@codenotch/process 0.0.0-dev → 0.1.4

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.
Files changed (2) hide show
  1. package/README.md +51 -51
  2. package/package.json +43 -43
package/README.md CHANGED
@@ -1,51 +1,51 @@
1
- # @codenotch/process
2
-
3
- The standard library and type surface of Codenotch script processes.
4
-
5
- Script processes execute **on the server only**: the engine embeds this package's
6
- compiled runtime and serves it to `require('@codenotch/process')` inside the V8 workflow
7
- sandbox. What the package distributes to process authors is the **type declarations**
8
- (`dist/types`) — there is no client-side execution, and the runtime never ships in a
9
- process bundle (the deploy bundler treats the package as external).
10
-
11
- ## Layout
12
-
13
- ```
14
- src/lib the public library: process()/triggers, ctx (Context), errors,
15
- Instant, Duration, Decimal, encodings, url, canonicalJson, is, hash.
16
- Pure TypeScript; talks to the engine only through the EngineBindings
17
- seam (bindings.ts). dist/types is emitted from here.
18
- src/runtime the wire-protocol layer: sandbox hardening, the command channel over
19
- the __host adapter, and the engine entry points (__start, __deliver,
20
- __cancelDeliver, __deliverChildEvent, __processMetadataJson,
21
- __concurrencyKey). Engine-internal — never part of the public types.
22
- src/activity the '@codenotch/process/activity' entry: activity() and the activity-side
23
- types. Ships as runtime JS (dist/activity.mjs) — the deploy bundler
24
- inlines it into each activity bundle (activities run on Node).
25
- src/testing the '@codenotch/process/testing' entry: the process-test facade
26
- (test/expect/env — see doc/reference/process-tests.md). Its bundle
27
- (dist/test-prelude.js) is the engine's V8 test-host prelude; the entry
28
- distributes types only, like the root.
29
- ```
30
-
31
- ## Build
32
-
33
- `node build.mjs` — type-checks, emits `dist/types` and bundles the three runtimes:
34
- `src/runtime/prelude.ts` → `dist/prelude.js` (IIFE), `src/activity/index.ts` →
35
- `dist/activity.mjs`, `src/testing/main.ts` → `dist/test-prelude.js` (IIFE). Output files
36
- are rewritten only when content changed. The `Echino.Services.Framework.Processes`
37
- csproj runs this automatically when sources changed and embeds `dist/prelude.js`
38
- (`ScriptEngine.WorkflowPrelude.js`) and `dist/test-prelude.js`
39
- (`ScriptEngine.TestPrelude.js`), so the engine and the types can never drift.
40
-
41
- `dist/` is committed: a .NET-only checkout builds without running npm as long as the
42
- TypeScript sources are untouched.
43
-
44
- ## Rules (doc/reference/process-stdlib.md holds the user-facing docs)
45
-
46
- - Every `ctx` method and library function is documented (JSDoc here, reference doc there)
47
- and covered by an example-grade fixture in
48
- `test/Echino.Services.Framework.Processes.Test/testSchemas/StdlibTests`.
49
- - Strong typing first, dynamic as fallback (`ctx.call(handle)` over `ctx.call<In, Out>('name')`).
50
- - The library layer stays pure: anything touching the world goes through the bindings
51
- seam and is journaled by the engine.
1
+ # @codenotch/process
2
+
3
+ The standard library and type surface of Codenotch script processes.
4
+
5
+ Script processes execute **on the server only**: the engine embeds this package's
6
+ compiled runtime and serves it to `require('@codenotch/process')` inside the V8 workflow
7
+ sandbox. What the package distributes to process authors is the **type declarations**
8
+ (`dist/types`) — there is no client-side execution, and the runtime never ships in a
9
+ process bundle (the deploy bundler treats the package as external).
10
+
11
+ ## Layout
12
+
13
+ ```
14
+ src/lib the public library: process()/triggers, ctx (Context), errors,
15
+ Instant, Duration, Decimal, encodings, url, canonicalJson, is, hash.
16
+ Pure TypeScript; talks to the engine only through the EngineBindings
17
+ seam (bindings.ts). dist/types is emitted from here.
18
+ src/runtime the wire-protocol layer: sandbox hardening, the command channel over
19
+ the __host adapter, and the engine entry points (__start, __deliver,
20
+ __cancelDeliver, __deliverChildEvent, __processMetadataJson,
21
+ __concurrencyKey). Engine-internal — never part of the public types.
22
+ src/activity the '@codenotch/process/activity' entry: activity() and the activity-side
23
+ types. Ships as runtime JS (dist/activity.mjs) — the deploy bundler
24
+ inlines it into each activity bundle (activities run on Node).
25
+ src/testing the '@codenotch/process/testing' entry: the process-test facade
26
+ (test/expect/env — see doc/reference/process-tests.md). Its bundle
27
+ (dist/test-prelude.js) is the engine's V8 test-host prelude; the entry
28
+ distributes types only, like the root.
29
+ ```
30
+
31
+ ## Build
32
+
33
+ `node build.mjs` — type-checks, emits `dist/types` and bundles the three runtimes:
34
+ `src/runtime/prelude.ts` → `dist/prelude.js` (IIFE), `src/activity/index.ts` →
35
+ `dist/activity.mjs`, `src/testing/main.ts` → `dist/test-prelude.js` (IIFE). Output files
36
+ are rewritten only when content changed. The `Echino.Services.Framework.Processes`
37
+ csproj runs this automatically when sources changed and embeds `dist/prelude.js`
38
+ (`ScriptEngine.WorkflowPrelude.js`) and `dist/test-prelude.js`
39
+ (`ScriptEngine.TestPrelude.js`), so the engine and the types can never drift.
40
+
41
+ `dist/` is committed: a .NET-only checkout builds without running npm as long as the
42
+ TypeScript sources are untouched.
43
+
44
+ ## Rules (doc/reference/process-stdlib.md holds the user-facing docs)
45
+
46
+ - Every `ctx` method and library function is documented (JSDoc here, reference doc there)
47
+ and covered by an example-grade fixture in
48
+ `test/Echino.Services.Framework.Processes.Test/testSchemas/StdlibTests`.
49
+ - Strong typing first, dynamic as fallback (`ctx.call(handle)` over `ctx.call<In, Out>('name')`).
50
+ - The library layer stays pure: anything touching the world goes through the bindings
51
+ seam and is journaled by the engine.
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
- {
2
- "name": "@codenotch/process",
3
- "version": "0.0.0-dev",
4
- "description": "Types and standard library for Codenotch script processes. Processes execute on the server only: the engine embeds the compiled runtime (dist/prelude.js); this package distributes the type declarations.",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/EchinoHub/service-core.git",
8
- "directory": "src/codenotch-process"
9
- },
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "types": "./dist/types/lib/index.d.ts",
14
- "exports": {
15
- ".": {
16
- "types": "./dist/types/lib/index.d.ts"
17
- },
18
- "./activity": {
19
- "types": "./dist/types/activity/index.d.ts",
20
- "default": "./dist/activity.mjs"
21
- },
22
- "./template": {
23
- "types": "./dist/types/template/index.d.ts",
24
- "default": "./dist/template.mjs"
25
- },
26
- "./testing": {
27
- "types": "./dist/types/testing/index.d.ts"
28
- }
29
- },
30
- "files": [
31
- "dist/types",
32
- "dist/activity.mjs",
33
- "dist/template.mjs"
34
- ],
35
- "scripts": {
36
- "build": "node build.mjs",
37
- "check": "tsc -p tsconfig.json --noEmit"
38
- },
39
- "devDependencies": {
40
- "esbuild": "^0.25.9",
41
- "typescript": "^5.9.2"
42
- }
43
- }
1
+ {
2
+ "name": "@codenotch/process",
3
+ "version": "0.1.4",
4
+ "description": "Types and standard library for Codenotch script processes. Processes execute on the server only: the engine embeds the compiled runtime (dist/prelude.js); this package distributes the type declarations.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/EchinoHub/service-core.git",
8
+ "directory": "src/codenotch-process"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "types": "./dist/types/lib/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/types/lib/index.d.ts"
17
+ },
18
+ "./activity": {
19
+ "types": "./dist/types/activity/index.d.ts",
20
+ "default": "./dist/activity.mjs"
21
+ },
22
+ "./template": {
23
+ "types": "./dist/types/template/index.d.ts",
24
+ "default": "./dist/template.mjs"
25
+ },
26
+ "./testing": {
27
+ "types": "./dist/types/testing/index.d.ts"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist/types",
32
+ "dist/activity.mjs",
33
+ "dist/template.mjs"
34
+ ],
35
+ "scripts": {
36
+ "build": "node build.mjs",
37
+ "check": "tsc -p tsconfig.json --noEmit"
38
+ },
39
+ "devDependencies": {
40
+ "esbuild": "^0.25.9",
41
+ "typescript": "^5.9.2"
42
+ }
43
+ }