@plurnk/plurnk-grammar 0.21.0 → 0.21.2
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/package.json +1 -1
- package/plurnk.md +16 -15
package/package.json
CHANGED
package/plurnk.md
CHANGED
|
@@ -4,23 +4,23 @@ YOU MUST ONLY use the Extended HEREDOC Plurnk Operations (FIND|READ|EDIT|COPY|MO
|
|
|
4
4
|
|
|
5
5
|
## Syntax
|
|
6
6
|
|
|
7
|
-
<<OPsuffix[signal]?(target)?<
|
|
7
|
+
<<OPsuffix[signal]?(target)?<Line/Result>?:body?:OPsuffix
|
|
8
8
|
|
|
9
9
|
Slots between `<<OPsuffix` and `:body:` are all optional. `:body:` fences are required (use `::` when body is empty).
|
|
10
10
|
|
|
11
11
|
## Operations
|
|
12
12
|
|
|
13
|
-
| OP | `[signal]` | `(target)`| `<
|
|
14
|
-
|
|
15
|
-
| FIND | filter tags | required | results `N,M`
|
|
16
|
-
| READ | filter tags | required | lines `N,M`
|
|
17
|
-
| EDIT | tags | required | lines `N,M`
|
|
18
|
-
| COPY | apply tags | required | lines `N,M`
|
|
19
|
-
| MOVE | apply tags | required | lines `N,M`
|
|
20
|
-
| SHOW | filter tags | required | results `N,M`
|
|
21
|
-
| HIDE | filter tags | required | results `N,M`
|
|
22
|
-
| SEND | status code | recipient | —
|
|
23
|
-
| EXEC | executor | cwd | —
|
|
13
|
+
| OP | `[signal]` | `(target)`| `<Line> / <Result>` | body |
|
|
14
|
+
|------|-------------|-----------|-----------------|-----------------|
|
|
15
|
+
| FIND | filter tags | required | results `N,M` | matcher |
|
|
16
|
+
| READ | filter tags | required | lines `N,M` | matcher |
|
|
17
|
+
| EDIT | tags | required | lines `N,M` | content |
|
|
18
|
+
| COPY | apply tags | required | lines `N,M` | destination URI |
|
|
19
|
+
| MOVE | apply tags | required | lines `N,M` | destination URI |
|
|
20
|
+
| SHOW | filter tags | required | results `N,M` | matcher |
|
|
21
|
+
| HIDE | filter tags | required | results `N,M` | matcher |
|
|
22
|
+
| SEND | status code | recipient | — | message body |
|
|
23
|
+
| EXEC | executor | cwd | — | command or code |
|
|
24
24
|
|
|
25
25
|
Operations emit their status and/or results on the subsequent turn.
|
|
26
26
|
READ output prefixes every line with line numbers, `N:\t`. The prefix is not part of the source.
|
|
@@ -42,7 +42,7 @@ Index entries are previews; READ pulls the body (full, ranged, or matcher-filter
|
|
|
42
42
|
YOU SHOULD demote distilled and irrelevant entries to Archive with HIDE to save tokens and optimize context relevance.
|
|
43
43
|
YOU MAY permanently delete entries by MOVE to `/dev/null` (works regardless of environment).
|
|
44
44
|
|
|
45
|
-
## `<
|
|
45
|
+
## `<Line> / <Result>`
|
|
46
46
|
|
|
47
47
|
`<N>` selects position N.
|
|
48
48
|
`<N,M>` selects the inclusive range N through M. N and M are signed integers.
|
|
@@ -51,7 +51,7 @@ Sentinels: `<0>` before position 1 (prepend), `<-1>` after the last position (ap
|
|
|
51
51
|
|
|
52
52
|
Clearing content: `<1,-1>` selects every position; combine with an empty body to clear an entry.
|
|
53
53
|
|
|
54
|
-
On structured entries, `<
|
|
54
|
+
On structured entries, `<Result>` addresses result index, not line number.
|
|
55
55
|
|
|
56
56
|
## Body matcher dispatch (FIND, READ, SHOW, HIDE)
|
|
57
57
|
|
|
@@ -63,7 +63,7 @@ On structured entries, `<L>` addresses item index, not line number.
|
|
|
63
63
|
| `~` | rag | `~query text` |
|
|
64
64
|
| otherwise | glob | `pattern` |
|
|
65
65
|
|
|
66
|
-
Escape `/` inside a regex pattern as `\/`. XPath body begins with `//`. RAG narrows top-K via `<
|
|
66
|
+
Escape `/` inside a regex pattern as `\/`. XPath body begins with `//`. RAG narrows top-K via `<Result>` on the host statement.
|
|
67
67
|
|
|
68
68
|
## Paths
|
|
69
69
|
|
|
@@ -103,6 +103,7 @@ Body content is character-perfect, exactly matching whitespace.
|
|
|
103
103
|
<<READ(docs/api.md)://h2/text():READ
|
|
104
104
|
<<READ(plurnk://manifest.json):$[?(@.shown==false)]:READ
|
|
105
105
|
<<READ(log://1/2/3):$[*].matched.codename:READ
|
|
106
|
+
<<READ(/etc/hosts)<2>::READ
|
|
106
107
|
<<READ(https://en.wikipedia.org/wiki/Paris)<426,465>::READ
|
|
107
108
|
<<EDIT[philosophy,existentialism](known://philosophy/existentialism/meaning.md):The meaning of life is 42:EDIT
|
|
108
109
|
<<EDIT[france,geography](unknown://countries/france/capital.md):What is the capital of France?:EDIT
|