reviewer-protocol 1.0.0-beta.1 → 1.0.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 +3 -5
- package/dist/canonicalJson.js +1 -1
- package/dist/template.js +2 -2
- package/package.json +4 -2
- package/src/canonicalJson.ts +1 -1
- package/src/template.ts +2 -2
package/README.md
CHANGED
|
@@ -12,11 +12,9 @@ A harness connects in one of two ways:
|
|
|
12
12
|
This package holds the protocol's schemas ([zod](https://zod.dev)) and the functions a host and a manifest author share: manifest parsing and hashing, template rendering, and the output mapping.
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
|
-
npm install reviewer-protocol
|
|
15
|
+
npm install reviewer-protocol
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Until the first official release, the package is published under the `beta` dist-tag (see [Versions and compatibility](#versions-and-compatibility)).
|
|
19
|
-
|
|
20
18
|
## Boundary
|
|
21
19
|
|
|
22
20
|
The host gives a reviewer the checkout's path (its working directory), a task prompt, the revision under review, a time limit, and the model and effort to use. The reviewer returns the [events](#events) below. A session takes several prompts in order (the review, reminders, verification of fixes); a harness that cannot continue a session receives each later prompt, made self-contained, in a new process.
|
|
@@ -126,12 +124,12 @@ return { stopReason: 'end_turn', _meta: acpMeta({ usage: { input: 1200, output:
|
|
|
126
124
|
|
|
127
125
|
## Versions and compatibility
|
|
128
126
|
|
|
129
|
-
The
|
|
127
|
+
The package follows [semantic versioning](https://semver.org): a release that breaks its exports or the protocol raises the package's major version. No compatibility across majors is promised, and a new major may be released at any time.
|
|
130
128
|
|
|
131
129
|
- The protocol and the manifest schema each carry an integer major version (`REVIEWER_PROTOCOL_VERSION`, `MANIFEST_SCHEMA_VERSION`).
|
|
132
130
|
- Adding an optional field or a `failure.kind` to the protocol does not raise its major: a host ignores unknown fields and reads an unknown kind as `unknown`.
|
|
133
131
|
- The manifest schema rejects unknown keys, so adding a key raises its version. A host refuses a manifest newer than itself and asks to be updated.
|
|
134
|
-
-
|
|
132
|
+
- A host may stop accepting a previous major as soon as it supports a new one.
|
|
135
133
|
|
|
136
134
|
## License
|
|
137
135
|
|
package/dist/canonicalJson.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export function canonicalJson(value) {
|
|
8
8
|
if (value === null || typeof value !== 'object') {
|
|
9
9
|
if (typeof value === 'number' && !Number.isFinite(value))
|
|
10
|
-
throw new
|
|
10
|
+
throw new TypeError('JSON has no non-finite numbers');
|
|
11
11
|
const text = JSON.stringify(value);
|
|
12
12
|
if (text === undefined)
|
|
13
13
|
throw new Error(`not a JSON value: ${typeof value}`);
|
package/dist/template.js
CHANGED
|
@@ -67,7 +67,7 @@ export function renderArgs(templates, values, item) {
|
|
|
67
67
|
if (list === undefined)
|
|
68
68
|
return [];
|
|
69
69
|
if (!Array.isArray(list))
|
|
70
|
-
throw new
|
|
70
|
+
throw new TypeError(`"each" needs a list, and "${template.each}" is not one`);
|
|
71
71
|
return list.flatMap((element) => renderArgs(template.args, values, element));
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -80,7 +80,7 @@ function applyFilter(value, filter) {
|
|
|
80
80
|
if (filter === 'toml')
|
|
81
81
|
return tomlValue(value);
|
|
82
82
|
if (Array.isArray(value))
|
|
83
|
-
throw new
|
|
83
|
+
throw new TypeError('a list is rendered through "each" or a filter');
|
|
84
84
|
return String(value);
|
|
85
85
|
}
|
|
86
86
|
// TOML basic strings share JSON's escapes for every character JSON.stringify escapes, and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reviewer-protocol",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Reviewer Protocol: events, manifest format, and an ACP extension for connecting reviewer harnesses to review orchestrators",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@tsconfig/bun": "1.0.11",
|
|
36
36
|
"@types/bun": "1.4.4",
|
|
37
|
-
"typescript": "7.0.2"
|
|
37
|
+
"typescript": "7.0.2",
|
|
38
|
+
"semantic-release": "25.0.9",
|
|
39
|
+
"conventional-changelog-conventionalcommits": "10.4.0"
|
|
38
40
|
},
|
|
39
41
|
"publishConfig": {
|
|
40
42
|
"access": "public",
|
package/src/canonicalJson.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export function canonicalJson(value: unknown): string {
|
|
8
8
|
if (value === null || typeof value !== 'object') {
|
|
9
|
-
if (typeof value === 'number' && !Number.isFinite(value)) throw new
|
|
9
|
+
if (typeof value === 'number' && !Number.isFinite(value)) throw new TypeError('JSON has no non-finite numbers');
|
|
10
10
|
const text = JSON.stringify(value);
|
|
11
11
|
if (text === undefined) throw new Error(`not a JSON value: ${typeof value}`);
|
|
12
12
|
return text;
|
package/src/template.ts
CHANGED
|
@@ -96,7 +96,7 @@ export function renderArgs(templates: readonly ArgTemplate[], values: TemplateVa
|
|
|
96
96
|
}
|
|
97
97
|
const list = values[template.each];
|
|
98
98
|
if (list === undefined) return [];
|
|
99
|
-
if (!Array.isArray(list)) throw new
|
|
99
|
+
if (!Array.isArray(list)) throw new TypeError(`"each" needs a list, and "${template.each}" is not one`);
|
|
100
100
|
return (list as readonly string[]).flatMap((element) => renderArgs(template.args, values, element));
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -108,7 +108,7 @@ function hasValue(value: unknown): boolean {
|
|
|
108
108
|
function applyFilter(value: unknown, filter: Filter | undefined): string {
|
|
109
109
|
if (filter === 'json') return JSON.stringify(value);
|
|
110
110
|
if (filter === 'toml') return tomlValue(value);
|
|
111
|
-
if (Array.isArray(value)) throw new
|
|
111
|
+
if (Array.isArray(value)) throw new TypeError('a list is rendered through "each" or a filter');
|
|
112
112
|
return String(value);
|
|
113
113
|
}
|
|
114
114
|
|