@frontmcp/sdk 0.2.0 → 0.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -10,6 +10,7 @@ export type ToolCallExtra = RequestHandlerExtra<Request, Notification>;
10
10
  export declare abstract class ToolEntry<In = z.ZodRawShape, Out = z.ZodRawShape> extends BaseEntry<ToolRecord, ToolContext<In, Out>, ToolMetadata> {
11
11
  owner: EntryOwnerRef;
12
12
  inputSchema: z.ZodObject<any>;
13
+ rawInputSchema: z.ZodObject<any>;
13
14
  outputSchema: z.ZodObject<any>;
14
15
  abstract create(input: ToolCallArgs, ctx: ToolCallExtra): ToolContext<In, Out>;
15
16
  }
@@ -5,6 +5,7 @@ const base_entry_1 = require("./base.entry");
5
5
  class ToolEntry extends base_entry_1.BaseEntry {
6
6
  owner;
7
7
  inputSchema;
8
+ rawInputSchema;
8
9
  outputSchema;
9
10
  }
10
11
  exports.ToolEntry = ToolEntry;
@@ -1 +1 @@
1
- {"version":3,"file":"tool.entry.js","sourceRoot":"","sources":["../../../src/entries/tool.entry.ts"],"names":[],"mappings":";;;AACA,6CAAsD;AAWtD,MAAsB,SAAmD,SAAQ,sBAAyD;IACxI,KAAK,CAAgB;IACrB,WAAW,CAAmB;IAC9B,YAAY,CAAmB;CAGhC;AAND,8BAMC","sourcesContent":["import {z} from 'zod';\nimport {BaseEntry, EntryOwnerRef} from './base.entry';\nimport {ToolRecord} from '../records';\nimport {ToolContext} from '../interfaces';\nimport {ToolMetadata} from '../metadata';\nimport {Request, Notification, CallToolRequest} from \"@modelcontextprotocol/sdk/types.js\";\nimport {RequestHandlerExtra} from \"@modelcontextprotocol/sdk/shared/protocol.js\";\n\n\nexport type ToolCallArgs = CallToolRequest[\"params\"][\"arguments\"];\nexport type ToolCallExtra = RequestHandlerExtra<Request, Notification>;\n\nexport abstract class ToolEntry<In = z.ZodRawShape, Out = z.ZodRawShape> extends BaseEntry<ToolRecord, ToolContext<In, Out>, ToolMetadata> {\n owner: EntryOwnerRef;\n inputSchema: z.ZodObject<any>;\n outputSchema: z.ZodObject<any>;\n\n abstract create(input: ToolCallArgs, ctx: ToolCallExtra): ToolContext<In, Out>;\n}\n"]}
1
+ {"version":3,"file":"tool.entry.js","sourceRoot":"","sources":["../../../src/entries/tool.entry.ts"],"names":[],"mappings":";;;AACA,6CAAsD;AAWtD,MAAsB,SAAmD,SAAQ,sBAAyD;IACxI,KAAK,CAAgB;IACrB,WAAW,CAAmB;IAC9B,cAAc,CAAmB;IACjC,YAAY,CAAmB;CAGhC;AAPD,8BAOC","sourcesContent":["import {z} from 'zod';\nimport {BaseEntry, EntryOwnerRef} from './base.entry';\nimport {ToolRecord} from '../records';\nimport {ToolContext} from '../interfaces';\nimport {ToolMetadata} from '../metadata';\nimport {Request, Notification, CallToolRequest} from \"@modelcontextprotocol/sdk/types.js\";\nimport {RequestHandlerExtra} from \"@modelcontextprotocol/sdk/shared/protocol.js\";\n\n\nexport type ToolCallArgs = CallToolRequest[\"params\"][\"arguments\"];\nexport type ToolCallExtra = RequestHandlerExtra<Request, Notification>;\n\nexport abstract class ToolEntry<In = z.ZodRawShape, Out = z.ZodRawShape> extends BaseEntry<ToolRecord, ToolContext<In, Out>, ToolMetadata> {\n owner: EntryOwnerRef;\n inputSchema: z.ZodObject<any>;\n rawInputSchema: z.ZodObject<any>;\n outputSchema: z.ZodObject<any>;\n\n abstract create(input: ToolCallArgs, ctx: ToolCallExtra): ToolContext<In, Out>;\n}\n"]}
@@ -3,6 +3,7 @@ import { ProviderRegistryInterface } from "./internal";
3
3
  import { ToolMetadata } from "../metadata";
4
4
  import { FrontMcpLogger } from "./logger.interface";
5
5
  import { URL } from "url";
6
+ import { AuthInfo } from "@modelcontextprotocol/sdk/server/auth/types.js";
6
7
  export type ToolType<T = any> = Type<T> | FuncType<T>;
