@guren/core 1.19.0 → 1.20.0
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/dist/internal/deploy-build.d.ts +16 -39
- package/dist/internal/deploy-build.js +10 -38
- package/package.json +3 -3
|
@@ -136,7 +136,11 @@ declare const DOCUMENT_ASSET_EXTENSIONS: readonly ['htm', 'html', 'svg', 'xhtml'
|
|
|
136
136
|
* working while a directly opened URL downloads; `nosniff` stops browser promotion.
|
|
137
137
|
*/
|
|
138
138
|
declare const DOCUMENT_ASSET_HEADERS: Readonly<Record<string, string>>;
|
|
139
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* What a dev-only module is needed for, so a plugin can word its own message.
|
|
141
|
+
* `mcp` is the `@guren/cli` entry. Deploy plugins already on npm key their message
|
|
142
|
+
* tables on these values, so renaming one breaks their builds until core 2.0.
|
|
143
|
+
*/
|
|
140
144
|
type DevOnlyModuleKind = 'sqlite' | 'vite' | 'mcp' | 'sql-driver';
|
|
141
145
|
interface DevOnlyModule {
|
|
142
146
|
readonly specifier: string;
|
|
@@ -150,10 +154,8 @@ interface DevOnlyModule {
|
|
|
150
154
|
* The package source that reaches this module, repo-relative. An entry is here
|
|
151
155
|
* because one package imports it, so the module-graph check searches that package
|
|
152
156
|
* alone: a stale entry cannot be kept alive by an unrelated package's import.
|
|
153
|
-
* `null`: no package imports it any more, and it stays only so the stub file a
|
|
154
|
-
* committed `wrangler.jsonc` aliases keeps being written (RFC 0028 §4).
|
|
155
157
|
*/
|
|
156
|
-
readonly importedBy: string
|
|
158
|
+
readonly importedBy: string;
|
|
157
159
|
}
|
|
158
160
|
/**
|
|
159
161
|
* Dev-only modules in the graph of any app importing `@guren/core`, listed here
|
|
@@ -177,43 +179,25 @@ declare const DEV_ONLY_MODULES: readonly [{
|
|
|
177
179
|
readonly kind: 'mcp';
|
|
178
180
|
readonly exportNames: readonly [];
|
|
179
181
|
readonly importedBy: 'packages/server/src';
|
|
180
|
-
}, {
|
|
181
|
-
readonly specifier: '@modelcontextprotocol/sdk/server/mcp.js';
|
|
182
|
-
readonly kind: 'mcp';
|
|
183
|
-
readonly exportNames: readonly ["McpServer", "ResourceTemplate"];
|
|
184
|
-
readonly importedBy: 'packages/server/src';
|
|
185
|
-
}, {
|
|
186
|
-
readonly specifier: '@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js';
|
|
187
|
-
readonly kind: 'mcp';
|
|
188
|
-
readonly exportNames: readonly ["WebStandardStreamableHTTPServerTransport"];
|
|
189
|
-
readonly importedBy: null;
|
|
190
182
|
}];
|
|
191
183
|
/** One entry of `DEV_ONLY_MODULES`, with its `kind` still narrowed. */
|
|
192
184
|
type DevOnlyModuleEntry = (typeof DEV_ONLY_MODULES)[number];
|
|
193
|
-
/**
|
|
194
|
-
* The v1 transport `@guren/plugin-mcp` imported before SDK v2 (RFC 0016 §7): the
|
|
195
|
-
* one `DEV_ONLY_MODULES` entry whose stubbing is conditional. Nothing imports it
|
|
196
|
-
* now, so the condition changes no bundle; it goes in RFC 0028's removal PR.
|
|
197
|
-
*/
|
|
198
|
-
declare const MCP_TRANSPORT_SPECIFIER = "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
199
185
|
/** The package an app declares to opt into the App MCP endpoint. */
|
|
200
186
|
declare const MCP_PLUGIN_PACKAGE = "@guren/plugin-mcp";
|
|
187
|
+
/** @deprecated The v1 MCP transport, which no Guren package imports since RFC 0028. */
|
|
188
|
+
declare const MCP_TRANSPORT_SPECIFIER = "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
189
|
+
/** @deprecated The v1 MCP SDK subpath prefix, which no Guren package imports since RFC 0028. */
|
|
190
|
+
declare const MCP_SDK_SUBPATH_PREFIX = "@modelcontextprotocol/sdk/";
|
|
201
191
|
/**
|
|
202
|
-
* Whether
|
|
203
|
-
*
|
|
204
|
-
* can silently compile the endpoint shut. `devDependencies` do not count (they do
|
|
205
|
-
* not ship). An absent, unreadable, or malformed manifest answers `false`: the
|
|
206
|
-
* transport stays stubbed, which is the safe direction.
|
|
192
|
+
* @deprecated Whether `@guren/plugin-mcp` is a runtime dependency. No longer decides
|
|
193
|
+
* any stub: nothing imports the v1 transport it once kept out of the stub list.
|
|
207
194
|
*/
|
|
208
195
|
declare function appUsesMcpPlugin(root: string): boolean;
|
|
209
196
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* Phase 4a). Since the plugin moved to SDK v2 that entry has no importer, so the
|
|
213
|
-
* split changes no bundle (RFC 0028 §4). `server/mcp.js` stays stubbed: the Dev MCP. Each entry keeps
|
|
214
|
-
* its narrow `kind` so platform `Record<kind, message>` tables stay indexable.
|
|
197
|
+
* @deprecated `DEV_ONLY_MODULES`, whatever `mcpPlugin` says: the v1 transport entry
|
|
198
|
+
* this once dropped is no longer listed.
|
|
215
199
|
*/
|
|
216
|
-
declare function stubbableDevOnlyModules(
|
|
200
|
+
declare function stubbableDevOnlyModules(_options: {
|
|
217
201
|
mcpPlugin: boolean;
|
|
218
202
|
}): readonly DevOnlyModuleEntry[];
|
|
219
203
|
/** A database `@guren/orm` can connect through, named after the factory the app's config calls. */
|
|
@@ -325,13 +309,6 @@ type DevOnlySpecifier = (typeof DEV_ONLY_MODULES)[number]['specifier'];
|
|
|
325
309
|
* called without `new` would hide the real reason).
|
|
326
310
|
* @param message Platform-specific explanation, including the replacement API.
|
|
327
311
|
*/
|
|
328
|
-
declare function renderDevOnlyStub(module: DevOnlyModule, message: string): string;
|
|
329
|
-
/**
|
|
330
|
-
* The v1 MCP SDK is reached only through subpaths, which a package-name alias does
|
|
331
|
-
* not cover (hence each one in `DEV_ONLY_MODULES`). A platform whose aliasing supports
|
|
332
|
-
* prefixes routes unlisted subpaths under this prefix to a stub too. SDK v2 lives
|
|
333
|
-
* under other package names, so `@guren/plugin-mcp`'s import is never matched.
|
|
334
|
-
*/
|
|
335
|
-
declare const MCP_SDK_SUBPATH_PREFIX = "@modelcontextprotocol/sdk/";
|
|
312
|
+
declare function renderDevOnlyStub(module: Pick<DevOnlyModule, 'exportNames'>, message: string): string;
|
|
336
313
|
//#endregion
|
|
337
314
|
export { AGENTS_CONFIG_FILE, CLIENT_ASSETS_URL_PREFIX, ClientAssetEnv, DATABASE_CONFIG_CANDIDATES, DATABASE_DIALECTS, DATABASE_FACTORIES, DEV_ONLY_MODULES, DOCUMENT_ASSET_EXTENSIONS, DOCUMENT_ASSET_HEADERS, DatabaseDialect, DatabaseDialectDetection, DevOnlyModule, DevOnlyModuleEntry, DevOnlyModuleKind, DevOnlySpecifier, MCP_PLUGIN_PACKAGE, MCP_SDK_SUBPATH_PREFIX, MCP_TRANSPORT_SPECIFIER, Manifest, ManifestEntry, PathLike, SQL_CLIENT_MODULES, SqlClientModule, SqlClientSpecifier, UnusedSqlClient, appUsesMcpPlugin, assertOutputDirOutsideRoot, bundledRuntimeEnv, clientManifestJson, detectDatabaseDialects, importSpecifier, parseDatabaseDialects, readManifest, removeShadowingIndex, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stageStaticAssets, stubbableDevOnlyModules, translationCatalogJson, unusedSqlClients };
|
|
@@ -315,34 +315,17 @@ const DEV_ONLY_MODULES = [
|
|
|
315
315
|
kind: "mcp",
|
|
316
316
|
exportNames: [],
|
|
317
317
|
importedBy: "packages/server/src"
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
specifier: "@modelcontextprotocol/sdk/server/mcp.js",
|
|
321
|
-
kind: "mcp",
|
|
322
|
-
exportNames: ["McpServer", "ResourceTemplate"],
|
|
323
|
-
importedBy: "packages/server/src"
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
specifier: "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js",
|
|
327
|
-
kind: "mcp",
|
|
328
|
-
exportNames: ["WebStandardStreamableHTTPServerTransport"],
|
|
329
|
-
importedBy: null
|
|
330
318
|
}
|
|
331
319
|
];
|
|
332
|
-
/**
|
|
333
|
-
* The v1 transport `@guren/plugin-mcp` imported before SDK v2 (RFC 0016 §7): the
|
|
334
|
-
* one `DEV_ONLY_MODULES` entry whose stubbing is conditional. Nothing imports it
|
|
335
|
-
* now, so the condition changes no bundle; it goes in RFC 0028's removal PR.
|
|
336
|
-
*/
|
|
337
|
-
const MCP_TRANSPORT_SPECIFIER = "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
338
320
|
/** The package an app declares to opt into the App MCP endpoint. */
|
|
339
321
|
const MCP_PLUGIN_PACKAGE = "@guren/plugin-mcp";
|
|
322
|
+
/** @deprecated The v1 MCP transport, which no Guren package imports since RFC 0028. */
|
|
323
|
+
const MCP_TRANSPORT_SPECIFIER = "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
324
|
+
/** @deprecated The v1 MCP SDK subpath prefix, which no Guren package imports since RFC 0028. */
|
|
325
|
+
const MCP_SDK_SUBPATH_PREFIX = "@modelcontextprotocol/sdk/";
|
|
340
326
|
/**
|
|
341
|
-
* Whether
|
|
342
|
-
*
|
|
343
|
-
* can silently compile the endpoint shut. `devDependencies` do not count (they do
|
|
344
|
-
* not ship). An absent, unreadable, or malformed manifest answers `false`: the
|
|
345
|
-
* transport stays stubbed, which is the safe direction.
|
|
327
|
+
* @deprecated Whether `@guren/plugin-mcp` is a runtime dependency. No longer decides
|
|
328
|
+
* any stub: nothing imports the v1 transport it once kept out of the stub list.
|
|
346
329
|
*/
|
|
347
330
|
function appUsesMcpPlugin(root) {
|
|
348
331
|
try {
|
|
@@ -353,15 +336,11 @@ function appUsesMcpPlugin(root) {
|
|
|
353
336
|
}
|
|
354
337
|
}
|
|
355
338
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
* Phase 4a). Since the plugin moved to SDK v2 that entry has no importer, so the
|
|
359
|
-
* split changes no bundle (RFC 0028 §4). `server/mcp.js` stays stubbed: the Dev MCP. Each entry keeps
|
|
360
|
-
* its narrow `kind` so platform `Record<kind, message>` tables stay indexable.
|
|
339
|
+
* @deprecated `DEV_ONLY_MODULES`, whatever `mcpPlugin` says: the v1 transport entry
|
|
340
|
+
* this once dropped is no longer listed.
|
|
361
341
|
*/
|
|
362
|
-
function stubbableDevOnlyModules(
|
|
363
|
-
|
|
364
|
-
return DEV_ONLY_MODULES.filter((module) => module.specifier !== MCP_TRANSPORT_SPECIFIER);
|
|
342
|
+
function stubbableDevOnlyModules(_options) {
|
|
343
|
+
return DEV_ONLY_MODULES;
|
|
365
344
|
}
|
|
366
345
|
/**
|
|
367
346
|
* The `@guren/orm` factory names an app's config calls, with each one's dialect.
|
|
@@ -515,12 +494,5 @@ function renderDevOnlyStub(module, message) {
|
|
|
515
494
|
const named = module.exportNames.length > 0 ? `, { ${module.exportNames.join(", ")} }` : "";
|
|
516
495
|
return `// ${comment}\n${throwing}\n${`function unavailable() { ${error} }`}\nexport default Object.assign(unavailable${named})\n`;
|
|
517
496
|
}
|
|
518
|
-
/**
|
|
519
|
-
* The v1 MCP SDK is reached only through subpaths, which a package-name alias does
|
|
520
|
-
* not cover (hence each one in `DEV_ONLY_MODULES`). A platform whose aliasing supports
|
|
521
|
-
* prefixes routes unlisted subpaths under this prefix to a stub too. SDK v2 lives
|
|
522
|
-
* under other package names, so `@guren/plugin-mcp`'s import is never matched.
|
|
523
|
-
*/
|
|
524
|
-
const MCP_SDK_SUBPATH_PREFIX = "@modelcontextprotocol/sdk/";
|
|
525
497
|
//#endregion
|
|
526
498
|
export { AGENTS_CONFIG_FILE, CLIENT_ASSETS_URL_PREFIX, DATABASE_CONFIG_CANDIDATES, DATABASE_DIALECTS, DATABASE_FACTORIES, DEV_ONLY_MODULES, DOCUMENT_ASSET_EXTENSIONS, DOCUMENT_ASSET_HEADERS, MCP_PLUGIN_PACKAGE, MCP_SDK_SUBPATH_PREFIX, MCP_TRANSPORT_SPECIFIER, SQL_CLIENT_MODULES, appUsesMcpPlugin, assertOutputDirOutsideRoot, bundledRuntimeEnv, clientManifestJson, detectDatabaseDialects, importSpecifier, parseDatabaseDialects, readManifest, removeShadowingIndex, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stageStaticAssets, stubbableDevOnlyModules, translationCatalogJson, unusedSqlClients };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guren/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"./src/bin.ts",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"typecheck": "tsc --noEmit"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@guren/cli": "^2.
|
|
91
|
+
"@guren/cli": "^2.25.0",
|
|
92
92
|
"@guren/orm": "^2.11.0",
|
|
93
|
-
"@guren/server": "^2.
|
|
93
|
+
"@guren/server": "^2.25.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@types/node": "^20.14.10",
|