@plurnk/plurnk-grammar 0.49.0 → 0.54.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.
package/README.md CHANGED
@@ -170,7 +170,7 @@ Nesting: outer body may contain inner `<<OP:…:OP` statements; outer must use a
170
170
  <<SEND[102](agent://supervisor):decomposition complete; awaiting clearance:SEND
171
171
 
172
172
  31. Kill a runaway process
173
- <<KILL(exec:///3/1/2)::KILL
173
+ <<KILL(sh:///3/1/2)::KILL
174
174
 
175
175
  32. Permanently delete an entry
176
176
  <<KILL(known:///obsolete/note)::KILL
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schemas.plurnk.dev/v0/ChannelContent.json",
4
4
  "title": "ChannelContent",
5
- "description": "One named stream of content on an entry. Channels carry distinct, parallel views of an entry (e.g. `stdout` and `stderr` on `exec://`; `body` and `headers` on `https://`; `body` and `symbols` on a code file). Each channel has its own content bytes, mimetype, and token count.",
5
+ "description": "One named stream of content on an entry. Channels carry distinct, parallel views of an entry (e.g. `stdout` and `stderr` on an executor scheme like `node://`/`sh://`; `body` and `headers` on `https://`; `body` and `symbols` on a code file). Each channel has its own content bytes, mimetype, and token count.",
6
6
  "type": "object",
7
7
  "required": ["content", "mimetype", "tokens"],
8
8
  "additionalProperties": false,
@@ -18,7 +18,7 @@
18
18
  "default_channel": {
19
19
  "type": "string",
20
20
  "pattern": "^[a-z][a-z0-9_-]*$",
21
- "description": "Channel name selected when an op against this scheme has no fragment. Conventionally `body`; exec schemes typically declare `stdout`."
21
+ "description": "Channel name selected when an op against this scheme has no fragment. Conventionally `body`; executor schemes (`{tag}://`) typically declare `stdout`."
22
22
  },
23
23
  "channel_orientations": {
24
24
  "type": "object",
@@ -43,7 +43,7 @@ export interface SchemeRegistration {
43
43
  category: string;
44
44
  default_scope: ("agent" | "session");
45
45
  /**
46
- * Channel name selected when an op against this scheme has no fragment. Conventionally `body`; exec schemes typically declare `stdout`.
46
+ * Channel name selected when an op against this scheme has no fragment. Conventionally `body`; executor schemes (`{tag}://`) typically declare `stdout`.
47
47
  */
48
48
  default_channel: string;
49
49
  /**
@@ -97,7 +97,7 @@ export interface Params {
97
97
  [k: string]: (string | string[]);
98
98
  }
99
99
  /**
100
- * One named stream of content on an entry. Channels carry distinct, parallel views of an entry (e.g. `stdout` and `stderr` on `exec://`; `body` and `headers` on `https://`; `body` and `symbols` on a code file). Each channel has its own content bytes, mimetype, and token count.
100
+ * One named stream of content on an entry. Channels carry distinct, parallel views of an entry (e.g. `stdout` and `stderr` on an executor scheme like `node://`/`sh://`; `body` and `headers` on `https://`; `body` and `symbols` on a code file). Each channel has its own content bytes, mimetype, and token count.
101
101
  */
102
102
  export interface LineMarker {
103
103
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-grammar",
3
- "version": "0.49.0",
3
+ "version": "0.54.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,10 +98,10 @@ 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
- <<READ(exec:///3/1/2#stdout)<1,40>::READ
104
+ <<READ(node:///3/1/2#stdout)<1,40>::READ
112
105
  <<READ(/etc/hosts)<2>::READ
113
106
  <<READ(https://en.wikipedia.org/wiki/Paris)<426,465>::READ
114
107
  <<EDIT[philosophy,existentialism](known:///philosophy/existentialism/meaning.md):The meaning of life is 42:EDIT
@@ -128,7 +121,7 @@ Body content is character-perfect, exactly matching whitespace.
128
121
  <<COPY[archive,2026-05-14](known:///draft.md):known:///archive/2026-05-14/draft.md:COPY
129
122
  <<MOVE[final](known:///draft/answer.md):known:///final/answer.md:MOVE
130
123
  <<KILL(obsolete/file.md)::KILL
131
- <<KILL(exec:///3/1/2)::KILL
124
+ <<KILL(sh:///3/1/2)::KILL
132
125
  <<EDIT(run:///capital-check):Find the capital of France.:EDIT
133
126
  <<COPY(run:///.):Re-derive the capital from a primary source.:COPY
134
127
  <<OPEN(log:///**/get)<1,10>::OPEN
@@ -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