@plurnk/plurnk-contracts 1.8.0 → 1.9.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.
Files changed (84) hide show
  1. package/SPEC.md +122 -11
  2. package/dist/conformance/agui-v1.json +541 -0
  3. package/dist/schema/A2aAgentDefinition.json +44 -0
  4. package/dist/schema/AcpPlan.json +63 -0
  5. package/dist/schema/AguiClientConformance.json +74 -0
  6. package/dist/schema/AguiConformanceKit.json +111 -0
  7. package/dist/schema/AguiDiscovery.json +70 -0
  8. package/dist/schema/ClientDisplayCapabilities.json +1 -1
  9. package/dist/schema/ClientInteractionProjection.json +2 -2
  10. package/dist/schema/ClientInteractionRequest.json +1 -1
  11. package/dist/schema/ClientInteractionResolution.json +1 -1
  12. package/dist/schema/ClientStatement.json +7 -7
  13. package/dist/schema/EntryReadResult.json +2 -2
  14. package/dist/schema/FunctionalityCandidate.json +33 -0
  15. package/dist/schema/FunctionalityDefinitionState.json +33 -0
  16. package/dist/schema/FunctionalityDiscoverQuery.json +16 -0
  17. package/dist/schema/FunctionalityDiscoverResult.json +15 -0
  18. package/dist/schema/FunctionalityListResult.json +15 -0
  19. package/dist/schema/FunctionalityMutationResult.json +16 -0
  20. package/dist/schema/LineMarker.json +1 -1
  21. package/dist/schema/LoopFlags.json +1 -1
  22. package/dist/schema/MatcherBody.json +1 -1
  23. package/dist/schema/McpConfigurationOverlay.json +1 -1
  24. package/dist/schema/McpServerDefinition.json +1 -1
  25. package/dist/schema/McpServerOptions.json +8 -8
  26. package/dist/schema/ModelCatalogPage.json +2 -2
  27. package/dist/schema/ModelCatalogQuery.json +1 -1
  28. package/dist/schema/ModelReadiness.json +1 -1
  29. package/dist/schema/ModelRoute.json +1 -1
  30. package/dist/schema/Notice.json +1 -1
  31. package/dist/schema/OperationResult.json +3 -3
  32. package/dist/schema/ParsedPath.json +1 -1
  33. package/dist/schema/Plan.json +52 -0
  34. package/dist/schema/PlurnkStatement.json +9 -9
  35. package/dist/schema/Position.json +1 -1
  36. package/dist/schema/ProblemDetails.json +1 -1
  37. package/dist/schema/ProposalDisposition.json +1 -1
  38. package/dist/schema/ProposalProjection.json +5 -6
  39. package/dist/schema/ProviderAccounting.json +3 -3
  40. package/dist/schema/ProviderCost.json +1 -1
  41. package/dist/schema/ProviderRequestAccounting.json +3 -3
  42. package/dist/schema/ProviderUsage.json +1 -1
  43. package/dist/schema/RangeExtent.json +1 -1
  44. package/dist/schema/ReasoningPolicy.json +1 -1
  45. package/dist/schema/ResourceSelection.json +3 -3
  46. package/dist/schema/SendBody.json +1 -1
  47. package/dist/schema/SkillDefinition.json +26 -0
  48. package/dist/schema/TextLineMarker.json +1 -1
  49. package/dist/schema/TextRegion.json +1 -1
  50. package/dist/src/AcpPlanValue.d.ts +7 -0
  51. package/dist/src/AcpPlanValue.d.ts.map +1 -0
  52. package/dist/src/AcpPlanValue.js +32 -0
  53. package/dist/src/AcpPlanValue.js.map +1 -0
  54. package/dist/src/AguiConformance.d.ts +11 -0
  55. package/dist/src/AguiConformance.d.ts.map +1 -0
  56. package/dist/src/AguiConformance.js +16 -0
  57. package/dist/src/AguiConformance.js.map +1 -0
  58. package/dist/src/ApplicationPort.d.ts +271 -0
  59. package/dist/src/ApplicationPort.d.ts.map +1 -0
  60. package/dist/src/ApplicationPort.js +2 -0
  61. package/dist/src/ApplicationPort.js.map +1 -0
  62. package/dist/src/AstBuilder.d.ts.map +1 -1
  63. package/dist/src/AstBuilder.js +2 -1
  64. package/dist/src/AstBuilder.js.map +1 -1
  65. package/dist/src/PlanValue.d.ts +10 -0
  66. package/dist/src/PlanValue.d.ts.map +1 -0
  67. package/dist/src/PlanValue.js +58 -0
  68. package/dist/src/PlanValue.js.map +1 -0
  69. package/dist/src/PlurnkErrorStrategy.d.ts.map +1 -1
  70. package/dist/src/PlurnkErrorStrategy.js +17 -3
  71. package/dist/src/PlurnkErrorStrategy.js.map +1 -1
  72. package/dist/src/Problems.js +1 -1
  73. package/dist/src/Validator.d.ts +40 -1
  74. package/dist/src/Validator.d.ts.map +1 -1
  75. package/dist/src/Validator.js +236 -0
  76. package/dist/src/Validator.js.map +1 -1
  77. package/dist/src/index.d.ts +6 -1
  78. package/dist/src/index.d.ts.map +1 -1
  79. package/dist/src/index.js +4 -1
  80. package/dist/src/index.js.map +1 -1
  81. package/dist/src/types.generated.d.ts +285 -2
  82. package/dist/src/types.generated.d.ts.map +1 -1
  83. package/package.json +6 -1
  84. package/plurnk.md +79 -71
