@plurnk/plurnk-contracts 7.2.1 → 7.3.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 +1 -1
- package/SPEC.md +48 -58
- package/dist/schema/CapabilityDescriptor.json +3 -3
- package/dist/schema/CapabilitySelector.json +3 -3
- package/dist/schema/FunctionalityDefinitionState.json +1 -1
- package/dist/schema/Notice.json +1 -1
- package/dist/schema/PlurnkStatement.json +23 -23
- package/dist/schema/ProposalProjection.json +16 -16
- package/dist/schema/ResourceSelection.json +1 -1
- package/dist/schema/SendBody.json +1 -1
- package/dist/src/Application.d.ts +1 -1
- package/dist/src/Application.d.ts.map +1 -1
- package/dist/src/Application.js +159 -9
- package/dist/src/Application.js.map +1 -1
- package/dist/src/LogRow.js +14 -14
- package/dist/src/TurnDisposition.js +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/types.d.ts +1 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.generated.d.ts +30 -30
- package/dist/src/types.js +5 -7
- package/dist/src/types.js.map +1 -1
- package/package.json +2 -2
- package/plurnk.md +6 -162
package/dist/src/types.js
CHANGED
|
@@ -8,18 +8,16 @@ import skillDefinitionSchema from "../schema/SkillDefinition.json" with { type:
|
|
|
8
8
|
// expressed in JSON Schema. Hand-maintained.
|
|
9
9
|
// Runtime protocol alphabet; PlurnkOp is structurally derived from this tuple. {§op-shapes}
|
|
10
10
|
export const PLURNK_OPS = [
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"find", "read", "edit", "copy", "move", "send", "done", "fail", "bare", "work", "fork", "kill",
|
|
12
|
+
"note", "todo", "wait",
|
|
13
13
|
];
|
|
14
|
-
//
|
|
15
|
-
export const PLURNK_FENCE = "```";
|
|
16
|
-
// Membership in the operation alphabet: the one test a heading's name or a stored row's op is read through.
|
|
14
|
+
// Membership in the operation alphabet: the one test an operation name or a stored row's op is read through.
|
|
17
15
|
export const isPlurnkOp = (value) => PLURNK_OPS.some((op) => op === value);
|
|
18
16
|
export const RUNTIME_TAG = /^[a-z][a-z0-9+._-]*$/;
|
|
19
17
|
export const INTERNAL_ROW_OPS = new Set(["extension", "error"]);
|
|
20
|
-
export const isExecutionOp = (op) => typeof op === "string" && !INTERNAL_ROW_OPS.has(op) && RUNTIME_TAG.test(op);
|
|
18
|
+
export const isExecutionOp = (op) => typeof op === "string" && !INTERNAL_ROW_OPS.has(op) && !isPlurnkOp(op) && RUNTIME_TAG.test(op);
|
|
21
19
|
export const isExecution = (statement) => "runtime" in statement;
|
|
22
|
-
// The
|
|
20
|
+
// The operation token as written: an operation keyword, or an execution's runtime. This is the
|
|
23
21
|
// log row's `op`.
|
|
24
22
|
export const writtenOp = (statement) =>
|
|
25
23
|
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- an execution's op is its runtime tag; every other statement's op is its own
|
package/dist/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,oFAAoF;AACpF,cAAc,sBAAsB,CAAC;AAErC,OAAO,oBAAoB,MAAM,+BAA+B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvF,OAAO,YAAY,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvE,OAAO,qBAAqB,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAUzF,0EAA0E;AAC1E,6CAA6C;AAE7C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,E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AAC,CAAC;AACnG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAiD,SAAY,EAAoD,EAAE,CAC1I,SAAS,IAAI,SAAS,CAAC;AAC3B,+FAA+F;AAC/F,kBAAkB;AAClB,MAAM,CAAC,MAAM,SAAS,GAAG,CAA4B,SAAY,EAA4C,EAAE;AAC3G,8IAA8I;AAC9I,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAA6C,CAAC;AAmB5G,2EAA2E;AAC3E,uEAAuE;AACvE,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM;AAChC,2HAA2H;AAC3H,YAAY,CAAC,IAAgB,CAChC,CAAC;AAEF,sEAAsE;AACtE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM;AAC1C,2HAA2H;AAC3H,oBAAoB,CAAC,IAAwB,CAChD,CAAC;AAEF,wFAAwF;AACxF,MAAM,CAAC,MAAM,YAAY,GAAG,kCAAkC,CAAC;AAE/D,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAEpF,qFAAqF;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAAuB,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAE1F,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-contracts",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Canonical PLURNK language contract, schemas, generated types, and runtime-neutral wire contracts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"json-schema-to-typescript": "^16.0.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "9d234b81e14a1d3fe88b9be3f7c643a0eb929533"
|
|
72
72
|
}
|
package/plurnk.md
CHANGED
|
@@ -1,166 +1,10 @@
|
|
|
1
|
-
# Plurnk
|
|
1
|
+
# Plurnk Harness
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Syntax
|
|
7
|
-
|
|
8
|
-
```exampleOperation (path)? <scope|range>? [metadata]? pattern? <!-- aside -->?
|
|
9
|
-
body?
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
> [!TIP]
|
|
13
|
-
> You may use more than three backticks in your opening and closing outer fences to wrap, nest, and disambiguate.
|
|
14
|
-
|
|
15
|
-
## Core Operations
|
|
16
|
-
|
|
17
|
-
* NOTE: Working memory. Save all new facts and ideas for later turns.
|
|
18
|
-
* TODO: List of remaining TODO items (absent if finished).
|
|
19
|
-
* FIND: List matching paths, or the match locations inside one path.
|
|
20
|
-
* READ: Read files, entries, streams, or only the lines a pattern selects.
|
|
21
|
-
* EDIT: Create a file or entry; replace existing text by scope or by pattern.
|
|
22
|
-
* COPY (source) <scope>? (destination) <scope>?: Copy files, entries, streams, or text regions (no body).
|
|
23
|
-
* MOVE (source) <scope>? (destination) <scope>?: Move files, entries, streams, or text regions (no body).
|
|
24
|
-
* KILL: Delete an entry, stop a process, or retire log items.
|
|
25
|
-
* WORK: Delegate to a child session (fresh log).
|
|
26
|
-
* FORK: Delegate to a child session (copied log).
|
|
27
|
-
* WAIT: Yield to child sessions or streams. You may include `[60]` to check in after 60 seconds.
|
|
28
|
-
* SEND: Deliver a new message.
|
|
29
|
-
* DONE: Deliver the final deliverable message, concluding an Open Message (oldest when path omitted).
|
|
30
|
-
* FAIL: Deliver the final failure message, concluding an Open Message (oldest when path omitted).
|
|
3
|
+
YOU MUST ONLY emit unfenced Code Mode statements: `await <server>.<tool>() // aside`
|
|
4
|
+
YOU MUST persist all new decisions, hypotheses, and facts as `plurnk.note` entries.
|
|
31
5
|
|
|
32
6
|
## Loop Protocol
|
|
33
7
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```NOTE
|
|
38
|
-
a finding or conclusion and its evidence
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
```TODO
|
|
42
|
-
- The first step.
|
|
43
|
-
- The second step.
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
````SEND
|
|
47
|
-
a continuing progress update response
|
|
48
|
-
````
|
|
49
|
-
|
|
50
|
-
````DONE
|
|
51
|
-
a final deliverable response
|
|
52
|
-
````
|
|
53
|
-
|
|
54
|
-
> [!TIP]
|
|
55
|
-
> The loop continues until all Open Work is resolved, with all Open Messages DONE or FAILed.
|
|
56
|
-
|
|
57
|
-
> [!TIP]
|
|
58
|
-
> YOU SHOULD NOT deliberate while discovering. Submit necessary NOTE, TODO, FIND and READ operations, then deliberate on the next turn.
|
|
59
|
-
|
|
60
|
-
## Delegation (plurnk:///delegation.md)
|
|
61
|
-
|
|
62
|
-
```WORK (session://exampleSessionName) <!-- the child's result lands in your log -->
|
|
63
|
-
Describe the child's complete task in the body.
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## `pattern` (plurnk:///pattern.md)
|
|
67
|
-
|
|
68
|
-
| prefix | dialect | example |
|
|
69
|
-
|--------|-----------------------------|---------------------------------|
|
|
70
|
-
| `/` | regex (ECMAScript) | `/\btimeout\b/i` |
|
|
71
|
-
| `//` | xpath (1.0) | `//dependencies/*` |
|
|
72
|
-
| `$` | jsonpath (RFC 9535) | `$.items[?(@.price>500)]` |
|
|
73
|
-
| `~` | full-text (SQLite FTS5) | `~retry` |
|
|
74
|
-
| `&` | graph (treesitter symbols) | `&sym`, `&<sym`, `&>sym` |
|
|
75
|
-
| none | literal or glob/extglob | `?(export )?(async )function *` |
|
|
76
|
-
|
|
77
|
-
> [!TIP]
|
|
78
|
-
> Patterns select source text as written, and an EDIT body replaces all of it:
|
|
79
|
-
> `//book/@lang` selects `lang="en"`;
|
|
80
|
-
> `$.lang` selects `"en"` with its quotes.
|
|
81
|
-
|
|
82
|
-
## `<scope|range>`
|
|
83
|
-
|
|
84
|
-
> [!TIP]
|
|
85
|
-
> Text scopes use 1-based lines and Unicode code-point columns across textual mimetypes.
|
|
86
|
-
|
|
87
|
-
| form | endpoint rule |
|
|
88
|
-
|-----------------|--------------------------------|
|
|
89
|
-
| `<L>`, `<@hash>` | one line |
|
|
90
|
-
| `<SL,EL>`, `<@start,@end>` | lines SL through EL, inclusive |
|
|
91
|
-
| `<SL,SC,EL,EC>` | start included, end excluded — `<@abcde,5,@abcde,8>` is `bar` in line 42 `foo bar baz` |
|
|
92
|
-
| `<L,1,L,1>`, `<@hash,1,@hash,1>` | insert before that line |
|
|
93
|
-
| `<0>`, `<-1>` | prepend / append on mutations; as an end line, `-1` is the last line |
|
|
94
|
-
|
|
95
|
-
## Workspace Navigation
|
|
96
|
-
|
|
97
|
-
```FIND (src/**/*.ts) <1,-1> /TODO/ <!-- paths with matches; the range pages results, not lines -->
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
```READ (src/**/*.ts) <1,-1> /TODO/ <!-- the matching lines in every file -->
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
```COPY (sh:///ab3d5678) (build.log) <!-- the command's output lands in a file, never in your context -->
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
* `(path)` may be a glob/extglob, permitting bulk operations.
|
|
107
|
-
* Log item paths nest: `log:///1/2/3/READ` is loop/turn/item/OP.
|
|
108
|
-
* FIND results hold one inner array per path: its channels, default first; append `#channel` to the path to select another: `(sh:///ab3d5678#stderr)`.
|
|
109
|
-
* Percent-encode in paths `(` as `%28` and `)` as `%29`.
|
|
110
|
-
|
|
111
|
-
## Membership (mcp:///plurnk_members.md)
|
|
112
|
-
|
|
113
|
-
```plurnk_members (add) <!-- adding membership tracking for files outside of the project folder -->
|
|
114
|
-
{"files": ["../exampleSisterProject/*.md", "../exampleSisterProject/example.json"]}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Editing
|
|
118
|
-
|
|
119
|
-
````EDIT (example.md) <@abcde> <!-- READ showed 42<@abcde>foo bar baz; the body replaces line 42 -->
|
|
120
|
-
bar
|
|
121
|
-
````
|
|
122
|
-
|
|
123
|
-
````EDIT (example.md) <@abcde,@fghij> <!-- the body replaces lines 42 through 43 -->
|
|
124
|
-
bar
|
|
125
|
-
````
|
|
126
|
-
|
|
127
|
-
````EDIT (example.md) <@abcde,5,@abcde,8> <!-- READ showed 42<@abcde>foo bar baz; "bar" becomes the body -->
|
|
128
|
-
qux
|
|
129
|
-
````
|
|
130
|
-
|
|
131
|
-
````EDIT (example.md) <@abcde,1,@abcde,1> <!-- insert before line 42; line 42 stays -->
|
|
132
|
-
baz
|
|
133
|
-
````
|
|
134
|
-
|
|
135
|
-
````EDIT (example.md) <@fghij,1,@fghij,1> <!-- insert after line 42: insert before line 43; insert after the last line: <-1> -->
|
|
136
|
-
qux
|
|
137
|
-
````
|
|
138
|
-
|
|
139
|
-
````EDIT (src/**/*.js) /\bfoo\b/ <!-- every match in every file becomes the body -->
|
|
140
|
-
bar
|
|
141
|
-
````
|
|
142
|
-
|
|
143
|
-
````EDIT (books.xml) //book[price > 35.00] <!-- an empty body removes each match -->
|
|
144
|
-
````
|
|
145
|
-
|
|
146
|
-
> [!TIP]
|
|
147
|
-
> YOU SHOULD address lines with batch-friendly `<@hash>` or `<@start,@end>` anchors to protect against stale targets.
|
|
148
|
-
|
|
149
|
-
## Context Curation
|
|
150
|
-
|
|
151
|
-
```READ (largeExampleFile.txt) <101,200> <!-- READing in chunks if budget constrained -->
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
```KILL (log:///1/[1-7]/*/{READ,emission}) <!-- old results, in bulk; the body may survive as a NOTE -->
|
|
155
|
-
example distillation or summarization
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## Environment (mcp:///plurnk_env.md)
|
|
159
|
-
|
|
160
|
-
```plurnk_env (add) <!-- persists for this session's commands -->
|
|
161
|
-
{"alias":"PLANET","value":"world"}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
```sh <!-- greet the world -->
|
|
165
|
-
echo "Hello, $PLANET."
|
|
166
|
-
```
|
|
8
|
+
* The loop continues until all Open Messages are `plurnk.done` or `plurnk.fail`.
|
|
9
|
+
* The loop continues if any tool in the turn returns results.
|
|
10
|
+
* The loop continues until all Open Work is resolved.
|