@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,605 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common schema definitions shared across AXM configuration files.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
*/
|
|
6
|
+
import * as EffectRecord from "effect/Record";
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
|
+
import * as Option from "effect/Option";
|
|
9
|
+
import * as Result from "effect/Result";
|
|
10
|
+
import { AGENT_IDS, CONFIGURABLE_AGENT_IDS } from "../agents/types.js";
|
|
11
|
+
import { HANDLE_PATTERN_SOURCE, HandleSchema } from "./handle.js";
|
|
12
|
+
import { parseLicenseExpression } from "./license.js";
|
|
13
|
+
import { CompanionPackageSchema } from "../package-urls/index.js";
|
|
14
|
+
import { ExtensionMetadataSchema } from "./manifest-metadata.js";
|
|
15
|
+
import { VersionSchema, VersionRangeSchema } from "../version-constraints/version-constraints.js";
|
|
16
|
+
/**
|
|
17
|
+
* Author information for a manifest.
|
|
18
|
+
*
|
|
19
|
+
* @experimental This API is unstable and may change without notice.
|
|
20
|
+
*/
|
|
21
|
+
export const AuthorSchema = Schema.Struct({
|
|
22
|
+
name: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "author name is required" })),
|
|
23
|
+
email: Schema.optional(Schema.String),
|
|
24
|
+
url: Schema.optional(Schema.String),
|
|
25
|
+
}).annotate({
|
|
26
|
+
identifier: "Author",
|
|
27
|
+
title: "Author",
|
|
28
|
+
description: "A person credited as a creator or maintainer of this extension.",
|
|
29
|
+
});
|
|
30
|
+
/** Convert schema-decoded author shape into runtime/domain Author. */
|
|
31
|
+
export const toAuthor = (author) => ({
|
|
32
|
+
name: author.name,
|
|
33
|
+
email: Option.fromUndefinedOr(author.email),
|
|
34
|
+
url: Option.fromUndefinedOr(author.url),
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Repository field for extension manifests. Accepts either a URL string
|
|
38
|
+
* (or shorthand like `github:owner/repo`) or an npm-style object with
|
|
39
|
+
* optional `type` and `directory` for monorepo subpaths.
|
|
40
|
+
*
|
|
41
|
+
* Matches the shape accepted by npm's `package.json` `repository` field.
|
|
42
|
+
*
|
|
43
|
+
* @experimental This API is unstable and may change without notice.
|
|
44
|
+
*/
|
|
45
|
+
export const RepositorySchema = Schema.Union([
|
|
46
|
+
Schema.String.annotate({
|
|
47
|
+
examples: ["https://github.com/acme/code-review", "github:acme/code-review"],
|
|
48
|
+
format: "uri-reference",
|
|
49
|
+
}),
|
|
50
|
+
Schema.Struct({
|
|
51
|
+
type: Schema.optional(Schema.NonEmptyString.annotate({
|
|
52
|
+
description: "Version control system (e.g., `git`).",
|
|
53
|
+
examples: ["git"],
|
|
54
|
+
})),
|
|
55
|
+
url: Schema.NonEmptyString.pipe(Schema.annotateKey({ messageMissingKey: "repository url is required" }), Schema.annotate({
|
|
56
|
+
description: "Repository URL.",
|
|
57
|
+
examples: ["https://github.com/acme/code-review"],
|
|
58
|
+
format: "uri",
|
|
59
|
+
})),
|
|
60
|
+
directory: Schema.optional(Schema.NonEmptyString.annotate({
|
|
61
|
+
description: "Subdirectory within the repository, for monorepo publishers.",
|
|
62
|
+
examples: ["packages/code-review"],
|
|
63
|
+
})),
|
|
64
|
+
}),
|
|
65
|
+
]).annotate({
|
|
66
|
+
identifier: "Repository",
|
|
67
|
+
title: "Repository",
|
|
68
|
+
description: "Source repository for this extension. Accepts a URL string (or `host:owner/repo` shorthand) or an object with `type`, `url`, and optional `directory`.",
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Bugs field for extension manifests. Accepts either a URL string or an
|
|
72
|
+
* npm-style object with optional `url` and `email`.
|
|
73
|
+
*
|
|
74
|
+
* @experimental This API is unstable and may change without notice.
|
|
75
|
+
*/
|
|
76
|
+
export const BugsSchema = Schema.Union([
|
|
77
|
+
Schema.String.annotate({
|
|
78
|
+
examples: ["https://github.com/acme/code-review/issues"],
|
|
79
|
+
format: "uri",
|
|
80
|
+
}),
|
|
81
|
+
Schema.Struct({
|
|
82
|
+
url: Schema.optional(Schema.NonEmptyString.annotate({
|
|
83
|
+
description: "Issue tracker URL.",
|
|
84
|
+
examples: ["https://github.com/acme/code-review/issues"],
|
|
85
|
+
format: "uri",
|
|
86
|
+
})),
|
|
87
|
+
email: Schema.optional(Schema.NonEmptyString.annotate({
|
|
88
|
+
description: "Contact email for bug reports.",
|
|
89
|
+
examples: ["bugs@acme.dev"],
|
|
90
|
+
format: "email",
|
|
91
|
+
})),
|
|
92
|
+
}),
|
|
93
|
+
]).annotate({
|
|
94
|
+
identifier: "Bugs",
|
|
95
|
+
title: "Bugs",
|
|
96
|
+
description: "Where to report bugs against this extension. Accepts a URL string or an object with optional `url` and `email`.",
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* License field for extension manifests.
|
|
100
|
+
*
|
|
101
|
+
* Accepts valid SPDX license expressions plus the npm-compatible
|
|
102
|
+
* `UNLICENSED` literal for proprietary code that grants no license.
|
|
103
|
+
*
|
|
104
|
+
* @experimental This API is unstable and may change without notice.
|
|
105
|
+
*/
|
|
106
|
+
export const LicenseSchema = Schema.String.annotate({
|
|
107
|
+
identifier: "License",
|
|
108
|
+
title: "License",
|
|
109
|
+
description: "SPDX license expression, or `UNLICENSED` for proprietary code.",
|
|
110
|
+
examples: ["MIT", "Apache-2.0", "MIT OR Apache-2.0", "UNLICENSED"],
|
|
111
|
+
format: "spdx-expression",
|
|
112
|
+
}).check(Schema.makeFilter((value) => Result.isSuccess(parseLicenseExpression(value))
|
|
113
|
+
? true
|
|
114
|
+
: "Expected a valid SPDX license expression or UNLICENSED"));
|
|
115
|
+
/**
|
|
116
|
+
* Single source of truth for extension type naming. Row order is the canonical
|
|
117
|
+
* display order. Every other type-naming export in this module derives from
|
|
118
|
+
* this table, so a new extension type is exactly one row here: a missing
|
|
119
|
+
* column is TS2741, an excess column is TS2353, and every downstream
|
|
120
|
+
* `satisfies Record<ExtensionType, _>` table fails until the new type is
|
|
121
|
+
* decided everywhere.
|
|
122
|
+
*
|
|
123
|
+
* @experimental This API is unstable and may change without notice.
|
|
124
|
+
*/
|
|
125
|
+
export const EXTENSION_TYPE_TABLE = {
|
|
126
|
+
skill: {
|
|
127
|
+
plural: "skills",
|
|
128
|
+
label: "Skill",
|
|
129
|
+
pluralLabel: "Skills",
|
|
130
|
+
sentenceLabel: "skill",
|
|
131
|
+
pluralSentenceLabel: "skills",
|
|
132
|
+
distribution: "registry",
|
|
133
|
+
placement: "per-agent",
|
|
134
|
+
governs: "package-body",
|
|
135
|
+
installInputs: false,
|
|
136
|
+
workspaceCapability: null,
|
|
137
|
+
},
|
|
138
|
+
"mcp-server": {
|
|
139
|
+
plural: "mcps",
|
|
140
|
+
label: "MCP Server",
|
|
141
|
+
pluralLabel: "MCP Servers",
|
|
142
|
+
sentenceLabel: "MCP server",
|
|
143
|
+
pluralSentenceLabel: "MCP servers",
|
|
144
|
+
distribution: "registry",
|
|
145
|
+
placement: "per-agent",
|
|
146
|
+
governs: "runtime-protocol",
|
|
147
|
+
installInputs: true,
|
|
148
|
+
workspaceCapability: null,
|
|
149
|
+
},
|
|
150
|
+
subagent: {
|
|
151
|
+
plural: "subagents",
|
|
152
|
+
label: "Subagent",
|
|
153
|
+
pluralLabel: "Subagents",
|
|
154
|
+
sentenceLabel: "subagent",
|
|
155
|
+
pluralSentenceLabel: "subagents",
|
|
156
|
+
distribution: "registry",
|
|
157
|
+
placement: "per-agent",
|
|
158
|
+
governs: null,
|
|
159
|
+
installInputs: false,
|
|
160
|
+
workspaceCapability: null,
|
|
161
|
+
},
|
|
162
|
+
rule: {
|
|
163
|
+
plural: "rules",
|
|
164
|
+
label: "Rule",
|
|
165
|
+
pluralLabel: "Rules",
|
|
166
|
+
sentenceLabel: "rule",
|
|
167
|
+
pluralSentenceLabel: "rules",
|
|
168
|
+
distribution: "registry",
|
|
169
|
+
placement: "workspace",
|
|
170
|
+
governs: "host-file",
|
|
171
|
+
installInputs: false,
|
|
172
|
+
workspaceCapability: "instructions",
|
|
173
|
+
},
|
|
174
|
+
hook: {
|
|
175
|
+
plural: "hooks",
|
|
176
|
+
label: "Hook",
|
|
177
|
+
pluralLabel: "Hooks",
|
|
178
|
+
sentenceLabel: "hook",
|
|
179
|
+
pluralSentenceLabel: "hooks",
|
|
180
|
+
distribution: "registry",
|
|
181
|
+
placement: "per-agent",
|
|
182
|
+
governs: null,
|
|
183
|
+
installInputs: false,
|
|
184
|
+
workspaceCapability: null,
|
|
185
|
+
},
|
|
186
|
+
knowledge: {
|
|
187
|
+
plural: "knowledge",
|
|
188
|
+
label: "Knowledge",
|
|
189
|
+
pluralLabel: "Knowledge",
|
|
190
|
+
sentenceLabel: "knowledge bundle",
|
|
191
|
+
pluralSentenceLabel: "knowledge bundles",
|
|
192
|
+
distribution: "registry",
|
|
193
|
+
placement: "workspace",
|
|
194
|
+
governs: "package-body",
|
|
195
|
+
installInputs: false,
|
|
196
|
+
workspaceCapability: null,
|
|
197
|
+
},
|
|
198
|
+
pack: {
|
|
199
|
+
plural: "packs",
|
|
200
|
+
label: "Pack",
|
|
201
|
+
pluralLabel: "Packs",
|
|
202
|
+
sentenceLabel: "pack",
|
|
203
|
+
pluralSentenceLabel: "packs",
|
|
204
|
+
distribution: "registry",
|
|
205
|
+
placement: "container",
|
|
206
|
+
governs: null,
|
|
207
|
+
installInputs: false,
|
|
208
|
+
workspaceCapability: null,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
export const extensionTypes = EffectRecord.keys(EXTENSION_TYPE_TABLE);
|
|
212
|
+
// Row union carrying its own key, so the plural-keyed view can map back to the
|
|
213
|
+
// singular type id.
|
|
214
|
+
const tableRowsWithType = EffectRecord.map(EXTENSION_TYPE_TABLE, (row, type) => ({
|
|
215
|
+
...row,
|
|
216
|
+
type,
|
|
217
|
+
}));
|
|
218
|
+
const tableByPlural = EffectRecord.mapKeys(tableRowsWithType, (_type, row) => row.plural);
|
|
219
|
+
export const extensionTypePluralSegments = EffectRecord.keys(tableByPlural);
|
|
220
|
+
const extensionTypeSet = new Set(extensionTypes);
|
|
221
|
+
export const isExtensionType = (value) => value !== undefined && extensionTypeSet.has(value);
|
|
222
|
+
const extensionTypePluralSet = new Set(extensionTypePluralSegments);
|
|
223
|
+
export const isExtensionTypePlural = (value) => value !== undefined && extensionTypePluralSet.has(value);
|
|
224
|
+
export const extensionTypeFromPlural = EffectRecord.map(tableByPlural, (row) => row.type);
|
|
225
|
+
export const extensionTypeToPlural = EffectRecord.map(EXTENSION_TYPE_TABLE, (row) => row.plural);
|
|
226
|
+
export const toExtensionType = (segment) => extensionTypeFromPlural[segment];
|
|
227
|
+
export const toExtensionTypePlural = (type) => extensionTypeToPlural[type];
|
|
228
|
+
export const extensionTypeLabels = EffectRecord.map(EXTENSION_TYPE_TABLE, (row) => row.label);
|
|
229
|
+
export const extensionTypePluralLabels = EffectRecord.map(tableByPlural, (row) => row.pluralLabel);
|
|
230
|
+
export const extensionTypeSentenceLabels = EffectRecord.map(EXTENSION_TYPE_TABLE, (row) => row.sentenceLabel);
|
|
231
|
+
export const extensionTypePluralSentenceLabels = EffectRecord.map(tableByPlural, (row) => row.pluralSentenceLabel);
|
|
232
|
+
const EXTENSION_TYPE_PLURAL_PATTERN_SOURCE = extensionTypePluralSegments.join("|");
|
|
233
|
+
export const nonPackExtensionTypePluralSegments = extensionTypePluralSegments.filter((segment) => segment !== "packs");
|
|
234
|
+
const NON_PACK_EXTENSION_TYPE_PLURAL_PATTERN_SOURCE = nonPackExtensionTypePluralSegments.join("|");
|
|
235
|
+
export const PER_AGENT_EXTENSION_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].placement === "per-agent");
|
|
236
|
+
export const WORKSPACE_EXTENSION_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].placement === "workspace");
|
|
237
|
+
export const CONTAINER_EXTENSION_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].placement === "container");
|
|
238
|
+
export const REGISTRY_EXTENSION_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].placement !== "container");
|
|
239
|
+
export const INPUT_EXTENSION_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].installInputs);
|
|
240
|
+
export const BODY_GOVERNED_EXTENSION_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].governs === "package-body");
|
|
241
|
+
export const SPEC_TRACKED_EXTENSION_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].governs !== null);
|
|
242
|
+
export const WORKSPACE_CAPABILITY_EXTENSION_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].workspaceCapability !== null);
|
|
243
|
+
/** Extension types managed purely as extensions, with no workspace capability. */
|
|
244
|
+
export const EXTENSION_ONLY_TYPES = extensionTypes.filter((type) => EXTENSION_TYPE_TABLE[type].workspaceCapability === null);
|
|
245
|
+
const EXTENSION_NAME_MAX_LENGTH = 64;
|
|
246
|
+
const EXTENSION_NAME_PATTERN_SOURCE = "[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?";
|
|
247
|
+
const EXTENSION_NAME_BRAND = "ExtensionName";
|
|
248
|
+
const INVALID_EXTENSION_NAME_MESSAGE = `Expected a valid extension name: max ${EXTENSION_NAME_MAX_LENGTH} characters, lowercase letters, numbers, and hyphens only, and not starting or ending with a hyphen (e.g., my-skill)`;
|
|
249
|
+
const makeExtensionNameSchema = () => Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(EXTENSION_NAME_PATTERN, { message: INVALID_EXTENSION_NAME_MESSAGE })), Schema.annotate({
|
|
250
|
+
identifier: "ExtensionName",
|
|
251
|
+
title: "Extension Name",
|
|
252
|
+
description: "The name of an extension — lowercase letters, numbers, and hyphens (e.g. my-skill).",
|
|
253
|
+
examples: ["my-skill", "code-review", "prettier"],
|
|
254
|
+
message: INVALID_EXTENSION_NAME_MESSAGE,
|
|
255
|
+
}), Schema.brand(EXTENSION_NAME_BRAND));
|
|
256
|
+
/**
|
|
257
|
+
* Fully qualified name regex: `@<handle>/<type>/<name>` where handle and name
|
|
258
|
+
* use the canonical handle, plural extension type, and extension name grammar.
|
|
259
|
+
*
|
|
260
|
+
* @experimental This API is unstable and may change without notice.
|
|
261
|
+
*/
|
|
262
|
+
export const FQN_PATTERN = new RegExp(`^(${HANDLE_PATTERN_SOURCE})\\/(${EXTENSION_TYPE_PLURAL_PATTERN_SOURCE})\\/(${EXTENSION_NAME_PATTERN_SOURCE})$`);
|
|
263
|
+
/**
|
|
264
|
+
* Fully qualified name regex restricted to non-pack extension types. Matches
|
|
265
|
+
* `@<handle>/<type>/<name>` where `<type>` is any plural extension type other
|
|
266
|
+
* than `packs`.
|
|
267
|
+
*
|
|
268
|
+
* @experimental This API is unstable and may change without notice.
|
|
269
|
+
*/
|
|
270
|
+
export const NON_PACK_FQN_PATTERN = new RegExp(`^(${HANDLE_PATTERN_SOURCE})\\/(${NON_PACK_EXTENSION_TYPE_PLURAL_PATTERN_SOURCE})\\/(${EXTENSION_NAME_PATTERN_SOURCE})$`);
|
|
271
|
+
/**
|
|
272
|
+
* Fully qualified name regex restricted to the pack extension type. Matches
|
|
273
|
+
* `@<handle>/packs/<name>`.
|
|
274
|
+
*
|
|
275
|
+
* @experimental This API is unstable and may change without notice.
|
|
276
|
+
*/
|
|
277
|
+
export const PACK_FQN_PATTERN = new RegExp(`^(${HANDLE_PATTERN_SOURCE})\\/packs\\/(${EXTENSION_NAME_PATTERN_SOURCE})$`);
|
|
278
|
+
const EXTENSION_SPEC_PATTERN = new RegExp(`^(${HANDLE_PATTERN_SOURCE})\\/(${EXTENSION_TYPE_PLURAL_PATTERN_SOURCE})\\/(${EXTENSION_NAME_PATTERN_SOURCE})(?:@.+)?$`);
|
|
279
|
+
const PACK_SPEC_PATTERN = new RegExp(`^(${HANDLE_PATTERN_SOURCE})\\/packs\\/(${EXTENSION_NAME_PATTERN_SOURCE})(?:@.+)?$`);
|
|
280
|
+
/**
|
|
281
|
+
* Canonical extension short name regex.
|
|
282
|
+
*/
|
|
283
|
+
export const EXTENSION_NAME_PATTERN = new RegExp(`^${EXTENSION_NAME_PATTERN_SOURCE}$`);
|
|
284
|
+
/**
|
|
285
|
+
* Canonical extension short name schema shared by generic extension surfaces.
|
|
286
|
+
*/
|
|
287
|
+
export const ExtensionNameSchema = makeExtensionNameSchema();
|
|
288
|
+
export const decodeExtensionNameSync = Schema.decodeUnknownSync(ExtensionNameSchema);
|
|
289
|
+
/**
|
|
290
|
+
* Extension type enumeration.
|
|
291
|
+
*
|
|
292
|
+
* @experimental This API is unstable and may change without notice.
|
|
293
|
+
*/
|
|
294
|
+
export const ExtensionTypeSchema = Schema.Literals(extensionTypes).annotate({
|
|
295
|
+
identifier: "ExtensionType",
|
|
296
|
+
title: "Extension Type",
|
|
297
|
+
description: "What kind of extension this is: skill, mcp-server, subagent, rule, hook, knowledge, or pack.",
|
|
298
|
+
});
|
|
299
|
+
/**
|
|
300
|
+
* Plural extension-type segment enumeration used by route/FQN surfaces.
|
|
301
|
+
*
|
|
302
|
+
* @experimental This API is unstable and may change without notice.
|
|
303
|
+
*/
|
|
304
|
+
export const ExtensionTypePluralSchema = Schema.Literals(extensionTypePluralSegments).annotate({
|
|
305
|
+
identifier: "ExtensionTypePlural",
|
|
306
|
+
title: "Extension Type (Plural)",
|
|
307
|
+
description: "Plural form of the extension type used in URLs and identifiers (e.g. skills, hooks, packs).",
|
|
308
|
+
});
|
|
309
|
+
/**
|
|
310
|
+
* Structured FQN parts schema composed from the canonical handle, type, and name schemas.
|
|
311
|
+
*
|
|
312
|
+
* @experimental This API is unstable and may change without notice.
|
|
313
|
+
*/
|
|
314
|
+
export const ExtensionFqnPartsSchema = Schema.Struct({
|
|
315
|
+
owner: HandleSchema,
|
|
316
|
+
type: ExtensionTypeSchema,
|
|
317
|
+
name: ExtensionNameSchema,
|
|
318
|
+
}).annotate({
|
|
319
|
+
identifier: "ExtensionFqnParts",
|
|
320
|
+
title: "Extension FQN Parts",
|
|
321
|
+
description: "The parts of a full extension identifier like @my-org/skills/code-review.",
|
|
322
|
+
});
|
|
323
|
+
const decodeExtensionFqnParts = Schema.decodeUnknownResult(ExtensionFqnPartsSchema);
|
|
324
|
+
/**
|
|
325
|
+
* Parse a fully qualified name string into validated structured parts.
|
|
326
|
+
*
|
|
327
|
+
* @experimental This API is unstable and may change without notice.
|
|
328
|
+
*/
|
|
329
|
+
export const parseExtensionFqnParts = (input) => {
|
|
330
|
+
const parts = input.split("/");
|
|
331
|
+
if (parts.length !== 3) {
|
|
332
|
+
return undefined;
|
|
333
|
+
}
|
|
334
|
+
const [owner, typeSegment, name] = parts;
|
|
335
|
+
if (owner === undefined || typeSegment === undefined || name === undefined) {
|
|
336
|
+
return undefined;
|
|
337
|
+
}
|
|
338
|
+
if (!isExtensionTypePlural(typeSegment)) {
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
341
|
+
const type = toExtensionType(typeSegment);
|
|
342
|
+
const result = decodeExtensionFqnParts({ owner, type, name });
|
|
343
|
+
return Result.isSuccess(result) ? result.success : undefined;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Parse an extension spec string (with optional version constraint) into parts.
|
|
347
|
+
* Strips the version constraint suffix and returns the validated FQN parts.
|
|
348
|
+
*
|
|
349
|
+
* @experimental This API is unstable and may change without notice.
|
|
350
|
+
*/
|
|
351
|
+
export const parseExtensionSpecParts = (input) => {
|
|
352
|
+
const lastSlash = input.lastIndexOf("/");
|
|
353
|
+
const constraintAt = lastSlash > 0 ? input.indexOf("@", lastSlash + 1) : -1;
|
|
354
|
+
const fqnPart = constraintAt > 0 ? input.slice(0, constraintAt) : input;
|
|
355
|
+
return parseExtensionFqnParts(fqnPart);
|
|
356
|
+
};
|
|
357
|
+
const INVALID_EXTENSION_FQN_MESSAGE = "Expected fully qualified name in @handle/(skills|mcps|subagents|rules|hooks|knowledge|packs)/name form";
|
|
358
|
+
/**
|
|
359
|
+
* Fully qualified name string schema validated against the composed handle,
|
|
360
|
+
* type, and name patterns. Annotated so JSON Schema generation surfaces a
|
|
361
|
+
* `pattern` and a top-level `ExtensionFqn` definition that `Schema.Record`
|
|
362
|
+
* keys can reference via `propertyNames`.
|
|
363
|
+
*
|
|
364
|
+
* @experimental This API is unstable and may change without notice.
|
|
365
|
+
*/
|
|
366
|
+
export const ExtensionFqnSchema = Schema.String.pipe(Schema.check(Schema.isPattern(FQN_PATTERN, { message: INVALID_EXTENSION_FQN_MESSAGE })), Schema.annotate({
|
|
367
|
+
identifier: "ExtensionFqn",
|
|
368
|
+
title: "Extension FQN",
|
|
369
|
+
description: "Canonical extension identifier in @owner/<type>s/<name> form.",
|
|
370
|
+
examples: ["@acme/skills/code-review", "@my-org/rules/typescript"],
|
|
371
|
+
message: INVALID_EXTENSION_FQN_MESSAGE,
|
|
372
|
+
}));
|
|
373
|
+
const INVALID_NON_PACK_EXTENSION_FQN_MESSAGE = "Expected fully qualified name in @handle/(skills|mcps|subagents|rules|hooks|knowledge)/name form (packs are not allowed)";
|
|
374
|
+
/**
|
|
375
|
+
* Fully qualified name string schema restricted to non-pack extension types.
|
|
376
|
+
* Used wherever pack-typed FQNs are not permitted, like the keys of a pack
|
|
377
|
+
* manifest's `dependencies` map.
|
|
378
|
+
*
|
|
379
|
+
* @experimental This API is unstable and may change without notice.
|
|
380
|
+
*/
|
|
381
|
+
export const NonPackExtensionFqnSchema = Schema.String.pipe(Schema.check(Schema.isPattern(NON_PACK_FQN_PATTERN, { message: INVALID_NON_PACK_EXTENSION_FQN_MESSAGE })), Schema.annotate({
|
|
382
|
+
identifier: "NonPackExtensionFqn",
|
|
383
|
+
title: "Non-Pack Extension FQN",
|
|
384
|
+
description: "Extension identifier restricted to non-pack types (skills, mcps, subagents, rules, hooks, knowledge).",
|
|
385
|
+
examples: ["@acme/skills/code-review", "@my-org/rules/typescript"],
|
|
386
|
+
message: INVALID_NON_PACK_EXTENSION_FQN_MESSAGE,
|
|
387
|
+
}));
|
|
388
|
+
const INVALID_PACK_FQN_MESSAGE = "Expected fully qualified pack name in @handle/packs/name form";
|
|
389
|
+
/**
|
|
390
|
+
* Fully qualified name string schema restricted to the pack extension type.
|
|
391
|
+
* Used wherever only pack-typed FQNs are permitted, like the items of a
|
|
392
|
+
* non-pack manifest's `recommendedPacks` list.
|
|
393
|
+
*
|
|
394
|
+
* @experimental This API is unstable and may change without notice.
|
|
395
|
+
*/
|
|
396
|
+
export const PackFqnSchema = Schema.String.pipe(Schema.check(Schema.isPattern(PACK_FQN_PATTERN, { message: INVALID_PACK_FQN_MESSAGE })), Schema.annotate({
|
|
397
|
+
identifier: "PackFqn",
|
|
398
|
+
title: "Pack FQN",
|
|
399
|
+
description: "Pack identifier in @owner/packs/<name> form.",
|
|
400
|
+
examples: ["@acme/packs/typescript", "@my-org/packs/web"],
|
|
401
|
+
message: INVALID_PACK_FQN_MESSAGE,
|
|
402
|
+
}));
|
|
403
|
+
/**
|
|
404
|
+
* Extension spec — fully qualified extension name with an optional version
|
|
405
|
+
* constraint suffix. Accepts `@owner/type/name` or `@owner/type/name@constraint`
|
|
406
|
+
* where the FQN portion validates through ExtensionFqnSchema and the optional
|
|
407
|
+
* constraint validates as a semver VersionRange.
|
|
408
|
+
*
|
|
409
|
+
* @experimental This API is unstable and may change without notice.
|
|
410
|
+
*/
|
|
411
|
+
export const ExtensionSpecSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.makeFilter((value) => {
|
|
412
|
+
// Find the constraint separator: the @ after the last slash
|
|
413
|
+
const lastSlash = value.lastIndexOf("/");
|
|
414
|
+
const constraintAt = lastSlash > 0 ? value.indexOf("@", lastSlash + 1) : -1;
|
|
415
|
+
const fqnPart = constraintAt > 0 ? value.slice(0, constraintAt) : value;
|
|
416
|
+
const constraintPart = constraintAt > 0 ? value.slice(constraintAt + 1) : undefined;
|
|
417
|
+
// Validate FQN portion
|
|
418
|
+
if (parseExtensionFqnParts(fqnPart) === undefined) {
|
|
419
|
+
return `Expected extension spec in @handle/type/name[@constraint] form, got: ${value}`;
|
|
420
|
+
}
|
|
421
|
+
// Validate constraint portion if present
|
|
422
|
+
if (constraintPart !== undefined) {
|
|
423
|
+
const constraintResult = Schema.decodeUnknownResult(VersionRangeSchema)(constraintPart);
|
|
424
|
+
if (Result.isFailure(constraintResult)) {
|
|
425
|
+
return `Expected valid version constraint after @, got: ${constraintPart}`;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return undefined;
|
|
429
|
+
})), Schema.check(Schema.isPattern(EXTENSION_SPEC_PATTERN, {
|
|
430
|
+
message: "Expected extension spec in @handle/type/name[@constraint] form",
|
|
431
|
+
})), Schema.annotate({
|
|
432
|
+
identifier: "ExtensionSpec",
|
|
433
|
+
title: "Extension Spec",
|
|
434
|
+
description: "Extension reference with an optional version constraint suffix.",
|
|
435
|
+
examples: ["@acme/skills/code-review", "@acme/skills/code-review@^1.0.0"],
|
|
436
|
+
}), Schema.brand("ExtensionSpec"));
|
|
437
|
+
/**
|
|
438
|
+
* Pack spec — fully qualified pack name with an optional version constraint
|
|
439
|
+
* suffix. Accepts `@owner/packs/name` or `@owner/packs/name@constraint` where
|
|
440
|
+
* the FQN portion validates through PackFqnSchema and the optional constraint
|
|
441
|
+
* validates as a semver VersionRange.
|
|
442
|
+
*
|
|
443
|
+
* @experimental This API is unstable and may change without notice.
|
|
444
|
+
*/
|
|
445
|
+
export const PackSpecSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.makeFilter((value) => {
|
|
446
|
+
const lastSlash = value.lastIndexOf("/");
|
|
447
|
+
const constraintAt = lastSlash > 0 ? value.indexOf("@", lastSlash + 1) : -1;
|
|
448
|
+
const fqnPart = constraintAt > 0 ? value.slice(0, constraintAt) : value;
|
|
449
|
+
const constraintPart = constraintAt > 0 ? value.slice(constraintAt + 1) : undefined;
|
|
450
|
+
if (!PACK_FQN_PATTERN.test(fqnPart)) {
|
|
451
|
+
return `Expected pack spec in @handle/packs/name[@constraint] form, got: ${value}`;
|
|
452
|
+
}
|
|
453
|
+
if (constraintPart !== undefined) {
|
|
454
|
+
const constraintResult = Schema.decodeUnknownResult(VersionRangeSchema)(constraintPart);
|
|
455
|
+
if (Result.isFailure(constraintResult)) {
|
|
456
|
+
return `Expected valid version constraint after @, got: ${constraintPart}`;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return undefined;
|
|
460
|
+
})), Schema.check(Schema.isPattern(PACK_SPEC_PATTERN, {
|
|
461
|
+
message: "Expected pack spec in @handle/packs/name[@constraint] form",
|
|
462
|
+
})), Schema.annotate({
|
|
463
|
+
identifier: "PackSpec",
|
|
464
|
+
title: "Pack Spec",
|
|
465
|
+
description: "Pack reference with an optional version constraint suffix.",
|
|
466
|
+
examples: ["@acme/packs/typescript", "@acme/packs/typescript@^1.0.0"],
|
|
467
|
+
}), Schema.brand("PackSpec"));
|
|
468
|
+
/**
|
|
469
|
+
* Map of fully-qualified extension names to semver constraints.
|
|
470
|
+
*
|
|
471
|
+
* @experimental This API is unstable and may change without notice.
|
|
472
|
+
*/
|
|
473
|
+
export const ExtensionDependencyConstraintMapSchema = Schema.Record(Schema.String, VersionRangeSchema).check(Schema.isPropertyNames(ExtensionFqnSchema));
|
|
474
|
+
/**
|
|
475
|
+
* Map of non-pack fully-qualified extension names to semver constraints.
|
|
476
|
+
* Used for pack manifest `dependencies`, which cannot include other packs.
|
|
477
|
+
*
|
|
478
|
+
* @experimental This API is unstable and may change without notice.
|
|
479
|
+
*/
|
|
480
|
+
export const NonPackExtensionDependencyConstraintMapSchema = Schema.Record(Schema.String, VersionRangeSchema)
|
|
481
|
+
.check(Schema.isPropertyNames(NonPackExtensionFqnSchema))
|
|
482
|
+
.annotate({
|
|
483
|
+
description: "Map of fully-qualified non-pack extension names to version ranges. Packs cannot depend on other packs.",
|
|
484
|
+
});
|
|
485
|
+
/**
|
|
486
|
+
* Publish-time packaging options.
|
|
487
|
+
*
|
|
488
|
+
* Declared in the manifest rather than in workspace settings so the policy
|
|
489
|
+
* travels with the package: whoever publishes a checkout produces the same
|
|
490
|
+
* archive. Absent means every file under the package directory is published,
|
|
491
|
+
* which is the default and the only behavior before this field existed.
|
|
492
|
+
*
|
|
493
|
+
* @experimental This API is unstable and may change without notice.
|
|
494
|
+
*/
|
|
495
|
+
export const ExtensionVisibilitySchema = Schema.Literals(["public", "private"]).annotate({
|
|
496
|
+
identifier: "ExtensionVisibility",
|
|
497
|
+
title: "Extension Visibility",
|
|
498
|
+
description: "Whole-Extension Registry visibility applied to every published version.",
|
|
499
|
+
});
|
|
500
|
+
export const PublishOptionsSchema = Schema.Struct({
|
|
501
|
+
visibility: Schema.optional(ExtensionVisibilitySchema.annotate({
|
|
502
|
+
description: "Intended whole-Extension Registry visibility. Establishes new Extensions and must match established Extensions.",
|
|
503
|
+
})),
|
|
504
|
+
ignore: Schema.optional(Schema.Array(Schema.NonEmptyString)
|
|
505
|
+
.pipe(Schema.check(Schema.isUnique()))
|
|
506
|
+
.annotate({
|
|
507
|
+
description: "Registry-only archive exclusions matched against package-relative POSIX paths. Matching files are omitted only from published archives; local, Git, workspace, import, fork, and agent projection behavior is unchanged. `*` is the only wildcard, is case-sensitive, and spans `/`. An explicit empty array records a reviewed publish-all decision.",
|
|
508
|
+
examples: [[], ["evals/*"]],
|
|
509
|
+
})),
|
|
510
|
+
}).annotate({
|
|
511
|
+
identifier: "PublishOptions",
|
|
512
|
+
title: "Publish Options",
|
|
513
|
+
description: "Publication policy and archive options for this extension.",
|
|
514
|
+
});
|
|
515
|
+
/**
|
|
516
|
+
* Common base fields shared across manifest types.
|
|
517
|
+
* Type-specific manifests provide their own `type` and `name` fields explicitly.
|
|
518
|
+
*
|
|
519
|
+
* @experimental This API is unstable and may change without notice.
|
|
520
|
+
*/
|
|
521
|
+
export const CommonManifestBaseFields = {
|
|
522
|
+
publish: Schema.optional(PublishOptionsSchema),
|
|
523
|
+
metadata: Schema.optional(ExtensionMetadataSchema),
|
|
524
|
+
owner: HandleSchema.pipe(Schema.annotateKey({ messageMissingKey: "owner is required" })),
|
|
525
|
+
version: VersionSchema.pipe(Schema.annotateKey({ messageMissingKey: "version is required" })),
|
|
526
|
+
description: Schema.optional(Schema.String.annotate({
|
|
527
|
+
description: "Short, registry-facing summary of this extension shown in listings and search results.",
|
|
528
|
+
})),
|
|
529
|
+
keywords: Schema.optional(Schema.Array(Schema.NonEmptyString).annotate({
|
|
530
|
+
examples: [["lint", "typescript", "review"]],
|
|
531
|
+
})),
|
|
532
|
+
repository: Schema.optional(RepositorySchema),
|
|
533
|
+
homepage: Schema.optional(Schema.String.annotate({
|
|
534
|
+
examples: ["https://acme.dev/code-review"],
|
|
535
|
+
format: "uri",
|
|
536
|
+
})),
|
|
537
|
+
license: Schema.optional(LicenseSchema),
|
|
538
|
+
bugs: Schema.optional(BugsSchema),
|
|
539
|
+
authors: Schema.optional(Schema.Array(AuthorSchema)),
|
|
540
|
+
packages: Schema.optional(Schema.Array(CompanionPackageSchema).pipe(Schema.annotate({
|
|
541
|
+
description: "External ecosystem packages this extension is designed to work with, declared as identity Package URLs with optional VERS compatibility ranges.",
|
|
542
|
+
}))),
|
|
543
|
+
};
|
|
544
|
+
/**
|
|
545
|
+
* Fields shared across non-pack extension manifests. These describe how an
|
|
546
|
+
* extension relates to packs.
|
|
547
|
+
*
|
|
548
|
+
* @experimental This API is unstable and may change without notice.
|
|
549
|
+
*/
|
|
550
|
+
export const NonPackManifestFields = {
|
|
551
|
+
enhances: Schema.optional(Schema.Array(Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)?$/, {
|
|
552
|
+
message: "Expected a lowercase kebab-case capability key with an optional :grade suffix.",
|
|
553
|
+
}))))
|
|
554
|
+
.pipe(Schema.check(Schema.isUnique()))
|
|
555
|
+
.annotate({
|
|
556
|
+
description: "Soft capability enhancements used by the source. These never block installation.",
|
|
557
|
+
})),
|
|
558
|
+
requires: Schema.optional(Schema.Array(Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)?$/, {
|
|
559
|
+
message: "Expected a lowercase kebab-case capability key with an optional :grade suffix.",
|
|
560
|
+
}))))
|
|
561
|
+
.pipe(Schema.check(Schema.isUnique()))
|
|
562
|
+
.annotate({
|
|
563
|
+
description: "Hard capabilities without which the extension cannot operate.",
|
|
564
|
+
})),
|
|
565
|
+
fallback: Schema.optional(Schema.Literals(["auto", "none"]).annotate({
|
|
566
|
+
description: "Whether AXM may apply platform-provided capability fallbacks. Defaults to auto.",
|
|
567
|
+
default: "auto",
|
|
568
|
+
})),
|
|
569
|
+
recommendedPacks: Schema.optional(Schema.Array(PackSpecSchema).pipe(Schema.annotate({
|
|
570
|
+
description: "Pack recommendations and same-pack composition metadata. Entries do not install or guarantee the pack or its members.",
|
|
571
|
+
}))),
|
|
572
|
+
standalone: Schema.optional(Schema.Boolean.pipe(Schema.annotate({
|
|
573
|
+
description: "False means the extension requires sibling extensions that are direct members of a pack named in recommendedPacks; it does not create dependencies.",
|
|
574
|
+
default: true,
|
|
575
|
+
}))),
|
|
576
|
+
};
|
|
577
|
+
/**
|
|
578
|
+
* Agent identifier enumeration for supported coding agents.
|
|
579
|
+
*
|
|
580
|
+
* Derived from `AGENT_IDS` in agents/types.ts — compile-time enforced,
|
|
581
|
+
* no manual sync required.
|
|
582
|
+
*
|
|
583
|
+
* @experimental This API is unstable and may change without notice.
|
|
584
|
+
*/
|
|
585
|
+
export const AgentIdSchema = Schema.Literals([...AGENT_IDS]).annotate({
|
|
586
|
+
identifier: "AgentId",
|
|
587
|
+
title: "Agent ID",
|
|
588
|
+
description: "Supported coding agent identifier.",
|
|
589
|
+
examples: ["claude-code", "codex", "cursor"],
|
|
590
|
+
});
|
|
591
|
+
/**
|
|
592
|
+
* Agent identifiers users may persist in `axm.json`.
|
|
593
|
+
*
|
|
594
|
+
* Synthetic materialization targets such as `universal` are known agents, but
|
|
595
|
+
* they are injected by repository code rather than configured by users.
|
|
596
|
+
*
|
|
597
|
+
* @experimental This API is unstable and may change without notice.
|
|
598
|
+
*/
|
|
599
|
+
export const ConfigurableAgentIdSchema = Schema.Literals([...CONFIGURABLE_AGENT_IDS]).annotate({
|
|
600
|
+
identifier: "ConfigurableAgentId",
|
|
601
|
+
title: "Configurable Agent ID",
|
|
602
|
+
description: "Supported coding agent identifier used in workspace settings `agents`.",
|
|
603
|
+
examples: ["claude-code", "codex", "cursor"],
|
|
604
|
+
});
|
|
605
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity deprecation vocabulary carried by resolved extension references.
|
|
3
|
+
*
|
|
4
|
+
* A registry-resolved ref commits to the deprecation evidence captured at
|
|
5
|
+
* resolution time, so the view lives with the extension identity vocabulary.
|
|
6
|
+
* Publisher-management composites (transitions, management views) stay in
|
|
7
|
+
* `@agentxm/registry-protocol`.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is unstable and may change without notice.
|
|
10
|
+
*/
|
|
11
|
+
import * as Schema from "effect/Schema";
|
|
12
|
+
export declare const DeprecationReplacementSchema: Schema.Union<readonly [Schema.Struct<{
|
|
13
|
+
readonly status: Schema.Literal<"available">;
|
|
14
|
+
readonly fqn: Schema.String;
|
|
15
|
+
}>, Schema.Struct<{
|
|
16
|
+
readonly status: Schema.Literal<"unavailable">;
|
|
17
|
+
readonly fqn: Schema.optional<Schema.String>;
|
|
18
|
+
}>]>;
|
|
19
|
+
export declare const DeprecationViewSchema: Schema.Union<readonly [Schema.Struct<{
|
|
20
|
+
readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
|
|
21
|
+
readonly message: Schema.String;
|
|
22
|
+
readonly replacement: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
23
|
+
readonly status: Schema.Literal<"available">;
|
|
24
|
+
readonly fqn: Schema.String;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly status: Schema.Literal<"unavailable">;
|
|
27
|
+
readonly fqn: Schema.optional<Schema.String>;
|
|
28
|
+
}>]>>;
|
|
29
|
+
}>, Schema.Struct<{
|
|
30
|
+
readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
|
|
31
|
+
readonly message: Schema.optional<Schema.String>;
|
|
32
|
+
readonly replacement: Schema.Union<readonly [Schema.Struct<{
|
|
33
|
+
readonly status: Schema.Literal<"available">;
|
|
34
|
+
readonly fqn: Schema.String;
|
|
35
|
+
}>, Schema.Struct<{
|
|
36
|
+
readonly status: Schema.Literal<"unavailable">;
|
|
37
|
+
readonly fqn: Schema.optional<Schema.String>;
|
|
38
|
+
}>]>;
|
|
39
|
+
}>]>;
|
|
40
|
+
export type DeprecationReplacement = typeof DeprecationReplacementSchema.Type;
|
|
41
|
+
export type DeprecationView = typeof DeprecationViewSchema.Type;
|
|
42
|
+
//# sourceMappingURL=deprecation.d.ts.map
|