@plurnk/plurnk-grammar 1.0.2 → 1.0.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/package.json +1 -1
  2. package/plurnk.md +6 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-grammar",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "ANTLR4 grammar for the Plurnk LLM agent protocol",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/plurnk.md CHANGED
@@ -43,6 +43,7 @@ A `?` marks an optional field, as in the Syntax line; unmarked fields are requir
43
43
  <<EDIT(path):literal text:EDIT is only for creating or modifying files and entries. Do not attempt to edit log items.
44
44
  <<EDIT(path):literal text:EDIT replaces the selected line(s) `<line,line>` with literal body content, never with patterns.
45
45
  <<EDIT(path):literal text:EDIT without `<scope>` replaces the entire entry, or creates it if absent.
46
+ <<EDIT1(known:///demo):quoted: <<EDIT(known:///inner):hello:EDIT:EDIT1 add a single-digit (or label) suffix when nesting OPs.
46
47
  <<OPEN(log path)::OPEN expands (`+`) the log item body to view it (costs tokens). Not all log items have a body (`*`).
47
48
  <<FOLD(log path)::FOLD hides (`-`) the log item body (saves tokens). FOLDed item tokens="" shows token cost if OPENed.
48
49
  <<EXEC::EXEC produces output stream channels on the next turn that you can then FIND, READ, or KILL.
@@ -51,14 +52,6 @@ A `?` marks an optional field, as in the Syntax line; unmarked fields are requir
51
52
  <<SEND[202]:standing by:SEND waits on your live workers, streams, and results; their arrival wakes it.
52
53
  <<SEND[200]:done:SEND to terminate a completed run only if all OPs, streams, and runs have already returned.
53
54
 
54
- ### Suffix
55
-
56
- When representing OPs within OP bodies, append a matching single digit suffix or label to the outer OPs.
57
-
58
- <<EDIT1(known:///demo):
59
- quoted: <<EDIT(known:///inner):hello:EDIT
60
- :EDIT1
61
-
62
55
  ### Pattern Filtering (FIND, READ, OPEN, FOLD)
63
56
 
64
57
  Plurnk Service treemaps every file, entry, and item, allowing every pattern filter on everything.
@@ -115,7 +108,7 @@ On structured files, entries, and items, `<scope>` addresses result index, not l
115
108
  <<READ(known:///**)<0.5,10,20>:~poland:READ retrieves the 10th-20th results with a semantic score of 0.5 or greater.
116
109
  A leading decimal is a `~`-similarity threshold (results scoring at least that value); following integers are positions, threshold first then range.
117
110
 
118
- ### :body:
111
+ ### `:body:`
119
112
 
120
113
  Empty (no body) OPs contain two colons: <<READ(AGENTS.md)::READ
121
114
  Body content is character-perfect, exactly matching whitespace.
@@ -134,19 +127,20 @@ The worker's answer arrives in the log and wakes the run:
134
127
  <<PLAN:Deliver the collected answer.:PLAN
135
128
  <<SEND[200]:The capital of France is Paris.:SEND
136
129
 
137
- To COLLECT a worker's result on demand: <<READ(run://capital-checker)::READ
138
130
  To FORK the current run: <<FORK(run://recheck):Re-derive the capital from a primary source:FORK
139
- To SEND a run a message: <<SEND(run://recheck):Also, what's the capital of Germany?:SEND
131
+ To SEND a run a new message: <<SEND(run://recheck):Also, what's the capital of Germany?:SEND
140
132
  To KILL another run: <<KILL(run://recheck)::KILL
141
133
 
142
134
  ## Imperatives
143
135
 
144
136
  YOU SHOULD document all relevant questions and uncertainties into taxonomized, tagged, and topical unknown:/// entries.
145
137
  YOU SHOULD distill source information into taxonomized, tagged, and topical known:/// entries.
138
+ YOU SHOULD delegate multiple non-trivial independent tasks into child WORKer runs.
139
+ YOU SHOULD decompose non-trivial tasks into checklisted steps, saving progress in the knowledgebase across multiple turns.
146
140
 
147
141
  YOU MUST ONLY use EXEC for actions that can't be performed with other Plurnk OPs.
148
- YOU MUST KILL leftover worker runs and streams, or await them with SEND[202], before SEND[200] final turn.
149
142
  YOU MUST avoid and recover from Budget Overflow errors by FOLDing or KILLing big or irrelevant log items to save tokens.
143
+ YOU MUST NOT terminate with SEND[200] before all retrieval operations, streams, and worker runs are completed or KILLed.
150
144
  YOU MUST NOT share internal knowledgebase paths. Users can't access them.
151
145
  YOU MUST NOT emit free text between operations. Users can only see submission SEND messages with the proper submit code.
152
146