kizunajs 2.0.0-beta.3 → 2.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  A spec-driven framework for building fully typed REST APIs in TypeScript, where your route declarations produce the validation, the documentation, the clients, and the AI tools.
6
6
 
7
- [![npm](https://img.shields.io/npm/v/kizunajs/beta?color=blue&label=npm)](https://www.npmjs.com/package/kizunajs/v/2.0.0-beta.3)
7
+ [![npm](https://img.shields.io/npm/v/kizunajs/beta?color=blue&label=npm)](https://www.npmjs.com/package/kizunajs/v/2.0.0-beta.5)
8
8
  ![license](https://img.shields.io/badge/license-MIT-blue)
9
9
 
10
10
  [Documentation](https://kizunajs.com)
package/dist/index.cjs CHANGED
@@ -578,6 +578,7 @@ const defineConfig = (options) => {
578
578
  onJobError: options.jobRunner?.onError
579
579
  }, options.adapter),
580
580
  clients: options.clients ?? [],
581
+ diff: options.diff,
581
582
  typescript: options.typescript
582
583
  };
583
584
  };
@@ -593,7 +594,8 @@ const apiEntries = (module) => {
593
594
  return [["default", {
594
595
  api: config.api,
595
596
  clients: config.clients ?? [],
596
- typescript: config.typescript
597
+ typescript: config.typescript,
598
+ diff: config.diff
597
599
  }]];
598
600
  };
599
601
  //#endregion
package/dist/index.d.cts CHANGED
@@ -856,6 +856,34 @@ interface ClientTarget {
856
856
  */
857
857
  readonly generate: (contract: ApiDefinition) => string;
858
858
  }
859
+ /**
860
+ * What else `kizuna diff` treats as breaking.
861
+ */
862
+ interface DiffSettings {
863
+ /**
864
+ * Report a renamed dotted key, such as `users.getUser` becoming
865
+ * `users.fetchUser`, as breaking. The key names the method on a generated
866
+ * client, so a rename breaks anyone shipping one as an SDK and leaves the
867
+ * HTTP surface untouched.
868
+ *
869
+ * @default false
870
+ */
871
+ dottedKeys?: boolean;
872
+ /**
873
+ * Report a job key that is gone. A job answers `POST /jobs/run` by its
874
+ * dotted key, so this matters once something outside your own code
875
+ * dispatches them.
876
+ *
877
+ * @default false
878
+ */
879
+ jobs?: boolean;
880
+ /**
881
+ * Report an MCP tool a model can no longer call.
882
+ *
883
+ * @default false
884
+ */
885
+ tools?: boolean;
886
+ }
859
887
  /**
860
888
  * What `kizuna.config.ts` default-exports: the api its config assembles, and
861
889
  * what is generated from it.
@@ -869,6 +897,10 @@ interface ApiEntry {
869
897
  typescript?: {
870
898
  outputFile?: string;
871
899
  };
900
+ /**
901
+ * What else `kizuna diff` treats as breaking.
902
+ */
903
+ diff?: DiffSettings;
872
904
  }
873
905
  /**
874
906
  * The config a `kizuna.config.ts` module default-exports. A repository serving
@@ -974,6 +1006,15 @@ type KizunaConfigInput<R extends Routes, J extends Jobs, P extends PluginList, T
974
1006
  * ],
975
1007
  */
976
1008
  clients?: readonly ClientTarget[];
1009
+ /**
1010
+ * What else `kizuna diff` treats as breaking.
1011
+ *
1012
+ * @example
1013
+ * diff: {
1014
+ * dottedKeys: true,
1015
+ * }
1016
+ */
1017
+ diff?: DiffSettings;
977
1018
  };
978
1019
  /**
979
1020
  * The api `defineConfig` assembles: the routes it declares, and the `mount`
@@ -1003,6 +1044,7 @@ declare const defineConfig: <const R extends Routes = Record<string, never>, con
1003
1044
  typescript: {
1004
1045
  outputFile?: string;
1005
1046
  } | undefined;
1047
+ diff: DiffSettings | undefined;
1006
1048
  };
1007
1049
  //#endregion
1008
- export { AUTO_GUARD_BRAND, AUTO_GUARD_WRITTEN_BRAND, AUTO_RESPONSES_BRAND, type AnyPlugin, type Api, type ApiDefinition, type ApiEntry, type ApiImplementations, type ApiKeyCredential, type ApiPlugins, type ApiPluginsOf, type AuthCheck, type AuthContextOf, type AuthoredJobs, type AuthoredRouteDefinition, type AuthoredRoutes, type AutoResponsesBrand, type BasicCredential, type BearerCredential, type BrandedHandlerContext, type BuiltinIssueCode, type CachePolicy, type CatalogOf, type ClientTarget, type CodedIssue, type CompiledJob, type CompiledJobs, type ConfiguredApi, type ContextFromAuth, type ContextOf, type Credential, type CredentialOf, DECLARATION, type DeclarationKind, DispatchFailedSchema, type DispatchOptions, type DispatchOutcome, type DispatchResult, DispatchResultSchema, EVENT_STREAM_MEDIA_TYPE, type ExtractPathParams, type FlattenedJob, GUARD, type GrantNamesOf, type GrantsOf, type GuardAnswer, type GuardBody, type GuardFor, type GuardHoldings, type GuardOutput, type GuardReturn, type GuardSchemaOf, type GuardStatus, type GuardSuccess, HANDLER_CONTEXT_BRAND, type HandlerArgs, type HandlerContextBrand, type HandlerReturn, type HasPathParams, type Identity, type IdentityBuilder, type IdentityFactories, type IdentityNamesOf, type IdentityParamsOf, type IdentityRole, type IdentityWithGuard, type JobBuilder, type JobDefinition, type JobDescriptor, JobDispatchError, type JobErrorHandler, type JobFn, type JobFnByKey, type JobFnOf, type JobHandler, type JobHandlerArgs, type JobHandlerFor, type JobHandlerReturn, type JobHandlers, JobInputError, type JobMessage, type JobQueueArgs, type JobQueueOptions, type JobResponses, type JobRunArgs, type JobRunner, type JobRunnerOptions, type JobSchedule, type JobTransport, type JobTransportDefinition, type JobTransportSupports, type JobWithHandler, type JobWorker, type JobWorkerContext, type Jobs, type JobsArg, type JobsConfig, type JobsOf, type JobsOfTree, type K, Kizuna, type KizunaConfigInput, type KizunaConfigShape, type KizunaSpec, METHODS, type Method, type ModelOptions, type NoCredential, type NoJobs, type NormalizeTags, type OAuthFlow, type OAuthFlows, type OpenApiSecuritySchemeObject, type ParsedCron, type PathParamName, type PermissionCatalog, type PermissionName, type PermissionSet, type Permissions, type PluginArgs, type PluginDeclaration, type PluginDefinition, type PluginExportValues, type PluginExportsOf, type PluginList, type PluginPropsOf, type PluginRoutes, type PluginRoutesOf, type PluginsBySlug, type ProblemDetails, type ProtectedResourceConfig, type ProtectedResourceMetadata, RESOLVER, type RegisteredIssue, type RequestContextBuilder, type RequestContextHeaderInputs, type RequestContextHeaderValues, type RequestContextOf, type RequestContextSchema, type RequestContextWithHandler, type RequiredPermissions, type ResponseContentType, type ResponseDefinition, ResponseError, type RoleDefinition, type RoleNamesOf, type RoleOf, type Roles, type RolesOf, type RouteAuth, type RouteAuthCheck, type RouteAuthRule, type RouteAuthValue, type RouteBuilder, type RouteDefinition, type RouteHandlerFunction, type RoutePath, type RouteToolOptions, type RouteWithHandler, type Routes, type RoutesOf, type RoutesWithHandlerContext, STATUS_TITLES, type ScheduledJob, type SchemeNameOf, type SchemesOf, type SecurityRequirement, type SecurityScheme, type StreamBody, type StreamBodyOf, type StreamChunk, type StreamComment, type StreamContext, type StreamDefinition, type StreamMessage, type StreamMessageOf, type StreamMode, type StreamResponseDefinition, type StreamWithTools, type StreamYield, type StripProblemEnvelope, type TagKeysOf, type TagNamesOf, type TagOptions, type TagSet, type ThrowableReturn, type ToolAt, type ToolCall, type ToolCallMessage, type ToolCallRecord, type ToolCallState, type ToolError, type ToolEvents, type ToolKeys, type ToolResult, type ValidationError, type ValidationErrorFor, type ValidationIssueCode, apiEntries, assertCanonicalResourceUri, assertValidSchedule, authorizationServerIssuer, buildPath, buildProtectedResourceMetadata, createJobRunner, createJobTransport, createPlugin, cron, declaredScopes, defineConfig, dispatchDueJobs, dispatchSucceeded, dueJobs, dueSchedules, expandStreamTools, failedJobs, firesBetween, flattenJobs, getHeaderValue, getStatusText, isCompiledJob, isJobDefinition, isNamedStream, isPermissions, isProblemDetails, isRoles, isRouteDefinition, isSecurityScheme, isStreamResponse, isValidationError, isZodSchema, jobAt, jobFnAt, nextRun, nextRuns, parseCron, parsePath, problemDetails, problemFromBody, readToolCalls, routeStreams, scheduleExpression, scheduleTimezone, soleStreamResponse, streamContentType, streamMode, streamStatuses, toolEvents };
1050
+ export { AUTO_GUARD_BRAND, AUTO_GUARD_WRITTEN_BRAND, AUTO_RESPONSES_BRAND, type AnyPlugin, type Api, type ApiDefinition, type ApiEntry, type ApiImplementations, type ApiKeyCredential, type ApiPlugins, type ApiPluginsOf, type AuthCheck, type AuthContextOf, type AuthoredJobs, type AuthoredRouteDefinition, type AuthoredRoutes, type AutoResponsesBrand, type BasicCredential, type BearerCredential, type BrandedHandlerContext, type BuiltinIssueCode, type CachePolicy, type CatalogOf, type ClientTarget, type CodedIssue, type CompiledJob, type CompiledJobs, type ConfiguredApi, type ContextFromAuth, type ContextOf, type Credential, type CredentialOf, DECLARATION, type DeclarationKind, type DiffSettings, DispatchFailedSchema, type DispatchOptions, type DispatchOutcome, type DispatchResult, DispatchResultSchema, EVENT_STREAM_MEDIA_TYPE, type ExtractPathParams, type FlattenedJob, GUARD, type GrantNamesOf, type GrantsOf, type GuardAnswer, type GuardBody, type GuardFor, type GuardHoldings, type GuardOutput, type GuardReturn, type GuardSchemaOf, type GuardStatus, type GuardSuccess, HANDLER_CONTEXT_BRAND, type HandlerArgs, type HandlerContextBrand, type HandlerReturn, type HasPathParams, type Identity, type IdentityBuilder, type IdentityFactories, type IdentityNamesOf, type IdentityParamsOf, type IdentityRole, type IdentityWithGuard, type JobBuilder, type JobDefinition, type JobDescriptor, JobDispatchError, type JobErrorHandler, type JobFn, type JobFnByKey, type JobFnOf, type JobHandler, type JobHandlerArgs, type JobHandlerFor, type JobHandlerReturn, type JobHandlers, JobInputError, type JobMessage, type JobQueueArgs, type JobQueueOptions, type JobResponses, type JobRunArgs, type JobRunner, type JobRunnerOptions, type JobSchedule, type JobTransport, type JobTransportDefinition, type JobTransportSupports, type JobWithHandler, type JobWorker, type JobWorkerContext, type Jobs, type JobsArg, type JobsConfig, type JobsOf, type JobsOfTree, type K, Kizuna, type KizunaConfigInput, type KizunaConfigShape, type KizunaSpec, METHODS, type Method, type ModelOptions, type NoCredential, type NoJobs, type NormalizeTags, type OAuthFlow, type OAuthFlows, type OpenApiSecuritySchemeObject, type ParsedCron, type PathParamName, type PermissionCatalog, type PermissionName, type PermissionSet, type Permissions, type PluginArgs, type PluginDeclaration, type PluginDefinition, type PluginExportValues, type PluginExportsOf, type PluginList, type PluginPropsOf, type PluginRoutes, type PluginRoutesOf, type PluginsBySlug, type ProblemDetails, type ProtectedResourceConfig, type ProtectedResourceMetadata, RESOLVER, type RegisteredIssue, type RequestContextBuilder, type RequestContextHeaderInputs, type RequestContextHeaderValues, type RequestContextOf, type RequestContextSchema, type RequestContextWithHandler, type RequiredPermissions, type ResponseContentType, type ResponseDefinition, ResponseError, type RoleDefinition, type RoleNamesOf, type RoleOf, type Roles, type RolesOf, type RouteAuth, type RouteAuthCheck, type RouteAuthRule, type RouteAuthValue, type RouteBuilder, type RouteDefinition, type RouteHandlerFunction, type RoutePath, type RouteToolOptions, type RouteWithHandler, type Routes, type RoutesOf, type RoutesWithHandlerContext, STATUS_TITLES, type ScheduledJob, type SchemeNameOf, type SchemesOf, type SecurityRequirement, type SecurityScheme, type StreamBody, type StreamBodyOf, type StreamChunk, type StreamComment, type StreamContext, type StreamDefinition, type StreamMessage, type StreamMessageOf, type StreamMode, type StreamResponseDefinition, type StreamWithTools, type StreamYield, type StripProblemEnvelope, type TagKeysOf, type TagNamesOf, type TagOptions, type TagSet, type ThrowableReturn, type ToolAt, type ToolCall, type ToolCallMessage, type ToolCallRecord, type ToolCallState, type ToolError, type ToolEvents, type ToolKeys, type ToolResult, type ValidationError, type ValidationErrorFor, type ValidationIssueCode, apiEntries, assertCanonicalResourceUri, assertValidSchedule, authorizationServerIssuer, buildPath, buildProtectedResourceMetadata, createJobRunner, createJobTransport, createPlugin, cron, declaredScopes, defineConfig, dispatchDueJobs, dispatchSucceeded, dueJobs, dueSchedules, expandStreamTools, failedJobs, firesBetween, flattenJobs, getHeaderValue, getStatusText, isCompiledJob, isJobDefinition, isNamedStream, isPermissions, isProblemDetails, isRoles, isRouteDefinition, isSecurityScheme, isStreamResponse, isValidationError, isZodSchema, jobAt, jobFnAt, nextRun, nextRuns, parseCron, parsePath, problemDetails, problemFromBody, readToolCalls, routeStreams, scheduleExpression, scheduleTimezone, soleStreamResponse, streamContentType, streamMode, streamStatuses, toolEvents };
package/dist/index.d.mts CHANGED
@@ -856,6 +856,34 @@ interface ClientTarget {
856
856
  */
857
857
  readonly generate: (contract: ApiDefinition) => string;
858
858
  }
