@plurnk/plurnk-contracts 3.3.0 → 4.1.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/.env.defaults +17 -0
- package/README.md +3 -1
- package/SPEC.md +100 -85
- package/dist/conformance/agui-v1.json +308 -183
- package/dist/schema/A2aAgentDefinition.json +42 -10
- package/dist/schema/AguiDiscovery.json +1 -1
- package/dist/schema/PlurnkStatement.json +1 -1
- package/dist/schema/ProposalProjection.json +90 -14
- package/dist/src/Application.d.ts +253 -0
- package/dist/src/Application.d.ts.map +1 -0
- package/dist/src/Application.js +2 -0
- package/dist/src/Application.js.map +1 -0
- package/dist/src/ApplicationPort.d.ts +67 -147
- package/dist/src/ApplicationPort.d.ts.map +1 -1
- package/dist/src/Functionality.d.ts +2 -1
- package/dist/src/Functionality.d.ts.map +1 -1
- package/dist/src/HttpOrigin.d.ts +16 -0
- package/dist/src/HttpOrigin.d.ts.map +1 -0
- package/dist/src/HttpOrigin.js +15 -0
- package/dist/src/HttpOrigin.js.map +1 -0
- package/dist/src/Validator.d.ts +0 -1
- package/dist/src/Validator.d.ts.map +1 -1
- package/dist/src/Validator.js +0 -14
- package/dist/src/Validator.js.map +1 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/types.d.ts +11 -7
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.generated.d.ts +47 -22
- package/dist/src/types.generated.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/package.json +7 -3
- package/plurnk.md +46 -50
- package/dist/schema/ClientStatement.json +0 -104
package/plurnk.md
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
# Plurnk Operation Protocol
|
|
2
2
|
|
|
3
3
|
> [!IMPORTANT]
|
|
4
|
-
> YOU MUST ONLY emit fenced
|
|
5
|
-
|
|
6
|
-
> [!IMPORTANT]
|
|
7
|
-
> YOU MUST record at least one NOTE along with other operations.
|
|
8
|
-
|
|
9
|
-
> [!TIP]
|
|
10
|
-
> All operations (except NOTE) are converted into log items.
|
|
4
|
+
> YOU MUST ONLY emit fenced operation batches; with the parameters, pattern, and terse aside on the fenced operation line. No tool calls.
|
|
11
5
|
|
|
12
6
|
## Syntax
|
|
13
7
|
|
|
@@ -15,9 +9,12 @@
|
|
|
15
9
|
body?
|
|
16
10
|
```
|
|
17
11
|
|
|
12
|
+
> [!TIP]
|
|
13
|
+
> You may use more than three backticks in your opening and closing outer fences to wrap, nest, and disambiguate.
|
|
14
|
+
|
|
18
15
|
## Core Operations
|
|
19
16
|
|
|
20
|
-
* NOTE:
|
|
17
|
+
* NOTE: Save all new plans, findings, and decisions for later turns.
|
|
21
18
|
* FIND: List matching paths, or the match locations inside one path.
|
|
22
19
|
* READ: Read files, entries, streams, or only the lines a pattern selects.
|
|
23
20
|
* EDIT: Create a file or entry; replace existing text by scope or by pattern.
|
|
@@ -26,40 +23,43 @@ body?
|
|
|
26
23
|
* KILL: Delete an entry, stop a process, or retire log items.
|
|
27
24
|
* WORK: Delegate to a child worker (fresh log).
|
|
28
25
|
* FORK: Delegate to a child worker (copied log).
|
|
29
|
-
* WAIT: Yield to child workers
|
|
26
|
+
* WAIT: Yield to child workers or streams. You may include `[60]` to check in after 60 seconds. Not for awaiting user input.
|
|
30
27
|
* SEND: Message endpoints, workers, or Open Messages (when the path is omitted, the oldest Open Message).
|
|
31
28
|
|
|
32
29
|
## Loop Protocol
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
> [!IMPORTANT]
|
|
32
|
+
> YOU MUST Recall, Record, and React:
|
|
33
|
+
> * **Recall**: Review the Open Work and Open Messages against the prior NOTE entries and log items.
|
|
34
|
+
> * **Record**: NOTE entries are your ONLY chain of thought. Persist all new plans, findings, and decisions.
|
|
35
|
+
> * **React**: When the necessary operations are identified, stop reflecting and emit the batch of notes and operations.
|
|
36
|
+
|
|
37
|
+
```NOTE <!-- plan -->
|
|
38
|
+
the steps ahead and why
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
```NOTE <!-- finding -->
|
|
39
|
-
|
|
42
|
+
a finding and its evidence
|
|
40
43
|
```
|
|
41
44
|
|
|
42
45
|
```NOTE <!-- decision -->
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
```NOTE <!-- plan -->
|
|
47
|
-
Edit exampleLoader.py, then rerun exampleTest.py.
|
|
46
|
+
a decision and its reasons
|
|
48
47
|
```
|
|
49
48
|
|
|
50
|
-
```
|
|
51
|
-
|
|
49
|
+
```NOTE <!-- next -->
|
|
50
|
+
the next action and what it needs
|
|
52
51
|
```
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
````SEND
|
|
54
|
+
a continuing progress update response
|
|
55
|
+
````
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
````SEND [200]
|
|
58
|
+
a final deliverable response
|
|
59
|
+
````
|
|
60
60
|
|
|
61
61
|
> [!CAUTION]
|
|
62
|
-
> The loop continues until
|
|
62
|
+
> The loop continues until all Open Messages receive a `[200]` or `[499]` response and all Open Work is completed.
|
|
63
63
|
|
|
64
64
|
## Delegation (worker:///_plurnk/plurnk/delegation.md)
|
|
65
65
|
|
|
@@ -78,38 +78,40 @@ Describe the child's complete task in the body.
|
|
|
78
78
|
| `&` | graph (treesitter symbols) | `&sym`, `&<sym`, `&>sym` |
|
|
79
79
|
| none | literal or glob/extglob | `?(export )?(async )function *` |
|
|
80
80
|
|
|
81
|
+
## `<scope|range>`
|
|
82
|
+
|
|
83
|
+
> [!TIP]
|
|
84
|
+
> Text scopes use 1-based lines and Unicode code-point columns across textual mimetypes:
|
|
85
|
+
|
|
86
|
+
| form | endpoint rule |
|
|
87
|
+
|-----------------|--------------------------------|
|
|
88
|
+
| `<L>`, `<@hash>` | one line |
|
|
89
|
+
| `<SL,EL>`, `<@start,@end>` | lines SL through EL, inclusive |
|
|
90
|
+
| `<SL,SC,EL,EC>` | start included, end excluded — `<@abcde,5,@abcde,8>` is `bar` in line 42 `foo bar baz` |
|
|
91
|
+
| `<L,1,L,1>`, `<@hash,1,@hash,1>` | insert before that line |
|
|
92
|
+
| `<0>`, `<-1>` | prepend / append on mutations; as an end line, `-1` is the last line |
|
|
93
|
+
|
|
81
94
|
## Workspace Navigation
|
|
82
95
|
|
|
83
|
-
```FIND (src/**/*.ts) /TODO/ <!-- paths with matches -->
|
|
96
|
+
```FIND (src/**/*.ts) <1,-1> /TODO/ <!-- paths with matches -->
|
|
84
97
|
```
|
|
85
98
|
|
|
86
|
-
```READ (src/**/*.ts) /TODO/ <!-- the matching lines in every file -->
|
|
99
|
+
```READ (src/**/*.ts) <1,-1> /TODO/ <!-- the matching lines in every file -->
|
|
87
100
|
```
|
|
88
101
|
|
|
89
102
|
```COPY (sh:///ab3d5678) (build.log) <!-- the command's output lands in a file, never in your context -->
|
|
90
103
|
```
|
|
91
104
|
|
|
92
|
-
```members (add) <!-- adding membership tracking for files outside of the project folder -->
|
|
93
|
-
{"files": ["../exampleSisterProject/*.md", "../exampleSisterProject/example.json"]}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
105
|
* `(path)` may be a glob/extglob, permitting bulk operations.
|
|
97
106
|
* Log item paths nest: `log:///1/2/3/READ` is loop/turn/item/OP.
|
|
98
107
|
* FIND results hold one inner array per path: its channels, default first; append `#channel` to the path to select another: `(sh:///ab3d5678#stderr)`.
|
|
99
108
|
* Percent-encode in paths `(` as `%28` and `)` as `%29`.
|
|
100
109
|
|
|
101
|
-
##
|
|
102
|
-
|
|
103
|
-
> [!TIP]
|
|
104
|
-
> Text scopes use 1-based lines and Unicode code-point columns across textual mimetypes:
|
|
110
|
+
## Membership (worker:///_plurnk/plurnk/members.md)
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
| `<SL,EL>`, `<@start,@end>` | lines SL through EL, inclusive |
|
|
110
|
-
| `<SL,SC,EL,EC>` | start included, end excluded — `<@abcde,5,@abcde,8>` is `bar` in line 42 `foo bar baz` |
|
|
111
|
-
| `<L,1,L,1>`, `<@hash,1,@hash,1>` | insert before that line |
|
|
112
|
-
| `<0>`, `<-1>` | prepend / append on mutations; as an end line, `-1` is the last line |
|
|
112
|
+
```members (add) <!-- adding membership tracking for files outside of the project folder -->
|
|
113
|
+
{"files": ["../exampleSisterProject/*.md", "../exampleSisterProject/example.json"]}
|
|
114
|
+
```
|
|
113
115
|
|
|
114
116
|
## Editing
|
|
115
117
|
|
|
@@ -140,22 +142,16 @@ bar
|
|
|
140
142
|
```EDIT (books.xml) //book[price > 35.00] <!-- an empty body removes each match -->
|
|
141
143
|
```
|
|
142
144
|
|
|
143
|
-
````EDIT (edit-example.md)
|
|
144
|
-
```EDIT (create-example.md)
|
|
145
|
-
Nesting can be resolved with increased outer fences.
|
|
146
|
-
```
|
|
147
|
-
````
|
|
148
|
-
|
|
149
145
|
> [!TIP]
|
|
150
146
|
> YOU SHOULD address lines by `<@hash>` or `<@start,@end>` to protect against stale targets.
|
|
151
147
|
|
|
152
148
|
## Context Curation
|
|
153
149
|
|
|
154
|
-
```READ (largeExampleFile.txt) <101,200> <!-- READing in chunks
|
|
150
|
+
```READ (largeExampleFile.txt) <101,200> <!-- READing in chunks if budget constrained -->
|
|
155
151
|
```
|
|
156
152
|
|
|
157
153
|
```KILL (log:///1/[1-7]/*/{READ,emission}) <!-- old results and your own old programs, in bulk; the body survives as a NOTE -->
|
|
158
|
-
|
|
154
|
+
example distillation or summarization
|
|
159
155
|
```
|
|
160
156
|
|
|
161
157
|
## Environment (worker:///_plurnk/plurnk/env.md)
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://schemas.plurnk.xyz/v0/ClientStatement.json",
|
|
4
|
-
"title": "ClientStatement",
|
|
5
|
-
"description": "The client-tier AST returned by PlurnkParser.parseClient: the closed protocol PlurnkStatement union plus the read-shaped LOOK utility statement.",
|
|
6
|
-
"oneOf": [
|
|
7
|
-
{
|
|
8
|
-
"$ref": "https://schemas.plurnk.xyz/v0/PlurnkStatement.json"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"$ref": "#/$defs/LookStatement"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"$defs": {
|
|
15
|
-
"AsideOrNull": {
|
|
16
|
-
"type": [
|
|
17
|
-
"string",
|
|
18
|
-
"null"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
"SchemeMetadataOrNull": {
|
|
22
|
-
"oneOf": [
|
|
23
|
-
{
|
|
24
|
-
"type": "array",
|
|
25
|
-
"items": {
|
|
26
|
-
"type": "string"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "null"
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"PathOrNull": {
|
|
35
|
-
"oneOf": [
|
|
36
|
-
{
|
|
37
|
-
"$ref": "https://schemas.plurnk.xyz/v0/ParsedPath.json"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"type": "null"
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
"TextLineMarkerOrNull": {
|
|
45
|
-
"oneOf": [
|
|
46
|
-
{
|
|
47
|
-
"$ref": "https://schemas.plurnk.xyz/v0/TextLineMarker.json"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": "null"
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
"MatcherBodyOrNull": {
|
|
55
|
-
"oneOf": [
|
|
56
|
-
{
|
|
57
|
-
"$ref": "https://schemas.plurnk.xyz/v0/MatcherBody.json"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"type": "null"
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
"PositionRef": {
|
|
65
|
-
"$ref": "https://schemas.plurnk.xyz/v0/Position.json"
|
|
66
|
-
},
|
|
67
|
-
"LookStatement": {
|
|
68
|
-
"type": "object",
|
|
69
|
-
"required": [
|
|
70
|
-
"op",
|
|
71
|
-
"aside",
|
|
72
|
-
"metadata",
|
|
73
|
-
"target",
|
|
74
|
-
"lineMarker",
|
|
75
|
-
"body",
|
|
76
|
-
"position"
|
|
77
|
-
],
|
|
78
|
-
"additionalProperties": false,
|
|
79
|
-
"properties": {
|
|
80
|
-
"op": {
|
|
81
|
-
"const": "LOOK"
|
|
82
|
-
},
|
|
83
|
-
"aside": {
|
|
84
|
-
"$ref": "#/$defs/AsideOrNull"
|
|
85
|
-
},
|
|
86
|
-
"metadata": {
|
|
87
|
-
"$ref": "#/$defs/SchemeMetadataOrNull"
|
|
88
|
-
},
|
|
89
|
-
"target": {
|
|
90
|
-
"$ref": "#/$defs/PathOrNull"
|
|
91
|
-
},
|
|
92
|
-
"lineMarker": {
|
|
93
|
-
"$ref": "#/$defs/TextLineMarkerOrNull"
|
|
94
|
-
},
|
|
95
|
-
"body": {
|
|
96
|
-
"$ref": "#/$defs/MatcherBodyOrNull"
|
|
97
|
-
},
|
|
98
|
-
"position": {
|
|
99
|
-
"$ref": "#/$defs/PositionRef"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|