@agentxm/extension-materialization 0.28.14-preview.1789139351.5cd4595aa
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 +16 -0
- package/dist/src/desired-state/errors.d.ts +22 -0
- package/dist/src/desired-state/errors.js +22 -0
- package/dist/src/desired-state/retained-materialization.d.ts +58 -0
- package/dist/src/desired-state/retained-materialization.js +119 -0
- package/dist/src/errors.d.ts +42 -0
- package/dist/src/errors.js +14 -0
- package/dist/src/extensions/canonical-directory.d.ts +106 -0
- package/dist/src/extensions/canonical-directory.js +210 -0
- package/dist/src/extensions/canonical-reuse.d.ts +43 -0
- package/dist/src/extensions/canonical-reuse.js +38 -0
- package/dist/src/extensions/copy-directory.d.ts +50 -0
- package/dist/src/extensions/copy-directory.js +78 -0
- package/dist/src/extensions/errors.d.ts +97 -0
- package/dist/src/extensions/errors.js +42 -0
- package/dist/src/extensions/materializable-from-disk.d.ts +37 -0
- package/dist/src/extensions/materializable-from-disk.js +89 -0
- package/dist/src/extensions/operations.d.ts +252 -0
- package/dist/src/extensions/operations.js +631 -0
- package/dist/src/hooks/errors.d.ts +33 -0
- package/dist/src/hooks/errors.js +18 -0
- package/dist/src/hooks/manager.d.ts +13 -0
- package/dist/src/hooks/manager.js +778 -0
- package/dist/src/index.d.ts +44 -0
- package/dist/src/index.js +56 -0
- package/dist/src/knowledge/errors.d.ts +75 -0
- package/dist/src/knowledge/errors.js +36 -0
- package/dist/src/knowledge/manager.d.ts +9 -0
- package/dist/src/knowledge/manager.js +709 -0
- package/dist/src/live.d.ts +20 -0
- package/dist/src/live.js +20 -0
- package/dist/src/manager-contract.d.ts +136 -0
- package/dist/src/manager-contract.js +19 -0
- package/dist/src/manager-registry-live.d.ts +11 -0
- package/dist/src/manager-registry-live.js +23 -0
- package/dist/src/manager-registry.d.ts +37 -0
- package/dist/src/manager-registry.js +22 -0
- package/dist/src/managers.d.ts +147 -0
- package/dist/src/managers.js +32 -0
- package/dist/src/mcps/artifact.d.ts +24 -0
- package/dist/src/mcps/artifact.js +74 -0
- package/dist/src/mcps/authored-materialization.d.ts +28 -0
- package/dist/src/mcps/authored-materialization.js +34 -0
- package/dist/src/mcps/errors.d.ts +105 -0
- package/dist/src/mcps/errors.js +40 -0
- package/dist/src/mcps/install-operation.d.ts +92 -0
- package/dist/src/mcps/install-operation.js +557 -0
- package/dist/src/mcps/manager.d.ts +15 -0
- package/dist/src/mcps/manager.js +253 -0
- package/dist/src/mcps/native-entry.d.ts +51 -0
- package/dist/src/mcps/native-entry.js +100 -0
- package/dist/src/mcps/secret-store-live.d.ts +14 -0
- package/dist/src/mcps/secret-store-live.js +58 -0
- package/dist/src/mcps/secret-store.d.ts +55 -0
- package/dist/src/mcps/secret-store.js +33 -0
- package/dist/src/packs/errors.d.ts +50 -0
- package/dist/src/packs/errors.js +24 -0
- package/dist/src/packs/manager.d.ts +16 -0
- package/dist/src/packs/manager.js +189 -0
- package/dist/src/projection-participants-live.d.ts +17 -0
- package/dist/src/projection-participants-live.js +66 -0
- package/dist/src/projection-step-failure.d.ts +19 -0
- package/dist/src/projection-step-failure.js +76 -0
- package/dist/src/registry-materialization.d.ts +52 -0
- package/dist/src/registry-materialization.js +67 -0
- package/dist/src/rules/errors.d.ts +31 -0
- package/dist/src/rules/errors.js +17 -0
- package/dist/src/rules/manager.d.ts +18 -0
- package/dist/src/rules/manager.js +492 -0
- package/dist/src/skills/errors.d.ts +42 -0
- package/dist/src/skills/errors.js +21 -0
- package/dist/src/skills/manager.d.ts +17 -0
- package/dist/src/skills/manager.js +339 -0
- package/dist/src/skills/materialization.d.ts +52 -0
- package/dist/src/skills/materialization.js +168 -0
- package/dist/src/skills/skill-artifact.d.ts +38 -0
- package/dist/src/skills/skill-artifact.js +70 -0
- package/dist/src/skills/source-hash.d.ts +2 -0
- package/dist/src/skills/source-hash.js +6 -0
- package/dist/src/subagents/errors.d.ts +43 -0
- package/dist/src/subagents/errors.js +20 -0
- package/dist/src/subagents/lock-entry-builder.d.ts +20 -0
- package/dist/src/subagents/lock-entry-builder.js +63 -0
- package/dist/src/subagents/manager.d.ts +17 -0
- package/dist/src/subagents/manager.js +736 -0
- package/dist/src/testing.d.ts +87 -0
- package/dist/src/testing.js +116 -0
- package/package.json +70 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed failure family for the MCP server manager, the MCP install operation,
|
|
3
|
+
* and MCP inspection.
|
|
4
|
+
*
|
|
5
|
+
* The native-config failures the agent writers construct live in
|
|
6
|
+
* `@agentxm/agent-integration`; this module owns what materialization itself
|
|
7
|
+
* decides. Fields are domain facts; the application error boundary owns
|
|
8
|
+
* rendering, codes, and suggestions.
|
|
9
|
+
*
|
|
10
|
+
* @experimental This API is unstable and may change without notice.
|
|
11
|
+
*/
|
|
12
|
+
import type { AgentId } from "@agentxm/extension-model/unstable/agents/types";
|
|
13
|
+
import type { McpInspectionError } from "@agentxm/workspace-projection";
|
|
14
|
+
declare const McpRegistryOnlyInstall_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 & {
|
|
15
|
+
readonly _tag: "McpRegistryOnlyInstall";
|
|
16
|
+
} & Readonly<A>;
|
|
17
|
+
/** MCP servers install only from registry packages. */
|
|
18
|
+
export declare class McpRegistryOnlyInstall extends McpRegistryOnlyInstall_base<{
|
|
19
|
+
readonly serverName: string;
|
|
20
|
+
readonly refType: string;
|
|
21
|
+
}> {
|
|
22
|
+
}
|
|
23
|
+
declare const McpInstallStateMissing_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 & {
|
|
24
|
+
readonly _tag: "McpInstallStateMissing";
|
|
25
|
+
} & Readonly<A>;
|
|
26
|
+
/** A lock entry was requested before install recorded the package state. */
|
|
27
|
+
export declare class McpInstallStateMissing extends McpInstallStateMissing_base<{
|
|
28
|
+
readonly name: string;
|
|
29
|
+
}> {
|
|
30
|
+
}
|
|
31
|
+
declare const McpLocalNameConflict_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 & {
|
|
32
|
+
readonly _tag: "McpLocalNameConflict";
|
|
33
|
+
} & Readonly<A>;
|
|
34
|
+
/**
|
|
35
|
+
* The requested local connection name already stands for a different source,
|
|
36
|
+
* so accepting the request would silently repoint an installed connection.
|
|
37
|
+
*/
|
|
38
|
+
export declare class McpLocalNameConflict extends McpLocalNameConflict_base<{
|
|
39
|
+
readonly localName: string;
|
|
40
|
+
/** Source identity the request would install. */
|
|
41
|
+
readonly requestedIdentity: string;
|
|
42
|
+
/** Source identity the name already stands for, or `inline` for an authored entry. */
|
|
43
|
+
readonly owningIdentity: string;
|
|
44
|
+
}> {
|
|
45
|
+
}
|
|
46
|
+
declare const McpCanonicalPathUnsafe_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 & {
|
|
47
|
+
readonly _tag: "McpCanonicalPathUnsafe";
|
|
48
|
+
} & Readonly<A>;
|
|
49
|
+
/** The canonical path a registry MCP package would occupy escapes the workspace. */
|
|
50
|
+
export declare class McpCanonicalPathUnsafe extends McpCanonicalPathUnsafe_base<{
|
|
51
|
+
readonly serverName: string;
|
|
52
|
+
readonly canonicalPath: string;
|
|
53
|
+
}> {
|
|
54
|
+
}
|
|
55
|
+
/** Why a workspace-authored MCP package cannot be installed from where it says it is. */
|
|
56
|
+
export type McpWorkspacePackageFault = "outside-workspace" | "missing" | "unreadable";
|
|
57
|
+
declare const McpWorkspacePackageInvalid_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 & {
|
|
58
|
+
readonly _tag: "McpWorkspacePackageInvalid";
|
|
59
|
+
} & Readonly<A>;
|
|
60
|
+
/** A workspace-sourced MCP package is not where the reference says it is. */
|
|
61
|
+
export declare class McpWorkspacePackageInvalid extends McpWorkspacePackageInvalid_base<{
|
|
62
|
+
readonly serverName: string;
|
|
63
|
+
readonly location: string;
|
|
64
|
+
readonly fault: McpWorkspacePackageFault;
|
|
65
|
+
readonly cause?: unknown;
|
|
66
|
+
}> {
|
|
67
|
+
}
|
|
68
|
+
declare const McpRequiredInputsMissing_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 & {
|
|
69
|
+
readonly _tag: "McpRequiredInputsMissing";
|
|
70
|
+
} & Readonly<A>;
|
|
71
|
+
/**
|
|
72
|
+
* The manifest declares required inputs nothing supplied, and the invoking
|
|
73
|
+
* surface said it cannot prompt.
|
|
74
|
+
*/
|
|
75
|
+
export declare class McpRequiredInputsMissing extends McpRequiredInputsMissing_base<{
|
|
76
|
+
readonly localName: string;
|
|
77
|
+
/** Input names still unsatisfied, sorted. */
|
|
78
|
+
readonly inputNames: ReadonlyArray<string>;
|
|
79
|
+
}> {
|
|
80
|
+
}
|
|
81
|
+
/** Why projecting an MCP connection to the configured agents was refused. */
|
|
82
|
+
export type McpAgentSyncFault =
|
|
83
|
+
/** Settings name agents AXM does not know, and the caller asked for strict sync. */
|
|
84
|
+
"unknown-agents"
|
|
85
|
+
/** An agent's native configuration cannot represent the connection. */
|
|
86
|
+
| "misconfigured"
|
|
87
|
+
/** An agent write failed and the caller asked for strict sync. */
|
|
88
|
+
| "failed"
|
|
89
|
+
/** An agent AXM requires refused the connection and the caller asked for strict sync. */
|
|
90
|
+
| "disabled";
|
|
91
|
+
declare const McpAgentSyncRefused_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 & {
|
|
92
|
+
readonly _tag: "McpAgentSyncRefused";
|
|
93
|
+
} & Readonly<A>;
|
|
94
|
+
/** Projecting an MCP connection into the configured agents could not settle. */
|
|
95
|
+
export declare class McpAgentSyncRefused extends McpAgentSyncRefused_base<{
|
|
96
|
+
readonly serverName: string;
|
|
97
|
+
readonly fault: McpAgentSyncFault;
|
|
98
|
+
/** The agents the fault is about; empty when it is about none in particular. */
|
|
99
|
+
readonly agentIds: ReadonlyArray<AgentId | string>;
|
|
100
|
+
}> {
|
|
101
|
+
}
|
|
102
|
+
/** Every failure the MCP module surfaces. */
|
|
103
|
+
export type McpManagerError = McpInspectionError | McpRegistryOnlyInstall | McpInstallStateMissing | McpLocalNameConflict | McpCanonicalPathUnsafe | McpWorkspacePackageInvalid | McpRequiredInputsMissing | McpAgentSyncRefused;
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed failure family for the MCP server manager, the MCP install operation,
|
|
3
|
+
* and MCP inspection.
|
|
4
|
+
*
|
|
5
|
+
* The native-config failures the agent writers construct live in
|
|
6
|
+
* `@agentxm/agent-integration`; this module owns what materialization itself
|
|
7
|
+
* decides. Fields are domain facts; the application error boundary owns
|
|
8
|
+
* rendering, codes, and suggestions.
|
|
9
|
+
*
|
|
10
|
+
* @experimental This API is unstable and may change without notice.
|
|
11
|
+
*/
|
|
12
|
+
import * as Data from "effect/Data";
|
|
13
|
+
/** MCP servers install only from registry packages. */
|
|
14
|
+
export class McpRegistryOnlyInstall extends Data.TaggedError("McpRegistryOnlyInstall") {
|
|
15
|
+
}
|
|
16
|
+
/** A lock entry was requested before install recorded the package state. */
|
|
17
|
+
export class McpInstallStateMissing extends Data.TaggedError("McpInstallStateMissing") {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The requested local connection name already stands for a different source,
|
|
21
|
+
* so accepting the request would silently repoint an installed connection.
|
|
22
|
+
*/
|
|
23
|
+
export class McpLocalNameConflict extends Data.TaggedError("McpLocalNameConflict") {
|
|
24
|
+
}
|
|
25
|
+
/** The canonical path a registry MCP package would occupy escapes the workspace. */
|
|
26
|
+
export class McpCanonicalPathUnsafe extends Data.TaggedError("McpCanonicalPathUnsafe") {
|
|
27
|
+
}
|
|
28
|
+
/** A workspace-sourced MCP package is not where the reference says it is. */
|
|
29
|
+
export class McpWorkspacePackageInvalid extends Data.TaggedError("McpWorkspacePackageInvalid") {
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The manifest declares required inputs nothing supplied, and the invoking
|
|
33
|
+
* surface said it cannot prompt.
|
|
34
|
+
*/
|
|
35
|
+
export class McpRequiredInputsMissing extends Data.TaggedError("McpRequiredInputsMissing") {
|
|
36
|
+
}
|
|
37
|
+
/** Projecting an MCP connection into the configured agents could not settle. */
|
|
38
|
+
export class McpAgentSyncRefused extends Data.TaggedError("McpAgentSyncRefused") {
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP server installation operation: acquire the package, reconcile the
|
|
3
|
+
* connection's credentials, record the accepted resolution and the settings
|
|
4
|
+
* entry, and project the connection into every configured agent.
|
|
5
|
+
*
|
|
6
|
+
* It lives in the materialization capability rather than in a feature because
|
|
7
|
+
* four surfaces need it — `axm mcps install`, pack member installation,
|
|
8
|
+
* reconciliation, and the authoring routes that install an MCP server they
|
|
9
|
+
* have just scaffolded, forked, adopted, or imported — and a feature may not
|
|
10
|
+
* import a peer feature. Requirements stay in `R` and failures stay typed in
|
|
11
|
+
* `E`; the caller composes the layer and renders the failure.
|
|
12
|
+
*
|
|
13
|
+
* @experimental This API is unstable and may change without notice.
|
|
14
|
+
*/
|
|
15
|
+
import * as FileSystem from "effect/FileSystem";
|
|
16
|
+
import type * as HttpClient from "effect/unstable/http/HttpClient";
|
|
17
|
+
import * as Path from "effect/Path";
|
|
18
|
+
import * as Effect from "effect/Effect";
|
|
19
|
+
import * as Option from "effect/Option";
|
|
20
|
+
import { NativeWriteAuthority } from "@agentxm/agent-integration";
|
|
21
|
+
import { CodingAgentRepository } from "@agentxm/workspace-projection";
|
|
22
|
+
import type { JobStepResult, Operation } from "@agentxm/workspace-operations";
|
|
23
|
+
import { WorkspaceMutations } from "@agentxm/workspace-state";
|
|
24
|
+
import type { McpServerExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/mcp-server";
|
|
25
|
+
import { type McpServerManifest } from "@agentxm/extension-model/unstable/mcps/manifest-schema";
|
|
26
|
+
import type { ExtensionManagerFailure } from "../errors.js";
|
|
27
|
+
import { McpSecretStore, type McpSecretIdentity } from "./secret-store.js";
|
|
28
|
+
/**
|
|
29
|
+
* Args for the install-mcp-server operation.
|
|
30
|
+
*/
|
|
31
|
+
export type InstallMcpServerOperationArgs = {
|
|
32
|
+
readonly ref: McpServerExtensionRef;
|
|
33
|
+
/** Local connection identity and exact agent-native MCP key. */
|
|
34
|
+
readonly localName?: string;
|
|
35
|
+
readonly force: boolean;
|
|
36
|
+
/** Explicitly permit a workspace-authored relocation during reconciliation. */
|
|
37
|
+
readonly allowWorkspaceSourceTransition?: boolean;
|
|
38
|
+
readonly versionRange: Option.Option<string>;
|
|
39
|
+
/** When true, write to lockfile only (skip settings). Used for pack dependencies. */
|
|
40
|
+
readonly skipSettings: Option.Option<boolean>;
|
|
41
|
+
/** Materialize only; the enclosing authored-package transaction owns state writes. */
|
|
42
|
+
readonly skipStateWrites?: boolean;
|
|
43
|
+
/** When true, enforce strict policy for MCP sync outcomes. */
|
|
44
|
+
readonly strictAgentSync?: Option.Option<boolean>;
|
|
45
|
+
/** Resolved MCP input values from `--env KEY=VALUE` flags. */
|
|
46
|
+
readonly env?: Option.Option<Readonly<Record<string, string>>>;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the invoking surface can prompt for missing required inputs.
|
|
49
|
+
* The transport boundary resolves flag, CI, and TTY state.
|
|
50
|
+
*/
|
|
51
|
+
readonly nonInteractive: boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Add an MCP server to the workspace.
|
|
55
|
+
*
|
|
56
|
+
* @experimental This API is unstable and may change without notice.
|
|
57
|
+
*/
|
|
58
|
+
export type InstallMcpServerOperation = Operation<"install-mcp-server", InstallMcpServerOperationArgs>;
|
|
59
|
+
export type McpSecretDeletionOutcome = {
|
|
60
|
+
readonly _tag: "deleted";
|
|
61
|
+
readonly inputName: string;
|
|
62
|
+
} | {
|
|
63
|
+
readonly _tag: "absent";
|
|
64
|
+
readonly inputName: string;
|
|
65
|
+
} | {
|
|
66
|
+
readonly _tag: "failed";
|
|
67
|
+
readonly inputName: string;
|
|
68
|
+
};
|
|
69
|
+
export declare const collectSecretInputNames: (manifest: McpServerManifest) => ReadonlySet<string>;
|
|
70
|
+
export declare const readMcpServerManifest: (canonicalPath: string) => Effect.Effect<Option.Option<McpServerManifest>, never, FileSystem.FileSystem | Path.Path>;
|
|
71
|
+
/**
|
|
72
|
+
* Erase every credential one connection holds. Erasure is reported per input:
|
|
73
|
+
* a credential store that is unavailable leaves the secret behind and says so,
|
|
74
|
+
* rather than failing the removal that has already settled.
|
|
75
|
+
*/
|
|
76
|
+
export declare const deleteMcpSecrets: (identity: McpSecretIdentity, secretNames: ReadonlySet<string>) => Effect.Effect<ReadonlyArray<McpSecretDeletionOutcome>, never, McpSecretStore>;
|
|
77
|
+
/**
|
|
78
|
+
* Everything the MCP install operation needs from its composition root.
|
|
79
|
+
*/
|
|
80
|
+
export type McpServerInstallRequirements = FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | WorkspaceMutations | CodingAgentRepository | NativeWriteAuthority | McpSecretStore;
|
|
81
|
+
/**
|
|
82
|
+
* Install one MCP server: acquire the package (registry archive or the
|
|
83
|
+
* workspace-authored directory), merge the connection's inputs with what the
|
|
84
|
+
* credential store already holds, record the settings entry and the accepted
|
|
85
|
+
* resolution, and project the connection into every configured agent.
|
|
86
|
+
*
|
|
87
|
+
* Failures stay typed: a refused request, an unrepresentable connection, and a
|
|
88
|
+
* credential store that will not persist a secret are three different facts,
|
|
89
|
+
* and the caller decides how each is reported.
|
|
90
|
+
*/
|
|
91
|
+
export declare const installMcpServer: (op: InstallMcpServerOperation) => Effect.Effect<JobStepResult, ExtensionManagerFailure, McpServerInstallRequirements>;
|
|
92
|
+
//# sourceMappingURL=install-operation.d.ts.map
|