@plurnk/plurnk-contracts 1.11.0 → 1.13.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/SPEC.md +41 -10
- package/dist/conformance/agui-v1.json +5 -5
- package/dist/schema/ProviderUsage.json +1 -1
- package/dist/src/PlurnkErrorStrategy.d.ts +1 -0
- package/dist/src/PlurnkErrorStrategy.d.ts.map +1 -1
- package/dist/src/PlurnkErrorStrategy.js +90 -1
- package/dist/src/PlurnkErrorStrategy.js.map +1 -1
- package/dist/src/PlurnkParser.d.ts.map +1 -1
- package/dist/src/PlurnkParser.js +65 -1
- package/dist/src/PlurnkParser.js.map +1 -1
- package/dist/src/TagSignal.d.ts.map +1 -1
- package/dist/src/TagSignal.js +5 -0
- package/dist/src/TagSignal.js.map +1 -1
- package/dist/src/Validator.d.ts +1 -0
- package/dist/src/Validator.d.ts.map +1 -1
- package/dist/src/Validator.js +4 -0
- package/dist/src/Validator.js.map +1 -1
- package/dist/src/generated/plurnkParser.d.ts +0 -1
- package/dist/src/generated/plurnkParser.d.ts.map +1 -1
- package/dist/src/generated/plurnkParser.js +520 -519
- package/dist/src/generated/plurnkParser.js.map +1 -1
- package/dist/src/types.d.ts +7 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.generated.d.ts +2 -2
- package/dist/src/types.js.map +1 -1
- package/package.json +1 -1
- package/plurnk.md +20 -25
package/dist/src/types.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
export * from "./types.generated.ts";
|
|
2
|
-
import type { CapabilityPolicy, LoopPolicy, Position, PlurnkStatement, ReasoningPolicy } from "./types.generated.ts";
|
|
2
|
+
import type { CapabilityPolicy, LoopPolicy, Position, PlurnkStatement, ProviderRequestAccounting, ReasoningPolicy } from "./types.generated.ts";
|
|
3
3
|
import type PlurnkParseError from "./PlurnkParseError.ts";
|
|
4
4
|
export declare const PLURNK_OPS: readonly ["FIND", "READ", "EDIT", "COPY", "MOVE", "OPEN", "FOLD", "SEND", "EXEC", "BARE", "WORK", "FORK", "KILL", "PLAN"];
|
|
5
5
|
export declare const DEFAULT_RETRIEVAL_LIMIT = 16;
|
|
6
6
|
export type PlurnkOp = (typeof PLURNK_OPS)[number];
|
|
7
|
+
export interface ProviderRequestIdentity {
|
|
8
|
+
readonly provider: string;
|
|
9
|
+
readonly model: string;
|
|
10
|
+
}
|
|
11
|
+
export type ProviderRequestSettlement = (accounting: ProviderRequestAccounting) => Promise<void>;
|
|
12
|
+
export type ProviderRequestObserver = (identity: ProviderRequestIdentity) => Promise<ProviderRequestSettlement>;
|
|
7
13
|
export declare const REASONING_POLICIES: readonly ReasoningPolicy[];
|
|
8
14
|
export declare const DEFAULT_CAPABILITY_POLICY: CapabilityPolicy;
|
|
9
15
|
export declare const DEFAULT_LOOP_POLICY: LoopPolicy;
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAEA,cAAc,sBAAsB,CAAC;AAGrC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAEA,cAAc,sBAAsB,CAAC;AAGrC,OAAO,KAAK,EACR,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,eAAe,EACf,yBAAyB,EACzB,eAAe,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAM1D,eAAO,MAAM,UAAU,YACnB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CACxG,CAAC;AAIX,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,MAAM,MAAM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AM,CAAA;KAAE,CAAC;CACrD,CAAC"}
|
|
@@ -1055,7 +1055,7 @@ export interface ProviderRequestAccounting {
|
|
|
1055
1055
|
cost: ProviderCost;
|
|
1056
1056
|
}
|
|
1057
1057
|
/**
|
|
1058
|
-
* Known token quantities
|
|
1058
|
+
* Known token quantities. Physical-request instances enforce their partition identities; aggregate projections sum each reported field independently. Omitted fields are unknown; explicit zero is observed or exactly derived.
|
|
1059
1059
|
*/
|
|
1060
1060
|
export interface ProviderUsage {
|
|
1061
1061
|
inputTokens?: number;
|
|
@@ -1079,7 +1079,7 @@ export type DecimalAmount = string;
|
|
|
1079
1079
|
export type NonEmptyString = string;
|
|
1080
1080
|
export type Tokens = number;
|
|
1081
1081
|
/**
|
|
1082
|
-
* Known token quantities
|
|
1082
|
+
* Known token quantities. Physical-request instances enforce their partition identities; aggregate projections sum each reported field independently. Omitted fields are unknown; explicit zero is observed or exactly derived.
|
|
1083
1083
|
*/
|
|
1084
1084
|
export type ReasoningPolicy = ("off" | "adaptive" | "low" | "medium" | "high");
|
|
1085
1085
|
export interface SkillDefinition {
|
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,qBAAqB,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,oFAAoF;AACpF,cAAc,sBAAsB,CAAC;AAErC,OAAO,qBAAqB,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAWzF,0EAA0E;AAC1E,6CAA6C;AAE7C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,MAAM,EAAE,M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|
|
4
|
+
YOU MUST continue performing OPs until every Active User Prompt requirement and every pending or in_progress item is completed.
|
|
5
5
|
|
|
6
6
|
### Syntax
|
|
7
7
|
|
|
@@ -21,7 +21,7 @@ body?
|
|
|
21
21
|
|
|
22
22
|
* Plurnk grammar is overloaded and polymorphic, with `[signal]`, `(path)`, `<scope>`, and `body` components depending on the OP.
|
|
23
23
|
* `[signal]`, `(path)`, `<scope>`, `<!-- annotations -->` and `body` are optional, but at least one must be present.
|
|
24
|
-
*
|
|
24
|
+
* A scoped EDIT with no `body` deletes the selected region; an unscoped EDIT only creates a new file or entry.
|
|
25
25
|
* Code fences are not part of the OP syntax. Do not add them around OPs.
|
|
26
26
|
|
|
27
27
|
```plurnk-syntax
|
|
@@ -40,18 +40,15 @@ literal replacement text
|
|
|
40
40
|
|
|
41
41
|
## MOVE0 [+tag] (source) <source text region> (destination) <destination text region> <!-- move between targets -->
|
|
42
42
|
|
|
43
|
-
## FOLD0 [tag] (log items) <log body lines> <!-- hide matching log bodies -->
|
|
43
|
+
## FOLD0 [±tag] (log items) <log body lines> <!-- hide matching log bodies -->
|
|
44
44
|
filter pattern
|
|
45
45
|
|
|
46
|
-
## OPEN0 [tag] (log items) <log body lines> <!-- reveal matching log bodies -->
|
|
46
|
+
## OPEN0 [±tag] (log items) <log body lines> <!-- reveal matching log bodies -->
|
|
47
47
|
filter pattern
|
|
48
48
|
|
|
49
49
|
## EXEC0 <!-- run a command, script, or tool -->
|
|
50
50
|
command, script, or tool input
|
|
51
51
|
|
|
52
|
-
## BARE0 [+tag] <!-- retrieve one model response -->
|
|
53
|
-
prompt
|
|
54
|
-
|
|
55
52
|
## WORK0 (worker://name) <!-- spawn a child worker -->
|
|
56
53
|
prompt
|
|
57
54
|
|
|
@@ -107,25 +104,24 @@ Next: Distill relevant findings from this chunk, then continue reading.
|
|
|
107
104
|
|
|
108
105
|
* Pattern matchers in the OP's `body` select resources by content:
|
|
109
106
|
|
|
110
|
-
| prefix | dialect | form | engine |
|
|
111
|
-
|
|
112
|
-
| `/` | regex | `/pattern/flags` | ECMAScript |
|
|
113
|
-
| `//` | xpath | `//selector` | XPath 1.0 |
|
|
114
|
-
| `$` | jsonpath | `$.field`, `$.items[*].name` | RFC 9535 |
|
|
115
|
-
| `~` | semantic | `~phrase` | embedding cosine |
|
|
116
|
-
| `&` | graph | `&<symbol`, `&>symbol`, `&symbol` | symbol index |
|
|
117
|
-
| none | glob | `pattern` | glob / literal |
|
|
107
|
+
| prefix | dialect | form | example | engine |
|
|
108
|
+
|--------|----------|------------------------------------|-------------------------|------------------|
|
|
109
|
+
| `/` | regex | `/pattern/flags` | `/\btimeout\b/i` | ECMAScript |
|
|
110
|
+
| `//` | xpath | `//selector` | `//dependencies/*` | XPath 1.0 |
|
|
111
|
+
| `$` | jsonpath | `$.field`, `$.items[*].name` | `$[*][?(@.tokensActive>500)]` | RFC 9535 |
|
|
112
|
+
| `~` | semantic | `~phrase` | `~retry` | embedding cosine |
|
|
113
|
+
| `&` | graph | `&<symbol`, `&>symbol`, `&symbol` | `&<parseTurn` | symbol index |
|
|
114
|
+
| none | glob | `pattern` | `?(export )?(async )function *` | glob / literal |
|
|
118
115
|
|
|
119
116
|
* The leading symbol commits its dialect.
|
|
120
117
|
* In a path target, `*` maps one level and `**` crosses directories.
|
|
121
|
-
* JSONPath filters bracket directly: `$[*][?(@.tokensActive>500)]`.
|
|
122
118
|
* Mapping is universal: JSONPath can query XML and XPath can query JSON.
|
|
123
119
|
* Patterned FIND returns resources for broad targets and locations for exact targets.
|
|
124
120
|
|
|
125
121
|
### `(path)`
|
|
126
122
|
|
|
127
123
|
* Each OP's `(path)` slot takes exactly one bare project-relative path or resource URI.
|
|
128
|
-
* Log item paths are nested: `log:///1/2/3` is loop/turn/item.
|
|
124
|
+
* Log item paths are nested: `log:///1/2/3/READ` is loop/turn/item/OP; omit the OP segment to match any OP.
|
|
129
125
|
* In FIND results, each inner array lists one resource's channels, default first. Append `#channel` to override the default.
|
|
130
126
|
* A file or entry extension declares its mimetype.
|
|
131
127
|
* Percent-encode reserved path characters: `(` becomes `%28`, `)` becomes `%29`, and `<` becomes `%3C`.
|
|
@@ -140,12 +136,15 @@ Next: Distill relevant findings from this chunk, then continue reading.
|
|
|
140
136
|
|
|
141
137
|
| form | endpoint rule |
|
|
142
138
|
|-----------------|--------------------------------|
|
|
143
|
-
| `<L>` | one line
|
|
139
|
+
| `<L>` | one line |
|
|
140
|
+
| `<@hash>` | one line |
|
|
144
141
|
| `<SL,EL>` | lines SL through EL, inclusive |
|
|
142
|
+
| `<@start,@end>` | lines @start through @end, inclusive |
|
|
145
143
|
| `<SL,SC,EL,EC>` | start included, end excluded — `<2,1,2,5>` is columns 1-4 of line 2 |
|
|
144
|
+
| `<0>`, `<-1>` | prepend / append on mutations; as an end line, `-1` is the last line |
|
|
146
145
|
|
|
147
|
-
* Unscoped FIND returns items 1-16; unscoped READ returns lines 1–16.
|
|
148
|
-
* Rendered
|
|
146
|
+
* Unscoped FIND returns items 1-16; unscoped READ returns lines 1–16.
|
|
147
|
+
* Rendered READ lines and an applied EDIT's resulting lines begin with a per-line `@hash` anchor and `L:` line number; neither is content.
|
|
149
148
|
|
|
150
149
|
YOU SHOULD prefer `<@hash>` or `<@start,@end>` for EDIT line coordinates; they reject stale targets.
|
|
151
150
|
|
|
@@ -155,7 +154,6 @@ YOU SHOULD prefer `<@hash>` or `<@start,@end>` for EDIT line coordinates; they r
|
|
|
155
154
|
* `## KILL0 (log:///1/[1-7]/*/{PLAN,READ})` removes irrelevant log items.
|
|
156
155
|
* `## FOLD0 [+trimmed] (log:///**/READ) <17,-1>` tags every READ and folds each body after line 16.
|
|
157
156
|
* `## OPEN0 (log:///1/2/3/READ) <@aB3dE>` restores one anchored line.
|
|
158
|
-
* Log item paths contain their loop, turn, and item: `log:///{loop}/{turn}/{item}/{OP}`.
|
|
159
157
|
|
|
160
158
|
YOU SHOULD FOLD, KILL, or trim superseded, stale, or irrelevant log content.
|
|
161
159
|
|
|
@@ -165,10 +163,7 @@ YOU SHOULD FOLD, KILL, or trim superseded, stale, or irrelevant log content.
|
|
|
165
163
|
|-------|------------|---------------------------------|------|
|
|
166
164
|
| WORK | fresh log | Divide and conquer | self-contained task prompt, with necessary context |
|
|
167
165
|
| FORK | forked log | Do two things at once | distinct objective prompt; prior context is inherited |
|
|
168
|
-
| BARE | no log | Context-free one-shot inference | complete standalone prompt |
|
|
169
166
|
|
|
170
167
|
* Delegation `body` must contain a prompt, not OPs.
|
|
171
168
|
* Send a worker another message: `## SEND0 (worker://recheck)` with body `Also verify the alternative against the existing tests.`.
|
|
172
169
|
* Terminate a worker: `## KILL0 (worker://recheck)`.
|
|
173
|
-
|
|
174
|
-
YOU SHOULD decompose distinct subtasks into separate WORKers.
|