859
+ /**
860
+ * What else `kizuna diff` treats as breaking.
861
+ */
862
+ interface DiffSettings {
863
+ /**
864
+ * Report a renamed dotted key, such as `users.getUser` becoming
865
+ * `users.fetchUser`, as breaking. The key names the method on a generated
866
+ * client, so a rename breaks anyone shipping one as an SDK and leaves the
867
+ * HTTP surface untouched.
868
+ *
869
+ * @default false
870
+ */
871
+ dottedKeys?: boolean;
872
+ /**
873
+ * Report a job key that is gone. A job answers `POST /jobs/run` by its
874
+ * dotted key, so this matters once something outside your own code
875
+ * dispatches them.
876
+ *
877
+ * @default false
878
+ */
879
+ jobs?: boolean;
880
+ /**
881
+ * Report an MCP tool a model can no longer call.
882
+ *
883
+ * @default false
884
+ */
885
+ tools?: boolean;
886
+ }
859
887
  /**
860
888
  * What `kizuna.config.ts` default-exports: the api its config assembles, and
861
889
  * what is generated from it.
@@ -869,6 +897,10 @@ interface ApiEntry {
869
897
  typescript?: {
870
898
  outputFile?: string;
871
899
  };
900
+ /**
901
+ * What else `kizuna diff` treats as breaking.
902
+ */
903
+ diff?: DiffSettings;
872
904
  }