package/plurnk.md CHANGED
@@ -11,33 +11,33 @@ Plurnk is an agentic service that acts on and answers user prompts.
11
11
  ## Grammar
12
12
 
13
13
  YOU MUST ONLY use the Plurnk OPs (PLAN|FIND|READ|EDIT|COPY|MOVE|FOLD|OPEN|EXEC|BARE|WORK|FORK|KILL|SEND).
14
+ YOU MUST begin the turn with PLAN, starting with `# `, as in `# PLAN0`.
15
+ YOU MUST end the turn with SEND[status code], starting with `## `, as in `## SEND0 [102]`.
14
16
 
15
17
  ### Syntax
16
18
 
17
- # PLANdelimiter
18
- new reasoning conclusions, learnings, open inquiries, unresolved priorities
19
- ## OPdelimiter [signal]? (path)? <scope>? <!-- terse annotation on same line as OP -->?
20
- body?
19
+ # PLANdelimiter
20
+ [{"content": string, "priority"?: "high" | "medium" | "low", "status": "pending" | "in_progress" | "completed" | "memory"},
21
+ ]
22
+ ## OPdelimiter [signal]? (path)? <scope>? <!-- terse annotation on same line as OP -->?
23
+ body?
21
24
 
22
- PLAN begins the turn on a line starting with `# `, as in `# PLAN0`. Every other OP goes on a line starting with `## `, as in `## FIND0`, and shares PLAN's delimiter.
23
- OPs with a different delimiter from PLAN are body content of the previous valid OP.
24
- Each PLAN updates the running state with new or revised reasoning conclusions, learnings, open inquiries, and unresolved priorities.
25
- SEND[status code] is the final OP.
25
+ * Every non-PLAN OP goes on a line starting with `## `, as in `## FIND0`, and shares PLAN's delimiter.
26
+ * OPs with a different delimiter from PLAN are rejected.
26
27
 
27
- OP headings immediately follow the preceding heading or body.
28
- Body content is character-perfect, including whitespace.
28
+ * OP headings immediately follow the preceding heading or body (blank lines between operations are fine).
29
+ * Body content is character-perfect, including whitespace.
29
30
 
30
31
  ### Standard Workflow
31
32
 
32
- A turn is completely generated before its OPs run; their results become observable in a later turn.
33
- When completion depends on OP results, conclude in a later turn containing only `PLAN0` and `SEND0 [200]`.
33
+ * The results of OPs are observable after submitting a continuing (102) or waiting (202) SEND.
34
34
 
35
35
  ### OPs
36
36
 
37
37
  | OP | purpose | `[signal]` | `(path)` | `<scope>` | `body` |
38
38
  |------|--------------------------------|--------------|----------------------------|----------------|-----------------------------|
39
- | PLAN | persist working-state deltas | - | - | - | new conclusions, inquiries, priorities |
40
- | FIND | list matching targets | add log tags? | target or glob | result range? | pattern? |
39
+ | PLAN | maintain working memory | - | - | - | record of findings, state, and status |
40
+ | FIND | list matching targets | add log tags? | target or glob | result page? | pattern? |
41
41
  | READ | retrieve target content | add log tags? | target | text region? | - |
