@openplanr/protocol 0.6.0 → 0.6.2
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/lib/dashboard/closed-json-contract.mjs +99 -109
- package/lib/dashboard/operate-experience-audit-display-contract.d.mts +128 -153
- package/lib/dashboard/operate-experience-audit-display-contract.mjs +530 -585
- package/lib/dashboard/operate-experience-display-contract.d.mts +415 -437
- package/lib/dashboard/operate-experience-display-contract.mjs +768 -831
- package/lib/dashboard/operate-experience-surface-contract.d.mts +143 -148
- package/lib/dashboard/operate-experience-surface-contract.mjs +72 -73
- package/lib/dashboard/operate-review-contract.d.mts +7 -14
- package/lib/dashboard/operate-review-contract.mjs +46 -42
- package/lib/dashboard/operate-review-display-workspace-contract.d.mts +2 -5
- package/lib/dashboard/operate-review-display-workspace-contract.mjs +158 -104
- package/lib/dashboard/operate-review-payload-safety.mjs +4 -2
- package/lib/dashboard/operate-review-workspace-projection-v2.d.mts +47 -33
- package/lib/protocol/index.d.ts +2647 -543
- package/package.json +1 -1
- package/registries/commands.json +7 -7
- package/registries/skills.json +6 -6
- package/src/browser-contracts.d.mts +4 -1
- package/src/browser-contracts.mjs +16 -5
- package/src/canonical-json.d.mts +3 -1
- package/src/canonical-json.mjs +57 -20
- package/src/compat/live-evidence-v2.mjs +1604 -485
- package/src/compat/operate-experience-live-patch.mjs +67 -15
- package/src/compat/operating-planning-contracts.mjs +183 -51
- package/src/contracts.d.mts +54 -13
- package/src/contracts.mjs +655 -345
- package/src/design-contracts.mjs +58 -21
- package/src/design-handoff-contracts.d.mts +67 -11
- package/src/design-handoff-contracts.mjs +243 -98
- package/src/design-publication-contracts.mjs +98 -33
- package/src/diagram-authoring-contracts.d.mts +422 -78
- package/src/diagram-authoring-contracts.mjs +1697 -326
- package/src/diagram-contracts.d.mts +4 -1
- package/src/diagram-contracts.mjs +16 -4
- package/src/enterprise-contracts.d.mts +211 -46
- package/src/enterprise-contracts.mjs +727 -175
- package/src/errors.mjs +4 -0
- package/src/generated/canonical-registries.mjs +13 -13
- package/src/index.d.mts +8 -8
- package/src/index.mjs +36 -20
- package/src/json-schema.d.mts +21 -6
- package/src/json-schema.mjs +66 -18
- package/src/planning-contracts.d.mts +8 -2
- package/src/planning-contracts.mjs +33 -7
- package/src/registries.d.mts +11 -3
- package/src/registries.mjs +369 -87
- package/src/review-experience-contracts.d.mts +7 -2
- package/src/review-experience-contracts.mjs +198 -49
- package/src/semver.mjs +5 -1
- package/src/skill-source-contracts.d.mts +36 -16
- package/src/skill-source-contracts.mjs +25 -6
- package/src/task-contracts.d.mts +13 -3
- package/src/task-contracts.mjs +181 -40
- package/src/workspace-contracts.d.mts +38 -10
- package/src/workspace-contracts.mjs +147 -33
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { canonicalizeJson, sha256Hex } from './canonical-json.mjs';
|
|
1
3
|
import { validateJson } from './json-schema.mjs';
|
|
2
4
|
import { DESIGN_REVIEW_BUNDLE_SCHEMA } from './workspace-contracts.mjs';
|
|
3
|
-
import { canonicalizeJson, sha256Hex } from './canonical-json.mjs';
|
|
4
5
|
|
|
5
6
|
const text = { type: 'string', maxLength: 16384 };
|
|
6
7
|
const id = { type: 'string', minLength: 1, maxLength: 128 };
|
|
7
8
|
const digest = { type: 'string', pattern: '^[a-f0-9]{64}$' };
|
|
8
9
|
const texts = { type: 'array', maxItems: 256, items: text };
|
|
9
|
-
const closed = (properties, required = Object.keys(properties)) => ({
|
|
10
|
+
const closed = (properties, required = Object.keys(properties)) => ({
|
|
11
|
+
type: 'object',
|
|
12
|
+
additionalProperties: false,
|
|
13
|
+
properties,
|
|
14
|
+
required,
|
|
15
|
+
});
|
|
10
16
|
const list = (items, maxItems = 256) => ({ type: 'array', maxItems, items });
|
|
11
17
|
const schema = (name, properties, required) => ({
|
|
12
18
|
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
@@ -14,87 +20,230 @@ const schema = (name, properties, required) => ({
|
|
|
14
20
|
'x-openplanr-contract': { id: name, version: '1.10.0' },
|
|
15
21
|
...closed(properties, required),
|
|
16
22
|
});
|
|
23
|
+
/**
|
|
24
|
+
* A published schema reopened for its next version.
|
|
25
|
+
* @typedef {{ properties: Record<string, unknown>; required: string[]; [key: string]: unknown }} MutableSchema
|
|
26
|
+
*/
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
/** @type {typeof import('./review-experience-contracts.d.mts').DESIGN_REVIEW_CONTEXT_SCHEMA} */
|
|
29
|
+
export const DESIGN_REVIEW_CONTEXT_SCHEMA = schema(
|
|
30
|
+
'design-review-context',
|
|
31
|
+
{
|
|
32
|
+
kind: { const: 'openplanr-design-review-context' },
|
|
33
|
+
schemaVersion: { const: '1.0.0' },
|
|
34
|
+
designId: id,
|
|
35
|
+
brief: closed({ purpose: text, requests: { ...texts, maxItems: 3 }, audience: text }, [
|
|
36
|
+
'purpose',
|
|
37
|
+
'requests',
|
|
38
|
+
]),
|
|
39
|
+
revisionSummary: text,
|
|
40
|
+
implementation: closed({
|
|
41
|
+
tokens: list(closed({ name: id, value: text, description: text }, ['name', 'value']), 512),
|
|
42
|
+
components: list(
|
|
43
|
+
closed(
|
|
44
|
+
{
|
|
45
|
+
id,
|
|
46
|
+
name: text,
|
|
47
|
+
screenIds: list(id),
|
|
48
|
+
anchorIds: list(id),
|
|
49
|
+
states: list(closed({ name: id, description: text })),
|
|
50
|
+
notes: text,
|
|
51
|
+
responsive: text,
|
|
52
|
+
accessibility: text,
|
|
53
|
+
},
|
|
54
|
+
['id', 'name'],
|
|
55
|
+
),
|
|
56
|
+
),
|
|
57
|
+
responsive: texts,
|
|
58
|
+
accessibility: texts,
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
['kind', 'schemaVersion', 'designId', 'brief', 'implementation'],
|
|
62
|
+
);
|
|
28
63
|
|
|
29
|
-
|
|
30
|
-
export const
|
|
31
|
-
|
|
64
|
+
/** @type {typeof import('./review-experience-contracts.d.mts').DESIGN_FINGERPRINT_SCHEMA} */
|
|
65
|
+
export const DESIGN_FINGERPRINT_SCHEMA = closed({
|
|
66
|
+
screenId: id,
|
|
67
|
+
variantId: id,
|
|
68
|
+
frameId: id,
|
|
69
|
+
contentDigest: digest,
|
|
70
|
+
guidanceDigest: digest,
|
|
71
|
+
});
|
|
72
|
+
const bundleV11 = {
|
|
73
|
+
.../** @type {MutableSchema} */ (structuredClone(DESIGN_REVIEW_BUNDLE_SCHEMA)),
|
|
32
74
|
$id: 'https://openplanr.dev/schemas/v1.10.0/design-review-bundle.schema.json',
|
|
33
75
|
'x-openplanr-contract': { id: 'design-review-bundle', version: '1.10.0' },
|
|
34
76
|
};
|
|
35
|
-
Object.assign(
|
|
36
|
-
schemaVersion: { const: '1.1.0' },
|
|
37
|
-
|
|
77
|
+
Object.assign(bundleV11.properties, {
|
|
78
|
+
schemaVersion: { const: '1.1.0' },
|
|
79
|
+
reviewContext: DESIGN_REVIEW_CONTEXT_SCHEMA,
|
|
80
|
+
contextDigest: digest,
|
|
81
|
+
fingerprints: list(DESIGN_FINGERPRINT_SCHEMA),
|
|
38
82
|
});
|
|
39
|
-
|
|
83
|
+
bundleV11.required.push('reviewContext', 'contextDigest', 'fingerprints');
|
|
84
|
+
/** @type {typeof import('./review-experience-contracts.d.mts').DESIGN_REVIEW_BUNDLE_V11_SCHEMA} */
|
|
85
|
+
export const DESIGN_REVIEW_BUNDLE_V11_SCHEMA = bundleV11;
|
|
40
86
|
|
|
41
|
-
const item = closed(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
87
|
+
const item = closed(
|
|
88
|
+
{
|
|
89
|
+
pinId: id,
|
|
90
|
+
reviewId: id,
|
|
91
|
+
screenId: id,
|
|
92
|
+
revisionId: id,
|
|
93
|
+
text,
|
|
94
|
+
refinement: text,
|
|
95
|
+
stale: { type: 'boolean' },
|
|
96
|
+
author: text,
|
|
97
|
+
reviewOf: digest,
|
|
98
|
+
source: text,
|
|
99
|
+
},
|
|
100
|
+
['pinId', 'text'],
|
|
101
|
+
);
|
|
102
|
+
/** @type {typeof import('./review-experience-contracts.d.mts').DESIGN_HANDOFF_CONTENT_SCHEMA} */
|
|
103
|
+
export const DESIGN_HANDOFF_CONTENT_SCHEMA = closed({
|
|
104
|
+
summary: text,
|
|
105
|
+
agreedChanges: list(item, 10000),
|
|
106
|
+
openQuestions: list(item, 10000),
|
|
107
|
+
deferred: list(item, 10000),
|
|
108
|
+
rejected: list(item, 10000),
|
|
109
|
+
});
|
|
110
|
+
/** @type {typeof import('./review-experience-contracts.d.mts').DESIGN_HANDOFF_SCHEMA} */
|
|
111
|
+
export const DESIGN_HANDOFF_SCHEMA = schema(
|
|
112
|
+
'design-review-handoff',
|
|
113
|
+
{
|
|
114
|
+
kind: { const: 'openplanr-design-review-handoff' },
|
|
115
|
+
schemaVersion: { const: '1.0.0' },
|
|
116
|
+
title: text,
|
|
117
|
+
version: { type: 'integer', minimum: 1 },
|
|
118
|
+
status: { enum: ['draft', 'approved'] },
|
|
119
|
+
basis: closed({
|
|
120
|
+
designId: id,
|
|
121
|
+
sourceRevision: digest,
|
|
122
|
+
contextDigest: digest,
|
|
123
|
+
reviewOf: digest,
|
|
124
|
+
selectedVariant: id,
|
|
125
|
+
feedbackDigest: digest,
|
|
126
|
+
verificationDigest: digest,
|
|
127
|
+
feedbackWatermark: { type: 'integer', minimum: 0 },
|
|
128
|
+
}),
|
|
129
|
+
content: DESIGN_HANDOFF_CONTENT_SCHEMA,
|
|
130
|
+
contentHash: digest,
|
|
131
|
+
markdown: { type: 'string', maxLength: 2097152 },
|
|
132
|
+
affectedScreens: list(id),
|
|
133
|
+
verificationGaps: texts,
|
|
134
|
+
reviewNotes: list(closed({ reviewId: id, text }), 10000),
|
|
135
|
+
approval: closed({ contentHash: digest, at: { type: 'string', format: 'date-time' } }),
|
|
136
|
+
},
|
|
137
|
+
[
|
|
138
|
+
'kind',
|
|
139
|
+
'schemaVersion',
|
|
140
|
+
'title',
|
|
141
|
+
'version',
|
|
142
|
+
'status',
|
|
143
|
+
'basis',
|
|
144
|
+
'content',
|
|
145
|
+
'contentHash',
|
|
146
|
+
'markdown',
|
|
147
|
+
'affectedScreens',
|
|
148
|
+
'verificationGaps',
|
|
149
|
+
'reviewNotes',
|
|
150
|
+
],
|
|
151
|
+
);
|
|
51
152
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
153
|
+
/** @type {typeof import('./review-experience-contracts.d.mts').DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA} */
|
|
154
|
+
export const DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA = {
|
|
155
|
+
...schema(
|
|
156
|
+
'design-review-metadata-payload',
|
|
157
|
+
{
|
|
158
|
+
schemaVersion: { const: '1.0.0' },
|
|
159
|
+
kind: { enum: ['category', 'disposition'] },
|
|
160
|
+
author: { ...text, minLength: 1, maxLength: 160 },
|
|
161
|
+
reviewOf: digest,
|
|
162
|
+
pinId: id,
|
|
163
|
+
category: { enum: ['question', 'suggestion', 'blocker'] },
|
|
164
|
+
disposition: { enum: ['accepted', 'deferred', 'rejected'] },
|
|
165
|
+
reason: text,
|
|
166
|
+
updatedAt: { type: 'string', format: 'date-time' },
|
|
167
|
+
},
|
|
168
|
+
['schemaVersion', 'kind', 'author', 'reviewOf', 'pinId', 'updatedAt'],
|
|
169
|
+
),
|
|
170
|
+
allOf: [
|
|
171
|
+
{
|
|
172
|
+
if: { properties: { kind: { const: 'category' } } },
|
|
173
|
+
then: { required: ['category'], not: { required: ['disposition'] } },
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
if: { properties: { kind: { const: 'disposition' } } },
|
|
177
|
+
then: { required: ['disposition', 'reason'], not: { required: ['category'] } },
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
};
|
|
62
181
|
|
|
63
182
|
// A request to change the product is distinct from a suggestion or a blocker.
|
|
64
183
|
// Keep the closed 1.0.0 payload intact for existing signed review history.
|
|
65
|
-
|
|
66
|
-
|
|
184
|
+
const payloadV11 = {
|
|
185
|
+
.../** @type {MutableSchema} */ (structuredClone(DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA)),
|
|
67
186
|
$id: 'https://openplanr.dev/schemas/v1.11.0/design-review-metadata-payload.schema.json',
|
|
68
187
|
'x-openplanr-contract': { id: 'design-review-metadata-payload', version: '1.11.0' },
|
|
69
188
|
};
|
|
70
|
-
Object.assign(
|
|
189
|
+
Object.assign(payloadV11.properties, {
|
|
71
190
|
schemaVersion: { const: '1.1.0' },
|
|
72
191
|
category: { enum: ['question', 'suggestion', 'change-request', 'blocker'] },
|
|
73
192
|
});
|
|
193
|
+
/** @type {typeof import('./review-experience-contracts.d.mts').DESIGN_REVIEW_METADATA_PAYLOAD_V11_SCHEMA} */
|
|
194
|
+
export const DESIGN_REVIEW_METADATA_PAYLOAD_V11_SCHEMA = payloadV11;
|
|
74
195
|
|
|
196
|
+
/** @returns {ReturnType<typeof import('./review-experience-contracts.d.mts').assertReviewExperience>} */
|
|
75
197
|
export function assertReviewExperience(value, contract) {
|
|
76
198
|
const errors = validateJson(value, contract);
|
|
77
|
-
if (errors.length)
|
|
199
|
+
if (errors.length)
|
|
200
|
+
throw new TypeError(
|
|
201
|
+
`Invalid ${contract['x-openplanr-contract']?.id ?? 'review data'}: ${errors
|
|
202
|
+
.slice(0, 4)
|
|
203
|
+
.map((item) => `${item.path} ${item.detail}`)
|
|
204
|
+
.join('; ')}`,
|
|
205
|
+
);
|
|
78
206
|
return value;
|
|
79
207
|
}
|
|
208
|
+
/** @returns {ReturnType<typeof import('./review-experience-contracts.d.mts').assertDesignReviewMetadata>} */
|
|
80
209
|
export function assertDesignReviewMetadata(value) {
|
|
81
|
-
return assertReviewExperience(
|
|
210
|
+
return assertReviewExperience(
|
|
211
|
+
value,
|
|
212
|
+
value?.schemaVersion === '1.1.0'
|
|
213
|
+
? DESIGN_REVIEW_METADATA_PAYLOAD_V11_SCHEMA
|
|
214
|
+
: DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA,
|
|
215
|
+
);
|
|
82
216
|
}
|
|
217
|
+
/** @returns {ReturnType<typeof import('./review-experience-contracts.d.mts').assertDesignReviewBundle>} */
|
|
83
218
|
export function assertDesignReviewBundle(value) {
|
|
84
|
-
assertReviewExperience(
|
|
219
|
+
assertReviewExperience(
|
|
220
|
+
value,
|
|
221
|
+
value?.schemaVersion === '1.1.0'
|
|
222
|
+
? DESIGN_REVIEW_BUNDLE_V11_SCHEMA
|
|
223
|
+
: DESIGN_REVIEW_BUNDLE_SCHEMA,
|
|
224
|
+
);
|
|
85
225
|
if (value.schemaVersion === '1.1.0') {
|
|
86
|
-
if (
|
|
87
|
-
|
|
226
|
+
if (
|
|
227
|
+
value.reviewContext.designId !== value.design.id ||
|
|
228
|
+
value.contextDigest !== sha256Hex(canonicalizeJson(value.reviewContext))
|
|
229
|
+
)
|
|
230
|
+
throw new TypeError('Review context identity or digest does not match its published design.');
|
|
231
|
+
const entries = new Set(
|
|
232
|
+
value.entries.map((entry) => `${entry.screenId}:${entry.variantId}:${entry.frameId}`),
|
|
233
|
+
);
|
|
88
234
|
const seen = new Set();
|
|
89
235
|
for (const item of value.fingerprints) {
|
|
90
236
|
const key = `${item.screenId}:${item.variantId}:${item.frameId}`;
|
|
91
|
-
if (!entries.has(key) || seen.has(key))
|
|
237
|
+
if (!entries.has(key) || seen.has(key))
|
|
238
|
+
throw new TypeError('Review fingerprints must identify distinct published artboards.');
|
|
92
239
|
seen.add(key);
|
|
93
240
|
}
|
|
94
|
-
if (seen.size && seen.size !== entries.size)
|
|
241
|
+
if (seen.size && seen.size !== entries.size)
|
|
242
|
+
throw new TypeError('Review fingerprints must cover every published artboard.');
|
|
95
243
|
}
|
|
96
244
|
return value;
|
|
97
245
|
}
|
|
246
|
+
/** @type {typeof import('./review-experience-contracts.d.mts').REVIEW_EXPERIENCE_SCHEMAS} */
|
|
98
247
|
export const REVIEW_EXPERIENCE_SCHEMAS = Object.freeze({
|
|
99
248
|
'design-review-context': DESIGN_REVIEW_CONTEXT_SCHEMA,
|
|
100
249
|
'design-review-bundle': DESIGN_REVIEW_BUNDLE_V11_SCHEMA,
|
package/src/semver.mjs
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
1
2
|
// Canonical SemVer 2.0.0 grammar (semver.org BNF). One source of truth so the
|
|
2
3
|
// skill-source JSON Schema and the compiler graph share a single definition of
|
|
3
4
|
// "exact version" and can never drift. Rejects empty dot-separated identifiers,
|
|
4
5
|
// leading-zero numeric identifiers, and empty prerelease/build segments.
|
|
5
|
-
|
|
6
|
+
/** @type {typeof import('./semver.d.mts').SEMVER_PATTERN} */
|
|
7
|
+
export const SEMVER_PATTERN =
|
|
8
|
+
'^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-((?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$';
|
|
6
9
|
|
|
10
|
+
/** @type {typeof import('./semver.d.mts').SEMVER_REGEX} */
|
|
7
11
|
export const SEMVER_REGEX = new RegExp(SEMVER_PATTERN, 'u');
|
|
@@ -6,20 +6,40 @@ export declare const PLANNING_V17_CONTRACT_FILES: Readonly<Record<string, string
|
|
|
6
6
|
export declare const PROTOCOL_V17_CONTRACT_FILES: Readonly<Record<string, string>>;
|
|
7
7
|
export declare const SKILL_PACKAGE_V18_CONTRACT_FILES: Readonly<Record<string, string>>;
|
|
8
8
|
export declare const PROTOCOL_V18_CONTRACT_FILES: Readonly<Record<string, string>>;
|
|
9
|
-
export declare const SKILL_SOURCE_V16_REGISTRIES: Readonly<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
9
|
+
export declare const SKILL_SOURCE_V16_REGISTRIES: Readonly<
|
|
10
|
+
Record<
|
|
11
|
+
string,
|
|
12
|
+
Readonly<{
|
|
13
|
+
kind: string;
|
|
14
|
+
protocolVersion: '1.6.0';
|
|
15
|
+
}>
|
|
16
|
+
>
|
|
17
|
+
>;
|
|
18
|
+
export declare const DIAGRAM_V16_REGISTRIES: Readonly<
|
|
19
|
+
Record<
|
|
20
|
+
string,
|
|
21
|
+
Readonly<{
|
|
22
|
+
kind: string;
|
|
23
|
+
protocolVersion: '1.6.0';
|
|
24
|
+
}>
|
|
25
|
+
>
|
|
26
|
+
>;
|
|
27
|
+
export declare const PROTOCOL_V16_REGISTRIES: Readonly<
|
|
28
|
+
Record<
|
|
29
|
+
string,
|
|
30
|
+
Readonly<{
|
|
31
|
+
kind: string;
|
|
32
|
+
protocolVersion: '1.6.0';
|
|
33
|
+
}>
|
|
34
|
+
>
|
|
35
|
+
>;
|
|
36
|
+
export declare const SKILL_SOURCE_V17_REGISTRIES: Readonly<
|
|
37
|
+
Record<
|
|
38
|
+
string,
|
|
39
|
+
Readonly<{
|
|
40
|
+
kind: string;
|
|
41
|
+
protocolVersion: '1.7.0';
|
|
42
|
+
}>
|
|
43
|
+
>
|
|
44
|
+
>;
|
|
25
45
|
export declare const PROTOCOL_V17_REGISTRIES: typeof SKILL_SOURCE_V17_REGISTRIES;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
// @ts-check
|
|
1
2
|
// Protocol 1.6 grows by additive contract families. Keep each family explicit,
|
|
2
3
|
// then expose one aggregate map to schema resolvers and browser consumers.
|
|
4
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').SKILL_SOURCE_V16_CONTRACT_FILES} */
|
|
3
5
|
export const SKILL_SOURCE_V16_CONTRACT_FILES = Object.freeze({
|
|
4
6
|
'generated-asset-manifest': 'generated-asset-manifest.schema.json',
|
|
5
7
|
'skill-catalog': 'skill-catalog.schema.json',
|
|
@@ -13,6 +15,7 @@ export const SKILL_SOURCE_V16_CONTRACT_FILES = Object.freeze({
|
|
|
13
15
|
'skill-source': 'skill-source.schema.json',
|
|
14
16
|
});
|
|
15
17
|
|
|
18
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').DIAGRAM_V16_CONTRACT_FILES} */
|
|
16
19
|
export const DIAGRAM_V16_CONTRACT_FILES = Object.freeze({
|
|
17
20
|
'diagram-consumer-reference': 'diagram-consumer-reference.schema.json',
|
|
18
21
|
'diagram-document': 'diagram-document.schema.json',
|
|
@@ -24,13 +27,16 @@ export const DIAGRAM_V16_CONTRACT_FILES = Object.freeze({
|
|
|
24
27
|
'diagram-type-registry': 'diagram-type-registry.schema.json',
|
|
25
28
|
});
|
|
26
29
|
|
|
30
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').PROTOCOL_V16_CONTRACT_FILES} */
|
|
27
31
|
export const PROTOCOL_V16_CONTRACT_FILES = Object.freeze({
|
|
28
32
|
...SKILL_SOURCE_V16_CONTRACT_FILES,
|
|
29
33
|
...DIAGRAM_V16_CONTRACT_FILES,
|
|
30
34
|
});
|
|
31
35
|
|
|
36
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').SKILL_SOURCE_V17_CONTRACT_FILES} */
|
|
32
37
|
export const SKILL_SOURCE_V17_CONTRACT_FILES = SKILL_SOURCE_V16_CONTRACT_FILES;
|
|
33
38
|
|
|
39
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').PLANNING_V17_CONTRACT_FILES} */
|
|
34
40
|
export const PLANNING_V17_CONTRACT_FILES = Object.freeze({
|
|
35
41
|
'planning-id-sequence': 'planning-id-sequence.schema.json',
|
|
36
42
|
'request-authority': 'request-authority.schema.json',
|
|
@@ -39,21 +45,25 @@ export const PLANNING_V17_CONTRACT_FILES = Object.freeze({
|
|
|
39
45
|
task: 'task.schema.json',
|
|
40
46
|
});
|
|
41
47
|
|
|
48
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').PROTOCOL_V17_CONTRACT_FILES} */
|
|
42
49
|
export const PROTOCOL_V17_CONTRACT_FILES = Object.freeze({
|
|
43
50
|
...SKILL_SOURCE_V17_CONTRACT_FILES,
|
|
44
51
|
...PLANNING_V17_CONTRACT_FILES,
|
|
45
52
|
});
|
|
46
53
|
|
|
54
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').SKILL_PACKAGE_V18_CONTRACT_FILES} */
|
|
47
55
|
export const SKILL_PACKAGE_V18_CONTRACT_FILES = Object.freeze({
|
|
48
56
|
'skill-package': 'skill-package.schema.json',
|
|
49
57
|
'utility-command-catalog': 'utility-command-catalog.schema.json',
|
|
50
58
|
});
|
|
51
59
|
|
|
60
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').PROTOCOL_V18_CONTRACT_FILES} */
|
|
52
61
|
export const PROTOCOL_V18_CONTRACT_FILES = SKILL_PACKAGE_V18_CONTRACT_FILES;
|
|
53
62
|
|
|
54
63
|
// Canonical classification for the additive registries stored in the shared
|
|
55
64
|
// registries/ directory. Projection, preservation, and ecosystem generators
|
|
56
65
|
// derive version custody from this descriptor instead of owning filename lists.
|
|
66
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').SKILL_SOURCE_V16_REGISTRIES} */
|
|
57
67
|
export const SKILL_SOURCE_V16_REGISTRIES = Object.freeze({
|
|
58
68
|
'skill-host-profiles.json': Object.freeze({
|
|
59
69
|
kind: 'skill-host-profile-registry',
|
|
@@ -75,6 +85,7 @@ export const SKILL_SOURCE_V16_REGISTRIES = Object.freeze({
|
|
|
75
85
|
}),
|
|
76
86
|
});
|
|
77
87
|
|
|
88
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').DIAGRAM_V16_REGISTRIES} */
|
|
78
89
|
export const DIAGRAM_V16_REGISTRIES = Object.freeze({
|
|
79
90
|
'diagram-grammars.json': Object.freeze({
|
|
80
91
|
kind: 'diagram-type-registry',
|
|
@@ -90,16 +101,24 @@ export const DIAGRAM_V16_REGISTRIES = Object.freeze({
|
|
|
90
101
|
}),
|
|
91
102
|
});
|
|
92
103
|
|
|
104
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').PROTOCOL_V16_REGISTRIES} */
|
|
93
105
|
export const PROTOCOL_V16_REGISTRIES = Object.freeze({
|
|
94
106
|
...SKILL_SOURCE_V16_REGISTRIES,
|
|
95
107
|
...DIAGRAM_V16_REGISTRIES,
|
|
96
108
|
});
|
|
97
109
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').SKILL_SOURCE_V17_REGISTRIES} */
|
|
111
|
+
export const SKILL_SOURCE_V17_REGISTRIES = Object.freeze(
|
|
112
|
+
Object.fromEntries(
|
|
113
|
+
Object.entries(SKILL_SOURCE_V16_REGISTRIES).map(([file, descriptor]) => [
|
|
114
|
+
file,
|
|
115
|
+
Object.freeze({
|
|
116
|
+
...descriptor,
|
|
117
|
+
protocolVersion: '1.7.0',
|
|
118
|
+
}),
|
|
119
|
+
]),
|
|
120
|
+
),
|
|
121
|
+
);
|
|
104
122
|
|
|
123
|
+
/** @type {typeof import('./skill-source-contracts.d.mts').PROTOCOL_V17_REGISTRIES} */
|
|
105
124
|
export const PROTOCOL_V17_REGISTRIES = SKILL_SOURCE_V17_REGISTRIES;
|
package/src/task-contracts.d.mts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
export interface ProtocolSemanticDiagnostic {
|
|
2
|
-
|
|
1
|
+
export interface ProtocolSemanticDiagnostic {
|
|
2
|
+
code: string;
|
|
3
|
+
path: string;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function validateTaskManifestSemantics(
|
|
7
|
+
value: unknown,
|
|
8
|
+
options?: object,
|
|
9
|
+
): ProtocolSemanticDiagnostic[];
|
|
3
10
|
export declare function assertTaskManifestSemantics<T>(value: T, options?: object): T;
|
|
4
11
|
export declare function validateTaskGraph(values: unknown[]): ProtocolSemanticDiagnostic[];
|
|
5
12
|
export declare function countR2Tasks(values: unknown[]): number;
|
|
6
|
-
export declare function validateTaskOutputSemantics(
|
|
13
|
+
export declare function validateTaskOutputSemantics(
|
|
14
|
+
value: unknown,
|
|
15
|
+
options?: { taskManifest?: any },
|
|
16
|
+
): ProtocolSemanticDiagnostic[];
|
|
7
17
|
export declare function assertTaskOutputSemantics<T>(value: T, options?: { taskManifest?: any }): T;
|