depa-actor 0.2.0 → 0.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/addressing.d.ts +100 -0
- package/dist/addressing.d.ts.map +1 -0
- package/dist/addressing.js +409 -0
- package/dist/addressing.js.map +1 -0
- package/dist/dispatch/ActorDispatchAdapter.d.ts +74 -17
- package/dist/dispatch/ActorDispatchAdapter.d.ts.map +1 -1
- package/dist/dispatch/ActorDispatchAdapter.js +109 -24
- package/dist/dispatch/ActorDispatchAdapter.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/ActorPipeline.d.ts +35 -8
- package/dist/pipeline/ActorPipeline.d.ts.map +1 -1
- package/dist/pipeline/ActorPipeline.js +26 -16
- package/dist/pipeline/ActorPipeline.js.map +1 -1
- package/dist-cjs/addressing.cjs +424 -0
- package/dist-cjs/dispatch/ActorDispatchAdapter.cjs +109 -24
- package/dist-cjs/index.cjs +26 -1
- package/dist-cjs/pipeline/ActorPipeline.cjs +26 -16
- package/package.json +4 -1
- package/src/addressing.ts +756 -0
- package/src/dispatch/ActorDispatchAdapter.ts +218 -47
- package/src/index.ts +55 -2
- package/src/pipeline/ActorPipeline.ts +103 -57
|
@@ -2,33 +2,43 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* depa-actor — ActorPipeline
|
|
4
4
|
*
|
|
5
|
-
* Adapts the DOP 6-step pipeline
|
|
5
|
+
* Adapts the DOP 6-step pipeline to actor context by REUSING the depa-processor
|
|
6
|
+
* `component` primitives (DEPA dimension chain Processor → Actor): the 6-step
|
|
7
|
+
* orchestration is delegated to `runByFuncStyleAdapter`, identity/null seams come
|
|
8
|
+
* from `stdMake*`, and the core-logic seam is `StdInnerLogic` verbatim — this module
|
|
9
|
+
* no longer re-implements a parallel copy of `component/types.ts`.
|
|
6
10
|
*
|
|
7
|
-
* Mapping:
|
|
11
|
+
* Mapping (outer dimension):
|
|
8
12
|
* OuterRuntime = ActorSelf
|
|
9
13
|
* OuterInput = envelope payload
|
|
10
14
|
* OuterConfig = actor state
|
|
11
15
|
*
|
|
16
|
+
* Step 6 (output) is adapted with `TOuterOutput = void`: actor output is a side
|
|
17
|
+
* effect (write `self.state` / `self.send`), not a returned value. This thinly
|
|
18
|
+
* adapts depa-processor's pure-function `StdOuterOutputAdapter` without leaking
|
|
19
|
+
* actor semantics back into the generic primitive.
|
|
20
|
+
*
|
|
12
21
|
* createPipelineHandler() wraps a pipeline definition into an ActorHandler.
|
|
13
22
|
*/
|
|
14
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
24
|
exports.createPipelineHandler = createPipelineHandler;
|
|
25
|
+
const depa_processor_1 = require("depa-processor");
|
|
16
26
|
// ─── createPipelineHandler ───────────────────────────────────────────
|
|
27
|
+
/**
|
|
28
|
+
* Wrap a pipeline definition into an ActorHandler by delegating the 6-step
|
|
29
|
+
* orchestration to depa-processor `runByFuncStyleAdapter`.
|
|
30
|
+
*
|
|
31
|
+
* Outer dimension: runtime = self, input = payload, config = state.
|
|
32
|
+
* Step 6 produces `void` — `runByFuncStyleAdapter` runs the output adapter for its
|
|
33
|
+
* side effects and the (void) return value is discarded.
|
|
34
|
+
*/
|
|
17
35
|
function createPipelineHandler(pipeline) {
|
|
18
36
|
return async (self, envelope) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// Step 3: Transform input
|
|
26
|
-
const innerInput = pipeline.innerInput(self, payload, state, derived);
|
|
27
|
-
// Step 4: Transform config
|
|
28
|
-
const innerConfig = pipeline.innerConfig(self, payload, state, derived);
|
|
29
|
-
// Step 5: Core logic
|
|
30
|
-
const innerOutput = await pipeline.coreLogic(innerRuntime, innerInput, innerConfig);
|
|
31
|
-
// Step 6: Output (side effects on actor state / send messages)
|
|
32
|
-
await pipeline.output(self, payload, state, derived, innerOutput);
|
|
37
|
+
// `runByFuncStyleAdapter` returns the output adapter's value verbatim (without
|
|
38
|
+
// awaiting it). Capture it and await so an async step-6 side effect (write
|
|
39
|
+
// state / send messages) is fully settled before the handler resolves —
|
|
40
|
+
// preserving the original `await pipeline.output(...)` semantics.
|
|
41
|
+
const outputResult = await (0, depa_processor_1.runByFuncStyleAdapter)(self, envelope.payload, self.state, pipeline.computeDerived, pipeline.innerRuntime, pipeline.innerInput, pipeline.innerConfig, pipeline.coreLogic, pipeline.output);
|
|
42
|
+
await outputResult;
|
|
33
43
|
};
|
|
34
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "depa-actor",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist-cjs/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
"dist-cjs",
|
|
18
18
|
"src"
|
|
19
19
|
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"depa-processor": "0.1.1"
|
|
22
|
+
},
|
|
20
23
|
"scripts": {
|
|
21
24
|
"build": "tsc && tsc -p tsconfig.cjs.json && node scripts/build-cjs.mjs",
|
|
22
25
|
"dev": "tsc --watch",
|