@guren/server 2.35.0 → 2.37.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/{DocsViewerServiceProvider-BVPZjwQp.js → DocsViewerServiceProvider-DzrxQoYh.js} +15 -4
- package/dist/Event-COT3f5Xd.js +28 -0
- package/dist/{McpServiceProvider-CXOokGax.js → McpServiceProvider-BOeQyt7u.js} +2 -0
- package/dist/PrivateChannel-1krGz028.js +187 -0
- package/dist/{Resource-y-7zzZSB.js → Resource-PhnO_wNO.js} +113 -12
- package/dist/agent/derive.d.ts +23 -1
- package/dist/agent/dispatch.d.ts +12 -1
- package/dist/agent/pipeline.d.ts +6 -0
- package/dist/agent/public.d.ts +1 -1
- package/dist/agent/public.js +1 -1
- package/dist/{api-token-1-INqeVU.js → api-token-Cs1myxf6.js} +15 -1
- package/dist/auth/SessionGuard.d.ts +20 -0
- package/dist/auth/index.js +2 -2
- package/dist/auth/providers/ModelUserProvider.d.ts +3 -0
- package/dist/auth/types.d.ts +7 -0
- package/dist/{auth-CO9MlQNE.js → auth-X27d4l78.js} +88 -6
- package/dist/broadcasting/BroadcastManager.d.ts +19 -5
- package/dist/broadcasting/event-target.d.ts +9 -0
- package/dist/broadcasting/index.d.ts +3 -1
- package/dist/broadcasting/index.js +3 -2
- package/dist/broadcasting/sender-envelope.d.ts +26 -0
- package/dist/broadcasting/types.d.ts +27 -2
- package/dist/{broadcasting-D04a3R02.js → broadcasting-Bh6QoMpy.js} +50 -95
- package/dist/{contained-path-BkNSBljW.js → contained-path-DOVauNQC.js} +1 -22
- package/dist/{dev-banner-BUrHz-LF.js → dev-banner-Uydpgbrm.js} +3 -3
- package/dist/{dispatch-ENWpBxbE.js → dispatch-CDNqcB3Q.js} +51 -12
- package/dist/events/index.js +2 -1
- package/dist/{events-B6gfJkCH.js → events-DW197Nur.js} +2 -28
- package/dist/http/vite-dev-server.d.ts +18 -1
- package/dist/http/vite-manifest.d.ts +4 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +110 -23
- package/dist/internal/agent-principal.d.ts +8 -0
- package/dist/internal/testing.d.ts +1 -0
- package/dist/internal/testing.js +2 -2
- package/dist/mail/index.js +1 -1
- package/dist/mail/types.d.ts +9 -0
- package/dist/{mail-BQ2y2U5c.js → mail-D4AP4_Wd.js} +6 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mvc/Router.d.ts +13 -0
- package/dist/mvc/inertia/InertiaEngine.d.ts +3 -0
- package/dist/mvc/inertia/props.d.ts +54 -3
- package/dist/runtime/index.js +5 -3
- package/dist/storage/index.js +1 -1
- package/dist/{storage-YPbsV9ju.js → storage-ziIKgHON.js} +2 -1
- package/dist/trim-slashes-BLY9hKAa.js +22 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.js +283 -1
- package/dist/vite/mcp-app.d.ts +59 -0
- package/dist/vite/plugin.d.ts +12 -0
- package/dist/{vite-manifest-DO0pU1vm.js → vite-dev-server-Ag90otai.js} +25 -114
- package/dist/vite-manifest-BdXRybeq.js +129 -0
- package/package.json +2 -2
- package/dist/host-port-t6wQFaRu.js +0 -15
|
@@ -168,30 +168,39 @@ function advertisesStructuredOutput(tool) {
|
|
|
168
168
|
* with the handler's body; other → capped text. An object-`outputSchema` success
|
|
169
169
|
* lacking an object becomes `isError`: the SDK client rejects it after the route ran.
|
|
170
170
|
*/
|
|
171
|
-
async function mapToolResponse(tool, response) {
|
|
171
|
+
async function mapToolResponse(tool, response, requestUrl) {
|
|
172
172
|
const status = response.status;
|
|
173
173
|
const structured = advertisesStructuredOutput(tool);
|
|
174
174
|
if (status === 204 || status >= 300 && status < 400) {
|
|
175
175
|
const location = response.headers.get("Location");
|
|
176
176
|
const text = location ? `HTTP ${status} (Location: ${location})` : `HTTP ${status}`;
|
|
177
|
-
|
|
177
|
+
const facts = location ? { location: resolveLocation(location, requestUrl) } : {};
|
|
178
|
+
if (structured) return {
|
|
179
|
+
...inconsistentOutput(tool, text, status),
|
|
180
|
+
...facts
|
|
181
|
+
};
|
|
178
182
|
return {
|
|
179
183
|
content: [{
|
|
180
184
|
type: "text",
|
|
181
185
|
text
|
|
182
186
|
}],
|
|
183
|
-
status
|
|
187
|
+
status,
|
|
188
|
+
...facts
|
|
184
189
|
};
|
|
185
190
|
}
|
|
186
191
|
const raw = await response.text();
|
|
187
|
-
if (status >= 400)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
if (status >= 400) {
|
|
193
|
+
const errors = status === 422 ? readValidationErrors(response, raw) : void 0;
|
|
194
|
+
return {
|
|
195
|
+
content: [{
|
|
196
|
+
type: "text",
|
|
197
|
+
text: raw || `HTTP ${status}`
|
|
198
|
+
}],
|
|
199
|
+
isError: true,
|
|
200
|
+
status,
|
|
201
|
+
...errors ? { errors } : {}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
195
204
|
const parsed = parseJsonBody(response, raw);
|
|
196
205
|
if (parsed === void 0) {
|
|
197
206
|
const text = raw.length > TEXT_RESPONSE_CAP ? `${raw.slice(0, TEXT_RESPONSE_CAP)}… [truncated ${raw.length - TEXT_RESPONSE_CAP} characters]` : raw;
|
|
@@ -213,13 +222,15 @@ async function mapToolResponse(tool, response) {
|
|
|
213
222
|
preflightVerdict: true
|
|
214
223
|
};
|
|
215
224
|
const payload = unwrapInertiaProps(tool, response, parsed);
|
|
225
|
+
const inertiaPage = tool.ui?.page === void 0 ? void 0 : readInertiaPage(response, parsed);
|
|
216
226
|
if (structured && !isRecord(payload)) return inconsistentOutput(tool, `a ${Array.isArray(payload) ? "JSON array" : typeof payload} body`, status);
|
|
217
227
|
const outcome = {
|
|
218
228
|
content: [{
|
|
219
229
|
type: "text",
|
|
220
230
|
text: JSON.stringify(payload)
|
|
221
231
|
}],
|
|
222
|
-
status
|
|
232
|
+
status,
|
|
233
|
+
...inertiaPage ? { inertiaPage } : {}
|
|
223
234
|
};
|
|
224
235
|
if (structured && isRecord(payload)) outcome.structuredContent = payload;
|
|
225
236
|
return outcome;
|
|
@@ -247,6 +258,34 @@ function parseJsonBody(response, raw) {
|
|
|
247
258
|
return;
|
|
248
259
|
}
|
|
249
260
|
}
|
|
261
|
+
function resolveLocation(location, requestUrl) {
|
|
262
|
+
if (!requestUrl) return location;
|
|
263
|
+
try {
|
|
264
|
+
return new URL(location, requestUrl).href;
|
|
265
|
+
} catch {
|
|
266
|
+
return location;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/** `{ errors: { field: string[] } }`, the body a non-Inertia request's `ValidationException` renders. */
|
|
270
|
+
function readValidationErrors(response, raw) {
|
|
271
|
+
const parsed = parseJsonBody(response, raw);
|
|
272
|
+
if (!isRecord(parsed) || !isRecord(parsed.errors)) return void 0;
|
|
273
|
+
const errors = {};
|
|
274
|
+
for (const [field, messages] of Object.entries(parsed.errors)) if (Array.isArray(messages)) errors[field] = messages.map((message) => String(message));
|
|
275
|
+
else if (typeof messages === "string") errors[field] = [messages];
|
|
276
|
+
return errors;
|
|
277
|
+
}
|
|
278
|
+
function readInertiaPage(response, parsed) {
|
|
279
|
+
if (response.headers.get("X-Inertia") !== "true" || !isRecord(parsed)) return void 0;
|
|
280
|
+
const { component, props, url, version } = parsed;
|
|
281
|
+
if (typeof component !== "string" || !isRecord(props) || typeof url !== "string") return void 0;
|
|
282
|
+
return {
|
|
283
|
+
component,
|
|
284
|
+
props,
|
|
285
|
+
url,
|
|
286
|
+
...typeof version === "string" ? { version } : {}
|
|
287
|
+
};
|
|
288
|
+
}
|
|
250
289
|
function unwrapInertiaProps(tool, response, parsed) {
|
|
251
290
|
if (tool.outputSchema) return parsed;
|
|
252
291
|
if (response.headers.get("X-Inertia") !== "true") return parsed;
|
package/dist/events/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as Event } from "../Event-COT3f5Xd.js";
|
|
2
|
+
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";
|
|
2
3
|
export { ApplicationShutdown, ApplicationStarted, Event, EventManager, JobFailed, JobProcessed, Listener, RequestFinished, RequestReceived, UserAuthenticated, UserLoggedOut, createEventManager, createQueueEventDispatcher };
|
|
@@ -1,32 +1,6 @@
|
|
|
1
1
|
import { t as warnOnce } from "./warn-once-p-IlMjra.js";
|
|
2
|
+
import { n as resolveEventName, t as Event } from "./Event-COT3f5Xd.js";
|
|
2
3
|
import { d as resolveQueueDriver, l as registerJob, p as reportRegistryCollision, t as Job } from "./Job-0Prk8k0z.js";
|
|
3
|
-
//#region src/events/Event.ts
|
|
4
|
-
/** Base class for all application events. */
|
|
5
|
-
var Event = class {
|
|
6
|
-
timestamp = /* @__PURE__ */ new Date();
|
|
7
|
-
/**
|
|
8
|
-
* Stable wire name: queued emits record it and the worker resolves the class
|
|
9
|
-
* back from it. Declare it as a static field to pin the name against a
|
|
10
|
-
* rename or identifier mangling.
|
|
11
|
-
* @default the class name
|
|
12
|
-
*/
|
|
13
|
-
static get eventName() {
|
|
14
|
-
return this.name;
|
|
15
|
-
}
|
|
16
|
-
get eventName() {
|
|
17
|
-
return resolveEventName(this.constructor);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Only an *own* `eventName` counts: statics are inherited, so reading the
|
|
22
|
-
* prototype chain would make every subclass of a pinned event claim its
|
|
23
|
-
* parent's name and take over its listeners. The base class's own entry is the
|
|
24
|
-
* accessor, which answers with the class name.
|
|
25
|
-
*/
|
|
26
|
-
function resolveEventName(eventClass) {
|
|
27
|
-
return (Object.prototype.hasOwnProperty.call(eventClass, "eventName") ? eventClass.eventName : void 0) ?? eventClass.name;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
4
|
//#region src/events/serialize.ts
|
|
31
5
|
/**
|
|
32
6
|
* Marks a `Date` inside a queued event's fields. A driver that JSON-encodes the
|
|
@@ -438,4 +412,4 @@ var ApplicationShutdown = class extends Event {
|
|
|
438
412
|
}
|
|
439
413
|
};
|
|
440
414
|
//#endregion
|
|
441
|
-
export { RequestFinished as a, UserLoggedOut as c, EventManager as d, createEventManager as f, JobProcessed as i, createQueueEventDispatcher as l, ApplicationStarted as n, RequestReceived as o,
|
|
415
|
+
export { RequestFinished as a, UserLoggedOut as c, EventManager as d, createEventManager as f, JobProcessed as i, createQueueEventDispatcher as l, ApplicationStarted as n, RequestReceived as o, JobFailed as r, UserAuthenticated as s, ApplicationShutdown as t, Listener as u };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { InlineConfig, ViteDevServer } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* The port `listen()` starts its managed Vite dev server on. `guren browser:serve`
|
|
4
|
+
* restates the name in packages/cli/src/browser-serve.ts; tests/browser-serve.test.ts pins the two.
|
|
5
|
+
*/
|
|
6
|
+
export declare const VITE_PORT_ENV = "GUREN_VITE_PORT";
|
|
2
7
|
export interface StartViteDevServerOptions {
|
|
3
8
|
root?: string;
|
|
4
9
|
config?: InlineConfig;
|
|
@@ -8,17 +13,29 @@ export interface StartViteDevServerOptions {
|
|
|
8
13
|
* the project root, unauthenticated. Pass `true` to expose it on the network.
|
|
9
14
|
*/
|
|
10
15
|
host?: boolean | string;
|
|
16
|
+
/**
|
|
17
|
+
* The port Vite tries first, moving to the next free one when it is busy unless
|
|
18
|
+
* the project sets `server.strictPort`. `listen()` falls back to `GUREN_VITE_PORT`,
|
|
19
|
+
* then to the project's Vite config (5173 with the Guren plugin).
|
|
20
|
+
*/
|
|
11
21
|
port?: number;
|
|
12
22
|
}
|
|
13
23
|
export interface StartedViteDevServer {
|
|
14
24
|
server: ViteDevServer;
|
|
25
|
+
/** Names the port Vite bound, which is not the one asked for after a walk. */
|
|
15
26
|
localUrl: string;
|
|
16
27
|
networkUrls: string[];
|
|
17
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* `GUREN_VITE_PORT` as a port, or `undefined` when it is unset or blank, so the
|
|
31
|
+
* project's Vite config decides. Throws on anything else: a typo silently
|
|
32
|
+
* ignored would put two apps back on the same port.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readViteDevServerPort(value?: string | undefined): number | undefined;
|
|
18
35
|
/**
|
|
19
36
|
* Build the inline config the managed dev server starts with. `server.host` is
|
|
20
37
|
* left undefined unless asked for, so Vite's config merge drops it and the
|
|
21
|
-
* project's own `vite.config.ts` decides.
|
|
38
|
+
* project's own `vite.config.ts` decides; `server.port` likewise.
|
|
22
39
|
*/
|
|
23
40
|
export declare function resolveViteDevServerConfig(options?: StartViteDevServerOptions): InlineConfig;
|
|
24
41
|
export declare function startViteDevServer(options?: StartViteDevServerOptions): Promise<StartedViteDevServer>;
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
* internal/deploy-build.ts; tests/http/vite-manifest.test.ts pins the two equal.
|
|
12
12
|
*/
|
|
13
13
|
export declare const PUBLIC_ASSETS_URL_PREFIX = "/public/assets/";
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* The Vite default the framework assumes when no dev-server URL is set. Not
|
|
16
|
+
* `GUREN_VITE_PORT`: a managed start publishes the URL Vite bound instead.
|
|
17
|
+
*/
|
|
15
18
|
export declare const DEFAULT_DEV_SERVER_URL = "http://localhost:5173";
|
|
16
19
|
/**
|
|
17
20
|
* Production for *asset* purposes: `NODE_ENV` says so and no dev server is
|
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
|
|
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-
|
|
8
|
-
import {
|
|
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-
|
|
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-X27d4l78.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
|
|
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,24 +26,24 @@ 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
|
|
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 {
|
|
33
|
-
import {
|
|
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
|
-
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-
|
|
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-D4AP4_Wd.js";
|
|
40
42
|
import { a as LOG_LEVEL_PRIORITY, i as matchDailyFileDate, n as dailyFileDateStamp, r as dailyFilePath, t as DailyFileChannel } from "./DailyFileChannel-CTTPA0EF.js";
|
|
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-
|
|
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
|
-
|
|
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)
|
|
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-
|
|
3714
|
+
if (process.env.NODE_ENV !== "production") devBanner ??= await import("./dev-banner-Uydpgbrm.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-
|
|
3890
|
-
() => this.mountDevEndpoint(isDocsViewerEnabled(), async () => (await import("./DocsViewerServiceProvider-
|
|
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
|
-
|
|
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';
|
package/dist/internal/testing.js
CHANGED
|
@@ -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-
|
|
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/mail/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-D4AP4_Wd.js";
|
|
2
2
|
export { LogTransport, Mail, MailManager, MemoryTransport, ResendTransport, SmtpTransport, createMailManager, getMailManager, mail, setMailManager };
|
package/dist/mail/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConnectionOptions } from 'node:tls';
|
|
1
2
|
/** Email address with optional display name. */
|
|
2
3
|
export interface MailAddress {
|
|
3
4
|
email: string;
|
|
@@ -67,6 +68,14 @@ export interface SmtpTransportOptions {
|
|
|
67
68
|
port?: number;
|
|
68
69
|
/** Use TLS. @default false */
|
|
69
70
|
secure?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Fail the send when the server does not upgrade with STARTTLS, rather than continue in cleartext.
|
|
73
|
+
* Without it, an on-path attacker can strip STARTTLS from the EHLO reply and read `auth`.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
requireTLS?: boolean;
|
|
77
|
+
/** Node TLS options for the connection, such as `ca` for a relay on a private CA. */
|
|
78
|
+
tls?: ConnectionOptions;
|
|
70
79
|
/** Authentication credentials. */
|
|
71
80
|
auth?: {
|
|
72
81
|
user: string;
|