@guren/server 2.16.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{McpServiceProvider-nNcbCIQX.js → McpServiceProvider-BvJRcDOm.js} +31 -3
- package/dist/agent/approval-status.d.ts +56 -0
- package/dist/agent/events.d.ts +6 -4
- package/dist/agent/gate.d.ts +118 -0
- package/dist/agent/pipeline.d.ts +234 -0
- package/dist/agent/scopes.d.ts +32 -0
- package/dist/auth/AgentPrincipalGuard.d.ts +49 -0
- package/dist/auth/AuthManager.d.ts +5 -5
- package/dist/auth/index.js +1 -1
- package/dist/{auth-CbdPH4Cd.js → auth-Gg54ppQi.js} +119 -26
- package/dist/http/Application.d.ts +18 -0
- package/dist/http/middleware/csrf.d.ts +14 -6
- package/dist/http/middleware/index.d.ts +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +456 -13
- package/dist/internal/agent-principal.d.ts +32 -0
- package/dist/mcp/create-mcp-server.d.ts +19 -0
- package/dist/mcp/index.js +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/{vite-manifest-CTQp-SOo.js → vite-manifest-DhbXfFct.js} +1 -1
- package/package.json +1 -1
|
@@ -277,6 +277,103 @@ function getSessionFromContext(ctx) {
|
|
|
277
277
|
return ctx.get(SESSION_CONTEXT_KEY);
|
|
278
278
|
}
|
|
279
279
|
//#endregion
|
|
280
|
+
//#region src/internal/agent-principal.ts
|
|
281
|
+
const installed = /* @__PURE__ */ new WeakMap();
|
|
282
|
+
/**
|
|
283
|
+
* Mark `request` as carrying `principal`, returning that same object — a copy
|
|
284
|
+
* would key the map on something the auth context never sees. Returning it is
|
|
285
|
+
* what makes the identity requirement hard to get wrong at a call site:
|
|
286
|
+
* `app.fetch(installAgentPrincipal(request, installed), env, ctx)`. Callers
|
|
287
|
+
* reach this through the pipeline's `handoff: 'seam'`, and the reader not at all.
|
|
288
|
+
*/
|
|
289
|
+
function installAgentPrincipal(request, value) {
|
|
290
|
+
installed.set(request, value);
|
|
291
|
+
return request;
|
|
292
|
+
}
|
|
293
|
+
/** The principal installed on this exact request object, or `undefined`. */
|
|
294
|
+
function readAgentPrincipal(request) {
|
|
295
|
+
return installed.get(request);
|
|
296
|
+
}
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/auth/providers/UserProvider.ts
|
|
299
|
+
/**
|
|
300
|
+
* Run a user record through the provider's optional `sanitize` before it leaves
|
|
301
|
+
* the auth layer. Every guard must call this on anything it returns from
|
|
302
|
+
* `user()` — a guard that forgets the ternary leaks password hashes, so the
|
|
303
|
+
* ternary lives here, once.
|
|
304
|
+
*/
|
|
305
|
+
function sanitizeUser(provider, user) {
|
|
306
|
+
return provider.sanitize ? provider.sanitize(user) : user;
|
|
307
|
+
}
|
|
308
|
+
var BaseUserProvider = class {
|
|
309
|
+
async setRememberToken(user, token) {
|
|
310
|
+
if (typeof user.setRememberToken === "function") await user.setRememberToken(token);
|
|
311
|
+
}
|
|
312
|
+
async getRememberToken(user) {
|
|
313
|
+
if (typeof user.getRememberToken === "function") return await user.getRememberToken() ?? null;
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/auth/AgentPrincipalGuard.ts
|
|
319
|
+
/**
|
|
320
|
+
* The guard answering for a principal the pipeline installed (RFC 0017 §2), for
|
|
321
|
+
* an **unqualified** lookup on a seam-marked request; explicit `guard('web')` /
|
|
322
|
+
* `guard('token')` is untouched, and `guardNames()` never lists this one. It
|
|
323
|
+
* satisfies `requireAuthenticated()`, `Controller.auth` and `Gate`, but not
|
|
324
|
+
* `createBearerTokenMiddleware` / `tokenCan*`, which judge an `ApiToken`.
|
|
325
|
+
*/
|
|
326
|
+
var AgentPrincipalGuard = class {
|
|
327
|
+
installed;
|
|
328
|
+
provider;
|
|
329
|
+
resolvedUser;
|
|
330
|
+
constructor(options) {
|
|
331
|
+
this.installed = options.installed;
|
|
332
|
+
this.provider = options.provider;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* `user() !== null`, the predicate `TokenGuard` answers `check()` with: true
|
|
336
|
+
* in every case but one, a `kind: 'user'` principal a configured provider
|
|
337
|
+
* cannot resolve. Answering true there would admit a request whose
|
|
338
|
+
* `Controller.auth.userOrFail()` then throws.
|
|
339
|
+
*/
|
|
340
|
+
async check() {
|
|
341
|
+
return await this.user() !== null;
|
|
342
|
+
}
|
|
343
|
+
async guest() {
|
|
344
|
+
return !await this.check();
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* `kind: 'service'` is always the minimal `{ id }`: a service principal names
|
|
348
|
+
* no user, so a lookup would resolve an id in a table it does not belong to.
|
|
349
|
+
* `kind: 'user'` goes through the provider when one is configured.
|
|
350
|
+
*/
|
|
351
|
+
user() {
|
|
352
|
+
if (!this.resolvedUser) this.resolvedUser = (async () => {
|
|
353
|
+
const { principal } = this.installed;
|
|
354
|
+
if (principal.kind !== "user" || !this.provider) return { id: principal.id };
|
|
355
|
+
const record = await this.provider.retrieveById(principal.id);
|
|
356
|
+
return record ? sanitizeUser(this.provider, record) : null;
|
|
357
|
+
})();
|
|
358
|
+
return this.resolvedUser;
|
|
359
|
+
}
|
|
360
|
+
async id() {
|
|
361
|
+
return this.installed.principal.id;
|
|
362
|
+
}
|
|
363
|
+
async login() {
|
|
364
|
+
throw new Error("The agent principal guard does not support login(); the principal is installed by the invocation pipeline for one request.");
|
|
365
|
+
}
|
|
366
|
+
async attempt(_credentials, _remember) {
|
|
367
|
+
throw new Error("The agent principal guard does not support attempt(); an installed principal is not credential-based.");
|
|
368
|
+
}
|
|
369
|
+
async validate(_credentials) {
|
|
370
|
+
throw new Error("The agent principal guard does not support validate(); an installed principal is not credential-based.");
|
|
371
|
+
}
|
|
372
|
+
/** Nothing to end: no session, and no stored credential to revoke. */
|
|
373
|
+
async logout() {}
|
|
374
|
+
session() {}
|
|
375
|
+
};
|
|
376
|
+
//#endregion
|
|
280
377
|
//#region src/errors/exceptions/AuthenticationException.ts
|
|
281
378
|
/** 401: the user is not authenticated, or the credentials were invalid. */
|
|
282
379
|
var AuthenticationException = class AuthenticationException extends HttpException {
|
|
@@ -490,26 +587,6 @@ var DefaultHasher = class {
|
|
|
490
587
|
}
|
|
491
588
|
};
|
|
492
589
|
//#endregion
|
|
493
|
-
//#region src/auth/providers/UserProvider.ts
|
|
494
|
-
/**
|
|
495
|
-
* Run a user record through the provider's optional `sanitize` before it leaves
|
|
496
|
-
* the auth layer. Every guard must call this on anything it returns from
|
|
497
|
-
* `user()` — a guard that forgets the ternary leaks password hashes, so the
|
|
498
|
-
* ternary lives here, once.
|
|
499
|
-
*/
|
|
500
|
-
function sanitizeUser(provider, user) {
|
|
501
|
-
return provider.sanitize ? provider.sanitize(user) : user;
|
|
502
|
-
}
|
|
503
|
-
var BaseUserProvider = class {
|
|
504
|
-
async setRememberToken(user, token) {
|
|
505
|
-
if (typeof user.setRememberToken === "function") await user.setRememberToken(token);
|
|
506
|
-
}
|
|
507
|
-
async getRememberToken(user) {
|
|
508
|
-
if (typeof user.getRememberToken === "function") return await user.getRememberToken() ?? null;
|
|
509
|
-
return null;
|
|
510
|
-
}
|
|
511
|
-
};
|
|
512
|
-
//#endregion
|
|
513
590
|
//#region src/auth/providers/ModelUserProvider.ts
|
|
514
591
|
/**
|
|
515
592
|
* Capability check, not `instanceof AuthenticatableModel`: a nominal check
|
|
@@ -1079,6 +1156,14 @@ var TokenGuard = class {
|
|
|
1079
1156
|
//#endregion
|
|
1080
1157
|
//#region src/auth/AuthManager.ts
|
|
1081
1158
|
const DEFAULT_GUARD = "web";
|
|
1159
|
+
/**
|
|
1160
|
+
* The guard name an unqualified lookup resolves to on a request the pipeline
|
|
1161
|
+
* installed a principal on (RFC 0017 §2). Deliberately **not** registered:
|
|
1162
|
+
* registering it would publish a name an application could select, default to,
|
|
1163
|
+
* or shadow. Namespaced so it cannot collide, and `createGuard` refuses it for
|
|
1164
|
+
* a request carrying no principal, so naming it explicitly buys nothing.
|
|
1165
|
+
*/
|
|
1166
|
+
const AGENT_PRINCIPAL_GUARD = "guren.agent-principal";
|
|
1082
1167
|
var AuthManager = class {
|
|
1083
1168
|
guards = /* @__PURE__ */ new Map();
|
|
1084
1169
|
providers = /* @__PURE__ */ new Map();
|
|
@@ -1105,6 +1190,13 @@ var AuthManager = class {
|
|
|
1105
1190
|
return entry.instance;
|
|
1106
1191
|
}
|
|
1107
1192
|
createGuard(name, context) {
|
|
1193
|
+
if (name === AGENT_PRINCIPAL_GUARD) {
|
|
1194
|
+
const installed = readAgentPrincipal(context.ctx.req.raw);
|
|
1195
|
+
if (installed) return new AgentPrincipalGuard({
|
|
1196
|
+
installed,
|
|
1197
|
+
...this.apiTokenOptions.provider ? { provider: this.getProvider(this.apiTokenOptions.provider) } : {}
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1108
1200
|
const entry = this.guards.get(name);
|
|
1109
1201
|
if (!entry) throw new Error(`AuthManager: guard "${name}" has not been registered.`);
|
|
1110
1202
|
return entry.factory(context);
|
|
@@ -1120,14 +1212,15 @@ var AuthManager = class {
|
|
|
1120
1212
|
return this.defaultGuard;
|
|
1121
1213
|
}
|
|
1122
1214
|
/**
|
|
1123
|
-
* The guard
|
|
1124
|
-
*
|
|
1125
|
-
*
|
|
1126
|
-
*
|
|
1127
|
-
*
|
|
1215
|
+
* The guard an unqualified `auth.guard()` / `auth.user()` resolves to.
|
|
1216
|
+
* Explicit names win; otherwise a principal the pipeline installed on this
|
|
1217
|
+
* exact request answers first, then a token guard for a Bearer header, then
|
|
1218
|
+
* the default — RFC 0016's composite rule with RFC 0017 §2's seam in front,
|
|
1219
|
+
* so a header cannot win over an identity the framework itself established.
|
|
1128
1220
|
*/
|
|
1129
1221
|
resolveGuardName(ctx, name) {
|
|
1130
1222
|
if (name) return name;
|
|
1223
|
+
if (readAgentPrincipal(ctx.req.raw)) return AGENT_PRINCIPAL_GUARD;
|
|
1131
1224
|
if (this.tokenGuard && hasBearerHeader(ctx)) return this.tokenGuard;
|
|
1132
1225
|
return this.defaultGuard;
|
|
1133
1226
|
}
|
|
@@ -1898,4 +1991,4 @@ function requireVerifiedEmail(options = {}) {
|
|
|
1898
1991
|
};
|
|
1899
1992
|
}
|
|
1900
1993
|
//#endregion
|
|
1901
|
-
export { buildTokenUrl as $, verifyOAuthState as A, getApiToken as B, createGoogleOAuthProviderConfig as C, fetchOAuthUserProfile as D, exchangeOAuthCode as E, TokenGuard as F, readBearerToken as G, getUserApiTokens as H, API_TOKEN_KEY as I, tokenCan as J, revokeAllApiTokens as K, MemoryApiTokenStore as L, isAppRelativePath as M, normalizeRedirectTarget as N, parseOAuthRedirectUrl as O, AuthManager as P, SessionGuard as Q, createApiToken as R, createGitHubOAuthProviderConfig as S, createOAuthState as T, hasBearerHeader as U, getApiTokenOrFail as V, parseApiToken as W, tokenCanAny as X, tokenCanAll as Y, verifyApiToken as Z, OAUTH_SESSION_BINDING_KEY as _, isEmailVerified as a, secureStringCompare as at, buildOAuthRedirectUrl as b, verifyEmailToken as c,
|
|
1994
|
+
export { buildTokenUrl as $, verifyOAuthState as A, getApiToken as B, createGoogleOAuthProviderConfig as C, fetchOAuthUserProfile as D, exchangeOAuthCode as E, TokenGuard as F, readBearerToken as G, getUserApiTokens as H, API_TOKEN_KEY as I, tokenCan as J, revokeAllApiTokens as K, MemoryApiTokenStore as L, isAppRelativePath as M, normalizeRedirectTarget as N, parseOAuthRedirectUrl as O, AuthManager as P, SessionGuard as Q, createApiToken as R, createGitHubOAuthProviderConfig as S, createOAuthState as T, hasBearerHeader as U, getApiTokenOrFail as V, parseApiToken as W, tokenCanAny as X, tokenCanAll as Y, verifyApiToken as Z, OAUTH_SESSION_BINDING_KEY as _, isEmailVerified as a, secureStringCompare as at, buildOAuthRedirectUrl as b, verifyEmailToken as c, NodeHasher as ct, completePasswordReset as d, BaseUserProvider as dt, generateId as et, createPasswordResetToken as f, installAgentPrincipal as ft, MemoryOAuthStateStore as g, getSessionFromContext as gt, AuthenticatableModel as h, createSessionMiddleware as ht, createEmailVerificationToken as i, secureCompare as it, hostMatchesAllowlist as j, sanitizeOAuthRedirect as k, MemoryPasswordResetStore as l, ScryptHasher as lt, verifyPasswordResetToken as m, MemorySessionStore as mt, buildVerificationUrl as n, hashToken as nt, parseVerificationUrl as o, ModelUserProvider as ot, parsePasswordResetUrl as p, readAgentPrincipal as pt, revokeApiToken as q, completeEmailVerification as r, parseTokenUrl as rt, requireVerifiedEmail as s, DefaultHasher as st, MemoryEmailVerificationStore as t, generateToken as tt, buildPasswordResetUrl as u, AuthenticationException as ut, OAuthManager as v, createOAuthManager as w, createDiscordOAuthProviderConfig as x, buildOAuthAuthorizeUrl as y, createBearerTokenMiddleware as z };
|
|
@@ -142,6 +142,7 @@ export declare class Application {
|
|
|
142
142
|
*/
|
|
143
143
|
private disposeBunTeardown?;
|
|
144
144
|
private autoSessionAttached;
|
|
145
|
+
private readonly cookielessAuthPaths;
|
|
145
146
|
private routesRegistered;
|
|
146
147
|
private bootPromise?;
|
|
147
148
|
constructor(options?: ApplicationOptions);
|
|
@@ -150,6 +151,16 @@ export declare class Application {
|
|
|
150
151
|
get i18nOptions(): I18nPluginOptions | undefined;
|
|
151
152
|
markAutoSessionAttached(): void;
|
|
152
153
|
hasAutoSessionAttached(): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Asserts that `path` resolves its principal without ever reading a session
|
|
156
|
+
* cookie, so it refuses on its own terms and CSRF has no ambient authority to
|
|
157
|
+
* defend there. Only for an endpoint whose own code establishes that; an app
|
|
158
|
+
* exempting a path it chose wants `csrfOptions.exclude`. Call from `boot`,
|
|
159
|
+
* after `mountRoutes()` — at `register` the collision check sees no routes.
|
|
160
|
+
*/
|
|
161
|
+
declareCookielessAuthPath(path: string): void;
|
|
162
|
+
/** Matched by exact path — see {@link declareCookielessAuthPath}. */
|
|
163
|
+
getCookielessAuthPaths(): ReadonlySet<string>;
|
|
153
164
|
mountRoutes(): Promise<void>;
|
|
154
165
|
use(path: string, ...middleware: MiddlewareHandler[]): void;
|
|
155
166
|
/**
|
|
@@ -160,6 +171,13 @@ export declare class Application {
|
|
|
160
171
|
* retries on the partially mounted app rather than starting clean.
|
|
161
172
|
*/
|
|
162
173
|
boot(): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Resolves when the boot that is running — or has already run — completes,
|
|
176
|
+
* and immediately when none was ever started. For a surface holding this
|
|
177
|
+
* application from *inside* `boot`, whose hook runs while later providers are
|
|
178
|
+
* unbooted. Never await it from a provider's own `boot`: it waits on itself.
|
|
179
|
+
*/
|
|
180
|
+
booted(): Promise<void>;
|
|
163
181
|
private bootOnce;
|
|
164
182
|
/** Called once, from the constructor — see the note there for why. */
|
|
165
183
|
private mountSecurityDefaults;
|
|
@@ -22,6 +22,14 @@ export interface CsrfOptions {
|
|
|
22
22
|
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Read per request, not snapshotted: this middleware is created in
|
|
27
|
+
* `AuthServiceProvider.register()`, while an endpoint that declares itself
|
|
28
|
+
* mounts at `boot`. A separate argument, not a {@link CsrfOptions} field: an
|
|
29
|
+
* app fills those in, and there this would be a second `exclude` carrying none
|
|
30
|
+
* of the review a declaring endpoint's own code is what supplies.
|
|
31
|
+
*/
|
|
32
|
+
export type CookielessAuthEndpoints = () => ReadonlySet<string>;
|
|
25
33
|
/**
|
|
26
34
|
* The request's CSRF token: bound to the session when a stable one exists,
|
|
27
35
|
* otherwise a stateless signed double-submit token. Nothing is stored
|
|
@@ -40,10 +48,10 @@ export declare function csrfField(ctx: Context): string;
|
|
|
40
48
|
*/
|
|
41
49
|
export declare function verifyCsrfToken(ctx: Context, token: string | undefined): boolean;
|
|
42
50
|
/**
|
|
43
|
-
* Issues a signed `XSRF-TOKEN` on safe requests and verifies it on
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
51
|
+
* Issues a signed `XSRF-TOKEN` on safe requests and verifies it on state-changing
|
|
52
|
+
* ones (`_token`, `X-CSRF-TOKEN` / `X-XSRF-TOKEN`), skipping cookie-less bearer
|
|
53
|
+
* requests (RFC 0016) and seam-marked ones (RFC 0017). `cookie: false` suits
|
|
54
|
+
* session flows only. **Mount directly inside the session middleware:** anything
|
|
55
|
+
* between that mutates the session after `await next()` moves the id too late.
|
|
48
56
|
*/
|
|
49
|
-
export declare function createCsrfMiddleware(options?: CsrfOptions): MiddlewareHandler;
|
|
57
|
+
export declare function createCsrfMiddleware(options?: CsrfOptions, cookielessAuthEndpoints?: CookielessAuthEndpoints): MiddlewareHandler;
|
|
@@ -5,7 +5,7 @@ export declare function jsonResponse(data: unknown, status?: number): Response;
|
|
|
5
5
|
export { createSessionMiddleware, MemorySessionStore, getSessionFromContext } from './session.js';
|
|
6
6
|
export type { Session, SessionData, SessionStore } from './session.js';
|
|
7
7
|
export { requireAuthenticated, requireGuest, attachAuthContext, type AuthContext, type RequireAuthOptions, } from './auth.js';
|
|
8
|
-
export { createCsrfMiddleware, getCsrfToken, csrfField, verifyCsrfToken, CSRF_TOKEN_KEY, CSRF_HEADER_NAME, CSRF_FORM_FIELD, XSRF_HEADER_NAME, XSRF_COOKIE_NAME, type CsrfOptions, } from './csrf.js';
|
|
8
|
+
export { createCsrfMiddleware, getCsrfToken, csrfField, verifyCsrfToken, CSRF_TOKEN_KEY, CSRF_HEADER_NAME, CSRF_FORM_FIELD, XSRF_HEADER_NAME, XSRF_COOKIE_NAME, type CsrfOptions, type CookielessAuthEndpoints, } from './csrf.js';
|
|
9
9
|
export { validateRequest, validateRequestWith, getValidatedData, validate, validateSafe, VALIDATED_DATA_KEY, type ValidationSchema, type ValidateRequestOptions, } from './validation.js';
|
|
10
10
|
export { createRateLimitMiddleware, getRateLimitInfo, resetRateLimit, MemoryRateLimitStore, SlidingWindowRateLimitStore, type RateLimitOptions, type RateLimitStore, type RateLimitEntry, type RateLimitInfo, } from './rate-limit.js';
|
|
11
11
|
export { createSecurityHeaders, type SecurityHeadersOptions, type HstsOptions, } from './security-headers.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export type { AgentToolInputSource, AgentToolSchema, DeriveAgentToolsResult, Der
|
|
|
16
16
|
export { advertisesStructuredOutput, buildToolRequest, describeBuildFailure, mapToolResponse, PREFLIGHT_ARGUMENT, } from './agent/dispatch.js';
|
|
17
17
|
export type { BuildToolRequestOptions, BuiltToolRequest, ToolCallOutcome, ToolRequestBuildFailure, } from './agent/dispatch.js';
|
|
18
18
|
export { APPROVAL_STATUS_TOOL_NAME, isReservedAgentToolName, PREFLIGHT_TOOL_NAME, RESERVED_AGENT_TOOL_NAMES, } from './agent/meta-tools.js';
|
|
19
|
-
export { AGENT_TOOL_NAME_PATTERN, expandToolScopes, parseToolScope, scopesAllowTool, } from './agent/scopes.js';
|
|
20
|
-
export type { ParsedToolScope, ScopedTool } from './agent/scopes.js';
|
|
19
|
+
export { AGENT_TOOL_NAME_PATTERN, classifyRegistrationScope, expandToolScopes, parseToolScope, scopesAllowTool, } from './agent/scopes.js';
|
|
20
|
+
export type { ParsedToolScope, RegistrationScopeVerdict, ScopedTool } from './agent/scopes.js';
|
|
21
21
|
export { AgentToolDenied, AgentToolInvoked } from './agent/events.js';
|
|
22
22
|
export type { AgentPrincipal, AgentSurface, AgentToolDenialReason } from './agent/events.js';
|
|
23
23
|
export { AGENT_REDACTED, redactAgentArguments } from './agent/redact.js';
|
|
@@ -28,6 +28,12 @@ export type { AgentAuditEmitter, AgentAuditSink } from './agent/audit-emitter.js
|
|
|
28
28
|
export { AGENT_APPROVAL_CONFIG_KEY, agentApprovalExpiredAt, agentApprovalFingerprint, agentApprovalPrincipalKey, agentApprovalStatusAt, agentApprovalUsableAt, agentApprovalVisibleTo, buildAgentApprovalRequest, canonicalizeAgentApprovalInput, DEFAULT_AGENT_APPROVAL_TTL_MS, } from './agent/approval.js';
|
|
29
29
|
export type { AgentApprovalMatch, AgentApprovalRequest, AgentApprovalRequestInput, AgentApprovalStatus, AgentApprovalStore, } from './agent/approval.js';
|
|
30
30
|
export { AgentApprovalRequested } from './agent/AgentApprovalRequested.js';
|
|
31
|
+
export { DEFAULT_APPROVAL_CONFIGURE_HINT, DEFAULT_SCOPE_SUBJECT, gateApproval, gatePreflight, gateToolCall, notifyApprovers, scopedShape, } from './agent/gate.js';
|
|
32
|
+
export type { ApprovalGateContext, GateVerdict, ScopeGateOptions } from './agent/gate.js';
|
|
33
|
+
export { createAgentApprovalContext, createAgentAuditRecorder, createAgentInvocationPipeline, } from './agent/pipeline.js';
|
|
34
|
+
export type { AgentAuditRecorder, AgentAuditRecorderOptions, AgentDispatchTarget, AgentInterposition, AgentInvocation, AgentInvocationDenial, AgentInvocationOptions, AgentInvocationPipeline, AgentInvocationResult, AuditedTool, InterposedAgentCall, } from './agent/pipeline.js';
|
|
35
|
+
export { approvalStatusNotFoundMessage, toApprovalStatusReport } from './agent/approval-status.js';
|
|
36
|
+
export type { ApprovalStatusOutcome, ApprovalStatusReport } from './agent/approval-status.js';
|
|
31
37
|
export { ViewEngine } from './mvc/ViewEngine.js';
|
|
32
38
|
export { inertia, setInertiaSsrRenderer, setInertiaDocument } from './mvc/inertia/InertiaEngine.js';
|
|
33
39
|
export { setInertiaSharedProps, getInertiaSharedPropsResolver, shareInertiaProps } from './mvc/inertia/shared.js';
|
|
@@ -39,7 +45,7 @@ export { AuthManager, SessionGuard, TokenGuard, ModelUserProvider, BaseUserProvi
|
|
|
39
45
|
export type { AuthContext as AuthRuntimeContext, AuthCredentials, AuthManagerOptions, Authenticatable, Guard, GuardContext, GuardFactory, UserProvider, ProviderFactory, DefaultSanitizedKeys, Sanitized, PasswordResetConfig, PasswordResetTokenStore, PasswordResetTokenResult, EmailVerificationConfig, EmailVerificationTokenStore, EmailVerificationToken, EmailVerificationTokenResult, ApiToken, ApiTokenGuardOptions, ApiTokenStore, CreateApiTokenOptions, CreateApiTokenResult, BearerTokenMiddlewareOptions, VerifiedApiToken, TokenGuardOptions, OAuthProviderConfig, OAuthTokenResult, OAuthUserProfile, OAuthFallbackEmail, OAuthStatePayload, OAuthStateStore, OAuthStateConfig, OAuthAuthorizeOptions, OAuthCallbackPayload, OAuthManagerOptions, OAuthProviderFactoryInput, OAuthBindingSession, } from './auth/index.js';
|
|
40
46
|
export { defineMiddleware, jsonResponse, createSessionMiddleware, MemorySessionStore, getSessionFromContext, requireAuthenticated, requireGuest, attachAuthContext, createCsrfMiddleware, getCsrfToken, csrfField, verifyCsrfToken, CSRF_TOKEN_KEY, CSRF_HEADER_NAME, CSRF_FORM_FIELD, validateRequest, validateRequestWith, getValidatedData, validate, validateSafe, VALIDATED_DATA_KEY, createRateLimitMiddleware, getRateLimitInfo, resetRateLimit, MemoryRateLimitStore, SlidingWindowRateLimitStore, createSecurityHeaders, createCspMiddleware, getCspNonce, CSP_NONCE_KEY, createHostAuthorizationMiddleware, createCorsMiddleware, createRedirectSafetyMiddleware, isSafeRedirectUrl, createForceHttpsMiddleware, requestIdMiddleware, requestLoggingMiddleware, detectLocaleMiddleware, LOCALE_CONTEXT_KEY, getRequestLocale, getRequestTranslator, } from './http/middleware/index.js';
|
|
41
47
|
export { AUTH_CONTEXT_KEY } from './http/middleware/auth.js';
|
|
42
|
-
export type { Middleware, Session, SessionData, SessionStore, AuthContext, RequireAuthOptions, CsrfOptions, ValidationSchema, ValidateRequestOptions, RateLimitOptions, RateLimitStore, RateLimitEntry, RateLimitInfo, SecurityHeadersOptions, HstsOptions, CspOptions, CspDirectives, HostAuthorizationOptions, CorsOptions, RedirectSafetyOptions, ForceHttpsOptions, DetectLocaleOptions, DetectLocaleVariables, TranslatorBinding, LocaleSource, } from './http/middleware/index.js';
|
|
48
|
+
export type { Middleware, Session, SessionData, SessionStore, AuthContext, RequireAuthOptions, CsrfOptions, CookielessAuthEndpoints, ValidationSchema, ValidateRequestOptions, RateLimitOptions, RateLimitStore, RateLimitEntry, RateLimitInfo, SecurityHeadersOptions, HstsOptions, CspOptions, CspDirectives, HostAuthorizationOptions, CorsOptions, RedirectSafetyOptions, ForceHttpsOptions, DetectLocaleOptions, DetectLocaleVariables, TranslatorBinding, LocaleSource, } from './http/middleware/index.js';
|
|
43
49
|
export { Validator, FieldValidator, createValidator, quickValidate, quickValidateOrThrow, required, nullable, requiredIf, requiredUnless, requiredWith, requiredWithout, string as stringRule, numeric, integer, boolean as booleanRule, array as arrayRule, object as objectRule, email as emailRule, url as urlRule, uuid as uuidRule, ip, ipv4, ipv6, json as jsonRule, alpha, alphaNum, alphaDash, regex, min, max, between, size, inValues, notIn, confirmed, same, different, date as dateRule, dateFormat, after, afterOrEqual, before, beforeOrEqual, startsWith, endsWith, file as fileRule, image as imageRule, mimes, maxFileSize, minFileSize, custom, unique, exists, } from './http/validation/index.js';
|
|
44
50
|
export type { ValidationRule, RuleDefinition, ValidationResult, FileValidationOptions, ImageValidationOptions, ValidatorOptions, FileLike, } from './http/validation/index.js';
|
|
45
51
|
export { Event, EventManager, createEventManager, Listener, RequestReceived, RequestFinished, UserAuthenticated, UserLoggedOut, JobProcessed, JobFailed, ApplicationStarted, ApplicationShutdown, } from './events/index.js';
|