@plurnk/plurnk-execs-jq 1.20.0 → 1.21.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/.env.defaults ADDED
@@ -0,0 +1,3 @@
1
+ # @plurnk/plurnk-execs-jq — opt-in JSON filtering.
2
+ # Set to 1 to register jq; the interpreter must also be on PATH.
3
+ PLURNK_EXECS_JQ=0
package/README.md CHANGED
@@ -23,6 +23,7 @@ line ({§executor-output-address}).
23
23
 
24
24
  ## Effect & availability
25
25
 
26
+ - Disabled by default. Set `PLURNK_EXECS_JQ=1` in the environment cascade to enable it.
26
27
  - **`effect`** — inline/`-n` is `pure`; a target data source is `read`. Both
27
28
  bypass the human proposal gate, then stream on the same next-turn path as
28
29
  every execution ({§executor-effect}).
package/docs/jq.md CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  The system `jq` as a runtime: the **body is the jq program**, the **`(target)` is the data source**.
4
4
 
5
- ````jq
5
+ ```jq
6
6
  [1,2,3] | add
7
- ````
7
+ ```
8
8
 
9
- ````jq (data.json)
9
+ ```jq (data.json)
10
10
  .users[].name
11
- ````
11
+ ```
12
12
 
13
- ````jq (sqlite:///ab3d5678#results)
13
+ ```jq (sqlite:///ab3d5678#results)
14
14
  .[] | .name
15
- ````
15
+ ```
16
16
 
17
17
  The first form has no input and uses `-n`. The second filters a file. The third
18
18
  filters the result stream at the emitted SQLite address.
@@ -29,24 +29,24 @@ address.
29
29
 
30
30
  `jq` reads the ambient environment (`env`, `$ENV`) per its own contract — the consumer's scoped env is honored when provided.
31
31
 
32
+ ## Errors
33
+
34
+ A failed program or spawn closes `results` as `errored` with status 500 and an
35
+ RFC 9457 Problem carrying jq's own stderr.
36
+
32
37
  ## Live input
33
38
 
34
- ````jq [{"stdin": "open"}]
39
+ ```jq [{"stdin": "open"}]
35
40
  .value * 2
36
- ````
41
+ ```
37
42
 
38
43
  Use the returned stream address, here `jq:///c4e56789`. A SEND body is input
39
44
  JSON, not another jq program; this example closes stdin after sending its value:
40
45
 
41
- ````SEND (jq:///c4e56789) [{"eof": true}]
46
+ ```SEND (jq:///c4e56789) [{"eof": true}]
42
47
  {"value":21}
43
- ````
48
+ ```
44
49
 
45
50
  Without `[{"eof": true}]`, include an actual trailing newline to delimit each JSON
46
51
  value. Open-input output is unbuffered. READ the same address for results;
47
52
  SEND acknowledges only input delivery. KILL remains execution cancellation.
48
-
49
- ## Errors
50
-
51
- A failed program or spawn closes `results` as `errored` with status 500 and an
52
- RFC 9457 Problem carrying jq's own stderr.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-execs-jq",
3
- "version": "1.20.0",
3
+ "version": "1.21.1",
4
4
  "description": "jq runtime executor for plurnk-service's exec scheme — shells the system jq binary to filter or transform JSON.",
5
5
  "keywords": [
6
6
  "plurnk",
@@ -64,11 +64,12 @@
64
64
  "files": [
65
65
  "dist/**/*",
66
66
  "README.md",
67
+ ".env.defaults",
67
68
  "docs/**/*"
68
69
  ],
69
70
  "scripts": {
70
71
  "test:lint": "tsc --noEmit",
71
- "test:unit": "node --conditions=plurnk-dev --env-file-if-exists=../plurnk-execs/.env.defaults --test \"src/**/*.test.ts\"",
72
+ "test:unit": "node --conditions=plurnk-dev --env-file-if-exists=.env.defaults --env-file-if-exists=../plurnk-execs/.env.defaults --test \"src/**/*.test.ts\"",
72
73
  "test": "npm run test:lint && npm run test:unit",
73
74
  "build:clean": "rm -rf dist",
74
75
  "build:dist": "tsc -p tsconfig.build.json",
@@ -77,6 +78,6 @@
77
78
  "prepublishOnly": "npm audit --audit-level=moderate && npm test"
78
79
  },
79
80
  "peerDependencies": {
80
- "@plurnk/plurnk-execs": "^1.20.0"
81
+ "@plurnk/plurnk-execs": "^1.21.1"
81
82
  }
82
83
  }