@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.
- package/LICENSE +110 -0
- package/README.md +13 -0
- package/dist/src/unstable/content/agent-skills-standard.d.ts +17 -0
- package/dist/src/unstable/content/agent-skills-standard.js +24 -0
- package/dist/src/unstable/content/frontmatter.d.ts +52 -0
- package/dist/src/unstable/content/frontmatter.js +115 -0
- package/dist/src/unstable/content/index.d.ts +11 -0
- package/dist/src/unstable/content/index.js +11 -0
- package/dist/src/unstable/content/skill-content.d.ts +43 -0
- package/dist/src/unstable/content/skill-content.js +184 -0
- package/dist/src/unstable/content/skill-types.d.ts +22 -0
- package/dist/src/unstable/content/skill-types.js +9 -0
- package/dist/src/unstable/content/subagent-content.d.ts +58 -0
- package/dist/src/unstable/content/subagent-content.js +101 -0
- package/dist/src/unstable/knowledge/index.d.ts +8 -0
- package/dist/src/unstable/knowledge/index.js +8 -0
- package/dist/src/unstable/knowledge/knowledge-search.d.ts +32 -0
- package/dist/src/unstable/knowledge/knowledge-search.js +147 -0
- package/dist/src/unstable/knowledge/okf.d.ts +86 -0
- package/dist/src/unstable/knowledge/okf.js +1090 -0
- package/dist/src/unstable/lint/catalog/hook/decision-portability.d.ts +4 -0
- package/dist/src/unstable/lint/catalog/hook/decision-portability.js +40 -0
- package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.d.ts +4 -0
- package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.js +39 -0
- package/dist/src/unstable/lint/catalog/hook/envelope.d.ts +6 -0
- package/dist/src/unstable/lint/catalog/hook/envelope.js +15 -0
- package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.d.ts +4 -0
- package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.js +51 -0
- package/dist/src/unstable/lint/catalog/hook.d.ts +4 -0
- package/dist/src/unstable/lint/catalog/hook.js +17 -0
- package/dist/src/unstable/lint/catalog/knowledge/diagnostics.d.ts +128 -0
- package/dist/src/unstable/lint/catalog/knowledge/diagnostics.js +78 -0
- package/dist/src/unstable/lint/catalog/knowledge/envelope.d.ts +6 -0
- package/dist/src/unstable/lint/catalog/knowledge/envelope.js +15 -0
- package/dist/src/unstable/lint/catalog/knowledge.d.ts +5 -0
- package/dist/src/unstable/lint/catalog/knowledge.js +11 -0
- package/dist/src/unstable/lint/catalog/mcp-server/envelope.d.ts +6 -0
- package/dist/src/unstable/lint/catalog/mcp-server/envelope.js +15 -0
- package/dist/src/unstable/lint/catalog/mcp-server.d.ts +4 -0
- package/dist/src/unstable/lint/catalog/mcp-server.js +6 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts +28 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js +38 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts +17 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-present.js +24 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts +25 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js +33 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts +51 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js +45 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts +60 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/vft.js +85 -0
- package/dist/src/unstable/lint/catalog/pack.d.ts +37 -0
- package/dist/src/unstable/lint/catalog/pack.js +47 -0
- package/dist/src/unstable/lint/catalog/rule/envelope.d.ts +6 -0
- package/dist/src/unstable/lint/catalog/rule/envelope.js +15 -0
- package/dist/src/unstable/lint/catalog/rule.d.ts +4 -0
- package/dist/src/unstable/lint/catalog/rule.js +6 -0
- package/dist/src/unstable/lint/catalog/shared/envelope-rules.d.ts +93 -0
- package/dist/src/unstable/lint/catalog/shared/envelope-rules.js +89 -0
- package/dist/src/unstable/lint/catalog/shared/manifest-json.d.ts +18 -0
- package/dist/src/unstable/lint/catalog/shared/manifest-json.js +28 -0
- package/dist/src/unstable/lint/catalog/shared/manifest-present.d.ts +25 -0
- package/dist/src/unstable/lint/catalog/shared/manifest-present.js +37 -0
- package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.d.ts +70 -0
- package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.js +139 -0
- package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts +58 -0
- package/dist/src/unstable/lint/catalog/shared/schema-rule.js +103 -0
- package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts +31 -0
- package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js +148 -0
- package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.d.ts +13 -0
- package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.js +61 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts +26 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js +41 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts +23 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-present.js +32 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts +21 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js +36 -0
- package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.d.ts +8 -0
- package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.js +12 -0
- package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts +17 -0
- package/dist/src/unstable/lint/catalog/skill/skill-md-present.js +37 -0
- package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.d.ts +8 -0
- package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.js +12 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts +61 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js +55 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts +77 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/vft.js +135 -0
- package/dist/src/unstable/lint/catalog/skill.d.ts +44 -0
- package/dist/src/unstable/lint/catalog/skill.js +64 -0
- package/dist/src/unstable/lint/catalog/subagent/envelope.d.ts +6 -0
- package/dist/src/unstable/lint/catalog/subagent/envelope.js +15 -0
- package/dist/src/unstable/lint/catalog/subagent.d.ts +4 -0
- package/dist/src/unstable/lint/catalog/subagent.js +6 -0
- package/dist/src/unstable/lint/compose-path.d.ts +28 -0
- package/dist/src/unstable/lint/compose-path.js +64 -0
- package/dist/src/unstable/lint/config.d.ts +103 -0
- package/dist/src/unstable/lint/config.js +140 -0
- package/dist/src/unstable/lint/context.d.ts +246 -0
- package/dist/src/unstable/lint/context.js +21 -0
- package/dist/src/unstable/lint/describe-document.d.ts +31 -0
- package/dist/src/unstable/lint/describe-document.js +50 -0
- package/dist/src/unstable/lint/evaluate.d.ts +47 -0
- package/dist/src/unstable/lint/evaluate.js +82 -0
- package/dist/src/unstable/lint/issues-to-findings.d.ts +35 -0
- package/dist/src/unstable/lint/issues-to-findings.js +149 -0
- package/dist/src/unstable/lint/publish.d.ts +49 -0
- package/dist/src/unstable/lint/publish.js +86 -0
- package/dist/src/unstable/lint/rule.d.ts +98 -0
- package/dist/src/unstable/lint/rule.js +18 -0
- package/dist/src/unstable/publish/archive-guardrails.d.ts +39 -0
- package/dist/src/unstable/publish/archive-guardrails.js +250 -0
- package/dist/src/unstable/publish/filtered-package-validation.d.ts +24 -0
- package/dist/src/unstable/publish/filtered-package-validation.js +117 -0
- package/dist/src/unstable/publish/index.d.ts +12 -0
- package/dist/src/unstable/publish/index.js +12 -0
- package/dist/src/unstable/publish/ingest-limits.d.ts +25 -0
- package/dist/src/unstable/publish/ingest-limits.js +41 -0
- package/dist/src/unstable/publish/input-normalization.d.ts +40 -0
- package/dist/src/unstable/publish/input-normalization.js +125 -0
- package/dist/src/unstable/publish/manifest-policy.d.ts +611 -0
- package/dist/src/unstable/publish/manifest-policy.js +196 -0
- package/dist/src/unstable/publish/test-zip-helpers.d.ts +13 -0
- package/dist/src/unstable/publish/test-zip-helpers.js +117 -0
- package/dist/src/unstable/publish/visibility.d.ts +161 -0
- package/dist/src/unstable/publish/visibility.js +124 -0
- package/dist/src/unstable/registry/discover-schema.d.ts +68 -0
- package/dist/src/unstable/registry/discover-schema.js +35 -0
- package/dist/src/unstable/registry/index.d.ts +9 -0
- package/dist/src/unstable/registry/index.js +9 -0
- package/dist/src/unstable/registry/publication-set.d.ts +303 -0
- package/dist/src/unstable/registry/publication-set.js +507 -0
- package/dist/src/unstable/registry/release-age-policy.d.ts +57 -0
- package/dist/src/unstable/registry/release-age-policy.js +117 -0
- package/dist/src/unstable/registry/schema.d.ts +220 -0
- package/dist/src/unstable/registry/schema.js +114 -0
- package/dist/src/unstable/suggested-action.d.ts +19 -0
- package/dist/src/unstable/suggested-action.js +42 -0
- package/package.json +214 -0
|
@@ -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,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,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,17 @@
|
|
|
1
|
+
import { registerLintRuleIds } from "../config.js";
|
|
2
|
+
import { entrypointExistsRule } from "./hook/entrypoint-exists.js";
|
|
3
|
+
import { decisionPortabilityRule } from "./hook/decision-portability.js";
|
|
4
|
+
import { hookEnvelopeRules } from "./hook/envelope.js";
|
|
5
|
+
import { matcherRawPortabilityRule } from "./hook/matcher-raw-portability.js";
|
|
6
|
+
export const hookRules = [
|
|
7
|
+
hookEnvelopeRules.manifestPresent,
|
|
8
|
+
hookEnvelopeRules.manifestSchemaValid,
|
|
9
|
+
hookEnvelopeRules.manifestKeysRecognized,
|
|
10
|
+
decisionPortabilityRule,
|
|
11
|
+
matcherRawPortabilityRule,
|
|
12
|
+
entrypointExistsRule,
|
|
13
|
+
hookEnvelopeRules.standaloneDeclarationValid,
|
|
14
|
+
hookEnvelopeRules.recommendedPacksValid,
|
|
15
|
+
];
|
|
16
|
+
registerLintRuleIds(hookRules.map((r) => r.id));
|
|
17
|
+
//# 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,5 @@
|
|
|
1
|
+
import type { KnowledgeRuleContext } from "../context.js";
|
|
2
|
+
import type { LintRule } from "../rule.js";
|
|
3
|
+
export declare const knowledgeRules: ReadonlyArray<LintRule<KnowledgeRuleContext>>;
|
|
4
|
+
export { knowledgeDiagnosticRuleDefinitions, knowledgeDiagnosticRules, } from "./knowledge/diagnostics.js";
|
|
5
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { registerLintRuleIds } from "../config.js";
|
|
2
|
+
import { knowledgeEnvelopeRules } from "./knowledge/envelope.js";
|
|
3
|
+
import { orderedEnvelopeRules } from "./shared/envelope-rules.js";
|
|
4
|
+
import { knowledgeDiagnosticRules } from "./knowledge/diagnostics.js";
|
|
5
|
+
export const knowledgeRules = [
|
|
6
|
+
...orderedEnvelopeRules(knowledgeEnvelopeRules),
|
|
7
|
+
...knowledgeDiagnosticRules,
|
|
8
|
+
];
|
|
9
|
+
export { knowledgeDiagnosticRuleDefinitions, knowledgeDiagnosticRules, } from "./knowledge/diagnostics.js";
|
|
10
|
+
registerLintRuleIds(knowledgeRules.map((r) => r.id));
|
|
11
|
+
//# 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
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { registerLintRuleIds } from "../config.js";
|
|
2
|
+
import { mcpServerEnvelopeRules } from "./mcp-server/envelope.js";
|
|
3
|
+
import { orderedEnvelopeRules } from "./shared/envelope-rules.js";
|
|
4
|
+
export const mcpServerRules = orderedEnvelopeRules(mcpServerEnvelopeRules);
|
|
5
|
+
registerLintRuleIds(mcpServerRules.map((r) => r.id));
|
|
6
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pack/manifest-keys-recognized` — `pack.json` contains only keys
|
|
3
|
+
* declared by `PackManifestSchema`.
|
|
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
|
+
* A forbidden `packs:` dependency section (ONTOLOGY D015 "Cross-Domain
|
|
10
|
+
* Pack Semantics") decodes as an unrecognized top-level key here
|
|
11
|
+
* and surfaces at error severity here.
|
|
12
|
+
*
|
|
13
|
+
* Allowed-keys set is derived from `PackManifestSchema.fields` — no
|
|
14
|
+
* copy-paste of field names. A schema gain (or rename) automatically updates
|
|
15
|
+
* the allowlist.
|
|
16
|
+
*
|
|
17
|
+
* Early-return arm (no findings):
|
|
18
|
+
*
|
|
19
|
+
* - `subject.packJson === undefined` / non-object — nothing to enumerate;
|
|
20
|
+
* `pack/manifest-present` owns the absence case.
|
|
21
|
+
*
|
|
22
|
+
* @experimental This API is unstable and may change without notice.
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
25
|
+
import type { PackRuleContext } from "../../context.js";
|
|
26
|
+
import type { AdvisoryRule } from "../../rule.js";
|
|
27
|
+
export declare const manifestKeysRecognizedRule: AdvisoryRule<PackRuleContext>;
|
|
28
|
+
//# sourceMappingURL=manifest-keys-recognized.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pack/manifest-keys-recognized` — `pack.json` contains only keys
|
|
3
|
+
* declared by `PackManifestSchema`.
|
|
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
|
+
* A forbidden `packs:` dependency section (ONTOLOGY D015 "Cross-Domain
|
|
10
|
+
* Pack Semantics") decodes as an unrecognized top-level key here
|
|
11
|
+
* and surfaces at error severity here.
|
|
12
|
+
*
|
|
13
|
+
* Allowed-keys set is derived from `PackManifestSchema.fields` — no
|
|
14
|
+
* copy-paste of field names. A schema gain (or rename) automatically updates
|
|
15
|
+
* the allowlist.
|
|
16
|
+
*
|
|
17
|
+
* Early-return arm (no findings):
|
|
18
|
+
*
|
|
19
|
+
* - `subject.packJson === undefined` / non-object — nothing to enumerate;
|
|
20
|
+
* `pack/manifest-present` owns the absence case.
|
|
21
|
+
*
|
|
22
|
+
* @experimental This API is unstable and may change without notice.
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
25
|
+
import * as Effect from "effect/Effect";
|
|
26
|
+
import { PackManifestSchema } from "@agentxm/extension-model/unstable/packs/manifest-schema";
|
|
27
|
+
import { enumerateUnknownTopLevelKeys, structFieldKeys } from "../shared/schema-rule.js";
|
|
28
|
+
const RULE_ID = "pack/manifest-keys-recognized";
|
|
29
|
+
const PACK_JSON = "pack.json";
|
|
30
|
+
const allowedKeys = structFieldKeys(PackManifestSchema);
|
|
31
|
+
export const manifestKeysRecognizedRule = {
|
|
32
|
+
id: RULE_ID,
|
|
33
|
+
description: "pack.json uses only supported top-level fields.",
|
|
34
|
+
kind: "advisory",
|
|
35
|
+
severity: "error",
|
|
36
|
+
check: (context) => Effect.succeed(enumerateUnknownTopLevelKeys(RULE_ID, "error", PACK_JSON, allowedKeys, context.subject.packJson)),
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=manifest-keys-recognized.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pack/manifest-present` — packs must have a `pack.json` at the
|
|
3
|
+
* pack root.
|
|
4
|
+
*
|
|
5
|
+
* Packs are registry-only at v1; every pack context is expected to expose a
|
|
6
|
+
* manifest. Unlike `skill/manifest-present`, there is no native-vs-non-native
|
|
7
|
+
* split — the rule applies to every pack context unconditionally.
|
|
8
|
+
*
|
|
9
|
+
* Advisory-only — scaffolding a manifest is `axm packs new` (a user-authored
|
|
10
|
+
* action) per the lint design.
|
|
11
|
+
*
|
|
12
|
+
* @experimental This API is unstable and may change without notice.
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
import type { PackRuleContext } from "../../context.js";
|
|
16
|
+
export declare const manifestPresentRule: import("../../rule.ts").AdvisoryRule<PackRuleContext<import("../../context.js").PackContent>>;
|
|
17
|
+
//# sourceMappingURL=manifest-present.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pack/manifest-present` — packs must have a `pack.json` at the
|
|
3
|
+
* pack root.
|
|
4
|
+
*
|
|
5
|
+
* Packs are registry-only at v1; every pack context is expected to expose a
|
|
6
|
+
* manifest. Unlike `skill/manifest-present`, there is no native-vs-non-native
|
|
7
|
+
* split — the rule applies to every pack context unconditionally.
|
|
8
|
+
*
|
|
9
|
+
* Advisory-only — scaffolding a manifest is `axm packs new` (a user-authored
|
|
10
|
+
* action) per the lint design.
|
|
11
|
+
*
|
|
12
|
+
* @experimental This API is unstable and may change without notice.
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
import { makeManifestPresentRule } from "../shared/manifest-present.js";
|
|
16
|
+
const RULE_ID = "pack/manifest-present";
|
|
17
|
+
const PACK_JSON = "pack.json";
|
|
18
|
+
export const manifestPresentRule = makeManifestPresentRule({
|
|
19
|
+
ruleId: RULE_ID,
|
|
20
|
+
description: "Packs include a root pack.json manifest.",
|
|
21
|
+
manifestFile: PACK_JSON,
|
|
22
|
+
missingMessage: "pack.json is missing. Create pack.json with the required manifest fields (`owner`, `type`, `name`, `version`).",
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=manifest-present.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pack/manifest-schema-valid` — `pack.json` conforms to
|
|
3
|
+
* `PackManifestSchema`.
|
|
4
|
+
*
|
|
5
|
+
* Delegates to Effect Schema. Issues map 1:1 to findings via
|
|
6
|
+
* `issuesToFindings`.
|
|
7
|
+
*
|
|
8
|
+
* Early-return arm (no findings):
|
|
9
|
+
*
|
|
10
|
+
* - `subject.packJson === undefined` — manifest is absent (covered by
|
|
11
|
+
* `pack/manifest-present`).
|
|
12
|
+
*
|
|
13
|
+
* Dependency-map FQN grammar and `VersionRange` decode arms are owned by
|
|
14
|
+
* `PackManifestSchema` itself — the dependency sections are typed
|
|
15
|
+
* `Record<FQN, VersionRange>` so unknown FQNs, malformed grammar, and
|
|
16
|
+
* bad semver ranges surface as normal schema issues through the shared
|
|
17
|
+
* `schemaDecodeFindings` plumbing.
|
|
18
|
+
*
|
|
19
|
+
* @experimental This API is unstable and may change without notice.
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
22
|
+
import type { PackRuleContext } from "../../context.js";
|
|
23
|
+
import type { AdvisoryRule } from "../../rule.js";
|
|
24
|
+
export declare const manifestSchemaValidRule: AdvisoryRule<PackRuleContext>;
|
|
25
|
+
//# sourceMappingURL=manifest-schema-valid.d.ts.map
|