kizlo 0.20.2 → 0.21.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.
@@ -0,0 +1,157 @@
1
+ import { log } from "../daemon/logger.js";
2
+ import { callRoute, describeRoute, listRoutes } from "./tools.js";
3
+ import z from "zod/v4";
4
+ import { createServer } from "node:http";
5
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
+ import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
7
+
8
+ //#region src/cli/mcp/server.ts
9
+ /** The only interface the server is ever bound to. Never `0.0.0.0`: this is a developer's machine. */
10
+ const MCP_HOST = "127.0.0.1";
11
+ /** The one path the server answers on, so a harness config is a URL rather than a URL and a note. */
12
+ const MCP_PATH = "/mcp";
13
+ /** Hosts an `Origin` may name. Everything the loopback interface is reachable as, and nothing else. */
14
+ const LOOPBACK_HOSTS = new Set([
15
+ "127.0.0.1",
16
+ "::1",
17
+ "[::1]",
18
+ "localhost"
19
+ ]);
20
+ /**
21
+ * Whether a request's `Origin` may be served.
22
+ *
23
+ * Binding to loopback keeps other machines out, but not the developer's own browser: a page on any
24
+ * site can `fetch` `http://127.0.0.1`, and while CORS stops it reading the reply, a request that
25
+ * changes WordPress has already happened by then. The MCP specification requires HTTP transports to
26
+ * check `Origin` for exactly this, so a page that names itself is refused before it reaches a tool.
27
+ *
28
+ * No `Origin` is allowed, because that is what a native MCP client sends. Browsers attach the header
29
+ * to cross-origin requests themselves and cannot forge it, so its absence is not something an attacking
30
+ * page can arrange.
31
+ */
32
+ function isAllowedOrigin(origin) {
33
+ if (origin === void 0 || origin === "") return true;
34
+ if (origin === "null") return false;
35
+ try {
36
+ return LOOPBACK_HOSTS.has(new URL(origin).hostname);
37
+ } catch {
38
+ return false;
39
+ }
40
+ }
41
+ /** Render a tool's answer as the MCP content block a client reads, failures included. */
42
+ function toolContent(result) {
43
+ if (!result.ok) return {
44
+ content: [{
45
+ type: "text",
46
+ text: result.error
47
+ }],
48
+ isError: true
49
+ };
50
+ return { content: [{
51
+ type: "text",
52
+ text: JSON.stringify(result.value, null, 2)
53
+ }] };
54
+ }
55
+ /**
56
+ * Three dispatchers rather than a tool per route. The contract a seeded WordPress serves runs to well
57
+ * over a hundred routes, and putting their schemas in front of a model up front would cost tens of
58
+ * thousands of tokens in every message. These cost a few hundred and reach all of them — and because
59
+ * they read the document per call, a route registered while `kizlo dev` runs is callable without
60
+ * re-registering anything.
61
+ */
62
+ function createMcpServer(state) {
63
+ const server = new McpServer({
64
+ name: "kizlo",
65
+ version: "1.0.0"
66
+ }, { instructions: "Read and call the WordPress REST routes of the Kizlo project this server was started in." });
67
+ server.registerTool("kizlo_list_routes", {
68
+ title: "List WordPress routes",
69
+ description: "List every REST route this project's WordPress serves, with its method and summary. Start here: the route names it returns are what `kizlo_describe_route` and `kizlo_call` take.",
70
+ inputSchema: { namespace: z.string().optional().describe("Only routes in this REST namespace, e.g. \"wp/v2\" or \"kizlo/v1\".") }
71
+ }, async ({ namespace }) => toolContent(listRoutes(state, namespace === void 0 ? {} : { namespace })));
72
+ server.registerTool("kizlo_describe_route", {
73
+ title: "Describe a WordPress route",
74
+ description: "The JSON Schema for one route's arguments, plus which of them are interpolated into its path.",
75
+ inputSchema: { route: z.string().describe("A route name from `kizlo_list_routes`, e.g. `postTypes.book.list`.") }
76
+ }, async ({ route }) => toolContent(describeRoute(state, { route })));
77
+ server.registerTool("kizlo_call", {
78
+ title: "Call a WordPress route",
79
+ description: "Run one route against this project's WordPress and return its response. Path parameters, query parameters, and body fields all go in `input`; `kizlo_describe_route` says which are which.",
80
+ inputSchema: {
81
+ route: z.string().describe("A route name from `kizlo_list_routes`."),
82
+ input: z.record(z.string(), z.unknown()).optional().describe("The route's arguments, as described by `kizlo_describe_route`.")
83
+ }
84
+ }, async ({ route, input }) => toolContent(await callRoute(state, input === void 0 ? { route } : {
85
+ route,
86
+ input
87
+ })));
88
+ return server;
89
+ }
90
+ /**
91
+ * Bind the MCP server for this session.
92
+ *
93
+ * It binds once and stays bound. The contract watcher restarts whenever `.env` or a config file
94
+ * changes, and tying the socket to that cycle would drop the harness's connection on every save and
95
+ * race the rebind against a port the previous listener had not finished releasing. Nothing here is
96
+ * captured from the watcher either: `state` is read per tool call, so a reload that changes the
97
+ * WordPress connection takes effect on the next call without rebinding anything.
98
+ */
99
+ async function startMcpServer(state, options) {
100
+ const server = createServer((request, response) => {
101
+ if (!isAllowedOrigin(request.headers.origin)) {
102
+ response.writeHead(403, { "content-type": "application/json" });
103
+ response.end(JSON.stringify({ error: `Refused an MCP request from origin ${request.headers.origin}.` }));
104
+ return;
105
+ }
106
+ const { pathname } = new URL(request.url ?? "/", `http://${MCP_HOST}`);
107
+ if (pathname !== MCP_PATH) {
108
+ response.writeHead(404, { "content-type": "application/json" });
109
+ response.end(JSON.stringify({ error: `Nothing is served at ${pathname}. The MCP endpoint is ${MCP_PATH}.` }));
110
+ return;
111
+ }
112
+ dispatch(request, response, state);
113
+ });
114
+ await new Promise((resolve, reject) => {
115
+ server.once("error", reject);
116
+ server.listen(options.port, MCP_HOST, () => {
117
+ server.removeListener("error", reject);
118
+ server.on("error", (error) => log.error("MCP server error:", error));
119
+ resolve();
120
+ });
121
+ });
122
+ const address = server.address();
123
+ const port = typeof address === "object" && address !== null ? address.port : options.port;
124
+ return {
125
+ url: `http://${MCP_HOST}:${port}${MCP_PATH}`,
126
+ port,
127
+ stop: () => stopServer(server)
128
+ };
129
+ }
130
+ /**
131
+ * Answer one request with a server and transport of its own.
132
+ *
133
+ * Stateless, with plain JSON replies: a dev session has exactly one harness attached and nothing to
134
+ * remember between its calls, so there is no session to track and no reason to hold an event stream
135
+ * open. Per request rather than shared, because a stateless transport carries the state of the one
136
+ * exchange it was built for and cannot answer a second. Building three tools again each time costs
137
+ * nothing next to the request, and it is what keeps the tools reading the current `state`.
138
+ */
139
+ async function dispatch(request, response, state) {
140
+ const mcp = createMcpServer(state);
141
+ const transport = new StreamableHTTPServerTransport({ enableJsonResponse: true });
142
+ response.on("close", () => {
143
+ transport.close();
144
+ mcp.close();
145
+ });
146
+ await mcp.connect(transport);
147
+ await transport.handleRequest(request, response);
148
+ }
149
+ async function stopServer(server) {
150
+ await new Promise((resolve) => {
151
+ server.close(() => resolve());
152
+ server.closeAllConnections();
153
+ });
154
+ }
155
+
156
+ //#endregion
157
+ export { MCP_HOST, MCP_PATH, isAllowedOrigin, startMcpServer };
@@ -0,0 +1,7 @@
1
+ //#region src/cli/mcp/state.ts
2
+ function createMcpState() {
3
+ return {};
4
+ }
5
+
6
+ //#endregion
7
+ export { createMcpState };
@@ -0,0 +1,103 @@
1
+ import { buildWordPressRequest } from "../../wordpress/endpoint.js";
2
+ import { WordPressTransport } from "../../wordpress/transport.js";
3
+ import { routesOf, sortRoutes } from "./routes.js";
4
+ import { toJsonSchema } from "./schema.js";
5
+
6
+ //#region src/cli/mcp/tools.ts
7
+ /** The document is fetched by the watcher, so the only reason it is missing is that none has arrived yet. */
8
+ const NO_DOCUMENT = "The WordPress contract has not been fetched yet. Retry in a moment; `kizlo dev` refreshes it every few seconds.";
9
+ /** Summaries only. The schemas behind these routes are far too large to put in front of a model at once. */
10
+ function listRoutes(state, input = {}) {
11
+ if (!state.document) return {
12
+ ok: false,
13
+ error: NO_DOCUMENT
14
+ };
15
+ const all = sortRoutes(routesOf(state.document).values());
16
+ const routes = input.namespace ? all.filter((route) => route.namespace === input.namespace) : all;
17
+ if (input.namespace && routes.length === 0) {
18
+ const known = [...new Set(all.map((route) => route.namespace))].sort();
19
+ return {
20
+ ok: false,
21
+ error: `No routes in namespace "${input.namespace}". This WordPress serves: ${known.join(", ")}.`
22
+ };
23
+ }
24
+ return {
25
+ ok: true,
26
+ value: {
27
+ count: routes.length,
28
+ routes: routes.map((route) => ({
29
+ name: route.name,
30
+ namespace: route.namespace,
31
+ method: route.method,
32
+ path: route.path,
33
+ ...route.summary !== void 0 ? { summary: route.summary } : {},
34
+ ...route.deprecated ? { deprecated: true } : {}
35
+ }))
36
+ }
37
+ };
38
+ }
39
+ /** The full argument schema for one route, which is what a caller needs before it can build a call. */
40
+ function describeRoute(state, input) {
41
+ if (!state.document) return {
42
+ ok: false,
43
+ error: NO_DOCUMENT
44
+ };
45
+ const route = routesOf(state.document).get(input.route);
46
+ if (!route) return {
47
+ ok: false,
48
+ error: unknownRoute(input.route)
49
+ };
50
+ return {
51
+ ok: true,
52
+ value: {
53
+ name: route.name,
54
+ namespace: route.namespace,
55
+ method: route.method,
56
+ path: route.path,
57
+ ...route.summary !== void 0 ? { summary: route.summary } : {},
58
+ ...route.description !== void 0 ? { description: route.description } : {},
59
+ ...route.deprecated ? { deprecated: true } : {},
60
+ pathParameters: route.definition.pathParameters,
61
+ input: toJsonSchema(route.operation.input, state.document)
62
+ }
63
+ };
64
+ }
65
+ /** Run one route against the connected WordPress and hand back what it answered. */
66
+ async function callRoute(state, input) {
67
+ if (!state.document) return {
68
+ ok: false,
69
+ error: NO_DOCUMENT
70
+ };
71
+ if (!state.credentials) return {
72
+ ok: false,
73
+ error: "No WordPress connection is configured, so nothing can be called. Check the connection settings in `.env`."
74
+ };
75
+ const route = routesOf(state.document).get(input.route);
76
+ if (!route) return {
77
+ ok: false,
78
+ error: unknownRoute(input.route)
79
+ };
80
+ const built = buildWordPressRequest(route.definition, input.input ?? {});
81
+ if (built.error) return {
82
+ ok: false,
83
+ error: built.error.message
84
+ };
85
+ const response = await new WordPressTransport({ credentials: state.credentials }).request(built.request);
86
+ if (response.error) return {
87
+ ok: false,
88
+ error: `${route.method} ${route.path} failed (${response.status || "no response"}): ${response.error.code} — ${response.error.message}`
89
+ };
90
+ return {
91
+ ok: true,
92
+ value: {
93
+ status: response.status,
94
+ data: response.data
95
+ }
96
+ };
97
+ }
98
+ function unknownRoute(name) {
99
+ return `No route named "${name}" in this WordPress contract. Call \`kizlo_list_routes\` for the routes it serves.`;
100
+ }
101
+
102
+ //#endregion
103
+ export { callRoute, describeRoute, listRoutes };
package/dist/config.d.ts CHANGED
@@ -120,6 +120,16 @@ interface KizloLocalConfig {
120
120
  /** The test stack run by `kizlo test`. Inherits `version` and `fixtures` from {@link KizloLocalConfig.dev}. */
121
121
  test?: KizloTestConfig;
122
122
  }
