reviewer-protocol 1.0.0-beta.0 → 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 +2 -2
- 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
|
@@ -124,12 +124,12 @@ return { stopReason: 'end_turn', _meta: acpMeta({ usage: { input: 1200, output:
|
|
|
124
124
|
|
|
125
125
|
## Versions and compatibility
|
|
126
126
|
|
|
127
|
-
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.
|
|
128
128
|
|
|
129
129
|
- The protocol and the manifest schema each carry an integer major version (`REVIEWER_PROTOCOL_VERSION`, `MANIFEST_SCHEMA_VERSION`).
|
|
130
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`.
|
|
131
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.
|
|
132
|
-
-
|
|
132
|
+
- A host may stop accepting a previous major as soon as it supports a new one.
|
|
133
133
|
|
|
134
134
|
## License
|
|
135
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
|
|