@cnstra/core 2.5.0 → 3.0.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/README.md +3 -4
- package/dist/CNS.d.ts +16 -12
- package/dist/CNS.d.ts.map +1 -1
- package/dist/CNSCollateral.d.ts +2 -2
- package/dist/CNSCollateral.d.ts.map +1 -1
- package/dist/CNSNetwork.d.ts +11 -10
- package/dist/CNSNetwork.d.ts.map +1 -1
- package/dist/CNSStimulation.d.ts +21 -48
- package/dist/CNSStimulation.d.ts.map +1 -1
- package/dist/factory/index.d.ts +45 -105
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/index.cjs +44 -247
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -243
- package/dist/index.js.map +1 -1
- package/dist/utils/CNSStimulationGate.d.ts +9 -9
- package/dist/utils/CNSStimulationGate.d.ts.map +1 -1
- package/package.json +5 -2
- package/dist/CNSPersistOptionsRegistry.d.ts +0 -28
- package/dist/CNSPersistOptionsRegistry.d.ts.map +0 -1
- package/dist/CNSStimulationContextStore.d.ts +0 -11
- package/dist/CNSStimulationContextStore.d.ts.map +0 -1
- package/dist/interfaces/ICNS.d.ts +0 -27
- package/dist/interfaces/ICNS.d.ts.map +0 -1
- package/dist/interfaces/ICNSCollateral.d.ts +0 -6
- package/dist/interfaces/ICNSCollateral.d.ts.map +0 -1
- package/dist/interfaces/ICNSStimulationContextStore.d.ts +0 -8
- package/dist/interfaces/ICNSStimulationContextStore.d.ts.map +0 -1
- package/dist/types/TCNSAfferentPath.d.ts +0 -4
- package/dist/types/TCNSAfferentPath.d.ts.map +0 -1
- package/dist/types/TCNSAxon.d.ts +0 -26
- package/dist/types/TCNSAxon.d.ts.map +0 -1
- package/dist/types/TCNSDendrite.d.ts +0 -9
- package/dist/types/TCNSDendrite.d.ts.map +0 -1
- package/dist/types/TCNSHandlerContext.d.ts +0 -24
- package/dist/types/TCNSHandlerContext.d.ts.map +0 -1
- package/dist/types/TCNSLocalContextValueStore.d.ts +0 -6
- package/dist/types/TCNSLocalContextValueStore.d.ts.map +0 -1
- package/dist/types/TCNSModality.d.ts +0 -5
- package/dist/types/TCNSModality.d.ts.map +0 -1
- package/dist/types/TCNSNeuron.d.ts +0 -12
- package/dist/types/TCNSNeuron.d.ts.map +0 -1
- package/dist/types/TCNSNeuronActivationTask.d.ts +0 -8
- package/dist/types/TCNSNeuronActivationTask.d.ts.map +0 -1
- package/dist/types/TCNSNeuronActivationTaskFailure.d.ts +0 -7
- package/dist/types/TCNSNeuronActivationTaskFailure.d.ts.map +0 -1
- package/dist/types/TCNSNeuronResponseReturn.d.ts +0 -9
- package/dist/types/TCNSNeuronResponseReturn.d.ts.map +0 -1
- package/dist/types/TCNSOptions.d.ts +0 -11
- package/dist/types/TCNSOptions.d.ts.map +0 -1
- package/dist/types/TCNSPersist.d.ts +0 -16
- package/dist/types/TCNSPersist.d.ts.map +0 -1
- package/dist/types/TCNSSignal.d.ts +0 -6
- package/dist/types/TCNSSignal.d.ts.map +0 -1
- package/dist/types/TCNSStimulationDrain.d.ts +0 -37
- package/dist/types/TCNSStimulationDrain.d.ts.map +0 -1
- package/dist/types/TCNSStimulationOptions.d.ts +0 -32
- package/dist/types/TCNSStimulationOptions.d.ts.map +0 -1
- package/dist/types/TCNSStimulationQueueItem.d.ts +0 -11
- package/dist/types/TCNSStimulationQueueItem.d.ts.map +0 -1
- package/dist/types/TCNSStimulationResponse.d.ts +0 -57
- package/dist/types/TCNSStimulationResponse.d.ts.map +0 -1
- package/dist/types/TCNSStimulationSerializedContextValue.d.ts +0 -4
- package/dist/types/TCNSStimulationSerializedContextValue.d.ts.map +0 -1
- package/dist/types/TCNSSubscriber.d.ts +0 -7
- package/dist/types/TCNSSubscriber.d.ts.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
+
import type { ICNSCollateral } from '@cnstra/types';
|
|
1
2
|
import type { CNS } from '../CNS';
|
|
2
|
-
import type { CNSCollateral } from '../CNSCollateral';
|
|
3
3
|
import type { CNSStimulation } from '../CNSStimulation';
|
|
4
|
-
import type { TCNSDendrite } from '
|
|
5
|
-
import type { TCNSNeuron } from '
|
|
6
|
-
import type { TCNSSignal } from '
|
|
7
|
-
import type { TCNSStimulationOptions } from '
|
|
8
|
-
import type { TCNSStimulationResponse } from '
|
|
9
|
-
export type TCNSStimulationGateSignal = TCNSSignal<
|
|
10
|
-
export type TCNSStimulationGateOptions<TNeuron extends TCNSNeuron<any
|
|
4
|
+
import type { TCNSDendrite } from '@cnstra/types';
|
|
5
|
+
import type { TCNSNeuron } from '@cnstra/types';
|
|
6
|
+
import type { TCNSSignal } from '@cnstra/types';
|
|
7
|
+
import type { TCNSStimulationOptions } from '@cnstra/types';
|
|
8
|
+
import type { TCNSStimulationResponse } from '@cnstra/types';
|
|
9
|
+
export type TCNSStimulationGateSignal = TCNSSignal<ICNSCollateral<unknown>> | TCNSSignal<ICNSCollateral<unknown>>[];
|
|
10
|
+
export type TCNSStimulationGateOptions<TNeuron extends TCNSNeuron<any>, TDendrite extends TCNSDendrite<any, any, any> = TCNSDendrite<any, any, any>> = {
|
|
11
11
|
cns: CNS<TNeuron, TDendrite>;
|
|
12
12
|
signal: TCNSStimulationGateSignal;
|
|
13
13
|
options?: TCNSStimulationOptions<TCNSStimulationResponse>;
|
|
14
14
|
};
|
|
15
|
-
export declare class CNSStimulationGate<TNeuron extends TCNSNeuron<any
|
|
15
|
+
export declare class CNSStimulationGate<TNeuron extends TCNSNeuron<any>, TDendrite extends TCNSDendrite<any, any, any> = TCNSDendrite<any, any, any>> {
|
|
16
16
|
private readonly guardOptions;
|
|
17
17
|
private currentStimulation?;
|
|
18
18
|
private currentDrain?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CNSStimulationGate.d.ts","sourceRoot":"","sources":["../../src/utils/CNSStimulationGate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"CNSStimulationGate.d.ts","sourceRoot":"","sources":["../../src/utils/CNSStimulationGate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GAC/B,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,GACnC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;AAE5C,MAAM,MAAM,0BAA0B,CAClC,OAAO,SAAS,UAAU,CAAC,GAAG,CAAC,EAC/B,SAAS,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAC3E;IACA,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC7B,MAAM,EAAE,yBAAyB,CAAC;IAClC,OAAO,CAAC,EAAE,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;CAC7D,CAAC;AAEF,qBAAa,kBAAkB,CAC3B,OAAO,SAAS,UAAU,CAAC,GAAG,CAAC,EAC/B,SAAS,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAOvE,OAAO,CAAC,QAAQ,CAAC,YAAY;IALjC,OAAO,CAAC,kBAAkB,CAAC,CAAqC;IAChE,OAAO,CAAC,YAAY,CAAC,CAAgB;IACrC,OAAO,CAAC,sBAAsB,CAAC,CAAkB;gBAG5B,YAAY,EAAE,0BAA0B,CAAC,OAAO,EAAE,SAAS,CAAC;IAG1E,UAAU,IAAI,OAAO;IAIrB,qBAAqB,IACtB,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,GAClC,SAAS;IAIR,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqBtB,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO;IAQnC,OAAO,CAAC,wBAAwB;CAkBnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cnstra/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.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",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup && tsc --emitDeclarationOnly",
|
|
52
52
|
"build:types": "tsc --emitDeclarationOnly",
|
|
53
|
-
"prepublishOnly": "npm run test && npm run test:types && npm run build",
|
|
53
|
+
"prepublishOnly": "node ../../scripts/check-drift.mjs --gate && npm run test && npm run test:types && npm run build",
|
|
54
54
|
"test": "jest",
|
|
55
55
|
"test:types": "npm run build:types",
|
|
56
56
|
"examples": "tsx examples/run-examples.ts"
|
|
@@ -63,6 +63,9 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@cnstra/types": "^0.2.0"
|
|
68
|
+
},
|
|
66
69
|
"devDependencies": {
|
|
67
70
|
"@types/jest": "^29.5.12",
|
|
68
71
|
"jest": "^29.7.0",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { CNSCollateral } from './CNSCollateral';
|
|
2
|
-
import { CNSStimulation } from './CNSStimulation';
|
|
3
|
-
import { TCNSAxon } from './types/TCNSAxon';
|
|
4
|
-
import { TCNSNeuron } from './types/TCNSNeuron';
|
|
5
|
-
import { TCNSCollateralPersistOptions, TCNSNeuronPersistOptions, TCNSStimulationPersistOptions } from './types/TCNSPersist';
|
|
6
|
-
export declare class CNSPersistOptionsRegistry {
|
|
7
|
-
private neurons;
|
|
8
|
-
private neuronNames;
|
|
9
|
-
private collaterals;
|
|
10
|
-
private stimulations;
|
|
11
|
-
addNeuron(neuron: TCNSNeuron<unknown, TCNSAxon>, options: TCNSNeuronPersistOptions<TCNSNeuron<unknown, TCNSAxon>>): void;
|
|
12
|
-
getNeuron(name: string): TCNSNeuron<unknown, TCNSAxon> | undefined;
|
|
13
|
-
getNeuronName(neuron: TCNSNeuron<unknown, TCNSAxon>): string | undefined;
|
|
14
|
-
getNamedNeurons(): ReadonlyMap<string, TCNSNeuron<unknown, TCNSAxon>>;
|
|
15
|
-
getCollateralName(collateral: CNSCollateral<unknown>): string | undefined;
|
|
16
|
-
removeNeuron(name: string): void;
|
|
17
|
-
addCollateral(collateral: CNSCollateral<unknown>, options: TCNSCollateralPersistOptions): void;
|
|
18
|
-
getCollateral(name: string): CNSCollateral<unknown> | undefined;
|
|
19
|
-
removeCollateral(name: string): void;
|
|
20
|
-
addStimulation(stimulation: CNSStimulation<TCNSNeuron<unknown, TCNSAxon>>, options: TCNSStimulationPersistOptions): void;
|
|
21
|
-
getStimulation(stimulationId: string): CNSStimulation<TCNSNeuron<unknown, TCNSAxon>> | undefined;
|
|
22
|
-
removeStimulation(stimulationId: string): void;
|
|
23
|
-
register<TAxon extends TCNSAxon>(name: string, neuron: TCNSNeuron<any, TAxon>, collateralNames?: {
|
|
24
|
-
[K in keyof TAxon]?: string;
|
|
25
|
-
}): this;
|
|
26
|
-
registerCollateral(name: string, collateral: CNSCollateral<unknown>): this;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=CNSPersistOptionsRegistry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CNSPersistOptionsRegistry.d.ts","sourceRoot":"","sources":["../src/CNSPersistOptionsRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EACH,4BAA4B,EAC5B,wBAAwB,EACxB,6BAA6B,EAChC,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,yBAAyB;IAClC,OAAO,CAAC,OAAO,CAAoD;IACnE,OAAO,CAAC,WAAW,CAAwD;IAE3E,OAAO,CAAC,WAAW,CAA6C;IAEhE,OAAO,CAAC,YAAY,CAGhB;IAEJ,SAAS,CACL,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,EACrC,OAAO,EAAE,wBAAwB,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,GACjE,IAAI;IAKP,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,SAAS;IAIlE,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,MAAM,GAAG,SAAS;IAIxE,eAAe,IAAI,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAIrE,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS;IAOzE,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAMhC,aAAa,CACT,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAClC,OAAO,EAAE,4BAA4B,GACtC,IAAI;IAIP,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS;IAI/D,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIpC,cAAc,CACV,WAAW,EAAE,cAAc,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,EAC1D,OAAO,EAAE,6BAA6B,GACvC,IAAI;IAIP,cAAc,CACV,aAAa,EAAE,MAAM,GACtB,cAAc,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,GAAG,SAAS;IAI5D,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAI9C,QAAQ,CAAC,KAAK,SAAS,QAAQ,EAC3B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,EAC9B,eAAe,CAAC,EAAE;SAAG,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE,MAAM;KAAE,GAClD,IAAI;IAWP,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI;CAI7E"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ICNSStimulationContextStore } from './interfaces/ICNSStimulationContextStore';
|
|
2
|
-
export declare class CNSStimulationContextStore implements ICNSStimulationContextStore {
|
|
3
|
-
private ctx?;
|
|
4
|
-
constructor(ctx?: Map<object, unknown>);
|
|
5
|
-
get(key: object): unknown;
|
|
6
|
-
set(key: object, value: unknown): void;
|
|
7
|
-
getAll(): Map<object, unknown>;
|
|
8
|
-
setAll(values: Map<object, unknown>): void;
|
|
9
|
-
delete(key: object): void;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=CNSStimulationContextStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CNSStimulationContextStore.d.ts","sourceRoot":"","sources":["../src/CNSStimulationContextStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAEvF,qBAAa,0BAA2B,YAAW,2BAA2B;IAG1E,OAAO,CAAC,GAAG,CAAC,CAAuB;gBAEvB,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAItC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAItC,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAI9B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAM1C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAG5B"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { TCNSNeuron } from '../types/TCNSNeuron';
|
|
2
|
-
import type { TCNSDendrite } from '../types/TCNSDendrite';
|
|
3
|
-
import type { TCNSOptions } from '../types/TCNSOptions';
|
|
4
|
-
import type { TCNSStimulationOptions } from '../types/TCNSStimulationOptions';
|
|
5
|
-
import type { TCNSSignal } from '../types/TCNSSignal';
|
|
6
|
-
import type { TCNSStimulationResponse } from '../types/TCNSStimulationResponse';
|
|
7
|
-
import type { TCNSStimulationDrain } from '../types/TCNSStimulationDrain';
|
|
8
|
-
import type { CNSNetwork } from '../CNSNetwork';
|
|
9
|
-
import type { CNSStimulation } from '../CNSStimulation';
|
|
10
|
-
import type { CNSCollateral } from '../CNSCollateral';
|
|
11
|
-
export interface ICNS<TNeuron extends TCNSNeuron<any, any>, TDendrite extends TCNSDendrite<any, any, any> = TCNSDendrite<any, any, any>> {
|
|
12
|
-
options?: TCNSOptions;
|
|
13
|
-
network: CNSNetwork<TNeuron, TDendrite>;
|
|
14
|
-
/**
|
|
15
|
-
* Add a global response listener applied to all stimulations.
|
|
16
|
-
* Returns an unsubscribe function.
|
|
17
|
-
*/
|
|
18
|
-
addResponseListener(listener: (response: TCNSStimulationResponse) => void): () => void;
|
|
19
|
-
/**
|
|
20
|
-
* Add a global batch-boundary listener applied to all stimulations, called
|
|
21
|
-
* once at the end of every synchronous turn.
|
|
22
|
-
* Returns an unsubscribe function.
|
|
23
|
-
*/
|
|
24
|
-
addDrainListener(listener: (drain: TCNSStimulationDrain) => void): () => void;
|
|
25
|
-
stimulate(signalOrSignals: TCNSSignal<CNSCollateral<unknown>> | TCNSSignal<CNSCollateral<unknown>>[], options?: TCNSStimulationOptions<TCNSStimulationResponse>): CNSStimulation<TNeuron, TDendrite>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=ICNS.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICNS.d.ts","sourceRoot":"","sources":["../../src/interfaces/ICNS.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,IAAI,CACjB,OAAO,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EACpC,SAAS,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAE3E,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAExC;;;OAGG;IACH,mBAAmB,CACf,QAAQ,EAAE,CACN,QAAQ,EAAE,uBAAuB,KAChC,IAAI,GACV,MAAM,IAAI,CAAC;IAEd;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAE9E,SAAS,CACL,eAAe,EACT,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,GAClC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,EAC1C,OAAO,CAAC,EAAE,sBAAsB,CAAC,uBAAuB,CAAC,GAC1D,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;CACzC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TCNSSignal } from '../types/TCNSSignal';
|
|
2
|
-
import { CNSCollateral } from '../CNSCollateral';
|
|
3
|
-
export interface ICNSCollateral<TPayload> {
|
|
4
|
-
createSignal(payload: TPayload): TCNSSignal<CNSCollateral<TPayload>>;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=ICNSCollateral.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICNSCollateral.d.ts","sourceRoot":"","sources":["../../src/interfaces/ICNSCollateral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,cAAc,CAAC,QAAQ;IACpC,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;CACxE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface ICNSStimulationContextStore {
|
|
2
|
-
get: (key: object) => unknown;
|
|
3
|
-
set: (key: object, value: unknown) => void;
|
|
4
|
-
getAll: () => Map<object, unknown>;
|
|
5
|
-
setAll: (values: Map<object, unknown>) => void;
|
|
6
|
-
delete: (key: object) => void;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=ICNSStimulationContextStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICNSStimulationContextStore.d.ts","sourceRoot":"","sources":["../../src/interfaces/ICNSStimulationContextStore.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IACxC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9B,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSAfferentPath.d.ts","sourceRoot":"","sources":["../../src/types/TCNSAfferentPath.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC3B,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;CACzC,CAAC"}
|
package/dist/types/TCNSAxon.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { CNSCollateral } from '../CNSCollateral';
|
|
2
|
-
/**
|
|
3
|
-
* Axon type used by neurons.
|
|
4
|
-
*
|
|
5
|
-
* Historically this type only took a collateral name union and a single payload
|
|
6
|
-
* type, which meant every collateral on the axon was typed with the same
|
|
7
|
-
* payload (typically a union of all possible payloads).
|
|
8
|
-
*
|
|
9
|
-
* That broke property-level typing on `axon.*.createSignal(...)` – the payload
|
|
10
|
-
* parameter became a big union instead of the specific payload for that
|
|
11
|
-
* collateral.
|
|
12
|
-
*
|
|
13
|
-
* To fix this while keeping existing generic call sites mostly intact, we add
|
|
14
|
-
* a third type parameter that carries the original heterogeneous axon object.
|
|
15
|
-
* When that third parameter is provided, we preserve the precise payload type
|
|
16
|
-
* for each collateral.
|
|
17
|
-
*
|
|
18
|
-
* - `TCollateralName` / `TInputPayload` are still useful for higher-level
|
|
19
|
-
* generic constraints (unions of names / payloads).
|
|
20
|
-
* - `TCollaterals` is the concrete axon map used to recover the per-key
|
|
21
|
-
* payload types.
|
|
22
|
-
*/
|
|
23
|
-
export type TCNSAxon<TCollaterals extends Record<string, CNSCollateral<unknown>> = Record<string, CNSCollateral<unknown>>> = {
|
|
24
|
-
[K in keyof TCollaterals]: TCollaterals[K];
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=TCNSAxon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSAxon.d.ts","sourceRoot":"","sources":["../../src/types/TCNSAxon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,QAAQ,CAChB,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,CAChE,MAAM,EACN,aAAa,CAAC,OAAO,CAAC,CACzB,IACD;KACC,CAAC,IAAI,MAAM,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC;CAC7C,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CNSCollateral } from '../CNSCollateral';
|
|
2
|
-
import { TCNSAxon } from './TCNSAxon';
|
|
3
|
-
import { TNCNeuronResponseReturn } from './TCNSNeuronResponseReturn';
|
|
4
|
-
import { TCNSHandlerContext } from './TCNSHandlerContext';
|
|
5
|
-
export type TCNSDendrite<TContextValue, TSenderCollateral extends CNSCollateral<unknown>, TAxonType extends TCNSAxon, TExt = unknown> = {
|
|
6
|
-
collateral: TSenderCollateral;
|
|
7
|
-
response: (payload: TSenderCollateral extends CNSCollateral<infer P> ? P : never, axon: TAxonType, ctx: TCNSHandlerContext<TContextValue, TExt>) => TNCNeuronResponseReturn<TAxonType>;
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=TCNSDendrite.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,MAAM,YAAY,CACpB,aAAa,EACb,iBAAiB,SAAS,aAAa,CAAC,OAAO,CAAC,EAEhD,SAAS,SAAS,QAAQ,EAG1B,IAAI,GAAG,OAAO,IACd;IACA,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,CACN,OAAO,EAAE,iBAAiB,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,EACrE,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,kBAAkB,CAAC,aAAa,EAAE,IAAI,CAAC,KAC3C,uBAAuB,CAAC,SAAS,CAAC,CAAC;CAC3C,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSLocalContextValueStore.d.ts","sourceRoot":"","sources":["../../src/types/TCNSLocalContextValueStore.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,CAAC,aAAa,IAAI;IACpD,GAAG,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;IACrC,GAAG,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACpC,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSModality.d.ts","sourceRoot":"","sources":["../../src/types/TCNSModality.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG;IACvB,aAAa,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5D,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TCNSAxon } from './TCNSAxon';
|
|
2
|
-
import { TCNSDendrite } from './TCNSDendrite';
|
|
3
|
-
import { CNSCollateral } from '../CNSCollateral';
|
|
4
|
-
export type TCNSNeuron<TContextValue, TAxonType extends TCNSAxon = TCNSAxon> = {
|
|
5
|
-
axon: TAxonType;
|
|
6
|
-
/** Optional per-neuron concurrency limit. If undefined or <= 0, no limit is applied. */
|
|
7
|
-
concurrency?: number;
|
|
8
|
-
/** Optional per-neuron max processing duration in milliseconds. */
|
|
9
|
-
maxDuration?: number;
|
|
10
|
-
dendrites: TCNSDendrite<TContextValue, CNSCollateral<unknown>, TAxonType, any>[];
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=TCNSNeuron.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CNSCollateral } from '../CNSCollateral';
|
|
2
|
-
import { TCNSSignal } from './TCNSSignal';
|
|
3
|
-
export type TCNSNeuronActivationTask<TNeuron extends object = object, TCollateral extends CNSCollateral<unknown> = CNSCollateral<unknown>> = {
|
|
4
|
-
neuron: TNeuron;
|
|
5
|
-
dendriteCollateral: TCollateral;
|
|
6
|
-
input?: TCNSSignal<TCollateral>;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=TCNSNeuronActivationTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSNeuronActivationTask.d.ts","sourceRoot":"","sources":["../../src/types/TCNSNeuronActivationTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,wBAAwB,CAChC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,WAAW,SAAS,aAAa,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,IACnE;IACA,MAAM,EAAE,OAAO,CAAC;IAChB,kBAAkB,EAAE,WAAW,CAAC;IAChC,KAAK,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACnC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TCNSNeuronActivationTask } from './TCNSNeuronActivationTask';
|
|
2
|
-
export type TCNSNeuronActivationTaskFailure<TNeuron extends object = object> = {
|
|
3
|
-
task: TCNSNeuronActivationTask<TNeuron>;
|
|
4
|
-
error: Error;
|
|
5
|
-
aborted: boolean;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=TCNSNeuronActivationTaskFailure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSNeuronActivationTaskFailure.d.ts","sourceRoot":"","sources":["../../src/types/TCNSNeuronActivationTaskFailure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,MAAM,+BAA+B,CACvC,OAAO,SAAS,MAAM,GAAG,MAAM,IAC/B;IACA,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;IACxC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TCNSSignal } from './TCNSSignal';
|
|
2
|
-
import { TCNSAxon } from './TCNSAxon';
|
|
3
|
-
/**
|
|
4
|
-
* Allowed return types from a neuron dendrite `response` function.
|
|
5
|
-
*
|
|
6
|
-
* Signals route by collateral object identity (not by name).
|
|
7
|
-
*/
|
|
8
|
-
export type TNCNeuronResponseReturn<TAxon extends TCNSAxon> = Promise<TCNSSignal<TAxon[keyof TAxon]>> | TCNSSignal<TAxon[keyof TAxon]> | Promise<TCNSSignal<TAxon[keyof TAxon]>[]> | TCNSSignal<TAxon[keyof TAxon]>[] | Promise<void> | void;
|
|
9
|
-
//# sourceMappingURL=TCNSNeuronResponseReturn.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSNeuronResponseReturn.d.ts","sourceRoot":"","sources":["../../src/types/TCNSNeuronResponseReturn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,CAAC,KAAK,SAAS,QAAQ,IACpD,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,GACvC,UAAU,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,GAC9B,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,GACzC,UAAU,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,GAChC,OAAO,CAAC,IAAI,CAAC,GACb,IAAI,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type TCNSOptions = {
|
|
2
|
-
/**
|
|
3
|
-
* Automatically cleanup context stores when the stimulation is finished.
|
|
4
|
-
* Default is false.
|
|
5
|
-
*
|
|
6
|
-
* CAN AFFECT PERFORMANCE!
|
|
7
|
-
* Better to use only to solve problems with memory quickly.
|
|
8
|
-
*/
|
|
9
|
-
autoCleanupContexts?: boolean;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=TCNSOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSOptions.d.ts","sourceRoot":"","sources":["../../src/types/TCNSOptions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACtB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CNSCollateral } from '../CNSCollateral';
|
|
2
|
-
import { TCNSNeuron } from './TCNSNeuron';
|
|
3
|
-
type CNSCollateralLike = InstanceType<typeof CNSCollateral>;
|
|
4
|
-
export type TCNSNeuronPersistOptions<TNeuron extends TCNSNeuron<unknown, any> = TCNSNeuron<unknown, any>> = {
|
|
5
|
-
name: string;
|
|
6
|
-
neuron: TNeuron;
|
|
7
|
-
};
|
|
8
|
-
export type TCNSCollateralPersistOptions<TCollateral extends CNSCollateralLike = CNSCollateralLike> = {
|
|
9
|
-
name: string;
|
|
10
|
-
collateral: TCollateral;
|
|
11
|
-
};
|
|
12
|
-
export type TCNSStimulationPersistOptions = {
|
|
13
|
-
stimulationId: string;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=TCNSPersist.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSPersist.d.ts","sourceRoot":"","sources":["../../src/types/TCNSPersist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5D,MAAM,MAAM,wBAAwB,CAChC,OAAO,SAAS,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,IACnE;IACA,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,4BAA4B,CACpC,WAAW,SAAS,iBAAiB,GAAG,iBAAiB,IACzD;IACA,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC,aAAa,EAAE,MAAM,CAAC;CACzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSSignal.d.ts","sourceRoot":"","sources":["../../src/types/TCNSSignal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,UAAU,CAAC,WAAW,SAAS,aAAa,CAAC,OAAO,CAAC,IAAI;IACjE,UAAU,EAAE,WAAW,CAAC;IACxB,OAAO,CAAC,EAAE,WAAW,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CACpE,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { CNSStimulation } from '../CNSStimulation';
|
|
2
|
-
/**
|
|
3
|
-
* Announced when a stimulation's synchronous turn ends: everything reachable
|
|
4
|
-
* without yielding to the event loop has run, and what remains (if anything) is
|
|
5
|
-
* waiting on a promise or blocked by a concurrency limit.
|
|
6
|
-
*
|
|
7
|
-
* This is the batch boundary. It is a property of the scheduler loop exhausting,
|
|
8
|
-
* not of any individual activation starting or finishing - which is why it cannot
|
|
9
|
-
* be derived from `onResponse`. A turn ends in six ways, and a response is only
|
|
10
|
-
* emitted in the first:
|
|
11
|
-
*
|
|
12
|
-
* 1. an activation finished and left the queue empty
|
|
13
|
-
* 2. the last activation *started* and returned a promise
|
|
14
|
-
* 3. the stimulation-level `concurrency` limit was reached
|
|
15
|
-
* 4. the stimulation was aborted
|
|
16
|
-
* 5. subscribers are parked behind an async `onResponse` listener
|
|
17
|
-
* 6. a per-neuron `setConcurrency` gate forced an activation onto a promise
|
|
18
|
-
*
|
|
19
|
-
* Fires exactly once per turn, including the final one - so a listener that
|
|
20
|
-
* flushes on every drain needs no separate completion handling.
|
|
21
|
-
*
|
|
22
|
-
* The counters carry the same meaning as on `TCNSStimulationResponse`, but they
|
|
23
|
-
* are measured *after* the loop exhausted rather than before the work runs. On a
|
|
24
|
-
* response `pendingActivations` is a forecast; here it is a fact, and a non-zero
|
|
25
|
-
* value can only mean blocked - by a concurrency limit or by an abort - never
|
|
26
|
-
* "about to run".
|
|
27
|
-
*/
|
|
28
|
-
export type TCNSStimulationDrain = {
|
|
29
|
-
stimulation: CNSStimulation<any, any>;
|
|
30
|
-
/** `pendingActivations + activeActivations`. Zero means the stimulation is finished. */
|
|
31
|
-
queueLength: number;
|
|
32
|
-
/** Activations whose dendrite body has not been invoked. Non-zero here means blocked. */
|
|
33
|
-
pendingActivations: number;
|
|
34
|
-
/** Activations awaiting an unsettled promise. Non-zero means another drain is coming. */
|
|
35
|
-
activeActivations: number;
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=TCNSStimulationDrain.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSStimulationDrain.d.ts","sourceRoot":"","sources":["../../src/types/TCNSStimulationDrain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,WAAW,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtC,wFAAwF;IACxF,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,iBAAiB,EAAE,MAAM,CAAC;CAC7B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ICNSStimulationContextStore } from '../interfaces/ICNSStimulationContextStore';
|
|
2
|
-
import { TCNSModality } from './TCNSModality';
|
|
3
|
-
import { TCNSAfferentPath } from './TCNSAfferentPath';
|
|
4
|
-
import { TCNSStimulationDrain } from './TCNSStimulationDrain';
|
|
5
|
-
export type TCNSStimulationOptions<TResponse, TStimulationContext extends Object = {}> = {
|
|
6
|
-
maxNeuronHops?: number;
|
|
7
|
-
onResponse?: (response: TResponse) => void | Promise<void>;
|
|
8
|
-
/**
|
|
9
|
-
* Called once at the end of every synchronous turn - see
|
|
10
|
-
* {@link TCNSStimulationDrain}. This is the batch boundary for integrations
|
|
11
|
-
* that commit accumulated writes (state managers, in-memory databases).
|
|
12
|
-
*
|
|
13
|
-
* Returns `void` by design: a returned promise is not awaited. There is
|
|
14
|
-
* nothing to gate on - the next turn is started by someone else's promise
|
|
15
|
-
* settling, so awaiting here would only delay the callback. For asynchronous
|
|
16
|
-
* work at a boundary use `onResponse`, which does support promises.
|
|
17
|
-
*
|
|
18
|
-
* Re-entrant calls are safe. A nested `stimulate()` is a separate stimulation
|
|
19
|
-
* and announces its own boundary inline - that is the supported way to react
|
|
20
|
-
* to a drain. Feeding work back into the *same* stimulation via
|
|
21
|
-
* `enqueueTasks()` runs it, but folds it into the turn that is already
|
|
22
|
-
* closing, so it produces no additional boundary of its own.
|
|
23
|
-
*/
|
|
24
|
-
onDrain?: (drain: TCNSStimulationDrain) => void;
|
|
25
|
-
abortSignal?: AbortSignal;
|
|
26
|
-
ctx?: ICNSStimulationContextStore;
|
|
27
|
-
concurrency?: number;
|
|
28
|
-
modality?: TCNSModality;
|
|
29
|
-
afferentPath?: TCNSAfferentPath;
|
|
30
|
-
stimulationContext?: TStimulationContext;
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=TCNSStimulationOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSStimulationOptions.d.ts","sourceRoot":"","sources":["../../src/types/TCNSStimulationOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,CAC9B,SAAS,EACT,mBAAmB,SAAS,MAAM,GAAG,EAAE,IACvC;IACA,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,GAAG,CAAC,EAAE,2BAA2B,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,kBAAkB,CAAC,EAAE,mBAAmB,CAAC;CAC5C,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TCNSSubscriber } from './TCNSSubscriber';
|
|
2
|
-
import { TCNSSignal } from './TCNSSignal';
|
|
3
|
-
import { TCNSNeuron } from './TCNSNeuron';
|
|
4
|
-
import { TCNSDendrite } from './TCNSDendrite';
|
|
5
|
-
import { CNSCollateral } from '../CNSCollateral';
|
|
6
|
-
export type TCNSStimulationQueueItem<TNeuron extends TCNSNeuron<any, any>, TDendrite extends TCNSDendrite<any, any, any>, TInputCollateral extends CNSCollateral<unknown> = CNSCollateral<unknown>> = {
|
|
7
|
-
neuron: TNeuron;
|
|
8
|
-
subscriber: TCNSSubscriber<TNeuron, TDendrite>;
|
|
9
|
-
inputSignal?: TCNSSignal<TInputCollateral>;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=TCNSStimulationQueueItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSStimulationQueueItem.d.ts","sourceRoot":"","sources":["../../src/types/TCNSStimulationQueueItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,wBAAwB,CAChC,OAAO,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EACpC,SAAS,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC7C,gBAAgB,SAAS,aAAa,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,IACxE;IACA,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { TCNSSignal } from './TCNSSignal';
|
|
2
|
-
import { CNSStimulation } from '../CNSStimulation';
|
|
3
|
-
import { TCNSModality } from './TCNSModality';
|
|
4
|
-
import { TCNSAfferentPath } from './TCNSAfferentPath';
|
|
5
|
-
import { CNSCollateral } from '../CNSCollateral';
|
|
6
|
-
export type TCNSStimulationResponse<TInputCollateral extends CNSCollateral<unknown> = CNSCollateral<unknown>, TOutputCollateral extends CNSCollateral<unknown> = CNSCollateral<unknown>> = {
|
|
7
|
-
inputSignal?: TCNSSignal<TInputCollateral>;
|
|
8
|
-
outputSignal?: TCNSSignal<TOutputCollateral>;
|
|
9
|
-
modality?: TCNSModality;
|
|
10
|
-
afferentPath?: TCNSAfferentPath;
|
|
11
|
-
contextValue: Map<object, unknown>;
|
|
12
|
-
/**
|
|
13
|
-
* Every activation this stimulation still owns, in any state:
|
|
14
|
-
* `pendingActivations + activeActivations`.
|
|
15
|
-
*
|
|
16
|
-
* The unit is an activation - one `TCNSNeuronActivationTask`, i.e. one
|
|
17
|
-
* (neuron, dendrite, signal) triple. A single signal produces one activation
|
|
18
|
-
* per subscriber of its collateral.
|
|
19
|
-
*
|
|
20
|
-
* Active activations are counted deliberately: the queue owns work that has
|
|
21
|
-
* been handed to a neuron but not finished, the same way an AMQP queue counts
|
|
22
|
-
* unacknowledged messages in its total. `getAllActivationTasks()` follows the
|
|
23
|
-
* same model.
|
|
24
|
-
*
|
|
25
|
-
* `queueLength === 0` means the stimulation is finished - it is the exact
|
|
26
|
-
* condition used internally to settle `waitUntilComplete()`, so it holds on
|
|
27
|
-
* the terminal response and nowhere else.
|
|
28
|
-
*
|
|
29
|
-
* NOT a synchronous-batch boundary. A response is emitted when an activation
|
|
30
|
-
* finishes, but a batch can also end when one *starts* and goes async, and no
|
|
31
|
-
* response is emitted at that moment. Use `onDrain` for batch boundaries.
|
|
32
|
-
*/
|
|
33
|
-
queueLength: number;
|
|
34
|
-
/**
|
|
35
|
-
* Activations that exist (or are reserved) but whose dendrite body has not
|
|
36
|
-
* been invoked yet: waiting in the ring buffer, created and held before being
|
|
37
|
-
* enqueued, or reserved by an array fan-out that is still mid-dispatch.
|
|
38
|
-
*
|
|
39
|
-
* Subscribers parked behind an async `onResponse` listener are counted here,
|
|
40
|
-
* not in {@link activeActivations}: the split is by lifecycle stage - whether
|
|
41
|
-
* the body has started - not by whether something is being awaited.
|
|
42
|
-
*/
|
|
43
|
-
pendingActivations: number;
|
|
44
|
-
/**
|
|
45
|
-
* Activations whose dendrite body has been invoked and returned a promise
|
|
46
|
-
* that has not settled.
|
|
47
|
-
*
|
|
48
|
-
* A synchronous body passes through this state within a single pump
|
|
49
|
-
* iteration and is decremented before its response is emitted, so only
|
|
50
|
-
* genuinely asynchronous activations are ever observed here.
|
|
51
|
-
*/
|
|
52
|
-
activeActivations: number;
|
|
53
|
-
stimulation: CNSStimulation<any, any>;
|
|
54
|
-
error?: Error;
|
|
55
|
-
hops?: number;
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=TCNSStimulationResponse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSStimulationResponse.d.ts","sourceRoot":"","sources":["../../src/types/TCNSStimulationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,uBAAuB,CAC/B,gBAAgB,SAAS,aAAa,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,EACxE,iBAAiB,SAAS,aAAa,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,IACzE;IACA,WAAW,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;;OAQG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B,WAAW,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAEtC,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSStimulationSerializedContextValue.d.ts","sourceRoot":"","sources":["../../src/types/TCNSStimulationSerializedContextValue.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qCAAqC,GAAG;IAChD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TCNSDendrite } from './TCNSDendrite';
|
|
2
|
-
import { TCNSNeuron } from './TCNSNeuron';
|
|
3
|
-
export type TCNSSubscriber<TNeuron extends TCNSNeuron<any, any>, TDendrite extends TCNSDendrite<any, any, any>> = {
|
|
4
|
-
neuron: TNeuron;
|
|
5
|
-
dendrite: TDendrite;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=TCNSSubscriber.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TCNSSubscriber.d.ts","sourceRoot":"","sources":["../../src/types/TCNSSubscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,cAAc,CACtB,OAAO,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EACpC,SAAS,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAC7C;IACA,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACvB,CAAC"}
|