7
8
  type HistoryEntry<T> = {
8
9
  at: number;
@@ -12,7 +13,7 @@ type HistoryEntry<T> = {
12
13
  };
13
14
  export declare abstract class ToolContext<In, Out> {
14
15
  private providers;
15
- private session;
16
+ readonly authInfo: AuthInfo;
16
17
  protected readonly runId: string;
17
18
  protected readonly toolId: string;
18
19
  protected readonly toolName: string;
@@ -26,7 +27,7 @@ export declare abstract class ToolContext<In, Out> {
26
27
  private _error?;
27
28
  private readonly _inputHistory;
28
29
  private readonly _outputHistory;
29
- constructor(metadata: ToolMetadata, input: In, providers: ProviderRegistryInterface, logger: FrontMcpLogger, session: any);
30
+ constructor(metadata: ToolMetadata, input: In, providers: ProviderRegistryInterface, logger: FrontMcpLogger, authInfo: any);
30
31
  abstract execute(input: In): Promise<Out>;
31
32
  get<T>(token: Token<T>): T;
32
33
  tryGet<T>(token: Token<T>): T | undefined;
@@ -5,7 +5,7 @@ const crypto_1 = require("crypto");
5
5
  const flow_interface_1 = require("./flow.interface");
6
6
  class ToolContext {
7
7
  providers;
8
- session; // TODO: type this
8
+ authInfo;
9
9
  runId;
10
10
  toolId;
11
11
  toolName;
@@ -22,7 +22,7 @@ class ToolContext {
22
22
  // ---- histories
23
23
  _inputHistory = [];
24
24
  _outputHistory = [];
25
- constructor(metadata, input, providers, logger, session) {
25
+ constructor(metadata, input, providers, logger, authInfo) {
26
26
  this.runId = (0, crypto_1.randomUUID)();
27
27
  this.toolName = metadata.name;
28
28
  this.toolId = metadata.id ?? metadata.name;
@@ -30,7 +30,7 @@ class ToolContext {
30
30
  this._input = input;
31
31
  this.providers = providers;
32
32
  this.logger = logger.child(`tool:${this.toolId}`);
33
- this.session = session;
33
+ this.authInfo = authInfo;
34
34
  }
35
35
  get(token) {
36
36
  return this.providers.get(token);
@@ -82,7 +82,7 @@ class ToolContext {
82
82
  this.activeStage = stage;
83
83
  }
84
84
  fetch(input, init) {
85
- return this.session.fetch(input, init);
85
+ return fetch(input, init);
86
86
  }
87
87
  }
88
88
  exports.ToolContext = ToolContext;
@@ -1 +1 @@
1
- {"version":3,"file":"tool.interface.js","sourceRoot":"","sources":["../../../src/interfaces/tool.interface.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAKlC,qDAA6C;AAc7C,MAAsB,WAAW;IACvB,SAAS,CAA4B;IACrC,OAAO,CAAM,CAAC,kBAAkB;IAErB,KAAK,CAAS;IACd,MAAM,CAAS;IACf,QAAQ,CAAS;IACjB,QAAQ,CAAe;IACvB,MAAM,CAAiB;IAEhC,WAAW,CAAS;IAE9B,uCAAuC;IAC/B,SAAS,CAAqB;IAC9B,MAAM,CAAM;IAEpB,wCAAwC;IAChC,YAAY,CAAsB;IAClC,OAAO,CAAO;IAEd,MAAM,CAAS;IAEvB,iBAAiB;IACA,aAAa,GAAuB,EAAE,CAAC;IACvC,cAAc,GAAwB,EAAE,CAAC;IAG1D,YAAY,QAAsB,EAAE,KAAS,EAAE,SAAoC,EAAE,MAAsB,EAAE,OAAY;QACvH,IAAI,CAAC,KAAK,GAAG,IAAA,mBAAU,GAAE,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAID,GAAG,CAAI,KAAe;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;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AM,GAAG,GAAG,CAAC;QAClB,4BAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,KAAwB,EAAE,IAAkB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AAtGD,kCAsGC","sourcesContent":["import {randomUUID} from \"crypto\";\nimport {FuncType, Token, Type} from \"./base.interface\";\nimport {ProviderRegistryInterface} from \"./internal\";\nimport {ToolMetadata} from \"../metadata\";\nimport {FrontMcpLogger} from \"./logger.interface\";\nimport {FlowControl} from \"./flow.interface\";\nimport {URL} from \"url\";\n\nexport type ToolType<T = any> =\n | Type<T>\n | FuncType<T>\n\ntype HistoryEntry<T> = {\n at: number;\n stage?: string;\n value: T | undefined;\n note?: string;\n};\n\nexport abstract class ToolContext<In, Out> {\n private providers: ProviderRegistryInterface;\n private session: any; // TODO: type this\n\n protected readonly runId: string;\n protected readonly toolId: string;\n protected readonly toolName: string;\n protected readonly metadata: ToolMetadata;\n protected readonly logger: FrontMcpLogger;\n\n protected activeStage: string;\n\n // ---- INPUT storages (backing fields)\n private _rawInput?: Partial<In> | any;\n private _input?: In;\n\n // ---- OUTPUT storages (backing fields)\n private _outputDraft?: Partial<Out> | any;\n private _output?: Out;\n\n private _error?: Error;\n\n // ---- histories\n private readonly _inputHistory: HistoryEntry<In>[] = [];\n private readonly _outputHistory: HistoryEntry<Out>[] = [];\n\n\n constructor(metadata: ToolMetadata, input: In, providers: ProviderRegistryInterface, logger: FrontMcpLogger, session: any) {\n this.runId = randomUUID();\n this.toolName = metadata.name;\n this.toolId = metadata.id ?? metadata.name;\n this.metadata = metadata;\n this._input = input;\n this.providers = providers;\n this.logger = logger.child(`tool:${this.toolId}`);\n this.session = session;\n }\n\n abstract execute(input: In): Promise<Out>;\n\n get<T>(token: Token<T>): T {\n return this.providers.get(token);\n }\n\n tryGet<T>(token: Token<T>): T | undefined {\n try {\n return this.providers.get(token);\n } catch (e) {\n this.logger.warn(\"Requesting provider that doesn't exist: \", token);\n return undefined;\n }\n }\n\n public get input(): In {\n return this._input as In;\n }\n\n public set input(v: In | undefined) {\n this._input = v;\n this._inputHistory.push({\n at: Date.now(),\n stage: this.activeStage,\n value: v,\n });\n }\n\n public get inputHistory(): ReadonlyArray<HistoryEntry<In>> {\n return this._inputHistory;\n }\n\n public get output(): Out | undefined {\n return this._output;\n }\n\n public set output(v: Out | undefined) {\n this._output = v;\n this._outputHistory.push({at: Date.now(), stage: this.activeStage, value: v,});\n }\n\n public get outputHistory(): ReadonlyArray<HistoryEntry<Out>> {\n return this._outputHistory;\n }\n\n protected respond(value: Out): never {\n // record validated output and surface the value via control flow\n this.output = value;\n FlowControl.respond<Out>(value);\n }\n\n /** Fail the run (invoker will run error/finalize). */\n protected fail(err: Error): never {\n this._error = err;\n FlowControl.fail(err);\n }\n\n mark(stage: string): void {\n this.activeStage = stage;\n }\n\n fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {\n return this.session.fetch(input, init);\n }\n}\n\n"]}
1
+ {"version":3,"file":"tool.interface.js","sourceRoot":"","sources":["../../../src/interfaces/tool.interface.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAKlC,qDAA6C;AAe7C,MAAsB,WAAW;IACvB,SAAS,CAA4B;IACpC,QAAQ,CAAW;IAET,KAAK,CAAS;IACd,MAAM,CAAS;IACf,QAAQ,CAAS;IACjB,QAAQ,CAAe;IACvB,MAAM,CAAiB;IAEhC,WAAW,CAAS;IAE9B,uCAAuC;IAC/B,SAAS,CAAqB;IAC9B,MAAM,CAAM;IAEpB,wCAAwC;IAChC,YAAY,CAAsB;IAClC,OAAO,CAAO;IAEd,MAAM,CAAS;IAEvB,iBAAiB;IACA,aAAa,GAAuB,EAAE,CAAC;IACvC,cAAc,GAAwB,EAAE,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AC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,MAAM,CAAC,CAAkB;QAClC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAC,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,GAAE,CAAC,CAAC;IACjF,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAES,OAAO,CAAC,KAAU;QAC1B,iEAAiE;QACjE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,4BAAW,CAAC,OAAO,CAAM,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,sDAAsD;IAC5C,IAAI,CAAC,GAAU;QACvB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,4BAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,KAAwB,EAAE,IAAkB;QAChD,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC;CACF;AAtGD,kCAsGC","sourcesContent":["import {randomUUID} from \"crypto\";\nimport {FuncType, Token, Type} from \"./base.interface\";\nimport {ProviderRegistryInterface} from \"./internal\";\nimport {ToolMetadata} from \"../metadata\";\nimport {FrontMcpLogger} from \"./logger.interface\";\nimport {FlowControl} from \"./flow.interface\";\nimport {URL} from \"url\";\nimport {AuthInfo} from \"@modelcontextprotocol/sdk/server/auth/types.js\";\n\nexport type ToolType<T = any> =\n | Type<T>\n | FuncType<T>\n\ntype HistoryEntry<T> = {\n at: number;\n stage?: string;\n value: T | undefined;\n note?: string;\n};\n\nexport abstract class ToolContext<In, Out> {\n private providers: ProviderRegistryInterface;\n readonly authInfo: AuthInfo;\n\n protected readonly runId: string;\n protected readonly toolId: string;\n protected readonly toolName: string;\n protected readonly metadata: ToolMetadata;\n protected readonly logger: FrontMcpLogger;\n\n protected activeStage: string;\n\n // ---- INPUT storages (backing fields)\n private _rawInput?: Partial<In> | any;\n private _input?: In;\n\n // ---- OUTPUT storages (backing fields)\n private _outputDraft?: Partial<Out> | any;\n private _output?: Out;\n\n private _error?: Error;\n\n // ---- histories\n private readonly _inputHistory: HistoryEntry<In>[] = [];\n private readonly _outputHistory: HistoryEntry<Out>[] = [];\n\n\n constructor(metadata: ToolMetadata, input: In, providers: ProviderRegistryInterface, logger: FrontMcpLogger, authInfo: any) {\n this.runId = randomUUID();\n this.toolName = metadata.name;\n this.toolId = metadata.id ?? metadata.name;\n this.metadata = metadata;\n this._input = input;\n this.providers = providers;\n this.logger = logger.child(`tool:${this.toolId}`);\n this.authInfo = authInfo;\n }\n\n abstract execute(input: In): Promise<Out>;\n\n get<T>(token: Token<T>): T {\n return this.providers.get(token);\n }\n\n tryGet<T>(token: Token<T>): T | undefined {\n try {\n return this.providers.get(token);\n } catch (e) {\n this.logger.warn(\"Requesting provider that doesn't exist: \", token);\n return undefined;\n }\n }\n\n public get input(): In {\n return this._input as In;\n }\n\n public set input(v: In | undefined) {\n this._input = v;\n this._inputHistory.push({\n at: Date.now(),\n stage: this.activeStage,\n value: v,\n });\n }\n\n public get inputHistory(): ReadonlyArray<HistoryEntry<In>> {\n return this._inputHistory;\n }\n\n public get output(): Out | undefined {\n return this._output;\n }\n\n public set output(v: Out | undefined) {\n this._output = v;\n this._outputHistory.push({at: Date.now(), stage: this.activeStage, value: v,});\n }\n\n public get outputHistory(): ReadonlyArray<HistoryEntry<Out>> {\n return this._outputHistory;\n }\n\n protected respond(value: Out): never {\n // record validated output and surface the value via control flow\n this.output = value;\n FlowControl.respond<Out>(value);\n }\n\n /** Fail the run (invoker will run error/finalize). */\n protected fail(err: Error): never {\n this._error = err;\n FlowControl.fail(err);\n }\n\n mark(stage: string): void {\n this.activeStage = stage;\n }\n\n fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {\n return fetch(input, init);\n }\n}\n\n"]}
@@ -27,7 +27,7 @@ export declare const HttpCookieSchema: z.ZodObject<{
27
27
  httpOnly: boolean;
28
28
  domain?: string | undefined;
29
29
  secure?: boolean | undefined;
30
- sameSite?: "strict" | "lax" | "none" | undefined;
30
+ sameSite?: "lax" | "strict" | "none" | undefined;
31
31
  maxAge?: number | undefined;
32
32
  expires?: Date | undefined;
33
33
  }, {
@@ -37,7 +37,7 @@ export declare const HttpCookieSchema: z.ZodObject<{
37
37
  domain?: string | undefined;
38
38
  httpOnly?: boolean | undefined;
39
39
  secure?: boolean | undefined;
40
- sameSite?: "strict" | "lax" | "none" | undefined;
40
+ sameSite?: "lax" | "strict" | "none" | undefined;
41
41
  maxAge?: number | undefined;
42
42
  expires?: Date | undefined;
43
43
  }>;
@@ -59,7 +59,7 @@ export declare const HttpCookies: z.ZodDefault<z.ZodArray<z.ZodObject<{
59
59
  httpOnly: boolean;
60
60
  domain?: string | undefined;
61
61
  secure?: boolean | undefined;
62
- sameSite?: "strict" | "lax" | "none" | undefined;
62
+ sameSite?: "lax" | "strict" | "none" | undefined;
63
63
  maxAge?: number | undefined;
64
64
  expires?: Date | undefined;
65
65
  }, {
@@ -69,7 +69,7 @@ export declare const HttpCookies: z.ZodDefault<z.ZodArray<z.ZodObject<{
69
69
  domain?: string | undefined;
70
70
  httpOnly?: boolean | undefined;
71
71
  secure?: boolean | undefined;
72
- sameSite?: "strict" | "lax" | "none" | undefined;
72
+ sameSite?: "lax" | "strict" | "none" | undefined;
73
73
  maxAge?: number | undefined;
74
74
  expires?: Date | undefined;
75
75
  }>, "many">>;
@@ -99,7 +99,7 @@ export declare const HttpRedirectSchema: z.ZodObject<{
99
99
  httpOnly: boolean;
100
100
  domain?: string | undefined;
101
101
  secure?: boolean | undefined;
102
- sameSite?: "strict" | "lax" | "none" | undefined;
102
+ sameSite?: "lax" | "strict" | "none" | undefined;
103
103
  maxAge?: number | undefined;
104
104
  expires?: Date | undefined;
105
105
  }, {
@@ -109,7 +109,7 @@ export declare const HttpRedirectSchema: z.ZodObject<{
109
109
  domain?: string | undefined;
110
110
  httpOnly?: boolean | undefined;
111
111
  secure?: boolean | undefined;
112
- sameSite?: "strict" | "lax" | "none" | undefined;
112
+ sameSite?: "lax" | "strict" | "none" | undefined;
113
113
  maxAge?: number | undefined;
114
114
  expires?: Date | undefined;
115
115
  }>, "many">>>;
@@ -125,7 +125,7 @@ export declare const HttpRedirectSchema: z.ZodObject<{
125
125
  httpOnly: boolean;
126
126
  domain?: string | undefined;
127
127
  secure?: boolean | undefined;
128
- sameSite?: "strict" | "lax" | "none" | undefined;
128
+ sameSite?: "lax" | "strict" | "none" | undefined;
129
129
  maxAge?: number | undefined;
130
130
  expires?: Date | undefined;
131
131
  }[] | undefined;
@@ -141,7 +141,7 @@ export declare const HttpRedirectSchema: z.ZodObject<{
141
141
  domain?: string | undefined;
142
142
  httpOnly?: boolean | undefined;
143
143
  secure?: boolean | undefined;
144
- sameSite?: "strict" | "lax" | "none" | undefined;
144
+ sameSite?: "lax" | "strict" | "none" | undefined;
145
145
  maxAge?: number | undefined;
146
146
  expires?: Date | undefined;
147
147
  }[] | undefined;
@@ -173,7 +173,7 @@ export declare const HttpJsonSchema: z.ZodObject<{
173
173
  httpOnly: boolean;
174
174
  domain?: string | undefined;
175
175
  secure?: boolean | undefined;
176
- sameSite?: "strict" | "lax" | "none" | undefined;
176
+ sameSite?: "lax" | "strict" | "none" | undefined;
177
177
  maxAge?: number | undefined;
178
178
  expires?: Date | undefined;
179
179
  }, {
@@ -183,7 +183,7 @@ export declare const HttpJsonSchema: z.ZodObject<{
183
183
  domain?: string | undefined;
184
184
  httpOnly?: boolean | undefined;
185
185
  secure?: boolean | undefined;
186
- sameSite?: "strict" | "lax" | "none" | undefined;
186
+ sameSite?: "lax" | "strict" | "none" | undefined;
187
187
  maxAge?: number | undefined;
188
188
  expires?: Date | undefined;
189
189
  }>, "many">>>;
@@ -200,7 +200,7 @@ export declare const HttpJsonSchema: z.ZodObject<{
200
200
  httpOnly: boolean;
201
201
  domain?: string | undefined;
202
202
  secure?: boolean | undefined;
203
- sameSite?: "strict" | "lax" | "none" | undefined;
203
+ sameSite?: "lax" | "strict" | "none" | undefined;
204
204
  maxAge?: number | undefined;
205
205
  expires?: Date | undefined;
206
206
  }[] | undefined;
@@ -216,7 +216,7 @@ export declare const HttpJsonSchema: z.ZodObject<{
216
216
  domain?: string | undefined;
217
217
  httpOnly?: boolean | undefined;
218
218
  secure?: boolean | undefined;
219
- sameSite?: "strict" | "lax" | "none" | undefined;
219
+ sameSite?: "lax" | "strict" | "none" | undefined;
220
220
  maxAge?: number | undefined;
221
221
  expires?: Date | undefined;
222
222
  }[] | undefined;
@@ -266,7 +266,7 @@ export declare const HttpTextSchema: z.ZodObject<{
266
266
  httpOnly: boolean;
267
267
  domain?: string | undefined;
268
268
  secure?: boolean | undefined;
269
- sameSite?: "strict" | "lax" | "none" | undefined;
269
+ sameSite?: "lax" | "strict" | "none" | undefined;
270
270
  maxAge?: number | undefined;
271
271
  expires?: Date | undefined;
272
272
  }, {
@@ -276,7 +276,7 @@ export declare const HttpTextSchema: z.ZodObject<{
276
276
  domain?: string | undefined;
277
277
  httpOnly?: boolean | undefined;
278
278
  secure?: boolean | undefined;
279
- sameSite?: "strict" | "lax" | "none" | undefined;
279
+ sameSite?: "lax" | "strict" | "none" | undefined;
280
280
  maxAge?: number | undefined;
281
281
  expires?: Date | undefined;
282
282
  }>, "many">>>;
@@ -293,7 +293,7 @@ export declare const HttpTextSchema: z.ZodObject<{
293
293
  httpOnly: boolean;
294
294
  domain?: string | undefined;
295
295
  secure?: boolean | undefined;
296
- sameSite?: "strict" | "lax" | "none" | undefined;
296
+ sameSite?: "lax" | "strict" | "none" | undefined;
297
297
  maxAge?: number | undefined;
298
298
  expires?: Date | undefined;
299
299
  }[] | undefined;
@@ -309,7 +309,7 @@ export declare const HttpTextSchema: z.ZodObject<{
309
309
  domain?: string | undefined;
310
310
  httpOnly?: boolean | undefined;
311
311
  secure?: boolean | undefined;
312
- sameSite?: "strict" | "lax" | "none" | undefined;
312
+ sameSite?: "lax" | "strict" | "none" | undefined;
313
313
  maxAge?: number | undefined;
314
314
  expires?: Date | undefined;
315
315
  }[] | undefined;
@@ -339,7 +339,7 @@ export declare const HttpHtmlSchema: z.ZodObject<{
339
339
  httpOnly: boolean;
340
340
  domain?: string | undefined;
341
341
  secure?: boolean | undefined;
342
- sameSite?: "strict" | "lax" | "none" | undefined;
342
+ sameSite?: "lax" | "strict" | "none" | undefined;
343
343
  maxAge?: number | undefined;
344
344
  expires?: Date | undefined;
345
345
  }, {
@@ -349,7 +349,7 @@ export declare const HttpHtmlSchema: z.ZodObject<{
349
349
  domain?: string | undefined;
350
350
  httpOnly?: boolean | undefined;
351
351
  secure?: boolean | undefined;
352
- sameSite?: "strict" | "lax" | "none" | undefined;
352
+ sameSite?: "lax" | "strict" | "none" | undefined;
353
353
  maxAge?: number | undefined;
354
354
  expires?: Date | undefined;
355
355
  }>, "many">>>;
@@ -369,7 +369,7 @@ export declare const HttpHtmlSchema: z.ZodObject<{
369
369
  httpOnly: boolean;
370
370
  domain?: string | undefined;
371
371
  secure?: boolean | undefined;
372
- sameSite?: "strict" | "lax" | "none" | undefined;
372
+ sameSite?: "lax" | "strict" | "none" | undefined;
373
373
  maxAge?: number | undefined;
374
374
  expires?: Date | undefined;
375
375
  }[] | undefined;
@@ -385,7 +385,7 @@ export declare const HttpHtmlSchema: z.ZodObject<{
385
385
  domain?: string | undefined;
386
386
  httpOnly?: boolean | undefined;
387
387
  secure?: boolean | undefined;
388
- sameSite?: "strict" | "lax" | "none" | undefined;
388
+ sameSite?: "lax" | "strict" | "none" | undefined;
389
389
  maxAge?: number | undefined;
390
390
  expires?: Date | undefined;
391
391
  }[] | undefined;
@@ -422,7 +422,7 @@ export declare const HttpBinarySchema: z.ZodObject<{
422
422
  httpOnly: boolean;
423
423
  domain?: string | undefined;
424
424
  secure?: boolean | undefined;
425
- sameSite?: "strict" | "lax" | "none" | undefined;
425
+ sameSite?: "lax" | "strict" | "none" | undefined;
426
426
  maxAge?: number | undefined;
427
427
  expires?: Date | undefined;
428
428
  }, {
@@ -432,7 +432,7 @@ export declare const HttpBinarySchema: z.ZodObject<{
432
432
  domain?: string | undefined;
433
433
  httpOnly?: boolean | undefined;
434
434
  secure?: boolean | undefined;
435
- sameSite?: "strict" | "lax" | "none" | undefined;
435
+ sameSite?: "lax" | "strict" | "none" | undefined;
436
436
  maxAge?: number | undefined;
437
437
  expires?: Date | undefined;
438
438
  }>, "many">>>;
@@ -451,7 +451,7 @@ export declare const HttpBinarySchema: z.ZodObject<{
451
451
  httpOnly: boolean;
452
452
  domain?: string | undefined;
453
453
  secure?: boolean | undefined;
454
- sameSite?: "strict" | "lax" | "none" | undefined;
454
+ sameSite?: "lax" | "strict" | "none" | undefined;
455
455
  maxAge?: number | undefined;
456
456
  expires?: Date | undefined;
457
457
  }[] | undefined;
@@ -469,7 +469,7 @@ export declare const HttpBinarySchema: z.ZodObject<{
469
469
  domain?: string | undefined;
470
470
  httpOnly?: boolean | undefined;
471
471
  secure?: boolean | undefined;
472
- sameSite?: "strict" | "lax" | "none" | undefined;
472
+ sameSite?: "lax" | "strict" | "none" | undefined;
473
473
  maxAge?: number | undefined;
474
474
  expires?: Date | undefined;
475
475
  }[] | undefined;
@@ -504,7 +504,7 @@ export declare const HttpImageSchema: z.ZodObject<{
504
504
  httpOnly: boolean;
505
505
  domain?: string | undefined;
506
506
  secure?: boolean | undefined;
507
- sameSite?: "strict" | "lax" | "none" | undefined;
507
+ sameSite?: "lax" | "strict" | "none" | undefined;
508
508
  maxAge?: number | undefined;
509
509
  expires?: Date | undefined;
510
510
  }, {
@@ -514,7 +514,7 @@ export declare const HttpImageSchema: z.ZodObject<{
514
514
  domain?: string | undefined;
515
515
  httpOnly?: boolean | undefined;
516
516
  secure?: boolean | undefined;
517
- sameSite?: "strict" | "lax" | "none" | undefined;
517
+ sameSite?: "lax" | "strict" | "none" | undefined;
518
518
  maxAge?: number | undefined;
519
519
  expires?: Date | undefined;
520
520
  }>, "many">>>;
@@ -536,7 +536,7 @@ export declare const HttpImageSchema: z.ZodObject<{
536
536
  httpOnly: boolean;
537
537
  domain?: string | undefined;
538
538
  secure?: boolean | undefined;
539
- sameSite?: "strict" | "lax" | "none" | undefined;
539
+ sameSite?: "lax" | "strict" | "none" | undefined;
540
540
  maxAge?: number | undefined;
541
541
  expires?: Date | undefined;
542
542
  }[] | undefined;
@@ -554,7 +554,7 @@ export declare const HttpImageSchema: z.ZodObject<{
554
554
  domain?: string | undefined;
555
555
  httpOnly?: boolean | undefined;
556
556
  secure?: boolean | undefined;
557
- sameSite?: "strict" | "lax" | "none" | undefined;
557
+ sameSite?: "lax" | "strict" | "none" | undefined;
558
558
  maxAge?: number | undefined;
559
559
  expires?: Date | undefined;
560
560
  }[] | undefined;
@@ -594,7 +594,7 @@ export declare const HttpStreamSchema: z.ZodObject<{
594
594
  httpOnly: boolean;
595
595
  domain?: string | undefined;
596
596
  secure?: boolean | undefined;
597
- sameSite?: "strict" | "lax" | "none" | undefined;
597
+ sameSite?: "lax" | "strict" | "none" | undefined;
598
598
  maxAge?: number | undefined;
599
599
  expires?: Date | undefined;
600
600
  }, {
@@ -604,7 +604,7 @@ export declare const HttpStreamSchema: z.ZodObject<{
604
604
  domain?: string | undefined;
605
605
  httpOnly?: boolean | undefined;
606
606
  secure?: boolean | undefined;
607
- sameSite?: "strict" | "lax" | "none" | undefined;
607
+ sameSite?: "lax" | "strict" | "none" | undefined;
608
608
  maxAge?: number | undefined;
609
609
  expires?: Date | undefined;
610
610
  }>, "many">>>;
@@ -622,7 +622,7 @@ export declare const HttpStreamSchema: z.ZodObject<{
622
622
  httpOnly: boolean;
623
623
  domain?: string | undefined;
624
624
  secure?: boolean | undefined;
625
- sameSite?: "strict" | "lax" | "none" | undefined;
625
+ sameSite?: "lax" | "strict" | "none" | undefined;
626
626
  maxAge?: number | undefined;
627
627
  expires?: Date | undefined;
628
628
  }[] | undefined;
@@ -640,7 +640,7 @@ export declare const HttpStreamSchema: z.ZodObject<{
640
640
  domain?: string | undefined;
641
641
  httpOnly?: boolean | undefined;
642
642
  secure?: boolean | undefined;
643
- sameSite?: "strict" | "lax" | "none" | undefined;
643
+ sameSite?: "lax" | "strict" | "none" | undefined;
644
644
  maxAge?: number | undefined;
645
645
  expires?: Date | undefined;
646
646
  }[] | undefined;
@@ -673,7 +673,7 @@ export declare const HttpSseSchema: z.ZodObject<{
673
673
  httpOnly: boolean;
674
674
  domain?: string | undefined;
675
675
  secure?: boolean | undefined;
676
- sameSite?: "strict" | "lax" | "none" | undefined;
676
+ sameSite?: "lax" | "strict" | "none" | undefined;
677
677
  maxAge?: number | undefined;
678
678
  expires?: Date | undefined;
679
679
  }, {
@@ -683,7 +683,7 @@ export declare const HttpSseSchema: z.ZodObject<{
683
683
  domain?: string | undefined;
684
684
  httpOnly?: boolean | undefined;
685
685
  secure?: boolean | undefined;
686
- sameSite?: "strict" | "lax" | "none" | undefined;
686
+ sameSite?: "lax" | "strict" | "none" | undefined;
687
687
  maxAge?: number | undefined;
688
688
  expires?: Date | undefined;
689
689
  }>, "many">>>;
@@ -704,7 +704,7 @@ export declare const HttpSseSchema: z.ZodObject<{
704
704
  httpOnly: boolean;
705
705
  domain?: string | undefined;
706
706
  secure?: boolean | undefined;
707
- sameSite?: "strict" | "lax" | "none" | undefined;
707
+ sameSite?: "lax" | "strict" | "none" | undefined;
708
708
  maxAge?: number | undefined;
709
709
  expires?: Date | undefined;
710
710
  }[] | undefined;
@@ -721,7 +721,7 @@ export declare const HttpSseSchema: z.ZodObject<{
721
721
  domain?: string | undefined;
722
722
  httpOnly?: boolean | undefined;
723
723
  secure?: boolean | undefined;
724
- sameSite?: "strict" | "lax" | "none" | undefined;
724
+ sameSite?: "lax" | "strict" | "none" | undefined;
725
725
  maxAge?: number | undefined;
726
726
  expires?: Date | undefined;
727
727
  }[] | undefined;
@@ -814,7 +814,7 @@ export declare const HttpJsonRpcSchema: z.ZodObject<{
814
814
  httpOnly: boolean;
815
815
  domain?: string | undefined;
816
816
  secure?: boolean | undefined;
817
- sameSite?: "strict" | "lax" | "none" | undefined;
817
+ sameSite?: "lax" | "strict" | "none" | undefined;
818
818
  maxAge?: number | undefined;
819
819
  expires?: Date | undefined;
820
820
  }, {
@@ -824,7 +824,7 @@ export declare const HttpJsonRpcSchema: z.ZodObject<{
824
824
  domain?: string | undefined;
825
825
  httpOnly?: boolean | undefined;
826
826
  secure?: boolean | undefined;
827
- sameSite?: "strict" | "lax" | "none" | undefined;
827
+ sameSite?: "lax" | "strict" | "none" | undefined;
828
828
  maxAge?: number | undefined;
829
829
  expires?: Date | undefined;
830
830
  }>, "many">>>;
@@ -857,7 +857,7 @@ export declare const HttpJsonRpcSchema: z.ZodObject<{
857
857
  httpOnly: boolean;
858
858
  domain?: string | undefined;
859
859
  secure?: boolean | undefined;
860
- sameSite?: "strict" | "lax" | "none" | undefined;
860
+ sameSite?: "lax" | "strict" | "none" | undefined;
861
861
  maxAge?: number | undefined;
862
862
  expires?: Date | undefined;
863
863
  }[] | undefined;
@@ -889,7 +889,7 @@ export declare const HttpJsonRpcSchema: z.ZodObject<{
889
889
  domain?: string | undefined;
890
890
  httpOnly?: boolean | undefined;
891
891
  secure?: boolean | undefined;
892
- sameSite?: "strict" | "lax" | "none" | undefined;
892
+ sameSite?: "lax" | "strict" | "none" | undefined;
893
893
  maxAge?: number | undefined;
894
894
  expires?: Date | undefined;
895
895
  }[] | undefined;
@@ -928,7 +928,7 @@ export declare const HttpProblemSchema: z.ZodObject<{
928
928
  httpOnly: boolean;
929
929
  domain?: string | undefined;
930
930
  secure?: boolean | undefined;
931
- sameSite?: "strict" | "lax" | "none" | undefined;
931
+ sameSite?: "lax" | "strict" | "none" | undefined;
932
932
  maxAge?: number | undefined;
933
933
  expires?: Date | undefined;
934
934
  }, {
@@ -938,7 +938,7 @@ export declare const HttpProblemSchema: z.ZodObject<{
938
938
  domain?: string | undefined;
939
939
  httpOnly?: boolean | undefined;
940
940
  secure?: boolean | undefined;
941
- sameSite?: "strict" | "lax" | "none" | undefined;
941
+ sameSite?: "lax" | "strict" | "none" | undefined;
942
942
  maxAge?: number | undefined;
943
943
  expires?: Date | undefined;
944
944
  }>, "many">>>;
@@ -959,7 +959,7 @@ export declare const HttpProblemSchema: z.ZodObject<{
959
959
  httpOnly: boolean;
960
960
  domain?: string | undefined;
961
961
  secure?: boolean | undefined;
962
- sameSite?: "strict" | "lax" | "none" | undefined;
962
+ sameSite?: "lax" | "strict" | "none" | undefined;
963
963
  maxAge?: number | undefined;
964
964
  expires?: Date | undefined;
965
965
  }[] | undefined;
@@ -979,7 +979,7 @@ export declare const HttpProblemSchema: z.ZodObject<{
979
979
  domain?: string | undefined;
980
980
  httpOnly?: boolean | undefined;
981
981
  secure?: boolean | undefined;
982
- sameSite?: "strict" | "lax" | "none" | undefined;
982
+ sameSite?: "lax" | "strict" | "none" | undefined;
983
983
  maxAge?: number | undefined;
984
984
  expires?: Date | undefined;
985
985
  }[] | undefined;
@@ -1010,7 +1010,7 @@ export declare const HttpEmptySchema: z.ZodObject<{
1010
1010
  httpOnly: boolean;
1011
1011
  domain?: string | undefined;
1012
1012
  secure?: boolean | undefined;
1013
- sameSite?: "strict" | "lax" | "none" | undefined;
1013
+ sameSite?: "lax" | "strict" | "none" | undefined;
1014
1014
  maxAge?: number | undefined;
1015
1015
  expires?: Date | undefined;
1016
1016
  }, {
@@ -1020,7 +1020,7 @@ export declare const HttpEmptySchema: z.ZodObject<{
1020
1020
  domain?: string | undefined;
1021
1021
  httpOnly?: boolean | undefined;
1022
1022
  secure?: boolean | undefined;
1023
- sameSite?: "strict" | "lax" | "none" | undefined;
1023
+ sameSite?: "lax" | "strict" | "none" | undefined;
1024
1024
  maxAge?: number | undefined;
1025
1025
  expires?: Date | undefined;
1026
1026
  }>, "many">>>;
@@ -1035,7 +1035,7 @@ export declare const HttpEmptySchema: z.ZodObject<{
1035
1035
  httpOnly: boolean;
1036
1036
  domain?: string | undefined;
1037
1037
  secure?: boolean | undefined;
1038
- sameSite?: "strict" | "lax" | "none" | undefined;
1038
+ sameSite?: "lax" | "strict" | "none" | undefined;
1039
1039
  maxAge?: number | undefined;
1040
1040
  expires?: Date | undefined;
1041
1041
  }[] | undefined;
@@ -1050,7 +1050,7 @@ export declare const HttpEmptySchema: z.ZodObject<{
1050
1050
  domain?: string | undefined;
1051
1051
  httpOnly?: boolean | undefined;
1052
1052
  secure?: boolean | undefined;
1053
- sameSite?: "strict" | "lax" | "none" | undefined;
1053
+ sameSite?: "lax" | "strict" | "none" | undefined;
1054
1054
  maxAge?: number | undefined;
1055
1055
  expires?: Date | undefined;
1056
1056
  }[] | undefined;
@@ -1081,7 +1081,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1081
1081
  httpOnly: boolean;
1082
1082
  domain?: string | undefined;
1083
1083
  secure?: boolean | undefined;
1084
- sameSite?: "strict" | "lax" | "none" | undefined;
1084
+ sameSite?: "lax" | "strict" | "none" | undefined;
1085
1085
  maxAge?: number | undefined;
1086
1086
  expires?: Date | undefined;
1087
1087
  }, {
@@ -1091,7 +1091,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1091
1091
  domain?: string | undefined;
1092
1092
  httpOnly?: boolean | undefined;
1093
1093
  secure?: boolean | undefined;
1094
- sameSite?: "strict" | "lax" | "none" | undefined;
1094
+ sameSite?: "lax" | "strict" | "none" | undefined;
1095
1095
  maxAge?: number | undefined;
1096
1096
  expires?: Date | undefined;
1097
1097
  }>, "many">>>;
@@ -1107,7 +1107,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1107
1107
  httpOnly: boolean;
1108
1108
  domain?: string | undefined;
1109
1109
  secure?: boolean | undefined;
1110
- sameSite?: "strict" | "lax" | "none" | undefined;
1110
+ sameSite?: "lax" | "strict" | "none" | undefined;
1111
1111
  maxAge?: number | undefined;
1112
1112
  expires?: Date | undefined;
1113
1113
  }[] | undefined;
@@ -1123,7 +1123,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1123
1123
  domain?: string | undefined;
1124
1124
  httpOnly?: boolean | undefined;
1125
1125
  secure?: boolean | undefined;
1126
- sameSite?: "strict" | "lax" | "none" | undefined;
1126
+ sameSite?: "lax" | "strict" | "none" | undefined;
1127
1127
  maxAge?: number | undefined;
1128
1128
  expires?: Date | undefined;
1129
1129
  }[] | undefined;
@@ -1151,7 +1151,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1151
1151
  httpOnly: boolean;
1152
1152
  domain?: string | undefined;
1153
1153
  secure?: boolean | undefined;
1154
- sameSite?: "strict" | "lax" | "none" | undefined;
1154
+ sameSite?: "lax" | "strict" | "none" | undefined;
1155
1155
  maxAge?: number | undefined;
1156
1156
  expires?: Date | undefined;
1157
1157
  }, {
@@ -1161,7 +1161,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1161
1161
  domain?: string | undefined;
1162
1162
  httpOnly?: boolean | undefined;
1163
1163
  secure?: boolean | undefined;
1164
- sameSite?: "strict" | "lax" | "none" | undefined;
1164
+ sameSite?: "lax" | "strict" | "none" | undefined;
1165
1165
  maxAge?: number | undefined;
1166
1166
  expires?: Date | undefined;
1167
1167
  }>, "many">>>;
@@ -1178,7 +1178,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1178
1178
  httpOnly: boolean;
1179
1179
  domain?: string | undefined;
1180
1180
  secure?: boolean | undefined;
1181
- sameSite?: "strict" | "lax" | "none" | undefined;
1181
+ sameSite?: "lax" | "strict" | "none" | undefined;
1182
1182
  maxAge?: number | undefined;
1183
1183
  expires?: Date | undefined;
1184
1184
  }[] | undefined;
@@ -1194,7 +1194,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1194
1194
  domain?: string | undefined;
1195
1195
  httpOnly?: boolean | undefined;
1196
1196
  secure?: boolean | undefined;
1197
- sameSite?: "strict" | "lax" | "none" | undefined;
1197
+ sameSite?: "lax" | "strict" | "none" | undefined;
1198
1198
  maxAge?: number | undefined;
1199
1199
  expires?: Date | undefined;
1200
1200
  }[] | undefined;
@@ -1223,7 +1223,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1223
1223
  httpOnly: boolean;
1224
1224
  domain?: string | undefined;
1225
1225
  secure?: boolean | undefined;
1226
- sameSite?: "strict" | "lax" | "none" | undefined;
1226
+ sameSite?: "lax" | "strict" | "none" | undefined;
1227
1227
  maxAge?: number | undefined;
1228
1228
  expires?: Date | undefined;
1229
1229
  }, {
@@ -1233,7 +1233,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1233
1233
  domain?: string | undefined;
1234
1234
  httpOnly?: boolean | undefined;
1235
1235
  secure?: boolean | undefined;
1236
- sameSite?: "strict" | "lax" | "none" | undefined;
1236
+ sameSite?: "lax" | "strict" | "none" | undefined;
1237
1237
  maxAge?: number | undefined;
1238
1238
  expires?: Date | undefined;
1239
1239
  }>, "many">>>;
@@ -1250,7 +1250,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1250
1250
  httpOnly: boolean;
1251
1251
  domain?: string | undefined;
1252
1252
  secure?: boolean | undefined;
1253
- sameSite?: "strict" | "lax" | "none" | undefined;
1253
+ sameSite?: "lax" | "strict" | "none" | undefined;
1254
1254
  maxAge?: number | undefined;
1255
1255
  expires?: Date | undefined;
1256
1256
  }[] | undefined;
@@ -1266,7 +1266,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1266
1266
  domain?: string | undefined;
1267
1267
  httpOnly?: boolean | undefined;
1268
1268
  secure?: boolean | undefined;
1269
- sameSite?: "strict" | "lax" | "none" | undefined;
1269
+ sameSite?: "lax" | "strict" | "none" | undefined;
1270
1270
  maxAge?: number | undefined;
1271
1271
  expires?: Date | undefined;
1272
1272
  }[] | undefined;
@@ -1292,7 +1292,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1292
1292
  httpOnly: boolean;
1293
1293
  domain?: string | undefined;
1294
1294
  secure?: boolean | undefined;
1295
- sameSite?: "strict" | "lax" | "none" | undefined;
1295
+ sameSite?: "lax" | "strict" | "none" | undefined;
1296
1296
  maxAge?: number | undefined;
1297
1297
  expires?: Date | undefined;
1298
1298
  }, {
@@ -1302,7 +1302,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1302
1302
  domain?: string | undefined;
1303
1303
  httpOnly?: boolean | undefined;
1304
1304
  secure?: boolean | undefined;
1305
- sameSite?: "strict" | "lax" | "none" | undefined;
1305
+ sameSite?: "lax" | "strict" | "none" | undefined;
1306
1306
  maxAge?: number | undefined;
1307
1307
  expires?: Date | undefined;
1308
1308
  }>, "many">>>;
@@ -1322,7 +1322,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1322
1322
  httpOnly: boolean;
1323
1323
  domain?: string | undefined;
1324
1324
  secure?: boolean | undefined;
1325
- sameSite?: "strict" | "lax" | "none" | undefined;
1325
+ sameSite?: "lax" | "strict" | "none" | undefined;
1326
1326
  maxAge?: number | undefined;
1327
1327
  expires?: Date | undefined;
1328
1328
  }[] | undefined;
@@ -1338,7 +1338,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1338
1338
  domain?: string | undefined;
1339
1339
  httpOnly?: boolean | undefined;
1340
1340
  secure?: boolean | undefined;
1341
- sameSite?: "strict" | "lax" | "none" | undefined;
1341
+ sameSite?: "lax" | "strict" | "none" | undefined;
1342
1342
  maxAge?: number | undefined;
1343
1343
  expires?: Date | undefined;
1344
1344
  }[] | undefined;
@@ -1370,7 +1370,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1370
1370
  httpOnly: boolean;
1371
1371
  domain?: string | undefined;
1372
1372
  secure?: boolean | undefined;
1373
- sameSite?: "strict" | "lax" | "none" | undefined;
1373
+ sameSite?: "lax" | "strict" | "none" | undefined;
1374
1374
  maxAge?: number | undefined;
1375
1375
  expires?: Date | undefined;
1376
1376
  }, {
@@ -1380,7 +1380,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1380
1380
  domain?: string | undefined;
1381
1381
  httpOnly?: boolean | undefined;
1382
1382
  secure?: boolean | undefined;
1383
- sameSite?: "strict" | "lax" | "none" | undefined;
1383
+ sameSite?: "lax" | "strict" | "none" | undefined;
1384
1384
  maxAge?: number | undefined;
1385
1385
  expires?: Date | undefined;
1386
1386
  }>, "many">>>;
@@ -1399,7 +1399,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1399
1399
  httpOnly: boolean;
1400
1400
  domain?: string | undefined;
1401
1401
  secure?: boolean | undefined;
1402
- sameSite?: "strict" | "lax" | "none" | undefined;
1402
+ sameSite?: "lax" | "strict" | "none" | undefined;
1403
1403
  maxAge?: number | undefined;
1404
1404
  expires?: Date | undefined;
1405
1405
  }[] | undefined;
@@ -1417,7 +1417,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1417
1417
  domain?: string | undefined;
1418
1418
  httpOnly?: boolean | undefined;
1419
1419
  secure?: boolean | undefined;
1420
- sameSite?: "strict" | "lax" | "none" | undefined;
1420
+ sameSite?: "lax" | "strict" | "none" | undefined;
1421
1421
  maxAge?: number | undefined;
1422
1422
  expires?: Date | undefined;
1423
1423
  }[] | undefined;
@@ -1448,7 +1448,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1448
1448
  httpOnly: boolean;
1449
1449
  domain?: string | undefined;
1450
1450
  secure?: boolean | undefined;
1451
- sameSite?: "strict" | "lax" | "none" | undefined;
1451
+ sameSite?: "lax" | "strict" | "none" | undefined;
1452
1452
  maxAge?: number | undefined;
1453
1453
  expires?: Date | undefined;
1454
1454
  }, {
@@ -1458,7 +1458,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1458
1458
  domain?: string | undefined;
1459
1459
  httpOnly?: boolean | undefined;
1460
1460
  secure?: boolean | undefined;
1461
- sameSite?: "strict" | "lax" | "none" | undefined;
1461
+ sameSite?: "lax" | "strict" | "none" | undefined;
1462
1462
  maxAge?: number | undefined;
1463
1463
  expires?: Date | undefined;
1464
1464
  }>, "many">>>;
@@ -1480,7 +1480,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1480
1480
  httpOnly: boolean;
1481
1481
  domain?: string | undefined;
1482
1482
  secure?: boolean | undefined;
1483
- sameSite?: "strict" | "lax" | "none" | undefined;
1483
+ sameSite?: "lax" | "strict" | "none" | undefined;
1484
1484
  maxAge?: number | undefined;
1485
1485
  expires?: Date | undefined;
1486
1486
  }[] | undefined;
@@ -1498,7 +1498,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1498
1498
  domain?: string | undefined;
1499
1499
  httpOnly?: boolean | undefined;
1500
1500
  secure?: boolean | undefined;
1501
- sameSite?: "strict" | "lax" | "none" | undefined;
1501
+ sameSite?: "lax" | "strict" | "none" | undefined;
1502
1502
  maxAge?: number | undefined;
1503
1503
  expires?: Date | undefined;
1504
1504
  }[] | undefined;
@@ -1531,7 +1531,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1531
1531
  httpOnly: boolean;
1532
1532
  domain?: string | undefined;
1533
1533
  secure?: boolean | undefined;
1534
- sameSite?: "strict" | "lax" | "none" | undefined;
1534
+ sameSite?: "lax" | "strict" | "none" | undefined;
1535
1535
  maxAge?: number | undefined;
1536
1536
  expires?: Date | undefined;
1537
1537
  }, {
@@ -1541,7 +1541,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1541
1541
  domain?: string | undefined;
1542
1542
  httpOnly?: boolean | undefined;
1543
1543
  secure?: boolean | undefined;
1544
- sameSite?: "strict" | "lax" | "none" | undefined;
1544
+ sameSite?: "lax" | "strict" | "none" | undefined;
1545
1545
  maxAge?: number | undefined;
1546
1546
  expires?: Date | undefined;
1547
1547
  }>, "many">>>;
@@ -1559,7 +1559,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1559
1559
  httpOnly: boolean;
1560
1560
  domain?: string | undefined;
1561
1561
  secure?: boolean | undefined;
1562
- sameSite?: "strict" | "lax" | "none" | undefined;
1562
+ sameSite?: "lax" | "strict" | "none" | undefined;
1563
1563
  maxAge?: number | undefined;
1564
1564
  expires?: Date | undefined;
1565
1565
  }[] | undefined;
@@ -1577,7 +1577,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1577
1577
  domain?: string | undefined;
1578
1578
  httpOnly?: boolean | undefined;
1579
1579
  secure?: boolean | undefined;
1580
- sameSite?: "strict" | "lax" | "none" | undefined;
1580
+ sameSite?: "lax" | "strict" | "none" | undefined;
1581
1581
  maxAge?: number | undefined;
1582
1582
  expires?: Date | undefined;
1583
1583
  }[] | undefined;
@@ -1606,7 +1606,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1606
1606
  httpOnly: boolean;
1607
1607
  domain?: string | undefined;
1608
1608
  secure?: boolean | undefined;
1609
- sameSite?: "strict" | "lax" | "none" | undefined;
1609
+ sameSite?: "lax" | "strict" | "none" | undefined;
1610
1610
  maxAge?: number | undefined;
1611
1611
  expires?: Date | undefined;
1612
1612
  }, {
@@ -1616,7 +1616,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1616
1616
  domain?: string | undefined;
1617
1617
  httpOnly?: boolean | undefined;
1618
1618
  secure?: boolean | undefined;
1619
- sameSite?: "strict" | "lax" | "none" | undefined;
1619
+ sameSite?: "lax" | "strict" | "none" | undefined;
1620
1620
  maxAge?: number | undefined;
1621
1621
  expires?: Date | undefined;
1622
1622
  }>, "many">>>;
