@agentxm/workspace-state 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.
- package/LICENSE +110 -0
- package/README.md +11 -0
- package/dist/src/index.d.ts +72 -0
- package/dist/src/index.js +88 -0
- package/dist/src/knowledge/discovery-config.d.ts +12 -0
- package/dist/src/knowledge/discovery-config.js +9 -0
- package/dist/src/lockfile/accepted-registry-version.d.ts +12 -0
- package/dist/src/lockfile/accepted-registry-version.js +13 -0
- package/dist/src/lockfile/entry-fields.d.ts +189 -0
- package/dist/src/lockfile/entry-fields.js +89 -0
- package/dist/src/lockfile/errors.d.ts +48 -0
- package/dist/src/lockfile/errors.js +27 -0
- package/dist/src/lockfile/index.d.ts +18 -0
- package/dist/src/lockfile/index.js +16 -0
- package/dist/src/lockfile/lockfile.d.ts +2255 -0
- package/dist/src/lockfile/lockfile.js +235 -0
- package/dist/src/lockfile/resolved-version.d.ts +4 -0
- package/dist/src/lockfile/resolved-version.js +7 -0
- package/dist/src/lockfile/schema.d.ts +3062 -0
- package/dist/src/lockfile/schema.js +406 -0
- package/dist/src/schema/index.d.ts +3 -0
- package/dist/src/schema/index.js +2 -0
- package/dist/src/schema/read-and-validate-json-file.d.ts +20 -0
- package/dist/src/schema/read-and-validate-json-file.js +85 -0
- package/dist/src/schema/types.d.ts +26 -0
- package/dist/src/schema/types.js +2 -0
- package/dist/src/settings/errors.d.ts +22 -0
- package/dist/src/settings/errors.js +15 -0
- package/dist/src/settings/format-preserving-json.d.ts +40 -0
- package/dist/src/settings/format-preserving-json.js +80 -0
- package/dist/src/settings/index.d.ts +15 -0
- package/dist/src/settings/index.js +14 -0
- package/dist/src/settings/schema.d.ts +687 -0
- package/dist/src/settings/schema.js +977 -0
- package/dist/src/settings/settings.d.ts +38 -0
- package/dist/src/settings/settings.js +213 -0
- package/dist/src/testing.d.ts +17 -0
- package/dist/src/testing.js +17 -0
- package/dist/src/utils/atomic-write.d.ts +67 -0
- package/dist/src/utils/atomic-write.js +71 -0
- package/dist/src/utils/environment.d.ts +16 -0
- package/dist/src/utils/environment.js +19 -0
- package/dist/src/utils/path-safety.d.ts +25 -0
- package/dist/src/utils/path-safety.js +34 -0
- package/dist/src/utils/resolve-parent-symlinks.d.ts +16 -0
- package/dist/src/utils/resolve-parent-symlinks.js +36 -0
- package/dist/src/workspace/accepted-canonical-ref.d.ts +58 -0
- package/dist/src/workspace/accepted-canonical-ref.js +229 -0
- package/dist/src/workspace/artifact-change.d.ts +14 -0
- package/dist/src/workspace/artifact-change.js +18 -0
- package/dist/src/workspace/canonical-observation.d.ts +39 -0
- package/dist/src/workspace/canonical-observation.js +307 -0
- package/dist/src/workspace/configured-agent-outcome.d.ts +22 -0
- package/dist/src/workspace/configured-agent-outcome.js +33 -0
- package/dist/src/workspace/configured-agent-outcomes-provider.d.ts +50 -0
- package/dist/src/workspace/configured-agent-outcomes-provider.js +26 -0
- package/dist/src/workspace/configured-agent-outcomes.d.ts +48 -0
- package/dist/src/workspace/configured-agent-outcomes.js +113 -0
- package/dist/src/workspace/configured-entry-resolution/types.d.ts +32 -0
- package/dist/src/workspace/configured-entry-resolution/types.js +2 -0
- package/dist/src/workspace/configured-entry-resolution/workspace-ref.d.ts +32 -0
- package/dist/src/workspace/configured-entry-resolution/workspace-ref.js +176 -0
- package/dist/src/workspace/constants.d.ts +6 -0
- package/dist/src/workspace/constants.js +6 -0
- package/dist/src/workspace/create-symlink.d.ts +26 -0
- package/dist/src/workspace/create-symlink.js +87 -0
- package/dist/src/workspace/desired-pack-lock.d.ts +18 -0
- package/dist/src/workspace/desired-pack-lock.js +132 -0
- package/dist/src/workspace/desired-state-enabled.d.ts +18 -0
- package/dist/src/workspace/desired-state-enabled.js +16 -0
- package/dist/src/workspace/desired-state-graph.d.ts +114 -0
- package/dist/src/workspace/desired-state-graph.js +384 -0
- package/dist/src/workspace/desired-state-problem-text.d.ts +6 -0
- package/dist/src/workspace/desired-state-problem-text.js +27 -0
- package/dist/src/workspace/errors.d.ts +184 -0
- package/dist/src/workspace/errors.js +79 -0
- package/dist/src/workspace/extension-name.d.ts +28 -0
- package/dist/src/workspace/extension-name.js +66 -0
- package/dist/src/workspace/extension-paths.d.ts +82 -0
- package/dist/src/workspace/extension-paths.js +172 -0
- package/dist/src/workspace/footprint-recorder.d.ts +30 -0
- package/dist/src/workspace/footprint-recorder.js +32 -0
- package/dist/src/workspace/layout.d.ts +43 -0
- package/dist/src/workspace/layout.js +164 -0
- package/dist/src/workspace/lock-entry-to-ref.d.ts +40 -0
- package/dist/src/workspace/lock-entry-to-ref.js +433 -0
- package/dist/src/workspace/lock-entry-to-source-params.d.ts +26 -0
- package/dist/src/workspace/lock-entry-to-source-params.js +81 -0
- package/dist/src/workspace/locked-entries.d.ts +30 -0
- package/dist/src/workspace/locked-entries.js +34 -0
- package/dist/src/workspace/materialized-file-target.d.ts +14 -0
- package/dist/src/workspace/materialized-file-target.js +14 -0
- package/dist/src/workspace/materialized-tree.d.ts +23 -0
- package/dist/src/workspace/materialized-tree.js +90 -0
- package/dist/src/workspace/mcp-entry-semantics.d.ts +31 -0
- package/dist/src/workspace/mcp-entry-semantics.js +60 -0
- package/dist/src/workspace/observed-installed.d.ts +9 -0
- package/dist/src/workspace/observed-installed.js +9 -0
- package/dist/src/workspace/pack-manifest-content-identity.d.ts +12 -0
- package/dist/src/workspace/pack-manifest-content-identity.js +20 -0
- package/dist/src/workspace/pack-paths.d.ts +24 -0
- package/dist/src/workspace/pack-paths.js +16 -0
- package/dist/src/workspace/package-hash.d.ts +25 -0
- package/dist/src/workspace/package-hash.js +45 -0
- package/dist/src/workspace/paths.d.ts +24 -0
- package/dist/src/workspace/paths.js +52 -0
- package/dist/src/workspace/read-model/__fixtures__/builder.d.ts +199 -0
- package/dist/src/workspace/read-model/__fixtures__/builder.js +588 -0
- package/dist/src/workspace/read-model/__fixtures__/decoders.d.ts +15 -0
- package/dist/src/workspace/read-model/__fixtures__/decoders.js +15 -0
- package/dist/src/workspace/read-model/__fixtures__/occurrences.d.ts +72 -0
- package/dist/src/workspace/read-model/__fixtures__/occurrences.js +134 -0
- package/dist/src/workspace/read-model/__fixtures__/scenario-harness.d.ts +99 -0
- package/dist/src/workspace/read-model/__fixtures__/scenario-harness.js +142 -0
- package/dist/src/workspace/read-model/__fixtures__/test-layer.d.ts +60 -0
- package/dist/src/workspace/read-model/__fixtures__/test-layer.js +57 -0
- package/dist/src/workspace/read-model/agent-presence.d.ts +32 -0
- package/dist/src/workspace/read-model/agent-presence.js +21 -0
- package/dist/src/workspace/read-model/agent-root-resolver.d.ts +38 -0
- package/dist/src/workspace/read-model/agent-root-resolver.js +35 -0
- package/dist/src/workspace/read-model/agents/index.d.ts +38 -0
- package/dist/src/workspace/read-model/agents/index.js +45 -0
- package/dist/src/workspace/read-model/agents/shared.d.ts +27 -0
- package/dist/src/workspace/read-model/agents/shared.js +63 -0
- package/dist/src/workspace/read-model/agents/types.d.ts +133 -0
- package/dist/src/workspace/read-model/agents/types.js +51 -0
- package/dist/src/workspace/read-model/diagnostics.d.ts +18 -0
- package/dist/src/workspace/read-model/diagnostics.js +14 -0
- package/dist/src/workspace/read-model/discovery/index.d.ts +5 -0
- package/dist/src/workspace/read-model/discovery/index.js +5 -0
- package/dist/src/workspace/read-model/discovery/plugin-manifests.d.ts +16 -0
- package/dist/src/workspace/read-model/discovery/plugin-manifests.js +168 -0
- package/dist/src/workspace/read-model/discovery/skills.d.ts +58 -0
- package/dist/src/workspace/read-model/discovery/skills.js +263 -0
- package/dist/src/workspace/read-model/discovery/subagents.d.ts +37 -0
- package/dist/src/workspace/read-model/discovery/subagents.js +48 -0
- package/dist/src/workspace/read-model/errors.d.ts +93 -0
- package/dist/src/workspace/read-model/errors.js +30 -0
- package/dist/src/workspace/read-model/extensions/actual-helpers.d.ts +4 -0
- package/dist/src/workspace/read-model/extensions/actual-helpers.js +4 -0
- package/dist/src/workspace/read-model/extensions/hook.d.ts +104 -0
- package/dist/src/workspace/read-model/extensions/hook.js +119 -0
- package/dist/src/workspace/read-model/extensions/index.d.ts +19 -0
- package/dist/src/workspace/read-model/extensions/index.js +43 -0
- package/dist/src/workspace/read-model/extensions/indexByName.d.ts +31 -0
- package/dist/src/workspace/read-model/extensions/indexByName.js +30 -0
- package/dist/src/workspace/read-model/extensions/inventory.d.ts +99 -0
- package/dist/src/workspace/read-model/extensions/inventory.js +111 -0
- package/dist/src/workspace/read-model/extensions/knowledge.d.ts +101 -0
- package/dist/src/workspace/read-model/extensions/knowledge.js +121 -0
- package/dist/src/workspace/read-model/extensions/mcp-server.d.ts +106 -0
- package/dist/src/workspace/read-model/extensions/mcp-server.js +122 -0
- package/dist/src/workspace/read-model/extensions/pack.d.ts +104 -0
- package/dist/src/workspace/read-model/extensions/pack.js +123 -0
- package/dist/src/workspace/read-model/extensions/package-root.d.ts +39 -0
- package/dist/src/workspace/read-model/extensions/package-root.js +48 -0
- package/dist/src/workspace/read-model/extensions/projection.d.ts +137 -0
- package/dist/src/workspace/read-model/extensions/projection.js +180 -0
- package/dist/src/workspace/read-model/extensions/rule.d.ts +104 -0
- package/dist/src/workspace/read-model/extensions/rule.js +113 -0
- package/dist/src/workspace/read-model/extensions/skill.d.ts +170 -0
- package/dist/src/workspace/read-model/extensions/skill.js +148 -0
- package/dist/src/workspace/read-model/extensions/subagent.d.ts +97 -0
- package/dist/src/workspace/read-model/extensions/subagent.js +120 -0
- package/dist/src/workspace/read-model/scanners/agent-dir.d.ts +49 -0
- package/dist/src/workspace/read-model/scanners/agent-dir.js +180 -0
- package/dist/src/workspace/read-model/scanners/agent-root.d.ts +73 -0
- package/dist/src/workspace/read-model/scanners/agent-root.js +148 -0
- package/dist/src/workspace/read-model/scanners/agent-settings.d.ts +43 -0
- package/dist/src/workspace/read-model/scanners/agent-settings.js +54 -0
- package/dist/src/workspace/read-model/scanners/canonical-extensions.d.ts +48 -0
- package/dist/src/workspace/read-model/scanners/canonical-extensions.js +237 -0
- package/dist/src/workspace/read-model/scanners/fs-helpers.d.ts +63 -0
- package/dist/src/workspace/read-model/scanners/fs-helpers.js +106 -0
- package/dist/src/workspace/read-model/scanners/index.d.ts +15 -0
- package/dist/src/workspace/read-model/scanners/index.js +34 -0
- package/dist/src/workspace/read-model/scanners/mcp-config.d.ts +47 -0
- package/dist/src/workspace/read-model/scanners/mcp-config.js +212 -0
- package/dist/src/workspace/read-model/scanners/types.d.ts +170 -0
- package/dist/src/workspace/read-model/scanners/types.js +86 -0
- package/dist/src/workspace/read-model/service.d.ts +103 -0
- package/dist/src/workspace/read-model/service.js +391 -0
- package/dist/src/workspace/read-model/state.d.ts +35 -0
- package/dist/src/workspace/read-model/state.js +97 -0
- package/dist/src/workspace/read-model/types.d.ts +75 -0
- package/dist/src/workspace/read-model/types.js +26 -0
- package/dist/src/workspace/read-model-record-readers.d.ts +34 -0
- package/dist/src/workspace/read-model-record-readers.js +467 -0
- package/dist/src/workspace/read-model-record-rows.d.ts +45 -0
- package/dist/src/workspace/read-model-record-rows.js +33 -0
- package/dist/src/workspace/read-model-record-types.d.ts +45 -0
- package/dist/src/workspace/read-model-record-types.js +13 -0
- package/dist/src/workspace/remove-if-exists.d.ts +13 -0
- package/dist/src/workspace/remove-if-exists.js +26 -0
- package/dist/src/workspace/rendered-files.d.ts +53 -0
- package/dist/src/workspace/rendered-files.js +50 -0
- package/dist/src/workspace/scope-refusal.d.ts +26 -0
- package/dist/src/workspace/scope-refusal.js +29 -0
- package/dist/src/workspace/service-interface.d.ts +479 -0
- package/dist/src/workspace/service-interface.js +27 -0
- package/dist/src/workspace/service.d.ts +1665 -0
- package/dist/src/workspace/service.js +1263 -0
- package/dist/src/workspace/setup-scope-support.d.ts +27 -0
- package/dist/src/workspace/setup-scope-support.js +299 -0
- package/dist/src/workspace/skill-paths.d.ts +33 -0
- package/dist/src/workspace/skill-paths.js +14 -0
- package/dist/src/workspace/source-metadata.d.ts +7 -0
- package/dist/src/workspace/source-metadata.js +10 -0
- package/dist/src/workspace/source-to-lock-entry.d.ts +32 -0
- package/dist/src/workspace/source-to-lock-entry.js +68 -0
- package/dist/src/workspace/test-stubs.d.ts +144 -0
- package/dist/src/workspace/test-stubs.js +412 -0
- package/dist/src/workspace/transaction.d.ts +218 -0
- package/dist/src/workspace/transaction.js +177 -0
- package/package.json +57 -0
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reconstruct extension refs from lockfile entries.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
import { pathToFileURL } from "node:url";
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Option from "effect/Option";
|
|
10
|
+
import { LockEntryEndpointConflict, LockEntryNameInvalid, LockEntrySourceMissing, LockEntrySourceTypeConflict, LockEntryUrlInvalid, } from "./errors.js";
|
|
11
|
+
import { decodeExtensionNameSync, } from "@agentxm/extension-model/unstable/extensions";
|
|
12
|
+
const fileHref = (path) => pathToFileURL(path).href;
|
|
13
|
+
const localLockEntryPath = (deps, entryPath) => deps.path.resolve(deps.baseDir, entryPath);
|
|
14
|
+
const missingSource = (entryType, sourceName) => new LockEntrySourceMissing({ entryType, sourceName });
|
|
15
|
+
const invalidUrl = (value) => new LockEntryUrlInvalid({ value });
|
|
16
|
+
const invalidName = (name) => new LockEntryNameInvalid({ name });
|
|
17
|
+
const decodeLockEntryName = (name) => Effect.try({
|
|
18
|
+
try: () => decodeExtensionNameSync(name),
|
|
19
|
+
catch: () => invalidName(name),
|
|
20
|
+
});
|
|
21
|
+
const hasSourceType = (sourceType) => (source) => source.type === sourceType;
|
|
22
|
+
const registrySourceFromEntry = (entry, getSourceByName) => Effect.gen(function* () {
|
|
23
|
+
const configured = yield* getSourceByName(entry.sourceName);
|
|
24
|
+
if (Option.isNone(configured) || configured.value.type !== "registry") {
|
|
25
|
+
return yield* missingSource("registry", entry.sourceName);
|
|
26
|
+
}
|
|
27
|
+
if (configured.value.location.href !== entry.endpoint.href) {
|
|
28
|
+
return yield* new LockEntryEndpointConflict({
|
|
29
|
+
sourceKind: "Registry",
|
|
30
|
+
sourceName: entry.sourceName,
|
|
31
|
+
acceptedEndpoint: entry.endpoint.href,
|
|
32
|
+
resolvedEndpoint: configured.value.location.href,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
type: "registry",
|
|
37
|
+
name: configured.value.name,
|
|
38
|
+
location: entry.endpoint,
|
|
39
|
+
owner: Option.some(entry.owner),
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
function findSourceConfig(sourceType, sourceName, endpoint, getSourceByName) {
|
|
43
|
+
return Effect.gen(function* () {
|
|
44
|
+
const configured = yield* getSourceByName(sourceName);
|
|
45
|
+
if (Option.isNone(configured) || !hasSourceType(sourceType)(configured.value)) {
|
|
46
|
+
return yield* new LockEntrySourceTypeConflict({
|
|
47
|
+
sourceKind: sourceType,
|
|
48
|
+
sourceName,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (configured.value.url.href !== endpoint.href) {
|
|
52
|
+
return yield* new LockEntryEndpointConflict({
|
|
53
|
+
sourceKind: sourceType,
|
|
54
|
+
sourceName,
|
|
55
|
+
acceptedEndpoint: endpoint.href,
|
|
56
|
+
resolvedEndpoint: configured.value.url.href,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return configured.value;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const gitBasedSourceFromEntry = (entry, getSourceByName) => {
|
|
63
|
+
switch (entry.type) {
|
|
64
|
+
case "github":
|
|
65
|
+
return Effect.map(findSourceConfig("github", entry.sourceName, entry.endpoint, getSourceByName), (source) => ({
|
|
66
|
+
type: "github",
|
|
67
|
+
name: source.name,
|
|
68
|
+
url: source.url,
|
|
69
|
+
owner: entry.owner,
|
|
70
|
+
repo: entry.repo,
|
|
71
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
72
|
+
subPath: Option.fromUndefinedOr(entry.path),
|
|
73
|
+
}));
|
|
74
|
+
case "gitlab":
|
|
75
|
+
return Effect.map(findSourceConfig("gitlab", entry.sourceName, entry.endpoint, getSourceByName), (source) => ({
|
|
76
|
+
type: "gitlab",
|
|
77
|
+
name: source.name,
|
|
78
|
+
url: source.url,
|
|
79
|
+
owner: entry.owner,
|
|
80
|
+
repo: entry.repo,
|
|
81
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
82
|
+
subPath: Option.fromUndefinedOr(entry.path),
|
|
83
|
+
}));
|
|
84
|
+
case "bitbucket":
|
|
85
|
+
return Effect.map(findSourceConfig("bitbucket", entry.sourceName, entry.endpoint, getSourceByName), (source) => ({
|
|
86
|
+
type: "bitbucket",
|
|
87
|
+
name: source.name,
|
|
88
|
+
url: source.url,
|
|
89
|
+
owner: entry.owner,
|
|
90
|
+
repo: entry.repo,
|
|
91
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
92
|
+
subPath: Option.fromUndefinedOr(entry.path),
|
|
93
|
+
}));
|
|
94
|
+
case "azurerepos":
|
|
95
|
+
return Effect.map(findSourceConfig("azurerepos", entry.sourceName, entry.endpoint, getSourceByName), (source) => ({
|
|
96
|
+
type: "azurerepos",
|
|
97
|
+
name: source.name,
|
|
98
|
+
url: source.url,
|
|
99
|
+
organization: entry.organization,
|
|
100
|
+
project: entry.project,
|
|
101
|
+
repo: entry.repo,
|
|
102
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
103
|
+
subPath: Option.fromUndefinedOr(entry.path),
|
|
104
|
+
}));
|
|
105
|
+
case "git":
|
|
106
|
+
return Effect.map(Effect.try({
|
|
107
|
+
try: () => new URL(entry.url),
|
|
108
|
+
catch: () => invalidUrl(entry.url),
|
|
109
|
+
}), (url) => ({
|
|
110
|
+
type: "git",
|
|
111
|
+
url,
|
|
112
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const lockEntryLocation = (deps, entry) => {
|
|
117
|
+
const root = deps.scope === "project"
|
|
118
|
+
? `${deps.baseDir}/agent_extensions`
|
|
119
|
+
: `${deps.baseDir}/.axm/workspace/agent_extensions`;
|
|
120
|
+
const selected = entry.path === undefined ? "" : `/${entry.path}`;
|
|
121
|
+
switch (entry.type) {
|
|
122
|
+
case "github":
|
|
123
|
+
case "gitlab":
|
|
124
|
+
case "bitbucket":
|
|
125
|
+
return fileHref(`${root}/${entry.sourceName}/${entry.owner}/${entry.repo}${selected}`);
|
|
126
|
+
case "azurerepos":
|
|
127
|
+
return fileHref(`${root}/${entry.sourceName}/${entry.organization}/${entry.project}/${entry.repo}${selected}`);
|
|
128
|
+
case "git": {
|
|
129
|
+
const url = new URL(entry.url);
|
|
130
|
+
const repository = url.pathname.replace(/^\/+|\/+$/gu, "").replace(/\.git$/u, "");
|
|
131
|
+
return fileHref(`${root}/git/${url.hostname}/${repository}${selected}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
export const skillLockEntryToRef = (name, entry, deps) => Effect.flatMap(decodeLockEntryName(name), (extensionName) => {
|
|
136
|
+
switch (entry.type) {
|
|
137
|
+
case "registry":
|
|
138
|
+
return Effect.map(registrySourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
139
|
+
type: "skill",
|
|
140
|
+
refType: "registry",
|
|
141
|
+
source,
|
|
142
|
+
owner: entry.owner,
|
|
143
|
+
publisherBindingId: entry.publisherBindingId,
|
|
144
|
+
name: entry.name,
|
|
145
|
+
version: entry.resolvedVersion,
|
|
146
|
+
integrity: entry.integrity.length > 0 ? Option.some(entry.integrity) : Option.none(),
|
|
147
|
+
packages: [],
|
|
148
|
+
skill: { name: extensionName, description: Option.none(), metadata: Option.none() },
|
|
149
|
+
}));
|
|
150
|
+
case "local": {
|
|
151
|
+
const skillSourcePath = localLockEntryPath(deps, entry.path);
|
|
152
|
+
return Effect.succeed({
|
|
153
|
+
type: "skill",
|
|
154
|
+
refType: "local",
|
|
155
|
+
...(entry.packageOwner === undefined ? {} : { owner: entry.packageOwner }),
|
|
156
|
+
name: entry.packageName,
|
|
157
|
+
source: { type: "local", path: skillSourcePath },
|
|
158
|
+
location: fileHref(skillSourcePath),
|
|
159
|
+
sourcePath: entry.path,
|
|
160
|
+
portable: entry.packageFormat === "agent-skill",
|
|
161
|
+
skill: { name: extensionName, description: Option.none(), metadata: Option.none() },
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
case "github":
|
|
165
|
+
case "gitlab":
|
|
166
|
+
case "bitbucket":
|
|
167
|
+
case "azurerepos":
|
|
168
|
+
case "git":
|
|
169
|
+
return Effect.map(gitBasedSourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
170
|
+
type: "skill",
|
|
171
|
+
refType: "git-hosted",
|
|
172
|
+
...(entry.packageOwner === undefined ? {} : { owner: entry.packageOwner }),
|
|
173
|
+
name: entry.packageName,
|
|
174
|
+
source,
|
|
175
|
+
...(entry.path === undefined ? {} : { sourcePath: entry.path }),
|
|
176
|
+
portable: entry.packageFormat === "agent-skill",
|
|
177
|
+
location: lockEntryLocation(deps, entry),
|
|
178
|
+
gitTreeSha: entry.resolvedTree,
|
|
179
|
+
gitCommitSha: entry.resolvedCommit,
|
|
180
|
+
skill: { name: extensionName, description: Option.none(), metadata: Option.none() },
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
export const mcpServerLockEntryToRef = (name, entry, deps) => Effect.flatMap(decodeLockEntryName(name), (extensionName) => {
|
|
185
|
+
switch (entry.type) {
|
|
186
|
+
case "registry":
|
|
187
|
+
return Effect.map(registrySourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
188
|
+
type: "mcp-server",
|
|
189
|
+
refType: "registry",
|
|
190
|
+
source,
|
|
191
|
+
owner: entry.owner,
|
|
192
|
+
publisherBindingId: entry.publisherBindingId,
|
|
193
|
+
name: entry.name,
|
|
194
|
+
version: entry.resolvedVersion,
|
|
195
|
+
integrity: entry.integrity.length > 0 ? Option.some(entry.integrity) : Option.none(),
|
|
196
|
+
packages: [],
|
|
197
|
+
server: { name: extensionName },
|
|
198
|
+
}));
|
|
199
|
+
case "local": {
|
|
200
|
+
const mcpServerSourcePath = localLockEntryPath(deps, entry.path);
|
|
201
|
+
return Effect.succeed({
|
|
202
|
+
type: "mcp-server",
|
|
203
|
+
refType: "local",
|
|
204
|
+
owner: entry.packageOwner,
|
|
205
|
+
name: entry.packageName,
|
|
206
|
+
source: { type: "local", path: mcpServerSourcePath },
|
|
207
|
+
location: fileHref(mcpServerSourcePath),
|
|
208
|
+
sourcePath: entry.path,
|
|
209
|
+
server: { name: extensionName },
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
case "github":
|
|
213
|
+
case "gitlab":
|
|
214
|
+
case "bitbucket":
|
|
215
|
+
case "azurerepos":
|
|
216
|
+
case "git":
|
|
217
|
+
return Effect.map(gitBasedSourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
218
|
+
type: "mcp-server",
|
|
219
|
+
refType: "git-hosted",
|
|
220
|
+
owner: entry.packageOwner,
|
|
221
|
+
name: entry.packageName,
|
|
222
|
+
source,
|
|
223
|
+
...(entry.path === undefined ? {} : { sourcePath: entry.path }),
|
|
224
|
+
location: lockEntryLocation(deps, entry),
|
|
225
|
+
gitTreeSha: entry.resolvedTree,
|
|
226
|
+
gitCommitSha: entry.resolvedCommit,
|
|
227
|
+
server: { name: extensionName },
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
export const subagentLockEntryToRef = (name, entry, deps) => Effect.flatMap(decodeLockEntryName(name), (extensionName) => {
|
|
232
|
+
switch (entry.type) {
|
|
233
|
+
case "registry":
|
|
234
|
+
return Effect.map(registrySourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
235
|
+
type: "subagent",
|
|
236
|
+
refType: "registry",
|
|
237
|
+
source,
|
|
238
|
+
owner: entry.owner,
|
|
239
|
+
publisherBindingId: entry.publisherBindingId,
|
|
240
|
+
name: entry.name,
|
|
241
|
+
version: entry.resolvedVersion,
|
|
242
|
+
integrity: entry.integrity.length > 0 ? Option.some(entry.integrity) : Option.none(),
|
|
243
|
+
packages: [],
|
|
244
|
+
subagent: { name: extensionName, description: Option.none() },
|
|
245
|
+
}));
|
|
246
|
+
case "local": {
|
|
247
|
+
const subagentSourcePath = localLockEntryPath(deps, entry.path);
|
|
248
|
+
return Effect.succeed({
|
|
249
|
+
type: "subagent",
|
|
250
|
+
refType: "local",
|
|
251
|
+
owner: entry.packageOwner,
|
|
252
|
+
name: entry.packageName,
|
|
253
|
+
source: { type: "local", path: subagentSourcePath },
|
|
254
|
+
location: fileHref(subagentSourcePath),
|
|
255
|
+
sourcePath: entry.path,
|
|
256
|
+
subagent: { name: extensionName, description: Option.none() },
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
case "github":
|
|
260
|
+
case "gitlab":
|
|
261
|
+
case "bitbucket":
|
|
262
|
+
case "azurerepos":
|
|
263
|
+
case "git":
|
|
264
|
+
return Effect.map(gitBasedSourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
265
|
+
type: "subagent",
|
|
266
|
+
refType: "git-hosted",
|
|
267
|
+
owner: entry.packageOwner,
|
|
268
|
+
name: entry.packageName,
|
|
269
|
+
source,
|
|
270
|
+
...(entry.path === undefined ? {} : { sourcePath: entry.path }),
|
|
271
|
+
location: lockEntryLocation(deps, entry),
|
|
272
|
+
gitTreeSha: entry.resolvedTree,
|
|
273
|
+
gitCommitSha: entry.resolvedCommit,
|
|
274
|
+
subagent: { name: extensionName, description: Option.none() },
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
export const ruleLockEntryToRef = (name, entry, deps) => Effect.flatMap(decodeLockEntryName(name), (extensionName) => {
|
|
279
|
+
switch (entry.type) {
|
|
280
|
+
case "registry":
|
|
281
|
+
return Effect.map(registrySourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
282
|
+
type: "rule",
|
|
283
|
+
refType: "registry",
|
|
284
|
+
source,
|
|
285
|
+
owner: entry.owner,
|
|
286
|
+
publisherBindingId: entry.publisherBindingId,
|
|
287
|
+
name: entry.name,
|
|
288
|
+
version: entry.resolvedVersion,
|
|
289
|
+
integrity: entry.integrity.length > 0 ? Option.some(entry.integrity) : Option.none(),
|
|
290
|
+
packages: [],
|
|
291
|
+
rule: { name: extensionName },
|
|
292
|
+
}));
|
|
293
|
+
case "local": {
|
|
294
|
+
const sourcePath = localLockEntryPath(deps, entry.path);
|
|
295
|
+
return Effect.succeed({
|
|
296
|
+
type: "rule",
|
|
297
|
+
refType: "local",
|
|
298
|
+
owner: entry.packageOwner,
|
|
299
|
+
name: entry.packageName,
|
|
300
|
+
source: { type: "local", path: sourcePath },
|
|
301
|
+
location: fileHref(sourcePath),
|
|
302
|
+
sourcePath: entry.path,
|
|
303
|
+
rule: { name: extensionName },
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
case "github":
|
|
307
|
+
case "gitlab":
|
|
308
|
+
case "bitbucket":
|
|
309
|
+
case "azurerepos":
|
|
310
|
+
case "git":
|
|
311
|
+
return Effect.map(gitBasedSourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
312
|
+
type: "rule",
|
|
313
|
+
refType: "git-hosted",
|
|
314
|
+
owner: entry.packageOwner,
|
|
315
|
+
name: entry.packageName,
|
|
316
|
+
source,
|
|
317
|
+
...(entry.path === undefined ? {} : { sourcePath: entry.path }),
|
|
318
|
+
location: lockEntryLocation(deps, entry),
|
|
319
|
+
gitTreeSha: entry.resolvedTree,
|
|
320
|
+
gitCommitSha: entry.resolvedCommit,
|
|
321
|
+
rule: { name: extensionName },
|
|
322
|
+
}));
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
export const hookLockEntryToRef = (name, entry, deps) => Effect.flatMap(decodeLockEntryName(name), (extensionName) => {
|
|
326
|
+
switch (entry.type) {
|
|
327
|
+
case "registry":
|
|
328
|
+
return Effect.map(registrySourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
329
|
+
type: "hook",
|
|
330
|
+
refType: "registry",
|
|
331
|
+
source,
|
|
332
|
+
owner: entry.owner,
|
|
333
|
+
publisherBindingId: entry.publisherBindingId,
|
|
334
|
+
name: entry.name,
|
|
335
|
+
version: entry.resolvedVersion,
|
|
336
|
+
integrity: entry.integrity.length > 0 ? Option.some(entry.integrity) : Option.none(),
|
|
337
|
+
packages: [],
|
|
338
|
+
hook: { name: extensionName },
|
|
339
|
+
}));
|
|
340
|
+
case "local": {
|
|
341
|
+
const sourcePath = localLockEntryPath(deps, entry.path);
|
|
342
|
+
return Effect.succeed({
|
|
343
|
+
type: "hook",
|
|
344
|
+
refType: "local",
|
|
345
|
+
owner: entry.packageOwner,
|
|
346
|
+
name: entry.packageName,
|
|
347
|
+
source: { type: "local", path: sourcePath },
|
|
348
|
+
location: fileHref(sourcePath),
|
|
349
|
+
sourcePath: entry.path,
|
|
350
|
+
hook: { name: extensionName },
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
case "github":
|
|
354
|
+
case "gitlab":
|
|
355
|
+
case "bitbucket":
|
|
356
|
+
case "azurerepos":
|
|
357
|
+
case "git":
|
|
358
|
+
return Effect.map(gitBasedSourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
359
|
+
type: "hook",
|
|
360
|
+
refType: "git-hosted",
|
|
361
|
+
owner: entry.packageOwner,
|
|
362
|
+
name: entry.packageName,
|
|
363
|
+
source,
|
|
364
|
+
...(entry.path === undefined ? {} : { sourcePath: entry.path }),
|
|
365
|
+
location: lockEntryLocation(deps, entry),
|
|
366
|
+
gitTreeSha: entry.resolvedTree,
|
|
367
|
+
gitCommitSha: entry.resolvedCommit,
|
|
368
|
+
hook: { name: extensionName },
|
|
369
|
+
}));
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
export const knowledgeLockEntryToRef = (name, entry, deps) => Effect.flatMap(decodeLockEntryName(name), (extensionName) => {
|
|
373
|
+
switch (entry.type) {
|
|
374
|
+
case "registry":
|
|
375
|
+
return Effect.map(registrySourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
376
|
+
type: "knowledge",
|
|
377
|
+
refType: "registry",
|
|
378
|
+
source,
|
|
379
|
+
owner: entry.owner,
|
|
380
|
+
publisherBindingId: entry.publisherBindingId,
|
|
381
|
+
name: entry.name,
|
|
382
|
+
version: entry.resolvedVersion,
|
|
383
|
+
integrity: entry.integrity.length > 0 ? Option.some(entry.integrity) : Option.none(),
|
|
384
|
+
packages: [],
|
|
385
|
+
knowledge: { name: extensionName },
|
|
386
|
+
}));
|
|
387
|
+
case "local": {
|
|
388
|
+
const sourcePath = localLockEntryPath(deps, entry.path);
|
|
389
|
+
return Effect.succeed({
|
|
390
|
+
type: "knowledge",
|
|
391
|
+
refType: "local",
|
|
392
|
+
owner: entry.packageOwner,
|
|
393
|
+
name: entry.packageName,
|
|
394
|
+
source: { type: "local", path: sourcePath },
|
|
395
|
+
location: fileHref(sourcePath),
|
|
396
|
+
sourcePath: entry.path,
|
|
397
|
+
knowledge: { name: extensionName },
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
case "github":
|
|
401
|
+
case "gitlab":
|
|
402
|
+
case "bitbucket":
|
|
403
|
+
case "azurerepos":
|
|
404
|
+
case "git":
|
|
405
|
+
return Effect.map(gitBasedSourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
406
|
+
type: "knowledge",
|
|
407
|
+
refType: "git-hosted",
|
|
408
|
+
owner: entry.packageOwner,
|
|
409
|
+
name: entry.packageName,
|
|
410
|
+
source,
|
|
411
|
+
...(entry.path === undefined ? {} : { sourcePath: entry.path }),
|
|
412
|
+
location: lockEntryLocation(deps, entry),
|
|
413
|
+
gitTreeSha: entry.resolvedTree,
|
|
414
|
+
gitCommitSha: entry.resolvedCommit,
|
|
415
|
+
knowledge: { name: extensionName },
|
|
416
|
+
}));
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
export const packLockEntryToRef = (name, entry, deps) => Effect.flatMap(decodeLockEntryName(name), (extensionName) => {
|
|
420
|
+
return Effect.map(registrySourceFromEntry(entry, deps.getConfiguredSourceByName), (source) => ({
|
|
421
|
+
type: "pack",
|
|
422
|
+
refType: "registry",
|
|
423
|
+
source,
|
|
424
|
+
owner: entry.owner,
|
|
425
|
+
publisherBindingId: entry.publisherBindingId,
|
|
426
|
+
name: entry.name,
|
|
427
|
+
version: entry.resolvedVersion,
|
|
428
|
+
integrity: entry.integrity.length > 0 ? Option.some(entry.integrity) : Option.none(),
|
|
429
|
+
packages: [],
|
|
430
|
+
pack: { name: extensionName, dependencies: {} },
|
|
431
|
+
}));
|
|
432
|
+
});
|
|
433
|
+
//# sourceMappingURL=lock-entry-to-ref.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lock entry to source-params conversion and lock-locator printing.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
import type { McpServerLockEntry, PackLockEntry, HookLockEntry, KnowledgeLockEntry, RuleLockEntry, SkillLockEntry, SubagentLockEntry } from "../lockfile/schema.js";
|
|
8
|
+
import type { SourceParams } from "@agentxm/extension-model/unstable/sources/types";
|
|
9
|
+
type SourceLockEntry = SkillLockEntry | McpServerLockEntry | RuleLockEntry | HookLockEntry | KnowledgeLockEntry | SubagentLockEntry | PackLockEntry;
|
|
10
|
+
/**
|
|
11
|
+
* Convert a skill lock entry back to a SourceParams.
|
|
12
|
+
* Inverse of sourceToLockEntry (lock entry optional fields -> Option).
|
|
13
|
+
*
|
|
14
|
+
* @experimental This API is unstable and may change without notice.
|
|
15
|
+
*/
|
|
16
|
+
export declare const lockEntryToSourceParams: (entry: SourceLockEntry) => SourceParams;
|
|
17
|
+
/**
|
|
18
|
+
* Print the exact source locator represented by an accepted Skill resolution.
|
|
19
|
+
* Registry rows include their immutable identity and resolved version; other
|
|
20
|
+
* rows round-trip through their source-specific shorthand.
|
|
21
|
+
*
|
|
22
|
+
* @experimental This API is unstable and may change without notice.
|
|
23
|
+
*/
|
|
24
|
+
export declare const printSkillLockSourceLocator: (_lockName: string, entry: SkillLockEntry) => string;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=lock-entry-to-source-params.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lock entry to source-params conversion and lock-locator printing.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
import * as Option from "effect/Option";
|
|
8
|
+
import { formatFqn } from "@agentxm/extension-model/unstable/extensions";
|
|
9
|
+
import { printSourceParams } from "@agentxm/extension-model/unstable/sources/printer";
|
|
10
|
+
/**
|
|
11
|
+
* Convert a skill lock entry back to a SourceParams.
|
|
12
|
+
* Inverse of sourceToLockEntry (lock entry optional fields -> Option).
|
|
13
|
+
*
|
|
14
|
+
* @experimental This API is unstable and may change without notice.
|
|
15
|
+
*/
|
|
16
|
+
export const lockEntryToSourceParams = (entry) => {
|
|
17
|
+
switch (entry.type) {
|
|
18
|
+
case "github":
|
|
19
|
+
return {
|
|
20
|
+
type: "github",
|
|
21
|
+
sourceName: entry.sourceName,
|
|
22
|
+
owner: entry.owner,
|
|
23
|
+
repo: entry.repo,
|
|
24
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
25
|
+
subPath: Option.fromUndefinedOr(entry.path),
|
|
26
|
+
};
|
|
27
|
+
case "gitlab":
|
|
28
|
+
return {
|
|
29
|
+
type: "gitlab",
|
|
30
|
+
sourceName: entry.sourceName,
|
|
31
|
+
owner: entry.owner,
|
|
32
|
+
repo: entry.repo,
|
|
33
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
34
|
+
subPath: Option.fromUndefinedOr(entry.path),
|
|
35
|
+
};
|
|
36
|
+
case "bitbucket":
|
|
37
|
+
return {
|
|
38
|
+
type: "bitbucket",
|
|
39
|
+
sourceName: entry.sourceName,
|
|
40
|
+
owner: entry.owner,
|
|
41
|
+
repo: entry.repo,
|
|
42
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
43
|
+
subPath: Option.fromUndefinedOr(entry.path),
|
|
44
|
+
};
|
|
45
|
+
case "azurerepos":
|
|
46
|
+
return {
|
|
47
|
+
type: "azurerepos",
|
|
48
|
+
sourceName: entry.sourceName,
|
|
49
|
+
organization: entry.organization,
|
|
50
|
+
project: entry.project,
|
|
51
|
+
repo: entry.repo,
|
|
52
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
53
|
+
subPath: Option.fromUndefinedOr(entry.path),
|
|
54
|
+
};
|
|
55
|
+
case "git":
|
|
56
|
+
return {
|
|
57
|
+
type: "git",
|
|
58
|
+
url: new URL(entry.url),
|
|
59
|
+
ref: Option.fromUndefinedOr(entry.ref),
|
|
60
|
+
};
|
|
61
|
+
case "local":
|
|
62
|
+
return { type: "local", path: entry.path };
|
|
63
|
+
case "registry":
|
|
64
|
+
return {
|
|
65
|
+
type: "registry",
|
|
66
|
+
sourceName: entry.sourceName,
|
|
67
|
+
owner: Option.none(),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Print the exact source locator represented by an accepted Skill resolution.
|
|
73
|
+
* Registry rows include their immutable identity and resolved version; other
|
|
74
|
+
* rows round-trip through their source-specific shorthand.
|
|
75
|
+
*
|
|
76
|
+
* @experimental This API is unstable and may change without notice.
|
|
77
|
+
*/
|
|
78
|
+
export const printSkillLockSourceLocator = (_lockName, entry) => entry.type === "registry"
|
|
79
|
+
? `${entry.sourceName}:${formatFqn({ owner: entry.owner, type: "skill", name: entry.name })}@${entry.resolvedVersion}`
|
|
80
|
+
: printSourceParams(lockEntryToSourceParams(entry));
|
|
81
|
+
//# sourceMappingURL=lock-entry-to-source-params.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-type lockfile reads, keyed by catalog extension type.
|
|
3
|
+
*
|
|
4
|
+
* `WorkspaceMutationsService` exposes one `getLockedX()` accessor per type. The
|
|
5
|
+
* table here is the single place that maps a type id onto its accessor, so
|
|
6
|
+
* callers that work over the whole catalog — installed-identifier resolution,
|
|
7
|
+
* `<type> show` — stay total without a switch of their own.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is unstable and may change without notice.
|
|
10
|
+
*/
|
|
11
|
+
import type * as Effect from "effect/Effect";
|
|
12
|
+
import type { CatalogExtensionType } from "@agentxm/extension-model/unstable/extension-types/schema";
|
|
13
|
+
import type { HookLockEntry, KnowledgeLockEntry, KnowledgeLockMap, McpServerLockEntry, RuleLockEntry, SkillLockEntry, SubagentLockEntry } from "../lockfile/index.js";
|
|
14
|
+
import type { WorkspaceLockfileReadFailure, WorkspaceMutationsService } from "./service-interface.js";
|
|
15
|
+
/**
|
|
16
|
+
* Any per-type lock entry. Every arm of every lock union comes from the same
|
|
17
|
+
* factory, so narrowing to `type === "registry"` yields `owner`, `name`, and
|
|
18
|
+
* `resolvedVersion` uniformly no matter which type produced the entry.
|
|
19
|
+
*/
|
|
20
|
+
export type AnyLockEntry = SkillLockEntry | SubagentLockEntry | McpServerLockEntry | RuleLockEntry | HookLockEntry | KnowledgeLockEntry;
|
|
21
|
+
export type AnyLockMap = {
|
|
22
|
+
readonly [name: string]: AnyLockEntry;
|
|
23
|
+
};
|
|
24
|
+
/** Read the whole lock map for one catalog extension type. */
|
|
25
|
+
export declare const getLockedEntries: (ws: WorkspaceMutationsService, type: CatalogExtensionType) => Effect.Effect<AnyLockMap, WorkspaceLockfileReadFailure>;
|
|
26
|
+
/** Read accepted external Knowledge resolutions from the workspace lockfile. */
|
|
27
|
+
export declare const getKnowledgeLockEntries: (ws: WorkspaceMutationsService) => Effect.Effect<KnowledgeLockMap, WorkspaceLockfileReadFailure>;
|
|
28
|
+
/** Resolved version for a lock entry, when its source arm carries one. */
|
|
29
|
+
export declare const lockEntryVersion: (entry: AnyLockEntry) => string | null;
|
|
30
|
+
//# sourceMappingURL=locked-entries.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-type lockfile reads, keyed by catalog extension type.
|
|
3
|
+
*
|
|
4
|
+
* `WorkspaceMutationsService` exposes one `getLockedX()` accessor per type. The
|
|
5
|
+
* table here is the single place that maps a type id onto its accessor, so
|
|
6
|
+
* callers that work over the whole catalog — installed-identifier resolution,
|
|
7
|
+
* `<type> show` — stay total without a switch of their own.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is unstable and may change without notice.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The `satisfies Record<CatalogExtensionType, …>` is load-bearing: a new
|
|
13
|
+
* catalog type fails compile here until it is wired, instead of silently
|
|
14
|
+
* resolving to an empty lock map.
|
|
15
|
+
*/
|
|
16
|
+
const lockedEntryReaders = {
|
|
17
|
+
skill: (ws) => ws.getLockedSkills(),
|
|
18
|
+
"mcp-server": (ws) => ws.getLockedMcpServers(),
|
|
19
|
+
subagent: (ws) => ws.getLockedSubagents(),
|
|
20
|
+
rule: (ws) => ws.getLockedRules(),
|
|
21
|
+
hook: (ws) => ws.getLockedHooks(),
|
|
22
|
+
knowledge: (ws) => ws.getLockedKnowledge(),
|
|
23
|
+
};
|
|
24
|
+
/** Read the whole lock map for one catalog extension type. */
|
|
25
|
+
export const getLockedEntries = (ws, type) => lockedEntryReaders[type](ws);
|
|
26
|
+
/** Read accepted external Knowledge resolutions from the workspace lockfile. */
|
|
27
|
+
export const getKnowledgeLockEntries = (ws) => ws.getLockedKnowledge();
|
|
28
|
+
/** Resolved version for a lock entry, when its source arm carries one. */
|
|
29
|
+
export const lockEntryVersion = (entry) => {
|
|
30
|
+
if (entry.type === "registry")
|
|
31
|
+
return entry.resolvedVersion;
|
|
32
|
+
return null;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=locked-entries.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
/**
|
|
3
|
+
* Ephemeral result of one Rule or Hook projection reconciliation. This is the
|
|
4
|
+
* extensibility axis for placement and materialization mode; grammar-level
|
|
5
|
+
* changes belong to the managed-file ownership contract referenced by
|
|
6
|
+
* `projection/marker-grammar.ts`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MaterializedFileTargetSchema: Schema.Struct<{
|
|
9
|
+
readonly target: Schema.brand<Schema.String, "RelativePath">;
|
|
10
|
+
readonly mode: Schema.Literals<readonly ["sync-once", "sync-always", "managed-region"]>;
|
|
11
|
+
readonly region: Schema.optional<Schema.NonEmptyString>;
|
|
12
|
+
}>;
|
|
13
|
+
export type MaterializedFileTarget = typeof MaterializedFileTargetSchema.Type;
|
|
14
|
+
//# sourceMappingURL=materialized-file-target.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import { RelativePathSchema } from "@agentxm/extension-model/unstable/path-types";
|
|
3
|
+
/**
|
|
4
|
+
* Ephemeral result of one Rule or Hook projection reconciliation. This is the
|
|
5
|
+
* extensibility axis for placement and materialization mode; grammar-level
|
|
6
|
+
* changes belong to the managed-file ownership contract referenced by
|
|
7
|
+
* `projection/marker-grammar.ts`.
|
|
8
|
+
*/
|
|
9
|
+
export const MaterializedFileTargetSchema = Schema.Struct({
|
|
10
|
+
target: RelativePathSchema,
|
|
11
|
+
mode: Schema.Literals(["sync-once", "sync-always", "managed-region"]),
|
|
12
|
+
region: Schema.optional(Schema.NonEmptyString),
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=materialized-file-target.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as FileSystem from "effect/FileSystem";
|
|
3
|
+
import * as Path from "effect/Path";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
export declare const TreeIntegritySchema: Schema.brand<Schema.String, "TreeIntegrity">;
|
|
6
|
+
export type TreeIntegrity = Schema.Schema.Type<typeof TreeIntegritySchema>;
|
|
7
|
+
declare const MaterializedTreeInvalid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
8
|
+
readonly _tag: "MaterializedTreeInvalid";
|
|
9
|
+
} & Readonly<A>;
|
|
10
|
+
/**
|
|
11
|
+
* A materialized package tree failed strict integrity walking: unreadable,
|
|
12
|
+
* unsafe, colliding, or unsupported entries. `reason` carries the walk's fact
|
|
13
|
+
* sentence.
|
|
14
|
+
*/
|
|
15
|
+
export declare class MaterializedTreeInvalid extends MaterializedTreeInvalid_base<{
|
|
16
|
+
readonly root: string;
|
|
17
|
+
readonly reason: string;
|
|
18
|
+
readonly cause?: unknown;
|
|
19
|
+
}> {
|
|
20
|
+
}
|
|
21
|
+
export declare const computeMaterializedTreeIntegrity: (root: string) => Effect.Effect<TreeIntegrity, MaterializedTreeInvalid, FileSystem.FileSystem | Path.Path>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=materialized-tree.d.ts.map
|