873
905
  /**
874
906
  * The config a `kizuna.config.ts` module default-exports. A repository serving
@@ -974,6 +1006,15 @@ type KizunaConfigInput<R extends Routes, J extends Jobs, P extends PluginList, T
974
1006
  * ],
975
1007
  */
976
1008
  clients?: readonly ClientTarget[];
1009
+ /**
1010
+ * What else `kizuna diff` treats as breaking.
1011
+ *
1012
+ * @example
1013
+ * diff: {
1014
+ * dottedKeys: true,
1015
+ * }
1016
+ */
1017
+ diff?: DiffSettings;
977
1018
  };
978
1019
  /**
979
1020
  * The api `defineConfig` assembles: the routes it declares, and the `mount`
@@ -1003,6 +1044,7 @@ declare const defineConfig: <const R extends Routes = Record<string, never>, con
1003
1044
  typescript: {
1004
1045
  outputFile?: string;
1005
1046
  } | undefined;
1047
+ diff: DiffSettings | undefined;
1006
1048
  };
1007
1049
  //#endregion
1008
- export { AUTO_GUARD_BRAND, AUTO_GUARD_WRITTEN_BRAND, AUTO_RESPONSES_BRAND, type AnyPlugin, type Api, type ApiDefinition, type ApiEntry, type ApiImplementations, type ApiKeyCredential, type ApiPlugins, type ApiPluginsOf, type AuthCheck, type AuthContextOf, type AuthoredJobs, type AuthoredRouteDefinition, type AuthoredRoutes, type AutoResponsesBrand, type BasicCredential, type BearerCredential, type BrandedHandlerContext, type BuiltinIssueCode, type CachePolicy, type CatalogOf, type ClientTarget, type CodedIssue, type CompiledJob, type CompiledJobs, type ConfiguredApi, type ContextFromAuth, type ContextOf, type Credential, type CredentialOf, DECLARATION, type DeclarationKind, DispatchFailedSchema, type DispatchOptions, type DispatchOutcome, type DispatchResult, DispatchResultSchema, EVENT_STREAM_MEDIA_TYPE, type ExtractPathParams, type FlattenedJob, GUARD, type GrantNamesOf, type GrantsOf, type GuardAnswer, type GuardBody, type GuardFor, type GuardHoldings, type GuardOutput, type GuardReturn, type GuardSchemaOf, type GuardStatus, type GuardSuccess, HANDLER_CONTEXT_BRAND, type HandlerArgs, type HandlerContextBrand, type HandlerReturn, type HasPathParams, type Identity, type IdentityBuilder, type IdentityFactories, type IdentityNamesOf, type IdentityParamsOf, type IdentityRole, type IdentityWithGuard, type JobBuilder, type JobDefinition, type JobDescriptor, JobDispatchError, type JobErrorHandler, type JobFn, type JobFnByKey, type JobFnOf, type JobHandler, type JobHandlerArgs, type JobHandlerFor, type JobHandlerReturn, type JobHandlers, JobInputError, type JobMessage, type JobQueueArgs, type JobQueueOptions, type JobResponses, type JobRunArgs, type JobRunner, type JobRunnerOptions, type JobSchedule, type JobTransport, type JobTransportDefinition, type JobTransportSupports, type JobWithHandler, type JobWorker, type JobWorkerContext, type Jobs, type JobsArg, type JobsConfig, type JobsOf, type JobsOfTree, type K, Kizuna, type KizunaConfigInput, type KizunaConfigShape, type KizunaSpec, METHODS, type Method, type ModelOptions, type NoCredential, type NoJobs, type NormalizeTags, type OAuthFlow, type OAuthFlows, type OpenApiSecuritySchemeObject, type ParsedCron, type PathParamName, type PermissionCatalog, type PermissionName, type PermissionSet, type Permissions, type PluginArgs, type PluginDeclaration, type PluginDefinition, type PluginExportValues, type PluginExportsOf, type PluginList, type PluginPropsOf, type PluginRoutes, type PluginRoutesOf, type PluginsBySlug, type ProblemDetails, type ProtectedResourceConfig, type ProtectedResourceMetadata, RESOLVER, type RegisteredIssue, type RequestContextBuilder, type RequestContextHeaderInputs, type RequestContextHeaderValues, type RequestContextOf, type RequestContextSchema, type RequestContextWithHandler, type RequiredPermissions, type ResponseContentType, type ResponseDefinition, ResponseError, type RoleDefinition, type RoleNamesOf, type RoleOf, type Roles, type RolesOf, type RouteAuth, type RouteAuthCheck, type RouteAuthRule, type RouteAuthValue, type RouteBuilder, type RouteDefinition, type RouteHandlerFunction, type RoutePath, type RouteToolOptions, type RouteWithHandler, type Routes, type RoutesOf, type RoutesWithHandlerContext, STATUS_TITLES, type ScheduledJob, type SchemeNameOf, type SchemesOf, type SecurityRequirement, type SecurityScheme, type StreamBody, type StreamBodyOf, type StreamChunk, type StreamComment, type StreamContext, type StreamDefinition, type StreamMessage, type StreamMessageOf, type StreamMode, type StreamResponseDefinition, type StreamWithTools, type StreamYield, type StripProblemEnvelope, type TagKeysOf, type TagNamesOf, type TagOptions, type TagSet, type ThrowableReturn, type ToolAt, type ToolCall, type ToolCallMessage, type ToolCallRecord, type ToolCallState, type ToolError, type ToolEvents, type ToolKeys, type ToolResult, type ValidationError, type ValidationErrorFor, type ValidationIssueCode, apiEntries, assertCanonicalResourceUri, assertValidSchedule, authorizationServerIssuer, buildPath, buildProtectedResourceMetadata, createJobRunner, createJobTransport, createPlugin, cron, declaredScopes, defineConfig, dispatchDueJobs, dispatchSucceeded, dueJobs, dueSchedules, expandStreamTools, failedJobs, firesBetween, flattenJobs, getHeaderValue, getStatusText, isCompiledJob, isJobDefinition, isNamedStream, isPermissions, isProblemDetails, isRoles, isRouteDefinition, isSecurityScheme, isStreamResponse, isValidationError, isZodSchema, jobAt, jobFnAt, nextRun, nextRuns, parseCron, parsePath, problemDetails, problemFromBody, readToolCalls, routeStreams, scheduleExpression, scheduleTimezone, soleStreamResponse, streamContentType, streamMode, streamStatuses, toolEvents };
1050
+ export { AUTO_GUARD_BRAND, AUTO_GUARD_WRITTEN_BRAND, AUTO_RESPONSES_BRAND, type AnyPlugin, type Api, type ApiDefinition, type ApiEntry, type ApiImplementations, type ApiKeyCredential, type ApiPlugins, type ApiPluginsOf, type AuthCheck, type AuthContextOf, type AuthoredJobs, type AuthoredRouteDefinition, type AuthoredRoutes, type AutoResponsesBrand, type BasicCredential, type BearerCredential, type BrandedHandlerContext, type BuiltinIssueCode, type CachePolicy, type CatalogOf, type ClientTarget, type CodedIssue, type CompiledJob, type CompiledJobs, type ConfiguredApi, type ContextFromAuth, type ContextOf, type Credential, type CredentialOf, DECLARATION, type DeclarationKind, type DiffSettings, DispatchFailedSchema, type DispatchOptions, type DispatchOutcome, type DispatchResult, DispatchResultSchema, EVENT_STREAM_MEDIA_TYPE, type ExtractPathParams, type FlattenedJob, GUARD, type GrantNamesOf, type GrantsOf, type GuardAnswer, type GuardBody, type GuardFor, type GuardHoldings, type GuardOutput, type GuardReturn, type GuardSchemaOf, type GuardStatus, type GuardSuccess, HANDLER_CONTEXT_BRAND, type HandlerArgs, type HandlerContextBrand, type HandlerReturn, type HasPathParams, type Identity, type IdentityBuilder, type IdentityFactories, type IdentityNamesOf, type IdentityParamsOf, type IdentityRole, type IdentityWithGuard, type JobBuilder, type JobDefinition, type JobDescriptor, JobDispatchError, type JobErrorHandler, type JobFn, type JobFnByKey, type JobFnOf, type JobHandler, type JobHandlerArgs, type JobHandlerFor, type JobHandlerReturn, type JobHandlers, JobInputError, type JobMessage, type JobQueueArgs, type JobQueueOptions, type JobResponses, type JobRunArgs, type JobRunner, type JobRunnerOptions, type JobSchedule, type JobTransport, type JobTransportDefinition, type JobTransportSupports, type JobWithHandler, type JobWorker, type JobWorkerContext, type Jobs, type JobsArg, type JobsConfig, type JobsOf, type JobsOfTree, type K, Kizuna, type KizunaConfigInput, type KizunaConfigShape, type KizunaSpec, METHODS, type Method, type ModelOptions, type NoCredential, type NoJobs, type NormalizeTags, type OAuthFlow, type OAuthFlows, type OpenApiSecuritySchemeObject, type ParsedCron, type PathParamName, type PermissionCatalog, type PermissionName, type PermissionSet, type Permissions, type PluginArgs, type PluginDeclaration, type PluginDefinition, type PluginExportValues, type PluginExportsOf, type PluginList, type PluginPropsOf, type PluginRoutes, type PluginRoutesOf, type PluginsBySlug, type ProblemDetails, type ProtectedResourceConfig, type ProtectedResourceMetadata, RESOLVER, type RegisteredIssue, type RequestContextBuilder, type RequestContextHeaderInputs, type RequestContextHeaderValues, type RequestContextOf, type RequestContextSchema, type RequestContextWithHandler, type RequiredPermissions, type ResponseContentType, type ResponseDefinition, ResponseError, type RoleDefinition, type RoleNamesOf, type RoleOf, type Roles, type RolesOf, type RouteAuth, type RouteAuthCheck, type RouteAuthRule, type RouteAuthValue, type RouteBuilder, type RouteDefinition, type RouteHandlerFunction, type RoutePath, type RouteToolOptions, type RouteWithHandler, type Routes, type RoutesOf, type RoutesWithHandlerContext, STATUS_TITLES, type ScheduledJob, type SchemeNameOf, type SchemesOf, type SecurityRequirement, type SecurityScheme, type StreamBody, type StreamBodyOf, type StreamChunk, type StreamComment, type StreamContext, type StreamDefinition, type StreamMessage, type StreamMessageOf, type StreamMode, type StreamResponseDefinition, type StreamWithTools, type StreamYield, type StripProblemEnvelope, type TagKeysOf, type TagNamesOf, type TagOptions, type TagSet, type ThrowableReturn, type ToolAt, type ToolCall, type ToolCallMessage, type ToolCallRecord, type ToolCallState, type ToolError, type ToolEvents, type ToolKeys, type ToolResult, type ValidationError, type ValidationErrorFor, type ValidationIssueCode, apiEntries, assertCanonicalResourceUri, assertValidSchedule, authorizationServerIssuer, buildPath, buildProtectedResourceMetadata, createJobRunner, createJobTransport, createPlugin, cron, declaredScopes, defineConfig, dispatchDueJobs, dispatchSucceeded, dueJobs, dueSchedules, expandStreamTools, failedJobs, firesBetween, flattenJobs, getHeaderValue, getStatusText, isCompiledJob, isJobDefinition, isNamedStream, isPermissions, isProblemDetails, isRoles, isRouteDefinition, isSecurityScheme, isStreamResponse, isValidationError, isZodSchema, jobAt, jobFnAt, nextRun, nextRuns, parseCron, parsePath, problemDetails, problemFromBody, readToolCalls, routeStreams, scheduleExpression, scheduleTimezone, soleStreamResponse, streamContentType, streamMode, streamStatuses, toolEvents };
package/dist/index.mjs CHANGED
@@ -577,6 +577,7 @@ const defineConfig = (options) => {
577
577
  onJobError: options.jobRunner?.onError
578
578
  }, options.adapter),
579
579
  clients: options.clients ?? [],
580
+ diff: options.diff,
580
581
  typescript: options.typescript
581
582
  };
582
583
  };
@@ -592,7 +593,8 @@ const apiEntries = (module) => {
592
593
  return [["default", {
593
594
  api: config.api,
594
595
  clients: config.clients ?? [],
595
- typescript: config.typescript
596
+ typescript: config.typescript,
597
+ diff: config.diff
596
598
  }]];
597
599
  };
598
600
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kizunajs",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.0-beta.5",
4
4
  "description": "Route declaration, validation, and the adapter API for Kizuna.js",
5
5
  "keywords": [
6
6
  "kizunajs",
package/src/config.ts CHANGED
@@ -22,6 +22,35 @@ export interface ClientTarget {
22
22
  readonly generate: (contract: ApiDefinition) => string;
23
23
  }
24
24
 
25
+ /**
26
+ * What else `kizuna diff` treats as breaking.
27
+ */
28
+ export interface DiffSettings {
29
+ /**
30
+ * Report a renamed dotted key, such as `users.getUser` becoming
31
+ * `users.fetchUser`, as breaking. The key names the method on a generated
32
+ * client, so a rename breaks anyone shipping one as an SDK and leaves the
33
+ * HTTP surface untouched.
34
+ *
35
+ * @default false
36
+ */
37
+ dottedKeys?: boolean;
38
+ /**
39
+ * Report a job key that is gone. A job answers `POST /jobs/run` by its
40
+ * dotted key, so this matters once something outside your own code
41
+ * dispatches them.
42
+ *
43
+ * @default false
44
+ */
45
+ jobs?: boolean;
46
+ /**
47
+ * Report an MCP tool a model can no longer call.
48
+ *
49
+ * @default false
50
+ */
51
+ tools?: boolean;
52
+ }
53
+
25
54
  /**
26
55
  * What `kizuna.config.ts` default-exports: the api its config assembles, and
27
56
  * what is generated from it.
@@ -35,6 +64,10 @@ export interface ApiEntry {
35
64
  typescript?: {
36
65
  outputFile?: string;
37
66
  };
67
+ /**
68
+ * What else `kizuna diff` treats as breaking.
69
+ */
70
+ diff?: DiffSettings;
38
71
  }
