@agentxm/extension-resolution 0.29.4 → 0.30.1
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/README.md +19 -7
- package/dist/src/axm-skill-candidate.d.ts +3 -2
- package/dist/src/axm-skill-candidate.js +4 -2
- package/dist/src/axm-skill-workspace-compatibility.d.ts +2 -1
- package/dist/src/axm-skill-workspace-compatibility.js +2 -1
- package/dist/src/errors.d.ts +0 -19
- package/dist/src/errors.js +0 -10
- package/dist/src/index.d.ts +2 -4
- package/dist/src/index.js +3 -5
- package/dist/src/live.d.ts +0 -15
- package/dist/src/live.js +3 -2
- package/dist/src/testing.d.ts +2 -10
- package/dist/src/testing.js +2 -10
- package/dist/src/version-resolution.js +1 -1
- package/package.json +15 -18
- package/dist/src/axm-skill-compatibility.d.ts +0 -87
- package/dist/src/axm-skill-compatibility.js +0 -248
package/README.md
CHANGED
|
@@ -20,14 +20,16 @@ extension resolves to, and whether that resolution may be accepted.
|
|
|
20
20
|
- **Publisher-binding trust** — `classifyPublisherBindingTransition` and the
|
|
21
21
|
proposal vocabulary. Shaping the resulting plan risk condition belongs to
|
|
22
22
|
the feature that owns the plan, not here.
|
|
23
|
-
- **Official AXM skill
|
|
24
|
-
`
|
|
23
|
+
- **Official AXM skill inspection** — `evaluateAxmSkillCandidate` and
|
|
24
|
+
`readAxmSkillWorkspaceCompatibility` currently obtain candidate facts and
|
|
25
|
+
invoke the compatibility policy owned by `@agentxm/cli-maintenance`.
|
|
25
26
|
|
|
26
27
|
Exports `.` and `./live`.
|
|
27
28
|
|
|
28
29
|
Dependency budget: `@agentxm/extension-model`, `@agentxm/registry-protocol`,
|
|
29
30
|
`@agentxm/extension-content`, `@agentxm/extension-sources`, and
|
|
30
|
-
`@agentxm/workspace-state
|
|
31
|
+
`@agentxm/workspace-state`, and the published official-skill APIs of
|
|
32
|
+
`@agentxm/cli-maintenance`. Deciding what a configured entry resolves to needs
|
|
31
33
|
workspace facts and source acquisition, so this package sits **above**
|
|
32
34
|
`@agentxm/workspace-state`: state must never depend on it.
|
|
33
35
|
|
|
@@ -46,10 +48,20 @@ It therefore declares ports whose vocabulary lives in
|
|
|
46
48
|
- `WorkspaceCatalog` — implemented by `@agentxm/workspace-projection`, which
|
|
47
49
|
owns the agent-selection facts the catalog reports.
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
`@agentxm/
|
|
52
|
-
|
|
51
|
+
Shared release selection (`selectVersion`, `resolveVersionEntry`: exact
|
|
52
|
+
requests, yank handling, and range maxima) belongs to
|
|
53
|
+
`@agentxm/extension-model/unstable/version-constraints/version-selection`.
|
|
54
|
+
It consumes domain release facts and preserves the selected candidate. Registry
|
|
55
|
+
clients and this package use it without making wire schemas own the algorithm;
|
|
56
|
+
release-age and other client admission policies remain here.
|
|
57
|
+
|
|
58
|
+
Official-skill compatibility and recovery are owned by
|
|
59
|
+
[`@agentxm/cli-maintenance`](../../supporting/cli-maintenance/README.md), with
|
|
60
|
+
separate domain, application, and composition entry points. They are absent
|
|
61
|
+
from this package's public exports. Registry candidate probing and workspace
|
|
62
|
+
inspection still require a further acquisition/application separation; the
|
|
63
|
+
policy extraction does not make the current provider port design the target
|
|
64
|
+
architecture.
|
|
53
65
|
|
|
54
66
|
Unstable and unsupported — use the [axm.sh](https://axm.sh) CLI.
|
|
55
67
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
import * as FileSystem from "effect/FileSystem";
|
|
3
3
|
import * as Path from "effect/Path";
|
|
4
|
-
import { AxmSkillCompatibilityUnavailable
|
|
5
|
-
import {
|
|
4
|
+
import { AxmSkillCompatibilityUnavailable } from "@agentxm/cli-maintenance/official-skill/application";
|
|
5
|
+
import { AxmSkillIncompatible } from "@agentxm/cli-maintenance/official-skill/domain";
|
|
6
|
+
import { type AxmSkillCompatibility } from "@agentxm/cli-maintenance/official-skill/domain";
|
|
6
7
|
import type { SkillExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/skill";
|
|
7
8
|
export interface ValidateAxmSkillCandidateArgs {
|
|
8
9
|
readonly ref: SkillExtensionRef;
|
|
@@ -2,8 +2,10 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import * as FileSystem from "effect/FileSystem";
|
|
3
3
|
import * as Option from "effect/Option";
|
|
4
4
|
import * as Path from "effect/Path";
|
|
5
|
-
import { AxmSkillCompatibilityUnavailable
|
|
6
|
-
import {
|
|
5
|
+
import { AxmSkillCompatibilityUnavailable } from "@agentxm/cli-maintenance/official-skill/application";
|
|
6
|
+
import { AxmSkillIncompatible } from "@agentxm/cli-maintenance/official-skill/domain";
|
|
7
|
+
import { AXM_SKILL_FQN, evaluateAxmSkillCompatibility, } from "@agentxm/cli-maintenance/official-skill/domain";
|
|
8
|
+
import { AxmSkillCompatibilityPolicy } from "@agentxm/cli-maintenance/official-skill/application";
|
|
7
9
|
import { parseSkillMd } from "@agentxm/extension-content";
|
|
8
10
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9
11
|
const parseManifest = (content) => Option.match(content, {
|
|
@@ -4,7 +4,8 @@ import * as Option from "effect/Option";
|
|
|
4
4
|
import type * as Path from "effect/Path";
|
|
5
5
|
import type { InstalledSkill, WorkspaceReadModel } from "@agentxm/workspace-state";
|
|
6
6
|
import { type LockfileReadError, type SettingsReadError } from "@agentxm/workspace-state";
|
|
7
|
-
import { type AxmSkillCompatibility
|
|
7
|
+
import { type AxmSkillCompatibility } from "@agentxm/cli-maintenance/official-skill/domain";
|
|
8
|
+
import { type AxmSkillCompatibilityPolicyService } from "@agentxm/cli-maintenance/official-skill/application";
|
|
8
9
|
/** Whether desired workspace state directly or transitively declares the official AXM skill. */
|
|
9
10
|
export declare const declaresOfficialAxmSkill: (args: {
|
|
10
11
|
readonly declaredSource: string | null;
|
|
@@ -2,7 +2,8 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import * as Option from "effect/Option";
|
|
3
3
|
import { printSkillLockSourceLocator, } from "@agentxm/workspace-state";
|
|
4
4
|
import { parseSkillMd } from "@agentxm/extension-content";
|
|
5
|
-
import { AXM_SKILL_FQN, } from "
|
|
5
|
+
import { AXM_SKILL_FQN, } from "@agentxm/cli-maintenance/official-skill/domain";
|
|
6
|
+
import {} from "@agentxm/cli-maintenance/official-skill/application";
|
|
6
7
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
8
|
const manifestVersion = (content) => {
|
|
8
9
|
try {
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* @experimental This API is unstable and may change without notice.
|
|
6
6
|
*/
|
|
7
7
|
import * as Schema from "effect/Schema";
|
|
8
|
-
import type { AxmSkillCompatibility } from "./axm-skill-compatibility.js";
|
|
9
8
|
declare const ExtensionResolutionFailed_base: Schema.Class<ExtensionResolutionFailed, Schema.TaggedStruct<"ExtensionResolutionFailed", {
|
|
10
9
|
readonly category: Schema.Literals<readonly ["conflict", "internal", "network", "not_found", "usage", "validation"]>;
|
|
11
10
|
readonly title: Schema.optional<Schema.String>;
|
|
@@ -38,24 +37,6 @@ export declare class SourceAuthorityBlocked extends SourceAuthorityBlocked_base<
|
|
|
38
37
|
}>;
|
|
39
38
|
}> {
|
|
40
39
|
}
|
|
41
|
-
declare const AxmSkillCompatibilityUnavailable_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 & {
|
|
42
|
-
readonly _tag: "AxmSkillCompatibilityUnavailable";
|
|
43
|
-
} & Readonly<A>;
|
|
44
|
-
/** The AXM compatibility policy did not evaluate the official AXM skill. */
|
|
45
|
-
export declare class AxmSkillCompatibilityUnavailable extends AxmSkillCompatibilityUnavailable_base {
|
|
46
|
-
}
|
|
47
|
-
declare const AxmSkillIncompatible_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 & {
|
|
48
|
-
readonly _tag: "AxmSkillIncompatible";
|
|
49
|
-
} & Readonly<A>;
|
|
50
|
-
/**
|
|
51
|
-
* The official AXM skill candidate is incompatible with this CLI. Carries the
|
|
52
|
-
* policy's full compatibility verdict, whose recovery plan the application
|
|
53
|
-
* boundary renders into suggestions.
|
|
54
|
-
*/
|
|
55
|
-
export declare class AxmSkillIncompatible extends AxmSkillIncompatible_base<{
|
|
56
|
-
readonly compatibility: AxmSkillCompatibility;
|
|
57
|
-
}> {
|
|
58
|
-
}
|
|
59
40
|
declare const PackDependencyInvalid_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 & {
|
|
60
41
|
readonly _tag: "PackDependencyInvalid";
|
|
61
42
|
} & Readonly<A>;
|
package/dist/src/errors.js
CHANGED
|
@@ -37,16 +37,6 @@ export class ExtensionResolutionFailed extends Schema.TaggedError()("ExtensionRe
|
|
|
37
37
|
/** Source-authority evaluation refused the requested transition. */
|
|
38
38
|
export class SourceAuthorityBlocked extends Data.TaggedError("SourceAuthorityBlocked") {
|
|
39
39
|
}
|
|
40
|
-
/** The AXM compatibility policy did not evaluate the official AXM skill. */
|
|
41
|
-
export class AxmSkillCompatibilityUnavailable extends Data.TaggedError("AxmSkillCompatibilityUnavailable") {
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The official AXM skill candidate is incompatible with this CLI. Carries the
|
|
45
|
-
* policy's full compatibility verdict, whose recovery plan the application
|
|
46
|
-
* boundary renders into suggestions.
|
|
47
|
-
*/
|
|
48
|
-
export class AxmSkillIncompatible extends Data.TaggedError("AxmSkillIncompatible") {
|
|
49
|
-
}
|
|
50
40
|
/**
|
|
51
41
|
* A declared pack dependency cannot be resolved as requested. `detail`
|
|
52
42
|
* carries the site's fact sentence verbatim.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* Extension resolution policy: which source is allowed to supply a
|
|
5
5
|
* configured extension, which visible version that source resolves to under
|
|
6
6
|
* the minimum-release-age policy, which publisher binding a proposed
|
|
7
|
-
* acceptance replaces, how a Pack's declared members resolve
|
|
8
|
-
* official AXM skill candidate is compatible with this CLI. Pure over the
|
|
7
|
+
* acceptance replaces, and how a Pack's declared members resolve. Pure over the
|
|
9
8
|
* Registry index contract and workspace state; the provider that fetches the
|
|
10
9
|
* index applies these through a port.
|
|
11
10
|
*
|
|
12
11
|
* @experimental This API is unstable and may change without notice.
|
|
13
12
|
* @packageDocumentation
|
|
14
13
|
*/
|
|
15
|
-
export {
|
|
14
|
+
export { ExtensionResolutionFailed, PackConstraintShadowed, PackDependencyConflict, PackDependencyInvalid, PackDependencyMissing, PackDependencyUnsatisfied, SourceAuthorityBlocked, type PackDependencyResolutionFailure, } from "./errors.js";
|
|
16
15
|
export { type ReleaseAgeBypassRecord, type ReleaseAgeHoldbackRecord, type ReleaseAgeOperationEvidence, type ReleaseAgeRecord, type ReleaseAgeRecordBase, filterMatureVersions, formatMinimumReleaseAgeSeconds, isVersionEntryEligibleAt, isVersionEntryMature, normalizeReleaseAgeRecords, parseMinimumReleaseAge, releaseAgeEvidence, releaseAgeExemptionForIdentity, releaseAgeHoldbackWarning, } from "./release-age-policy.js";
|
|
17
16
|
export { type ReleaseAgeVersionResolution, resolveVersionEntryForReleaseAge, resolveVersionEntryWithReleaseAge, } from "./version-resolution.js";
|
|
18
17
|
export { decideNamedRegistryVersion, namedRegistryCandidates, } from "./named-registry-resolution.js";
|
|
@@ -25,7 +24,6 @@ export { classifyPublisherBindingTransition, describePublisherBindingTransition,
|
|
|
25
24
|
export { ResolvedPackDependencyMapSchema, ResolvedPackDependencySchema, type ResolvedPackDependency, type ResolvedPackDependencyMap, } from "./resolved-pack-dependency.js";
|
|
26
25
|
export { resolvePackDependencies, resolvePackDependenciesWithReleaseAge, type PackDependencyRefResolver, type ReleaseAgeAwarePackDependencyResolution, type ResolvedPackDependencies, type WorkspacePackDependencyResolution, type WorkspacePackDependencyResolver, } from "./pack-dependency-resolution.js";
|
|
27
26
|
export { acceptedPackDependencyResolver } from "./accepted-pack-dependency-resolver.js";
|
|
28
|
-
export { AXM_SKILL_BUNDLED_APPLY_COMMAND, AXM_SKILL_BUNDLED_PREVIEW_COMMAND, AXM_SKILL_CLI_VERSION_METADATA_KEY, AXM_SKILL_CLI_VERSION_RANGE_METADATA_KEY, AXM_SKILL_FQN, AXM_SKILL_REGISTRY_APPLY_COMMAND, AXM_SKILL_REGISTRY_PREVIEW_COMMAND, AxmSkillCompatibilityPolicy, AxmSkillCompatibilityRecoveryActionSchema, AxmSkillCompatibilityRecoverySchema, AxmSkillCompatibilityRecoveryStepSchema, AxmSkillCompatibilityReasonSchema, AxmSkillCompatibilitySchema, evaluateAxmSkillCompatibility, formatAxmSkillCompatibilityTarget, makeAxmSkillCompatibilityPolicyLayer, validateAxmSkillCliVersionRange, type AxmSkillCliVersionRangeValidation, type AxmSkillCompatibility, type AxmSkillCompatibilityCandidate, type AxmSkillCompatibilityInput, type AxmSkillCompatibilityPolicyInput, type AxmSkillCompatibilityPolicyService, type AxmSkillCompatibilityReason, type AxmSkillCompatibilityRecovery, type AxmSkillCompatibilityRecoveryAction, type AxmSkillCompatibilityRecoveryStep, } from "./axm-skill-compatibility.js";
|
|
29
27
|
export { evaluateAxmSkillCandidate, validateAxmSkillCandidate, type ValidateAxmSkillCandidateArgs, } from "./axm-skill-candidate.js";
|
|
30
28
|
export { declaresOfficialAxmSkill, readAxmSkillWorkspaceCompatibility, type ReadAxmSkillWorkspaceCompatibilityArgs, } from "./axm-skill-workspace-compatibility.js";
|
|
31
29
|
export { classifyTargetedUpdate, resolveTargetedUpdateContext, type ClassifyTargetedUpdateArgs, type TargetedUpdateAuthority, type TargetedUpdateBlocker, type TargetedUpdateContext, type TargetedUpdateContextFailure, type TargetedUpdateEffect, type TargetedUpdateOwnership, type TargetedUpdatePublicContext, type TargetedUpdateTarget, type TargetedUpdateTargetType, } from "./update/targeted-update-context.js";
|
package/dist/src/index.js
CHANGED
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* Extension resolution policy: which source is allowed to supply a
|
|
5
5
|
* configured extension, which visible version that source resolves to under
|
|
6
6
|
* the minimum-release-age policy, which publisher binding a proposed
|
|
7
|
-
* acceptance replaces, how a Pack's declared members resolve
|
|
8
|
-
* official AXM skill candidate is compatible with this CLI. Pure over the
|
|
7
|
+
* acceptance replaces, and how a Pack's declared members resolve. Pure over the
|
|
9
8
|
* Registry index contract and workspace state; the provider that fetches the
|
|
10
9
|
* index applies these through a port.
|
|
11
10
|
*
|
|
12
11
|
* @experimental This API is unstable and may change without notice.
|
|
13
12
|
* @packageDocumentation
|
|
14
13
|
*/
|
|
15
|
-
export {
|
|
14
|
+
export { ExtensionResolutionFailed, PackConstraintShadowed, PackDependencyConflict, PackDependencyInvalid, PackDependencyMissing, PackDependencyUnsatisfied, SourceAuthorityBlocked, } from "./errors.js";
|
|
16
15
|
export { filterMatureVersions, formatMinimumReleaseAgeSeconds, isVersionEntryEligibleAt, isVersionEntryMature, normalizeReleaseAgeRecords, parseMinimumReleaseAge, releaseAgeEvidence, releaseAgeExemptionForIdentity, releaseAgeHoldbackWarning, } from "./release-age-policy.js";
|
|
17
16
|
export { resolveVersionEntryForReleaseAge, resolveVersionEntryWithReleaseAge, } from "./version-resolution.js";
|
|
18
17
|
export { decideNamedRegistryVersion, namedRegistryCandidates, } from "./named-registry-resolution.js";
|
|
@@ -31,8 +30,7 @@ export { classifyPublisherBindingTransition, describePublisherBindingTransition,
|
|
|
31
30
|
export { ResolvedPackDependencyMapSchema, ResolvedPackDependencySchema, } from "./resolved-pack-dependency.js";
|
|
32
31
|
export { resolvePackDependencies, resolvePackDependenciesWithReleaseAge, } from "./pack-dependency-resolution.js";
|
|
33
32
|
export { acceptedPackDependencyResolver } from "./accepted-pack-dependency-resolver.js";
|
|
34
|
-
// Official
|
|
35
|
-
export { AXM_SKILL_BUNDLED_APPLY_COMMAND, AXM_SKILL_BUNDLED_PREVIEW_COMMAND, AXM_SKILL_CLI_VERSION_METADATA_KEY, AXM_SKILL_CLI_VERSION_RANGE_METADATA_KEY, AXM_SKILL_FQN, AXM_SKILL_REGISTRY_APPLY_COMMAND, AXM_SKILL_REGISTRY_PREVIEW_COMMAND, AxmSkillCompatibilityPolicy, AxmSkillCompatibilityRecoveryActionSchema, AxmSkillCompatibilityRecoverySchema, AxmSkillCompatibilityRecoveryStepSchema, AxmSkillCompatibilityReasonSchema, AxmSkillCompatibilitySchema, evaluateAxmSkillCompatibility, formatAxmSkillCompatibilityTarget, makeAxmSkillCompatibilityPolicyLayer, validateAxmSkillCliVersionRange, } from "./axm-skill-compatibility.js";
|
|
33
|
+
// Official-skill byte inspection remains a workspace integration.
|
|
36
34
|
export { evaluateAxmSkillCandidate, validateAxmSkillCandidate, } from "./axm-skill-candidate.js";
|
|
37
35
|
export { declaresOfficialAxmSkill, readAxmSkillWorkspaceCompatibility, } from "./axm-skill-workspace-compatibility.js";
|
|
38
36
|
// Targeted update classification: who owns the declaration a named update
|
package/dist/src/live.d.ts
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Implementation of the source-resolution composition port this package owns
|
|
3
|
-
* the policy for.
|
|
4
|
-
*
|
|
5
|
-
* `@agentxm/extension-sources` declares the official AXM skill candidate gate
|
|
6
|
-
* as a port because a supporting integration may not own AXM trust policy.
|
|
7
|
-
* Resolution owns that policy, so the Live is composed here rather than at
|
|
8
|
-
* the application boundary; the composition root only composes Layers.
|
|
9
|
-
*
|
|
10
|
-
* The catalog port's Live belongs to `@agentxm/workspace-projection`, which
|
|
11
|
-
* owns the agent-selection facts it reads.
|
|
12
|
-
*
|
|
13
|
-
* @experimental This API is unstable and may change without notice.
|
|
14
|
-
* @packageDocumentation
|
|
15
|
-
*/
|
|
16
1
|
import * as Layer from "effect/Layer";
|
|
17
2
|
import { AxmSkillCandidateGate } from "@agentxm/extension-sources";
|
|
18
3
|
/**
|
package/dist/src/live.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { renderAxmSkillRecovery } from "@agentxm/cli-maintenance/official-skill/adapters/cli";
|
|
1
2
|
/**
|
|
2
3
|
* Implementation of the source-resolution composition port this package owns
|
|
3
4
|
* the policy for.
|
|
@@ -17,7 +18,7 @@ import * as Effect from "effect/Effect";
|
|
|
17
18
|
import * as Layer from "effect/Layer";
|
|
18
19
|
import { AxmSkillCandidateGate, AxmSkillGateUnavailable, } from "@agentxm/extension-sources";
|
|
19
20
|
import { evaluateAxmSkillCandidate } from "./axm-skill-candidate.js";
|
|
20
|
-
import { AXM_SKILL_BUNDLED_PREVIEW_COMMAND, formatAxmSkillCompatibilityTarget, } from "
|
|
21
|
+
import { AXM_SKILL_BUNDLED_PREVIEW_COMMAND, formatAxmSkillCompatibilityTarget, } from "@agentxm/cli-maintenance/official-skill/adapters/cli";
|
|
21
22
|
/**
|
|
22
23
|
* The gate renders the recovery command and target exactly as the registry
|
|
23
24
|
* host provider rendered them before the port existed. Its only failure is
|
|
@@ -36,7 +37,7 @@ export const AxmSkillCandidateGateLive = Layer.succeed(AxmSkillCandidateGate, {
|
|
|
36
37
|
detail: result.detail,
|
|
37
38
|
recoveryCommand: result.recovery.action === "update-registry-skill"
|
|
38
39
|
? AXM_SKILL_BUNDLED_PREVIEW_COMMAND
|
|
39
|
-
: result.recovery.nextAction,
|
|
40
|
+
: renderAxmSkillRecovery(result.recovery).nextAction,
|
|
40
41
|
recoveryTarget: formatAxmSkillCompatibilityTarget(result.recovery),
|
|
41
42
|
}), Effect.mapError((failure) => new AxmSkillGateUnavailable({
|
|
42
43
|
category: "internal",
|
package/dist/src/testing.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @agentxm/extension-resolution deterministic test ports and decoders.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
* skill compatibility policy — bound to fixed values, plus the branded-value
|
|
4
|
+
* The minimum-release-age posture the operator decides, bound to a fixed
|
|
5
|
+
* value, plus the branded-value
|
|
7
6
|
* decoders a fixture needs to state a handle, name, version, or range.
|
|
8
7
|
* Production source never imports this module.
|
|
9
8
|
*
|
|
@@ -14,7 +13,6 @@ import * as Layer from "effect/Layer";
|
|
|
14
13
|
import { type ExtensionName } from "@agentxm/extension-model/unstable/extensions/common";
|
|
15
14
|
import { type Handle } from "@agentxm/extension-model/unstable/extensions/handle";
|
|
16
15
|
import { type Version, type VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
|
|
17
|
-
import { AxmSkillCompatibilityPolicy } from "./axm-skill-compatibility.js";
|
|
18
16
|
import { ReleaseAgePosture, type ReleaseAgePostureValue } from "./release-age-posture.js";
|
|
19
17
|
/**
|
|
20
18
|
* The release-age gate's posture for one run. `"enforce"` withholds a
|
|
@@ -23,12 +21,6 @@ import { ReleaseAgePosture, type ReleaseAgePostureValue } from "./release-age-po
|
|
|
23
21
|
* this run only.
|
|
24
22
|
*/
|
|
25
23
|
export declare const ReleaseAgePostureTest: (posture?: ReleaseAgePostureValue) => Layer.Layer<ReleaseAgePosture>;
|
|
26
|
-
/**
|
|
27
|
-
* The real official-skill compatibility policy, evaluated against a stated CLI
|
|
28
|
-
* version rather than the running executable's. `null` models an executable
|
|
29
|
-
* that reports no version, which the policy must still answer for.
|
|
30
|
-
*/
|
|
31
|
-
export declare const AxmSkillCompatibilityPolicyTest: (cliVersion: string | null) => Layer.Layer<AxmSkillCompatibilityPolicy>;
|
|
32
24
|
/** The handle a fixture names, decoded into its branded form. */
|
|
33
25
|
export declare const handle: (value: string) => Handle;
|
|
34
26
|
/** The extension name a fixture names, decoded into its branded form. */
|
package/dist/src/testing.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @agentxm/extension-resolution deterministic test ports and decoders.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
* skill compatibility policy — bound to fixed values, plus the branded-value
|
|
4
|
+
* The minimum-release-age posture the operator decides, bound to a fixed
|
|
5
|
+
* value, plus the branded-value
|
|
7
6
|
* decoders a fixture needs to state a handle, name, version, or range.
|
|
8
7
|
* Production source never imports this module.
|
|
9
8
|
*
|
|
@@ -14,7 +13,6 @@ import * as Layer from "effect/Layer";
|
|
|
14
13
|
import { decodeExtensionNameSync, } from "@agentxm/extension-model/unstable/extensions/common";
|
|
15
14
|
import { decodeHandleSync } from "@agentxm/extension-model/unstable/extensions/handle";
|
|
16
15
|
import { decodeVersionRangeSync, decodeVersionSync, } from "@agentxm/extension-model/unstable/version-constraints";
|
|
17
|
-
import { AxmSkillCompatibilityPolicy, makeAxmSkillCompatibilityPolicyLayer, } from "./axm-skill-compatibility.js";
|
|
18
16
|
import { ReleaseAgePosture } from "./release-age-posture.js";
|
|
19
17
|
/**
|
|
20
18
|
* The release-age gate's posture for one run. `"enforce"` withholds a
|
|
@@ -23,12 +21,6 @@ import { ReleaseAgePosture } from "./release-age-posture.js";
|
|
|
23
21
|
* this run only.
|
|
24
22
|
*/
|
|
25
23
|
export const ReleaseAgePostureTest = (posture = "enforce") => Layer.succeed(ReleaseAgePosture, posture);
|
|
26
|
-
/**
|
|
27
|
-
* The real official-skill compatibility policy, evaluated against a stated CLI
|
|
28
|
-
* version rather than the running executable's. `null` models an executable
|
|
29
|
-
* that reports no version, which the policy must still answer for.
|
|
30
|
-
*/
|
|
31
|
-
export const AxmSkillCompatibilityPolicyTest = (cliVersion) => makeAxmSkillCompatibilityPolicyLayer(cliVersion);
|
|
32
24
|
/** The handle a fixture names, decoded into its branded form. */
|
|
33
25
|
export const handle = (value) => decodeHandleSync(value);
|
|
34
26
|
/** The extension name a fixture names, decoded into its branded form. */
|
|
@@ -8,7 +8,7 @@ import * as Duration from "effect/Duration";
|
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
9
9
|
import * as Option from "effect/Option";
|
|
10
10
|
import * as semver from "semver";
|
|
11
|
-
import { resolveVersionEntry } from "@agentxm/
|
|
11
|
+
import { resolveVersionEntry } from "@agentxm/extension-model/unstable/version-constraints/version-selection";
|
|
12
12
|
import { filterMatureVersions, isVersionEntryEligibleAt, releaseAgeEvidence, } from "./release-age-policy.js";
|
|
13
13
|
/**
|
|
14
14
|
* Resolve a version request against the versions that have reached the
|
package/package.json
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
"url": "https://github.com/agentxm/axm/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@agentxm/
|
|
8
|
-
"@agentxm/extension-
|
|
9
|
-
"@agentxm/extension-
|
|
10
|
-
"@agentxm/
|
|
11
|
-
"@agentxm/
|
|
7
|
+
"@agentxm/cli-maintenance": "^0.30.1",
|
|
8
|
+
"@agentxm/extension-content": "^0.30.1",
|
|
9
|
+
"@agentxm/extension-model": "^0.30.1",
|
|
10
|
+
"@agentxm/extension-sources": "^0.30.1",
|
|
11
|
+
"@agentxm/registry-protocol": "^0.30.1",
|
|
12
|
+
"@agentxm/workspace-state": "^0.30.1",
|
|
12
13
|
"effect": "4.0.0-rc.115",
|
|
13
14
|
"semver": "^7.8.5"
|
|
14
15
|
},
|
|
15
|
-
"description": "AXM extension resolution policy: what a configured or requested extension resolves to and whether that resolution may be accepted — release-age policy, version selection, configured-entry and Pack dependency resolution, workspace source authority, publisher-binding trust
|
|
16
|
+
"description": "AXM extension resolution policy: what a configured or requested extension resolves to and whether that resolution may be accepted — release-age policy, version selection, configured-entry and Pack dependency resolution, workspace source authority, publisher-binding trust. Unstable and unsupported — use the axm.sh CLI.",
|
|
16
17
|
"devDependencies": {
|
|
17
|
-
"@agentxm/specification-metadata": "^0.
|
|
18
|
+
"@agentxm/specification-metadata": "^0.30.1",
|
|
18
19
|
"@effect/platform-node": "4.0.0-rc.115",
|
|
19
20
|
"@effect/vitest": "4.0.0-rc.115",
|
|
20
|
-
"@fast-check/vitest": "^0.5.0",
|
|
21
21
|
"@types/semver": "^7.7.1",
|
|
22
22
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
23
23
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
@@ -28,19 +28,16 @@
|
|
|
28
28
|
},
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
-
"
|
|
32
|
-
"default": "./dist/src/index.js"
|
|
33
|
-
"types": "./dist/src/index.d.ts"
|
|
31
|
+
"types": "./dist/src/index.d.ts",
|
|
32
|
+
"default": "./dist/src/index.js"
|
|
34
33
|
},
|
|
35
34
|
"./live": {
|
|
36
|
-
"
|
|
37
|
-
"default": "./dist/src/live.js"
|
|
38
|
-
"types": "./dist/src/live.d.ts"
|
|
35
|
+
"types": "./dist/src/live.d.ts",
|
|
36
|
+
"default": "./dist/src/live.js"
|
|
39
37
|
},
|
|
40
38
|
"./testing": {
|
|
41
|
-
"
|
|
42
|
-
"default": "./dist/src/testing.js"
|
|
43
|
-
"types": "./dist/src/testing.d.ts"
|
|
39
|
+
"types": "./dist/src/testing.d.ts",
|
|
40
|
+
"default": "./dist/src/testing.js"
|
|
44
41
|
}
|
|
45
42
|
},
|
|
46
43
|
"files": [
|
|
@@ -63,5 +60,5 @@
|
|
|
63
60
|
},
|
|
64
61
|
"sideEffects": false,
|
|
65
62
|
"type": "module",
|
|
66
|
-
"version": "0.
|
|
63
|
+
"version": "0.30.1"
|
|
67
64
|
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as Layer from "effect/Layer";
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import * as ServiceMap from "effect/Context";
|
|
4
|
-
export declare const AXM_SKILL_FQN = "@agentxm/skills/axm";
|
|
5
|
-
export declare const AXM_SKILL_CLI_VERSION_METADATA_KEY = "axm.sh/cli-version";
|
|
6
|
-
export declare const AXM_SKILL_CLI_VERSION_RANGE_METADATA_KEY = "axm.sh/cli-version-range";
|
|
7
|
-
export declare const AXM_SKILL_BUNDLED_PREVIEW_COMMAND = "axm skills install @agentxm/skills/axm --bundled --preview";
|
|
8
|
-
export declare const AXM_SKILL_BUNDLED_APPLY_COMMAND = "axm skills install @agentxm/skills/axm --bundled";
|
|
9
|
-
export declare const AXM_SKILL_REGISTRY_PREVIEW_COMMAND = "axm skills update --name axm --preview";
|
|
10
|
-
export declare const AXM_SKILL_REGISTRY_APPLY_COMMAND = "axm skills update --name axm";
|
|
11
|
-
export declare const AxmSkillCompatibilityReasonSchema: Schema.Literals<readonly ["cli-version-unavailable", "axm-skill-missing", "axm-skill-manifest-invalid", "compatibility-metadata-missing", "compatibility-metadata-malformed", "skill-release-mismatch", "skill-release-range-mismatch", "cli-version-incompatible"]>;
|
|
12
|
-
export type AxmSkillCompatibilityReason = typeof AxmSkillCompatibilityReasonSchema.Type;
|
|
13
|
-
export declare const AxmSkillCompatibilityRecoveryActionSchema: Schema.Literals<readonly ["none", "inspect-cli", "upgrade-cli", "update-registry-skill", "install-bundled-skill", "preserve-authored-skill"]>;
|
|
14
|
-
export type AxmSkillCompatibilityRecoveryAction = typeof AxmSkillCompatibilityRecoveryActionSchema.Type;
|
|
15
|
-
export declare const AxmSkillCompatibilityRecoveryStepSchema: Schema.Struct<{
|
|
16
|
-
readonly boundary: Schema.Literals<readonly ["executable", "workspace", "verification"]>;
|
|
17
|
-
readonly command: Schema.String;
|
|
18
|
-
readonly preview: Schema.Boolean;
|
|
19
|
-
}>;
|
|
20
|
-
export type AxmSkillCompatibilityRecoveryStep = typeof AxmSkillCompatibilityRecoveryStepSchema.Type;
|
|
21
|
-
export declare const AxmSkillCompatibilityRecoverySchema: Schema.Struct<{
|
|
22
|
-
readonly action: Schema.Literals<readonly ["none", "inspect-cli", "upgrade-cli", "update-registry-skill", "install-bundled-skill", "preserve-authored-skill"]>;
|
|
23
|
-
readonly targetCliVersion: Schema.NullOr<Schema.String>;
|
|
24
|
-
readonly targetSkillVersion: Schema.NullOr<Schema.String>;
|
|
25
|
-
readonly nextAction: Schema.NullOr<Schema.String>;
|
|
26
|
-
readonly steps: Schema.$Array<Schema.Struct<{
|
|
27
|
-
readonly boundary: Schema.Literals<readonly ["executable", "workspace", "verification"]>;
|
|
28
|
-
readonly command: Schema.String;
|
|
29
|
-
readonly preview: Schema.Boolean;
|
|
30
|
-
}>>;
|
|
31
|
-
}>;
|
|
32
|
-
export type AxmSkillCompatibilityRecovery = typeof AxmSkillCompatibilityRecoverySchema.Type;
|
|
33
|
-
export declare const formatAxmSkillCompatibilityTarget: (target: {
|
|
34
|
-
readonly targetCliVersion: string | null;
|
|
35
|
-
readonly targetSkillVersion: string | null;
|
|
36
|
-
}) => string;
|
|
37
|
-
export declare const AxmSkillCompatibilitySchema: Schema.Struct<{
|
|
38
|
-
readonly status: Schema.Literals<readonly ["compatible", "incompatible"]>;
|
|
39
|
-
readonly cliVersion: Schema.NullOr<Schema.String>;
|
|
40
|
-
readonly skillVersion: Schema.NullOr<Schema.String>;
|
|
41
|
-
readonly source: Schema.NullOr<Schema.String>;
|
|
42
|
-
readonly declaredCliVersion: Schema.NullOr<Schema.String>;
|
|
43
|
-
readonly declaredCliVersionRange: Schema.NullOr<Schema.String>;
|
|
44
|
-
readonly reasonCode: Schema.NullOr<Schema.Literals<readonly ["cli-version-unavailable", "axm-skill-missing", "axm-skill-manifest-invalid", "compatibility-metadata-missing", "compatibility-metadata-malformed", "skill-release-mismatch", "skill-release-range-mismatch", "cli-version-incompatible"]>>;
|
|
45
|
-
readonly detail: Schema.NullOr<Schema.String>;
|
|
46
|
-
readonly recovery: Schema.Struct<{
|
|
47
|
-
readonly action: Schema.Literals<readonly ["none", "inspect-cli", "upgrade-cli", "update-registry-skill", "install-bundled-skill", "preserve-authored-skill"]>;
|
|
48
|
-
readonly targetCliVersion: Schema.NullOr<Schema.String>;
|
|
49
|
-
readonly targetSkillVersion: Schema.NullOr<Schema.String>;
|
|
50
|
-
readonly nextAction: Schema.NullOr<Schema.String>;
|
|
51
|
-
readonly steps: Schema.$Array<Schema.Struct<{
|
|
52
|
-
readonly boundary: Schema.Literals<readonly ["executable", "workspace", "verification"]>;
|
|
53
|
-
readonly command: Schema.String;
|
|
54
|
-
readonly preview: Schema.Boolean;
|
|
55
|
-
}>>;
|
|
56
|
-
}>;
|
|
57
|
-
}>;
|
|
58
|
-
export type AxmSkillCompatibility = typeof AxmSkillCompatibilitySchema.Type;
|
|
59
|
-
export interface AxmSkillCompatibilityCandidate {
|
|
60
|
-
readonly manifestVersion: string | null;
|
|
61
|
-
readonly metadata: Readonly<Record<string, string>> | null;
|
|
62
|
-
readonly source: string | null;
|
|
63
|
-
}
|
|
64
|
-
export interface AxmSkillCompatibilityInput {
|
|
65
|
-
readonly cliVersion: string | null;
|
|
66
|
-
readonly skill: AxmSkillCompatibilityCandidate | null;
|
|
67
|
-
}
|
|
68
|
-
export interface AxmSkillCompatibilityPolicyInput {
|
|
69
|
-
readonly fqn: string;
|
|
70
|
-
readonly candidate: AxmSkillCompatibilityCandidate | null;
|
|
71
|
-
}
|
|
72
|
-
export interface AxmSkillCompatibilityPolicyService {
|
|
73
|
-
readonly evaluate: (input: AxmSkillCompatibilityPolicyInput) => AxmSkillCompatibility | null;
|
|
74
|
-
}
|
|
75
|
-
declare const AxmSkillCompatibilityPolicy_base: ServiceMap.ServiceClass<AxmSkillCompatibilityPolicy, "@agentxm/extension-resolution/axm-skill-compatibility/AxmSkillCompatibilityPolicy", AxmSkillCompatibilityPolicyService>;
|
|
76
|
-
export declare class AxmSkillCompatibilityPolicy extends AxmSkillCompatibilityPolicy_base {
|
|
77
|
-
}
|
|
78
|
-
export type AxmSkillCliVersionRangeValidation = {
|
|
79
|
-
readonly valid: true;
|
|
80
|
-
} | {
|
|
81
|
-
readonly valid: false;
|
|
82
|
-
};
|
|
83
|
-
export declare const validateAxmSkillCliVersionRange: (value: string) => AxmSkillCliVersionRangeValidation;
|
|
84
|
-
export declare const evaluateAxmSkillCompatibility: (input: AxmSkillCompatibilityInput) => AxmSkillCompatibility;
|
|
85
|
-
export declare const makeAxmSkillCompatibilityPolicyLayer: (cliVersion: string | null) => Layer.Layer<AxmSkillCompatibilityPolicy>;
|
|
86
|
-
export {};
|
|
87
|
-
//# sourceMappingURL=axm-skill-compatibility.d.ts.map
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import * as Layer from "effect/Layer";
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import * as ServiceMap from "effect/Context";
|
|
4
|
-
import * as semver from "semver";
|
|
5
|
-
export const AXM_SKILL_FQN = "@agentxm/skills/axm";
|
|
6
|
-
const AXM_SKILL_AGENTXM_SOURCE = `agentxm:${AXM_SKILL_FQN}`;
|
|
7
|
-
export const AXM_SKILL_CLI_VERSION_METADATA_KEY = "axm.sh/cli-version";
|
|
8
|
-
export const AXM_SKILL_CLI_VERSION_RANGE_METADATA_KEY = "axm.sh/cli-version-range";
|
|
9
|
-
export const AXM_SKILL_BUNDLED_PREVIEW_COMMAND = "axm skills install @agentxm/skills/axm --bundled --preview";
|
|
10
|
-
export const AXM_SKILL_BUNDLED_APPLY_COMMAND = "axm skills install @agentxm/skills/axm --bundled";
|
|
11
|
-
export const AXM_SKILL_REGISTRY_PREVIEW_COMMAND = "axm skills update --name axm --preview";
|
|
12
|
-
export const AXM_SKILL_REGISTRY_APPLY_COMMAND = "axm skills update --name axm";
|
|
13
|
-
export const AxmSkillCompatibilityReasonSchema = Schema.Literals([
|
|
14
|
-
"cli-version-unavailable",
|
|
15
|
-
"axm-skill-missing",
|
|
16
|
-
"axm-skill-manifest-invalid",
|
|
17
|
-
"compatibility-metadata-missing",
|
|
18
|
-
"compatibility-metadata-malformed",
|
|
19
|
-
"skill-release-mismatch",
|
|
20
|
-
"skill-release-range-mismatch",
|
|
21
|
-
"cli-version-incompatible",
|
|
22
|
-
]);
|
|
23
|
-
export const AxmSkillCompatibilityRecoveryActionSchema = Schema.Literals([
|
|
24
|
-
"none",
|
|
25
|
-
"inspect-cli",
|
|
26
|
-
"upgrade-cli",
|
|
27
|
-
"update-registry-skill",
|
|
28
|
-
"install-bundled-skill",
|
|
29
|
-
"preserve-authored-skill",
|
|
30
|
-
]);
|
|
31
|
-
export const AxmSkillCompatibilityRecoveryStepSchema = Schema.Struct({
|
|
32
|
-
boundary: Schema.Literals(["executable", "workspace", "verification"]),
|
|
33
|
-
command: Schema.String,
|
|
34
|
-
preview: Schema.Boolean,
|
|
35
|
-
});
|
|
36
|
-
export const AxmSkillCompatibilityRecoverySchema = Schema.Struct({
|
|
37
|
-
action: AxmSkillCompatibilityRecoveryActionSchema,
|
|
38
|
-
targetCliVersion: Schema.NullOr(Schema.String),
|
|
39
|
-
targetSkillVersion: Schema.NullOr(Schema.String),
|
|
40
|
-
nextAction: Schema.NullOr(Schema.String),
|
|
41
|
-
steps: Schema.Array(AxmSkillCompatibilityRecoveryStepSchema),
|
|
42
|
-
});
|
|
43
|
-
export const formatAxmSkillCompatibilityTarget = (target) => `AXM CLI ${target.targetCliVersion ?? "unknown"} + official AXM skill ${target.targetSkillVersion ?? "unknown"}`;
|
|
44
|
-
export const AxmSkillCompatibilitySchema = Schema.Struct({
|
|
45
|
-
status: Schema.Literals(["compatible", "incompatible"]),
|
|
46
|
-
cliVersion: Schema.NullOr(Schema.String),
|
|
47
|
-
skillVersion: Schema.NullOr(Schema.String),
|
|
48
|
-
source: Schema.NullOr(Schema.String),
|
|
49
|
-
declaredCliVersion: Schema.NullOr(Schema.String),
|
|
50
|
-
declaredCliVersionRange: Schema.NullOr(Schema.String),
|
|
51
|
-
reasonCode: Schema.NullOr(AxmSkillCompatibilityReasonSchema),
|
|
52
|
-
detail: Schema.NullOr(Schema.String),
|
|
53
|
-
recovery: AxmSkillCompatibilityRecoverySchema,
|
|
54
|
-
});
|
|
55
|
-
export class AxmSkillCompatibilityPolicy extends ServiceMap.Service()("@agentxm/extension-resolution/axm-skill-compatibility/AxmSkillCompatibilityPolicy") {
|
|
56
|
-
}
|
|
57
|
-
const wildcardRangePattern = /(?:^|[.\s])(?:[xX*])(?:$|[.\s])/u;
|
|
58
|
-
const compatibilitySatisfies = (version, range) => semver.satisfies(version, range, { includePrerelease: true });
|
|
59
|
-
const comparatorSetIsBounded = (comparators) => {
|
|
60
|
-
let hasLowerBound = false;
|
|
61
|
-
let hasUpperBound = false;
|
|
62
|
-
for (const comparator of comparators) {
|
|
63
|
-
if (comparator.value.length === 0)
|
|
64
|
-
continue;
|
|
65
|
-
switch (comparator.operator) {
|
|
66
|
-
case "":
|
|
67
|
-
hasLowerBound = true;
|
|
68
|
-
hasUpperBound = true;
|
|
69
|
-
break;
|
|
70
|
-
case ">":
|
|
71
|
-
case ">=":
|
|
72
|
-
hasLowerBound = true;
|
|
73
|
-
break;
|
|
74
|
-
case "<":
|
|
75
|
-
case "<=":
|
|
76
|
-
hasUpperBound = true;
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return hasLowerBound && hasUpperBound;
|
|
81
|
-
};
|
|
82
|
-
export const validateAxmSkillCliVersionRange = (value) => {
|
|
83
|
-
if (value.length === 0 || value.trim() !== value || wildcardRangePattern.test(value)) {
|
|
84
|
-
return { valid: false };
|
|
85
|
-
}
|
|
86
|
-
if (semver.validRange(value) === null)
|
|
87
|
-
return { valid: false };
|
|
88
|
-
try {
|
|
89
|
-
const range = new semver.Range(value);
|
|
90
|
-
return range.set.length > 0 && range.set.every(comparatorSetIsBounded)
|
|
91
|
-
? { valid: true }
|
|
92
|
-
: { valid: false };
|
|
93
|
-
}
|
|
94
|
-
catch {
|
|
95
|
-
return { valid: false };
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const recoveryStep = (boundary, command, preview) => ({ boundary, command, preview });
|
|
99
|
-
const bundledSkillRecovery = (cliVersion) => ({
|
|
100
|
-
action: "install-bundled-skill",
|
|
101
|
-
targetCliVersion: cliVersion,
|
|
102
|
-
targetSkillVersion: cliVersion,
|
|
103
|
-
nextAction: AXM_SKILL_BUNDLED_PREVIEW_COMMAND,
|
|
104
|
-
steps: [
|
|
105
|
-
recoveryStep("workspace", AXM_SKILL_BUNDLED_PREVIEW_COMMAND, true),
|
|
106
|
-
recoveryStep("workspace", AXM_SKILL_BUNDLED_APPLY_COMMAND, false),
|
|
107
|
-
recoveryStep("verification", "axm lint", false),
|
|
108
|
-
],
|
|
109
|
-
});
|
|
110
|
-
const isAuthoredSource = (source) => source === "workspace";
|
|
111
|
-
const isRegistrySource = (source) => source === AXM_SKILL_FQN ||
|
|
112
|
-
source?.startsWith(`${AXM_SKILL_FQN}@`) === true ||
|
|
113
|
-
source === AXM_SKILL_AGENTXM_SOURCE ||
|
|
114
|
-
source?.startsWith(`${AXM_SKILL_AGENTXM_SOURCE}@`) === true;
|
|
115
|
-
const registrySkillRecovery = (cliVersion) => ({
|
|
116
|
-
action: "update-registry-skill",
|
|
117
|
-
targetCliVersion: cliVersion,
|
|
118
|
-
targetSkillVersion: cliVersion,
|
|
119
|
-
nextAction: AXM_SKILL_REGISTRY_PREVIEW_COMMAND,
|
|
120
|
-
steps: [
|
|
121
|
-
recoveryStep("workspace", AXM_SKILL_REGISTRY_PREVIEW_COMMAND, true),
|
|
122
|
-
recoveryStep("workspace", AXM_SKILL_REGISTRY_APPLY_COMMAND, false),
|
|
123
|
-
recoveryStep("verification", "axm lint", false),
|
|
124
|
-
],
|
|
125
|
-
});
|
|
126
|
-
const deriveRecovery = (compatibility) => {
|
|
127
|
-
if (compatibility.status === "compatible") {
|
|
128
|
-
return {
|
|
129
|
-
action: "none",
|
|
130
|
-
targetCliVersion: compatibility.cliVersion,
|
|
131
|
-
targetSkillVersion: compatibility.skillVersion,
|
|
132
|
-
nextAction: null,
|
|
133
|
-
steps: [],
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
if (compatibility.reasonCode === "cli-version-unavailable") {
|
|
137
|
-
return {
|
|
138
|
-
action: "inspect-cli",
|
|
139
|
-
targetCliVersion: null,
|
|
140
|
-
targetSkillVersion: compatibility.skillVersion,
|
|
141
|
-
nextAction: "axm --version",
|
|
142
|
-
steps: [
|
|
143
|
-
recoveryStep("verification", "axm --version", false),
|
|
144
|
-
recoveryStep("verification", "axm lint", false),
|
|
145
|
-
],
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
if (compatibility.reasonCode === "cli-version-incompatible" &&
|
|
149
|
-
compatibility.cliVersion !== null &&
|
|
150
|
-
compatibility.declaredCliVersionRange !== null) {
|
|
151
|
-
const minimum = semver.minVersion(compatibility.declaredCliVersionRange);
|
|
152
|
-
if (minimum !== null && semver.lt(compatibility.cliVersion, minimum)) {
|
|
153
|
-
return {
|
|
154
|
-
action: "upgrade-cli",
|
|
155
|
-
targetCliVersion: compatibility.declaredCliVersion ?? minimum.version,
|
|
156
|
-
targetSkillVersion: compatibility.skillVersion,
|
|
157
|
-
nextAction: "axm upgrade",
|
|
158
|
-
steps: [
|
|
159
|
-
recoveryStep("executable", "axm upgrade", false),
|
|
160
|
-
recoveryStep("verification", "axm lint", false),
|
|
161
|
-
],
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (isAuthoredSource(compatibility.source)) {
|
|
166
|
-
return {
|
|
167
|
-
action: "preserve-authored-skill",
|
|
168
|
-
targetCliVersion: compatibility.cliVersion,
|
|
169
|
-
targetSkillVersion: compatibility.cliVersion,
|
|
170
|
-
nextAction: "axm help upgrade",
|
|
171
|
-
steps: [recoveryStep("verification", "axm help upgrade", false)],
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
if (isRegistrySource(compatibility.source) && compatibility.cliVersion !== null) {
|
|
175
|
-
return registrySkillRecovery(compatibility.cliVersion);
|
|
176
|
-
}
|
|
177
|
-
return compatibility.cliVersion === null
|
|
178
|
-
? {
|
|
179
|
-
action: "inspect-cli",
|
|
180
|
-
targetCliVersion: null,
|
|
181
|
-
targetSkillVersion: compatibility.skillVersion,
|
|
182
|
-
nextAction: "axm --version",
|
|
183
|
-
steps: [recoveryStep("verification", "axm --version", false)],
|
|
184
|
-
}
|
|
185
|
-
: bundledSkillRecovery(compatibility.cliVersion);
|
|
186
|
-
};
|
|
187
|
-
const withRecovery = (compatibility) => ({
|
|
188
|
-
...compatibility,
|
|
189
|
-
recovery: deriveRecovery(compatibility),
|
|
190
|
-
});
|
|
191
|
-
const incompatible = (fields, reasonCode, detail) => withRecovery({
|
|
192
|
-
status: "incompatible",
|
|
193
|
-
...fields,
|
|
194
|
-
reasonCode,
|
|
195
|
-
detail,
|
|
196
|
-
});
|
|
197
|
-
export const evaluateAxmSkillCompatibility = (input) => {
|
|
198
|
-
const cliVersion = input.cliVersion === null ? null : semver.valid(input.cliVersion);
|
|
199
|
-
const skillVersion = input.skill?.manifestVersion ?? null;
|
|
200
|
-
const source = input.skill?.source ?? null;
|
|
201
|
-
const declaredCliVersion = input.skill?.metadata?.[AXM_SKILL_CLI_VERSION_METADATA_KEY] ?? null;
|
|
202
|
-
const declaredCliVersionRange = input.skill?.metadata?.[AXM_SKILL_CLI_VERSION_RANGE_METADATA_KEY] ?? null;
|
|
203
|
-
const fields = {
|
|
204
|
-
cliVersion,
|
|
205
|
-
skillVersion,
|
|
206
|
-
source,
|
|
207
|
-
declaredCliVersion,
|
|
208
|
-
declaredCliVersionRange,
|
|
209
|
-
};
|
|
210
|
-
if (cliVersion === null) {
|
|
211
|
-
return incompatible(fields, "cli-version-unavailable", "The running AXM CLI version is unavailable or invalid.");
|
|
212
|
-
}
|
|
213
|
-
if (input.skill === null) {
|
|
214
|
-
return incompatible(fields, "axm-skill-missing", "The official @agentxm/skills/axm skill is not installed.");
|
|
215
|
-
}
|
|
216
|
-
const validSkillVersion = input.skill.manifestVersion === null ? null : semver.valid(input.skill.manifestVersion);
|
|
217
|
-
if (validSkillVersion === null) {
|
|
218
|
-
return incompatible(fields, "axm-skill-manifest-invalid", "The official AXM skill manifest has a missing or invalid version.");
|
|
219
|
-
}
|
|
220
|
-
if (declaredCliVersion === null || declaredCliVersionRange === null) {
|
|
221
|
-
return incompatible(fields, "compatibility-metadata-missing", `The official AXM skill must declare ${AXM_SKILL_CLI_VERSION_METADATA_KEY} and ${AXM_SKILL_CLI_VERSION_RANGE_METADATA_KEY}.`);
|
|
222
|
-
}
|
|
223
|
-
if (semver.valid(declaredCliVersion) === null ||
|
|
224
|
-
!validateAxmSkillCliVersionRange(declaredCliVersionRange).valid) {
|
|
225
|
-
return incompatible(fields, "compatibility-metadata-malformed", "The official AXM skill compatibility metadata must contain an exact release and a bounded, wildcard-free semver range.");
|
|
226
|
-
}
|
|
227
|
-
if (validSkillVersion !== declaredCliVersion) {
|
|
228
|
-
return incompatible(fields, "skill-release-mismatch", `The AXM skill manifest reports ${validSkillVersion}, but ${AXM_SKILL_CLI_VERSION_METADATA_KEY} reports ${declaredCliVersion}.`);
|
|
229
|
-
}
|
|
230
|
-
if (!compatibilitySatisfies(declaredCliVersion, declaredCliVersionRange)) {
|
|
231
|
-
return incompatible(fields, "skill-release-range-mismatch", `The AXM skill release ${declaredCliVersion} is outside its declared CLI range ${declaredCliVersionRange}.`);
|
|
232
|
-
}
|
|
233
|
-
if (!compatibilitySatisfies(cliVersion, declaredCliVersionRange)) {
|
|
234
|
-
return incompatible(fields, "cli-version-incompatible", `AXM CLI ${cliVersion} is outside the official AXM skill range ${declaredCliVersionRange}.`);
|
|
235
|
-
}
|
|
236
|
-
return withRecovery({
|
|
237
|
-
status: "compatible",
|
|
238
|
-
...fields,
|
|
239
|
-
reasonCode: null,
|
|
240
|
-
detail: null,
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
export const makeAxmSkillCompatibilityPolicyLayer = (cliVersion) => Layer.succeed(AxmSkillCompatibilityPolicy, {
|
|
244
|
-
evaluate: (input) => input.fqn === AXM_SKILL_FQN
|
|
245
|
-
? evaluateAxmSkillCompatibility({ cliVersion, skill: input.candidate })
|
|
246
|
-
: null,
|
|
247
|
-
});
|
|
248
|
-
//# sourceMappingURL=axm-skill-compatibility.js.map
|