@agentxm/extension-model 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 +17 -0
- package/dist/src/unstable/agent-capabilities/catalog.d.ts +47000 -0
- package/dist/src/unstable/agent-capabilities/catalog.js +172 -0
- package/dist/src/unstable/agent-capabilities/data/agents/adal.d.ts +162 -0
- package/dist/src/unstable/agent-capabilities/data/agents/adal.js +134 -0
- package/dist/src/unstable/agent-capabilities/data/agents/aider-desk.d.ts +167 -0
- package/dist/src/unstable/agent-capabilities/data/agents/aider-desk.js +133 -0
- package/dist/src/unstable/agent-capabilities/data/agents/amp.d.ts +203 -0
- package/dist/src/unstable/agent-capabilities/data/agents/amp.js +187 -0
- package/dist/src/unstable/agent-capabilities/data/agents/antigravity-cli.d.ts +186 -0
- package/dist/src/unstable/agent-capabilities/data/agents/antigravity-cli.js +140 -0
- package/dist/src/unstable/agent-capabilities/data/agents/antigravity.d.ts +357 -0
- package/dist/src/unstable/agent-capabilities/data/agents/antigravity.js +294 -0
- package/dist/src/unstable/agent-capabilities/data/agents/augment.d.ts +383 -0
- package/dist/src/unstable/agent-capabilities/data/agents/augment.js +329 -0
- package/dist/src/unstable/agent-capabilities/data/agents/chatgpt.d.ts +159 -0
- package/dist/src/unstable/agent-capabilities/data/agents/chatgpt.js +117 -0
- package/dist/src/unstable/agent-capabilities/data/agents/claude-ai.d.ts +153 -0
- package/dist/src/unstable/agent-capabilities/data/agents/claude-ai.js +105 -0
- package/dist/src/unstable/agent-capabilities/data/agents/claude-code.d.ts +460 -0
- package/dist/src/unstable/agent-capabilities/data/agents/claude-code.js +406 -0
- package/dist/src/unstable/agent-capabilities/data/agents/cline.d.ts +225 -0
- package/dist/src/unstable/agent-capabilities/data/agents/cline.js +190 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codearts-agent.d.ts +246 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codearts-agent.js +206 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codebuddy.d.ts +420 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codebuddy.js +378 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codemaker.d.ts +143 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codemaker.js +112 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codestudio.d.ts +165 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codestudio.js +136 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codex.d.ts +458 -0
- package/dist/src/unstable/agent-capabilities/data/agents/codex.js +399 -0
- package/dist/src/unstable/agent-capabilities/data/agents/command-code.d.ts +247 -0
- package/dist/src/unstable/agent-capabilities/data/agents/command-code.js +222 -0
- package/dist/src/unstable/agent-capabilities/data/agents/continue.d.ts +322 -0
- package/dist/src/unstable/agent-capabilities/data/agents/continue.js +273 -0
- package/dist/src/unstable/agent-capabilities/data/agents/cortex.d.ts +306 -0
- package/dist/src/unstable/agent-capabilities/data/agents/cortex.js +241 -0
- package/dist/src/unstable/agent-capabilities/data/agents/cowork.d.ts +185 -0
- package/dist/src/unstable/agent-capabilities/data/agents/cowork.js +133 -0
- package/dist/src/unstable/agent-capabilities/data/agents/crush.d.ts +249 -0
- package/dist/src/unstable/agent-capabilities/data/agents/crush.js +218 -0
- package/dist/src/unstable/agent-capabilities/data/agents/cursor.d.ts +300 -0
- package/dist/src/unstable/agent-capabilities/data/agents/cursor.js +282 -0
- package/dist/src/unstable/agent-capabilities/data/agents/deepagents.d.ts +159 -0
- package/dist/src/unstable/agent-capabilities/data/agents/deepagents.js +137 -0
- package/dist/src/unstable/agent-capabilities/data/agents/devin.d.ts +410 -0
- package/dist/src/unstable/agent-capabilities/data/agents/devin.js +358 -0
- package/dist/src/unstable/agent-capabilities/data/agents/dexto.d.ts +166 -0
- package/dist/src/unstable/agent-capabilities/data/agents/dexto.js +141 -0
- package/dist/src/unstable/agent-capabilities/data/agents/droid.d.ts +318 -0
- package/dist/src/unstable/agent-capabilities/data/agents/droid.js +257 -0
- package/dist/src/unstable/agent-capabilities/data/agents/firebender.d.ts +313 -0
- package/dist/src/unstable/agent-capabilities/data/agents/firebender.js +244 -0
- package/dist/src/unstable/agent-capabilities/data/agents/forgecode.d.ts +193 -0
- package/dist/src/unstable/agent-capabilities/data/agents/forgecode.js +160 -0
- package/dist/src/unstable/agent-capabilities/data/agents/gemini-app.d.ts +153 -0
- package/dist/src/unstable/agent-capabilities/data/agents/gemini-app.js +105 -0
- package/dist/src/unstable/agent-capabilities/data/agents/gemini-cli.d.ts +424 -0
- package/dist/src/unstable/agent-capabilities/data/agents/gemini-cli.js +411 -0
- package/dist/src/unstable/agent-capabilities/data/agents/github-copilot-cli.d.ts +300 -0
- package/dist/src/unstable/agent-capabilities/data/agents/github-copilot-cli.js +307 -0
- package/dist/src/unstable/agent-capabilities/data/agents/goose.d.ts +162 -0
- package/dist/src/unstable/agent-capabilities/data/agents/goose.js +131 -0
- package/dist/src/unstable/agent-capabilities/data/agents/grok-cli.d.ts +186 -0
- package/dist/src/unstable/agent-capabilities/data/agents/grok-cli.js +164 -0
- package/dist/src/unstable/agent-capabilities/data/agents/hermes.d.ts +303 -0
- package/dist/src/unstable/agent-capabilities/data/agents/hermes.js +223 -0
- package/dist/src/unstable/agent-capabilities/data/agents/ibm-bob.d.ts +231 -0
- package/dist/src/unstable/agent-capabilities/data/agents/ibm-bob.js +200 -0
- package/dist/src/unstable/agent-capabilities/data/agents/iflow-cli.d.ts +182 -0
- package/dist/src/unstable/agent-capabilities/data/agents/iflow-cli.js +126 -0
- package/dist/src/unstable/agent-capabilities/data/agents/index.d.ts +67 -0
- package/dist/src/unstable/agent-capabilities/data/agents/index.js +67 -0
- package/dist/src/unstable/agent-capabilities/data/agents/junie.d.ts +219 -0
- package/dist/src/unstable/agent-capabilities/data/agents/junie.js +200 -0
- package/dist/src/unstable/agent-capabilities/data/agents/kilo.d.ts +282 -0
- package/dist/src/unstable/agent-capabilities/data/agents/kilo.js +260 -0
- package/dist/src/unstable/agent-capabilities/data/agents/kimi-cli.d.ts +350 -0
- package/dist/src/unstable/agent-capabilities/data/agents/kimi-cli.js +274 -0
- package/dist/src/unstable/agent-capabilities/data/agents/kiro-cli.d.ts +227 -0
- package/dist/src/unstable/agent-capabilities/data/agents/kiro-cli.js +197 -0
- package/dist/src/unstable/agent-capabilities/data/agents/kode.d.ts +166 -0
- package/dist/src/unstable/agent-capabilities/data/agents/kode.js +141 -0
- package/dist/src/unstable/agent-capabilities/data/agents/lingma.d.ts +185 -0
- package/dist/src/unstable/agent-capabilities/data/agents/lingma.js +149 -0
- package/dist/src/unstable/agent-capabilities/data/agents/mcpjam.d.ts +144 -0
- package/dist/src/unstable/agent-capabilities/data/agents/mcpjam.js +116 -0
- package/dist/src/unstable/agent-capabilities/data/agents/minimax-code.d.ts +138 -0
- package/dist/src/unstable/agent-capabilities/data/agents/minimax-code.js +93 -0
- package/dist/src/unstable/agent-capabilities/data/agents/mistral-vibe.d.ts +244 -0
- package/dist/src/unstable/agent-capabilities/data/agents/mistral-vibe.js +200 -0
- package/dist/src/unstable/agent-capabilities/data/agents/mux.d.ts +155 -0
- package/dist/src/unstable/agent-capabilities/data/agents/mux.js +127 -0
- package/dist/src/unstable/agent-capabilities/data/agents/neovate.d.ts +211 -0
- package/dist/src/unstable/agent-capabilities/data/agents/neovate.js +178 -0
- package/dist/src/unstable/agent-capabilities/data/agents/ona.d.ts +167 -0
- package/dist/src/unstable/agent-capabilities/data/agents/ona.js +110 -0
- package/dist/src/unstable/agent-capabilities/data/agents/openclaw.d.ts +139 -0
- package/dist/src/unstable/agent-capabilities/data/agents/openclaw.js +114 -0
- package/dist/src/unstable/agent-capabilities/data/agents/opencode.d.ts +220 -0
- package/dist/src/unstable/agent-capabilities/data/agents/opencode.js +192 -0
- package/dist/src/unstable/agent-capabilities/data/agents/openhands.d.ts +245 -0
- package/dist/src/unstable/agent-capabilities/data/agents/openhands.js +184 -0
- package/dist/src/unstable/agent-capabilities/data/agents/pi.d.ts +185 -0
- package/dist/src/unstable/agent-capabilities/data/agents/pi.js +169 -0
- package/dist/src/unstable/agent-capabilities/data/agents/pochi.d.ts +199 -0
- package/dist/src/unstable/agent-capabilities/data/agents/pochi.js +163 -0
- package/dist/src/unstable/agent-capabilities/data/agents/qoder-cn.d.ts +199 -0
- package/dist/src/unstable/agent-capabilities/data/agents/qoder-cn.js +141 -0
- package/dist/src/unstable/agent-capabilities/data/agents/qoder.d.ts +414 -0
- package/dist/src/unstable/agent-capabilities/data/agents/qoder.js +378 -0
- package/dist/src/unstable/agent-capabilities/data/agents/qwen-code.d.ts +406 -0
- package/dist/src/unstable/agent-capabilities/data/agents/qwen-code.js +345 -0
- package/dist/src/unstable/agent-capabilities/data/agents/replit.d.ts +144 -0
- package/dist/src/unstable/agent-capabilities/data/agents/replit.js +116 -0
- package/dist/src/unstable/agent-capabilities/data/agents/roo.d.ts +192 -0
- package/dist/src/unstable/agent-capabilities/data/agents/roo.js +180 -0
- package/dist/src/unstable/agent-capabilities/data/agents/rovodev.d.ts +189 -0
- package/dist/src/unstable/agent-capabilities/data/agents/rovodev.js +156 -0
- package/dist/src/unstable/agent-capabilities/data/agents/tabnine-cli.d.ts +280 -0
- package/dist/src/unstable/agent-capabilities/data/agents/tabnine-cli.js +223 -0
- package/dist/src/unstable/agent-capabilities/data/agents/trae-cn.d.ts +188 -0
- package/dist/src/unstable/agent-capabilities/data/agents/trae-cn.js +156 -0
- package/dist/src/unstable/agent-capabilities/data/agents/trae.d.ts +188 -0
- package/dist/src/unstable/agent-capabilities/data/agents/trae.js +156 -0
- package/dist/src/unstable/agent-capabilities/data/agents/warp.d.ts +169 -0
- package/dist/src/unstable/agent-capabilities/data/agents/warp.js +133 -0
- package/dist/src/unstable/agent-capabilities/data/agents/windsurf.d.ts +414 -0
- package/dist/src/unstable/agent-capabilities/data/agents/windsurf.js +326 -0
- package/dist/src/unstable/agent-capabilities/data/agents/zed.d.ts +168 -0
- package/dist/src/unstable/agent-capabilities/data/agents/zed.js +109 -0
- package/dist/src/unstable/agent-capabilities/data/agents/zencoder.d.ts +168 -0
- package/dist/src/unstable/agent-capabilities/data/agents/zencoder.js +137 -0
- package/dist/src/unstable/agent-capabilities/data/agents/zenflow.d.ts +153 -0
- package/dist/src/unstable/agent-capabilities/data/agents/zenflow.js +96 -0
- package/dist/src/unstable/agent-capabilities/derive.d.ts +129 -0
- package/dist/src/unstable/agent-capabilities/derive.js +389 -0
- package/dist/src/unstable/agent-capabilities/index.d.ts +15 -0
- package/dist/src/unstable/agent-capabilities/index.js +15 -0
- package/dist/src/unstable/agent-capabilities/lookup.d.ts +10 -0
- package/dist/src/unstable/agent-capabilities/lookup.js +9 -0
- package/dist/src/unstable/agent-capabilities/schema.d.ts +3788 -0
- package/dist/src/unstable/agent-capabilities/schema.js +1218 -0
- package/dist/src/unstable/agent-capabilities/verification.d.ts +25 -0
- package/dist/src/unstable/agent-capabilities/verification.js +40 -0
- package/dist/src/unstable/agents/registry.d.ts +33 -0
- package/dist/src/unstable/agents/registry.js +50 -0
- package/dist/src/unstable/agents/types.d.ts +126 -0
- package/dist/src/unstable/agents/types.js +17 -0
- package/dist/src/unstable/date-time.d.ts +17 -0
- package/dist/src/unstable/date-time.js +30 -0
- package/dist/src/unstable/discovery-walk.d.ts +8 -0
- package/dist/src/unstable/discovery-walk.js +15 -0
- package/dist/src/unstable/extension-types/index.d.ts +8 -0
- package/dist/src/unstable/extension-types/index.js +8 -0
- package/dist/src/unstable/extension-types/schema.d.ts +154 -0
- package/dist/src/unstable/extension-types/schema.js +102 -0
- package/dist/src/unstable/extension-types/standards.d.ts +29 -0
- package/dist/src/unstable/extension-types/standards.js +29 -0
- package/dist/src/unstable/extensions/common.d.ts +539 -0
- package/dist/src/unstable/extensions/common.js +605 -0
- package/dist/src/unstable/extensions/deprecation.d.ts +42 -0
- package/dist/src/unstable/extensions/deprecation.js +46 -0
- package/dist/src/unstable/extensions/fqn-pattern.d.ts +17 -0
- package/dist/src/unstable/extensions/fqn-pattern.js +63 -0
- package/dist/src/unstable/extensions/fqn.d.ts +51 -0
- package/dist/src/unstable/extensions/fqn.js +51 -0
- package/dist/src/unstable/extensions/handle.d.ts +16 -0
- package/dist/src/unstable/extensions/handle.js +30 -0
- package/dist/src/unstable/extensions/index.d.ts +13 -0
- package/dist/src/unstable/extensions/index.js +13 -0
- package/dist/src/unstable/extensions/installable-types.d.ts +12 -0
- package/dist/src/unstable/extensions/installable-types.js +21 -0
- package/dist/src/unstable/extensions/license.d.ts +16 -0
- package/dist/src/unstable/extensions/license.js +29 -0
- package/dist/src/unstable/extensions/manifest-metadata.d.ts +18 -0
- package/dist/src/unstable/extensions/manifest-metadata.js +61 -0
- package/dist/src/unstable/extensions/refs/extension-ref.d.ts +20 -0
- package/dist/src/unstable/extensions/refs/extension-ref.js +12 -0
- package/dist/src/unstable/extensions/refs/hook.d.ts +29 -0
- package/dist/src/unstable/extensions/refs/hook.js +8 -0
- package/dist/src/unstable/extensions/refs/knowledge.d.ts +15 -0
- package/dist/src/unstable/extensions/refs/knowledge.js +2 -0
- package/dist/src/unstable/extensions/refs/mcp-server.d.ts +19 -0
- package/dist/src/unstable/extensions/refs/mcp-server.js +8 -0
- package/dist/src/unstable/extensions/refs/pack.d.ts +17 -0
- package/dist/src/unstable/extensions/refs/pack.js +10 -0
- package/dist/src/unstable/extensions/refs/ref-base.d.ts +125 -0
- package/dist/src/unstable/extensions/refs/ref-base.js +12 -0
- package/dist/src/unstable/extensions/refs/rule.d.ts +27 -0
- package/dist/src/unstable/extensions/refs/rule.js +8 -0
- package/dist/src/unstable/extensions/refs/skill.d.ts +28 -0
- package/dist/src/unstable/extensions/refs/skill.js +11 -0
- package/dist/src/unstable/extensions/refs/subagent.d.ts +19 -0
- package/dist/src/unstable/extensions/refs/subagent.js +8 -0
- package/dist/src/unstable/extensions/registry-source.d.ts +37 -0
- package/dist/src/unstable/extensions/registry-source.js +158 -0
- package/dist/src/unstable/extensions/release-age.d.ts +36 -0
- package/dist/src/unstable/extensions/release-age.js +11 -0
- package/dist/src/unstable/extensions/universal-skills-dir.d.ts +58 -0
- package/dist/src/unstable/extensions/universal-skills-dir.js +68 -0
- package/dist/src/unstable/hooks/manifest-schema.d.ts +175 -0
- package/dist/src/unstable/hooks/manifest-schema.js +112 -0
- package/dist/src/unstable/knowledge/concept-ref.d.ts +34 -0
- package/dist/src/unstable/knowledge/concept-ref.js +114 -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/manifest-schema.d.ts +60 -0
- package/dist/src/unstable/knowledge/manifest-schema.js +34 -0
- package/dist/src/unstable/mcps/manifest-schema.d.ts +899 -0
- package/dist/src/unstable/mcps/manifest-schema.js +230 -0
- package/dist/src/unstable/package-urls/companion-package.d.ts +14 -0
- package/dist/src/unstable/package-urls/companion-package.js +44 -0
- package/dist/src/unstable/package-urls/index.d.ts +4 -0
- package/dist/src/unstable/package-urls/index.js +4 -0
- package/dist/src/unstable/package-urls/internal.d.ts +6 -0
- package/dist/src/unstable/package-urls/internal.js +17 -0
- package/dist/src/unstable/package-urls/package-identity-purl.d.ts +5 -0
- package/dist/src/unstable/package-urls/package-identity-purl.js +26 -0
- package/dist/src/unstable/package-urls/vers-range.d.ts +34 -0
- package/dist/src/unstable/package-urls/vers-range.js +163 -0
- package/dist/src/unstable/packaging/index.d.ts +8 -0
- package/dist/src/unstable/packaging/index.js +8 -0
- package/dist/src/unstable/packaging/package-type.d.ts +23 -0
- package/dist/src/unstable/packaging/package-type.js +31 -0
- package/dist/src/unstable/packaging/package-url.d.ts +50 -0
- package/dist/src/unstable/packaging/package-url.js +93 -0
- package/dist/src/unstable/packs/manifest-schema.d.ts +66 -0
- package/dist/src/unstable/packs/manifest-schema.js +34 -0
- package/dist/src/unstable/path-types.d.ts +22 -0
- package/dist/src/unstable/path-types.js +48 -0
- package/dist/src/unstable/rules/manifest-schema.d.ts +70 -0
- package/dist/src/unstable/rules/manifest-schema.js +43 -0
- package/dist/src/unstable/schema-issues.d.ts +13 -0
- package/dist/src/unstable/schema-issues.js +34 -0
- package/dist/src/unstable/skills/manifest-schema.d.ts +69 -0
- package/dist/src/unstable/skills/manifest-schema.js +31 -0
- package/dist/src/unstable/sources/forge-grammar.d.ts +22 -0
- package/dist/src/unstable/sources/forge-grammar.js +50 -0
- package/dist/src/unstable/sources/parser.d.ts +85 -0
- package/dist/src/unstable/sources/parser.js +122 -0
- package/dist/src/unstable/sources/printer.d.ts +14 -0
- package/dist/src/unstable/sources/printer.js +45 -0
- package/dist/src/unstable/sources/source-hash.d.ts +24 -0
- package/dist/src/unstable/sources/source-hash.js +22 -0
- package/dist/src/unstable/sources/source-host-provider.d.ts +112 -0
- package/dist/src/unstable/sources/source-host-provider.js +11 -0
- package/dist/src/unstable/sources/types.d.ts +262 -0
- package/dist/src/unstable/sources/types.js +127 -0
- package/dist/src/unstable/sources/workspace.d.ts +13 -0
- package/dist/src/unstable/sources/workspace.js +13 -0
- package/dist/src/unstable/subagents/manifest-schema.d.ts +81 -0
- package/dist/src/unstable/subagents/manifest-schema.js +43 -0
- package/dist/src/unstable/version-constraints/version-constraints.d.ts +71 -0
- package/dist/src/unstable/version-constraints/version-constraints.js +144 -0
- package/dist/src/unstable/workspace-files.d.ts +13 -0
- package/dist/src/unstable/workspace-files.js +13 -0
- package/dist/src/unstable/workspace-scope.d.ts +11 -0
- package/dist/src/unstable/workspace-scope.js +10 -0
- package/package.json +271 -0
|
@@ -0,0 +1,1218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent capability catalog schemas.
|
|
3
|
+
*
|
|
4
|
+
* Sourcing namespaces:
|
|
5
|
+
*
|
|
6
|
+
* - `native` is the vendor-authoritative fact layer: whether the agent exposes
|
|
7
|
+
* the surface, which standard or convention it follows, where config lives,
|
|
8
|
+
* and the source URLs used to verify that claim.
|
|
9
|
+
* - `axm` is AXM integration state: whether AXM has modeled support, whether a
|
|
10
|
+
* writer exists, the writer metadata needed by AXM, and AXM-owned backlog or
|
|
11
|
+
* unsupported reasons. These fields are not vendor facts.
|
|
12
|
+
* - `canonical` is a derived, vendor-neutral vocabulary. Hook event/tool
|
|
13
|
+
* mappings store canonical IDs beside native names, but the catalog does not
|
|
14
|
+
* store a per-agent canonical capability block.
|
|
15
|
+
*
|
|
16
|
+
* Status axes:
|
|
17
|
+
*
|
|
18
|
+
* - `AgentLifecycle` describes the coding agent product itself.
|
|
19
|
+
* - `VendorStatus` describes the vendor or plugin surface named by
|
|
20
|
+
* `Availability`.
|
|
21
|
+
* - `Availability` describes whether the surface is native, plugin-backed, or
|
|
22
|
+
* absent.
|
|
23
|
+
* - AXM support/writer state lives under `axm.status` and `axm.writer`;
|
|
24
|
+
* `axm.writer !== null` means AXM has verified write mechanics for that
|
|
25
|
+
* capability.
|
|
26
|
+
*
|
|
27
|
+
* `capabilities` is keyed on the placement axis: exactly the extension types
|
|
28
|
+
* `EXTENSION_TYPE_TABLE` marks `placement: "per-agent"`, because only those
|
|
29
|
+
* render into a directory the agent owns. Two sibling fields sit beside it
|
|
30
|
+
* rather than inside it:
|
|
31
|
+
*
|
|
32
|
+
* - `instructions` carries the `rule` capability. Rules are `placement:
|
|
33
|
+
* "workspace"` — they live in shared instruction files that every configured
|
|
34
|
+
* agent reads — so the catalog records how each agent consumes that shared
|
|
35
|
+
* file, not an agent-owned slot. The field name is the type's
|
|
36
|
+
* `workspaceCapability` axis value.
|
|
37
|
+
* - `permissions` models AXM grant/write mechanics for an agent's permission
|
|
38
|
+
* system. It is not a publishable extension type at all.
|
|
39
|
+
*
|
|
40
|
+
* @experimental This API is unstable and may change without notice.
|
|
41
|
+
*/
|
|
42
|
+
import * as Effect from "effect/Effect";
|
|
43
|
+
import * as Schema from "effect/Schema";
|
|
44
|
+
import { DocLinkSchema, LeafExtensionTypeSchema, UrlSchema, } from "../extension-types/schema.js";
|
|
45
|
+
import {} from "../extensions/common.js";
|
|
46
|
+
export { DocLinkSchema, LEAF_EXTENSION_TYPES, StandardSchema, UrlSchema, } from "../extension-types/schema.js";
|
|
47
|
+
export {} from "../extensions/common.js";
|
|
48
|
+
const AGENT_ID_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
49
|
+
const ISO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
50
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
51
|
+
export const AgentIdFromYamlSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(AGENT_ID_PATTERN, {
|
|
52
|
+
message: "Expected a lowercase kebab-case agent id.",
|
|
53
|
+
}))).annotate({
|
|
54
|
+
identifier: "AgentId",
|
|
55
|
+
title: "Agent ID",
|
|
56
|
+
description: "Lowercase kebab-case coding agent identifier.",
|
|
57
|
+
examples: ["claude-code", "codex", "cursor"],
|
|
58
|
+
});
|
|
59
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
60
|
+
export const StandardsComplianceSchema = Schema.Literals([
|
|
61
|
+
"full",
|
|
62
|
+
"parity",
|
|
63
|
+
"partial",
|
|
64
|
+
"none",
|
|
65
|
+
]).annotate({
|
|
66
|
+
identifier: "StandardsCompliance",
|
|
67
|
+
title: "Standards Compliance",
|
|
68
|
+
description: "How well a spec-tracked capability's native format matches the named spec.",
|
|
69
|
+
examples: ["full", "parity", "partial"],
|
|
70
|
+
});
|
|
71
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
72
|
+
export const ConventionSchema = Schema.Literals(["universal", "vendor", "hosted"]).annotate({
|
|
73
|
+
identifier: "Convention",
|
|
74
|
+
title: "Convention",
|
|
75
|
+
description: "Whether a spec-tracked capability uses a standard, vendor-specific, or hosted location.",
|
|
76
|
+
examples: ["universal", "vendor", "hosted"],
|
|
77
|
+
});
|
|
78
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
79
|
+
export const SkillReadPathStatusSchema = Schema.Literals([
|
|
80
|
+
"canonical",
|
|
81
|
+
"compat",
|
|
82
|
+
"deprecated",
|
|
83
|
+
]).annotate({
|
|
84
|
+
identifier: "SkillReadPathStatus",
|
|
85
|
+
title: "Skill Read Path Status",
|
|
86
|
+
description: "How an additional native Skill directory relates to the agent's primary path.",
|
|
87
|
+
});
|
|
88
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
89
|
+
export const SkillReadPathSchema = Schema.Struct({
|
|
90
|
+
path: Schema.NonEmptyString,
|
|
91
|
+
status: SkillReadPathStatusSchema,
|
|
92
|
+
}).annotate({
|
|
93
|
+
identifier: "SkillReadPath",
|
|
94
|
+
title: "Skill Read Path",
|
|
95
|
+
description: "An additional directory an agent reads for Skill discovery but AXM never writes.",
|
|
96
|
+
});
|
|
97
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
98
|
+
export const ScopeSchema = Schema.Literals(["user", "project"]).annotate({
|
|
99
|
+
identifier: "Scope",
|
|
100
|
+
title: "Scope",
|
|
101
|
+
description: "Where a capability can be configured.",
|
|
102
|
+
examples: ["user", "project"],
|
|
103
|
+
});
|
|
104
|
+
const NonEmptyScopesSchema = Schema.NonEmptyArray(ScopeSchema).pipe(Schema.check(Schema.isUnique()));
|
|
105
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
106
|
+
export const SUPPORTED_AXM_SUPPORT = "supported";
|
|
107
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
108
|
+
export const AxmSupportSchema = Schema.Literals([
|
|
109
|
+
SUPPORTED_AXM_SUPPORT,
|
|
110
|
+
"planned",
|
|
111
|
+
"unsupported",
|
|
112
|
+
"unknown",
|
|
113
|
+
]).annotate({
|
|
114
|
+
identifier: "AxmSupport",
|
|
115
|
+
title: "AXM Support",
|
|
116
|
+
description: "AXM-owned integration status for an agent capability. This is not a vendor fact.",
|
|
117
|
+
examples: [SUPPORTED_AXM_SUPPORT, "unsupported", "unknown"],
|
|
118
|
+
});
|
|
119
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
120
|
+
export const ActiveAxmSupportSchema = Schema.Literals([SUPPORTED_AXM_SUPPORT, "planned"]).annotate({
|
|
121
|
+
identifier: "ActiveAxmSupport",
|
|
122
|
+
title: "Active AXM Support",
|
|
123
|
+
description: "AXM support values that carry a concrete managed capability claim.",
|
|
124
|
+
examples: [SUPPORTED_AXM_SUPPORT, "planned"],
|
|
125
|
+
});
|
|
126
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
127
|
+
export const InactiveAxmSupportSchema = Schema.Literals(["unsupported", "unknown"]).annotate({
|
|
128
|
+
identifier: "InactiveAxmSupport",
|
|
129
|
+
title: "Inactive AXM Support",
|
|
130
|
+
description: "AXM support values without an active managed extension writer.",
|
|
131
|
+
examples: ["unsupported", "unknown"],
|
|
132
|
+
});
|
|
133
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
134
|
+
export const PluginDistributionMechanismSchema = Schema.Literals([
|
|
135
|
+
"agent-native",
|
|
136
|
+
"npm",
|
|
137
|
+
"git",
|
|
138
|
+
"manual",
|
|
139
|
+
]).annotate({
|
|
140
|
+
identifier: "PluginDistributionMechanism",
|
|
141
|
+
title: "Plugin Distribution Mechanism",
|
|
142
|
+
description: "How an agent-vendor plugin is distributed outside AXM.",
|
|
143
|
+
});
|
|
144
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
145
|
+
export const PluginDistributionSchema = Schema.Struct({
|
|
146
|
+
mechanism: PluginDistributionMechanismSchema,
|
|
147
|
+
installHint: Schema.NullOr(Schema.NonEmptyString),
|
|
148
|
+
packageRef: Schema.NullOr(Schema.NonEmptyString),
|
|
149
|
+
}).annotate({
|
|
150
|
+
identifier: "PluginDistribution",
|
|
151
|
+
title: "Plugin Distribution",
|
|
152
|
+
description: "Descriptive install metadata that AXM may display but never executes.",
|
|
153
|
+
});
|
|
154
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
155
|
+
export const PluginDetectionPathSchema = Schema.Struct({
|
|
156
|
+
scope: ScopeSchema,
|
|
157
|
+
path: Schema.NonEmptyString,
|
|
158
|
+
kind: Schema.Literals(["dir", "file"]),
|
|
159
|
+
}).annotate({
|
|
160
|
+
identifier: "PluginDetectionPath",
|
|
161
|
+
title: "Plugin Detection Path",
|
|
162
|
+
description: "Future scan marker for detecting an installed agent-vendor plugin.",
|
|
163
|
+
});
|
|
164
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
165
|
+
export const PluginDetectionConfigKeySchema = Schema.Struct({
|
|
166
|
+
scope: ScopeSchema,
|
|
167
|
+
file: Schema.NonEmptyString,
|
|
168
|
+
key: Schema.NonEmptyString,
|
|
169
|
+
}).annotate({
|
|
170
|
+
identifier: "PluginDetectionConfigKey",
|
|
171
|
+
title: "Plugin Detection Config Key",
|
|
172
|
+
description: "Future config-key marker for detecting an installed agent-vendor plugin.",
|
|
173
|
+
});
|
|
174
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
175
|
+
export const PluginDetectionSchema = Schema.Struct({
|
|
176
|
+
paths: Schema.Array(PluginDetectionPathSchema),
|
|
177
|
+
configKeys: Schema.Array(PluginDetectionConfigKeySchema),
|
|
178
|
+
}).annotate({
|
|
179
|
+
identifier: "PluginDetection",
|
|
180
|
+
title: "Plugin Detection",
|
|
181
|
+
description: "Descriptive plugin detection markers reserved for future workspace scans.",
|
|
182
|
+
});
|
|
183
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
184
|
+
export const PluginDescriptorSchema = Schema.Struct({
|
|
185
|
+
name: Schema.NonEmptyString,
|
|
186
|
+
homepage: UrlSchema,
|
|
187
|
+
author: Schema.NullOr(Schema.NonEmptyString),
|
|
188
|
+
distribution: PluginDistributionSchema,
|
|
189
|
+
detection: Schema.NullOr(PluginDetectionSchema),
|
|
190
|
+
}).annotate({
|
|
191
|
+
identifier: "PluginDescriptor",
|
|
192
|
+
title: "Plugin Descriptor",
|
|
193
|
+
description: "Descriptive metadata for third-party or vendor plugins outside AXM management.",
|
|
194
|
+
});
|
|
195
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
196
|
+
const NativeAvailabilitySchema = Schema.Struct({ via: Schema.Literal("native") });
|
|
197
|
+
const NoneAvailabilitySchema = Schema.Struct({ via: Schema.Literal("none") });
|
|
198
|
+
const PluginAvailabilitySchema = Schema.Struct({
|
|
199
|
+
via: Schema.Literal("plugin"),
|
|
200
|
+
provider: Schema.Literals(["first-party", "third-party"]),
|
|
201
|
+
plugin: PluginDescriptorSchema,
|
|
202
|
+
});
|
|
203
|
+
const AvailableCapabilityAvailabilitySchema = Schema.Union([
|
|
204
|
+
NativeAvailabilitySchema,
|
|
205
|
+
PluginAvailabilitySchema,
|
|
206
|
+
]);
|
|
207
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
208
|
+
export const AvailabilitySchema = Schema.Union([
|
|
209
|
+
NativeAvailabilitySchema,
|
|
210
|
+
NoneAvailabilitySchema,
|
|
211
|
+
PluginAvailabilitySchema,
|
|
212
|
+
]).annotate({
|
|
213
|
+
identifier: "Availability",
|
|
214
|
+
title: "Availability",
|
|
215
|
+
description: "Whether the agent capability surface is obtainable natively, via plugin, or not.",
|
|
216
|
+
});
|
|
217
|
+
const VendorStatusSinceSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(ISO_DATE_PATTERN, {
|
|
218
|
+
message: "Expected an ISO 8601 date in YYYY-MM-DD form.",
|
|
219
|
+
})));
|
|
220
|
+
const InactiveVendorStatusFields = {
|
|
221
|
+
since: Schema.NullOr(VendorStatusSinceSchema),
|
|
222
|
+
note: Schema.NullOr(Schema.NonEmptyString),
|
|
223
|
+
supersededByType: Schema.NullOr(LeafExtensionTypeSchema),
|
|
224
|
+
};
|
|
225
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
226
|
+
export const VendorStatusSchema = Schema.Union([
|
|
227
|
+
Schema.Struct({ state: Schema.Literal("active") }),
|
|
228
|
+
Schema.Struct({ state: Schema.Literal("maintenance"), ...InactiveVendorStatusFields }),
|
|
229
|
+
Schema.Struct({ state: Schema.Literal("deprecated"), ...InactiveVendorStatusFields }),
|
|
230
|
+
Schema.Struct({ state: Schema.Literal("removed"), ...InactiveVendorStatusFields }),
|
|
231
|
+
]).annotate({
|
|
232
|
+
identifier: "VendorStatus",
|
|
233
|
+
title: "Vendor Status",
|
|
234
|
+
description: "Vendor or plugin health for the surface named by availability.",
|
|
235
|
+
});
|
|
236
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
237
|
+
export const AgentInterfaceSchema = Schema.Literals([
|
|
238
|
+
"cli",
|
|
239
|
+
"ide-extension",
|
|
240
|
+
"chat",
|
|
241
|
+
"hosted-agent",
|
|
242
|
+
]).annotate({
|
|
243
|
+
identifier: "AgentInterface",
|
|
244
|
+
title: "Agent Interface",
|
|
245
|
+
description: "Primary product interface where the agent runs.",
|
|
246
|
+
examples: ["cli", "ide-extension", "chat", "hosted-agent"],
|
|
247
|
+
});
|
|
248
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
249
|
+
export const McpTransportSchema = Schema.Literals(["stdio", "http", "sse"]).annotate({
|
|
250
|
+
identifier: "McpTransport",
|
|
251
|
+
title: "MCP Transport",
|
|
252
|
+
description: "MCP transport supported by an agent.",
|
|
253
|
+
examples: ["stdio", "http", "sse"],
|
|
254
|
+
});
|
|
255
|
+
const NonEmptyMcpTransportsSchema = Schema.NonEmptyArray(McpTransportSchema).pipe(Schema.check(Schema.isUnique()));
|
|
256
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
257
|
+
export const DetectionSignalSchema = Schema.Literals([
|
|
258
|
+
"definitive",
|
|
259
|
+
"supporting",
|
|
260
|
+
"ambiguous",
|
|
261
|
+
]).annotate({
|
|
262
|
+
identifier: "DetectionSignal",
|
|
263
|
+
title: "Detection Signal",
|
|
264
|
+
description: "How strongly a resolved marker identifies a specific coding agent.",
|
|
265
|
+
examples: ["definitive", "supporting", "ambiguous"],
|
|
266
|
+
});
|
|
267
|
+
const DetectionMarkerBaseFields = {
|
|
268
|
+
signal: DetectionSignalSchema,
|
|
269
|
+
note: Schema.NullOr(Schema.NonEmptyString),
|
|
270
|
+
};
|
|
271
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
272
|
+
export const DetectionMarkerSchema = Schema.Union([
|
|
273
|
+
Schema.Struct({
|
|
274
|
+
kind: Schema.Literal("dir"),
|
|
275
|
+
path: Schema.NonEmptyString,
|
|
276
|
+
...DetectionMarkerBaseFields,
|
|
277
|
+
}),
|
|
278
|
+
Schema.Struct({
|
|
279
|
+
kind: Schema.Literal("file"),
|
|
280
|
+
path: Schema.NonEmptyString,
|
|
281
|
+
...DetectionMarkerBaseFields,
|
|
282
|
+
}),
|
|
283
|
+
Schema.Struct({
|
|
284
|
+
kind: Schema.Literal("executable"),
|
|
285
|
+
name: Schema.NonEmptyString,
|
|
286
|
+
...DetectionMarkerBaseFields,
|
|
287
|
+
}),
|
|
288
|
+
]).annotate({
|
|
289
|
+
identifier: "DetectionMarker",
|
|
290
|
+
title: "Detection Marker",
|
|
291
|
+
description: "Typed marker used to detect an installed or configured coding agent.",
|
|
292
|
+
});
|
|
293
|
+
const detectionMarkerKey = (marker) => marker.kind === "executable" ? `executable:${marker.name}` : `${marker.kind}:${marker.path}`;
|
|
294
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
295
|
+
export const ScopeDetectionSchema = Schema.Struct({
|
|
296
|
+
markers: Schema.Array(DetectionMarkerSchema).pipe(Schema.check(Schema.makeFilter((markers) => {
|
|
297
|
+
const seen = new Set();
|
|
298
|
+
for (const marker of markers) {
|
|
299
|
+
const key = detectionMarkerKey(marker);
|
|
300
|
+
if (seen.has(key))
|
|
301
|
+
return "Detection markers must be unique by kind and path/name.";
|
|
302
|
+
seen.add(key);
|
|
303
|
+
}
|
|
304
|
+
return undefined;
|
|
305
|
+
}))),
|
|
306
|
+
}).annotate({
|
|
307
|
+
identifier: "ScopeDetection",
|
|
308
|
+
title: "Scope Detection",
|
|
309
|
+
description: "Detection markers for one configuration scope.",
|
|
310
|
+
});
|
|
311
|
+
const DetectionStruct = Schema.Struct({
|
|
312
|
+
project: ScopeDetectionSchema,
|
|
313
|
+
user: ScopeDetectionSchema,
|
|
314
|
+
});
|
|
315
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
316
|
+
export const DetectionSchema = DetectionStruct.pipe(Schema.annotate({
|
|
317
|
+
identifier: "Detection",
|
|
318
|
+
title: "Detection",
|
|
319
|
+
description: "Per-scope signals (marker dirs, files, CLI binaries) used to detect an installed agent.",
|
|
320
|
+
}));
|
|
321
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
322
|
+
export const LastVerifiedDateSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(ISO_DATE_PATTERN, {
|
|
323
|
+
message: "Expected an ISO 8601 date in YYYY-MM-DD form.",
|
|
324
|
+
}))).annotate({
|
|
325
|
+
identifier: "LastVerifiedDate",
|
|
326
|
+
title: "Last Verified Date",
|
|
327
|
+
description: "Date a capability claim was last verified.",
|
|
328
|
+
examples: ["2026-05-16"],
|
|
329
|
+
});
|
|
330
|
+
const CapabilityNotesSchema = Schema.NullOr(Schema.NonEmptyString);
|
|
331
|
+
const CapabilityDocsSchema = Schema.Array(DocLinkSchema);
|
|
332
|
+
const CapabilitySourcesSchema = Schema.Array(UrlSchema);
|
|
333
|
+
const provenanceFields = (sources, lastVerified) => ({
|
|
334
|
+
sources,
|
|
335
|
+
lastVerified,
|
|
336
|
+
});
|
|
337
|
+
const NullableProvenanceFields = provenanceFields(CapabilitySourcesSchema, Schema.NullOr(LastVerifiedDateSchema));
|
|
338
|
+
const VerifiedProvenanceFields = provenanceFields(Schema.NonEmptyArray(UrlSchema), LastVerifiedDateSchema);
|
|
339
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
340
|
+
export const ProvenanceSchema = Schema.Struct(NullableProvenanceFields).annotate({
|
|
341
|
+
identifier: "Provenance",
|
|
342
|
+
title: "Provenance",
|
|
343
|
+
description: "Source URLs and verification date for a catalog capability claim.",
|
|
344
|
+
});
|
|
345
|
+
const UnavailableNativeCapabilityFields = {
|
|
346
|
+
availability: NoneAvailabilitySchema,
|
|
347
|
+
vendorStatus: VendorStatusSchema,
|
|
348
|
+
notes: CapabilityNotesSchema,
|
|
349
|
+
docs: CapabilityDocsSchema,
|
|
350
|
+
sources: CapabilitySourcesSchema,
|
|
351
|
+
};
|
|
352
|
+
const AvailableNativeCapabilityBaseFields = {
|
|
353
|
+
availability: AvailableCapabilityAvailabilitySchema,
|
|
354
|
+
vendorStatus: VendorStatusSchema,
|
|
355
|
+
notes: CapabilityNotesSchema,
|
|
356
|
+
docs: CapabilityDocsSchema,
|
|
357
|
+
sources: CapabilitySourcesSchema,
|
|
358
|
+
scopes: NonEmptyScopesSchema,
|
|
359
|
+
};
|
|
360
|
+
const SpecTrackedCapabilityFields = {
|
|
361
|
+
standardsCompliance: StandardsComplianceSchema,
|
|
362
|
+
convention: ConventionSchema,
|
|
363
|
+
};
|
|
364
|
+
const AvailableSpecTrackedNativeCapabilityFields = {
|
|
365
|
+
...AvailableNativeCapabilityBaseFields,
|
|
366
|
+
...SpecTrackedCapabilityFields,
|
|
367
|
+
};
|
|
368
|
+
const axmCapabilityStateDescription = "AXM integration state for this capability: AXM support status, AXM verification date, optional writer metadata, and AXM-owned rationale. This is not a vendor fact.";
|
|
369
|
+
const axmCapabilityStateSchema = (writerSchema, identifier) => Schema.Struct({
|
|
370
|
+
status: AxmSupportSchema,
|
|
371
|
+
lastVerified: Schema.NullOr(LastVerifiedDateSchema),
|
|
372
|
+
reason: Schema.optionalKey(Schema.NonEmptyString),
|
|
373
|
+
writer: Schema.NullOr(writerSchema),
|
|
374
|
+
}).annotate({
|
|
375
|
+
identifier,
|
|
376
|
+
title: "AXM Capability State",
|
|
377
|
+
description: axmCapabilityStateDescription,
|
|
378
|
+
});
|
|
379
|
+
const NoWriterAxmCapabilityStateSchema = axmCapabilityStateSchema(Schema.Never, "NoWriterAxmCapabilityState");
|
|
380
|
+
const requireSourcesForActiveAxmSupport = (capability) => {
|
|
381
|
+
if ((capability.axm.status === SUPPORTED_AXM_SUPPORT || capability.axm.status === "planned") &&
|
|
382
|
+
capability.native.sources.length === 0) {
|
|
383
|
+
return {
|
|
384
|
+
path: ["native", "sources"],
|
|
385
|
+
issue: "Active AXM support claims require at least one native source.",
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
return undefined;
|
|
389
|
+
};
|
|
390
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
391
|
+
export const NativeCapabilityBaseSchema = Schema.Union([
|
|
392
|
+
Schema.Struct(AvailableNativeCapabilityBaseFields),
|
|
393
|
+
Schema.Struct(UnavailableNativeCapabilityFields),
|
|
394
|
+
]).annotate({
|
|
395
|
+
identifier: "NativeCapabilityBase",
|
|
396
|
+
title: "Native Capability Base",
|
|
397
|
+
description: "Vendor-sourced fields shared by all agent capabilities.",
|
|
398
|
+
});
|
|
399
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
400
|
+
export const SkillsExtensionCapabilitySchema = Schema.Struct({
|
|
401
|
+
native: Schema.Union([
|
|
402
|
+
Schema.Struct({
|
|
403
|
+
...AvailableSpecTrackedNativeCapabilityFields,
|
|
404
|
+
convention: Schema.Literals(["universal", "vendor"]),
|
|
405
|
+
directory: Schema.NonEmptyString,
|
|
406
|
+
additionalReadPaths: Schema.Array(SkillReadPathSchema).pipe(Schema.withDecodingDefaultKey(Effect.succeed([])), Schema.optionalKey),
|
|
407
|
+
}),
|
|
408
|
+
Schema.Struct({
|
|
409
|
+
...AvailableSpecTrackedNativeCapabilityFields,
|
|
410
|
+
convention: Schema.Literal("hosted"),
|
|
411
|
+
}),
|
|
412
|
+
Schema.Struct(UnavailableNativeCapabilityFields),
|
|
413
|
+
]),
|
|
414
|
+
axm: NoWriterAxmCapabilityStateSchema,
|
|
415
|
+
})
|
|
416
|
+
.pipe(Schema.check(Schema.makeFilter(requireSourcesForActiveAxmSupport)))
|
|
417
|
+
.annotate({
|
|
418
|
+
identifier: "SkillsExtensionCapability",
|
|
419
|
+
title: "Skills Capability",
|
|
420
|
+
description: "Agent support for Agent Skills-style extensions.",
|
|
421
|
+
});
|
|
422
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
423
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
424
|
+
export const SubagentsLayoutSchema = Schema.Literals(["file", "directory"]).annotate({
|
|
425
|
+
identifier: "SubagentsLayout",
|
|
426
|
+
title: "Subagents Layout",
|
|
427
|
+
description: "Whether subagents live in a directory or a single opaque file path.",
|
|
428
|
+
examples: ["directory", "file"],
|
|
429
|
+
});
|
|
430
|
+
const PluginSubagentsNativeCapabilitySchema = Schema.Struct({
|
|
431
|
+
...AvailableNativeCapabilityBaseFields,
|
|
432
|
+
availability: PluginAvailabilitySchema,
|
|
433
|
+
});
|
|
434
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
435
|
+
export const SubagentsExtensionCapabilitySchema = Schema.Struct({
|
|
436
|
+
native: Schema.Union([
|
|
437
|
+
Schema.Struct({
|
|
438
|
+
...AvailableNativeCapabilityBaseFields,
|
|
439
|
+
availability: NativeAvailabilitySchema,
|
|
440
|
+
directory: Schema.NonEmptyString,
|
|
441
|
+
layout: SubagentsLayoutSchema,
|
|
442
|
+
}),
|
|
443
|
+
PluginSubagentsNativeCapabilitySchema,
|
|
444
|
+
Schema.Struct(UnavailableNativeCapabilityFields),
|
|
445
|
+
]),
|
|
446
|
+
axm: NoWriterAxmCapabilityStateSchema,
|
|
447
|
+
})
|
|
448
|
+
.pipe(Schema.check(Schema.makeFilter(requireSourcesForActiveAxmSupport)))
|
|
449
|
+
.annotate({
|
|
450
|
+
identifier: "SubagentsExtensionCapability",
|
|
451
|
+
title: "Subagents Capability",
|
|
452
|
+
description: "Agent support for subagent extensions.",
|
|
453
|
+
});
|
|
454
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
455
|
+
export const RuleInstructionsKindSchema = Schema.Literals([
|
|
456
|
+
"agents-md",
|
|
457
|
+
"own-file",
|
|
458
|
+
"rules-dir",
|
|
459
|
+
]).annotate({
|
|
460
|
+
identifier: "RuleInstructionsKind",
|
|
461
|
+
title: "Rule Instructions Kind",
|
|
462
|
+
description: "Operational instruction-file convention used by the agent.",
|
|
463
|
+
examples: ["agents-md", "own-file", "rules-dir"],
|
|
464
|
+
});
|
|
465
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
466
|
+
export const RuleInstructionsImportSyntaxSchema = Schema.Literals(["at-path"]).annotate({
|
|
467
|
+
identifier: "RuleInstructionsImportSyntax",
|
|
468
|
+
title: "Rule Instructions Import Syntax",
|
|
469
|
+
description: "Syntax an agent uses to import another instruction file.",
|
|
470
|
+
examples: ["at-path"],
|
|
471
|
+
});
|
|
472
|
+
const OptionalRuleDirectoryField = {
|
|
473
|
+
directory: Schema.optionalKey(Schema.NonEmptyString),
|
|
474
|
+
};
|
|
475
|
+
const AgentsMdRulesExtensionCapabilitySchema = Schema.Struct({
|
|
476
|
+
...AvailableSpecTrackedNativeCapabilityFields,
|
|
477
|
+
...OptionalRuleDirectoryField,
|
|
478
|
+
kind: Schema.Literal("agents-md"),
|
|
479
|
+
files: Schema.Tuple([Schema.Literal("AGENTS.md")]),
|
|
480
|
+
nestedDiscovery: Schema.Boolean,
|
|
481
|
+
importSyntax: Schema.NullOr(RuleInstructionsImportSyntaxSchema),
|
|
482
|
+
});
|
|
483
|
+
const OwnFileRulesExtensionCapabilitySchema = Schema.Struct({
|
|
484
|
+
...AvailableSpecTrackedNativeCapabilityFields,
|
|
485
|
+
...OptionalRuleDirectoryField,
|
|
486
|
+
kind: Schema.Literal("own-file"),
|
|
487
|
+
files: Schema.Tuple([Schema.NonEmptyString]),
|
|
488
|
+
nestedDiscovery: Schema.Boolean,
|
|
489
|
+
importSyntax: Schema.NullOr(RuleInstructionsImportSyntaxSchema),
|
|
490
|
+
});
|
|
491
|
+
const RulesDirRulesExtensionCapabilitySchema = Schema.Struct({
|
|
492
|
+
...AvailableSpecTrackedNativeCapabilityFields,
|
|
493
|
+
kind: Schema.Literal("rules-dir"),
|
|
494
|
+
files: Schema.Array(Schema.NonEmptyString).pipe(Schema.check(Schema.isUnique())),
|
|
495
|
+
nestedDiscovery: Schema.Boolean,
|
|
496
|
+
importSyntax: Schema.NullOr(RuleInstructionsImportSyntaxSchema),
|
|
497
|
+
directory: Schema.NonEmptyString,
|
|
498
|
+
});
|
|
499
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
500
|
+
export const RulesExtensionCapabilitySchema = Schema.Struct({
|
|
501
|
+
native: Schema.Union([
|
|
502
|
+
AgentsMdRulesExtensionCapabilitySchema,
|
|
503
|
+
OwnFileRulesExtensionCapabilitySchema,
|
|
504
|
+
RulesDirRulesExtensionCapabilitySchema,
|
|
505
|
+
Schema.Struct(UnavailableNativeCapabilityFields),
|
|
506
|
+
]),
|
|
507
|
+
axm: NoWriterAxmCapabilityStateSchema,
|
|
508
|
+
})
|
|
509
|
+
.pipe(Schema.check(Schema.makeFilter(requireSourcesForActiveAxmSupport)))
|
|
510
|
+
.annotate({
|
|
511
|
+
identifier: "RulesExtensionCapability",
|
|
512
|
+
title: "Rules Capability",
|
|
513
|
+
description: "Agent support for behavior-governing instruction files and rule extensions.",
|
|
514
|
+
});
|
|
515
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
516
|
+
export const ConfigFileFormatSchema = Schema.Literals([
|
|
517
|
+
"json",
|
|
518
|
+
"jsonc",
|
|
519
|
+
"toml",
|
|
520
|
+
"yaml",
|
|
521
|
+
"starlark",
|
|
522
|
+
"vscode-settings",
|
|
523
|
+
]).annotate({
|
|
524
|
+
identifier: "ConfigFileFormat",
|
|
525
|
+
title: "Config File Format",
|
|
526
|
+
description: "Serialization format used by an agent's permission config file.",
|
|
527
|
+
examples: ["json", "toml", "yaml", "vscode-settings"],
|
|
528
|
+
});
|
|
529
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
530
|
+
export const McpServersKeySchema = Schema.Literals([
|
|
531
|
+
"mcpServers",
|
|
532
|
+
"servers",
|
|
533
|
+
"mcp",
|
|
534
|
+
"mcp_servers",
|
|
535
|
+
"context_servers",
|
|
536
|
+
]).annotate({
|
|
537
|
+
identifier: "McpServersKey",
|
|
538
|
+
title: "MCP Servers Key",
|
|
539
|
+
description: "Top-level key containing MCP server entries in an agent config file.",
|
|
540
|
+
examples: ["mcpServers", "servers", "mcp"],
|
|
541
|
+
});
|
|
542
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
543
|
+
export const McpTargetAttributionSchema = Schema.Literals(["shared", "agent"]).annotate({
|
|
544
|
+
identifier: "McpTargetAttribution",
|
|
545
|
+
title: "MCP Target Attribution",
|
|
546
|
+
description: "Whether a config target identifies one agent or is a shared surface read by multiple agents.",
|
|
547
|
+
});
|
|
548
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
549
|
+
export const McpConfigTargetSchema = Schema.Struct({
|
|
550
|
+
scope: ScopeSchema,
|
|
551
|
+
path: Schema.NonEmptyString,
|
|
552
|
+
format: ConfigFileFormatSchema,
|
|
553
|
+
attribution: McpTargetAttributionSchema,
|
|
554
|
+
}).annotate({
|
|
555
|
+
identifier: "McpConfigTarget",
|
|
556
|
+
title: "MCP Config Target",
|
|
557
|
+
description: "A config file target where MCP server entries can be written, with explicit presence attribution.",
|
|
558
|
+
});
|
|
559
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
560
|
+
export const McpTypeFieldValueMapSchema = Schema.Struct({
|
|
561
|
+
"streamable-http": Schema.NonEmptyString,
|
|
562
|
+
sse: Schema.optionalKey(Schema.NonEmptyString),
|
|
563
|
+
}).annotate({
|
|
564
|
+
identifier: "McpTypeFieldValueMap",
|
|
565
|
+
title: "MCP Type Field Value Map",
|
|
566
|
+
description: "Agent discriminator values by upstream remote transport.",
|
|
567
|
+
});
|
|
568
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
569
|
+
export const McpTypeFieldRepresentationSchema = Schema.Struct({
|
|
570
|
+
name: Schema.NonEmptyString,
|
|
571
|
+
value: Schema.Union([Schema.NonEmptyString, McpTypeFieldValueMapSchema]),
|
|
572
|
+
}).annotate({
|
|
573
|
+
identifier: "McpTypeFieldRepresentation",
|
|
574
|
+
title: "MCP Type Field Representation",
|
|
575
|
+
description: "One accepted per-entry transport discriminator representation.",
|
|
576
|
+
});
|
|
577
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
578
|
+
export const McpTypeFieldSchema = Schema.Struct({
|
|
579
|
+
required: Schema.NullOr(McpTypeFieldRepresentationSchema),
|
|
580
|
+
accepted: Schema.NonEmptyArray(Schema.NullOr(McpTypeFieldRepresentationSchema)),
|
|
581
|
+
}).annotate({
|
|
582
|
+
identifier: "McpTypeField",
|
|
583
|
+
title: "MCP Type Field",
|
|
584
|
+
description: "The discriminator representation AXM writes and every representation the agent accepts.",
|
|
585
|
+
});
|
|
586
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
587
|
+
export const McpActivationFieldRepresentationSchema = Schema.Struct({
|
|
588
|
+
name: Schema.NonEmptyString,
|
|
589
|
+
enabled: Schema.Boolean,
|
|
590
|
+
disabled: Schema.Boolean,
|
|
591
|
+
}).annotate({
|
|
592
|
+
identifier: "McpActivationFieldRepresentation",
|
|
593
|
+
title: "MCP Activation Field Representation",
|
|
594
|
+
description: "One accepted per-entry activation field and its boolean polarity.",
|
|
595
|
+
});
|
|
596
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
597
|
+
export const McpActivationFieldSchema = Schema.Struct({
|
|
598
|
+
required: Schema.NullOr(McpActivationFieldRepresentationSchema),
|
|
599
|
+
accepted: Schema.NonEmptyArray(Schema.NullOr(McpActivationFieldRepresentationSchema)),
|
|
600
|
+
}).annotate({
|
|
601
|
+
identifier: "McpActivationField",
|
|
602
|
+
title: "MCP Activation Field",
|
|
603
|
+
description: "The activation representation AXM writes and every representation the agent accepts.",
|
|
604
|
+
});
|
|
605
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
606
|
+
export const McpStdioDialectSchema = Schema.Struct({
|
|
607
|
+
typeField: McpTypeFieldSchema,
|
|
608
|
+
command: Schema.Literals(["split", "array"]),
|
|
609
|
+
envKey: Schema.NullOr(Schema.NonEmptyString),
|
|
610
|
+
}).annotate({
|
|
611
|
+
identifier: "McpStdioDialect",
|
|
612
|
+
title: "MCP Stdio Dialect",
|
|
613
|
+
description: "How an agent represents local stdio MCP server entries.",
|
|
614
|
+
});
|
|
615
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
616
|
+
export const McpUrlKeyMapSchema = Schema.Struct({
|
|
617
|
+
"streamable-http": Schema.NonEmptyString,
|
|
618
|
+
sse: Schema.optionalKey(Schema.NonEmptyString),
|
|
619
|
+
}).annotate({
|
|
620
|
+
identifier: "McpUrlKeyMap",
|
|
621
|
+
title: "MCP URL Key Map",
|
|
622
|
+
description: "Agent URL field names by upstream remote transport.",
|
|
623
|
+
});
|
|
624
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
625
|
+
export const McpRemoteDialectSchema = Schema.Struct({
|
|
626
|
+
typeField: McpTypeFieldSchema,
|
|
627
|
+
urlKey: McpUrlKeyMapSchema,
|
|
628
|
+
headersKey: Schema.NullOr(Schema.NonEmptyString),
|
|
629
|
+
bearerTokenEnvKey: Schema.optionalKey(Schema.NullOr(Schema.NonEmptyString)),
|
|
630
|
+
envHeadersKey: Schema.optionalKey(Schema.NullOr(Schema.NonEmptyString)),
|
|
631
|
+
}).annotate({
|
|
632
|
+
identifier: "McpRemoteDialect",
|
|
633
|
+
title: "MCP Remote Dialect",
|
|
634
|
+
description: "How an agent represents remote MCP server entries.",
|
|
635
|
+
});
|
|
636
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
637
|
+
export const McpConfigSchema = Schema.Struct({
|
|
638
|
+
serversKey: McpServersKeySchema,
|
|
639
|
+
activationField: McpActivationFieldSchema,
|
|
640
|
+
targets: Schema.Array(McpConfigTargetSchema),
|
|
641
|
+
stdio: Schema.NullOr(McpStdioDialectSchema),
|
|
642
|
+
remote: Schema.NullOr(McpRemoteDialectSchema),
|
|
643
|
+
}).annotate({
|
|
644
|
+
identifier: "McpConfig",
|
|
645
|
+
title: "MCP Config",
|
|
646
|
+
description: "Prescriptive config writer metadata for an agent's MCP support.",
|
|
647
|
+
});
|
|
648
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
649
|
+
export const McpEnvExpansionSchema = Schema.Struct({
|
|
650
|
+
variables: Schema.Literals(["none", "braced"]),
|
|
651
|
+
defaults: Schema.Boolean,
|
|
652
|
+
}).annotate({
|
|
653
|
+
identifier: "McpEnvExpansion",
|
|
654
|
+
title: "MCP Env Expansion",
|
|
655
|
+
description: "Whether an agent expands MCP config environment references.",
|
|
656
|
+
});
|
|
657
|
+
const McpUnavailableCapabilityStruct = Schema.Struct({
|
|
658
|
+
native: Schema.Struct(UnavailableNativeCapabilityFields),
|
|
659
|
+
axm: axmCapabilityStateSchema(Schema.Struct({ config: McpConfigSchema }), "McpAxmState"),
|
|
660
|
+
});
|
|
661
|
+
const McpNativeWithTransportsSchema = Schema.Struct({
|
|
662
|
+
...AvailableSpecTrackedNativeCapabilityFields,
|
|
663
|
+
transports: NonEmptyMcpTransportsSchema,
|
|
664
|
+
mcpEnvExpansion: Schema.optionalKey(McpEnvExpansionSchema),
|
|
665
|
+
});
|
|
666
|
+
const McpAvailableCapabilityStruct = Schema.Struct({
|
|
667
|
+
native: McpNativeWithTransportsSchema,
|
|
668
|
+
axm: axmCapabilityStateSchema(Schema.Struct({ config: McpConfigSchema }), "McpAxmState"),
|
|
669
|
+
});
|
|
670
|
+
const McpExtensionCapabilityStruct = Schema.Union([
|
|
671
|
+
McpAvailableCapabilityStruct,
|
|
672
|
+
McpUnavailableCapabilityStruct,
|
|
673
|
+
]);
|
|
674
|
+
const McpExtensionCapabilitySchemaWithChecks = McpExtensionCapabilityStruct.pipe(Schema.check(Schema.makeFilter((capability) => {
|
|
675
|
+
const issues = [];
|
|
676
|
+
const activeSourcesIssue = requireSourcesForActiveAxmSupport(capability);
|
|
677
|
+
if (activeSourcesIssue !== undefined)
|
|
678
|
+
issues.push(activeSourcesIssue);
|
|
679
|
+
const writer = capability.axm.writer;
|
|
680
|
+
if (writer === null || !("transports" in capability.native))
|
|
681
|
+
return issues;
|
|
682
|
+
const config = writer.config;
|
|
683
|
+
if (capability.native.transports.includes("stdio") && config.stdio === null) {
|
|
684
|
+
issues.push({
|
|
685
|
+
path: ["axm", "writer", "config", "stdio"],
|
|
686
|
+
issue: "MCP stdio config is required when stdio transport is supported.",
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
if ((capability.native.transports.includes("http") ||
|
|
690
|
+
capability.native.transports.includes("sse")) &&
|
|
691
|
+
config.remote === null) {
|
|
692
|
+
issues.push({
|
|
693
|
+
path: ["axm", "writer", "config", "remote"],
|
|
694
|
+
issue: "MCP remote config is required when http or sse transport is supported.",
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
return issues;
|
|
698
|
+
})));
|
|
699
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
700
|
+
export const McpExtensionCapabilitySchema = McpExtensionCapabilitySchemaWithChecks.annotate({
|
|
701
|
+
identifier: "McpExtensionCapability",
|
|
702
|
+
title: "MCP Capability",
|
|
703
|
+
description: "Agent support for MCP server extensions.",
|
|
704
|
+
});
|
|
705
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
706
|
+
export const PermissionMechanismSchema = Schema.Literals([
|
|
707
|
+
"config-file",
|
|
708
|
+
"cli-flag",
|
|
709
|
+
"ui-only",
|
|
710
|
+
]).annotate({
|
|
711
|
+
identifier: "PermissionMechanism",
|
|
712
|
+
title: "Permission Mechanism",
|
|
713
|
+
description: "How an agent exposes permission configuration.",
|
|
714
|
+
examples: ["config-file", "cli-flag", "ui-only"],
|
|
715
|
+
});
|
|
716
|
+
const NonEmptyPermissionMechanismsSchema = Schema.NonEmptyArray(PermissionMechanismSchema).pipe(Schema.check(Schema.isUnique()));
|
|
717
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
718
|
+
export const PermissionGrammarStyleSchema = Schema.Literals([
|
|
719
|
+
"tool-call",
|
|
720
|
+
"prefix",
|
|
721
|
+
"regex",
|
|
722
|
+
"glob",
|
|
723
|
+
"starlark-rule",
|
|
724
|
+
]).annotate({
|
|
725
|
+
identifier: "PermissionGrammarStyle",
|
|
726
|
+
title: "Permission Grammar Style",
|
|
727
|
+
description: "Syntax shape used to express a permission rule.",
|
|
728
|
+
examples: ["tool-call", "prefix", "regex"],
|
|
729
|
+
});
|
|
730
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
731
|
+
export const ConfigFileLocationSchema = Schema.Struct({
|
|
732
|
+
scope: ScopeSchema,
|
|
733
|
+
path: Schema.NonEmptyString,
|
|
734
|
+
format: ConfigFileFormatSchema,
|
|
735
|
+
gitignored: Schema.Boolean,
|
|
736
|
+
}).annotate({
|
|
737
|
+
identifier: "ConfigFileLocation",
|
|
738
|
+
title: "Config File Location",
|
|
739
|
+
description: "A configuration file where an agent's permission rules can live.",
|
|
740
|
+
});
|
|
741
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
742
|
+
export const CANONICAL_HOOK_EVENT_IDS = [
|
|
743
|
+
"session.start",
|
|
744
|
+
"prompt.submit",
|
|
745
|
+
"turn.end",
|
|
746
|
+
"tool.pre",
|
|
747
|
+
"tool.post",
|
|
748
|
+
"subagent.stop",
|
|
749
|
+
"compaction.pre",
|
|
750
|
+
];
|
|
751
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
752
|
+
export const CanonicalHookEventIdSchema = Schema.Literals(CANONICAL_HOOK_EVENT_IDS).annotate({
|
|
753
|
+
identifier: "CanonicalHookEventId",
|
|
754
|
+
title: "Canonical Hook Event ID",
|
|
755
|
+
description: "Vendor-neutral hook lifecycle event identifier.",
|
|
756
|
+
examples: ["tool.pre", "tool.post", "prompt.submit"],
|
|
757
|
+
});
|
|
758
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
759
|
+
export const HookEventTierSchema = Schema.Literals(["core", "extended"]).annotate({
|
|
760
|
+
identifier: "HookEventTier",
|
|
761
|
+
title: "Hook Event Tier",
|
|
762
|
+
description: "Whether a canonical hook event belongs to the stable core or extended tail.",
|
|
763
|
+
});
|
|
764
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
765
|
+
export const CanonicalHookEventSchema = Schema.Struct({
|
|
766
|
+
id: CanonicalHookEventIdSchema,
|
|
767
|
+
tier: HookEventTierSchema,
|
|
768
|
+
}).annotate({
|
|
769
|
+
identifier: "CanonicalHookEvent",
|
|
770
|
+
title: "Canonical Hook Event",
|
|
771
|
+
description: "Registered AXM hook event concept.",
|
|
772
|
+
});
|
|
773
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
774
|
+
export const CANONICAL_HOOK_EVENTS = [
|
|
775
|
+
{ id: "session.start", tier: "core" },
|
|
776
|
+
{ id: "prompt.submit", tier: "core" },
|
|
777
|
+
{ id: "turn.end", tier: "core" },
|
|
778
|
+
{ id: "tool.pre", tier: "core" },
|
|
779
|
+
{ id: "tool.post", tier: "core" },
|
|
780
|
+
{ id: "subagent.stop", tier: "extended" },
|
|
781
|
+
{ id: "compaction.pre", tier: "extended" },
|
|
782
|
+
];
|
|
783
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
784
|
+
export const CANONICAL_HOOK_TOOL_IDS = [
|
|
785
|
+
"file.read",
|
|
786
|
+
"file.write",
|
|
787
|
+
"file.edit",
|
|
788
|
+
"shell.exec",
|
|
789
|
+
"web.fetch",
|
|
790
|
+
"mcp.call",
|
|
791
|
+
];
|
|
792
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
793
|
+
export const CanonicalHookToolIdSchema = Schema.Literals(CANONICAL_HOOK_TOOL_IDS).annotate({
|
|
794
|
+
identifier: "CanonicalHookToolId",
|
|
795
|
+
title: "Canonical Hook Tool ID",
|
|
796
|
+
description: "Vendor-neutral tool identity used by portable hook matchers.",
|
|
797
|
+
examples: ["file.write", "file.edit", "shell.exec"],
|
|
798
|
+
});
|
|
799
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
800
|
+
export const HookToolMappingSchema = Schema.Struct({
|
|
801
|
+
nativeName: Schema.NonEmptyString,
|
|
802
|
+
canonical: CanonicalHookToolIdSchema,
|
|
803
|
+
...VerifiedProvenanceFields,
|
|
804
|
+
}).annotate({
|
|
805
|
+
identifier: "HookToolMapping",
|
|
806
|
+
title: "Hook Tool Mapping",
|
|
807
|
+
description: "Native tool name with its canonical AXM tool identity and provenance.",
|
|
808
|
+
});
|
|
809
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
810
|
+
export const HookMechanismFamilySchema = Schema.Literals(["command-stdin", "raw"]).annotate({
|
|
811
|
+
identifier: "HookMechanismFamily",
|
|
812
|
+
title: "Hook Mechanism Family",
|
|
813
|
+
description: "How a native hook system invokes a hook.",
|
|
814
|
+
examples: ["command-stdin", "raw"],
|
|
815
|
+
});
|
|
816
|
+
const NonEmptyHookMechanismFamiliesSchema = Schema.NonEmptyArray(HookMechanismFamilySchema).pipe(Schema.check(Schema.isUnique()));
|
|
817
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
818
|
+
export const HookMatcherKindSchema = Schema.Literals([
|
|
819
|
+
"regex",
|
|
820
|
+
"literal-list",
|
|
821
|
+
"glob",
|
|
822
|
+
"tool-category",
|
|
823
|
+
"exact-substring",
|
|
824
|
+
"none-imperative",
|
|
825
|
+
]).annotate({
|
|
826
|
+
identifier: "HookMatcherKind",
|
|
827
|
+
title: "Hook Matcher Kind",
|
|
828
|
+
description: "Native matcher syntax used to scope hook invocation.",
|
|
829
|
+
examples: ["regex", "glob", "none-imperative"],
|
|
830
|
+
});
|
|
831
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
832
|
+
export const HookMatcherSchema = Schema.Struct({
|
|
833
|
+
kind: HookMatcherKindSchema,
|
|
834
|
+
example: Schema.NullOr(Schema.NonEmptyString),
|
|
835
|
+
notes: Schema.NullOr(Schema.NonEmptyString),
|
|
836
|
+
}).annotate({
|
|
837
|
+
identifier: "HookMatcher",
|
|
838
|
+
title: "Hook Matcher",
|
|
839
|
+
description: "Matcher model for a native hook event.",
|
|
840
|
+
});
|
|
841
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
842
|
+
export const HookBlockOutcomeSchema = Schema.Literals(["allow", "deny", "ask"]).annotate({
|
|
843
|
+
identifier: "HookBlockOutcome",
|
|
844
|
+
title: "Hook Block Outcome",
|
|
845
|
+
description: "Decision outcome available to blocking hook systems.",
|
|
846
|
+
});
|
|
847
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
848
|
+
export const HookModifyOperationSchema = Schema.Literals([
|
|
849
|
+
"modify-input",
|
|
850
|
+
"inject-context",
|
|
851
|
+
"modify-output",
|
|
852
|
+
"synthesize",
|
|
853
|
+
"redact",
|
|
854
|
+
]).annotate({
|
|
855
|
+
identifier: "HookModifyOperation",
|
|
856
|
+
title: "Hook Modify Operation",
|
|
857
|
+
description: "Transform operation available to modifying hook systems.",
|
|
858
|
+
});
|
|
859
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
860
|
+
export const HookDecisionCapabilitySchema = Schema.Union([
|
|
861
|
+
Schema.Struct({ kind: Schema.Literal("observe") }),
|
|
862
|
+
Schema.Struct({
|
|
863
|
+
kind: Schema.Literal("block"),
|
|
864
|
+
outcomes: Schema.NonEmptyArray(HookBlockOutcomeSchema).pipe(Schema.check(Schema.isUnique())),
|
|
865
|
+
}),
|
|
866
|
+
Schema.Struct({
|
|
867
|
+
kind: Schema.Literal("modify"),
|
|
868
|
+
operations: Schema.NonEmptyArray(HookModifyOperationSchema).pipe(Schema.check(Schema.isUnique())),
|
|
869
|
+
}),
|
|
870
|
+
]).annotate({
|
|
871
|
+
identifier: "HookDecisionCapability",
|
|
872
|
+
title: "Hook Decision Capability",
|
|
873
|
+
description: "Whether a hook event can observe, block, or modify lifecycle behavior.",
|
|
874
|
+
});
|
|
875
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
876
|
+
export const HookEventMappingSchema = Schema.Struct({
|
|
877
|
+
nativeName: Schema.NonEmptyString,
|
|
878
|
+
canonical: CanonicalHookEventIdSchema,
|
|
879
|
+
matcher: HookMatcherSchema,
|
|
880
|
+
decision: Schema.NonEmptyArray(HookDecisionCapabilitySchema),
|
|
881
|
+
...VerifiedProvenanceFields,
|
|
882
|
+
}).annotate({
|
|
883
|
+
identifier: "HookEventMapping",
|
|
884
|
+
title: "Hook Event Mapping",
|
|
885
|
+
description: "Native hook event name with its canonical AXM event pointer and provenance.",
|
|
886
|
+
});
|
|
887
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
888
|
+
export const HooksSerializerSchema = Schema.Literals(["command-stdin"]).annotate({
|
|
889
|
+
identifier: "HooksSerializer",
|
|
890
|
+
title: "Hooks Serializer",
|
|
891
|
+
description: "Native settings serializer AXM uses for managed hook declarations.",
|
|
892
|
+
examples: ["command-stdin"],
|
|
893
|
+
});
|
|
894
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
895
|
+
export const HookMatcherSerializationSchema = Schema.Literals([
|
|
896
|
+
"bare",
|
|
897
|
+
"slash-delimited",
|
|
898
|
+
"glob",
|
|
899
|
+
]).annotate({
|
|
900
|
+
identifier: "HookMatcherSerialization",
|
|
901
|
+
title: "Hook Matcher Serialization",
|
|
902
|
+
description: "How AXM serializes manifest matcher strings into an agent-native hook group.",
|
|
903
|
+
examples: ["bare", "slash-delimited", "glob"],
|
|
904
|
+
});
|
|
905
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
906
|
+
export const HookTimeoutSerializationSchema = Schema.Literals(["seconds", "milliseconds"]).annotate({
|
|
907
|
+
identifier: "HookTimeoutSerialization",
|
|
908
|
+
title: "Hook Timeout Serialization",
|
|
909
|
+
description: "Unit AXM uses when serializing hook timeout fields into native settings.",
|
|
910
|
+
examples: ["seconds", "milliseconds"],
|
|
911
|
+
});
|
|
912
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
913
|
+
export const HookCommandNameSerializationSchema = Schema.Literals(["omit", "manifest"]).annotate({
|
|
914
|
+
identifier: "HookCommandNameSerialization",
|
|
915
|
+
title: "Hook Command Name Serialization",
|
|
916
|
+
description: "Whether native command hook entries need an explicit name field.",
|
|
917
|
+
examples: ["omit", "manifest"],
|
|
918
|
+
});
|
|
919
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
920
|
+
export const HooksWriterSchema = Schema.Struct({
|
|
921
|
+
serializer: HooksSerializerSchema,
|
|
922
|
+
configFiles: Schema.NonEmptyArray(ConfigFileLocationSchema),
|
|
923
|
+
settingsKey: Schema.NonEmptyString,
|
|
924
|
+
eventMap: Schema.Literal("native.events"),
|
|
925
|
+
matcherKind: HookMatcherKindSchema,
|
|
926
|
+
matcherSerialization: HookMatcherSerializationSchema,
|
|
927
|
+
timeoutSerialization: HookTimeoutSerializationSchema,
|
|
928
|
+
commandNameSerialization: HookCommandNameSerializationSchema,
|
|
929
|
+
}).annotate({
|
|
930
|
+
identifier: "HooksWriter",
|
|
931
|
+
title: "Hooks Writer",
|
|
932
|
+
description: "Parameterized AXM hook writer metadata derived from native hook catalog data.",
|
|
933
|
+
});
|
|
934
|
+
const HooksAvailableNativeCapabilitySchema = Schema.Struct({
|
|
935
|
+
...AvailableNativeCapabilityBaseFields,
|
|
936
|
+
mechanism: NonEmptyHookMechanismFamiliesSchema,
|
|
937
|
+
configFiles: Schema.Array(ConfigFileLocationSchema),
|
|
938
|
+
events: Schema.NonEmptyArray(HookEventMappingSchema),
|
|
939
|
+
tools: Schema.Array(HookToolMappingSchema),
|
|
940
|
+
});
|
|
941
|
+
const HooksUnmodeledNativeCapabilitySchema = Schema.Struct({
|
|
942
|
+
...AvailableNativeCapabilityBaseFields,
|
|
943
|
+
modeling: Schema.Literal("native-unmodeled"),
|
|
944
|
+
});
|
|
945
|
+
const HooksExtensionCapabilityStruct = Schema.Struct({
|
|
946
|
+
native: Schema.Union([
|
|
947
|
+
HooksAvailableNativeCapabilitySchema,
|
|
948
|
+
HooksUnmodeledNativeCapabilitySchema,
|
|
949
|
+
Schema.Struct(UnavailableNativeCapabilityFields),
|
|
950
|
+
]),
|
|
951
|
+
axm: axmCapabilityStateSchema(HooksWriterSchema, "HooksAxmState"),
|
|
952
|
+
});
|
|
953
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
954
|
+
export const HooksExtensionCapabilitySchema = HooksExtensionCapabilityStruct.pipe(Schema.check(Schema.makeFilter((capability) => {
|
|
955
|
+
const issues = [];
|
|
956
|
+
if (capability.axm.writer !== null && capability.native.sources.length === 0) {
|
|
957
|
+
issues.push({
|
|
958
|
+
path: ["native", "sources"],
|
|
959
|
+
issue: "Hook writer claims require at least one native source.",
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
if ("events" in capability.native) {
|
|
963
|
+
const nativeToolNames = new Set(capability.native.tools.map((tool) => tool.nativeName));
|
|
964
|
+
if (nativeToolNames.size !== capability.native.tools.length) {
|
|
965
|
+
issues.push({
|
|
966
|
+
path: ["native", "tools"],
|
|
967
|
+
issue: "Hook native tool mappings require unique nativeName values.",
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
return issues;
|
|
972
|
+
}))).annotate({
|
|
973
|
+
identifier: "HooksExtensionCapability",
|
|
974
|
+
title: "Hooks Capability",
|
|
975
|
+
description: "Agent support for lifecycle hook extensions.",
|
|
976
|
+
});
|
|
977
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
978
|
+
export const PermissionGrammarSchema = Schema.Struct({
|
|
979
|
+
style: PermissionGrammarStyleSchema,
|
|
980
|
+
example: Schema.NonEmptyString,
|
|
981
|
+
notes: Schema.NullOr(Schema.NonEmptyString),
|
|
982
|
+
}).annotate({
|
|
983
|
+
identifier: "PermissionGrammar",
|
|
984
|
+
title: "Permission Grammar",
|
|
985
|
+
description: "Rule syntax used by an agent's permission system.",
|
|
986
|
+
});
|
|
987
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
988
|
+
export const PermissionPrerequisiteSchema = Schema.Struct({
|
|
989
|
+
key: Schema.NonEmptyString,
|
|
990
|
+
value: Schema.NonEmptyString,
|
|
991
|
+
scope: ScopeSchema,
|
|
992
|
+
note: Schema.NullOr(Schema.NonEmptyString),
|
|
993
|
+
}).annotate({
|
|
994
|
+
identifier: "PermissionPrerequisite",
|
|
995
|
+
title: "Permission Prerequisite",
|
|
996
|
+
description: "Mode or gate that must be set before allow rules take effect.",
|
|
997
|
+
});
|
|
998
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
999
|
+
export const PermissionCliFlagSchema = Schema.Struct({
|
|
1000
|
+
flag: Schema.NonEmptyString,
|
|
1001
|
+
note: Schema.NullOr(Schema.NonEmptyString),
|
|
1002
|
+
}).annotate({
|
|
1003
|
+
identifier: "PermissionCliFlag",
|
|
1004
|
+
title: "Permission CLI Flag",
|
|
1005
|
+
description: "Invocation-time flag that adjusts approval or sandbox behavior.",
|
|
1006
|
+
});
|
|
1007
|
+
const PermissionGrantStruct = Schema.Struct({
|
|
1008
|
+
target: Schema.NonEmptyString,
|
|
1009
|
+
patch: Schema.NullOr(Schema.Unknown),
|
|
1010
|
+
template: Schema.NullOr(Schema.NonEmptyString),
|
|
1011
|
+
});
|
|
1012
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1013
|
+
export const PermissionGrantSchema = PermissionGrantStruct.pipe(Schema.check(Schema.makeFilter((grant) => grant.patch === null && grant.template === null
|
|
1014
|
+
? "Permission grants require patch or template."
|
|
1015
|
+
: undefined))).annotate({
|
|
1016
|
+
identifier: "PermissionGrant",
|
|
1017
|
+
title: "Permission Grant",
|
|
1018
|
+
description: "Instruction to grant access for a named tool. Provide patch (JSON-ish merge) or template (raw text). Path and patch may interpolate ${tool} and ${workspaceRoot}.",
|
|
1019
|
+
});
|
|
1020
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1021
|
+
export const PermissionsExtensionCapabilitySchema = Schema.Struct({
|
|
1022
|
+
native: Schema.Union([
|
|
1023
|
+
Schema.Struct({
|
|
1024
|
+
...AvailableNativeCapabilityBaseFields,
|
|
1025
|
+
mechanism: NonEmptyPermissionMechanismsSchema,
|
|
1026
|
+
configFiles: Schema.Array(ConfigFileLocationSchema),
|
|
1027
|
+
grammar: Schema.NullOr(PermissionGrammarSchema),
|
|
1028
|
+
prerequisites: Schema.Array(PermissionPrerequisiteSchema),
|
|
1029
|
+
cliFlags: Schema.Array(PermissionCliFlagSchema),
|
|
1030
|
+
}),
|
|
1031
|
+
Schema.Struct(UnavailableNativeCapabilityFields),
|
|
1032
|
+
]),
|
|
1033
|
+
axm: axmCapabilityStateSchema(Schema.Struct({ grants: Schema.Record(Schema.String, PermissionGrantSchema) }), "PermissionsAxmState"),
|
|
1034
|
+
})
|
|
1035
|
+
.pipe(Schema.check(Schema.makeFilter(requireSourcesForActiveAxmSupport)))
|
|
1036
|
+
.annotate({
|
|
1037
|
+
identifier: "PermissionsExtensionCapability",
|
|
1038
|
+
title: "Permissions Capability",
|
|
1039
|
+
description: "How an agent grants tool execution and filesystem access without per-call prompts.",
|
|
1040
|
+
});
|
|
1041
|
+
const PerAgentCapabilitySchemaByType = {
|
|
1042
|
+
skill: SkillsExtensionCapabilitySchema,
|
|
1043
|
+
"mcp-server": McpExtensionCapabilitySchema,
|
|
1044
|
+
subagent: SubagentsExtensionCapabilitySchema,
|
|
1045
|
+
hook: HooksExtensionCapabilitySchema,
|
|
1046
|
+
};
|
|
1047
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1048
|
+
export const AgentCapabilitiesSchema = Schema.Struct(PerAgentCapabilitySchemaByType).annotate({
|
|
1049
|
+
identifier: "AgentCapabilities",
|
|
1050
|
+
title: "Agent Capabilities",
|
|
1051
|
+
description: "Agent extension capabilities keyed by per-agent extension type.",
|
|
1052
|
+
});
|
|
1053
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1054
|
+
export const AgentLifecycleStateSchema = Schema.Literals([
|
|
1055
|
+
"active",
|
|
1056
|
+
"deprecated",
|
|
1057
|
+
"retired",
|
|
1058
|
+
]).annotate({
|
|
1059
|
+
identifier: "AgentLifecycleState",
|
|
1060
|
+
title: "Agent Lifecycle State",
|
|
1061
|
+
description: "Support status of the coding agent product itself. Distinct from AxmSupport, which tracks AXM's integration with a single capability.",
|
|
1062
|
+
examples: ["active", "deprecated", "retired"],
|
|
1063
|
+
});
|
|
1064
|
+
const AgentLifecycleSinceSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(ISO_DATE_PATTERN, {
|
|
1065
|
+
message: "Expected an ISO 8601 date in YYYY-MM-DD form.",
|
|
1066
|
+
}))).annotate({
|
|
1067
|
+
identifier: "AgentLifecycleSince",
|
|
1068
|
+
title: "Agent Lifecycle Since",
|
|
1069
|
+
description: "Date an agent entered its current lifecycle state.",
|
|
1070
|
+
examples: ["2025-11-01"],
|
|
1071
|
+
});
|
|
1072
|
+
// Loose kebab id rather than the closed AgentIdSchema: that schema lives in
|
|
1073
|
+
// catalog.ts (which imports this module), so referencing it here would be a
|
|
1074
|
+
// cycle. Referential integrity (target exists, not self, no cycles) is enforced
|
|
1075
|
+
// by the catalog invariant test.
|
|
1076
|
+
const InactiveAgentLifecycleFields = {
|
|
1077
|
+
since: Schema.NullOr(AgentLifecycleSinceSchema),
|
|
1078
|
+
note: Schema.NullOr(Schema.NonEmptyString),
|
|
1079
|
+
supersededBy: Schema.NullOr(AgentIdFromYamlSchema),
|
|
1080
|
+
};
|
|
1081
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1082
|
+
export const AgentLifecycleSchema = Schema.Union([
|
|
1083
|
+
Schema.Struct({ state: Schema.Literal("active") }),
|
|
1084
|
+
Schema.Struct({ state: Schema.Literal("deprecated"), ...InactiveAgentLifecycleFields }),
|
|
1085
|
+
Schema.Struct({ state: Schema.Literal("retired"), ...InactiveAgentLifecycleFields }),
|
|
1086
|
+
]).annotate({
|
|
1087
|
+
identifier: "AgentLifecycle",
|
|
1088
|
+
title: "Agent Lifecycle",
|
|
1089
|
+
description: "Whether a catalog agent is active, deprecated, or retired, and which agent supersedes it.",
|
|
1090
|
+
});
|
|
1091
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1092
|
+
export const CapabilityTargetingEntrySchema = Schema.Struct({
|
|
1093
|
+
grades: Schema.Array(Schema.NonEmptyString).pipe(Schema.check(Schema.isUnique())),
|
|
1094
|
+
nouns: Schema.Record(Schema.String, Schema.NonEmptyString),
|
|
1095
|
+
affordances: Schema.Record(Schema.String, Schema.NonEmptyString),
|
|
1096
|
+
}).annotate({
|
|
1097
|
+
identifier: "CapabilityTargetingEntry",
|
|
1098
|
+
title: "Capability Targeting Entry",
|
|
1099
|
+
description: "Additional portable grades, target-native nouns, and maintained affordance phrases for one capability.",
|
|
1100
|
+
});
|
|
1101
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1102
|
+
export const CapabilityTargetingSchema = Schema.Struct({
|
|
1103
|
+
extends: Schema.NullOr(AgentIdFromYamlSchema),
|
|
1104
|
+
capabilities: Schema.Record(Schema.String, CapabilityTargetingEntrySchema),
|
|
1105
|
+
}).annotate({
|
|
1106
|
+
identifier: "CapabilityTargeting",
|
|
1107
|
+
title: "Capability Targeting",
|
|
1108
|
+
description: "Catalog inputs used by AXM's capability-targeted extension renderer and fallback graph.",
|
|
1109
|
+
});
|
|
1110
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1111
|
+
export const HostedInstallDeliverySchema = Schema.Literals(["upload", "directory"]).annotate({
|
|
1112
|
+
identifier: "HostedInstallDelivery",
|
|
1113
|
+
title: "Hosted Install Delivery",
|
|
1114
|
+
description: "User-mediated delivery mechanism accepted by a hosted agent surface.",
|
|
1115
|
+
});
|
|
1116
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1117
|
+
export const HostedInstallArtifactSchema = Schema.Literals([
|
|
1118
|
+
"directory",
|
|
1119
|
+
"zip",
|
|
1120
|
+
"skill-file-or-zip",
|
|
1121
|
+
]).annotate({
|
|
1122
|
+
identifier: "HostedInstallArtifact",
|
|
1123
|
+
title: "Hosted Install Artifact",
|
|
1124
|
+
description: "Artifact shape a hosted agent accepts for manual extension delivery.",
|
|
1125
|
+
});
|
|
1126
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1127
|
+
export const HostedInstallTargetSchema = Schema.Struct({
|
|
1128
|
+
kind: Schema.Literal("hosted"),
|
|
1129
|
+
delivery: Schema.NonEmptyArray(HostedInstallDeliverySchema).pipe(Schema.check(Schema.isUnique())),
|
|
1130
|
+
artifact: HostedInstallArtifactSchema,
|
|
1131
|
+
instructions: Schema.NonEmptyString,
|
|
1132
|
+
docs: UrlSchema,
|
|
1133
|
+
}).annotate({
|
|
1134
|
+
identifier: "HostedInstallTarget",
|
|
1135
|
+
title: "Hosted Install Target",
|
|
1136
|
+
description: "Manual delivery instructions for a hosted agent after AXM packages and validates an extension.",
|
|
1137
|
+
});
|
|
1138
|
+
const AgentStruct = Schema.Struct({
|
|
1139
|
+
id: AgentIdFromYamlSchema,
|
|
1140
|
+
name: Schema.NonEmptyString,
|
|
1141
|
+
vendor: Schema.NonEmptyString,
|
|
1142
|
+
homepage: UrlSchema,
|
|
1143
|
+
interfaces: Schema.NonEmptyArray(AgentInterfaceSchema).pipe(Schema.check(Schema.isUnique())),
|
|
1144
|
+
family: Schema.NullOr(Schema.NonEmptyString),
|
|
1145
|
+
rootDir: Schema.NullOr(Schema.NonEmptyString),
|
|
1146
|
+
installTarget: Schema.optionalKey(HostedInstallTargetSchema),
|
|
1147
|
+
lifecycle: AgentLifecycleSchema,
|
|
1148
|
+
detection: DetectionSchema,
|
|
1149
|
+
docs: Schema.Array(DocLinkSchema),
|
|
1150
|
+
capabilities: AgentCapabilitiesSchema,
|
|
1151
|
+
instructions: RulesExtensionCapabilitySchema,
|
|
1152
|
+
permissions: PermissionsExtensionCapabilitySchema,
|
|
1153
|
+
targeting: Schema.optionalKey(CapabilityTargetingSchema),
|
|
1154
|
+
});
|
|
1155
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
1156
|
+
export const AgentSchema = AgentStruct.pipe(Schema.check(Schema.makeFilter((agent) => {
|
|
1157
|
+
const issues = [];
|
|
1158
|
+
if ("kind" in agent.instructions.native &&
|
|
1159
|
+
agent.instructions.native.kind === "agents-md" &&
|
|
1160
|
+
agent.instructions.native.files[0] !== "AGENTS.md") {
|
|
1161
|
+
issues.push({
|
|
1162
|
+
path: ["instructions", "native", "files"],
|
|
1163
|
+
issue: 'instructions.kind "agents-md" requires AGENTS.md.',
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
const hostedOnly = agent.interfaces.every((interfaceKind) => interfaceKind === "chat" || interfaceKind === "hosted-agent");
|
|
1167
|
+
const hasHostedInterface = agent.interfaces.some((interfaceKind) => interfaceKind === "chat" || interfaceKind === "hosted-agent");
|
|
1168
|
+
const hasDetectionMarkers = agent.detection.project.markers.length > 0 || agent.detection.user.markers.length > 0;
|
|
1169
|
+
if (hasHostedInterface && agent.installTarget === undefined) {
|
|
1170
|
+
issues.push({
|
|
1171
|
+
path: ["installTarget"],
|
|
1172
|
+
issue: "Agents with a hosted interface require installTarget.",
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
if (hostedOnly && agent.rootDir !== null) {
|
|
1176
|
+
issues.push({
|
|
1177
|
+
path: ["rootDir"],
|
|
1178
|
+
issue: "Hosted-only agents cannot declare rootDir.",
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
if (hostedOnly && hasDetectionMarkers) {
|
|
1182
|
+
issues.push({
|
|
1183
|
+
path: ["detection"],
|
|
1184
|
+
issue: "Hosted-only agents cannot declare local detection markers.",
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
const capabilitySlots = [
|
|
1188
|
+
...Object.values(agent.capabilities),
|
|
1189
|
+
agent.instructions,
|
|
1190
|
+
agent.permissions,
|
|
1191
|
+
];
|
|
1192
|
+
if (hostedOnly && capabilitySlots.some((capability) => capability.axm.writer !== null)) {
|
|
1193
|
+
issues.push({
|
|
1194
|
+
path: ["capabilities"],
|
|
1195
|
+
issue: "Hosted-only agents cannot declare filesystem writers.",
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
if (hostedOnly &&
|
|
1199
|
+
capabilitySlots.some((capability) => "directory" in capability.native ||
|
|
1200
|
+
("configFiles" in capability.native && capability.native.configFiles.length > 0))) {
|
|
1201
|
+
issues.push({
|
|
1202
|
+
path: ["capabilities"],
|
|
1203
|
+
issue: "Hosted-only agents cannot declare local capability paths.",
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
if (!hasHostedInterface && agent.installTarget !== undefined) {
|
|
1207
|
+
issues.push({
|
|
1208
|
+
path: ["installTarget"],
|
|
1209
|
+
issue: "Local-only agents cannot declare a hosted installTarget.",
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
return issues;
|
|
1213
|
+
}))).annotate({
|
|
1214
|
+
identifier: "Agent",
|
|
1215
|
+
title: "Agent",
|
|
1216
|
+
description: "AI coding agent and its verified extension capability claims.",
|
|
1217
|
+
});
|
|
1218
|
+
//# sourceMappingURL=schema.js.map
|