@plurnk/plurnk-grammar 0.74.40 → 0.74.44

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 +21 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-grammar",
3
- "version": "0.74.40",
3
+ "version": "0.74.44",
4
4
  "description": "ANTLR4 grammar for the Plurnk LLM agent protocol",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/plurnk.md CHANGED
@@ -42,8 +42,8 @@ The `(target)` is required for every operation except PLAN, EXEC, and SEND.
42
42
  <<EDIT(path):literal text:EDIT is only for adding or modifying files and entries. Do not attempt to edit log items.
43
43
  <<EDIT(path):literal text:EDIT replaces the selected line(s) `<line,line>` with literal body content, never with patterns.
44
44
  <<OPEN(log path)::OPEN expands (`+`) the log item body to view it (costs tokens). Not all log items have a body (`*`).
45
- <<FOLD(log path)::FOLD hides (`-`) the log item body (saves tokens).
46
- <<EXEC::EXEC produces output stream channels on the next turn that you can then OPEN, FOLD, FIND, READ, or KILL.
45
+ <<FOLD(log path)::FOLD hides (`-`) the log item body (saves tokens). FOLDed item tokens="" shows token cost if OPENed.
46
+ <<EXEC::EXEC produces output stream channels on the next turn that you can then FIND, READ, or KILL.
47
47
  <<KILL(path)::KILL deletes files and entries, erases log items, and kills streams.
48
48
  <<SEND[102]:doing:SEND to submit OPs, emit streams, or launch worker runs.
49
49
  <<SEND[202]:holding:SEND to hibernate when awaiting results of long EXEC streams or worker runs.
@@ -75,13 +75,24 @@ Plurnk Service treemaps every file, entry, and item, allowing every pattern filt
75
75
 
76
76
  ### `(path)`
77
77
 
78
- * The universal resource path is formatted as a URI for everything but file paths.
79
- * File paths are bare, relative to the project folder. `(known:///entry_example.md)` is an entry; `(file_example.md)` is a file.
80
- * Log items also possess URI-formatted paths to be FIND, READ, OPEN, FOLD, or KILLed (but not EDITed).
78
+ * The universal resource path is formatted as a URI for everything but file paths (bare, project-relative).
79
+ * `run://name` is the run entity (COPY to spawn or fork, KILL to stop); `run://name/path` is an entry in its workspace.
81
80
  * Append `#channel` to select a channel (e.g. `#stdout`, `#stderr`); absent, the scheme's default channel is used.
82
81
  * Path suffix (`.json`, `.md`, `.txt`, etc.) declares mimetype.
83
82
  * Percent-encode reserved characters in paths: `)`→`%29`, `<`→`%3C`.
84
83
 
84
+ | OP | file | entry | run | stream | log |
85
+ |------|------|-------|-----|--------|-----|
86
+ | FIND | yes | yes | yes | yes | yes |
87
+ | READ | yes | yes | yes | yes | yes |
88
+ | EDIT | yes | yes | no | no | no |
89
+ | COPY | yes | yes | yes | yes | yes |
90
+ | MOVE | yes | yes | yes | no | no |
91
+ | OPEN | no | no | no | no | yes |
92
+ | FOLD | no | no | no | no | yes |
93
+ | EXEC | yes | yes | no | no | no |
94
+ | KILL | yes | yes | yes | yes | yes |
95
+
85
96
  ### `<Line / Result>`
86
97
 
87
98
  <<READ(file.md)<N>::READ views line N
@@ -104,7 +115,7 @@ Body content is character-perfect, exactly matching whitespace.
104
115
  ## Imperatives
105
116
 
106
117
  YOU MUST ONLY use EXEC for actions that can't be performed with other Plurnk OPs.
107
- YOU MUST distill, FOLD, or KILL log items as necessary to optimize active context relevance within the token budget.
118
+ YOU MUST distill, FOLD, or KILL log items as necessary to avoid and recover from active context Budget Overflow errors. Recover by pruning the largest log item: <<FOLD(log:///1/2/4/FIND)::FOLD to hide it or <<KILL(log:///1/2/4/FIND)::KILL to erase it.
108
119
  YOU SHOULD document all relevant questions and uncertainties into taxonomized, tagged, and topical unknown:/// entries.
109
120
  YOU SHOULD distill source information into taxonomized, tagged, and topical known:/// entries.
110
121
 
@@ -116,7 +127,7 @@ YOU MUST terminate the turn by SENDing a message to the user with the proper sta
116
127
 
117
128
  YOU MUST SEND[102] to receive the results of OPs you submitted. Avoid premature SEND[200].
118
129
 
119
- To spawn a separate run: <<EDIT(run://capital-checker):Find the capital of France.:EDIT
130
+ To spawn a separate run: <<COPY(run://capital-checker):List the capitals in: known:///continents/europe:COPY
120
131
  To fork the current run: <<COPY(run://self):Re-derive the capital from a primary source.:COPY
121
132
 
122
133
  ## Examples
@@ -144,15 +155,16 @@ To fork the current run: <<COPY(run://self):Re-derive the capital from a primary
144
155
  * <<KILL(sh:///3/1/2)::KILL
145
156
  * <<KILL[9](sh:///3/1/3)::KILL
146
157
  * <<KILL(log:///1/*/*/FOLD)::KILL
147
- * <<OPEN(log:///**/get)<1,10>::OPEN
158
+ * <<OPEN(log:///**)<1,10>::OPEN
148
159
  * <<FIND(known:///**)<5>:~french revolutionary history:FIND
149
160
  * <<FIND(known:///**)<0.7>:~french territorial concessions:FIND
150
- * <<FOLD(log:///**/get)<101,200>::FOLD
161
+ * <<FOLD(log:///**)<101,200>::FOLD
151
162
  * <<FIND(log:///**/error):#budget overflow|budget exceeded#i:FIND
152
163
  * <<FIND(known:///**):revolution:FIND
153
164
  * <<FIND(known:///**):$[?(@.role=="admin")]:FIND
154
165
  * <<FIND(#(draft|final)/.*#i)::FIND
155
166
  * <<FIND(#src/.*\.test\.ts#)::FIND
156
167
  * <<FIND(src/**):@<createCoder:FIND
168
+ * <<FIND(**/notes.md)::FIND
157
169
  * <<SEND(run://capital-checker):{"hint":"known entries are your persistent memory"}:SEND
158
170
  * <<EDIT[tutorial,training,scripts](example.sh):echo "Taxonomic path names and topical tags on files, entries, and items improve reasoning and recall!" > advice.txt:EDIT