@cadenza.io/core 3.22.0 → 3.23.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/dist/index.d.mts CHANGED
@@ -2046,6 +2046,20 @@ interface ActorTaskContext<D extends Record<string, any>, R = AnyObject> {
2046
2046
  * Handler signature used by `actor.task(...)`.
2047
2047
  */
2048
2048
  type ActorTaskHandler<D extends Record<string, any>, R = AnyObject> = (context: ActorTaskContext<D, R>) => TaskResult | ActorStateReducer<D> | Promise<TaskResult | ActorStateReducer<D>>;
2049
+ /**
2050
+ * Metadata attached to wrapped actor task functions.
2051
+ */
2052
+ interface ActorTaskRuntimeMetadata {
2053
+ actorName: string;
2054
+ actorDescription?: string;
2055
+ actorKind: ActorKind;
2056
+ mode: ActorTaskMode;
2057
+ forceMeta: boolean;
2058
+ }
2059
+ /**
2060
+ * Reads actor metadata from a wrapped task function if available.
2061
+ */
2062
+ declare function getActorTaskRuntimeMetadata(taskFunction: TaskFunction): ActorTaskRuntimeMetadata | undefined;
2049
2063
  /**
2050
2064
  * In-memory actor runtime.
2051
2065
  *
@@ -2112,6 +2126,7 @@ declare class Actor<D extends Record<string, any> = AnyObject, R = AnyObject> {
2112
2126
  private touchSession;
2113
2127
  private runWithOptionalIdempotency;
2114
2128
  private getActiveIdempotencyRecord;
2129
+ private emitActorCreatedSignal;
2115
2130
  }
2116
2131
 
2117
2132
  interface TaskOptions {
@@ -2145,6 +2160,7 @@ declare class Cadenza {
2145
2160
  static metaRunner: GraphRunner;
2146
2161
  static registry: GraphRegistry;
2147
2162
  private static taskCache;
2163
+ private static actorCache;
2148
2164
  static isBootstrapped: boolean;
2149
2165
  static mode: CadenzaMode;
2150
2166
  /**
@@ -2185,6 +2201,7 @@ declare class Cadenza {
2185
2201
  */
2186
2202
  static validateName(name: string): void;
2187
2203
  private static resolveTaskOptionsForActorTask;
2204
+ private static registerActor;
2188
2205
  /**
2189
2206
  * Executes the specified task or GraphRoutine with the given context using an internal runner.
2190
2207
  *
@@ -2226,6 +2243,8 @@ declare class Cadenza {
2226
2243
  static interval(taskName: string, context: AnyObject, intervalMs: number, leading?: boolean, startDateTime?: Date): void;
2227
2244
  static debounce(signalName: string, context: any, delayMs: number): void;
2228
2245
  static get(taskName: string): Task | undefined;
2246
+ static getActor<D extends Record<string, any> = AnyObject, R = AnyObject>(actorName: string): Actor<D, R> | undefined;
2247
+ static getAllActors<D extends Record<string, any> = AnyObject, R = AnyObject>(): Actor<D, R>[];
2229
2248
  static getRoutine(routineName: string): GraphRoutine | undefined;
2230
2249
  static defineIntent(intent: Intent): Intent;
2231
2250
  static inquire(inquiry: string, context: AnyObject, options?: InquiryOptions): Promise<any>;
@@ -2594,4 +2613,4 @@ declare class Cadenza {
2594
2613
  static reset(): void;
2595
2614
  }
2596
2615
 
2597
- export { Actor, type ActorConsistencyProfileName, type ActorDefinition, type ActorFactoryOptions, type ActorInvocationOptions, type ActorKeyDefinition, type ActorKind, type ActorLoadPolicy, type ActorRuntimeReadGuard, type ActorSpec, type ActorStateDefinition, type ActorStateReducer, type ActorStateStore, type ActorTaskBindingDefinition, type ActorTaskBindingOptions, type ActorTaskContext, type ActorTaskHandler, type ActorTaskMode, type ActorWriteContract, type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, type EmitOptions, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type IdempotencyPolicy, InquiryBroker, type InquiryOptions, type Intent, type RetryPolicy, type Schema, type SchemaConstraints, type SchemaDefinition, type SchemaType, type SessionPolicy, SignalBroker, SignalEmitter, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default };
2616
+ export { Actor, type ActorConsistencyProfileName, type ActorDefinition, type ActorFactoryOptions, type ActorInvocationOptions, type ActorKeyDefinition, type ActorKind, type ActorLoadPolicy, type ActorRuntimeReadGuard, type ActorSpec, type ActorStateDefinition, type ActorStateReducer, type ActorStateStore, type ActorTaskBindingDefinition, type ActorTaskBindingOptions, type ActorTaskContext, type ActorTaskHandler, type ActorTaskMode, type ActorTaskRuntimeMetadata, type ActorWriteContract, type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, type EmitOptions, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type IdempotencyPolicy, InquiryBroker, type InquiryOptions, type Intent, type RetryPolicy, type Schema, type SchemaConstraints, type SchemaDefinition, type SchemaType, type SessionPolicy, SignalBroker, SignalEmitter, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default, getActorTaskRuntimeMetadata };
package/dist/index.d.ts CHANGED
@@ -2046,6 +2046,20 @@ interface ActorTaskContext<D extends Record<string, any>, R = AnyObject> {
2046
2046
  * Handler signature used by `actor.task(...)`.
2047
2047
  */
2048
2048
  type ActorTaskHandler<D extends Record<string, any>, R = AnyObject> = (context: ActorTaskContext<D, R>) => TaskResult | ActorStateReducer<D> | Promise<TaskResult | ActorStateReducer<D>>;
2049
+ /**
2050
+ * Metadata attached to wrapped actor task functions.
2051
+ */
2052
+ interface ActorTaskRuntimeMetadata {
2053
+ actorName: string;
2054
+ actorDescription?: string;
2055
+ actorKind: ActorKind;
2056
+ mode: ActorTaskMode;
2057
+ forceMeta: boolean;
2058
+ }
2059
+ /**
2060
+ * Reads actor metadata from a wrapped task function if available.
2061
+ */
2062
+ declare function getActorTaskRuntimeMetadata(taskFunction: TaskFunction): ActorTaskRuntimeMetadata | undefined;
2049
2063
  /**
2050
2064
  * In-memory actor runtime.
2051
2065
  *
@@ -2112,6 +2126,7 @@ declare class Actor<D extends Record<string, any> = AnyObject, R = AnyObject> {
2112
2126
  private touchSession;
2113
2127
  private runWithOptionalIdempotency;
2114
2128
  private getActiveIdempotencyRecord;
2129
+ private emitActorCreatedSignal;
2115
2130
  }
2116
2131
 
2117
2132
  interface TaskOptions {
@@ -2145,6 +2160,7 @@ declare class Cadenza {
2145
2160
  static metaRunner: GraphRunner;
2146
2161
  static registry: GraphRegistry;
2147
2162
  private static taskCache;
2163
+ private static actorCache;
2148
2164
  static isBootstrapped: boolean;
2149
2165
  static mode: CadenzaMode;
2150
2166
  /**
@@ -2185,6 +2201,7 @@ declare class Cadenza {
2185
2201
  */
2186
2202
  static validateName(name: string): void;
2187
2203
  private static resolveTaskOptionsForActorTask;
2204
+ private static registerActor;
2188
2205
  /**
2189
2206
  * Executes the specified task or GraphRoutine with the given context using an internal runner.
2190
2207
  *
@@ -2226,6 +2243,8 @@ declare class Cadenza {
2226
2243
  static interval(taskName: string, context: AnyObject, intervalMs: number, leading?: boolean, startDateTime?: Date): void;
2227
2244
  static debounce(signalName: string, context: any, delayMs: number): void;
2228
2245
  static get(taskName: string): Task | undefined;
2246
+ static getActor<D extends Record<string, any> = AnyObject, R = AnyObject>(actorName: string): Actor<D, R> | undefined;
2247
+ static getAllActors<D extends Record<string, any> = AnyObject, R = AnyObject>(): Actor<D, R>[];
2229
2248
  static getRoutine(routineName: string): GraphRoutine | undefined;
2230
2249
  static defineIntent(intent: Intent): Intent;
2231
2250
  static inquire(inquiry: string, context: AnyObject, options?: InquiryOptions): Promise<any>;
@@ -2594,4 +2613,4 @@ declare class Cadenza {
2594
2613
  static reset(): void;
2595
2614
  }
2596
2615
 
2597
- export { Actor, type ActorConsistencyProfileName, type ActorDefinition, type ActorFactoryOptions, type ActorInvocationOptions, type ActorKeyDefinition, type ActorKind, type ActorLoadPolicy, type ActorRuntimeReadGuard, type ActorSpec, type ActorStateDefinition, type ActorStateReducer, type ActorStateStore, type ActorTaskBindingDefinition, type ActorTaskBindingOptions, type ActorTaskContext, type ActorTaskHandler, type ActorTaskMode, type ActorWriteContract, type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, type EmitOptions, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type IdempotencyPolicy, InquiryBroker, type InquiryOptions, type Intent, type RetryPolicy, type Schema, type SchemaConstraints, type SchemaDefinition, type SchemaType, type SessionPolicy, SignalBroker, SignalEmitter, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default };
2616
+ export { Actor, type ActorConsistencyProfileName, type ActorDefinition, type ActorFactoryOptions, type ActorInvocationOptions, type ActorKeyDefinition, type ActorKind, type ActorLoadPolicy, type ActorRuntimeReadGuard, type ActorSpec, type ActorStateDefinition, type ActorStateReducer, type ActorStateStore, type ActorTaskBindingDefinition, type ActorTaskBindingOptions, type ActorTaskContext, type ActorTaskHandler, type ActorTaskMode, type ActorTaskRuntimeMetadata, type ActorWriteContract, type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, type EmitOptions, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type IdempotencyPolicy, InquiryBroker, type InquiryOptions, type Intent, type RetryPolicy, type Schema, type SchemaConstraints, type SchemaDefinition, type SchemaType, type SessionPolicy, SignalBroker, SignalEmitter, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default, getActorTaskRuntimeMetadata };