@agentxm/registry-protocol 0.28.4 → 0.28.6

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.
@@ -0,0 +1,642 @@
1
+ /**
2
+ * Static metadata for every lint rule accepted by workspace settings.
3
+ *
4
+ * This catalog is deliberately independent of executable rule modules. The
5
+ * settings schema and generated JSON Schema must know the complete rule-id
6
+ * vocabulary without relying on catalog imports or module-load side effects.
7
+ * Executable catalogs are checked against this contract separately.
8
+ *
9
+ * @experimental This API is unstable and may change without notice.
10
+ * @packageDocumentation
11
+ */
12
+ const bothViews = Object.freeze(["workspace", "git-index"]);
13
+ const workspaceView = Object.freeze(["workspace"]);
14
+ const defineLintCatalog = (entries) => {
15
+ const ids = new Set();
16
+ for (const entry of entries) {
17
+ if (ids.has(entry.id)) {
18
+ throw new Error(`Duplicate lint rule id '${entry.id}' in catalog metadata`);
19
+ }
20
+ if (!entry.id.startsWith(`${entry.group}/`)) {
21
+ throw new Error(`Lint rule id '${entry.id}' does not belong to group '${entry.group}'`);
22
+ }
23
+ if (entry.views.length === 0 || new Set(entry.views).size !== entry.views.length) {
24
+ throw new Error(`Lint rule '${entry.id}' must declare a non-empty, unique view list`);
25
+ }
26
+ if (entry.views.includes("git-index") && !entry.views.includes("workspace")) {
27
+ throw new Error(`Git-index lint rule '${entry.id}' must also run against the workspace view`);
28
+ }
29
+ ids.add(entry.id);
30
+ }
31
+ return Object.freeze(entries);
32
+ };
33
+ /**
34
+ * Complete ordered lint-rule contract.
35
+ *
36
+ * Order is the public reporting order: extension catalogs first, then
37
+ * workspace rules. A rule listed for `git-index` must also be listed for the
38
+ * live `workspace` view.
39
+ */
40
+ export const lintCatalogRuleMetadata = defineLintCatalog([
41
+ { id: "skill/skill-md-present", defaultSeverity: "error", group: "skill", views: bothViews },
42
+ { id: "skill/manifest-present", defaultSeverity: "error", group: "skill", views: bothViews },
43
+ { id: "skill/frontmatter-parseable", defaultSeverity: "error", group: "skill", views: bothViews },
44
+ {
45
+ id: "skill/frontmatter-standard-valid",
46
+ defaultSeverity: "error",
47
+ group: "skill",
48
+ views: bothViews,
49
+ },
50
+ {
51
+ id: "skill/manifest-schema-valid",
52
+ defaultSeverity: "error",
53
+ group: "skill",
54
+ views: bothViews,
55
+ },
56
+ {
57
+ id: "skill/manifest-keys-recognized",
58
+ defaultSeverity: "error",
59
+ group: "skill",
60
+ views: bothViews,
61
+ },
62
+ {
63
+ id: "skill/standalone-declaration-valid",
64
+ defaultSeverity: "warning",
65
+ group: "skill",
66
+ views: bothViews,
67
+ },
68
+ {
69
+ id: "skill/recommended-packs-valid",
70
+ defaultSeverity: "warning",
71
+ group: "skill",
72
+ views: bothViews,
73
+ },
74
+ { id: "pack/manifest-present", defaultSeverity: "error", group: "pack", views: bothViews },
75
+ {
76
+ id: "pack/manifest-schema-valid",
77
+ defaultSeverity: "error",
78
+ group: "pack",
79
+ views: bothViews,
80
+ },
81
+ {
82
+ id: "pack/manifest-keys-recognized",
83
+ defaultSeverity: "error",
84
+ group: "pack",
85
+ views: bothViews,
86
+ },
87
+ {
88
+ id: "subagent/manifest-present",
89
+ defaultSeverity: "error",
90
+ group: "subagent",
91
+ views: bothViews,
92
+ },
93
+ {
94
+ id: "subagent/manifest-schema-valid",
95
+ defaultSeverity: "error",
96
+ group: "subagent",
97
+ views: bothViews,
98
+ },
99
+ {
100
+ id: "subagent/manifest-keys-recognized",
101
+ defaultSeverity: "error",
102
+ group: "subagent",
103
+ views: bothViews,
104
+ },
105
+ {
106
+ id: "subagent/standalone-declaration-valid",
107
+ defaultSeverity: "warning",
108
+ group: "subagent",
109
+ views: bothViews,
110
+ },
111
+ {
112
+ id: "subagent/recommended-packs-valid",
113
+ defaultSeverity: "warning",
114
+ group: "subagent",
115
+ views: bothViews,
116
+ },
117
+ {
118
+ id: "mcp-server/manifest-present",
119
+ defaultSeverity: "error",
120
+ group: "mcp-server",
121
+ views: bothViews,
122
+ },
123
+ {
124
+ id: "mcp-server/manifest-schema-valid",
125
+ defaultSeverity: "error",
126
+ group: "mcp-server",
127
+ views: bothViews,
128
+ },
129
+ {
130
+ id: "mcp-server/manifest-keys-recognized",
131
+ defaultSeverity: "error",
132
+ group: "mcp-server",
133
+ views: bothViews,
134
+ },
135
+ {
136
+ id: "mcp-server/standalone-declaration-valid",
137
+ defaultSeverity: "warning",
138
+ group: "mcp-server",
139
+ views: bothViews,
140
+ },
141
+ {
142
+ id: "mcp-server/recommended-packs-valid",
143
+ defaultSeverity: "warning",
144
+ group: "mcp-server",
145
+ views: bothViews,
146
+ },
147
+ { id: "hook/manifest-present", defaultSeverity: "error", group: "hook", views: bothViews },
148
+ {
149
+ id: "hook/manifest-schema-valid",
150
+ defaultSeverity: "error",
151
+ group: "hook",
152
+ views: bothViews,
153
+ },
154
+ {
155
+ id: "hook/manifest-keys-recognized",
156
+ defaultSeverity: "error",
157
+ group: "hook",
158
+ views: bothViews,
159
+ },
160
+ {
161
+ id: "hook/decision-portability",
162
+ defaultSeverity: "warning",
163
+ group: "hook",
164
+ views: bothViews,
165
+ },
166
+ {
167
+ id: "hook/matcher-raw-portability",
168
+ defaultSeverity: "warning",
169
+ group: "hook",
170
+ views: bothViews,
171
+ },
172
+ { id: "hook/entrypoint-exists", defaultSeverity: "error", group: "hook", views: bothViews },
173
+ {
174
+ id: "hook/standalone-declaration-valid",
175
+ defaultSeverity: "warning",
176
+ group: "hook",
177
+ views: bothViews,
178
+ },
179
+ {
180
+ id: "hook/recommended-packs-valid",
181
+ defaultSeverity: "warning",
182
+ group: "hook",
183
+ views: bothViews,
184
+ },
185
+ { id: "rule/manifest-present", defaultSeverity: "error", group: "rule", views: bothViews },
186
+ {
187
+ id: "rule/manifest-schema-valid",
188
+ defaultSeverity: "error",
189
+ group: "rule",
190
+ views: bothViews,
191
+ },
192
+ {
193
+ id: "rule/manifest-keys-recognized",
194
+ defaultSeverity: "error",
195
+ group: "rule",
196
+ views: bothViews,
197
+ },
198
+ {
199
+ id: "rule/standalone-declaration-valid",
200
+ defaultSeverity: "warning",
201
+ group: "rule",
202
+ views: bothViews,
203
+ },
204
+ {
205
+ id: "rule/recommended-packs-valid",
206
+ defaultSeverity: "warning",
207
+ group: "rule",
208
+ views: bothViews,
209
+ },
210
+ {
211
+ id: "knowledge/manifest-present",
212
+ defaultSeverity: "error",
213
+ group: "knowledge",
214
+ views: bothViews,
215
+ },
216
+ {
217
+ id: "knowledge/manifest-schema-valid",
218
+ defaultSeverity: "error",
219
+ group: "knowledge",
220
+ views: bothViews,
221
+ },
222
+ {
223
+ id: "knowledge/manifest-keys-recognized",
224
+ defaultSeverity: "error",
225
+ group: "knowledge",
226
+ views: bothViews,
227
+ },
228
+ {
229
+ id: "knowledge/standalone-declaration-valid",
230
+ defaultSeverity: "warning",
231
+ group: "knowledge",
232
+ views: bothViews,
233
+ },
234
+ {
235
+ id: "knowledge/recommended-packs-valid",
236
+ defaultSeverity: "warning",
237
+ group: "knowledge",
238
+ views: bothViews,
239
+ },
240
+ {
241
+ id: "knowledge/bundle-too-large",
242
+ defaultSeverity: "error",
243
+ group: "knowledge",
244
+ views: bothViews,
245
+ },
246
+ {
247
+ id: "knowledge/file-too-large",
248
+ defaultSeverity: "error",
249
+ group: "knowledge",
250
+ views: bothViews,
251
+ },
252
+ { id: "knowledge/invalid-tags", defaultSeverity: "error", group: "knowledge", views: bothViews },
253
+ {
254
+ id: "knowledge/missing-root-index",
255
+ defaultSeverity: "error",
256
+ group: "knowledge",
257
+ views: bothViews,
258
+ },
259
+ {
260
+ id: "knowledge/missing-okf-version",
261
+ defaultSeverity: "error",
262
+ group: "knowledge",
263
+ views: bothViews,
264
+ },
265
+ {
266
+ id: "knowledge/missing-title",
267
+ defaultSeverity: "warning",
268
+ group: "knowledge",
269
+ views: bothViews,
270
+ },
271
+ {
272
+ id: "knowledge/missing-description",
273
+ defaultSeverity: "warning",
274
+ group: "knowledge",
275
+ views: bothViews,
276
+ },
277
+ {
278
+ id: "knowledge/missing-manifest-description",
279
+ defaultSeverity: "warning",
280
+ group: "knowledge",
281
+ views: bothViews,
282
+ },
283
+ {
284
+ id: "knowledge/empty-bundle",
285
+ defaultSeverity: "warning",
286
+ group: "knowledge",
287
+ views: bothViews,
288
+ },
289
+ {
290
+ id: "knowledge/missing-tags",
291
+ defaultSeverity: "warning",
292
+ group: "knowledge",
293
+ views: bothViews,
294
+ },
295
+ { id: "knowledge/symbolic-link", defaultSeverity: "error", group: "knowledge", views: bothViews },
296
+ {
297
+ id: "knowledge/too-many-files",
298
+ defaultSeverity: "error",
299
+ group: "knowledge",
300
+ views: bothViews,
301
+ },
302
+ {
303
+ id: "knowledge/unsupported-okf-version",
304
+ defaultSeverity: "error",
305
+ group: "knowledge",
306
+ views: bothViews,
307
+ },
308
+ { id: "knowledge/missing-type", defaultSeverity: "error", group: "knowledge", views: bothViews },
309
+ {
310
+ id: "knowledge/invalid-frontmatter",
311
+ defaultSeverity: "error",
312
+ group: "knowledge",
313
+ views: bothViews,
314
+ },
315
+ {
316
+ id: "knowledge/case-collision",
317
+ defaultSeverity: "error",
318
+ group: "knowledge",
319
+ views: bothViews,
320
+ },
321
+ { id: "knowledge/dangerous-uri", defaultSeverity: "error", group: "knowledge", views: bothViews },
322
+ {
323
+ id: "knowledge/detected-secret",
324
+ defaultSeverity: "error",
325
+ group: "knowledge",
326
+ views: bothViews,
327
+ },
328
+ { id: "knowledge/unsafe-path", defaultSeverity: "error", group: "knowledge", views: bothViews },
329
+ { id: "knowledge/invalid-index", defaultSeverity: "error", group: "knowledge", views: bothViews },
330
+ { id: "knowledge/invalid-log", defaultSeverity: "error", group: "knowledge", views: bothViews },
331
+ {
332
+ id: "knowledge/invalid-resource",
333
+ defaultSeverity: "error",
334
+ group: "knowledge",
335
+ views: bothViews,
336
+ },
337
+ {
338
+ id: "knowledge/escaping-resource",
339
+ defaultSeverity: "error",
340
+ group: "knowledge",
341
+ views: bothViews,
342
+ },
343
+ {
344
+ id: "knowledge/unresolved-resource",
345
+ defaultSeverity: "warning",
346
+ group: "knowledge",
347
+ views: bothViews,
348
+ },
349
+ {
350
+ id: "knowledge/broken-internal-link",
351
+ defaultSeverity: "warning",
352
+ group: "knowledge",
353
+ views: bothViews,
354
+ },
355
+ {
356
+ id: "knowledge/escaping-link",
357
+ defaultSeverity: "warning",
358
+ group: "knowledge",
359
+ views: bothViews,
360
+ },
361
+ {
362
+ id: "knowledge/unreachable-concept",
363
+ defaultSeverity: "warning",
364
+ group: "knowledge",
365
+ views: bothViews,
366
+ },
367
+ {
368
+ id: "knowledge/missing-index-entry",
369
+ defaultSeverity: "warning",
370
+ group: "knowledge",
371
+ views: bothViews,
372
+ },
373
+ {
374
+ id: "knowledge/stale-index-entry",
375
+ defaultSeverity: "warning",
376
+ group: "knowledge",
377
+ views: bothViews,
378
+ },
379
+ {
380
+ id: "knowledge/embedded-html",
381
+ defaultSeverity: "warning",
382
+ group: "knowledge",
383
+ views: bothViews,
384
+ },
385
+ {
386
+ id: "knowledge/duplicate-resource",
387
+ defaultSeverity: "warning",
388
+ group: "knowledge",
389
+ views: bothViews,
390
+ },
391
+ {
392
+ id: "knowledge/inconsistent-type",
393
+ defaultSeverity: "warning",
394
+ group: "knowledge",
395
+ views: bothViews,
396
+ },
397
+ {
398
+ id: "knowledge/large-concept",
399
+ defaultSeverity: "warning",
400
+ group: "knowledge",
401
+ views: bothViews,
402
+ },
403
+ { id: "knowledge/large-index", defaultSeverity: "warning", group: "knowledge", views: bothViews },
404
+ {
405
+ id: "knowledge/unreferenced-asset",
406
+ defaultSeverity: "warning",
407
+ group: "knowledge",
408
+ views: bothViews,
409
+ },
410
+ {
411
+ id: "knowledge/invalid-sources",
412
+ defaultSeverity: "error",
413
+ group: "knowledge",
414
+ views: bothViews,
415
+ },
416
+ {
417
+ id: "knowledge/invalid-generated",
418
+ defaultSeverity: "error",
419
+ group: "knowledge",
420
+ views: bothViews,
421
+ },
422
+ {
423
+ id: "knowledge/invalid-verified",
424
+ defaultSeverity: "error",
425
+ group: "knowledge",
426
+ views: bothViews,
427
+ },
428
+ {
429
+ id: "knowledge/invalid-status",
430
+ defaultSeverity: "error",
431
+ group: "knowledge",
432
+ views: bothViews,
433
+ },
434
+ {
435
+ id: "knowledge/invalid-stale-after",
436
+ defaultSeverity: "error",
437
+ group: "knowledge",
438
+ views: bothViews,
439
+ },
440
+ {
441
+ id: "knowledge/invalid-attestation",
442
+ defaultSeverity: "error",
443
+ group: "knowledge",
444
+ views: bothViews,
445
+ },
446
+ { id: "workspace/initialized", defaultSeverity: "error", group: "workspace", views: bothViews },
447
+ {
448
+ id: "workspace/settings-schema-valid",
449
+ defaultSeverity: "error",
450
+ group: "workspace",
451
+ views: bothViews,
452
+ },
453
+ {
454
+ id: "workspace/settings-keys-recognized",
455
+ defaultSeverity: "error",
456
+ group: "workspace",
457
+ views: bothViews,
458
+ },
459
+ {
460
+ id: "workspace/lockfile-valid",
461
+ defaultSeverity: "error",
462
+ group: "workspace",
463
+ views: bothViews,
464
+ },
465
+ {
466
+ id: "workspace/source-endpoints-aligned",
467
+ defaultSeverity: "error",
468
+ group: "workspace",
469
+ views: bothViews,
470
+ },
471
+ {
472
+ id: "workspace/desired-state-reconcilable",
473
+ defaultSeverity: "error",
474
+ group: "workspace",
475
+ views: bothViews,
476
+ },
477
+ {
478
+ id: "workspace/axm-skill-declared",
479
+ defaultSeverity: "info",
480
+ group: "workspace",
481
+ views: bothViews,
482
+ },
483
+ {
484
+ id: "workspace/axm-skill-compatible",
485
+ defaultSeverity: "error",
486
+ group: "workspace",
487
+ views: bothViews,
488
+ },
489
+ {
490
+ id: "workspace/agents-recognized",
491
+ defaultSeverity: "error",
492
+ group: "workspace",
493
+ views: bothViews,
494
+ },
495
+ {
496
+ id: "workspace/agents-detected-declared",
497
+ defaultSeverity: "warning",
498
+ group: "workspace",
499
+ views: workspaceView,
500
+ },
501
+ {
502
+ id: "workspace/agents-projections-stale",
503
+ defaultSeverity: "warning",
504
+ group: "workspace",
505
+ views: workspaceView,
506
+ },
507
+ {
508
+ id: "workspace/instructions-source-present",
509
+ defaultSeverity: "error",
510
+ group: "workspace",
511
+ views: bothViews,
512
+ },
513
+ {
514
+ id: "workspace/instructions-target-current",
515
+ defaultSeverity: "warning",
516
+ group: "workspace",
517
+ views: workspaceView,
518
+ },
519
+ {
520
+ id: "workspace/instructions-target-unowned",
521
+ defaultSeverity: "warning",
522
+ group: "workspace",
523
+ views: workspaceView,
524
+ },
525
+ {
526
+ id: "workspace/instructions-target-stale",
527
+ defaultSeverity: "warning",
528
+ group: "workspace",
529
+ views: workspaceView,
530
+ },
531
+ {
532
+ id: "workspace/instructions-agent-supported",
533
+ defaultSeverity: "warning",
534
+ group: "workspace",
535
+ views: bothViews,
536
+ },
537
+ {
538
+ id: "workspace/instructions-gitignore-current",
539
+ defaultSeverity: "info",
540
+ group: "workspace",
541
+ views: bothViews,
542
+ },
543
+ {
544
+ id: "workspace/projection-ownership-valid",
545
+ defaultSeverity: "error",
546
+ group: "workspace",
547
+ views: workspaceView,
548
+ },
549
+ {
550
+ id: "workspace/projection-contributors-rendered",
551
+ defaultSeverity: "warning",
552
+ group: "workspace",
553
+ views: workspaceView,
554
+ },
555
+ {
556
+ id: "workspace/hook-ownership-ambiguous",
557
+ defaultSeverity: "warning",
558
+ group: "workspace",
559
+ views: workspaceView,
560
+ },
561
+ {
562
+ id: "workspace/managed-file-unowned",
563
+ defaultSeverity: "warning",
564
+ group: "workspace",
565
+ views: workspaceView,
566
+ },
567
+ {
568
+ id: "workspace/skills-declarations-valid",
569
+ defaultSeverity: "error",
570
+ group: "workspace",
571
+ views: bothViews,
572
+ },
573
+ {
574
+ id: "workspace/packs-declarations-valid",
575
+ defaultSeverity: "error",
576
+ group: "workspace",
577
+ views: bothViews,
578
+ },
579
+ {
580
+ id: "workspace/configured-but-not-installed",
581
+ defaultSeverity: "error",
582
+ group: "workspace",
583
+ views: bothViews,
584
+ },
585
+ {
586
+ id: "workspace/knowledge-state-valid",
587
+ defaultSeverity: "error",
588
+ group: "workspace",
589
+ views: bothViews,
590
+ },
591
+ {
592
+ id: "workspace/mcps-transport-exclusivity",
593
+ defaultSeverity: "warning",
594
+ group: "workspace",
595
+ views: bothViews,
596
+ },
597
+ {
598
+ id: "workspace/mcps-no-secret-literal",
599
+ defaultSeverity: "warning",
600
+ group: "workspace",
601
+ views: bothViews,
602
+ },
603
+ {
604
+ id: "workspace/mcps-agent-drift",
605
+ defaultSeverity: "warning",
606
+ group: "workspace",
607
+ views: workspaceView,
608
+ },
609
+ {
610
+ id: "workspace/mcps-agent-orphaned",
611
+ defaultSeverity: "warning",
612
+ group: "workspace",
613
+ views: workspaceView,
614
+ },
615
+ {
616
+ id: "workspace/skills-lockfile-aligned",
617
+ defaultSeverity: "error",
618
+ group: "workspace",
619
+ views: bothViews,
620
+ },
621
+ {
622
+ id: "workspace/skills-integrity-valid",
623
+ defaultSeverity: "error",
624
+ group: "workspace",
625
+ views: bothViews,
626
+ },
627
+ {
628
+ id: "workspace/skills-artifacts-correct",
629
+ defaultSeverity: "error",
630
+ group: "workspace",
631
+ views: workspaceView,
632
+ },
633
+ {
634
+ id: "workspace/packs-dependencies-resolved",
635
+ defaultSeverity: "error",
636
+ group: "workspace",
637
+ views: bothViews,
638
+ },
639
+ ]);
640
+ /** Every accepted lint-rule identity, in catalog/reporting order. */
641
+ export const allLintCatalogRuleIds = Object.freeze(lintCatalogRuleMetadata.map((entry) => entry.id));
642
+ //# sourceMappingURL=catalog-metadata.js.map
@@ -6,10 +6,9 @@
6
6
  * gate ignores workspace overrides; this config affects `axm lint` only.
