@agentxm/extension-lifecycle 0.29.2 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/src/activation/set-activation.d.ts +22 -40
  2. package/dist/src/activation/set-activation.js +199 -331
  3. package/dist/src/demote/demote-to-external-source.d.ts +1 -1
  4. package/dist/src/demote/demote-to-external-source.js +53 -24
  5. package/dist/src/hooks/configured-agent-outcomes-provider.d.ts +4 -4
  6. package/dist/src/hooks/configured-agent-outcomes-provider.js +23 -17
  7. package/dist/src/hooks/install/plan.js +6 -3
  8. package/dist/src/hooks/uninstall/plan.js +4 -3
  9. package/dist/src/index.d.ts +1 -2
  10. package/dist/src/index.js +1 -2
  11. package/dist/src/install/root-intent.d.ts +2 -2
  12. package/dist/src/install/vocabulary.d.ts +5 -4
  13. package/dist/src/knowledge/install/plan.js +2 -1
  14. package/dist/src/knowledge/uninstall/plan.js +4 -3
  15. package/dist/src/live.d.ts +1 -1
  16. package/dist/src/live.js +1 -1
  17. package/dist/src/mcps/install/plan.js +2 -3
  18. package/dist/src/mcps/operations/disable.js +1 -1
  19. package/dist/src/mcps/operations/enable.js +20 -35
  20. package/dist/src/mcps/operations/uninstall.js +2 -1
  21. package/dist/src/mcps/uninstall/plan.js +13 -4
  22. package/dist/src/packs/graph-transition.d.ts +0 -25
  23. package/dist/src/packs/graph-transition.js +0 -101
  24. package/dist/src/packs/install/plan.d.ts +0 -13
  25. package/dist/src/packs/install/plan.js +12 -9
  26. package/dist/src/packs/member-install-step.js +8 -21
  27. package/dist/src/packs/promote-authored-pack.js +6 -3
  28. package/dist/src/packs/uninstall/plan.js +52 -20
  29. package/dist/src/rules/install/plan.js +6 -3
  30. package/dist/src/rules/uninstall/plan.js +4 -3
  31. package/dist/src/skills/install/bundled.js +4 -4
  32. package/dist/src/skills/install/plan.js +3 -2
  33. package/dist/src/skills/operations/install.d.ts +0 -1
  34. package/dist/src/skills/operations/install.js +9 -18
  35. package/dist/src/skills/uninstall/plan.js +4 -3
  36. package/dist/src/subagents/install/plan.js +3 -2
  37. package/dist/src/subagents/operations/enable.js +1 -3
  38. package/dist/src/subagents/uninstall/plan.js +4 -3
  39. package/dist/src/testing.d.ts +1 -1
  40. package/dist/src/testing.js +2 -1
  41. package/dist/src/uninstall/root-intent.d.ts +1 -1
  42. package/dist/src/uninstall/uninstall-extensions.d.ts +1 -1
  43. package/dist/src/uninstall/uninstall-extensions.js +77 -1
  44. package/dist/src/update/root-request.d.ts +2 -2
  45. package/dist/src/update/selective/skills.d.ts +1 -1
  46. package/dist/src/update/selective/skills.js +0 -1
  47. package/dist/src/update/selective/subagents.d.ts +1 -1
  48. package/dist/src/update/selective/subagents.js +3 -2
  49. package/dist/src/update/selective/use-case.d.ts +2 -2
  50. package/dist/src/update/targeted-plan.js +4 -2
  51. package/dist/src/workspace-paths.d.ts +0 -6
  52. package/dist/src/workspace-paths.js +0 -10
  53. package/package.json +22 -24
  54. package/dist/src/uninstall/retention-policy.d.ts +0 -21
  55. package/dist/src/uninstall/retention-policy.js +0 -28
@@ -10,9 +10,9 @@
10
10
  * configuration, a rule or Knowledge bundle through a shared managed region,
11
11
  * a Pack through the members it contributes.
12
12
  *
13
- * Two invariants hold across every type. Disabling never removes canonical
14
- * content or retires an accepted resolution, so re-enabling never re-resolves
15
- * or re-acquires. And a type whose projection shares a file with instruction
13
+ * Disabling a leaf preserves its canonical content and accepted resolution.
14
+ * Disabling a Pack withdraws its dependency route and retires exclusive acquired
15
+ * members. A type whose projection shares a file with instruction
16
16
  * management reconciles that file inside the same transaction, so the
17
17
  * workspace is never left with a settings change the files do not reflect.
18
18
  *
@@ -25,14 +25,15 @@ import * as Path from "effect/Path";
25
25
  import type * as Scope from "effect/Scope";
26
26
  import type * as HttpClient from "effect/unstable/http/HttpClient";
