@agentxm/registry-protocol 0.28.12 → 0.28.13

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 (131) hide show
  1. package/README.md +13 -5
  2. package/dist/src/unstable/publish/index.d.ts +1 -6
  3. package/dist/src/unstable/publish/index.js +1 -6
  4. package/dist/src/unstable/registry/discover-schema.d.ts +4 -4
  5. package/dist/src/unstable/registry/index.d.ts +1 -0
  6. package/dist/src/unstable/registry/index.js +1 -0
  7. package/dist/src/unstable/registry/version-selection.d.ts +22 -0
  8. package/dist/src/unstable/registry/version-selection.js +39 -0
  9. package/package.json +11 -192
  10. package/dist/src/unstable/content/agent-skills-standard.d.ts +0 -17
  11. package/dist/src/unstable/content/agent-skills-standard.js +0 -24
  12. package/dist/src/unstable/content/frontmatter.d.ts +0 -52
  13. package/dist/src/unstable/content/frontmatter.js +0 -115
  14. package/dist/src/unstable/content/index.d.ts +0 -11
  15. package/dist/src/unstable/content/index.js +0 -11
  16. package/dist/src/unstable/content/skill-content.d.ts +0 -43
  17. package/dist/src/unstable/content/skill-content.js +0 -184
  18. package/dist/src/unstable/content/skill-types.d.ts +0 -22
  19. package/dist/src/unstable/content/skill-types.js +0 -9
  20. package/dist/src/unstable/content/subagent-content.d.ts +0 -58
  21. package/dist/src/unstable/content/subagent-content.js +0 -101
  22. package/dist/src/unstable/knowledge/index.d.ts +0 -8
  23. package/dist/src/unstable/knowledge/index.js +0 -8
  24. package/dist/src/unstable/knowledge/knowledge-search.d.ts +0 -32
  25. package/dist/src/unstable/knowledge/knowledge-search.js +0 -147
  26. package/dist/src/unstable/knowledge/okf.d.ts +0 -86
  27. package/dist/src/unstable/knowledge/okf.js +0 -1090
  28. package/dist/src/unstable/lint/catalog/hook/decision-portability.d.ts +0 -4
  29. package/dist/src/unstable/lint/catalog/hook/decision-portability.js +0 -40
  30. package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.d.ts +0 -4
  31. package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.js +0 -39
  32. package/dist/src/unstable/lint/catalog/hook/envelope.d.ts +0 -6
  33. package/dist/src/unstable/lint/catalog/hook/envelope.js +0 -15
  34. package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.d.ts +0 -4
  35. package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.js +0 -51
  36. package/dist/src/unstable/lint/catalog/hook.d.ts +0 -4
  37. package/dist/src/unstable/lint/catalog/hook.js +0 -15
  38. package/dist/src/unstable/lint/catalog/knowledge/diagnostics.d.ts +0 -128
  39. package/dist/src/unstable/lint/catalog/knowledge/diagnostics.js +0 -78
  40. package/dist/src/unstable/lint/catalog/knowledge/envelope.d.ts +0 -6
  41. package/dist/src/unstable/lint/catalog/knowledge/envelope.js +0 -15
  42. package/dist/src/unstable/lint/catalog/knowledge.d.ts +0 -5
  43. package/dist/src/unstable/lint/catalog/knowledge.js +0 -9
  44. package/dist/src/unstable/lint/catalog/mcp-server/envelope.d.ts +0 -6
  45. package/dist/src/unstable/lint/catalog/mcp-server/envelope.js +0 -15
  46. package/dist/src/unstable/lint/catalog/mcp-server.d.ts +0 -4
  47. package/dist/src/unstable/lint/catalog/mcp-server.js +0 -4
  48. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts +0 -28
  49. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js +0 -38
  50. package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts +0 -17
  51. package/dist/src/unstable/lint/catalog/pack/manifest-present.js +0 -24
  52. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts +0 -25
  53. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js +0 -33
  54. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts +0 -51
  55. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js +0 -45
  56. package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts +0 -60
  57. package/dist/src/unstable/lint/catalog/pack-accessor/vft.js +0 -85
  58. package/dist/src/unstable/lint/catalog/pack.d.ts +0 -31
  59. package/dist/src/unstable/lint/catalog/pack.js +0 -36
  60. package/dist/src/unstable/lint/catalog/rule/envelope.d.ts +0 -6
  61. package/dist/src/unstable/lint/catalog/rule/envelope.js +0 -15
  62. package/dist/src/unstable/lint/catalog/rule.d.ts +0 -4
  63. package/dist/src/unstable/lint/catalog/rule.js +0 -4
  64. package/dist/src/unstable/lint/catalog/shared/envelope-rules.d.ts +0 -88
  65. package/dist/src/unstable/lint/catalog/shared/envelope-rules.js +0 -84
  66. package/dist/src/unstable/lint/catalog/shared/manifest-json.d.ts +0 -18
  67. package/dist/src/unstable/lint/catalog/shared/manifest-json.js +0 -28
  68. package/dist/src/unstable/lint/catalog/shared/manifest-present.d.ts +0 -25
  69. package/dist/src/unstable/lint/catalog/shared/manifest-present.js +0 -37
  70. package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.d.ts +0 -70
  71. package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.js +0 -139
  72. package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts +0 -57
  73. package/dist/src/unstable/lint/catalog/shared/schema-rule.js +0 -102
  74. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts +0 -31
  75. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js +0 -148
  76. package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.d.ts +0 -13
  77. package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.js +0 -61
  78. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts +0 -26
  79. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js +0 -41
  80. package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts +0 -23
  81. package/dist/src/unstable/lint/catalog/skill/manifest-present.js +0 -32
  82. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts +0 -21
  83. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js +0 -36
  84. package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.d.ts +0 -8
  85. package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.js +0 -12
  86. package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts +0 -17
  87. package/dist/src/unstable/lint/catalog/skill/skill-md-present.js +0 -37
  88. package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.d.ts +0 -8
  89. package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.js +0 -12
  90. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts +0 -61
  91. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js +0 -55
  92. package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts +0 -77
  93. package/dist/src/unstable/lint/catalog/skill-accessor/vft.js +0 -135
  94. package/dist/src/unstable/lint/catalog/skill.d.ts +0 -38
  95. package/dist/src/unstable/lint/catalog/skill.js +0 -53
  96. package/dist/src/unstable/lint/catalog/subagent/envelope.d.ts +0 -6
  97. package/dist/src/unstable/lint/catalog/subagent/envelope.js +0 -15
  98. package/dist/src/unstable/lint/catalog/subagent.d.ts +0 -4
  99. package/dist/src/unstable/lint/catalog/subagent.js +0 -4
  100. package/dist/src/unstable/lint/catalog-metadata.d.ts +0 -125
  101. package/dist/src/unstable/lint/catalog-metadata.js +0 -642
  102. package/dist/src/unstable/lint/compose-path.d.ts +0 -28
  103. package/dist/src/unstable/lint/compose-path.js +0 -64
  104. package/dist/src/unstable/lint/config.d.ts +0 -77
  105. package/dist/src/unstable/lint/config.js +0 -99
  106. package/dist/src/unstable/lint/context.d.ts +0 -239
  107. package/dist/src/unstable/lint/context.js +0 -17
  108. package/dist/src/unstable/lint/describe-document.d.ts +0 -31
  109. package/dist/src/unstable/lint/describe-document.js +0 -50
  110. package/dist/src/unstable/lint/evaluate.d.ts +0 -47
  111. package/dist/src/unstable/lint/evaluate.js +0 -73
  112. package/dist/src/unstable/lint/issues-to-findings.d.ts +0 -35
  113. package/dist/src/unstable/lint/issues-to-findings.js +0 -149
  114. package/dist/src/unstable/lint/publish.d.ts +0 -49
  115. package/dist/src/unstable/lint/publish.js +0 -86
  116. package/dist/src/unstable/lint/rule.d.ts +0 -97
  117. package/dist/src/unstable/lint/rule.js +0 -17
  118. package/dist/src/unstable/publish/archive-guardrails.d.ts +0 -39
  119. package/dist/src/unstable/publish/archive-guardrails.js +0 -250
  120. package/dist/src/unstable/publish/filtered-package-validation.d.ts +0 -24
  121. package/dist/src/unstable/publish/filtered-package-validation.js +0 -117
  122. package/dist/src/unstable/publish/ingest-limits.d.ts +0 -25
  123. package/dist/src/unstable/publish/ingest-limits.js +0 -41
  124. package/dist/src/unstable/publish/input-normalization.d.ts +0 -40
  125. package/dist/src/unstable/publish/input-normalization.js +0 -125
  126. package/dist/src/unstable/publish/manifest-policy.d.ts +0 -611
  127. package/dist/src/unstable/publish/manifest-policy.js +0 -196
  128. package/dist/src/unstable/publish/test-zip-helpers.d.ts +0 -13
  129. package/dist/src/unstable/publish/test-zip-helpers.js +0 -117
  130. package/dist/src/unstable/registry/release-age-policy.d.ts +0 -57
  131. package/dist/src/unstable/registry/release-age-policy.js +0 -117
