@agentxm/extension-lifecycle 0.28.4-bootstrap.0

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 (84) hide show
  1. package/LICENSE +110 -0
  2. package/dist/src/configured-entry-resolution.d.ts +110 -0
  3. package/dist/src/configured-entry-resolution.js +723 -0
  4. package/dist/src/errors.d.ts +39 -0
  5. package/dist/src/errors.js +45 -0
  6. package/dist/src/failure-adapter.d.ts +35 -0
  7. package/dist/src/failure-adapter.js +23 -0
  8. package/dist/src/hooks/configured-agent-outcomes-provider.d.ts +18 -0
  9. package/dist/src/hooks/configured-agent-outcomes-provider.js +39 -0
  10. package/dist/src/hooks/manager.d.ts +15 -0
  11. package/dist/src/hooks/manager.js +751 -0
  12. package/dist/src/index.d.ts +38 -0
  13. package/dist/src/index.js +41 -0
  14. package/dist/src/internal/fs-helpers.d.ts +12 -0
  15. package/dist/src/internal/fs-helpers.js +13 -0
  16. package/dist/src/internal/integrity.d.ts +13 -0
  17. package/dist/src/internal/integrity.js +17 -0
  18. package/dist/src/knowledge/manager.d.ts +11 -0
  19. package/dist/src/knowledge/manager.js +655 -0
  20. package/dist/src/live.d.ts +18 -0
  21. package/dist/src/live.js +18 -0
  22. package/dist/src/mcps/manager.d.ts +16 -0
  23. package/dist/src/mcps/manager.js +213 -0
  24. package/dist/src/mcps/operations/artifact.d.ts +24 -0
  25. package/dist/src/mcps/operations/artifact.js +74 -0
  26. package/dist/src/mcps/operations/disable.d.ts +18 -0
  27. package/dist/src/mcps/operations/disable.js +113 -0
  28. package/dist/src/mcps/operations/enable.d.ts +18 -0
  29. package/dist/src/mcps/operations/enable.js +218 -0
  30. package/dist/src/mcps/operations/install.d.ts +59 -0
  31. package/dist/src/mcps/operations/install.js +566 -0
  32. package/dist/src/mcps/operations/sync-outcome.d.ts +10 -0
  33. package/dist/src/mcps/operations/sync-outcome.js +27 -0
  34. package/dist/src/mcps/operations/uninstall.d.ts +41 -0
  35. package/dist/src/mcps/operations/uninstall.js +189 -0
  36. package/dist/src/packs/dependency-resolution.d.ts +65 -0
  37. package/dist/src/packs/dependency-resolution.js +414 -0
  38. package/dist/src/packs/expansion.d.ts +59 -0
  39. package/dist/src/packs/expansion.js +44 -0
  40. package/dist/src/packs/manager.d.ts +16 -0
  41. package/dist/src/packs/manager.js +181 -0
  42. package/dist/src/packs/operations/install.d.ts +67 -0
  43. package/dist/src/packs/operations/install.js +156 -0
  44. package/dist/src/packs/resolved-dependency.d.ts +29 -0
  45. package/dist/src/packs/resolved-dependency.js +28 -0
  46. package/dist/src/registry-materialization.d.ts +52 -0
  47. package/dist/src/registry-materialization.js +67 -0
  48. package/dist/src/resolution-progress.d.ts +18 -0
  49. package/dist/src/resolution-progress.js +11 -0
  50. package/dist/src/resolution-timeout.d.ts +5 -0
  51. package/dist/src/resolution-timeout.js +11 -0
  52. package/dist/src/rules/manager.d.ts +20 -0
  53. package/dist/src/rules/manager.js +475 -0
  54. package/dist/src/skills/manager.d.ts +18 -0
  55. package/dist/src/skills/manager.js +346 -0
  56. package/dist/src/skills/materialization.d.ts +54 -0
  57. package/dist/src/skills/materialization.js +158 -0
  58. package/dist/src/skills/operations/disable.d.ts +31 -0
  59. package/dist/src/skills/operations/disable.js +110 -0
  60. package/dist/src/skills/operations/enable.d.ts +31 -0
  61. package/dist/src/skills/operations/enable.js +113 -0
  62. package/dist/src/skills/operations/install-result.d.ts +33 -0
  63. package/dist/src/skills/operations/install-result.js +10 -0
  64. package/dist/src/skills/operations/install.d.ts +67 -0
  65. package/dist/src/skills/operations/install.js +590 -0
  66. package/dist/src/skills/operations/source-hash.d.ts +2 -0
  67. package/dist/src/skills/operations/source-hash.js +6 -0
  68. package/dist/src/skills/operations/uninstall.d.ts +40 -0
  69. package/dist/src/skills/operations/uninstall.js +157 -0
  70. package/dist/src/skills/utils.d.ts +11 -0
  71. package/dist/src/skills/utils.js +29 -0
  72. package/dist/src/subagents/manager.d.ts +18 -0
  73. package/dist/src/subagents/manager.js +677 -0
  74. package/dist/src/subagents/operations/artifact.d.ts +18 -0
  75. package/dist/src/subagents/operations/artifact.js +43 -0
  76. package/dist/src/subagents/operations/disable.d.ts +32 -0
  77. package/dist/src/subagents/operations/disable.js +116 -0
  78. package/dist/src/subagents/operations/enable.d.ts +30 -0
  79. package/dist/src/subagents/operations/enable.js +160 -0
  80. package/dist/src/workflows/install-command/workflow.d.ts +57 -0
  81. package/dist/src/workflows/install-command/workflow.js +41 -0
  82. package/dist/src/workflows/uninstall-command/workflow.d.ts +42 -0
  83. package/dist/src/workflows/uninstall-command/workflow.js +29 -0
  84. package/package.json +62 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Typed failures for the extension-lifecycle feature. The producer owns the