39
72
 
40
73
  /**
@@ -51,6 +84,7 @@ export const apiEntries = (module: Record<string, unknown>): [string, ApiEntry][
51
84
  api: config.api,
52
85
  clients: config.clients ?? [],
53
86
  typescript: config.typescript,
87
+ diff: config.diff,
54
88
  },
55
89
  ],
56
90
  ];
@@ -18,7 +18,7 @@ import { permissionNames } from './permissions.js';
18
18
  import { GUARD } from './identity-builder.js';
19
19
  import { RESOLVER } from './request-context-builder.js';
20
20
  import { buildApi, type Api } from './api.js';
21
- import type { ClientTarget } from './config.js';
21
+ import type { ClientTarget, DiffSettings } from './config.js';
22
22
 
23
23
  /**
24
24
  * Kizuna sends the guard body itself when a route's `requires` turns a caller
@@ -251,6 +251,15 @@ export type KizunaConfigInput<
251
251
  * ],
252
252
  */
253
253
  clients?: readonly ClientTarget[];
254
+ /**
255
+ * What else `kizuna diff` treats as breaking.
256
+ *
257
+ * @example
258
+ * diff: {
259
+ * dottedKeys: true,
260
+ * }
261
+ */
262
+ diff?: DiffSettings;
254
263
  };