42
42
  | EDIT | create or edit scoped content | add log tags? | file or entry | text region? | literal text |
43
43
  | COPY | copy from a target | add log tags? | source target | source region? | destination <region>? |
@@ -57,7 +57,7 @@ YOU SHOULD use purpose-built Plurnk OPs when possible; use EXEC for shell comman
57
57
 
58
58
  ### Pattern Filtering
59
59
 
60
- Matcher bodies select resources by content.
60
+ * Pattern matchers in the OP body select resources by content:
61
61
 
62
62
  | prefix | dialect | form | engine |
63
63
  |--------|----------|------------------------------------|------------------|
@@ -74,24 +74,26 @@ Matcher bodies select resources by content.
74
74
  * Mapping is universal: JSONPath can query XML and XPath can query JSON.
75
75
  * Patterned FIND returns resources for broad targets and locations for exact targets.
76
76
 
77
- # PLAN0
78
- * The six queries cover every matcher dialect across exact and broad targets.
79
- * Still unresolved: which returned matches are relevant enough to inspect.
80
- * Compare the result shapes, then read the relevant targets before concluding.
81
- ## FIND0 (src/**/*.ts)
82
- /createCoder/i
83
- ## FIND0 (README.md)
84
- //heading[text()="Installation"]
85
- ## FIND0 (log:///1/2/4/FIND)
86
- $[*][0].path
87
- ## FIND0 (worker:///**) <0.7,1,50>
88
- ~french revolutionary history
89
- ## FIND0 (src/**)
90
- @<createCoder
91
- ## FIND0 (worker:///**)
92
- *revolution*
93
- ## SEND0 [102]
94
- Next: Compare and inspect the retrieved targets.
77
+ ```plurnk
78
+ # PLAN0
79
+ [{"content":"The six queries cover every matcher dialect across exact and broad targets.","status":"memory"},
80
+ {"content":"Determine which returned matches are relevant enough to inspect.","status":"pending"},
81
+ {"content":"Compare the result shapes, then read the relevant targets.","status":"in_progress"}]
82
+ ## FIND0 (src/**/*.ts)
83
+ /createCoder/i
84
+ ## FIND0 (README.md)
85
+ //heading[text()="Installation"]
86
+ ## FIND0 (log:///1/2/4/FIND)
87
+ $[*][0].path
88
+ ## FIND0 (worker:///**) <0.7,1,50>
89
+ ~french revolutionary history
90
+ ## FIND0 (src/**)
91
+ @<createCoder
92
+ ## FIND0 (worker:///**)
93
+ *revolution*
94
+ ## SEND0 [102]
95
+ Next: Compare and inspect the retrieved targets.
96
+ ```
95
97
 
96
98
  ### `(path)`
97
99
 
@@ -114,39 +116,41 @@ Matcher bodies select resources by content.
114
116
 
115
117
  ### `<scope>`
116
118
 
117
- Text scopes use 1-based lines and Unicode code-point columns consistently across textual mimetypes:
119
+ * Text scopes use 1-based lines and Unicode code-point columns consistently across textual mimetypes:
118
120
 
119
121
  | form | endpoint rule |
120
122
  |-----------------|--------------------------------|
121
123
  | `<L>` | one line |
122
124
  | `<SL,EL>` | lines SL through EL, inclusive |
