@agentxm/registry-protocol 0.28.4-bootstrap.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 (137) hide show
  1. package/LICENSE +110 -0
  2. package/README.md +13 -0
  3. package/dist/src/unstable/content/agent-skills-standard.d.ts +17 -0
  4. package/dist/src/unstable/content/agent-skills-standard.js +24 -0
  5. package/dist/src/unstable/content/frontmatter.d.ts +52 -0
  6. package/dist/src/unstable/content/frontmatter.js +115 -0
  7. package/dist/src/unstable/content/index.d.ts +11 -0
  8. package/dist/src/unstable/content/index.js +11 -0
  9. package/dist/src/unstable/content/skill-content.d.ts +43 -0
  10. package/dist/src/unstable/content/skill-content.js +184 -0
  11. package/dist/src/unstable/content/skill-types.d.ts +22 -0
  12. package/dist/src/unstable/content/skill-types.js +9 -0
  13. package/dist/src/unstable/content/subagent-content.d.ts +58 -0
  14. package/dist/src/unstable/content/subagent-content.js +101 -0
  15. package/dist/src/unstable/knowledge/index.d.ts +8 -0
  16. package/dist/src/unstable/knowledge/index.js +8 -0
  17. package/dist/src/unstable/knowledge/knowledge-search.d.ts +32 -0
  18. package/dist/src/unstable/knowledge/knowledge-search.js +147 -0
  19. package/dist/src/unstable/knowledge/okf.d.ts +86 -0
  20. package/dist/src/unstable/knowledge/okf.js +1090 -0
  21. package/dist/src/unstable/lint/catalog/hook/decision-portability.d.ts +4 -0
  22. package/dist/src/unstable/lint/catalog/hook/decision-portability.js +40 -0
  23. package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.d.ts +4 -0
  24. package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.js +39 -0
  25. package/dist/src/unstable/lint/catalog/hook/envelope.d.ts +6 -0
  26. package/dist/src/unstable/lint/catalog/hook/envelope.js +15 -0
  27. package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.d.ts +4 -0
  28. package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.js +51 -0
  29. package/dist/src/unstable/lint/catalog/hook.d.ts +4 -0
  30. package/dist/src/unstable/lint/catalog/hook.js +17 -0
  31. package/dist/src/unstable/lint/catalog/knowledge/diagnostics.d.ts +128 -0
  32. package/dist/src/unstable/lint/catalog/knowledge/diagnostics.js +78 -0
  33. package/dist/src/unstable/lint/catalog/knowledge/envelope.d.ts +6 -0
  34. package/dist/src/unstable/lint/catalog/knowledge/envelope.js +15 -0
  35. package/dist/src/unstable/lint/catalog/knowledge.d.ts +5 -0
  36. package/dist/src/unstable/lint/catalog/knowledge.js +11 -0
  37. package/dist/src/unstable/lint/catalog/mcp-server/envelope.d.ts +6 -0
  38. package/dist/src/unstable/lint/catalog/mcp-server/envelope.js +15 -0
  39. package/dist/src/unstable/lint/catalog/mcp-server.d.ts +4 -0
  40. package/dist/src/unstable/lint/catalog/mcp-server.js +6 -0
  41. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts +28 -0
  42. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js +38 -0
  43. package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts +17 -0
  44. package/dist/src/unstable/lint/catalog/pack/manifest-present.js +24 -0
  45. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts +25 -0
  46. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js +33 -0
  47. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts +51 -0
  48. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js +45 -0
  49. package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts +60 -0
  50. package/dist/src/unstable/lint/catalog/pack-accessor/vft.js +85 -0
  51. package/dist/src/unstable/lint/catalog/pack.d.ts +37 -0
  52. package/dist/src/unstable/lint/catalog/pack.js +47 -0
  53. package/dist/src/unstable/lint/catalog/rule/envelope.d.ts +6 -0
  54. package/dist/src/unstable/lint/catalog/rule/envelope.js +15 -0
  55. package/dist/src/unstable/lint/catalog/rule.d.ts +4 -0
  56. package/dist/src/unstable/lint/catalog/rule.js +6 -0
  57. package/dist/src/unstable/lint/catalog/shared/envelope-rules.d.ts +93 -0
  58. package/dist/src/unstable/lint/catalog/shared/envelope-rules.js +89 -0
  59. package/dist/src/unstable/lint/catalog/shared/manifest-json.d.ts +18 -0
  60. package/dist/src/unstable/lint/catalog/shared/manifest-json.js +28 -0
  61. package/dist/src/unstable/lint/catalog/shared/manifest-present.d.ts +25 -0
  62. package/dist/src/unstable/lint/catalog/shared/manifest-present.js +37 -0
  63. package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.d.ts +70 -0
  64. package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.js +139 -0
  65. package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts +58 -0
  66. package/dist/src/unstable/lint/catalog/shared/schema-rule.js +103 -0
  67. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts +31 -0
  68. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js +148 -0
  69. package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.d.ts +13 -0
  70. package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.js +61 -0
  71. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts +26 -0
  72. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js +41 -0
  73. package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts +23 -0
  74. package/dist/src/unstable/lint/catalog/skill/manifest-present.js +32 -0
  75. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts +21 -0
  76. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js +36 -0
  77. package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.d.ts +8 -0
  78. package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.js +12 -0
  79. package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts +17 -0
  80. package/dist/src/unstable/lint/catalog/skill/skill-md-present.js +37 -0
  81. package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.d.ts +8 -0
  82. package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.js +12 -0
  83. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts +61 -0
  84. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js +55 -0
  85. package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts +77 -0
  86. package/dist/src/unstable/lint/catalog/skill-accessor/vft.js +135 -0
  87. package/dist/src/unstable/lint/catalog/skill.d.ts +44 -0
  88. package/dist/src/unstable/lint/catalog/skill.js +64 -0
  89. package/dist/src/unstable/lint/catalog/subagent/envelope.d.ts +6 -0
  90. package/dist/src/unstable/lint/catalog/subagent/envelope.js +15 -0
  91. package/dist/src/unstable/lint/catalog/subagent.d.ts +4 -0
  92. package/dist/src/unstable/lint/catalog/subagent.js +6 -0
  93. package/dist/src/unstable/lint/compose-path.d.ts +28 -0
  94. package/dist/src/unstable/lint/compose-path.js +64 -0
  95. package/dist/src/unstable/lint/config.d.ts +103 -0
  96. package/dist/src/unstable/lint/config.js +140 -0
  97. package/dist/src/unstable/lint/context.d.ts +246 -0
  98. package/dist/src/unstable/lint/context.js +21 -0
  99. package/dist/src/unstable/lint/describe-document.d.ts +31 -0
  100. package/dist/src/unstable/lint/describe-document.js +50 -0
  101. package/dist/src/unstable/lint/evaluate.d.ts +47 -0
  102. package/dist/src/unstable/lint/evaluate.js +82 -0
  103. package/dist/src/unstable/lint/issues-to-findings.d.ts +35 -0
  104. package/dist/src/unstable/lint/issues-to-findings.js +149 -0
  105. package/dist/src/unstable/lint/publish.d.ts +49 -0
  106. package/dist/src/unstable/lint/publish.js +86 -0
  107. package/dist/src/unstable/lint/rule.d.ts +98 -0
  108. package/dist/src/unstable/lint/rule.js +18 -0
  109. package/dist/src/unstable/publish/archive-guardrails.d.ts +39 -0
  110. package/dist/src/unstable/publish/archive-guardrails.js +250 -0
  111. package/dist/src/unstable/publish/filtered-package-validation.d.ts +24 -0
  112. package/dist/src/unstable/publish/filtered-package-validation.js +117 -0
  113. package/dist/src/unstable/publish/index.d.ts +12 -0
  114. package/dist/src/unstable/publish/index.js +12 -0
  115. package/dist/src/unstable/publish/ingest-limits.d.ts +25 -0
  116. package/dist/src/unstable/publish/ingest-limits.js +41 -0
  117. package/dist/src/unstable/publish/input-normalization.d.ts +40 -0
  118. package/dist/src/unstable/publish/input-normalization.js +125 -0
  119. package/dist/src/unstable/publish/manifest-policy.d.ts +611 -0
  120. package/dist/src/unstable/publish/manifest-policy.js +196 -0
  121. package/dist/src/unstable/publish/test-zip-helpers.d.ts +13 -0
  122. package/dist/src/unstable/publish/test-zip-helpers.js +117 -0
  123. package/dist/src/unstable/publish/visibility.d.ts +161 -0
  124. package/dist/src/unstable/publish/visibility.js +124 -0
  125. package/dist/src/unstable/registry/discover-schema.d.ts +68 -0
  126. package/dist/src/unstable/registry/discover-schema.js +35 -0
  127. package/dist/src/unstable/registry/index.d.ts +9 -0
  128. package/dist/src/unstable/registry/index.js +9 -0
  129. package/dist/src/unstable/registry/publication-set.d.ts +303 -0
  130. package/dist/src/unstable/registry/publication-set.js +507 -0
  131. package/dist/src/unstable/registry/release-age-policy.d.ts +57 -0
  132. package/dist/src/unstable/registry/release-age-policy.js +117 -0
  133. package/dist/src/unstable/registry/schema.d.ts +220 -0
  134. package/dist/src/unstable/registry/schema.js +114 -0
  135. package/dist/src/unstable/suggested-action.d.ts +19 -0
  136. package/dist/src/unstable/suggested-action.js +42 -0
  137. package/package.json +214 -0
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `skill/manifest-keys-recognized` — `skill.json` contains only keys
3
+ * declared by `SkillManifestSchema`.
4
+ *
5
+ * The paired `-schema-valid` rule ignores excess properties by construction
6
+ * (`onExcessProperty: "ignore"`); this rule rejects them so publish never
7
+ * silently drops unrecognized manifest data.
8
+ *
9
+ * Allowed-keys set is derived from `SkillManifestSchema.fields` — no
10
+ * copy-paste of field names. A schema gain (or rename) automatically updates
11
+ * the allowlist.
12
+ *
13
+ * Early-return arms (no findings):
14
+ *
15
+ * - `subject.isNative === false` — non-native skills have no manifest to
16
+ * check.
17
+ * - `subject.skillJson === undefined` / non-object — nothing to enumerate;
18
+ * `skill/manifest-present` owns the absence case.
19
+ *
20
+ * @experimental This API is unstable and may change without notice.
21
+ * @packageDocumentation
22
+ */
23
+ import type { SkillRuleContext } from "../../context.js";
24
+ import type { AdvisoryRule } from "../../rule.js";
25
+ export declare const manifestKeysRecognizedRule: AdvisoryRule<SkillRuleContext>;
26
+ //# sourceMappingURL=manifest-keys-recognized.d.ts.map
@@ -0,0 +1,41 @@
1
+ /**
2
+ * `skill/manifest-keys-recognized` — `skill.json` contains only keys
3
+ * declared by `SkillManifestSchema`.
4
+ *
5
+ * The paired `-schema-valid` rule ignores excess properties by construction
6
+ * (`onExcessProperty: "ignore"`); this rule rejects them so publish never
7
+ * silently drops unrecognized manifest data.
8
+ *
9
+ * Allowed-keys set is derived from `SkillManifestSchema.fields` — no
10
+ * copy-paste of field names. A schema gain (or rename) automatically updates
11
+ * the allowlist.
12
+ *
13
+ * Early-return arms (no findings):
14
+ *
15
+ * - `subject.isNative === false` — non-native skills have no manifest to
16
+ * check.
17
+ * - `subject.skillJson === undefined` / non-object — nothing to enumerate;
18
+ * `skill/manifest-present` owns the absence case.
19
+ *
20
+ * @experimental This API is unstable and may change without notice.
21
+ * @packageDocumentation
22
+ */
23
+ import * as Effect from "effect/Effect";
24
+ import { SkillManifestSchema } from "@agentxm/extension-model/unstable/skills/manifest-schema";
25
+ import { enumerateUnknownTopLevelKeys, structFieldKeys } from "../shared/schema-rule.js";
26
+ const RULE_ID = "skill/manifest-keys-recognized";
27
+ const SKILL_JSON = "skill.json";
28
+ const allowedKeys = structFieldKeys(SkillManifestSchema);
29
+ export const manifestKeysRecognizedRule = {
30
+ id: RULE_ID,
31
+ description: "skill.json uses only supported top-level fields.",
32
+ kind: "advisory",
33
+ severity: "error",
34
+ check: (context) => {
35
+ if (!context.subject.isNative) {
36
+ return Effect.succeed([]);
37
+ }
38
+ return Effect.succeed(enumerateUnknownTopLevelKeys(RULE_ID, "error", SKILL_JSON, allowedKeys, context.subject.skillJson));
39
+ },
40
+ };
41
+ //# sourceMappingURL=manifest-keys-recognized.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `skill/manifest-present` — native skills must have a `skill.json` at the
3
+ * package root.
4
+ *
5
+ * Reads through `context.packageFiles` (package-root accessor) rather than
6
+ * `context.files` (content-root accessor). For native skills, the package
7
+ * root contains `skill.json` and a `src/` directory holding the skill
8
+ * content; `context.files` is rooted at `src/`, so `skill.json` is only
9
+ * reachable via `packageFiles`.
10
+ *
11
+ * Native-only via `check` early-return: when `subject.isNative === false`
12
+ * (managed-external skills without a declared manifest), the rule produces
13
+ * no findings. No separate `applies` predicate per
14
+ * the lint design.
15
+ *
16
+ * Advisory-only — scaffolding a manifest is a user-authored action.
17
+ *
18
+ * @experimental This API is unstable and may change without notice.
19
+ * @packageDocumentation
20
+ */
21
+ import type { SkillRuleContext } from "../../context.js";
22
+ export declare const manifestPresentRule: import("../../rule.ts").AdvisoryRule<SkillRuleContext<import("../../context.js").SkillContent>>;
23
+ //# sourceMappingURL=manifest-present.d.ts.map
@@ -0,0 +1,32 @@
1
+ /**
2
+ * `skill/manifest-present` — native skills must have a `skill.json` at the
3
+ * package root.
4
+ *
5
+ * Reads through `context.packageFiles` (package-root accessor) rather than
6
+ * `context.files` (content-root accessor). For native skills, the package
7
+ * root contains `skill.json` and a `src/` directory holding the skill
8
+ * content; `context.files` is rooted at `src/`, so `skill.json` is only
9
+ * reachable via `packageFiles`.
10
+ *
11
+ * Native-only via `check` early-return: when `subject.isNative === false`
12
+ * (managed-external skills without a declared manifest), the rule produces
13
+ * no findings. No separate `applies` predicate per
14
+ * the lint design.
15
+ *
16
+ * Advisory-only — scaffolding a manifest is a user-authored action.
17
+ *
18
+ * @experimental This API is unstable and may change without notice.
19
+ * @packageDocumentation
20
+ */
21
+ import { makeManifestPresentRule } from "../shared/manifest-present.js";
22
+ const RULE_ID = "skill/manifest-present";
23
+ const SKILL_JSON = "skill.json";
24
+ export const manifestPresentRule = makeManifestPresentRule({
25
+ ruleId: RULE_ID,
26
+ description: "Native skills include a root skill.json manifest.",
27
+ manifestFile: SKILL_JSON,
28
+ missingMessage: "skill.json is missing for this native skill. Create skill.json with the required manifest fields (`owner`, `type`, `name`, `version`).",
29
+ getFiles: (context) => context.packageFiles,
30
+ applies: (context) => context.subject.isNative,
31
+ });
32
+ //# sourceMappingURL=manifest-present.js.map
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `skill/manifest-schema-valid` — `skill.json` conforms to
3
+ * `SkillManifestSchema`.
4
+ *
5
+ * Delegates to Effect Schema. Issues map 1:1 to findings via
6
+ * `issuesToFindings`.
7
+ *
8
+ * Early-return arms (no findings):
9
+ *
10
+ * - `subject.isNative === false` — non-native skills have no manifest to
11
+ * check (complement of `skill/manifest-present`).
12
+ * - `subject.skillJson === undefined` — manifest is absent (covered by
13
+ * `skill/manifest-present`).
14
+ *
15
+ * @experimental This API is unstable and may change without notice.
16
+ * @packageDocumentation
17
+ */
18
+ import type { SkillRuleContext } from "../../context.js";
19
+ import type { AdvisoryRule } from "../../rule.js";
20
+ export declare const manifestSchemaValidRule: AdvisoryRule<SkillRuleContext>;
21
+ //# sourceMappingURL=manifest-schema-valid.d.ts.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `skill/manifest-schema-valid` — `skill.json` conforms to
3
+ * `SkillManifestSchema`.
4
+ *
5
+ * Delegates to Effect Schema. Issues map 1:1 to findings via
6
+ * `issuesToFindings`.
7
+ *
8
+ * Early-return arms (no findings):
9
+ *
10
+ * - `subject.isNative === false` — non-native skills have no manifest to
11
+ * check (complement of `skill/manifest-present`).
12
+ * - `subject.skillJson === undefined` — manifest is absent (covered by
13
+ * `skill/manifest-present`).
14
+ *
15
+ * @experimental This API is unstable and may change without notice.
16
+ * @packageDocumentation
17
+ */
18
+ import { SkillManifestSchema } from "@agentxm/extension-model/unstable/skills/manifest-schema";
19
+ import { schemaDecodeFindings } from "../shared/schema-rule.js";
20
+ const RULE_ID = "skill/manifest-schema-valid";
21
+ const SKILL_JSON = "skill.json";
22
+ export const manifestSchemaValidRule = {
23
+ id: RULE_ID,
24
+ description: "skill.json defines a valid skill manifest.",
25
+ kind: "advisory",
26
+ severity: "error",
27
+ check: (context) => {
28
+ if (!context.subject.isNative) {
29
+ // Non-native skills have no skill.json to schema-validate. The
30
+ // presence rule (manifest-present) does not fire for non-native either.
31
+ return schemaDecodeFindings(RULE_ID, "error", SKILL_JSON, SkillManifestSchema, undefined);
32
+ }
33
+ return schemaDecodeFindings(RULE_ID, "error", SKILL_JSON, SkillManifestSchema, context.subject.skillJson);
34
+ },
35
+ };
36
+ //# sourceMappingURL=manifest-schema-valid.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `skill/recommended-packs-valid` — recommended packs are bare FQNs, never
3
+ * version-ranged specs. See `../shared/recommended-packs-rules.ts`.
4
+ */
5
+ import type { SkillRuleContext } from "../../context.js";
6
+ import type { AdvisoryRule } from "../../rule.js";
7
+ export declare const recommendedPacksValidRule: AdvisoryRule<SkillRuleContext>;
8
+ //# sourceMappingURL=recommended-packs-valid.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `skill/recommended-packs-valid` — recommended packs are bare FQNs, never
3
+ * version-ranged specs. See `../shared/recommended-packs-rules.ts`.
4
+ */
5
+ import { MANIFEST_FILENAME } from "@agentxm/extension-model/unstable/skills/manifest-schema";
6
+ import { makeRecommendedPacksValidRule } from "../shared/recommended-packs-rules.js";
7
+ export const recommendedPacksValidRule = makeRecommendedPacksValidRule({
8
+ namespace: "skill",
9
+ manifestFile: MANIFEST_FILENAME,
10
+ manifestJson: (context) => context.subject.skillJson,
11
+ });
12
+ //# sourceMappingURL=recommended-packs-valid.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `skill/skill-md-present` — every skill must have a `SKILL.md` at its root.
3
+ *
4
+ * Applies to every skill context (native and non-native). Upstream-required
5
+ * by the agentskills specification; also the precondition for the
6
+ * `skill/frontmatter-parseable` cascade.
7
+ *
8
+ * Advisory-only (no autofix). Scaffolding `SKILL.md` requires user-authored
9
+ * content and is not a meaning-preserving normalization.
10
+ *
11
+ * @experimental This API is unstable and may change without notice.
12
+ * @packageDocumentation
13
+ */
14
+ import type { SkillRuleContext } from "../../context.js";
15
+ import type { AdvisoryRule } from "../../rule.js";
16
+ export declare const skillMdPresentRule: AdvisoryRule<SkillRuleContext>;
17
+ //# sourceMappingURL=skill-md-present.d.ts.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * `skill/skill-md-present` — every skill must have a `SKILL.md` at its root.
3
+ *
4
+ * Applies to every skill context (native and non-native). Upstream-required
5
+ * by the agentskills specification; also the precondition for the
6
+ * `skill/frontmatter-parseable` cascade.
7
+ *
8
+ * Advisory-only (no autofix). Scaffolding `SKILL.md` requires user-authored
9
+ * content and is not a meaning-preserving normalization.
10
+ *
11
+ * @experimental This API is unstable and may change without notice.
12
+ * @packageDocumentation
13
+ */
14
+ import * as Effect from "effect/Effect";
15
+ const RULE_ID = "skill/skill-md-present";
16
+ const SKILL_MD = "SKILL.md";
17
+ export const skillMdPresentRule = {
18
+ id: RULE_ID,
19
+ description: "Skills include a root SKILL.md file.",
20
+ kind: "advisory",
21
+ severity: "error",
22
+ check: (context) => Effect.map(context.files.exists(SKILL_MD), (present) => {
23
+ if (present) {
24
+ return [];
25
+ }
26
+ return [
27
+ {
28
+ kind: "advisory",
29
+ ruleId: RULE_ID,
30
+ severity: "error",
31
+ message: "SKILL.md is missing. Create SKILL.md with the required frontmatter (`name`, `description`).",
32
+ location: { file: SKILL_MD },
33
+ },
34
+ ];
35
+ }),
36
+ };
37
+ //# sourceMappingURL=skill-md-present.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `skill/standalone-declaration-valid` — a manifest that opts out of standalone
3
+ * use names the packs it needs. See `../shared/recommended-packs-rules.ts`.
4
+ */
5
+ import type { SkillRuleContext } from "../../context.js";
6
+ import type { AdvisoryRule } from "../../rule.js";
7
+ export declare const standaloneDeclarationValidRule: AdvisoryRule<SkillRuleContext>;
8
+ //# sourceMappingURL=standalone-declaration-valid.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `skill/standalone-declaration-valid` — a manifest that opts out of standalone
3
+ * use names the packs it needs. See `../shared/recommended-packs-rules.ts`.
4
+ */
5
+ import { MANIFEST_FILENAME } from "@agentxm/extension-model/unstable/skills/manifest-schema";
6
+ import { makeStandaloneDeclarationValidRule } from "../shared/recommended-packs-rules.js";
7
+ export const standaloneDeclarationValidRule = makeStandaloneDeclarationValidRule({
8
+ namespace: "skill",
9
+ manifestFile: MANIFEST_FILENAME,
10
+ manifestJson: (context) => context.subject.skillJson,
11
+ });
12
+ //# sourceMappingURL=standalone-declaration-valid.js.map
@@ -0,0 +1,61 @@
1
+ /**
2
+ * `buildSkillRuleContexts` — build `SkillRuleContext[]` from a structural
3
+ * `installedSkills` input. The full lint workspace view
4
+ * (`LintWorkspaceView`) satisfies this by construction.
5
+ *
6
+ * The minimal shape is **exactly** the set of fields the function reads per
7
+ * installed skill:
8
+ *
9
+ * - `isNative` — whether the skill is expected to expose `skill.json`
10
+ * (registry-installed natives: `true`; managed external: `false`).
11
+ * - `skillJson` — pre-decoded `skill.json` when present (caller decodes
12
+ * once per skill, so rules don't re-read + re-parse).
13
+ * - `displayRoot` — posix-relative root used by the renderer; the caller
14
+ * picks per provenance (see the table below).
15
+ * - `files` — the pre-bound content-root `SkillFileAccessor` (rooted at the
16
+ * directory containing `SKILL.md`). The caller chooses VFT or
17
+ * platform-backed.
18
+ * - `packageFiles` — the pre-bound package-root `SkillFileAccessor` (rooted
19
+ * at the directory containing `skill.json` for native skills). For
20
+ * non-native skills, callers MAY alias `files`.
21
+ *
22
+ * Provenance → `displayRoot` table:
23
+ *
24
+ * | Surface | `displayRoot` |
25
+ * | ----------------------------------------- | --------------------------------------------- |
26
+ * | Publish | `""` |
27
+ * | Registry-installed native skill | `agent_extensions/<source>/<@owner>/skills/<name>/src` |
28
+ * | Portable acquired skill | `agent_extensions/<source>/<source-full-name>` |
29
+ *
30
+ * @experimental This API is unstable and may change without notice.
31
+ * @packageDocumentation
32
+ */
33
+ import type { SkillFileAccessor, SkillRuleContext } from "../../context.js";
34
+ /**
35
+ * Minimal structural shape `buildSkillRuleContexts` needs per installed
36
+ * skill. The full lint workspace view exposes
37
+ * `installedSkills: ReadonlyArray<InstalledSkillInfo>`.
38
+ *
39
+ * @experimental This API is unstable and may change without notice.
40
+ */
41
+ export interface InstalledSkillInfo {
42
+ readonly isNative: boolean;
43
+ readonly skillJson: unknown;
44
+ readonly expectedName?: string;
45
+ readonly displayRoot: string;
46
+ readonly files: SkillFileAccessor;
47
+ readonly packageFiles: SkillFileAccessor;
48
+ }
49
+ /**
50
+ * Project an input's `installedSkills` into `SkillRuleContext`s with their
51
+ * `displayRoot` and `subject` fields pre-populated.
52
+ *
53
+ * Publish callers bypass this helper and construct a single context directly
54
+ * — they have exactly one skill in play and no workspace.
55
+ *
56
+ * @experimental This API is unstable and may change without notice.
57
+ */
58
+ export declare const buildSkillRuleContexts: (input: {
59
+ readonly installedSkills: ReadonlyArray<InstalledSkillInfo>;
60
+ }) => ReadonlyArray<SkillRuleContext>;
61
+ //# sourceMappingURL=contexts.d.ts.map
@@ -0,0 +1,55 @@
1
+ /**
2
+ * `buildSkillRuleContexts` — build `SkillRuleContext[]` from a structural
3
+ * `installedSkills` input. The full lint workspace view
4
+ * (`LintWorkspaceView`) satisfies this by construction.
5
+ *
6
+ * The minimal shape is **exactly** the set of fields the function reads per
7
+ * installed skill:
8
+ *
9
+ * - `isNative` — whether the skill is expected to expose `skill.json`
10
+ * (registry-installed natives: `true`; managed external: `false`).
11
+ * - `skillJson` — pre-decoded `skill.json` when present (caller decodes
12
+ * once per skill, so rules don't re-read + re-parse).
13
+ * - `displayRoot` — posix-relative root used by the renderer; the caller
14
+ * picks per provenance (see the table below).
15
+ * - `files` — the pre-bound content-root `SkillFileAccessor` (rooted at the
16
+ * directory containing `SKILL.md`). The caller chooses VFT or
17
+ * platform-backed.
18
+ * - `packageFiles` — the pre-bound package-root `SkillFileAccessor` (rooted
19
+ * at the directory containing `skill.json` for native skills). For
20
+ * non-native skills, callers MAY alias `files`.
21
+ *
22
+ * Provenance → `displayRoot` table:
23
+ *
24
+ * | Surface | `displayRoot` |
25
+ * | ----------------------------------------- | --------------------------------------------- |
26
+ * | Publish | `""` |
27
+ * | Registry-installed native skill | `agent_extensions/<source>/<@owner>/skills/<name>/src` |
28
+ * | Portable acquired skill | `agent_extensions/<source>/<source-full-name>` |
29
+ *
30
+ * @experimental This API is unstable and may change without notice.
31
+ * @packageDocumentation
32
+ */
33
+ // -----------------------------------------------------------------------------
34
+ // buildSkillRuleContexts
35
+ // -----------------------------------------------------------------------------
36
+ /**
37
+ * Project an input's `installedSkills` into `SkillRuleContext`s with their
38
+ * `displayRoot` and `subject` fields pre-populated.
39
+ *
40
+ * Publish callers bypass this helper and construct a single context directly
41
+ * — they have exactly one skill in play and no workspace.
42
+ *
43
+ * @experimental This API is unstable and may change without notice.
44
+ */
45
+ export const buildSkillRuleContexts = (input) => input.installedSkills.map((info) => ({
46
+ subject: {
47
+ isNative: info.isNative,
48
+ skillJson: info.skillJson,
49
+ ...(info.expectedName === undefined ? {} : { expectedName: info.expectedName }),
50
+ },
51
+ files: info.files,
52
+ packageFiles: info.packageFiles,
53
+ displayRoot: info.displayRoot,
54
+ }));
55
+ //# sourceMappingURL=contexts.js.map
@@ -0,0 +1,77 @@
1
+ /**
2
+ * VFT-backed `SkillFileAccessor` for publish callers.
3
+ *
4
+ * A Virtual File Tree (VFT) is an in-memory representation of an extracted
5
+ * archive — the registry publish pipeline extracts an upload into a VFT, then
6
+ * passes that tree into Phase 4 decode/lint. The VFT's schema and bounds
7
+ * (max size, file count, path depth) are owned by the registry extract phase
8
+ * (Phase 4 concern); this accessor treats the tree as a read-only
9
+ * `path -> Uint8Array` map and enforces its own rooted-read + no-`..`-escape
10
+ * invariants at the rule boundary.
11
+ *
12
+ * Bounds enforcement here:
13
+ *
14
+ * - Paths are normalized to posix, `./` prefixes are stripped.
15
+ * - Empty path resolves to the accessor root itself (useful for
16
+ * `location.file = ""` findings but not currently exercised by the v1
17
+ * catalog).
18
+ * - Any path containing a `..` segment raises `FileAccessError {
19
+ * reason: "path-escape" }` from `readBytes` and resolves to `false` from
20
+ * `exists`.
21
+ * - Absolute paths (starting with `/` or a Windows drive letter) are
22
+ * treated as escape attempts.
23
+ *
24
+ * @experimental This API is unstable and may change without notice.
25
+ * @packageDocumentation
26
+ */
27
+ import type { SkillFileAccessor } from "../../context.js";
28
+ /**
29
+ * Minimal shape of a Virtual File Tree consumed by the accessor.
30
+ *
31
+ * The registry VFT (Phase 4, this-repo) MUST satisfy this interface. The
32
+ * registry may (and will) expose additional methods — file count, archive
33
+ * bounds, iteration — but those are the extract phase's concern.
34
+ *
35
+ * @experimental This API is unstable and may change without notice.
36
+ */
37
+ export interface VFTNode {
38
+ /**
39
+ * Whether the given posix path points to a file within the tree.
40
+ */
41
+ readonly hasFile: (posixPath: string) => boolean;
42
+ /**
43
+ * Return the bytes for the given posix path, or `undefined` when the path
44
+ * does not resolve to a file (missing, directory, or outside the tree).
45
+ */
46
+ readonly getFile: (posixPath: string) => Uint8Array | undefined;
47
+ }
48
+ /**
49
+ * Build a VFT-backed `SkillFileAccessor` rooted at the tree's root.
50
+ *
51
+ * Callers that root the skill at a sub-path of the archive should pre-strip
52
+ * that sub-path before constructing the tree — the accessor enforces no
53
+ * `..` escape above the root it was given.
54
+ *
55
+ * @experimental This API is unstable and may change without notice.
56
+ */
57
+ export declare const makeVftSkillFileAccessor: (tree: VFTNode) => SkillFileAccessor;
58
+ /**
59
+ * Build a VFT-backed `SkillFileAccessor` rooted at a sub-path of the tree.
60
+ *
61
+ * Publish callers use this when the archive layout nests the skill content
62
+ * under a directory (for native managed skills: `src/` holds the content
63
+ * accessor root while the archive root holds the package). The
64
+ * `prefix` is a posix path relative to the tree root; every rule-supplied
65
+ * path is resolved as `<prefix>/<path>` before dispatching to the tree.
66
+ *
67
+ * Bounds enforcement matches {@link makeVftSkillFileAccessor} — path traversal
68
+ * checks run on the caller-supplied path before the prefix is applied, so
69
+ * rules still cannot escape above the scoped root.
70
+ *
71
+ * The prefix itself is normalized posix (leading `./` and trailing `/` stripped);
72
+ * an empty or `.` prefix is equivalent to {@link makeVftSkillFileAccessor}.
73
+ *
74
+ * @experimental This API is unstable and may change without notice.
75
+ */
76
+ export declare const makeVftSkillFileAccessorScoped: (tree: VFTNode, prefix: string) => SkillFileAccessor;
77
+ //# sourceMappingURL=vft.d.ts.map
@@ -0,0 +1,135 @@
1
+ /**
2
+ * VFT-backed `SkillFileAccessor` for publish callers.
3
+ *
4
+ * A Virtual File Tree (VFT) is an in-memory representation of an extracted
5
+ * archive — the registry publish pipeline extracts an upload into a VFT, then
6
+ * passes that tree into Phase 4 decode/lint. The VFT's schema and bounds
7
+ * (max size, file count, path depth) are owned by the registry extract phase
8
+ * (Phase 4 concern); this accessor treats the tree as a read-only
9
+ * `path -> Uint8Array` map and enforces its own rooted-read + no-`..`-escape
10
+ * invariants at the rule boundary.
11
+ *
12
+ * Bounds enforcement here:
13
+ *
14
+ * - Paths are normalized to posix, `./` prefixes are stripped.
15
+ * - Empty path resolves to the accessor root itself (useful for
16
+ * `location.file = ""` findings but not currently exercised by the v1
17
+ * catalog).
18
+ * - Any path containing a `..` segment raises `FileAccessError {
19
+ * reason: "path-escape" }` from `readBytes` and resolves to `false` from
20
+ * `exists`.
21
+ * - Absolute paths (starting with `/` or a Windows drive letter) are
22
+ * treated as escape attempts.
23
+ *
24
+ * @experimental This API is unstable and may change without notice.
25
+ * @packageDocumentation
26
+ */
27
+ import * as Effect from "effect/Effect";
28
+ /**
29
+ * Build a VFT-backed `SkillFileAccessor` rooted at the tree's root.
30
+ *
31
+ * Callers that root the skill at a sub-path of the archive should pre-strip
32
+ * that sub-path before constructing the tree — the accessor enforces no
33
+ * `..` escape above the root it was given.
34
+ *
35
+ * @experimental This API is unstable and may change without notice.
36
+ */
37
+ export const makeVftSkillFileAccessor = (tree) => {
38
+ return {
39
+ exists: (path) => {
40
+ const normalized = normalizeAndCheck(path);
41
+ if (normalized.kind !== "ok") {
42
+ return Effect.succeed(false);
43
+ }
44
+ return Effect.succeed(tree.hasFile(normalized.path));
45
+ },
46
+ readBytes: (path) => {
47
+ const normalized = normalizeAndCheck(path);
48
+ if (normalized.kind === "escape") {
49
+ return failFileAccess(path, "path-escape", `path escapes the accessor root: ${path}`);
50
+ }
51
+ const bytes = tree.getFile(normalized.path);
52
+ if (bytes === undefined) {
53
+ return failFileAccess(path, "read-error", `file not found at ${path}`);
54
+ }
55
+ return Effect.succeed(bytes);
56
+ },
57
+ };
58
+ };
59
+ /**
60
+ * Build a VFT-backed `SkillFileAccessor` rooted at a sub-path of the tree.
61
+ *
62
+ * Publish callers use this when the archive layout nests the skill content
63
+ * under a directory (for native managed skills: `src/` holds the content
64
+ * accessor root while the archive root holds the package). The
65
+ * `prefix` is a posix path relative to the tree root; every rule-supplied
66
+ * path is resolved as `<prefix>/<path>` before dispatching to the tree.
67
+ *
68
+ * Bounds enforcement matches {@link makeVftSkillFileAccessor} — path traversal
69
+ * checks run on the caller-supplied path before the prefix is applied, so
70
+ * rules still cannot escape above the scoped root.
71
+ *
72
+ * The prefix itself is normalized posix (leading `./` and trailing `/` stripped);
73
+ * an empty or `.` prefix is equivalent to {@link makeVftSkillFileAccessor}.
74
+ *
75
+ * @experimental This API is unstable and may change without notice.
76
+ */
77
+ export const makeVftSkillFileAccessorScoped = (tree, prefix) => {
78
+ const normalizedPrefix = normalizePrefix(prefix);
79
+ if (normalizedPrefix === "") {
80
+ return makeVftSkillFileAccessor(tree);
81
+ }
82
+ const join = (path) => path === "" ? normalizedPrefix : `${normalizedPrefix}/${path}`;
83
+ return {
84
+ exists: (path) => {
85
+ const normalized = normalizeAndCheck(path);
86
+ if (normalized.kind !== "ok") {
87
+ return Effect.succeed(false);
88
+ }
89
+ return Effect.succeed(tree.hasFile(join(normalized.path)));
90
+ },
91
+ readBytes: (path) => {
92
+ const normalized = normalizeAndCheck(path);
93
+ if (normalized.kind === "escape") {
94
+ return failFileAccess(path, "path-escape", `path escapes the accessor root: ${path}`);
95
+ }
96
+ const bytes = tree.getFile(join(normalized.path));
97
+ if (bytes === undefined) {
98
+ return failFileAccess(path, "read-error", `file not found at ${path}`);
99
+ }
100
+ return Effect.succeed(bytes);
101
+ },
102
+ };
103
+ };
104
+ const normalizePrefix = (prefix) => {
105
+ const stripped = prefix.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "");
106
+ if (stripped === "" || stripped === ".") {
107
+ return "";
108
+ }
109
+ return stripped;
110
+ };
111
+ const normalizeAndCheck = (path) => {
112
+ if (path === "" || path === "." || path === "./") {
113
+ return { kind: "ok", path: "" };
114
+ }
115
+ // Windows drive letters (`C:/`) and absolute posix paths both count as
116
+ // escape attempts at a skill-rooted accessor.
117
+ if (/^[a-z]:[\\/]/i.test(path) || path.startsWith("/") || path.startsWith("\\")) {
118
+ return { kind: "escape" };
119
+ }
120
+ const normalized = path.replace(/\\/g, "/").replace(/^\.\//, "");
121
+ const segments = normalized.split("/");
122
+ for (const segment of segments) {
123
+ if (segment === "..") {
124
+ return { kind: "escape" };
125
+ }
126
+ }
127
+ return { kind: "ok", path: normalized };
128
+ };
129
+ const failFileAccess = (path, reason, message) => Effect.fail({
130
+ _tag: "FileAccessError",
131
+ path,
132
+ reason,
133
+ message,
134
+ });
135
+ //# sourceMappingURL=vft.js.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * `skill/*` rule catalog.
3
+ *
4
+ * Per the lint design, registry publish and `axm lint`
5
+ * run exactly these rules against each skill context:
6
+ *
7
+ * | ID | Severity | Autofix |
8
+ * | -------------------------------------- | -------- | ------- |
9
+ * | `skill/skill-md-present` | error | — |
10
+ * | `skill/manifest-present` | error | — |
11
+ * | `skill/frontmatter-parseable` | error | — |
12
+ * | `skill/frontmatter-standard-valid` | error | — |
13
+ * | `skill/manifest-schema-valid` | error | — |
14
+ * | `skill/manifest-keys-recognized` | error | — |
15
+ * | `skill/standalone-declaration-valid` | warning | — |
16
+ * | `skill/recommended-packs-valid` | warning | — |
17
+ *
18
+ * The last two come from `catalog/shared/recommended-packs-rules.ts`; every
19
+ * non-pack catalog registers the same pair against its own manifest.
20
+ *
21
+ * All ship `kind: "advisory"`. Native-vs-non-native applicability is
22
+ * expressed via `check` early-return (no separate `applies` predicate); see
23
+ * each rule's module for the guard.
24
+ *
25
+ * Rule ids are **registered with the lint config allowlist at module-load
26
+ * time**, so importing this catalog extends the set of accepted
27
+ * `axm.json` `lint.rules` keys. Consumers that never import the
28
+ * catalog (the registry Worker bundle for `pack`-only routes, e.g.) don't pay
29
+ * the registration cost.
30
+ *
31
+ * @experimental This API is unstable and may change without notice.
32
+ * @packageDocumentation
33
+ */
34
+ import type { LintRule } from "../rule.js";
35
+ import type { SkillRuleContext } from "../context.js";
36
+ /**
37
+ * Ordered v1 `skill/*` rule catalog. Declaration order is the evaluation
38
+ * order within a single `evaluateContexts` call (deterministic ordering is
39
+ * test-observable; see `evaluate.ts`).
40
+ *
41
+ * @experimental This API is unstable and may change without notice.
42
+ */
43
+ export declare const skillRules: ReadonlyArray<LintRule<SkillRuleContext>>;
44
+ //# sourceMappingURL=skill.d.ts.map