@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,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effective setup scope support derived from the extension-type and coding-agent catalogs.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
*/
|
|
6
|
+
import { type ExtensionType, type ExtensionPlacement } from "@agentxm/extension-model/unstable/extensions/common";
|
|
7
|
+
import type { WorkspaceScope } from "@agentxm/extension-model/unstable/workspace-scope";
|
|
8
|
+
export type SetupScopeSupportStatus = "supported" | "project-only" | "unsupported" | "refused";
|
|
9
|
+
export type SetupScopeSupportReasonCode = "supported" | "no-configured-agents" | "unknown-agent" | "native-capability-unavailable" | "axm-capability-unavailable" | "project-only" | "scope-not-modeled";
|
|
10
|
+
export interface SetupScopeSupportOutcome {
|
|
11
|
+
readonly target: "workspace" | "container" | "agent" | "agent-set";
|
|
12
|
+
readonly agentId?: string;
|
|
13
|
+
readonly agentName?: string;
|
|
14
|
+
readonly status: SetupScopeSupportStatus;
|
|
15
|
+
readonly reasonCode: SetupScopeSupportReasonCode;
|
|
16
|
+
readonly reason: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SetupScopeSupportCategory {
|
|
19
|
+
readonly type: ExtensionType;
|
|
20
|
+
readonly label: string;
|
|
21
|
+
readonly placement: ExtensionPlacement;
|
|
22
|
+
readonly outcomes: ReadonlyArray<SetupScopeSupportOutcome>;
|
|
23
|
+
}
|
|
24
|
+
export declare const setupScopeSupportOutcomes: (type: ExtensionType, agentIds: ReadonlyArray<string>, scope: WorkspaceScope) => ReadonlyArray<SetupScopeSupportOutcome>;
|
|
25
|
+
/** Derive setup's category and per-agent scope contract from canonical catalogs. */
|
|
26
|
+
export declare const setupScopeSupport: (agentIds: ReadonlyArray<string>, scope: WorkspaceScope) => ReadonlyArray<SetupScopeSupportCategory>;
|
|
27
|
+
//# sourceMappingURL=setup-scope-support.d.ts.map
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effective setup scope support derived from the extension-type and coding-agent catalogs.
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is unstable and may change without notice.
|
|
5
|
+
*/
|
|
6
|
+
import { CONFIGURABLE_AGENTS_BY_ID, } from "@agentxm/extension-model/unstable/agent-capabilities";
|
|
7
|
+
import { userScopeRefusal } from "./scope-refusal.js";
|
|
8
|
+
import { EXTENSION_TYPE_TABLE, extensionTypeLabels, extensionTypes, } from "@agentxm/extension-model/unstable/extensions/common";
|
|
9
|
+
const isConfigurableAgentId = (id) => Object.hasOwn(CONFIGURABLE_AGENTS_BY_ID, id);
|
|
10
|
+
const nativeSupportsScope = (native, scope) => native.availability.via !== "none" && "scopes" in native && native.scopes.includes(scope);
|
|
11
|
+
const capabilityReason = (axm, fallback) => typeof axm === "object" && axm !== null && "reason" in axm && typeof axm.reason === "string"
|
|
12
|
+
? axm.reason
|
|
13
|
+
: fallback;
|
|
14
|
+
const supportedOutcome = (args) => ({
|
|
15
|
+
...args,
|
|
16
|
+
status: "supported",
|
|
17
|
+
reasonCode: "supported",
|
|
18
|
+
});
|
|
19
|
+
const agentOutcome = (args) => ({ target: "agent", ...args });
|
|
20
|
+
const noConfiguredAgentsOutcome = () => ({
|
|
21
|
+
target: "agent-set",
|
|
22
|
+
status: "unsupported",
|
|
23
|
+
reasonCode: "no-configured-agents",
|
|
24
|
+
reason: "No coding agents are configured for this scope.",
|
|
25
|
+
});
|
|
26
|
+
const unknownAgentOutcome = (agentId) => agentOutcome({
|
|
27
|
+
agentId,
|
|
28
|
+
agentName: agentId,
|
|
29
|
+
status: "unsupported",
|
|
30
|
+
reasonCode: "unknown-agent",
|
|
31
|
+
reason: `${agentId} is not present in the coding-agent capability catalog.`,
|
|
32
|
+
});
|
|
33
|
+
const capabilityUnavailableOutcome = (args) => agentOutcome({
|
|
34
|
+
agentId: args.agentId,
|
|
35
|
+
agentName: args.agentName,
|
|
36
|
+
status: "unsupported",
|
|
37
|
+
reasonCode: args.axmReason === undefined ? "native-capability-unavailable" : "axm-capability-unavailable",
|
|
38
|
+
reason: args.axmReason ??
|
|
39
|
+
`${args.agentName} has no supported ${args.typeLabel.toLowerCase()} surface.`,
|
|
40
|
+
});
|
|
41
|
+
const projectOnlyOutcome = (args) => agentOutcome({
|
|
42
|
+
agentId: args.agentId,
|
|
43
|
+
agentName: args.agentName,
|
|
44
|
+
status: "project-only",
|
|
45
|
+
reasonCode: "project-only",
|
|
46
|
+
reason: args.reason ??
|
|
47
|
+
`${args.agentName} supports ${args.typeLabel.toLowerCase()} only in project scope.`,
|
|
48
|
+
});
|
|
49
|
+
const scopeNotModeledOutcome = (args) => agentOutcome({
|
|
50
|
+
agentId: args.agentId,
|
|
51
|
+
agentName: args.agentName,
|
|
52
|
+
status: "refused",
|
|
53
|
+
reasonCode: "scope-not-modeled",
|
|
54
|
+
reason: args.reason ??
|
|
55
|
+
`AXM has not modeled ${args.typeLabel.toLowerCase()} for ${args.agentName} in user scope.`,
|
|
56
|
+
});
|
|
57
|
+
const perAgentOutcomes = (agentIds, resolve) => {
|
|
58
|
+
if (agentIds.length === 0)
|
|
59
|
+
return [noConfiguredAgentsOutcome()];
|
|
60
|
+
return agentIds.map((agentId) => isConfigurableAgentId(agentId) ? resolve(agentId) : unknownAgentOutcome(agentId));
|
|
61
|
+
};
|
|
62
|
+
const skillOutcome = (agentId, scope) => {
|
|
63
|
+
const agent = CONFIGURABLE_AGENTS_BY_ID[agentId];
|
|
64
|
+
const capability = agent.capabilities.skill;
|
|
65
|
+
const projectSupported = capability.axm.status === "supported" && nativeSupportsScope(capability.native, "project");
|
|
66
|
+
if (capability.native.availability.via === "none") {
|
|
67
|
+
return capabilityUnavailableOutcome({
|
|
68
|
+
agentId,
|
|
69
|
+
agentName: agent.name,
|
|
70
|
+
typeLabel: "Skills",
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (capability.axm.status !== "supported") {
|
|
74
|
+
return capabilityUnavailableOutcome({
|
|
75
|
+
agentId,
|
|
76
|
+
agentName: agent.name,
|
|
77
|
+
typeLabel: "Skills",
|
|
78
|
+
axmReason: capabilityReason(capability.axm, `AXM does not support skills for ${agent.name}.`),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
if (nativeSupportsScope(capability.native, scope)) {
|
|
82
|
+
return supportedOutcome({
|
|
83
|
+
target: "agent",
|
|
84
|
+
agentId,
|
|
85
|
+
agentName: agent.name,
|
|
86
|
+
reason: `${agent.name} supports skills in ${scope} scope.`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return projectSupported
|
|
90
|
+
? projectOnlyOutcome({ agentId, agentName: agent.name, typeLabel: "Skills" })
|
|
91
|
+
: capabilityUnavailableOutcome({ agentId, agentName: agent.name, typeLabel: "Skills" });
|
|
92
|
+
};
|
|
93
|
+
const mcpOutcome = (agentId, scope) => {
|
|
94
|
+
const agent = CONFIGURABLE_AGENTS_BY_ID[agentId];
|
|
95
|
+
const capability = agent.capabilities["mcp-server"];
|
|
96
|
+
if (capability.native.availability.via === "none") {
|
|
97
|
+
return capabilityUnavailableOutcome({
|
|
98
|
+
agentId,
|
|
99
|
+
agentName: agent.name,
|
|
100
|
+
typeLabel: "MCP servers",
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (capability.axm.status !== "supported" || capability.axm.writer === null) {
|
|
104
|
+
return capabilityUnavailableOutcome({
|
|
105
|
+
agentId,
|
|
106
|
+
agentName: agent.name,
|
|
107
|
+
typeLabel: "MCP servers",
|
|
108
|
+
axmReason: capabilityReason(capability.axm, `AXM has no supported MCP writer for ${agent.name}.`),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
const targets = capability.axm.writer.config.targets;
|
|
112
|
+
const hasTarget = targets.some((target) => target.scope === scope);
|
|
113
|
+
if (nativeSupportsScope(capability.native, scope) && hasTarget) {
|
|
114
|
+
return supportedOutcome({
|
|
115
|
+
target: "agent",
|
|
116
|
+
agentId,
|
|
117
|
+
agentName: agent.name,
|
|
118
|
+
reason: `${agent.name} has an AXM-managed ${scope}-scope MCP target.`,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const hasProjectTarget = targets.some((target) => target.scope === "project");
|
|
122
|
+
if (scope === "user" && nativeSupportsScope(capability.native, "user") && hasProjectTarget) {
|
|
123
|
+
return scopeNotModeledOutcome({
|
|
124
|
+
agentId,
|
|
125
|
+
agentName: agent.name,
|
|
126
|
+
typeLabel: "MCP servers",
|
|
127
|
+
reason: `AXM manages only project-scope MCP configuration for ${agent.name}; the native user-scope surface is not modeled.`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return scope === "user" && hasProjectTarget
|
|
131
|
+
? projectOnlyOutcome({ agentId, agentName: agent.name, typeLabel: "MCP servers" })
|
|
132
|
+
: capabilityUnavailableOutcome({
|
|
133
|
+
agentId,
|
|
134
|
+
agentName: agent.name,
|
|
135
|
+
typeLabel: "MCP servers",
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
const subagentOutcome = (agentId, scope) => {
|
|
139
|
+
const agent = CONFIGURABLE_AGENTS_BY_ID[agentId];
|
|
140
|
+
const capability = agent.capabilities.subagent;
|
|
141
|
+
const projectSupported = capability.native.availability.via !== "none" &&
|
|
142
|
+
capability.axm.status === "supported" &&
|
|
143
|
+
nativeSupportsScope(capability.native, "project");
|
|
144
|
+
if (!projectSupported) {
|
|
145
|
+
return capabilityUnavailableOutcome({
|
|
146
|
+
agentId,
|
|
147
|
+
agentName: agent.name,
|
|
148
|
+
typeLabel: "Subagents",
|
|
149
|
+
...(capability.axm.status === "supported"
|
|
150
|
+
? {}
|
|
151
|
+
: {
|
|
152
|
+
axmReason: capabilityReason(capability.axm, `AXM does not support subagents for ${agent.name}.`),
|
|
153
|
+
}),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (scope === "project") {
|
|
157
|
+
return supportedOutcome({
|
|
158
|
+
target: "agent",
|
|
159
|
+
agentId,
|
|
160
|
+
agentName: agent.name,
|
|
161
|
+
reason: `${agent.name} has an AXM-managed project-scope subagent target.`,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
const reason = userScopeRefusal({ agentId, agentName: agent.name, type: "subagents" });
|
|
165
|
+
return nativeSupportsScope(capability.native, "user")
|
|
166
|
+
? scopeNotModeledOutcome({
|
|
167
|
+
agentId,
|
|
168
|
+
agentName: agent.name,
|
|
169
|
+
typeLabel: "Subagents",
|
|
170
|
+
reason,
|
|
171
|
+
})
|
|
172
|
+
: projectOnlyOutcome({
|
|
173
|
+
agentId,
|
|
174
|
+
agentName: agent.name,
|
|
175
|
+
typeLabel: "Subagents",
|
|
176
|
+
reason,
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
const hookOutcome = (agentId, scope) => {
|
|
180
|
+
const agent = CONFIGURABLE_AGENTS_BY_ID[agentId];
|
|
181
|
+
const capability = agent.capabilities.hook;
|
|
182
|
+
if (capability.native.availability.via === "none" ||
|
|
183
|
+
capability.axm.status !== "supported" ||
|
|
184
|
+
capability.axm.writer === null) {
|
|
185
|
+
return capabilityUnavailableOutcome({
|
|
186
|
+
agentId,
|
|
187
|
+
agentName: agent.name,
|
|
188
|
+
typeLabel: "Hooks",
|
|
189
|
+
...(capability.axm.status === "supported"
|
|
190
|
+
? {}
|
|
191
|
+
: {
|
|
192
|
+
axmReason: capabilityReason(capability.axm, `AXM does not support hooks for ${agent.name}.`),
|
|
193
|
+
}),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
const hasProjectTarget = capability.axm.writer.configFiles.some((target) => target.scope === "project");
|
|
197
|
+
if (!hasProjectTarget) {
|
|
198
|
+
return capabilityUnavailableOutcome({
|
|
199
|
+
agentId,
|
|
200
|
+
agentName: agent.name,
|
|
201
|
+
typeLabel: "Hooks",
|
|
202
|
+
axmReason: `AXM has no project-scope hook writer target for ${agent.name}.`,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
if (scope === "user") {
|
|
206
|
+
return projectOnlyOutcome({
|
|
207
|
+
agentId,
|
|
208
|
+
agentName: agent.name,
|
|
209
|
+
typeLabel: "Hooks",
|
|
210
|
+
reason: `AXM hook materialization for ${agent.name} is intentionally project-only.`,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return supportedOutcome({
|
|
214
|
+
target: "agent",
|
|
215
|
+
agentId,
|
|
216
|
+
agentName: agent.name,
|
|
217
|
+
reason: `${agent.name} has an AXM-managed project-scope hook target.`,
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
const instructionOutcome = (agentId, scope) => {
|
|
221
|
+
const agent = CONFIGURABLE_AGENTS_BY_ID[agentId];
|
|
222
|
+
const capability = agent.instructions;
|
|
223
|
+
if (capability.native.availability.via === "none") {
|
|
224
|
+
return capabilityUnavailableOutcome({
|
|
225
|
+
agentId,
|
|
226
|
+
agentName: agent.name,
|
|
227
|
+
typeLabel: "instruction files",
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
if (capability.axm.status !== "supported") {
|
|
231
|
+
return capabilityUnavailableOutcome({
|
|
232
|
+
agentId,
|
|
233
|
+
agentName: agent.name,
|
|
234
|
+
typeLabel: "instruction files",
|
|
235
|
+
axmReason: capabilityReason(capability.axm, `AXM does not support instruction projection for ${agent.name}.`),
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
if (nativeSupportsScope(capability.native, scope)) {
|
|
239
|
+
return supportedOutcome({
|
|
240
|
+
target: "agent",
|
|
241
|
+
agentId,
|
|
242
|
+
agentName: agent.name,
|
|
243
|
+
reason: `${agent.name} supports instruction files in ${scope} scope.`,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
return scope === "user" && nativeSupportsScope(capability.native, "project")
|
|
247
|
+
? projectOnlyOutcome({
|
|
248
|
+
agentId,
|
|
249
|
+
agentName: agent.name,
|
|
250
|
+
typeLabel: "instruction files",
|
|
251
|
+
})
|
|
252
|
+
: capabilityUnavailableOutcome({
|
|
253
|
+
agentId,
|
|
254
|
+
agentName: agent.name,
|
|
255
|
+
typeLabel: "instruction files",
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
export const setupScopeSupportOutcomes = (type, agentIds, scope) => {
|
|
259
|
+
switch (type) {
|
|
260
|
+
case "skill":
|
|
261
|
+
return perAgentOutcomes(agentIds, (agentId) => skillOutcome(agentId, scope));
|
|
262
|
+
case "mcp-server":
|
|
263
|
+
return perAgentOutcomes(agentIds, (agentId) => mcpOutcome(agentId, scope));
|
|
264
|
+
case "subagent":
|
|
265
|
+
return perAgentOutcomes(agentIds, (agentId) => subagentOutcome(agentId, scope));
|
|
266
|
+
case "hook":
|
|
267
|
+
return perAgentOutcomes(agentIds, (agentId) => hookOutcome(agentId, scope));
|
|
268
|
+
case "rule":
|
|
269
|
+
return [
|
|
270
|
+
supportedOutcome({
|
|
271
|
+
target: "workspace",
|
|
272
|
+
reason: `Rule packages and the canonical instruction source are supported in ${scope} scope.`,
|
|
273
|
+
}),
|
|
274
|
+
...perAgentOutcomes(agentIds, (agentId) => instructionOutcome(agentId, scope)),
|
|
275
|
+
];
|
|
276
|
+
case "knowledge":
|
|
277
|
+
return [
|
|
278
|
+
supportedOutcome({
|
|
279
|
+
target: "workspace",
|
|
280
|
+
reason: `Knowledge bundles are supported in ${scope} scope.`,
|
|
281
|
+
}),
|
|
282
|
+
];
|
|
283
|
+
case "pack":
|
|
284
|
+
return [
|
|
285
|
+
supportedOutcome({
|
|
286
|
+
target: "container",
|
|
287
|
+
reason: `Pack intent is supported in ${scope} scope; member outcomes follow their categories.`,
|
|
288
|
+
}),
|
|
289
|
+
];
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
/** Derive setup's category and per-agent scope contract from canonical catalogs. */
|
|
293
|
+
export const setupScopeSupport = (agentIds, scope) => extensionTypes.map((type) => ({
|
|
294
|
+
type,
|
|
295
|
+
label: extensionTypeLabels[type],
|
|
296
|
+
placement: EXTENSION_TYPE_TABLE[type].placement,
|
|
297
|
+
outcomes: setupScopeSupportOutcomes(type, agentIds, scope),
|
|
298
|
+
}));
|
|
299
|
+
//# sourceMappingURL=setup-scope-support.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized skill path computation.
|
|
3
|
+
*
|
|
4
|
+
* Provides types and a pure function for computing skill directory paths
|
|
5
|
+
* based on source type (registry vs non-registry).
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
*/
|
|
9
|
+
import { type ExtensionPathSource } from "./extension-paths.js";
|
|
10
|
+
import type { AbsolutePath } from "@agentxm/extension-model/unstable/path-types";
|
|
11
|
+
import type { WorkspaceLayout } from "./layout.js";
|
|
12
|
+
/**
|
|
13
|
+
* Minimal structural discriminant for determining skill path layout.
|
|
14
|
+
*
|
|
15
|
+
* Every acquired ref carries enough source coordinates to derive its
|
|
16
|
+
* source-qualified canonical path.
|
|
17
|
+
*/
|
|
18
|
+
export type SkillPathSource = ExtensionPathSource;
|
|
19
|
+
/**
|
|
20
|
+
* Computed paths for an installed skill directory.
|
|
21
|
+
*
|
|
22
|
+
* - `canonicalPath`: root of the installed skill
|
|
23
|
+
* - `skillSrcPath`: where actual skill source files live
|
|
24
|
+
*
|
|
25
|
+
* Native packages use `<canonicalPath>/src`; portable Agent Skills use the
|
|
26
|
+
* source-qualified package root directly.
|
|
27
|
+
*/
|
|
28
|
+
export interface SkillDirPaths {
|
|
29
|
+
readonly canonicalPath: AbsolutePath;
|
|
30
|
+
readonly skillSrcPath: AbsolutePath;
|
|
31
|
+
}
|
|
32
|
+
export declare const computeSkillPathsForLayout: (join: (...paths: string[]) => string, layout: WorkspaceLayout, source: SkillPathSource, sanitizedName: string) => SkillDirPaths;
|
|
33
|
+
//# sourceMappingURL=skill-paths.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized skill path computation.
|
|
3
|
+
*
|
|
4
|
+
* Provides types and a pure function for computing skill directory paths
|
|
5
|
+
* based on source type (registry vs non-registry).
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is unstable and may change without notice.
|
|
8
|
+
*/
|
|
9
|
+
import { computeExtensionPathsForLayout } from "./extension-paths.js";
|
|
10
|
+
export const computeSkillPathsForLayout = (join, layout, source, sanitizedName) => {
|
|
11
|
+
const paths = computeExtensionPathsForLayout(join, layout, source, "skills", sanitizedName);
|
|
12
|
+
return { canonicalPath: paths.canonicalPath, skillSrcPath: paths.extensionSrcPath };
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=skill-paths.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Source metadata derivation helpers. */
|
|
2
|
+
import type { PackagingKind } from "./read-model-record-types.js";
|
|
3
|
+
export type SourceMeta = {
|
|
4
|
+
readonly packagingKind: PackagingKind;
|
|
5
|
+
};
|
|
6
|
+
export declare const deriveSourceMetaFromLockType: (lockType: string) => SourceMeta;
|
|
7
|
+
//# sourceMappingURL=source-metadata.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Source metadata derivation helpers. */
|
|
2
|
+
export const deriveSourceMetaFromLockType = (lockType) => {
|
|
3
|
+
switch (lockType) {
|
|
4
|
+
case "registry":
|
|
5
|
+
return { packagingKind: "native" };
|
|
6
|
+
default:
|
|
7
|
+
return { packagingKind: "non-native" };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=source-metadata.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a SkillExtensionRef to the corresponding SkillLockEntry.
|
|
3
|
+
*
|
|
4
|
+
* Pure function that converts from the runtime SkillExtensionRef types
|
|
5
|
+
* (which use Option<T>) to the lockfile schema types (which use T | undefined
|
|
6
|
+
* via Schema.optional).
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
*/
|
|
10
|
+
import * as Option from "effect/Option";
|
|
11
|
+
import type { SkillLockEntry } from "../lockfile/schema.js";
|
|
12
|
+
import type { SourceHash } from "@agentxm/extension-model/unstable/sources/source-hash";
|
|
13
|
+
import type { TreeIntegrity } from "./materialized-tree.js";
|
|
14
|
+
import type { SkillExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/skill";
|
|
15
|
+
export interface SourceToLockEntryInput {
|
|
16
|
+
readonly ref: SkillExtensionRef;
|
|
17
|
+
/** Required for registry sources — which named registry config was used. */
|
|
18
|
+
readonly sourceName: Option.Option<string>;
|
|
19
|
+
/** Canonical package identity required by Git and local-path resolutions. */
|
|
20
|
+
readonly contentIdentity: SourceHash;
|
|
21
|
+
readonly treeIntegrity: TreeIntegrity;
|
|
22
|
+
/** Workspace-root-relative local source path for lockfile persistence. */
|
|
23
|
+
readonly workspaceRelativeLocalSourcePath?: Option.Option<string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Maps a SkillExtensionRef and operation metadata to a SkillLockEntry for lockfile persistence.
|
|
27
|
+
*
|
|
28
|
+
* Outer switch on `ref.refType` for ref-detail access; inner switch on `ref.source.type`
|
|
29
|
+
* within `git-hosted` for per-source lock entry granularity.
|
|
30
|
+
*/
|
|
31
|
+
export declare const sourceToLockEntry: (input: SourceToLockEntryInput) => SkillLockEntry | undefined;
|
|
32
|
+
//# sourceMappingURL=source-to-lock-entry.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a SkillExtensionRef to the corresponding SkillLockEntry.
|
|
3
|
+
*
|
|
4
|
+
* Pure function that converts from the runtime SkillExtensionRef types
|
|
5
|
+
* (which use Option<T>) to the lockfile schema types (which use T | undefined
|
|
6
|
+
* via Schema.optional).
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
*/
|
|
10
|
+
import * as Option from "effect/Option";
|
|
11
|
+
import { gitSourceLockFields, portableGitSourceLockFields } from "../lockfile/entry-fields.js";
|
|
12
|
+
// -----------------------------------------------------------------------------
|
|
13
|
+
// Helpers
|
|
14
|
+
// -----------------------------------------------------------------------------
|
|
15
|
+
const localSourceLockPath = (input, sourcePath) => Option.getOrElse(input.workspaceRelativeLocalSourcePath ?? Option.none(), () => sourcePath);
|
|
16
|
+
// -----------------------------------------------------------------------------
|
|
17
|
+
// Implementation
|
|
18
|
+
// -----------------------------------------------------------------------------
|
|
19
|
+
/**
|
|
20
|
+
* Maps a SkillExtensionRef and operation metadata to a SkillLockEntry for lockfile persistence.
|
|
21
|
+
*
|
|
22
|
+
* Outer switch on `ref.refType` for ref-detail access; inner switch on `ref.source.type`
|
|
23
|
+
* within `git-hosted` for per-source lock entry granularity.
|
|
24
|
+
*/
|
|
25
|
+
export const sourceToLockEntry = (input) => {
|
|
26
|
+
const { ref } = input;
|
|
27
|
+
switch (ref.refType) {
|
|
28
|
+
case "git-hosted":
|
|
29
|
+
return {
|
|
30
|
+
...(ref.owner === undefined
|
|
31
|
+
? portableGitSourceLockFields(ref.source, ref.skill.name, Option.fromUndefinedOr(ref.sourcePath), ref.gitCommitSha, ref.gitTreeSha, input.contentIdentity, ref.name, input.treeIntegrity)
|
|
32
|
+
: gitSourceLockFields(ref.source, "skill", ref.skill.name, Option.fromUndefinedOr(ref.sourcePath), ref.gitCommitSha, ref.gitTreeSha, input.contentIdentity, ref.owner, ref.name, input.treeIntegrity)),
|
|
33
|
+
};
|
|
34
|
+
case "local":
|
|
35
|
+
return {
|
|
36
|
+
type: "local",
|
|
37
|
+
sourceType: "local",
|
|
38
|
+
sourceName: "local",
|
|
39
|
+
extensionType: "skill",
|
|
40
|
+
workspaceName: ref.skill.name,
|
|
41
|
+
packageFormat: ref.portable === true ? "agent-skill" : "agentxm",
|
|
42
|
+
...(ref.owner === undefined ? {} : { packageOwner: ref.owner }),
|
|
43
|
+
packageName: ref.name,
|
|
44
|
+
path: localSourceLockPath(input, ref.source.path),
|
|
45
|
+
contentIdentity: input.contentIdentity,
|
|
46
|
+
treeIntegrity: input.treeIntegrity,
|
|
47
|
+
};
|
|
48
|
+
case "registry":
|
|
49
|
+
return {
|
|
50
|
+
type: "registry",
|
|
51
|
+
sourceType: "registry",
|
|
52
|
+
packageFormat: "agentxm",
|
|
53
|
+
endpoint: ref.source.location,
|
|
54
|
+
extensionType: "skill",
|
|
55
|
+
workspaceName: ref.skill.name,
|
|
56
|
+
owner: ref.owner,
|
|
57
|
+
name: ref.skill.name,
|
|
58
|
+
resolvedVersion: ref.version,
|
|
59
|
+
integrity: Option.getOrElse(ref.integrity, () => ""),
|
|
60
|
+
sourceName: ref.source.name,
|
|
61
|
+
publisherBindingId: ref.publisherBindingId,
|
|
62
|
+
treeIntegrity: input.treeIntegrity,
|
|
63
|
+
};
|
|
64
|
+
case "workspace":
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=source-to-lock-entry.js.map
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default no-op stubs for workspace getter methods on WorkspaceMutationsService.
|
|
3
|
+
* Spread into test mocks to satisfy the interface without implementing every method.
|
|
4
|
+
*
|
|
5
|
+
* @internal Test-only. Not exported from the barrel.
|
|
6
|
+
*/
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import type { WorkspaceMutationsService } from "./service-interface.js";
|
|
9
|
+
import type { ReadModelRecordRow, PackagingKind } from "./read-model-record-types.js";
|
|
10
|
+
import type { WorkspaceStateReadFailure } from "./service-interface.js";
|
|
11
|
+
import type { ExtensionInventory } from "./read-model/extensions/inventory.js";
|
|
12
|
+
import { type McpServerLockEntry, type RegistryPackLockEntry, type SkillLockEntry } from "../lockfile/index.js";
|
|
13
|
+
import { type InstallableExtensionType } from "@agentxm/extension-model/unstable/extensions/installable-types";
|
|
14
|
+
import { type Handle } from "@agentxm/extension-model/unstable/extensions/handle";
|
|
15
|
+
import { type Version } from "@agentxm/extension-model/unstable/version-constraints";
|
|
16
|
+
type WorkspaceMockOverrides = Partial<WorkspaceMutationsService> & Partial<WorkspaceMutationsService["records"]>;
|
|
17
|
+
/**
|
|
18
|
+
* Build a `configured` read-model row. Tests that previously stubbed
|
|
19
|
+
* `getConfiguredSkills` with a `{ name: { source, enabled } }` map supply the
|
|
20
|
+
* same facts here and feed the result to {@link rowsFor}.
|
|
21
|
+
*/
|
|
22
|
+
export declare const configuredRow: (args: {
|
|
23
|
+
readonly type: InstallableExtensionType;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly source: string;
|
|
26
|
+
readonly enabled?: boolean;
|
|
27
|
+
readonly packagingKind?: PackagingKind;
|
|
28
|
+
}) => ReadModelRecordRow;
|
|
29
|
+
/** Build an `implicit` read-model row (pack member or lockfile-only entry). */
|
|
30
|
+
export declare const implicitRow: (args: {
|
|
31
|
+
readonly type: InstallableExtensionType;
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly source?: string;
|
|
34
|
+
readonly packagingKind?: PackagingKind;
|
|
35
|
+
}) => ReadModelRecordRow;
|
|
36
|
+
/** Build an `unmanaged` read-model row (observed on disk, unclaimed). */
|
|
37
|
+
export declare const unmanagedRow: (args: {
|
|
38
|
+
readonly type: InstallableExtensionType;
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly locations?: ReadonlyArray<string>;
|
|
41
|
+
readonly packagingKind?: PackagingKind;
|
|
42
|
+
}) => ReadModelRecordRow;
|
|
43
|
+
/**
|
|
44
|
+
* Build a `records.rows` stub from per-type row lists. Types absent from the
|
|
45
|
+
* map yield an empty array, matching the real reader's totality.
|
|
46
|
+
*/
|
|
47
|
+
export declare const rowsFor: (byType: Partial<Record<InstallableExtensionType, ReadonlyArray<ReadModelRecordRow>>>) => (type: InstallableExtensionType) => Effect.Effect<ReadonlyArray<ReadModelRecordRow>, WorkspaceStateReadFailure>;
|
|
48
|
+
/**
|
|
49
|
+
* No-op stubs for all read-model record getters. Spread into mock objects:
|
|
50
|
+
* ```ts
|
|
51
|
+
* const ws: WorkspaceMutationsService = {
|
|
52
|
+
* records: readModelRecordStubs,
|
|
53
|
+
* // your overrides
|
|
54
|
+
* };
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const readModelRecordStubs: {
|
|
58
|
+
readonly getInventory: () => Effect.Effect<{
|
|
59
|
+
items: never[];
|
|
60
|
+
count: number;
|
|
61
|
+
configuredCount: number;
|
|
62
|
+
implicitCount: number;
|
|
63
|
+
installedCount: number;
|
|
64
|
+
unmanagedCount: number;
|
|
65
|
+
}, never, never>;
|
|
66
|
+
readonly getExtensionInventory: () => Effect.Effect<ExtensionInventory, WorkspaceStateReadFailure>;
|
|
67
|
+
readonly rows: () => Effect.Effect<ReadonlyArray<ReadModelRecordRow>, WorkspaceStateReadFailure>;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Base workspace mock with no-op defaults for all methods.
|
|
71
|
+
* Tests should only override the methods they exercise.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const ws = makeBaseWorkspaceMock("/tmp/axm", {
|
|
76
|
+
* setSkill: vi.fn(() => Effect.void),
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare const makeBaseWorkspaceMock: (axmDir?: string, overrides?: WorkspaceMockOverrides) => WorkspaceMutationsService;
|
|
81
|
+
export declare const TEST_CONTENT_IDENTITY: string & import("effect/Brand").Brand<"SourceHash">;
|
|
82
|
+
export declare const TEST_TREE_INTEGRITY: string & import("effect/Brand").Brand<"TreeIntegrity">;
|
|
83
|
+
export interface WriteWorkspaceFilesOptions {
|
|
84
|
+
readonly agents?: ReadonlyArray<string> | undefined;
|
|
85
|
+
readonly owner?: string | undefined;
|
|
86
|
+
readonly skills?: Record<string, unknown> | undefined;
|
|
87
|
+
readonly mcps?: Record<string, unknown> | undefined;
|
|
88
|
+
readonly subagents?: Record<string, unknown> | undefined;
|
|
89
|
+
readonly rules?: Record<string, unknown> | undefined;
|
|
90
|
+
readonly packs?: Record<string, unknown> | undefined;
|
|
91
|
+
readonly sources?: ReadonlyArray<unknown> | undefined;
|
|
92
|
+
readonly lockfileSkills?: Record<string, unknown> | undefined;
|
|
93
|
+
readonly lockfileMcpServers?: Record<string, unknown> | undefined;
|
|
94
|
+
readonly lockfileSubagents?: Record<string, unknown> | undefined;
|
|
95
|
+
readonly lockfileRules?: Record<string, unknown> | undefined;
|
|
96
|
+
readonly lockfilePacks?: Record<string, unknown> | undefined;
|
|
97
|
+
}
|
|
98
|
+
export declare const writeWorkspaceFiles: (runtimeDir: string, opts?: WriteWorkspaceFilesOptions) => void;
|
|
99
|
+
export declare const makeLocalSkillLockEntry: (opts?: {
|
|
100
|
+
readonly path?: string;
|
|
101
|
+
readonly agents?: ReadonlyArray<string>;
|
|
102
|
+
readonly installedAt?: unknown;
|
|
103
|
+
readonly updatedAt?: unknown;
|
|
104
|
+
}) => SkillLockEntry;
|
|
105
|
+
export declare const makeRegistrySkillLockEntry: (opts: {
|
|
106
|
+
readonly owner: Handle;
|
|
107
|
+
readonly name: string;
|
|
108
|
+
readonly resolvedVersion?: Version;
|
|
109
|
+
readonly integrity?: string;
|
|
110
|
+
readonly sourceName?: string;
|
|
111
|
+
readonly endpoint?: URL;
|
|
112
|
+
readonly publisherBindingId?: string;
|
|
113
|
+
readonly agents?: ReadonlyArray<string>;
|
|
114
|
+
readonly installedAt?: unknown;
|
|
115
|
+
readonly updatedAt?: unknown;
|
|
116
|
+
}) => SkillLockEntry;
|
|
117
|
+
export declare const makeRegistryMcpServerLockEntry: (opts: {
|
|
118
|
+
readonly owner: Handle;
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly resolvedVersion?: Version;
|
|
121
|
+
readonly integrity?: string;
|
|
122
|
+
readonly sourceName?: string;
|
|
123
|
+
readonly endpoint?: URL;
|
|
124
|
+
readonly publisherBindingId?: string;
|
|
125
|
+
readonly installedAt?: unknown;
|
|
126
|
+
readonly updatedAt?: unknown;
|
|
127
|
+
}) => McpServerLockEntry;
|
|
128
|
+
export declare const makeRegistryPackLockEntry: (opts: {
|
|
129
|
+
readonly owner: Handle;
|
|
130
|
+
readonly name: string;
|
|
131
|
+
readonly resolvedVersion?: Version;
|
|
132
|
+
readonly integrity?: string;
|
|
133
|
+
readonly sourceName?: string;
|
|
134
|
+
readonly endpoint?: URL;
|
|
135
|
+
readonly publisherBindingId?: string;
|
|
136
|
+
readonly sourceHash?: string;
|
|
137
|
+
readonly resolvedSkills?: Readonly<Record<string, unknown>>;
|
|
138
|
+
readonly resolvedMcpServers?: Readonly<Record<string, unknown>>;
|
|
139
|
+
readonly resolvedSubagents?: Readonly<Record<string, unknown>>;
|
|
140
|
+
readonly installedAt?: unknown;
|
|
141
|
+
readonly updatedAt?: unknown;
|
|
142
|
+
}) => RegistryPackLockEntry;
|
|
143
|
+
export {};
|
|
144
|
+
//# sourceMappingURL=test-stubs.d.ts.map
|