@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,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which configured registry supplies a skill or subagent named without one.
|
|
3
|
+
*
|
|
4
|
+
* A bare name or an unqualified `@owner/name` says nothing about which
|
|
5
|
+
* registry hosts it, so every configured host is probed in order and the
|
|
6
|
+
* first that answers wins. Each probe is recorded so the application can
|
|
7
|
+
* show, verbatim, which registries were consulted and what each one said.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is unstable and may change without notice.
|
|
10
|
+
*/
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as Option from "effect/Option";
|
|
13
|
+
import { createRegistryClient } from "@agentxm/registry-client";
|
|
14
|
+
import { resolveIdentifier, sourceResolutionFailureCategory, } from "@agentxm/extension-sources";
|
|
15
|
+
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
16
|
+
import { registryLoginSuggestions } from "./registry-login-suggestion.js";
|
|
17
|
+
import { installRefused } from "./vocabulary.js";
|
|
18
|
+
/** How to declare a registry when none is configured for the requested owner. */
|
|
19
|
+
export const ADD_REGISTRY_SOURCE = {
|
|
20
|
+
description: "Add a registry under `sources` in workspace settings",
|
|
21
|
+
cmd: "axm help settings",
|
|
22
|
+
};
|
|
23
|
+
/** The sentence a source-resolution failure carries, for probe evidence. */
|
|
24
|
+
export const sourceFailureDetail = (error) => {
|
|
25
|
+
switch (error._tag) {
|
|
26
|
+
case "SourceSyntaxInvalid":
|
|
27
|
+
case "SourceHostNotConfigured":
|
|
28
|
+
case "SourceNotResolvable":
|
|
29
|
+
case "SourceNetworkFailure":
|
|
30
|
+
case "GitOperationFailed":
|
|
31
|
+
case "WorkspaceCatalogUnavailable":
|
|
32
|
+
case "AxmSkillGateUnavailable":
|
|
33
|
+
return error.detail;
|
|
34
|
+
case "RegistryProblem":
|
|
35
|
+
return error.detail ?? error.title ?? error.category;
|
|
36
|
+
case "RegistryRequestFailed":
|
|
37
|
+
case "RegistryOperationFailed":
|
|
38
|
+
return error.detail;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const summarizeLookupFailure = (error) => `${sourceFailureDetail(error)} (${sourceResolutionFailureCategory(error)})`;
|
|
42
|
+
const extensionLabel = (type) => type === "skill" ? "Skill" : "Subagent";
|
|
43
|
+
const qualifiedExtension = (type, owner, name) => `${owner}/${type === "skill" ? "skills" : "subagents"}/${name}`;
|
|
44
|
+
const explicitSourceSuggestion = (type) => `Verify the owner/${type} name, or install with an explicit source like github:owner/repo`;
|
|
45
|
+
/** Render one probe as the line the application prints under `--verbose`. */
|
|
46
|
+
export const formatRegistryProbe = (probe) => {
|
|
47
|
+
switch (probe.outcome) {
|
|
48
|
+
case "matched":
|
|
49
|
+
return `${probe.location}: matched`;
|
|
50
|
+
case "not-found":
|
|
51
|
+
return `${probe.location}: no match`;
|
|
52
|
+
case "error":
|
|
53
|
+
return Option.match(probe.reason, {
|
|
54
|
+
onNone: () => `${probe.location}: error`,
|
|
55
|
+
onSome: (reason) => `${probe.location}: ${reason}`,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/** Probe every host configured under `sourceName` for the named extension. */
|
|
60
|
+
export const resolveConfiguredRegistrySource = Effect.fn("InstallExtensions.resolveConfiguredRegistrySource")(function* (args) {
|
|
61
|
+
const workspace = yield* WorkspaceMutations;
|
|
62
|
+
const registrySources = (yield* workspace.getRegistrySourceHosts().pipe(Effect.mapError((cause) => installRefused({
|
|
63
|
+
category: "internal",
|
|
64
|
+
detail: `Failed to read configured registry sources for owner "${args.owner}"`,
|
|
65
|
+
recover: "Check that your workspace settings file is valid and accessible",
|
|
66
|
+
cause,
|
|
67
|
+
})))).filter((source) => source.name === args.sourceName);
|
|
68
|
+
if (registrySources.length === 0) {
|
|
69
|
+
return yield* installRefused({
|
|
70
|
+
category: "not_found",
|
|
71
|
+
detail: `No registry source is configured for owner "${args.owner}"`,
|
|
72
|
+
recover: `Add a registry source for owner "${args.owner}"`,
|
|
73
|
+
...(ADD_REGISTRY_SOURCE.cmd === undefined ? {} : { cmd: ADD_REGISTRY_SOURCE.cmd }),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
for (const registrySource of registrySources) {
|
|
77
|
+
const client = yield* createRegistryClient(registrySource.location.href).pipe(Effect.mapError((cause) => installRefused({
|
|
78
|
+
category: "network",
|
|
79
|
+
detail: `Registry ${registrySource.location.href} could not be reached`,
|
|
80
|
+
cause,
|
|
81
|
+
})));
|
|
82
|
+
const matchResult = yield* Option.match(args.extensionName, {
|
|
83
|
+
onNone: () => client.ownerExists(args.owner),
|
|
84
|
+
onSome: (name) => client.extensionExists({ owner: args.owner, type: args.extensionType, name }),
|
|
85
|
+
}).pipe(Effect.result);
|
|
86
|
+
if (matchResult._tag === "Failure") {
|
|
87
|
+
if (Option.isSome(args.options)) {
|
|
88
|
+
args.options.value.onRegistryProbe({
|
|
89
|
+
location: registrySource.location.href,
|
|
90
|
+
outcome: "error",
|
|
91
|
+
reason: Option.some(summarizeLookupFailure(matchResult.failure)),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (matchResult.success.exists) {
|
|
97
|
+
if (Option.isSome(args.options)) {
|
|
98
|
+
args.options.value.onRegistryProbe({
|
|
99
|
+
location: registrySource.location.href,
|
|
100
|
+
outcome: "matched",
|
|
101
|
+
reason: Option.none(),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
type: "registry",
|
|
106
|
+
name: registrySource.name,
|
|
107
|
+
location: registrySource.location,
|
|
108
|
+
owner: Option.some(args.owner),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (Option.isSome(args.options)) {
|
|
112
|
+
args.options.value.onRegistryProbe({
|
|
113
|
+
location: registrySource.location.href,
|
|
114
|
+
outcome: "not-found",
|
|
115
|
+
reason: Option.none(),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const loginSuggestions = yield* registryLoginSuggestions(registrySources.map((source) => source.location.href));
|
|
120
|
+
if (Option.isSome(args.extensionName)) {
|
|
121
|
+
return yield* installRefused({
|
|
122
|
+
category: "not_found",
|
|
123
|
+
detail: `${extensionLabel(args.extensionType)} "${qualifiedExtension(args.extensionType, args.owner, args.extensionName.value)}" was not found in configured registries`,
|
|
124
|
+
recover: explicitSourceSuggestion(args.extensionType),
|
|
125
|
+
suggestions: loginSuggestions,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return yield* installRefused({
|
|
129
|
+
category: "not_found",
|
|
130
|
+
detail: `None of the configured registry sources contain owner "${args.owner}"`,
|
|
131
|
+
recover: `Verify the owner name is correct, or add a registry that hosts "${args.owner}"`,
|
|
132
|
+
suggestions: loginSuggestions,
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
/** Resolve a bare name against the default `agentxm` registry and configured owner. */
|
|
136
|
+
export const resolveDefaultRegistrySourceByName = Effect.fn("InstallExtensions.resolveDefaultRegistrySourceByName")(function* (args) {
|
|
137
|
+
const workspace = yield* WorkspaceMutations;
|
|
138
|
+
const label = extensionLabel(args.extensionType);
|
|
139
|
+
const registryHosts = (yield* workspace.getRegistrySourceHosts().pipe(Effect.mapError((cause) => installRefused({
|
|
140
|
+
category: "internal",
|
|
141
|
+
detail: "Configured registry sources could not be read",
|
|
142
|
+
cause,
|
|
143
|
+
})))).filter((source) => source.name === "agentxm");
|
|
144
|
+
if (registryHosts.length === 0) {
|
|
145
|
+
return yield* installRefused({
|
|
146
|
+
category: "not_found",
|
|
147
|
+
detail: `${label} "${args.name}" could not be looked up (no registry sources)`,
|
|
148
|
+
suggestions: [ADD_REGISTRY_SOURCE],
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
const maybeOwner = yield* workspace.getConfiguredOwner().pipe(Effect.mapError((cause) => installRefused({
|
|
152
|
+
category: "internal",
|
|
153
|
+
detail: "Configured workspace owner could not be read",
|
|
154
|
+
cause,
|
|
155
|
+
})));
|
|
156
|
+
const loginSuggestions = yield* registryLoginSuggestions(registryHosts.map((source) => source.location.href));
|
|
157
|
+
const resolved = yield* Effect.scoped(resolveIdentifier({
|
|
158
|
+
input: args.name,
|
|
159
|
+
resourceType: args.extensionType,
|
|
160
|
+
scope: "registry",
|
|
161
|
+
registrySourceName: "agentxm",
|
|
162
|
+
})).pipe(Effect.mapError((failure) => {
|
|
163
|
+
if (sourceResolutionFailureCategory(failure) !== "not_found") {
|
|
164
|
+
return installRefused({
|
|
165
|
+
category: "network",
|
|
166
|
+
detail: sourceFailureDetail(failure),
|
|
167
|
+
cause: failure,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
const detail = Option.match(maybeOwner, {
|
|
171
|
+
onNone: () => `${label} "${args.name}" could not be looked up (no default owner)`,
|
|
172
|
+
onSome: (owner) => `${label} "${qualifiedExtension(args.extensionType, owner, args.name)}" was not found in configured registries`,
|
|
173
|
+
});
|
|
174
|
+
return installRefused({
|
|
175
|
+
category: "not_found",
|
|
176
|
+
detail,
|
|
177
|
+
suggestions: [
|
|
178
|
+
{ description: explicitSourceSuggestion(args.extensionType) },
|
|
179
|
+
...loginSuggestions,
|
|
180
|
+
],
|
|
181
|
+
cause: failure,
|
|
182
|
+
});
|
|
183
|
+
}));
|
|
184
|
+
const resolvedOwner = Option.getOrUndefined(resolved.owner);
|
|
185
|
+
if (resolvedOwner === undefined) {
|
|
186
|
+
return yield* installRefused({
|
|
187
|
+
category: "not_found",
|
|
188
|
+
detail: `${label} "${args.name}" was not found in configured registries`,
|
|
189
|
+
suggestions: [
|
|
190
|
+
{ description: explicitSourceSuggestion(args.extensionType) },
|
|
191
|
+
...loginSuggestions,
|
|
192
|
+
],
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
const defaultRegistry = registryHosts[0];
|
|
196
|
+
if (defaultRegistry === undefined) {
|
|
197
|
+
return yield* installRefused({
|
|
198
|
+
category: "not_found",
|
|
199
|
+
detail: `${label} "${args.name}" could not be looked up (no registry sources)`,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
if (Option.isSome(args.options)) {
|
|
203
|
+
args.options.value.onRegistryProbe({
|
|
204
|
+
location: Option.getOrElse(Option.map(resolved.registryLocation, (location) => location.href), () => defaultRegistry.location.href),
|
|
205
|
+
outcome: "matched",
|
|
206
|
+
reason: Option.none(),
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
type: "registry",
|
|
211
|
+
name: defaultRegistry.name,
|
|
212
|
+
location: Option.getOrElse(resolved.registryLocation, () => defaultRegistry.location),
|
|
213
|
+
owner: Option.some(resolvedOwner),
|
|
214
|
+
};
|
|
215
|
+
});
|
|
216
|
+
//# sourceMappingURL=registry-source-resolution.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import type { ExtensionLifecycleFailed } from "../errors.js";
|
|
4
|
+
import { type InstallableExtensionType } from "@agentxm/extension-model/unstable/extensions/installable-types";
|
|
5
|
+
export declare const rootInstallableTypeSegments: readonly ("knowledge" | "rules" | "hooks" | "mcps" | "skills" | "subagents" | "packs")[];
|
|
6
|
+
export declare const RootInstallableTypeSegmentSchema: Schema.Literals<readonly ("knowledge" | "rules" | "hooks" | "mcps" | "skills" | "subagents" | "packs")[]>;
|
|
7
|
+
export type RootInstallableTypeSegment = typeof RootInstallableTypeSegmentSchema.Type;
|
|
8
|
+
export type RootInstallableType = InstallableExtensionType;
|
|
9
|
+
export interface RootInstallIntent {
|
|
10
|
+
readonly source: string;
|
|
11
|
+
readonly type: RootInstallableType | "locator";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Which route a root install request takes: a registry FQN names its own
|
|
15
|
+
* type, while a locator is opened and whatever installable extensions it
|
|
16
|
+
* contains are discovered from it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const resolveRootInstallIntent: (input: string) => Effect.Effect<RootInstallIntent, ExtensionLifecycleFailed>;
|
|
19
|
+
//# sourceMappingURL=root-intent.d.ts.map
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Option from "effect/Option";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { installRefused } from "./vocabulary.js";
|
|
5
|
+
import { installableExtensionTypePluralSegments, InstallableExtensionTypePluralSchema, isInstallableExtensionTypePlural, toInstallableExtensionType, } from "@agentxm/extension-model/unstable/extensions/installable-types";
|
|
6
|
+
import { parseSourceQualifiedRegistrySourcePatternParts, RegistrySourceRefSchema, } from "@agentxm/extension-model/unstable/extensions";
|
|
7
|
+
import { parseInputPattern } from "@agentxm/extension-model/unstable/sources/parser";
|
|
8
|
+
import { perTypeInstallPluralSegments } from "./per-type-install.js";
|
|
9
|
+
const decodeRegistrySourceRef = Schema.decodeUnknownEffect(RegistrySourceRefSchema);
|
|
10
|
+
export const rootInstallableTypeSegments = installableExtensionTypePluralSegments;
|
|
11
|
+
export const RootInstallableTypeSegmentSchema = InstallableExtensionTypePluralSchema;
|
|
12
|
+
const rootInstallFqnGrammar = "@<handle>/<plural-type>/<name>[@<version>]";
|
|
13
|
+
const supportedRootInstallTypes = rootInstallableTypeSegments.join(", ");
|
|
14
|
+
const locatorDiscoveryTypes = "skills, MCP servers, subagents, rules, hooks, and knowledge";
|
|
15
|
+
const rootInstallRegistryOnlyHowToFix = (source) => {
|
|
16
|
+
const parsed = parseInputPattern(source);
|
|
17
|
+
if (Option.isNone(parsed)) {
|
|
18
|
+
return "Use `axm install @<handle>/<plural-type>/<name>[@<version>]` or a path, URL, git, or provider shorthand source locator.";
|
|
19
|
+
}
|
|
20
|
+
switch (parsed.value.pattern.pattern) {
|
|
21
|
+
case "file-path-pattern":
|
|
22
|
+
case "url-input":
|
|
23
|
+
case "git-scp-address":
|
|
24
|
+
case "shorthand-input":
|
|
25
|
+
case "slash-pattern":
|
|
26
|
+
return `Use \`axm install ${source}\` to discover and install ${locatorDiscoveryTypes} from the source. MCP servers and packs require a registry FQN.`;
|
|
27
|
+
case "name-input":
|
|
28
|
+
case "glob-input":
|
|
29
|
+
return `Root install needs a registry FQN or source locator. For bare names, use the matching per-type command — for example \`axm skills install ${source}\`. Per-type install exists for ${perTypeInstallPluralSegments.join(", ")}.`;
|
|
30
|
+
case "registry-pattern-input":
|
|
31
|
+
return "Use `axm install @<handle>/<plural-type>/<name>[@<version>]`.";
|
|
32
|
+
case "workspace-pattern-input":
|
|
33
|
+
return "Workspace locators declare source authority in settings and cannot be installed over. Use sync or the matching enable command.";
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Which route a root install request takes: a registry FQN names its own
|
|
38
|
+
* type, while a locator is opened and whatever installable extensions it
|
|
39
|
+
* contains are discovered from it.
|
|
40
|
+
*/
|
|
41
|
+
export const resolveRootInstallIntent = Effect.fn("InstallExtensions.resolveRootIntent")(function* (input) {
|
|
42
|
+
const source = input.trim();
|
|
43
|
+
const segments = source.split("/");
|
|
44
|
+
const pluralType = segments.length === 3 ? segments[1] : undefined;
|
|
45
|
+
const sourceQualifiedRegistry = parseSourceQualifiedRegistrySourcePatternParts(source);
|
|
46
|
+
if (!source.startsWith("@") && sourceQualifiedRegistry === undefined) {
|
|
47
|
+
const parsedInput = parseInputPattern(source);
|
|
48
|
+
if (Option.isSome(parsedInput)) {
|
|
49
|
+
switch (parsedInput.value.pattern.pattern) {
|
|
50
|
+
case "file-path-pattern":
|
|
51
|
+
case "url-input":
|
|
52
|
+
case "git-scp-address":
|
|
53
|
+
case "shorthand-input":
|
|
54
|
+
case "slash-pattern":
|
|
55
|
+
return {
|
|
56
|
+
source,
|
|
57
|
+
type: "locator",
|
|
58
|
+
};
|
|
59
|
+
case "name-input":
|
|
60
|
+
case "glob-input":
|
|
61
|
+
case "registry-pattern-input":
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return yield* installRefused({
|
|
66
|
+
category: "usage",
|
|
67
|
+
detail: "Root install needs a registry FQN or source locator",
|
|
68
|
+
suggestions: [{ description: rootInstallRegistryOnlyHowToFix(source) }],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (pluralType === "libraries") {
|
|
72
|
+
return yield* installRefused({
|
|
73
|
+
category: "usage",
|
|
74
|
+
detail: "Libraries are curated registry collections and cannot be installed",
|
|
75
|
+
suggestions: [
|
|
76
|
+
{
|
|
77
|
+
description: "Open the Library in AgentXM, then install the individual extensions you want.",
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const parsed = yield* decodeRegistrySourceRef(source).pipe(Effect.mapError((error) => {
|
|
83
|
+
if (pluralType !== undefined && !isInstallableExtensionTypePlural(pluralType)) {
|
|
84
|
+
return installRefused({
|
|
85
|
+
category: "not_found",
|
|
86
|
+
detail: "Install source uses an unsupported plural type",
|
|
87
|
+
suggestions: [
|
|
88
|
+
{
|
|
89
|
+
description: `Use ${rootInstallFqnGrammar}. Supported plural types: ${supportedRootInstallTypes}.`,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
cause: error,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return installRefused({
|
|
96
|
+
category: "validation",
|
|
97
|
+
detail: "Install source must be a registry FQN",
|
|
98
|
+
suggestions: [
|
|
99
|
+
{
|
|
100
|
+
description: `Use ${rootInstallFqnGrammar} with one of: ${supportedRootInstallTypes}.`,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
cause: error,
|
|
104
|
+
});
|
|
105
|
+
}));
|
|
106
|
+
if (!isInstallableExtensionTypePlural(parsed.type)) {
|
|
107
|
+
return yield* installRefused({
|
|
108
|
+
category: "usage",
|
|
109
|
+
detail: "Root install does not support that extension type",
|
|
110
|
+
suggestions: [
|
|
111
|
+
{
|
|
112
|
+
description: `Use ${rootInstallFqnGrammar}. Supported plural types: ${supportedRootInstallTypes}.`,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
source,
|
|
119
|
+
type: toInstallableExtensionType(parsed.type),
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=root-intent.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Choosing among the extensions a source offers.
|
|
3
|
+
*
|
|
4
|
+
* When a source contains several skills or subagents and the request named
|
|
5
|
+
* none of them, someone has to choose. Which candidates are offered and what
|
|
6
|
+
* a choice means is this feature's; how the choice is asked for — a terminal
|
|
7
|
+
* multiselect, a test double, nothing at all — is the application's.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is unstable and may change without notice.
|
|
10
|
+
*/
|
|
11
|
+
import type * as Array from "effect/Array";
|
|
12
|
+
import * as ServiceMap from "effect/Context";
|
|
13
|
+
import type * as Effect from "effect/Effect";
|
|
14
|
+
import type { SkillExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/skill";
|
|
15
|
+
import type { SubagentExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/subagent";
|
|
16
|
+
import type { ExtensionLifecycleFailed } from "../errors.js";
|
|
17
|
+
declare const ExtensionSelectionCancelled_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 & {
|
|
18
|
+
readonly _tag: "ExtensionSelectionCancelled";
|
|
19
|
+
} & Readonly<A>;
|
|
20
|
+
/**
|
|
21
|
+
* The person was asked which extensions to install and declined to answer.
|
|
22
|
+
* Nothing was written and nothing is pending, so the application reports a
|
|
23
|
+
* cancelled invocation rather than a failure.
|
|
24
|
+
*/
|
|
25
|
+
export declare class ExtensionSelectionCancelled extends ExtensionSelectionCancelled_base<{
|
|
26
|
+
readonly message: string;
|
|
27
|
+
}> {
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A surface that cannot open the choice refuses with the feature's own typed
|
|
31
|
+
* failure rather than reporting a cancellation nobody made: declining is a
|
|
32
|
+
* clean exit, being unable to ask is a refusal the operator must act on. Both
|
|
33
|
+
* callers already carry the pair, so naming it here narrows nothing.
|
|
34
|
+
*/
|
|
35
|
+
export type ExtensionSelectionFailure = ExtensionSelectionCancelled | ExtensionLifecycleFailed;
|
|
36
|
+
export interface ExtensionSelectionInteractionService {
|
|
37
|
+
/** Choose which of the discovered skills to install; at least one. */
|
|
38
|
+
readonly selectSkills: (candidates: Array.NonEmptyReadonlyArray<SkillExtensionRef>) => Effect.Effect<ReadonlyArray<SkillExtensionRef>, ExtensionSelectionFailure>;
|
|
39
|
+
/** Choose which of the discovered subagents to install; at least one. */
|
|
40
|
+
readonly selectSubagents: (candidates: Array.NonEmptyReadonlyArray<SubagentExtensionRef>) => Effect.Effect<ReadonlyArray<SubagentExtensionRef>, ExtensionSelectionFailure>;
|
|
41
|
+
}
|
|
42
|
+
declare const ExtensionSelectionInteraction_base: ServiceMap.ServiceClass<ExtensionSelectionInteraction, "@agentxm/extension-lifecycle/install/ExtensionSelectionInteraction", ExtensionSelectionInteractionService>;
|
|
43
|
+
export declare class ExtensionSelectionInteraction extends ExtensionSelectionInteraction_base {
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=selection-interaction.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Choosing among the extensions a source offers.
|
|
3
|
+
*
|
|
4
|
+
* When a source contains several skills or subagents and the request named
|
|
5
|
+
* none of them, someone has to choose. Which candidates are offered and what
|
|
6
|
+
* a choice means is this feature's; how the choice is asked for — a terminal
|
|
7
|
+
* multiselect, a test double, nothing at all — is the application's.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is unstable and may change without notice.
|
|
10
|
+
*/
|
|
11
|
+
import * as ServiceMap from "effect/Context";
|
|
12
|
+
import * as Data from "effect/Data";
|
|
13
|
+
/**
|
|
14
|
+
* The person was asked which extensions to install and declined to answer.
|
|
15
|
+
* Nothing was written and nothing is pending, so the application reports a
|
|
16
|
+
* cancelled invocation rather than a failure.
|
|
17
|
+
*/
|
|
18
|
+
export class ExtensionSelectionCancelled extends Data.TaggedError("ExtensionSelectionCancelled") {
|
|
19
|
+
}
|
|
20
|
+
export class ExtensionSelectionInteraction extends ServiceMap.Service()("@agentxm/extension-lifecycle/install/ExtensionSelectionInteraction") {
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=selection-interaction.js.map
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vocabulary every install route shares.
|
|
3
|
+
*
|
|
4
|
+
* Root install, the seven per-type installs, and the configured-entry sweep
|
|
5
|
+
* are one use case with the type either fixed by the command or detected from
|
|
6
|
+
* what the source offers. They therefore share one request, one requirement
|
|
7
|
+
* set, one per-type resolved intent, and one failure vocabulary; only the
|
|
8
|
+
* grammar that produced the request differs.
|
|
9
|
+
*
|
|
10
|
+
* @experimental This API is unstable and may change without notice.
|
|
11
|
+
*/
|
|
12
|
+
import type * as FileSystem from "effect/FileSystem";
|
|
13
|
+
import type * as Option from "effect/Option";
|
|
14
|
+
import type * as Path from "effect/Path";
|
|
15
|
+
import type * as Scope from "effect/Scope";
|
|
16
|
+
import type * as HttpClient from "effect/unstable/http/HttpClient";
|
|
17
|
+
import type { NativeWriteAuthority } from "@agentxm/agent-integration";
|
|
18
|
+
import type { ManagerRequirements, McpSecretStore, RecipeRequirements } from "@agentxm/extension-materialization";
|
|
19
|
+
import type { ExtensionName } from "@agentxm/extension-model/unstable/extensions";
|
|
20
|
+
import type { HookExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/hook";
|
|
21
|
+
import type { KnowledgeExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/knowledge";
|
|
22
|
+
import type { McpServerExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/mcp-server";
|
|
23
|
+
import type { PackRef } from "@agentxm/extension-model/unstable/extensions/refs/pack";
|
|
24
|
+
import type { RuleExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/rule";
|
|
25
|
+
import type { SkillExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/skill";
|
|
26
|
+
import type { SubagentExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/subagent";
|
|
27
|
+
import type { ReleaseAgeEvaluation } from "@agentxm/extension-model/unstable/extensions/release-age";
|
|
28
|
+
import type { VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
|
|
29
|
+
import type { ExtensionResolutionFailed, PackDependencyRefResolver } from "@agentxm/extension-resolution";
|
|
30
|
+
import type { SourceHostProviders, WorkspaceCatalog } from "@agentxm/extension-sources";
|
|
31
|
+
import type { ApprovalRecoveryMissing, CandidateFingerprintFailed, OperationJournal, PlanInteractionFailed, ResolvePlanInteraction } from "@agentxm/workspace-operations";
|
|
32
|
+
import type { CodingAgentRepository } from "@agentxm/workspace-projection";
|
|
33
|
+
import type { AcceptedCanonicalRefError, ConfiguredAgentOutcomesProvider, LockfileValidationError, WorkspaceMutations, WorkspaceSettingsReadFailure, WorkspaceStateReadFailure } from "@agentxm/workspace-state";
|
|
34
|
+
import type { FootprintRecorder, WorkspaceTransactionScope, WorkspaceTransitionAcquireFailure } from "@agentxm/workspace-transactions";
|
|
35
|
+
import { ExtensionLifecycleFailed } from "../errors.js";
|
|
36
|
+
/**
|
|
37
|
+
* What an install or uninstall plan step declares at execution time: the
|
|
38
|
+
* manager's own requirements, the transaction scope its closure opens, the
|
|
39
|
+
* keychain an MCP connection reads, and the workspace facade and agent
|
|
40
|
+
* repository its artifact observes. These travel with the step and are
|
|
41
|
+
* composed once at the application's runtime boundary; nothing is captured
|
|
42
|
+
* into a step's closure on the way, and no failure adapter is among them.
|
|
43
|
+
*/
|
|
44
|
+
export type InstallStepRequirements = ManagerRequirements | RecipeRequirements | McpSecretStore | CodingAgentRepository | WorkspaceMutations | NativeWriteAuthority;
|
|
45
|
+
/**
|
|
46
|
+
* What routing a source locator, probing configured registries, and reading
|
|
47
|
+
* what a source contains all need.
|
|
48
|
+
*/
|
|
49
|
+
export type ResolveInstallRequirements = FileSystem.FileSystem | Path.Path | HttpClient.HttpClient | Scope.Scope | SourceHostProviders | WorkspaceCatalog | WorkspaceMutations;
|
|
50
|
+
/**
|
|
51
|
+
* Every failure resolving a settled install or removal can surface: the
|
|
52
|
+
* approval and interaction refusals, the candidate revalidation, and the
|
|
53
|
+
* transition an apply could not acquire. Step failures travel inside the
|
|
54
|
+
* resolution rather than being raised, so the operator still sees what each
|
|
55
|
+
* closure settled.
|
|
56
|
+
*/
|
|
57
|
+
export type InstallExecutionFailure = ApprovalRecoveryMissing | CandidateFingerprintFailed | LockfileValidationError | PlanInteractionFailed | WorkspaceSettingsReadFailure | WorkspaceStateReadFailure | WorkspaceTransitionAcquireFailure;
|
|
58
|
+
/**
|
|
59
|
+
* Everything settling an install reads, and everything resolving the settled
|
|
60
|
+
* candidate writes through: the sources it resolves against, the workspace
|
|
61
|
+
* facade and agent outcomes it reads, the journal and footprint the operation
|
|
62
|
+
* records into, and the interaction that presents and confirms it.
|
|
63
|
+
*/
|
|
64
|
+
export type PrepareInstallRequirements = InstallStepRequirements | ResolveInstallRequirements | ConfiguredAgentOutcomesProvider | FootprintRecorder | OperationJournal | ResolvePlanInteraction | WorkspaceTransactionScope;
|
|
65
|
+
/**
|
|
66
|
+
* Refuse an install or uninstall with the category, wording, and recovery the
|
|
67
|
+
* feature decided. The application converts the carried fields into its error
|
|
68
|
+
* envelope verbatim, so the producer owns the refusal rather than the shell.
|
|
69
|
+
*/
|
|
70
|
+
export declare const installRefused: (fields: {
|
|
71
|
+
readonly category: ExtensionLifecycleFailed["category"];
|
|
72
|
+
readonly detail: string;
|
|
73
|
+
readonly recover?: string;
|
|
74
|
+
readonly cmd?: string;
|
|
75
|
+
readonly suggestions?: ExtensionLifecycleFailed["suggestions"];
|
|
76
|
+
readonly cause?: unknown;
|
|
77
|
+
}) => ExtensionLifecycleFailed;
|
|
78
|
+
/** One discovered package and the constraint the request placed on it. */
|
|
79
|
+
export interface ResolvedInstallRef<TRef> {
|
|
80
|
+
readonly ref: TRef;
|
|
81
|
+
readonly versionRange: Option.Option<VersionRange>;
|
|
82
|
+
}
|
|
83
|
+
/** Skills the request selected, and whether to re-materialize regardless. */
|
|
84
|
+
export interface SkillInstallIntent {
|
|
85
|
+
readonly skillsToInstall: ReadonlyArray<ResolvedInstallRef<SkillExtensionRef>>;
|
|
86
|
+
readonly force?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/** Subagents the request selected. */
|
|
89
|
+
export interface SubagentInstallIntent {
|
|
90
|
+
readonly subagentsToInstall: ReadonlyArray<ResolvedInstallRef<SubagentExtensionRef>>;
|
|
91
|
+
}
|
|
92
|
+
/** Rules the request selected. */
|
|
93
|
+
export interface RuleInstallIntent {
|
|
94
|
+
/** The enclosing semantic closure owns the trailing aggregate projection. */
|
|
95
|
+
readonly deferProjections?: boolean;
|
|
96
|
+
readonly refs: ReadonlyArray<ResolvedInstallRef<RuleExtensionRef>>;
|
|
97
|
+
}
|
|
98
|
+
/** Hooks packages the request selected. */
|
|
99
|
+
export interface HookInstallIntent {
|
|
100
|
+
/** The enclosing semantic closure owns the trailing aggregate projection. */
|
|
101
|
+
readonly deferProjections?: boolean;
|
|
102
|
+
readonly refs: ReadonlyArray<ResolvedInstallRef<HookExtensionRef>>;
|
|
103
|
+
}
|
|
104
|
+
/** Knowledge bundles the request selected. */
|
|
105
|
+
export interface KnowledgeInstallIntent {
|
|
106
|
+
/** The enclosing semantic closure owns the trailing aggregate projection. */
|
|
107
|
+
readonly deferProjections?: boolean;
|
|
108
|
+
readonly refs: ReadonlyArray<ResolvedInstallRef<KnowledgeExtensionRef>>;
|
|
109
|
+
}
|
|
110
|
+
/** One MCP connection, its local name, and the inputs the request supplied. */
|
|
111
|
+
export interface McpServerInstallIntent {
|
|
112
|
+
readonly ref: McpServerExtensionRef;
|
|
113
|
+
readonly localName: ExtensionName;
|
|
114
|
+
readonly versionRange: Option.Option<string>;
|
|
115
|
+
readonly force: boolean;
|
|
116
|
+
readonly nonInteractive: boolean;
|
|
117
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The authority a recovery uses instead of re-selecting members: every member
|
|
121
|
+
* ref comes from the accepted resolution already recorded for it.
|
|
122
|
+
*/
|
|
123
|
+
export type PackRecoveryDependencyResolver = PackDependencyRefResolver<AcceptedCanonicalRefError | ExtensionResolutionFailed, WorkspaceMutations | FileSystem.FileSystem | Path.Path>;
|
|
124
|
+
/** One pack graph transition and the policy that governs it. */
|
|
125
|
+
export interface PackInstallIntent {
|
|
126
|
+
readonly packToInstall: PackRef;
|
|
127
|
+
readonly versionRange: Option.Option<VersionRange>;
|
|
128
|
+
readonly unattended?: boolean;
|
|
129
|
+
readonly nonInteractive: boolean;
|
|
130
|
+
readonly releaseAgeEvaluation?: ReleaseAgeEvaluation;
|
|
131
|
+
readonly releaseAgeHoldbackBehavior?: "continue" | "preserve-or-block";
|
|
132
|
+
/** Immutable dependency authority a deterministic recovery workflow supplies. */
|
|
133
|
+
readonly dependencyResolver?: PackRecoveryDependencyResolver;
|
|
134
|
+
/** Render shared aggregate projections after a larger enclosing transition. */
|
|
135
|
+
readonly deferProjections?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Reacquire the Pack's canonical content instead of reusing the installed
|
|
138
|
+
* tree. Recovery sets this because the observed tree already diverged from
|
|
139
|
+
* the accepted resolution, so reusing it would preserve the divergence.
|
|
140
|
+
*/
|
|
141
|
+
readonly forceCanonical?: boolean;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vocabulary every install route shares.
|
|
3
|
+
*
|
|
4
|
+
* Root install, the seven per-type installs, and the configured-entry sweep
|
|
5
|
+
* are one use case with the type either fixed by the command or detected from
|
|
6
|
+
* what the source offers. They therefore share one request, one requirement
|
|
7
|
+
* set, one per-type resolved intent, and one failure vocabulary; only the
|
|
8
|
+
* grammar that produced the request differs.
|
|
9
|
+
*
|
|
10
|
+
* @experimental This API is unstable and may change without notice.
|
|
11
|
+
*/
|
|
12
|
+
import { ExtensionLifecycleFailed } from "../errors.js";
|
|
13
|
+
// -----------------------------------------------------------------------------
|
|
14
|
+
// Failures
|
|
15
|
+
// -----------------------------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* Refuse an install or uninstall with the category, wording, and recovery the
|
|
18
|
+
* feature decided. The application converts the carried fields into its error
|
|
19
|
+
* envelope verbatim, so the producer owns the refusal rather than the shell.
|
|
20
|
+
*/
|
|
21
|
+
export const installRefused = (fields) => new ExtensionLifecycleFailed({
|
|
22
|
+
category: fields.category,
|
|
23
|
+
detail: fields.detail,
|
|
24
|
+
...(fields.recover === undefined ? {} : { recover: fields.recover }),
|
|
25
|
+
...(fields.cmd === undefined ? {} : { cmd: fields.cmd }),
|
|
26
|
+
...(fields.suggestions === undefined ? {} : { suggestions: fields.suggestions }),
|
|
27
|
+
...(fields.cause === undefined ? {} : { cause: fields.cause }),
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=vocabulary.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installing Open Knowledge Format bundles.
|
|
3
|
+
*
|
|
4
|
+
* A bundle becomes discoverable through the shared discovery region, so
|
|
5
|
+
* several bundles in one operation defer that render until every contributor
|
|
6
|
+
* has landed.
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
*/
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Option from "effect/Option";
|
|
12
|
+
import { KnowledgeManager } from "@agentxm/extension-materialization";
|
|
13
|
+
import { type Handle } from "@agentxm/extension-model/unstable/extensions";
|
|
14
|
+
import type { KnowledgeExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/knowledge";
|
|
15
|
+
import type { Source } from "@agentxm/extension-model/unstable/sources/types";
|
|
16
|
+
import type { VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
|
|
17
|
+
import { type Plan } from "@agentxm/workspace-operations";
|
|
18
|
+
import type { ExtensionLifecycleFailed } from "../../errors.js";
|
|
19
|
+
import { type InstallStepRequirements, type KnowledgeInstallIntent, type ResolveInstallRequirements } from "../../install/vocabulary.js";
|
|
20
|
+
/** A knowledge source after grammar parsing, before anything is discovered. */
|
|
21
|
+
export interface ParsedKnowledgeInstallRequest {
|
|
22
|
+
readonly source: Source;
|
|
23
|
+
readonly names: ReadonlyArray<string>;
|
|
24
|
+
readonly owner: Option.Option<Handle>;
|
|
25
|
+
readonly versionRange: Option.Option<VersionRange>;
|
|
26
|
+
}
|
|
27
|
+
/** Read the knowledge source grammar: which owner, which names, which range. */
|
|
28
|
+
export declare const parseKnowledgeInstallRequest: (source: string) => Effect.Effect<ParsedKnowledgeInstallRequest, ExtensionLifecycleFailed, ResolveInstallRequirements>;
|
|
29
|
+
/** Discover the knowledge bundles the parsed source offers. */
|
|
30
|
+
export declare const discoverKnowledgeRefs: (request: ParsedKnowledgeInstallRequest) => Effect.Effect<ReadonlyArray<KnowledgeExtensionRef>, ExtensionLifecycleFailed, ResolveInstallRequirements>;
|
|
31
|
+
/** Settle which knowledge bundles this request installs, or refuse when none matched. */
|
|
32
|
+
export declare const finalizeKnowledgeInstallIntent: (request: ParsedKnowledgeInstallRequest, refs: ReadonlyArray<KnowledgeExtensionRef>) => Effect.Effect<KnowledgeInstallIntent, ExtensionLifecycleFailed>;
|
|
33
|
+
/** The closures a settled knowledge intent becomes. */
|
|
34
|
+
export declare const planKnowledgeInstall: (intent: KnowledgeInstallIntent) => Effect.Effect<Plan<InstallStepRequirements>, ExtensionLifecycleFailed, InstallStepRequirements | KnowledgeManager>;
|
|
35
|
+
//# sourceMappingURL=plan.d.ts.map
|