@guren/server 2.35.0 → 2.36.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.
Files changed (48) hide show
  1. package/dist/{DocsViewerServiceProvider-BVPZjwQp.js → DocsViewerServiceProvider-DzrxQoYh.js} +15 -4
  2. package/dist/Event-COT3f5Xd.js +28 -0
  3. package/dist/{McpServiceProvider-CXOokGax.js → McpServiceProvider-BOeQyt7u.js} +2 -0
  4. package/dist/PrivateChannel-1krGz028.js +187 -0
  5. package/dist/{Resource-y-7zzZSB.js → Resource-PhnO_wNO.js} +113 -12
  6. package/dist/agent/derive.d.ts +23 -1
  7. package/dist/agent/dispatch.d.ts +12 -1
  8. package/dist/agent/pipeline.d.ts +6 -0
  9. package/dist/agent/public.d.ts +1 -1
  10. package/dist/agent/public.js +1 -1
  11. package/dist/{api-token-1-INqeVU.js → api-token-Cs1myxf6.js} +15 -1
  12. package/dist/auth/index.js +2 -2
  13. package/dist/{auth-CO9MlQNE.js → auth-DYWBlmpS.js} +1 -1
  14. package/dist/broadcasting/BroadcastManager.d.ts +19 -5
  15. package/dist/broadcasting/event-target.d.ts +9 -0
  16. package/dist/broadcasting/index.d.ts +3 -1
  17. package/dist/broadcasting/index.js +3 -2
  18. package/dist/broadcasting/sender-envelope.d.ts +26 -0
  19. package/dist/broadcasting/types.d.ts +27 -2
  20. package/dist/{broadcasting-D04a3R02.js → broadcasting-Bh6QoMpy.js} +50 -95
  21. package/dist/{contained-path-BkNSBljW.js → contained-path-DOVauNQC.js} +1 -22
  22. package/dist/{dev-banner-BUrHz-LF.js → dev-banner-DGxB3HGY.js} +3 -3
  23. package/dist/{dispatch-ENWpBxbE.js → dispatch-CDNqcB3Q.js} +51 -12
  24. package/dist/events/index.js +2 -1
  25. package/dist/{events-B6gfJkCH.js → events-DW197Nur.js} +2 -28
  26. package/dist/http/vite-dev-server.d.ts +18 -1
  27. package/dist/http/vite-manifest.d.ts +4 -1
  28. package/dist/index.d.ts +7 -7
  29. package/dist/index.js +109 -22
  30. package/dist/internal/agent-principal.d.ts +8 -0
  31. package/dist/internal/testing.d.ts +1 -0
  32. package/dist/internal/testing.js +2 -2
  33. package/dist/mcp/index.js +1 -1
  34. package/dist/mvc/Router.d.ts +13 -0
  35. package/dist/mvc/inertia/InertiaEngine.d.ts +3 -0
  36. package/dist/mvc/inertia/props.d.ts +54 -3
  37. package/dist/runtime/index.js +5 -3
  38. package/dist/storage/index.js +1 -1
  39. package/dist/{storage-YPbsV9ju.js → storage-ziIKgHON.js} +2 -1
  40. package/dist/trim-slashes-BLY9hKAa.js +22 -0
  41. package/dist/vite/index.d.ts +2 -0
  42. package/dist/vite/index.js +283 -1
  43. package/dist/vite/mcp-app.d.ts +59 -0
  44. package/dist/vite/plugin.d.ts +12 -0
  45. package/dist/{vite-manifest-DO0pU1vm.js → vite-dev-server-Ag90otai.js} +25 -114
  46. package/dist/vite-manifest-BdXRybeq.js +129 -0
  47. package/package.json +1 -1
  48. package/dist/host-port-t6wQFaRu.js +0 -15
package/dist/index.d.ts CHANGED
@@ -18,9 +18,9 @@ export type { ViteAssetOptions } from './http/vite-assets.js';
18
18
  export { Router } from './mvc/Router.js';
19
19
  export { prototype } from './mvc/prototype.js';
20
20
  export type { PrototypeFixture, PrototypeFixtureLoader, PrototypeResult, PrototypeRouteHandler, PrototypeServerContext, } from './mvc/prototype.js';
21
- export type { BindableModel, AgentRouteMetadata, RouteBuilder, RouteContractOptions, RouteDefinition, RouteMiddlewareInput, RouteModelBinding, RouteOpenApiMetadata, ResourceAction as RouteResourceAction, ResourceResponseHint, ResourceResponseShape, ResourceRouteOptions, } from './mvc/Router.js';
22
- export { deriveAgentTools } from './agent/derive.js';
23
- export type { AgentToolInputSource, AgentToolSchema, DeriveAgentToolsResult, DerivedAgentTool, DerivedAgentToolAnnotations, DerivedAgentToolExposure, } from './agent/derive.js';
21
+ export type { BindableModel, AgentRouteMetadata, AgentRouteUi, AgentUiPage, RouteBuilder, RouteContractOptions, RouteDefinition, RouteMiddlewareInput, RouteModelBinding, RouteOpenApiMetadata, ResourceAction as RouteResourceAction, ResourceResponseHint, ResourceResponseShape, ResourceRouteOptions, } from './mvc/Router.js';
22
+ export { deriveAgentToolUi, deriveAgentTools } from './agent/derive.js';
23
+ export type { AgentToolInputSource, AgentToolSchema, DeriveAgentToolsResult, DerivedAgentTool, DerivedAgentToolAnnotations, DerivedAgentToolExposure, DerivedAgentToolUi, } from './agent/derive.js';
24
24
  export { advertisesStructuredOutput, buildToolRequest, describeBuildFailure, mapToolResponse, PREFLIGHT_ARGUMENT, } from './agent/dispatch.js';
25
25
  export type { BuildToolRequestOptions, BuiltToolRequest, ToolCallOutcome, ToolRequestBuildFailure, } from './agent/dispatch.js';
26
26
  export { APPROVAL_STATUS_TOOL_NAME, isReservedAgentToolName, PORTABLE_AGENT_TOOL_NAME_PATTERN, PREFLIGHT_TOOL_NAME, RESERVED_AGENT_TOOL_NAMES, } from './agent/meta-tools.js';
@@ -48,8 +48,8 @@ export { approvalStatusNotFoundMessage, toApprovalStatusReport } from './agent/a
48
48
  export type { ApprovalStatusOutcome, ApprovalStatusReport } from './agent/approval-status.js';
49
49
  export { ViewEngine } from './mvc/ViewEngine.js';
50
50
  export { inertia, setInertiaSsrRenderer, setInertiaDocument } from './mvc/inertia/InertiaEngine.js';
51
- export { always, defer, isAlwaysProp, isDeferredProp } from './mvc/inertia/props.js';
52
- export type { AlwaysProp, DeferredProp, InertiaPropInput, InertiaPropsInput, ResolvedInertiaProp, ResolvedInertiaProps, } from './mvc/inertia/props.js';
51
+ export { always, defer, isAlwaysProp, isDeferredProp, isLiveProp, live } from './mvc/inertia/props.js';
52
+ export type { AlwaysProp, DeferredProp, LiveChannelType, LiveEvent, LiveListener, LiveListenerInput, LiveOptions, LiveProp, LivePropEntry, InertiaPropInput, InertiaPropsInput, ResolvedInertiaProp, ResolvedInertiaProps, } from './mvc/inertia/props.js';
53
53
  export { setInertiaSharedProps, getInertiaSharedPropsResolver, shareInertiaProps } from './mvc/inertia/shared.js';
54
54
  export type { InertiaDocumentContext, InertiaDocumentOptions, InertiaOptions, InertiaPagePayload, InertiaSsrContext, InertiaSsrOptions, InertiaSsrRenderer, InertiaSsrResult, } from './mvc/inertia/InertiaEngine.js';
55
55
  export type { SharedInertiaPropsResolver, InertiaSharedProps, ResolvedSharedInertiaProps, SharedPropsContainer, } from './mvc/inertia/shared.js';