@@ -1637,7 +1637,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1637
1637
  httpOnly: boolean;
1638
1638
  domain?: string | undefined;
1639
1639
  secure?: boolean | undefined;
1640
- sameSite?: "strict" | "lax" | "none" | undefined;
1640
+ sameSite?: "lax" | "strict" | "none" | undefined;
1641
1641
  maxAge?: number | undefined;
1642
1642
  expires?: Date | undefined;
1643
1643
  }[] | undefined;
@@ -1654,7 +1654,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1654
1654
  domain?: string | undefined;
1655
1655
  httpOnly?: boolean | undefined;
1656
1656
  secure?: boolean | undefined;
1657
- sameSite?: "strict" | "lax" | "none" | undefined;
1657
+ sameSite?: "lax" | "strict" | "none" | undefined;
1658
1658
  maxAge?: number | undefined;
1659
1659
  expires?: Date | undefined;
1660
1660
  }[] | undefined;
@@ -1743,7 +1743,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1743
1743
  httpOnly: boolean;
1744
1744
  domain?: string | undefined;
1745
1745
  secure?: boolean | undefined;
1746
- sameSite?: "strict" | "lax" | "none" | undefined;
1746
+ sameSite?: "lax" | "strict" | "none" | undefined;
1747
1747
  maxAge?: number | undefined;
