@cosmicdrift/kumiko-types 0.369.0 → 0.371.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.
Files changed (39) hide show
  1. package/dist/action-icon.d.ts +1 -1
  2. package/dist/agent-exposure.d.ts +1 -1
  3. package/dist/config.d.ts +13 -13
  4. package/dist/cursor-types.d.ts +1 -1
  5. package/dist/define-handler.d.ts +3 -3
  6. package/dist/entity-cache.d.ts +1 -1
  7. package/dist/entity-handlers.d.ts +2 -2
  8. package/dist/entity-table-meta-types.d.ts +2 -2
  9. package/dist/envelope-cipher-types.d.ts +1 -1
  10. package/dist/event-store-executor-types.d.ts +7 -7
  11. package/dist/event-store-types.d.ts +1 -1
  12. package/dist/extension-options-map.d.ts +1 -1
  13. package/dist/feature.d.ts +24 -17
  14. package/dist/fields.d.ts +4 -4
  15. package/dist/file-provider-resolver-types.d.ts +2 -2
  16. package/dist/handlers.d.ts +33 -33
  17. package/dist/hooks.d.ts +7 -7
  18. package/dist/http-route.d.ts +2 -2
  19. package/dist/kms-adapter-types.d.ts +1 -1
  20. package/dist/multi-stream-apply-context-types.d.ts +7 -7
  21. package/dist/nav.d.ts +5 -5
  22. package/dist/observability/index.d.ts +3 -3
  23. package/dist/observability/provider.d.ts +2 -2
  24. package/dist/ownership.d.ts +1 -1
  25. package/dist/projection.d.ts +6 -6
  26. package/dist/rate-limit-types.d.ts +1 -1
  27. package/dist/schema-table-types.d.ts +1 -1
  28. package/dist/screen.d.ts +6 -6
  29. package/dist/search-adapter.d.ts +1 -1
  30. package/dist/secrets-types.d.ts +2 -2
  31. package/dist/snapshot-types.d.ts +1 -1
  32. package/dist/step.d.ts +7 -7
  33. package/dist/tenant-db-types.d.ts +8 -8
  34. package/dist/tree-node.d.ts +1 -1
  35. package/dist/tz-context.d.ts +1 -1
  36. package/dist/websocket-route.d.ts +1 -1
  37. package/dist/workspace.d.ts +1 -1
  38. package/package.json +1 -1
  39. package/src/changes.json +7 -0
@@ -1,3 +1,3 @@
1
- import type { IconKey } from "./nav-icon.js";
1
+ import type { IconKey } from "./nav-icon.ts";
2
2
  export declare const ACTION_ICON_BY_ID: Readonly<Partial<Record<string, IconKey>>>;
3
3
  export declare function resolveActionIcon(id: string, declared?: IconKey): IconKey | undefined;
@@ -1,4 +1,4 @@
1
- import type { AgentExposure, AgentHandlerHints, AgentScreenHints } from "./handlers.js";
1
+ import type { AgentExposure, AgentHandlerHints, AgentScreenHints } from "./handlers.ts";
2
2
  /** Fail-closed: a handler without a `description` stays invisible to the agent
3
3
  * unless it opts in explicitly. `kind` is a parameter because write and query
4
4
  * handler definitions are structurally indistinguishable at runtime. */