123
+ interface KizloMcpConfig {
124
+ /**
125
+ * Port the server binds on `127.0.0.1`. Unset, it starts at the Kizlo default and steps off a
126
+ * collision, which is why nothing has to be configured to run two projects at once. Set it when a
127
+ * harness config has to name the port: an explicitly set port is never auto-reassigned, and
128
+ * `kizlo dev` stops rather than serving on one you did not choose.
129
+ * @default 8300
130
+ */
131
+ port?: number;
132
+ }
123
133
  interface KizloGlobalConfig {
124
134
  /**
125
135
  * Where Kizlo generates, and what it watches. A string names the home directory Kizlo owns the
@@ -139,7 +149,13 @@ interface KizloGlobalConfig {
139
149
  * stack name, the per-branch `worktrees` toggle, and the two stacks live.
140
150
  */
141
151
  local?: boolean | KizloLocalConfig;
152
+ /**
153
+ * The MCP server `kizlo dev` serves on loopback, exposing this project's WordPress routes to an AI
154
+ * harness. It runs whenever `kizlo dev` can resolve a WordPress connection; this block only tunes it.
155
+ * It is never part of a built app: the server lives in the CLI, so nothing about it can be deployed.
156
+ */
157
+ mcp?: KizloMcpConfig;
142
158
  }
