@happyvertical/smrt-app-cli 0.40.60 → 0.40.62

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
@@ -115,6 +115,11 @@ The package also ships the generic `smrt-mcp-bridge` binary. The remote app
115
115
  surface is typically mounted with
116
116
  [`@happyvertical/smrt-app-mcp`](../smrt-app-mcp/README.md).
117
117
 
118
+ The bridge canonicalizes its `tools/list` catalog by tool name and emits a
119
+ one-day `private` cache lifetime. The catalog is tied to the configured local
120
+ app credentials, so it never opts into shared caching even when an upstream
121
+ app serves public tools.
122
+
118
123
  ## Configuration and authentication
119
124
 
120
125
  - `name` supplies the display name and default environment-variable prefix.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { p as runMcpStdioBridge } from "../config-BKGZTlBc.js";
2
+ import { p as runMcpStdioBridge } from "../config-B6arU8x7.js";
3
3
  //#region src/bin/smrt-mcp-bridge.ts
4
4
  /**
5
5
  * `smrt-mcp-bridge` — generic stdio MCP bridge.
@@ -0,0 +1,2 @@
1
+ import { p as runMcpStdioBridge } from "./config-B6arU8x7.js";
2
+ export { runMcpStdioBridge };
@@ -28,6 +28,13 @@ import { StdioServerTransport, serveStdio } from "@modelcontextprotocol/server/s
28
28
  *
29
29
  * @packageDocumentation
30
30
  */
31
+ var PRIVATE_TOOL_LIST_CACHE_HINT = {
32
+ ttlMs: 864e5,
33
+ cacheScope: "private"
34
+ };
35
+ function compareToolNames(left, right) {
36
+ return left < right ? -1 : left > right ? 1 : 0;
37
+ }
31
38
  /**
32
39
  * Wire up the stdio server. Use `runMcpStdioBridge` for a one-call entry
33
40
  * point in `bin/` scripts; this lower-level form is exposed for tests.
@@ -35,11 +42,19 @@ import { StdioServerTransport, serveStdio } from "@modelcontextprotocol/server/s
35
42
  function createMcpStdioBridge(options) {
36
43
  const toolsPath = options.toolsPath ?? "/api/mcp/tools";
37
44
  const callPath = options.callPath ?? "/api/mcp/call";
38
- const server = new Server(options.serverInfo, { capabilities: { tools: {} } });
45
+ const server = new Server(options.serverInfo, {
46
+ capabilities: { tools: {} },
47
+ cacheHints: { "tools/list": PRIVATE_TOOL_LIST_CACHE_HINT }
48
+ });
39
49
  server.setRequestHandler("tools/list", async (_request) => {
40
50
  const outcome = await requestJsonResult(options, toolsPath, { method: "GET" }, { fetch: options.fetch });
41
51
  if (!outcome.ok) throw toMcpTransportError(outcome.error);
42
- return withMcpMetadata(outcome.result, outcome.metadata);
52
+ const result = withMcpMetadata(outcome.result, outcome.metadata);
53
+ return {
54
+ ...result,
55
+ tools: [...result.tools].sort((left, right) => compareToolNames(left.name, right.name)),
56
+ ...PRIVATE_TOOL_LIST_CACHE_HINT
57
+ };
43
58
  });
44
59
  server.setRequestHandler("tools/call", async (request) => {
45
60
  const { name, arguments: args = {} } = request.params;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as loadCliConfig, c as requestJsonResult, d as createMcpStdioBridge, i as getStoredToken, l as saveAuth, n as clearStoredToken, o as redactTransportValue, p as runMcpStdioBridge, r as getServerUrl, s as requestJson, t as AppCliRequestError, u as saveCliConfig } from "./config-BKGZTlBc.js";
1
+ import { a as loadCliConfig, c as requestJsonResult, d as createMcpStdioBridge, i as getStoredToken, l as saveAuth, n as clearStoredToken, o as redactTransportValue, p as runMcpStdioBridge, r as getServerUrl, s as requestJson, t as AppCliRequestError, u as saveCliConfig } from "./config-B6arU8x7.js";
2
2
  import { SMRT_MCP_RESULT_METADATA_KEY, validateDiscoveryConformanceArtifact } from "@happyvertical/smrt-users/app-contract";
3
3
  import { spawn, spawnSync } from "node:child_process";
4
4
  //#region src/discovery.ts
@@ -873,7 +873,7 @@ function createAppCli(options) {
873
873
  return {
874
874
  run: (argv) => runCli(context, options, extraByName, argv),
875
875
  startMcpBridge: async (serverInfo) => {
876
- const { runMcpStdioBridge } = await import("./bridge-DpPDVLGq.js");
876
+ const { runMcpStdioBridge } = await import("./bridge-DqndDLee.js");
877
877
  await runMcpStdioBridge({
878
878
  ...context,
879
879
  serverInfo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-app-cli",
3
- "version": "0.40.60",
3
+ "version": "0.40.62",
4
4
  "description": "Reusable CLI factory for SMRT apps — branded `<name> <resource> <command>` CLI + stdio MCP bridge with decorator-driven resource discovery",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@modelcontextprotocol/server": "2.0.0",
24
- "@happyvertical/smrt-users": "0.40.60"
24
+ "@happyvertical/smrt-users": "0.40.62"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@modelcontextprotocol/client": "2.0.0",
@@ -30,7 +30,7 @@
30
30
  "vite": "8.1.4",
31
31
  "vite-plugin-dts": "4.5.4",
32
32
  "vitest": "4.1.10",
33
- "@happyvertical/smrt-core": "0.40.60"
33
+ "@happyvertical/smrt-core": "0.40.62"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=24.18.0"
@@ -1,2 +0,0 @@
1
- import { p as runMcpStdioBridge } from "./config-BKGZTlBc.js";
2
- export { runMcpStdioBridge };