7
7
  *
8
8
  * Keys are **exact** rule ids (`<namespace>/<name>`). No glob, wildcard, or
9
- * regex syntax is accepted in v1. The accepted-key set is built at schema
10
- * construction time from rule ids registered via `registerLintRuleIds` the
11
- * three v1 catalogs (`skill/*`, `pack/*`, `workspace/*`) each register their
12
- * ids so adding a catalog in a later phase extends the set by construction.
9
+ * regex syntax is accepted. The accepted-key set comes from the static lint
10
+ * catalog metadata, so validation never depends on which executable catalog
11
+ * modules happened to be imported first.
13
12
  *
14
13
  * @experimental This API is unstable and may change without notice.
15
14
  * @packageDocumentation
@@ -31,31 +30,6 @@ export declare const LintRuleSeveritySchema: Schema.Literals<readonly ["off", "i
31
30
  * @experimental This API is unstable and may change without notice.
32
31
  */
33
32
  export type LintRuleSeverity = Schema.Schema.Type<typeof LintRuleSeveritySchema>;
34
- /**
35
- * Register one or more rule ids into the config allowlist.
36
- *
37
- * Each v1 rule catalog calls this once at module-load to extend the set of
38
- * accepted `lint.rules` keys. Calls are additive and idempotent — registering
39
- * an id twice is a no-op. A rule id that isn't registered will cause
40
- * `SettingsSchema` decode to fail at the `lint.rules` key, surfacing the
41
- * unknown id in the error path.
42
- *
43
- * Consumers (Phases 3a/3b/3c) should register from the catalog module by
44
- * iterating the catalog's own rule array: no copy-paste of rule ids into this
45
- * file.
46
- *
47
- * @experimental This API is unstable and may change without notice.
48
- */
49
- export declare const registerLintRuleIds: (ids: Iterable<string>) => void;
50
- /**
51
- * Read-only view of the currently-registered rule ids.
52
- *
53
- * Mainly useful for tests and snapshots; production callers should not depend
54
- * on ordering.
55
- *
56
- * @experimental This API is unstable and may change without notice.
57
- */
58
- export declare const registeredLintRuleIds: () => ReadonlySet<string>;
59
33
  /**
60
34
  * Record of `<namespace>/<name>` ids to severity overrides.
61
35
  *