@suluk/platform 0.1.5 → 0.1.6
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 +1 -1
- package/src/catalog.ts +2 -0
- package/test/plan.test.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suluk/platform",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "The platform generator (C051): write one `definePlatform` manifest → it plans the shadcn-registry adds, generates the wired Hono entry, and merges each module's provision fragment into a single provision.config. The manifest compiles to a shadcn-add list + a C047 provision.config; the generator runs the adds + `@suluk/provision`. Turns the Suluk backend registry into a one-command platform. CANDIDATE tooling.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
package/src/catalog.ts
CHANGED
|
@@ -24,6 +24,8 @@ export const CATALOG: Record<string, CatalogEntry> = {
|
|
|
24
24
|
// the contract is a MIDDLEWARE mount: it installs the scope gate (enforceApiKeyScope) + GET /api/openapi.json. Place it
|
|
25
25
|
// after `auth` in the manifest so the gate runs after identity/apiKeyAuth set keyId/scopes. Derived + stateless.
|
|
26
26
|
contract: { mount: { kind: "middleware", symbol: "mountContract", from: "./routes/contract" } },
|
|
27
|
+
// the API-as-MCP server + OAuth discovery + connections — a middleware mount (registers /api/mcp + /.well-known/*).
|
|
28
|
+
mcp: { mount: { kind: "middleware", symbol: "mountMcp", from: "./routes/mcp" }, provision: { symbol: "mcpProvision", from: "./src/provision/mcp" } },
|
|
27
29
|
// feature routes mount under /api/* — where the caller-resolution + cors + rate-limit middleware live (toolfactory parity).
|
|
28
30
|
credits: { mount: { kind: "route", path: "/api/credits", symbol: "creditsRoutes", from: "./routes/credits" }, provision: { symbol: "creditsProvision", from: "./src/provision/credits" } },
|
|
29
31
|
keys: { mount: { kind: "route", path: "/api/keys", symbol: "keysRoutes", from: "./routes/keys" }, provision: { symbol: "keysProvision", from: "./src/provision/keys" } },
|
package/test/plan.test.ts
CHANGED
|
@@ -101,6 +101,14 @@ describe("cost (route + provision) + dev modules (journeys/audit — files only)
|
|
|
101
101
|
expect(p.provisionConfig).not.toContain("adminProvision");
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
+
test("mcp is a middleware mount (server + discovery + connections) with a provision fragment", () => {
|
|
105
|
+
const p = planPlatform(definePlatform({ name: "m", registry: "acme/reg", services: ["auth", "contract", "mcp", "credits"] }));
|
|
106
|
+
expect(p.entry).toContain('import { mountMcp } from "./routes/mcp";');
|
|
107
|
+
expect(p.entry).toContain("mountMcp(app);");
|
|
108
|
+
expect(p.entry).not.toContain('app.route("/api/mcp"'); // it's a mount, not a route
|
|
109
|
+
expect(p.provisionConfig).toContain("mcpProvision");
|
|
110
|
+
});
|
|
111
|
+
|
|
104
112
|
test("dev modules add shadcn refs but NO entry mount and NO provision fragment", () => {
|
|
105
113
|
expect(plan.adds).toContain("acme/reg/journeys");
|
|
106
114
|
expect(plan.adds).toContain("acme/reg/audit");
|