@plurnk/plurnk-contracts 1.11.0 → 1.12.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 +89 -0
- 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 +11 -18
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
|
|
|
@@ -49,9 +49,6 @@ filter pattern
|
|
|
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,18 +104,17 @@ 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
|
|
|
@@ -145,7 +141,7 @@ Next: Distill relevant findings from this chunk, then continue reading.
|
|
|
145
141
|
| `<SL,SC,EL,EC>` | start included, end excluded — `<2,1,2,5>` is columns 1-4 of line 2 |
|
|
146
142
|
|
|
147
143
|
* Unscoped FIND returns items 1-16; unscoped READ returns lines 1–16. `<1,-1>` returns all.
|
|
148
|
-
* Rendered
|
|
144
|
+
* 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
145
|
|
|
150
146
|
YOU SHOULD prefer `<@hash>` or `<@start,@end>` for EDIT line coordinates; they reject stale targets.
|
|
151
147
|
|
|
@@ -165,10 +161,7 @@ YOU SHOULD FOLD, KILL, or trim superseded, stale, or irrelevant log content.
|
|
|
165
161
|
|-------|------------|---------------------------------|------|
|
|
166
162
|
| WORK | fresh log | Divide and conquer | self-contained task prompt, with necessary context |
|
|
167
163
|
| 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
164
|
|
|
170
165
|
* Delegation `body` must contain a prompt, not OPs.
|
|
171
166
|
* Send a worker another message: `## SEND0 (worker://recheck)` with body `Also verify the alternative against the existing tests.`.
|
|
172
167
|
* Terminate a worker: `## KILL0 (worker://recheck)`.
|
|
173
|
-
|
|
174
|
-
YOU SHOULD decompose distinct subtasks into separate WORKers.
|