kizunajs 2.0.0-beta.21 → 2.0.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/{adapter-D4bTPElA.d.mts → adapter-BdkB6ql9.d.mts} +5 -1
  3. package/dist/{adapter-ClaFZoab.cjs → adapter-CK8ccDOC.cjs} +78 -8
  4. package/dist/{adapter-BSqNrxhq.mjs → adapter-DU3Ljl0P.mjs} +73 -9
  5. package/dist/{adapter-C3WYdSfx.d.cts → adapter-nQIkQwsM.d.cts} +5 -1
  6. package/dist/adapter.cjs +4 -3
  7. package/dist/adapter.d.cts +2 -2
  8. package/dist/adapter.d.mts +2 -2
  9. package/dist/adapter.mjs +4 -4
  10. package/dist/{error-response-CNQaKVYd.mjs → error-response-D7urgxeq.mjs} +16 -3
  11. package/dist/{error-response-C9ymqSU4.cjs → error-response-DN5Dsf8b.cjs} +21 -2
  12. package/dist/generator.cjs +5 -3
  13. package/dist/generator.d.cts +6 -2
  14. package/dist/generator.d.mts +6 -2
  15. package/dist/generator.mjs +5 -4
  16. package/dist/index.cjs +4 -4
  17. package/dist/index.d.cts +1 -1
  18. package/dist/index.d.mts +1 -1
  19. package/dist/index.mjs +4 -4
  20. package/dist/jobs-entry.cjs +2 -2
  21. package/dist/jobs-entry.d.cts +1 -1
  22. package/dist/jobs-entry.d.mts +1 -1
  23. package/dist/jobs-entry.mjs +2 -2
  24. package/dist/{plugin-server-kUsK7thV.cjs → plugin-server-CfF82yZL.cjs} +11 -6
  25. package/dist/{plugin-server-BztlE1fz.mjs → plugin-server-DNQ9_DL7.mjs} +11 -6
  26. package/dist/plugin.d.cts +1 -1
  27. package/dist/plugin.d.mts +1 -1
  28. package/dist/{schemas-DNPVDvkd.cjs → schemas-Bre1FVHq.cjs} +1 -1
  29. package/dist/{schemas-HW2FDsvz.mjs → schemas-DBX8DwFb.mjs} +1 -1
  30. package/dist/schemas.cjs +2 -2
  31. package/dist/schemas.mjs +2 -2
  32. package/package.json +1 -1
  33. package/src/adapter.ts +8 -5
  34. package/src/coercion.ts +25 -16
  35. package/src/generator.ts +4 -2
  36. package/src/routes.ts +97 -1
  37. package/src/zod-internals.ts +17 -2
@@ -1,5 +1,5 @@
1
1
  import { K as RouteDefinition, W as ResponseHeaders, Z as Routes, j as CachePolicy } from "./error-response-YbkRMKno.cjs";
2
- import { $n as jobAt, At as shortTypeName, Ct as resolveResponseCache, Dt as resolveResponseStream, Et as resolveResponseHeaders, Fn as FlattenedJob, Ki as parsePath, Kn as Jobs, Mt as toCamelCase, Nn as CompiledJob, Nt as toPascalCase, Ot as sanitizeFieldName, Sn as GeneratedFile, St as resolveResponseBody, Tt as resolveResponseEtag, Xn as flattenJobs, Zn as isCompiledJob, _t as isStreamResponse, aa as isNamedStream, bt as localTypeName, ca as streamContentType, da as streamStatuses, gt as isJsonMediaType, ht as isHintPrefix, jt as statusToCamelCase, kt as sanitizeIdentifier, la as streamMode, na as StreamMode, oa as routeStreams, qi as EVENT_STREAM_MEDIA_TYPE, sa as soleStreamResponse, ua as streamSchemas, vt as isSuccessStatus, wn as ApiDefinition, wt as resolveResponseContentType, xt as mergeHeaderFields, yt as isZodSchema } from "./adapter-C3WYdSfx.cjs";
2
+ import { At as sanitizeIdentifier, Cn as GeneratedFile, Ct as resolveResponseBody, Dt as resolveResponseHeaders, Et as resolveResponseEtag, In as FlattenedJob, Ji as EVENT_STREAM_MEDIA_TYPE, Mt as statusToCamelCase, Nt as toCamelCase, Ot as resolveResponseStream, Pn as CompiledJob, Pt as toPascalCase, Qn as isCompiledJob, St as mergeHeaderFields, Tn as ApiDefinition, Tt as resolveResponseContentType, Zn as flattenJobs, _t as isJsonMediaType, bt as isZodSchema, ca as soleStreamResponse, da as streamSchemas, er as jobAt, fa as streamStatuses, gt as isHintPrefix, jt as shortTypeName, kt as sanitizeFieldName, la as streamContentType, oa as isNamedStream, qi as parsePath, qn as Jobs, ra as StreamMode, sa as routeStreams, ua as streamMode, vt as isStreamResponse, wt as resolveResponseCache, xt as localTypeName, yt as isSuccessStatus } from "./adapter-nQIkQwsM.cjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/zod-internals.d.ts
@@ -107,6 +107,10 @@ declare const isBinarySchema: (schema: z.core.$ZodType) => boolean;
107
107
  * Returns a schema's metadata (set via `.meta()`), or undefined.
108
108
  */
109
109
  declare const readMeta: (schema: z.core.$ZodType) => Record<string, unknown> | undefined;
110
+ /**
111
+ * Returns the `Kizuna.model` a schema is, or was copied from by `.describe()` or `.meta()`.
112
+ */
113
+ declare const readModelSchema: (schema: z.core.$ZodType) => z.core.$ZodType | undefined;
110
114
  /**
111
115
  * Returns a `Kizuna.model` schema's `id` metadata, or undefined.
112
116
  */
