@teamscala/service-boot 0.23.448 → 0.23.449
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/package.json
CHANGED
|
@@ -41,13 +41,11 @@ describe("mountOrpcRouter generated-artifact seam", () => {
|
|
|
41
41
|
);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
test("the
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
// callers (sdk-mcp-forwarder) already handle: an absent gateway URL
|
|
50
|
-
// means "SDK tools unusable in this service".
|
|
44
|
+
test("the generic mount no longer injects a gateway URL — the executor derives its host from the registry", async () => {
|
|
45
|
+
// The retired MCP_GATEWAY_URL env name and its injector are gone: the
|
|
46
|
+
// sdk-mcp-forwarder resolves the SDK execution host from the
|
|
47
|
+
// mcp_server/scala-mcp registry row via loadRegistryConfig. A missing
|
|
48
|
+
// row refuses at the boundary (assertSdkHostResolved), never via env.
|
|
51
49
|
const service = await mkdtemp(join(tmpdir(), "mount-orpc-router-test-"));
|
|
52
50
|
tempDirs.push(service);
|
|
53
51
|
await mkdir(join(service, "prisma/generated/orpc/routers"), {
|
|
@@ -64,8 +62,9 @@ describe("mountOrpcRouter generated-artifact seam", () => {
|
|
|
64
62
|
process.chdir(service);
|
|
65
63
|
|
|
66
64
|
// Stub the collaborators the mount reaches BEFORE configureToolExecutor
|
|
67
|
-
// — the point is to capture the opts object and
|
|
68
|
-
|
|
65
|
+
// — the point is to capture the opts object and assert the injector is
|
|
66
|
+
// absent.
|
|
67
|
+
let seenKeys: Array<string> = [];
|
|
69
68
|
mock.module("@teamscala/orpc/app-router", () => ({
|
|
70
69
|
getAppRouter: async () => ({
|
|
71
70
|
healthz: { health: async () => ({ ok: true }) },
|
|
@@ -75,18 +74,14 @@ describe("mountOrpcRouter generated-artifact seam", () => {
|
|
|
75
74
|
getPrisma: () => ({}),
|
|
76
75
|
}));
|
|
77
76
|
mock.module("@teamscala/tool-executor/configure", () => ({
|
|
78
|
-
configure: (opts:
|
|
79
|
-
|
|
77
|
+
configure: (opts: Record<string, unknown>) => {
|
|
78
|
+
seenKeys = Object.keys(opts);
|
|
80
79
|
},
|
|
81
80
|
}));
|
|
82
81
|
|
|
83
82
|
const app = { post: () => {} };
|
|
84
83
|
await mountOrpcRouter(app as never, "scala-mcp");
|
|
85
84
|
|
|
86
|
-
expect(
|
|
87
|
-
// THE regression: invoking the getter must not throw.
|
|
88
|
-
expect(() => capture.getMcpGatewayUrl!()).not.toThrow();
|
|
89
|
-
// And it returns undefined — explicit, never a ReferenceError.
|
|
90
|
-
expect(capture.getMcpGatewayUrl!()).toBeUndefined();
|
|
85
|
+
expect(seenKeys).not.toContain("getMcpGatewayUrl");
|
|
91
86
|
});
|
|
92
87
|
});
|
package/src/mount-orpc-router.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { join } from "node:path";
|
|
13
13
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
14
14
|
import { registerFnRouters } from "./fn-routers/index.ts";
|
|
15
|
-
import type { InjectedDb8 } from "@teamscala/
|
|
15
|
+
import type { InjectedDb8 } from "@teamscala/db/db8-registry";
|
|
16
16
|
import type { Hono } from "hono";
|
|
17
17
|
import { bodyLimit } from "hono/body-limit";
|
|
18
18
|
|
|
@@ -86,6 +86,11 @@ export async function mountOrpcRouter(
|
|
|
86
86
|
connectionString: process.env.DATABASE_URL,
|
|
87
87
|
serviceName: serviceSlug,
|
|
88
88
|
})) as never;
|
|
89
|
+
// Register for db-core internals (registry loaders, raw fallbacks)
|
|
90
|
+
// routing v8-first via getDb8() — the same coexistence shape as
|
|
91
|
+
// the RPC context injection above.
|
|
92
|
+
const { registerDb8 } = await import("@teamscala/db/db8-registry");
|
|
93
|
+
registerDb8(db8 as never);
|
|
89
94
|
}
|
|
90
95
|
} catch (err) {
|
|
91
96
|
log.info(
|
|
@@ -122,14 +127,6 @@ export async function mountOrpcRouter(
|
|
|
122
127
|
configureToolExecutor({
|
|
123
128
|
getAppRouter: () => getAppRouter(),
|
|
124
129
|
getPrisma: () => getConfiguredPrisma(),
|
|
125
|
-
// Central MCP gateway URL — sdk:* tool calls from any non-host service
|
|
126
|
-
// forward here (scala-mcp owns every @teamscala/api-* adapter per
|
|
127
|
-
// operator ruling 2026-08-26). Returns undefined explicitly: callers
|
|
128
|
-
// (sdk-mcp-forwarder) treat absent as "SDK tool unusable in this
|
|
129
|
-
// service" and refuse with that message. The previous form read an
|
|
130
|
-
// out-of-scope `ctx` (c39d279) and would have thrown ReferenceError
|
|
131
|
-
// on first invoke instead of returning undefined.
|
|
132
|
-
getMcpGatewayUrl: () => undefined,
|
|
133
130
|
createHostCommandInvoker: (config) => createHostCommandInvoker(config as never),
|
|
134
131
|
getCallerContext: () => getCallerContext(),
|
|
135
132
|
decryptSecretConfig: (raw) => decryptSecretConfig(raw as never),
|