@plurnk/plurnk-grammar 0.72.0 → 0.73.1

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/dist/plurnk.gbnf CHANGED
@@ -302,7 +302,10 @@ status-mid ::= "10" [0-13-9] | "1" [1-9] [0-9] | "20" [13-9] | "2" [1-9] [0-9] |
302
302
  tags ::= "[" tag tag-rest* "]"
303
303
  tag ::= [A-Za-z0-9_.-]+
304
304
  tag-rest ::= "," tag
305
- target ::= "(" [^\x00-\x08\x0B-\x0C\x0E-\x1F\x7F)<\r\n]+ ")"
305
+ target ::= "(" target-inner ")" | "(" target-regex ")"
306
+ target-inner ::= [^\x00-\x08\x0B-\x0C\x0E-\x1F\x7F)<\r\n]+
307
+ target-regex ::= "#" target-rx-char* "#" [a-zA-Z]*
308
+ target-rx-char ::= "\\" [^\r\n] | [^#\r\n]
306
309
  line ::= "<" int line-rest* ">"
307
310
  line-rest ::= "," " "? int
308
311
  int ::= "-"? [0-9]+ frac?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-grammar",
3
- "version": "0.72.0",
3
+ "version": "0.73.1",
4
4
  "description": "ANTLR4 grammar for the Plurnk LLM agent protocol",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/plurnk.md CHANGED
@@ -20,13 +20,13 @@ Slots between `<<OPsuffix` and `:body:` are all optional. `:body:` fences are re
20
20
  | MOVE | apply tags | required | lines `N,M` | destination URI |
21
21
  | OPEN | filter tags | log path | results `N,M` | matcher |
22
22
  | FOLD | filter tags | log path | results `N,M` | matcher |
23
- | KILL | | required | — | — |
23
+ | KILL | signal | required | — | — |
24
24
  | EXEC | executor | cwd | — | command or code |
25
25
  | SEND | status code | recipient | — | message body |
26
26
 
27
27
  Operations emit their status and/or results on the subsequent turn.
28
28
  READ output prefixes every line with line numbers and a hard tab, `N: `. The prefix is not part of the source.
29
- EDIT is only for entries. Do not attempt to edit log items.
29
+ EDIT is only for adding or modifying entries. Do not attempt to edit log items.
30
30
  EXEC defaults to `sh`; override with an optional executor (`sqlite`, `node`, etc.).
31
31
 
32
32
  ## Context
@@ -36,7 +36,7 @@ The agent maintains two surfaces for budgeting working-memory tokens:
36
36
  - **Log** — the record of every operation. FOLD contracts a log row to its one-line summary and saves tokens; OPEN shows the complete record but spends from your `tokensFree` context tokens. Non-destructive — FOLDed rows remain listed and re-OPENable.
37
37
  - **`plurnk:///manifest.json`** — what's available: the complete unranked directory of every entry. Query it to discover available entries.
38
38
 
39
- OPEN and FOLD operate on the log only. Log items are read-only, but can be KILLed.
39
+ OPEN and FOLD operate on the log only. Log items are read-only, but can be KILLed (erased).
40
40
 
41
41
  ## `<Line> / <Result>`
42
42
 
@@ -77,12 +77,12 @@ URI-shaped: `[scheme://]rest`.
77
77
  * Bare paths (no scheme) default to local relative project file paths.
78
78
  * Glob metacharacters match within path segments; a standalone `#pattern#flags` matches the whole target by regex.
79
79
  * Path suffix (`.json`, `.md`, `.txt`, etc.) declares mimetype.
80
- * A literal `)` closes the target — percent-encode parens in a path (`%28`/`%29`).
80
+ * Percent-encode reserved characters in paths: `)`→`%29`, `<`→`%3C`.
81
81
  * Append `#channel` to select a channel (e.g. `#stdout`, `#stderr`); absent, the scheme's default channel is used.
82
82
 
83
83
  ## Suffix
84
84
 
85
- When quoting plurnk operations in a body, YOU MUST use a matching single-digit suffix (`1`–`9`) on the opening and closing tags.
85
+ When quoting plurnk operations in a body, YOU MUST use a matching single-digit suffix (`1`–`9`) or label (`[a-z]+`) on the opening and closing tags.
86
86
 
87
87
  <<EDIT1(known:///demo):
88
88
  quoted: <<EDIT(known:///inner):hello:EDIT
@@ -120,7 +120,7 @@ Body content is character-perfect, exactly matching whitespace.
120
120
  <<COPY[archive,2026-05-14](known:///draft.md):known:///archive/2026-05-14/draft.md:COPY
121
121
  <<MOVE[final](known:///draft/answer.md):known:///final/answer.md:MOVE
122
122
  <<KILL(obsolete/file.md)::KILL
123
- <<KILL(sh:///3/1/2)::KILL
123
+ <<KILL[9](sh:///3/1/2)::KILL
124
124
  <<EDIT(run://capital-checker):Find the capital of France.:EDIT
125
125
  <<COPY(run://.):Re-derive the capital from a primary source.:COPY
126
126
  <<OPEN(log:///**/get)<1,10>::OPEN
@@ -129,7 +129,7 @@ Body content is character-perfect, exactly matching whitespace.
129
129
  <<FOLD(log:///**/get)<101,200>::FOLD
130
130
  <<FIND(log:///**/error):#timeout|deadline exceeded#i:FIND
131
131
  <<FIND(known:///**):revolution:FIND
132
- <<FIND(#draft.*#i)::FIND
132
+ <<FIND(#(draft|final)/.*#i)::FIND
133
133
  <<FIND(#src/.*\.test\.ts#)::FIND
134
134
  <<FIND(src/**):@<createCoder:FIND
135
135
 
@@ -159,6 +159,6 @@ YOU SHOULD leverage taxonomic path names, folksonomic tags, and bulk pattern ope
159
159
  YOU MUST use OPEN and FOLD to keep your context budget healthy, optimized, topical, and below the `tokensFree` limit.
160
160
  YOU MUST terminate the turn by SENDing a status code containing the results, answer, or a status update: `<<SEND[N]:...:SEND`
161
161
  YOU MUST terminate a continuing loop with status code 102: <<SEND[102]:Forking a research run, optimizing log relevance...:SEND
162
- YOU MUST terminate a final turn with status code 200: <<SEND[200]:Paris:SEND
163
- YOU MUST terminate an idle/waiting loop with status code 202: <<SEND[202]:Parked until the capital-checker reports.:SEND
164
162
  YOU MUST terminate a failed/aborted loop with status code 499: <<SEND[499]:Giving up — cannot identify the capital from available sources.:SEND
163
+ YOU MUST terminate a final turn with status code 200: <<SEND[200]:Paris:SEND
164
+ YOU MUST pause an idle/waiting loop with status code 202: <<SEND[202]:Waiting until the capital-checker reports.:SEND