@@ -86,8 +86,8 @@ export { HealthCheck, HealthManager, createHealthManager, DatabaseCheck, RedisCh
86
86
  export type { HealthStatus, CheckResult, HealthReport, HealthCheckOptions, HealthMiddlewareOptions, DatabaseConnection, DatabaseCheckOptions, RedisClient, RedisCheckOptions, CacheStoreInterface, CacheCheckOptions, StorageDriverInterface, StorageCheckOptions, MemoryCheckOptions, CustomCheckCallback, } from './health/index.js';
87
87
  export { Notification, NotificationManager, createNotificationManager, setNotificationManager, getNotificationManager, MailChannel, DatabaseChannel, SlackChannel, MemoryChannel, registerNotification, getNotification, clearNotificationRegistry, resolveNotifiableType, } from './notifications/index.js';
88
88
  export type { NotificationConstructor, NotificationChannel, Notifiable, DatabaseNotification, NotificationMailMessage, NotificationAttachment, SlackMessage, SlackBlock, SlackAttachment, NotificationChannelFactory, NotificationManagerOptions, DatabaseChannelOptions, SentNotification, NotificationClass, MailChannelOptions, SlackChannelOptions, } from './notifications/index.js';
89
- export { BroadcastManager, createBroadcastManager, setBroadcastManager, getBroadcastManager, Channel, PrivateChannel, PresenceChannel, MemoryDriver as MemoryBroadcastDriver, RedisDriver as RedisBroadcastDriver, } from './broadcasting/index.js';
90
- export type { BroadcastEvent, BroadcastDriver, PresenceBroadcastDriver, ChannelAuthorizer, PresenceChannelAuthorizer, PresenceMember, SSEClient, WebSocketClient, BroadcastManagerOptions, BroadcastDriverFactory, ChannelRegistration, SSEMiddlewareOptions, WebSocketMiddlewareOptions, AuthMiddlewareOptions, BroadcastableEvent, MemoryDriverOptions as BroadcastMemoryDriverOptions, RedisClient as BroadcastRedisClient, RedisDriverOptions as BroadcastRedisDriverOptions, } from './broadcasting/index.js';
89
+ export { BroadcastManager, createBroadcastManager, setBroadcastManager, getBroadcastManager, Channel, PrivateChannel, PresenceChannel, MemoryDriver as MemoryBroadcastDriver, RedisDriver as RedisBroadcastDriver, broadcastChannelsOf, broadcastNameOf, } from './broadcasting/index.js';
90
+ export type { BroadcastEvent, BroadcastDriver, PresenceBroadcastDriver, ChannelAuthorizer, PresenceChannelAuthorizer, PresenceMember, SSEClient, WebSocketClient, BroadcastManagerOptions, BroadcastDriverFactory, ChannelRegistration, SSEMiddlewareOptions, WebSocketMiddlewareOptions, AuthMiddlewareOptions, BroadcastableEvent, BroadcastEventOptions, BroadcastSender, BroadcastTarget, MemoryDriverOptions as BroadcastMemoryDriverOptions, RedisClient as BroadcastRedisClient, RedisDriverOptions as BroadcastRedisDriverOptions, } from './broadcasting/index.js';
91
91
  export { Container, createContainer, resolveOptional, setContainer, getContainer, resolve, ServiceProvider, ProviderManager, definePlugin, defineModule, mountModuleRoutes, } from './container/index.js';
92
92
  export type { ContainerLike, PluginDefinition, PluginFactory, ModuleDefinition, GurenModule, ServiceFactory, ServiceClass, ServiceBinding, ServiceBindings, ContextualBindingBuilder, ContextualNeedsBuilder, ContextualBinding, ServiceProviderOptions, Provider as ContainerProvider, ServiceProviderClass, } from './container/index.js';
93
93
  export { HttpException, ExceptionHandler, createExceptionHandler, setExceptionHandler, getExceptionHandler, abort, abortIf, abortUnless, ValidationException, AuthenticationException, AuthorizationException, NotFoundHttpException, MethodNotAllowedException, } from './errors/index.js';
package/dist/index.js CHANGED
@@ -1,20 +1,22 @@
1
- import { A as ensureErrorStackTracePolyfill, C as setInertiaDocument, D as defer, E as always, O as isAlwaysProp, a as renderDocument, b as inertia, c as getRequestLocale, d as mountModuleRoutes, f as definePlugin, g as shareInertiaProps, h as setInertiaSharedProps, i as Controller, k as isDeferredProp, l as getRequestTranslator, m as resolveSharedInertiaProps, n as Resource, o as LOCALE_CONTEXT_KEY, p as getInertiaSharedPropsResolver, r as collect, s as detectLocaleMiddleware, t as JsonResource, u as defineModule, w as setInertiaSsrRenderer } from "./Resource-y-7zzZSB.js";
1
+ import { A as isLiveProp, C as setInertiaDocument, D as defer, E as always, M as ensureErrorStackTracePolyfill, O as isAlwaysProp, a as renderDocument, b as inertia, c as getRequestLocale, d as mountModuleRoutes, f as definePlugin, g as shareInertiaProps, h as setInertiaSharedProps, i as Controller, j as live, k as isDeferredProp, l as getRequestTranslator, m as resolveSharedInertiaProps, n as Resource, o as LOCALE_CONTEXT_KEY, p as getInertiaSharedPropsResolver, r as collect, s as detectLocaleMiddleware, t as JsonResource, u as defineModule, w as setInertiaSsrRenderer } from "./Resource-PhnO_wNO.js";
2
2
  import { a as parseRequestPayload, i as parseRequestBody, n as flattenRequestQueries, r as formatValidationErrors } from "./request-CLOYytGP.js";
3
3
  import { i as setValidatedInput, n as getValidatedInput } from "./validated-input-D84J8wcC.js";
4
4
  import { n as NOT_FOUND_MESSAGE, t as HttpException } from "./HttpException-2tfZGamp.js";
5
5
  import { n as ValidationException } from "./errors-C8neC8go.js";
6
6
  import { a as withAuthorization, c as capabilitiesOf, i as derivableAbility, l as mergeCapabilities, n as authorizeMiddleware, o as Policy, r as authorizeResourceMiddleware, s as definePolicy, t as authorizeAllMiddleware, u as stampCapabilities } from "./authorization-rxx6aprN.js";
7
- import { a as mapToolResponse, c as AGENT_PREFLIGHT_VERDICT_HEADER, i as describeBuildFailure, n as advertisesStructuredOutput, o as isDispatchedToolRequest, r as buildToolRequest, t as PREFLIGHT_ARGUMENT } from "./dispatch-ENWpBxbE.js";
8
- import { i as trimSlashes } from "./contained-path-BkNSBljW.js";
7
+ import { a as mapToolResponse, c as AGENT_PREFLIGHT_VERDICT_HEADER, i as describeBuildFailure, n as advertisesStructuredOutput, o as isDispatchedToolRequest, r as buildToolRequest, t as PREFLIGHT_ARGUMENT } from "./dispatch-CDNqcB3Q.js";
8
+ import { t as trimSlashes } from "./trim-slashes-BLY9hKAa.js";
9
9
  import { PATH_PARAM_PATTERN, extractPathParamNames } from "./internal/route-path.js";
10
10
  import { a as generateAppKey, c as parseAppKey, i as encodeDerivedKey, l as parsePreviousAppKeys, n as deriveAppKey, o as getAppKeyringFromEnv, r as deriveAppKeyring, s as normalizeAppKey, t as MessageSigner } from "./MessageSigner-DIUT1Yao.js";
11
11
  import { n as detectServerlessRuntime, t as SERVERLESS_RUNTIME_LABELS } from "./serverless-D96rJb6x.js";
12
- import { A as verifyOAuthState, B as ModelUserProvider, C as createGoogleOAuthProviderConfig, D as fetchOAuthUserProfile, E as exchangeOAuthCode, F as normalizeRedirectTarget, G as MemorySessionStore, H as NodeHasher, I as AuthManager, J as getSessionFromContext, K as createSessionMiddleware, L as DEFAULT_PROVIDER, M as jsonResponse, N as hostMatchesAllowlist, O as parseOAuthRedirectUrl, P as isAppRelativePath, R as TokenGuard, S as createGitHubOAuthProviderConfig, T as createOAuthState, U as ScryptHasher, V as DefaultHasher, W as BaseUserProvider, _ as OAUTH_SESSION_BINDING_KEY, a as isEmailVerified, b as buildOAuthRedirectUrl, c as verifyEmailToken, d as completePasswordReset, f as createPasswordResetToken, g as MemoryOAuthStateStore, h as AuthenticatableModel, i as createEmailVerificationToken, j as defineMiddleware, k as sanitizeOAuthRedirect, l as MemoryPasswordResetStore, m as verifyPasswordResetToken, n as buildVerificationUrl, o as parseVerificationUrl, p as parsePasswordResetUrl, q as defaultCookieSecure, r as completeEmailVerification, s as requireVerifiedEmail, t as MemoryEmailVerificationStore, u as buildPasswordResetUrl, v as OAuthManager, w as createOAuthManager, x as createDiscordOAuthProviderConfig, y as buildOAuthAuthorizeUrl, z as SessionGuard } from "./auth-CO9MlQNE.js";
12
+ import { A as verifyOAuthState, B as ModelUserProvider, C as createGoogleOAuthProviderConfig, D as fetchOAuthUserProfile, E as exchangeOAuthCode, F as normalizeRedirectTarget, G as MemorySessionStore, H as NodeHasher, I as AuthManager, J as getSessionFromContext, K as createSessionMiddleware, L as DEFAULT_PROVIDER, M as jsonResponse, N as hostMatchesAllowlist, O as parseOAuthRedirectUrl, P as isAppRelativePath, R as TokenGuard, S as createGitHubOAuthProviderConfig, T as createOAuthState, U as ScryptHasher, V as DefaultHasher, W as BaseUserProvider, _ as OAUTH_SESSION_BINDING_KEY, a as isEmailVerified, b as buildOAuthRedirectUrl, c as verifyEmailToken, d as completePasswordReset, f as createPasswordResetToken, g as MemoryOAuthStateStore, h as AuthenticatableModel, i as createEmailVerificationToken, j as defineMiddleware, k as sanitizeOAuthRedirect, l as MemoryPasswordResetStore, m as verifyPasswordResetToken, n as buildVerificationUrl, o as parseVerificationUrl, p as parsePasswordResetUrl, q as defaultCookieSecure, r as completeEmailVerification, s as requireVerifiedEmail, t as MemoryEmailVerificationStore, u as buildPasswordResetUrl, v as OAuthManager, w as createOAuthManager, x as createDiscordOAuthProviderConfig, y as buildOAuthAuthorizeUrl, z as SessionGuard } from "./auth-DYWBlmpS.js";
13
13
  import { t as resolveOptional } from "./resolve-optional-ax6gPWTp.js";
14
14
  import { t as warnOnce } from "./warn-once-p-IlMjra.js";
15
15
  import { a as defaultApplication, c as resolve, d as createContainer, f as getContainer, g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, l as useAsDefaultApplication, m as warnDeprecated, n as ambientBinding, o as defaultContainer, p as setContainer, r as ambientContainer, s as resetDefaultApplication, t as adoptDefaultApplication, u as Container } from "./default-application-s9SE-Er7.js";
16
+ import { t as Event } from "./Event-COT3f5Xd.js";
17
+ import { l as broadcastChannelsOf, n as PresenceChannel, r as Channel, t as PrivateChannel, u as broadcastNameOf } from "./PrivateChannel-1krGz028.js";
16
18
  import { n as ServiceProvider, t as ProviderManager } from "./ServiceProvider-G0YclITd.js";
17
- import { C as scopesAllowTool, M as markAgentDispatch, N as readAgentPrincipal, S as parseToolScope, _ as tokenCanAny, a as getApiToken, b as classifyRegistrationScope, c as hasBearerHeader, d as revokeAllApiTokens, f as revokeApiToken, g as tokenCanAll, h as tokenCan, i as createBearerTokenMiddleware, j as installAgentPrincipal, l as parseApiToken, n as MemoryApiTokenStore, o as getApiTokenOrFail, r as createApiToken, s as getUserApiTokens, t as API_TOKEN_KEY, u as readBearerToken, v as verifyApiToken, x as expandToolScopes, y as AGENT_TOOL_NAME_PATTERN } from "./api-token-1-INqeVU.js";
19
+ import { C as scopesAllowTool, M as installAgentSharedProps, N as markAgentDispatch, P as readAgentPrincipal, S as parseToolScope, _ as tokenCanAny, a as getApiToken, b as classifyRegistrationScope, c as hasBearerHeader, d as revokeAllApiTokens, f as revokeApiToken, g as tokenCanAll, h as tokenCan, i as createBearerTokenMiddleware, j as installAgentPrincipal, l as parseApiToken, n as MemoryApiTokenStore, o as getApiTokenOrFail, r as createApiToken, s as getUserApiTokens, t as API_TOKEN_KEY, u as readBearerToken, v as verifyApiToken, x as expandToolScopes, y as AGENT_TOOL_NAME_PATTERN } from "./api-token-Cs1myxf6.js";
18
20
  import { o as AuthenticationException, r as getAuthContext, t as AUTH_CONTEXT_KEY } from "./context--l2HdOhy.js";
19
21
  import { a as md5, c as sha256, d as verifyPassword, i as hmac, l as sha512, n as hash, o as needsRehash, r as hashPassword, s as secureCompare, t as check, u as verifyHmac } from "./Hash-D2DFd8xX.js";
20
22
  import { t as redactQueryParams } from "./redact-query-params-Ba-sAfcP.js";
@@ -24,16 +26,16 @@ import { a as RedisStore, i as FileStore, n as createCacheManager, o as MemorySt
24
26
  import { n as createRedisClient, r as RedisSessionStore } from "./client-C5Wj9P9o.js";
25
27
  import { c as isDevCenterFeedbackRequest, i as loadRuntimeErrorsModule, l as isMcpEndpointEnabled, r as captureRuntimeError, t as RUNTIME_ERRORS_BINDING } from "./runtime-error-capture-DLRXwp0d.js";
26
28
  import { n as isHotReloadRuntime, r as matchingOpenParen, t as claimHotDisposable } from "./hot-disposables-W2fH-GID.js";
27
- 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-D04a3R02.js";
29
+ import { a as setBroadcastManager, c as createWebSocketOriginGuard, i as getBroadcastManager, n as BroadcastManager, o as RedisDriver, r as createBroadcastManager, s as MemoryDriver, t as createTypedBroadcaster } from "./broadcasting-Bh6QoMpy.js";
28
30
  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";
29
31
  import { n as isAgentToolRequest } from "./agent-request-Caj6bnbj.js";
30
32
  import { a as cannot, f as setGate, h as hasComposedMessage, i as can, l as getGate, m as NotFoundHttpException, n as Response$1, o as createGate, p as AuthorizationException, r as authorize, s as defineGate, t as Gate } from "./Gate-BHyDcDKo.js";
31
33
  import { r as isDocsViewerEnabled } from "./endpoint-CTIzcagh.js";
32
- import { n as isWildcardHost, t as formatHostPort } from "./host-port-t6wQFaRu.js";
33
- import { C as stopBunServerBounded, S as stopActiveViteDevServer, _ as registerBunTeardown, b as setActiveBunServer, c as isViteProduction, d as startViteDevServer, g as hotReloadStopBound, h as getGlobalState, i as clientManifestCandidates, l as loadViteManifest, m as closeOwnedViteDevServer, n as INJECTED_CLIENT_MANIFEST_SOURCE, o as getManifestFile, p as adoptViteDevServer, r as PUBLIC_ASSETS_URL_PREFIX, s as injectedClientManifest, u as normalizeDevServerUrl, v as releaseActiveBunServer, x as stopActiveBunServer, y as reusableActiveViteDevServer } from "./vite-manifest-DO0pU1vm.js";
34
+ import { c as isViteProduction, d as formatHostPort, f as isWildcardHost, i as clientManifestCandidates, l as loadViteManifest, n as INJECTED_CLIENT_MANIFEST_SOURCE, o as getManifestFile, r as PUBLIC_ASSETS_URL_PREFIX, s as injectedClientManifest, u as normalizeDevServerUrl } from "./vite-manifest-BdXRybeq.js";
35
+ import { a as closeOwnedViteDevServer, c as registerBunTeardown, d as setActiveBunServer, f as stopActiveBunServer, i as adoptViteDevServer, l as releaseActiveBunServer, m as stopBunServerBounded, n as startViteDevServer, o as getGlobalState, p as stopActiveViteDevServer, s as hotReloadStopBound, t as readViteDevServerPort, u as reusableActiveViteDevServer } from "./vite-dev-server-Ag90otai.js";
34
36
  import { readObjectSchema, toJsonSchema } from "./internal/zod-json-schema.js";
35
- import { a as RequestFinished, c as UserLoggedOut, d as EventManager, f as createEventManager, i as JobProcessed, l as createQueueEventDispatcher, n as ApplicationStarted, o as RequestReceived, p as Event, r as JobFailed, s as UserAuthenticated, t as ApplicationShutdown, u as Listener } from "./events-B6gfJkCH.js";
36
37
  import { a as NotificationManager, c as setNotificationManager, d as getNotification, f as registerNotification, i as MailChannel, l as resolveNotifiableType, n as SlackChannel, o as createNotificationManager, p as Notification, r as DatabaseChannel, s as getNotificationManager, t as MemoryChannel, u as clearNotificationRegistry } from "./notifications-DV5Yr6Fl.js";
38
+ import { a as RequestFinished, c as UserLoggedOut, d as EventManager, f as createEventManager, i as JobProcessed, l as createQueueEventDispatcher, n as ApplicationStarted, o as RequestReceived, r as JobFailed, s as UserAuthenticated, t as ApplicationShutdown, u as Listener } from "./events-DW197Nur.js";
37
39
  import { a as getJob, d as resolveQueueDriver, f as setQueueDriver, l as registerJob, n as clearJobRegistry, o as getQueueDriver, r as clearQueueDriver, s as getRegisteredJobs, t as Job, u as resolveJobName } from "./Job-0Prk8k0z.js";
38
40
  import { a as processJob, c as RedisDriver$1, i as Worker, l as SyncDriver, n as createQueueManager, o as SqsDriver, r as FailedJobReporter, s as createSqsAdapter, t as QueueManager, u as MemoryDriver$1 } from "./queue-K4Bi6NRy.js";
39
41
  import { a as MailManager, c as MemoryTransport, i as setMailManager, l as ResendTransport, n as getMailManager, o as createMailManager, r as mail, s as LogTransport, t as Mail, u as SmtpTransport } from "./mail-BQ2y2U5c.js";
@@ -41,7 +43,7 @@ import { a as LOG_LEVEL_PRIORITY, i as matchDailyFileDate, n as dailyFileDateSta
41
43
  import { a as FileChannel, i as setLogManager, n as createLogManager, o as ConsoleChannel, r as getLogManager, t as LogManager } from "./logging-Br9bZlaG.js";
42
44
  import { a as random, c as randomHex, d as sample, f as shuffle, i as pick, l as randomInt, m as uuid, n as generatePassword, o as randomBase64, p as urlSafeToken, r as generateSlug, s as randomBase64Url, t as generateOtp, u as randomString } from "./Random-S0OvCuR8.js";
43
45
  import { a as decrypt, c as getEncrypter, i as createEncrypter, l as setEncrypter, n as verifySignedUrl, o as encrypt, r as Encrypter, s as generateKey, t as signUrl } from "./encryption-BS-FGkqS.js";
44
- import { a as LocalDriver, i as S3Driver, n as createStorageManager, r as MemoryDriver$2, t as StorageManager } from "./storage-YPbsV9ju.js";
46
+ import { a as LocalDriver, i as S3Driver, n as createStorageManager, r as MemoryDriver$2, t as StorageManager } from "./storage-ziIKgHON.js";
45
47
  import { a as CacheCheck, c as HealthManager, i as StorageCheck, l as createHealthManager, n as customCheck, o as RedisCheck, r as MemoryCheck, s as DatabaseCheck, t as CustomCheck, u as HealthCheck } from "./health-Wi_05kkf.js";
46
48
  import { a as ScheduledTask, c as isDue, d as parseCron, f as toTimezone, i as Schedule, l as isDueInTimezone, n as createScheduler, o as getNextOccurrence, p as MemorySchedulerLock, r as PendingSchedule, s as getNextOccurrences, t as Scheduler, u as matchesCron } from "./scheduling-iLkx4gID.js";
47
49
  import { Hono } from "hono";
@@ -229,7 +231,36 @@ async function resolveModelBinding({ model, key }, value) {
229
231
  * `schemas` and the spread OpenAPI metadata still alias the registry.
230
232
  */
231
233
  function cloneAgentMetadata(metadata) {
232
- return structuredClone(metadata);
234
+ if (metadata.ui === void 0) return structuredClone(metadata);
235
+ const { ui, ...rest } = metadata;
236
+ return {
237
+ ...structuredClone(rest),
238
+ ui: structuredClone(pageIdsOf(ui))
239
+ };
240
+ }
241
+ /**
242
+ * A generated `PageContract` reduced to its id, since its `props()` method is
243
+ * what `structuredClone` throws on. Everything else is kept as written for
244
+ * `deriveAgentToolUi()` to judge, so a malformed declaration is reported as written.
245
+ */
246
+ function pageIdsOf(ui) {
247
+ if (isPageLike(ui) && ("visibility" in ui || "page" in ui)) {
248
+ const { visibility, page } = ui;
249
+ return {
250
+ id: ui.id,
251
+ visibility,
252
+ page
253
+ };
254
+ }
255
+ if (isPageLike(ui)) return ui.id;
256
+ if (typeof ui === "object" && ui !== null && isPageLike(ui.page)) return {
257
+ ...ui,
258
+ page: ui.page.id
259
+ };
260
+ return ui;
261
+ }
262
+ function isPageLike(value) {
263
+ return typeof value === "object" && value !== null && typeof value.id === "string";
233
264
  }
234
265
  /**
235
266
  * Group scopes unwind synchronously, so an `async` callback registers routes
@@ -2181,9 +2212,14 @@ function attachAuthContext(contextFactory) {
2181
2212
  await next();
2182
2213
  };
2183
2214
  }
2184
- function refuse$1(ctx, options, status, message) {
2215
+ function refuse$1(ctx, options, status, message, pageMessage) {
2185
2216
  if (options.redirectTo) return isAgentToolRequest(ctx) ? jsonResponse({ message }, status) : ctx.redirect(options.redirectTo);
2186
- return options.responseFactory ? options.responseFactory() : jsonResponse({ message }, status);
2217
+ if (options.responseFactory) return options.responseFactory();
2218
+ if (!isAgentToolRequest(ctx) && wantsHtmlResponse(ctx)) return new Response(renderErrorPage(status, pageMessage), {
2219
+ status,
2220
+ headers: { "Content-Type": "text/html; charset=UTF-8" }
2221
+ });
2222
+ return jsonResponse({ message }, status);
2187
2223
  }
2188
2224
  function requireAuthenticated(options = {}) {
2189
2225
  const { status = 401 } = options;
@@ -2199,7 +2235,7 @@ function requireGuest(options = {}) {
2199
2235
  return stampCapabilities(async (ctx, next) => {
2200
2236
  const auth = getAuthContext(ctx);
2201
2237
  if (!auth) throw new Error("Auth context has not been attached. Did you register the auth middleware?");
2202
- if (!await auth.guest()) return refuse$1(ctx, options, status, "Already authenticated");
2238
+ if (!await auth.guest()) return refuse$1(ctx, options, status, "Already authenticated", "You are already signed in.");
2203
2239
  await next();
2204
2240
  }, { authentication: { mode: "guest-only" } });
2205
2241
  }
@@ -3223,6 +3259,11 @@ function deriveAgentTools(definitions) {
3223
3259
  warnings.push(`${toolName}: ${where} (route "${routeName}") claims a tool name already derived from ${existing.method} ${existing.path} (route "${existing.routeName}") — the later route is not exposed. Give one of them a distinct agent toolName.`);
3224
3260
  continue;
3225
3261
  }
3262
+ const ui = agent.ui === void 0 ? void 0 : deriveAgentToolUi(agent.ui);
3263
+ if (typeof ui === "string") {
3264
+ warnings.push(`${toolName}: ${where} (route "${routeName}") declares a malformed agent ui (${ui}), so it is not exposed as a tool.`);
3265
+ continue;
3266
+ }
3226
3267
  const toolWarnings = [];
3227
3268
  const readOnlyHint = agent.readOnlyHint ?? READ_ONLY_METHODS.has(method);
3228
3269
  const input = buildInputSchema(definition, method, toolWarnings);
@@ -3235,6 +3276,7 @@ function deriveAgentTools(definitions) {
3235
3276
  inputSchema: input.schema,
3236
3277
  inputSources: input.sources,
3237
3278
  inputBodyNested: input.nestedBody,
3279
+ ...input.collisions.length > 0 ? { inputCollisions: input.collisions } : {},
3238
3280
  outputSchema: buildOutputSchema(definition, method, toolWarnings),
3239
3281
  resource: definition.schemas?.output ? void 0 : definition.resource,
3240
3282
  annotations: {
@@ -3249,6 +3291,7 @@ function deriveAgentTools(definitions) {
3249
3291
  mcp: agent.expose?.mcp ?? true,
3250
3292
  webMcp: agent.expose?.webMcp ?? true
3251
3293
  },
3294
+ ...ui ? { ui } : {},
3252
3295
  warnings: toolWarnings
3253
3296
  };
3254
3297
  claimed.set(toolName, tool);
@@ -3265,6 +3308,7 @@ function buildInputSchema(definition, method, warnings) {
3265
3308
  const merged = {
3266
3309
  properties: Object.create(null),
3267
3310
  required: /* @__PURE__ */ new Set(),
3311
+ collisions: /* @__PURE__ */ new Set(),
3268
3312
  owner: /* @__PURE__ */ new Map()
3269
3313
  };
3270
3314
  const pathParamNames = extractPathParamNames(definition.path);
@@ -3300,7 +3344,8 @@ function buildInputSchema(definition, method, warnings) {
3300
3344
  ...required.length > 0 ? { required } : {}
3301
3345
  },
3302
3346
  sources: { ...sources },
3303
- nestedBody
3347
+ nestedBody,
3348
+ collisions: Array.from(merged.collisions)
3304
3349
  };
3305
3350
  }
3306
3351
  /**
@@ -3311,7 +3356,10 @@ function buildInputSchema(definition, method, warnings) {
3311
3356
  function mergeProperties(merged, properties, required, source, warnings) {
3312
3357
  for (const [name, schema] of Object.entries(properties)) {
3313
3358
  const previous = merged.owner.get(name);
3314
- if (previous) warnings.push(`input key "${name}" is declared by both the ${previous} and the ${source} schema; the ${source} definition wins. Rename one — merged tool input has one namespace.`);
3359
+ if (previous) {
3360
+ merged.collisions.add(name);
3361
+ warnings.push(`input key "${name}" is declared by both the ${previous} and the ${source} schema; the ${source} definition wins. Rename one — merged tool input has one namespace.`);
3362
+ }
3315
3363
  merged.properties[name] = schema;
3316
3364
  merged.owner.set(name, source);
3317
3365
  merged.required.delete(name);
@@ -3340,6 +3388,44 @@ function deriveAuthorization(definition, method) {
3340
3388
  const ability = derivableAbility(definition.capabilities?.authorization, method);
3341
3389
  return ability === void 0 ? void 0 : { ability };
3342
3390
  }
3391
+ const UI_AUDIENCES = /* @__PURE__ */ new Set(["model", "app"]);
3392
+ /** Never throws, unlike `JSON.stringify` on a bigint: the derivation is total. */
3393
+ function describeEntry(entry) {
3394
+ try {
3395
+ return typeof entry === "string" ? JSON.stringify(entry) : String(entry);
3396
+ } catch {
3397
+ return `a ${typeof entry}`;
3398
+ }
3399
+ }
3400
+ function pageIdOf(value) {
3401
+ if (typeof value !== "object" || value === null) return void 0;
3402
+ const id = value.id;
3403
+ return typeof id === "string" ? id : void 0;
3404
+ }
3405
+ /**
3406
+ * The declared `ui` resolved, or why it is malformed. The one rule: the
3407
+ * derivation and `guren check` both judge a declaration through it.
3408
+ */
3409
+ function deriveAgentToolUi(declared) {
3410
+ const value = declared;
3411
+ if (pageIdOf(value) !== void 0 && ("visibility" in value || "page" in value)) return "a page contract mixed with { page, visibility } options; write { page, visibility }";
3412
+ const form = typeof value === "string" || pageIdOf(value) !== void 0 ? { page: value } : value;
3413
+ if (typeof form !== "object" || form === null || Array.isArray(form)) return "neither a page nor a { page, visibility } object";
3414
+ const { page: rawPage, visibility: rawVisibility } = form;
3415
+ const page = rawPage === void 0 ? void 0 : typeof rawPage === "string" ? rawPage : pageIdOf(rawPage);
3416
+ if (rawPage !== void 0 && page === void 0) return "a page that is neither a page id nor a page contract";
3417
+ if (page !== void 0 && page.trim() === "") return "an empty page id";
3418
+ if (page === void 0 && rawVisibility === void 0) return "neither a page nor a visibility";
3419
+ if (rawVisibility !== void 0 && !Array.isArray(rawVisibility)) return "a visibility that is not a list";
3420
+ const visibility = rawVisibility === void 0 ? ["model", "app"] : Array.from(rawVisibility);
3421
+ if (visibility.length === 0) return "an empty visibility list";
3422
+ const invalid = visibility.findIndex((entry) => typeof entry !== "string" || !UI_AUDIENCES.has(entry));
3423
+ if (invalid !== -1) return `the visibility entry ${describeEntry(visibility[invalid])}, which is neither "model" nor "app"`;
3424
+ return {
3425
+ ...page !== void 0 ? { page } : {},
3426
+ visibility: Array.from(new Set(visibility))
3427
+ };
3428
+ }
3343
3429
  //#endregion
3344
3430
  //#region src/introspection/plain-json.ts
3345
3431
  /**
@@ -3625,7 +3711,7 @@ let devBanner;
3625
3711
  */
3626
3712
  async function loadDevBanner() {
3627
3713
  if (typeof process === "undefined") return devBanner;
3628
- if (process.env.NODE_ENV !== "production") devBanner ??= await import("./dev-banner-BUrHz-LF.js").then((n) => n.n);
3714
+ if (process.env.NODE_ENV !== "production") devBanner ??= await import("./dev-banner-DGxB3HGY.js").then((n) => n.n);
3629
3715
  return devBanner;
3630
3716
  }
3631
3717
  /**
@@ -3886,8 +3972,8 @@ var Application = class {
3886
3972
  this.bootSequence ??= new BootSequence([
3887
3973
  () => this.options.boot?.(this.hono),
3888
3974
  () => this.mountRoutes(),
3889
- () => this.mountDevEndpoint(isMcpEndpointEnabled(), async () => (await import("./McpServiceProvider-CXOokGax.js").then((n) => n.n)).McpServiceProvider, "GUREN_MCP=1 but the MCP endpoint could not load — is @guren/cli installed?"),
3890
- () => 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?"),
3975
+ () => this.mountDevEndpoint(isMcpEndpointEnabled(), async () => (await import("./McpServiceProvider-BOeQyt7u.js").then((n) => n.n)).McpServiceProvider, "GUREN_MCP=1 but the MCP endpoint could not load — is @guren/cli installed?"),
3976
+ () => this.mountDevEndpoint(isDocsViewerEnabled(), async () => (await import("./DocsViewerServiceProvider-DzrxQoYh.js")).DocsViewerServiceProvider, "GUREN_DOCS=1 but the docs viewer could not load — is @guren/cli resolvable from this app?"),
3891
3977
  () => this.providerManager.bootAll(),
3892
3978
  () => this.warnOnUnconfiguredAuth()
3893
3979
  ]);
@@ -3993,7 +4079,7 @@ var Application = class {
3993
4079
  root: viteOptions?.root ?? process.cwd(),
3994
4080
  config: viteOptions?.config,
3995
4081
  host: viteOptions?.host,
3996
- port: viteOptions?.port
4082
+ port: viteOptions?.port ?? readViteDevServerPort()
3997
4083
  });
3998
4084
  adoptViteDevServer(this, server, localUrl);
3999
4085
  resolvedAssetsUrl = localUrl;
@@ -5048,7 +5134,8 @@ function createAgentInvocationPipeline(options) {
5048
5134
  principal: options.principal,
5049
5135
  abilities: options.abilities
5050
5136
  }) : built.request);
5051
- const outcome = await mapToolResponse(tool, await options.app.fetch(request, options.env, options.executionCtx));
5137
+ if (options.sharedProps) installAgentSharedProps(request, options.sharedProps);
5138
+ const outcome = await mapToolResponse(tool, await options.app.fetch(request, options.env, options.executionCtx), request.url);
5052
5139
  record.invoked(audited, auditArgs, outcome.status, elapsed(startedAt));
5053
5140
  return {
5054
5141
  status: "executed",
@@ -7806,4 +7893,4 @@ function defineStorageConfig(resolve) {
7806
7893
  //#region src/index.ts
7807
7894
  ensureErrorStackTracePolyfill();
7808
7895
  //#endregion
7809
- export { AGENT_APPROVAL_CONFIG_KEY, AGENT_AUDIT_BINDING, AGENT_REDACTED, AGENT_TOOL_NAME_PATTERN, API_TOKEN_KEY, APPROVAL_STATUS_TOOL_NAME, AUTH_CONTEXT_KEY, AgentApprovalRequested, AgentToolDenied, AgentToolInvoked, Application, ApplicationShutdown, ApplicationStarted, ScryptHasher as Argon2Hasher, ScryptHasher, AuthManager, Response$1 as AuthResponse, AuthServiceProvider, AuthenticatableModel, AuthenticationException, AuthorizationException, AuthorizationServiceProvider, AutoDiscovery, BUILT_IN_SESSION_DRIVERS, BaseFactory, BaseFactory as Factory, BaseSeeder, BaseSeeder as Seeder, BaseUserProvider, BroadcastManager, BroadcastServiceProvider, BufferedOutput, CONTAINER_CONTEXT_KEY, CSP_NONCE_KEY, CSRF_FORM_FIELD, CSRF_HEADER_NAME, CSRF_TOKEN_KEY, CacheCheck, CacheManager, CacheServiceProvider, Channel, Command, ConsoleChannel, ConsoleKernel, Container, Controller, CookieSessionStore, CursorPaginator, CustomCheck, DEFAULT_AGENT_APPROVAL_TTL_MS, DEFAULT_AGENT_AUDIT_PATH, DEFAULT_APPROVAL_CONFIGURE_HINT, DEFAULT_SCOPE_SUBJECT, DEFAULT_SESSION_STORE_NAME, DailyFileChannel, DatabaseChannel, DatabaseCheck, DefaultHasher, DefaultHasher as Hash, Encrypter, EncryptionServiceProvider, Env, EnvSchema, EnvValidationError, EnvVar, ErrorServiceProvider, Event, EventManager, EventServiceProvider, ExceptionHandler, FailedJobReporter, FieldValidator, FileStore as FileCacheStore, FileChannel, FormRequest, Gate, HealthCheck, HealthManager, HealthServiceProvider, HttpException, I18nManager, I18nServiceProvider, InertiaServiceProvider, Input, Job, JobFailed, JobProcessed, JsonLoader, JsonResource, LOCALE_CONTEXT_KEY, LOG_LEVEL_PRIORITY, Listener, LocalDriver as LocalStorageDriver, LogManager, LogServiceProvider, LogTransport, Logger, Mail, MailChannel, MailManager, MailServiceProvider, MemoryApiTokenStore, MemoryDriver as MemoryBroadcastDriver, MemoryStore as MemoryCacheStore, MemoryChannel, MemoryCheck, MemoryDriver$1 as MemoryDriver, MemoryDriver$1 as MemoryQueueDriver, MemoryEmailVerificationStore, MemoryLoader, MemoryOAuthStateStore, MemoryPasswordResetStore, MemoryRateLimitStore, MemorySchedulerLock, MemorySessionStore, MemoryDriver$2 as MemoryStorageDriver, MemoryTransport, MessageSigner, MethodNotAllowedException, ModelUserProvider, NodeHasher, NotFoundHttpException, Notification, NotificationManager, NotificationServiceProvider, OAUTH_SESSION_BINDING_KEY, OAuthManager, OAuthServiceProvider, Output, PER_PROCESS_SESSION_DRIVERS, PORTABLE_AGENT_TOOL_NAME_PATTERN, PREFLIGHT_ARGUMENT, PREFLIGHT_TOOL_NAME, Paginator, PendingSchedule, Policy, PresenceChannel, PrivateChannel, ProviderManager, QueueManager, QueueServiceProvider, RESERVED_AGENT_TOOL_NAMES, RedisDriver as RedisBroadcastDriver, RedisStore as RedisCacheStore, RedisCheck, RedisDriver$1 as RedisDriver, RedisDriver$1 as RedisQueueDriver, RequestFinished, RequestReceived, ResendTransport, Resource, ResourceCollection, Router, S3Driver, SERVERLESS_RUNTIME_LABELS, Schedule, ScheduledTask, Scheduler, SchedulingServiceProvider, SeederRunner, ServiceProvider, SessionGuard, SessionManager, SlackChannel, SlidingWindowRateLimitStore, SmtpTransport, SqsDriver, StorageCheck, StorageManager, StorageServiceProvider, SyncDriver, SyncDriver as SyncQueueDriver, TaggedCache, TokenGuard, Translator, UserAuthenticated, UserLoggedOut, VALIDATED_DATA_KEY, ValidationException, Validator, ViewEngine, Worker, abort, abortIf, abortUnless, advertisesStructuredOutput, after, afterOrEqual, agentApprovalExpiredAt, agentApprovalFingerprint, agentApprovalPrincipalKey, agentApprovalStatusAt, agentApprovalUsableAt, agentApprovalVisibleTo, alpha, alphaDash, alphaNum, always, ambientBinding, ambientContainer, approvalStatusNotFoundMessage, array as arrayRule, attachAuthContext, authorize as authorizeAbility, authorizeAllMiddleware, authorizeMiddleware, authorizeResourceMiddleware, before, beforeOrEqual, between, boolean as booleanRule, buildAgentApprovalRequest, buildOAuthAuthorizeUrl, buildOAuthRedirectUrl, buildPasswordResetUrl, buildToolRequest, buildVerificationUrl, can, cannot, canonicalizeAgentApprovalInput, check as checkHash, classifyRegistrationScope, clearJobRegistry, clearNotificationRegistry, clearQueueDriver, collect, completeEmailVerification, completePasswordReset, confirmed, createAgentApprovalContext, createAgentAuditRecorder, createAgentCallBudget, createAgentInvocationPipeline, createApiToken, createApp, createAuditEmitter, createBearerTokenMiddleware, createBroadcastManager, createCacheManager, createConsoleKernel, createContainer, createCorsMiddleware, createCspMiddleware, createCsrfMiddleware, createDiscordOAuthProviderConfig, createEmailVerificationToken, createEncrypter, createEventManager, createExceptionHandler, createFacade, createFacades, createForceHttpsMiddleware, createGate, createGitHubOAuthProviderConfig, createGoogleOAuthProviderConfig, createHealthManager, createHostAuthorizationMiddleware, createI18n, createLogManager, createMailManager, createNotificationManager, createOAuthManager, createOAuthState, createPasswordResetToken, createQueueEventDispatcher, createQueueManager, createRateLimitMiddleware, createRedirectSafetyMiddleware, createRedisClient, createScheduler, createSecurityHeaders, createSeederRunner, createSessionMiddleware, createSqsAdapter, createStorageManager, createTypedBroadcaster, createValidator, createWebSocketOriginGuard, csrfField, cursorPaginate, custom, customCheck, dailyFileDateStamp, dailyFilePath, dateFormat, date as dateRule, debugErrorMiddleware, decodeCursor, decrypt, defaultApplication, defaultContainer, defer, defineCacheConfig, defineConfig, defineEnv, defineFactory, defineGate, defineHttpConfig, defineMailConfig, defineMiddleware, defineModule, defineOAuthConfig, definePlugin, definePolicy, defineQueueConfig, defineStorageConfig, deriveAgentTools, deriveAppKey, deriveAppKeyring, describeBuildFailure, detectLocaleMiddleware, detectServerlessRuntime, different, email as emailRule, encodeCursor, encrypt, endsWith, exchangeOAuthCode, exists, expandToolScopes, fetchOAuthUserProfile, file as fileRule, filterSensitiveData, formatValidationErrors, gateApproval, gatePreflight, gateToolCall, generateAppKey, generateKey, generateOtp, generatePassword, generateSlug, getApiToken, getApiTokenOrFail, getAppKeyringFromEnv, getBroadcastManager, getContainer, getCspNonce, getCsrfToken, getEncrypter, getExceptionHandler, getGate, getI18n, getInertiaSharedPropsResolver, getJob, getLogManager, getMailManager, getNextOccurrence, getNextOccurrences, getNotification, getNotificationManager, getPluralizationRule, getQueueDriver, getRateLimitInfo, getRegisteredJobs, getRequestContainer, getRequestLocale, getRequestTranslator, getSessionFromContext, getUserApiTokens, getValidatedData, hash, hashPassword, hmac, image as imageRule, inValues, inertia, integer, ip, ipv4, ipv6, isAlwaysProp, isDeferredProp, isDue, isDueInTimezone, isEmailVerified, isIntrospecting, isRawEnvKey, isReservedAgentToolName, isSafeRedirectUrl, jsonResponse, json as jsonRule, mail, mapToolResponse, matchDailyFileDate, matchesCron, max, maxFileSize, md5, mimes, min, minFileSize, mountModuleRoutes, needsRehash, normalizeAppKey, notIn, notifyApprovers, nullable, numeric, object as objectRule, paginate, parseApiToken, parseAppKey, parseAuditRecord, parseCron, parseOAuthRedirectUrl, parsePasswordResetUrl, parsePreviousAppKeys, parseRequestPayload, parseSignature, parseToolScope, parseVerificationUrl, pick, pluralizationRules, processJob, prototype, quickValidate, quickValidateOrThrow, random, randomBase64, randomBase64Url, randomHex, randomInt, randomString, readBearerToken, recordEnvReads, redactAgentArguments, regex, registerJob, registerNotification, renderDebugPage, renderDocument, renderErrorPage, requestIdMiddleware, requestLoggingMiddleware, requireAuthenticated, requireGuest, requireVerifiedEmail, required, requiredIf, requiredUnless, requiredWith, requiredWithout, resetCalledSeeders, resetDefaultApplication, resetRateLimit, resolve, resolveAgentAuditSink, resolveJobName, resolveNotifiableType, resolveOptional, resolveQueueDriver, revokeAllApiTokens, revokeApiToken, same, sample, sanitizeOAuthRedirect, scopedShape, scopesAllowTool, secureCompare, selectPluralForm, setBroadcastManager, setContainer, setEncrypter, setExceptionHandler, setGate, setI18n, setInertiaDocument, setInertiaSharedProps, setInertiaSsrRenderer, setLogManager, setMailManager, setNotificationManager, setQueueDriver, sha256, sha512, shareInertiaProps, shuffle, signUrl, size, startsWith, string as stringRule, t, tc, toApprovalStatusReport, toAuditRecord, toTimezone, tokenCan, tokenCanAll, tokenCanAny, tryGetI18n, tryGetRequestContainer, unique, url as urlRule, urlSafeToken, useAsDefaultApplication, uuid, uuid$1 as uuidRule, validate, validateRequest, validateRequestWith, validateSafe, verifyApiToken, verifyCsrfToken, verifyEmailToken, verifyHmac, verifyOAuthState, verifyPassword, verifyPasswordResetToken, verifySignedUrl, viteAsset, withAuthorization };
7896
+ export { AGENT_APPROVAL_CONFIG_KEY, AGENT_AUDIT_BINDING, AGENT_REDACTED, AGENT_TOOL_NAME_PATTERN, API_TOKEN_KEY, APPROVAL_STATUS_TOOL_NAME, AUTH_CONTEXT_KEY, AgentApprovalRequested, AgentToolDenied, AgentToolInvoked, Application, ApplicationShutdown, ApplicationStarted, ScryptHasher as Argon2Hasher, ScryptHasher, AuthManager, Response$1 as AuthResponse, AuthServiceProvider, AuthenticatableModel, AuthenticationException, AuthorizationException, AuthorizationServiceProvider, AutoDiscovery, BUILT_IN_SESSION_DRIVERS, BaseFactory, BaseFactory as Factory, BaseSeeder, BaseSeeder as Seeder, BaseUserProvider, BroadcastManager, BroadcastServiceProvider, BufferedOutput, CONTAINER_CONTEXT_KEY, CSP_NONCE_KEY, CSRF_FORM_FIELD, CSRF_HEADER_NAME, CSRF_TOKEN_KEY, CacheCheck, CacheManager, CacheServiceProvider, Channel, Command, ConsoleChannel, ConsoleKernel, Container, Controller, CookieSessionStore, CursorPaginator, CustomCheck, DEFAULT_AGENT_APPROVAL_TTL_MS, DEFAULT_AGENT_AUDIT_PATH, DEFAULT_APPROVAL_CONFIGURE_HINT, DEFAULT_SCOPE_SUBJECT, DEFAULT_SESSION_STORE_NAME, DailyFileChannel, DatabaseChannel, DatabaseCheck, DefaultHasher, DefaultHasher as Hash, Encrypter, EncryptionServiceProvider, Env, EnvSchema, EnvValidationError, EnvVar, ErrorServiceProvider, Event, EventManager, EventServiceProvider, ExceptionHandler, FailedJobReporter, FieldValidator, FileStore as FileCacheStore, FileChannel, FormRequest, Gate, HealthCheck, HealthManager, HealthServiceProvider, HttpException, I18nManager, I18nServiceProvider, InertiaServiceProvider, Input, Job, JobFailed, JobProcessed, JsonLoader, JsonResource, LOCALE_CONTEXT_KEY, LOG_LEVEL_PRIORITY, Listener, LocalDriver as LocalStorageDriver, LogManager, LogServiceProvider, LogTransport, Logger, Mail, MailChannel, MailManager, MailServiceProvider, MemoryApiTokenStore, MemoryDriver as MemoryBroadcastDriver, MemoryStore as MemoryCacheStore, MemoryChannel, MemoryCheck, MemoryDriver$1 as MemoryDriver, MemoryDriver$1 as MemoryQueueDriver, MemoryEmailVerificationStore, MemoryLoader, MemoryOAuthStateStore, MemoryPasswordResetStore, MemoryRateLimitStore, MemorySchedulerLock, MemorySessionStore, MemoryDriver$2 as MemoryStorageDriver, MemoryTransport, MessageSigner, MethodNotAllowedException, ModelUserProvider, NodeHasher, NotFoundHttpException, Notification, NotificationManager, NotificationServiceProvider, OAUTH_SESSION_BINDING_KEY, OAuthManager, OAuthServiceProvider, Output, PER_PROCESS_SESSION_DRIVERS, PORTABLE_AGENT_TOOL_NAME_PATTERN, PREFLIGHT_ARGUMENT, PREFLIGHT_TOOL_NAME, Paginator, PendingSchedule, Policy, PresenceChannel, PrivateChannel, ProviderManager, QueueManager, QueueServiceProvider, RESERVED_AGENT_TOOL_NAMES, RedisDriver as RedisBroadcastDriver, RedisStore as RedisCacheStore, RedisCheck, RedisDriver$1 as RedisDriver, RedisDriver$1 as RedisQueueDriver, RequestFinished, RequestReceived, ResendTransport, Resource, ResourceCollection, Router, S3Driver, SERVERLESS_RUNTIME_LABELS, Schedule, ScheduledTask, Scheduler, SchedulingServiceProvider, SeederRunner, ServiceProvider, SessionGuard, SessionManager, SlackChannel, SlidingWindowRateLimitStore, SmtpTransport, SqsDriver, StorageCheck, StorageManager, StorageServiceProvider, SyncDriver, SyncDriver as SyncQueueDriver, TaggedCache, TokenGuard, Translator, UserAuthenticated, UserLoggedOut, VALIDATED_DATA_KEY, ValidationException, Validator, ViewEngine, Worker, abort, abortIf, abortUnless, advertisesStructuredOutput, after, afterOrEqual, agentApprovalExpiredAt, agentApprovalFingerprint, agentApprovalPrincipalKey, agentApprovalStatusAt, agentApprovalUsableAt, agentApprovalVisibleTo, alpha, alphaDash, alphaNum, always, ambientBinding, ambientContainer, approvalStatusNotFoundMessage, array as arrayRule, attachAuthContext, authorize as authorizeAbility, authorizeAllMiddleware, authorizeMiddleware, authorizeResourceMiddleware, before, beforeOrEqual, between, boolean as booleanRule, broadcastChannelsOf, broadcastNameOf, buildAgentApprovalRequest, buildOAuthAuthorizeUrl, buildOAuthRedirectUrl, buildPasswordResetUrl, buildToolRequest, buildVerificationUrl, can, cannot, canonicalizeAgentApprovalInput, check as checkHash, classifyRegistrationScope, clearJobRegistry, clearNotificationRegistry, clearQueueDriver, collect, completeEmailVerification, completePasswordReset, confirmed, createAgentApprovalContext, createAgentAuditRecorder, createAgentCallBudget, createAgentInvocationPipeline, createApiToken, createApp, createAuditEmitter, createBearerTokenMiddleware, createBroadcastManager, createCacheManager, createConsoleKernel, createContainer, createCorsMiddleware, createCspMiddleware, createCsrfMiddleware, createDiscordOAuthProviderConfig, createEmailVerificationToken, createEncrypter, createEventManager, createExceptionHandler, createFacade, createFacades, createForceHttpsMiddleware, createGate, createGitHubOAuthProviderConfig, createGoogleOAuthProviderConfig, createHealthManager, createHostAuthorizationMiddleware, createI18n, createLogManager, createMailManager, createNotificationManager, createOAuthManager, createOAuthState, createPasswordResetToken, createQueueEventDispatcher, createQueueManager, createRateLimitMiddleware, createRedirectSafetyMiddleware, createRedisClient, createScheduler, createSecurityHeaders, createSeederRunner, createSessionMiddleware, createSqsAdapter, createStorageManager, createTypedBroadcaster, createValidator, createWebSocketOriginGuard, csrfField, cursorPaginate, custom, customCheck, dailyFileDateStamp, dailyFilePath, dateFormat, date as dateRule, debugErrorMiddleware, decodeCursor, decrypt, defaultApplication, defaultContainer, defer, defineCacheConfig, defineConfig, defineEnv, defineFactory, defineGate, defineHttpConfig, defineMailConfig, defineMiddleware, defineModule, defineOAuthConfig, definePlugin, definePolicy, defineQueueConfig, defineStorageConfig, deriveAgentToolUi, deriveAgentTools, deriveAppKey, deriveAppKeyring, describeBuildFailure, detectLocaleMiddleware, detectServerlessRuntime, different, email as emailRule, encodeCursor, encrypt, endsWith, exchangeOAuthCode, exists, expandToolScopes, fetchOAuthUserProfile, file as fileRule, filterSensitiveData, formatValidationErrors, gateApproval, gatePreflight, gateToolCall, generateAppKey, generateKey, generateOtp, generatePassword, generateSlug, getApiToken, getApiTokenOrFail, getAppKeyringFromEnv, getBroadcastManager, getContainer, getCspNonce, getCsrfToken, getEncrypter, getExceptionHandler, getGate, getI18n, getInertiaSharedPropsResolver, getJob, getLogManager, getMailManager, getNextOccurrence, getNextOccurrences, getNotification, getNotificationManager, getPluralizationRule, getQueueDriver, getRateLimitInfo, getRegisteredJobs, getRequestContainer, getRequestLocale, getRequestTranslator, getSessionFromContext, getUserApiTokens, getValidatedData, hash, hashPassword, hmac, image as imageRule, inValues, inertia, integer, ip, ipv4, ipv6, isAlwaysProp, isDeferredProp, isDue, isDueInTimezone, isEmailVerified, isIntrospecting, isLiveProp, isRawEnvKey, isReservedAgentToolName, isSafeRedirectUrl, jsonResponse, json as jsonRule, live, mail, mapToolResponse, matchDailyFileDate, matchesCron, max, maxFileSize, md5, mimes, min, minFileSize, mountModuleRoutes, needsRehash, normalizeAppKey, notIn, notifyApprovers, nullable, numeric, object as objectRule, paginate, parseApiToken, parseAppKey, parseAuditRecord, parseCron, parseOAuthRedirectUrl, parsePasswordResetUrl, parsePreviousAppKeys, parseRequestPayload, parseSignature, parseToolScope, parseVerificationUrl, pick, pluralizationRules, processJob, prototype, quickValidate, quickValidateOrThrow, random, randomBase64, randomBase64Url, randomHex, randomInt, randomString, readBearerToken, recordEnvReads, redactAgentArguments, regex, registerJob, registerNotification, renderDebugPage, renderDocument, renderErrorPage, requestIdMiddleware, requestLoggingMiddleware, requireAuthenticated, requireGuest, requireVerifiedEmail, required, requiredIf, requiredUnless, requiredWith, requiredWithout, resetCalledSeeders, resetDefaultApplication, resetRateLimit, resolve, resolveAgentAuditSink, resolveJobName, resolveNotifiableType, resolveOptional, resolveQueueDriver, revokeAllApiTokens, revokeApiToken, same, sample, sanitizeOAuthRedirect, scopedShape, scopesAllowTool, secureCompare, selectPluralForm, setBroadcastManager, setContainer, setEncrypter, setExceptionHandler, setGate, setI18n, setInertiaDocument, setInertiaSharedProps, setInertiaSsrRenderer, setLogManager, setMailManager, setNotificationManager, setQueueDriver, sha256, sha512, shareInertiaProps, shuffle, signUrl, size, startsWith, string as stringRule, t, tc, toApprovalStatusReport, toAuditRecord, toTimezone, tokenCan, tokenCanAll, tokenCanAny, tryGetI18n, tryGetRequestContainer, unique, url as urlRule, urlSafeToken, useAsDefaultApplication, uuid, uuid$1 as uuidRule, validate, validateRequest, validateRequestWith, validateSafe, verifyApiToken, verifyCsrfToken, verifyEmailToken, verifyHmac, verifyOAuthState, verifyPassword, verifyPasswordResetToken, verifySignedUrl, viteAsset, withAuthorization };
@@ -39,3 +39,11 @@ export declare function readAgentPrincipal(request: Request): InstalledAgentPrin
39
39
  export declare function markAgentDispatch(request: Request): Request;
40
40
  /** Whether the pipeline dispatched this exact request object. */
41
41
  export declare function isAgentDispatch(request: Request): boolean;
42
+ /**
43
+ * Mark `request` as allowed only the named shared Inertia props (RFC 0038 §6),
44
+ * returning that same object. A surface opts in through the pipeline's
45
+ * `sharedProps`; nothing on the wire can ask for it, and nothing can widen it.
46
+ */
47
+ export declare function installAgentSharedProps(request: Request, keys: readonly string[]): Request;
48
+ /** The shared props this exact request may carry, or `undefined` for all of them. */
49
+ export declare function readAgentSharedProps(request: Request): ReadonlySet<string> | undefined;
@@ -8,6 +8,7 @@
8
8
  export { Controller } from '../mvc/Controller.js';
9
9
  export type { InertiaPageContractLike, InertiaResponseOptions } from '../mvc/Controller.js';
10
10
  export { acceptsJson, buildInertiaPage, INERTIA_VARY, mergeInertiaVary, serializePage } from '../mvc/inertia/InertiaEngine.js';
11
+ export { always, defer, live } from '../mvc/inertia/props.js';
11
12
  export { withDefaultHeaders } from '../support/default-headers.js';
12
13
  export { Resource, JsonResource, collect } from '../http/resources/Resource.js';
13
14
  export { ValidationException } from '../errors/exceptions/ValidationException.js';
@@ -1,6 +1,6 @@
1
- import { S as serializePage, T as withDefaultHeaders, _ as INERTIA_VARY, f as definePlugin, i as Controller, n as Resource, r as collect, t as JsonResource, u as defineModule, v as acceptsJson, x as mergeInertiaVary, y as buildInertiaPage } from "../Resource-y-7zzZSB.js";
1
+ import { D as defer, E as always, S as serializePage, T as withDefaultHeaders, _ as INERTIA_VARY, f as definePlugin, i as Controller, j as live, n as Resource, r as collect, t as JsonResource, u as defineModule, v as acceptsJson, x as mergeInertiaVary, y as buildInertiaPage } from "../Resource-PhnO_wNO.js";
2
2
  import { r as formatValidationErrors } from "../request-CLOYytGP.js";
3
3
  import { n as ValidationException } from "../errors-C8neC8go.js";
4
4
  import { n as ServiceProvider } from "../ServiceProvider-G0YclITd.js";
5
5
  import { o as AuthenticationException } from "../context--l2HdOhy.js";
6
- export { AuthenticationException, Controller, INERTIA_VARY, JsonResource, Resource, ServiceProvider, ValidationException, acceptsJson, buildInertiaPage, collect, defineModule, definePlugin, formatValidationErrors, mergeInertiaVary, serializePage, withDefaultHeaders };
6
+ export { AuthenticationException, Controller, INERTIA_VARY, JsonResource, Resource, ServiceProvider, ValidationException, acceptsJson, always, buildInertiaPage, collect, defer, defineModule, definePlugin, formatValidationErrors, live, mergeInertiaVary, serializePage, withDefaultHeaders };
package/dist/mcp/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as McpServiceProvider } from "../McpServiceProvider-CXOokGax.js";
1
+ import { t as McpServiceProvider } from "../McpServiceProvider-BOeQyt7u.js";
2
2
  export { McpServiceProvider };
