@agentxm/extension-lifecycle 0.28.6 → 0.28.7
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/configured-entry-resolution.d.ts +4 -3
- package/dist/src/configured-entry-resolution.js +6 -1
- package/dist/src/hooks/manager.js +10 -4
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/knowledge/manager.js +14 -3
- package/dist/src/release-age-posture.d.ts +23 -0
- package/dist/src/release-age-posture.js +15 -0
- package/dist/src/rules/manager.js +10 -5
- package/package.json +8 -8
|
@@ -20,15 +20,16 @@ import type { SubagentExtensionRef } from "@agentxm/extension-model/unstable/ext
|
|
|
20
20
|
import type { VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
|
|
21
21
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
22
22
|
import { ExtensionLifecycleFailed } from "./errors.js";
|
|
23
|
+
import { ReleaseAgePosture } from "./release-age-posture.js";
|
|
23
24
|
import { LifecycleFailureAdapter } from "./failure-adapter.js";
|
|
24
25
|
import type { AcceptedCanonicalRefError } from "@agentxm/workspace-state";
|
|
25
26
|
import type { ConfiguredRegistryResolution } from "@agentxm/workspace-state";
|
|
26
|
-
export declare const makeConfiguredReleaseAgeEvaluation: (
|
|
27
|
+
export declare const makeConfiguredReleaseAgeEvaluation: () => Effect.Effect<{
|
|
27
28
|
minimumReleaseAge: import("effect/Duration").Duration;
|
|
28
29
|
evaluatedAt: DateTime.Utc;
|
|
29
|
-
mode: "
|
|
30
|
+
mode: import("./release-age-posture.js").ReleaseAgePostureValue;
|
|
30
31
|
exclude: readonly import("@agentxm/extension-model/unstable/extensions/release-age").ScopedReleaseAgeExcludePattern[];
|
|
31
|
-
}, ExtensionLifecycleFailed | import("@agentxm/workspace-state").WorkspaceSettingsReadFailure, WorkspaceMutations>;
|
|
32
|
+
}, ExtensionLifecycleFailed | import("@agentxm/workspace-state").WorkspaceSettingsReadFailure, ReleaseAgePosture | WorkspaceMutations>;
|
|
32
33
|
export declare const resolveConfiguredRegistryEntry: (name: string, source: string, expectedType: ExtensionType, releaseAgeEvaluation: ReleaseAgeEvaluation) => Effect.Effect<Option.Option<ConfiguredRegistryResolution>, ExtensionLifecycleFailed | SourceResolutionFailure | AcceptedCanonicalRefError, LifecycleFailureAdapter | SourceHostProviders | WorkspaceCatalog | WorkspaceMutations | FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | Scope.Scope>;
|
|
33
34
|
export declare const resolveConfiguredSkill: (name: string, source: string, releaseAgeEvaluation: ReleaseAgeEvaluation) => Effect.Effect<{
|
|
34
35
|
ref: import("@agentxm/extension-model/unstable/extensions/refs/skill").RegistrySkillRef;
|
|
@@ -7,10 +7,12 @@ import { resolveSource, SourceHostProviders, WorkspaceCatalog } from "@agentxm/e
|
|
|
7
7
|
import { isWorkspaceSourceLocator } from "@agentxm/extension-model/unstable/sources/workspace";
|
|
8
8
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
9
9
|
import { ExtensionLifecycleFailed } from "./errors.js";
|
|
10
|
+
import { ReleaseAgePosture } from "./release-age-posture.js";
|
|
10
11
|
import { LifecycleFailureAdapter } from "./failure-adapter.js";
|
|
11
12
|
import { acceptedResolutionRef } from "@agentxm/workspace-state";
|
|
12
13
|
import { resolveWorkspaceExtensionRef } from "@agentxm/workspace-state";
|
|
13
|
-
export const makeConfiguredReleaseAgeEvaluation = (
|
|
14
|
+
export const makeConfiguredReleaseAgeEvaluation = () => Effect.gen(function* () {
|
|
15
|
+
const mode = yield* ReleaseAgePosture;
|
|
14
16
|
const ws = yield* WorkspaceMutations;
|
|
15
17
|
const configured = yield* ws.getMinimumReleaseAge();
|
|
16
18
|
const minimumReleaseAge = parseMinimumReleaseAge(configured);
|
|
@@ -61,6 +63,9 @@ const configuredRegistryResolution = (resolution) => Effect.gen(function* () {
|
|
|
61
63
|
category: "conflict",
|
|
62
64
|
title: "Release held by minimum release age",
|
|
63
65
|
detail: `${resolution.target}@${resolution.candidate.version} is held by the minimum release age until ${resolution.candidate.eligibleAt}`,
|
|
66
|
+
// Both routes are reachable from wherever the operator is standing:
|
|
67
|
+
// the exemption is declared once, the flag lasts one run.
|
|
68
|
+
recover: `Declare ${resolution.target} in minimumReleaseAgeExclude, or rerun this command with --ignore-release-age to take it for this run only.`,
|
|
64
69
|
});
|
|
65
70
|
}
|
|
66
71
|
const holdbacks = resolution.kind === "exempted" || resolution.newerHeld === undefined
|
|
@@ -29,7 +29,7 @@ import { stripFileProtocol } from "../internal/fs-helpers.js";
|
|
|
29
29
|
import { makeWorkspaceRelativeSourcePath } from "@agentxm/extension-model/unstable/path-types";
|
|
30
30
|
import { decodeRelativePathSync, makeWorkspaceRelativePath, } from "@agentxm/extension-model/unstable/path-types";
|
|
31
31
|
import { decodeVersionSync } from "@agentxm/extension-model/unstable/version-constraints";
|
|
32
|
-
import {
|
|
32
|
+
import { usableAcceptedCanonicalRef } from "@agentxm/workspace-state";
|
|
33
33
|
import { coupleLifecycleDependencyFailure } from "../errors.js";
|
|
34
34
|
import { LifecycleFailureAdapter } from "../failure-adapter.js";
|
|
35
35
|
import { HOOK_FALLBACKS_REGION_OWNER, HookManager } from "@agentxm/extension-workspace";
|
|
@@ -711,11 +711,17 @@ export const HookManagerLive = Layer.effect(HookManager, Effect.gen(function* ()
|
|
|
711
711
|
const configured = yield* ws.getConfiguredHookEntries();
|
|
712
712
|
return Option.fromUndefinedOr(configured[target.name]?.source);
|
|
713
713
|
}),
|
|
714
|
+
/**
|
|
715
|
+
* Every enabled entry's accepted canonical package, read from accepted
|
|
716
|
+
* resolution rather than re-resolved from source. Materialization
|
|
717
|
+
* realizes what the workspace already accepted; going back to the
|
|
718
|
+
* source would put an unrelated configured entry's release age between
|
|
719
|
+
* an operator and the extension they are authoring.
|
|
720
|
+
*/
|
|
714
721
|
listMaterializable: Effect.fn("HookManager.listMaterializable")(function* () {
|
|
715
722
|
const configured = yield* ws.getConfiguredHookEntries();
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
return refs;
|
|
723
|
+
const refs = yield* Effect.forEach(enabledConfiguredEntries(configured), ([name]) => provide(usableAcceptedCanonicalRef({ workspace: ws, type: "hook", name }).pipe(Effect.map(Option.filter((ref) => ref.type === "hook")))), { concurrency: "unbounded" });
|
|
724
|
+
return refs.flatMap((ref) => (Option.isSome(ref) ? [ref.value] : []));
|
|
719
725
|
}),
|
|
720
726
|
materializeUninstall,
|
|
721
727
|
materializeDeactivate,
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
11
|
export { ExtensionLifecycleFailed } from "./errors.js";
|
|
12
|
+
export { ReleaseAgePosture, type ReleaseAgePostureValue } from "./release-age-posture.js";
|
|
12
13
|
export { LifecycleFailureAdapter, withAdaptedStepFailures, type LifecycleFailureAdapterService, } from "./failure-adapter.js";
|
|
13
14
|
export { makeConfiguredReleaseAgeEvaluation, resolveConfiguredHook, resolveConfiguredKnowledge, resolveConfiguredMcpServer, resolveConfiguredPack, resolveConfiguredRegistryEntry, resolveConfiguredRule, resolveConfiguredSkill, resolveConfiguredSubagent, } from "./configured-entry-resolution.js";
|
|
14
15
|
export { CONFIGURED_ENTRY_RESOLUTION_TIMEOUT, withConfiguredEntryResolutionTimeout, } from "./resolution-timeout.js";
|
package/dist/src/index.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
11
|
export { ExtensionLifecycleFailed } from "./errors.js";
|
|
12
|
+
export { ReleaseAgePosture } from "./release-age-posture.js";
|
|
12
13
|
export { LifecycleFailureAdapter, withAdaptedStepFailures, } from "./failure-adapter.js";
|
|
13
14
|
export { makeConfiguredReleaseAgeEvaluation, resolveConfiguredHook, resolveConfiguredKnowledge, resolveConfiguredMcpServer, resolveConfiguredPack, resolveConfiguredRegistryEntry, resolveConfiguredRule, resolveConfiguredSkill, resolveConfiguredSubagent, } from "./configured-entry-resolution.js";
|
|
14
15
|
export { CONFIGURED_ENTRY_RESOLUTION_TIMEOUT, withConfiguredEntryResolutionTimeout, } from "./resolution-timeout.js";
|
|
@@ -26,7 +26,7 @@ import { makeWorkspaceRelativeSourcePath } from "@agentxm/extension-model/unstab
|
|
|
26
26
|
import { recordFootprint } from "@agentxm/workspace-state";
|
|
27
27
|
import { makeWorkspaceRelativePath } from "@agentxm/extension-model/unstable/path-types";
|
|
28
28
|
import { decodeVersionSync } from "@agentxm/extension-model/unstable/version-constraints";
|
|
29
|
-
import {
|
|
29
|
+
import { usableAcceptedCanonicalRef } from "@agentxm/workspace-state";
|
|
30
30
|
import { getKnowledgeLockEntries } from "@agentxm/workspace-state";
|
|
31
31
|
import { KnowledgeManager, } from "@agentxm/extension-workspace";
|
|
32
32
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
@@ -667,10 +667,21 @@ export const KnowledgeManagerLive = Layer.effect(KnowledgeManager, Effect.gen(fu
|
|
|
667
667
|
getConfiguredSource: ({ target }) => ws
|
|
668
668
|
.getConfiguredKnowledgeEntries()
|
|
669
669
|
.pipe(Effect.map((entries) => Option.fromUndefinedOr(entries[target.name]?.source))),
|
|
670
|
+
/**
|
|
671
|
+
* Every enabled entry's accepted canonical package, read from accepted
|
|
672
|
+
* resolution rather than re-resolved from source. Materialization
|
|
673
|
+
* realizes what the workspace already accepted; going back to the
|
|
674
|
+
* source would put an unrelated configured entry's release age between
|
|
675
|
+
* an operator and the extension they are authoring.
|
|
676
|
+
*/
|
|
670
677
|
listMaterializable: () => Effect.gen(function* () {
|
|
671
678
|
const nodes = yield* activeKnowledgeNodes();
|
|
672
|
-
const
|
|
673
|
-
|
|
679
|
+
const refs = yield* Effect.forEach(nodes, (node) => provide(usableAcceptedCanonicalRef({
|
|
680
|
+
workspace: ws,
|
|
681
|
+
type: "knowledge",
|
|
682
|
+
name: node.name,
|
|
683
|
+
}).pipe(Effect.map(Option.filter((ref) => ref.type === "knowledge")))), { concurrency: "unbounded" });
|
|
684
|
+
return refs.flatMap((ref) => (Option.isSome(ref) ? [ref.value] : []));
|
|
674
685
|
}),
|
|
675
686
|
materializeUninstall,
|
|
676
687
|
materializeDeactivate,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The minimum-release-age gate's posture for one invocation.
|
|
3
|
+
*
|
|
4
|
+
* A leaf cannot invent this value: `makeConfiguredReleaseAgeEvaluation` reads
|
|
5
|
+
* it from context, so every gated code path carries the requirement up to the
|
|
6
|
+
* command boundary that owns the operator's decision. A command is
|
|
7
|
+
* gate-blockable precisely when its execution requests this service, which is
|
|
8
|
+
* what the conformance specification reads instead of a hand-copied list.
|
|
9
|
+
*
|
|
10
|
+
* @experimental This API is unstable and may change without notice.
|
|
11
|
+
*/
|
|
12
|
+
import * as ServiceMap from "effect/Context";
|
|
13
|
+
/**
|
|
14
|
+
* `"enforce"` withholds a candidate that has not reached the configured
|
|
15
|
+
* minimum release age; `"ignore"` takes it for this run only. Neither value
|
|
16
|
+
* changes settings, and a declared exemption outranks both.
|
|
17
|
+
*/
|
|
18
|
+
export type ReleaseAgePostureValue = "enforce" | "ignore";
|
|
19
|
+
declare const ReleaseAgePosture_base: ServiceMap.ServiceClass<ReleaseAgePosture, "axm.sh/extension-lifecycle/ReleaseAgePosture", ReleaseAgePostureValue>;
|
|
20
|
+
export declare class ReleaseAgePosture extends ReleaseAgePosture_base {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=release-age-posture.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The minimum-release-age gate's posture for one invocation.
|
|
3
|
+
*
|
|
4
|
+
* A leaf cannot invent this value: `makeConfiguredReleaseAgeEvaluation` reads
|
|
5
|
+
* it from context, so every gated code path carries the requirement up to the
|
|
6
|
+
* command boundary that owns the operator's decision. A command is
|
|
7
|
+
* gate-blockable precisely when its execution requests this service, which is
|
|
8
|
+
* what the conformance specification reads instead of a hand-copied list.
|
|
9
|
+
*
|
|
10
|
+
* @experimental This API is unstable and may change without notice.
|
|
11
|
+
*/
|
|
12
|
+
import * as ServiceMap from "effect/Context";
|
|
13
|
+
export class ReleaseAgePosture extends ServiceMap.Service()("axm.sh/extension-lifecycle/ReleaseAgePosture") {
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=release-age-posture.js.map
|
|
@@ -30,8 +30,7 @@ import { removeIfExists } from "@agentxm/workspace-state";
|
|
|
30
30
|
import { makeWorkspaceRelativePath } from "@agentxm/extension-model/unstable/path-types";
|
|
31
31
|
import { decodeVersionSync } from "@agentxm/extension-model/unstable/version-constraints";
|
|
32
32
|
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
33
|
-
import {
|
|
34
|
-
import { coupleLifecycleDependencyFailure } from "../errors.js";
|
|
33
|
+
import { usableAcceptedCanonicalRef } from "@agentxm/workspace-state";
|
|
35
34
|
import { LifecycleFailureAdapter } from "../failure-adapter.js";
|
|
36
35
|
import { isObservedInstalled } from "@agentxm/workspace-state";
|
|
37
36
|
import { acceptedCanonicalObservation, prepareAcceptedCanonicalTransition, removableAcceptedCanonicalPath, } from "@agentxm/workspace-state";
|
|
@@ -423,11 +422,17 @@ export const RuleManagerLive = Layer.effect(RuleManager, Effect.gen(function* ()
|
|
|
423
422
|
const configured = yield* ws.getConfiguredRuleEntries();
|
|
424
423
|
return Option.fromUndefinedOr(configured[target.name]?.source);
|
|
425
424
|
}),
|
|
425
|
+
/**
|
|
426
|
+
* Every enabled entry's accepted canonical package, read from accepted
|
|
427
|
+
* resolution rather than re-resolved from source. Materialization
|
|
428
|
+
* realizes what the workspace already accepted; going back to the
|
|
429
|
+
* source would put an unrelated configured entry's release age between
|
|
430
|
+
* an operator and the extension they are authoring.
|
|
431
|
+
*/
|
|
426
432
|
listMaterializable: Effect.fn("RuleManager.listMaterializable")(function* () {
|
|
427
433
|
const configured = yield* ws.getConfiguredRuleEntries();
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
return refs;
|
|
434
|
+
const refs = yield* Effect.forEach(enabledConfiguredEntries(configured), ([name]) => provide(usableAcceptedCanonicalRef({ workspace: ws, type: "rule", name }).pipe(Effect.map(Option.filter((ref) => ref.type === "rule")))), { concurrency: "unbounded" });
|
|
435
|
+
return refs.flatMap((ref) => (Option.isSome(ref) ? [ref.value] : []));
|
|
431
436
|
}),
|
|
432
437
|
materializeUninstall,
|
|
433
438
|
materializeDeactivate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentxm/extension-lifecycle",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.7",
|
|
4
4
|
"description": "AXM extension-lifecycle feature: install, update, uninstall, enable, and disable policy across root and type-specific command forms for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"effect": "4.0.0-rc.112",
|
|
45
45
|
"semver": "^7.8.5",
|
|
46
|
-
"@agentxm/extension-
|
|
47
|
-
"@agentxm/extension-
|
|
48
|
-
"@agentxm/
|
|
49
|
-
"@agentxm/registry-client": "^0.28.
|
|
50
|
-
"@agentxm/workspace-
|
|
51
|
-
"@agentxm/workspace-
|
|
52
|
-
"@agentxm/
|
|
46
|
+
"@agentxm/extension-model": "^0.28.7",
|
|
47
|
+
"@agentxm/extension-workspace": "^0.28.7",
|
|
48
|
+
"@agentxm/registry-protocol": "^0.28.7",
|
|
49
|
+
"@agentxm/registry-client": "^0.28.7",
|
|
50
|
+
"@agentxm/workspace-state": "^0.28.7",
|
|
51
|
+
"@agentxm/workspace-operations": "^0.28.7",
|
|
52
|
+
"@agentxm/extension-sources": "^0.28.7"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@effect/platform-node": "4.0.0-rc.112",
|