1748
1748
  expires?: Date | undefined;
1749
1749
  }, {
@@ -1753,7 +1753,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1753
1753
  domain?: string | undefined;
1754
1754
  httpOnly?: boolean | undefined;
1755
1755
  secure?: boolean | undefined;
1756
- sameSite?: "strict" | "lax" | "none" | undefined;
1756
+ sameSite?: "lax" | "strict" | "none" | undefined;
1757
1757
  maxAge?: number | undefined;
1758
1758
  expires?: Date | undefined;
1759
1759
  }>, "many">>>;
@@ -1786,7 +1786,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1786
1786
  httpOnly: boolean;
1787
1787
  domain?: string | undefined;
1788
1788
  secure?: boolean | undefined;
1789
- sameSite?: "strict" | "lax" | "none" | undefined;
1789
+ sameSite?: "lax" | "strict" | "none" | undefined;
1790
1790
  maxAge?: number | undefined;
1791
1791
  expires?: Date | undefined;
1792
1792
  }[] | undefined;
@@ -1818,7 +1818,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1818
1818
  domain?: string | undefined;
1819
1819
  httpOnly?: boolean | undefined;
1820
1820
  secure?: boolean | undefined;
1821
- sameSite?: "strict" | "lax" | "none" | undefined;
1821
+ sameSite?: "lax" | "strict" | "none" | undefined;
1822
1822
  maxAge?: number | undefined;
