@almadar/runtime 3.1.4 → 3.2.1

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.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { B as BindingContext, E as EvaluationContextExtensions, P as PatternProps, a as EffectHandlers, b as EffectContext, c as ExecutionEnvironment, d as EffectResult, T as TraitDefinition } from './types-CM6txTNy.js';
2
- export { e as Effect, f as EventListener, H as HANDLER_MANIFEST, I as IEventBus, R as RuntimeConfig, g as RuntimeEvent, h as TraitState, i as TransitionObserver, j as TransitionResult, U as Unsubscribe } from './types-CM6txTNy.js';
3
- export { E as EntitySharingMap, a as EventBus, b as EventNamespaceMap, O as OrbitalEventRequest, c as OrbitalEventResponse, d as OrbitalServerRuntimeConfig, P as PersistenceAdapter, e as PreprocessOptions, f as PreprocessResult, g as PreprocessedSchema, h as ProcessEventOptions, R as RegisteredOrbital, i as RuntimeOrbital, j as RuntimeOrbitalSchema, k as RuntimeTrait, S as StateMachineManager, l as createInitialTraitState, m as findInitialState, n as findTransition, o as getIsolatedCollectionName, p as getNamespacedEvent, q as isNamespacedEvent, r as normalizeEventKey, s as parseNamespacedEvent, t as preprocessSchema, u as processEvent } from './OrbitalServerRuntime-DWJYcIJG.js';
1
+ import { B as BindingContext, E as EvaluationContextExtensions, P as PatternProps, a as EffectHandlers, b as EffectContext, c as ExecutionEnvironment, d as EffectResult, T as TraitDefinition } from './types-B8OfRFfV.js';
2
+ export { e as Effect, f as EventListener, H as HANDLER_MANIFEST, I as IEventBus, R as RuntimeConfig, g as RuntimeEvent, h as TraitState, i as TransitionObserver, j as TransitionResult, U as Unsubscribe } from './types-B8OfRFfV.js';
3
+ export { E as EntitySharingMap, a as EventBus, b as EventNamespaceMap, O as OrbitalEventRequest, c as OrbitalEventResponse, d as OrbitalServerRuntimeConfig, P as PersistenceAdapter, e as PreprocessOptions, f as PreprocessResult, g as PreprocessedSchema, h as ProcessEventOptions, R as RegisteredOrbital, i as RuntimeOrbital, j as RuntimeOrbitalSchema, k as RuntimeTrait, S as StateMachineManager, l as createInitialTraitState, m as findInitialState, n as findTransition, o as getIsolatedCollectionName, p as getNamespacedEvent, q as isNamespacedEvent, r as normalizeEventKey, s as parseNamespacedEvent, t as preprocessSchema, u as processEvent } from './OrbitalServerRuntime-CQsVhY4Y.js';
4
4
  import { EvaluationContext } from '@almadar/evaluator';
5
5
  export { EvaluationContext, createMinimalContext } from '@almadar/evaluator';
6
6
  import { EventPayload, EntityRow, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
@@ -163,6 +163,16 @@ declare class EffectExecutor {
163
163
  * Instead, it captures errors in the returned `EffectResult[]` array.
164
164
  */
165
165
  executeWithResults(effects: unknown[]): Promise<EffectResult[]>;
166
+ private extractEmitConfig;
167
+ private emitSuccess;
168
+ private emitFailure;
169
+ /**
170
+ * Narrow the generic emit config into the `os/watch-*` handler surface
171
+ * (only `on_message` + `failure` are meaningful for streaming ops).
172
+ * Returns `undefined` when neither field is set so handlers can test
173
+ * with a single `if (emit)` guard.
174
+ */
175
+ private osEmit;
166
176
  private dispatch;
167
177
  private logUnsupported;
168
178
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { EffectExecutor, EventBus, HANDLER_MANIFEST, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createTestExecutor, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isNamespacedEvent, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent } from './chunk-6PAKTVTR.js';
1
+ export { EffectExecutor, EventBus, HANDLER_MANIFEST, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createTestExecutor, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isNamespacedEvent, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent } from './chunk-PXASRZKG.js';
2
2
  import { __export } from './chunk-PZ5AY32C.js';
3
3
  import { isInlineTrait } from '@almadar/core';
4
4
 
@@ -1,13 +1,6 @@
1
+ import * as _almadar_core from '@almadar/core';
1
2
  import { EventPayload, AgentContext, EntityRow, ServiceParams, ResolvedPatternProps } from '@almadar/core';
2
3
 
3
- /**
4
- * Unified Runtime Types
5
- *
6
- * Platform-agnostic interfaces for trait execution on client or server.
7
- *
8
- * @packageDocumentation
9
- */
10
-
11
4
  /** Alias for ResolvedPatternProps to avoid breaking internal consumers */
12
5
  type PatternProps = ResolvedPatternProps;
13
6
  /** Configuration context */
@@ -194,22 +187,28 @@ interface EffectHandlers {
194
187
  osWatchFiles?: (glob: string, options: {
195
188
  recursive?: boolean;
196
189
  debounce?: number;
197
- }) => void;
190
+ }, emit?: OsEmitConfig) => void;
198
191
  /** Monitor a process by name */
199
- osWatchProcess?: (name: string, subcommand?: string) => void;
192
+ osWatchProcess?: (name: string, subcommand?: string, emit?: OsEmitConfig) => void;
200
193
  /** Monitor a port for open/close */
201
- osWatchPort?: (port: number, protocol: string) => void;
194
+ osWatchPort?: (port: number, protocol: string, emit?: OsEmitConfig) => void;
202
195
  /** Intercept HTTP responses matching pattern */
203
- osWatchHttp?: (urlPattern: string, method?: string) => void;
196
+ osWatchHttp?: (urlPattern: string, method?: string, emit?: OsEmitConfig) => void;
204
197
  /** Register a cron schedule */
205
- osWatchCron?: (expression: string) => void;
198
+ osWatchCron?: (expression: string, emit?: OsEmitConfig) => void;
206
199
  /** Register an OS signal handler */
207
- osWatchSignal?: (signal: string) => void;
200
+ osWatchSignal?: (signal: string, emit?: OsEmitConfig) => void;
208
201
  /** Watch an environment variable for changes */
209
- osWatchEnv?: (variable: string) => void;
202
+ osWatchEnv?: (variable: string, emit?: OsEmitConfig) => void;
210
203
  /** Configure debounce for an OS event type */
211
204
  osDebounce?: (ms: number, eventType: string) => void;
212
205
  }
206
+ /**
207
+ * Author-configured `emit:` block threaded into `os/watch-*` handlers.
208
+ * Narrower than @almadar/core's `EmitConfig` — only the keys streaming
209
+ * operators meaningfully fire.
210
+ */
211
+ type OsEmitConfig = Pick<_almadar_core.EmitConfig, 'on_message' | 'failure'>;
213
212
  /**
214
213
  * Context for resolving bindings like @entity.field, @payload.value
215
214
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/runtime",
3
- "version": "3.1.4",
3
+ "version": "3.2.1",
4
4
  "description": "Interpreted runtime for Almadar orbital applications (OrbitalServerRuntime)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@almadar/evaluator": ">=2.5.4",
40
40
  "@almadar/operators": ">=2.1.3",
41
- "@almadar/core": ">=4.2.0",
41
+ "@almadar/core": ">=4.8.0",
42
42
  "@faker-js/faker": "^9.3.0"
43
43
  },
44
44
  "peerDependencies": {