@openplanr/protocol 0.6.1 → 0.7.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 (58) hide show
  1. package/README.md +10 -0
  2. package/lib/dashboard/closed-json-contract.mjs +99 -109
  3. package/lib/dashboard/operate-experience-audit-display-contract.d.mts +128 -153
  4. package/lib/dashboard/operate-experience-audit-display-contract.mjs +530 -585
  5. package/lib/dashboard/operate-experience-display-contract.d.mts +415 -437
  6. package/lib/dashboard/operate-experience-display-contract.mjs +777 -831
  7. package/lib/dashboard/operate-experience-surface-contract.d.mts +143 -148
  8. package/lib/dashboard/operate-experience-surface-contract.mjs +72 -73
  9. package/lib/dashboard/operate-review-contract.d.mts +7 -14
  10. package/lib/dashboard/operate-review-contract.mjs +46 -42
  11. package/lib/dashboard/operate-review-display-workspace-contract.d.mts +2 -5
  12. package/lib/dashboard/operate-review-display-workspace-contract.mjs +158 -104
  13. package/lib/dashboard/operate-review-payload-safety.mjs +4 -2
  14. package/lib/dashboard/operate-review-workspace-projection-v2.d.mts +47 -33
  15. package/lib/protocol/index.d.ts +2647 -543
  16. package/package.json +1 -1
  17. package/registries/artifact-theme.json +64 -0
  18. package/registries/commands.json +40 -40
  19. package/registries/skills.json +5 -5
  20. package/schemas/v1.14.0/artifact-theme.schema.json +316 -0
  21. package/src/browser-contracts.d.mts +4 -1
  22. package/src/browser-contracts.mjs +16 -5
  23. package/src/canonical-json.d.mts +6 -1
  24. package/src/canonical-json.mjs +100 -22
  25. package/src/compat/live-evidence-v2.mjs +1611 -485
  26. package/src/compat/operate-experience-live-patch.mjs +67 -15
  27. package/src/compat/operating-planning-contracts.mjs +183 -51
  28. package/src/contracts.d.mts +54 -13
  29. package/src/contracts.mjs +635 -343
  30. package/src/design-contracts.mjs +58 -21
  31. package/src/design-handoff-contracts.d.mts +67 -11
  32. package/src/design-handoff-contracts.mjs +236 -119
  33. package/src/design-publication-contracts.mjs +98 -33
  34. package/src/diagram-authoring-contracts.d.mts +422 -78
  35. package/src/diagram-authoring-contracts.mjs +1715 -335
  36. package/src/diagram-contracts.d.mts +4 -1
  37. package/src/diagram-contracts.mjs +16 -4
  38. package/src/enterprise-contracts.d.mts +211 -46
  39. package/src/enterprise-contracts.mjs +738 -184
  40. package/src/errors.mjs +4 -0
  41. package/src/generated/canonical-registries.mjs +45 -45
  42. package/src/index.d.mts +8 -8
  43. package/src/index.mjs +36 -20
  44. package/src/json-schema.d.mts +21 -6
  45. package/src/json-schema.mjs +66 -18
  46. package/src/planning-contracts.d.mts +8 -2
  47. package/src/planning-contracts.mjs +33 -7
  48. package/src/registries.d.mts +11 -3
  49. package/src/registries.mjs +369 -87
  50. package/src/review-experience-contracts.d.mts +7 -2
  51. package/src/review-experience-contracts.mjs +198 -49
  52. package/src/semver.mjs +5 -1
  53. package/src/skill-source-contracts.d.mts +36 -16
  54. package/src/skill-source-contracts.mjs +25 -6
  55. package/src/task-contracts.d.mts +13 -3
  56. package/src/task-contracts.mjs +181 -40
  57. package/src/workspace-contracts.d.mts +38 -10
  58. 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)) => ({ type: 'object', additionalProperties: false, properties, required });
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
- export const DESIGN_REVIEW_CONTEXT_SCHEMA = schema('design-review-context', {
19
- kind: { const: 'openplanr-design-review-context' }, schemaVersion: { const: '1.0.0' }, designId: id,
20
- brief: closed({ purpose: text, requests: { ...texts, maxItems: 3 }, audience: text }, ['purpose', 'requests']),
21
- revisionSummary: text,
22
- implementation: closed({
23
- tokens: list(closed({ name: id, value: text, description: text }, ['name', 'value']), 512),
24
- components: list(closed({ id, name: text, screenIds: list(id), anchorIds: list(id), states: list(closed({ name: id, description: text })), notes: text, responsive: text, accessibility: text }, ['id', 'name'])),
25
- responsive: texts, accessibility: texts,
26
- }),
27
- }, ['kind', 'schemaVersion', 'designId', 'brief', 'implementation']);
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
- export const DESIGN_FINGERPRINT_SCHEMA = closed({ screenId: id, variantId: id, frameId: id, contentDigest: digest, guidanceDigest: digest });
30
- export const DESIGN_REVIEW_BUNDLE_V11_SCHEMA = {
31
- ...structuredClone(DESIGN_REVIEW_BUNDLE_SCHEMA),
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(DESIGN_REVIEW_BUNDLE_V11_SCHEMA.properties, {
36
- schemaVersion: { const: '1.1.0' }, reviewContext: DESIGN_REVIEW_CONTEXT_SCHEMA,
37
- contextDigest: digest, fingerprints: list(DESIGN_FINGERPRINT_SCHEMA),
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
- DESIGN_REVIEW_BUNDLE_V11_SCHEMA.required.push('reviewContext', 'contextDigest', 'fingerprints');
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({ pinId: id, reviewId: id, screenId: id, revisionId: id, text, refinement: text, stale: { type: 'boolean' }, author: text, reviewOf: digest, source: text }, ['pinId', 'text']);
42
- export const DESIGN_HANDOFF_CONTENT_SCHEMA = closed({ summary: text, agreedChanges: list(item, 10000), openQuestions: list(item, 10000), deferred: list(item, 10000), rejected: list(item, 10000) });
43
- export const DESIGN_HANDOFF_SCHEMA = schema('design-review-handoff', {
44
- kind: { const: 'openplanr-design-review-handoff' }, schemaVersion: { const: '1.0.0' },
45
- title: text, version: { type: 'integer', minimum: 1 }, status: { enum: ['draft', 'approved'] },
46
- basis: closed({ designId: id, sourceRevision: digest, contextDigest: digest, reviewOf: digest, selectedVariant: id, feedbackDigest: digest, verificationDigest: digest, feedbackWatermark: { type: 'integer', minimum: 0 } }),
47
- content: DESIGN_HANDOFF_CONTENT_SCHEMA, contentHash: digest, markdown: { type: 'string', maxLength: 2097152 },
48
- affectedScreens: list(id), verificationGaps: texts, reviewNotes: list(closed({reviewId:id,text}),10000),
49
- approval: closed({ contentHash: digest, at: { type: 'string', format: 'date-time' } }),
50
- }, ['kind', 'schemaVersion', 'title', 'version', 'status', 'basis', 'content', 'contentHash', 'markdown', 'affectedScreens', 'verificationGaps', 'reviewNotes']);
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
- export const DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA = schema('design-review-metadata-payload', {
53
- schemaVersion: { const: '1.0.0' }, kind: { enum: ['category', 'disposition'] }, author: { ...text, minLength: 1, maxLength: 160 },
54
- reviewOf: digest, pinId: id, category: { enum: ['question', 'suggestion', 'blocker'] },
55
- disposition: { enum: ['accepted', 'deferred', 'rejected'] }, reason: text,
56
- updatedAt: { type: 'string', format: 'date-time' },
57
- }, ['schemaVersion', 'kind', 'author', 'reviewOf', 'pinId', 'updatedAt']);
58
- DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA.allOf = [
59
- { if: { properties: { kind: { const: 'category' } } }, then: { required: ['category'], not: { required: ['disposition'] } } },
60
- { if: { properties: { kind: { const: 'disposition' } } }, then: { required: ['disposition', 'reason'], not: { required: ['category'] } } },
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
- export const DESIGN_REVIEW_METADATA_PAYLOAD_V11_SCHEMA = {
66
- ...structuredClone(DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA),
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(DESIGN_REVIEW_METADATA_PAYLOAD_V11_SCHEMA.properties, {
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) throw new TypeError(`Invalid ${contract['x-openplanr-contract']?.id ?? 'review data'}: ${errors.slice(0, 4).map(item => `${item.path} ${item.detail}`).join('; ')}`);
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(value, value?.schemaVersion === '1.1.0' ? DESIGN_REVIEW_METADATA_PAYLOAD_V11_SCHEMA : DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA);
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(value, value?.schemaVersion === '1.1.0' ? DESIGN_REVIEW_BUNDLE_V11_SCHEMA : DESIGN_REVIEW_BUNDLE_SCHEMA);
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 (value.reviewContext.designId !== value.design.id || value.contextDigest !== sha256Hex(canonicalizeJson(value.reviewContext))) throw new TypeError('Review context identity or digest does not match its published design.');
87
- const entries = new Set(value.entries.map(entry => `${entry.screenId}:${entry.variantId}:${entry.frameId}`));
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)) throw new TypeError('Review fingerprints must identify distinct published artboards.');
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) throw new TypeError('Review fingerprints must cover every published artboard.');
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
- export const SEMVER_PATTERN = '^(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
+ /** @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<Record<string, Readonly<{
10
- kind: string;
11
- protocolVersion: '1.6.0';
12
- }>>>;
13
- export declare const DIAGRAM_V16_REGISTRIES: Readonly<Record<string, Readonly<{
14
- kind: string;
15
- protocolVersion: '1.6.0';
16
- }>>>;
17
- export declare const PROTOCOL_V16_REGISTRIES: Readonly<Record<string, Readonly<{
18
- kind: string;
19
- protocolVersion: '1.6.0';
20
- }>>>;
21
- export declare const SKILL_SOURCE_V17_REGISTRIES: Readonly<Record<string, Readonly<{
22
- kind: string;
23
- protocolVersion: '1.7.0';
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
- export const SKILL_SOURCE_V17_REGISTRIES = Object.freeze(Object.fromEntries(
99
- Object.entries(SKILL_SOURCE_V16_REGISTRIES).map(([file, descriptor]) => [file, Object.freeze({
100
- ...descriptor,
101
- protocolVersion: '1.7.0',
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;
@@ -1,7 +1,17 @@
1
- export interface ProtocolSemanticDiagnostic { code: string; path: string; message: string }
2
- export declare function validateTaskManifestSemantics(value: unknown, options?: object): ProtocolSemanticDiagnostic[];
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(value: unknown, options?: { taskManifest?: any }): ProtocolSemanticDiagnostic[];
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;