@plurnk/plurnk-grammar 0.74.42 → 0.74.45

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 +5 -3
  2. package/plurnk.md +8 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-grammar",
3
- "version": "0.74.42",
3
+ "version": "0.74.45",
4
4
  "description": "ANTLR4 grammar for the Plurnk LLM agent protocol",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,8 +42,10 @@
42
42
  "test:smoke": "node scriptify/smoke-test.ts",
43
43
  "test:llama": "node --test test/llama/*.test.ts",
44
44
  "test:all": "npm run test:lint && npm run test:unit && npm run test:intg && npm run test:demo",
45
- "prepare": "npm run build",
46
- "prepublishOnly": "npm run build && npm run test:all && npm run test:smoke"
45
+ "test": "npm run test:all",
46
+ "deps:fresh": "npm outdated",
47
+ "prepare": "git config core.hooksPath .githooks && npm run build",
48
+ "prepublishOnly": "npm run deps:fresh && npm audit && npm run build && npm run test:all && npm run test:smoke"
47
49
  },
48
50
  "dependencies": {
49
51
  "@cfworker/json-schema": "^4.1.1",
package/plurnk.md CHANGED
@@ -15,12 +15,12 @@ YOU MUST ONLY use the Plurnk OPs (PLAN|FIND|READ|EDIT|COPY|MOVE|OPEN|FOLD|EXEC|K
15
15
 
16
16
  ### Syntax
17
17
 
18
- <<OPsuffix[signal]?(target)?<Line/Result>?:body?:OPsuffix
18
+ <<OPsuffix[signal]?(path)?<Line/Result>?:body?:OPsuffix
19
19
 
20
20
  ### OPs
21
21
 
22
22
  Fields are optional unless otherwise specified.
23
- The `(target)` is required for every operation except PLAN, EXEC, and SEND.
23
+ The `(path)` is required for every operation except PLAN, EXEC, and SEND.
24
24
 
25
25
  | OP | `[signal]` | `(path)` | `<Line / Result>` | :body: | OP |
26
26
  |------|---------------|-------------|-------------------|-----------------------|------|
@@ -42,7 +42,7 @@ 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).
45
+ <<FOLD(log path)::FOLD hides (`-`) the log item body (saves tokens). FOLDed item tokens="" shows token cost if OPENed.
46
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.
@@ -115,7 +115,7 @@ Body content is character-perfect, exactly matching whitespace.
115
115
  ## Imperatives
116
116
 
117
117
  YOU MUST ONLY use EXEC for actions that can't be performed with other Plurnk OPs.
118
- 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.
119
119
  YOU SHOULD document all relevant questions and uncertainties into taxonomized, tagged, and topical unknown:/// entries.
120
120
  YOU SHOULD distill source information into taxonomized, tagged, and topical known:/// entries.
121
121
 
@@ -127,7 +127,7 @@ YOU MUST terminate the turn by SENDing a message to the user with the proper sta
127
127
 
128
128
  YOU MUST SEND[102] to receive the results of OPs you submitted. Avoid premature SEND[200].
129
129
 
130
- To spawn a separate run: <<COPY(run://capital-checker):Find the capital of France.:COPY
130
+ To spawn a separate run: <<COPY(run://capital-checker):List the capitals in: known:///continents/europe:COPY
131
131
  To fork the current run: <<COPY(run://self):Re-derive the capital from a primary source.:COPY
132
132
 
133
133
  ## Examples
@@ -155,15 +155,16 @@ To fork the current run: <<COPY(run://self):Re-derive the capital from a primary
155
155
  * <<KILL(sh:///3/1/2)::KILL
156
156
  * <<KILL[9](sh:///3/1/3)::KILL
157
157
  * <<KILL(log:///1/*/*/FOLD)::KILL
158
- * <<OPEN(log:///**/get)<1,10>::OPEN
158
+ * <<OPEN(log:///**)<1,10>::OPEN
159
159
  * <<FIND(known:///**)<5>:~french revolutionary history:FIND
160
160
  * <<FIND(known:///**)<0.7>:~french territorial concessions:FIND
161
- * <<FOLD(log:///**/get)<101,200>::FOLD
161
+ * <<FOLD(log:///**)<101,200>::FOLD
162
162
  * <<FIND(log:///**/error):#budget overflow|budget exceeded#i:FIND
163
163
  * <<FIND(known:///**):revolution:FIND
164
164
  * <<FIND(known:///**):$[?(@.role=="admin")]:FIND
165
165
  * <<FIND(#(draft|final)/.*#i)::FIND
166
166
  * <<FIND(#src/.*\.test\.ts#)::FIND
167
167
  * <<FIND(src/**):@<createCoder:FIND
168
+ * <<FIND(**/notes.md)::FIND
168
169
  * <<SEND(run://capital-checker):{"hint":"known entries are your persistent memory"}:SEND
169
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