@@ -1,73 +0,0 @@
1
- /**
2
- * Pure evaluator for the lint engine.
3
- *
4
- * `evaluateContexts(rules, contexts, config)` pairs each rule with each context,
5
- * invokes `rule.check`, applies severity overrides from `config.rules`, and
6
- * drops findings from rules configured `"off"`.
7
- *
8
- * Both functions are plain `Effect` values; neither requires a Layer or an
9
- * ambient service. See the `lint-engine` design doc §3 for the rationale
10
- * behind library primitives over a central engine service.
11
- *
12
- * @experimental This API is unstable and may change without notice.
13
- * @packageDocumentation
14
- */
15
- import * as Effect from "effect/Effect";
16
- // -----------------------------------------------------------------------------
17
- // Severity override
18
- // -----------------------------------------------------------------------------
19
- /**
20
- * Translate a `LintRuleSeverity` config value into an effective `Severity`
21
- * or the `"off"` sentinel. `"warn"` maps to `"warning"` so downstream code
22
- * sees the canonical three-severity alphabet.
23
- *
24
- * `config.rules` keys are exact rule ids with no wildcard / glob support in v1;
25
- * see `./config.ts` for the schema.
26
- */
27
- const translateConfigValue = (value) => {
28
- switch (value) {
29
- case "warn":
30
- return "warning";
31
- case "off":
32
- case "info":
33
- case "error":
34
- return value;
35
- }
36
- };
37
- const resolveEffectiveSeverity = (defaultSeverity, override) => (override === undefined ? defaultSeverity : translateConfigValue(override));
38
- const withSeverity = (finding, severity) => ({
39
- ...finding,
40
- severity,
41
- });
42
- // -----------------------------------------------------------------------------
43
- // evaluateContexts
44
- // -----------------------------------------------------------------------------
45
- /**
46
- * Pair each rule with each context, run `rule.check`, apply severity overrides
47
- * from `config.rules`, and return one `Evaluated<C>` per pair.
48
- *
49
- * Findings whose configured severity is `"off"` are suppressed entirely; the
50
- * `Evaluated` entry still ships (with an empty `findings` array) so consumers
51
- * that group by rule still see the rule ran.
52
- *
53
- * Rules are evaluated in catalog order; contexts are evaluated in caller
54
- * order. Rule-context invocation is sequential within a single
55
- * `evaluateContexts` call so tests can observe deterministic ordering.
56
- *
57
- * @experimental This API is unstable and may change without notice.
58
- */
59
- export const evaluateContexts = (rules, contexts, config) => Effect.forEach(rules.flatMap((rule) => contexts.map((context) => ({ rule, context }))), ({ rule, context }) => evaluateOne(rule, context, config), { concurrency: 1 });
60
- const evaluateOne = (rule, context, config) => Effect.map(rule.check(context), (rawFindings) => ({
61
- rule,
62
- context,
63
- findings: applySeverityConfig(rule, rawFindings, config),
64
- }));
65
- const applySeverityConfig = (rule, findings, config) => {
66
- const override = config.rules?.[rule.id];
67
- const effective = resolveEffectiveSeverity(rule.severity, override);
68
- if (effective === "off") {
69
- return [];
70
- }
71
- return findings.map((finding) => withSeverity(finding, effective));
72
- };
73
- //# sourceMappingURL=evaluate.js.map
@@ -1,35 +0,0 @@
1
- /**
2
- * `issuesToFindings` — shared schema-delegation helper.
3
- *
4
- * `-schema-valid` rules delegate their `check` to Effect Schema via
5
- * `Schema.decodeUnknownResult(schema, { onExcessProperty: "ignore" })` (or the
6
- * Effect/Exit equivalents) and map the resulting `Issue` tree 1:1 to
7
- * `AdvisoryFinding`s through this helper. Rules never re-implement schema
8
- * checks inline; the paired `-keys-recognized` rule owns unknown-key hygiene
9
- * at warning severity.
10
- *
11
- * The helper walks the recursive `SchemaIssue.Issue` tree, accumulating a
12
- * path at each `Pointer` node and emitting one finding per leaf issue.
13
- * Composite nodes recurse into their children. Each finding's `message`
14
- * is branch-specific and guide-conformant: invariant failure first, raw
15
- * schema detail second when needed, remediation last. `location.file` is the
16
- * caller-supplied file (the manifest file); v1 does not parse byte positions
17
- * out of `Issue` values.
18
- *
19
- * @experimental This API is unstable and may change without notice.
20
- * @packageDocumentation
21
- */
22
- import * as SchemaIssue from "effect/SchemaIssue";
23
- import type { AdvisoryFinding, Severity } from "./rule.js";
24
- /**
25
- * Walk an `Issue` tree and produce one finding per leaf issue.
26
- *
27
- * @param ruleId - `<namespace>/<name>` id of the calling rule.
28
- * @param severity - Severity to stamp on each emitted finding.
29
- * @param file - Accessor-relative file path to stamp on `location.file`.
30
- * @param issue - Root `Issue` produced by `Schema.decodeUnknown*`.
31
- *
32
- * @experimental This API is unstable and may change without notice.
33
- */
34
- export declare const issuesToFindings: (ruleId: string, severity: Severity, file: string, issue: SchemaIssue.Issue) => ReadonlyArray<AdvisoryFinding>;
35
- //# sourceMappingURL=issues-to-findings.d.ts.map
@@ -1,149 +0,0 @@
1
- /**
2
- * `issuesToFindings` — shared schema-delegation helper.
3
- *
4
- * `-schema-valid` rules delegate their `check` to Effect Schema via
5
- * `Schema.decodeUnknownResult(schema, { onExcessProperty: "ignore" })` (or the
6
- * Effect/Exit equivalents) and map the resulting `Issue` tree 1:1 to
7
- * `AdvisoryFinding`s through this helper. Rules never re-implement schema
8
- * checks inline; the paired `-keys-recognized` rule owns unknown-key hygiene
9
- * at warning severity.
10
- *
11
- * The helper walks the recursive `SchemaIssue.Issue` tree, accumulating a
12
- * path at each `Pointer` node and emitting one finding per leaf issue.
13
- * Composite nodes recurse into their children. Each finding's `message`
14
- * is branch-specific and guide-conformant: invariant failure first, raw
15
- * schema detail second when needed, remediation last. `location.file` is the
16
- * caller-supplied file (the manifest file); v1 does not parse byte positions
17
- * out of `Issue` values.
18
- *
19
- * @experimental This API is unstable and may change without notice.
20
- * @packageDocumentation
21
- */
22
- import * as SchemaIssue from "effect/SchemaIssue";
23
- import { describeSchemaDocument } from "./describe-document.js";
24
- // -----------------------------------------------------------------------------
25
- // Public helper
26
- // -----------------------------------------------------------------------------
27
- /**
28
- * Walk an `Issue` tree and produce one finding per leaf issue.
29
- *
30
- * @param ruleId - `<namespace>/<name>` id of the calling rule.
31
- * @param severity - Severity to stamp on each emitted finding.
32
- * @param file - Accessor-relative file path to stamp on `location.file`.
33
- * @param issue - Root `Issue` produced by `Schema.decodeUnknown*`.
34
- *
35
- * @experimental This API is unstable and may change without notice.
36
- */
37
- export const issuesToFindings = (ruleId, severity, file, issue) => {
38
- const findings = [];
39
- walkIssue(issue, [], (leaf, path) => {
40
- findings.push(toFinding(ruleId, severity, file, leaf, path));
41
- });
42
- return findings;
43
- };
44
- const walkIssue = (issue, path, visit) => {
45
- switch (issue._tag) {
46
- case "Pointer": {
47
- walkIssue(issue.issue, [...path, ...issue.path], visit);
48
- return;
49
- }
50
- case "Composite":
51
- case "AnyOf": {
52
- if (issue.issues.length === 0) {
53
- // No union member matched / no nested issues — treat as a leaf so
54
- // the caller sees at least one finding for the covering diagnostic.
55
- visit(issue, path);
56
- return;
57
- }
58
- for (const child of issue.issues) {
59
- walkIssue(child, path, visit);
60
- }
61
- return;
62
- }
63
- case "Filter":
64
- case "Encoding": {
65
- walkIssue(issue.issue, path, visit);
66
- return;
67
- }
68
- case "InvalidType":
69
- case "InvalidValue":
70
- case "MissingKey":
71
- case "UnexpectedKey":
72
- case "Forbidden":
73
- case "OneOf": {
74
- visit(issue, path);
75
- return;
76
- }
77
- }
78
- };
79
- const toFinding = (ruleId, severity, file, issue, path) => {
80
- return {
81
- kind: "advisory",
82
- ruleId,
83
- severity,
84
- message: formatIssueMessage(describeSchemaDocument(file), file, issue, path),
85
- location: { file },
86
- };
87
- };
88
- const formatIssueMessage = (documentLabel, file, issue, path) => {
89
- const pathStr = formatPath(path);
90
- const valueRef = describeValueReference(documentLabel, pathStr);
91
- switch (issue._tag) {
92
- case "MissingKey":
93
- return formatMissingKeyMessage(documentLabel, file, path, pathStr);
94
- case "UnexpectedKey":
95
- return formatUnexpectedKeyMessage(documentLabel, file, pathStr);
96
- case "InvalidType":
97
- return `${valueRef} has the wrong type. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "replace it with a value of the expected type")}`;
98
- case "InvalidValue":
99
- return `${valueRef} is invalid. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "update it so it satisfies the schema constraint")}`;
100
- case "Forbidden":
101
- return `${valueRef} uses a value or operation the schema does not allow. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "update it so the document satisfies the schema")}`;
102
- case "OneOf":
103
- return `${valueRef} matches more than one allowed shape. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "rewrite it so exactly one allowed shape matches")}`;
104
- case "AnyOf":
105
- return `${valueRef} does not match any allowed shape. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "rewrite it so it matches one of the allowed shapes")}`;
106
- case "Filter":
107
- return `${valueRef} fails a schema constraint. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "update it so it satisfies the constraint")}`;
108
- case "Encoding":
109
- return `${valueRef} cannot be encoded or decoded as required by the schema. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "update it to the shape the schema expects")}`;
110
- case "Pointer":
111
- return `${documentLabel} has a schema problem${pathStr === "" ? "" : ` at ${pathStr}`}. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "fix the value at that path so the document satisfies the schema")}`;
112
- case "Composite":
113
- return `${valueRef} has multiple schema problems. Detail: ${formatSchemaIssue(issue)}. ${formatRemediation(file, "fix the referenced values so the document satisfies the schema")}`;
114
- }
115
- };
116
- const formatSchemaIssue = SchemaIssue.makeFormatterDefault();
117
- const formatMissingKeyMessage = (documentLabel, file, path, pathStr) => {
118
- const lastSegment = path[path.length - 1];
119
- const parentPath = formatPath(path.slice(0, -1));
120
- if (typeof lastSegment === "string" && pathStr !== "") {
121
- return parentPath === ""
122
- ? `${documentLabel} is missing required field \`${pathStr}\`. ${formatRemediation(file, `add \`${lastSegment}\``)}`
123
- : `${documentLabel} is missing required field \`${pathStr}\`. ${formatRemediation(file, `add \`${lastSegment}\` under \`${parentPath}\``)}`;
124
- }
125
- if (lastSegment !== undefined && pathStr !== "") {
126
- return `${documentLabel} is missing a required item at \`${pathStr}\`. ${formatRemediation(file, "add the missing item at that path")}`;
127
- }
128
- return `${documentLabel} is missing a required value. ${formatRemediation(file, "add the required value")}`;
129
- };
130
- const formatUnexpectedKeyMessage = (documentLabel, file, pathStr) => pathStr === ""
131
- ? `${documentLabel} has an unrecognized field. ${formatRemediation(file, "remove it or rename it to the intended field name")}`
132
- : `${documentLabel} has unrecognized field \`${pathStr}\`. ${formatRemediation(file, "remove it or rename it to the intended field name")}`;
133
- const describeValueReference = (documentLabel, pathStr) => pathStr === "" ? documentLabel : `${documentLabel} field \`${pathStr}\``;
134
- const formatRemediation = (file, manualAction) => isLockfile(file)
135
- ? "Regenerate the workspace lockfile from workspace settings by reinstalling the declared extensions."
136
- : `Edit \`${file}\` and ${manualAction}.`;
137
- const formatPath = (path) => path.reduce((acc, segment) => {
138
- if (typeof segment === "number") {
139
- return `${acc}[${String(segment)}]`;
140
- }
141
- return acc === "" ? String(segment) : `${acc}.${String(segment)}`;
142
- }, "");
143
- const basename = (file) => {
144
- const normalized = file.replace(/\\/g, "/");
145
- const parts = normalized.split("/");
146
- return parts[parts.length - 1] ?? normalized;
147
- };
148
- const isLockfile = (file) => basename(file) === "axm-lock.yaml";
149
- //# sourceMappingURL=issues-to-findings.js.map
@@ -1,49 +0,0 @@
1
- /**
2
- * Registry-publish lint surface.
3
- *
4
- * This entry point intentionally exports only the primitives the registry
5
- * publish gate needs. It avoids the full lint barrel because that surface also
6
- * constructs workspace-settings schemas and workspace catalogs for `axm lint`.
7
- *
8
- * @experimental This API is unstable and may change without notice.
9
- * @packageDocumentation
10
- */
11
- import type { HookRuleContext, KnowledgeRuleContext, McpServerRuleContext, PackRuleContext, RuleRuleContext, SkillRuleContext, SubagentRuleContext } from "./context.js";
12
- import type { LintRule } from "./rule.js";
13
- export { composePath } from "./compose-path.js";
14
- export { evaluateContexts, type Evaluated } from "./evaluate.js";
15
- export type { LintConfig } from "./config.js";
16
- export type { FileAccessError, HookContent, HookFileAccessor, HookRuleContext, KnowledgeContent, KnowledgeFileAccessor, KnowledgeRuleContext, RuleContent, RuleFileAccessor, RuleRuleContext, McpServerContent, McpServerFileAccessor, McpServerRuleContext, PackContent, PackFileAccessor, PackRuleContext, SkillContent, SkillFileAccessor, SkillRuleContext, SubagentContent, SubagentFileAccessor, SubagentRuleContext, } from "./context.js";
17
- export type { LintFinding, LintRule } from "./rule.js";
18
- export { makeVftPackFileAccessor, type PackVFTNode } from "./catalog/pack-accessor/vft.js";
19
- export { makeVftSkillFileAccessor, makeVftSkillFileAccessorScoped, type VFTNode, } from "./catalog/skill-accessor/vft.js";
20
- /**
21
- * Ordered publish-safe `pack/*` rule catalog.
22
- *
23
- * This intentionally avoids `./catalog/pack.js`, whose module-load rule-id
24
- * registration imports the workspace lint config schema.
25
- */
26
- export declare const packRules: ReadonlyArray<LintRule<PackRuleContext>>;
27
- /**
28
- * Ordered publish-safe `skill/*` rule catalog.
29
- *
30
- * This intentionally avoids `./catalog/skill.js`, whose module-load rule-id
31
- * registration imports the workspace lint config schema.
32
- */
33
- export declare const skillRules: ReadonlyArray<LintRule<SkillRuleContext>>;
34
- export declare const subagentRules: ReadonlyArray<LintRule<SubagentRuleContext>>;
35
- export declare const mcpServerRules: ReadonlyArray<LintRule<McpServerRuleContext>>;
36
- /**
37
- * Ordered publish-safe `hook//*` rule catalog.
38
- *
39
- * Identical to `catalog/hook.ts`: `hook/matcher-raw-portability` used to be
40
- * omitted here, which meant `axm publish` and `axm lint` disagreed about the
41
- * same `hook.json`. It is a pure-manifest advisory at `warning` severity, and
42
- * the publish gate fails only on `error` findings, so running it at publish
43
- * time surfaces the portability advice to the author without gating the
44
- * publish.
45
- */
46
- export declare const hookRules: ReadonlyArray<LintRule<HookRuleContext>>;
47
- export declare const ruleRules: ReadonlyArray<LintRule<RuleRuleContext>>;
48
- export declare const knowledgeRules: ReadonlyArray<LintRule<KnowledgeRuleContext>>;
49
- //# sourceMappingURL=publish.d.ts.map
@@ -1,86 +0,0 @@
1
- /**
2
- * Registry-publish lint surface.
3
- *
4
- * This entry point intentionally exports only the primitives the registry
5
- * publish gate needs. It avoids the full lint barrel because that surface also
6
- * constructs workspace-settings schemas and workspace catalogs for `axm lint`.
7
- *
8
- * @experimental This API is unstable and may change without notice.
9
- * @packageDocumentation
10
- */
11
- import { manifestKeysRecognizedRule as packManifestKeysRecognizedRule } from "./catalog/pack/manifest-keys-recognized.js";
12
- import { manifestPresentRule as packManifestPresentRule } from "./catalog/pack/manifest-present.js";
13
- import { manifestSchemaValidRule as packManifestSchemaValidRule } from "./catalog/pack/manifest-schema-valid.js";
14
- import { subagentEnvelopeRules } from "./catalog/subagent/envelope.js";
15
- import { mcpServerEnvelopeRules } from "./catalog/mcp-server/envelope.js";
16
- import { hookEnvelopeRules } from "./catalog/hook/envelope.js";
17
- import { ruleEnvelopeRules } from "./catalog/rule/envelope.js";
18
- import { knowledgeEnvelopeRules } from "./catalog/knowledge/envelope.js";
19
- import { orderedEnvelopeRules } from "./catalog/shared/envelope-rules.js";
20
- import { entrypointExistsRule as hookEntrypointExistsRule } from "./catalog/hook/entrypoint-exists.js";
21
- import { matcherRawPortabilityRule as hookMatcherRawPortabilityRule } from "./catalog/hook/matcher-raw-portability.js";
22
- import { decisionPortabilityRule as hookDecisionPortabilityRule } from "./catalog/hook/decision-portability.js";
23
- import { frontmatterParseableRule as skillFrontmatterParseableRule } from "./catalog/skill/frontmatter-parseable.js";
24
- import { frontmatterStandardValidRule as skillFrontmatterStandardValidRule } from "./catalog/skill/frontmatter-standard-valid.js";
25
- import { manifestKeysRecognizedRule as skillManifestKeysRecognizedRule } from "./catalog/skill/manifest-keys-recognized.js";
26
- import { manifestPresentRule as skillManifestPresentRule } from "./catalog/skill/manifest-present.js";
27
- import { manifestSchemaValidRule as skillManifestSchemaValidRule } from "./catalog/skill/manifest-schema-valid.js";
28
- import { skillMdPresentRule } from "./catalog/skill/skill-md-present.js";
29
- import { recommendedPacksValidRule as skillRecommendedPacksValidRule } from "./catalog/skill/recommended-packs-valid.js";
30
- import { standaloneDeclarationValidRule as skillStandaloneDeclarationValidRule } from "./catalog/skill/standalone-declaration-valid.js";
31
- export { composePath } from "./compose-path.js";
32
- export { evaluateContexts } from "./evaluate.js";
33
- export { makeVftPackFileAccessor } from "./catalog/pack-accessor/vft.js";
34
- export { makeVftSkillFileAccessor, makeVftSkillFileAccessorScoped, } from "./catalog/skill-accessor/vft.js";
35
- /**
36
- * Ordered publish-safe `pack/*` rule catalog.
37
- *
38
- * This intentionally avoids `./catalog/pack.js`, whose module-load rule-id
39
- * registration imports the workspace lint config schema.
40
- */
41
- export const packRules = [
42
- packManifestPresentRule,
43
- packManifestSchemaValidRule,
44
- packManifestKeysRecognizedRule,
45
- ];
46
- /**
47
- * Ordered publish-safe `skill/*` rule catalog.
48
- *
49
- * This intentionally avoids `./catalog/skill.js`, whose module-load rule-id
50
- * registration imports the workspace lint config schema.
51
- */
52
- export const skillRules = [
53
- skillMdPresentRule,
54
- skillManifestPresentRule,
55
- skillFrontmatterParseableRule,
56
- skillFrontmatterStandardValidRule,
57
- skillManifestSchemaValidRule,
58
- skillManifestKeysRecognizedRule,
59
- skillStandaloneDeclarationValidRule,
60
- skillRecommendedPacksValidRule,
61
- ];
62
- export const subagentRules = orderedEnvelopeRules(subagentEnvelopeRules);
63
- export const mcpServerRules = orderedEnvelopeRules(mcpServerEnvelopeRules);
64
- /**
65
- * Ordered publish-safe `hook//*` rule catalog.
66
- *
67
- * Identical to `catalog/hook.ts`: `hook/matcher-raw-portability` used to be
68
- * omitted here, which meant `axm publish` and `axm lint` disagreed about the
69
- * same `hook.json`. It is a pure-manifest advisory at `warning` severity, and
70
- * the publish gate fails only on `error` findings, so running it at publish
71
- * time surfaces the portability advice to the author without gating the
72
- * publish.
73
- */
74
- export const hookRules = [
75
- hookEnvelopeRules.manifestPresent,
76
- hookEnvelopeRules.manifestSchemaValid,
77
- hookEnvelopeRules.manifestKeysRecognized,
78
- hookDecisionPortabilityRule,
79
- hookMatcherRawPortabilityRule,
80
- hookEntrypointExistsRule,
81
- hookEnvelopeRules.standaloneDeclarationValid,
82
- hookEnvelopeRules.recommendedPacksValid,
83
- ];
84
- export const ruleRules = orderedEnvelopeRules(ruleEnvelopeRules);
85
- export const knowledgeRules = orderedEnvelopeRules(knowledgeEnvelopeRules);
86
- //# sourceMappingURL=publish.js.map
@@ -1,97 +0,0 @@
1
- /**
2
- * Lint rule and finding primitives.
3
- *
4
- * Library-style discriminated unions for the lint engine. Rules are plain
5
- * values generic over a caller-built `RuleContext` — no Layer wiring and no
6
- * ambient service bag. Findings are produced by `rule.check`; rules do not
7
- * carry mutation or workflow guidance.
8
- *
9
- * Rule ids follow `<namespace>/<subject>-<predicate>` with lowercase letters,
10
- * digits, and hyphens; ids leak into settings files, CI logs, and agent
11
- * transcripts, so changing one is an explicit product-contract change.
12
- *
13
- * @experimental This API is unstable and may change without notice.
14
- * @packageDocumentation
15
- */
16
- import type * as Effect from "effect/Effect";
17
- /**
18
- * Platform-canonical finding severity.
19
- *
20
- * WorkspaceMutations `lint.rules` overrides can raise or lower the severity at
21
- * evaluation time; the catalog pins the platform default.
22
- *
23
- * @experimental This API is unstable and may change without notice.
24
- */
25
- export type Severity = "error" | "warning" | "info";
26
- /**
27
- * Accessor-relative location of a finding.
28
- *
29
- * `file` is posix and relative to the rule context's accessor root (skill or
30
- * pack manifest directory for per-extension rules, workspace root for workspace
31
- * rules). Rules MUST NOT embed absolute paths, `displayRoot`-qualified paths,
32
- * or source coordinates in `message`; the display path is composed from
33
- * `context.displayRoot` and `location.file` at format time via `composePath`.
34
- *
35
- * `file: ""` targets the context root itself (e.g., a missing `SKILL.md` on a
36
- * skill context).
37
- *
38
- * @experimental This API is unstable and may change without notice.
39
- */
40
- export interface FindingLocation {
41
- readonly file: string;
42
- readonly line?: number;
43
- readonly column?: number;
44
- readonly byteOffset?: number;
45
- readonly byteLength?: number;
46
- }
47
- /**
48
- * Fields common to all lint findings.
49
- *
50
- * @experimental This API is unstable and may change without notice.
51
- */
52
- export interface FindingBase {
53
- readonly ruleId: string;
54
- readonly severity: Severity;
55
- readonly message: string;
56
- readonly location?: FindingLocation;
57
- }
58
- /**
59
- * Intrinsic fact produced by a lint rule.
60
- *
61
- * @experimental This API is unstable and may change without notice.
62
- */
63
- export interface AdvisoryFinding extends FindingBase {
64
- readonly kind: "advisory";
65
- }
66
- /**
67
- * Discriminated union of lint findings on `kind`.
68
- *
69
- * @experimental This API is unstable and may change without notice.
70
- */
71
- export type LintFinding = AdvisoryFinding;
72
- /**
73
- * Fields common to all lint rules.
74
- *
75
- * @experimental This API is unstable and may change without notice.
76
- */
77
- export interface RuleBase {
78
- readonly id: string;
79
- readonly description: string;
80
- readonly severity: Severity;
81
- }
82
- /**
83
- * Rule that only surfaces findings; never autofixes.
84
- *
85
- * @experimental This API is unstable and may change without notice.
86
- */
87
- export interface AdvisoryRule<C> extends RuleBase {
88
- readonly kind: "advisory";
89
- readonly check: (context: C) => Effect.Effect<ReadonlyArray<AdvisoryFinding>>;
90
- }
91
- /**
92
- * Discriminated union of lint rules over a caller-built rule-context type `C`.
93
- *
94
- * @experimental This API is unstable and may change without notice.
95
- */
96
- export type LintRule<C> = AdvisoryRule<C>;
97
- //# sourceMappingURL=rule.d.ts.map
@@ -1,17 +0,0 @@
1
- /**
2
- * Lint rule and finding primitives.
3
- *
4
- * Library-style discriminated unions for the lint engine. Rules are plain
5
- * values generic over a caller-built `RuleContext` — no Layer wiring and no
6
- * ambient service bag. Findings are produced by `rule.check`; rules do not
7
- * carry mutation or workflow guidance.
8
- *
9
- * Rule ids follow `<namespace>/<subject>-<predicate>` with lowercase letters,
10
- * digits, and hyphens; ids leak into settings files, CI logs, and agent
11
- * transcripts, so changing one is an explicit product-contract change.
12
- *
13
- * @experimental This API is unstable and may change without notice.
14
- * @packageDocumentation
15
- */
16
- export {};
17
- //# sourceMappingURL=rule.js.map
@@ -1,39 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- declare const ArchiveGuardrailError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
3
- readonly _tag: "ArchiveGuardrailError";
4
- } & Readonly<A>;
5
- export declare class ArchiveGuardrailError extends ArchiveGuardrailError_base<{
6
- readonly code: "path_traversal" | "absolute_path" | "duplicate_entry" | "symlink_entry" | "unsupported_compression" | "malformed_archive" | "decompression_limit_exceeded" | "compression_ratio_exceeded" | "entry_count_exceeded" | "forbidden_entry";
7
- readonly message: string;
8
- readonly entry?: string;
9
- }> {
10
- }
11
- export declare const ZIP_LOCAL_SIGNATURE = 67324752;
12
- export interface ZipEntry {
13
- readonly fileName: string;
14
- readonly compressedSize: number;
15
- readonly uncompressedSize: number;
16
- readonly compressionMethod: number;
17
- readonly externalAttributes: number;
18
- readonly localHeaderOffset: number;
19
- }
20
- export interface ArchiveGuardrailLimits {
21
- readonly maxEntries?: number;
22
- readonly maxDecompressedBytes?: number;
23
- readonly maxCompressionRatio?: number;
24
- }
25
- export declare const parseZipCentralDirectory: (buf: Uint8Array) => Effect.Effect<readonly ZipEntry[], ArchiveGuardrailError>;
26
- /**
27
- * Reject archives carrying build or secret leftovers: any `node_modules` or
28
- * `.git` path segment, and `.env` / `.env.*` files. Kept out of
29
- * {@link validateArchive} on purpose — that function is the registry ingest
30
- * contract, and archives accepted by earlier clients must keep ingesting.
31
- *
32
- * `.env*` matches the basename exactly (`.env`) or by dotted prefix
33
- * (`.env.local`, `.env.production`, and also `.env.example`), so sibling names
34
- * like `.envrc` and `environment.md` are unaffected.
35
- */
36
- export declare const checkForbiddenSourceEntries: (entries: readonly ZipEntry[]) => Effect.Effect<void, ArchiveGuardrailError>;
37
- export declare const validateArchive: (archiveBytes: Uint8Array, limits?: ArchiveGuardrailLimits) => Effect.Effect<readonly ZipEntry[], ArchiveGuardrailError>;
38
- export {};
39
- //# sourceMappingURL=archive-guardrails.d.ts.map