@cosmicdrift/kumiko-types 0.229.1 → 0.231.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.229.1",
3
+ "version": "0.231.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>",
@@ -16,4 +16,5 @@ export type FileHandle = {
16
16
  // GDPR jobs all hit the same store by construction.
17
17
  export type FileContext = {
18
18
  ref(key: string): FileHandle;
19
+ list(prefix: string): Promise<readonly string[]>;
19
20
  };
package/src/step.ts CHANGED
@@ -76,6 +76,27 @@ export type PipelineCtx<
76
76
  */
77
77
  export type StepResolver<T, TPayload = unknown> = T | ((ctx: PipelineCtx<TPayload>) => T);
78
78
 
79
+ // Serializable AST for r.step.waitForEvent's `match` argument. Persisted
80
+ // verbatim into the waiting-for-event suspension payload (jsonb), so it
81
+ // must survive a JSON round-trip — a closure cannot.
82
+ export type EventMatchValue = string | number | boolean | null;
83
+
84
+ export type EventMatchOp =
85
+ | { readonly kind: "eq"; readonly value: EventMatchValue }
86
+ | { readonly kind: "ne"; readonly value: EventMatchValue }
87
+ | { readonly kind: "in"; readonly values: readonly EventMatchValue[] }
88
+ | { readonly kind: "gt"; readonly value: number | string }
89
+ | { readonly kind: "gte"; readonly value: number | string }
90
+ | { readonly kind: "lt"; readonly value: number | string }
91
+ | { readonly kind: "lte"; readonly value: number | string };
92
+
93
+ export type EventMatchExpr =
94
+ | { readonly kind: "and"; readonly nodes: readonly EventMatchExpr[] }
95
+ | { readonly kind: "or"; readonly nodes: readonly EventMatchExpr[] }
96
+ | { readonly kind: "atom"; readonly path: readonly string[]; readonly op: EventMatchOp };
97
+
98
+ export type EventMatch = { readonly version: 1; readonly expr: EventMatchExpr };
99
+
79
100
  /**
80
101
  * Per-step error strategy. M.1.1 only supports "throw" — the type is
81
102
  * deliberately narrowed so callers cannot pass an unsupported strategy
@@ -319,7 +340,7 @@ export type StepNamespace = {
319
340
  readonly wait: (args: { readonly for: StepResolver<string> }) => StepInstance;
320
341
  readonly waitForEvent: (args: {
321
342
  readonly event: string;
322
- readonly match?: StepResolver<(payload: unknown) => boolean>;
343
+ readonly match?: StepResolver<EventMatch>;
323
344
  readonly timeout: StepResolver<string>;
324
345
  }) => StepInstance;
325
346
  readonly retry: (args: {