@agentxm/extension-content 0.28.14-preview.1789139351.5cd4595aa

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 (133) hide show
  1. package/LICENSE +110 -0
  2. package/README.md +17 -0
  3. package/dist/src/content/agent-skills-standard.d.ts +17 -0
  4. package/dist/src/content/agent-skills-standard.js +24 -0
  5. package/dist/src/content/frontmatter.d.ts +52 -0
  6. package/dist/src/content/frontmatter.js +115 -0
  7. package/dist/src/content/index.d.ts +11 -0
  8. package/dist/src/content/index.js +11 -0
  9. package/dist/src/content/skill-content.d.ts +43 -0
  10. package/dist/src/content/skill-content.js +184 -0
  11. package/dist/src/content/skill-types.d.ts +22 -0
  12. package/dist/src/content/skill-types.js +9 -0
  13. package/dist/src/content/subagent-content.d.ts +58 -0
  14. package/dist/src/content/subagent-content.js +101 -0
  15. package/dist/src/index.d.ts +23 -0
  16. package/dist/src/index.js +23 -0
  17. package/dist/src/knowledge/index.d.ts +9 -0
  18. package/dist/src/knowledge/index.js +9 -0
  19. package/dist/src/knowledge/knowledge-search.d.ts +32 -0
  20. package/dist/src/knowledge/knowledge-search.js +147 -0
  21. package/dist/src/knowledge/okf.d.ts +86 -0
  22. package/dist/src/knowledge/okf.js +1090 -0
  23. package/dist/src/knowledge/package-inspection.d.ts +125 -0
  24. package/dist/src/knowledge/package-inspection.js +45 -0
  25. package/dist/src/lint/catalog/hook/decision-portability.d.ts +4 -0
  26. package/dist/src/lint/catalog/hook/decision-portability.js +40 -0
  27. package/dist/src/lint/catalog/hook/entrypoint-exists.d.ts +4 -0
  28. package/dist/src/lint/catalog/hook/entrypoint-exists.js +39 -0
  29. package/dist/src/lint/catalog/hook/envelope.d.ts +6 -0
  30. package/dist/src/lint/catalog/hook/envelope.js +15 -0
  31. package/dist/src/lint/catalog/hook/matcher-raw-portability.d.ts +4 -0
  32. package/dist/src/lint/catalog/hook/matcher-raw-portability.js +51 -0
  33. package/dist/src/lint/catalog/hook.d.ts +4 -0
  34. package/dist/src/lint/catalog/hook.js +15 -0
  35. package/dist/src/lint/catalog/knowledge/diagnostics.d.ts +128 -0
  36. package/dist/src/lint/catalog/knowledge/diagnostics.js +78 -0
  37. package/dist/src/lint/catalog/knowledge/envelope.d.ts +6 -0
  38. package/dist/src/lint/catalog/knowledge/envelope.js +15 -0
  39. package/dist/src/lint/catalog/knowledge.d.ts +11 -0
  40. package/dist/src/lint/catalog/knowledge.js +15 -0
  41. package/dist/src/lint/catalog/mcp-server/envelope.d.ts +6 -0
  42. package/dist/src/lint/catalog/mcp-server/envelope.js +15 -0
  43. package/dist/src/lint/catalog/mcp-server.d.ts +4 -0
  44. package/dist/src/lint/catalog/mcp-server.js +4 -0
  45. package/dist/src/lint/catalog/pack/manifest-keys-recognized.d.ts +28 -0
  46. package/dist/src/lint/catalog/pack/manifest-keys-recognized.js +38 -0
  47. package/dist/src/lint/catalog/pack/manifest-present.d.ts +17 -0
  48. package/dist/src/lint/catalog/pack/manifest-present.js +24 -0
  49. package/dist/src/lint/catalog/pack/manifest-schema-valid.d.ts +25 -0
  50. package/dist/src/lint/catalog/pack/manifest-schema-valid.js +33 -0
  51. package/dist/src/lint/catalog/pack-accessor/contexts.d.ts +51 -0
  52. package/dist/src/lint/catalog/pack-accessor/contexts.js +45 -0
  53. package/dist/src/lint/catalog/pack-accessor/platform.d.ts +56 -0
  54. package/dist/src/lint/catalog/pack-accessor/platform.js +93 -0
  55. package/dist/src/lint/catalog/pack-accessor/vft.d.ts +60 -0
  56. package/dist/src/lint/catalog/pack-accessor/vft.js +85 -0
  57. package/dist/src/lint/catalog/pack.d.ts +31 -0
  58. package/dist/src/lint/catalog/pack.js +36 -0
  59. package/dist/src/lint/catalog/rule/envelope.d.ts +6 -0
  60. package/dist/src/lint/catalog/rule/envelope.js +15 -0
  61. package/dist/src/lint/catalog/rule.d.ts +4 -0
  62. package/dist/src/lint/catalog/rule.js +4 -0
  63. package/dist/src/lint/catalog/shared/envelope-rules.d.ts +88 -0
  64. package/dist/src/lint/catalog/shared/envelope-rules.js +84 -0
  65. package/dist/src/lint/catalog/shared/manifest-json.d.ts +18 -0
  66. package/dist/src/lint/catalog/shared/manifest-json.js +28 -0
  67. package/dist/src/lint/catalog/shared/manifest-present.d.ts +25 -0
  68. package/dist/src/lint/catalog/shared/manifest-present.js +37 -0
  69. package/dist/src/lint/catalog/shared/recommended-packs-rules.d.ts +70 -0
  70. package/dist/src/lint/catalog/shared/recommended-packs-rules.js +139 -0
  71. package/dist/src/lint/catalog/shared/schema-rule.d.ts +57 -0
  72. package/dist/src/lint/catalog/shared/schema-rule.js +102 -0
  73. package/dist/src/lint/catalog/skill/frontmatter-parseable.d.ts +31 -0
  74. package/dist/src/lint/catalog/skill/frontmatter-parseable.js +148 -0
  75. package/dist/src/lint/catalog/skill/frontmatter-standard-valid.d.ts +13 -0
  76. package/dist/src/lint/catalog/skill/frontmatter-standard-valid.js +61 -0
  77. package/dist/src/lint/catalog/skill/manifest-keys-recognized.d.ts +26 -0
  78. package/dist/src/lint/catalog/skill/manifest-keys-recognized.js +41 -0
  79. package/dist/src/lint/catalog/skill/manifest-present.d.ts +23 -0
  80. package/dist/src/lint/catalog/skill/manifest-present.js +32 -0
  81. package/dist/src/lint/catalog/skill/manifest-schema-valid.d.ts +21 -0
  82. package/dist/src/lint/catalog/skill/manifest-schema-valid.js +36 -0
  83. package/dist/src/lint/catalog/skill/recommended-packs-valid.d.ts +8 -0
  84. package/dist/src/lint/catalog/skill/recommended-packs-valid.js +12 -0
  85. package/dist/src/lint/catalog/skill/skill-md-present.d.ts +17 -0
  86. package/dist/src/lint/catalog/skill/skill-md-present.js +37 -0
  87. package/dist/src/lint/catalog/skill/standalone-declaration-valid.d.ts +8 -0
  88. package/dist/src/lint/catalog/skill/standalone-declaration-valid.js +12 -0
  89. package/dist/src/lint/catalog/skill-accessor/contexts.d.ts +61 -0
  90. package/dist/src/lint/catalog/skill-accessor/contexts.js +55 -0
  91. package/dist/src/lint/catalog/skill-accessor/platform.d.ts +53 -0
  92. package/dist/src/lint/catalog/skill-accessor/platform.js +90 -0
  93. package/dist/src/lint/catalog/skill-accessor/vft.d.ts +77 -0
  94. package/dist/src/lint/catalog/skill-accessor/vft.js +135 -0
  95. package/dist/src/lint/catalog/skill.d.ts +38 -0
  96. package/dist/src/lint/catalog/skill.js +53 -0
  97. package/dist/src/lint/catalog/subagent/envelope.d.ts +6 -0
  98. package/dist/src/lint/catalog/subagent/envelope.js +15 -0
  99. package/dist/src/lint/catalog/subagent.d.ts +4 -0
  100. package/dist/src/lint/catalog/subagent.js +4 -0
  101. package/dist/src/lint/catalog-metadata.d.ts +125 -0
  102. package/dist/src/lint/catalog-metadata.js +642 -0
  103. package/dist/src/lint/compose-path.d.ts +28 -0
  104. package/dist/src/lint/compose-path.js +64 -0
  105. package/dist/src/lint/config.d.ts +77 -0
  106. package/dist/src/lint/config.js +99 -0
  107. package/dist/src/lint/context.d.ts +239 -0
  108. package/dist/src/lint/context.js +17 -0
  109. package/dist/src/lint/describe-document.d.ts +31 -0
  110. package/dist/src/lint/describe-document.js +50 -0
  111. package/dist/src/lint/evaluate.d.ts +47 -0
  112. package/dist/src/lint/evaluate.js +73 -0
  113. package/dist/src/lint/index.d.ts +36 -0
  114. package/dist/src/lint/index.js +34 -0
  115. package/dist/src/lint/issues-to-findings.d.ts +35 -0
  116. package/dist/src/lint/issues-to-findings.js +149 -0
  117. package/dist/src/lint/rule.d.ts +97 -0
  118. package/dist/src/lint/rule.js +17 -0
  119. package/dist/src/packaging/archive-guardrails.d.ts +39 -0
  120. package/dist/src/packaging/archive-guardrails.js +250 -0
  121. package/dist/src/packaging/filtered-package-validation.d.ts +24 -0
  122. package/dist/src/packaging/filtered-package-validation.js +117 -0
  123. package/dist/src/packaging/ingest-limits.d.ts +25 -0
  124. package/dist/src/packaging/ingest-limits.js +41 -0
  125. package/dist/src/packaging/input-normalization.d.ts +40 -0
  126. package/dist/src/packaging/input-normalization.js +125 -0
  127. package/dist/src/packaging/manifest-policy.d.ts +611 -0
  128. package/dist/src/packaging/manifest-policy.js +196 -0
  129. package/dist/src/packaging/test-zip-helpers.d.ts +13 -0
  130. package/dist/src/packaging/test-zip-helpers.js +117 -0
  131. package/dist/src/testing.d.ts +9 -0
  132. package/dist/src/testing.js +9 -0
  133. package/package.json +65 -0