27
27
  import type { ExtensionType } from "@agentxm/extension-model/unstable/extensions";
28
- import type { ExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/extension-ref";
29
28
  import type { WorkspaceScope } from "@agentxm/extension-model/unstable/workspace-scope";
30
29
  import { SourceHostProviders, WorkspaceCatalog, type SourceResolutionFailure } from "@agentxm/extension-sources";
31
- import { ExtensionManagers, SubagentManager, type ExtensionManagerFailure, type ManagerRequirements, type McpServerInstallRequirements, type RecipeRequirements } from "@agentxm/extension-materialization";
30
+ import { ExtensionManagers, HookManager, SkillManager, RuleManager, KnowledgeManager, PackManager, McpServerManager, SubagentManager, type ExtensionManagerFailure, type ManagerRequirements } from "@agentxm/extension-materialization";
31
+ import { type McpServerInstallRequirements } from "@agentxm/workspace-reconciliation";
32
+ import { type SyncStepRequirements, type CollectedMaterializeSteps, type DesiredStateProposal, type RecipeRequirements } from "@agentxm/workspace-reconciliation";
32
33
  import { ReleaseAgePosture, type ExtensionResolutionFailed, type PackDependencyResolutionFailure, type SourceAuthorityBlocked } from "@agentxm/extension-resolution";
33
34
  import { CodingAgentRepository, type ProjectionParticipantRequirements, type ResolvedInstructionsConfig } from "@agentxm/workspace-projection";
34
- import { OperationJournal, ResolvePlanInteraction, type JobStepArtifact, type OperationResolution, type PlanExecution } from "@agentxm/workspace-operations";
35
- import { ConfiguredAgentOutcomesProvider, type ConfiguredAgentOutcome, WorkspaceMutations, type DesiredExtensionNode, type AcceptedCanonicalRefError } from "@agentxm/workspace-state";
35
+ import { OperationJournal, ResolvePlanInteraction, type ExecutionCandidate, type JobStepArtifact, type OperationResolution, type PlanExecution, type PlannedJobStep } from "@agentxm/workspace-operations";
36
+ import { LockfileReader, SettingsReader, SettingsWriter, ConfiguredAgentOutcomesProvider, type ConfiguredAgentOutcome, WorkspaceMutations, type DesiredExtensionNode, type AcceptedCanonicalRefError } from "@agentxm/workspace-state";
36
37
  import { FootprintRecorder, WorkspaceTransactionScope } from "@agentxm/workspace-transactions";
37
38
  import { ExtensionLifecycleFailed } from "../errors.js";
38
39
  import { StepFailureConversion } from "../step-failure-conversion.js";
@@ -61,26 +62,16 @@ export type ActivationTransition =
61
62
  readonly kind: "subagent";
62
63
  } | {
63
64
  readonly kind: "mcp-server";
64
- }
65
- /** Enabling re-runs the configured install closure for the accepted entry. */
66
- | {
67
- readonly kind: "reinstall";
68
- readonly ref: ExtensionRef;
69
- readonly versionRange: Option.Option<string>;
70
- }
71
- /** Disabling flips the preference and dematerializes the type's projection. */
72
- | {
73
- readonly kind: "deactivate-rule";
74
65
  } | {
75
- readonly kind: "deactivate-hook";
76
- }
77
- /** Rendering the discovery region is what deactivation means for Knowledge. */
78
- | {
79
- readonly kind: "deactivate-knowledge";
66
+ readonly kind: "aggregate";
67
+ readonly proposal: DesiredStateProposal;
80
68
  }
81
69
  /** A Pack contributes members; activation moves the whole member closure. */
82
70
  | {
83
71
  readonly kind: "pack";
72
+ readonly proposal: DesiredStateProposal;
73
+ readonly materialization?: CollectedMaterializeSteps;
74
+ readonly retirement: Option.Option<PlannedJobStep<SyncStepRequirements | LockfileReader>>;
84
75
  readonly identity: string;
85
76
  /** Members whose active/inactive state this change decides. */
86
77
  readonly members: ReadonlyArray<DesiredExtensionNode>;
@@ -88,7 +79,7 @@ export type ActivationTransition =
88
79
  readonly aggregateTypes: ReadonlySet<ExtensionType>;
89
80
  };
90
81
  /** A settled activation change: everything the plan needs, decided. */