143
159
  declare function defineConfig(config: KizloGlobalConfig): KizloGlobalConfig;
144
160
  //#endregion
145
- export { KizloDevConfig, KizloDir, KizloGlobalConfig, KizloLocalConfig, KizloTestConfig, defineConfig };
161
+ export { KizloDevConfig, KizloDir, KizloGlobalConfig, KizloLocalConfig, KizloMcpConfig, KizloTestConfig, defineConfig };
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ import { AnyEventSchema, AnyEvents, EventHandler, EventHandlerFn, InferEventUnio
28
28
  import { COMMON_ERRORS, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, DefinedErrorMapLike, ErrorDefinition, KizloError, KizloErrorOptions, ThrowableErrorFn, ThrowableErrorMap, WithCommonErrorMap, createThrowableErrorMap, defineErrorMap, isKizloError, toKizloError } from "./shared/error.js";
29
29
  import { AnyMiddleware, ExtractMiddlewareContextOutput, InferMiddlewares, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, createMiddleware } from "./shared/middleware.js";
30
30
  import { AnyProcedure, AnyProcedureTree, BaseHandlerOptions, ExtractParams, ExtractProcedureByScope, InvocationScope, OpenapiPart, Procedure, ProcedureErrors, ProcedureHandler, ProcedureOptions, ProcedureTreeDepthTuple, ResolveParamsPart, ResolvedSchemaInput, ResolvedSchemaOutput, SchemaIO, buildProcedure, combineDetailed, createProcedure, handleUnexpectedError, schemaType } from "./shared/procedure.js";
31
- import { AnyIntegration, EnvReader, EnvRecord, EnvSource, ExtractIntegrationProcedures, InferIntegrationProcedures, Integration, IntegrationRequirements, KizloEnv, WordPressEnv, assertIntegrationEndpoints, assertIntegrationEnv, createIntegration, missingEndpoints, missingEnv, readEnv } from "./shared/integration.js";
31
+ import { AnyIntegration, EnvReader, EnvRecord, EnvSource, ExtractIntegrationProcedures, InferIntegrationProcedures, Integration, IntegrationRequirements, KizloEnv, WordPressEnv, assertIntegrationEndpoints, assertIntegrationEnv, createIntegration, missingEndpoints, missingEnv, readEnv, sortIntegrations } from "./shared/integration.js";
32
32
  import { InferProcedureData, InferProcedureError, InferProcedureInput, InferProcedureResult, KizloErrorUnion, KizloResult, MaybeCallerOptions, ProcedureMethod, ResultClient, createResultClient } from "./shared/result.js";
33
33
  import { AnyKizloConfig, CreateKizloOptions, Kizlo, KizloConfig, RootProcedures, S2SClient, createKizlo, integrationEnv, resolveKizloConfig, resolveWordPressConnection, wordPressConnectionComplete } from "./kizlo.js";
34
34
  import { WEB_MANIFEST_ROUTE, WebManifest, buildWebManifest, createManifestRoute } from "./brand/manifest.js";
@@ -43,4 +43,4 @@ import { ShaAlgorithm, compare, hash, hmac } from "./shared/crypto.js";
43
43
  import { Identifier, parseIdentifier } from "./shared/identifier.js";
44
44
  import { createOrpcRouter } from "./shared/router.js";
45
45
  import { deserializeCurrencyFormat, deserializeListMetadata, emptyList, serializeCurrencyFormat } from "./shared/serialize.js";
46
- export { ActiveWordPressClient, AnyContext, AnyEventSchema, AnyEvents, AnyIntegration, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureTree, AuthAdapter, AuthGetSession, AuthUser, AuthorsSettings, AuthorsSettingsInput, BaseHandlerOptions, BrandSettings, BrandSettingsInput, COMMON_ERRORS, CONTENT_TYPES, CORE_PROCEDURES, CaptchaAdapter, type Category, type CategoryCustomFields, CategoryCustomFieldsSchema, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, CookiesStorage, CoreProcedures, CrawlingSettings, CrawlingSettingsInput, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, EnvReader, EnvRecord, EnvSource, ErrorDefinition, EventHandler, EventHandlerFn, ExtractIntegrationProcedures, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, FixtureSettleFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, HeadlessSettings, HeadlessSettingsInput, IconDescriptor, Identifier, IdentifierInput, IdentitySettings, IdentitySettingsInput, InferEventUnion, InferIntegrationProcedures, InferMiddlewares, InferProcedureData, InferProcedureError, InferProcedureInput, InferProcedureResult, Integration, IntegrationRequirements, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloEnv, KizloError, KizloErrorOptions, KizloErrorUnion, KizloResult, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, ManifestIcon, MaybeCallerOptions, MaybeOptionalOptions, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, type Page, type PageCustomFields, PageCustomFieldsSchema, PersonSettings, PersonSettingsInput, PluginSource, type Post, type PostCustomFields, PostCustomFieldsSchema, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureMethod, ProcedureOptions, ProcedureTreeDepthTuple, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedIcons, ResolvedSchemaInput, ResolvedSchemaOutput, ResultClient, Robots, RobotsRule, RootProcedures, S2SClient, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServiceAdapters, SessionFn, Settings, SettingsService, SettleContext, ShaAlgorithm, SiteSettings, SiteSettingsInput, Sitemap, SitemapIndex, SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, SocialProfile, type Tag, type TagCustomFields, TagCustomFieldsSchema, TaxonomySettings, TaxonomySettingsInput, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UploadsSettings, UploadsSettingsInput, VerifyCaptchaFn, VerifyPreviewTokenFn, WEB_MANIFEST_ROUTE, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_CallOptions, WP_Client, WP_CommonErrorCode, WP_CurrencyFormat, WP_CustomFields, WP_CustomFieldsPath, WP_Endpoint, WP_EndpointData, WP_EndpointDefinition, WP_EndpointError, WP_EndpointInput, WP_EndpointPath, WP_EndpointResult, WP_Error, WP_ErrorData, WP_Failure, WP_List, WP_ListMetadata, WP_RequestBuild, WP_RequestContentType, WP_RequestInput, WP_RequestMethod, WP_ResponseContentType, WP_Result, WP_Success, WP_TransportFailure, WP_TypedHeaders, WebManifest, WebhookOptions, WebhookSettings, WebhookSettingsInput, WithCommonErrorMap, WordPressClientRegistry, WordPressCredentials, WordPressCustomFieldsRegistry, WordPressEndpointRegistry, WordPressEnv, WordPressTransport, WordPressTransportOptions, WordPressTransportResult, altcha, arkose, assertIntegrationEndpoints, assertIntegrationEnv, authMock, buildProcedure, buildWebManifest, buildWordPressRequest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createGeoAdapter, createIntegration, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createResultClient, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, createWordPressClient, customFieldsSchema, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, integrationEnv, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, mergeServiceAdapters, missingEndpoints, missingEnv, noopAdapter, parseIdentifier, parseSitemapSlug, readEnv, recaptcha, renderJsonLd, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, resolveWordPressConnection, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, wordPressConnectionComplete, wpEndpoint, xmlResponse };
46
+ export { ActiveWordPressClient, AnyContext, AnyEventSchema, AnyEvents, AnyIntegration, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureTree, AuthAdapter, AuthGetSession, AuthUser, AuthorsSettings, AuthorsSettingsInput, BaseHandlerOptions, BrandSettings, BrandSettingsInput, COMMON_ERRORS, CONTENT_TYPES, CORE_PROCEDURES, CaptchaAdapter, type Category, type CategoryCustomFields, CategoryCustomFieldsSchema, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, CookiesStorage, CoreProcedures, CrawlingSettings, CrawlingSettingsInput, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, EnvReader, EnvRecord, EnvSource, ErrorDefinition, EventHandler, EventHandlerFn, ExtractIntegrationProcedures, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, FixtureSettleFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, HeadlessSettings, HeadlessSettingsInput, IconDescriptor, Identifier, IdentifierInput, IdentitySettings, IdentitySettingsInput, InferEventUnion, InferIntegrationProcedures, InferMiddlewares, InferProcedureData, InferProcedureError, InferProcedureInput, InferProcedureResult, Integration, IntegrationRequirements, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloEnv, KizloError, KizloErrorOptions, KizloErrorUnion, KizloResult, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, ManifestIcon, MaybeCallerOptions, MaybeOptionalOptions, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, type Page, type PageCustomFields, PageCustomFieldsSchema, PersonSettings, PersonSettingsInput, PluginSource, type Post, type PostCustomFields, PostCustomFieldsSchema, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureMethod, ProcedureOptions, ProcedureTreeDepthTuple, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedIcons, ResolvedSchemaInput, ResolvedSchemaOutput, ResultClient, Robots, RobotsRule, RootProcedures, S2SClient, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServiceAdapters, SessionFn, Settings, SettingsService, SettleContext, ShaAlgorithm, SiteSettings, SiteSettingsInput, Sitemap, SitemapIndex, SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, SocialProfile, type Tag, type TagCustomFields, TagCustomFieldsSchema, TaxonomySettings, TaxonomySettingsInput, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UploadsSettings, UploadsSettingsInput, VerifyCaptchaFn, VerifyPreviewTokenFn, WEB_MANIFEST_ROUTE, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_CallOptions, WP_Client, WP_CommonErrorCode, WP_CurrencyFormat, WP_CustomFields, WP_CustomFieldsPath, WP_Endpoint, WP_EndpointData, WP_EndpointDefinition, WP_EndpointError, WP_EndpointInput, WP_EndpointPath, WP_EndpointResult, WP_Error, WP_ErrorData, WP_Failure, WP_List, WP_ListMetadata, WP_RequestBuild, WP_RequestContentType, WP_RequestInput, WP_RequestMethod, WP_ResponseContentType, WP_Result, WP_Success, WP_TransportFailure, WP_TypedHeaders, WebManifest, WebhookOptions, WebhookSettings, WebhookSettingsInput, WithCommonErrorMap, WordPressClientRegistry, WordPressCredentials, WordPressCustomFieldsRegistry, WordPressEndpointRegistry, WordPressEnv, WordPressTransport, WordPressTransportOptions, WordPressTransportResult, altcha, arkose, assertIntegrationEndpoints, assertIntegrationEnv, authMock, buildProcedure, buildWebManifest, buildWordPressRequest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createGeoAdapter, createIntegration, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createResultClient, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, createWordPressClient, customFieldsSchema, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, integrationEnv, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, mergeServiceAdapters, missingEndpoints, missingEnv, noopAdapter, parseIdentifier, parseSitemapSlug, readEnv, recaptcha, renderJsonLd, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, resolveWordPressConnection, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, sortIntegrations, toKizloError, turnstile, wordPressConnectionComplete, wpEndpoint, xmlResponse };
package/dist/index.js CHANGED
@@ -32,10 +32,10 @@ import { PageCustomFieldsSchema } from "./page/schema.js";
32
32
  import { PostCustomFieldsSchema } from "./post/schema.js";
33
33
  import { TagCustomFieldsSchema } from "./tag/schema.js";
34
34
  import { CORE_PROCEDURES } from "./procedures.js";
35
- import { assertIntegrationEndpoints, assertIntegrationEnv, createIntegration, missingEndpoints, missingEnv, readEnv } from "./shared/integration.js";
35
+ import { assertIntegrationEndpoints, assertIntegrationEnv, createIntegration, missingEndpoints, missingEnv, readEnv, sortIntegrations } from "./shared/integration.js";
36
36
  import { createEventHandler, createWebhookRouter } from "./webhook/index.js";
37
37
  import { Kizlo, createKizlo, integrationEnv, resolveKizloConfig, resolveWordPressConnection, wordPressConnectionComplete } from "./kizlo.js";
38
38
  import { SITEMAP_BASE, SITEMAP_INDEX_SLUG, createSitemapRedirectRoute, createSitemapRoute } from "./seo/sitemap.js";
39
39
  import { createMiddleware } from "./shared/middleware.js";
40
40
 
41
- export { COMMON_ERRORS, CONTENT_TYPES, CORE_PROCEDURES, CategoryCustomFieldsSchema, ContentType, Context, CookiesStorage, CurrencyFormat, IdentifierInput, Kizlo, KizloClient, KizloError, LIST_ORDER, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, PageCustomFieldsSchema, PostCustomFieldsSchema, PreviewTokenData, PreviewTokenPayload, Robots, RobotsRule, SITEMAP_BASE, SITEMAP_INDEX_SLUG, Seo, SeoHead, SeoSchema, SettingsService, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, TagCustomFieldsSchema, WEB_MANIFEST_ROUTE, WP_Error, WordPressTransport, altcha, arkose, assertIntegrationEndpoints, assertIntegrationEnv, authMock, buildProcedure, buildWebManifest, buildWordPressRequest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createGeoAdapter, createIntegration, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createResultClient, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, createWordPressClient, customFieldsSchema, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, integrationEnv, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, mergeServiceAdapters, missingEndpoints, missingEnv, noopAdapter, parseIdentifier, parseSitemapSlug, readEnv, recaptcha, renderJsonLd, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, resolveWordPressConnection, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, wordPressConnectionComplete, wpEndpoint, xmlResponse };
41
+ export { COMMON_ERRORS, CONTENT_TYPES, CORE_PROCEDURES, CategoryCustomFieldsSchema, ContentType, Context, CookiesStorage, CurrencyFormat, IdentifierInput, Kizlo, KizloClient, KizloError, LIST_ORDER, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, PageCustomFieldsSchema, PostCustomFieldsSchema, PreviewTokenData, PreviewTokenPayload, Robots, RobotsRule, SITEMAP_BASE, SITEMAP_INDEX_SLUG, Seo, SeoHead, SeoSchema, SettingsService, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, TagCustomFieldsSchema, WEB_MANIFEST_ROUTE, WP_Error, WordPressTransport, altcha, arkose, assertIntegrationEndpoints, assertIntegrationEnv, authMock, buildProcedure, buildWebManifest, buildWordPressRequest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createGeoAdapter, createIntegration, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createResultClient, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, createWordPressClient, customFieldsSchema, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, integrationEnv, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, mergeServiceAdapters, missingEndpoints, missingEnv, noopAdapter, parseIdentifier, parseSitemapSlug, readEnv, recaptcha, renderJsonLd, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, resolveWordPressConnection, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, sortIntegrations, toKizloError, turnstile, wordPressConnectionComplete, wpEndpoint, xmlResponse };
@@ -1,3 +1,4 @@
1
+ import { FRAMEWORK_INTEGRATION_ORDER } from "../../shared/constants.js";
1
2
  import { createIntegration } from "../../shared/integration.js";
2
3
  import { runtimeEnv } from "../runtime-env.js";
3
4
 
@@ -6,6 +7,7 @@ import { runtimeEnv } from "../runtime-env.js";
6
7
  function astro(options) {
7
8
  return createIntegration({
8
9
  id: "astro",
10
+ order: FRAMEWORK_INTEGRATION_ORDER,
9
11
  env: runtimeEnv(options.env, "PUBLIC_KIZLO_BASE_URL")
10
12
  });
11
13
  }
@@ -1,3 +1,4 @@
1
+ import { FRAMEWORK_INTEGRATION_ORDER } from "../../shared/constants.js";
1
2
  import { createIntegration } from "../../shared/integration.js";
2
3
  import { runtimeEnv } from "../runtime-env.js";
3
4
  import { nextRevalidation } from "./revalidate.js";
@@ -9,6 +10,7 @@ function nextjs(options = {}) {
9
10
  const revalidation = options.revalidate;
10
11
  return createIntegration({
11
12
  id: "nextjs",
13
+ order: FRAMEWORK_INTEGRATION_ORDER,
12
14
  env: runtimeEnv(source, "NEXT_PUBLIC_KIZLO_BASE_URL"),
13
15
  events: revalidation === false ? void 0 : nextRevalidation(typeof revalidation === "object" ? revalidation : void 0).events
14
16
  });
@@ -1,3 +1,4 @@
1
+ import { FRAMEWORK_INTEGRATION_ORDER } from "../../shared/constants.js";
1
2
  import { createIntegration } from "../../shared/integration.js";
2
3
  import { runtimeEnv } from "../runtime-env.js";
3
4
 
@@ -6,6 +7,7 @@ import { runtimeEnv } from "../runtime-env.js";
6
7
  function node(options = {}) {
7
8
  return createIntegration({
8
9
  id: "node",
10
+ order: FRAMEWORK_INTEGRATION_ORDER,
9
11
  env: runtimeEnv(options.env ?? process.env, "KIZLO_BASE_URL")
10
12
  });
11
13
  }
@@ -1,3 +1,4 @@
1
+ import { FRAMEWORK_INTEGRATION_ORDER } from "../../shared/constants.js";
1
2
  import { createIntegration } from "../../shared/integration.js";
2
3
  import { runtimeEnv } from "../runtime-env.js";
3
4
 
@@ -6,6 +7,7 @@ import { runtimeEnv } from "../runtime-env.js";
6
7
  function tanstackStart(options = {}) {
7
8
  return createIntegration({
8
9
  id: "tanstack-start",
10
+ order: FRAMEWORK_INTEGRATION_ORDER,
9
11
  env: runtimeEnv(options.env ?? process.env, "VITE_KIZLO_BASE_URL")
10
12
  });
11
13
  }
package/dist/kizlo.js CHANGED
@@ -8,7 +8,7 @@ import { isTypescriptObject } from "./shared/utils.js";
8
8
  import { Context } from "./context.js";
9
9
  import { CORE_PROCEDURES } from "./procedures.js";
10
10
  import { isContractGeneration } from "./shared/contract-generation.js";
11
- import { assertIntegrationEndpoints, assertIntegrationEnv, missingEnv, readEnv } from "./shared/integration.js";
11
+ import { assertIntegrationEndpoints, assertIntegrationEnv, missingEnv, readEnv, sortIntegrations } from "./shared/integration.js";
12
12
  import { createWebhookRouter } from "./webhook/index.js";
13
13
  import { tryCatch } from "@kizlo/shared";
14
14
  import { ORPCError, createRouterClient } from "@orpc/server";
@@ -101,7 +101,7 @@ var Kizlo = class {
101
101
  const reservedIds = new Set([...Object.keys(CORE_PROCEDURES), "webhooks"]);
102
102
  const integrationIds = /* @__PURE__ */ new Set();
103
103
  const generating = isContractGeneration();
104
- for (const integration of this.config.integrations ?? []) {
104
+ for (const integration of sortIntegrations(this.config.integrations ?? [])) {
105
105
  if (reservedIds.has(integration.id)) throw new KizloError("INTEGRATION_ID_CONFLICT", { message: `The integration id "${integration.id}" is reserved by Kizlo. Choose a different integration id.` });
106
106
  if (integrationIds.has(integration.id)) throw new KizloError("INTEGRATION_ID_CONFLICT", { message: `The integration id "${integration.id}" is registered more than once. Give every integration a unique id.` });
107
107
  integrationIds.add(integration.id);
@@ -130,9 +130,10 @@ const WORDPRESS_ENV_VALUES = new Set([
130
130
  * Kizlo's active WordPress connection from the canonical `mode` value.
131
131
  */
132
132
  function integrationEnv(integrations) {
133
+ const mounted = sortIntegrations(integrations);
133
134
  const composed = (name) => {
134
135
  let value;
135
- for (const integration of integrations) {
136
+ for (const integration of mounted) {
136
137
  if (!integration.env) continue;
137
138
  const contribution = readEnv(integration.env, name);
138
139
  if (contribution !== void 0) value = contribution;
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.20.2";
2
+ var version = "0.21.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -26,13 +26,13 @@ declare const Post: z.ZodObject<{
26
26
  private: "private";
27
27
  }>;
28
28
  format: z.ZodEnum<{
29
+ image: "image";
30
+ link: "link";
29
31
  status: "status";
30
32
  standard: "standard";
31
33
  aside: "aside";
32
34
  chat: "chat";
33
35
  gallery: "gallery";
34
- link: "link";
35
- image: "image";
36
36
  quote: "quote";
37
37
  video: "video";
38
38
  audio: "audio";
@@ -150,13 +150,13 @@ declare const PostList: z.ZodObject<{
150
150
  private: "private";
151
151
  }>;
152
152
  format: z.ZodEnum<{
153
+ image: "image";
154
+ link: "link";
153
155
  status: "status";
154
156
  standard: "standard";
155
157
  aside: "aside";
156
158
  chat: "chat";
157
159
  gallery: "gallery";
158
- link: "link";
159
- image: "image";
160
160
  quote: "quote";
161
161
  video: "video";
162
162
  audio: "audio";
@@ -44,7 +44,7 @@ declare const CORE_PROCEDURES: {
44
44
  include?: string | number | (string | number)[] | undefined;
45
45
  offset?: string | number | undefined;
46
46
  order?: "asc" | "desc" | undefined;
47
- orderby?: "date" | "id" | "slug" | "parent" | "title" | "author" | "include" | "modified" | "relevance" | "include_slugs" | undefined;
47
+ orderby?: "id" | "slug" | "parent" | "title" | "author" | "date" | "include" | "include_slugs" | "modified" | "relevance" | undefined;
48
48
  searchColumns?: ("post_title" | "post_content" | "post_excerpt")[] | undefined;
49
49
  slug?: string | string[] | undefined;
50
50
  taxRelation?: "AND" | "OR" | undefined;
@@ -99,7 +99,7 @@ declare const CORE_PROCEDURES: {
99
99
  include?: string | number | (string | number)[] | undefined;
100
100
  offset?: string | number | undefined;
101
101
  order?: "asc" | "desc" | undefined;
102
- orderby?: "date" | "id" | "slug" | "parent" | "title" | "author" | "include" | "modified" | "relevance" | "include_slugs" | "menu_order" | undefined;
102
+ orderby?: "id" | "slug" | "parent" | "title" | "author" | "date" | "include" | "include_slugs" | "modified" | "relevance" | "menu_order" | undefined;
103
103
  searchColumns?: ("post_title" | "post_content" | "post_excerpt")[] | undefined;
104
104
  slug?: string | string[] | undefined;
105
105
  parent?: string | number | (string | number)[] | undefined;
@@ -136,7 +136,7 @@ declare const CORE_PROCEDURES: {
136
136
  exclude?: string | number | (string | number)[] | undefined;
137
137
  include?: string | number | (string | number)[] | undefined;
138
138
  order?: "asc" | "desc" | undefined;
139
- orderBy?: "count" | "id" | "slug" | "name" | "description" | "include" | "include_slugs" | "term_group" | undefined;
139
+ orderBy?: "id" | "name" | "slug" | "description" | "include" | "include_slugs" | "term_group" | "count" | undefined;
140
140
  hideEmpty?: string | boolean | undefined;
141
141
  parent?: string | number | undefined;
142
142
  post?: string | number | undefined;
@@ -172,7 +172,7 @@ declare const CORE_PROCEDURES: {
172
172
  exclude?: string | number | (string | number)[] | undefined;
173
173
  include?: string | number | (string | number)[] | undefined;
174
174
  order?: "asc" | "desc" | undefined;
175
- orderBy?: "count" | "id" | "slug" | "name" | "description" | "include" | "include_slugs" | "term_group" | undefined;
175
+ orderBy?: "id" | "name" | "slug" | "description" | "include" | "include_slugs" | "term_group" | "count" | undefined;
176
176
  hideEmpty?: string | boolean | undefined;
177
177
  post?: string | number | undefined;
178
178
  slug?: string | string[] | undefined;
@@ -241,7 +241,7 @@ declare const CORE_PROCEDURES: {
241
241
  sitemaps: {
242
242
  list: Procedure<"internal", {}, {
243
243
  key: string;
244
- type: "post_type" | "taxonomy" | "author";
244
+ type: "author" | "post_type" | "taxonomy";
245
245
  pages: number;
246
246
  lastmod: string;
247
247
  }[], DefinedErrorMapLike>;
@@ -249,7 +249,7 @@ declare const CORE_PROCEDURES: {
249
249
  origin: string;
250
250
  sitemaps: {
251
251
  key: string;
252
- type: "post_type" | "taxonomy" | "author";
252
+ type: "author" | "post_type" | "taxonomy";
253
253
  pages: number;
254
254
  lastmod: string;
255
255
  }[];
@@ -292,7 +292,7 @@ declare const CORE_PROCEDURES: {
292
292
  include?: string | number | (string | number)[] | undefined;
293
293
  offset?: string | number | undefined;
294
294
  order?: "asc" | "desc" | undefined;
295
- orderby?: "date" | "id" | "slug" | "parent" | "title" | "author" | "include" | "relevance" | "include_slugs" | "menu_order" | undefined;
295
+ orderby?: "id" | "slug" | "parent" | "title" | "author" | "date" | "include" | "include_slugs" | "relevance" | "menu_order" | undefined;
296
296
  searchColumns?: ("post_title" | "post_content" | "post_excerpt")[] | undefined;
297
297
  slug?: string | string[] | undefined;
298
298
  taxRelation?: "AND" | "OR" | undefined;
@@ -371,7 +371,7 @@ declare const CORE_PROCEDURES: {
371
371
  include?: string | number | (string | number)[] | undefined;
372
372
  offset?: string | number | undefined;
373
373
  order?: "asc" | "desc" | undefined;
374
- orderby?: "date" | "id" | "slug" | "parent" | "title" | "author" | "include" | "relevance" | "include_slugs" | "menu_order" | undefined;
374
+ orderby?: "id" | "slug" | "parent" | "title" | "author" | "date" | "include" | "include_slugs" | "relevance" | "menu_order" | undefined;
375
375
  searchColumns?: ("post_title" | "post_content" | "post_excerpt")[] | undefined;
376
376
  slug?: string | string[] | undefined;
377
377
  taxRelation?: "AND" | "OR" | undefined;
@@ -507,7 +507,7 @@ declare const CORE_PROCEDURES: {
507
507
  include?: string | number | (string | number)[] | undefined;
508
508
  offset?: string | number | undefined;
509
509
  order?: "asc" | "desc" | undefined;
510
- orderby?: "date" | "id" | "parent" | "include" | "post" | undefined;
510
+ orderby?: "id" | "parent" | "date" | "include" | "post" | undefined;
511
511
  parent?: string | number | (string | number)[] | undefined;
512
512
  parentExclude?: string | number | (string | number)[] | undefined;
513
513
  post?: string | number | (string | number)[] | undefined;
@@ -635,8 +635,8 @@ declare const CORE_PROCEDURES: {
635
635
  get: Procedure<"internal", {}, _kizlo_shared11.Settings, DefinedErrorMapLike>;
636
636
  site: {
637
637
  update: Procedure<"internal", {
638
- url?: string | null | undefined;
639
638
  name?: string | null | undefined;
639
+ url?: string | null | undefined;
640
640
  backend_url?: string | null | undefined;
641
641
  secret?: string | null | undefined;
642
642
  alternate_name?: string | null | undefined;
@@ -108,17 +108,17 @@ declare const Seo: z.ZodObject<{
108
108
  type Seo = z.infer<typeof Seo>;
109
109
  declare const CONTENT_TYPES: readonly ["post_type", "taxonomy", "author"];
110
110
  declare const ContentType: z.ZodEnum<{
111
+ author: "author";
111
112
  post_type: "post_type";
112
113
  taxonomy: "taxonomy";
113
- author: "author";
114
114
  }>;
115
115
  type ContentType = z.infer<typeof ContentType>;
116
116
  declare const Sitemap: z.ZodObject<{
117
117
  key: z.ZodString;
118
118
  type: z.ZodEnum<{
119
+ author: "author";
119
120
  post_type: "post_type";
120
121
  taxonomy: "taxonomy";
121
- author: "author";
122
122
  }>;
123
123
  pages: z.ZodNumber;
124
124
  lastmod: z.ZodString;
@@ -127,9 +127,9 @@ type Sitemap = z.infer<typeof Sitemap>;
127
127
  declare const SitemapList: z.ZodArray<z.ZodObject<{
128
128
  key: z.ZodString;
129
129
  type: z.ZodEnum<{
130
+ author: "author";
130
131
  post_type: "post_type";
131
132
  taxonomy: "taxonomy";
132
- author: "author";
133
133
  }>;
134
134
  pages: z.ZodNumber;
135
135
  lastmod: z.ZodString;
@@ -140,9 +140,9 @@ declare const SitemapIndex: z.ZodObject<{
140
140
  sitemaps: z.ZodArray<z.ZodObject<{
141
141
  key: z.ZodString;
142
142
  type: z.ZodEnum<{
143
+ author: "author";
143
144
  post_type: "post_type";
144
145
  taxonomy: "taxonomy";
145
- author: "author";
146
146
  }>;
147
147
  pages: z.ZodNumber;
148
148
  lastmod: z.ZodString;
@@ -174,9 +174,9 @@ declare const SitemapUrlList: z.ZodArray<z.ZodObject<{
174
174
  type SitemapUrlList = z.infer<typeof SitemapUrlList>;
175
175
  declare const ListSitemapUrlInputBase: z.ZodObject<{
176
176
  type: z.ZodEnum<{
177
+ author: "author";
177
178
  post_type: "post_type";
178
179
  taxonomy: "taxonomy";
179
- author: "author";
180
180
  }>;
181
181
  page: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
182
182
  }, z.core.$strip>;
@@ -5,6 +5,8 @@ import { milliseconds } from "@kizlo/shared";
5
5
  const VERSION = version;
6
6
  const RPC_PROTOCOL_HEADER = "x-rpc-protocol";
7
7
  const SESSION_EXPIRY_MARGIN_MS = milliseconds("5 minutes");
8
+ /** Mount order for the built-in framework integrations, ahead of app integrations that leave `order` unset. */
9
+ const FRAMEWORK_INTEGRATION_ORDER = -100;
8
10
 
9
11
  //#endregion
10
- export { RPC_PROTOCOL_HEADER };
12
+ export { FRAMEWORK_INTEGRATION_ORDER, RPC_PROTOCOL_HEADER };