package/dist/config.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import type { ZodType } from "zod";
2
- import type { ConcurrencyMode } from "./concurrency-mode.js";
3
- import type { ConfigScope } from "./config-scope.js";
4
- import type { DbConnection } from "./db-connection.js";
5
- import type { FieldDefinition, OptionsQueryPayload } from "./fields.js";
6
- import type { EscapeHatchDeclaration, JobContext } from "./handlers.js";
7
- import type { PostDeleteHookFn, PostSaveHookFn, PreDeleteHookFn, PreQueryHookFn, PreSaveHookFn } from "./hooks.js";
8
- import type { TenantId } from "./identifiers.js";
9
- import type { NavIconKey } from "./nav-icon.js";
10
- import type { DashboardCustomPanel, DashboardScreenPanel } from "./screen.js";
11
- import type { TenantDb } from "./tenant-db-types.js";
2
+ import type { ConcurrencyMode } from "./concurrency-mode.ts";
3
+ import type { ConfigScope } from "./config-scope.ts";
4
+ import type { DbConnection } from "./db-connection.ts";
5
+ import type { FieldDefinition, OptionsQueryPayload } from "./fields.ts";
6
+ import type { EscapeHatchDeclaration, JobContext } from "./handlers.ts";
7
+ import type { PostDeleteHookFn, PostSaveHookFn, PreDeleteHookFn, PreQueryHookFn, PreSaveHookFn } from "./hooks.ts";
8
+ import type { TenantId } from "./identifiers.ts";
9
+ import type { NavIconKey } from "./nav-icon.ts";
10
+ import type { DashboardCustomPanel, DashboardScreenPanel } from "./screen.ts";
11
+ import type { TenantDb } from "./tenant-db-types.ts";
12
12
  export type ConfigKeyAccess = {
13
13
  readonly read: readonly string[];
14
14
  readonly write: readonly string[];
@@ -141,7 +141,7 @@ export type RunIn = "api" | "worker" | "both";
141
141
  export type JobRunIn = Exclude<RunIn, "both">;
142
142
  export type JobHandlerFn = (payload: Record<string, unknown>, context: JobContext) => Promise<void>;
143
143
  export type JobTrigger = {
144
- readonly on: import("./handlers.js").NameOrRef | readonly import("./handlers.js").NameOrRef[];
144
+ readonly on: import("./handlers.ts").NameOrRef | readonly import("./handlers.ts").NameOrRef[];
145
145
  readonly where?: Readonly<Record<string, string | number | boolean>>;
146
146
  } | {
147
147
  readonly cron: string;
@@ -183,10 +183,10 @@ export type JobDefinition = {
183
183
  readonly subjectFields?: readonly string[] | undefined;
184
184
  } | undefined;
185
185
  };
186
- export type NotificationRecipientFn = (result: import("./hooks.js").SaveContext) => string | readonly string[] | {
186
+ export type NotificationRecipientFn = (result: import("./hooks.ts").SaveContext) => string | readonly string[] | {
187
187
  readonly tenant: string;
188
188
  } | null;
189
- export type NotificationDataFn = (result: import("./hooks.js").SaveContext) => Record<string, unknown>;
189
+ export type NotificationDataFn = (result: import("./hooks.ts").SaveContext) => Record<string, unknown>;
190
190
  export type NotificationTemplateFn = (data: Record<string, unknown>) => Record<string, unknown>;
191
191
  type TemplateVariableCommon = {
192
192
  readonly label?: string;
@@ -1,4 +1,4 @@
1
- import type { EntityId, TenantId } from "./identifiers.js";
1
+ import type { EntityId, TenantId } from "./identifiers.ts";
2
2
  export type CursorQueryOptions = {
3
3
  tenantId: TenantId;
4
4
  cursor?: string;
@@ -1,8 +1,8 @@
1
1
  import type * as z from "zod";
2
2
  import type { ZodType } from "zod";
3
- import type { KumikoEventTypeMap } from "./event-type-map.js";
4
- import type { AccessRule, AgentHandlerHints, BeforeTransactionPhase, EscapeHatchDeclaration, HandlerContext, PayloadRateLimitOption, PreparedWriteEvent, PreTransactionReservation, QueryEvent, RateLimitDeclaration, WriteHandlerTransactionMode, WriteResult } from "./handlers.js";
5
- import type { PipelineDef } from "./step.js";
3
+ import type { KumikoEventTypeMap } from "./event-type-map.ts";
4
+ import type { AccessRule, AgentHandlerHints, BeforeTransactionPhase, EscapeHatchDeclaration, HandlerContext, PayloadRateLimitOption, PreparedWriteEvent, PreTransactionReservation, QueryEvent, RateLimitDeclaration, WriteHandlerTransactionMode, WriteResult } from "./handlers.ts";
5
+ import type { PipelineDef } from "./step.ts";
6
6
  export type WriteHandlerDefinition<TName extends string = string, TSchema extends ZodType = ZodType, TData = unknown, TMap extends object = KumikoEventTypeMap, TPrepared = undefined> = {
7
7
  readonly name: TName;
8
8
  readonly schema: TSchema;
@@ -1,4 +1,4 @@
1
- import type { EntityId, TenantId } from "./identifiers.js";
1
+ import type { EntityId, TenantId } from "./identifiers.ts";
2
2
  export type EntityCache = {
3
3
  /** Get a single cached entity. Returns null on miss. */
4
4
  get(tenantId: TenantId, entityName: string, id: EntityId): Promise<Record<string, unknown> | null>;
@@ -1,5 +1,5 @@
1
- import type { EntityDefinition } from "./fields.js";
2
- import type { AccessRule, AgentHandlerHints, EscapeHatchDeclaration, QueryHandlerDef, WriteHandlerDef } from "./handlers.js";
1
+ import type { EntityDefinition } from "./fields.ts";
2
+ import type { AccessRule, AgentHandlerHints, EscapeHatchDeclaration, QueryHandlerDef, WriteHandlerDef } from "./handlers.ts";
3
3
  export type EntityHandlerOptions = {
4
4
  readonly access: AccessRule;
5
5
  readonly description?: string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
- import type { EntityRelations } from "./relations.js";
3
- import type { EntityTenancy } from "./tenancy-brand.js";
2
+ import type { EntityRelations } from "./relations.ts";
3
+ import type { EntityTenancy } from "./tenancy-brand.ts";
4
4
  export type PgType = "uuid" | "text" | "boolean" | "integer" | "double precision" | "bigint" | "serial" | "bigserial" | "jsonb" | "timestamptz" | "timestamptz(3)" | "date" | `numeric(${number},${number})`;
5
5
  export type ColumnMeta = {
6
6
  readonly name: string;
@@ -1,4 +1,4 @@
1
- import type { KeyScope } from "./secrets-types.js";
1
+ import type { KeyScope } from "./secrets-types.ts";
2
2
  export type EnvelopeCipher = {
3
3
  encrypt(plaintext: string, scope?: KeyScope): Promise<string>;
4
4
  decrypt(stored: string, scope?: KeyScope): Promise<string>;
@@ -1,10 +1,10 @@
1
- import type { CursorResult } from "./cursor-types.js";
2
- import type { EntityDefinition } from "./fields.js";
3
- import type { SessionUser, WriteResult } from "./handlers.js";
4
- import type { DeleteContext, SaveContext } from "./hooks.js";
5
- import type { EntityId, TenantId } from "./identifiers.js";
6
- import type { SearchAdapter } from "./search-adapter.js";
7
- import type { TenantDb } from "./tenant-db-types.js";
1
+ import type { CursorResult } from "./cursor-types.ts";
2
+ import type { EntityDefinition } from "./fields.ts";
3
+ import type { SessionUser, WriteResult } from "./handlers.ts";
4
+ import type { DeleteContext, SaveContext } from "./hooks.ts";
5
+ import type { EntityId, TenantId } from "./identifiers.ts";
6
+ import type { SearchAdapter } from "./search-adapter.ts";
7
+ import type { TenantDb } from "./tenant-db-types.ts";
8
8
  export type ParentVisibilityOption = {
9
9
  readonly entities: ReadonlyMap<string, EntityDefinition>;
10
10
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
- import type { TenantId } from "./identifiers.js";
2
+ import type { TenantId } from "./identifiers.ts";
3
3
  export interface VersionConflict extends Error {
4
4
  readonly aggregateId: string;
5
5
  readonly expectedVersion: number;
@@ -1,4 +1,4 @@
1
- import type { EscapeHatchDeclaration } from "./handlers.js";
1
+ import type { EscapeHatchDeclaration } from "./handlers.ts";
2
2
  export interface KumikoExtensionOptionsMap {
3
3
  }
4
4
  /** Options shape for an extension name: the augmented hook shape plus `escapeHatch`, or an untyped bag if unaugmented. */
package/dist/feature.d.ts CHANGED
@@ -1,22 +1,22 @@
1
1
  import type * as z from "zod";
2
2
  import type { ZodType } from "zod";
3
- import type { ConfigKeyDefinition, ConfigKeyHandle, ConfigKeyType, ConfigSeedDef, ExtensionSelectorDef, ExtensionSelectorPanel, JobDefinition, JobHandlerFn, NotificationDataFn, NotificationDefinition, NotificationLocalizedTemplate, NotificationRecipientFn, NotificationRecordMapping, NotificationTemplateBody, NotificationTemplateFn, NotificationTemplateMeta, ReferenceDataDef, RegistrarExtensionDef, RegistrarExtensionRegistration, TemplateVariables, TranslationKeys, TranslationsDef } from "./config.js";
4
- import type { QueryHandlerDefinition, StreamHandlerDefinition, WriteHandlerDefinition } from "./define-handler.js";
5
- import type { RegisterEntityCrudOptions } from "./entity-handlers.js";
6
- import type { EntityTableMeta } from "./entity-table-meta-types.js";
7
- import type { KumikoEventTypeMap } from "./event-type-map.js";
8
- import type { ExtensionOptionsArgs, ExtensionOptionsFor } from "./extension-options-map.js";
9
- import type { EntityDefinition } from "./fields.js";
10
- import type { AccessRule, AuthClaimsFn, AuthClaimsHookDef, ClaimKeyDefinition, ClaimKeyHandle, ClaimKeyType, DeclarativeEventMigration, EntityRef, EscapeHatchDeclaration, EventDef, EventMigrationDef, EventPiiStance, EventUpcastFn, HandlerRef, NameOrRef, QualifiedEventName, QueryHandlerDef, RateLimitDeclaration, StreamHandlerDef, StreamHandlerFn, WriteHandlerDef } from "./handlers.js";
11
- import type { EntityHookMap, HookMap, HookPhase, OwnedFn, PostDeleteHookFn, PostQueryHookFn, PostSaveHookFn, PreDeleteHookFn, PreQueryHookFn, PreSaveHookFn, SearchPayloadContributorFn, ValidationHookFn } from "./hooks.js";
12
- import type { HttpRouteDefinition } from "./http-route.js";
13
- import type { ContentCollectionDefinition, NavDefinition } from "./nav.js";
14
- import type { EntityProjectionExtension, MultiStreamProjectionDefinition, ProjectionDefinition } from "./projection.js";
15
- import type { EntityRelations, RelationDefinition } from "./relations.js";
16
- import type { ScreenDefinition } from "./screen.js";
17
- import type { TreeActionDef, TreeActionsHandle } from "./tree-node.js";
18
- import type { WebSocketRouteDefinition } from "./websocket-route.js";
19
- import type { WorkspaceDefinition } from "./workspace.js";
3
+ import type { ConfigKeyDefinition, ConfigKeyHandle, ConfigKeyType, ConfigSeedDef, ExtensionSelectorDef, ExtensionSelectorPanel, JobDefinition, JobHandlerFn, NotificationDataFn, NotificationDefinition, NotificationLocalizedTemplate, NotificationRecipientFn, NotificationRecordMapping, NotificationTemplateBody, NotificationTemplateFn, NotificationTemplateMeta, ReferenceDataDef, RegistrarExtensionDef, RegistrarExtensionRegistration, TemplateVariables, TranslationKeys, TranslationsDef } from "./config.ts";
4
+ import type { QueryHandlerDefinition, StreamHandlerDefinition, WriteHandlerDefinition } from "./define-handler.ts";
5
+ import type { RegisterEntityCrudOptions } from "./entity-handlers.ts";
6
+ import type { EntityTableMeta } from "./entity-table-meta-types.ts";
7
+ import type { KumikoEventTypeMap } from "./event-type-map.ts";
8
+ import type { ExtensionOptionsArgs, ExtensionOptionsFor } from "./extension-options-map.ts";
9
+ import type { EntityDefinition } from "./fields.ts";
10
+ import type { AccessRule, AuthClaimsFn, AuthClaimsHookDef, ClaimKeyDefinition, ClaimKeyHandle, ClaimKeyType, DeclarativeEventMigration, EntityRef, EscapeHatchDeclaration, EventDef, EventMigrationDef, EventPiiStance, EventUpcastFn, HandlerRef, NameOrRef, QualifiedEventName, QueryHandlerDef, RateLimitDeclaration, StreamHandlerDef, StreamHandlerFn, WriteHandlerDef } from "./handlers.ts";
11
+ import type { EntityHookMap, HookMap, HookPhase, OwnedFn, PostDeleteHookFn, PostQueryHookFn, PostSaveHookFn, PreDeleteHookFn, PreQueryHookFn, PreSaveHookFn, SearchPayloadContributorFn, ValidationHookFn } from "./hooks.ts";
12
+ import type { HttpRouteDefinition } from "./http-route.ts";
13
+ import type { ContentCollectionDefinition, NavDefinition } from "./nav.ts";
14
+ import type { EntityProjectionExtension, MultiStreamProjectionDefinition, ProjectionDefinition } from "./projection.ts";
15
+ import type { EntityRelations, RelationDefinition } from "./relations.ts";
16
+ import type { ScreenDefinition } from "./screen.ts";
17
+ import type { TreeActionDef, TreeActionsHandle } from "./tree-node.ts";
18
+ import type { WebSocketRouteDefinition } from "./websocket-route.ts";
19
+ import type { WorkspaceDefinition } from "./workspace.ts";
20
20
  export type FeatureMetricType = "counter" | "histogram" | "gauge";
21
21
  export type FeatureMetricDef = {
22
22
  readonly shortName: string;
@@ -115,6 +115,12 @@ export type BootCheckContext = {
115
115
  readonly features: readonly FeatureDefinition[];
116
116
  };
117
117
  export type BootCheckFn = (ctx: BootCheckContext) => void;
118
+ /** runProdApp options a stack can depend on; runProdApp checks the set at boot. */
119
+ export type BootOptionName = "mail" | "kmsMode" | "fileStorage" | "billing" | "demoMode" | "seeds" | "signals" | "rateLimit";
120
+ export type StackBootRequirement = {
121
+ readonly stack: string;
122
+ readonly options: readonly BootOptionName[];
123
+ };
118
124
  export type FeatureDefinition = {
119
125
  readonly name: string;
120
126
  readonly description?: string;
@@ -164,6 +170,7 @@ export type FeatureDefinition = {
164
170
  * feature-authored message (framework wraps it with `[Feature <name>]`).
165
171
  */
166
172
  readonly bootChecks: readonly BootCheckFn[];
173
+ readonly bootRequires?: StackBootRequirement;
167
174
  readonly referenceData: readonly ReferenceDataDef[];
168
175
  readonly notifications: Readonly<Record<string, NotificationDefinition>>;
169
176
  readonly events: Readonly<Record<string, EventDef>>;
package/dist/fields.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
- import type { VariantSpec } from "./derivatives-types.js";
3
- import type { EventUpcastCtx } from "./handlers.js";
4
- import type { OwnershipMap } from "./ownership.js";
5
- import type { EntityTenancy } from "./tenancy-brand.js";
2
+ import type { VariantSpec } from "./derivatives-types.ts";
3
+ import type { EventUpcastCtx } from "./handlers.ts";
4
+ import type { OwnershipMap } from "./ownership.ts";
5
+ import type { EntityTenancy } from "./tenancy-brand.ts";
6
6
  export type FieldAccess = {
7
7
  readonly read?: OwnershipMap | readonly string[];
8
8
  readonly write?: OwnershipMap | readonly string[];
@@ -1,3 +1,3 @@
1
- import type { FileStorageProvider } from "./file-storage-provider-types.js";
2
- import type { TenantId } from "./identifiers.js";
1
+ import type { FileStorageProvider } from "./file-storage-provider-types.ts";
2
+ import type { TenantId } from "./identifiers.ts";
3
3
  export type FileProviderResolver = (tenantId: TenantId) => Promise<FileStorageProvider>;
@@ -1,21 +1,21 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
2
  import type { Redis } from "ioredis";
3
3
  import type { ZodType } from "zod";
4
- import type { CacheSyncBus } from "./cache-sync-types.js";
5
- import type { ConfigAccessor, ConfigAccessorFactory, ConfigResolver } from "./config.js";
6
- import type { DbConnection, DbTx } from "./db-connection.js";
7
- import type { DerivativesContext } from "./derivatives-types.js";
8
- import type { EntityCache } from "./entity-cache.js";
9
- import type { EventMetadata, WriteOrigin } from "./event-store-types.js";
10
- import type { KumikoEventTypeMap } from "./event-type-map.js";
11
- import type { FileContext } from "./file-handle-types.js";
12
- import type { FileProviderResolver } from "./file-provider-resolver-types.js";
13
- import type { GeoTzProvider } from "./geo-tz.js";
14
- import type { Logger } from "./logger.js";
15
- import type { Meter, MetricsHandle, Tracer } from "./observability/index.js";
16
- import type { SearchAdapter } from "./search-adapter.js";
17
- import type { CrossTenantReads, TenantDb } from "./tenant-db-types.js";
18
- import type { Clock, TzContext } from "./tz-context.js";
4
+ import type { CacheSyncBus } from "./cache-sync-types.ts";
5
+ import type { ConfigAccessor, ConfigAccessorFactory, ConfigResolver } from "./config.ts";
6
+ import type { DbConnection, DbTx } from "./db-connection.ts";
7
+ import type { DerivativesContext } from "./derivatives-types.ts";
8
+ import type { EntityCache } from "./entity-cache.ts";
9
+ import type { EventMetadata, WriteOrigin } from "./event-store-types.ts";
10
+ import type { KumikoEventTypeMap } from "./event-type-map.ts";
11
+ import type { FileContext } from "./file-handle-types.ts";
12
+ import type { FileProviderResolver } from "./file-provider-resolver-types.ts";
13
+ import type { GeoTzProvider } from "./geo-tz.ts";
14
+ import type { Logger } from "./logger.ts";
15
+ import type { Meter, MetricsHandle, Tracer } from "./observability/index.ts";
16
+ import type { SearchAdapter } from "./search-adapter.ts";
17
+ import type { CrossTenantReads, TenantDb } from "./tenant-db-types.ts";
18
+ import type { Clock, TzContext } from "./tz-context.ts";
19
19
  export type OpenToAllPersonalData = "tenant-members";
20
20
  export type OpenToAllDeclaration = {
21
21
  readonly reason: string;
@@ -72,7 +72,7 @@ export type ClaimKeyHandle<T extends ClaimKeyType = ClaimKeyType> = {
72
72
  readonly type: T;
73
73
  };
74
74
  export type AuthClaimsContext = {
75
- readonly db: import("./tenant-db-types.js").TenantDb;
75
+ readonly db: import("./tenant-db-types.ts").TenantDb;
76
76
  readonly queryAs: (user: SessionUser, qn: string, payload: unknown) => Promise<unknown>;
77
77
  readonly config?: ConfigAccessor;
78
78
  };
@@ -112,14 +112,14 @@ export type QueryEvent<TPayload = unknown> = {
112
112
  readonly payload: TPayload;
113
113
  readonly user: SessionUser;
114
114
  };
115
- import type { WriteFailure } from "./write-error-info-types.js";
115
+ import type { WriteFailure } from "./write-error-info-types.ts";
116
116
  export type WriteResult<TData = unknown> = {
117
117
  readonly isSuccess: true;
118
118
  readonly data: TData;
119
119
  } | WriteFailure;
120
- import type { Registry } from "./feature.js";
121
- import type { TenantId } from "./identifiers.js";
122
- import type { UncheckedSystemDb } from "./tenant-db-types.js";
120
+ import type { Registry } from "./feature.ts";
121
+ import type { TenantId } from "./identifiers.ts";
122
+ import type { UncheckedSystemDb } from "./tenant-db-types.ts";
123
123
  export type MemberReader = (userId: string, qn: string, payload: unknown) => Promise<unknown>;
124
124
  export type JobTriggerEvent = {
125
125
  readonly id: string;
@@ -231,8 +231,8 @@ type SharedContextFields = {
231
231
  */
232
232
  readonly forTenant?: (tenantId: TenantId) => TenantWriteTarget;
233
233
  readonly _configAccessorFactory?: ConfigAccessorFactory;
234
- readonly configEncryption?: import("./envelope-cipher-types.js").EnvelopeCipher;
235
- readonly rateLimit?: import("./rate-limit-types.js").RateLimitResolver;
234
+ readonly configEncryption?: import("./envelope-cipher-types.ts").EnvelopeCipher;
235
+ readonly rateLimit?: import("./rate-limit-types.ts").RateLimitResolver;
236
236
  readonly _rateLimitPayloadDigest?: (value: string) => string;
237
237
  readonly searchAdapter?: SearchAdapter;
238
238
  readonly files?: FileContext;
@@ -244,9 +244,9 @@ type SharedContextFields = {
244
244
  readonly _notifyInTransactionFactory?: (user: SessionUser, tenantId: TenantId) => NotifyFn;
245
245
  readonly _notifyAfterCommitFactory?: (user: SessionUser, tenantId: TenantId) => NotifyFn;
246
246
  readonly _escapeHatchAuditSink?: EscapeHatchAuditSink;
247
- readonly secrets?: import("./secrets-types.js").SecretsContext;
248
- readonly masterKeyProvider?: import("./secrets-types.js").MasterKeyProvider;
249
- readonly kms?: import("./kms-adapter-types.js").KmsAdapter;
247
+ readonly secrets?: import("./secrets-types.ts").SecretsContext;
248
+ readonly masterKeyProvider?: import("./secrets-types.ts").MasterKeyProvider;
249
+ readonly kms?: import("./kms-adapter-types.ts").KmsAdapter;
250
250
  readonly tracer?: Tracer;
251
251
  readonly meter?: Meter;
252
252
  readonly signal?: AbortSignal;
@@ -326,7 +326,7 @@ export type HandlerContext<TMap extends object = KumikoEventTypeMap> = SharedCon
326
326
  readonly fetchForWriting: (args: FetchForWritingArgs) => Promise<AggregateStreamHandle>;
327
327
  readonly loadAggregate: (aggregateId: string, options?: {
328
328
  readonly asOf?: Temporal.Instant;
329
- }) => Promise<readonly import("./event-store-types.js").StoredEvent[]>;
329
+ }) => Promise<readonly import("./event-store-types.ts").StoredEvent[]>;
330
330
  readonly archiveStream: (aggregateId: string, args: {
331
331
  readonly aggregateType: string;
332
332
  readonly reason?: string;
@@ -340,7 +340,7 @@ export type HandlerContext<TMap extends object = KumikoEventTypeMap> = SharedCon
340
340
  readonly state: Record<string, unknown>;
341
341
  readonly snapshotVersion?: number;
342
342
  }) => Promise<void>;
343
- readonly loadAggregateWithSnapshot: <TState extends Record<string, unknown>>(aggregateId: string, reducer: import("./snapshot-types.js").SnapshotReducer<TState>, initial: TState, options?: Omit<import("./snapshot-types.js").LoadAggregateWithSnapshotOptions, "upcastEvent">) => Promise<import("./snapshot-types.js").LoadAggregateWithSnapshotResult<TState>>;
343
+ readonly loadAggregateWithSnapshot: <TState extends Record<string, unknown>>(aggregateId: string, reducer: import("./snapshot-types.ts").SnapshotReducer<TState>, initial: TState, options?: Omit<import("./snapshot-types.ts").LoadAggregateWithSnapshotOptions, "upcastEvent">) => Promise<import("./snapshot-types.ts").LoadAggregateWithSnapshotResult<TState>>;
344
344
  readonly queryProjection: <T = Record<string, unknown>>(qualifiedName: string, options?: {
345
345
  readonly unsafeAllTenants?: boolean;
346
346
  }) => Promise<readonly T[]>;
@@ -467,10 +467,10 @@ export type AppendEventFn<TMap extends object = KumikoEventTypeMap> = <K extends
467
467
  export type UnsafeAppendEventFn = (args: AppendEventArgs) => Promise<void>;
468
468
  export type TryAppendEventResult = {
469
469
  readonly ok: true;
470
- readonly event: import("./event-store-types.js").StoredEvent;
470
+ readonly event: import("./event-store-types.ts").StoredEvent;
471
471
  } | {
472
472
  readonly ok: false;
473
- readonly conflict: import("./event-store-types.js").VersionConflict;
473
+ readonly conflict: import("./event-store-types.ts").VersionConflict;
474
474
  };
475
475
  export type TryAppendEventFn = (args: AppendEventArgs) => Promise<TryAppendEventResult>;
476
476
  export type FetchForWritingArgs = {
@@ -479,7 +479,7 @@ export type FetchForWritingArgs = {
479
479
  readonly expectedVersion?: number;
480
480
  };
481
481
  export type AggregateStreamHandle = {
482
- readonly events: readonly import("./event-store-types.js").StoredEvent[];
482
+ readonly events: readonly import("./event-store-types.ts").StoredEvent[];
483
483
  readonly version: number;
484
484
  readonly appendOne: (args: {
485
485
  readonly type: string;
@@ -488,8 +488,8 @@ export type AggregateStreamHandle = {
488
488
  readonly hasEvent: (type: string) => boolean;
489
489
  };
490
490
  export type EventUpcastCtx = {
491
- readonly db: import("./db-connection.js").DbRunner;
492
- readonly tenantId: import("./identifiers.js").TenantId;
491
+ readonly db: import("./db-connection.ts").DbRunner;
492
+ readonly tenantId: import("./identifiers.ts").TenantId;
493
493
  };
494
494
  export type EventUpcastFn = (payload: unknown, ctx: EventUpcastCtx) => unknown | Promise<unknown>;
495
495
  export type DeclarativeEventMigration = {
@@ -614,7 +614,7 @@ export type WriteHandlerDef = {
614
614
  * SYSTEM_TENANT_ID when the host resolves no tenant. Boot requires
615
615
  * `access.roles: ["anonymous"]` and a real `rateLimit`. */
616
616
  readonly tenantlessAnonymous?: boolean;
617
- readonly perform?: import("./step.js").PipelineDef;
617
+ readonly perform?: import("./step.ts").PipelineDef;
618
618
  };
619
619
  export declare const ENTITY_CONVENTION_QUERY_BRAND = "__kumikoEntityConventionQuery";
620
620
  export type QueryHandlerDef = {
package/dist/hooks.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import type { StoredEvent } from "./event-store-types.js";
2
- import type { AppContext } from "./handlers.js";
3
- import type { HookPhase } from "./hook-phase.js";
4
- import type { EntityId } from "./identifiers.js";
1
+ import type { StoredEvent } from "./event-store-types.ts";
2
+ import type { AppContext } from "./handlers.ts";
3
+ import type { HookPhase } from "./hook-phase.ts";
4
+ import type { EntityId } from "./identifiers.ts";
5
5
  export type ValidationError = {
6
6
  readonly field: string;
7
7
  readonly error: string;
@@ -15,14 +15,14 @@ export type SaveContext = {
15
15
  readonly previous: Readonly<Record<string, unknown>>;
16
16
  readonly isNew: boolean;
17
17
  readonly entityName?: string | undefined;
18
- readonly event?: StoredEvent | undefined;
18
+ readonly event: StoredEvent;
19
19
  };
20
20
  export type DeleteContext = {
21
21
  readonly kind: "delete";
22
22
  readonly id: EntityId;
23
23
  readonly data: Readonly<Record<string, unknown>>;
24
24
  readonly entityName?: string | undefined;
25
- readonly event?: StoredEvent | undefined;
25
+ readonly event: StoredEvent;
26
26
  readonly lockGuardBypassed?: boolean | undefined;
27
27
  };
28
28
  export type LifecycleResult = SaveContext | DeleteContext;
@@ -43,7 +43,7 @@ export type PostQueryHookFn = (result: {
43
43
  rows: ReadonlyArray<Record<string, unknown>>;
44
44
  }>;
45
45
  export type LifecycleHookFn = PreSaveHookFn | PostSaveHookFn | PreDeleteHookFn | PostDeleteHookFn | PreQueryHookFn | PostQueryHookFn;
46
- export type { HookPhase } from "./hook-phase.js";
46
+ export type { HookPhase } from "./hook-phase.ts";
47
47
  export type HookOwner = {
48
48
  readonly featureName?: string;
49
49
  };
@@ -1,5 +1,5 @@
1
1
  import type { Context } from "hono";
2
- import type { RateLimitOption } from "./handlers.js";
2
+ import type { RateLimitOption } from "./handlers.ts";
3
3
  /** Subset von HTTP-Methoden den wir aktiv unterstützen. Hono spricht
4
4
  * alle, aber das hier sind die einzigen die ein Feature-Author
5
5
  * realistisch deklariert. */
@@ -28,7 +28,7 @@ export type HttpRouteHandlerDeps = {
28
28
  * an internal X-Tenant header on `app.fetch(...)` is indistinguishable
29
29
  * from an external client and gets rejected by resolverTrust:
30
30
  * "authoritative" anonymousAccess configs (see auth-middleware.ts). */
31
- readonly systemQuery: (type: string, payload: unknown, tenantId: import("./identifiers.js").TenantId) => Promise<unknown>;
31
+ readonly systemQuery: (type: string, payload: unknown, tenantId: import("./identifiers.ts").TenantId) => Promise<unknown>;
32
32
  /** Caller IP resolved via the server's configured, trustedProxyHops-aware
33
33
  * resolver (same one requestIdMiddleware uses for `/api/*`) — a route
34
34
  * handler needing the caller's IP (rate limiting, audit) should read
@@ -1,4 +1,4 @@
1
- import type { TenantId } from "./identifiers.js";
1
+ import type { TenantId } from "./identifiers.ts";
2
2
  export type SubjectId = {
3
3
  readonly kind: "user";
4
4
  readonly userId: string;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
- import type { DerivativesContext } from "./derivatives-types.js";
3
- import type { StoredEvent } from "./event-store-types.js";
4
- import type { KumikoEventTypeMap } from "./event-type-map.js";
5
- import type { Registry } from "./feature.js";
6
- import type { FileContext } from "./file-handle-types.js";
7
- import type { AppendEventFn, UnsafeAppendEventFn } from "./handlers.js";
8
- import type { SecretsContext } from "./secrets-types.js";
2
+ import type { DerivativesContext } from "./derivatives-types.ts";
3
+ import type { StoredEvent } from "./event-store-types.ts";
4
+ import type { KumikoEventTypeMap } from "./event-type-map.ts";
5
+ import type { Registry } from "./feature.ts";
6
+ import type { FileContext } from "./file-handle-types.ts";
7
+ import type { AppendEventFn, UnsafeAppendEventFn } from "./handlers.ts";
8
+ import type { SecretsContext } from "./secrets-types.ts";
9
9
  export type MultiStreamApplyContext<TMap extends object = KumikoEventTypeMap> = {
10
10
  readonly appendEvent: AppendEventFn<TMap>;
11
11
  readonly unsafeAppendEvent: UnsafeAppendEventFn;
package/dist/nav.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { AccessRule } from "./handlers.js";
2
- import type { NavIconKey } from "./nav-icon.js";
3
- import type { TargetRef } from "./target-ref.js";
4
- import type { TreeAction } from "./tree-node.js";
5
- export type { IconKey, NavIconKey } from "./nav-icon.js";
1
+ import type { AccessRule } from "./handlers.ts";
2
+ import type { NavIconKey } from "./nav-icon.ts";
3
+ import type { TargetRef } from "./target-ref.ts";
4
+ import type { TreeAction } from "./tree-node.ts";
5
+ export type { IconKey, NavIconKey } from "./nav-icon.ts";
6
6
  export type NavDefinition = {
7
7
  readonly id: string;
8
8
  readonly label: string;
@@ -1,3 +1,3 @@
1
- export type { Counter, Gauge, Histogram, Meter, MetricDefinition, MetricLabels, MetricsHandle, MetricType, } from "./metric.js";
2
- export type { ObservabilityOptions, ObservabilityProvider, SamplingConfig, SensitiveFilterConfig, } from "./provider.js";
3
- export type { SerializedTraceContext, Span, SpanAttributes, SpanAttributeValue, SpanKind, SpanStatus, StartSpanOptions, Tracer, } from "./span.js";
1
+ export type { Counter, Gauge, Histogram, Meter, MetricDefinition, MetricLabels, MetricsHandle, MetricType, } from "./metric.ts";
2
+ export type { ObservabilityOptions, ObservabilityProvider, SamplingConfig, SensitiveFilterConfig, } from "./provider.ts";
3
+ export type { SerializedTraceContext, Span, SpanAttributes, SpanAttributeValue, SpanKind, SpanStatus, StartSpanOptions, Tracer, } from "./span.ts";
@@ -1,5 +1,5 @@
1
- import type { Meter } from "./metric.js";
2
- import type { Tracer } from "./span.js";
1
+ import type { Meter } from "./metric.ts";
2
+ import type { Tracer } from "./span.ts";
3
3
  export type SamplingConfig = {
4
4
  readonly tracing?: number;
5
5
  readonly alwaysOnError?: boolean;
@@ -1,4 +1,4 @@
1
- import type { SessionUser } from "./handlers.js";
1
+ import type { SessionUser } from "./handlers.ts";
2
2
  export type SqlFragment = {
3
3
  readonly sqlText: string;
4
4
  readonly params: readonly unknown[];
@@ -1,9 +1,9 @@
1
- import type { RunIn } from "./config.js";
2
- import type { DbRunner } from "./db-connection.js";
3
- import type { StoredEvent } from "./event-store-types.js";
4
- import type { EntityDefinition } from "./fields.js";
5
- import type { MultiStreamApplyContext } from "./multi-stream-apply-context-types.js";
6
- import type { SchemaTable } from "./schema-table-types.js";
1
+ import type { RunIn } from "./config.ts";
2
+ import type { DbRunner } from "./db-connection.ts";
3
+ import type { StoredEvent } from "./event-store-types.ts";
4
+ import type { EntityDefinition } from "./fields.ts";
5
+ import type { MultiStreamApplyContext } from "./multi-stream-apply-context-types.ts";
6
+ import type { SchemaTable } from "./schema-table-types.ts";
7
7
  export type ProjectionTable = SchemaTable;
8
8
  export type SingleStreamApplyFn<TPayload = Record<string, unknown>> = (event: StoredEvent<TPayload>, tx: DbRunner, table: ProjectionTable) => Promise<void>;
9
9
  export type MultiStreamApplyFn<TPayload = Record<string, unknown>> = (event: StoredEvent<TPayload>, tx: DbRunner, ctx: MultiStreamApplyContext) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
- import type { Temporal } from "./temporal.js";
2
+ import type { Temporal } from "./temporal.ts";
3
3
  export type RateLimitDecision = {
4
4
  readonly allowed: boolean;
5
5
  readonly limit: number;
@@ -1,4 +1,4 @@
1
- import type { EntityTableMeta, PgType } from "./entity-table-meta-types.js";
1
+ import type { EntityTableMeta, PgType } from "./entity-table-meta-types.ts";
2
2
  export declare const KUMIKO_NAME_SYMBOL: unique symbol;
3
3
  export declare const KUMIKO_COLUMNS_SYMBOL: unique symbol;
4
4
  export declare const KUMIKO_META_SYMBOL: unique symbol;
package/dist/screen.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { FieldIconKey } from "./field-icon.js";
2
- import type { FieldCondition, FieldDefinition, FormFieldDefinition, SelectOptionTone } from "./fields.js";
3
- import type { AccessRule, AgentScreenHints } from "./handlers.js";
4
- import type { IconKey, NavIconKey } from "./nav-icon.js";
5
- export type { FieldIconKey } from "./field-icon.js";
1
+ import type { FieldIconKey } from "./field-icon.ts";
2
+ import type { FieldCondition, FieldDefinition, FormFieldDefinition, SelectOptionTone } from "./fields.ts";
3
+ import type { AccessRule, AgentScreenHints } from "./handlers.ts";
4
+ import type { IconKey, NavIconKey } from "./nav-icon.ts";
5
+ export type { FieldIconKey } from "./field-icon.ts";
6
6
  export type PlatformComponent = {
7
7
  readonly react?: unknown;
8
8
  readonly native?: unknown;
@@ -73,7 +73,7 @@ export type FormatSpec = {
73
73
  } & FieldFormatRegistry[K];
74
74
  }[keyof FieldFormatRegistry];
75
75
  export type FieldRenderer = PlatformComponent | string | FormatSpec;
76
- export type { FieldCondition } from "./fields.js";
76
+ export type { FieldCondition } from "./fields.ts";
77
77
  export type ListColumnSpec = string | {
78
78
  readonly field: string;
79
79
  readonly renderer?: FieldRenderer;
@@ -1,4 +1,4 @@
1
- import type { EntityId, TenantId } from "./identifiers.js";
1
+ import type { EntityId, TenantId } from "./identifiers.ts";
2
2
  export type SearchAdapterConfig = {
3
3
  searchableFields: readonly string[];
4
4
  rankingFields?: readonly string[];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
- import type { DbRunner } from "./db-connection.js";
3
- import type { TenantId } from "./identifiers.js";
2
+ import type { DbRunner } from "./db-connection.ts";
3
+ import type { TenantId } from "./identifiers.ts";
4
4
  declare const SecretBrand: unique symbol;
5
5
  export type Secret<T = string> = {
6
6
  readonly [SecretBrand]: true;
@@ -1,4 +1,4 @@
1
- import type { StoredEvent } from "./event-store-types.js";
1
+ import type { StoredEvent } from "./event-store-types.ts";
2
2
  export type SnapshotReducer<TState extends Record<string, unknown>> = (state: TState, event: StoredEvent) => TState;
3
3
  export type LoadAggregateWithSnapshotResult<TState extends Record<string, unknown>> = {
4
4
  readonly state: TState;
package/dist/step.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { EventStoreExecutor } from "./event-store-executor-types.js";
2
- import type { KumikoEventTypeMap } from "./event-type-map.js";
3
- import type { HandlerContext, WriteEvent, WriteResult } from "./handlers.js";
4
- import type { SaveContext } from "./hooks.js";
5
- import type { EntityId } from "./identifiers.js";
6
- import type { WhereObject } from "./where-clause-types.js";
1
+ import type { EventStoreExecutor } from "./event-store-executor-types.ts";
2
+ import type { KumikoEventTypeMap } from "./event-type-map.ts";
3
+ import type { HandlerContext, WriteEvent, WriteResult } from "./handlers.ts";
4
+ import type { SaveContext } from "./hooks.ts";
5
+ import type { EntityId } from "./identifiers.ts";
6
+ import type { WhereObject } from "./where-clause-types.ts";
7
7
  /**
8
8
  * The kind discriminator for a step instance — matches the step's
9
9
  * registration name in the step-registry (e.g. "return", "compute",
@@ -281,7 +281,7 @@ export type StepNamespace = {
281
281
  readonly callFeature: (name: string, opts: {
282
282
  readonly handler: string;
283
283
  readonly payload: StepResolver<unknown>;
284
- readonly as?: import("./handlers.js").SessionUser;
284
+ readonly as?: import("./handlers.ts").SessionUser;
285
285
  }) => StepInstance;
286
286
  readonly wait: (args: {
287
287
  readonly for: StepResolver<string>;
@@ -1,11 +1,11 @@
1
- import type { AggregateRow, AggregateSpec } from "./aggregate-types.js";
2
- import type { DbRunner } from "./db-connection.js";
3
- import type { EntityTableMeta } from "./entity-table-meta-types.js";
4
- import type { ExecutorOnly, NotExecutorOnly } from "./executor-brand.js";
5
- import type { TenantId } from "./identifiers.js";
6
- import type { SchemaTable } from "./schema-table-types.js";
7
- import type { TenancyBrand } from "./tenancy-brand.js";
8
- import type { SelectOptions, WhereObject } from "./where-clause-types.js";
1
+ import type { AggregateRow, AggregateSpec } from "./aggregate-types.ts";
2
+ import type { DbRunner } from "./db-connection.ts";
3
+ import type { EntityTableMeta } from "./entity-table-meta-types.ts";
4
+ import type { ExecutorOnly, NotExecutorOnly } from "./executor-brand.ts";
5
+ import type { TenantId } from "./identifiers.ts";
6
+ import type { SchemaTable } from "./schema-table-types.ts";
7
+ import type { TenancyBrand } from "./tenancy-brand.ts";
8
+ import type { SelectOptions, WhereObject } from "./where-clause-types.ts";
9
9
  type WritableTable = (SchemaTable | EntityTableMeta) & NotExecutorOnly;
10
10
  type GlobalReads = {
11
11
  selectMany<T = Record<string, unknown>>(where?: WhereObject, options?: SelectOptions): Promise<readonly T[]>;
@@ -1,4 +1,4 @@
1
- import type { TargetRef } from "./target-ref.js";
1
+ import type { TargetRef } from "./target-ref.ts";
2
2
  export type TreeNodeState = "filled" | "stub" | "empty" | "loading" | "error";
3
3
  type TreeActionBase = {
4
4
  readonly icon: string;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
- import type { GeoAddress, GeoCoordinates, GeoTzProvider } from "./geo-tz.js";
2
+ import type { GeoAddress, GeoCoordinates, GeoTzProvider } from "./geo-tz.ts";
3
3
  export type LocatedTimestampJson = {
4
4
  /** Wall-clock ISO without offset, e.g. "2026-04-03T10:00:00" */
5
5
  readonly at: string;
@@ -1,5 +1,5 @@
1
1
  import type { Context } from "hono";
2
- import type { SessionUser, WriteResult } from "./handlers.js";
2
+ import type { SessionUser, WriteResult } from "./handlers.ts";
3
3
  export declare const WEBSOCKET_MAX_PAYLOAD_BYTES: number;
4
4
  export declare const WEBSOCKET_DEFAULT_MAX_MESSAGE_BYTES: number;
5
5
  export declare const WEBSOCKET_ROUTE_PATH_PREFIX = "/api/ws/";
@@ -1,4 +1,4 @@
1
- import type { AccessRule } from "./handlers.js";
1
+ import type { AccessRule } from "./handlers.ts";
2
2
  export type WorkspaceDefinition = {
3
3
  readonly id: string;
4
4
  readonly label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.369.0",
3
+ "version": "0.371.0",
4
4
  "description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
package/src/changes.json CHANGED
@@ -1,4 +1,11 @@
1
1
  [
2
+ {
3
+ "version": "0.370.0",
4
+ "type": "breaking",
5
+ "title": "SaveContext.event and DeleteContext.event are required",
6
+ "detail": "postSave and postDelete hooks always receive the stored event, so event is no longer optional on SaveContext and DeleteContext. Hooks read the caller from event.createdBy instead of guarding for undefined.",
7
+ "migration": "Code that builds a SaveContext or DeleteContext by hand, usually in tests, sets event, for example with createTestStoredEvent() from @cosmicdrift/kumiko-testing/helpers. Drop optional chaining on ctx.event in hooks."
8
+ },
2
9
  {
3
10
  "version": "0.365.0",
4
11
  "type": "improvement",