@cnstra/core 2.3.0 → 2.4.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.
@@ -1,14 +1,9 @@
1
1
  import { CNSCollateral } from '../CNSCollateral';
2
2
  import { TCNSAxon } from './TCNSAxon';
3
- import { TCNSLocalContextValueStore } from './TCNSLocalContextValueStore';
4
3
  import { TNCNeuronResponseReturn } from './TCNSNeuronResponseReturn';
5
- import { ICNS } from '../interfaces/ICNS';
6
- export type TCNSDendrite<TContextValue, TSenderCollateral extends CNSCollateral<unknown>, TAxonType extends TCNSAxon> = {
4
+ import { TCNSHandlerContext } from './TCNSHandlerContext';
5
+ export type TCNSDendrite<TContextValue, TSenderCollateral extends CNSCollateral<unknown>, TAxonType extends TCNSAxon, TExt = unknown> = {
7
6
  collateral: TSenderCollateral;
8
- response: (payload: TSenderCollateral extends CNSCollateral<infer P> ? P : never, axon: TAxonType, ctx: TCNSLocalContextValueStore<TContextValue> & {
9
- abortSignal?: AbortSignal;
10
- cns?: ICNS<any, any>;
11
- stimulation?: any;
12
- }) => TNCNeuronResponseReturn<TAxonType>;
7
+ response: (payload: TSenderCollateral extends CNSCollateral<infer P> ? P : never, axon: TAxonType, ctx: TCNSHandlerContext<TContextValue, TExt>) => TNCNeuronResponseReturn<TAxonType>;
13
8
  };
14
9
  //# sourceMappingURL=TCNSDendrite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TCNSDendrite.d.ts","sourceRoot":"","sources":["../../src/types/TCNSDendrite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1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,24 @@
1
+ import { TCNSLocalContextValueStore } from './TCNSLocalContextValueStore';
2
+ import { ICNS } from '../interfaces/ICNS';
3
+ /**
4
+ * The base `ctx` bag handed to every dendrite handler — nothing app-specific
5
+ * lives here. Factory layers add their own fields via the `TExt` extension
6
+ * (see {@link TCNSHandlerContext}), so the base stays clean for neurons that
7
+ * don't opt into anything.
8
+ */
9
+ export type TCNSHandlerContextBase<TContextValue> = TCNSLocalContextValueStore<TContextValue> & {
10
+ abortSignal?: AbortSignal;
11
+ cns?: ICNS<any, any>;
12
+ stimulation?: any;
13
+ };
14
+ /**
15
+ * The `ctx` a dendrite handler receives. `TExt` is whatever the factory layers
16
+ * poured in (e.g. `withGlobal<T>()` adds `{ global: T }`) — it's a plain
17
+ * intersection, so layers add exactly what they want and nothing else, and a
18
+ * base neuron (no layers) gets `TExt = unknown`, i.e. just the base bag.
19
+ *
20
+ * The handler signature stays `(payload, axon, ctx)` no matter how many layers
21
+ * you stack; each layer widens the type of `ctx`, never the argument list.
22
+ */
23
+ export type TCNSHandlerContext<TContextValue, TExt = unknown> = TCNSHandlerContextBase<TContextValue> & TExt;
24
+ //# sourceMappingURL=TCNSHandlerContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TCNSHandlerContext.d.ts","sourceRoot":"","sources":["../../src/types/TCNSHandlerContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,CAAC,aAAa,IAC5C,0BAA0B,CAAC,aAAa,CAAC,GAAG;IACxC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACrB,WAAW,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEN;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,CAAC,aAAa,EAAE,IAAI,GAAG,OAAO,IACxD,sBAAsB,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC"}
@@ -7,6 +7,6 @@ export type TCNSNeuron<TContextValue, TAxonType extends TCNSAxon = TCNSAxon> = {
7
7
  concurrency?: number;
8
8
  /** Optional per-neuron max processing duration in milliseconds. */
9
9
  maxDuration?: number;
10
- dendrites: TCNSDendrite<TContextValue, CNSCollateral<unknown>, TAxonType>[];
10
+ dendrites: TCNSDendrite<TContextValue, CNSCollateral<unknown>, TAxonType, any>[];
11
11
  };
12
12
  //# sourceMappingURL=TCNSNeuron.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TCNSNeuron.d.ts","sourceRoot":"","sources":["../../src/types/TCNSNeuron.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,UAAU,CAClB,aAAa,EACb,SAAS,SAAS,QAAQ,GAAG,QAAQ,IACrC;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,YAAY,CACnB,aAAa,EACb,aAAa,CAAC,OAAO,CAAC,EACtB,SAAS,CACZ,EAAE,CAAC;CACP,CAAC"}
1
+ {"version":3,"file":"TCNSNeuron.d.ts","sourceRoot":"","sources":["../../src/types/TCNSNeuron.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,UAAU,CAClB,aAAa,EACb,SAAS,SAAS,QAAQ,GAAG,QAAQ,IACrC;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,SAAS,EAAE,YAAY,CACnB,aAAa,EACb,aAAa,CAAC,OAAO,CAAC,EACtB,SAAS,EACT,GAAG,CACN,EAAE,CAAC;CACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnstra/core",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Embeddable workflow/orchestration engine for TypeScript: deterministic runs over a typed neuron graph (in-memory, zero dependencies).",
5
5
  "keywords": [
6
6
  "neural-network",