@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
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import * as FileSystem from "effect/FileSystem";
|
|
10
10
|
import * as Path from "effect/Path";
|
|
11
|
-
import {
|
|
11
|
+
import { StepFailureConversion } from "../../step-failure-conversion.js";
|
|
12
12
|
import type { OperationHandler } from "@agentxm/workspace-operations";
|
|
13
13
|
import type { Operation } from "@agentxm/workspace-operations";
|
|
14
14
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
15
|
+
import { WorkspaceTransactionScope } from "@agentxm/workspace-transactions";
|
|
15
16
|
/**
|
|
16
17
|
* Disable a skill (remove files but keep settings/lockfile entry).
|
|
17
18
|
*
|
|
@@ -27,5 +28,5 @@ export type DisableSkillOperation = Operation<"disable-skill", {
|
|
|
27
28
|
* materialized targets, and promotes implicit pack members to a direct disabled
|
|
28
29
|
* preference. Canonical files are preserved for later re-enablement.
|
|
29
30
|
*/
|
|
30
|
-
export declare const disableSkill: OperationHandler<DisableSkillOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations |
|
|
31
|
+
export declare const disableSkill: OperationHandler<DisableSkillOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations | WorkspaceTransactionScope | StepFailureConversion>;
|
|
31
32
|
//# sourceMappingURL=disable.d.ts.map
|
|
@@ -12,14 +12,15 @@ import * as Array from "effect/Array";
|
|
|
12
12
|
import * as Effect from "effect/Effect";
|
|
13
13
|
import * as Option from "effect/Option";
|
|
14
14
|
import * as Layer from "effect/Layer";
|
|
15
|
-
import { DefaultCodingAgentRepository } from "@agentxm/
|
|
15
|
+
import { DefaultCodingAgentRepository } from "@agentxm/workspace-projection";
|
|
16
16
|
import { ExtensionLifecycleFailed } from "../../errors.js";
|
|
17
|
-
import {
|
|
17
|
+
import { StepFailureConversion, withAdaptedStepFailures } from "../../step-failure-conversion.js";
|
|
18
18
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
19
|
+
import { WorkspaceTransactionScope, runWorkspaceTransaction, } from "@agentxm/workspace-transactions";
|
|
19
20
|
import { sanitizeName } from "@agentxm/workspace-state";
|
|
20
|
-
import { skillArtifactFromTargets, } from "@agentxm/extension-
|
|
21
|
+
import { skillArtifactFromTargets, } from "@agentxm/extension-materialization";
|
|
21
22
|
import { installedRowsByName } from "@agentxm/workspace-state";
|
|
22
|
-
import { removeSkillAgentArtifact } from "
|
|
23
|
+
import { removeSkillAgentArtifact } from "@agentxm/extension-materialization";
|
|
23
24
|
// -----------------------------------------------------------------------------
|
|
24
25
|
// Public API
|
|
25
26
|
// -----------------------------------------------------------------------------
|
|
@@ -50,7 +51,7 @@ export const disableSkill = (op) => Effect.gen(function* () {
|
|
|
50
51
|
const desiredBeforeDisable = graph.nodes.find((node) => node.type === "skill" && node.name === op.args.skillName);
|
|
51
52
|
const sanitizedName = sanitizeName(op.args.skillName);
|
|
52
53
|
const materializationAgents = yield* DefaultCodingAgentRepository.getMaterializationAgents().pipe(Effect.provideService(WorkspaceMutations, ws));
|
|
53
|
-
const installableTargetOptions = yield*
|
|
54
|
+
const installableTargetOptions = yield* runWorkspaceTransaction({
|
|
54
55
|
transition: Effect.gen(function* () {
|
|
55
56
|
if (isImplicit) {
|
|
56
57
|
const source = desiredBeforeDisable?.source ?? Option.getOrElse(installed.source, () => undefined);
|
|
@@ -72,12 +73,7 @@ export const disableSkill = (op) => Effect.gen(function* () {
|
|
|
72
73
|
return yield* Effect.forEach(materializationAgents, (agent) => agent.resolveEffectiveSkillsDir({ workspaceRoot: base }).pipe(Effect.provide(fsPathLayer), Effect.flatMap((outcome) => outcome._tag === "supported"
|
|
73
74
|
? Effect.gen(function* () {
|
|
74
75
|
const targetDir = path.normalize(outcome.dir);
|
|
75
|
-
yield* removeSkillAgentArtifact({
|
|
76
|
-
fs,
|
|
77
|
-
pathService: path,
|
|
78
|
-
targetDir,
|
|
79
|
-
sanitizedName,
|
|
80
|
-
});
|
|
76
|
+
yield* removeSkillAgentArtifact({ targetDir, sanitizedName });
|
|
81
77
|
return Option.some({
|
|
82
78
|
agentId: agent.id,
|
|
83
79
|
targetDir,
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import * as FileSystem from "effect/FileSystem";
|
|
10
10
|
import * as Path from "effect/Path";
|
|
11
|
-
import {
|
|
11
|
+
import { StepFailureConversion } from "../../step-failure-conversion.js";
|
|
12
12
|
import type { OperationHandler } from "@agentxm/workspace-operations";
|
|
13
13
|
import type { Operation } from "@agentxm/workspace-operations";
|
|
14
14
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
15
|
+
import { WorkspaceTransactionScope } from "@agentxm/workspace-transactions";
|
|
15
16
|
/**
|
|
16
17
|
* Enable a previously disabled skill (re-install files and update state).
|
|
17
18
|
*
|
|
@@ -27,5 +28,5 @@ export type EnableSkillOperation = Operation<"enable-skill", {
|
|
|
27
28
|
* 2. Create agent artifacts.
|
|
28
29
|
* 3. Update settings to set enabled: true.
|
|
29
30
|
*/
|
|
30
|
-
export declare const enableSkill: OperationHandler<EnableSkillOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations |
|
|
31
|
+
export declare const enableSkill: OperationHandler<EnableSkillOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations | WorkspaceTransactionScope | StepFailureConversion>;
|
|
31
32
|
//# sourceMappingURL=enable.d.ts.map
|
|
@@ -11,13 +11,14 @@ import * as Path from "effect/Path";
|
|
|
11
11
|
import * as Effect from "effect/Effect";
|
|
12
12
|
import * as Option from "effect/Option";
|
|
13
13
|
import * as Layer from "effect/Layer";
|
|
14
|
-
import { DefaultCodingAgentRepository } from "@agentxm/
|
|
14
|
+
import { DefaultCodingAgentRepository } from "@agentxm/workspace-projection";
|
|
15
15
|
import { ExtensionLifecycleFailed } from "../../errors.js";
|
|
16
|
-
import {
|
|
16
|
+
import { StepFailureConversion, withAdaptedStepFailures } from "../../step-failure-conversion.js";
|
|
17
17
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
18
|
+
import { WorkspaceTransactionScope, runWorkspaceTransaction, } from "@agentxm/workspace-transactions";
|
|
18
19
|
import { sanitizeName } from "@agentxm/workspace-state";
|
|
19
|
-
import { ensureSkillAgentArtifact } from "
|
|
20
|
-
import { skillArtifactFromTargets, } from "@agentxm/extension-
|
|
20
|
+
import { ensureSkillAgentArtifact } from "@agentxm/extension-materialization";
|
|
21
|
+
import { skillArtifactFromTargets, } from "@agentxm/extension-materialization";
|
|
21
22
|
import { usableAcceptedCanonicalObservation } from "@agentxm/workspace-state";
|
|
22
23
|
// -----------------------------------------------------------------------------
|
|
23
24
|
// Public API
|
|
@@ -35,7 +36,6 @@ export const enableSkill = (op) => Effect.gen(function* () {
|
|
|
35
36
|
const ws = yield* WorkspaceMutations;
|
|
36
37
|
const base = ws.baseDir;
|
|
37
38
|
const fsPathLayer = Layer.mergeAll(Layer.succeed(FileSystem.FileSystem, fs), Layer.succeed(Path.Path, path));
|
|
38
|
-
const provide = (effect) => Effect.provide(effect, fsPathLayer);
|
|
39
39
|
const canonical = yield* usableAcceptedCanonicalObservation({
|
|
40
40
|
workspace: ws,
|
|
41
41
|
type: "skill",
|
|
@@ -62,7 +62,7 @@ export const enableSkill = (op) => Effect.gen(function* () {
|
|
|
62
62
|
const skillSrcPath = portable
|
|
63
63
|
? canonical.value.observation.path
|
|
64
64
|
: path.join(canonical.value.observation.path, "src");
|
|
65
|
-
const installableTargets = yield*
|
|
65
|
+
const installableTargets = yield* runWorkspaceTransaction({
|
|
66
66
|
transition: Effect.gen(function* () {
|
|
67
67
|
const resolvedTargets = yield* Effect.forEach(materializationAgents, (agent) => agent.resolveEffectiveSkillsDir({ workspaceRoot: base }).pipe(Effect.provide(fsPathLayer), Effect.map((outcome) => ({ agent, outcome }))), { concurrency: "unbounded" });
|
|
68
68
|
const targets = resolvedTargets.flatMap(({ agent, outcome }) => outcome._tag === "supported"
|
|
@@ -85,9 +85,7 @@ export const enableSkill = (op) => Effect.gen(function* () {
|
|
|
85
85
|
canonicalSkillSrcPath: skillSrcPath,
|
|
86
86
|
targetDir: location.targetDir,
|
|
87
87
|
sanitizedName,
|
|
88
|
-
pathService: path,
|
|
89
88
|
baseDir: base,
|
|
90
|
-
provide,
|
|
91
89
|
}), { concurrency: "unbounded" });
|
|
92
90
|
yield* ws.updateSkillEntry(op.args.skillName, (entry) => ({
|
|
93
91
|
...entry,
|
|
@@ -14,8 +14,8 @@ import type { AgentId } from "@agentxm/extension-model/unstable/agents/types";
|
|
|
14
14
|
import { type RenderedFilesMap } from "@agentxm/workspace-state";
|
|
15
15
|
import type { SkillExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/skill";
|
|
16
16
|
import { SourceHostProviders } from "@agentxm/extension-sources";
|
|
17
|
-
import { CodingAgentRepository } from "@agentxm/
|
|
18
|
-
import {
|
|
17
|
+
import { CodingAgentRepository } from "@agentxm/workspace-projection";
|
|
18
|
+
import { StepFailureConversion } from "../../step-failure-conversion.js";
|
|
19
19
|
import type { OperationHandler } from "@agentxm/workspace-operations";
|
|
20
20
|
import type { Operation } from "@agentxm/workspace-operations";
|
|
21
21
|
import type { JobStepArtifactSource } from "@agentxm/workspace-operations";
|
|
@@ -43,7 +43,7 @@ export type InstallSkillOperationArgs = {
|
|
|
43
43
|
*/
|
|
44
44
|
export type InstallSkillOperation = Operation<"install-skill", InstallSkillOperationArgs>;
|
|
45
45
|
export declare const gitHostedSkillArtifactSource: (ref: SkillExtensionRef) => JobStepArtifactSource | undefined;
|
|
46
|
-
export { computeSkillSourceHash } from "
|
|
46
|
+
export { computeSkillSourceHash } from "@agentxm/extension-materialization";
|
|
47
47
|
/**
|
|
48
48
|
* Build a RenderedFilesMap from per-agent copy-mode install results.
|
|
49
49
|
* Only includes agents where mode === "copy" and success === true.
|
|
@@ -63,5 +63,5 @@ export declare const buildRenderedFilesFromResults: (installableTargets: Readonl
|
|
|
63
63
|
* 2. Update lockfile/settings entry (failures logged as warnings)
|
|
64
64
|
* 3. Compute and return overall result
|
|
65
65
|
*/
|
|
66
|
-
export declare const installSkill: OperationHandler<InstallSkillOperation, FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | WorkspaceMutations | SourceHostProviders | CodingAgentRepository |
|
|
66
|
+
export declare const installSkill: OperationHandler<InstallSkillOperation, FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | WorkspaceMutations | SourceHostProviders | CodingAgentRepository | StepFailureConversion>;
|
|
67
67
|
//# sourceMappingURL=install.d.ts.map
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @experimental This API is unstable and may change without notice.
|
|
8
8
|
*/
|
|
9
9
|
import * as FileSystem from "effect/FileSystem";
|
|
10
|
+
import { stripFileProtocol } from "@agentxm/registry-client";
|
|
10
11
|
import * as Path from "effect/Path";
|
|
11
12
|
import * as Array from "effect/Array";
|
|
12
13
|
import * as Effect from "effect/Effect";
|
|
@@ -14,29 +15,29 @@ import * as Option from "effect/Option";
|
|
|
14
15
|
import { printSourceParams } from "@agentxm/extension-model/unstable/sources/printer";
|
|
15
16
|
import { printSkillLockSourceLocator } from "@agentxm/workspace-state";
|
|
16
17
|
import { sourceToLockEntry } from "@agentxm/workspace-state";
|
|
17
|
-
import { canReuseInstalledPackage, materializeExternalPackage } from "@agentxm/extension-
|
|
18
|
-
import { materializeRegistryPackage } from "
|
|
18
|
+
import { canReuseInstalledPackage, materializeExternalPackage, } from "@agentxm/extension-materialization";
|
|
19
|
+
import { materializeRegistryPackage } from "@agentxm/extension-materialization";
|
|
19
20
|
import { computePackageContentHash } from "@agentxm/workspace-state";
|
|
20
21
|
import { RenderedFilePathSchema, } from "@agentxm/workspace-state";
|
|
21
22
|
import { computeMaterializedTreeIntegrity } from "@agentxm/workspace-state";
|
|
22
23
|
import * as Schema from "effect/Schema";
|
|
23
24
|
import { SourceHostProviders } from "@agentxm/extension-sources";
|
|
24
|
-
import { CodingAgentRepository
|
|
25
|
-
import {
|
|
26
|
-
import { isPathSafe } from "@agentxm/workspace-state";
|
|
25
|
+
import { CodingAgentRepository } from "@agentxm/workspace-projection";
|
|
26
|
+
import { isPathSafe } from "@agentxm/extension-model/unstable/path-types";
|
|
27
27
|
import { makeWorkspaceRelativeSourcePath } from "@agentxm/extension-model/unstable/path-types";
|
|
28
28
|
import { createSymlink } from "@agentxm/workspace-state";
|
|
29
29
|
import { validatePathSafety } from "@agentxm/workspace-state";
|
|
30
30
|
import { StepFailure } from "@agentxm/workspace-operations";
|
|
31
31
|
import { acceptedRegistryVersionForRef, validateExactResolvedVersion, } from "@agentxm/workspace-state";
|
|
32
32
|
import { ExtensionLifecycleFailed } from "../../errors.js";
|
|
33
|
-
import {
|
|
33
|
+
import { StepFailureConversion, withAdaptedStepFailures } from "../../step-failure-conversion.js";
|
|
34
34
|
import { appendWarningsToMessage } from "@agentxm/workspace-operations";
|
|
35
35
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
36
|
-
import { copyExtensionDirectory, formatCopyExtensionDirectoryFailure, } from "@agentxm/extension-
|
|
37
|
-
import { artifactAgentIdsFromTargets, artifactTargetAgentIds, groupInstallTargetsByDirectory, } from "@agentxm/extension-
|
|
36
|
+
import { copyExtensionDirectory, formatCopyExtensionDirectoryFailure, } from "@agentxm/extension-materialization";
|
|
37
|
+
import { artifactAgentIdsFromTargets, artifactTargetAgentIds, groupInstallTargetsByDirectory, } from "@agentxm/extension-materialization";
|
|
38
38
|
import { sanitizeName } from "@agentxm/workspace-state";
|
|
39
|
-
import { computeSkillSourceHash } from "
|
|
39
|
+
import { computeSkillSourceHash } from "@agentxm/extension-materialization";
|
|
40
|
+
import { validateAxmSkillCandidate } from "@agentxm/extension-resolution";
|
|
40
41
|
const countFiles = (dir) => Effect.gen(function* () {
|
|
41
42
|
const fs = yield* FileSystem.FileSystem;
|
|
42
43
|
const path = yield* Path.Path;
|
|
@@ -134,7 +135,7 @@ export const gitHostedSkillArtifactSource = (ref) => {
|
|
|
134
135
|
// Shared helpers
|
|
135
136
|
// -----------------------------------------------------------------------------
|
|
136
137
|
const preCleanAndCopy = (sanitizedName, sourcePath, copyTarget) => Effect.gen(function* () {
|
|
137
|
-
const adapter = yield*
|
|
138
|
+
const adapter = yield* StepFailureConversion;
|
|
138
139
|
const fs = yield* FileSystem.FileSystem;
|
|
139
140
|
const ws = yield* WorkspaceMutations;
|
|
140
141
|
const sourceExists = yield* fs
|
|
@@ -171,7 +172,7 @@ const preCleanAndCopy = (sanitizedName, sourcePath, copyTarget) => Effect.gen(fu
|
|
|
171
172
|
})));
|
|
172
173
|
});
|
|
173
174
|
const decodeRenderedFilePath = Schema.decodeUnknownSync(RenderedFilePathSchema);
|
|
174
|
-
export { computeSkillSourceHash } from "
|
|
175
|
+
export { computeSkillSourceHash } from "@agentxm/extension-materialization";
|
|
175
176
|
/**
|
|
176
177
|
* Build a RenderedFilesMap from per-agent copy-mode install results.
|
|
177
178
|
* Only includes agents where mode === "copy" and success === true.
|
|
@@ -371,7 +372,7 @@ const materializeSkill = (ref, sanitizedName, versionRange, reuse) => {
|
|
|
371
372
|
* 3. Compute and return overall result
|
|
372
373
|
*/
|
|
373
374
|
export const installSkill = (op) => Effect.gen(function* () {
|
|
374
|
-
const adapter = yield*
|
|
375
|
+
const adapter = yield* StepFailureConversion;
|
|
375
376
|
const ws = yield* WorkspaceMutations;
|
|
376
377
|
const path = yield* Path.Path;
|
|
377
378
|
const agentRepo = yield* CodingAgentRepository;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uninstalling skills.
|
|
3
|
+
*
|
|
4
|
+
* A skill's removal withdraws its projection from every configured agent's
|
|
5
|
+
* skills directory as well as its canonical package, so the artifact names
|
|
6
|
+
* both. What the removal actually settled — package removed, retained for a
|
|
7
|
+
* pack, or already absent — comes from the settlement, not from its sentence.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is unstable and may change without notice.
|
|
10
|
+
*/
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as FileSystem from "effect/FileSystem";
|
|
13
|
+
import * as Path from "effect/Path";
|
|
14
|
+
import { SkillManager } from "@agentxm/extension-materialization";
|
|
15
|
+
import type { Plan } from "@agentxm/workspace-operations";
|
|
16
|
+
import type { ExtensionLifecycleFailed } from "../../errors.js";
|
|
17
|
+
import { type InstallStepRequirements, type ResolveInstallRequirements } from "../../install/vocabulary.js";
|
|
18
|
+
import type { SkillUninstallIntent } from "../../uninstall/vocabulary.js";
|
|
19
|
+
/** Expand the selector against installed skills; a glob may match nothing. */
|
|
20
|
+
export declare const parseSkillUninstallRequest: (selector: string) => Effect.Effect<SkillUninstallIntent, ExtensionLifecycleFailed, InstallStepRequirements | ResolveInstallRequirements>;
|
|
21
|
+
/** The closures a settled skill removal becomes. */
|
|
22
|
+
export declare const planSkillUninstall: (intent: SkillUninstallIntent) => Effect.Effect<Plan<InstallStepRequirements>, ExtensionLifecycleFailed, InstallStepRequirements | SkillManager | FileSystem.FileSystem | Path.Path>;
|
|
23
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uninstalling skills.
|
|
3
|
+
*
|
|
4
|
+
* A skill's removal withdraws its projection from every configured agent's
|
|
5
|
+
* skills directory as well as its canonical package, so the artifact names
|
|
6
|
+
* both. What the removal actually settled — package removed, retained for a
|
|
7
|
+
* pack, or already absent — comes from the settlement, not from its sentence.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is unstable and may change without notice.
|
|
10
|
+
*/
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as FileSystem from "effect/FileSystem";
|
|
13
|
+
import * as Option from "effect/Option";
|
|
14
|
+
import * as Path from "effect/Path";
|
|
15
|
+
import { SkillManager, buildUninstallOperation, skillArtifactFromTargets, } from "@agentxm/extension-materialization";
|
|
16
|
+
import { resolveInstalledIdentifierNameOrInput } from "@agentxm/extension-sources";
|
|
17
|
+
import { CodingAgentRepository } from "@agentxm/workspace-projection";
|
|
18
|
+
import { WorkspaceMutations, acquiredExtensionDisplayPathFromLockEntry, installedRowsByName, sanitizeName, } from "@agentxm/workspace-state";
|
|
19
|
+
import { expandGlob } from "../../glob.js";
|
|
20
|
+
import { lifecycleStepFailure } from "../../step-failure.js";
|
|
21
|
+
import { installRefused, } from "../../install/vocabulary.js";
|
|
22
|
+
import { makeWorkspaceRetentionPolicy } from "../../uninstall/retention-policy.js";
|
|
23
|
+
import { workspaceAuthoredPath, workspaceCanonicalPath, workspaceCanonicalRoot, workspaceLockfilePath, workspaceSettingsPath, } from "../../workspace-paths.js";
|
|
24
|
+
const skillSourceTarget = (ws, path, configuredSource, lockEntry, sanitizedName) => {
|
|
25
|
+
if (Option.isSome(configuredSource) && configuredSource.value === "workspace") {
|
|
26
|
+
return { path: workspaceAuthoredPath(path, ws, "skill", sanitizedName), change: "unchanged" };
|
|
27
|
+
}
|
|
28
|
+
if (Option.isSome(lockEntry)) {
|
|
29
|
+
const entry = lockEntry.value;
|
|
30
|
+
return {
|
|
31
|
+
path: acquiredExtensionDisplayPathFromLockEntry(workspaceCanonicalRoot(ws.scope), entry, "skills", entry.workspaceName),
|
|
32
|
+
change: "removed",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return { path: workspaceCanonicalPath(ws.scope, sanitizedName), change: "removed" };
|
|
36
|
+
};
|
|
37
|
+
/** Expand the selector against installed skills; a glob may match nothing. */
|
|
38
|
+
export const parseSkillUninstallRequest = Effect.fn("UninstallExtensions.parseSkillRequest")(function* (selector) {
|
|
39
|
+
const ws = yield* WorkspaceMutations;
|
|
40
|
+
const installedSkills = yield* ws.records.rows("skill").pipe(Effect.mapError((cause) => installRefused({
|
|
41
|
+
category: "internal",
|
|
42
|
+
detail: "Installed skills could not be read",
|
|
43
|
+
cause,
|
|
44
|
+
})), Effect.map(installedRowsByName));
|
|
45
|
+
const installedNames = Object.keys(installedSkills);
|
|
46
|
+
const matched = expandGlob(selector, installedNames);
|
|
47
|
+
if (selector.includes("*") && matched.length === 0) {
|
|
48
|
+
return { targets: [] };
|
|
49
|
+
}
|
|
50
|
+
const names = matched.length > 0
|
|
51
|
+
? matched
|
|
52
|
+
: [
|
|
53
|
+
yield* resolveInstalledIdentifierNameOrInput({
|
|
54
|
+
input: selector,
|
|
55
|
+
resourceType: "skill",
|
|
56
|
+
}).pipe(Effect.mapError((cause) => installRefused({
|
|
57
|
+
category: "not_found",
|
|
58
|
+
detail: `Skill "${selector}" could not be resolved`,
|
|
59
|
+
cause,
|
|
60
|
+
}))),
|
|
61
|
+
];
|
|
62
|
+
return {
|
|
63
|
+
targets: names.map((name) => ({ type: "skill", name })),
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
/** The closures a settled skill removal becomes. */
|
|
67
|
+
export const planSkillUninstall = Effect.fn("UninstallExtensions.planSkills")(function* (intent) {
|
|
68
|
+
const ws = yield* WorkspaceMutations;
|
|
69
|
+
const skillManager = yield* SkillManager;
|
|
70
|
+
const agentRepo = yield* CodingAgentRepository;
|
|
71
|
+
const path = yield* Path.Path;
|
|
72
|
+
const retentionPolicy = makeWorkspaceRetentionPolicy(ws);
|
|
73
|
+
const configuredAgents = yield* agentRepo.getMaterializationAgents().pipe(Effect.mapError((cause) => installRefused({
|
|
74
|
+
category: "internal",
|
|
75
|
+
detail: "Configured agents could not be read",
|
|
76
|
+
cause,
|
|
77
|
+
})));
|
|
78
|
+
const resolvedAgents = yield* Effect.forEach(configuredAgents, (agent) => agent
|
|
79
|
+
.resolveEffectiveSkillsDir({ workspaceRoot: ws.baseDir })
|
|
80
|
+
.pipe(Effect.map((outcome) => ({ agentId: agent.id, outcome }))), { concurrency: "unbounded" }).pipe(Effect.mapError((cause) => installRefused({
|
|
81
|
+
category: "internal",
|
|
82
|
+
detail: "Configured skill placement could not be resolved",
|
|
83
|
+
cause,
|
|
84
|
+
})));
|
|
85
|
+
const installableTargets = [];
|
|
86
|
+
for (const { agentId, outcome } of resolvedAgents) {
|
|
87
|
+
if (outcome._tag === "supported") {
|
|
88
|
+
installableTargets.push({ agentId, targetDir: path.normalize(outcome.dir) });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const steps = yield* Effect.forEach(intent.targets, (target) => Effect.gen(function* () {
|
|
92
|
+
const sanitizedName = sanitizeName(target.name);
|
|
93
|
+
const configuredSource = skillManager.getConfiguredSource === undefined
|
|
94
|
+
? Option.none()
|
|
95
|
+
: yield* skillManager.getConfiguredSource({ target });
|
|
96
|
+
const lockEntry = yield* ws
|
|
97
|
+
.getLockedSkill(target.name)
|
|
98
|
+
.pipe(Effect.catch(() => Effect.succeed(Option.none())));
|
|
99
|
+
const sourceTarget = skillSourceTarget(ws, path, configuredSource, lockEntry, sanitizedName);
|
|
100
|
+
const removedArtifact = yield* skillArtifactFromTargets({
|
|
101
|
+
targets: installableTargets,
|
|
102
|
+
workspaceRoot: ws.baseDir,
|
|
103
|
+
sanitizedName,
|
|
104
|
+
scope: ws.scope,
|
|
105
|
+
change: "removed",
|
|
106
|
+
workspaceTargets: [
|
|
107
|
+
{ path: workspaceLockfilePath(ws.scope), change: "updated" },
|
|
108
|
+
{ path: workspaceSettingsPath(ws.scope), change: "updated" },
|
|
109
|
+
sourceTarget,
|
|
110
|
+
],
|
|
111
|
+
});
|
|
112
|
+
// A skill another desired route still reaches keeps its resolution,
|
|
113
|
+
// its package, and its projections: only the direct declaration goes.
|
|
114
|
+
const retainedArtifact = yield* skillArtifactFromTargets({
|
|
115
|
+
targets: installableTargets,
|
|
116
|
+
workspaceRoot: ws.baseDir,
|
|
117
|
+
sanitizedName,
|
|
118
|
+
scope: ws.scope,
|
|
119
|
+
change: "unchanged",
|
|
120
|
+
workspaceTargets: [
|
|
121
|
+
{ path: workspaceLockfilePath(ws.scope), change: "unchanged" },
|
|
122
|
+
{ path: workspaceSettingsPath(ws.scope), change: "updated" },
|
|
123
|
+
{ path: sourceTarget.path, change: "unchanged" },
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
const step = buildUninstallOperation(skillManager, retentionPolicy, {
|
|
127
|
+
target,
|
|
128
|
+
toStepFailure: lifecycleStepFailure,
|
|
129
|
+
// The settlement says what the removal withdrew, so a package
|
|
130
|
+
// retained for a pack — or one that was never there — is reported
|
|
131
|
+
// from the settlement rather than read out of a sentence.
|
|
132
|
+
buildArtifact: ({ settlement }) => {
|
|
133
|
+
if (settlement.declaration === "absent") {
|
|
134
|
+
return Effect.succeed({ ...removedArtifact, change: "unchanged" });
|
|
135
|
+
}
|
|
136
|
+
if (settlement.canonical === "retained-by-pack" ||
|
|
137
|
+
settlement.canonical === "preserved-unreadable") {
|
|
138
|
+
// The declaration was withdrawn, so this changed the workspace
|
|
139
|
+
// even though nothing on disk was deleted.
|
|
140
|
+
return Effect.succeed({ ...retainedArtifact, change: "updated" });
|
|
141
|
+
}
|
|
142
|
+
return Effect.succeed(removedArtifact);
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
...step,
|
|
147
|
+
artifact: removedArtifact,
|
|
148
|
+
};
|
|
149
|
+
}).pipe(Effect.mapError((cause) => installRefused({
|
|
150
|
+
category: "internal",
|
|
151
|
+
detail: `Skill uninstall planning failed for ${target.name}`,
|
|
152
|
+
cause,
|
|
153
|
+
}))), { concurrency: "unbounded" });
|
|
154
|
+
return {
|
|
155
|
+
_tag: "Plan",
|
|
156
|
+
name: intent.targets.length === 0
|
|
157
|
+
? "Uninstall skills"
|
|
158
|
+
: intent.targets.length === 1
|
|
159
|
+
? "Uninstall skill"
|
|
160
|
+
: `Uninstall ${intent.targets.length} skills`,
|
|
161
|
+
description: Option.none(),
|
|
162
|
+
jobs: [{ concurrency: 1, steps }],
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=plan.js.map
|
package/dist/src/skills/utils.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @experimental This API is unstable and may change without notice.
|
|
8
8
|
*/
|
|
9
|
-
import { stripFileProtocol } from "
|
|
9
|
+
import { stripFileProtocol } from "@agentxm/registry-client";
|
|
10
10
|
// -----------------------------------------------------------------------------
|
|
11
11
|
// Display Name
|
|
12
12
|
// -----------------------------------------------------------------------------
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The application-supplied conversion from a lifecycle operation's typed
|
|
3
|
+
* failure union into the plan-step vocabulary and into display text.
|
|
4
|
+
*
|
|
5
|
+
* Error rendering is application-owned: the CLI implements this with the same
|
|
6
|
+
* dispatcher it uses at its output boundary, so step categories and details
|
|
7
|
+
* inside lifecycle plans stay byte-identical with rendered errors. Nothing in
|
|
8
|
+
* the channel is `unknown` — the port names the exact union a lifecycle
|
|
9
|
+
* operation can surface, so a new failure family is a compile error here
|
|
10
|
+
* rather than a silently mis-rendered step.
|
|
11
|
+
*
|
|
12
|
+
* @experimental This API is unstable and may change without notice.
|
|
13
|
+
*/
|
|
14
|
+
import * as ServiceMap from "effect/Context";
|
|
15
|
+
import * as Effect from "effect/Effect";
|
|
16
|
+
import type { StepFailure } from "@agentxm/workspace-operations";
|
|
17
|
+
import type { ExtensionManagerFailure } from "@agentxm/extension-materialization";
|
|
18
|
+
import type { ExtensionResolutionFailed } from "@agentxm/extension-resolution";
|
|
19
|
+
import type { ExtensionLifecycleFailed } from "./errors.js";
|
|
20
|
+
/**
|
|
21
|
+
* Every failure a lifecycle operation can surface: the materialization
|
|
22
|
+
* families and the integration families they carry, the resolution refusal a
|
|
23
|
+
* configured entry's source can produce before any plan exists, plus the
|
|
24
|
+
* feature's own typed failure.
|
|
25
|
+
*/
|
|
26
|
+
export type LifecycleFailure = ExtensionManagerFailure | ExtensionResolutionFailed | ExtensionLifecycleFailed | StepFailure;
|
|
27
|
+
export interface StepFailureConversionService {
|
|
28
|
+
/** Serialize one lifecycle failure into the plan-step vocabulary. */
|
|
29
|
+
readonly toStepFailure: (failure: LifecycleFailure) => StepFailure;
|
|
30
|
+
/** Render one failure as the detail sentence the boundary would print. */
|
|
31
|
+
readonly describeFailure: (failure: LifecycleFailure) => string;
|
|
32
|
+
/** Render one failure as the boundary envelope's `message` property. */
|
|
33
|
+
readonly describeFailureMessage: (failure: LifecycleFailure) => string;
|
|
34
|
+
}
|
|
35
|
+
declare const StepFailureConversion_base: ServiceMap.ServiceClass<StepFailureConversion, "@agentxm/extension-lifecycle/step-failure-conversion/StepFailureConversion", StepFailureConversionService>;
|
|
36
|
+
export declare class StepFailureConversion extends StepFailureConversion_base {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Serialize every failure of one lifecycle operation into the plan-step
|
|
40
|
+
* vocabulary through the application-supplied conversion.
|
|
41
|
+
*/
|
|
42
|
+
export declare const withAdaptedStepFailures: <A, E extends LifecycleFailure, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, StepFailure, R | StepFailureConversion>;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=step-failure-conversion.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The application-supplied conversion from a lifecycle operation's typed
|
|
3
|
+
* failure union into the plan-step vocabulary and into display text.
|
|
4
|
+
*
|
|
5
|
+
* Error rendering is application-owned: the CLI implements this with the same
|
|
6
|
+
* dispatcher it uses at its output boundary, so step categories and details
|
|
7
|
+
* inside lifecycle plans stay byte-identical with rendered errors. Nothing in
|
|
8
|
+
* the channel is `unknown` — the port names the exact union a lifecycle
|
|
9
|
+
* operation can surface, so a new failure family is a compile error here
|
|
10
|
+
* rather than a silently mis-rendered step.
|
|
11
|
+
*
|
|
12
|
+
* @experimental This API is unstable and may change without notice.
|
|
13
|
+
*/
|
|
14
|
+
import * as ServiceMap from "effect/Context";
|
|
15
|
+
import * as Effect from "effect/Effect";
|
|
16
|
+
export class StepFailureConversion extends ServiceMap.Service()("@agentxm/extension-lifecycle/step-failure-conversion/StepFailureConversion") {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Serialize every failure of one lifecycle operation into the plan-step
|
|
20
|
+
* vocabulary through the application-supplied conversion.
|
|
21
|
+
*/
|
|
22
|
+
export const withAdaptedStepFailures = (effect) => Effect.gen(function* () {
|
|
23
|
+
const conversion = yield* StepFailureConversion;
|
|
24
|
+
return yield* effect.pipe(Effect.mapError((failure) => conversion.toStepFailure(failure)));
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=step-failure-conversion.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a lifecycle closure serializes a failure into the plan-step vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* The feature owns this: a lifecycle step that failed must report the same
|
|
5
|
+
* category, sentence, and recovery whether the failure came from lifecycle
|
|
6
|
+
* policy, from the materialization machinery underneath it, from workspace
|
|
7
|
+
* state, or from the transaction around it. Nothing is supplied by the
|
|
8
|
+
* application, so a lifecycle use case carries no failure adapter in its
|
|
9
|
+
* requirements.
|
|
10
|
+
*
|
|
11
|
+
* Categories and detail sentences are the serialized contract of machine
|
|
12
|
+
* output; families that already carry their own category and fact sentence
|
|
13
|
+
* keep both rather than being replaced with a generic sentence.
|
|
14
|
+
*
|
|
15
|
+
* @experimental This API is unstable and may change without notice.
|
|
16
|
+
*/
|
|
17
|
+
import { StepFailure } from "@agentxm/workspace-operations";
|
|
18
|
+
import type { LifecycleFailure } from "./step-failure-conversion.js";
|
|
19
|
+
/** Every failure a lifecycle closure can settle a plan step with. */
|
|
20
|
+
export type LifecycleStepFailure = LifecycleFailure;
|
|
21
|
+
/**
|
|
22
|
+
* Serialize one lifecycle-closure failure into the plan-step vocabulary.
|
|
23
|
+
*
|
|
24
|
+
* Families this feature or the machinery beneath it constructs are rendered
|
|
25
|
+
* exactly; families the kernel already serializes are delegated to it; and
|
|
26
|
+
* anything else carries its producer's own category and sentence through.
|
|
27
|
+
*/
|
|
28
|
+
export declare const lifecycleStepFailure: (failure: LifecycleStepFailure) => StepFailure;
|
|
29
|
+
//# sourceMappingURL=step-failure.d.ts.map
|