@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,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook manifest schema definition.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
*/
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
export declare const HOOK_MANIFEST_FILENAME = "hook.json";
|
|
8
|
+
export declare const HOOK_EXTENSION_DIR = "hooks";
|
|
9
|
+
export declare const HOOK_MANIFEST_SCHEMA_URL = "https://axm.sh/schemas/hook.schema.json";
|
|
10
|
+
export declare const HookRuntimeSchema: Schema.Literals<readonly ["bash", "node", "python"]>;
|
|
11
|
+
/** @experimental */
|
|
12
|
+
export type HookRuntime = Schema.Schema.Type<typeof HookRuntimeSchema>;
|
|
13
|
+
export declare const HookEventSchema: Schema.Literals<readonly ["session.start", "prompt.submit", "turn.end", "tool.pre", "tool.post", "subagent.stop", "compaction.pre"]>;
|
|
14
|
+
/** @experimental */
|
|
15
|
+
export type HookEvent = Schema.Schema.Type<typeof HookEventSchema>;
|
|
16
|
+
export declare const HookMatchSchema: Schema.Struct<{
|
|
17
|
+
readonly tools: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["file.read", "file.write", "file.edit", "shell.exec", "web.fetch", "mcp.call"]>>>;
|
|
18
|
+
}>;
|
|
19
|
+
/** @experimental */
|
|
20
|
+
export type HookMatch = Schema.Schema.Type<typeof HookMatchSchema>;
|
|
21
|
+
export declare const HookDecisionRequirementSchema: Schema.Union<readonly [Schema.Struct<{
|
|
22
|
+
readonly kind: Schema.Literal<"observe">;
|
|
23
|
+
}>, Schema.Struct<{
|
|
24
|
+
readonly kind: Schema.Literal<"block">;
|
|
25
|
+
readonly outcomes: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["allow", "deny", "ask"]>>>;
|
|
26
|
+
}>, Schema.Struct<{
|
|
27
|
+
readonly kind: Schema.Literal<"modify">;
|
|
28
|
+
readonly operations: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["modify-input", "inject-context", "modify-output", "synthesize", "redact"]>>>;
|
|
29
|
+
}>]>;
|
|
30
|
+
/** @experimental */
|
|
31
|
+
export type HookDecisionRequirement = Schema.Schema.Type<typeof HookDecisionRequirementSchema>;
|
|
32
|
+
export declare const HookBindingTargetSchema: Schema.Struct<{
|
|
33
|
+
readonly matcherRaw: Schema.optional<Schema.NonEmptyString>;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const CanonicalHookBindingSchema: Schema.Struct<{
|
|
36
|
+
readonly on: Schema.Literals<readonly ["session.start", "prompt.submit", "turn.end", "tool.pre", "tool.post", "subagent.stop", "compaction.pre"]>;
|
|
37
|
+
readonly match: Schema.optional<Schema.Struct<{
|
|
38
|
+
readonly tools: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["file.read", "file.write", "file.edit", "shell.exec", "web.fetch", "mcp.call"]>>>;
|
|
39
|
+
}>>;
|
|
40
|
+
readonly matcherRaw: Schema.optional<Schema.NonEmptyString>;
|
|
41
|
+
readonly targets: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
42
|
+
readonly matcherRaw: Schema.optional<Schema.NonEmptyString>;
|
|
43
|
+
}>>>;
|
|
44
|
+
readonly requires: Schema.optional<Schema.Struct<{
|
|
45
|
+
readonly decision: Schema.Union<readonly [Schema.Struct<{
|
|
46
|
+
readonly kind: Schema.Literal<"observe">;
|
|
47
|
+
}>, Schema.Struct<{
|
|
48
|
+
readonly kind: Schema.Literal<"block">;
|
|
49
|
+
readonly outcomes: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["allow", "deny", "ask"]>>>;
|
|
50
|
+
}>, Schema.Struct<{
|
|
51
|
+
readonly kind: Schema.Literal<"modify">;
|
|
52
|
+
readonly operations: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["modify-input", "inject-context", "modify-output", "synthesize", "redact"]>>>;
|
|
53
|
+
}>]>;
|
|
54
|
+
}>>;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const HookBindingSchema: Schema.Struct<{
|
|
57
|
+
readonly on: Schema.Literals<readonly ["session.start", "prompt.submit", "turn.end", "tool.pre", "tool.post", "subagent.stop", "compaction.pre"]>;
|
|
58
|
+
readonly match: Schema.optional<Schema.Struct<{
|
|
59
|
+
readonly tools: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["file.read", "file.write", "file.edit", "shell.exec", "web.fetch", "mcp.call"]>>>;
|
|
60
|
+
}>>;
|
|
61
|
+
readonly matcherRaw: Schema.optional<Schema.NonEmptyString>;
|
|
62
|
+
readonly targets: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
63
|
+
readonly matcherRaw: Schema.optional<Schema.NonEmptyString>;
|
|
64
|
+
}>>>;
|
|
65
|
+
readonly requires: Schema.optional<Schema.Struct<{
|
|
66
|
+
readonly decision: Schema.Union<readonly [Schema.Struct<{
|
|
67
|
+
readonly kind: Schema.Literal<"observe">;
|
|
68
|
+
}>, Schema.Struct<{
|
|
69
|
+
readonly kind: Schema.Literal<"block">;
|
|
70
|
+
readonly outcomes: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["allow", "deny", "ask"]>>>;
|
|
71
|
+
}>, Schema.Struct<{
|
|
72
|
+
readonly kind: Schema.Literal<"modify">;
|
|
73
|
+
readonly operations: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["modify-input", "inject-context", "modify-output", "synthesize", "redact"]>>>;
|
|
74
|
+
}>]>;
|
|
75
|
+
}>>;
|
|
76
|
+
}>;
|
|
77
|
+
/** @experimental */
|
|
78
|
+
export type HookBinding = Schema.Schema.Type<typeof HookBindingSchema>;
|
|
79
|
+
export declare const HookCapabilitiesSchema: Schema.Struct<{
|
|
80
|
+
readonly network: Schema.optional<Schema.Boolean>;
|
|
81
|
+
readonly filesystemWrite: Schema.optional<Schema.Boolean>;
|
|
82
|
+
readonly exec: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
83
|
+
readonly env: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
84
|
+
}>;
|
|
85
|
+
/** @experimental */
|
|
86
|
+
export type HookCapabilities = Schema.Schema.Type<typeof HookCapabilitiesSchema>;
|
|
87
|
+
/**
|
|
88
|
+
* Schema for hook manifest files (hook.json).
|
|
89
|
+
*
|
|
90
|
+
* Hooks distribute an executable body plus agent event bindings. Install
|
|
91
|
+
* materializes the body under agent_extensions and registers native agent hook
|
|
92
|
+
* settings that invoke the materialized entrypoint.
|
|
93
|
+
*
|
|
94
|
+
* @experimental This API is unstable and may change without notice.
|
|
95
|
+
*/
|
|
96
|
+
export declare const HookManifestSchema: Schema.Struct<{
|
|
97
|
+
readonly type: Schema.Literal<"hook">;
|
|
98
|
+
readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
|
|
99
|
+
readonly title: Schema.optional<Schema.NonEmptyString>;
|
|
100
|
+
readonly runtime: Schema.Literals<readonly ["bash", "node", "python"]>;
|
|
101
|
+
readonly entrypoint: Schema.NonEmptyString;
|
|
102
|
+
readonly bindings: Schema.$Array<Schema.Struct<{
|
|
103
|
+
readonly on: Schema.Literals<readonly ["session.start", "prompt.submit", "turn.end", "tool.pre", "tool.post", "subagent.stop", "compaction.pre"]>;
|
|
104
|
+
readonly match: Schema.optional<Schema.Struct<{
|
|
105
|
+
readonly tools: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["file.read", "file.write", "file.edit", "shell.exec", "web.fetch", "mcp.call"]>>>;
|
|
106
|
+
}>>;
|
|
107
|
+
readonly matcherRaw: Schema.optional<Schema.NonEmptyString>;
|
|
108
|
+
readonly targets: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
109
|
+
readonly matcherRaw: Schema.optional<Schema.NonEmptyString>;
|
|
110
|
+
}>>>;
|
|
111
|
+
readonly requires: Schema.optional<Schema.Struct<{
|
|
112
|
+
readonly decision: Schema.Union<readonly [Schema.Struct<{
|
|
113
|
+
readonly kind: Schema.Literal<"observe">;
|
|
114
|
+
}>, Schema.Struct<{
|
|
115
|
+
readonly kind: Schema.Literal<"block">;
|
|
116
|
+
readonly outcomes: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["allow", "deny", "ask"]>>>;
|
|
117
|
+
}>, Schema.Struct<{
|
|
118
|
+
readonly kind: Schema.Literal<"modify">;
|
|
119
|
+
readonly operations: Schema.optional<Schema.NonEmptyArray<Schema.Literals<readonly ["modify-input", "inject-context", "modify-output", "synthesize", "redact"]>>>;
|
|
120
|
+
}>]>;
|
|
121
|
+
}>>;
|
|
122
|
+
}>>;
|
|
123
|
+
readonly timeoutMs: Schema.optional<Schema.Int>;
|
|
124
|
+
readonly capabilities: Schema.optional<Schema.Struct<{
|
|
125
|
+
readonly network: Schema.optional<Schema.Boolean>;
|
|
126
|
+
readonly filesystemWrite: Schema.optional<Schema.Boolean>;
|
|
127
|
+
readonly exec: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
128
|
+
readonly env: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
129
|
+
}>>;
|
|
130
|
+
readonly enhances: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
131
|
+
readonly requires: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
132
|
+
readonly fallback: Schema.optional<Schema.Literals<readonly ["auto", "none"]>>;
|
|
133
|
+
readonly recommendedPacks: Schema.optional<Schema.$Array<Schema.brand<Schema.NonEmptyString, "PackSpec">>>;
|
|
134
|
+
readonly standalone: Schema.optional<Schema.Boolean>;
|
|
135
|
+
readonly publish: Schema.optional<Schema.Struct<{
|
|
136
|
+
readonly visibility: Schema.optional<Schema.Literals<readonly ["public", "private"]>>;
|
|
137
|
+
readonly ignore: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
138
|
+
}>>;
|
|
139
|
+
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
140
|
+
readonly owner: Schema.brand<Schema.String, "Handle">;
|
|
141
|
+
readonly version: Schema.brand<Schema.String, "Version">;
|
|
142
|
+
readonly description: Schema.optional<Schema.String>;
|
|
143
|
+
readonly keywords: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
144
|
+
readonly repository: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
145
|
+
readonly type: Schema.optional<Schema.NonEmptyString>;
|
|
146
|
+
readonly url: Schema.NonEmptyString;
|
|
147
|
+
readonly directory: Schema.optional<Schema.NonEmptyString>;
|
|
148
|
+
}>]>>;
|
|
149
|
+
readonly homepage: Schema.optional<Schema.String>;
|
|
150
|
+
readonly license: Schema.optional<Schema.String>;
|
|
151
|
+
readonly bugs: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
152
|
+
readonly url: Schema.optional<Schema.NonEmptyString>;
|
|
153
|
+
readonly email: Schema.optional<Schema.NonEmptyString>;
|
|
154
|
+
}>]>>;
|
|
155
|
+
readonly authors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
156
|
+
readonly name: Schema.String;
|
|
157
|
+
readonly email: Schema.optional<Schema.String>;
|
|
158
|
+
readonly url: Schema.optional<Schema.String>;
|
|
159
|
+
}>>>;
|
|
160
|
+
readonly packages: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
161
|
+
readonly purl: Schema.brand<Schema.NonEmptyString, "PackageIdentityPurl">;
|
|
162
|
+
readonly versionRange: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.Struct<{
|
|
163
|
+
readonly raw: Schema.NonEmptyString;
|
|
164
|
+
readonly scheme: Schema.NonEmptyString;
|
|
165
|
+
readonly constraints: Schema.$Array<Schema.Struct<{
|
|
166
|
+
readonly comparator: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
|
|
167
|
+
readonly version: Schema.NonEmptyString;
|
|
168
|
+
}>>;
|
|
169
|
+
}>>, Schema.NonEmptyString, never, never>, "VersRange">>;
|
|
170
|
+
}>>>;
|
|
171
|
+
readonly $schema: Schema.optional<Schema.String>;
|
|
172
|
+
}>;
|
|
173
|
+
/** @experimental */
|
|
174
|
+
export type HookManifest = Schema.Schema.Type<typeof HookManifestSchema>;
|
|
175
|
+
//# sourceMappingURL=manifest-schema.d.ts.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook manifest schema definition.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
*/
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import { CanonicalHookEventIdSchema, CanonicalHookToolIdSchema, HookBlockOutcomeSchema, HookModifyOperationSchema, } from "../agent-capabilities/index.js";
|
|
8
|
+
import { CommonManifestBaseFields, ExtensionNameSchema, NonPackManifestFields, } from "../extensions/common.js";
|
|
9
|
+
export const HOOK_MANIFEST_FILENAME = "hook.json";
|
|
10
|
+
export const HOOK_EXTENSION_DIR = "hooks";
|
|
11
|
+
export const HOOK_MANIFEST_SCHEMA_URL = "https://axm.sh/schemas/hook.schema.json";
|
|
12
|
+
export const HookRuntimeSchema = Schema.Literals(["bash", "node", "python"]).annotate({
|
|
13
|
+
identifier: "HookRuntime",
|
|
14
|
+
title: "Hook Runtime",
|
|
15
|
+
description: "Interpreter family used to execute the materialized hook entrypoint.",
|
|
16
|
+
});
|
|
17
|
+
export const HookEventSchema = CanonicalHookEventIdSchema.annotate({
|
|
18
|
+
identifier: "HookEvent",
|
|
19
|
+
title: "Hook Event",
|
|
20
|
+
description: "Canonical AXM hook event this extension binds to.",
|
|
21
|
+
});
|
|
22
|
+
export const HookMatchSchema = Schema.Struct({
|
|
23
|
+
tools: Schema.optional(Schema.NonEmptyArray(CanonicalHookToolIdSchema).pipe(Schema.check(Schema.isUnique()))),
|
|
24
|
+
}).annotate({
|
|
25
|
+
identifier: "HookMatch",
|
|
26
|
+
title: "Hook Match",
|
|
27
|
+
description: "Portable hook matcher expressed over AXM canonical tool IDs.",
|
|
28
|
+
});
|
|
29
|
+
export const HookDecisionRequirementSchema = Schema.Union([
|
|
30
|
+
Schema.Struct({ kind: Schema.Literal("observe") }),
|
|
31
|
+
Schema.Struct({
|
|
32
|
+
kind: Schema.Literal("block"),
|
|
33
|
+
outcomes: Schema.optional(Schema.NonEmptyArray(HookBlockOutcomeSchema).pipe(Schema.check(Schema.isUnique()))),
|
|
34
|
+
}),
|
|
35
|
+
Schema.Struct({
|
|
36
|
+
kind: Schema.Literal("modify"),
|
|
37
|
+
operations: Schema.optional(Schema.NonEmptyArray(HookModifyOperationSchema).pipe(Schema.check(Schema.isUnique()))),
|
|
38
|
+
}),
|
|
39
|
+
]).annotate({
|
|
40
|
+
identifier: "HookDecisionRequirement",
|
|
41
|
+
title: "Hook Decision Requirement",
|
|
42
|
+
description: "Decision capability a hook binding requires from the target agent event.",
|
|
43
|
+
});
|
|
44
|
+
export const HookBindingTargetSchema = Schema.Struct({
|
|
45
|
+
matcherRaw: Schema.optional(Schema.NonEmptyString),
|
|
46
|
+
}).annotate({
|
|
47
|
+
identifier: "HookBindingTarget",
|
|
48
|
+
title: "Hook Binding Target",
|
|
49
|
+
description: "Target-agent-specific hook binding escape hatches.",
|
|
50
|
+
});
|
|
51
|
+
export const CanonicalHookBindingSchema = Schema.Struct({
|
|
52
|
+
on: HookEventSchema,
|
|
53
|
+
match: Schema.optional(HookMatchSchema),
|
|
54
|
+
matcherRaw: Schema.optional(Schema.NonEmptyString),
|
|
55
|
+
targets: Schema.optional(Schema.Record(Schema.String, HookBindingTargetSchema)),
|
|
56
|
+
requires: Schema.optional(Schema.Struct({
|
|
57
|
+
decision: HookDecisionRequirementSchema,
|
|
58
|
+
})),
|
|
59
|
+
}).annotate({
|
|
60
|
+
identifier: "CanonicalHookBinding",
|
|
61
|
+
title: "Canonical Hook Binding",
|
|
62
|
+
description: "Universal hook event binding expressed in AXM canonical vocabulary.",
|
|
63
|
+
});
|
|
64
|
+
export const HookBindingSchema = CanonicalHookBindingSchema.annotate({
|
|
65
|
+
identifier: "HookBinding",
|
|
66
|
+
title: "Hook Binding",
|
|
67
|
+
description: "Universal hook event binding with portable canonical matching and raw native escape hatches.",
|
|
68
|
+
});
|
|
69
|
+
export const HookCapabilitiesSchema = Schema.Struct({
|
|
70
|
+
network: Schema.optional(Schema.Boolean),
|
|
71
|
+
filesystemWrite: Schema.optional(Schema.Boolean),
|
|
72
|
+
exec: Schema.optional(Schema.Array(Schema.NonEmptyString)),
|
|
73
|
+
env: Schema.optional(Schema.Array(Schema.NonEmptyString)),
|
|
74
|
+
}).annotate({
|
|
75
|
+
identifier: "HookCapabilities",
|
|
76
|
+
title: "Hook Capabilities",
|
|
77
|
+
description: "Advisory author-declared hook capability surface. v1 does not enforce it.",
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* Schema for hook manifest files (hook.json).
|
|
81
|
+
*
|
|
82
|
+
* Hooks distribute an executable body plus agent event bindings. Install
|
|
83
|
+
* materializes the body under agent_extensions and registers native agent hook
|
|
84
|
+
* settings that invoke the materialized entrypoint.
|
|
85
|
+
*
|
|
86
|
+
* @experimental This API is unstable and may change without notice.
|
|
87
|
+
*/
|
|
88
|
+
export const HookManifestSchema = Schema.Struct({
|
|
89
|
+
$schema: Schema.optional(Schema.String),
|
|
90
|
+
...CommonManifestBaseFields,
|
|
91
|
+
...NonPackManifestFields,
|
|
92
|
+
type: Schema.Literal("hook"),
|
|
93
|
+
name: ExtensionNameSchema.pipe(Schema.annotateKey({ messageMissingKey: "hook name is required" }), Schema.annotate({
|
|
94
|
+
description: "Short name for this hook within its owner namespace. Combined with owner, forms the FQN @owner/hooks/<name>.",
|
|
95
|
+
})),
|
|
96
|
+
title: Schema.optional(Schema.NonEmptyString.annotate({
|
|
97
|
+
description: "Optional display title for this hook.",
|
|
98
|
+
})),
|
|
99
|
+
runtime: HookRuntimeSchema.pipe(Schema.annotateKey({ messageMissingKey: "runtime is required" })),
|
|
100
|
+
entrypoint: Schema.NonEmptyString.pipe(Schema.annotateKey({ messageMissingKey: "entrypoint is required" }), Schema.annotate({
|
|
101
|
+
description: "Hook body entrypoint path, relative to the hook manifest directory.",
|
|
102
|
+
examples: ["src/hook.sh", "src/hook.js", "src/hook.py"],
|
|
103
|
+
})),
|
|
104
|
+
bindings: Schema.Array(HookBindingSchema).pipe(Schema.annotateKey({ messageMissingKey: "bindings are required" })),
|
|
105
|
+
timeoutMs: Schema.optional(Schema.Int.pipe(Schema.check(Schema.isGreaterThan(0)))),
|
|
106
|
+
capabilities: Schema.optional(HookCapabilitiesSchema),
|
|
107
|
+
}).annotate({
|
|
108
|
+
identifier: "HookManifest",
|
|
109
|
+
title: "Hook Manifest",
|
|
110
|
+
description: "Hook manifest for managed agent hooks. The executable body lives under src/ and is invoked from native agent settings.",
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=manifest-schema.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as Result from "effect/Result";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
export declare const KnowledgeBundleFqnSchema: Schema.String;
|
|
4
|
+
export type KnowledgeBundleFqn = typeof KnowledgeBundleFqnSchema.Type;
|
|
5
|
+
export declare const KnowledgeConceptIdSchema: Schema.String;
|
|
6
|
+
export type KnowledgeConceptId = typeof KnowledgeConceptIdSchema.Type;
|
|
7
|
+
export declare const KnowledgeRevisionSchema: Schema.String;
|
|
8
|
+
export type KnowledgeRevision = typeof KnowledgeRevisionSchema.Type;
|
|
9
|
+
export declare const ConceptRefSchema: Schema.Struct<{
|
|
10
|
+
readonly bundle: Schema.String;
|
|
11
|
+
readonly conceptId: Schema.String;
|
|
12
|
+
}>;
|
|
13
|
+
export type ConceptRef = typeof ConceptRefSchema.Type;
|
|
14
|
+
export declare const ResolvedConceptRefSchema: Schema.Struct<{
|
|
15
|
+
readonly bundle: Schema.String;
|
|
16
|
+
readonly conceptId: Schema.String;
|
|
17
|
+
readonly bundleVersion: Schema.String;
|
|
18
|
+
readonly bundleFingerprint: Schema.String;
|
|
19
|
+
readonly contentRevision: Schema.String;
|
|
20
|
+
}>;
|
|
21
|
+
export type ResolvedConceptRef = typeof ResolvedConceptRefSchema.Type;
|
|
22
|
+
declare const ConceptRefInvalidError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
23
|
+
readonly _tag: "ConceptRefInvalidError";
|
|
24
|
+
} & Readonly<A>;
|
|
25
|
+
export declare class ConceptRefInvalidError extends ConceptRefInvalidError_base<{
|
|
26
|
+
readonly input: string;
|
|
27
|
+
}> {
|
|
28
|
+
}
|
|
29
|
+
/** Parse a compact `FQN#concept` or canonical AgentXM HTTPS concept reference. */
|
|
30
|
+
export declare const parseConceptRef: (input: string) => Result.Result<ConceptRef, ConceptRefInvalidError>;
|
|
31
|
+
export type ConceptRefFormat = "compact" | "url";
|
|
32
|
+
export declare const formatConceptRef: (ref: ConceptRef, format?: ConceptRefFormat) => string;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=concept-ref.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as Data from "effect/Data";
|
|
2
|
+
import * as Result from "effect/Result";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { ExtensionFqnSchema, parseExtensionFqnParts } from "../extensions/common.js";
|
|
5
|
+
const KNOWLEDGE_BUNDLE_FQN_MESSAGE = "Expected a Knowledge bundle FQN in @owner/knowledge/name form";
|
|
6
|
+
const CONCEPT_ID_MESSAGE = "Expected a non-empty safe bundle-relative concept ID without .md";
|
|
7
|
+
const REVISION_MESSAGE = "Expected an opaque SHA-256 revision";
|
|
8
|
+
export const KnowledgeBundleFqnSchema = ExtensionFqnSchema.check(Schema.makeFilter((value) => parseExtensionFqnParts(value)?.type === "knowledge" ? undefined : KNOWLEDGE_BUNDLE_FQN_MESSAGE)).annotate({
|
|
9
|
+
identifier: "KnowledgeBundleFqn",
|
|
10
|
+
title: "Knowledge Bundle FQN",
|
|
11
|
+
description: "A fully qualified Knowledge bundle identity.",
|
|
12
|
+
message: KNOWLEDGE_BUNDLE_FQN_MESSAGE,
|
|
13
|
+
});
|
|
14
|
+
export const KnowledgeConceptIdSchema = Schema.String.check(Schema.makeFilter((value) => {
|
|
15
|
+
if (value.length === 0 ||
|
|
16
|
+
value.startsWith("/") ||
|
|
17
|
+
value.endsWith("/") ||
|
|
18
|
+
value.includes("\\") ||
|
|
19
|
+
value.toLowerCase().endsWith(".md") ||
|
|
20
|
+
value
|
|
21
|
+
.split("/")
|
|
22
|
+
.some((segment) => segment.length === 0 || segment === "." || segment === "..")) {
|
|
23
|
+
return CONCEPT_ID_MESSAGE;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
})).annotate({
|
|
27
|
+
identifier: "KnowledgeConceptId",
|
|
28
|
+
title: "Knowledge Concept ID",
|
|
29
|
+
description: "A bundle-relative Markdown path without the .md suffix.",
|
|
30
|
+
message: CONCEPT_ID_MESSAGE,
|
|
31
|
+
});
|
|
32
|
+
export const KnowledgeRevisionSchema = Schema.String.check(Schema.isPattern(/^sha256:[0-9a-f]{64}$/u, { message: REVISION_MESSAGE })).annotate({
|
|
33
|
+
identifier: "KnowledgeRevision",
|
|
34
|
+
title: "Knowledge Content Revision",
|
|
35
|
+
description: "An opaque deterministic content revision.",
|
|
36
|
+
message: REVISION_MESSAGE,
|
|
37
|
+
});
|
|
38
|
+
export const ConceptRefSchema = Schema.Struct({
|
|
39
|
+
bundle: KnowledgeBundleFqnSchema,
|
|
40
|
+
conceptId: KnowledgeConceptIdSchema,
|
|
41
|
+
}).annotate({
|
|
42
|
+
identifier: "ConceptRef",
|
|
43
|
+
title: "Knowledge Concept Reference",
|
|
44
|
+
description: "Logical Knowledge concept identity: bundle FQN plus concept ID.",
|
|
45
|
+
});
|
|
46
|
+
export const ResolvedConceptRefSchema = Schema.Struct({
|
|
47
|
+
bundle: KnowledgeBundleFqnSchema,
|
|
48
|
+
conceptId: KnowledgeConceptIdSchema,
|
|
49
|
+
bundleVersion: Schema.String.check(Schema.isNonEmpty()),
|
|
50
|
+
bundleFingerprint: KnowledgeRevisionSchema,
|
|
51
|
+
contentRevision: KnowledgeRevisionSchema,
|
|
52
|
+
}).annotate({
|
|
53
|
+
identifier: "ResolvedConceptRef",
|
|
54
|
+
title: "Resolved Knowledge Concept Reference",
|
|
55
|
+
description: "Logical concept identity resolved to one bundle and content revision.",
|
|
56
|
+
});
|
|
57
|
+
export class ConceptRefInvalidError extends Data.TaggedError("ConceptRefInvalidError") {
|
|
58
|
+
}
|
|
59
|
+
const decodeConceptRef = Schema.decodeUnknownResult(ConceptRefSchema);
|
|
60
|
+
const decodeComponent = (value) => {
|
|
61
|
+
try {
|
|
62
|
+
return decodeURIComponent(value);
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const validatedRef = (input, bundle, conceptId) => {
|
|
69
|
+
const decoded = decodeConceptRef({ bundle, conceptId });
|
|
70
|
+
return Result.isSuccess(decoded)
|
|
71
|
+
? Result.succeed(decoded.success)
|
|
72
|
+
: Result.fail(new ConceptRefInvalidError({ input }));
|
|
73
|
+
};
|
|
74
|
+
/** Parse a compact `FQN#concept` or canonical AgentXM HTTPS concept reference. */
|
|
75
|
+
export const parseConceptRef = (input) => {
|
|
76
|
+
if (input.startsWith("https://")) {
|
|
77
|
+
try {
|
|
78
|
+
const url = new URL(input);
|
|
79
|
+
const marker = "/concepts/";
|
|
80
|
+
const markerIndex = url.pathname.indexOf(marker);
|
|
81
|
+
if (url.origin !== "https://agentxm.ai" ||
|
|
82
|
+
url.username.length > 0 ||
|
|
83
|
+
url.password.length > 0 ||
|
|
84
|
+
url.search.length > 0 ||
|
|
85
|
+
url.hash.length > 0 ||
|
|
86
|
+
markerIndex <= 0) {
|
|
87
|
+
return Result.fail(new ConceptRefInvalidError({ input }));
|
|
88
|
+
}
|
|
89
|
+
const bundle = decodeComponent(url.pathname.slice(1, markerIndex));
|
|
90
|
+
const conceptId = decodeComponent(url.pathname.slice(markerIndex + marker.length));
|
|
91
|
+
return bundle === undefined || conceptId === undefined
|
|
92
|
+
? Result.fail(new ConceptRefInvalidError({ input }))
|
|
93
|
+
: validatedRef(input, bundle, conceptId);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return Result.fail(new ConceptRefInvalidError({ input }));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const separator = input.indexOf("#");
|
|
100
|
+
if (separator <= 0)
|
|
101
|
+
return Result.fail(new ConceptRefInvalidError({ input }));
|
|
102
|
+
const bundle = input.slice(0, separator);
|
|
103
|
+
const conceptId = decodeComponent(input.slice(separator + 1));
|
|
104
|
+
return conceptId === undefined
|
|
105
|
+
? Result.fail(new ConceptRefInvalidError({ input }))
|
|
106
|
+
: validatedRef(input, bundle, conceptId);
|
|
107
|
+
};
|
|
108
|
+
export const formatConceptRef = (ref, format = "compact") => format === "compact"
|
|
109
|
+
? `${ref.bundle}#${encodeURIComponent(ref.conceptId)}`
|
|
110
|
+
: `https://agentxm.ai/${ref.bundle}/concepts/${ref.conceptId
|
|
111
|
+
.split("/")
|
|
112
|
+
.map(encodeURIComponent)
|
|
113
|
+
.join("/")}`;
|
|
114
|
+
//# sourceMappingURL=concept-ref.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Area barrel for the package public surface.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
*/
|
|
6
|
+
export { type ConceptRef, type ConceptRefFormat, ConceptRefInvalidError, ConceptRefSchema, type KnowledgeBundleFqn, KnowledgeBundleFqnSchema, type KnowledgeConceptId, KnowledgeConceptIdSchema, type KnowledgeRevision, KnowledgeRevisionSchema, type ResolvedConceptRef, ResolvedConceptRefSchema, formatConceptRef, parseConceptRef, } from "./concept-ref.js";
|
|
7
|
+
export { KNOWLEDGE_EXTENSION_DIR, KNOWLEDGE_MANIFEST_FILENAME, KNOWLEDGE_MANIFEST_SCHEMA_URL, KNOWLEDGE_SOURCE_DIR, type KnowledgeManifest, KnowledgeManifestSchema, } from "./manifest-schema.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Area barrel for the package public surface.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
*/
|
|
6
|
+
export { ConceptRefInvalidError, ConceptRefSchema, KnowledgeBundleFqnSchema, KnowledgeConceptIdSchema, KnowledgeRevisionSchema, ResolvedConceptRefSchema, formatConceptRef, parseConceptRef, } from "./concept-ref.js";
|
|
7
|
+
export { KNOWLEDGE_EXTENSION_DIR, KNOWLEDGE_MANIFEST_FILENAME, KNOWLEDGE_MANIFEST_SCHEMA_URL, KNOWLEDGE_SOURCE_DIR, KnowledgeManifestSchema, } from "./manifest-schema.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Manifest schema for Open Knowledge Format bundles. */
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
export declare const KNOWLEDGE_MANIFEST_FILENAME = "knowledge.json";
|
|
4
|
+
export declare const KNOWLEDGE_EXTENSION_DIR = "knowledge";
|
|
5
|
+
export declare const KNOWLEDGE_SOURCE_DIR = "src";
|
|
6
|
+
export declare const KNOWLEDGE_MANIFEST_SCHEMA_URL = "https://axm.sh/schemas/knowledge.schema.json";
|
|
7
|
+
export declare const KnowledgeManifestSchema: Schema.Struct<{
|
|
8
|
+
readonly type: Schema.Literal<"knowledge">;
|
|
9
|
+
readonly format: Schema.Struct<{
|
|
10
|
+
readonly name: Schema.Literal<"okf">;
|
|
11
|
+
readonly version: Schema.Literal<"0.2">;
|
|
12
|
+
}>;
|
|
13
|
+
readonly bundleRoot: Schema.Literal<"src">;
|
|
14
|
+
readonly instructionEntry: Schema.optionalKey<Schema.Boolean>;
|
|
15
|
+
readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
|
|
16
|
+
readonly enhances: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
17
|
+
readonly requires: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
18
|
+
readonly fallback: Schema.optional<Schema.Literals<readonly ["auto", "none"]>>;
|
|
19
|
+
readonly recommendedPacks: Schema.optional<Schema.$Array<Schema.brand<Schema.NonEmptyString, "PackSpec">>>;
|
|
20
|
+
readonly standalone: Schema.optional<Schema.Boolean>;
|
|
21
|
+
readonly publish: Schema.optional<Schema.Struct<{
|
|
22
|
+
readonly visibility: Schema.optional<Schema.Literals<readonly ["public", "private"]>>;
|
|
23
|
+
readonly ignore: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
24
|
+
}>>;
|
|
25
|
+
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
26
|
+
readonly owner: Schema.brand<Schema.String, "Handle">;
|
|
27
|
+
readonly version: Schema.brand<Schema.String, "Version">;
|
|
28
|
+
readonly description: Schema.optional<Schema.String>;
|
|
29
|
+
readonly keywords: Schema.optional<Schema.$Array<Schema.NonEmptyString>>;
|
|
30
|
+
readonly repository: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
31
|
+
readonly type: Schema.optional<Schema.NonEmptyString>;
|
|
32
|
+
readonly url: Schema.NonEmptyString;
|
|
33
|
+
readonly directory: Schema.optional<Schema.NonEmptyString>;
|
|
34
|
+
}>]>>;
|
|
35
|
+
readonly homepage: Schema.optional<Schema.String>;
|
|
36
|
+
readonly license: Schema.optional<Schema.String>;
|
|
37
|
+
readonly bugs: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
38
|
+
readonly url: Schema.optional<Schema.NonEmptyString>;
|
|
39
|
+
readonly email: Schema.optional<Schema.NonEmptyString>;
|
|
40
|
+
}>]>>;
|
|
41
|
+
readonly authors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
42
|
+
readonly name: Schema.String;
|
|
43
|
+
readonly email: Schema.optional<Schema.String>;
|
|
44
|
+
readonly url: Schema.optional<Schema.String>;
|
|
45
|
+
}>>>;
|
|
46
|
+
readonly packages: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
47
|
+
readonly purl: Schema.brand<Schema.NonEmptyString, "PackageIdentityPurl">;
|
|
48
|
+
readonly versionRange: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.Struct<{
|
|
49
|
+
readonly raw: Schema.NonEmptyString;
|
|
50
|
+
readonly scheme: Schema.NonEmptyString;
|
|
51
|
+
readonly constraints: Schema.$Array<Schema.Struct<{
|
|
52
|
+
readonly comparator: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
|
|
53
|
+
readonly version: Schema.NonEmptyString;
|
|
54
|
+
}>>;
|
|
55
|
+
}>>, Schema.NonEmptyString, never, never>, "VersRange">>;
|
|
56
|
+
}>>>;
|
|
57
|
+
readonly $schema: Schema.optional<Schema.String>;
|
|
58
|
+
}>;
|
|
59
|
+
export type KnowledgeManifest = Schema.Schema.Type<typeof KnowledgeManifestSchema>;
|
|
60
|
+
//# sourceMappingURL=manifest-schema.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Manifest schema for Open Knowledge Format bundles. */
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { CommonManifestBaseFields, ExtensionNameSchema, NonPackManifestFields, } from "../extensions/common.js";
|
|
4
|
+
export const KNOWLEDGE_MANIFEST_FILENAME = "knowledge.json";
|
|
5
|
+
export const KNOWLEDGE_EXTENSION_DIR = "knowledge";
|
|
6
|
+
export const KNOWLEDGE_SOURCE_DIR = "src";
|
|
7
|
+
export const KNOWLEDGE_MANIFEST_SCHEMA_URL = "https://axm.sh/schemas/knowledge.schema.json";
|
|
8
|
+
export const KnowledgeManifestSchema = Schema.Struct({
|
|
9
|
+
$schema: Schema.optional(Schema.String),
|
|
10
|
+
...CommonManifestBaseFields,
|
|
11
|
+
...NonPackManifestFields,
|
|
12
|
+
type: Schema.Literal("knowledge"),
|
|
13
|
+
format: Schema.Struct({
|
|
14
|
+
name: Schema.Literal("okf"),
|
|
15
|
+
version: Schema.Literal("0.2"),
|
|
16
|
+
}).annotate({
|
|
17
|
+
description: "Open Knowledge Format dialect and version used by this bundle.",
|
|
18
|
+
}),
|
|
19
|
+
bundleRoot: Schema.Literal(KNOWLEDGE_SOURCE_DIR).annotate({
|
|
20
|
+
description: "Package-relative directory containing the authoritative OKF bundle.",
|
|
21
|
+
}),
|
|
22
|
+
instructionEntry: Schema.optionalKey(Schema.Boolean.annotate({
|
|
23
|
+
description: "Whether this bundle appears by default in the managed Knowledge Bundles instruction table. Defaults effectively to true.",
|
|
24
|
+
default: true,
|
|
25
|
+
})),
|
|
26
|
+
name: ExtensionNameSchema.pipe(Schema.annotateKey({ messageMissingKey: "knowledge bundle name is required" }), Schema.annotate({
|
|
27
|
+
description: "Short bundle name. Combined with owner, forms the FQN @owner/knowledge/<name>.",
|
|
28
|
+
})),
|
|
29
|
+
}).annotate({
|
|
30
|
+
identifier: "KnowledgeManifest",
|
|
31
|
+
title: "Knowledge Manifest",
|
|
32
|
+
description: "Manifest for an isolated Open Knowledge Format bundle rooted at src/.",
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=manifest-schema.js.map
|