@@ -125,6 +125,19 @@ export interface AgentRouteMetadata {
125
125
  approval?: 'required';
126
126
  /** Argument fields masked in agent audit logs. */
127
127
  redact?: string[];
128
+ /** Render this tool's result in an MCP Apps host with an Inertia page (RFC 0038). */
129
+ ui?: AgentUiPage | AgentRouteUi;
130
+ }
131
+ /** A page by id: a generated `PageContract` (anything with a string `id`), or the id itself. */
132
+ export type AgentUiPage = {
133
+ readonly id: string;
134
+ } | string;
135
+ /** The object form of `AgentRouteMetadata.ui` (RFC 0038 §1). */
136
+ export interface AgentRouteUi {
137
+ /** Absent for a tool a view calls but that renders no view of its own. */
138
+ page?: AgentUiPage;
139
+ /** MCP Apps `_meta.ui.visibility`. Default `['model', 'app']`. */
140
+ visibility?: ReadonlyArray<'model' | 'app'>;
128
141
  }
129
142
  /** A registered route definition, as handed out for introspection. */
130
143
  export interface RouteDefinition {
@@ -1,4 +1,5 @@
1
1
  import type { ContainerLike } from "../../container/types.js";
2
+ import { type LivePropEntry } from "./props.js";
2
3
  /**
3
4
  * Per-response form of {@link InertiaDocumentOptions}, already resolved to
4
5
  * strings. Each field overrides the app-wide
@@ -34,6 +35,8 @@ export interface InertiaPagePayload {
34
35
  version?: string;
35
36
  /** Deferred prop keys by group, announced on a full visit and fetched by the client per group. */
36
37
  deferredProps?: Record<string, string[]>;
38
+ /** Live prop listeners by key (RFC 0037): every live prop on a full visit, the resolved ones on a partial reload. */
39
+ liveProps?: Record<string, LivePropEntry>;
37
40
  }