@@ -376,4 +380,4 @@ interface GeneratorDefinition<Schema extends z.ZodType | undefined> {
376
380
  */
377
381
  declare const defineGenerator: <Schema extends z.ZodType | undefined = undefined>(definition: GeneratorDefinition<Schema>) => ((options: OptionsInput<Schema> & GeneratedFileOptions) => GeneratedFile);
378
382
  //#endregion
379
- export { ClientDefinition, type CompiledJob, type DiscriminatedUnion, EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, type FlattenedJob, GenerateContext, type GeneratedFile, GeneratedFileOptions, GeneratorDefinition, GeneratorModelContext, GeneratorPluginInfo, GeneratorRouteContext, GeneratorWalk, type Jobs, type RouteDefinition, type Routes, type StreamMode, type ToolNameEntry, type ToolOrigin, WalkApiOptions, type ZodDef, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
383
+ export { ClientDefinition, type CompiledJob, type DiscriminatedUnion, EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, type FlattenedJob, GenerateContext, type GeneratedFile, GeneratedFileOptions, GeneratorDefinition, GeneratorModelContext, GeneratorPluginInfo, GeneratorRouteContext, GeneratorWalk, type Jobs, type RouteDefinition, type Routes, type StreamMode, type ToolNameEntry, type ToolOrigin, WalkApiOptions, type ZodDef, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
@@ -1,5 +1,5 @@
1
1
  import { K as RouteDefinition, W as ResponseHeaders, Z as Routes, j as CachePolicy } from "./error-response-NoOGdh8H.mjs";
2
- import { $n as jobAt, At as shortTypeName, Ct as resolveResponseCache, Dt as resolveResponseStream, Et as resolveResponseHeaders, Fn as FlattenedJob, Ki as parsePath, Kn as Jobs, Mt as toCamelCase, Nn as CompiledJob, Nt as toPascalCase, Ot as sanitizeFieldName, Sn as GeneratedFile, St as resolveResponseBody, Tt as resolveResponseEtag, Xn as flattenJobs, Zn as isCompiledJob, _t as isStreamResponse, aa as isNamedStream, bt as localTypeName, ca as streamContentType, da as streamStatuses, gt as isJsonMediaType, ht as isHintPrefix, jt as statusToCamelCase, kt as sanitizeIdentifier, la as streamMode, na as StreamMode, oa as routeStreams, qi as EVENT_STREAM_MEDIA_TYPE, sa as soleStreamResponse, ua as streamSchemas, vt as isSuccessStatus, wn as ApiDefinition, wt as resolveResponseContentType, xt as mergeHeaderFields, yt as isZodSchema } from "./adapter-D4bTPElA.mjs";
2
+ import { At as sanitizeIdentifier, Cn as GeneratedFile, Ct as resolveResponseBody, Dt as resolveResponseHeaders, Et as resolveResponseEtag, In as FlattenedJob, Ji as EVENT_STREAM_MEDIA_TYPE, Mt as statusToCamelCase, Nt as toCamelCase, Ot as resolveResponseStream, Pn as CompiledJob, Pt as toPascalCase, Qn as isCompiledJob, St as mergeHeaderFields, Tn as ApiDefinition, Tt as resolveResponseContentType, Zn as flattenJobs, _t as isJsonMediaType, bt as isZodSchema, ca as soleStreamResponse, da as streamSchemas, er as jobAt, fa as streamStatuses, gt as isHintPrefix, jt as shortTypeName, kt as sanitizeFieldName, la as streamContentType, oa as isNamedStream, qi as parsePath, qn as Jobs, ra as StreamMode, sa as routeStreams, ua as streamMode, vt as isStreamResponse, wt as resolveResponseCache, xt as localTypeName, yt as isSuccessStatus } from "./adapter-BdkB6ql9.mjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/zod-internals.d.ts
@@ -107,6 +107,10 @@ declare const isBinarySchema: (schema: z.core.$ZodType) => boolean;
107
107
  * Returns a schema's metadata (set via `.meta()`), or undefined.
108
108
  */
109
109
  declare const readMeta: (schema: z.core.$ZodType) => Record<string, unknown> | undefined;
110
+ /**
111
+ * Returns the `Kizuna.model` a schema is, or was copied from by `.describe()` or `.meta()`.
112
+ */
113
+ declare const readModelSchema: (schema: z.core.$ZodType) => z.core.$ZodType | undefined;
110
114
  /**
111
115
  * Returns a `Kizuna.model` schema's `id` metadata, or undefined.
112
116
  */
@@ -376,4 +380,4 @@ interface GeneratorDefinition<Schema extends z.ZodType | undefined> {
376
380
  */
377
381
  declare const defineGenerator: <Schema extends z.ZodType | undefined = undefined>(definition: GeneratorDefinition<Schema>) => ((options: OptionsInput<Schema> & GeneratedFileOptions) => GeneratedFile);
378
382
  //#endregion
379
- export { ClientDefinition, type CompiledJob, type DiscriminatedUnion, EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, type FlattenedJob, GenerateContext, type GeneratedFile, GeneratedFileOptions, GeneratorDefinition, GeneratorModelContext, GeneratorPluginInfo, GeneratorRouteContext, GeneratorWalk, type Jobs, type RouteDefinition, type Routes, type StreamMode, type ToolNameEntry, type ToolOrigin, WalkApiOptions, type ZodDef, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
383
+ export { ClientDefinition, type CompiledJob, type DiscriminatedUnion, EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, type FlattenedJob, GenerateContext, type GeneratedFile, GeneratedFileOptions, GeneratorDefinition, GeneratorModelContext, GeneratorPluginInfo, GeneratorRouteContext, GeneratorWalk, type Jobs, type RouteDefinition, type Routes, type StreamMode, type ToolNameEntry, type ToolOrigin, WalkApiOptions, type ZodDef, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
@@ -1,5 +1,5 @@
1
- import { C as readMetaExamples, D as unwrapOptionalWrappers, S as readMetaDescription, T as readObjectShape, _ as readDiscriminatedUnion, b as readMeta, c as isBinarySchema, d as isIntegerSchema, f as isObjectSchema, g as readDeprecation, h as readDefType, i as FILE_PROBE, l as isDiscriminatedUnionSchema, m as readDef, p as isVoidSchema, s as globalRegistrySchemas, u as isFileSchema, v as readDiscriminatorLiteral, w as readMetaId, x as readMetaBrand, y as readDiscriminatorStringLiteral } from "./error-response-CNQaKVYd.mjs";
2
- import { $ as resolveResponseStream, A as toToolName, B as streamStatuses, F as routeStreams, G as isZodSchema, H as isJsonMediaType, I as soleStreamResponse, J as resolveResponseBody, K as localTypeName, L as streamContentType, P as isNamedStream, Q as resolveResponseHeaders, R as streamMode, U as isStreamResponse, V as isHintPrefix, W as isSuccessStatus, X as resolveResponseContentType, Y as resolveResponseCache, Z as resolveResponseEtag, _ as jobAt, a as pluginRoutesOf, at as toPascalCase, c as cacheHeaders, dt as isRouteDefinition, et as sanitizeFieldName, h as isCompiledJob, it as toCamelCase, j as EVENT_STREAM_MEDIA_TYPE, k as deriveToolNames, lt as flattenRoutes, m as flattenJobs, n as describeIssue, nt as shortTypeName, q as mergeHeaderFields, rt as statusToCamelCase, st as parsePath, tt as sanitizeIdentifier, u as deprecationHeaders, z as streamSchemas } from "./plugin-server-BztlE1fz.mjs";
1
+ import { C as readMetaExamples, E as readObjectShape, O as unwrapOptionalWrappers, S as readMetaDescription, T as readModelSchema, _ as readDiscriminatedUnion, b as readMeta, c as isBinarySchema, d as isIntegerSchema, f as isObjectSchema, g as readDeprecation, h as readDefType, i as FILE_PROBE, l as isDiscriminatedUnionSchema, m as readDef, p as isVoidSchema, s as globalRegistrySchemas, u as isFileSchema, v as readDiscriminatorLiteral, w as readMetaId, x as readMetaBrand, y as readDiscriminatorStringLiteral } from "./error-response-D7urgxeq.mjs";
2
+ import { $ as resolveResponseStream, A as toToolName, B as streamStatuses, F as routeStreams, G as isZodSchema, H as isJsonMediaType, I as soleStreamResponse, J as resolveResponseBody, K as localTypeName, L as streamContentType, P as isNamedStream, Q as resolveResponseHeaders, R as streamMode, U as isStreamResponse, V as isHintPrefix, W as isSuccessStatus, X as resolveResponseContentType, Y as resolveResponseCache, Z as resolveResponseEtag, _ as jobAt, a as pluginRoutesOf, at as toPascalCase, c as cacheHeaders, dt as isRouteDefinition, et as sanitizeFieldName, h as isCompiledJob, it as toCamelCase, j as EVENT_STREAM_MEDIA_TYPE, k as deriveToolNames, lt as flattenRoutes, m as flattenJobs, n as describeIssue, nt as shortTypeName, q as mergeHeaderFields, rt as statusToCamelCase, st as parsePath, tt as sanitizeIdentifier, u as deprecationHeaders, z as streamSchemas } from "./plugin-server-DNQ9_DL7.mjs";
3
3
  //#region src/generator.ts
4
4
  /**
5
5
  * Every route the api serves, the app's and the plugins' under their slugs,
@@ -41,7 +41,8 @@ const reachModels = (value, models, found, seen) => {
41
41
  if (typeof value !== "object" || value === null || seen.has(value)) return;
42
42
  seen.add(value);
43
43
  if (isSchema(value)) {
44
- if (models.has(value)) found.add(value);
44
+ const model = readModelSchema(value);
45
+ if (model !== void 0 && models.has(model)) found.add(model);
45
46
  const def = value._zod.def;
46
47
  for (const [key, child] of Object.entries(def)) {
47
48
  if (key === "checks") continue;
@@ -168,4 +169,4 @@ const defineGenerator = (definition) => (input) => {
168
169
  };
169
170
  };
170
171
  //#endregion
171
- export { EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
172
+ export { EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_plugin = require("./plugin-Dw-yCjTY.cjs");
3
- const require_error_response = require("./error-response-C9ymqSU4.cjs");
4
- const require_plugin_server = require("./plugin-server-kUsK7thV.cjs");
5
- const require_schemas = require("./schemas-DNPVDvkd.cjs");
6
- const require_adapter = require("./adapter-ClaFZoab.cjs");
3
+ const require_error_response = require("./error-response-DN5Dsf8b.cjs");
4
+ const require_plugin_server = require("./plugin-server-CfF82yZL.cjs");
5
+ const require_schemas = require("./schemas-Bre1FVHq.cjs");
6
+ const require_adapter = require("./adapter-CK8ccDOC.cjs");
7
7
  let zod = require("zod");
8
8
  //#region src/group-routes.ts
9
9
  /**
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { $ as SecurityRequirement, A as AutoResponsesBrand, B as ROUTES_GROUP, C as isPermissions, D as AUTO_RESPONSES_BRAND, E as AUTO_GUARD_WRITTEN_BRAND, F as HANDLER, G as RouteAuth, H as ResponseContentType, I as HANDLER_CONTEXT_BRAND, J as RouteHiddenToolCheck, K as RouteDefinition, L as HandlerContextBrand, M as DECLARATION, N as DeclarationKind, O as AuthoredRouteDefinition, P as GuardStatus, Q as SchemeNameOf, R as METHODS, S as createRoles, T as AUTO_GUARD_BRAND, U as ResponseDefinition, V as RequiredPermissions, X as RouteToolOptions, Y as RoutePath, Z as Routes, _ as PermissionSet, a as OAuthFlows, at as ProblemDetails, b as RoleNamesOf, ct as problemFromBody, d as isSecurityScheme, et as StreamDefinition, g as PermissionName, h as PermissionCatalog, i as OAuthFlow, it as GuardSchemaCheck, j as CachePolicy, k as AuthoredRoutes, l as authorizationServerIssuer, lt as STATUS_TITLES, m as GrantNamesOf, n as isProblemDetails, nt as GuardBody, o as OpenApiSecuritySchemeObject, ot as StripProblemEnvelope, p as CatalogOf, q as RouteHandlerFunction, r as ContextOf, rt as GuardOutput, s as SecurityScheme, st as problemDetails, tt as StreamResponseDefinition, u as declaredScopes, ut as getStatusText, v as Permissions, w as isRoles, x as Roles, y as RoleDefinition, z as Method } from "./error-response-YbkRMKno.cjs";
2
- import { $i as StreamContext, $n as jobAt, $r as BrandedHandlerContext, Aa as BearerCredential, Ai as ToolRunResult, An as SchemesOf, Ar as scheduleExpression, Ba as OAuth2Config, Bi as HasPathParams, Bn as JobHandlerArgs, Br as ResolvedGroup, Bt as PluginArgs, Cn as apiEntries, Cr as assertValidSchedule, Da as BasicConfig, Di as ToolEventYield, Dn as JobsOf, Dr as nextRun, E as MountedOf, Ea as ApiKeyCredential, Ei as ToolAnswer, En as GuardSchemaOf, Er as firesBetween, Fa as GuardHoldings, Fn as FlattenedJob, Fr as RequestContextSchema, Ft as ApiPlugins, Gi as buildPath, Gn as JobVoidReturn, Gt as PluginFactory, Ha as RoleOf, Hi as PathParamsCheck, Hn as JobHandlers, Ht as PluginDefinition, Ia as Identity, In as HttpJobsConfig, Ir as GroupOptions, Jn as JobsConfig, Jt as PluginRoutes, Ki as parsePath, Kn as Jobs, Kr as RouteBuilder, Kt as PluginList, La as IdentityParamsOf, Ln as InProcessJobsConfig, Lr as GroupPaths, Ma as CredentialOf, Mn as AuthoredJobs, Mr as RequestContextConfig, Na as CustomConfig, Nn as CompiledJob, Nr as RequestContextHeaderInputs, Oa as BasicCredential, Oi as ToolRunCall, On as RequestContextOf, Or as nextRuns, Pa as GrantsOf, Pn as CompiledJobs, Pr as RequestContextHeaderValues, Pt as AnyPlugin, Qi as StreamComment, Qn as isJobDefinition, Qr as AuthContextOf, Qt as PluginsBySlug, Ra as IdentityRole, Rn as JobDefinition, Rr as GroupPathsOf, Si as isRouteDefinition, Sn as GeneratedFile, Sr as ParsedCron, T as MountArgsOf, Ta as ApiKeyConfig, Ti as StreamTools, Tn as ApiPluginsOf, Tr as dueSchedules, Ua as RolesOf, Un as JobResponses, Ut as PluginExportValues, Va as OpenIdConnectConfig, Vi as PathParamName, Vn as JobHandlerReturn, Vr as createGroups, Vt as PluginDeclaration, Wi as RoutePathParamsCheck, Wn as JobRunnerConfig, Wt as PluginExportsOf, Xi as StreamBodyOf, Xn as flattenJobs, Xt as PluginSetup, Yi as StreamBody, Yn as NoJobs, Yt as PluginRoutesOf, Zi as StreamChunk, Zn as isCompiledJob, Zt as PluginSetupContext, _ as GuardDeny, _a as ToolKeys, _n as JobFnOf, _r as JobWorker, _t as isStreamResponse, aa as isNamedStream, ai as GuardSuccess, ar as JobQueueOptions, ba as toolEvents, bn as ApiEntry, br as defineJobTransport, ca as streamContentType, ci as HandlerReturn, cn as ConfiguredAdapterValue, cr as JobRunnerOptions, ct as ResponseError, da as streamStatuses, dn as ConfiguredGuardSchema, dr as JobDescriptor, ea as StreamMessage, ei as ContextFromAuth, er as JobErrorHandler, fa as StreamWithTools, fi as RouteGuardBrandOf, fn as ConfiguredIdentities, fr as JobDispatchError, ga as ToolEvents, gi as ThrowableReturn, gn as ConfiguredRequestContextSchemas, gr as JobTransportSupports, h as GuardDenial, ha as ToolError, hi as RoutesWithHandlerContext, hn as ConfiguredRequestContext, hr as JobTransportDefinition, ii as GuardReturn, ir as JobQueueArgs, ja as Credential, ji as ToolDefinition, jn as AuthoredJobDefinition, jr as scheduleTimezone, ka as BearerConfig, ki as ToolRunOptions, kn as RoutesOf, kr as parseCron, la as streamMode, ln as ConfiguredCodes, lr as createJobRunner, ma as ToolCall, mn as ConfiguredPlugins, mr as JobTransport, na as StreamMode, ni as GuardAnswer, nr as JobFnByKey, oa as routeStreams, or as JobRunArgs, pa as ToolAt, pn as ConfiguredJobs, pr as JobMessage, q as getHeaderValue, qi as EVENT_STREAM_MEDIA_TYPE, qn as JobsArg, qr as RouteWithHandler, ra as StreamYield, rn as definePlugin, rr as JobInputError, s as AnyAdapter, sa as soleStreamResponse, si as HandlerArgs, sn as ConfiguredAdapterContext, sr as JobRunner, ta as StreamMessageOf, tr as JobFn, u as ApiWithRouter, un as ConfiguredGroups, ur as jobFnAt, va as ToolResult, vn as JobsOfTree, vr as JobWorkerContext, wi as ModelToolCall, wn as ApiDefinition, wr as cron, xn as DiffSettings, xr as JobSchedule, ya as expandStreamTools, yn as KizunaConfigShape, yr as ScheduledJob, yt as isZodSchema, za as NoCredential, zi as ExtractPathParams, zn as JobHandler, zr as GroupSet, zt as PluginApi } from "./adapter-C3WYdSfx.cjs";
2
+ import { $i as StreamComment, $n as isJobDefinition, $r as AuthContextOf, $t as PluginsBySlug, Aa as BearerConfig, Ai as ToolRunOptions, An as RoutesOf, Ar as parseCron, Ba as NoCredential, Bi as ExtractPathParams, Bn as JobHandler, Br as GroupSet, Bt as PluginApi, Ci as isRouteDefinition, Cn as GeneratedFile, Cr as ParsedCron, Da as ApiKeyCredential, Di as ToolAnswer, Dn as GuardSchemaOf, Dr as firesBetween, E as MountedOf, Ea as ApiKeyConfig, Ei as StreamTools, En as ApiPluginsOf, Er as dueSchedules, Fa as GrantsOf, Fn as CompiledJobs, Fr as RequestContextHeaderValues, Ft as AnyPlugin, Gi as RoutePathParamsCheck, Gn as JobRunnerConfig, Gt as PluginExportsOf, Ha as OpenIdConnectConfig, Hi as PathParamName, Hn as JobHandlerReturn, Hr as createGroups, Ht as PluginDeclaration, Ia as GuardHoldings, In as FlattenedJob, Ir as RequestContextSchema, It as ApiPlugins, J as getHeaderValue, Ji as EVENT_STREAM_MEDIA_TYPE, Jn as JobsArg, Jr as RouteWithHandler, Ki as buildPath, Kn as JobVoidReturn, Kt as PluginFactory, La as Identity, Ln as HttpJobsConfig, Lr as GroupOptions, Ma as Credential, Mi as ToolDefinition, Mn as AuthoredJobDefinition, Mr as scheduleTimezone, Na as CredentialOf, Nn as AuthoredJobs, Nr as RequestContextConfig, Oa as BasicConfig, Oi as ToolEventYield, On as JobsOf, Or as nextRun, Pa as CustomConfig, Pn as CompiledJob, Pr as RequestContextHeaderInputs, Qi as StreamChunk, Qn as isCompiledJob, Qt as PluginSetupContext, Ra as IdentityParamsOf, Rn as InProcessJobsConfig, Rr as GroupPaths, Sn as DiffSettings, Sr as JobSchedule, T as MountArgsOf, Ti as ModelToolCall, Tn as ApiDefinition, Tr as cron, Ua as RoleOf, Ui as PathParamsCheck, Un as JobHandlers, Ut as PluginDefinition, Va as OAuth2Config, Vi as HasPathParams, Vn as JobHandlerArgs, Vr as ResolvedGroup, Vt as PluginArgs, Wa as RolesOf, Wn as JobResponses, Wt as PluginExportValues, Xi as StreamBody, Xn as NoJobs, Xt as PluginRoutesOf, Yn as JobsConfig, Yt as PluginRoutes, Zi as StreamBodyOf, Zn as flattenJobs, Zt as PluginSetup, _ as GuardDeny, _a as ToolEvents, _i as ThrowableReturn, _n as ConfiguredRequestContextSchemas, _r as JobTransportSupports, ai as GuardReturn, ar as JobQueueArgs, ba as expandStreamTools, bn as KizunaConfigShape, br as ScheduledJob, bt as isZodSchema, ca as soleStreamResponse, ci as HandlerArgs, cn as ConfiguredAdapterContext, cr as JobRunner, dn as ConfiguredGroups, dr as jobFnAt, ea as StreamContext, ei as BrandedHandlerContext, er as jobAt, fa as streamStatuses, fn as ConfiguredGuardSchema, fr as JobDescriptor, ga as ToolError, gi as RoutesWithHandlerContext, gn as ConfiguredRequestContext, gr as JobTransportDefinition, h as GuardDenial, ha as ToolCall, hn as ConfiguredPlugins, hr as JobTransport, ia as StreamYield, in as definePlugin, ir as JobInputError, ja as BearerCredential, ji as ToolRunResult, jn as SchemesOf, jr as scheduleExpression, ka as BasicCredential, ki as ToolRunCall, kn as RequestContextOf, kr as nextRuns, la as streamContentType, li as HandlerReturn, ln as ConfiguredAdapterValue, lr as JobRunnerOptions, lt as ResponseError, ma as ToolAt, mn as ConfiguredJobs, mr as JobMessage, na as StreamMessageOf, nr as JobFn, oa as isNamedStream, oi as GuardSuccess, or as JobQueueOptions, pa as StreamWithTools, pi as RouteGuardBrandOf, pn as ConfiguredIdentities, pr as JobDispatchError, qi as parsePath, qn as Jobs, qr as RouteBuilder, qt as PluginList, ra as StreamMode, ri as GuardAnswer, rr as JobFnByKey, s as AnyAdapter, sa as routeStreams, sr as JobRunArgs, ta as StreamMessage, ti as ContextFromAuth, tr as JobErrorHandler, u as ApiWithRouter, ua as streamMode, un as ConfiguredCodes, ur as createJobRunner, va as ToolKeys, vn as JobFnOf, vr as JobWorker, vt as isStreamResponse, wn as apiEntries, wr as assertValidSchedule, xa as toolEvents, xn as ApiEntry, xr as defineJobTransport, ya as ToolResult, yn as JobsOfTree, yr as JobWorkerContext, za as IdentityRole, zn as JobDefinition, zr as GroupPathsOf } from "./adapter-nQIkQwsM.cjs";
3
3
  import { a as buildProtectedResourceMetadata, c as ValidationErrorFor, d as isValidationError, i as assertCanonicalResourceUri, n as ProtectedResourceMetadata, o as BuiltinIssueCode, s as ValidationError, t as ProtectedResourceConfig, u as ValidationIssueCode } from "./protected-resource-metadata-B9hMFQ9N.cjs";
4
4
  import { z } from "zod";
5
5
  import { $input, $output } from "zod/v4/core";
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { $ as SecurityRequirement, A as AutoResponsesBrand, B as ROUTES_GROUP, C as isPermissions, D as AUTO_RESPONSES_BRAND, E as AUTO_GUARD_WRITTEN_BRAND, F as HANDLER, G as RouteAuth, H as ResponseContentType, I as HANDLER_CONTEXT_BRAND, J as RouteHiddenToolCheck, K as RouteDefinition, L as HandlerContextBrand, M as DECLARATION, N as DeclarationKind, O as AuthoredRouteDefinition, P as GuardStatus, Q as SchemeNameOf, R as METHODS, S as createRoles, T as AUTO_GUARD_BRAND, U as ResponseDefinition, V as RequiredPermissions, X as RouteToolOptions, Y as RoutePath, Z as Routes, _ as PermissionSet, a as OAuthFlows, at as ProblemDetails, b as RoleNamesOf, ct as problemFromBody, d as isSecurityScheme, et as StreamDefinition, g as PermissionName, h as PermissionCatalog, i as OAuthFlow, it as GuardSchemaCheck, j as CachePolicy, k as AuthoredRoutes, l as authorizationServerIssuer, lt as STATUS_TITLES, m as GrantNamesOf, n as isProblemDetails, nt as GuardBody, o as OpenApiSecuritySchemeObject, ot as StripProblemEnvelope, p as CatalogOf, q as RouteHandlerFunction, r as ContextOf, rt as GuardOutput, s as SecurityScheme, st as problemDetails, tt as StreamResponseDefinition, u as declaredScopes, ut as getStatusText, v as Permissions, w as isRoles, x as Roles, y as RoleDefinition, z as Method } from "./error-response-NoOGdh8H.mjs";
2
- import { $i as StreamContext, $n as jobAt, $r as BrandedHandlerContext, Aa as BearerCredential, Ai as ToolRunResult, An as SchemesOf, Ar as scheduleExpression, Ba as OAuth2Config, Bi as HasPathParams, Bn as JobHandlerArgs, Br as ResolvedGroup, Bt as PluginArgs, Cn as apiEntries, Cr as assertValidSchedule, Da as BasicConfig, Di as ToolEventYield, Dn as JobsOf, Dr as nextRun, E as MountedOf, Ea as ApiKeyCredential, Ei as ToolAnswer, En as GuardSchemaOf, Er as firesBetween, Fa as GuardHoldings, Fn as FlattenedJob, Fr as RequestContextSchema, Ft as ApiPlugins, Gi as buildPath, Gn as JobVoidReturn, Gt as PluginFactory, Ha as RoleOf, Hi as PathParamsCheck, Hn as JobHandlers, Ht as PluginDefinition, Ia as Identity, In as HttpJobsConfig, Ir as GroupOptions, Jn as JobsConfig, Jt as PluginRoutes, Ki as parsePath, Kn as Jobs, Kr as RouteBuilder, Kt as PluginList, La as IdentityParamsOf, Ln as InProcessJobsConfig, Lr as GroupPaths, Ma as CredentialOf, Mn as AuthoredJobs, Mr as RequestContextConfig, Na as CustomConfig, Nn as CompiledJob, Nr as RequestContextHeaderInputs, Oa as BasicCredential, Oi as ToolRunCall, On as RequestContextOf, Or as nextRuns, Pa as GrantsOf, Pn as CompiledJobs, Pr as RequestContextHeaderValues, Pt as AnyPlugin, Qi as StreamComment, Qn as isJobDefinition, Qr as AuthContextOf, Qt as PluginsBySlug, Ra as IdentityRole, Rn as JobDefinition, Rr as GroupPathsOf, Si as isRouteDefinition, Sn as GeneratedFile, Sr as ParsedCron, T as MountArgsOf, Ta as ApiKeyConfig, Ti as StreamTools, Tn as ApiPluginsOf, Tr as dueSchedules, Ua as RolesOf, Un as JobResponses, Ut as PluginExportValues, Va as OpenIdConnectConfig, Vi as PathParamName, Vn as JobHandlerReturn, Vr as createGroups, Vt as PluginDeclaration, Wi as RoutePathParamsCheck, Wn as JobRunnerConfig, Wt as PluginExportsOf, Xi as StreamBodyOf, Xn as flattenJobs, Xt as PluginSetup, Yi as StreamBody, Yn as NoJobs, Yt as PluginRoutesOf, Zi as StreamChunk, Zn as isCompiledJob, Zt as PluginSetupContext, _ as GuardDeny, _a as ToolKeys, _n as JobFnOf, _r as JobWorker, _t as isStreamResponse, aa as isNamedStream, ai as GuardSuccess, ar as JobQueueOptions, ba as toolEvents, bn as ApiEntry, br as defineJobTransport, ca as streamContentType, ci as HandlerReturn, cn as ConfiguredAdapterValue, cr as JobRunnerOptions, ct as ResponseError, da as streamStatuses, dn as ConfiguredGuardSchema, dr as JobDescriptor, ea as StreamMessage, ei as ContextFromAuth, er as JobErrorHandler, fa as StreamWithTools, fi as RouteGuardBrandOf, fn as ConfiguredIdentities, fr as JobDispatchError, ga as ToolEvents, gi as ThrowableReturn, gn as ConfiguredRequestContextSchemas, gr as JobTransportSupports, h as GuardDenial, ha as ToolError, hi as RoutesWithHandlerContext, hn as ConfiguredRequestContext, hr as JobTransportDefinition, ii as GuardReturn, ir as JobQueueArgs, ja as Credential, ji as ToolDefinition, jn as AuthoredJobDefinition, jr as scheduleTimezone, ka as BearerConfig, ki as ToolRunOptions, kn as RoutesOf, kr as parseCron, la as streamMode, ln as ConfiguredCodes, lr as createJobRunner, ma as ToolCall, mn as ConfiguredPlugins, mr as JobTransport, na as StreamMode, ni as GuardAnswer, nr as JobFnByKey, oa as routeStreams, or as JobRunArgs, pa as ToolAt, pn as ConfiguredJobs, pr as JobMessage, q as getHeaderValue, qi as EVENT_STREAM_MEDIA_TYPE, qn as JobsArg, qr as RouteWithHandler, ra as StreamYield, rn as definePlugin, rr as JobInputError, s as AnyAdapter, sa as soleStreamResponse, si as HandlerArgs, sn as ConfiguredAdapterContext, sr as JobRunner, ta as StreamMessageOf, tr as JobFn, u as ApiWithRouter, un as ConfiguredGroups, ur as jobFnAt, va as ToolResult, vn as JobsOfTree, vr as JobWorkerContext, wi as ModelToolCall, wn as ApiDefinition, wr as cron, xn as DiffSettings, xr as JobSchedule, ya as expandStreamTools, yn as KizunaConfigShape, yr as ScheduledJob, yt as isZodSchema, za as NoCredential, zi as ExtractPathParams, zn as JobHandler, zr as GroupSet, zt as PluginApi } from "./adapter-D4bTPElA.mjs";
2
+ import { $i as StreamComment, $n as isJobDefinition, $r as AuthContextOf, $t as PluginsBySlug, Aa as BearerConfig, Ai as ToolRunOptions, An as RoutesOf, Ar as parseCron, Ba as NoCredential, Bi as ExtractPathParams, Bn as JobHandler, Br as GroupSet, Bt as PluginApi, Ci as isRouteDefinition, Cn as GeneratedFile, Cr as ParsedCron, Da as ApiKeyCredential, Di as ToolAnswer, Dn as GuardSchemaOf, Dr as firesBetween, E as MountedOf, Ea as ApiKeyConfig, Ei as StreamTools, En as ApiPluginsOf, Er as dueSchedules, Fa as GrantsOf, Fn as CompiledJobs, Fr as RequestContextHeaderValues, Ft as AnyPlugin, Gi as RoutePathParamsCheck, Gn as JobRunnerConfig, Gt as PluginExportsOf, Ha as OpenIdConnectConfig, Hi as PathParamName, Hn as JobHandlerReturn, Hr as createGroups, Ht as PluginDeclaration, Ia as GuardHoldings, In as FlattenedJob, Ir as RequestContextSchema, It as ApiPlugins, J as getHeaderValue, Ji as EVENT_STREAM_MEDIA_TYPE, Jn as JobsArg, Jr as RouteWithHandler, Ki as buildPath, Kn as JobVoidReturn, Kt as PluginFactory, La as Identity, Ln as HttpJobsConfig, Lr as GroupOptions, Ma as Credential, Mi as ToolDefinition, Mn as AuthoredJobDefinition, Mr as scheduleTimezone, Na as CredentialOf, Nn as AuthoredJobs, Nr as RequestContextConfig, Oa as BasicConfig, Oi as ToolEventYield, On as JobsOf, Or as nextRun, Pa as CustomConfig, Pn as CompiledJob, Pr as RequestContextHeaderInputs, Qi as StreamChunk, Qn as isCompiledJob, Qt as PluginSetupContext, Ra as IdentityParamsOf, Rn as InProcessJobsConfig, Rr as GroupPaths, Sn as DiffSettings, Sr as JobSchedule, T as MountArgsOf, Ti as ModelToolCall, Tn as ApiDefinition, Tr as cron, Ua as RoleOf, Ui as PathParamsCheck, Un as JobHandlers, Ut as PluginDefinition, Va as OAuth2Config, Vi as HasPathParams, Vn as JobHandlerArgs, Vr as ResolvedGroup, Vt as PluginArgs, Wa as RolesOf, Wn as JobResponses, Wt as PluginExportValues, Xi as StreamBody, Xn as NoJobs, Xt as PluginRoutesOf, Yn as JobsConfig, Yt as PluginRoutes, Zi as StreamBodyOf, Zn as flattenJobs, Zt as PluginSetup, _ as GuardDeny, _a as ToolEvents, _i as ThrowableReturn, _n as ConfiguredRequestContextSchemas, _r as JobTransportSupports, ai as GuardReturn, ar as JobQueueArgs, ba as expandStreamTools, bn as KizunaConfigShape, br as ScheduledJob, bt as isZodSchema, ca as soleStreamResponse, ci as HandlerArgs, cn as ConfiguredAdapterContext, cr as JobRunner, dn as ConfiguredGroups, dr as jobFnAt, ea as StreamContext, ei as BrandedHandlerContext, er as jobAt, fa as streamStatuses, fn as ConfiguredGuardSchema, fr as JobDescriptor, ga as ToolError, gi as RoutesWithHandlerContext, gn as ConfiguredRequestContext, gr as JobTransportDefinition, h as GuardDenial, ha as ToolCall, hn as ConfiguredPlugins, hr as JobTransport, ia as StreamYield, in as definePlugin, ir as JobInputError, ja as BearerCredential, ji as ToolRunResult, jn as SchemesOf, jr as scheduleExpression, ka as BasicCredential, ki as ToolRunCall, kn as RequestContextOf, kr as nextRuns, la as streamContentType, li as HandlerReturn, ln as ConfiguredAdapterValue, lr as JobRunnerOptions, lt as ResponseError, ma as ToolAt, mn as ConfiguredJobs, mr as JobMessage, na as StreamMessageOf, nr as JobFn, oa as isNamedStream, oi as GuardSuccess, or as JobQueueOptions, pa as StreamWithTools, pi as RouteGuardBrandOf, pn as ConfiguredIdentities, pr as JobDispatchError, qi as parsePath, qn as Jobs, qr as RouteBuilder, qt as PluginList, ra as StreamMode, ri as GuardAnswer, rr as JobFnByKey, s as AnyAdapter, sa as routeStreams, sr as JobRunArgs, ta as StreamMessage, ti as ContextFromAuth, tr as JobErrorHandler, u as ApiWithRouter, ua as streamMode, un as ConfiguredCodes, ur as createJobRunner, va as ToolKeys, vn as JobFnOf, vr as JobWorker, vt as isStreamResponse, wn as apiEntries, wr as assertValidSchedule, xa as toolEvents, xn as ApiEntry, xr as defineJobTransport, ya as ToolResult, yn as JobsOfTree, yr as JobWorkerContext, za as IdentityRole, zn as JobDefinition, zr as GroupPathsOf } from "./adapter-BdkB6ql9.mjs";
3
3
  import { a as buildProtectedResourceMetadata, c as ValidationErrorFor, d as isValidationError, i as assertCanonicalResourceUri, n as ProtectedResourceMetadata, o as BuiltinIssueCode, s as ValidationError, t as ProtectedResourceConfig, u as ValidationIssueCode } from "./protected-resource-metadata-CfBVsqIk.mjs";
4
4
  import { z } from "zod";
5
5
  import { $input, $output } from "zod/v4/core";
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { a as definePlugin, c as createRoute, d as AUTO_RESPONSES_BRAND, f as DECLARATION, g as ROUTES_GROUP, h as METHODS, l as AUTO_GUARD_BRAND, m as HANDLER_CONTEXT_BRAND, o as pluginRouteTree, p as HANDLER, u as AUTO_GUARD_WRITTEN_BRAND } from "./plugin-xxCxibmu.mjs";
2
- import { T as readObjectShape, m as readDef, n as isProblemDetails, r as createModel, t as ProblemDetailsSchema } from "./error-response-CNQaKVYd.mjs";
3
- import { B as streamStatuses, C as firesBetween, D as scheduleExpression, E as parseCron, F as routeStreams, G as isZodSchema, I as soleStreamResponse, J as resolveResponseBody, L as streamContentType, O as scheduleTimezone, P as isNamedStream, R as streamMode, S as dueSchedules, T as nextRuns, U as isStreamResponse, _ as jobAt, b as assertValidSchedule, dt as isRouteDefinition, f as assertJobRunner, g as isJobDefinition, h as isCompiledJob, j as EVENT_STREAM_MEDIA_TYPE, l as assertValidDeprecationDates, lt as flattenRoutes, m as flattenJobs, o as resolvePlugins, ot as buildPath, p as buildJobs, r as pluginExportsOf, s as assertValidCache, st as parsePath, t as createApiReference, v as jobClaims, w as nextRun, x as cron } from "./plugin-server-BztlE1fz.mjs";
4
- import { a as assertCanonicalResourceUri, c as isValidationError, d as declaredScopes, f as isSecurityScheme, l as authenticationChallenge, o as buildProtectedResourceMetadata, p as resolveSecurityRequirements, u as authorizationServerIssuer } from "./schemas-HW2FDsvz.mjs";
5
- import { $ as dispatchSucceeded, G as defineJobTransport, J as jobFnAt, K as JobInputError, L as assertNoPathCollisions, P as warnUnsupportedJobOptions, Q as dispatchDueJobs, R as routeClaims, W as JobDispatchError, X as DispatchFailedSchema, Y as ResponseError, Z as DispatchResultSchema, at as getStatusText, ct as isPermissions, dt as createGroups, et as dueJobs, gt as toolEvents, ht as expandStreamTools, it as STATUS_TITLES, j as routerFromRoutes, lt as isRoles, mt as groupRoutes, nt as problemDetails, o as JOBS_META, ot as createPermissions, p as assembleApi, pt as assembleRoutes, q as createJobRunner, rt as problemFromBody, st as createRoles, tt as failedJobs, ut as permissionNames, x as getHeaderValue } from "./adapter-BSqNrxhq.mjs";
2
+ import { E as readObjectShape, m as readDef, n as isProblemDetails, r as createModel, t as ProblemDetailsSchema } from "./error-response-D7urgxeq.mjs";
3
+ import { B as streamStatuses, C as firesBetween, D as scheduleExpression, E as parseCron, F as routeStreams, G as isZodSchema, I as soleStreamResponse, J as resolveResponseBody, L as streamContentType, O as scheduleTimezone, P as isNamedStream, R as streamMode, S as dueSchedules, T as nextRuns, U as isStreamResponse, _ as jobAt, b as assertValidSchedule, dt as isRouteDefinition, f as assertJobRunner, g as isJobDefinition, h as isCompiledJob, j as EVENT_STREAM_MEDIA_TYPE, l as assertValidDeprecationDates, lt as flattenRoutes, m as flattenJobs, o as resolvePlugins, ot as buildPath, p as buildJobs, r as pluginExportsOf, s as assertValidCache, st as parsePath, t as createApiReference, v as jobClaims, w as nextRun, x as cron } from "./plugin-server-DNQ9_DL7.mjs";
4
+ import { a as assertCanonicalResourceUri, c as isValidationError, d as declaredScopes, f as isSecurityScheme, l as authenticationChallenge, o as buildProtectedResourceMetadata, p as resolveSecurityRequirements, u as authorizationServerIssuer } from "./schemas-DBX8DwFb.mjs";
5
+ import { $ as dispatchDueJobs, F as warnUnsupportedJobOptions, G as JobDispatchError, J as createJobRunner, K as defineJobTransport, M as routerFromRoutes, Q as DispatchResultSchema, R as assertNoPathCollisions, S as getHeaderValue, X as ResponseError, Y as jobFnAt, Z as DispatchFailedSchema, _t as toolEvents, at as STATUS_TITLES, ct as createRoles, dt as permissionNames, et as dispatchSucceeded, ft as createGroups, gt as expandStreamTools, ht as groupRoutes, it as problemFromBody, lt as isPermissions, mt as assembleRoutes, nt as failedJobs, o as JOBS_META, ot as getStatusText, p as assembleApi, q as JobInputError, rt as problemDetails, st as createPermissions, tt as dueJobs, ut as isRoles, z as routeClaims } from "./adapter-DU3Ljl0P.mjs";
6
6
  import { z } from "zod";
7
7
  //#region src/group-routes.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_plugin_server = require("./plugin-server-kUsK7thV.cjs");
3
- const require_adapter = require("./adapter-ClaFZoab.cjs");
2
+ const require_plugin_server = require("./plugin-server-CfF82yZL.cjs");
3
+ const require_adapter = require("./adapter-CK8ccDOC.cjs");
4
4
  //#region src/start-jobs.ts
5
5
  /**
6
6
  * The dedupe key an occurrence gets. Every instance ticking the same minute
@@ -1,4 +1,4 @@
1
- import { _r as JobWorker, wn as ApiDefinition } from "./adapter-C3WYdSfx.cjs";
1
+ import { Tn as ApiDefinition, vr as JobWorker } from "./adapter-nQIkQwsM.cjs";
2
2
 
3
3
  //#region src/start-jobs.d.ts
4
4
  interface StartJobsOptions {
@@ -1,4 +1,4 @@
1
- import { _r as JobWorker, wn as ApiDefinition } from "./adapter-D4bTPElA.mjs";
1
+ import { Tn as ApiDefinition, vr as JobWorker } from "./adapter-BdkB6ql9.mjs";
2
2
 
3
3
  //#region src/start-jobs.d.ts
4
4
  interface StartJobsOptions {
@@ -1,5 +1,5 @@
1
- import { D as scheduleExpression, O as scheduleTimezone, m as flattenJobs, w as nextRun } from "./plugin-server-BztlE1fz.mjs";
2
- import { D as jobRunnerFrom, J as jobFnAt, h as boundJobKeys, o as JOBS_META } from "./adapter-BSqNrxhq.mjs";
1
+ import { D as scheduleExpression, O as scheduleTimezone, m as flattenJobs, w as nextRun } from "./plugin-server-DNQ9_DL7.mjs";
2
+ import { O as jobRunnerFrom, Y as jobFnAt, h as boundJobKeys, o as JOBS_META } from "./adapter-DU3Ljl0P.mjs";
3
3
  //#region src/start-jobs.ts
4
4
  /**
5
5
  * The dedupe key an occurrence gets. Every instance ticking the same minute
@@ -1,5 +1,5 @@
1
1
  const require_plugin = require("./plugin-Dw-yCjTY.cjs");
2
- const require_error_response = require("./error-response-C9ymqSU4.cjs");
2
+ const require_error_response = require("./error-response-DN5Dsf8b.cjs");
3
3
  let zod = require("zod");
4
4
  //#region src/coercion.ts
5
5
  /**
@@ -28,9 +28,9 @@ const buildCoercionPlan = (schema) => {
28
28
  if (baseType === "array") {
29
29
  const element = resolveArrayElement(fieldSchema);
30
30
  const elementType = element ? require_error_response.resolveBaseType(element) : void 0;
31
- if (elementType !== void 0 && COERCIBLE_TYPES.has(elementType)) fields.push({
31
+ fields.push({
32
32
  key,
33
- type: elementType,
33
+ type: elementType !== void 0 && COERCIBLE_TYPES.has(elementType) ? elementType : void 0,
34
34
  array: true
35
35
  });
36
36
  continue;
@@ -84,10 +84,15 @@ const coerceValue = (value, type) => {
84
84
  const date = new Date(value);
85
85
  return Number.isNaN(date.getTime()) ? value : date;
86
86
  };
87
+ /**
88
+ * A lone value is a one-item list, the way OpenAPI's default `form` style
89
+ * sends `?tag=work`.
90
+ */
87
91
  const coerceArray = (value, type) => {
88
- if (!Array.isArray(value)) return value;
89
- let changed = false;
90
- const coerced = value.map((item) => {
92
+ const items = Array.isArray(value) ? value : [value];
93
+ if (type === void 0) return items;
94
+ let changed = items !== value;
95
+ const coerced = items.map((item) => {
91
96
  const next = coerceValue(item, type);
92
97
  if (next !== item) changed = true;
93
98
  return next;
@@ -1,5 +1,5 @@
1
1
  import { g as ROUTES_GROUP, n as PLUGIN_SERVERS_META_KEY, t as PLUGIN_ROUTES_META_KEY } from "./plugin-xxCxibmu.mjs";
2
- import { E as resolveBaseType, T as readObjectShape, a as WRAPPER_TYPES, c as isBinarySchema, m as readDef, t as ProblemDetailsSchema } from "./error-response-CNQaKVYd.mjs";
2
+ import { D as resolveBaseType, E as readObjectShape, a as WRAPPER_TYPES, c as isBinarySchema, m as readDef, t as ProblemDetailsSchema } from "./error-response-D7urgxeq.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/coercion.ts
5
5
  /**
@@ -28,9 +28,9 @@ const buildCoercionPlan = (schema) => {
28
28
  if (baseType === "array") {
29
29
  const element = resolveArrayElement(fieldSchema);
30
30
  const elementType = element ? resolveBaseType(element) : void 0;
31
- if (elementType !== void 0 && COERCIBLE_TYPES.has(elementType)) fields.push({
31
+ fields.push({
32
32
  key,
33
- type: elementType,
33
+ type: elementType !== void 0 && COERCIBLE_TYPES.has(elementType) ? elementType : void 0,
34
34
  array: true
35
35
  });
36
36
  continue;
@@ -84,10 +84,15 @@ const coerceValue = (value, type) => {
84
84
  const date = new Date(value);
85
85
  return Number.isNaN(date.getTime()) ? value : date;
86
86
  };
87
+ /**
88
+ * A lone value is a one-item list, the way OpenAPI's default `form` style
89
+ * sends `?tag=work`.
90
+ */
87
91
  const coerceArray = (value, type) => {
88
- if (!Array.isArray(value)) return value;
89
- let changed = false;
90
- const coerced = value.map((item) => {
92
+ const items = Array.isArray(value) ? value : [value];
93
+ if (type === void 0) return items;
94
+ let changed = items !== value;
95
+ const coerced = items.map((item) => {
91
96
  const next = coerceValue(item, type);
92
97
  if (next !== item) changed = true;
93
98
  return next;
package/dist/plugin.d.cts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { Y as RoutePath } from "./error-response-YbkRMKno.cjs";
2
- import { $t as ResolvedPlugin, Bt as PluginArgs, Ft as ApiPlugins, Gt as PluginFactory, Ht as PluginDefinition, It as InstallOptions, Jt as PluginRoutes, Kt as PluginList, Lt as PLUGIN_ROUTES_META_KEY, Pt as AnyPlugin, Qt as PluginsBySlug, Rt as PLUGIN_SERVERS_META_KEY, Ut as PluginExportValues, Vt as PluginDeclaration, Wt as PluginExportsOf, Xt as PluginSetup, Yt as PluginRoutesOf, Zt as PluginSetupContext, an as route, en as RouteAuthSchema, in as pluginRouteTree, nn as SlugOption, on as ApiContext, qt as PluginRouteBuilder, rn as definePlugin, tn as RoutePathSchema, zt as PluginApi } from "./adapter-C3WYdSfx.cjs";
2
+ import { $t as PluginsBySlug, Bt as PluginApi, Ft as AnyPlugin, Gt as PluginExportsOf, Ht as PluginDeclaration, It as ApiPlugins, Jt as PluginRouteBuilder, Kt as PluginFactory, Lt as InstallOptions, Qt as PluginSetupContext, Rt as PLUGIN_ROUTES_META_KEY, Ut as PluginDefinition, Vt as PluginArgs, Wt as PluginExportValues, Xt as PluginRoutesOf, Yt as PluginRoutes, Zt as PluginSetup, an as pluginRouteTree, en as ResolvedPlugin, in as definePlugin, nn as RoutePathSchema, on as route, qt as PluginList, rn as SlugOption, sn as ApiContext, tn as RouteAuthSchema, zt as PLUGIN_SERVERS_META_KEY } from "./adapter-nQIkQwsM.cjs";
3
3
  export { AnyPlugin, ApiContext, ApiPlugins, InstallOptions, PLUGIN_ROUTES_META_KEY, PLUGIN_SERVERS_META_KEY, PluginApi, PluginArgs, PluginDeclaration, PluginDefinition, PluginExportValues, PluginExportsOf, PluginFactory, PluginList, PluginRouteBuilder, PluginRoutes, PluginRoutesOf, PluginSetup, PluginSetupContext, PluginsBySlug, ResolvedPlugin, RouteAuthSchema, RoutePath, RoutePathSchema, SlugOption, definePlugin, pluginRouteTree, route };
package/dist/plugin.d.mts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { Y as RoutePath } from "./error-response-NoOGdh8H.mjs";
2
- import { $t as ResolvedPlugin, Bt as PluginArgs, Ft as ApiPlugins, Gt as PluginFactory, Ht as PluginDefinition, It as InstallOptions, Jt as PluginRoutes, Kt as PluginList, Lt as PLUGIN_ROUTES_META_KEY, Pt as AnyPlugin, Qt as PluginsBySlug, Rt as PLUGIN_SERVERS_META_KEY, Ut as PluginExportValues, Vt as PluginDeclaration, Wt as PluginExportsOf, Xt as PluginSetup, Yt as PluginRoutesOf, Zt as PluginSetupContext, an as route, en as RouteAuthSchema, in as pluginRouteTree, nn as SlugOption, on as ApiContext, qt as PluginRouteBuilder, rn as definePlugin, tn as RoutePathSchema, zt as PluginApi } from "./adapter-D4bTPElA.mjs";
2
+ import { $t as PluginsBySlug, Bt as PluginApi, Ft as AnyPlugin, Gt as PluginExportsOf, Ht as PluginDeclaration, It as ApiPlugins, Jt as PluginRouteBuilder, Kt as PluginFactory, Lt as InstallOptions, Qt as PluginSetupContext, Rt as PLUGIN_ROUTES_META_KEY, Ut as PluginDefinition, Vt as PluginArgs, Wt as PluginExportValues, Xt as PluginRoutesOf, Yt as PluginRoutes, Zt as PluginSetup, an as pluginRouteTree, en as ResolvedPlugin, in as definePlugin, nn as RoutePathSchema, on as route, qt as PluginList, rn as SlugOption, sn as ApiContext, tn as RouteAuthSchema, zt as PLUGIN_SERVERS_META_KEY } from "./adapter-BdkB6ql9.mjs";
3
3
  export { AnyPlugin, ApiContext, ApiPlugins, InstallOptions, PLUGIN_ROUTES_META_KEY, PLUGIN_SERVERS_META_KEY, PluginApi, PluginArgs, PluginDeclaration, PluginDefinition, PluginExportValues, PluginExportsOf, PluginFactory, PluginList, PluginRouteBuilder, PluginRoutes, PluginRoutesOf, PluginSetup, PluginSetupContext, PluginsBySlug, ResolvedPlugin, RouteAuthSchema, RoutePath, RoutePathSchema, SlugOption, definePlugin, pluginRouteTree, route };
@@ -1,4 +1,4 @@
1
- const require_error_response = require("./error-response-C9ymqSU4.cjs");
1
+ const require_error_response = require("./error-response-DN5Dsf8b.cjs");
2
2
  let zod = require("zod");
3
3
  //#region src/security-scheme.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { r as createModel, t as ProblemDetailsSchema } from "./error-response-CNQaKVYd.mjs";
1
+ import { r as createModel, t as ProblemDetailsSchema } from "./error-response-D7urgxeq.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/security-scheme.ts
4
4
  /**
package/dist/schemas.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_error_response = require("./error-response-C9ymqSU4.cjs");
3
- const require_schemas = require("./schemas-DNPVDvkd.cjs");
2
+ const require_error_response = require("./error-response-DN5Dsf8b.cjs");
3
+ const require_schemas = require("./schemas-Bre1FVHq.cjs");
4
4
  exports.BinarySchema = require_schemas.BinarySchema;
5
5
  exports.FileSchema = require_schemas.FileSchema;
6
6
  exports.ProblemDetailsSchema = require_error_response.ProblemDetailsSchema;
package/dist/schemas.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { t as ProblemDetailsSchema } from "./error-response-CNQaKVYd.mjs";
2
- import { i as ProtectedResourceMetadataSchema, n as BinarySchema, r as FileSchema, s as ValidationErrorSchema, t as ToolAnswerSchema } from "./schemas-HW2FDsvz.mjs";
1
+ import { t as ProblemDetailsSchema } from "./error-response-D7urgxeq.mjs";
2
+ import { i as ProtectedResourceMetadataSchema, n as BinarySchema, r as FileSchema, s as ValidationErrorSchema, t as ToolAnswerSchema } from "./schemas-DBX8DwFb.mjs";
3
3
  export { BinarySchema, FileSchema, ProblemDetailsSchema, ProtectedResourceMetadataSchema, ToolAnswerSchema, ValidationErrorSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kizunajs",
3
- "version": "2.0.0-beta.21",
3
+ "version": "2.0.0-beta.23",
4
4
  "description": "Route declaration, validation, and the adapter API for Kizuna.js",
5
5
  "keywords": [
6
6
  "kizunajs",
package/src/adapter.ts CHANGED
@@ -1832,9 +1832,12 @@ const renderResult = (
1832
1832
  }
1833
1833
  };
1834
1834
 
1835
- const formDataToObject = (form: FormData): Record<string, unknown> => {
1835
+ /**
1836
+ * A query string or form as an object. A repeated key collects every value into a list.
1837
+ */
1838
+ export const entriesToObject = (source: URLSearchParams | FormData): Record<string, unknown> => {
1836
1839
  const result: Record<string, unknown> = {};
1837
- for (const [key, value] of form.entries()) {
1840
+ for (const [key, value] of source.entries()) {
1838
1841
  const existing = result[key];
1839
1842
  if (existing === undefined) {
1840
1843
  result[key] = value;
@@ -1852,7 +1855,7 @@ const formDataToObject = (form: FormData): Record<string, unknown> => {
1852
1855
  * whose text core already read.
1853
1856
  */
1854
1857
  export const parseBodyText = (text: string, route: RouteDefinition): unknown => {
1855
- if (route.contentType === 'application/x-www-form-urlencoded') return Object.fromEntries(new URLSearchParams(text));
1858
+ if (route.contentType === 'application/x-www-form-urlencoded') return entriesToObject(new URLSearchParams(text));
1856
1859
  return text.length > 0 ? JSON.parse(text) : undefined;
1857
1860
  };
1858
1861
 
@@ -1865,9 +1868,9 @@ export const parseBodyText = (text: string, route: RouteDefinition): unknown =>
1865
1868
  export const parseFetchBody = async (request: Request, route: RouteDefinition): Promise<unknown> => {
1866
1869
  switch (route.contentType) {
1867
1870
  case 'multipart/form-data':
1868
- return formDataToObject(await request.formData());
1871
+ return entriesToObject(await request.formData());
1869
1872
  case 'application/x-www-form-urlencoded':
1870
- return Object.fromEntries(new URLSearchParams(await request.text()));
1873
+ return entriesToObject(new URLSearchParams(await request.text()));
1871
1874
  default: {
1872
1875
  const text = await request.text();
1873
1876
  return text.length > 0 ? JSON.parse(text) : undefined;
package/src/coercion.ts CHANGED
@@ -8,11 +8,17 @@ import { readDef, readObjectShape, resolveBaseType, WRAPPER_TYPES } from './zod-
8
8
  */
9
9
  const COERCIBLE_TYPES: ReadonlySet<string> = new Set(['number', 'int', 'boolean', 'bigint', 'date']);
10
10
 
11
- interface CoercionField {
12
- key: string;
13
- type: string;
14
- array: boolean;
15
- }
11
+ type CoercionField =
12
+ | {
13
+ key: string;
14
+ type: string;
15
+ array: false;
16
+ }
17
+ | {
18
+ key: string;
19
+ type: string | undefined;
20
+ array: true;
21
+ };
16
22
 
17
23
  /**
18
24
  * The fields of one request schema that need coercion, or `null` when none do.
@@ -43,13 +49,11 @@ const buildCoercionPlan = (schema: z.ZodType): CoercionPlan => {
43
49
  if (baseType === 'array') {
44
50
  const element = resolveArrayElement(fieldSchema);
45
51
  const elementType = element ? resolveBaseType(element) : undefined;
46
- if (elementType !== undefined && COERCIBLE_TYPES.has(elementType)) {
47
- fields.push({
48
- key,
49
- type: elementType,
50
- array: true,
51
- });
52
- }
52
+ fields.push({
53
+ key,
54
+ type: elementType !== undefined && COERCIBLE_TYPES.has(elementType) ? elementType : undefined,
55
+ array: true,
56
+ });
53
57
  continue;
54
58
  }
55
59
  if (COERCIBLE_TYPES.has(baseType)) {
@@ -111,10 +115,15 @@ const coerceValue = (value: unknown, type: string): unknown => {
111
115
  return Number.isNaN(date.getTime()) ? value : date;
112
116
  };
113
117
 
114
- const coerceArray = (value: unknown, type: string): unknown => {
115
- if (!Array.isArray(value)) return value;
116
- let changed = false;
117
- const coerced = value.map((item) => {
118
+ /**
119
+ * A lone value is a one-item list, the way OpenAPI's default `form` style
120
+ * sends `?tag=work`.
121
+ */
122
+ const coerceArray = (value: unknown, type: string | undefined): unknown => {
123
+ const items = Array.isArray(value) ? value : [value];
124
+ if (type === undefined) return items;
125
+ let changed = items !== value;
126
+ const coerced = items.map((item) => {
118
127
  const next = coerceValue(item, type);
119
128
  if (next !== item) changed = true;
120
129
  return next;
package/src/generator.ts CHANGED
@@ -5,7 +5,7 @@ import type { Routes, RouteDefinition } from './types.js';
5
5
  import type { ApiDefinition } from './api-definition.js';
6
6
  import { isRouteDefinition } from './handler-pipeline.js';
7
7
  import { describeIssue, pluginRoutesOf } from './plugin-server.js';
8
- import { globalRegistrySchemas, readMetaDescription } from './zod-internals.js';
8
+ import { globalRegistrySchemas, readMetaDescription, readModelSchema } from './zod-internals.js';
9
9
  import type { GeneratedFile } from './config.js';
10
10
  import type { z } from 'zod';
11
11
 
@@ -28,6 +28,7 @@ export {
28
28
  readDiscriminatedUnion,
29
29
  readMeta,
30
30
  readMetaId,
31
+ readModelSchema,
31
32
  readMetaDescription,
32
33
  readMetaBrand,
33
34
  readMetaExamples,
@@ -222,7 +223,8 @@ const reachModels = (value: unknown, models: Map<z.core.$ZodType, string>, found
222
223
  if (typeof value !== 'object' || value === null || seen.has(value)) return;
223
224
  seen.add(value);
224
225
  if (isSchema(value)) {
225
- if (models.has(value)) found.add(value);
226
+ const model = readModelSchema(value);
227
+ if (model !== undefined && models.has(model)) found.add(model);
226
228
  const def = value._zod.def as unknown as Record<string, unknown>;
227
229
  for (const [key, child] of Object.entries(def)) {
228
230
  if (key === 'checks') continue;