91
- export interface SetActivationCandidate {
82
+ interface ActivationRealization {
92
83
  readonly _tag: "SetActivation";
93
84
  readonly type: ExtensionType;
94
85
  /** The installed name, after resolving a fully-qualified identifier. */
@@ -97,6 +88,7 @@ export interface SetActivationCandidate {
97
88
  readonly scope: WorkspaceScope;
98
89
  readonly artifact: JobStepArtifact;
99
90
  readonly transition: ActivationTransition;
91
+ readonly proposal?: DesiredStateProposal;
100
92
  /** The instruction configuration this change reconciles inside its transaction. */
101
93
  readonly instructions: Option.Option<ResolvedInstructionsConfig>;
102
94
  /** The refusal that stops the change before it is offered, when there is one. */
@@ -109,26 +101,16 @@ export interface SetActivationCandidate {
109
101
  /** Every failure settling an activation request can surface. */
110
102
  export type SetActivationFailure = AcceptedCanonicalRefError | ExtensionLifecycleFailed | ExtensionManagerFailure | ExtensionResolutionFailed | PackDependencyResolutionFailure | SourceAuthorityBlocked | SourceResolutionFailure;
111
103
  /** Everything settling and resolving an activation needs. */
112
- export type SetActivationRequirements = CodingAgentRepository | ConfiguredAgentOutcomesProvider | ExtensionManagers | FileSystem.FileSystem | FootprintRecorder | HttpClient.HttpClient | ManagerRequirements | OperationJournal | Path.Path | McpServerInstallRequirements | ProjectionParticipantRequirements | RecipeRequirements | ReleaseAgePosture | ResolvePlanInteraction | Scope.Scope | SourceHostProviders | StepFailureConversion | SubagentManager | WorkspaceCatalog | WorkspaceMutations | WorkspaceTransactionScope;
113
- /**
114
- * Settle an activation request into the change it makes.
115
- *
116
- * A request the workspace already satisfies settles as `Unchanged` rather
117
- * than as an empty plan, so repeating a command reports what is true instead
118
- * of offering to do nothing. A request naming a subject the workspace does
119
- * not hold fails with the type's own recovery route.
120
- */
121
- export declare const prepareSetActivation: (request: SetActivationRequest) => Effect.Effect<SetActivationCandidate | ActivationUnchanged, SetActivationFailure, CodingAgentRepository | ExtensionManagers | FileSystem.FileSystem | HttpClient.HttpClient | ManagerRequirements | Path.Path | ReleaseAgePosture | Scope.Scope | SourceHostProviders | WorkspaceCatalog | WorkspaceMutations>;
122
- /**
123
- * Preview or apply a settled activation. The whole change — the preference,
124
- * the projections it implies, and any instruction file it shares — runs in
125
- * one workspace transaction, so a projection that cannot be written never
126
- * leaves the preference recorded.
127
- */
104
+ export type SetActivationRequirements = CodingAgentRepository | ConfiguredAgentOutcomesProvider | ExtensionManagers | HookManager | SkillManager | RuleManager | KnowledgeManager | PackManager | McpServerManager | FileSystem.FileSystem | FootprintRecorder | HttpClient.HttpClient | ManagerRequirements | OperationJournal | Path.Path | McpServerInstallRequirements | ProjectionParticipantRequirements | RecipeRequirements | LockfileReader | SettingsReader | SettingsWriter | ReleaseAgePosture | ResolvePlanInteraction | Scope.Scope | SourceHostProviders | StepFailureConversion | SubagentManager | WorkspaceCatalog | WorkspaceMutations | WorkspaceTransactionScope;
105
+ export interface SetActivationCandidate extends ActivationRealization {
106
+ readonly execution: ExecutionCandidate<SetActivationRequirements>;
107
+ }
108
+ export declare const prepareSetActivation: (request: SetActivationRequest) => Effect.Effect<SetActivationCandidate | ActivationUnchanged, SetActivationFailure | SetActivationExecutionFailure, SetActivationRequirements>;
128
109
  export declare const previewOrApplySetActivation: (candidate: SetActivationCandidate, execution: PlanExecution) => Effect.Effect<OperationResolution<void>, SetActivationExecutionFailure, SetActivationRequirements>;
129
110
  /** The activation use case. */
130
111
  export declare const SetActivation: {
131
- readonly prepare: (request: SetActivationRequest) => Effect.Effect<SetActivationCandidate | ActivationUnchanged, SetActivationFailure, CodingAgentRepository | ExtensionManagers | FileSystem.FileSystem | HttpClient.HttpClient | ManagerRequirements | Path.Path | ReleaseAgePosture | Scope.Scope | SourceHostProviders | WorkspaceCatalog | WorkspaceMutations>;
112
+ readonly prepare: (request: SetActivationRequest) => Effect.Effect<SetActivationCandidate | ActivationUnchanged, SetActivationFailure | SetActivationExecutionFailure, SetActivationRequirements>;
132
113
  readonly previewOrApply: (candidate: SetActivationCandidate, execution: PlanExecution) => Effect.Effect<OperationResolution<void>, SetActivationExecutionFailure, SetActivationRequirements>;
133
114
  };
115
+ export {};
134
116
  //# sourceMappingURL=set-activation.d.ts.map