1823
1823
  expires?: Date | undefined;
1824
1824
  }[] | undefined;
@@ -1853,7 +1853,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1853
1853
  httpOnly: boolean;
1854
1854
  domain?: string | undefined;
1855
1855
  secure?: boolean | undefined;
1856
- sameSite?: "strict" | "lax" | "none" | undefined;
1856
+ sameSite?: "lax" | "strict" | "none" | undefined;
1857
1857
  maxAge?: number | undefined;
1858
1858
  expires?: Date | undefined;
1859
1859
  }, {
@@ -1863,7 +1863,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1863
1863
  domain?: string | undefined;
1864
1864
  httpOnly?: boolean | undefined;
1865
1865
  secure?: boolean | undefined;
1866
- sameSite?: "strict" | "lax" | "none" | undefined;
1866
+ sameSite?: "lax" | "strict" | "none" | undefined;
1867
1867
  maxAge?: number | undefined;
1868
1868
  expires?: Date | undefined;
1869
1869
  }>, "many">>>;
@@ -1884,7 +1884,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1884
1884
  httpOnly: boolean;
1885
1885
  domain?: string | undefined;
1886
1886
  secure?: boolean | undefined;
1887
- sameSite?: "strict" | "lax" | "none" | undefined;
1887
+ sameSite?: "lax" | "strict" | "none" | undefined;
1888
1888
  maxAge?: number | undefined;
