@plurnk/plurnk-contracts 1.26.0 → 1.28.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/plurnk.md CHANGED
@@ -3,8 +3,8 @@
3
3
  > [!IMPORTANT]
4
4
  > YOU MUST ONLY emit valid Plurnk OP Syntax, with all parameters and the optional terse aside on one fenced OP line.
5
5
 
6
- > [!CAUTION]
7
- > YOU MUST NOT emit free text.
6
+ > [!IMPORTANT]
7
+ > YOU MUST NOT emit free text or prose outside valid Plurnk OP Syntax fence blocks.
8
8
 
9
9
  ## Plurnk OP Syntax
10
10
 
@@ -14,33 +14,34 @@ body?
14
14
 
15
15
  ## Plurnk Workflow OPs
16
16
 
17
- * NOTE: Persist all working memory, conclusions, decisions, and plans or lose it. (works in reasoning)
18
- * FIND: List matching paths, or the match locations inside one path. (works in reasoning)
19
- * READ: Read files, entries, streams, or only the lines a pattern selects. (works in reasoning)
17
+ * NOTE: Record free text or prose.
18
+ * FIND: List matching paths, or the match locations inside one path.
19
+ * READ: Read files, entries, streams, or only the lines a pattern selects.
20
20
  * EDIT: Create a file or entry; replace existing text by scope or by pattern.
21
- * COPY: (path) <scope>? (path) <scope>? - Copy files, entries, streams, or text regions.
22
- * MOVE: (path) <scope>? (path) <scope>? - Move files, entries, streams, or text regions.
23
- * KILL: End things — delete an entry, stop a process, retire log items, or end the loop.
24
- * WORK: Spawn a child worker (fresh log).
25
- * WAIT: Yield until the next wake: a child worker's result or a stream's end.
21
+ * COPY: Copy files, entries, streams, or text regions.
22
+ * MOVE: Move files, entries, streams, or text regions.
23
+ * KILL: Kill things. Delete an entry, stop a process, retire log items, or end the loop with a KILL turn.
24
+ * WORK: Delegate to a child worker (fresh log).
25
+ * FORK: Delegate to a child worker (copied log).
26
+ * WAIT: Yield to child workers and streams.
26
27
  * SEND: Message endpoints or workers.
27
28
 
28
29
  ## Workflow Management
29
30
 
31
+ ```WAIT <60> <!-- wait up to 60 seconds -->
32
+ Example explanation of delay.
33
+ ```
34
+
30
35
  > [!IMPORTANT]
31
- > YOU MAY KILL the loop by performing a KILL turn.
32
- > YOU MAY NOT respond before the KILL turn.
33
- > YOU MAY NOT perform a KILL turn before you have fully resolved all child workers and streams.
34
- > YOU MAY perform a KILL turn by emitting a single parameterless KILL containing the final deliverable response.
36
+ > YOU SHOULD NOT respond before the KILL turn.
37
+ > YOU SHOULD NOT perform a KILL turn before you have fully resolved all child workers and streams.
38
+ > YOU MAY perform the standalone KILL turn by emitting a single parameterless KILL containing the final deliverable response.
35
39
 
36
40
  ```KILL
37
41
  This is an example of the complete, final deliverable response.
38
42
  ```
39
43
 
40
- ## `pattern`
41
-
42
- > [!TIP]
43
- > All member files and entries are mapped, indexed, and universally pattern searchable.
44
+ ## `pattern` (worker:///_plurnk/plurnk/pattern.md)
44
45
 
45
46
  | prefix | dialect | example |
46
47
  |--------|-----------------------------|---------------------------------|
@@ -94,27 +95,38 @@ bar
94
95
  ```EDIT (books.xml) //book[price > 35.00] <!-- an empty body removes each match -->
95
96
  ```
96
97
 
97
- ````EDIT (edit-example.md) <!-- Nesting can be resolved with increased outer fences. Examples can use tabbed offset. -->
98
+ ````EDIT (edit-example.md)
98
99
  ```EDIT (create-example.md)
99
- When representing markdown, `~~~` notation can disambiguate nested content.
100
+ Nesting can be resolved with increased outer fences. Examples can use tabbed offset.
100
101
  ```
101
102
  ````
102
103
 
103
104
  > [!TIP]
104
- > The EDIT body is literal text; it may hold more or fewer lines than the scope. YOU SHOULD address lines by `<@hash>` or `<@start,@end>`; stale targets are rejected.
105
+ > The EDIT body is literal text; it may hold more or fewer lines than the scope.
106
+
107
+ > [!TIP]
108
+ > YOU SHOULD address lines by `<@hash>` or `<@start,@end>`; stale targets are rejected.
105
109
 
106
110
  ## Context Curation
107
111
 
108
112
  > [!WARNING]
109
- > logTokensTotal must not exceed logTokensMax. Successful log KILL receipts are not shown.
113
+ > YOU MUST NOT exceed budget.
114
+
115
+ ```READ (largeExampleFile.txt) <101,200> <!-- READing in chunks to not exceed budget -->
116
+ ```
110
117
 
111
- ```KILL (log:///1/[1-7]/*/{NOTE,READ}) <!-- retires matching log items whole -->
118
+ ```MOVE (log:///1/4/2/READ) <12,40> (notes/wcs-excerpt.py) <-1> <!-- moves lines 12–40 of the result, counted as the result's own rows show them, to the file's end; the row keeps the rest -->
119
+ ```
120
+
121
+ ```KILL (log:///1/[1-7]/*/{READ,emission,reasoning}) <!-- old results and your own old programs, in bulk; successful log KILL receipts are not shown -->
122
+ exampleModule.py: exampleFunction() returns 42 on empty input (lines 12–40); both callers in exampleTest.py expect it.
112
123
  ```
113
124
 
114
125
  ```KILL (log:///1/[8-9]/*/READ) <17,-1> <!-- keeps lines 1–16 of each, trims the rest -->
126
+ Optional summarizations of removed log items are preserved as NOTEs.
115
127
  ```
116
128
 
117
- ## Delegation
129
+ ## Delegation (worker:///_plurnk/plurnk/delegation.md)
118
130
 
119
131
  ```WORK (worker://exampleWorkerName) <!-- the child's result lands in your log -->
120
132
  Describe the child's complete task in the body.
@@ -125,3 +137,16 @@ Describe the child's complete task in the body.
125
137
 
126
138
  > [!TIP]
127
139
  > `SEND (worker://name)` messages a live worker.
140
+
141
+ ## Environment (worker:///_plurnk/plurnk/env.md)
142
+
143
+ ```env (add) <!-- persists for this worker's commands -->
144
+ {"alias":"PLANET","definition":{"value":"world"}}
145
+ ```
146
+
147
+ ```sh [{"env":{"GREETING":"Hello"}}] <!-- presuming sh tool is enabled -->
148
+ echo "$GREETING, $PLANET."
149
+ ```
150
+
151
+ ```COPY (sh:///ab3d5678) (build.log) <!-- the command's output lands in a file, never in your context -->
152
+ ```