@happyvertical/smrt-cli 0.44.1 → 0.45.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/AGENTS.md CHANGED
@@ -96,16 +96,34 @@ then `dist/smrt-knowledge.json`. Model tools come from the artifact's `mcp`
96
96
  surfaces (REST/CLI entries are not agent-addressable tools and are excluded);
97
97
  intents and playbooks come from its `agentSurface`.
98
98
 
99
- **Known under-report, tracked as #2619:** the artifact's `mcp` surfaces come
100
- from `configuredSurfaces()` in core, which returns nothing when an object omits
101
- `mcp` config — while `MCPGenerator` treats an omitted config as full CRUD and
102
- also emits eligible public custom-method tools. Doctor therefore lists fewer
103
- model tools than the runtime exposes for such an object. The error is
104
- conservative (it never advertises a tool that does not exist), and the fix
105
- belongs to the shared surface projection rather than this report.
99
+ The artifact's `mcp` surfaces come from `configuredSurfaces()` in core, which
100
+ derives the projection from the same defaults `MCPGenerator` applies rather
101
+ than from the presence of an `mcp` config key (#2619): an omitted config is
102
+ full CRUD, not a closed surface, and eligible public custom-method tools are
103
+ included using the generator's own exhaustive-include rule.
106
104
  `renderAgentSurfaceReport(report)` returns the printed lines; both are exported
107
105
  so the shape is testable without running the command.
108
106
 
107
+ **Known live over-exposure for an STI class with a bare `true`/omitted
108
+ `mcp`/`cli` config, tracked as #2624:** the *scanner's* STI method merge in
109
+ `manifest-generator.ts` walks the full inheritance chain unconditionally, so
110
+ an STI class's `object.methods` already (incorrectly) contains its framework
111
+ base classes' own internal methods (`save`, `toJSON`, `withTransaction`,
112
+ `generateEmbeddings`, `destroy`, ...). This is not only a manifest
113
+ artifact concern: `ObjectRegistry.getAllMethods()`'s runtime chain walk
114
+ (`registry/inheritance-resolver.ts`) never actually filters it back out —
115
+ its `SmrtObject`/`SmrtClass`/`SmrtCollection` ancestor-skip only fires for a
116
+ chain entry literally named one of those three, and `getInheritanceChain()`
117
+ already stops *before* adding such an ancestor to the chain, so that name
118
+ never appears there to be skipped. The STI class itself is always the last
119
+ chain entry, contributing its own (already-polluted) `methods` map
120
+ unfiltered. So `CLIGenerator`/`MCPGenerator` genuinely register
121
+ `<object>:save`, `<object>:withTransaction`, etc. as real, callable
122
+ commands/tools **today, in a running application** — `configuredSurfaces()`
123
+ here is reporting a real exposed surface, not fabricating one. #2624 tracks
124
+ narrowing the scanner's STI method merge (or making the runtime skip
125
+ actually reachable).
126
+
109
127
  Sample output:
110
128
 
111
129
  ```text
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { readFileSync } from "node:fs";
3
3
  import { basename, dirname, join } from "node:path";
4
4
  import { createInterface } from "node:readline";
5
5
  import { fileURLToPath } from "node:url";
6
- import { ObjectRegistry, getPackageFromQualifiedName } from "@happyvertical/smrt-core";
6
+ import { ObjectRegistry, getPackageFromQualifiedName, isCrudOperation, isFrameworkBaseClass } from "@happyvertical/smrt-core";
7
7
  import { loadLocalTestManifestSync } from "@happyvertical/smrt-core/manifest";
8
8
  import { parseCliArgs } from "@happyvertical/utils";
9
9
  //#region src/discovery/manifest-identity.ts
@@ -575,6 +575,7 @@ var CLIGenerator = class {
575
575
  async generateObjectCommands(objectName, _classInfo) {
576
576
  const commands = [];
577
577
  const lowerName = objectName.toLowerCase();
578
+ if (isFrameworkBaseClass(objectName, _classInfo?.packageName)) return commands;
578
579
  const cliConfig = ObjectRegistry.getConfig(objectName).cli;
579
580
  if (cliConfig === false) return commands;
580
581
  const excluded = (typeof cliConfig === "object" ? cliConfig.exclude : []) || [];
@@ -706,16 +707,11 @@ var CLIGenerator = class {
706
707
  }
707
708
  });
708
709
  const methods = await ObjectRegistry.getAllMethods(objectName);
709
- const crudOperations = [
710
- "list",
711
- "get",
712
- "create",
713
- "update",
714
- "delete"
715
- ];
716
- const hasCustomMethodsInInclude = included?.some((item) => !crudOperations.includes(item));
710
+ const hasCustomMethodsInInclude = included?.some((item) => !isCrudOperation(item));
711
+ const reservedCommandNames = new Set(commands.flatMap((command) => [command.name, ...command.aliases ?? []]));
717
712
  for (const [methodName, methodDef] of methods) {
718
713
  const shouldIncludeMethod = () => {
714
+ if (reservedCommandNames.has(`${lowerName}:${methodName}`)) return false;
719
715
  if (!methodDef.isPublic) return false;
720
716
  if (excluded.includes(methodName)) return false;
721
717
  if (hasCustomMethodsInInclude && included && !included.includes(methodName)) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-cli",
3
- "version": "0.44.1",
3
+ "version": "0.45.1",
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-config": "0.44.1",
36
- "@happyvertical/smrt-agents": "0.44.1",
37
- "@happyvertical/smrt-dev-mcp": "0.44.1",
38
- "@happyvertical/smrt-playground": "0.44.1",
39
- "@happyvertical/smrt-types": "0.44.1",
40
- "@happyvertical/smrt-core": "0.44.1"
35
+ "@happyvertical/smrt-agents": "0.45.1",
36
+ "@happyvertical/smrt-config": "0.45.1",
37
+ "@happyvertical/smrt-dev-mcp": "0.45.1",
38
+ "@happyvertical/smrt-playground": "0.45.1",
39
+ "@happyvertical/smrt-types": "0.45.1",
40
+ "@happyvertical/smrt-core": "0.45.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "24.13.2",