1889
1889
  expires?: Date | undefined;
1890
1890
  }[] | undefined;
@@ -1904,7 +1904,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1904
1904
  domain?: string | undefined;
1905
1905
  httpOnly?: boolean | undefined;
1906
1906
  secure?: boolean | undefined;
1907
- sameSite?: "strict" | "lax" | "none" | undefined;
1907
+ sameSite?: "lax" | "strict" | "none" | undefined;
1908
1908
  maxAge?: number | undefined;
1909
1909
  expires?: Date | undefined;
1910
1910
  }[] | undefined;
@@ -1931,7 +1931,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1931
1931
  httpOnly: boolean;
1932
1932
  domain?: string | undefined;
1933
1933
  secure?: boolean | undefined;
1934
- sameSite?: "strict" | "lax" | "none" | undefined;
1934
+ sameSite?: "lax" | "strict" | "none" | undefined;
1935
1935
  maxAge?: number | undefined;
1936
1936
  expires?: Date | undefined;
1937
1937
  }, {
@@ -1941,7 +1941,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1941
1941
  domain?: string | undefined;
1942
1942
  httpOnly?: boolean | undefined;
1943
1943
  secure?: boolean | undefined;
1944
- sameSite?: "strict" | "lax" | "none" | undefined;
1944
+ sameSite?: "lax" | "strict" | "none" | undefined;
1945
1945
  maxAge?: number | undefined;
1946
1946
  expires?: Date | undefined;
1947
1947
  }>, "many">>>;
@@ -1956,7 +1956,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1956
1956
  httpOnly: boolean;
1957
1957
  domain?: string | undefined;
1958
1958
  secure?: boolean | undefined;
1959
- sameSite?: "strict" | "lax" | "none" | undefined;
1959
+ sameSite?: "lax" | "strict" | "none" | undefined;
1960
1960
  maxAge?: number | undefined;
1961
1961
  expires?: Date | undefined;
1962
1962
  }[] | undefined;
@@ -1971,7 +1971,7 @@ export declare const httpOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1971
1971
  domain?: string | undefined;
1972
1972
  httpOnly?: boolean | undefined;
1973
1973
  secure?: boolean | undefined;
1974
- sameSite?: "strict" | "lax" | "none" | undefined;
1974
+ sameSite?: "lax" | "strict" | "none" | undefined;
1975
1975
  maxAge?: number | undefined;
1976
1976
  expires?: Date | undefined;
1977
1977
  }[] | undefined;
@@ -1993,7 +1993,7 @@ export type HttpOutput = z.infer<typeof httpOutputSchema>;
1993
1993
  * Convenience factories
1994
1994
  */