3
+ * category choice and user-facing wording; the application boundary converts
4
+ * the carried fields into its error envelope verbatim.
5
+ *
6
+ * @experimental This API is unstable and may change without notice.
7
+ */
8
+ import * as Schema from "effect/Schema";
9
+ import { CoupledDependencyFailure } from "@agentxm/extension-workspace";
10
+ declare const ExtensionLifecycleFailed_base: Schema.Class<ExtensionLifecycleFailed, Schema.TaggedStruct<"ExtensionLifecycleFailed", {
11
+ readonly category: Schema.Literals<readonly ["conflict", "internal", "network", "not_found", "usage", "validation"]>;
12
+ readonly title: Schema.optional<Schema.String>;
13
+ readonly detail: Schema.optional<Schema.String>;
14
+ readonly recover: Schema.optional<Schema.String>;
15
+ readonly cmd: Schema.optional<Schema.String>;
16
+ readonly suggestions: Schema.optional<Schema.$Array<Schema.Struct<{
17
+ readonly description: Schema.String;
18
+ readonly cmd: Schema.optional<Schema.String>;
19
+ readonly url: Schema.optional<Schema.String>;
20
+ }>>>;
21
+ readonly cause: Schema.optional<Schema.Unknown>;
22
+ }>, import("effect/Cause").YieldableError>;
23
+ /**
24
+ * A lifecycle policy step could not proceed. The carried fields mirror the
25
+ * application error envelope's inputs 1:1: `category` selects the code,
26
+ * `recover`/`cmd` fold into the leading suggested action, and `title`,
27
+ * `detail`, `suggestions`, and `cause` carry over verbatim.
28
+ */
29
+ export declare class ExtensionLifecycleFailed extends ExtensionLifecycleFailed_base {
30
+ }
31
+ /**
32
+ * Carry a lifecycle dependency's failure opaquely through a kernel-typed
33
+ * manager channel. The application boundary restores and converts the carried
34
+ * failure, so rendering, exit codes, and machine output stay byte-identical
35
+ * with the previous in-place conversion.
36
+ */
37
+ export declare const coupleLifecycleDependencyFailure: (failure: unknown) => CoupledDependencyFailure;
38
+ export {};
39
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Typed failures for the extension-lifecycle feature. The producer owns the
3
+ * category choice and user-facing wording; the application boundary converts
4
+ * the carried fields into its error envelope verbatim.
5
+ *
6
+ * @experimental This API is unstable and may change without notice.
7
+ */
8
+ import * as Schema from "effect/Schema";
9
+ import { CoupledDependencyFailure } from "@agentxm/extension-workspace";
10
+ const CarriedSuggestedActionSchema = Schema.Struct({
11
+ description: Schema.String,
12
+ cmd: Schema.optional(Schema.String),
13
+ url: Schema.optional(Schema.String),
14
+ });
15
+ /**
16
+ * A lifecycle policy step could not proceed. The carried fields mirror the
17
+ * application error envelope's inputs 1:1: `category` selects the code,
18
+ * `recover`/`cmd` fold into the leading suggested action, and `title`,
19
+ * `detail`, `suggestions`, and `cause` carry over verbatim.
20
+ */
21
+ export class ExtensionLifecycleFailed extends Schema.TaggedError()("ExtensionLifecycleFailed", {
22
+ category: Schema.Literals([
23
+ "conflict",
24
+ "internal",
25
+ "network",
26
+ "not_found",
27
+ "usage",
28
+ "validation",
29
+ ]),
30
+ title: Schema.optional(Schema.String),
31
+ detail: Schema.optional(Schema.String),
32
+ recover: Schema.optional(Schema.String),
33
+ cmd: Schema.optional(Schema.String),
34
+ suggestions: Schema.optional(Schema.Array(CarriedSuggestedActionSchema)),
35
+ cause: Schema.optional(Schema.Unknown),
36
+ }) {
37
+ }
38
+ /**
39
+ * Carry a lifecycle dependency's failure opaquely through a kernel-typed
40
+ * manager channel. The application boundary restores and converts the carried
41
+ * failure, so rendering, exit codes, and machine output stay byte-identical
42
+ * with the previous in-place conversion.
43
+ */
44
+ export const coupleLifecycleDependencyFailure = (failure) => new CoupledDependencyFailure({ failure });
45
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The application-supplied conversion from lifecycle failures to the plan
3
+ * step vocabulary and to display text. Error rendering is application-owned:
4
+ * the CLI implements this with the same dispatcher it uses at its output
5
+ * boundary, so step categories and details inside lifecycle plans stay
6
+ * byte-identical with rendered errors. The feature keeps only the
7
+ * requirement, never the mapping.
8
+ *
9
+ * @experimental This API is unstable and may change without notice.
10
+ */
11
+ import * as ServiceMap from "effect/Context";
12
+ import * as Effect from "effect/Effect";
13
+ import type { StepFailure } from "@agentxm/workspace-operations";
14
+ export interface LifecycleFailureAdapterService {
15
+ /**
16
+ * Serialize any failure a lifecycle operation can surface — kernel manager
17
+ * failures, integration failures, and the feature's own typed failures —
18
+ * into the plan-step vocabulary.
19
+ */
20
+ readonly toStepFailure: (failure: unknown) => StepFailure;
21
+ /** Render one failure as the detail sentence the boundary would print. */
22
+ readonly describeFailure: (failure: unknown) => string;
23
+ /** Render one failure as the boundary envelope's `message` property. */
24
+ readonly describeFailureMessage: (failure: unknown) => string;
25
+ }
26
+ declare const LifecycleFailureAdapter_base: ServiceMap.ServiceClass<LifecycleFailureAdapter, "@agentxm/extension-lifecycle/failure-adapter/LifecycleFailureAdapter", LifecycleFailureAdapterService>;
27
+ export declare class LifecycleFailureAdapter extends LifecycleFailureAdapter_base {
28
+ }
29
+ /**
30
+ * Serialize every failure of one lifecycle operation into the plan-step
31
+ * vocabulary through the application-supplied adapter.
32
+ */
33
+ export declare const withAdaptedStepFailures: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, StepFailure, R | LifecycleFailureAdapter>;
34
+ export {};
35
+ //# sourceMappingURL=failure-adapter.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The application-supplied conversion from lifecycle failures to the plan
3
+ * step vocabulary and to display text. Error rendering is application-owned:
4
+ * the CLI implements this with the same dispatcher it uses at its output
5
+ * boundary, so step categories and details inside lifecycle plans stay
6
+ * byte-identical with rendered errors. The feature keeps only the
7
+ * requirement, never the mapping.
8
+ *
9
+ * @experimental This API is unstable and may change without notice.
10
+ */
11
+ import * as ServiceMap from "effect/Context";
12
+ import * as Effect from "effect/Effect";
13
+ export class LifecycleFailureAdapter extends ServiceMap.Service()("@agentxm/extension-lifecycle/failure-adapter/LifecycleFailureAdapter") {
14
+ }
15
+ /**
16
+ * Serialize every failure of one lifecycle operation into the plan-step
17
+ * vocabulary through the application-supplied adapter.
18
+ */
19
+ export const withAdaptedStepFailures = (effect) => Effect.gen(function* () {
20
+ const adapter = yield* LifecycleFailureAdapter;
21
+ return yield* effect.pipe(Effect.mapError((failure) => adapter.toStepFailure(failure)));
22
+ });
23
+ //# sourceMappingURL=failure-adapter.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Hook-backed implementation of the workspace-state
3
+ * `ConfiguredAgentOutcomesProvider` port.
4
+ *
5
+ * The plan pipeline consumes the port; the hook manager owns the effective
6
+ * per-agent outcome facts. Only the composition root sees both, so the
7
+ * application wires this layer over the manager, supplying its own failure
8
+ * serialization so plan resolutions embed byte-identical step failures on
9
+ * either side of the seam.
10
+ *
11
+ * @experimental This API is unstable and may change without notice.
12
+ */
13
+ import * as Layer from "effect/Layer";
14
+ import { ConfiguredAgentOutcomesProvider } from "@agentxm/workspace-state";
15
+ import { LifecycleFailureAdapter } from "../failure-adapter.js";
16
+ import { HookManager } from "@agentxm/extension-workspace";
17
+ export declare const HookConfiguredAgentOutcomesProviderLive: Layer.Layer<ConfiguredAgentOutcomesProvider, never, LifecycleFailureAdapter | HookManager>;
18
+ //# sourceMappingURL=configured-agent-outcomes-provider.d.ts.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Hook-backed implementation of the workspace-state
3
+ * `ConfiguredAgentOutcomesProvider` port.
4
+ *
5
+ * The plan pipeline consumes the port; the hook manager owns the effective
6
+ * per-agent outcome facts. Only the composition root sees both, so the
7
+ * application wires this layer over the manager, supplying its own failure
8
+ * serialization so plan resolutions embed byte-identical step failures on
9
+ * either side of the seam.
10
+ *
11
+ * @experimental This API is unstable and may change without notice.
12
+ */
13
+ import * as Effect from "effect/Effect";
14
+ import * as Layer from "effect/Layer";
15
+ import { ConfiguredAgentOutcomesProvider, ConfiguredAgentOutcomesUnavailable, } from "@agentxm/workspace-state";
16
+ import { LifecycleFailureAdapter } from "../failure-adapter.js";
17
+ import { HookManager } from "@agentxm/extension-workspace";
18
+ export const HookConfiguredAgentOutcomesProviderLive = Layer.effect(ConfiguredAgentOutcomesProvider, Effect.gen(function* () {
19
+ const adapter = yield* LifecycleFailureAdapter;
20
+ const hookManager = yield* HookManager;
21
+ const configuredAgentOutcomes = hookManager.configuredAgentOutcomes;
22
+ if (configuredAgentOutcomes === undefined) {
23
+ return { byExtensionType: {} };
24
+ }
25
+ return {
26
+ byExtensionType: {
27
+ hook: (state) => configuredAgentOutcomes(state).pipe(Effect.mapError((failure) => {
28
+ const step = adapter.toStepFailure(failure);
29
+ return new ConfiguredAgentOutcomesUnavailable({
30
+ category: step.category,
31
+ detail: step.detail,
32
+ ...(step.suggestions === undefined ? {} : { suggestions: step.suggestions }),
33
+ ...(step.cause === undefined ? {} : { cause: step.cause }),
34
+ });
35
+ })),
36
+ },
37
+ };
38
+ }));
39
+ //# sourceMappingURL=configured-agent-outcomes-provider.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Hook manager service.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import * as FileSystem from "effect/FileSystem";
7
+ import * as HttpClient from "effect/unstable/http/HttpClient";
8
+ import * as Layer from "effect/Layer";
9
+ import * as Path from "effect/Path";
10
+ import { SourceHostProviders, WorkspaceCatalog } from "@agentxm/extension-sources";
11
+ import { LifecycleFailureAdapter } from "../failure-adapter.js";
12
+ import { HookManager } from "@agentxm/extension-workspace";
13
+ import { WorkspaceMutations } from "@agentxm/workspace-state";
14
+ export declare const HookManagerLive: Layer.Layer<HookManager, never, LifecycleFailureAdapter | SourceHostProviders | WorkspaceCatalog | WorkspaceMutations | FileSystem.FileSystem | HttpClient.HttpClient | Path.Path>;
15
+ //# sourceMappingURL=manager.d.ts.map