@plurnk/plurnk-grammar 0.76.4 → 0.76.6

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/package.json +1 -1
  2. package/plurnk.md +31 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-grammar",
3
- "version": "0.76.4",
3
+ "version": "0.76.6",
4
4
  "description": "ANTLR4 grammar for the Plurnk LLM agent protocol",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/plurnk.md CHANGED
@@ -11,7 +11,7 @@ Plurnk Service Features:
11
11
 
12
12
  ## Plurnk Service Grammar
13
13
 
14
- YOU MUST ONLY use the Plurnk OPs (PLAN|FIND|READ|EDIT|COPY|MOVE|OPEN|FOLD|EXEC|KILL|SEND).
14
+ YOU MUST ONLY use the Plurnk OPs (PLAN|FIND|READ|EDIT|COPY|MOVE|OPEN|FOLD|EXEC|WORK|FORK|KILL|SEND).
15
15
 
16
16
  ### Syntax
17
17
 
@@ -19,28 +19,30 @@ YOU MUST ONLY use the Plurnk OPs (PLAN|FIND|READ|EDIT|COPY|MOVE|OPEN|FOLD|EXEC|K
19
19
 
20
20
  ### OPs
21
21
 
22
- Fields are optional unless otherwise specified.
23
- The `(path)` is required for every operation except PLAN, EXEC, and SEND.
24
-
25
- | OP | `[signal]` | `(path)` | `<scope>` | :body: | OP |
26
- |------|---------------|-------------|-------------------|--------------------|------|
27
- | PLAN | - | - | - | :plan, free text: | PLAN |
28
- | FIND | [tags] | (path) | <result,result> | :pattern: | FIND |
29
- | READ | [tags] | (path) | <line,line> | :pattern: | READ |
30
- | EDIT | [tags] | (path) | <line,line> | :literal text: | EDIT |
31
- | COPY | [tags] | (path) | <line,line> | :destination path: | COPY |
32
- | MOVE | [tags] | (path) | <line,line> | :destination path: | MOVE |
33
- | OPEN | [tags] | (log path) | <result,result> | :pattern: | OPEN |
34
- | FOLD | [tags] | (log path) | <result,result> | :pattern: | FOLD |
35
- | EXEC | [executor] | (path) | <timeout, poll> | :code: | EXEC |
36
- | KILL | [signal] | (path) | - | :: | KILL |
37
- | SEND | [submit code] | (recipient) | <timeout, poll> | :message: | SEND |
22
+ A `?` marks an optional field, as in the Syntax line; unmarked fields are required.
23
+
24
+ | OP | `[signal]` | `(path)` | `<scope>` | :body: | OP |
25
+ |------|----------------|--------------|--------------------|--------------------|------|
26
+ | PLAN | - | - | - | :plan, free text: | PLAN |
27
+ | FIND | [tags]? | (path) | <result,result>? | :pattern:? | FIND |
28
+ | READ | [tags]? | (path) | <line,line>? | :pattern:? | READ |
29
+ | EDIT | [tags]? | (path) | <line,line>? | :literal text:? | EDIT |
30
+ | COPY | [tags]? | (path) | <line,line>? | :destination path: | COPY |
31
+ | MOVE | [tags]? | (path) | <line,line>? | :destination path: | MOVE |
32
+ | OPEN | [tags]? | (log path) | <result,result>? | :pattern:? | OPEN |
33
+ | FOLD | [tags]? | (log path) | <result,result>? | :pattern:? | FOLD |
34
+ | EXEC | [executor]? | (path)? | <timeout, poll>? | :code:? | EXEC |
35
+ | WORK | - | (run://name) | - | :task: | WORK |
36
+ | FORK | - | (run://name) | - | :hint:? | FORK |
37
+ | KILL | [signal]? | (path) | - | :: | KILL |
38
+ | SEND | [submit code]? | (recipient)? | <timeout, poll>? | :message: | SEND |
38
39
 
39
40
  <<PLAN:concise plan goes here:PLAN is required at the beginning of a turn.
40
41
  <<FIND(path)::FIND returns a JSON array of matches: each object carries its path and per-channel mimetype, tokens, and lines. READ a hit's path to view it.
41
42
  <<READ(path)::READ returns lines of matching content. Every line is prefixed with the line number and a hard tab, `N: `.
42
43
  <<EDIT(path):literal text:EDIT is only for creating or modifying files and entries. Do not attempt to edit log items.
43
44
  <<EDIT(path):literal text:EDIT replaces the selected line(s) `<line,line>` with literal body content, never with patterns.
45
+ <<EDIT(path):literal text:EDIT without `<scope>` replaces the entire entry, or creates it if absent.
44
46
  <<OPEN(log path)::OPEN expands (`+`) the log item body to view it (costs tokens). Not all log items have a body (`*`).
45
47
  <<FOLD(log path)::FOLD hides (`-`) the log item body (saves tokens). FOLDed item tokens="" shows token cost if OPENed.
46
48
  <<EXEC::EXEC produces output stream channels on the next turn that you can then FIND, READ, or KILL.
@@ -121,8 +123,18 @@ On filtering operations, the matching pattern goes in the body.
121
123
 
122
124
  ## Delegation
123
125
 
124
- To spawn a new WORKer run: <<WORK(run://capital-checker):Find the capital of France from a primary source:WORK
125
- To COLLECT a worker's result: <<READ(run://capital-checker)::READ
126
+ Delegation breathes across turns:
127
+
128
+ <<PLAN:Delegate the capital question, then wait.:PLAN
129
+ <<WORK(run://capital-checker):Find the capital of France from a primary source:WORK
130
+ <<SEND[202]:Awaiting capital-checker.:SEND
131
+
132
+ The worker's answer arrives in the log and wakes the run:
133
+
134
+ <<PLAN:Deliver the collected answer.:PLAN
135
+ <<SEND[200]:The capital of France is Paris.:SEND
136
+
137
+ To COLLECT a worker's result on demand: <<READ(run://capital-checker)::READ
126
138
  To FORK the current run: <<FORK(run://recheck):Re-derive the capital from a primary source:FORK
127
139
  To SEND a run a message: <<SEND(run://recheck):Also, what's the capital of Germany?:SEND
128
140
  To KILL another run: <<KILL(run://recheck)::KILL
@@ -178,7 +190,6 @@ YOU MUST submit the OPs by SENDing either a brief response or a Github-flavored
178
190
  * <<OPEN(log:///**)<1,10>::OPEN
179
191
  * <<FOLD(log:///**)<101,200>::FOLD
180
192
  * <<SEND(run://capital-checker):{"hint":"known entries are your persistent memory"}:SEND
181
- * <<SEND[202]:Awaiting worker capital-checker.:SEND
182
193
  * <<KILL(known:///draft.md)::KILL
183
194
  * <<KILL(obsolete/file.md)::KILL
184
195
  * <<KILL(sh:///3/1/2)::KILL