@agentxm/extension-lifecycle 0.28.12 → 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,546 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The configured-entry sweep an update performs.
|
|
3
|
+
*
|
|
4
|
+
* A workspace-wide update — and every `<type> update` that narrows it — asks
|
|
5
|
+
* one question of each configured, enabled entry: given the source the
|
|
6
|
+
* workspace declared and the constraint it recorded, which visible version
|
|
7
|
+
* does that source resolve to now, and does it differ from the one already
|
|
8
|
+
* accepted? A workspace-authored entry is locally authoritative and is
|
|
9
|
+
* reported unchanged rather than re-resolved; an inline MCP connection has no
|
|
10
|
+
* source to advance; an entry whose source cannot be resolved is reported as
|
|
11
|
+
* a blocked unit rather than failing the sweep, so one unreachable Registry
|
|
12
|
+
* does not stop every other advance.
|
|
13
|
+
*
|
|
14
|
+
* Each entry is planned through the same per-type install planner the install
|
|
15
|
+
* routes use, because advancing an accepted resolution is installing the
|
|
16
|
+
* version the source now offers. Where a direct declaration and a Pack-owned
|
|
17
|
+
* dependency both plan the same target, the direct one wins: the workspace's
|
|
18
|
+
* own declaration outranks a dependency the closure derived.
|
|
19
|
+
*
|
|
20
|
+
* @experimental This API is unstable and may change without notice.
|
|
21
|
+
*/
|
|
22
|
+
import * as Effect from "effect/Effect";
|
|
23
|
+
import * as DateTime from "effect/DateTime";
|
|
24
|
+
import * as Option from "effect/Option";
|
|
25
|
+
import { makeConfiguredReleaseAgeEvaluation, normalizeReleaseAgeRecords, ReleaseAgePosture, resolveConfiguredHook, resolveConfiguredKnowledge, resolveConfiguredMcpServer, resolveConfiguredPack, resolveConfiguredRegistryEntry, resolveConfiguredRule, resolveConfiguredSkill, resolveConfiguredSubagent, } from "@agentxm/extension-resolution";
|
|
26
|
+
import {} from "@agentxm/extension-model/unstable/extensions/release-age";
|
|
27
|
+
import { operationPresentation, } from "@agentxm/workspace-operations";
|
|
28
|
+
import { WorkspaceMutations, configuredRowsByName, isSourcedDesiredExtension, } from "@agentxm/workspace-state";
|
|
29
|
+
import { installableExtensionTypes, toInstallableExtensionTypePlural, } from "@agentxm/extension-model/unstable/extensions/installable-types";
|
|
30
|
+
import {} from "@agentxm/extension-model/unstable/extensions/refs/extension-ref";
|
|
31
|
+
import {} from "@agentxm/extension-model/unstable/workspace-scope";
|
|
32
|
+
import { HookManager, KnowledgeManager, McpServerManager, PackManager, RuleManager, SkillManager, SubagentManager, } from "@agentxm/extension-materialization";
|
|
33
|
+
import { SourceHostProviders, WorkspaceCatalog } from "@agentxm/extension-sources";
|
|
34
|
+
import { enabledConfiguredEntries } from "@agentxm/workspace-state";
|
|
35
|
+
import { extensionTypePluralSentenceLabels } from "@agentxm/extension-model/unstable/extensions";
|
|
36
|
+
import { isWorkspaceSourceLocator } from "@agentxm/extension-model/unstable/sources/workspace";
|
|
37
|
+
import { inlineMcpNotApplicablePlan } from "../install/inline-mcp-operation.js";
|
|
38
|
+
import { decodeExtensionNameSync } from "@agentxm/extension-model/unstable/extensions/common";
|
|
39
|
+
import { ExtensionLifecycleFailed } from "../errors.js";
|
|
40
|
+
import { lifecycleStepFailure } from "../step-failure.js";
|
|
41
|
+
import { StepFailureConversion } from "../step-failure-conversion.js";
|
|
42
|
+
import { planHookInstall } from "../hooks/install/plan.js";
|
|
43
|
+
import { planKnowledgeInstall } from "../knowledge/install/plan.js";
|
|
44
|
+
import { planMcpServerInstall } from "../mcps/install/plan.js";
|
|
45
|
+
import { planPackInstall } from "../packs/install/plan.js";
|
|
46
|
+
import { planRuleInstall } from "../rules/install/plan.js";
|
|
47
|
+
import { planSkillInstall } from "../skills/install/plan.js";
|
|
48
|
+
import { planSubagentInstall } from "../subagents/install/plan.js";
|
|
49
|
+
import { configuredPackConstraintBlockPlan, prospectivePackConstraintProblems, } from "../packs/constraint-gate.js";
|
|
50
|
+
import { WORKSPACE_UPDATE_EXECUTION_CAPABILITIES } from "./atomicity.js";
|
|
51
|
+
const selectedEntries = (entries, selection) => {
|
|
52
|
+
const { names } = selection;
|
|
53
|
+
if (names === undefined)
|
|
54
|
+
return entries;
|
|
55
|
+
return entries.filter(([name]) => names.has(name));
|
|
56
|
+
};
|
|
57
|
+
const hasConfiguredSource = (entry) => entry[1].source !== undefined;
|
|
58
|
+
const noConfiguredMessage = (type) => Option.match(type, {
|
|
59
|
+
onNone: () => "No configured extensions.",
|
|
60
|
+
onSome: (value) => `No configured ${extensionTypePluralSentenceLabels[toInstallableExtensionTypePlural(value)]}.`,
|
|
61
|
+
});
|
|
62
|
+
const flattenPlanSteps = (plan) => plan.jobs.flatMap((job) => job.steps);
|
|
63
|
+
const workspaceSourceUnchangedPlan = (type, name, source, scope) => ({
|
|
64
|
+
_tag: "Plan",
|
|
65
|
+
name: `Skip workspace-sourced ${type}`,
|
|
66
|
+
description: Option.some(`${name} is locally authoritative`),
|
|
67
|
+
jobs: [
|
|
68
|
+
{
|
|
69
|
+
concurrency: 1,
|
|
70
|
+
steps: [
|
|
71
|
+
{
|
|
72
|
+
key: `${type}:${name}`,
|
|
73
|
+
readiness: "ready",
|
|
74
|
+
label: name,
|
|
75
|
+
run: Effect.succeed({
|
|
76
|
+
result: "success",
|
|
77
|
+
message: `${name} is workspace-sourced and unchanged`,
|
|
78
|
+
artifact: {
|
|
79
|
+
path: source,
|
|
80
|
+
scope,
|
|
81
|
+
change: "unchanged",
|
|
82
|
+
targets: [{ path: source, change: "unchanged" }],
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
const workspacePlanningErrorPlan = (type, name, error) => ({
|
|
91
|
+
_tag: "Plan",
|
|
92
|
+
name: `Block configured ${type} update`,
|
|
93
|
+
description: Option.some(`${name} could not be planned`),
|
|
94
|
+
jobs: [
|
|
95
|
+
{
|
|
96
|
+
concurrency: 1,
|
|
97
|
+
steps: [
|
|
98
|
+
{
|
|
99
|
+
key: `${type}:${name}:planning-error`,
|
|
100
|
+
readiness: "ready",
|
|
101
|
+
label: name,
|
|
102
|
+
run: Effect.fail(lifecycleStepFailure(error)),
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
});
|
|
108
|
+
const toCollectedWorkspaceUpdatePlans = ({ plans, holdbacks = [], bypasses = [], originForStep = () => "direct", }) => ({
|
|
109
|
+
plans,
|
|
110
|
+
holdbacks,
|
|
111
|
+
bypasses,
|
|
112
|
+
fragments: plans.flatMap((plan) => flattenPlanSteps(plan).map((step, index) => ({
|
|
113
|
+
key: step.key ?? step.label,
|
|
114
|
+
origin: originForStep(index),
|
|
115
|
+
step,
|
|
116
|
+
}))),
|
|
117
|
+
});
|
|
118
|
+
const releaseAgeRecord = (args) => ({
|
|
119
|
+
reason: "minimum-release-age",
|
|
120
|
+
target: args.target,
|
|
121
|
+
dependencyPath: [args.target],
|
|
122
|
+
...(Option.isSome(args.versionRange) ? { requestedRange: args.versionRange.value } : {}),
|
|
123
|
+
...(args.selectedVersion === undefined ? {} : { selectedVersion: args.selectedVersion }),
|
|
124
|
+
...(args.currentVersion === undefined ? {} : { currentVersion: args.currentVersion }),
|
|
125
|
+
candidateVersion: args.evidence.version,
|
|
126
|
+
publishedAt: args.evidence.publishedAt,
|
|
127
|
+
eligibleAt: args.evidence.eligibleAt,
|
|
128
|
+
minimumReleaseAgeSeconds: args.evidence.minimumReleaseAgeSeconds,
|
|
129
|
+
});
|
|
130
|
+
const matchesRequestedType = (requestedType, candidate) => Option.match(requestedType, {
|
|
131
|
+
onNone: () => true,
|
|
132
|
+
onSome: (value) => value === candidate,
|
|
133
|
+
});
|
|
134
|
+
const mergeFragments = (collections) => {
|
|
135
|
+
const byKey = new Map();
|
|
136
|
+
for (const fragment of collections.flatMap((collection) => collection.fragments)) {
|
|
137
|
+
const existing = byKey.get(fragment.key);
|
|
138
|
+
if (existing === undefined) {
|
|
139
|
+
byKey.set(fragment.key, fragment);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (existing.origin === "dependency" && fragment.origin === "direct") {
|
|
143
|
+
byKey.set(fragment.key, fragment);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return [...byKey.values()];
|
|
147
|
+
};
|
|
148
|
+
const resolveUpdateIntent = (args) => Effect.gen(function* () {
|
|
149
|
+
const registryResolution = yield* resolveConfiguredRegistryEntry(args.name, args.source, args.type, args.releaseAgeEvaluation);
|
|
150
|
+
if (Option.isSome(registryResolution)) {
|
|
151
|
+
const resolution = registryResolution.value;
|
|
152
|
+
if (resolution.kind === "not_found") {
|
|
153
|
+
return yield* new ExtensionLifecycleFailed({
|
|
154
|
+
category: "not_found",
|
|
155
|
+
detail: `Configured extension "${resolution.target}" could not be found in its source`,
|
|
156
|
+
suggestions: [{ description: "Verify the configured source or update axm.json." }],
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (resolution.kind === "version_unsatisfied") {
|
|
160
|
+
return yield* new ExtensionLifecycleFailed({
|
|
161
|
+
category: "conflict",
|
|
162
|
+
title: "No compatible version",
|
|
163
|
+
detail: `${resolution.target} has no visible version satisfying ${resolution.requestedRange}`,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (resolution.kind === "policy_held") {
|
|
167
|
+
return {
|
|
168
|
+
kind: "policy_held",
|
|
169
|
+
holdbacks: [
|
|
170
|
+
releaseAgeRecord({
|
|
171
|
+
target: resolution.target,
|
|
172
|
+
versionRange: resolution.versionRange,
|
|
173
|
+
evidence: resolution.candidate,
|
|
174
|
+
}),
|
|
175
|
+
],
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const intent = args.makeIntent(resolution.ref, resolution.versionRange);
|
|
179
|
+
if (intent === undefined) {
|
|
180
|
+
return yield* new ExtensionLifecycleFailed({
|
|
181
|
+
category: "internal",
|
|
182
|
+
detail: `Configured ${args.type} resolution returned ${resolution.ref.type}`,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
kind: "selected",
|
|
187
|
+
intent,
|
|
188
|
+
holdbacks: resolution.kind === "exempted" || resolution.newerHeld === undefined
|
|
189
|
+
? []
|
|
190
|
+
: [
|
|
191
|
+
releaseAgeRecord({
|
|
192
|
+
target: resolution.target,
|
|
193
|
+
versionRange: resolution.versionRange,
|
|
194
|
+
evidence: resolution.newerHeld,
|
|
195
|
+
selectedVersion: resolution.ref.version,
|
|
196
|
+
...(resolution.acceptedVersion === undefined
|
|
197
|
+
? {}
|
|
198
|
+
: { currentVersion: resolution.acceptedVersion }),
|
|
199
|
+
}),
|
|
200
|
+
],
|
|
201
|
+
bypasses: resolution.kind === "selected"
|
|
202
|
+
? []
|
|
203
|
+
: [
|
|
204
|
+
{
|
|
205
|
+
...releaseAgeRecord({
|
|
206
|
+
target: resolution.target,
|
|
207
|
+
versionRange: resolution.versionRange,
|
|
208
|
+
evidence: resolution.bypassed,
|
|
209
|
+
selectedVersion: resolution.ref.version,
|
|
210
|
+
}),
|
|
211
|
+
...resolution.exemption,
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
const resolved = yield* args.fallback;
|
|
217
|
+
const intent = args.makeIntent(resolved.ref, resolved.versionRange);
|
|
218
|
+
if (intent === undefined) {
|
|
219
|
+
return yield* new ExtensionLifecycleFailed({
|
|
220
|
+
category: "internal",
|
|
221
|
+
detail: `Configured ${args.type} resolution returned ${resolved.ref.type}`,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
kind: "selected",
|
|
226
|
+
intent,
|
|
227
|
+
holdbacks: resolved.releaseAge?.holdbacks ?? [],
|
|
228
|
+
bypasses: resolved.releaseAge?.bypasses ?? [],
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
const resolveSkillIntent = (name, source, releaseAgeEvaluation) => resolveUpdateIntent({
|
|
232
|
+
type: "skill",
|
|
233
|
+
name,
|
|
234
|
+
source,
|
|
235
|
+
releaseAgeEvaluation,
|
|
236
|
+
fallback: resolveConfiguredSkill(name, source, releaseAgeEvaluation),
|
|
237
|
+
makeIntent: (ref, versionRange) => ref.type === "skill"
|
|
238
|
+
? { skillsToInstall: [{ ref, versionRange }] }
|
|
239
|
+
: undefined,
|
|
240
|
+
});
|
|
241
|
+
const resolveSubagentIntent = (name, source, releaseAgeEvaluation) => resolveUpdateIntent({
|
|
242
|
+
type: "subagent",
|
|
243
|
+
name,
|
|
244
|
+
source,
|
|
245
|
+
releaseAgeEvaluation,
|
|
246
|
+
fallback: resolveConfiguredSubagent(name, source, releaseAgeEvaluation),
|
|
247
|
+
makeIntent: (ref, versionRange) => ref.type === "subagent"
|
|
248
|
+
? { subagentsToInstall: [{ ref, versionRange }] }
|
|
249
|
+
: undefined,
|
|
250
|
+
});
|
|
251
|
+
const resolveRuleIntent = (name, source, releaseAgeEvaluation) => resolveUpdateIntent({
|
|
252
|
+
type: "rule",
|
|
253
|
+
name,
|
|
254
|
+
source,
|
|
255
|
+
releaseAgeEvaluation,
|
|
256
|
+
fallback: resolveConfiguredRule(name, source, releaseAgeEvaluation),
|
|
257
|
+
makeIntent: (ref, versionRange) => ref.type === "rule"
|
|
258
|
+
? { refs: [{ ref, versionRange }] }
|
|
259
|
+
: undefined,
|
|
260
|
+
});
|
|
261
|
+
const resolveHookIntent = (name, source, releaseAgeEvaluation) => resolveUpdateIntent({
|
|
262
|
+
type: "hook",
|
|
263
|
+
name,
|
|
264
|
+
source,
|
|
265
|
+
releaseAgeEvaluation,
|
|
266
|
+
fallback: resolveConfiguredHook(name, source, releaseAgeEvaluation),
|
|
267
|
+
makeIntent: (ref, versionRange) => ref.type === "hook"
|
|
268
|
+
? { refs: [{ ref, versionRange }] }
|
|
269
|
+
: undefined,
|
|
270
|
+
});
|
|
271
|
+
const resolveKnowledgeIntent = (name, source, releaseAgeEvaluation) => resolveUpdateIntent({
|
|
272
|
+
type: "knowledge",
|
|
273
|
+
name,
|
|
274
|
+
source,
|
|
275
|
+
releaseAgeEvaluation,
|
|
276
|
+
fallback: resolveConfiguredKnowledge(name, source, releaseAgeEvaluation),
|
|
277
|
+
makeIntent: (ref, versionRange) => ref.type === "knowledge"
|
|
278
|
+
? { refs: [{ ref, versionRange }] }
|
|
279
|
+
: undefined,
|
|
280
|
+
});
|
|
281
|
+
const resolveMcpServerIntent = (name, source, releaseAgeEvaluation, nonInteractive) => resolveUpdateIntent({
|
|
282
|
+
type: "mcp-server",
|
|
283
|
+
name,
|
|
284
|
+
source,
|
|
285
|
+
releaseAgeEvaluation,
|
|
286
|
+
fallback: resolveConfiguredMcpServer(name, source, releaseAgeEvaluation),
|
|
287
|
+
makeIntent: (ref, versionRange) => ref.type === "mcp-server"
|
|
288
|
+
? {
|
|
289
|
+
ref,
|
|
290
|
+
localName: decodeExtensionNameSync(name),
|
|
291
|
+
versionRange,
|
|
292
|
+
force: false,
|
|
293
|
+
nonInteractive,
|
|
294
|
+
}
|
|
295
|
+
: undefined,
|
|
296
|
+
});
|
|
297
|
+
const resolvePackRef = (name, source, releaseAgeEvaluation, nonInteractive) => resolveUpdateIntent({
|
|
298
|
+
type: "pack",
|
|
299
|
+
name,
|
|
300
|
+
source,
|
|
301
|
+
releaseAgeEvaluation,
|
|
302
|
+
fallback: resolveConfiguredPack(name, source, releaseAgeEvaluation),
|
|
303
|
+
makeIntent: (ref, versionRange) => ref.type === "pack"
|
|
304
|
+
? {
|
|
305
|
+
packToInstall: ref,
|
|
306
|
+
versionRange,
|
|
307
|
+
unattended: true,
|
|
308
|
+
nonInteractive,
|
|
309
|
+
releaseAgeEvaluation,
|
|
310
|
+
releaseAgeHoldbackBehavior: "continue",
|
|
311
|
+
}
|
|
312
|
+
: undefined,
|
|
313
|
+
});
|
|
314
|
+
const collectResolvedPlan = (resolution, buildPlan, onError) => resolution.pipe(Effect.flatMap((resolved) => resolved.kind === "policy_held"
|
|
315
|
+
? Effect.succeed({
|
|
316
|
+
plans: [],
|
|
317
|
+
holdbacks: resolved.holdbacks,
|
|
318
|
+
bypasses: [],
|
|
319
|
+
})
|
|
320
|
+
: buildPlan(resolved.intent).pipe(Effect.map((plan) => ({
|
|
321
|
+
plans: [plan],
|
|
322
|
+
holdbacks: [...resolved.holdbacks, ...(plan.releaseAge?.holdbacks ?? [])],
|
|
323
|
+
bypasses: [...resolved.bypasses, ...(plan.releaseAge?.bypasses ?? [])],
|
|
324
|
+
})))),
|
|
325
|
+
// One entry that cannot be planned is a blocked unit, not a failed sweep:
|
|
326
|
+
// the other configured entries still have an advance to report.
|
|
327
|
+
Effect.catch((error) => Effect.succeed({
|
|
328
|
+
plans: [onError(error)],
|
|
329
|
+
holdbacks: [],
|
|
330
|
+
bypasses: [],
|
|
331
|
+
})));
|
|
332
|
+
const collectedWorkspaceSourcePlan = (plan) => ({
|
|
333
|
+
plans: [plan],
|
|
334
|
+
holdbacks: [],
|
|
335
|
+
bypasses: [],
|
|
336
|
+
});
|
|
337
|
+
const collectSkillPlans = (selection) => Effect.gen(function* () {
|
|
338
|
+
const ws = yield* WorkspaceMutations;
|
|
339
|
+
const configured = yield* ws.records.rows("skill").pipe(Effect.map(configuredRowsByName));
|
|
340
|
+
const entries = selectedEntries(enabledConfiguredEntries(configured), selection).filter(hasConfiguredSource);
|
|
341
|
+
const resolved = yield* Effect.forEach(entries, ([name, entry]) => isWorkspaceSourceLocator(entry.source)
|
|
342
|
+
? Effect.succeed(collectedWorkspaceSourcePlan(workspaceSourceUnchangedPlan("skill", name, entry.source, ws.scope)))
|
|
343
|
+
: collectResolvedPlan(resolveSkillIntent(name, entry.source, selection.releaseAgeEvaluation), (intent) => planSkillInstall(intent), (error) => workspacePlanningErrorPlan("skill", name, error)), { concurrency: "unbounded" });
|
|
344
|
+
return toCollectedWorkspaceUpdatePlans({
|
|
345
|
+
plans: resolved.flatMap((item) => item.plans),
|
|
346
|
+
holdbacks: resolved.flatMap((item) => item.holdbacks),
|
|
347
|
+
bypasses: resolved.flatMap((item) => item.bypasses),
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
const collectRulePlans = (selection) => Effect.gen(function* () {
|
|
351
|
+
const ws = yield* WorkspaceMutations;
|
|
352
|
+
const configured = yield* ws.getConfiguredRuleEntries();
|
|
353
|
+
const entries = selectedEntries(enabledConfiguredEntries(configured), selection);
|
|
354
|
+
const resolved = yield* Effect.forEach(entries, ([name, entry]) => isWorkspaceSourceLocator(entry.source)
|
|
355
|
+
? Effect.succeed(collectedWorkspaceSourcePlan(workspaceSourceUnchangedPlan("rule", name, entry.source, ws.scope)))
|
|
356
|
+
: collectResolvedPlan(resolveRuleIntent(name, entry.source, selection.releaseAgeEvaluation), (intent) => planRuleInstall(intent), (error) => workspacePlanningErrorPlan("rule", name, error)), { concurrency: "unbounded" });
|
|
357
|
+
return toCollectedWorkspaceUpdatePlans({
|
|
358
|
+
plans: resolved.flatMap((item) => item.plans),
|
|
359
|
+
holdbacks: resolved.flatMap((item) => item.holdbacks),
|
|
360
|
+
bypasses: resolved.flatMap((item) => item.bypasses),
|
|
361
|
+
});
|
|
362
|
+
});
|
|
363
|
+
const collectHookPlans = (selection) => Effect.gen(function* () {
|
|
364
|
+
const ws = yield* WorkspaceMutations;
|
|
365
|
+
const configured = yield* ws.getConfiguredHookEntries();
|
|
366
|
+
const entries = selectedEntries(enabledConfiguredEntries(configured), selection);
|
|
367
|
+
const resolved = yield* Effect.forEach(entries, ([name, entry]) => isWorkspaceSourceLocator(entry.source)
|
|
368
|
+
? Effect.succeed(collectedWorkspaceSourcePlan(workspaceSourceUnchangedPlan("hook", name, entry.source, ws.scope)))
|
|
369
|
+
: collectResolvedPlan(resolveHookIntent(name, entry.source, selection.releaseAgeEvaluation), (intent) => planHookInstall(intent), (error) => workspacePlanningErrorPlan("hook", name, error)), { concurrency: "unbounded" });
|
|
370
|
+
return toCollectedWorkspaceUpdatePlans({
|
|
371
|
+
plans: resolved.flatMap((item) => item.plans),
|
|
372
|
+
holdbacks: resolved.flatMap((item) => item.holdbacks),
|
|
373
|
+
bypasses: resolved.flatMap((item) => item.bypasses),
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
const collectKnowledgePlans = (selection) => Effect.gen(function* () {
|
|
377
|
+
const ws = yield* WorkspaceMutations;
|
|
378
|
+
const configured = yield* ws.getConfiguredKnowledgeEntries();
|
|
379
|
+
const entries = selectedEntries(enabledConfiguredEntries(configured), selection);
|
|
380
|
+
const resolved = yield* Effect.forEach(entries, ([name, entry]) => isWorkspaceSourceLocator(entry.source)
|
|
381
|
+
? Effect.succeed(collectedWorkspaceSourcePlan(workspaceSourceUnchangedPlan("knowledge", name, entry.source, ws.scope)))
|
|
382
|
+
: collectResolvedPlan(resolveKnowledgeIntent(name, entry.source, selection.releaseAgeEvaluation), (intent) => planKnowledgeInstall(intent), (error) => workspacePlanningErrorPlan("knowledge", name, error)), { concurrency: "unbounded" });
|
|
383
|
+
return toCollectedWorkspaceUpdatePlans({
|
|
384
|
+
plans: resolved.flatMap((item) => item.plans),
|
|
385
|
+
holdbacks: resolved.flatMap((item) => item.holdbacks),
|
|
386
|
+
bypasses: resolved.flatMap((item) => item.bypasses),
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
const collectSubagentPlans = (selection) => Effect.gen(function* () {
|
|
390
|
+
const ws = yield* WorkspaceMutations;
|
|
391
|
+
const configured = yield* ws.records.rows("subagent").pipe(Effect.map(configuredRowsByName));
|
|
392
|
+
const entries = selectedEntries(enabledConfiguredEntries(configured), selection).filter(hasConfiguredSource);
|
|
393
|
+
const resolved = yield* Effect.forEach(entries, ([name, entry]) => isWorkspaceSourceLocator(entry.source)
|
|
394
|
+
? Effect.succeed(collectedWorkspaceSourcePlan(workspaceSourceUnchangedPlan("subagent", name, entry.source, ws.scope)))
|
|
395
|
+
: collectResolvedPlan(resolveSubagentIntent(name, entry.source, selection.releaseAgeEvaluation), (intent) => planSubagentInstall(intent), (error) => workspacePlanningErrorPlan("subagent", name, error)), { concurrency: "unbounded" });
|
|
396
|
+
return toCollectedWorkspaceUpdatePlans({
|
|
397
|
+
plans: resolved.flatMap((item) => item.plans),
|
|
398
|
+
holdbacks: resolved.flatMap((item) => item.holdbacks),
|
|
399
|
+
bypasses: resolved.flatMap((item) => item.bypasses),
|
|
400
|
+
});
|
|
401
|
+
});
|
|
402
|
+
const collectMcpServerPlans = (selection) => Effect.gen(function* () {
|
|
403
|
+
const ws = yield* WorkspaceMutations;
|
|
404
|
+
const configured = yield* ws.records.rows("mcp-server").pipe(Effect.map(configuredRowsByName));
|
|
405
|
+
const graph = yield* ws.getDesiredStateGraph();
|
|
406
|
+
const seenSourceClosures = new Set();
|
|
407
|
+
const entries = selectedEntries(enabledConfiguredEntries(configured), selection).flatMap((entry) => {
|
|
408
|
+
const [name, configuredEntry] = entry;
|
|
409
|
+
const desired = graph.nodes.find((node) => node.type === "mcp-server" && node.name === name);
|
|
410
|
+
if (configuredEntry.source === undefined ||
|
|
411
|
+
isWorkspaceSourceLocator(configuredEntry.source) ||
|
|
412
|
+
desired === undefined ||
|
|
413
|
+
!isSourcedDesiredExtension(desired)) {
|
|
414
|
+
return [entry];
|
|
415
|
+
}
|
|
416
|
+
if (seenSourceClosures.has(desired.identity))
|
|
417
|
+
return [];
|
|
418
|
+
seenSourceClosures.add(desired.identity);
|
|
419
|
+
const representative = [name, { ...configuredEntry, source: desired.source }];
|
|
420
|
+
return [representative];
|
|
421
|
+
});
|
|
422
|
+
const resolved = yield* Effect.forEach(entries, ([name, entry]) => entry.source === undefined
|
|
423
|
+
? Effect.succeed(collectedWorkspaceSourcePlan(inlineMcpNotApplicablePlan(name, "update")))
|
|
424
|
+
: isWorkspaceSourceLocator(entry.source)
|
|
425
|
+
? Effect.succeed(collectedWorkspaceSourcePlan(workspaceSourceUnchangedPlan("mcp-server", name, entry.source, ws.scope)))
|
|
426
|
+
: collectResolvedPlan(resolveMcpServerIntent(name, entry.source, selection.releaseAgeEvaluation, selection.nonInteractive), (intent) => planMcpServerInstall(intent), (error) => workspacePlanningErrorPlan("mcp-server", name, error)), { concurrency: "unbounded" });
|
|
427
|
+
return toCollectedWorkspaceUpdatePlans({
|
|
428
|
+
plans: resolved.flatMap((item) => item.plans),
|
|
429
|
+
holdbacks: resolved.flatMap((item) => item.holdbacks),
|
|
430
|
+
bypasses: resolved.flatMap((item) => item.bypasses),
|
|
431
|
+
});
|
|
432
|
+
});
|
|
433
|
+
const collectPackPlans = (selection) => Effect.gen(function* () {
|
|
434
|
+
const ws = yield* WorkspaceMutations;
|
|
435
|
+
const configured = yield* ws.records.rows("pack").pipe(Effect.map(configuredRowsByName));
|
|
436
|
+
const entries = selectedEntries(Object.entries(configured), selection).filter(hasConfiguredSource);
|
|
437
|
+
const resolved = yield* Effect.forEach(entries, ([name, entry]) => isWorkspaceSourceLocator(entry.source)
|
|
438
|
+
? Effect.succeed({
|
|
439
|
+
kind: "planned",
|
|
440
|
+
collection: collectedWorkspaceSourcePlan(workspaceSourceUnchangedPlan("pack", name, entry.source, ws.scope)),
|
|
441
|
+
})
|
|
442
|
+
: resolvePackRef(name, entry.source, selection.releaseAgeEvaluation, selection.nonInteractive).pipe(Effect.map((resolution) => ({
|
|
443
|
+
kind: "resolved",
|
|
444
|
+
resolution,
|
|
445
|
+
})), Effect.catch((error) => Effect.succeed({
|
|
446
|
+
kind: "planned",
|
|
447
|
+
collection: toCollectedWorkspaceUpdatePlans({
|
|
448
|
+
plans: [workspacePlanningErrorPlan("pack", name, error)],
|
|
449
|
+
}),
|
|
450
|
+
}))), { concurrency: "unbounded" });
|
|
451
|
+
const selected = resolved.flatMap((item) => item.kind === "resolved" && item.resolution.kind === "selected" ? [item.resolution] : []);
|
|
452
|
+
const prospectivePacks = selected.map(({ intent }) => intent.packToInstall);
|
|
453
|
+
const constraintProblems = yield* prospectivePackConstraintProblems({
|
|
454
|
+
workspace: ws,
|
|
455
|
+
prospectivePacks,
|
|
456
|
+
...(selection.names === undefined ? {} : { selectedNames: selection.names }),
|
|
457
|
+
});
|
|
458
|
+
const resolvedHoldbacks = resolved.flatMap((item) => item.kind === "resolved" ? item.resolution.holdbacks : item.collection.holdbacks);
|
|
459
|
+
const resolvedBypasses = resolved.flatMap((item) => item.kind === "resolved" && item.resolution.kind === "selected"
|
|
460
|
+
? item.resolution.bypasses
|
|
461
|
+
: item.kind === "planned"
|
|
462
|
+
? item.collection.bypasses
|
|
463
|
+
: []);
|
|
464
|
+
if (constraintProblems.length > 0) {
|
|
465
|
+
return toCollectedWorkspaceUpdatePlans({
|
|
466
|
+
plans: [
|
|
467
|
+
configuredPackConstraintBlockPlan({
|
|
468
|
+
operation: "update",
|
|
469
|
+
problems: constraintProblems,
|
|
470
|
+
}),
|
|
471
|
+
],
|
|
472
|
+
holdbacks: resolvedHoldbacks,
|
|
473
|
+
bypasses: resolvedBypasses,
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
const selectedPlans = yield* Effect.forEach(selected, ({ intent }) => planPackInstall(intent), {
|
|
477
|
+
concurrency: "unbounded",
|
|
478
|
+
});
|
|
479
|
+
const plannedCollections = resolved.flatMap((item) => item.kind === "planned" ? [item.collection] : []);
|
|
480
|
+
return toCollectedWorkspaceUpdatePlans({
|
|
481
|
+
plans: [...plannedCollections.flatMap((collection) => collection.plans), ...selectedPlans],
|
|
482
|
+
holdbacks: resolvedHoldbacks,
|
|
483
|
+
bypasses: resolvedBypasses,
|
|
484
|
+
originForStep: (index) => (index === 0 ? "direct" : "dependency"),
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
// Total over InstallableExtensionType: a missing key is a compile error, so a
|
|
488
|
+
// type can never again be silently dropped from workspace update.
|
|
489
|
+
const makeWorkspaceUpdateCollectors = () => {
|
|
490
|
+
const collectorsByType = {
|
|
491
|
+
skill: collectSkillPlans,
|
|
492
|
+
rule: collectRulePlans,
|
|
493
|
+
hook: collectHookPlans,
|
|
494
|
+
knowledge: collectKnowledgePlans,
|
|
495
|
+
subagent: collectSubagentPlans,
|
|
496
|
+
"mcp-server": collectMcpServerPlans,
|
|
497
|
+
pack: collectPackPlans,
|
|
498
|
+
};
|
|
499
|
+
return installableExtensionTypes.map((type) => ({
|
|
500
|
+
type,
|
|
501
|
+
collect: collectorsByType[type],
|
|
502
|
+
}));
|
|
503
|
+
};
|
|
504
|
+
export const makeWorkspaceUpdatePlan = (name, description, steps, type, releaseAge) => ({
|
|
505
|
+
_tag: "Plan",
|
|
506
|
+
name,
|
|
507
|
+
description,
|
|
508
|
+
executionCapabilities: WORKSPACE_UPDATE_EXECUTION_CAPABILITIES,
|
|
509
|
+
presentation: operationPresentation({ imperative: "update", past: "Updated", gerund: "Updating" }, Option.getOrUndefined(type)),
|
|
510
|
+
jobs: [{ concurrency: 1, executionPolicy: "best-effort", steps }],
|
|
511
|
+
...(releaseAge === undefined ? {} : { releaseAge }),
|
|
512
|
+
});
|
|
513
|
+
/**
|
|
514
|
+
* Sweep every selected configured entry and fold the surviving steps into one
|
|
515
|
+
* best-effort plan, or report that the selection had nothing configured to
|
|
516
|
+
* advance.
|
|
517
|
+
*/
|
|
518
|
+
export const buildWorkspaceUpdatePlan = Effect.fn("UpdateExtensions.sweepConfigured")(function* (args) {
|
|
519
|
+
const releaseAgeEvaluation = yield* makeConfiguredReleaseAgeEvaluation();
|
|
520
|
+
const selection = {
|
|
521
|
+
names: args.names === undefined ? undefined : new Set(args.names),
|
|
522
|
+
releaseAgeEvaluation,
|
|
523
|
+
nonInteractive: args.nonInteractive,
|
|
524
|
+
};
|
|
525
|
+
const selectedCollectors = makeWorkspaceUpdateCollectors().filter(({ type }) => matchesRequestedType(args.type, type));
|
|
526
|
+
const collections = yield* Effect.forEach(selectedCollectors, ({ collect }) => collect(selection), { concurrency: "unbounded" });
|
|
527
|
+
const fragments = mergeFragments(collections);
|
|
528
|
+
const holdbacks = normalizeReleaseAgeRecords(collections.flatMap((collection) => collection.holdbacks));
|
|
529
|
+
const bypasses = normalizeReleaseAgeRecords(collections.flatMap((collection) => collection.bypasses));
|
|
530
|
+
if (fragments.length === 0 && holdbacks.length === 0) {
|
|
531
|
+
return {
|
|
532
|
+
_tag: "NoConfiguredExtensions",
|
|
533
|
+
message: noConfiguredMessage(args.type),
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
const releaseAge = {
|
|
537
|
+
evaluatedAt: DateTime.formatIso(releaseAgeEvaluation.evaluatedAt),
|
|
538
|
+
holdbacks,
|
|
539
|
+
bypasses,
|
|
540
|
+
};
|
|
541
|
+
return {
|
|
542
|
+
_tag: "WorkspaceUpdatePlan",
|
|
543
|
+
plan: makeWorkspaceUpdatePlan(args.planName, args.planDescription, fragments.map((fragment) => fragment.step), args.type, releaseAge),
|
|
544
|
+
};
|
|
545
|
+
});
|
|
546
|
+
//# sourceMappingURL=configured.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { type InstallableExtensionType } from "@agentxm/extension-model/unstable/extensions/installable-types";
|
|
19
|
+
import { type ExtensionName, type Handle } from "@agentxm/extension-model/unstable/extensions";
|
|
20
|
+
import type { VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
|
|
21
|
+
export declare const rootUpdatableTypeSegments: readonly ("knowledge" | "rules" | "hooks" | "mcps" | "skills" | "subagents" | "packs")[];
|
|
22
|
+
export declare const RootUpdatableTypeSegmentSchema: Schema.Literals<readonly ("knowledge" | "rules" | "hooks" | "mcps" | "skills" | "subagents" | "packs")[]>;
|
|
23
|
+
export type RootUpdatableTypeSegment = typeof RootUpdatableTypeSegmentSchema.Type;
|
|
24
|
+
export type RootUpdatableType = InstallableExtensionType;
|
|
25
|
+
/** One Registry identity a root update names, with the range it requested. */
|
|
26
|
+
export interface RootUpdateIntent {
|
|
27
|
+
readonly source: string;
|
|
28
|
+
readonly type: RootUpdatableType;
|
|
29
|
+
readonly owner: Handle;
|
|
30
|
+
readonly name: ExtensionName;
|
|
31
|
+
readonly versionRange: Option.Option<VersionRange>;
|
|
32
|
+
readonly target: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Read one root-update request. Fails with the refusal a person can act on;
|
|
36
|
+
* succeeds with the Registry identity every later step is decided against.
|
|
37
|
+
*/
|
|
38
|
+
export declare const resolveRootUpdateIntent: (input: string) => Effect.Effect<RootUpdateIntent, ExtensionLifecycleFailed>;
|
|
39
|
+
//# sourceMappingURL=root-request.d.ts.map
|