@agentxm/extension-lifecycle 0.28.11 → 0.28.13
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/dist/src/activation/display-paths.d.ts +25 -0
- package/dist/src/activation/display-paths.js +25 -0
- package/dist/src/activation/errors.d.ts +16 -0
- package/dist/src/activation/errors.js +7 -0
- package/dist/src/activation/set-activation.d.ts +134 -0
- package/dist/src/activation/set-activation.js +772 -0
- package/dist/src/demote/demote-to-external-source.d.ts +82 -0
- package/dist/src/demote/demote-to-external-source.js +233 -0
- package/dist/src/errors.d.ts +0 -8
- package/dist/src/errors.js +0 -8
- package/dist/src/glob.d.ts +35 -0
- package/dist/src/glob.js +75 -0
- package/dist/src/hooks/configured-agent-outcomes-provider.d.ts +7 -3
- package/dist/src/hooks/configured-agent-outcomes-provider.js +11 -4
- package/dist/src/hooks/install/plan.d.ts +45 -0
- package/dist/src/hooks/install/plan.js +224 -0
- package/dist/src/hooks/uninstall/plan.d.ts +20 -0
- package/dist/src/hooks/uninstall/plan.js +77 -0
- package/dist/src/index.d.ts +48 -16
- package/dist/src/index.js +60 -17
- package/dist/src/install/aggregate-projection-step.d.ts +16 -0
- package/dist/src/install/aggregate-projection-step.js +49 -0
- package/dist/src/install/configured.d.ts +65 -0
- package/dist/src/install/configured.js +406 -0
- package/dist/src/install/inline-mcp-operation.d.ts +4 -0
- package/dist/src/install/inline-mcp-operation.js +25 -0
- package/dist/src/install/install-extensions.d.ts +110 -0
- package/dist/src/install/install-extensions.js +282 -0
- package/dist/src/install/per-type-install.d.ts +12 -0
- package/dist/src/install/per-type-install.js +12 -0
- package/dist/src/install/registry-install-target.d.ts +35 -0
- package/dist/src/install/registry-install-target.js +66 -0
- package/dist/src/install/registry-login-suggestion.d.ts +21 -0
- package/dist/src/install/registry-login-suggestion.js +34 -0
- package/dist/src/install/registry-source-resolution.d.ts +54 -0
- package/dist/src/install/registry-source-resolution.js +216 -0
- package/dist/src/install/root-intent.d.ts +19 -0
- package/dist/src/install/root-intent.js +122 -0
- package/dist/src/install/selection-interaction.d.ts +46 -0
- package/dist/src/install/selection-interaction.js +22 -0
- package/dist/src/install/vocabulary.d.ts +143 -0
- package/dist/src/install/vocabulary.js +29 -0
- package/dist/src/knowledge/install/plan.d.ts +35 -0
- package/dist/src/knowledge/install/plan.js +128 -0
- package/dist/src/knowledge/uninstall/plan.d.ts +23 -0
- package/dist/src/knowledge/uninstall/plan.js +140 -0
- package/dist/src/live.d.ts +4 -11
- package/dist/src/live.js +4 -11
- package/dist/src/mcps/install/plan.d.ts +65 -0
- package/dist/src/mcps/install/plan.js +301 -0
- package/dist/src/mcps/operations/disable.d.ts +5 -3
- package/dist/src/mcps/operations/disable.js +6 -4
- package/dist/src/mcps/operations/enable.d.ts +5 -3
- package/dist/src/mcps/operations/enable.js +8 -6
- package/dist/src/mcps/operations/sync-outcome.d.ts +1 -1
- package/dist/src/mcps/operations/uninstall.d.ts +5 -3
- package/dist/src/mcps/operations/uninstall.js +4 -4
- package/dist/src/mcps/uninstall/plan.d.ts +24 -0
- package/dist/src/mcps/uninstall/plan.js +109 -0
- package/dist/src/packs/artifact.d.ts +21 -0
- package/dist/src/packs/artifact.js +32 -0
- package/dist/src/packs/constraint-gate.d.ts +30 -0
- package/dist/src/packs/constraint-gate.js +76 -0
- package/dist/src/packs/expansion.d.ts +13 -14
- package/dist/src/packs/expansion.js +1 -2
- package/dist/src/packs/graph-transition.d.ts +64 -0
- package/dist/src/packs/graph-transition.js +219 -0
- package/dist/src/packs/install/plan.d.ts +95 -0
- package/dist/src/packs/install/plan.js +845 -0
- package/dist/src/packs/member-install-step.d.ts +29 -0
- package/dist/src/packs/member-install-step.js +156 -0
- package/dist/src/packs/operations/install.d.ts +3 -3
- package/dist/src/packs/operations/install.js +5 -5
- package/dist/src/packs/promote-authored-pack.d.ts +86 -0
- package/dist/src/packs/promote-authored-pack.js +239 -0
- package/dist/src/packs/resolved-dependency.d.ts +9 -26
- package/dist/src/packs/resolved-dependency.js +8 -20
- package/dist/src/packs/uninstall/plan.d.ts +66 -0
- package/dist/src/packs/uninstall/plan.js +344 -0
- package/dist/src/packs/uninstall/readiness.d.ts +50 -0
- package/dist/src/packs/uninstall/readiness.js +130 -0
- package/dist/src/publisher-binding.d.ts +8 -40
- package/dist/src/publisher-binding.js +8 -46
- package/dist/src/rules/install/plan.d.ts +35 -0
- package/dist/src/rules/install/plan.js +133 -0
- package/dist/src/rules/uninstall/plan.d.ts +19 -0
- package/dist/src/rules/uninstall/plan.js +54 -0
- package/dist/src/skills/install/bundled.d.ts +73 -0
- package/dist/src/skills/install/bundled.js +244 -0
- package/dist/src/skills/install/plan.d.ts +72 -0
- package/dist/src/skills/install/plan.js +429 -0
- package/dist/src/skills/install/selection.d.ts +26 -0
- package/dist/src/skills/install/selection.js +41 -0
- package/dist/src/skills/install/source.d.ts +21 -0
- package/dist/src/skills/install/source.js +76 -0
- package/dist/src/skills/operations/disable.d.ts +3 -2
- package/dist/src/skills/operations/disable.js +7 -11
- package/dist/src/skills/operations/enable.d.ts +3 -2
- package/dist/src/skills/operations/enable.js +6 -8
- package/dist/src/skills/operations/install.d.ts +4 -4
- package/dist/src/skills/operations/install.js +13 -12
- package/dist/src/skills/uninstall/plan.d.ts +23 -0
- package/dist/src/skills/uninstall/plan.js +165 -0
- package/dist/src/skills/utils.js +1 -1
- package/dist/src/step-failure-conversion.d.ts +44 -0
- package/dist/src/step-failure-conversion.js +26 -0
- package/dist/src/step-failure.d.ts +29 -0
- package/dist/src/step-failure.js +130 -0
- package/dist/src/subagents/install/plan.d.ts +49 -0
- package/dist/src/subagents/install/plan.js +270 -0
- package/dist/src/subagents/install/selection.d.ts +26 -0
- package/dist/src/subagents/install/selection.js +37 -0
- package/dist/src/subagents/install/source.d.ts +18 -0
- package/dist/src/subagents/install/source.js +72 -0
- package/dist/src/subagents/operations/disable.d.ts +5 -3
- package/dist/src/subagents/operations/disable.js +5 -3
- package/dist/src/subagents/operations/enable.d.ts +5 -3
- package/dist/src/subagents/operations/enable.js +17 -12
- package/dist/src/subagents/uninstall/plan.d.ts +20 -0
- package/dist/src/subagents/uninstall/plan.js +142 -0
- package/dist/src/test-packages.d.ts +34 -0
- package/dist/src/test-packages.js +111 -0
- package/dist/src/test-registry.d.ts +78 -0
- package/dist/src/test-registry.js +223 -0
- package/dist/src/testing.d.ts +108 -0
- package/dist/src/testing.js +241 -0
- package/dist/src/uninstall/retention-policy.d.ts +21 -0
- package/dist/src/uninstall/retention-policy.js +28 -0
- package/dist/src/uninstall/root-intent.d.ts +17 -0
- package/dist/src/uninstall/root-intent.js +101 -0
- package/dist/src/uninstall/uninstall-extensions.d.ts +61 -0
- package/dist/src/uninstall/uninstall-extensions.js +127 -0
- package/dist/src/uninstall/vocabulary.d.ts +40 -0
- package/dist/src/uninstall/vocabulary.js +14 -0
- package/dist/src/update/atomicity.d.ts +22 -0
- package/dist/src/update/atomicity.js +23 -0
- package/dist/src/update/blockers.d.ts +31 -0
- package/dist/src/update/blockers.js +78 -0
- package/dist/src/update/configured.d.ts +78 -0
- package/dist/src/update/configured.js +546 -0
- package/dist/src/update/root-request.d.ts +39 -0
- package/dist/src/update/root-request.js +117 -0
- package/dist/src/update/selective/plan.d.ts +45 -0
- package/dist/src/update/selective/plan.js +61 -0
- package/dist/src/update/selective/requirements.d.ts +17 -0
- package/dist/src/update/selective/requirements.js +14 -0
- package/dist/src/update/selective/selection.d.ts +63 -0
- package/dist/src/update/selective/selection.js +85 -0
- package/dist/src/update/selective/skills.d.ts +55 -0
- package/dist/src/update/selective/skills.js +596 -0
- package/dist/src/update/selective/subagents.d.ts +52 -0
- package/dist/src/update/selective/subagents.js +331 -0
- package/dist/src/update/selective/use-case.d.ts +121 -0
- package/dist/src/update/selective/use-case.js +28 -0
- package/dist/src/update/selective/vocabulary.d.ts +43 -0
- package/dist/src/update/selective/vocabulary.js +28 -0
- package/dist/src/update/selector.d.ts +72 -0
- package/dist/src/update/selector.js +120 -0
- package/dist/src/update/targeted-plan.d.ts +30 -0
- package/dist/src/update/targeted-plan.js +113 -0
- package/dist/src/update/update-extensions.d.ts +164 -0
- package/dist/src/update/update-extensions.js +579 -0
- package/dist/src/workspace-paths.d.ts +31 -0
- package/dist/src/workspace-paths.js +46 -0
- package/package.json +22 -12
- package/dist/src/configured-entry-resolution.d.ts +0 -111
- package/dist/src/configured-entry-resolution.js +0 -731
- package/dist/src/failure-adapter.d.ts +0 -35
- package/dist/src/failure-adapter.js +0 -23
- package/dist/src/hooks/manager.d.ts +0 -15
- package/dist/src/hooks/manager.js +0 -769
- package/dist/src/internal/fs-helpers.d.ts +0 -12
- package/dist/src/internal/fs-helpers.js +0 -13
- package/dist/src/internal/integrity.d.ts +0 -13
- package/dist/src/internal/integrity.js +0 -17
- package/dist/src/knowledge/manager.d.ts +0 -11
- package/dist/src/knowledge/manager.js +0 -711
- package/dist/src/mcps/manager.d.ts +0 -16
- package/dist/src/mcps/manager.js +0 -247
- package/dist/src/mcps/operations/artifact.d.ts +0 -24
- package/dist/src/mcps/operations/artifact.js +0 -74
- package/dist/src/mcps/operations/install.d.ts +0 -78
- package/dist/src/mcps/operations/install.js +0 -596
- package/dist/src/packs/dependency-resolution.d.ts +0 -65
- package/dist/src/packs/dependency-resolution.js +0 -414
- package/dist/src/packs/manager.d.ts +0 -16
- package/dist/src/packs/manager.js +0 -181
- package/dist/src/registry-materialization.d.ts +0 -52
- package/dist/src/registry-materialization.js +0 -72
- package/dist/src/release-age-posture.d.ts +0 -23
- package/dist/src/release-age-posture.js +0 -15
- package/dist/src/resolution-timeout.d.ts +0 -5
- package/dist/src/resolution-timeout.js +0 -11
- package/dist/src/rules/manager.d.ts +0 -20
- package/dist/src/rules/manager.js +0 -480
- package/dist/src/skills/manager.d.ts +0 -18
- package/dist/src/skills/manager.js +0 -346
- package/dist/src/skills/materialization.d.ts +0 -54
- package/dist/src/skills/materialization.js +0 -158
- package/dist/src/skills/operations/source-hash.d.ts +0 -2
- package/dist/src/skills/operations/source-hash.js +0 -6
- package/dist/src/subagents/manager.d.ts +0 -18
- package/dist/src/subagents/manager.js +0 -722
- package/dist/src/workflows/install-command/workflow.d.ts +0 -56
- package/dist/src/workflows/install-command/workflow.js +0 -46
- package/dist/src/workflows/uninstall-command/workflow.d.ts +0 -42
- package/dist/src/workflows/uninstall-command/workflow.js +0 -29
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The grammar a root `update` request is written in.
|
|
3
|
+
*
|
|
4
|
+
* Root update names one extension by its Registry identity and nothing else.
|
|
5
|
+
* A path, URL, or Git source names a package whose identity the workspace
|
|
6
|
+
* cannot compare against what it already accepted, and a Library is a curated
|
|
7
|
+
* collection rather than an installed package, so both are refused here with
|
|
8
|
+
* the per-type route that does accept them. The refusal carries its own
|
|
9
|
+
* how-to-fix sentence: what a person should type instead depends on what they
|
|
10
|
+
* typed, and only this grammar knows that.
|
|
11
|
+
*
|
|
12
|
+
* @experimental This API is unstable and may change without notice.
|
|
13
|
+
*/
|
|
14
|
+
import * as Effect from "effect/Effect";
|
|
15
|
+
import * as Option from "effect/Option";
|
|
16
|
+
import * as Schema from "effect/Schema";
|
|
17
|
+
import { ExtensionLifecycleFailed } from "../errors.js";
|
|
18
|
+
import { installableExtensionTypePluralSegments, InstallableExtensionTypePluralSchema, isInstallableExtensionTypePlural, toInstallableExtensionType, } from "@agentxm/extension-model/unstable/extensions/installable-types";
|
|
19
|
+
import { RegistrySourceRefSchema, } from "@agentxm/extension-model/unstable/extensions";
|
|
20
|
+
import { parseInputPattern } from "@agentxm/extension-model/unstable/sources/parser";
|
|
21
|
+
const decodeRegistrySourceRef = Schema.decodeUnknownEffect(RegistrySourceRefSchema);
|
|
22
|
+
export const rootUpdatableTypeSegments = installableExtensionTypePluralSegments;
|
|
23
|
+
export const RootUpdatableTypeSegmentSchema = InstallableExtensionTypePluralSchema;
|
|
24
|
+
const rootUpdateFqnGrammar = "@<handle>/<plural-type>/<name>[@<version>]";
|
|
25
|
+
const supportedRootUpdateTypes = rootUpdatableTypeSegments.join(", ");
|
|
26
|
+
const rootUpdateRegistryOnlyHowToFix = (source) => {
|
|
27
|
+
const parsed = parseInputPattern(source);
|
|
28
|
+
if (Option.isNone(parsed)) {
|
|
29
|
+
return "Use `axm update @<handle>/<plural-type>/<name>[@<version>]`. For path, URL, or git sources, use `axm skills update <source>` or `axm subagents update <source>` instead.";
|
|
30
|
+
}
|
|
31
|
+
switch (parsed.value.pattern.pattern) {
|
|
32
|
+
case "file-path-pattern":
|
|
33
|
+
case "url-input":
|
|
34
|
+
case "git-scp-address":
|
|
35
|
+
case "shorthand-input":
|
|
36
|
+
case "slash-pattern":
|
|
37
|
+
return `Root update only accepts registry FQNs. Use \`axm skills update ${source}\` or \`axm subagents update ${source}\` instead.`;
|
|
38
|
+
case "name-input":
|
|
39
|
+
case "glob-input":
|
|
40
|
+
return `Root update only accepts registry FQNs. Use the matching per-type command instead: \`axm skills update ${source}\` or \`axm subagents update ${source}\`.`;
|
|
41
|
+
case "registry-pattern-input":
|
|
42
|
+
return "Use `axm update @<handle>/<plural-type>/<name>[@<version>]`.";
|
|
43
|
+
case "workspace-pattern-input":
|
|
44
|
+
return "Workspace-sourced extensions are locally authoritative and are not update targets.";
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Read one root-update request. Fails with the refusal a person can act on;
|
|
49
|
+
* succeeds with the Registry identity every later step is decided against.
|
|
50
|
+
*/
|
|
51
|
+
export const resolveRootUpdateIntent = Effect.fn("UpdateExtensions.readRootRequest")(function* (input) {
|
|
52
|
+
const source = input.trim();
|
|
53
|
+
const segments = source.split("/");
|
|
54
|
+
const pluralType = segments.length === 3 ? segments[1] : undefined;
|
|
55
|
+
if (!source.startsWith("@")) {
|
|
56
|
+
return yield* new ExtensionLifecycleFailed({
|
|
57
|
+
category: "usage",
|
|
58
|
+
detail: "Root update only accepts registry FQNs",
|
|
59
|
+
suggestions: [{ description: rootUpdateRegistryOnlyHowToFix(source) }],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (pluralType === "libraries") {
|
|
63
|
+
return yield* new ExtensionLifecycleFailed({
|
|
64
|
+
category: "usage",
|
|
65
|
+
detail: "Libraries are curated registry collections and cannot be updated",
|
|
66
|
+
suggestions: [
|
|
67
|
+
{
|
|
68
|
+
description: "Update installed extensions individually; Library membership is viewed in AgentXM.",
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const parsed = yield* decodeRegistrySourceRef(source).pipe(Effect.mapError((error) => {
|
|
74
|
+
if (pluralType !== undefined && !isInstallableExtensionTypePlural(pluralType)) {
|
|
75
|
+
return new ExtensionLifecycleFailed({
|
|
76
|
+
category: "not_found",
|
|
77
|
+
detail: "Update source uses an unsupported plural type",
|
|
78
|
+
suggestions: [
|
|
79
|
+
{
|
|
80
|
+
description: `Use ${rootUpdateFqnGrammar}. Supported plural types: ${supportedRootUpdateTypes}.`,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
cause: error,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return new ExtensionLifecycleFailed({
|
|
87
|
+
category: "validation",
|
|
88
|
+
detail: "Update source must be a registry FQN",
|
|
89
|
+
suggestions: [
|
|
90
|
+
{
|
|
91
|
+
description: `Use ${rootUpdateFqnGrammar} with one of: ${supportedRootUpdateTypes}.`,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
cause: error,
|
|
95
|
+
});
|
|
96
|
+
}));
|
|
97
|
+
if (!isInstallableExtensionTypePlural(parsed.type)) {
|
|
98
|
+
return yield* new ExtensionLifecycleFailed({
|
|
99
|
+
category: "usage",
|
|
100
|
+
detail: "Root update does not support that extension type",
|
|
101
|
+
suggestions: [
|
|
102
|
+
{
|
|
103
|
+
description: `Use ${rootUpdateFqnGrammar}. Supported plural types: ${supportedRootUpdateTypes}.`,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
source,
|
|
110
|
+
type: toInstallableExtensionType(parsed.type),
|
|
111
|
+
owner: parsed.owner,
|
|
112
|
+
name: parsed.name,
|
|
113
|
+
versionRange: Option.fromUndefinedOr(parsed.versionRange),
|
|
114
|
+
target: `${parsed.owner}/${parsed.type}/${parsed.name}`,
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=root-request.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which selected entries a selective update actually advances.
|
|
3
|
+
*
|
|
4
|
+
* Every selected entry has already been re-resolved against its source. This
|
|
5
|
+
* decides, per entry, whether the resolution differs from the accepted one:
|
|
6
|
+
* a Git resolution compares tree hashes, a Registry resolution compares
|
|
7
|
+
* versions and publisher bindings, a local resolution always advances, and an
|
|
8
|
+
* entry the person forced advances regardless. An entry that matches what is
|
|
9
|
+
* already accepted is reported as unchanged rather than reinstalled.
|
|
10
|
+
*
|
|
11
|
+
* @experimental This API is unstable and may change without notice.
|
|
12
|
+
*/
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
|
+
import type * as Option from "effect/Option";
|
|
15
|
+
import type { JobStepResult, Plan, StepFailure } from "@agentxm/workspace-operations";
|
|
16
|
+
import type { SkillExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/skill";
|
|
17
|
+
import type { SubagentExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/subagent";
|
|
18
|
+
import type { SkillLockEntry, SubagentLockEntry } from "@agentxm/workspace-state";
|
|
19
|
+
/** The accepted resolution shape both lock maps share for this comparison. */
|
|
20
|
+
type AcceptedEntry = SkillLockEntry | SubagentLockEntry;
|
|
21
|
+
/**
|
|
22
|
+
* The facts the comparison reads off a resolved ref. Every ref kind either
|
|
23
|
+
* carries a version, a tree hash, or neither; a workspace-authored ref names
|
|
24
|
+
* no remote resolution at all and always advances.
|
|
25
|
+
*/
|
|
26
|
+
interface ResolvedRefFacts {
|
|
27
|
+
readonly refType: SkillExtensionRef["refType"] | SubagentExtensionRef["refType"];
|
|
28
|
+
readonly version?: string;
|
|
29
|
+
readonly gitTreeSha?: string;
|
|
30
|
+
}
|
|
31
|
+
/** One entry the plan may advance, with the identity the comparison uses. */
|
|
32
|
+
export interface SelectiveUpdateUnit<TOperation> {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly ref: ResolvedRefFacts;
|
|
35
|
+
readonly force: boolean;
|
|
36
|
+
readonly operation: TOperation;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Build the advance plan for one selective update: one unbounded job whose
|
|
40
|
+
* steps are the selected entries, each either unchanged or dispatched to the
|
|
41
|
+
* install operation that advances it.
|
|
42
|
+
*/
|
|
43
|
+
export declare const buildSelectiveUpdatePlan: <TOperation, R>(units: ReadonlyArray<SelectiveUpdateUnit<TOperation>>, acceptedResolutions: Readonly<Record<string, AcceptedEntry | undefined>>, name: string, description: Option.Option<string>, makeRunClosure: (operation: TOperation) => Effect.Effect<JobStepResult, StepFailure, R>) => Plan<R>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which selected entries a selective update actually advances.
|
|
3
|
+
*
|
|
4
|
+
* Every selected entry has already been re-resolved against its source. This
|
|
5
|
+
* decides, per entry, whether the resolution differs from the accepted one:
|
|
6
|
+
* a Git resolution compares tree hashes, a Registry resolution compares
|
|
7
|
+
* versions and publisher bindings, a local resolution always advances, and an
|
|
8
|
+
* entry the person forced advances regardless. An entry that matches what is
|
|
9
|
+
* already accepted is reported as unchanged rather than reinstalled.
|
|
10
|
+
*
|
|
11
|
+
* @experimental This API is unstable and may change without notice.
|
|
12
|
+
*/
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
|
+
/**
|
|
15
|
+
* Whether a resolution differs from what the workspace already accepted.
|
|
16
|
+
*/
|
|
17
|
+
const hasChanged = (ref, accepted) => {
|
|
18
|
+
if (ref.refType === "git-hosted") {
|
|
19
|
+
return !(accepted.type !== "registry" &&
|
|
20
|
+
accepted.type !== "local" &&
|
|
21
|
+
accepted.resolvedTree === ref.gitTreeSha);
|
|
22
|
+
}
|
|
23
|
+
if (ref.refType === "registry") {
|
|
24
|
+
return accepted.type !== "registry" || ref.version !== accepted.resolvedVersion;
|
|
25
|
+
}
|
|
26
|
+
// Local and workspace sources carry no resolution to compare against, so
|
|
27
|
+
// they always advance.
|
|
28
|
+
return true;
|
|
29
|
+
};
|
|
30
|
+
const unchangedStep = (label) => ({
|
|
31
|
+
readiness: "ready",
|
|
32
|
+
label,
|
|
33
|
+
run: Effect.succeed({
|
|
34
|
+
result: "success",
|
|
35
|
+
disposition: "unchanged",
|
|
36
|
+
message: "already up to date",
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Build the advance plan for one selective update: one unbounded job whose
|
|
41
|
+
* steps are the selected entries, each either unchanged or dispatched to the
|
|
42
|
+
* install operation that advances it.
|
|
43
|
+
*/
|
|
44
|
+
export const buildSelectiveUpdatePlan = (units, acceptedResolutions, name, description, makeRunClosure) => ({
|
|
45
|
+
_tag: "Plan",
|
|
46
|
+
name,
|
|
47
|
+
description,
|
|
48
|
+
jobs: [
|
|
49
|
+
{
|
|
50
|
+
concurrency: "unbounded",
|
|
51
|
+
steps: units.map((unit) => {
|
|
52
|
+
const accepted = acceptedResolutions[unit.name];
|
|
53
|
+
const needsUpdate = accepted === undefined || unit.force || hasChanged(unit.ref, accepted);
|
|
54
|
+
return needsUpdate
|
|
55
|
+
? { readiness: "ready", label: unit.name, run: makeRunClosure(unit.operation) }
|
|
56
|
+
: unchangedStep(unit.name);
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a selective update's plan steps declare at execution time.
|
|
3
|
+
*
|
|
4
|
+
* A selective advance runs the same install operation the install routes run,
|
|
5
|
+
* so its steps carry the install step requirements plus the two services that
|
|
6
|
+
* operation reaches for directly: the source providers it re-fetches through,
|
|
7
|
+
* and the boundary's failure conversion. Those requirements travel with the
|
|
8
|
+
* step and are composed once at the application's runtime boundary — nothing
|
|
9
|
+
* is captured into a step's closure on the way.
|
|
10
|
+
*
|
|
11
|
+
* @experimental This API is unstable and may change without notice.
|
|
12
|
+
*/
|
|
13
|
+
import type { SourceHostProviders } from "@agentxm/extension-sources";
|
|
14
|
+
import type { InstallStepRequirements } from "../../install/vocabulary.js";
|
|
15
|
+
import type { StepFailureConversion } from "../../step-failure-conversion.js";
|
|
16
|
+
export type SelectiveUpdateStepRequirements = InstallStepRequirements | SourceHostProviders | StepFailureConversion;
|
|
17
|
+
//# sourceMappingURL=requirements.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a selective update's plan steps declare at execution time.
|
|
3
|
+
*
|
|
4
|
+
* A selective advance runs the same install operation the install routes run,
|
|
5
|
+
* so its steps carry the install step requirements plus the two services that
|
|
6
|
+
* operation reaches for directly: the source providers it re-fetches through,
|
|
7
|
+
* and the boundary's failure conversion. Those requirements travel with the
|
|
8
|
+
* step and are composed once at the application's runtime boundary — nothing
|
|
9
|
+
* is captured into a step's closure on the way.
|
|
10
|
+
*
|
|
11
|
+
* @experimental This API is unstable and may change without notice.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=requirements.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which configured entries a selective update is about.
|
|
3
|
+
*
|
|
4
|
+
* `skills update` and `subagents update` accept two selectors: a positional
|
|
5
|
+
* that names either an installed extension or the source it came from, and a
|
|
6
|
+
* repeated name filter that accepts globs. Both narrow the configured,
|
|
7
|
+
* enabled entries of one type; neither resolves anything from a Registry.
|
|
8
|
+
* A selector that matches nothing is not a failure — it is a settled no-op
|
|
9
|
+
* with the reason the application renders.
|
|
10
|
+
*
|
|
11
|
+
* @experimental This API is unstable and may change without notice.
|
|
12
|
+
*/
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
|
+
import * as Option from "effect/Option";
|
|
15
|
+
import { SourceHostProviders, type IdentifierResourceType } from "@agentxm/extension-sources";
|
|
16
|
+
/** One configured entry a selective update may advance. */
|
|
17
|
+
export type SelectiveUpdateEntry = readonly [name: string, source: string];
|
|
18
|
+
/** Why a selective update settled without a plan. */
|
|
19
|
+
export type SelectiveUpdateNothingReason = "none-installed" | "no-source-match" | "no-name-match";
|
|
20
|
+
export type SelectiveUpdateSelection = {
|
|
21
|
+
readonly kind: "targets";
|
|
22
|
+
readonly entries: ReadonlyArray<SelectiveUpdateEntry>;
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: "nothing";
|
|
25
|
+
readonly reason: SelectiveUpdateNothingReason;
|
|
26
|
+
readonly message: string;
|
|
27
|
+
};
|
|
28
|
+
export interface SelectiveUpdateSelectors {
|
|
29
|
+
/** Positional selector: an installed name, or the source an entry declares. */
|
|
30
|
+
readonly source: Option.Option<string>;
|
|
31
|
+
/** Repeated name filter; entries may be globs. */
|
|
32
|
+
readonly nameFilters: ReadonlyArray<string>;
|
|
33
|
+
/** The flag spelling the application registered, quoted in the no-op reason. */
|
|
34
|
+
readonly nameFilterFlag: string;
|
|
35
|
+
}
|
|
36
|
+
interface SelectionRequest extends SelectiveUpdateSelectors {
|
|
37
|
+
readonly entries: ReadonlyArray<SelectiveUpdateEntry>;
|
|
38
|
+
readonly resourceType: IdentifierResourceType;
|
|
39
|
+
readonly resourceLabel: string;
|
|
40
|
+
readonly resourceLabelPlural: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Narrow the configured entries to the ones both selectors admit, or say
|
|
44
|
+
* which selector admitted nothing.
|
|
45
|
+
*/
|
|
46
|
+
export declare const selectUpdateTargets: (request: SelectionRequest) => Effect.Effect<{
|
|
47
|
+
kind: "nothing";
|
|
48
|
+
reason: "no-source-match";
|
|
49
|
+
message: string;
|
|
50
|
+
entries?: never;
|
|
51
|
+
} | {
|
|
52
|
+
kind: "nothing";
|
|
53
|
+
reason: "no-name-match";
|
|
54
|
+
message: string;
|
|
55
|
+
entries?: never;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "targets";
|
|
58
|
+
entries: readonly SelectiveUpdateEntry[];
|
|
59
|
+
reason?: never;
|
|
60
|
+
message?: never;
|
|
61
|
+
}, import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed, import("effect/FileSystem").FileSystem | import("effect/Path").Path | import("effect/unstable/http/HttpClient").HttpClient | SourceHostProviders | import("@agentxm/extension-sources").WorkspaceCatalog>;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which configured entries a selective update is about.
|
|
3
|
+
*
|
|
4
|
+
* `skills update` and `subagents update` accept two selectors: a positional
|
|
5
|
+
* that names either an installed extension or the source it came from, and a
|
|
6
|
+
* repeated name filter that accepts globs. Both narrow the configured,
|
|
7
|
+
* enabled entries of one type; neither resolves anything from a Registry.
|
|
8
|
+
* A selector that matches nothing is not a failure — it is a settled no-op
|
|
9
|
+
* with the reason the application renders.
|
|
10
|
+
*
|
|
11
|
+
* @experimental This API is unstable and may change without notice.
|
|
12
|
+
*/
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
|
+
import * as Option from "effect/Option";
|
|
15
|
+
import { parseSourceQualifiedRegistrySourcePatternParts } from "@agentxm/extension-model/unstable/extensions";
|
|
16
|
+
import { resolveInstalledIdentifierNameOrInput, resolveSource, SourceHostProviders, } from "@agentxm/extension-sources";
|
|
17
|
+
import { expandGlobs } from "../../glob.js";
|
|
18
|
+
/**
|
|
19
|
+
* Whether a positional selector names the same origin an entry declares.
|
|
20
|
+
* Two Registry patterns compare by their parsed parts; anything else
|
|
21
|
+
* compares by the canonical origin its source resolves to.
|
|
22
|
+
*/
|
|
23
|
+
const sourceMatchesEntrySource = (sourceValue, entrySource) => Effect.gen(function* () {
|
|
24
|
+
const requestedRegistry = parseSourceQualifiedRegistrySourcePatternParts(sourceValue);
|
|
25
|
+
const configuredRegistry = parseSourceQualifiedRegistrySourcePatternParts(entrySource);
|
|
26
|
+
if (requestedRegistry !== undefined || configuredRegistry !== undefined) {
|
|
27
|
+
return (requestedRegistry !== undefined &&
|
|
28
|
+
configuredRegistry !== undefined &&
|
|
29
|
+
requestedRegistry.sourceName === configuredRegistry.sourceName &&
|
|
30
|
+
requestedRegistry.owner === configuredRegistry.owner &&
|
|
31
|
+
requestedRegistry.type === configuredRegistry.type &&
|
|
32
|
+
requestedRegistry.name === configuredRegistry.name);
|
|
33
|
+
}
|
|
34
|
+
const sources = yield* SourceHostProviders;
|
|
35
|
+
const sourceArgResult = yield* Effect.result(resolveSource(sourceValue));
|
|
36
|
+
if (sourceArgResult._tag === "Failure")
|
|
37
|
+
return false;
|
|
38
|
+
const entrySourceResult = yield* Effect.result(resolveSource(entrySource));
|
|
39
|
+
if (entrySourceResult._tag === "Failure")
|
|
40
|
+
return false;
|
|
41
|
+
return sources.origin(entrySourceResult.success) === sources.origin(sourceArgResult.success);
|
|
42
|
+
});
|
|
43
|
+
const filterBySource = (entries, sourceValue) => Effect.gen(function* () {
|
|
44
|
+
const nameMatched = entries.filter(([name]) => name === sourceValue);
|
|
45
|
+
if (nameMatched.length > 0)
|
|
46
|
+
return nameMatched;
|
|
47
|
+
const matches = yield* Effect.forEach(entries, (entry) => Effect.map(sourceMatchesEntrySource(sourceValue, entry[1]), (matched) => matched ? Option.some(entry) : Option.none()), { concurrency: "unbounded" });
|
|
48
|
+
return matches.filter(Option.isSome).map((match) => match.value);
|
|
49
|
+
});
|
|
50
|
+
const filterByNameFilters = (entries, nameFilters, resourceType) => Effect.gen(function* () {
|
|
51
|
+
if (nameFilters.length === 0)
|
|
52
|
+
return entries;
|
|
53
|
+
const resolved = yield* Effect.forEach(nameFilters, (name) => name.includes("*")
|
|
54
|
+
? Effect.succeed(name)
|
|
55
|
+
: resolveInstalledIdentifierNameOrInput({ input: name, resourceType }));
|
|
56
|
+
const matched = new Set(expandGlobs(resolved, entries.map(([name]) => name)));
|
|
57
|
+
return entries.filter(([name]) => matched.has(name));
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Narrow the configured entries to the ones both selectors admit, or say
|
|
61
|
+
* which selector admitted nothing.
|
|
62
|
+
*/
|
|
63
|
+
export const selectUpdateTargets = Effect.fn("SelectiveUpdate.selectTargets")(function* (request) {
|
|
64
|
+
const sourceValue = Option.getOrUndefined(request.source);
|
|
65
|
+
const sourceFiltered = sourceValue === undefined
|
|
66
|
+
? request.entries
|
|
67
|
+
: yield* filterBySource(request.entries, sourceValue);
|
|
68
|
+
if (sourceValue !== undefined && sourceFiltered.length === 0) {
|
|
69
|
+
return {
|
|
70
|
+
kind: "nothing",
|
|
71
|
+
reason: "no-source-match",
|
|
72
|
+
message: `No installed ${request.resourceLabel} matched "${sourceValue}" as a name or source.`,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const nameFiltered = yield* filterByNameFilters(sourceFiltered, request.nameFilters, request.resourceType);
|
|
76
|
+
if (request.nameFilters.length > 0 && nameFiltered.length === 0) {
|
|
77
|
+
return {
|
|
78
|
+
kind: "nothing",
|
|
79
|
+
reason: "no-name-match",
|
|
80
|
+
message: `No installed ${request.resourceLabelPlural} match the ${request.nameFilterFlag} filter.`,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return { kind: "targets", entries: nameFiltered };
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=selection.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advancing the skills a workspace selected.
|
|
3
|
+
*
|
|
4
|
+
* `skills update` re-resolves each selected, enabled skill against the source
|
|
5
|
+
* the workspace declared, then advances the ones whose resolution differs
|
|
6
|
+
* from what was accepted. Two constraints govern the version it lands on: the
|
|
7
|
+
* range the workspace itself recorded, and the ranges every Pack that owns
|
|
8
|
+
* the skill declares. Precedence, not intersection, decides between them —
|
|
9
|
+
* `@agentxm/extension-resolution`'s constraint precedence owns that rule, and
|
|
10
|
+
* this module supplies it the visible version list and carries its warnings
|
|
11
|
+
* onto the plan. A skill that cannot be re-resolved is reported as a skipped
|
|
12
|
+
* unit rather than failing the sweep, so one unreachable source does not stop
|
|
13
|
+
* every other advance.
|
|
14
|
+
*
|
|
15
|
+
* @experimental This API is unstable and may change without notice.
|
|
16
|
+
*/
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import { SourceHostProviders } from "@agentxm/extension-sources";
|
|
19
|
+
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
20
|
+
import { ExtensionLifecycleFailed } from "../../errors.js";
|
|
21
|
+
import type { SelectiveUpdateStepRequirements } from "./requirements.js";
|
|
22
|
+
import { type SelectiveUpdateSelectors } from "./selection.js";
|
|
23
|
+
/** Everything `skills update` needs beyond the workspace it runs in. */
|
|
24
|
+
export interface SelectiveSkillUpdateRequest extends SelectiveUpdateSelectors {
|
|
25
|
+
readonly kind: "selective-skills";
|
|
26
|
+
/** Advance outside the version ranges installed Packs declare. */
|
|
27
|
+
readonly ignoreVersionConstraints: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** Settle a `skills update` request: decide everything, write nothing. */
|
|
30
|
+
export declare const prepareSelectiveSkillUpdate: (request: SelectiveSkillUpdateRequest) => Effect.Effect<{
|
|
31
|
+
outcome: "nothing";
|
|
32
|
+
reason: "none-installed";
|
|
33
|
+
message: string;
|
|
34
|
+
subjectType: "skill";
|
|
35
|
+
planName: string;
|
|
36
|
+
planDescription: string;
|
|
37
|
+
execution?: never;
|
|
38
|
+
} | {
|
|
39
|
+
outcome: "nothing";
|
|
40
|
+
reason: "no-source-match" | "no-name-match";
|
|
41
|
+
message: string;
|
|
42
|
+
subjectType: "skill";
|
|
43
|
+
planName: string;
|
|
44
|
+
planDescription: string;
|
|
45
|
+
execution?: never;
|
|
46
|
+
} | {
|
|
47
|
+
outcome: "planned";
|
|
48
|
+
subjectType: "skill";
|
|
49
|
+
planName: string;
|
|
50
|
+
execution: import("@agentxm/workspace-operations").ExecutionCandidate<SelectiveUpdateStepRequirements, never>;
|
|
51
|
+
reason?: never;
|
|
52
|
+
message?: never;
|
|
53
|
+
planDescription?: never;
|
|
54
|
+
}, ExtensionLifecycleFailed | import("@agentxm/extension-sources").SourceSyntaxInvalid | import("@agentxm/extension-sources").SourceHostNotConfigured | import("@agentxm/extension-sources").SourceNotResolvable | import("@agentxm/extension-sources").SourceNetworkFailure | import("@agentxm/extension-sources").GitOperationFailed | import("@agentxm/extension-sources").WorkspaceCatalogUnavailable | import("@agentxm/extension-sources").AxmSkillGateUnavailable | import("@agentxm/registry-client").RegistryProblem | import("@agentxm/registry-client").RegistryRequestFailed | import("@agentxm/registry-client").RegistryOperationFailed | import("@agentxm/workspace-state").SettingsIoError | import("@agentxm/workspace-state").SettingsParseError | import("@agentxm/workspace-state").SettingsDecodeError | import("@agentxm/workspace-state").LockfileIoError | import("@agentxm/workspace-state").LockfileParseError | import("@agentxm/workspace-state").LockfileDecodeError | import("@agentxm/workspace-state").LockfileVersionUnsupported | import("@agentxm/workspace-state").WorkspaceRootEscape | import("@agentxm/workspace-state").LockfileValidationError | import("@agentxm/extension-resolution").ExtensionResolutionFailed | import("@agentxm/workspace-operations").CandidateFingerprintFailed, import("effect/FileSystem").FileSystem | import("effect/Path").Path | WorkspaceMutations | import("@agentxm/workspace-state").ConfiguredAgentOutcomesProvider | import("effect/unstable/http/HttpClient").HttpClient | import("@agentxm/extension-resolution").ReleaseAgePosture | import("effect/Scope").Scope | SourceHostProviders | import("@agentxm/extension-sources").WorkspaceCatalog>;
|
|
55
|
+
//# sourceMappingURL=skills.d.ts.map
|