255
264
 
256
265
  /**
@@ -321,6 +330,7 @@ export const defineConfig = <
321
330
  api: ConfiguredApi<R, J, P, Tags, Codes, Identities, RequestContext, GuardSchema, AdapterValue>;
322
331
  clients: readonly ClientTarget[];
323
332
  typescript: { outputFile?: string } | undefined;
333
+ diff: DiffSettings | undefined;
324
334
  } => {
325
335
  const guardSchema = options.auth?.guardSchema;
326
336
  if (guardSchema) assertFillableGuardSchema(guardSchema);
@@ -390,6 +400,7 @@ export const defineConfig = <
390
400
  return {
391
401
  api,
392
402
  clients: options.clients ?? [],
403
+ diff: options.diff,
393
404
  typescript: options.typescript,
394
405
  };
395
406
  };
package/src/index.ts CHANGED
@@ -240,7 +240,7 @@ export {
240
240
  } from './handler-pipeline.js';
241
241
  export { type HandlerContextBrand, HANDLER_CONTEXT_BRAND } from './types.js';
242
242
  export { type AutoResponsesBrand, AUTO_RESPONSES_BRAND, AUTO_GUARD_BRAND, AUTO_GUARD_WRITTEN_BRAND, type GuardStatus } from './types.js';
243
- export { apiEntries, type ApiEntry, type ClientTarget } from './config.js';
243
+ export { apiEntries, type ApiEntry, type ClientTarget, type DiffSettings } from './config.js';
244
244
  export { type AnyPlugin, type PluginList, type PluginsBySlug } from './plugin.js';
245
245
  export { RESOLVER, type RequestContextBuilder, type RequestContextWithHandler } from './request-context-builder.js';
246
246
  export { GUARD, type IdentityBuilder, type IdentityWithGuard, type GuardFor, type IdentityFactories } from './identity-builder.js';