@happyvertical/smrt-app-mcp 0.60.18 → 0.61.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 +12 -0
- package/README.md +40 -0
- package/agents/runtime-loading.md +21 -0
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/audit-store.d.ts +53 -0
- package/dist/audit-store.d.ts.map +1 -0
- package/dist/audit-store.js +149 -0
- package/dist/audit-store.js.map +1 -0
- package/dist/audit.d.ts +59 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/chunks/{protocol-BRQji5k_.js → defaults-i3kpRFpB.js} +190 -149
- package/dist/chunks/defaults-i3kpRFpB.js.map +1 -0
- package/dist/chunks/{errors-XG_zn1pP.js → errors-C704k8Mv.js} +3 -2
- package/dist/chunks/errors-C704k8Mv.js.map +1 -0
- package/dist/chunks/protocol-D_O2WaCO.js +153 -0
- package/dist/chunks/protocol-D_O2WaCO.js.map +1 -0
- package/dist/errors.d.ts +2 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/host-operations.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +435 -3
- package/dist/server.d.ts +39 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +174 -8
- package/dist/smrt-knowledge.okf.md +17 -4
- package/dist/sveltekit.d.ts +1 -1
- package/dist/sveltekit.d.ts.map +1 -1
- package/dist/sveltekit.js +4 -3
- package/dist/sveltekit.js.map +1 -1
- package/dist/workflow-tools.d.ts +14 -0
- package/dist/workflow-tools.d.ts.map +1 -1
- package/package.json +14 -6
- package/dist/chunks/errors-XG_zn1pP.js.map +0 -1
- package/dist/chunks/protocol-BRQji5k_.js.map +0 -1
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,23 +3,28 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-app-mcp",
|
|
6
|
-
"packageVersion": "0.
|
|
6
|
+
"packageVersion": "0.61.1",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
12
|
-
"agents": "
|
|
10
|
+
"manifest": "558c0e35594c3c3ce8aa0970147b79ca21b70652c896c7b1b1dc3fb04fd5a846",
|
|
11
|
+
"packageJson": "c2808230887cba6edb2060515e6c1a4c7f43731a4ecae541005a2961d379d10b",
|
|
12
|
+
"agents": "5e63e85f8195c75e270ac29a3b45fb61633d02e56ae15a251d16e1eb6ec2b002",
|
|
13
|
+
"moduleDoc:agents/runtime-loading.md": "4fe25501e5066a0b0f8c26409ce419029965ccad26f2c6e976070f85145900b4"
|
|
13
14
|
},
|
|
14
15
|
"exports": [
|
|
15
16
|
".",
|
|
17
|
+
"./audit-store",
|
|
16
18
|
"./auth",
|
|
17
19
|
"./host-operations",
|
|
20
|
+
"./manifest",
|
|
21
|
+
"./manifest.json",
|
|
18
22
|
"./sveltekit"
|
|
19
23
|
],
|
|
20
24
|
"dependencies": {
|
|
21
25
|
"@happyvertical/smrt-core": "workspace:*",
|
|
22
26
|
"@happyvertical/smrt-jobs": "workspace:*",
|
|
27
|
+
"@happyvertical/smrt-tenancy": "workspace:*",
|
|
23
28
|
"@happyvertical/sql": "catalog:",
|
|
24
29
|
"@modelcontextprotocol/server": "2.4.0",
|
|
25
30
|
"jose": "^6.2.12",
|
|
@@ -34,7 +39,8 @@
|
|
|
34
39
|
},
|
|
35
40
|
"smrtDependencies": [
|
|
36
41
|
"@happyvertical/smrt-core",
|
|
37
|
-
"@happyvertical/smrt-jobs"
|
|
42
|
+
"@happyvertical/smrt-jobs",
|
|
43
|
+
"@happyvertical/smrt-tenancy"
|
|
38
44
|
],
|
|
39
45
|
"sdkDependencies": [
|
|
40
46
|
"@happyvertical/sql"
|
|
@@ -49,7 +55,160 @@
|
|
|
49
55
|
"risks": [
|
|
50
56
|
"sensitive-fields-excluded"
|
|
51
57
|
],
|
|
52
|
-
"objects": [
|
|
58
|
+
"objects": [
|
|
59
|
+
{
|
|
60
|
+
"name": "McpCallAudit",
|
|
61
|
+
"qualifiedName": "@happyvertical/smrt-app-mcp:McpCallAudit",
|
|
62
|
+
"collection": "mcpcallaudits",
|
|
63
|
+
"description": "One persisted MCP tool call. Stores identity, tool, tenant, outcome and argument KEY names only: never argument values or response bodies.",
|
|
64
|
+
"tableName": "smrt_mcp_call_audits",
|
|
65
|
+
"packageName": "@happyvertical/smrt-app-mcp",
|
|
66
|
+
"extends": "SmrtObject",
|
|
67
|
+
"fields": [
|
|
68
|
+
{
|
|
69
|
+
"name": "tenantId",
|
|
70
|
+
"type": "text",
|
|
71
|
+
"required": false,
|
|
72
|
+
"columnType": "UUID"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "principalId",
|
|
76
|
+
"type": "text",
|
|
77
|
+
"required": false,
|
|
78
|
+
"columnType": "TEXT"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "principalKind",
|
|
82
|
+
"type": "text",
|
|
83
|
+
"required": false,
|
|
84
|
+
"columnType": "TEXT"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "identityIssuer",
|
|
88
|
+
"type": "text",
|
|
89
|
+
"required": false,
|
|
90
|
+
"columnType": "TEXT"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "identitySubject",
|
|
94
|
+
"type": "text",
|
|
95
|
+
"required": false,
|
|
96
|
+
"columnType": "TEXT"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "identityClientId",
|
|
100
|
+
"type": "text",
|
|
101
|
+
"required": false,
|
|
102
|
+
"columnType": "TEXT"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "tool",
|
|
106
|
+
"type": "text",
|
|
107
|
+
"required": true,
|
|
108
|
+
"columnType": "TEXT",
|
|
109
|
+
"default": ""
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "outcome",
|
|
113
|
+
"type": "text",
|
|
114
|
+
"required": true,
|
|
115
|
+
"columnType": "TEXT",
|
|
116
|
+
"default": "allowed"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "errorCode",
|
|
120
|
+
"type": "text",
|
|
121
|
+
"required": false,
|
|
122
|
+
"columnType": "TEXT"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "argumentKeys",
|
|
126
|
+
"type": "json",
|
|
127
|
+
"required": false,
|
|
128
|
+
"columnType": "JSON"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "occurredAt",
|
|
132
|
+
"type": "datetime",
|
|
133
|
+
"required": true,
|
|
134
|
+
"columnType": "TIMESTAMP"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"relationships": [],
|
|
138
|
+
"methods": [],
|
|
139
|
+
"tenant": {
|
|
140
|
+
"scoped": true,
|
|
141
|
+
"mode": "optional",
|
|
142
|
+
"field": "tenantId"
|
|
143
|
+
},
|
|
144
|
+
"conflictColumns": [
|
|
145
|
+
"tenant_id",
|
|
146
|
+
"slug",
|
|
147
|
+
"context"
|
|
148
|
+
],
|
|
149
|
+
"surfaces": [],
|
|
150
|
+
"relationshipFeatures": [
|
|
151
|
+
"uuidColumns"
|
|
152
|
+
],
|
|
153
|
+
"tags": [],
|
|
154
|
+
"risks": []
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "McpCallAuditCollection",
|
|
158
|
+
"qualifiedName": "@happyvertical/smrt-app-mcp:McpCallAuditCollection",
|
|
159
|
+
"collection": "mcpcallaudits",
|
|
160
|
+
"description": "Tenant-aware persistence and queries for McpCallAudit.",
|
|
161
|
+
"tableName": "smrt_mcp_call_audits",
|
|
162
|
+
"packageName": "@happyvertical/smrt-app-mcp",
|
|
163
|
+
"extends": "SmrtCollection",
|
|
164
|
+
"fields": [],
|
|
165
|
+
"relationships": [],
|
|
166
|
+
"methods": [
|
|
167
|
+
"append",
|
|
168
|
+
"listAudits"
|
|
169
|
+
],
|
|
170
|
+
"methodSignatures": [
|
|
171
|
+
{
|
|
172
|
+
"name": "append",
|
|
173
|
+
"async": true,
|
|
174
|
+
"params": [
|
|
175
|
+
"record: McpAuditRecord"
|
|
176
|
+
],
|
|
177
|
+
"returns": "Promise<McpCallAudit>"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "listAudits",
|
|
181
|
+
"async": true,
|
|
182
|
+
"params": [
|
|
183
|
+
"query: any"
|
|
184
|
+
],
|
|
185
|
+
"returns": "any"
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"surfaces": [],
|
|
189
|
+
"withheldSurfaces": [
|
|
190
|
+
{
|
|
191
|
+
"kind": "api",
|
|
192
|
+
"operation": "append",
|
|
193
|
+
"code": "api-disabled",
|
|
194
|
+
"reason": "api is disabled",
|
|
195
|
+
"objectName": "@happyvertical/smrt-app-mcp:McpCallAuditCollection"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"kind": "api",
|
|
199
|
+
"operation": "listAudits",
|
|
200
|
+
"code": "api-disabled",
|
|
201
|
+
"reason": "api is disabled",
|
|
202
|
+
"objectName": "@happyvertical/smrt-app-mcp:McpCallAuditCollection"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"relationshipFeatures": [
|
|
206
|
+
"uuidColumns"
|
|
207
|
+
],
|
|
208
|
+
"tags": [],
|
|
209
|
+
"risks": []
|
|
210
|
+
}
|
|
211
|
+
],
|
|
53
212
|
"surfaces": [],
|
|
54
213
|
"prompts": [],
|
|
55
214
|
"relationshipsV2": {
|
|
@@ -58,7 +217,14 @@
|
|
|
58
217
|
"junctionCollections": 0,
|
|
59
218
|
"hierarchicalObjects": 0,
|
|
60
219
|
"polymorphicAssociations": 0,
|
|
61
|
-
"uuidColumns":
|
|
220
|
+
"uuidColumns": 4
|
|
62
221
|
},
|
|
63
|
-
"agentDoc": "# @happyvertical/smrt-app-mcp\n\nApplication-scoped MCP server wrapper for SMRT apps. The core owns generated\ntool policy; `./sveltekit` owns the stateless Streamable HTTP transport.\n\n## Purpose\n\n- Wraps `@happyvertical/smrt-core` MCP generation with app-level tool allow-lists.\n- Filters unauthenticated tool visibility to public read-only tools.\n- Applies an optional principal-aware policy consistently to discovery and calls.\n- Provides workflow assertions so app servers can reject unsafe or incomplete tool calls before dispatch.\n- Exposes an opt-in durable Tasks extension through `@happyvertical/smrt-jobs`.\n\n## Patterns\n\n- Generate tools from core scoped to the allow-list (`MCPConfig.classNames`),\n then filter by allowed class names: a duplicate tool name among registered\n classes the app never publishes must not fail its catalog or calls (#3490).\n `mountMcpAppRoute`/`createDefaultMcpAppServer` resolve each model\n constructor to its registry-qualified name, so a same-named class elsewhere\n never collides; a raw simple name two classes share fails closed.\n- Treat list/get tools as read-only; mutating tools require authentication unless the app deliberately wraps them with stronger policy.\n- Keep app policy outside generated tool schemas. The wrapper owns auth, allow-list, and workflow assertion behavior.\n- Return 404 for tools outside the app allow-list so private generated tools are not enumerated by mistake.\n- Trust only a principal supplied by the application adapter. This package\n does not implement an OAuth authorization server. The opt-in `./auth` entry\n validates JWT access tokens and requires an application-owned principal mapper.\n- Mount `mountMcpRoute` as one modern `POST` endpoint. It creates a fresh\n protocol server per request, emits no session id, and refuses subscriptions.\n- `mountMcpAppRoute` (`src/defaults.ts` + `./sveltekit`) is the one-call app\n route: explicit `models` allow-list, required `requiredScopes`, principal from\n session locals (`principalFromSessionLocals`). App policies compose with the\n default and may only narrow it. Its `Origin` check (default on; opt-in on\n `mountMcpRoute`) runs before auth and dispatch; no-`Origin` clients pass.\n `effects` filters the catalog by `mcpToolEffect` (excluded tools 404).\n `auth` swaps in bearer principals; `bindPrincipal` runs their dispatch in\n the app's principal context (RLS transaction), failing closed, and\n authorizes with the binder's narrowed (live) scopes; task lifecycle calls\n re-check the originating action against the allow-list and `effects`,\n after a principal-level `taskPrincipalPolicy` (defaults: scope policy);\n `mountMcpProtectedResourceMetadataRoute` serves only the advertised path.\n- `runtime` (structural `McpAppRouteRuntime`; no app-runtime dependency)\n derives `smrtOptions`, `bindPrincipal` and `auth` on both mounts, the\n profile resolved per request after the origin check (adapters memoized per\n runtime × profile). Fail closed: missing bindings throw at mount; an\n unresolvable profile or missing hosted config rejects (500), never serves\n without the bearer adapter. Explicit options override; keep both forms\n byte-identical (`runtime-route.test.ts`). `./auth` loads lazily from\n `./sveltekit`.\n- `createHostedMcpResourceAuth({ profile, runtime })`: locally, a runtime\n `verifyLocalMcpToken` yields the `sessionFallback` adapter\n (`createLocalMcpTokenAuth`): no `Authorization` header keeps the session\n principal; a presented bearer must verify (401, never cookie fallback); no\n metadata (404). Hosted, `runtime.resolveMcpPrincipal` is the default\n identity mapping; an explicit `resolvePrincipal` overrides it.\n- Adapters stamp `principal.tenantBinding` for `bindPrincipal`: the local\n token adapter always `direct`; the JWT adapter the mapping's value or\n `direct-or-inherited`. Never derive it from request input. Both adapters\n read principals/mappings from own data only (`own-data.ts`): inherited\n values, accessors and poison keys deny.\n- Keep tool catalogs private by default. Public caching requires an explicit\n attestation and a global, unauthenticated, read-only, non-tenant catalog with\n no principal-aware policy.\n\n- Host operations (`./host-operations`, browser-safe) are authored once and\n projected by `toMcpWorkflowTool`/`toWebMcpSpec`. `onToolCall` audits every\n call once; its principal/identity come from the adapter, and a failing hook\n never alters a result. Only `McpToolError`/`mapError` output reaches agents.\n Details: README \"Host operations, audit and typed errors\".\n\n## Gotchas\n\n- Public tool patterns are still constrained by read-only detection.\n- Policy errors fail closed and expose only the shared safe denial envelope.\n- Workflow assertions run before generated tool dispatch and should be deterministic.\n- Tasks require a stable authenticated principal id, preserve its tenant boundary,\n and require the deployment to run a `TaskRunner` for the `mcp-tasks` queue.\n- This package ships no stdio executable. Use `@happyvertical/smrt-app-cli` to\n bridge a deployed app endpoint to a local MCP client.\n- `mountMcpToolsRoute` and `mountMcpCallRoute` are deprecated REST-shaped\n compatibility aliases, not MCP transports.\n- This package is runtime app infrastructure, not the development MCP. Use `@happyvertical/smrt-dev-mcp` for agentic development knowledge, review, and architecture tooling.\n"
|
|
222
|
+
"agentDoc": "# @happyvertical/smrt-app-mcp\n\nApplication-scoped MCP server wrapper for SMRT apps. The core owns generated\ntool policy; `./sveltekit` owns the stateless Streamable HTTP transport.\n\n## Purpose\n\n- Wraps `@happyvertical/smrt-core` MCP generation with app-level tool allow-lists.\n- Filters unauthenticated tool visibility to public read-only tools.\n- Applies an optional principal-aware policy consistently to discovery and calls.\n- Provides workflow assertions so app servers can reject unsafe or incomplete tool calls before dispatch.\n- Exposes an opt-in durable Tasks extension through `@happyvertical/smrt-jobs`.\n\n## Patterns\n\n- Scopes, confirm and audit are server options (`toolScopes`, workflow\n `requiredScopes`/`requiresConfirm`, `confirmTools`, `auditSink`,\n `auditTenantId`). The scope check lives inside `passesToolPolicy` so tools and\n resources share it and an anonymous caller never passes a scoped tool; the\n confirm gate runs in `authorizeCall` before assertions and handlers and\n answers as an `isError` result (`confirm_required`, audited `denied`). Audit\n records hold argument KEY names only. `audit.ts` is model-free; the\n `@smrt()` `McpCallAudit` model lives only behind the `./audit-store` subpath\n (smrt#4957), never in the main entry.\n\n- Generate tools from core scoped to the allow-list (`MCPConfig.classNames`),\n then filter by allowed class names: a duplicate tool name among registered\n classes the app never publishes must not fail its catalog or calls (#3490).\n `mountMcpAppRoute`/`createDefaultMcpAppServer` resolve each model\n constructor to its registry-qualified name, so a same-named class elsewhere\n never collides; a raw simple name two classes share fails closed.\n- Treat list/get tools as read-only; mutating tools require authentication unless the app deliberately wraps them with stronger policy.\n- Keep app policy outside generated tool schemas. The wrapper owns auth, allow-list, and workflow assertion behavior.\n- Return 404 for tools outside the app allow-list so private generated tools are not enumerated by mistake.\n- Trust only a principal supplied by the application adapter. This package\n does not implement an OAuth authorization server. The opt-in `./auth` entry\n validates JWT access tokens and requires an application-owned principal mapper.\n- Mount `mountMcpRoute` as one modern `POST` endpoint. It creates a fresh\n protocol server per request, emits no session id, and refuses subscriptions.\n- `mountMcpAppRoute` (`src/defaults.ts` + `./sveltekit`) is the one-call app\n route: explicit `models` allow-list, required `requiredScopes`, principal from\n session locals (`principalFromSessionLocals`). App policies compose with the\n default and may only narrow it. Its `Origin` check (default on; opt-in on\n `mountMcpRoute`) runs before auth and dispatch; no-`Origin` clients pass.\n `effects` filters the catalog by `mcpToolEffect` (excluded tools 404).\n `auth` swaps in bearer principals; `bindPrincipal` runs their dispatch in\n the app's principal context (RLS transaction), failing closed, and\n authorizes with the binder's narrowed (live) scopes; task lifecycle calls\n re-check the originating action against the allow-list and `effects`,\n after a principal-level `taskPrincipalPolicy` (defaults: scope policy);\n `mountMcpProtectedResourceMetadataRoute` serves only the advertised path.\n- `runtime` (structural `McpAppRouteRuntime`; no app-runtime dependency)\n derives `smrtOptions`, `bindPrincipal` and `auth` on both mounts, the\n profile resolved per request after the origin check (adapters memoized per\n runtime × profile). Fail closed: missing bindings throw at mount; an\n unresolvable profile or missing hosted config rejects (500), never serves\n without the bearer adapter. Explicit options override; keep both forms\n byte-identical (`runtime-route.test.ts`). `./auth` loads lazily from\n `./sveltekit`.\n- `createHostedMcpResourceAuth({ profile, runtime })`: locally, a runtime\n `verifyLocalMcpToken` yields the `sessionFallback` adapter\n (`createLocalMcpTokenAuth`): no `Authorization` header keeps the session\n principal; a presented bearer must verify (401, never cookie fallback); no\n metadata (404). Hosted, `runtime.resolveMcpPrincipal` is the default\n identity mapping; an explicit `resolvePrincipal` overrides it.\n- Adapters stamp `principal.tenantBinding` for `bindPrincipal`: the local\n token adapter always `direct`; the JWT adapter the mapping's value or\n `direct-or-inherited`. Never derive it from request input. Both adapters\n read principals/mappings from own data only (`own-data.ts`): inherited\n values, accessors and poison keys deny.\n- Keep tool catalogs private by default. Public caching requires an explicit\n attestation and a global, unauthenticated, read-only, non-tenant catalog with\n no principal-aware policy.\n\n- Host operations (`./host-operations`, browser-safe) are authored once and\n projected by `toMcpWorkflowTool`/`toWebMcpSpec`. `onToolCall` audits every\n call once; its principal/identity come from the adapter, and a failing hook\n never alters a result. Only `McpToolError`/`mapError` output reaches agents.\n Details: README \"Host operations, audit and typed errors\".\n\n## Gotchas\n\n- Public tool patterns are still constrained by read-only detection.\n- Policy errors fail closed and expose only the shared safe denial envelope.\n- Workflow assertions run before generated tool dispatch and should be deterministic.\n- Tasks require a stable authenticated principal id, preserve its tenant boundary,\n and require the deployment to run a `TaskRunner` for the `mcp-tasks` queue.\n- This package ships no stdio executable. Use `@happyvertical/smrt-app-cli` to\n bridge a deployed app endpoint to a local MCP client.\n- `mountMcpToolsRoute` and `mountMcpCallRoute` are deprecated REST-shaped\n compatibility aliases, not MCP transports.\n- This package is runtime app infrastructure, not the development MCP. Use `@happyvertical/smrt-dev-mcp` for agentic development knowledge, review, and architecture tooling.\n\nHTTP transport loading: [agents/runtime-loading.md](agents/runtime-loading.md).\n",
|
|
223
|
+
"moduleDocs": [
|
|
224
|
+
{
|
|
225
|
+
"path": "agents/runtime-loading.md",
|
|
226
|
+
"module": "runtime-loading",
|
|
227
|
+
"content": "# HTTP transport loading\n\nThe `sveltekit` entry imports the MCP SDK and its protocol adapter at the existing\nasync request dispatch boundary. Task interception loads the same SDK classifier\nand the same protocol extension constant only when a task envelope needs them.\nRoute construction, runtime-binding validation and `.server` remain synchronous;\npublic `createMcpProtocolServer` remains synchronous on its existing entry.\nOrigin/auth checks still precede dispatch and an SDK load failure still rejects\nwith its original cause at first use. No auth or task policy is duplicated.\n\nThe fresh-Node published-entry regression refuses SDK resolution, mounts the\nroute, proves a cross-origin denial still returns 403, then proves an eligible\nrequest gets that exact SDK load error. It fails against the eager build. The\nfull package suite retains the SDK wire, effects, actor × tenant, binding,\nextension, async Tasks and revision/header refusal tests (359 tests including the startup guard). Runtime: Node 26, existing SQLite/injected executors;\nno persistence, transaction or dialect behavior changes.\n\nReuse inspection: MCP package review, intent index and searches for\n`mountMcpAppRoute`, `createMcpHandler`, SDK imports, `maybeHandleTaskRequest` and\nprotocol request factories found these existing seams. Only their import timing\nchanges; no new production component, helper, model, route or type is added.\n"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
64
230
|
}
|
|
@@ -5,10 +5,10 @@ description: "App-runtime MCP server scaffolding for SMRT apps — `createMcpApp
|
|
|
5
5
|
status: "stable"
|
|
6
6
|
generated:
|
|
7
7
|
by: "smrt/scripts/generate-knowledge-okf.ts"
|
|
8
|
-
at: "2026-11-
|
|
8
|
+
at: "2026-11-14T04:34:16Z"
|
|
9
9
|
audience: "internal"
|
|
10
|
-
evidence_level: "
|
|
11
|
-
source_revision: "sha256:
|
|
10
|
+
evidence_level: "source-inspected"
|
|
11
|
+
source_revision: "sha256:047333aa474fb44103e7f1c112302cdb7ea12ba8734971aca43876e7e0d4b927"
|
|
12
12
|
sources:
|
|
13
13
|
- id: "manifest"
|
|
14
14
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/smrt-app-mcp/package.json"
|
|
@@ -16,6 +16,9 @@ sources:
|
|
|
16
16
|
- id: "agents"
|
|
17
17
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/smrt-app-mcp/AGENTS.md"
|
|
18
18
|
title: "@happyvertical/smrt-app-mcp packages/smrt-app-mcp/AGENTS.md"
|
|
19
|
+
- id: "agents-2"
|
|
20
|
+
resource: "https://github.com/happyvertical/smrt/blob/main/packages/smrt-app-mcp/agents/runtime-loading.md"
|
|
21
|
+
title: "@happyvertical/smrt-app-mcp packages/smrt-app-mcp/agents/runtime-loading.md"
|
|
19
22
|
---
|
|
20
23
|
|
|
21
24
|
# @happyvertical/smrt-app-mcp
|
|
@@ -25,16 +28,18 @@ sources:
|
|
|
25
28
|
- Directory: `packages/smrt-app-mcp`
|
|
26
29
|
- Private: no
|
|
27
30
|
- Object source: `domain-artifact`
|
|
28
|
-
- Evidence level: `
|
|
31
|
+
- Evidence level: `source-inspected`
|
|
29
32
|
|
|
30
33
|
## Documentation
|
|
31
34
|
|
|
32
35
|
- `packages/smrt-app-mcp/AGENTS.md`
|
|
36
|
+
- `packages/smrt-app-mcp/agents/runtime-loading.md`
|
|
33
37
|
|
|
34
38
|
## Framework dependencies
|
|
35
39
|
|
|
36
40
|
- [smrt-core](/components/smrt-core.md)
|
|
37
41
|
- [smrt-jobs](/components/smrt-jobs.md)
|
|
42
|
+
- [smrt-tenancy](/components/smrt-tenancy.md)
|
|
38
43
|
|
|
39
44
|
## SDK dependencies
|
|
40
45
|
|
|
@@ -43,6 +48,14 @@ sources:
|
|
|
43
48
|
## Exports
|
|
44
49
|
|
|
45
50
|
- `.`
|
|
51
|
+
- `./audit-store`
|
|
46
52
|
- `./auth`
|
|
47
53
|
- `./host-operations`
|
|
54
|
+
- `./manifest`
|
|
55
|
+
- `./manifest.json`
|
|
48
56
|
- `./sveltekit`
|
|
57
|
+
|
|
58
|
+
## Models
|
|
59
|
+
|
|
60
|
+
- `McpCallAudit` (collection `mcpcallaudits`, extends `SmrtObject`)
|
|
61
|
+
- `McpCallAuditCollection` (collection `mcpcallaudits`, extends `SmrtCollection`)
|
package/dist/sveltekit.d.ts
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import type { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
31
31
|
import type { McpDeploymentProfile, McpLocalTokenPrincipal, McpPrincipalMapping, McpResourceAuth, McpVerifiedIdentity } from './auth.js';
|
|
32
32
|
import { type CreateDefaultMcpAppServerOptions } from './defaults.js';
|
|
33
|
-
import {
|
|
33
|
+
import type { McpProtocolRequestOptions } from './protocol.js';
|
|
34
34
|
import type { McpAppPrincipal, McpAppServer, McpSmrtOptionsThunk } from './server.js';
|
|
35
35
|
/** Minimal subset of a SvelteKit RequestEvent we actually touch. */
|
|
36
36
|
type SvelteKitRequestEvent = {
|
package/dist/sveltekit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sveltekit.d.ts","sourceRoot":"","sources":["../src/sveltekit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"sveltekit.d.ts","sourceRoot":"","sources":["../src/sveltekit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,gCAAgC,EAEtC,MAAM,eAAe,CAAC;AAOvB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACZ,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,oEAAoE;AACpE,KAAK,qBAAqB,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAChC,KAAK,EAAE,qBAAqB,KACzB,OAAO,CAAC,QAAQ,CAAC,CAAC;AAQvB,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CACjC,KAAK,EAAE,qBAAqB,KACzB,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;AAExC,6EAA6E;AAC7E,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAwCnD;;;;GAIG;AACH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E,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/sveltekit.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import {
|
|
1
|
+
import { n as createDefaultMcpAppServer } from "./chunks/defaults-i3kpRFpB.js";
|
|
2
|
+
import { i as MCP_TOOL_ACCESS_DENIED_CODE, r as MCP_ORIGIN_DENIED_CODE, s as McpAccessError } from "./chunks/errors-C704k8Mv.js";
|
|
3
3
|
import { t as stampVerifiedIdentity } from "./chunks/identity-BNzyRsWf.js";
|
|
4
|
-
import { classifyInboundRequest, createMcpHandler, isJsonContentType } from "@modelcontextprotocol/server";
|
|
5
4
|
//#region src/sveltekit.ts
|
|
6
5
|
var defaultResolvePrincipal = (event) => event.locals?.user ?? null;
|
|
7
6
|
function resolveRequestPrincipal(event, options) {
|
|
@@ -198,6 +197,7 @@ function mountMcpRouteWith(server, options, resolveAuth) {
|
|
|
198
197
|
async function dispatch(event, resolved) {
|
|
199
198
|
const taskResponse = await maybeHandleTaskRequest(server, resolved.principal, event.request);
|
|
200
199
|
if (taskResponse) return taskResponse;
|
|
200
|
+
const [{ createMcpHandler }, { createMcpProtocolServerForRequest }] = await Promise.all([import("@modelcontextprotocol/server"), import("./chunks/protocol-D_O2WaCO.js").then((n) => n.r)]);
|
|
201
201
|
return createMcpHandler(() => createMcpProtocolServerForRequest(protocolServerForRequest(server, resolved), {
|
|
202
202
|
principal: resolved.principal,
|
|
203
203
|
extensions: options.extensions
|
|
@@ -280,6 +280,7 @@ async function maybeHandleTaskRequest(server, principal, request) {
|
|
|
280
280
|
"tasks/cancel"
|
|
281
281
|
].includes(body.method ?? "");
|
|
282
282
|
if (!taskTool && !taskMethod) return null;
|
|
283
|
+
const [{ isJsonContentType, classifyInboundRequest }, { MCP_TASKS_EXTENSION }] = await Promise.all([import("@modelcontextprotocol/server"), import("./chunks/protocol-D_O2WaCO.js").then((n) => n.r)]);
|
|
283
284
|
if (!isJsonContentType(request.headers.get("content-type"))) return null;
|
|
284
285
|
const classification = classifyInboundRequest({
|
|
285
286
|
httpMethod: request.method,
|