1995
1995
  export declare const httpRespond: {
1996
- json: <T extends Record<string, any>>(body: T) => z.infer<typeof HttpJsonSchema>;
1996
+ json: <T extends Record<string, any>>(body: T, extra?: Partial<z.infer<typeof HttpJsonSchema>>) => z.infer<typeof HttpJsonSchema>;
1997
1997
  ok: (body: string | Record<string, any>) => z.infer<typeof HttpJsonSchema> | z.infer<typeof HttpTextSchema>;
1998
1998
  unauthorized: (options?: {
1999
1999
  headers?: Record<string, string>;
@@ -218,8 +218,8 @@ exports.httpOutputSchema = zod_1.z.discriminatedUnion('kind', [
218
218
  * Convenience factories
219
219
  */
220
220
  exports.httpRespond = {
221
- json: (body) => {
222
- return { kind: 'json', status: 200, body, contentType: 'application/json; charset=utf-8' };
221
+ json: (body, extra = {}) => {
222
+ return { kind: 'json', status: 200, body, contentType: 'application/json; charset=utf-8', ...extra };
223
223
  },
224
224
  ok: (body) => {
225
225
  return typeof body === 'string'
@@ -1 +1 @@
1
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,mBAAU,GAAE;SAC9B;KACF,CAAC;IAEF,UAAU,EAAE,CAAC,SAAoB,EAAE,MAAc,EAAE,MAAW,EAAkB,EAAE,CAAC,CAAC;QAClF,OAAO,EAAE,gBAAQ;QACjB,EAAE,EAAE,SAAS,IAAI,IAAA,mBAAU,GAAE;QAC7B,MAAM;QACN,MAAM;KACP,CAAC;IACF,QAAQ,CAAC,QAAgB;QACvB,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,GAAG;YACX,QAAQ;SACT,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAA2B;QAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACpC,CAAC;IACD,QAAQ;QACN,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC9B,CAAC;CACF,CAAC","sourcesContent":["// output-schemas.ts\nimport { z } from 'zod';\nimport {\n JSONRPCError,\n JSONRPCMessage,\n RequestId,\n JSONRPCResponseSchema,\n JSONRPCErrorSchema,\n} from '@modelcontextprotocol/sdk/types.js';\nimport { randomUUID } from 'crypto';\n\n/**\n * Constants\n */\nexport const JSON_RPC = '2.0' as const;\nexport const REDIRECTS = [301, 302, 303, 307, 308] as const;\nexport const NO_BODY_STATUSES = [204, 304] as const;\n\n/**\n * Helpers\n */\n// numeric-literal union from a readonly tuple of at least TWO numbers (no any)\nconst zNumUnion = <T extends readonly [number, number, ...number[]]>(vals: T): z.ZodType<T[number]> => {\n let schema: z.ZodType<T[number]> = z.literal(vals[0]) as z.ZodType<T[number]>;\n for (let i = 1; i < vals.length; i++) {\n schema = schema.or(z.literal(vals[i])) as z.ZodType<T[number]>;\n }\n return schema;\n};\n\nexport const HttpStatus = z.number().int().min(100).max(599);\nexport const HttpRedirectStatus = zNumUnion(REDIRECTS);\nexport const HttpEmptyStatus = zNumUnion(NO_BODY_STATUSES);\n\nexport const HttpHeaders = z.record(z.union([z.string(), z.union([z.string(), z.array(z.string())])])).default({});\n\nexport const HttpCookieSchema = z.object({\n name: z.string().min(1),\n value: z.string(),\n path: z.string().default('/'),\n domain: z.string().optional(),\n httpOnly: z.boolean().default(true),\n secure: z.boolean().optional(),\n sameSite: z.enum(['lax', 'strict', 'none']).optional(),\n maxAge: z.number().int().nonnegative().optional(),\n expires: z.date().optional(),\n});\nexport type HttpCookie = z.infer<typeof HttpCookieSchema>;\n\nexport const HttpCookies = z.array(HttpCookieSchema).default([]);\n\nconst HttpMeta = z.object({\n headers: HttpHeaders.optional(),\n cookies: HttpCookies.optional(),\n});\n\nconst statusAllowsBody = (s: number) => !NO_BODY_STATUSES.includes(s as (typeof NO_BODY_STATUSES)[number]);\n\n/**\n * Redirect (3xx)\n */\nexport const HttpRedirectSchema = z\n .object({\n kind: z.literal('redirect'),\n status: HttpRedirectStatus.default(302),\n location: z.string().url(),\n })\n .merge(HttpMeta);\n\n/**\n * JSON (application/json)\n */\nexport const HttpJsonSchema = z\n .object({\n kind: z.literal('json'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'JSON responses must allow a body and not be a redirect.',\n }),\n body: z.union([z.object({}).passthrough(), z.array(z.any()), z.record(z.string(), z.any())]),\n contentType: z.string().default('application/json; charset=utf-8'),\n })\n .merge(HttpMeta);\n\n/**\n * unknown — plain text, HTML, etc.\n */\nexport const HttpNextSchema = z\n .object({\n kind: z.literal('next'),\n })\n .passthrough();\n\nexport const HttpConsumedSchema = z.object({ kind: z.literal('consumed') });\n\n/**\n * Text (text/*) — plain text, HTML, etc.\n */\nexport const HttpTextSchema = z\n .object({\n kind: z.literal('text'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'Text responses must allow a body and not be a redirect.',\n }),\n body: z.string(),\n contentType: z\n .string()\n .regex(/^text\\/[a-z0-9.+-]+/i, 'contentType must be a text/* MIME type')\n .default('text/plain; charset=utf-8'),\n })\n .merge(HttpMeta);\n\n/**\n * HTML (text/html) — convenience specialization of Text\n */\nexport const HttpHtmlSchema = HttpTextSchema.extend({\n kind: z.literal('html'),\n contentType: z.literal('text/html; charset=utf-8').default('text/html; charset=utf-8'),\n});\n\n/**\n * Binary/file (Uint8Array or string with encoding)\n * Works for PDFs, archives, audio, video, etc.\n */\nexport const HttpBinarySchema = z\n .object({\n kind: z.literal('binary'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'Binary responses must allow a body and not be a redirect.',\n }),\n body: z.union([z.instanceof(Uint8Array), z.string()]),\n // how to interpret string body\n encoding: z.enum(['utf8', 'base64']).default('utf8'),\n contentType: z.string().min(1),\n disposition: z.enum(['inline', 'attachment']).default('inline'),\n filename: z.string().optional(),\n })\n .merge(HttpMeta);\n\n/**\n * Images — narrowed binary with common image types\n */\nexport const HttpImageSchema = HttpBinarySchema.extend({\n kind: z.literal('image'),\n contentType: z.enum([\n 'image/png',\n 'image/jpeg',\n 'image/webp',\n 'image/gif',\n 'image/svg+xml',\n 'image/avif',\n 'image/apng',\n 'image/bmp',\n 'image/x-icon',\n ]),\n});\n\n/**\n * Stream (Readable-like or AsyncIterable) — runtime-agnostic\n */\nexport type HttpReadableLike = { pipe?: (dest: unknown) => unknown } | AsyncIterable<Uint8Array>;\n\nconst isHttpReadableLike = (v: unknown): v is HttpReadableLike => {\n if (typeof v !== 'object' || v === null) return false;\n const maybePipe = (v as { pipe?: unknown }).pipe;\n const maybeAI = (v as { [Symbol.asyncIterator]?: unknown })[Symbol.asyncIterator];\n return typeof maybePipe === 'function' || typeof maybeAI === 'function';\n};\n\nexport const HttpStreamSchema = z\n .object({\n kind: z.literal('stream'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'Stream responses must allow a body and not be a redirect.',\n }),\n stream: z.custom<HttpReadableLike>(isHttpReadableLike, 'stream must be a Readable-like or AsyncIterable'),\n contentType: z.string().min(1),\n disposition: z.enum(['inline', 'attachment']).default('inline'),\n filename: z.string().optional(),\n })\n .merge(HttpMeta);\n\n/**\n * Server-Sent Events (specialized stream)\n */\nexport const HttpSseSchema = HttpStreamSchema.extend({\n kind: z.literal('sse'),\n contentType: z.literal('text/event-stream').default('text/event-stream'),\n});\n\n/**\n * JSON-RPC 2.0 wrapped for HTTP union (kind='jsonrpc')\n */\nexport const HttpJsonRpcSchema = z\n .object({\n kind: z.literal('jsonrpc'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'JSON-RPC responses must allow a body and not be a redirect.',\n }),\n contentType: z.string().default('application/json; charset=utf-8'),\n body: z.union([JSONRPCResponseSchema, JSONRPCErrorSchema]),\n })\n .merge(HttpMeta);\n\n/**\n * RFC 7807 Problem Details (application/problem+json)\n */\nexport const HttpProblemSchema = z\n .object({\n kind: z.literal('problem'),\n status: HttpStatus,\n contentType: z.literal('application/problem+json').default('application/problem+json'),\n body: z\n .object({\n error: z.string(),\n })\n .passthrough(), // allow extension members\n })\n .merge(HttpMeta);\n\n/**\n * Empty responses (204/304) — MUST NOT include a body\n */\nexport const HttpEmptySchema = z\n .object({\n kind: z.literal('empty'),\n status: HttpEmptyStatus,\n })\n .merge(HttpMeta);\n\n/**\n * Master union — validate all server outputs with this\n */\nexport const httpOutputSchema = z.discriminatedUnion('kind', [\n HttpRedirectSchema,\n HttpJsonSchema,\n HttpTextSchema,\n HttpHtmlSchema,\n HttpBinarySchema,\n HttpImageSchema,\n HttpStreamSchema,\n HttpSseSchema,\n HttpJsonRpcSchema,\n HttpProblemSchema,\n HttpEmptySchema,\n HttpNextSchema,\n HttpConsumedSchema,\n]);\n\nexport type HttpOutput = z.infer<typeof httpOutputSchema>;\n\n/**\n * Convenience factories\n */\nexport const httpRespond = {\n json: <T extends Record<string, any>>(body: T): z.infer<typeof HttpJsonSchema> => {\n return { kind: 'json', status: 200, body, contentType: 'application/json; charset=utf-8' };\n },\n\n ok: (body: string | Record<string, any>): z.infer<typeof HttpJsonSchema> | z.infer<typeof HttpTextSchema> => {\n return typeof body === 'string'\n ? { kind: 'text', status: 200, body, contentType: 'text/plain; charset=utf-8' }\n : { kind: 'json', status: 200, body, contentType: 'application/json; charset=utf-8' };\n },\n\n unauthorized: (options?: {\n headers?: Record<string, string>;\n body?: Record<string, string>;\n status?: number;\n }): z.infer<typeof HttpJsonSchema> => ({\n kind: 'json',\n status: options?.status ?? 401,\n body: options?.body ?? { error: 'Unauthorized' },\n headers: options?.headers,\n contentType: 'application/json; charset=utf-8',\n }),\n\n html: (markup: string, status = 200): z.infer<typeof HttpHtmlSchema> => ({\n kind: 'html',\n status,\n body: markup,\n contentType: 'text/html; charset=utf-8',\n }),\n\n notFound: (message = 'Not Found'): z.infer<typeof HttpTextSchema> => ({\n kind: 'text',\n status: 404,\n body: message,\n contentType: 'text/plain; charset=utf-8',\n }),\n\n noValidSessionError: (): JSONRPCError => ({\n jsonrpc: JSON_RPC,\n error: { code: -32000, message: 'Bad Request: No valid session ID provided' },\n id: randomUUID(),\n }),\n\n rpcError: (message: string, requestId?: RequestId | null):z.infer<typeof HttpJsonSchema> => ({\n kind: 'json',\n status: 400,\n contentType: 'application/json; charset=utf-8',\n body: {\n jsonrpc: JSON_RPC,\n error: { code: -32000, message },\n id: requestId ?? randomUUID(),\n },\n }),\n\n rpcRequest: (requestId: RequestId, method: string, params: any): JSONRPCMessage => ({\n jsonrpc: JSON_RPC,\n id: requestId ?? randomUUID(),\n method,\n params,\n }),\n redirect(location: string): z.infer<typeof HttpRedirectSchema> {\n return {\n kind: 'redirect',\n status: 302,\n location,\n };\n },\n next(extra?: Record<string, any>): z.infer<typeof HttpNextSchema> {\n return { kind: 'next', ...extra };\n },\n consumed(): z.infer<typeof HttpConsumedSchema> {\n return { kind: 'consumed' };\n },\n};\n"]}
1
+ {"version":3,"file":"http-output.schema.js","sourceRoot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AAA,mBAAU,GAAE;SAC9B;KACF,CAAC;IAEF,UAAU,EAAE,CAAC,SAAoB,EAAE,MAAc,EAAE,MAAW,EAAkB,EAAE,CAAC,CAAC;QAClF,OAAO,EAAE,gBAAQ;QACjB,EAAE,EAAE,SAAS,IAAI,IAAA,mBAAU,GAAE;QAC7B,MAAM;QACN,MAAM;KACP,CAAC;IACF,QAAQ,CAAC,QAAgB;QACvB,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,GAAG;YACX,QAAQ;SACT,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAA2B;QAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACpC,CAAC;IACD,QAAQ;QACN,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC9B,CAAC;CACF,CAAC","sourcesContent":["// output-schemas.ts\nimport { z } from 'zod';\nimport {\n JSONRPCError,\n JSONRPCMessage,\n RequestId,\n JSONRPCResponseSchema,\n JSONRPCErrorSchema,\n} from '@modelcontextprotocol/sdk/types.js';\nimport { randomUUID } from 'crypto';\n\n/**\n * Constants\n */\nexport const JSON_RPC = '2.0' as const;\nexport const REDIRECTS = [301, 302, 303, 307, 308] as const;\nexport const NO_BODY_STATUSES = [204, 304] as const;\n\n/**\n * Helpers\n */\n// numeric-literal union from a readonly tuple of at least TWO numbers (no any)\nconst zNumUnion = <T extends readonly [number, number, ...number[]]>(vals: T): z.ZodType<T[number]> => {\n let schema: z.ZodType<T[number]> = z.literal(vals[0]) as z.ZodType<T[number]>;\n for (let i = 1; i < vals.length; i++) {\n schema = schema.or(z.literal(vals[i])) as z.ZodType<T[number]>;\n }\n return schema;\n};\n\nexport const HttpStatus = z.number().int().min(100).max(599);\nexport const HttpRedirectStatus = zNumUnion(REDIRECTS);\nexport const HttpEmptyStatus = zNumUnion(NO_BODY_STATUSES);\n\nexport const HttpHeaders = z.record(z.union([z.string(), z.union([z.string(), z.array(z.string())])])).default({});\n\nexport const HttpCookieSchema = z.object({\n name: z.string().min(1),\n value: z.string(),\n path: z.string().default('/'),\n domain: z.string().optional(),\n httpOnly: z.boolean().default(true),\n secure: z.boolean().optional(),\n sameSite: z.enum(['lax', 'strict', 'none']).optional(),\n maxAge: z.number().int().nonnegative().optional(),\n expires: z.date().optional(),\n});\nexport type HttpCookie = z.infer<typeof HttpCookieSchema>;\n\nexport const HttpCookies = z.array(HttpCookieSchema).default([]);\n\nconst HttpMeta = z.object({\n headers: HttpHeaders.optional(),\n cookies: HttpCookies.optional(),\n});\n\nconst statusAllowsBody = (s: number) => !NO_BODY_STATUSES.includes(s as (typeof NO_BODY_STATUSES)[number]);\n\n/**\n * Redirect (3xx)\n */\nexport const HttpRedirectSchema = z\n .object({\n kind: z.literal('redirect'),\n status: HttpRedirectStatus.default(302),\n location: z.string().url(),\n })\n .merge(HttpMeta);\n\n/**\n * JSON (application/json)\n */\nexport const HttpJsonSchema = z\n .object({\n kind: z.literal('json'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'JSON responses must allow a body and not be a redirect.',\n }),\n body: z.union([z.object({}).passthrough(), z.array(z.any()), z.record(z.string(), z.any())]),\n contentType: z.string().default('application/json; charset=utf-8'),\n })\n .merge(HttpMeta);\n\n/**\n * unknown — plain text, HTML, etc.\n */\nexport const HttpNextSchema = z\n .object({\n kind: z.literal('next'),\n })\n .passthrough();\n\nexport const HttpConsumedSchema = z.object({ kind: z.literal('consumed') });\n\n/**\n * Text (text/*) — plain text, HTML, etc.\n */\nexport const HttpTextSchema = z\n .object({\n kind: z.literal('text'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'Text responses must allow a body and not be a redirect.',\n }),\n body: z.string(),\n contentType: z\n .string()\n .regex(/^text\\/[a-z0-9.+-]+/i, 'contentType must be a text/* MIME type')\n .default('text/plain; charset=utf-8'),\n })\n .merge(HttpMeta);\n\n/**\n * HTML (text/html) — convenience specialization of Text\n */\nexport const HttpHtmlSchema = HttpTextSchema.extend({\n kind: z.literal('html'),\n contentType: z.literal('text/html; charset=utf-8').default('text/html; charset=utf-8'),\n});\n\n/**\n * Binary/file (Uint8Array or string with encoding)\n * Works for PDFs, archives, audio, video, etc.\n */\nexport const HttpBinarySchema = z\n .object({\n kind: z.literal('binary'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'Binary responses must allow a body and not be a redirect.',\n }),\n body: z.union([z.instanceof(Uint8Array), z.string()]),\n // how to interpret string body\n encoding: z.enum(['utf8', 'base64']).default('utf8'),\n contentType: z.string().min(1),\n disposition: z.enum(['inline', 'attachment']).default('inline'),\n filename: z.string().optional(),\n })\n .merge(HttpMeta);\n\n/**\n * Images — narrowed binary with common image types\n */\nexport const HttpImageSchema = HttpBinarySchema.extend({\n kind: z.literal('image'),\n contentType: z.enum([\n 'image/png',\n 'image/jpeg',\n 'image/webp',\n 'image/gif',\n 'image/svg+xml',\n 'image/avif',\n 'image/apng',\n 'image/bmp',\n 'image/x-icon',\n ]),\n});\n\n/**\n * Stream (Readable-like or AsyncIterable) — runtime-agnostic\n */\nexport type HttpReadableLike = { pipe?: (dest: unknown) => unknown } | AsyncIterable<Uint8Array>;\n\nconst isHttpReadableLike = (v: unknown): v is HttpReadableLike => {\n if (typeof v !== 'object' || v === null) return false;\n const maybePipe = (v as { pipe?: unknown }).pipe;\n const maybeAI = (v as { [Symbol.asyncIterator]?: unknown })[Symbol.asyncIterator];\n return typeof maybePipe === 'function' || typeof maybeAI === 'function';\n};\n\nexport const HttpStreamSchema = z\n .object({\n kind: z.literal('stream'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'Stream responses must allow a body and not be a redirect.',\n }),\n stream: z.custom<HttpReadableLike>(isHttpReadableLike, 'stream must be a Readable-like or AsyncIterable'),\n contentType: z.string().min(1),\n disposition: z.enum(['inline', 'attachment']).default('inline'),\n filename: z.string().optional(),\n })\n .merge(HttpMeta);\n\n/**\n * Server-Sent Events (specialized stream)\n */\nexport const HttpSseSchema = HttpStreamSchema.extend({\n kind: z.literal('sse'),\n contentType: z.literal('text/event-stream').default('text/event-stream'),\n});\n\n/**\n * JSON-RPC 2.0 wrapped for HTTP union (kind='jsonrpc')\n */\nexport const HttpJsonRpcSchema = z\n .object({\n kind: z.literal('jsonrpc'),\n status: HttpStatus.refine((s) => statusAllowsBody(s) && !REDIRECTS.includes(s as (typeof REDIRECTS)[number]), {\n message: 'JSON-RPC responses must allow a body and not be a redirect.',\n }),\n contentType: z.string().default('application/json; charset=utf-8'),\n body: z.union([JSONRPCResponseSchema, JSONRPCErrorSchema]),\n })\n .merge(HttpMeta);\n\n/**\n * RFC 7807 Problem Details (application/problem+json)\n */\nexport const HttpProblemSchema = z\n .object({\n kind: z.literal('problem'),\n status: HttpStatus,\n contentType: z.literal('application/problem+json').default('application/problem+json'),\n body: z\n .object({\n error: z.string(),\n })\n .passthrough(), // allow extension members\n })\n .merge(HttpMeta);\n\n/**\n * Empty responses (204/304) — MUST NOT include a body\n */\nexport const HttpEmptySchema = z\n .object({\n kind: z.literal('empty'),\n status: HttpEmptyStatus,\n })\n .merge(HttpMeta);\n\n/**\n * Master union — validate all server outputs with this\n */\nexport const httpOutputSchema = z.discriminatedUnion('kind', [\n HttpRedirectSchema,\n HttpJsonSchema,\n HttpTextSchema,\n HttpHtmlSchema,\n HttpBinarySchema,\n HttpImageSchema,\n HttpStreamSchema,\n HttpSseSchema,\n HttpJsonRpcSchema,\n HttpProblemSchema,\n HttpEmptySchema,\n HttpNextSchema,\n HttpConsumedSchema,\n]);\n\nexport type HttpOutput = z.infer<typeof httpOutputSchema>;\n\n/**\n * Convenience factories\n */\nexport const httpRespond = {\n json: <T extends Record<string, any>>(body: T, extra: Partial<z.infer<typeof HttpJsonSchema>> = {}): z.infer<typeof HttpJsonSchema> => {\n return { kind: 'json', status: 200, body, contentType: 'application/json; charset=utf-8', ...extra };\n },\n\n ok: (body: string | Record<string, any>): z.infer<typeof HttpJsonSchema> | z.infer<typeof HttpTextSchema> => {\n return typeof body === 'string'\n ? { kind: 'text', status: 200, body, contentType: 'text/plain; charset=utf-8' }\n : { kind: 'json', status: 200, body, contentType: 'application/json; charset=utf-8' };\n },\n\n unauthorized: (options?: {\n headers?: Record<string, string>;\n body?: Record<string, string>;\n status?: number;\n }): z.infer<typeof HttpJsonSchema> => ({\n kind: 'json',\n status: options?.status ?? 401,\n body: options?.body ?? { error: 'Unauthorized' },\n headers: options?.headers,\n contentType: 'application/json; charset=utf-8',\n }),\n\n html: (markup: string, status = 200): z.infer<typeof HttpHtmlSchema> => ({\n kind: 'html',\n status,\n body: markup,\n contentType: 'text/html; charset=utf-8',\n }),\n\n notFound: (message = 'Not Found'): z.infer<typeof HttpTextSchema> => ({\n kind: 'text',\n status: 404,\n body: message,\n contentType: 'text/plain; charset=utf-8',\n }),\n\n noValidSessionError: (): JSONRPCError => ({\n jsonrpc: JSON_RPC,\n error: { code: -32000, message: 'Bad Request: No valid session ID provided' },\n id: randomUUID(),\n }),\n\n rpcError: (message: string, requestId?: RequestId | null):z.infer<typeof HttpJsonSchema> => ({\n kind: 'json',\n status: 400,\n contentType: 'application/json; charset=utf-8',\n body: {\n jsonrpc: JSON_RPC,\n error: { code: -32000, message },\n id: requestId ?? randomUUID(),\n },\n }),\n\n rpcRequest: (requestId: RequestId, method: string, params: any): JSONRPCMessage => ({\n jsonrpc: JSON_RPC,\n id: requestId ?? randomUUID(),\n method,\n params,\n }),\n redirect(location: string): z.infer<typeof HttpRedirectSchema> {\n return {\n kind: 'redirect',\n status: 302,\n location,\n };\n },\n next(extra?: Record<string, any>): z.infer<typeof HttpNextSchema> {\n return { kind: 'next', ...extra };\n },\n consumed(): z.infer<typeof HttpConsumedSchema> {\n return { kind: 'consumed' };\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"base.tokens.js","sourceRoot":"","sources":["../../../src/tokens/base.tokens.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAG,UAAU,CAAC;AAE7B,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,uBAAe,SAAS,IAAI,EAAE,CAAC;IACjE,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,uBAAe,SAAS,IAAI,EAAE,CAAC;CAClE,CAAA","sourcesContent":["import { Token } from '../interfaces';\n\nexport const baseTokenPrefix = 'FrontMcp';\n\nexport const tokenFactory = {\n type: (name: string) => Symbol(`${baseTokenPrefix}:type:${name}`),\n meta: (name: string) => Symbol(`${baseTokenPrefix}:meta:${name}`),\n}"]}
1
+ {"version":3,"file":"base.tokens.js","sourceRoot":"","sources":["../../../src/tokens/base.tokens.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,UAAU,CAAC;AAE7B,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,uBAAe,SAAS,IAAI,EAAE,CAAC;IACjE,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,uBAAe,SAAS,IAAI,EAAE,CAAC;CAClE,CAAA","sourcesContent":["export const baseTokenPrefix = 'FrontMcp';\n\nexport const tokenFactory = {\n type: (name: string) => Symbol(`${baseTokenPrefix}:type:${name}`),\n meta: (name: string) => Symbol(`${baseTokenPrefix}:meta:${name}`),\n}"]}
@@ -209,8 +209,8 @@ export declare const authorizationSchema: z.ZodObject<{
209
209
  }, "strip", z.ZodTypeAny, {
210
210
  token: string;
211
211
  user: {
212
- sub: string;
213
212
  iss: string;
213
+ sub: string;
214
214
  name?: string | undefined;
215
215
  sid?: string | undefined;
216
216
  exp?: number | undefined;
@@ -236,8 +236,8 @@ export declare const authorizationSchema: z.ZodObject<{
236
236
  }, {
237
237
  token: string;
238
238
  user: {
239
- sub: string;
240
239
  iss: string;
240
+ sub: string;
241
241
  name?: string | undefined;
242
242
  sid?: string | undefined;
243
243
  exp?: number | undefined;
@@ -418,6 +418,7 @@ export declare const appAuthOptionsSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
418
418
  type: "remote";
419
419
  baseUrl: string;
420
420
  id?: string | undefined;
421
+ standalone?: boolean | undefined;
421
422
  dcrEnabled?: boolean | undefined;
422
423
  clientId?: string | ((args_0: {
423
424
  clientId: string;
@@ -435,13 +436,13 @@ export declare const appAuthOptionsSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
435
436
  keys: JWK[];
436
437
  } | undefined;
437
438
  jwksUri?: string | undefined;
438
- standalone?: boolean | undefined;
439
439
  excludeFromParent?: boolean | undefined;
440
440
  }, {
441
441
  name: string;
442
442
  type: "remote";
443
443
  baseUrl: string;
444
444
  id?: string | undefined;
445
+ standalone?: boolean | undefined;
445
446
  dcrEnabled?: boolean | undefined;
446
447
  clientId?: string | ((args_0: {
447
448
  clientId: string;
@@ -459,7 +460,6 @@ export declare const appAuthOptionsSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
459
460
  keys: JWK[];
460
461
  } | undefined;
461
462
  jwksUri?: string | undefined;
462
- standalone?: boolean | undefined;
463
463
  excludeFromParent?: boolean | undefined;
464
464
  }>, z.ZodObject<{
465
465
  type: z.ZodLiteral<"local">;
@@ -484,6 +484,7 @@ export declare const appAuthOptionsSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
484
484
  name: string;
485
485
  id: string;
486
486
  type: "local";
487
+ standalone?: boolean | undefined;
487
488
  allowAnonymous?: boolean | undefined;
488
489
  consent?: boolean | undefined;
489
490
  scopes?: string[] | undefined;
@@ -492,12 +493,12 @@ export declare const appAuthOptionsSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
492
493
  keys: JWK[];
493
494
  } | undefined;
494
495
  signKey?: JWK | Uint8Array<ArrayBuffer> | undefined;
495
- standalone?: boolean | undefined;
496
496
  excludeFromParent?: boolean | undefined;
497
497
  }, {
498
498
  name: string;
499
499
  id: string;
500
500
  type: "local";
501
+ standalone?: boolean | undefined;
501
502
  allowAnonymous?: boolean | undefined;
502
503
  consent?: boolean | undefined;
503
504
  scopes?: string[] | undefined;
@@ -506,7 +507,6 @@ export declare const appAuthOptionsSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
506
507
  keys: JWK[];
507
508
  } | undefined;
508
509
  signKey?: JWK | Uint8Array<ArrayBuffer> | undefined;
509
- standalone?: boolean | undefined;
510
510
  excludeFromParent?: boolean | undefined;
511
511
  }>]>;
512
512
  export type AppAuthOptions = (RemoteAuthOptions | LocalAuthOptions) & StandaloneOption;
@@ -30,27 +30,27 @@ export declare const decisionSchema: z.ZodObject<{
30
30
  }, "strip", z.ZodTypeAny, {
31
31
  intent: "unknown" | "legacy-sse" | "sse" | "streamable-http" | "stateful-http" | "stateless-http";
32
32
  reasons: string[];
33
+ recommendation?: {
34
+ message: string;
35
+ httpStatus: number;
36
+ } | undefined;
33
37
  debug?: {
34
38
  key: number;
35
39
  channel: number;
36
40
  flags: number;
37
41
  } | undefined;
42
+ }, {
43
+ intent: "unknown" | "legacy-sse" | "sse" | "streamable-http" | "stateful-http" | "stateless-http";
44
+ reasons: string[];
38
45
  recommendation?: {
39
46
  message: string;
40
47
  httpStatus: number;
41
48
  } | undefined;
42
- }, {
43
- intent: "unknown" | "legacy-sse" | "sse" | "streamable-http" | "stateful-http" | "stateless-http";
44
- reasons: string[];
45
49
  debug?: {
46
50
  key: number;
47
51
  channel: number;
48
52
  flags: number;
49
53
  } | undefined;
50
- recommendation?: {
51
- message: string;
52
- httpStatus: number;
53
- } | undefined;
54
54
  }>;
55
55
  export type HttpRequestIntent = 'legacy-sse' | 'sse' | 'streamable-http' | 'stateful-http' | 'stateless-http';
56
56
  export type Intent = HttpRequestIntent | 'unknown';