@@ -0,0 +1,125 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as FileSystem from "effect/FileSystem";
3
+ import * as Path from "effect/Path";
4
+ import * as Schema from "effect/Schema";
5
+ import { ManifestError } from "../packaging/manifest-policy.js";
6
+ import { type KnowledgeInspection } from "./okf.js";
7
+ /** Read and decode one Knowledge package manifest without inspecting its bundle body. */
8
+ export declare const readKnowledgePackageManifest: (packageRoot: string) => Effect.Effect<{
9
+ sourceRoot: string;
10
+ manifest: {
11
+ readonly name: string & import("effect/Brand").Brand<"ExtensionName">;
12
+ readonly type: "knowledge";
13
+ readonly format: {
14
+ readonly name: "okf";
15
+ readonly version: "0.2";
16
+ };
17
+ readonly owner: string & import("effect/Brand").Brand<"Handle">;
18
+ readonly version: string & import("effect/Brand").Brand<"Version">;
19
+ readonly bundleRoot: "src";
20
+ readonly description?: string | undefined;
21
+ readonly license?: string | undefined;
22
+ readonly metadata?: {
23
+ readonly [x: string]: Schema.Json;
24
+ } | undefined;
25
+ readonly enhances?: readonly string[] | undefined;
26
+ readonly requires?: readonly string[] | undefined;
27
+ readonly fallback?: "auto" | "none" | undefined;
28
+ readonly recommendedPacks?: readonly (string & import("effect/Brand").Brand<"PackSpec">)[] | undefined;
29
+ readonly standalone?: boolean | undefined;
30
+ readonly publish?: {
31
+ readonly visibility?: "public" | "private" | undefined;
32
+ readonly ignore?: readonly string[] | undefined;
33
+ } | undefined;
34
+ readonly keywords?: readonly string[] | undefined;
35
+ readonly repository?: string | {
36
+ readonly url: string;
37
+ readonly type?: string | undefined;
38
+ readonly directory?: string | undefined;
39
+ } | undefined;
40
+ readonly homepage?: string | undefined;
41
+ readonly bugs?: string | {
42
+ readonly url?: string | undefined;
43
+ readonly email?: string | undefined;
44
+ } | undefined;
45
+ readonly authors?: readonly {
46
+ readonly name: string;
47
+ readonly url?: string | undefined;
48
+ readonly email?: string | undefined;
49
+ }[] | undefined;
50
+ readonly packages?: readonly {
51
+ readonly purl: string & import("effect/Brand").Brand<"PackageIdentityPurl">;
52
+ readonly versionRange?: ({
53
+ readonly raw: string;
54
+ readonly scheme: string;
55
+ readonly constraints: readonly {
56
+ readonly comparator: "=" | "!=" | "<" | "<=" | ">" | ">=";
57
+ readonly version: string;
58
+ }[];
59
+ } & import("effect/Brand").Brand<"VersRange">) | undefined;
60
+ }[] | undefined;
61
+ readonly $schema?: string | undefined;
62
+ readonly instructionEntry?: boolean;
63
+ };
64
+ }, import("effect/PlatformError").PlatformError | ManifestError | Schema.SchemaError, FileSystem.FileSystem | Path.Path>;
65
+ /** Inspect one complete Knowledge package, including manifest-level profile diagnostics. */
66
+ export declare const inspectKnowledgePackage: (packageRoot: string) => Effect.Effect<{
67
+ name: string & import("effect/Brand").Brand<"ExtensionName">;
68
+ sourceRoot: string;
69
+ manifest: {
70
+ readonly name: string & import("effect/Brand").Brand<"ExtensionName">;
71
+ readonly type: "knowledge";
72
+ readonly format: {
73
+ readonly name: "okf";
74
+ readonly version: "0.2";
75
+ };
76
+ readonly owner: string & import("effect/Brand").Brand<"Handle">;
77
+ readonly version: string & import("effect/Brand").Brand<"Version">;
78
+ readonly bundleRoot: "src";
79
+ readonly description?: string | undefined;
80
+ readonly license?: string | undefined;
81
+ readonly metadata?: {
82
+ readonly [x: string]: Schema.Json;
83
+ } | undefined;
84
+ readonly enhances?: readonly string[] | undefined;
85
+ readonly requires?: readonly string[] | undefined;
86
+ readonly fallback?: "auto" | "none" | undefined;
87
+ readonly recommendedPacks?: readonly (string & import("effect/Brand").Brand<"PackSpec">)[] | undefined;
88
+ readonly standalone?: boolean | undefined;
89
+ readonly publish?: {
90
+ readonly visibility?: "public" | "private" | undefined;
91
+ readonly ignore?: readonly string[] | undefined;
92
+ } | undefined;
93
+ readonly keywords?: readonly string[] | undefined;
94
+ readonly repository?: string | {
95
+ readonly url: string;
96
+ readonly type?: string | undefined;
97
+ readonly directory?: string | undefined;
98
+ } | undefined;
99
+ readonly homepage?: string | undefined;
100
+ readonly bugs?: string | {
101
+ readonly url?: string | undefined;
102
+ readonly email?: string | undefined;
103
+ } | undefined;
104
+ readonly authors?: readonly {
105
+ readonly name: string;
106
+ readonly url?: string | undefined;
107
+ readonly email?: string | undefined;
108
+ }[] | undefined;
109
+ readonly packages?: readonly {
110
+ readonly purl: string & import("effect/Brand").Brand<"PackageIdentityPurl">;
111
+ readonly versionRange?: ({
112
+ readonly raw: string;
113
+ readonly scheme: string;
114
+ readonly constraints: readonly {
115
+ readonly comparator: "=" | "!=" | "<" | "<=" | ">" | ">=";
116
+ readonly version: string;
117
+ }[];
118
+ } & import("effect/Brand").Brand<"VersRange">) | undefined;
119
+ }[] | undefined;
120
+ readonly $schema?: string | undefined;
121
+ readonly instructionEntry?: boolean;
122
+ };
123
+ inspection: KnowledgeInspection;
124
+ }, unknown, FileSystem.FileSystem | Path.Path>;
125
+ //# sourceMappingURL=package-inspection.d.ts.map
@@ -0,0 +1,45 @@
1
+ // @effect-diagnostics anyUnknownInErrorContext:off — package accessors preserve caller-owned foreign read errors until diagnostic translation
2
+ import * as Effect from "effect/Effect";
3
+ import * as FileSystem from "effect/FileSystem";
4
+ import * as Path from "effect/Path";
5
+ import * as Schema from "effect/Schema";
6
+ import { KNOWLEDGE_MANIFEST_FILENAME, KNOWLEDGE_SOURCE_DIR, KnowledgeManifestSchema, } from "@agentxm/extension-model/unstable/knowledge/manifest-schema";
7
+ import { ManifestError } from "../packaging/manifest-policy.js";
8
+ import { inspectKnowledgeBundle, } from "./okf.js";
9
+ const missingManifestDescription = () => ({
10
+ code: "missing-manifest-description",
11
+ severity: "warning",
12
+ relativePath: KNOWLEDGE_MANIFEST_FILENAME,
13
+ message: `${KNOWLEDGE_MANIFEST_FILENAME} should include a concise bundle description for discovery.`,
14
+ });
15
+ /** Read and decode one Knowledge package manifest without inspecting its bundle body. */
16
+ export const readKnowledgePackageManifest = Effect.fn("Knowledge.readPackageManifest")(function* (packageRoot) {
17
+ const fs = yield* FileSystem.FileSystem;
18
+ const path = yield* Path.Path;
19
+ const manifestPath = path.join(packageRoot, KNOWLEDGE_MANIFEST_FILENAME);
20
+ const manifestRaw = yield* fs.readFileString(manifestPath);
21
+ const manifestUnknown = yield* Effect.try({
22
+ try: () => JSON.parse(manifestRaw),
23
+ catch: (cause) => new ManifestError({
24
+ code: "manifest_invalid_json",
25
+ detail: `Failed to parse ${manifestPath}`,
26
+ details: cause,
27
+ }),
28
+ });
29
+ const manifest = yield* Schema.decodeUnknownEffect(KnowledgeManifestSchema)(manifestUnknown);
30
+ const sourceRoot = path.join(packageRoot, KNOWLEDGE_SOURCE_DIR);
31
+ return { sourceRoot, manifest };
32
+ });
33
+ /** Inspect one complete Knowledge package, including manifest-level profile diagnostics. */
34
+ export const inspectKnowledgePackage = Effect.fn("Knowledge.inspectPackage")(function* (packageRoot) {
35
+ const { sourceRoot, manifest } = yield* readKnowledgePackageManifest(packageRoot);
36
+ const inspected = yield* inspectKnowledgeBundle(sourceRoot);
37
+ const inspection = {
38
+ ...inspected,
39
+ diagnostics: manifest.description?.trim().length === 0 || manifest.description === undefined
40
+ ? [missingManifestDescription(), ...inspected.diagnostics]
41
+ : inspected.diagnostics,
42
+ };
43
+ return { name: manifest.name, sourceRoot, manifest, inspection };
44
+ });
45
+ //# sourceMappingURL=package-inspection.js.map
@@ -0,0 +1,4 @@
1
+ import type { HookRuleContext } from "../../context.js";
2
+ import type { AdvisoryRule } from "../../rule.js";
3
+ export declare const decisionPortabilityRule: AdvisoryRule<HookRuleContext>;
4
+ //# sourceMappingURL=decision-portability.d.ts.map
@@ -0,0 +1,40 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Result from "effect/Result";
3
+ import * as Schema from "effect/Schema";
4
+ import { HOOK_MANIFEST_FILENAME, HookManifestSchema, } from "@agentxm/extension-model/unstable/hooks/manifest-schema";
5
+ import { isManifestJsonParseFailure } from "../shared/manifest-json.js";
6
+ const RULE_ID = "hook/decision-portability";
7
+ const decodeHookManifest = Schema.decodeUnknownResult(HookManifestSchema);
8
+ export const decisionPortabilityRule = {
9
+ id: RULE_ID,
10
+ description: "Hook decision requirements state when native support is intentionally narrowed.",
11
+ kind: "advisory",
12
+ severity: "warning",
13
+ check: (context) => {
14
+ if (context.subject.hookJson === undefined ||
15
+ isManifestJsonParseFailure(context.subject.hookJson)) {
16
+ return Effect.succeed([]);
17
+ }
18
+ const decoded = decodeHookManifest(context.subject.hookJson, {
19
+ onExcessProperty: "ignore",
20
+ errors: "all",
21
+ });
22
+ if (Result.isFailure(decoded))
23
+ return Effect.succeed([]);
24
+ const findings = [];
25
+ for (const [index, binding] of decoded.success.bindings.entries()) {
26
+ const decision = binding.requires?.decision.kind;
27
+ if (decision === undefined || decision === "observe")
28
+ continue;
29
+ findings.push({
30
+ kind: "advisory",
31
+ ruleId: RULE_ID,
32
+ severity: "warning",
33
+ message: `hook.json bindings[${String(index)}].requires.decision.kind is ${decision}, which narrows native agent support and cannot use advisory fallback. Use observe when enforcement is not required, or retain ${decision} and expect unsupported configured agents to be blocked.`,
34
+ location: { file: HOOK_MANIFEST_FILENAME },
35
+ });
36
+ }
37
+ return Effect.succeed(findings);
38
+ },
39
+ };
40
+ //# sourceMappingURL=decision-portability.js.map
@@ -0,0 +1,4 @@
1
+ import type { HookRuleContext } from "../../context.js";
2
+ import type { AdvisoryRule } from "../../rule.js";
3
+ export declare const entrypointExistsRule: AdvisoryRule<HookRuleContext>;
4
+ //# sourceMappingURL=entrypoint-exists.d.ts.map
@@ -0,0 +1,39 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Result from "effect/Result";
3
+ import * as Schema from "effect/Schema";
4
+ import { HookManifestSchema, HOOK_MANIFEST_FILENAME, } from "@agentxm/extension-model/unstable/hooks/manifest-schema";
5
+ import { isManifestJsonParseFailure } from "../shared/manifest-json.js";
6
+ const RULE_ID = "hook/entrypoint-exists";
7
+ const decodeHookManifest = Schema.decodeUnknownResult(HookManifestSchema);
8
+ export const entrypointExistsRule = {
9
+ id: RULE_ID,
10
+ description: "hook.json entrypoint points to a package file.",
11
+ kind: "advisory",
12
+ severity: "error",
13
+ check: (context) => {
14
+ if (context.subject.hookJson === undefined ||
15
+ isManifestJsonParseFailure(context.subject.hookJson)) {
16
+ return Effect.succeed([]);
17
+ }
18
+ const decoded = decodeHookManifest(context.subject.hookJson, {
19
+ onExcessProperty: "ignore",
20
+ errors: "all",
21
+ });
22
+ if (Result.isFailure(decoded)) {
23
+ return Effect.succeed([]);
24
+ }
25
+ const entrypoint = decoded.success.entrypoint;
26
+ return Effect.map(context.files.exists(entrypoint), (present) => present
27
+ ? []
28
+ : [
29
+ {
30
+ kind: "advisory",
31
+ ruleId: RULE_ID,
32
+ severity: "error",
33
+ message: `hook.json entrypoint '${entrypoint}' does not exist. Add the hook body file or update \`entrypoint\`.`,
34
+ location: { file: HOOK_MANIFEST_FILENAME },
35
+ },
36
+ ]);
37
+ },
38
+ };
39
+ //# sourceMappingURL=entrypoint-exists.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `hook/*` manifest envelope — see `../shared/envelope-rules.ts`.
3
+ */
4
+ import type { HookRuleContext } from "../../context.js";
5
+ export declare const hookEnvelopeRules: import("../shared/envelope-rules.js").ManifestEnvelopeRules<HookRuleContext<import("../../context.js").HookContent>>;
6
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `hook/*` manifest envelope — see `../shared/envelope-rules.ts`.
3
+ */
4
+ import { HookManifestSchema, HOOK_MANIFEST_FILENAME, } from "@agentxm/extension-model/unstable/hooks/manifest-schema";
5
+ import { makeManifestEnvelopeRules } from "../shared/envelope-rules.js";
6
+ export const hookEnvelopeRules = makeManifestEnvelopeRules({
7
+ namespace: "hook",
8
+ manifestFile: HOOK_MANIFEST_FILENAME,
9
+ schema: HookManifestSchema,
10
+ manifestJson: (context) => context.subject.hookJson,
11
+ presentDescription: "Hooks include a root hook.json manifest.",
12
+ presentMissingMessage: "hook.json is missing. Create hook.json with the required manifest fields (`owner`, `type`, `name`, `version`, `runtime`, `entrypoint`, `bindings`).",
13
+ schemaDescription: "hook.json defines a valid hook manifest.",
14
+ });
15
+ //# sourceMappingURL=envelope.js.map
@@ -0,0 +1,4 @@
1
+ import type { HookRuleContext } from "../../context.js";
2
+ import type { AdvisoryRule } from "../../rule.js";
3
+ export declare const matcherRawPortabilityRule: AdvisoryRule<HookRuleContext>;
4
+ //# sourceMappingURL=matcher-raw-portability.d.ts.map
@@ -0,0 +1,51 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Result from "effect/Result";
3
+ import * as Schema from "effect/Schema";
4
+ import { HookManifestSchema, HOOK_MANIFEST_FILENAME, } from "@agentxm/extension-model/unstable/hooks/manifest-schema";
5
+ import { isManifestJsonParseFailure } from "../shared/manifest-json.js";
6
+ const RULE_ID = "hook/matcher-raw-portability";
7
+ const decodeHookManifest = Schema.decodeUnknownResult(HookManifestSchema);
8
+ export const matcherRawPortabilityRule = {
9
+ id: RULE_ID,
10
+ description: "Hook matchers use portable canonical tool matches where possible.",
11
+ kind: "advisory",
12
+ severity: "warning",
13
+ check: (context) => {
14
+ if (context.subject.hookJson === undefined ||
15
+ isManifestJsonParseFailure(context.subject.hookJson)) {
16
+ return Effect.succeed([]);
17
+ }
18
+ const decoded = decodeHookManifest(context.subject.hookJson, {
19
+ onExcessProperty: "ignore",
20
+ errors: "all",
21
+ });
22
+ if (Result.isFailure(decoded)) {
23
+ return Effect.succeed([]);
24
+ }
25
+ const findings = [];
26
+ for (const binding of decoded.success.bindings) {
27
+ if (binding.matcherRaw !== undefined) {
28
+ findings.push({
29
+ kind: "advisory",
30
+ ruleId: RULE_ID,
31
+ severity: "warning",
32
+ message: "hook.json uses matcherRaw, which is native-agent-specific and not portable. Prefer `match.tools` with canonical tool IDs.",
33
+ location: { file: HOOK_MANIFEST_FILENAME },
34
+ });
35
+ }
36
+ for (const target of Object.values(binding.targets ?? {})) {
37
+ if (target.matcherRaw !== undefined) {
38
+ findings.push({
39
+ kind: "advisory",
40
+ ruleId: RULE_ID,
41
+ severity: "warning",
42
+ message: "hook.json uses a target matcherRaw override, which is native-agent-specific and not portable.",
43
+ location: { file: HOOK_MANIFEST_FILENAME },
44
+ });
45
+ }
46
+ }
47
+ }
48
+ return Effect.succeed(findings);
49
+ },
50
+ };
51
+ //# sourceMappingURL=matcher-raw-portability.js.map
@@ -0,0 +1,4 @@
1
+ import type { HookRuleContext } from "../context.js";
2
+ import type { LintRule } from "../rule.js";
3
+ export declare const hookRules: ReadonlyArray<LintRule<HookRuleContext>>;
4
+ //# sourceMappingURL=hook.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { entrypointExistsRule } from "./hook/entrypoint-exists.js";
2
+ import { decisionPortabilityRule } from "./hook/decision-portability.js";
3
+ import { hookEnvelopeRules } from "./hook/envelope.js";
4
+ import { matcherRawPortabilityRule } from "./hook/matcher-raw-portability.js";
5
+ export const hookRules = [
6
+ hookEnvelopeRules.manifestPresent,
7
+ hookEnvelopeRules.manifestSchemaValid,
8
+ hookEnvelopeRules.manifestKeysRecognized,
9
+ decisionPortabilityRule,
10
+ matcherRawPortabilityRule,
11
+ entrypointExistsRule,
12
+ hookEnvelopeRules.standaloneDeclarationValid,
13
+ hookEnvelopeRules.recommendedPacksValid,
14
+ ];
15
+ //# sourceMappingURL=hook.js.map
@@ -0,0 +1,128 @@
1
+ import type { KnowledgeRuleContext } from "../../context.js";
2
+ import type { AdvisoryRule } from "../../rule.js";
3
+ export declare const knowledgeDiagnosticRuleDefinitions: readonly [{
4
+ readonly code: "bundle-too-large";
5
+ readonly severity: "error";
6
+ }, {
7
+ readonly code: "file-too-large";
8
+ readonly severity: "error";
9
+ }, {
10
+ readonly code: "invalid-tags";
11
+ readonly severity: "error";
12
+ }, {
13
+ readonly code: "missing-root-index";
14
+ readonly severity: "error";
15
+ }, {
16
+ readonly code: "missing-okf-version";
17
+ readonly severity: "error";
18
+ }, {
19
+ readonly code: "missing-title";
20
+ readonly severity: "warning";
21
+ }, {
22
+ readonly code: "missing-description";
23
+ readonly severity: "warning";
24
+ }, {
25
+ readonly code: "missing-manifest-description";
26
+ readonly severity: "warning";
27
+ }, {
28
+ readonly code: "empty-bundle";
29
+ readonly severity: "warning";
30
+ }, {
31
+ readonly code: "missing-tags";
32
+ readonly severity: "warning";
33
+ }, {
34
+ readonly code: "symbolic-link";
35
+ readonly severity: "error";
36
+ }, {
37
+ readonly code: "too-many-files";
38
+ readonly severity: "error";
39
+ }, {
40
+ readonly code: "unsupported-okf-version";
41
+ readonly severity: "error";
42
+ }, {
43
+ readonly code: "missing-type";
44
+ readonly severity: "error";
45
+ }, {
46
+ readonly code: "invalid-frontmatter";
47
+ readonly severity: "error";
48
+ }, {
49
+ readonly code: "case-collision";
50
+ readonly severity: "error";
51
+ }, {
52
+ readonly code: "dangerous-uri";
53
+ readonly severity: "error";
54
+ }, {
55
+ readonly code: "detected-secret";
56
+ readonly severity: "error";
57
+ }, {
58
+ readonly code: "unsafe-path";
59
+ readonly severity: "error";
60
+ }, {
61
+ readonly code: "invalid-index";
62
+ readonly severity: "error";
63
+ }, {
64
+ readonly code: "invalid-log";
65
+ readonly severity: "error";
66
+ }, {
67
+ readonly code: "invalid-resource";
68
+ readonly severity: "error";
69
+ }, {
70
+ readonly code: "escaping-resource";
71
+ readonly severity: "error";
72
+ }, {
73
+ readonly code: "unresolved-resource";
74
+ readonly severity: "warning";
75
+ }, {
76
+ readonly code: "broken-internal-link";
77
+ readonly severity: "warning";
78
+ }, {
79
+ readonly code: "escaping-link";
80
+ readonly severity: "warning";
81
+ }, {
82
+ readonly code: "unreachable-concept";
83
+ readonly severity: "warning";
84
+ }, {
85
+ readonly code: "missing-index-entry";
86
+ readonly severity: "warning";
87
+ }, {
88
+ readonly code: "stale-index-entry";
89
+ readonly severity: "warning";
90
+ }, {
91
+ readonly code: "embedded-html";
92
+ readonly severity: "warning";
93
+ }, {
94
+ readonly code: "duplicate-resource";
95
+ readonly severity: "warning";
96
+ }, {
97
+ readonly code: "inconsistent-type";
98
+ readonly severity: "warning";
99
+ }, {
100
+ readonly code: "large-concept";
101
+ readonly severity: "warning";
102
+ }, {
103
+ readonly code: "large-index";
104
+ readonly severity: "warning";
105
+ }, {
106
+ readonly code: "unreferenced-asset";
107
+ readonly severity: "warning";
108
+ }, {
109
+ readonly code: "invalid-sources";
110
+ readonly severity: "error";
111
+ }, {
112
+ readonly code: "invalid-generated";
113
+ readonly severity: "error";
114
+ }, {
115
+ readonly code: "invalid-verified";
116
+ readonly severity: "error";
117
+ }, {
118
+ readonly code: "invalid-status";
119
+ readonly severity: "error";
120
+ }, {
121
+ readonly code: "invalid-stale-after";
122
+ readonly severity: "error";
123
+ }, {
124
+ readonly code: "invalid-attestation";
125
+ readonly severity: "error";
126
+ }];
127
+ export declare const knowledgeDiagnosticRules: ReadonlyArray<AdvisoryRule<KnowledgeRuleContext>>;
128
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +1,78 @@
1
+ import * as Effect from "effect/Effect";
2
+ import { KNOWLEDGE_MANIFEST_FILENAME, KNOWLEDGE_SOURCE_DIR, } from "@agentxm/extension-model/unstable/knowledge";
3
+ import {} from "../../../knowledge/index.js";
4
+ const makeDiagnosticRule = (definition) => {
5
+ const ruleId = `knowledge/${definition.code}`;
6
+ return {
7
+ id: ruleId,
8
+ description: `Knowledge packages satisfy the ${definition.code} diagnostic invariant.`,
9
+ kind: "advisory",
10
+ severity: definition.severity,
11
+ check: (context) => {
12
+ const diagnostics = context.subject.inspection?.diagnostics ?? [];
13
+ const findings = diagnostics
14
+ .filter((diagnostic) => diagnostic.code === definition.code)
15
+ .map((diagnostic) => ({
16
+ kind: "advisory",
17
+ ruleId,
18
+ severity: definition.severity,
19
+ message: diagnostic.message,
20
+ location: {
21
+ file: diagnostic.code === "missing-manifest-description"
22
+ ? KNOWLEDGE_MANIFEST_FILENAME
23
+ : diagnostic.relativePath === "."
24
+ ? KNOWLEDGE_SOURCE_DIR
25
+ : `${KNOWLEDGE_SOURCE_DIR}/${diagnostic.relativePath}`,
26
+ ...(diagnostic.line === undefined ? {} : { line: diagnostic.line }),
27
+ ...(diagnostic.column === undefined ? {} : { column: diagnostic.column }),
28
+ },
29
+ }));
30
+ return Effect.succeed(findings);
31
+ },
32
+ };
33
+ };
34
+ export const knowledgeDiagnosticRuleDefinitions = [
35
+ { code: "bundle-too-large", severity: "error" },
36
+ { code: "file-too-large", severity: "error" },
37
+ { code: "invalid-tags", severity: "error" },
38
+ { code: "missing-root-index", severity: "error" },
39
+ { code: "missing-okf-version", severity: "error" },
40
+ { code: "missing-title", severity: "warning" },
41
+ { code: "missing-description", severity: "warning" },
42
+ { code: "missing-manifest-description", severity: "warning" },
43
+ { code: "empty-bundle", severity: "warning" },
44
+ { code: "missing-tags", severity: "warning" },
45
+ { code: "symbolic-link", severity: "error" },
46
+ { code: "too-many-files", severity: "error" },
47
+ { code: "unsupported-okf-version", severity: "error" },
48
+ { code: "missing-type", severity: "error" },
49
+ { code: "invalid-frontmatter", severity: "error" },
50
+ { code: "case-collision", severity: "error" },
51
+ { code: "dangerous-uri", severity: "error" },
52
+ { code: "detected-secret", severity: "error" },
53
+ { code: "unsafe-path", severity: "error" },
54
+ { code: "invalid-index", severity: "error" },
55
+ { code: "invalid-log", severity: "error" },
56
+ { code: "invalid-resource", severity: "error" },
57
+ { code: "escaping-resource", severity: "error" },
58
+ { code: "unresolved-resource", severity: "warning" },
59
+ { code: "broken-internal-link", severity: "warning" },
60
+ { code: "escaping-link", severity: "warning" },
61
+ { code: "unreachable-concept", severity: "warning" },
62
+ { code: "missing-index-entry", severity: "warning" },
63
+ { code: "stale-index-entry", severity: "warning" },
64
+ { code: "embedded-html", severity: "warning" },
65
+ { code: "duplicate-resource", severity: "warning" },
66
+ { code: "inconsistent-type", severity: "warning" },
67
+ { code: "large-concept", severity: "warning" },
68
+ { code: "large-index", severity: "warning" },
69
+ { code: "unreferenced-asset", severity: "warning" },
70
+ { code: "invalid-sources", severity: "error" },
71
+ { code: "invalid-generated", severity: "error" },
72
+ { code: "invalid-verified", severity: "error" },
73
+ { code: "invalid-status", severity: "error" },
74
+ { code: "invalid-stale-after", severity: "error" },
75
+ { code: "invalid-attestation", severity: "error" },
76
+ ];
77
+ export const knowledgeDiagnosticRules = knowledgeDiagnosticRuleDefinitions.map(makeDiagnosticRule);
78
+ //# sourceMappingURL=diagnostics.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `knowledge/*` manifest envelope — see `../shared/envelope-rules.ts`.
3
+ */
4
+ import type { KnowledgeRuleContext } from "../../context.js";
5
+ export declare const knowledgeEnvelopeRules: import("../shared/envelope-rules.js").ManifestEnvelopeRules<KnowledgeRuleContext<import("../../context.js").KnowledgeContent>>;
6
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `knowledge/*` manifest envelope — see `../shared/envelope-rules.ts`.
3
+ */
4
+ import { KnowledgeManifestSchema, KNOWLEDGE_MANIFEST_FILENAME, } from "@agentxm/extension-model/unstable/knowledge/manifest-schema";
5
+ import { makeManifestEnvelopeRules } from "../shared/envelope-rules.js";
6
+ export const knowledgeEnvelopeRules = makeManifestEnvelopeRules({
7
+ namespace: "knowledge",
8
+ manifestFile: KNOWLEDGE_MANIFEST_FILENAME,
9
+ schema: KnowledgeManifestSchema,
10
+ manifestJson: (context) => context.subject.knowledgeJson,
11
+ presentDescription: "Knowledge bundles include a root knowledge.json manifest.",
12
+ presentMissingMessage: "knowledge.json is missing. Create knowledge.json with the required manifest fields (`owner`, `type`, `name`, `version`, `format`, `bundleRoot`).",
13
+ schemaDescription: "knowledge.json defines a valid knowledge manifest.",
14
+ });
15
+ //# sourceMappingURL=envelope.js.map
@@ -0,0 +1,11 @@
1
+ import type { KnowledgeRuleContext } from "../context.js";
2
+ import type { LintRule } from "../rule.js";
3
+ /**
4
+ * Publish-safe `knowledge/*` catalog: the manifest envelope rules only. The
5
+ * publish gate validates OKF bundle content through package validation, so
6
+ * the inspection-backed diagnostic rules do not run there.
7
+ */
8
+ export declare const publishKnowledgeRules: ReadonlyArray<LintRule<KnowledgeRuleContext>>;
9
+ export declare const knowledgeRules: ReadonlyArray<LintRule<KnowledgeRuleContext>>;
10
+ export { knowledgeDiagnosticRuleDefinitions, knowledgeDiagnosticRules, } from "./knowledge/diagnostics.js";
11
+ //# sourceMappingURL=knowledge.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { knowledgeEnvelopeRules } from "./knowledge/envelope.js";
2
+ import { orderedEnvelopeRules } from "./shared/envelope-rules.js";
3
+ import { knowledgeDiagnosticRules } from "./knowledge/diagnostics.js";
4
+ /**
5
+ * Publish-safe `knowledge/*` catalog: the manifest envelope rules only. The
6
+ * publish gate validates OKF bundle content through package validation, so
7
+ * the inspection-backed diagnostic rules do not run there.
8
+ */
9
+ export const publishKnowledgeRules = orderedEnvelopeRules(knowledgeEnvelopeRules);
10
+ export const knowledgeRules = [
11
+ ...publishKnowledgeRules,
12
+ ...knowledgeDiagnosticRules,
13
+ ];
14
+ export { knowledgeDiagnosticRuleDefinitions, knowledgeDiagnosticRules, } from "./knowledge/diagnostics.js";
15
+ //# sourceMappingURL=knowledge.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `mcp-server/*` manifest envelope — see `../shared/envelope-rules.ts`.
3
+ */
4
+ import type { McpServerRuleContext } from "../../context.js";
5
+ export declare const mcpServerEnvelopeRules: import("../shared/envelope-rules.js").ManifestEnvelopeRules<McpServerRuleContext<import("../../context.js").McpServerContent>>;
6
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `mcp-server/*` manifest envelope — see `../shared/envelope-rules.ts`.
3
+ */
4
+ import { McpServerManifestSchema, MCP_SERVER_MANIFEST_FILENAME, } from "@agentxm/extension-model/unstable/mcps/manifest-schema";
5
+ import { makeManifestEnvelopeRules } from "../shared/envelope-rules.js";
6
+ export const mcpServerEnvelopeRules = makeManifestEnvelopeRules({
7
+ namespace: "mcp-server",
8
+ manifestFile: MCP_SERVER_MANIFEST_FILENAME,
9
+ schema: McpServerManifestSchema,
10
+ manifestJson: (context) => context.subject.mcpServerJson,
11
+ presentDescription: "MCP servers include a root mcp.json manifest.",
12
+ presentMissingMessage: "mcp.json is missing. Create mcp.json with the required manifest fields (`owner`, `type`, `name`, `version`).",
13
+ schemaDescription: "mcp.json defines a valid MCP server manifest.",
14
+ });
15
+ //# sourceMappingURL=envelope.js.map