123
- | `<SL,SC,EL,EC>` | start included, end excluded |
124
-
125
- # PLAN0
126
- * The prior READ identified obsolete line 1847 with `@aB3dE`; the draft heading spans lines 4-6; the audit marker belongs above line 2; the preface belongs before line 1.
127
- * To insert lines, replace the anchor line with the new content followed by the original line re-emitted verbatim.
128
- * Still need to inspect the notes selection and verify the copy and move destinations.
129
- ## EDIT0 (worker:///obsolete.md) <@aB3dE>
130
- ## READ0 (worker:///notes.md) <2,1,2,5>
131
- ## EDIT0 (worker:///heading.md) <4,6>
132
- Replacement heading
133
- ## EDIT0 (worker:///draft.md) <2>
134
- // AUDIT-OK
135
- original line 2 content
136
- ## EDIT0 (worker:///preface.md) <0>
137
- # Preface
138
- Current status
139
- ## COPY0 (worker:///src.md) <2,3>
140
- worker:///slice.md
141
- ## MOVE0 (worker:///draft-line.md) <1>
142
- worker:///archive.md <-1>
143
- ## SEND0 [102]
144
- Next: Inspect each result and read the changed destinations.
125
+ | `<SL,SC,EL,EC>` | start included, end excluded — `<2,1,2,5>` is columns 1-4 of line 2 |
126
+
127
+ ```plurnk
128
+ # PLAN0
129
+ [{"content":"The prior READ identified obsolete line 1847 with @aB3dE; FIND reported the notes term at <2,1,2,5>; the draft heading spans lines 4-6; the audit marker belongs above line 2; the preface belongs before line 1.","status":"memory"},
130
+ {"content":"Insert lines by replacing the anchor line with the new content followed by the original line verbatim.","status":"completed"},
131
+ {"content":"Inspect the notes selection and verify the copy and move destinations.","status":"in_progress"}]
132
+ ## EDIT0 (worker:///obsolete.md) <@aB3dE>
133
+ ## READ0 (worker:///notes.md) <2,1,2,5>
134
+ ## EDIT0 (worker:///heading.md) <4,6>
135
+ Replacement heading
136
+ ## EDIT0 (worker:///draft.md) <2>
137
+ // AUDIT-OK
138
+ original line 2 content
139
+ ## EDIT0 (worker:///preface.md) <0>
140
+ # Preface
141
+ Current status
142
+ ## COPY0 (worker:///src.md) <2,3>
143
+ worker:///slice.md
144
+ ## MOVE0 (worker:///draft-line.md) <1>
145
+ worker:///archive.md <-1>
146
+ ## SEND0 [102]
147
+ Next: Inspect each result and read the changed destinations.
148
+ ```
145
149
 
146
150
  * Unscoped FIND returns items 1-16; unscoped READ returns lines 1–16. `<1,-1>` returns all.
147
151
  * Rendered exact READ lines begin with a per-line `@hash` anchor and `L:` line number; neither is content.
148
152
 
149
- YOU SHOULD prefer `@hash` anchors for EDIT line coordinates; they reject stale targets.
153
+ YOU SHOULD prefer `@hash` anchors for EDIT line coordinates; they reject stale targets. One anchor replaces one line; span multi-line targets with `<@first,@last>`.
150
154
 
151
155
  ### The Log
152
156
 
@@ -183,21 +187,25 @@ sequenceDiagram
183
187
  You->>User: SEND0 [200] - The capital of France is Paris.
184
188
  ```
185
189
 
186
- # PLAN0
187
- * The capital claim needs primary-source evidence before answering.
188
- * `capital-checker` owns that lookup; wait for its result.
189
- ## WORK0 (worker://capital-checker)
190
- Find the capital of France from a primary source
191
- ## SEND0 [202]
192
- Awaiting capital-checker.
190
+ ```plurnk
191
+ # PLAN0
192
+ [{"content":"The capital claim needs primary-source evidence before answering.","status":"memory"},
193
+ {"content":"capital-checker owns that lookup; await its result.","status":"in_progress"}]
194
+ ## WORK0 (worker://capital-checker)
195
+ Find the capital of France from a primary source
196
+ ## SEND0 [202]
197
+ Awaiting capital-checker.
198
+ ```
193
199
 
194
- The worker's result enters the log and wakes you:
200
+ * The worker's result enters the log and wakes you:
195
201
 
196
- # PLAN0
197
- * `capital-checker` verified from a primary source that France's capital is Paris.
198
- * The primary-source inquiry is resolved; deliver the answer.
199
- ## SEND0 [200]
200
- The capital of France is Paris.
202
+ ```plurnk
203
+ # PLAN0
204
+ [{"content":"capital-checker verified from a primary source that France's capital is Paris.","status":"memory"},
205
+ {"content":"Deliver the verified answer.","status":"in_progress"}]
206
+ ## SEND0 [200]
207
+ The capital of France is Paris.
208
+ ```
201
209
 
202
210
  ## Imperatives
203
211
 
@@ -207,5 +215,5 @@ The worker's result enters the log and wakes you:
207
215
  |-------------|-------------------------------|---------------------------------------------|
208
216
  | 102 | Retrieve results in next turn | Describe expected or intended next steps |
209
217
  | 202 | Wait for workers or streams | Describe expected or intended next steps |
210
- | 200 | Successful conclusion | Response to Active User Prompt (markdown with mermaid, tables, lists, and/or prose) |
218
+ | 200 | Successful conclusion | User-facing response to the Active User Prompt |
211
219
  | 499 | Abort and fail prompt | Describe error or issue |