@agentxm/workspace-configuration 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/dist/src/errors.d.ts +30 -0
- package/dist/src/errors.js +29 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.js +17 -0
- package/dist/src/initialization-interaction.d.ts +112 -0
- package/dist/src/initialization-interaction.js +62 -0
- package/dist/src/initialization.d.ts +199 -0
- package/dist/src/initialization.js +671 -0
- package/dist/src/inline-mcp.d.ts +29 -0
- package/dist/src/inline-mcp.js +132 -0
- package/dist/src/instruction-reconciliation.d.ts +57 -0
- package/dist/src/instruction-reconciliation.js +93 -0
- package/dist/src/mcp-import-preflight.d.ts +44 -0
- package/dist/src/mcp-import-preflight.js +277 -0
- package/dist/src/mcp-import.d.ts +40 -0
- package/dist/src/mcp-import.js +276 -0
- package/dist/src/membership.d.ts +29 -0
- package/dist/src/membership.js +162 -0
- package/dist/src/testing.d.ts +9 -0
- package/dist/src/testing.js +9 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2025-2026 AgentXM, Inc.
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the MIT license that is effective on the second anniversary of the date we make
|
|
91
|
+
the Software available. On or after that date, you may use the Software under
|
|
92
|
+
the MIT license, in which case the following will apply:
|
|
93
|
+
|
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
95
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
96
|
+
the Software without restriction, including without limitation the rights to
|
|
97
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
98
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
99
|
+
so, subject to the following conditions:
|
|
100
|
+
|
|
101
|
+
The above copyright notice and this permission notice shall be included in all
|
|
102
|
+
copies or substantial portions of the Software.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
SOFTWARE.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed failures for workspace-configuration flows. The producer owns the
|
|
3
|
+
* category choice and user-facing wording; the application boundary converts
|
|
4
|
+
* the carried fields into its error envelope verbatim. The CLI's interaction
|
|
5
|
+
* implementation also maps prompt-guard failures into this family, so setup
|
|
6
|
+
* prompts surface through the same conversion.
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
*/
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
11
|
+
declare const WorkspaceConfigurationFailed_base: Schema.Class<WorkspaceConfigurationFailed, Schema.TaggedStruct<"WorkspaceConfigurationFailed", {
|
|
12
|
+
readonly category: Schema.Literals<readonly ["conflict", "internal", "usage", "validation"]>;
|
|
13
|
+
readonly detail: Schema.String;
|
|
14
|
+
readonly suggestions: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
15
|
+
readonly description: Schema.String;
|
|
16
|
+
readonly cmd: Schema.optional<Schema.String>;
|
|
17
|
+
readonly url: Schema.optional<Schema.String>;
|
|
18
|
+
}>>>;
|
|
19
|
+
readonly recover: Schema.optional<Schema.String>;
|
|
20
|
+
readonly cmd: Schema.optional<Schema.String>;
|
|
21
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
22
|
+
}>, import("effect/Cause").YieldableError>;
|
|
23
|
+
/**
|
|
24
|
+
* A workspace-configuration flow could not proceed. `category` and `detail`
|
|
25
|
+
* carry the boundary rendering 1:1.
|
|
26
|
+
*/
|
|
27
|
+
export declare class WorkspaceConfigurationFailed extends WorkspaceConfigurationFailed_base {
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed failures for workspace-configuration flows. The producer owns the
|
|
3
|
+
* category choice and user-facing wording; the application boundary converts
|
|
4
|
+
* the carried fields into its error envelope verbatim. The CLI's interaction
|
|
5
|
+
* implementation also maps prompt-guard failures into this family, so setup
|
|
6
|
+
* prompts surface through the same conversion.
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is unstable and may change without notice.
|
|
9
|
+
*/
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
11
|
+
const CarriedSuggestedActionSchema = Schema.Struct({
|
|
12
|
+
description: Schema.String,
|
|
13
|
+
cmd: Schema.optional(Schema.String),
|
|
14
|
+
url: Schema.optional(Schema.String),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* A workspace-configuration flow could not proceed. `category` and `detail`
|
|
18
|
+
* carry the boundary rendering 1:1.
|
|
19
|
+
*/
|
|
20
|
+
export class WorkspaceConfigurationFailed extends Schema.TaggedError()("WorkspaceConfigurationFailed", {
|
|
21
|
+
category: Schema.Literals(["conflict", "internal", "usage", "validation"]),
|
|
22
|
+
detail: Schema.String,
|
|
23
|
+
suggestions: Schema.optional(Schema.Array(CarriedSuggestedActionSchema)),
|
|
24
|
+
recover: Schema.optional(Schema.String),
|
|
25
|
+
cmd: Schema.optional(Schema.String),
|
|
26
|
+
cause: Schema.optional(Schema.Unknown),
|
|
27
|
+
}) {
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-configuration feature: workspace initialization and setup flows,
|
|
3
|
+
* configured-agent membership policy, instruction-management policy over the
|
|
4
|
+
* kernel's instruction semantics, and inline workspace MCP capability policy.
|
|
5
|
+
*
|
|
6
|
+
* @experimental This API is unstable and may change without notice.
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export { WorkspaceConfigurationFailed } from "./errors.js";
|
|
10
|
+
export { bootstrapWorkspace, initializeProjectWorkspace, ensureUserWorkspaceInitialized, ensureProjectWorkspaceInitialized, type SetupAgentCandidate, } from "./initialization.js";
|
|
11
|
+
export type { InstructionSourceChoice, SetupAgentScan, SetupPlanRow, WorkspaceInitializationInteractionService, } from "./initialization-interaction.js";
|
|
12
|
+
export { WorkspaceInitializationCancelled, WorkspaceInitializationInteraction, } from "./initialization-interaction.js";
|
|
13
|
+
export { activeInstructionsConfig, disableInstructionManagement, instructionReconciliationReadiness, instructionStateIsCurrent, observeInstructions, reconcileInstructionTransition, removeInstructionTargetsFor, type InstructionReadinessFailure, } from "./instruction-reconciliation.js";
|
|
14
|
+
export { dedupe, makeAtomicMembershipSteps, validateAgentIds } from "./membership.js";
|
|
15
|
+
export { makeInlineMcpDefinition, matchesInlineMcpEntry, parseInlineMcpEnv, parseInlineMcpHeaders, splitCommand, validateInlineMcpRemoteUrl, } from "./inline-mcp.js";
|
|
16
|
+
export { preflightMcpImports, type InlineMcpDefinition, type McpImportAdoption, type McpImportCandidate, type McpImportFinding, type McpImportPreflight, type McpImportSource, } from "./mcp-import-preflight.js";
|
|
17
|
+
export { applyMcpImport, collectMcpImportSources, removeConvertedMcpConfig } from "./mcp-import.js";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-configuration feature: workspace initialization and setup flows,
|
|
3
|
+
* configured-agent membership policy, instruction-management policy over the
|
|
4
|
+
* kernel's instruction semantics, and inline workspace MCP capability policy.
|
|
5
|
+
*
|
|
6
|
+
* @experimental This API is unstable and may change without notice.
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export { WorkspaceConfigurationFailed } from "./errors.js";
|
|
10
|
+
export { bootstrapWorkspace, initializeProjectWorkspace, ensureUserWorkspaceInitialized, ensureProjectWorkspaceInitialized, } from "./initialization.js";
|
|
11
|
+
export { WorkspaceInitializationCancelled, WorkspaceInitializationInteraction, } from "./initialization-interaction.js";
|
|
12
|
+
export { activeInstructionsConfig, disableInstructionManagement, instructionReconciliationReadiness, instructionStateIsCurrent, observeInstructions, reconcileInstructionTransition, removeInstructionTargetsFor, } from "./instruction-reconciliation.js";
|
|
13
|
+
export { dedupe, makeAtomicMembershipSteps, validateAgentIds } from "./membership.js";
|
|
14
|
+
export { makeInlineMcpDefinition, matchesInlineMcpEntry, parseInlineMcpEnv, parseInlineMcpHeaders, splitCommand, validateInlineMcpRemoteUrl, } from "./inline-mcp.js";
|
|
15
|
+
export { preflightMcpImports, } from "./mcp-import-preflight.js";
|
|
16
|
+
export { applyMcpImport, collectMcpImportSources, removeConvertedMcpConfig } from "./mcp-import.js";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import * as ServiceMap from "effect/Context";
|
|
4
|
+
import type { AgentDescriptor } from "@agentxm/extension-model/unstable/agents/types";
|
|
5
|
+
import type { WorkspaceConfigurationFailed } from "./errors.js";
|
|
6
|
+
import type { WorkspaceScope } from "@agentxm/extension-model/unstable/workspace-scope";
|
|
7
|
+
import type { SetupScopeSupportCategory } from "@agentxm/workspace-state";
|
|
8
|
+
declare const WorkspaceInitializationCancelled_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 & {
|
|
9
|
+
readonly _tag: "WorkspaceInitializationCancelled";
|
|
10
|
+
} & Readonly<A>;
|
|
11
|
+
/**
|
|
12
|
+
* Typed cancellation of workspace initialization. The CLI implementation maps
|
|
13
|
+
* a prompt cancellation into this kernel-owned error; the runtime envelope
|
|
14
|
+
* treats it as a cancelled (successful) exit.
|
|
15
|
+
*/
|
|
16
|
+
export declare class WorkspaceInitializationCancelled extends WorkspaceInitializationCancelled_base<{
|
|
17
|
+
readonly message: string;
|
|
18
|
+
}> {
|
|
19
|
+
}
|
|
20
|
+
export interface InstructionSourceChoice {
|
|
21
|
+
readonly fileName: string;
|
|
22
|
+
readonly exists: boolean;
|
|
23
|
+
readonly lines: number;
|
|
24
|
+
}
|
|
25
|
+
/** One row of the setup plan presented before confirmation. */
|
|
26
|
+
export interface SetupPlanRow {
|
|
27
|
+
readonly target: string;
|
|
28
|
+
readonly action: string;
|
|
29
|
+
readonly detail: string;
|
|
30
|
+
}
|
|
31
|
+
/** Agent-detection summary presented before agent selection. */
|
|
32
|
+
export interface SetupAgentScan {
|
|
33
|
+
readonly detectedCount: number;
|
|
34
|
+
readonly retiredAgents: ReadonlyArray<{
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export interface WorkspaceInitializationInteractionService {
|
|
40
|
+
readonly selectAgents: (options: {
|
|
41
|
+
readonly allAgents: ReadonlyArray<AgentDescriptor>;
|
|
42
|
+
readonly detectedIds: ReadonlyArray<string>;
|
|
43
|
+
readonly projectDetectedIds: ReadonlyArray<string>;
|
|
44
|
+
readonly userDetectedIds: ReadonlyArray<string>;
|
|
45
|
+
readonly suggestedIds: ReadonlyArray<string>;
|
|
46
|
+
readonly configuredIds: ReadonlyArray<string>;
|
|
47
|
+
}) => Effect.Effect<ReadonlyArray<string>, WorkspaceInitializationCancelled | WorkspaceConfigurationFailed>;
|
|
48
|
+
readonly confirmInstructionSync: (options: {
|
|
49
|
+
readonly enabled: boolean;
|
|
50
|
+
}) => Effect.Effect<boolean, WorkspaceInitializationCancelled | WorkspaceConfigurationFailed>;
|
|
51
|
+
readonly selectInstructionSource: (options: {
|
|
52
|
+
readonly defaultFileName: string;
|
|
53
|
+
readonly choices: ReadonlyArray<InstructionSourceChoice>;
|
|
54
|
+
}) => Effect.Effect<string, WorkspaceInitializationCancelled | WorkspaceConfigurationFailed>;
|
|
55
|
+
readonly confirmSetupPlan: () => Effect.Effect<boolean, WorkspaceInitializationCancelled | WorkspaceConfigurationFailed>;
|
|
56
|
+
/** Present the agent scan summary. The implementation owns all wording. */
|
|
57
|
+
readonly presentAgentScan: (scan: SetupAgentScan) => Effect.Effect<void>;
|
|
58
|
+
/** Present the setup plan rows before confirmation. */
|
|
59
|
+
readonly presentSetupPlan: (rows: ReadonlyArray<SetupPlanRow>) => Effect.Effect<void>;
|
|
60
|
+
/** Present per-category scope-support outcomes for the selected agents. */
|
|
61
|
+
readonly presentScopeSupport: (scope: WorkspaceScope, categories: ReadonlyArray<SetupScopeSupportCategory>) => Effect.Effect<void>;
|
|
62
|
+
}
|
|
63
|
+
declare const WorkspaceInitializationInteraction_base: ServiceMap.ServiceClass<WorkspaceInitializationInteraction, "@agentxm/workspace-configuration/initialization-interaction/WorkspaceInitializationInteraction", WorkspaceInitializationInteractionService>;
|
|
64
|
+
export declare class WorkspaceInitializationInteraction extends WorkspaceInitializationInteraction_base {
|
|
65
|
+
}
|
|
66
|
+
export interface WorkspaceInitializationInteractionTestState {
|
|
67
|
+
readonly selectAgentsCalls: Array<{
|
|
68
|
+
readonly allAgents: ReadonlyArray<AgentDescriptor>;
|
|
69
|
+
readonly detectedIds: ReadonlyArray<string>;
|
|
70
|
+
readonly projectDetectedIds: ReadonlyArray<string>;
|
|
71
|
+
readonly userDetectedIds: ReadonlyArray<string>;
|
|
72
|
+
readonly suggestedIds: ReadonlyArray<string>;
|
|
73
|
+
readonly configuredIds: ReadonlyArray<string>;
|
|
74
|
+
}>;
|
|
75
|
+
readonly confirmInstructionSyncCalls: Array<{
|
|
76
|
+
readonly enabled: boolean;
|
|
77
|
+
}>;
|
|
78
|
+
readonly selectInstructionSourceCalls: Array<{
|
|
79
|
+
readonly defaultFileName: string;
|
|
80
|
+
readonly choices: ReadonlyArray<InstructionSourceChoice>;
|
|
81
|
+
}>;
|
|
82
|
+
readonly confirmSetupPlanCalls: Array<null>;
|
|
83
|
+
readonly presentAgentScanCalls: Array<SetupAgentScan>;
|
|
84
|
+
readonly presentSetupPlanCalls: Array<ReadonlyArray<SetupPlanRow>>;
|
|
85
|
+
readonly presentScopeSupportCalls: Array<{
|
|
86
|
+
readonly scope: WorkspaceScope;
|
|
87
|
+
readonly categories: ReadonlyArray<SetupScopeSupportCategory>;
|
|
88
|
+
}>;
|
|
89
|
+
}
|
|
90
|
+
export declare const WorkspaceInitializationInteractionTest: (overrides?: {
|
|
91
|
+
readonly selectAgents?: (options: {
|
|
92
|
+
readonly allAgents: ReadonlyArray<AgentDescriptor>;
|
|
93
|
+
readonly detectedIds: ReadonlyArray<string>;
|
|
94
|
+
readonly projectDetectedIds: ReadonlyArray<string>;
|
|
95
|
+
readonly userDetectedIds: ReadonlyArray<string>;
|
|
96
|
+
readonly suggestedIds: ReadonlyArray<string>;
|
|
97
|
+
readonly configuredIds: ReadonlyArray<string>;
|
|
98
|
+
}) => Effect.Effect<ReadonlyArray<string>, WorkspaceInitializationCancelled | WorkspaceConfigurationFailed>;
|
|
99
|
+
readonly confirmInstructionSync?: (options: {
|
|
100
|
+
readonly enabled: boolean;
|
|
101
|
+
}) => Effect.Effect<boolean, WorkspaceInitializationCancelled | WorkspaceConfigurationFailed>;
|
|
102
|
+
readonly selectInstructionSource?: (options: {
|
|
103
|
+
readonly defaultFileName: string;
|
|
104
|
+
readonly choices: ReadonlyArray<InstructionSourceChoice>;
|
|
105
|
+
}) => Effect.Effect<string, WorkspaceInitializationCancelled | WorkspaceConfigurationFailed>;
|
|
106
|
+
readonly confirmSetupPlan?: () => Effect.Effect<boolean, WorkspaceInitializationCancelled | WorkspaceConfigurationFailed>;
|
|
107
|
+
}) => {
|
|
108
|
+
layer: Layer.Layer<WorkspaceInitializationInteraction, never, never>;
|
|
109
|
+
state: WorkspaceInitializationInteractionTestState;
|
|
110
|
+
};
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=initialization-interaction.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as Data from "effect/Data";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as ServiceMap from "effect/Context";
|
|
5
|
+
/**
|
|
6
|
+
* Typed cancellation of workspace initialization. The CLI implementation maps
|
|
7
|
+
* a prompt cancellation into this kernel-owned error; the runtime envelope
|
|
8
|
+
* treats it as a cancelled (successful) exit.
|
|
9
|
+
*/
|
|
10
|
+
export class WorkspaceInitializationCancelled extends Data.TaggedError("WorkspaceInitializationCancelled") {
|
|
11
|
+
}
|
|
12
|
+
export class WorkspaceInitializationInteraction extends ServiceMap.Service()("@agentxm/workspace-configuration/initialization-interaction/WorkspaceInitializationInteraction") {
|
|
13
|
+
}
|
|
14
|
+
export const WorkspaceInitializationInteractionTest = (overrides) => {
|
|
15
|
+
const state = {
|
|
16
|
+
selectAgentsCalls: [],
|
|
17
|
+
confirmInstructionSyncCalls: [],
|
|
18
|
+
selectInstructionSourceCalls: [],
|
|
19
|
+
confirmSetupPlanCalls: [],
|
|
20
|
+
presentAgentScanCalls: [],
|
|
21
|
+
presentSetupPlanCalls: [],
|
|
22
|
+
presentScopeSupportCalls: [],
|
|
23
|
+
};
|
|
24
|
+
const layer = Layer.succeed(WorkspaceInitializationInteraction, {
|
|
25
|
+
selectAgents: (options) => Effect.gen(function* () {
|
|
26
|
+
state.selectAgentsCalls.push(options);
|
|
27
|
+
return yield* overrides?.selectAgents?.(options) ??
|
|
28
|
+
Effect.succeed([
|
|
29
|
+
...new Set([
|
|
30
|
+
...options.configuredIds,
|
|
31
|
+
...options.projectDetectedIds,
|
|
32
|
+
...options.suggestedIds,
|
|
33
|
+
]),
|
|
34
|
+
]);
|
|
35
|
+
}),
|
|
36
|
+
confirmInstructionSync: (options) => Effect.gen(function* () {
|
|
37
|
+
state.confirmInstructionSyncCalls.push(options);
|
|
38
|
+
return yield* overrides?.confirmInstructionSync?.(options) ??
|
|
39
|
+
Effect.succeed(options.enabled);
|
|
40
|
+
}),
|
|
41
|
+
selectInstructionSource: (options) => Effect.gen(function* () {
|
|
42
|
+
state.selectInstructionSourceCalls.push(options);
|
|
43
|
+
return yield* overrides?.selectInstructionSource?.(options) ??
|
|
44
|
+
Effect.succeed(options.defaultFileName);
|
|
45
|
+
}),
|
|
46
|
+
confirmSetupPlan: () => Effect.gen(function* () {
|
|
47
|
+
state.confirmSetupPlanCalls.push(null);
|
|
48
|
+
return yield* overrides?.confirmSetupPlan?.() ?? Effect.succeed(true);
|
|
49
|
+
}),
|
|
50
|
+
presentAgentScan: (scan) => Effect.sync(() => {
|
|
51
|
+
state.presentAgentScanCalls.push(scan);
|
|
52
|
+
}),
|
|
53
|
+
presentSetupPlan: (rows) => Effect.sync(() => {
|
|
54
|
+
state.presentSetupPlanCalls.push(rows);
|
|
55
|
+
}),
|
|
56
|
+
presentScopeSupport: (scope, categories) => Effect.sync(() => {
|
|
57
|
+
state.presentScopeSupportCalls.push({ scope, categories });
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
60
|
+
return { layer, state };
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=initialization-interaction.js.map
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkspaceMutations initialization logic.
|
|
3
|
+
*
|
|
4
|
+
* Handles initial setup of project and user-scope workspaces: agent detection,
|
|
5
|
+
* interactive agent selection, and settings/lockfile creation.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
import * as FileSystem from "effect/FileSystem";
|
|
10
|
+
import * as Path from "effect/Path";
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import { type ConfigurableAgentId } from "@agentxm/extension-model/unstable/agents/types";
|
|
13
|
+
import { WorkspaceConfigurationFailed } from "./errors.js";
|
|
14
|
+
import { type Settings } from "@agentxm/workspace-state";
|
|
15
|
+
import type { WorkspaceMutationsOptions } from "@agentxm/workspace-state";
|
|
16
|
+
import { type WorkspaceLocation } from "@agentxm/workspace-state";
|
|
17
|
+
export interface SetupAgentCandidate {
|
|
18
|
+
readonly id: ConfigurableAgentId;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly projectDetected: boolean;
|
|
21
|
+
readonly userDetected: boolean;
|
|
22
|
+
readonly state: "selected" | "suggested" | "available" | "retired";
|
|
23
|
+
readonly selectionReason?: "explicit" | "project-detected" | "user-detected" | "catalog-suggestion";
|
|
24
|
+
}
|
|
25
|
+
export declare const initializeProjectWorkspace: (localDir: string, options: WorkspaceMutationsOptions) => Effect.Effect<{
|
|
26
|
+
settings: {
|
|
27
|
+
readonly [x: string]: unknown;
|
|
28
|
+
readonly $schema?: string;
|
|
29
|
+
readonly owner?: string & import("effect/Brand").Brand<"Handle">;
|
|
30
|
+
readonly publish?: {
|
|
31
|
+
readonly defaultVisibility?: "public" | "private" | undefined;
|
|
32
|
+
};
|
|
33
|
+
readonly minimumReleaseAge?: string;
|
|
34
|
+
readonly minimumReleaseAgeExclude?: readonly {
|
|
35
|
+
readonly owner: string & import("effect/Brand").Brand<"Handle">;
|
|
36
|
+
readonly type: "knowledge" | "skill" | "mcp-server" | "subagent" | "rule" | "hook" | "pack" | "*";
|
|
37
|
+
readonly name: "*" | (string & import("effect/Brand").Brand<"ExtensionName">);
|
|
38
|
+
}[];
|
|
39
|
+
readonly agents?: readonly ("claude-code" | "codex" | "cursor" | "github-copilot-cli" | "opencode" | "adal" | "aider-desk" | "amp" | "antigravity" | "antigravity-cli" | "augment" | "cline" | "codearts-agent" | "codebuddy" | "codemaker" | "codestudio" | "command-code" | "continue" | "cortex" | "crush" | "deepagents" | "devin" | "dexto" | "droid" | "firebender" | "forgecode" | "gemini-cli" | "goose" | "grok-cli" | "hermes" | "ibm-bob" | "iflow-cli" | "junie" | "lingma" | "kilo" | "kimi-cli" | "kiro-cli" | "kode" | "mcpjam" | "minimax-code" | "mistral-vibe" | "mux" | "neovate" | "openclaw" | "openhands" | "ona" | "pi" | "pochi" | "qoder" | "qoder-cn" | "qwen-code" | "replit" | "roo" | "rovodev" | "tabnine-cli" | "trae-cn" | "trae" | "warp" | "windsurf" | "zencoder" | "zed" | "zenflow")[];
|
|
40
|
+
readonly instructionFiles?: false | {
|
|
41
|
+
readonly fileName?: string;
|
|
42
|
+
readonly gitignoreAliases?: boolean;
|
|
43
|
+
};
|
|
44
|
+
readonly sources?: readonly ({
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly type: "github";
|
|
47
|
+
readonly url: URL;
|
|
48
|
+
} | {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly type: "gitlab";
|
|
51
|
+
readonly url: URL;
|
|
52
|
+
} | {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly type: "bitbucket";
|
|
55
|
+
readonly url: URL;
|
|
56
|
+
} | {
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly type: "azurerepos";
|
|
59
|
+
readonly url: URL;
|
|
60
|
+
} | {
|
|
61
|
+
readonly name: string;
|
|
62
|
+
readonly type: "registry";
|
|
63
|
+
readonly location: URL;
|
|
64
|
+
})[];
|
|
65
|
+
readonly skills?: {
|
|
66
|
+
readonly [x: string]: {
|
|
67
|
+
readonly source: string;
|
|
68
|
+
readonly enabled: boolean;
|
|
69
|
+
readonly origin?: "bundled";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
readonly skillsConfig?: {
|
|
73
|
+
readonly dir?: string;
|
|
74
|
+
};
|
|
75
|
+
readonly rules?: {
|
|
76
|
+
readonly [x: string]: {
|
|
77
|
+
readonly source: string;
|
|
78
|
+
readonly enabled: boolean;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
readonly rulesConfig?: {
|
|
82
|
+
readonly dir?: string;
|
|
83
|
+
};
|
|
84
|
+
readonly hooks?: {
|
|
85
|
+
readonly [x: string]: {
|
|
86
|
+
readonly source: string;
|
|
87
|
+
readonly enabled: boolean;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly hooksConfig?: {
|
|
91
|
+
readonly dir?: string;
|
|
92
|
+
};
|
|
93
|
+
readonly knowledge?: {
|
|
94
|
+
readonly [x: string]: {
|
|
95
|
+
readonly source: string;
|
|
96
|
+
readonly enabled: boolean;
|
|
97
|
+
readonly instructionEntry?: boolean;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly knowledgeConfig?: {
|
|
101
|
+
readonly dir?: string;
|
|
102
|
+
readonly instructions?: boolean;
|
|
103
|
+
};
|
|
104
|
+
readonly subagents?: {
|
|
105
|
+
readonly [x: string]: {
|
|
106
|
+
readonly source: string;
|
|
107
|
+
readonly enabled: boolean;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly subagentsConfig?: {
|
|
111
|
+
readonly dir?: string;
|
|
112
|
+
};
|
|
113
|
+
readonly packs?: {
|
|
114
|
+
readonly [x: string]: {
|
|
115
|
+
readonly source: string;
|
|
116
|
+
readonly enabled: boolean;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
readonly packsConfig?: {
|
|
120
|
+
readonly dir?: string;
|
|
121
|
+
};
|
|
122
|
+
readonly mcpServers?: {
|
|
123
|
+
readonly [x: string]: {
|
|
124
|
+
readonly source: string;
|
|
125
|
+
readonly enabled: boolean;
|
|
126
|
+
readonly env: {
|
|
127
|
+
readonly [x: string]: string;
|
|
128
|
+
};
|
|
129
|
+
readonly url?: string | undefined;
|
|
130
|
+
readonly agents?: readonly ("claude-code" | "codex" | "cursor" | "github-copilot-cli" | "opencode" | "adal" | "aider-desk" | "amp" | "antigravity" | "antigravity-cli" | "augment" | "cline" | "codearts-agent" | "codebuddy" | "codemaker" | "codestudio" | "command-code" | "continue" | "cortex" | "crush" | "deepagents" | "devin" | "dexto" | "droid" | "firebender" | "forgecode" | "gemini-cli" | "goose" | "grok-cli" | "hermes" | "ibm-bob" | "iflow-cli" | "junie" | "lingma" | "kilo" | "kimi-cli" | "kiro-cli" | "kode" | "mcpjam" | "minimax-code" | "mistral-vibe" | "mux" | "neovate" | "openclaw" | "openhands" | "ona" | "pi" | "pochi" | "qoder" | "qoder-cn" | "qwen-code" | "replit" | "roo" | "rovodev" | "tabnine-cli" | "trae-cn" | "trae" | "warp" | "windsurf" | "zencoder" | "zed" | "zenflow")[] | undefined;
|
|
131
|
+
readonly headers?: {
|
|
132
|
+
readonly [x: string]: string;
|
|
133
|
+
} | undefined;
|
|
134
|
+
readonly command?: string | undefined;
|
|
135
|
+
readonly args?: readonly string[] | undefined;
|
|
136
|
+
readonly kind?: "sourced" | undefined;
|
|
137
|
+
} | {
|
|
138
|
+
readonly enabled: boolean;
|
|
139
|
+
readonly env: {
|
|
140
|
+
readonly [x: string]: string;
|
|
141
|
+
};
|
|
142
|
+
readonly kind: "inline";
|
|
143
|
+
readonly url?: string | undefined;
|
|
144
|
+
readonly agents?: readonly ("claude-code" | "codex" | "cursor" | "github-copilot-cli" | "opencode" | "adal" | "aider-desk" | "amp" | "antigravity" | "antigravity-cli" | "augment" | "cline" | "codearts-agent" | "codebuddy" | "codemaker" | "codestudio" | "command-code" | "continue" | "cortex" | "crush" | "deepagents" | "devin" | "dexto" | "droid" | "firebender" | "forgecode" | "gemini-cli" | "goose" | "grok-cli" | "hermes" | "ibm-bob" | "iflow-cli" | "junie" | "lingma" | "kilo" | "kimi-cli" | "kiro-cli" | "kode" | "mcpjam" | "minimax-code" | "mistral-vibe" | "mux" | "neovate" | "openclaw" | "openhands" | "ona" | "pi" | "pochi" | "qoder" | "qoder-cn" | "qwen-code" | "replit" | "roo" | "rovodev" | "tabnine-cli" | "trae-cn" | "trae" | "warp" | "windsurf" | "zencoder" | "zed" | "zenflow")[] | undefined;
|
|
145
|
+
readonly source?: undefined;
|
|
146
|
+
readonly headers?: {
|
|
147
|
+
readonly [x: string]: string;
|
|
148
|
+
} | undefined;
|
|
149
|
+
readonly command?: string | undefined;
|
|
150
|
+
readonly args?: readonly string[] | undefined;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
readonly mcpServersConfig?: {
|
|
154
|
+
readonly dir?: string;
|
|
155
|
+
};
|
|
156
|
+
readonly lint?: {
|
|
157
|
+
readonly rules?: {
|
|
158
|
+
readonly [x: string]: "off" | "info" | "warn" | "error";
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
agentCandidates: readonly SetupAgentCandidate[];
|
|
163
|
+
confirmed: boolean;
|
|
164
|
+
}, WorkspaceConfigurationFailed | import("./initialization-interaction.js").WorkspaceInitializationCancelled | import("@agentxm/workspace-state").SettingsWriteError | import("@agentxm/workspace-state").LockfileWriteError | import("@agentxm/extension-workspace").InstructionMaintenanceFailure, FileSystem.FileSystem | Path.Path>;
|
|
165
|
+
interface WorkspaceInitializationState {
|
|
166
|
+
readonly settings: Settings;
|
|
167
|
+
readonly initialized: boolean;
|
|
168
|
+
readonly wouldInitialize: boolean;
|
|
169
|
+
readonly cancelled: boolean;
|
|
170
|
+
readonly agentCandidates: ReadonlyArray<SetupAgentCandidate>;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Ensure the user workspace has axm.json and axm-lock.yaml.
|
|
174
|
+
*
|
|
175
|
+
* Creates missing files with empty defaults.
|
|
176
|
+
*
|
|
177
|
+
* @param workspaceRoot - Path to the user workspace root
|
|
178
|
+
*/
|
|
179
|
+
export declare const ensureUserWorkspaceInitialized: (workspaceRoot: string, options: WorkspaceMutationsOptions) => Effect.Effect<WorkspaceInitializationState, WorkspaceConfigurationFailed | import("./initialization-interaction.js").WorkspaceInitializationCancelled | import("@agentxm/workspace-state").WorkspaceSnapshotError | import("@agentxm/workspace-state").SettingsWriteError | import("@agentxm/workspace-state").LockfileWriteError, FileSystem.FileSystem | Path.Path>;
|
|
180
|
+
/**
|
|
181
|
+
* Ensure project workspace is initialized, returning local settings.
|
|
182
|
+
*
|
|
183
|
+
* Reads existing local settings or runs the initialization flow when missing.
|
|
184
|
+
*
|
|
185
|
+
* @param localDir - Path to local .axm directory
|
|
186
|
+
* @param options - WorkspaceMutations options
|
|
187
|
+
* @returns Effect yielding local Settings
|
|
188
|
+
*/
|
|
189
|
+
export declare const ensureProjectWorkspaceInitialized: (localDir: string, options: WorkspaceMutationsOptions) => Effect.Effect<WorkspaceInitializationState, WorkspaceConfigurationFailed | import("./initialization-interaction.js").WorkspaceInitializationCancelled | import("@agentxm/workspace-state").SettingsWriteError | import("@agentxm/workspace-state").LockfileWriteError | import("@agentxm/extension-workspace").InstructionMaintenanceFailure, FileSystem.FileSystem | Path.Path>;
|
|
190
|
+
export declare const bootstrapWorkspace: (options: WorkspaceMutationsOptions) => Effect.Effect<{
|
|
191
|
+
location: WorkspaceLocation;
|
|
192
|
+
settings: Settings;
|
|
193
|
+
initialized: boolean;
|
|
194
|
+
wouldInitialize: boolean;
|
|
195
|
+
cancelled: boolean;
|
|
196
|
+
agentCandidates: ReadonlyArray<SetupAgentCandidate>;
|
|
197
|
+
}, WorkspaceConfigurationFailed | import("./initialization-interaction.js").WorkspaceInitializationCancelled | import("@agentxm/workspace-state").SettingsWriteError | import("@agentxm/workspace-state").LockfileWriteError | import("@agentxm/extension-workspace").InstructionMaintenanceFailure, FileSystem.FileSystem | Path.Path>;
|
|
198
|
+
export {};
|
|
199
|
+
//# sourceMappingURL=initialization.d.ts.map
|