38
41
  export interface InertiaSsrContext {
39
42
  page: InertiaPagePayload;
@@ -4,8 +4,10 @@
4
4
  * `@guren/testing`'s controller mock resolves through the same function, so a
5
5
  * test cannot pass on a prop set production would not send.
6
6
  */
7
+ import { type BroadcastTarget } from '../../broadcasting/event-target.js';
7
8
  declare const DEFERRED_BRAND: unique symbol;
8
9
  declare const ALWAYS_BRAND: unique symbol;
10
+ declare const LIVE_BRAND: unique symbol;
9
11
  export interface AlwaysProp<T> {
10
12
  readonly [ALWAYS_BRAND]: true;
11
13
  readonly value: T;
@@ -33,13 +35,60 @@ export interface DeferredProp<T> {
33
35
  */
34
36
  export declare function defer<T>(resolve: () => T, group?: string): DeferredProp<Awaited<T>>;
35
37
  export declare function isDeferredProp(value: unknown): value is DeferredProp<unknown>;
38
+ /** The wire shape of one `liveProps` entry, restated from `@inertiajs/core`, which the server does not depend on. */
39
+ export interface LivePropEntry {
40
+ readonly listeners: readonly LiveListener[];
41
+ /** Milliseconds between two reloads of the prop. */
42
+ readonly throttle?: number;
43
+ }
44
+ export interface LiveListener {
45
+ /** Unprefixed, as Inertia expects: the transport adds the prefix back. */
46
+ readonly channel: {
47
+ readonly name: string;
48
+ readonly type: LiveChannelType;
49
+ };
50
+ readonly events: readonly string[];
51
+ }
52
+ export type LiveChannelType = 'public' | 'private' | 'presence';
53
+ /** An event named by hand, for a sender that is not an event class. */
54
+ export interface LiveListenerInput {
55
+ readonly event: string;
56
+ /** Wire names, prefix included: `private-orders.1`, `presence-chat.2`, `announcements`. */
57
+ readonly channel: string | readonly string[];
58
+ }
59
+ export type LiveEvent = BroadcastTarget;
60
+ export interface LiveOptions {
61
+ /** Event instances (their channels and name are read off them) or hand-named listeners. */
62
+ readonly on: LiveEvent | LiveListenerInput | readonly (LiveEvent | LiveListenerInput)[];
63
+ /** Milliseconds between two reloads of this prop; the client's default when absent. */
64
+ readonly throttle?: number;
65
+ }
66
+ export interface LiveProp<V> {
67
+ readonly [LIVE_BRAND]: true;
68
+ readonly value: V;
69
+ readonly entry: LivePropEntry;
70
+ /** The value, as `always()` serializes, so props serialized before the engine sees them carry no brand. */
71
+ toJSON(): unknown;
72
+ }
73
+ /**
74
+ * A prop the client reloads whenever one of the given broadcast events
75
+ * arrives (Inertia's live props, RFC 0037). The entry is computed here, so a
76
+ * mistake throws in the action that wrote it. Wraps any other prop input.
77
+ */
78
+ export declare function live<V>(value: V, options: LiveOptions): LiveProp<V>;
79
+ export declare function isLiveProp(value: unknown): value is LiveProp<unknown>;
80
+ type PlainPropInput<T> = T | DeferredProp<T> | (() => T | Promise<T>);
81
+ type BasePropInput<T> = PlainPropInput<T> | AlwaysProp<PlainPropInput<T>>;
36
82
  /** What a controller may pass for a prop the page declares as `T`. */
37
- export type InertiaPropInput<T> = T | DeferredProp<T> | AlwaysProp<T> | (() => T | Promise<T>);
83
+ export type InertiaPropInput<T> = BasePropInput<T> | LiveProp<BasePropInput<T>>;
38
84
  export type InertiaPropsInput<Props> = {
39
85
  [K in keyof Props]: InertiaPropInput<Props[K]>;
40
86
  };
41
- /** The value the page receives for one prop input: a deferred, always or lazy prop as its resolved type. */
42
- export type ResolvedInertiaProp<V> = V extends DeferredProp<unknown> ? Awaited<ReturnType<V['resolve']>> : V extends AlwaysProp<unknown> ? V['value'] : V extends () => infer R ? Awaited<R> : V;
87
+ /**
88
+ * The value the page receives for one prop input. `always()` recurses: the
89
+ * resolver unwraps it and then runs a deferred or lazy value inside.
90
+ */
91
+ export type ResolvedInertiaProp<V> = V extends LiveProp<infer Inner> ? ResolvedInertiaProp<Inner> : V extends AlwaysProp<infer Inner> ? ResolvedInertiaProp<Inner> : V extends DeferredProp<unknown> ? Awaited<ReturnType<V['resolve']>> : V extends () => infer R ? Awaited<R> : V;
43
92
  export type ResolvedInertiaProps<Props> = {
44
93
  [K in keyof Props]: ResolvedInertiaProp<Props[K]>;
45
94
  };
@@ -52,6 +101,8 @@ export interface ResolvedInertiaPage {
52
101
  readonly props: Record<string, unknown>;
53
102
  /** Present on a full visit that carried at least one deferred prop. */
54
103
  readonly deferredProps?: Record<string, string[]>;
104
+ /** The listeners of every live prop the response resolves (all of them on a full visit). */
105
+ readonly liveProps?: Record<string, LivePropEntry>;
55
106
  }
56
107
  /**
57
108
  * The partial reload a request asks for, or undefined for a full visit. A
@@ -1,8 +1,10 @@
1
- import { a as trimTrailingSlashes, n as isRealPathWithin, t as isPathWithin } from "../contained-path-BkNSBljW.js";
1
+ import { n as trimTrailingSlashes } from "../trim-slashes-BLY9hKAa.js";
2
2
  import { n as parseImportMap } from "../inertia-defaults-BjrcT7za.js";
3
3
  import { n as hash } from "../Hash-D2DFd8xX.js";
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-BUrHz-LF.js";
4
+ import { a as getManifestCss, c as isViteProduction, i as clientManifestCandidates, l as loadViteManifest, o as getManifestFile, r as PUBLIC_ASSETS_URL_PREFIX, u as normalizeDevServerUrl } from "../vite-manifest-BdXRybeq.js";
5
+ import { n as startViteDevServer } from "../vite-dev-server-Ag90otai.js";
6
+ import { n as isRealPathWithin, t as isPathWithin } from "../contained-path-DOVauNQC.js";
7
+ import { r as logDevServerBanner, t as GUREN_ASCII_ART } from "../dev-banner-DGxB3HGY.js";
6
8
  import { createRequire } from "node:module";
7
9
  import { dirname, extname, join, resolve } from "node:path";
8
10
  import { fileURLToPath } from "node:url";
@@ -1,2 +1,2 @@
1
- import { a as LocalDriver, i as S3Driver, n as createStorageManager, r as MemoryDriver, t as StorageManager } from "../storage-YPbsV9ju.js";
1
+ import { a as LocalDriver, i as S3Driver, n as createStorageManager, r as MemoryDriver, t as StorageManager } from "../storage-ziIKgHON.js";
2
2
  export { LocalDriver, MemoryDriver, S3Driver, StorageManager, createStorageManager };
@@ -1,6 +1,7 @@
1
- import { i as trimSlashes, r as realPathOfNearestExisting, t as isPathWithin } from "./contained-path-BkNSBljW.js";
1
+ import { t as trimSlashes } from "./trim-slashes-BLY9hKAa.js";
2
2
  import { t as warnOnce } from "./warn-once-p-IlMjra.js";
3
3
  import { t as describeDriverMap } from "./driver-map-BhITaLcy.js";
4
+ import { r as realPathOfNearestExisting, t as isPathWithin } from "./contained-path-DOVauNQC.js";
4
5
  import { dirname, join, relative, resolve, sep } from "node:path";
5
6
  import { copyFile, lstat, mkdir, open, readFile, readdir, readlink, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
6
7
  import { existsSync } from "node:fs";
@@ -0,0 +1,22 @@
1
+ //#region src/support/trim-slashes.ts
2
+ /**
3
+ * No regex: patterns like `/\/+$/` backtrack quadratically on long slash runs
4
+ * mid-string, and several call sites feed request-derived paths.
5
+ *
6
+ * Twins that cannot import this module: `@guren/cli` (`src/utils.ts`) and
7
+ * `@guren/plugin-cloudflare` (`src/storage/R2Driver.ts`) — keep them in step.
8
+ */
9
+ function trimTrailingSlashes(value) {
10
+ let end = value.length;
11
+ while (end > 0 && value[end - 1] === "/") end--;
12
+ return value.slice(0, end);
13
+ }
14
+ function trimSlashes(value) {
15
+ let start = 0;
16
+ let end = value.length;
17
+ while (start < end && value[start] === "/") start++;
18
+ while (end > start && value[end - 1] === "/") end--;
19
+ return value.slice(start, end);
20
+ }
21
+ //#endregion
22
+ export { trimTrailingSlashes as n, trimSlashes as t };
@@ -1,2 +1,4 @@
1
1
  export { gurenVitePlugin as default, gurenVitePlugin } from './plugin.js';
2
2
  export type { GurenVitePluginOptions } from './plugin.js';
3
+ export { MCP_APP_MODE, MCP_APP_MODULE, MCP_APP_SETUP_FILE, renderPagesModule } from './mcp-app.js';
4
+ export type { GurenMcpAppOptions } from './mcp-app.js';