@plurnk/plurnk-grammar 0.49.0 → 0.53.0

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 +7 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-grammar",
3
- "version": "0.49.0",
3
+ "version": "0.53.0",
4
4
  "description": "ANTLR4 grammar for the Plurnk LLM agent protocol",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/plurnk.md CHANGED
@@ -61,12 +61,14 @@ On structured entries and items, `<Result>` addresses result index, not line num
61
61
  | leading prefix | dialect | form |
62
62
  |----------------|----------|-----------------------------------|
63
63
  | `//` | xpath | `//selector` |
64
- | `#` | regex | `#pattern#[igmsu]?` |
64
+ | `#` | regex | `#pattern#[igmsu]*` |
65
65
  | `$` | jsonpath | `$.field` |
66
66
  | `~` | semantic | `~phrase` |
67
67
  | `@` | graph | `@<symbol`, `@>symbol`, `@symbol` |
68
68
  | otherwise | glob | `pattern` |
69
69
 
70
+ `$` and `//` address any entry with derivable structure (Markdown, HTML, source, …), not just native JSON/XML; `@` walks the code graph likewise.
71
+
70
72
  Escape `#` inside a regex pattern as `\#`. XPath body begins with `//`. Semantic search narrows top-K via `<Result>` on the host statement.
71
73
 
72
74
  ## Paths
@@ -74,20 +76,11 @@ Escape `#` inside a regex pattern as `\#`. XPath body begins with `//`. Semantic
74
76
  URI-shaped: `[scheme://]rest`.
75
77
 
76
78
  * Bare paths (no scheme) default to local relative project file paths (leading `/` for absolute path).
77
- * Glob metacharacters (`*`, `**`, `?`, `[...]`) and regex (`#pattern#flags`) are allowed in path segments.
79
+ * Glob metacharacters (`*`, `**`, `?`, `[...]`) match within path segments; a standalone `#pattern#flags` matches the whole target by regex.
78
80
  * Path suffix (`.json`, `.md`, `.txt`, etc.) declares mimetype; absent suffix defers to scheme default.
81
+ * A literal `)` closes the target; percent-encode parens in a path as `%28`/`%29` (e.g. `Mercury_%28planet%29`).
79
82
  * Append `#channel` to select a channel (e.g. `#stdout`, `#stderr`); absent, the scheme's default channel is used.
80
83
 
81
- Internal schemes:
82
-
83
- - `unknown:///` — internal open question entries.
84
- - `known:///` — internal knowledgebase entries.
85
- - `exec:///` — execution stream output. not editable.
86
- - `log:///` — record of operations performed, not editable.
87
- - `plurnk:///` — internal agent entries, not editable.
88
- - `run:///` — agent runs; `run:///.` is the current run.
89
- - `error:///` — rendered telemetry locator, not addressable or editable.
90
-
91
84
  ## Suffix
92
85
 
93
86
  When quoting plurnk operations in a body, YOU MUST use a matching single-digit suffix (`1`–`9`) on the opening and closing tags.
@@ -105,7 +98,7 @@ Body content is character-perfect, exactly matching whitespace.
105
98
  <<FIND(config/**/*.xml)://user[@role='admin']:FIND
106
99
  <<READ(lang/??.json):$.greeting:READ
107
100
  <<READ(README.md):$.Installation:READ
108
- <<READ(docs/api.md)://h2/text():READ
101
+ <<READ(README.md)://h2/text():READ
109
102
  <<READ(plurnk:///manifest.json):$[?(@.channels.stderr)]:READ
110
103
  <<READ(log:///1/2/3):$[*].matched.codename:READ
111
104
  <<READ(exec:///3/1/2#stdout)<1,40>::READ
@@ -138,7 +131,7 @@ Body content is character-perfect, exactly matching whitespace.
138
131
  <<FIND(log:///**/error):#timeout|deadline exceeded#i:FIND
139
132
  <<FIND(known:///**):revolution:FIND
140
133
  <<FIND(#draft.*#i)::FIND
141
- <<FIND(#src/.*[.]test[.]ts#)::FIND
134
+ <<FIND(#src/.*\.test\.ts#)::FIND
142
135
  <<FIND(src/**):@<createCoder:FIND
143
136
 
144
137
  <<EDIT[tutorial,training,scripts](example.sh):#!/usr/bin/env sh