@guren/server 2.31.1 → 2.33.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/{McpServiceProvider-CvFExxdJ.js → McpServiceProvider-BDDr-7lh.js} +22 -2
- package/dist/{dev-banner-DZkJZ1X-.js → dev-banner-CSjrSNZi.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/mcp/endpoint.d.ts +8 -0
- package/dist/mcp/index.js +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/{runtime-error-capture-BclelWhA.js → runtime-error-capture-DzllKc0d.js} +13 -2
- package/dist/{runtime-errors-DOPBX0Ox.js → runtime-errors-D229wyoc.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
2
|
import { n as ServiceProvider } from "./ServiceProvider-G0YclITd.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as DEV_CENTER_FEEDBACK_ROUTE, l as isMcpEndpointEnabled, n as RUNTIME_ERRORS_PATH, o as MCP_ENDPOINT_PATH, s as createMcpAccessGuard, t as RUNTIME_ERRORS_BINDING } from "./runtime-error-capture-DzllKc0d.js";
|
|
4
4
|
//#region src/mcp/McpServiceProvider.ts
|
|
5
5
|
var McpServiceProvider_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
DEV_MCP_CLI_TOO_OLD: () => DEV_MCP_CLI_TOO_OLD,
|
|
@@ -39,11 +39,31 @@ var McpServiceProvider = class extends ServiceProvider {
|
|
|
39
39
|
for (const path of [
|
|
40
40
|
"/_guren",
|
|
41
41
|
"/_guren/",
|
|
42
|
-
"/_guren/graph.json"
|
|
42
|
+
"/_guren/graph.json",
|
|
43
|
+
"/_guren/plans.json",
|
|
44
|
+
"/_guren/plans/:slug",
|
|
45
|
+
"/_guren/plans/:slug/review",
|
|
46
|
+
"/_guren/plans/:slug/evidence",
|
|
47
|
+
"/_guren/plans/:slug/readiness/:decision",
|
|
48
|
+
"/_guren/browser/:run/screenshots/:sha256",
|
|
49
|
+
"/_guren/ui",
|
|
50
|
+
"/_guren/ui.json",
|
|
51
|
+
DEV_CENTER_FEEDBACK_ROUTE
|
|
43
52
|
]) {
|
|
44
53
|
hono.use(path, createMcpAccessGuard());
|
|
45
54
|
hono.get(path, (ctx) => isMcpEndpointEnabled() ? center.fetch(ctx.req.raw) : ctx.notFound());
|
|
46
55
|
}
|
|
56
|
+
hono.post(DEV_CENTER_FEEDBACK_ROUTE, (ctx) => {
|
|
57
|
+
if (!isMcpEndpointEnabled()) return ctx.notFound();
|
|
58
|
+
if (ctx.req.header("origin") !== new URL(ctx.req.url).origin) return ctx.json({
|
|
59
|
+
schemaVersion: 1,
|
|
60
|
+
error: {
|
|
61
|
+
code: "origin",
|
|
62
|
+
message: "Feedback is accepted from the Dev Center page only."
|
|
63
|
+
}
|
|
64
|
+
}, 403);
|
|
65
|
+
return center.fetch(ctx.req.raw);
|
|
66
|
+
});
|
|
47
67
|
}
|
|
48
68
|
const buffer = this.container.makeOptional(RUNTIME_ERRORS_BINDING);
|
|
49
69
|
const runtimeErrors = buffer ? (query) => isMcpEndpointEnabled() ? buffer.read(query) : {
|
|
@@ -4,7 +4,7 @@ import chalk from "chalk";
|
|
|
4
4
|
import figlet from "figlet";
|
|
5
5
|
import standard from "figlet/importable-fonts/Standard.js";
|
|
6
6
|
//#region package.json
|
|
7
|
-
var version = "2.
|
|
7
|
+
var version = "2.33.0";
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/http/dev-banner.ts
|
|
10
10
|
var dev_banner_exports = /* @__PURE__ */ __exportAll({
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import { _ as verifyApiToken, a as getApiToken, c as hasBearerHeader, d as revok
|
|
|
20
20
|
import { a as runInRequestScope, i as keepAlive, n as filterSensitiveData, t as Logger } from "./Logger-DWXdtLSJ.js";
|
|
21
21
|
import { a as RedisStore, i as FileStore, n as createCacheManager, o as MemoryStore, r as TaggedCache, s as resolveLazyRedisClient, t as CacheManager } from "./cache-Bi5U8N5P.js";
|
|
22
22
|
import { n as createRedisClient, r as RedisSessionStore } from "./client-C5Wj9P9o.js";
|
|
23
|
-
import { i as loadRuntimeErrorsModule,
|
|
23
|
+
import { c as isDevCenterFeedbackRequest, i as loadRuntimeErrorsModule, l as isMcpEndpointEnabled, r as captureRuntimeError, t as RUNTIME_ERRORS_BINDING } from "./runtime-error-capture-DzllKc0d.js";
|
|
24
24
|
import { n as isHotReloadRuntime, r as matchingOpenParen, t as claimHotDisposable } from "./hot-disposables-W2fH-GID.js";
|
|
25
25
|
import { a as setBroadcastManager, c as PresenceChannel, d as createWebSocketOriginGuard, i as getBroadcastManager, l as PrivateChannel, n as BroadcastManager, o as RedisDriver, r as createBroadcastManager, s as MemoryDriver, t as createTypedBroadcaster, u as Channel } from "./broadcasting-CcevVE5Y.js";
|
|
26
26
|
import { c as tc, d as Translator, f as getPluralizationRule, i as getI18n, l as tryGetI18n, m as selectPluralForm, n as I18nManager, o as setI18n, p as pluralizationRules, r as createI18n, s as t, t as MemoryLoader, u as JsonLoader } from "./i18n-BShPpJZa.js";
|
|
@@ -1418,7 +1418,7 @@ function createCsrfMiddleware(options = {}, cookielessAuthEndpoints) {
|
|
|
1418
1418
|
settleCookie(ctx);
|
|
1419
1419
|
return;
|
|
1420
1420
|
}
|
|
1421
|
-
if (isExcluded$1(path, exclude) || isMcpEndpointRequest(path) || isCookielessAuthEndpoint(path, cookielessAuthEndpoints) || isBearerRequestWithoutCookies(ctx) || isSeamPrincipalRequest(ctx)) {
|
|
1421
|
+
if (isExcluded$1(path, exclude) || isMcpEndpointRequest(path) || isDevCenterFeedbackRequest(path) || isCookielessAuthEndpoint(path, cookielessAuthEndpoints) || isBearerRequestWithoutCookies(ctx) || isSeamPrincipalRequest(ctx)) {
|
|
1422
1422
|
await next();
|
|
1423
1423
|
settleCookie(ctx);
|
|
1424
1424
|
return;
|
|
@@ -3565,7 +3565,7 @@ let devBanner;
|
|
|
3565
3565
|
*/
|
|
3566
3566
|
async function loadDevBanner() {
|
|
3567
3567
|
if (typeof process === "undefined") return devBanner;
|
|
3568
|
-
if (process.env.NODE_ENV !== "production") devBanner ??= await import("./dev-banner-
|
|
3568
|
+
if (process.env.NODE_ENV !== "production") devBanner ??= await import("./dev-banner-CSjrSNZi.js").then((n) => n.n);
|
|
3569
3569
|
return devBanner;
|
|
3570
3570
|
}
|
|
3571
3571
|
/**
|
|
@@ -3801,7 +3801,7 @@ var Application = class {
|
|
|
3801
3801
|
this.bootSequence ??= new BootSequence([
|
|
3802
3802
|
() => this.options.boot?.(this.hono),
|
|
3803
3803
|
() => this.mountRoutes(),
|
|
3804
|
-
() => this.mountDevEndpoint(isMcpEndpointEnabled(), async () => (await import("./McpServiceProvider-
|
|
3804
|
+
() => this.mountDevEndpoint(isMcpEndpointEnabled(), async () => (await import("./McpServiceProvider-BDDr-7lh.js").then((n) => n.n)).McpServiceProvider, "GUREN_MCP=1 but the MCP endpoint could not load — is @guren/cli installed?"),
|
|
3805
3805
|
() => this.mountDevEndpoint(isDocsViewerEnabled(), async () => (await import("./DocsViewerServiceProvider-BVPZjwQp.js")).DocsViewerServiceProvider, "GUREN_DOCS=1 but the docs viewer could not load — is @guren/cli resolvable from this app?"),
|
|
3806
3806
|
() => this.providerManager.bootAll(),
|
|
3807
3807
|
() => this.warnOnUnconfiguredAuth()
|
package/dist/mcp/endpoint.d.ts
CHANGED
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
import type { MiddlewareHandler } from 'hono';
|
|
7
7
|
export { isLoopbackAddress, isLoopbackOrigin } from '../http/middleware/loopback-guard.js';
|
|
8
8
|
export declare const MCP_ENDPOINT_PATH = "/_guren/mcp";
|
|
9
|
+
/** Where the Dev Center saves a plan review's feedback (RFC 0030 §8), its one write route. */
|
|
10
|
+
export declare const DEV_CENTER_FEEDBACK_ROUTE = "/_guren/plans/:slug/feedback";
|
|
11
|
+
/**
|
|
12
|
+
* The page posts without an `XSRF-TOKEN`: an app with no auth issues none. The CLI handler
|
|
13
|
+
* requires the request's own `Origin` instead, behind the loopback guard, and the route
|
|
14
|
+
* exists only while {@link isMcpEndpointEnabled} holds.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isDevCenterFeedbackRequest(path: string): boolean;
|
|
9
17
|
/**
|
|
10
18
|
* Whether the MCP endpoint is mounted: opt-in via `GUREN_MCP=1`, never in
|
|
11
19
|
* production (it exposes project introspection and code generation). The env
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as McpServiceProvider } from "../McpServiceProvider-
|
|
1
|
+
import { t as McpServiceProvider } from "../McpServiceProvider-BDDr-7lh.js";
|
|
2
2
|
export { McpServiceProvider };
|
package/dist/runtime/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { a as trimTrailingSlashes, n as isRealPathWithin, t as isPathWithin } fr
|
|
|
2
2
|
import { n as parseImportMap } from "../inertia-defaults-BjrcT7za.js";
|
|
3
3
|
import { n as hash } from "../Hash-D2DFd8xX.js";
|
|
4
4
|
import { a as getManifestCss, c as isViteProduction, d as startViteDevServer, i as clientManifestCandidates, l as loadViteManifest, o as getManifestFile, r as PUBLIC_ASSETS_URL_PREFIX, u as normalizeDevServerUrl } from "../vite-manifest-DO0pU1vm.js";
|
|
5
|
-
import { r as logDevServerBanner, t as GUREN_ASCII_ART } from "../dev-banner-
|
|
5
|
+
import { r as logDevServerBanner, t as GUREN_ASCII_ART } from "../dev-banner-CSjrSNZi.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { dirname, extname, join, resolve } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
@@ -2,6 +2,17 @@ import { t as createLoopbackGuard } from "./loopback-guard-CG8xB4v0.js";
|
|
|
2
2
|
import { r as tryGetRequestContainer } from "./request-container-BbuH0JJy.js";
|
|
3
3
|
//#region src/mcp/endpoint.ts
|
|
4
4
|
const MCP_ENDPOINT_PATH = "/_guren/mcp";
|
|
5
|
+
/** Where the Dev Center saves a plan review's feedback (RFC 0030 §8), its one write route. */
|
|
6
|
+
const DEV_CENTER_FEEDBACK_ROUTE = "/_guren/plans/:slug/feedback";
|
|
7
|
+
const DEV_CENTER_FEEDBACK_PATH = /^\/_guren\/plans\/[^/]+\/feedback$/;
|
|
8
|
+
/**
|
|
9
|
+
* The page posts without an `XSRF-TOKEN`: an app with no auth issues none. The CLI handler
|
|
10
|
+
* requires the request's own `Origin` instead, behind the loopback guard, and the route
|
|
11
|
+
* exists only while {@link isMcpEndpointEnabled} holds.
|
|
12
|
+
*/
|
|
13
|
+
function isDevCenterFeedbackRequest(path) {
|
|
14
|
+
return DEV_CENTER_FEEDBACK_PATH.test(path) && isMcpEndpointEnabled();
|
|
15
|
+
}
|
|
5
16
|
/**
|
|
6
17
|
* Whether the MCP endpoint is mounted: opt-in via `GUREN_MCP=1`, never in
|
|
7
18
|
* production (it exposes project introspection and code generation). The env
|
|
@@ -35,7 +46,7 @@ let loading;
|
|
|
35
46
|
* a call no define can settle. `tests/mcp/runtime-errors.test.ts` pins the form.
|
|
36
47
|
*/
|
|
37
48
|
function loadRuntimeErrorsModule() {
|
|
38
|
-
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production" && isMcpEndpointEnabled()) return loading ??= import("./runtime-errors-
|
|
49
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production" && isMcpEndpointEnabled()) return loading ??= import("./runtime-errors-D229wyoc.js");
|
|
39
50
|
}
|
|
40
51
|
/** Only ExceptionHandler calls this, after applying its dontReport policy. */
|
|
41
52
|
function captureRuntimeError(error, ctx, status) {
|
|
@@ -45,4 +56,4 @@ function captureRuntimeError(error, ctx, status) {
|
|
|
45
56
|
} catch {}
|
|
46
57
|
}
|
|
47
58
|
//#endregion
|
|
48
|
-
export {
|
|
59
|
+
export { DEV_CENTER_FEEDBACK_ROUTE as a, isDevCenterFeedbackRequest as c, loadRuntimeErrorsModule as i, isMcpEndpointEnabled as l, RUNTIME_ERRORS_PATH as n, MCP_ENDPOINT_PATH as o, captureRuntimeError as r, createMcpAccessGuard as s, RUNTIME_ERRORS_BINDING as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as RUNTIME_ERRORS_PATH, t as RUNTIME_ERRORS_BINDING } from "./runtime-error-capture-
|
|
1
|
+
import { n as RUNTIME_ERRORS_PATH, t as RUNTIME_ERRORS_BINDING } from "./runtime-error-capture-DzllKc0d.js";
|
|
2
2
|
import { r as tryGetRequestContainer } from "./request-container-BbuH0JJy.js";
|
|
3
3
|
import { realpathSync, statSync } from "node:fs";
|
|
4
4
|
import { routePath } from "hono/route";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guren/server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.33.0",
|
|
4
4
|
"description": "HTTP layer of the Guren framework, on Hono: routing, controllers, middleware, auth, sessions, queues and the AWS Lambda adapter. Applications import it through @guren/core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"guren",
|