expandai 0.0.2 → 0.0.4
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/README.md +42 -5
- package/build/dts/ApiClient.d.ts +128 -194
- package/build/dts/ApiClient.d.ts.map +1 -1
- package/build/dts/Auth/Domain.d.ts +95 -0
- package/build/dts/Auth/Domain.d.ts.map +1 -0
- package/build/dts/Auth/ManualAuthorization.d.ts +107 -0
- package/build/dts/Auth/ManualAuthorization.d.ts.map +1 -0
- package/build/dts/Auth/PendingInit.d.ts +35 -0
- package/build/dts/Auth/PendingInit.d.ts.map +1 -0
- package/build/dts/Auth/Pkce.d.ts +10 -0
- package/build/dts/Auth/Pkce.d.ts.map +1 -0
- package/build/dts/Auth/SetupGrantAuthorization.d.ts +34 -0
- package/build/dts/Auth/SetupGrantAuthorization.d.ts.map +1 -0
- package/build/dts/Authentication.d.ts +10 -9
- package/build/dts/Authentication.d.ts.map +1 -1
- package/build/dts/BrowserOAuth.d.ts +7 -7
- package/build/dts/BrowserOAuth.d.ts.map +1 -1
- package/build/dts/CommandPath.d.ts +2 -0
- package/build/dts/CommandPath.d.ts.map +1 -0
- package/build/dts/Commands/Fetch.d.ts.map +1 -1
- package/build/dts/Commands/Hook.d.ts +5 -5
- package/build/dts/Commands/Init.d.ts +55 -0
- package/build/dts/Commands/Init.d.ts.map +1 -0
- package/build/dts/Commands/Mcp.d.ts +6 -6
- package/build/dts/Commands/Search.d.ts.map +1 -1
- package/build/dts/Commands/Skill.d.ts +4 -4
- package/build/dts/Commands/Status.d.ts +27 -0
- package/build/dts/Commands/Status.d.ts.map +1 -0
- package/build/dts/Commands/Telemetry.d.ts +7 -0
- package/build/dts/Commands/Telemetry.d.ts.map +1 -0
- package/build/dts/Commands/Uninstall.d.ts +4 -4
- package/build/dts/Config.d.ts +108 -17
- package/build/dts/Config.d.ts.map +1 -1
- package/build/dts/Hook/SnapshotNote.d.ts +8 -4
- package/build/dts/Hook/SnapshotNote.d.ts.map +1 -1
- package/build/dts/Init/ClaudeAdapter.d.ts +61 -0
- package/build/dts/Init/ClaudeAdapter.d.ts.map +1 -0
- package/build/dts/Init/ClaudeProfile.d.ts +77 -0
- package/build/dts/Init/ClaudeProfile.d.ts.map +1 -0
- package/build/dts/Init/Domain.d.ts +139 -0
- package/build/dts/Init/Domain.d.ts.map +1 -0
- package/build/dts/Init/HarnessAdapter.d.ts +33 -0
- package/build/dts/Init/HarnessAdapter.d.ts.map +1 -0
- package/build/dts/Init/HarnessDetector.d.ts +19 -0
- package/build/dts/Init/HarnessDetector.d.ts.map +1 -0
- package/build/dts/Init/HarnessRegistry.d.ts +50 -0
- package/build/dts/Init/HarnessRegistry.d.ts.map +1 -0
- package/build/dts/Init/MutationTransaction.d.ts +96 -0
- package/build/dts/Init/MutationTransaction.d.ts.map +1 -0
- package/build/dts/Init/Service.d.ts +72 -0
- package/build/dts/Init/Service.d.ts.map +1 -0
- package/build/dts/Init/StandardAdapters.d.ts +42 -0
- package/build/dts/Init/StandardAdapters.d.ts.map +1 -0
- package/build/dts/Init/Status.d.ts +149 -0
- package/build/dts/Init/Status.d.ts.map +1 -0
- package/build/dts/Install/Claude/Hook.d.ts +57 -29
- package/build/dts/Install/Claude/Hook.d.ts.map +1 -1
- package/build/dts/Install/Claude/Mcp.d.ts +21 -18
- package/build/dts/Install/Claude/Mcp.d.ts.map +1 -1
- package/build/dts/Install/Claude/Skill.d.ts +14 -15
- package/build/dts/Install/Claude/Skill.d.ts.map +1 -1
- package/build/dts/Install/Codex/Mcp.d.ts +14 -8
- package/build/dts/Install/Codex/Mcp.d.ts.map +1 -1
- package/build/dts/Install/Codex/Skill.d.ts +4 -2
- package/build/dts/Install/Codex/Skill.d.ts.map +1 -1
- package/build/dts/Install/Cursor/Mcp.d.ts +13 -13
- package/build/dts/Install/Cursor/Mcp.d.ts.map +1 -1
- package/build/dts/Install/Cursor/Skill.d.ts +4 -2
- package/build/dts/Install/Cursor/Skill.d.ts.map +1 -1
- package/build/dts/Install/Domain.d.ts +35 -5
- package/build/dts/Install/Domain.d.ts.map +1 -1
- package/build/dts/Install/Hook.d.ts +4 -4
- package/build/dts/Install/Hook.d.ts.map +1 -1
- package/build/dts/Install/Mcp.d.ts +5 -5
- package/build/dts/Install/Mcp.d.ts.map +1 -1
- package/build/dts/Install/Opencode/Hook.d.ts +4 -3
- package/build/dts/Install/Opencode/Hook.d.ts.map +1 -1
- package/build/dts/Install/Opencode/Mcp.d.ts +11 -11
- package/build/dts/Install/Opencode/Mcp.d.ts.map +1 -1
- package/build/dts/Install/Opencode/Skill.d.ts +4 -2
- package/build/dts/Install/Opencode/Skill.d.ts.map +1 -1
- package/build/dts/Install/Skill.d.ts +3 -3
- package/build/dts/Install/Uninstall.d.ts +6 -6
- package/build/dts/Install/Uninstall.d.ts.map +1 -1
- package/build/dts/MarkdownAnsi.d.ts +29 -0
- package/build/dts/MarkdownAnsi.d.ts.map +1 -0
- package/build/dts/Mcp/ExpandDocs.d.ts +17 -5
- package/build/dts/Mcp/ExpandDocs.d.ts.map +1 -1
- package/build/dts/Mcp/Server.d.ts +1 -1
- package/build/dts/Mcp/Server.d.ts.map +1 -1
- package/build/dts/Mcp/tools/Citations.d.ts +100 -71
- package/build/dts/Mcp/tools/Citations.d.ts.map +1 -1
- package/build/dts/Mcp/tools/Fetch.d.ts +16 -15
- package/build/dts/Mcp/tools/Fetch.d.ts.map +1 -1
- package/build/dts/SecureFile.d.ts +23 -0
- package/build/dts/SecureFile.d.ts.map +1 -0
- package/build/dts/Snippets.d.ts +11 -12
- package/build/dts/Snippets.d.ts.map +1 -1
- package/build/dts/Telemetry.d.ts +30 -0
- package/build/dts/Telemetry.d.ts.map +1 -0
- package/build/dts/Version.d.ts +2 -0
- package/build/dts/Version.d.ts.map +1 -0
- package/build/dts/Xdg.d.ts +11 -0
- package/build/dts/Xdg.d.ts.map +1 -0
- package/build/esm/ApiClient.js +133 -10
- package/build/esm/ApiClient.js.map +1 -1
- package/build/esm/Auth/Domain.js +56 -0
- package/build/esm/Auth/Domain.js.map +1 -0
- package/build/esm/Auth/ManualAuthorization.js +253 -0
- package/build/esm/Auth/ManualAuthorization.js.map +1 -0
- package/build/esm/Auth/PendingInit.js +267 -0
- package/build/esm/Auth/PendingInit.js.map +1 -0
- package/build/esm/Auth/Pkce.js +23 -0
- package/build/esm/Auth/Pkce.js.map +1 -0
- package/build/esm/Auth/SetupGrantAuthorization.js +91 -0
- package/build/esm/Auth/SetupGrantAuthorization.js.map +1 -0
- package/build/esm/Authentication.js +38 -7
- package/build/esm/Authentication.js.map +1 -1
- package/build/esm/BrowserOAuth.js +7 -10
- package/build/esm/BrowserOAuth.js.map +1 -1
- package/build/esm/CommandPath.js +31 -0
- package/build/esm/CommandPath.js.map +1 -0
- package/build/esm/Commands/Fetch.js +30 -6
- package/build/esm/Commands/Fetch.js.map +1 -1
- package/build/esm/Commands/Init.js +371 -0
- package/build/esm/Commands/Init.js.map +1 -0
- package/build/esm/Commands/Search.js +6 -3
- package/build/esm/Commands/Search.js.map +1 -1
- package/build/esm/Commands/Status.js +186 -0
- package/build/esm/Commands/Status.js.map +1 -0
- package/build/esm/Commands/Telemetry.js +23 -0
- package/build/esm/Commands/Telemetry.js.map +1 -0
- package/build/esm/Config.js +502 -28
- package/build/esm/Config.js.map +1 -1
- package/build/esm/Hook/Claude.js +1 -1
- package/build/esm/Hook/Claude.js.map +1 -1
- package/build/esm/Hook/SnapshotNote.js +54 -7
- package/build/esm/Hook/SnapshotNote.js.map +1 -1
- package/build/esm/Init/ClaudeAdapter.js +137 -0
- package/build/esm/Init/ClaudeAdapter.js.map +1 -0
- package/build/esm/Init/ClaudeProfile.js +344 -0
- package/build/esm/Init/ClaudeProfile.js.map +1 -0
- package/build/esm/Init/Domain.js +118 -0
- package/build/esm/Init/Domain.js.map +1 -0
- package/build/esm/Init/HarnessAdapter.js +21 -0
- package/build/esm/Init/HarnessAdapter.js.map +1 -0
- package/build/esm/Init/HarnessDetector.js +65 -0
- package/build/esm/Init/HarnessDetector.js.map +1 -0
- package/build/esm/Init/HarnessRegistry.js +58 -0
- package/build/esm/Init/HarnessRegistry.js.map +1 -0
- package/build/esm/Init/MutationTransaction.js +494 -0
- package/build/esm/Init/MutationTransaction.js.map +1 -0
- package/build/esm/Init/Service.js +319 -0
- package/build/esm/Init/Service.js.map +1 -0
- package/build/esm/Init/StandardAdapters.js +116 -0
- package/build/esm/Init/StandardAdapters.js.map +1 -0
- package/build/esm/Init/Status.js +215 -0
- package/build/esm/Init/Status.js.map +1 -0
- package/build/esm/Install/Claude/Hook.js +52 -64
- package/build/esm/Install/Claude/Hook.js.map +1 -1
- package/build/esm/Install/Claude/Mcp.js +56 -26
- package/build/esm/Install/Claude/Mcp.js.map +1 -1
- package/build/esm/Install/Claude/Skill.js +49 -27
- package/build/esm/Install/Claude/Skill.js.map +1 -1
- package/build/esm/Install/Codex/Mcp.js +9 -4
- package/build/esm/Install/Codex/Mcp.js.map +1 -1
- package/build/esm/Install/Codex/Skill.js +4 -1
- package/build/esm/Install/Codex/Skill.js.map +1 -1
- package/build/esm/Install/Cursor/Mcp.js +7 -4
- package/build/esm/Install/Cursor/Mcp.js.map +1 -1
- package/build/esm/Install/Cursor/Skill.js +4 -1
- package/build/esm/Install/Cursor/Skill.js.map +1 -1
- package/build/esm/Install/Domain.js +60 -3
- package/build/esm/Install/Domain.js.map +1 -1
- package/build/esm/Install/Hook.js.map +1 -1
- package/build/esm/Install/Mcp.js +1 -1
- package/build/esm/Install/Mcp.js.map +1 -1
- package/build/esm/Install/Opencode/Hook.js +1 -1
- package/build/esm/Install/Opencode/Hook.js.map +1 -1
- package/build/esm/Install/Opencode/Mcp.js +6 -3
- package/build/esm/Install/Opencode/Mcp.js.map +1 -1
- package/build/esm/Install/Opencode/Skill.js +4 -1
- package/build/esm/Install/Opencode/Skill.js.map +1 -1
- package/build/esm/Install/Opencode/expandai-webfetch.js +27 -9
- package/build/esm/Install/Skill.js.map +1 -1
- package/build/esm/Install/Uninstall.js +2 -2
- package/build/esm/Install/Uninstall.js.map +1 -1
- package/build/esm/MarkdownAnsi.js +142 -0
- package/build/esm/MarkdownAnsi.js.map +1 -0
- package/build/esm/Mcp/ExpandDocs.js +44 -52
- package/build/esm/Mcp/ExpandDocs.js.map +1 -1
- package/build/esm/Mcp/RequestHeaders.js.map +1 -1
- package/build/esm/Mcp/Server.js +2 -1
- package/build/esm/Mcp/Server.js.map +1 -1
- package/build/esm/Mcp/tools/Citations.js +109 -8
- package/build/esm/Mcp/tools/Citations.js.map +1 -1
- package/build/esm/Mcp/tools/Fetch.js +36 -12
- package/build/esm/Mcp/tools/Fetch.js.map +1 -1
- package/build/esm/SecureFile.js +36 -0
- package/build/esm/SecureFile.js.map +1 -0
- package/build/esm/Snippets.js +12 -1
- package/build/esm/Snippets.js.map +1 -1
- package/build/esm/Telemetry.js +157 -0
- package/build/esm/Telemetry.js.map +1 -0
- package/build/esm/Version.js +4 -0
- package/build/esm/Version.js.map +1 -0
- package/build/esm/Xdg.js +15 -0
- package/build/esm/Xdg.js.map +1 -0
- package/build/esm/main.js +122 -14
- package/build/esm/main.js.map +1 -1
- package/build/skills/expandai/SKILL.md +37 -8
- package/package.json +4 -4
- package/src/ApiClient.ts +206 -13
- package/src/Auth/Domain.ts +63 -0
- package/src/Auth/ManualAuthorization.ts +296 -0
- package/src/Auth/PendingInit.ts +338 -0
- package/src/Auth/Pkce.ts +26 -0
- package/src/Auth/SetupGrantAuthorization.ts +116 -0
- package/src/Authentication.ts +49 -11
- package/src/BrowserOAuth.ts +10 -12
- package/src/CommandPath.ts +30 -0
- package/src/Commands/Fetch.ts +42 -11
- package/src/Commands/Init.ts +489 -0
- package/src/Commands/Search.ts +8 -3
- package/src/Commands/Status.ts +228 -0
- package/src/Commands/Telemetry.ts +42 -0
- package/src/Config.ts +695 -50
- package/src/Hook/Claude.ts +1 -1
- package/src/Hook/SnapshotNote.ts +55 -7
- package/src/Init/ClaudeAdapter.ts +191 -0
- package/src/Init/ClaudeProfile.ts +453 -0
- package/src/Init/Domain.ts +153 -0
- package/src/Init/HarnessAdapter.ts +35 -0
- package/src/Init/HarnessDetector.ts +77 -0
- package/src/Init/HarnessRegistry.ts +87 -0
- package/src/Init/MutationTransaction.ts +747 -0
- package/src/Init/Service.ts +385 -0
- package/src/Init/StandardAdapters.ts +141 -0
- package/src/Init/Status.ts +253 -0
- package/src/Install/Claude/Hook.ts +81 -91
- package/src/Install/Claude/Mcp.ts +80 -33
- package/src/Install/Claude/Skill.ts +70 -37
- package/src/Install/Codex/Mcp.ts +14 -9
- package/src/Install/Codex/Skill.ts +9 -5
- package/src/Install/Cursor/Mcp.ts +12 -9
- package/src/Install/Cursor/Skill.ts +9 -5
- package/src/Install/Domain.ts +77 -4
- package/src/Install/Hook.ts +3 -3
- package/src/Install/Mcp.ts +6 -6
- package/src/Install/Opencode/Hook.ts +5 -5
- package/src/Install/Opencode/Mcp.ts +11 -8
- package/src/Install/Opencode/Skill.ts +9 -5
- package/src/Install/Opencode/expandai-webfetch.js +27 -9
- package/src/Install/Skill.ts +3 -3
- package/src/Install/Uninstall.ts +3 -3
- package/src/MarkdownAnsi.ts +162 -0
- package/src/Mcp/ExpandDocs.ts +46 -55
- package/src/Mcp/Server.ts +2 -1
- package/src/Mcp/tools/Citations.ts +117 -8
- package/src/Mcp/tools/Fetch.ts +40 -14
- package/src/SecureFile.ts +70 -0
- package/src/Snippets.ts +19 -12
- package/src/Telemetry.ts +186 -0
- package/src/Version.ts +3 -0
- package/src/Xdg.ts +18 -0
- package/src/main.ts +171 -12
- package/build/dts/DeviceAuth.d.ts +0 -87
- package/build/dts/DeviceAuth.d.ts.map +0 -1
- package/build/esm/DeviceAuth.js +0 -127
- package/build/esm/DeviceAuth.js.map +0 -1
- package/src/DeviceAuth.ts +0 -193
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Effect, Schema } from 'effect';
|
|
2
|
+
import { ClaudeAdapter } from './ClaudeAdapter.js';
|
|
3
|
+
import type { InitHarness, InitScope } from './Domain.js';
|
|
4
|
+
import type { HarnessConfigurationError, HarnessInspection, HarnessInspectionError } from './HarnessAdapter.js';
|
|
5
|
+
import { CodexAdapter, CursorAdapter, OpencodeAdapter } from './StandardAdapters.js';
|
|
6
|
+
export interface HarnessAdapterContract {
|
|
7
|
+
readonly harness: InitHarness;
|
|
8
|
+
readonly inspect: (scope: InitScope) => Effect.Effect<HarnessInspection, HarnessInspectionError>;
|
|
9
|
+
readonly configure: (scope: InitScope) => Effect.Effect<HarnessInspection, HarnessConfigurationError>;
|
|
10
|
+
}
|
|
11
|
+
interface HarnessRegistryContract {
|
|
12
|
+
readonly inspect: (harness: InitHarness, scope: InitScope) => Effect.Effect<HarnessInspection, UnsupportedInitHarnessError | HarnessInspectionError>;
|
|
13
|
+
readonly configure: (harness: InitHarness, scope: InitScope) => Effect.Effect<HarnessInspection, UnsupportedInitHarnessError | HarnessConfigurationError>;
|
|
14
|
+
}
|
|
15
|
+
declare const UnsupportedInitHarnessError_base: Schema.TaggedErrorClass<UnsupportedInitHarnessError, "UnsupportedInitHarnessError", {
|
|
16
|
+
readonly _tag: Schema.tag<"UnsupportedInitHarnessError">;
|
|
17
|
+
} & {
|
|
18
|
+
harness: typeof Schema.String;
|
|
19
|
+
}>;
|
|
20
|
+
export declare class UnsupportedInitHarnessError extends UnsupportedInitHarnessError_base {
|
|
21
|
+
get message(): string;
|
|
22
|
+
}
|
|
23
|
+
declare const HarnessRegistry_base: Effect.Service.Class<HarnessRegistry, "@expandai/cli/Init/HarnessRegistry", {
|
|
24
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<ClaudeAdapter, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, import("@effect/platform/FileSystem").FileSystem>, import("effect/Layer").Layer<CursorAdapter, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<OpencodeAdapter, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<CodexAdapter, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>];
|
|
25
|
+
readonly effect: Effect.Effect<HarnessRegistryContract, never, ClaudeAdapter | CodexAdapter | CursorAdapter | OpencodeAdapter>;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* `Default` is the **real** registry, wired to the four adapters.
|
|
29
|
+
*
|
|
30
|
+
* It used to be `sync: () => makeRegistry([])` — an empty registry that reported
|
|
31
|
+
* every harness as unsupported. Nothing consumed it, because `main.ts` and the
|
|
32
|
+
* tests both built `DefaultWithoutDependencies` with a registry supplied by
|
|
33
|
+
* hand; but `InitService` and `StatusService` still *declared* it in their
|
|
34
|
+
* `dependencies`, so the declaration was decorative and would have silently
|
|
35
|
+
* produced an empty registry for anyone who reached for the obvious layer.
|
|
36
|
+
* `Effect.Service` always generates `Default`, so the fix is to make it correct
|
|
37
|
+
* rather than to remove it.
|
|
38
|
+
*/
|
|
39
|
+
export declare class HarnessRegistry extends HarnessRegistry_base {
|
|
40
|
+
/**
|
|
41
|
+
* The adapters are statically known at the composition root, so the contract
|
|
42
|
+
* is enforced by the type. The previous version took `ReadonlyArray<object>`
|
|
43
|
+
* and proved membership at runtime by walking prototypes and calling
|
|
44
|
+
* `Context.isTag` on the constructor — reflection standing in for a type, plus
|
|
45
|
+
* an error channel for a condition the compiler already rules out.
|
|
46
|
+
*/
|
|
47
|
+
static readonly fromAdapters: (adapters: ReadonlyArray<HarnessAdapterContract>) => HarnessRegistry;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=HarnessRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HarnessRegistry.d.ts","sourceRoot":"","sources":["../../../src/Init/HarnessRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC/G,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEpF,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAA;IAChG,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,yBAAyB,CAAC,CAAA;CACrG;AAED,UAAU,uBAAuB;IAChC,QAAQ,CAAC,OAAO,EAAE,CACjB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,SAAS,KACZ,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,2BAA2B,GAAG,sBAAsB,CAAC,CAAA;IAC3F,QAAQ,CAAC,SAAS,EAAE,CACnB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,SAAS,KACZ,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,2BAA2B,GAAG,yBAAyB,CAAC,CAAA;CAC9F;;;;;;AAED,qBAAa,2BAA4B,SAAQ,gCAKhD;IACA,IAAI,OAAO,WAEV;CACD;;;;;AA0BD;;;;;;;;;;;GAWG;AACH,qBAAa,eAAgB,SAAQ,oBAMnC;IACD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,YAAY,aAAc,aAAa,CAAC,sBAAsB,CAAC,qBAClC;CAC7C"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { FileSystem, Path } from '@effect/platform';
|
|
2
|
+
import { Effect, Schema } from 'effect';
|
|
3
|
+
type MutationType = 'write' | 'remove' | 'mkdir';
|
|
4
|
+
interface MutationBase {
|
|
5
|
+
readonly type: MutationType;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly expected?: MutationExpectedState;
|
|
8
|
+
readonly validate?: Effect.Effect<unknown, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export type MutationExpectedState = {
|
|
11
|
+
readonly exists: false;
|
|
12
|
+
} | {
|
|
13
|
+
readonly exists: true;
|
|
14
|
+
readonly type: 'File';
|
|
15
|
+
readonly bytes: Uint8Array;
|
|
16
|
+
readonly mode: number;
|
|
17
|
+
} | {
|
|
18
|
+
readonly exists: true;
|
|
19
|
+
readonly type: 'Directory';
|
|
20
|
+
readonly mode: number;
|
|
21
|
+
};
|
|
22
|
+
export interface WriteMutation extends MutationBase {
|
|
23
|
+
readonly type: 'write';
|
|
24
|
+
readonly bytes: Uint8Array;
|
|
25
|
+
readonly mode?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface RemoveMutation extends MutationBase {
|
|
28
|
+
readonly type: 'remove';
|
|
29
|
+
}
|
|
30
|
+
export interface MakeDirectoryMutation extends MutationBase {
|
|
31
|
+
readonly type: 'mkdir';
|
|
32
|
+
readonly mode?: number;
|
|
33
|
+
}
|
|
34
|
+
export type MutationOperation = WriteMutation | RemoveMutation | MakeDirectoryMutation;
|
|
35
|
+
declare const MutationFailure: Schema.Struct<{
|
|
36
|
+
path: typeof Schema.String;
|
|
37
|
+
operation: Schema.Literal<["write", "remove", "mkdir"]>;
|
|
38
|
+
error: typeof Schema.Defect;
|
|
39
|
+
}>;
|
|
40
|
+
export type MutationFailure = typeof MutationFailure.Type;
|
|
41
|
+
declare const MutationSymlinkError_base: Schema.TaggedErrorClass<MutationSymlinkError, "MutationSymlinkError", {
|
|
42
|
+
readonly _tag: Schema.tag<"MutationSymlinkError">;
|
|
43
|
+
} & {
|
|
44
|
+
path: typeof Schema.String;
|
|
45
|
+
}>;
|
|
46
|
+
export declare class MutationSymlinkError extends MutationSymlinkError_base {
|
|
47
|
+
get message(): string;
|
|
48
|
+
}
|
|
49
|
+
declare const MutationValidationError_base: Schema.TaggedErrorClass<MutationValidationError, "MutationValidationError", {
|
|
50
|
+
readonly _tag: Schema.tag<"MutationValidationError">;
|
|
51
|
+
} & Readonly<{
|
|
52
|
+
path: typeof Schema.String;
|
|
53
|
+
operation: Schema.Literal<["write", "remove", "mkdir"]>;
|
|
54
|
+
error: typeof Schema.Defect;
|
|
55
|
+
}>>;
|
|
56
|
+
export declare class MutationValidationError extends MutationValidationError_base {
|
|
57
|
+
get message(): string;
|
|
58
|
+
}
|
|
59
|
+
declare const MutationApplicationError_base: Schema.TaggedErrorClass<MutationApplicationError, "MutationApplicationError", {
|
|
60
|
+
readonly _tag: Schema.tag<"MutationApplicationError">;
|
|
61
|
+
} & {
|
|
62
|
+
path: typeof Schema.String;
|
|
63
|
+
operation: Schema.Literal<["write", "remove", "mkdir"]>;
|
|
64
|
+
error: typeof Schema.Defect;
|
|
65
|
+
rollbackFailures: Schema.Array$<Schema.Struct<{
|
|
66
|
+
path: typeof Schema.String;
|
|
67
|
+
operation: Schema.Literal<["write", "remove", "mkdir"]>;
|
|
68
|
+
error: typeof Schema.Defect;
|
|
69
|
+
}>>;
|
|
70
|
+
}>;
|
|
71
|
+
export declare class MutationApplicationError extends MutationApplicationError_base {
|
|
72
|
+
get message(): string;
|
|
73
|
+
}
|
|
74
|
+
declare const MutationRollbackError_base: Schema.TaggedErrorClass<MutationRollbackError, "MutationRollbackError", {
|
|
75
|
+
readonly _tag: Schema.tag<"MutationRollbackError">;
|
|
76
|
+
} & {
|
|
77
|
+
rollbackFailures: Schema.Array$<Schema.Struct<{
|
|
78
|
+
path: typeof Schema.String;
|
|
79
|
+
operation: Schema.Literal<["write", "remove", "mkdir"]>;
|
|
80
|
+
error: typeof Schema.Defect;
|
|
81
|
+
}>>;
|
|
82
|
+
}>;
|
|
83
|
+
export declare class MutationRollbackError extends MutationRollbackError_base {
|
|
84
|
+
get message(): string;
|
|
85
|
+
}
|
|
86
|
+
export type MutationTransactionError = MutationSymlinkError | MutationValidationError | MutationApplicationError | MutationRollbackError;
|
|
87
|
+
declare const MutationTransaction_base: Effect.Service.Class<MutationTransaction, "@expandai/cli/Init/MutationTransaction", {
|
|
88
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<FileSystem.FileSystem, never, never>, import("effect/Layer").Layer<Path.Path, never, never>];
|
|
89
|
+
readonly effect: Effect.Effect<{
|
|
90
|
+
readonly run: (operations: readonly MutationOperation[]) => Effect.Effect<undefined, MutationTransactionError, never>;
|
|
91
|
+
}, never, FileSystem.FileSystem | Path.Path>;
|
|
92
|
+
}>;
|
|
93
|
+
export declare class MutationTransaction extends MutationTransaction_base {
|
|
94
|
+
}
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=MutationTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MutationTransaction.d.ts","sourceRoot":"","sources":["../../../src/Init/MutationTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAA0B,MAAM,kBAAkB,CAAA;AAE3E,OAAO,EAAuB,MAAM,EAAqC,MAAM,EAAS,MAAM,QAAQ,CAAA;AAEtG,KAAK,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEhD,UAAU,YAAY;IACrB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAA;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;CACnD;AAED,MAAM,MAAM,qBAAqB,GAC9B;IAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAA;CAAE,GAC1B;IACA,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACpB,GACD;IACA,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACpB,CAAA;AAEJ,MAAM,WAAW,aAAc,SAAQ,YAAY;IAClD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;IACnD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CACvB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IAC1D,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,cAAc,GAAG,qBAAqB,CAAA;AAEtF,QAAA,MAAM,eAAe;;;;EAInB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;;;;;;AAEzD,qBAAa,oBAAqB,SAAQ,yBAExC;IACD,IAAI,OAAO,WAEV;CACD;;;;;;;;AAqBD,qBAAa,uBAAwB,SAAQ,4BAG5C;IACA,IAAI,OAAO,WAEV;CACD;;;;;;;;;;;;;AAED,qBAAa,wBAAyB,SAAQ,6BAM7C;IACA,IAAI,OAAO,WAIV;CACD;;;;;;;;;;AAED,qBAAa,qBAAsB,SAAQ,0BAEzC;IACD,IAAI,OAAO,WAEV;CACD;AAED,MAAM,MAAM,wBAAwB,GACjC,oBAAoB,GACpB,uBAAuB,GACvB,wBAAwB,GACxB,qBAAqB,CAAA;;;;;;;AAknBxB,qBAAa,mBAAoB,SAAQ,wBAMxC;CAAG"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { DateTime, Effect, Schema } from 'effect';
|
|
2
|
+
import { ManualAuthorization } from '../Auth/ManualAuthorization.js';
|
|
3
|
+
import { SetupGrantAuthorization } from '../Auth/SetupGrantAuthorization.js';
|
|
4
|
+
import { Authentication } from '../Authentication.js';
|
|
5
|
+
import { type InitRequest } from './Domain.js';
|
|
6
|
+
import { HarnessRegistry } from './HarnessRegistry.js';
|
|
7
|
+
declare const InitServiceError_base: Schema.TaggedErrorClass<InitServiceError, "InitServiceError", {
|
|
8
|
+
readonly _tag: Schema.tag<"InitServiceError">;
|
|
9
|
+
} & {
|
|
10
|
+
code: Schema.Literal<["authorization_failed", "setup_token_rejected", "setup_unreachable", "stored_credential_conflict", "authorization_unreachable", "authorization_denied", "authorization_refused", "credential_health_failed", "credential_save_failed", "credential_storage_insecure", "unsupported_harness", "inspection_failed", "configuration_failed", "policy_blocked", "invalid_adapter_result"]>;
|
|
11
|
+
recoverable: typeof Schema.Boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export declare class InitServiceError extends InitServiceError_base {
|
|
14
|
+
get message(): "A managed harness policy blocks this configuration." | "An Expand API key is already stored on this machine, and completing setup would replace it with no way to recover it. Nothing was changed and the setup prompt is still valid. Tell the user to run `expandai logout` to clear the stored key, then run the same setup command again." | "Authorization completed, but credentials could not be saved. Start authorization again." | "Authorization could not be completed. Start authorization again." | "Could not reach Expand to redeem the setup token. Nothing was sent, so the same token is still good — check the network and run the same command again." | "Could not reach the Expand API. Nothing was changed: any pending authorization is still pending, and if none existed, none was started. Do not retry the same command until the connection is fixed. Check that this machine can reach the API — if you are running inside an agent sandbox, its shell may have network access disabled — and check `EXPAND_API_URL` if it is set. Then run the same command again." | "Credential storage is not secure enough to continue." | "Expand refused to complete the authorization for a reason a new code cannot fix — most likely an OAuth client, resource, or scope misconfiguration on the server. Do not run setup again; each retry asks the user to approve and then fails the same way. Report the error under `code`." | "Stored credentials could not be validated safely." | "That setup token was rejected and is now spent. Do not retry it. Ask the user for a fresh setup prompt from the Expand dashboard, or continue without one to authorize in a browser." | "The authorization was denied in the browser. If that was unintended, run the same command again for a fresh approval code." | "The harness adapter returned an invalid configuration result." | "The harness configuration could not be inspected safely." | "The harness configuration could not be updated safely." | "This harness is not supported by init.";
|
|
15
|
+
}
|
|
16
|
+
declare const InitService_base: Effect.Service.Class<InitService, "@expandai/cli/Init/Service", {
|
|
17
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<Authentication, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<ManualAuthorization, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<SetupGrantAuthorization, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<HarnessRegistry, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, import("@effect/platform/FileSystem").FileSystem>];
|
|
18
|
+
readonly effect: Effect.Effect<{
|
|
19
|
+
readonly run: (request: InitRequest) => Effect.Effect<{
|
|
20
|
+
readonly schemaVersion: 1;
|
|
21
|
+
readonly status: "authorization_required";
|
|
22
|
+
readonly harnesses: readonly ["claude-code" | "codex" | "cursor" | "opencode", ...("claude-code" | "codex" | "cursor" | "opencode")[]];
|
|
23
|
+
readonly scope: "global" | "project";
|
|
24
|
+
readonly userMessage: "Open the approval page in your browser, type in the code shown here, and approve. Only enter this code on the Expand approval page your terminal named — never a code someone sent you, and never on a page from a link you did not expect. When you have approved, say so, and the same command will pick the authorization up.";
|
|
25
|
+
readonly authorization: {
|
|
26
|
+
readonly url: URL;
|
|
27
|
+
readonly userCode: string;
|
|
28
|
+
readonly approvalExpiresAt: DateTime.Utc;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
readonly schemaVersion: 1;
|
|
32
|
+
readonly status: "completed";
|
|
33
|
+
readonly harnesses: readonly ["claude-code" | "codex" | "cursor" | "opencode", ...("claude-code" | "codex" | "cursor" | "opencode")[]];
|
|
34
|
+
readonly scope: "global" | "project";
|
|
35
|
+
readonly userMessage: "Authorization complete. That setup code has been consumed and cannot be reused." | "Expand is already authorized. Agent setup is complete." | "Expand is authorized, but not every harness could be configured. The harnesses that failed are listed under `failures`; the ones under `installations` are ready to use.";
|
|
36
|
+
readonly auth: {
|
|
37
|
+
readonly healthy: boolean;
|
|
38
|
+
};
|
|
39
|
+
readonly projectPath?: string | undefined;
|
|
40
|
+
readonly installations: readonly [{
|
|
41
|
+
readonly harness: "claude-code" | "codex" | "cursor" | "opencode";
|
|
42
|
+
readonly configured: boolean;
|
|
43
|
+
readonly changed: boolean;
|
|
44
|
+
readonly components: readonly ("mcp" | "runtime-skill" | "webfetch-hook")[];
|
|
45
|
+
readonly version: string;
|
|
46
|
+
readonly verification: {
|
|
47
|
+
readonly runtimeState: "blocked" | "observed" | "reload_required" | "unverified";
|
|
48
|
+
readonly nextAction: string;
|
|
49
|
+
};
|
|
50
|
+
}, ...{
|
|
51
|
+
readonly harness: "claude-code" | "codex" | "cursor" | "opencode";
|
|
52
|
+
readonly configured: boolean;
|
|
53
|
+
readonly changed: boolean;
|
|
54
|
+
readonly components: readonly ("mcp" | "runtime-skill" | "webfetch-hook")[];
|
|
55
|
+
readonly version: string;
|
|
56
|
+
readonly verification: {
|
|
57
|
+
readonly runtimeState: "blocked" | "observed" | "reload_required" | "unverified";
|
|
58
|
+
readonly nextAction: string;
|
|
59
|
+
};
|
|
60
|
+
}[]];
|
|
61
|
+
readonly failures?: readonly {
|
|
62
|
+
readonly harness: "claude-code" | "codex" | "cursor" | "opencode";
|
|
63
|
+
readonly code: string;
|
|
64
|
+
readonly recoverable: boolean;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
}, InitServiceError, never>;
|
|
67
|
+
}, never, Authentication | HarnessRegistry | ManualAuthorization | SetupGrantAuthorization>;
|
|
68
|
+
}>;
|
|
69
|
+
export declare class InitService extends InitService_base {
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=Service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../../src/Init/Service.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,QAAQ,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEjF,OAAO,EACN,mBAAmB,EAKnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,uBAAuB,EAAgC,MAAM,oCAAoC,CAAA;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAKN,KAAK,WAAW,EAGhB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,eAAe,EAA+B,MAAM,sBAAsB,CAAA;;;;;;;AAoBnF,qBAAa,gBAAiB,SAAQ,qBAGpC;IACD,IAAI,OAAO,m9DA8CV;CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsHD,qBAAa,WAAY,SAAQ,gBA6K/B;CAAG"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FileSystem } from '@effect/platform';
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import { CodexMcp } from '../Install/Codex/Mcp.js';
|
|
4
|
+
import { CodexSkill } from '../Install/Codex/Skill.js';
|
|
5
|
+
import { CursorMcp } from '../Install/Cursor/Mcp.js';
|
|
6
|
+
import { CursorSkill } from '../Install/Cursor/Skill.js';
|
|
7
|
+
import { OpencodeHook } from '../Install/Opencode/Hook.js';
|
|
8
|
+
import { OpencodeMcp } from '../Install/Opencode/Mcp.js';
|
|
9
|
+
import { OpencodeSkill } from '../Install/Opencode/Skill.js';
|
|
10
|
+
import { HarnessConfigurationError, type HarnessInspection, HarnessInspectionError } from './HarnessAdapter.js';
|
|
11
|
+
declare const CursorAdapter_base: Effect.Service.Class<CursorAdapter, "@expandai/cli/Init/CursorAdapter", {
|
|
12
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<CursorMcp, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<CursorSkill, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>];
|
|
13
|
+
readonly effect: Effect.Effect<{
|
|
14
|
+
readonly harness: "claude-code" | "codex" | "cursor" | "opencode";
|
|
15
|
+
readonly inspect: (scope: "global" | "project") => Effect.Effect<HarnessInspection, HarnessInspectionError, never>;
|
|
16
|
+
readonly configure: (scope: "global" | "project") => Effect.Effect<HarnessInspection, HarnessConfigurationError, never>;
|
|
17
|
+
}, never, CursorMcp | CursorSkill>;
|
|
18
|
+
}>;
|
|
19
|
+
export declare class CursorAdapter extends CursorAdapter_base {
|
|
20
|
+
}
|
|
21
|
+
declare const CodexAdapter_base: Effect.Service.Class<CodexAdapter, "@expandai/cli/Init/CodexAdapter", {
|
|
22
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<CodexMcp, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<CodexSkill, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>];
|
|
23
|
+
readonly effect: Effect.Effect<{
|
|
24
|
+
readonly harness: "claude-code" | "codex" | "cursor" | "opencode";
|
|
25
|
+
readonly inspect: (scope: "global" | "project") => Effect.Effect<HarnessInspection, HarnessInspectionError, never>;
|
|
26
|
+
readonly configure: (scope: "global" | "project") => Effect.Effect<HarnessInspection, HarnessConfigurationError, never>;
|
|
27
|
+
}, never, CodexMcp | CodexSkill>;
|
|
28
|
+
}>;
|
|
29
|
+
export declare class CodexAdapter extends CodexAdapter_base {
|
|
30
|
+
}
|
|
31
|
+
declare const OpencodeAdapter_base: Effect.Service.Class<OpencodeAdapter, "@expandai/cli/Init/OpencodeAdapter", {
|
|
32
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<FileSystem.FileSystem, never, never>, import("effect/Layer").Layer<OpencodeHook, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<OpencodeMcp, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<OpencodeSkill, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>];
|
|
33
|
+
readonly effect: Effect.Effect<{
|
|
34
|
+
readonly harness: "claude-code" | "codex" | "cursor" | "opencode";
|
|
35
|
+
readonly inspect: (scope: "global" | "project") => Effect.Effect<HarnessInspection, HarnessInspectionError, never>;
|
|
36
|
+
readonly configure: (scope: "global" | "project") => Effect.Effect<HarnessInspection, HarnessConfigurationError, never>;
|
|
37
|
+
}, never, FileSystem.FileSystem | OpencodeHook | OpencodeMcp | OpencodeSkill>;
|
|
38
|
+
}>;
|
|
39
|
+
export declare class OpencodeAdapter extends OpencodeAdapter_base {
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=StandardAdapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StandardAdapters.d.ts","sourceRoot":"","sources":["../../../src/Init/StandardAdapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAG5D,OAAO,EAAE,yBAAyB,EAAE,KAAK,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;;;;;;;;;AAoD/G,qBAAa,aAAc,SAAQ,kBAuBjC;CAAG;;;;;;;;;AAEL,qBAAa,YAAa,SAAQ,iBAuBhC;CAAG;;;;;;;;;AAEL,qBAAa,eAAgB,SAAQ,oBA0BnC;CAAG"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { DateTime, Effect, Schema } from 'effect';
|
|
2
|
+
import { PendingInitStore } from '../Auth/PendingInit.js';
|
|
3
|
+
import { ConfigManager } from '../Config.js';
|
|
4
|
+
import { HarnessRegistry } from './HarnessRegistry.js';
|
|
5
|
+
declare const StatusRequest_base: Schema.Class<StatusRequest, {
|
|
6
|
+
harness: Schema.Literal<["claude-code", "cursor", "opencode", "codex"]>;
|
|
7
|
+
scope: Schema.Literal<["project", "global"]>;
|
|
8
|
+
}, Schema.Struct.Encoded<{
|
|
9
|
+
harness: Schema.Literal<["claude-code", "cursor", "opencode", "codex"]>;
|
|
10
|
+
scope: Schema.Literal<["project", "global"]>;
|
|
11
|
+
}>, never, {
|
|
12
|
+
readonly harness: "claude-code" | "codex" | "cursor" | "opencode";
|
|
13
|
+
} & {
|
|
14
|
+
readonly scope: "global" | "project";
|
|
15
|
+
}, {}, {}>;
|
|
16
|
+
export declare class StatusRequest extends StatusRequest_base {
|
|
17
|
+
}
|
|
18
|
+
declare const StatusResult_base: Schema.Class<StatusResult, {
|
|
19
|
+
schemaVersion: Schema.Literal<[1]>;
|
|
20
|
+
status: Schema.Literal<["ok"]>;
|
|
21
|
+
harness: Schema.Literal<["claude-code", "cursor", "opencode", "codex"]>;
|
|
22
|
+
scope: Schema.Literal<["project", "global"]>;
|
|
23
|
+
cli: Schema.Struct<{
|
|
24
|
+
version: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
|
|
25
|
+
}>;
|
|
26
|
+
auth: Schema.Struct<{
|
|
27
|
+
state: Schema.Literal<["absent", "unusable", "refresh_required", "healthy"]>;
|
|
28
|
+
healthy: typeof Schema.Boolean;
|
|
29
|
+
}>;
|
|
30
|
+
pendingAuthorization: Schema.Union<[Schema.Struct<{
|
|
31
|
+
state: Schema.Literal<["none"]>;
|
|
32
|
+
count: Schema.Literal<[0]>;
|
|
33
|
+
}>, Schema.Struct<{
|
|
34
|
+
state: Schema.Literal<["approval_pending"]>;
|
|
35
|
+
count: Schema.Literal<[1]>;
|
|
36
|
+
approvalExpiresAt: typeof Schema.DateTimeUtc;
|
|
37
|
+
}>]>;
|
|
38
|
+
installation: Schema.Struct<{
|
|
39
|
+
configured: typeof Schema.Boolean;
|
|
40
|
+
integrationVersion: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
|
|
41
|
+
components: Schema.Struct<{
|
|
42
|
+
webfetchHook: typeof Schema.Boolean;
|
|
43
|
+
runtimeSkill: typeof Schema.Boolean;
|
|
44
|
+
mcp: typeof Schema.Boolean;
|
|
45
|
+
}>;
|
|
46
|
+
runtimeState: Schema.Literal<["unverified", "reload_required", "blocked"]>;
|
|
47
|
+
reloadState: Schema.Literal<["not_required", "required"]>;
|
|
48
|
+
consentState: Schema.Literal<["not_required", "may_be_required"]>;
|
|
49
|
+
policyState: Schema.Literal<["unverified", "blocked"]>;
|
|
50
|
+
policyCodes: Schema.filter<Schema.Array$<Schema.Literal<["managed_policy_blocked", "target_read_only"]>>>;
|
|
51
|
+
}>;
|
|
52
|
+
}, Schema.Struct.Encoded<{
|
|
53
|
+
schemaVersion: Schema.Literal<[1]>;
|
|
54
|
+
status: Schema.Literal<["ok"]>;
|
|
55
|
+
harness: Schema.Literal<["claude-code", "cursor", "opencode", "codex"]>;
|
|
56
|
+
scope: Schema.Literal<["project", "global"]>;
|
|
57
|
+
cli: Schema.Struct<{
|
|
58
|
+
version: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
|
|
59
|
+
}>;
|
|
60
|
+
auth: Schema.Struct<{
|
|
61
|
+
state: Schema.Literal<["absent", "unusable", "refresh_required", "healthy"]>;
|
|
62
|
+
healthy: typeof Schema.Boolean;
|
|
63
|
+
}>;
|
|
64
|
+
pendingAuthorization: Schema.Union<[Schema.Struct<{
|
|
65
|
+
state: Schema.Literal<["none"]>;
|
|
66
|
+
count: Schema.Literal<[0]>;
|
|
67
|
+
}>, Schema.Struct<{
|
|
68
|
+
state: Schema.Literal<["approval_pending"]>;
|
|
69
|
+
count: Schema.Literal<[1]>;
|
|
70
|
+
approvalExpiresAt: typeof Schema.DateTimeUtc;
|
|
71
|
+
}>]>;
|
|
72
|
+
installation: Schema.Struct<{
|
|
73
|
+
configured: typeof Schema.Boolean;
|
|
74
|
+
integrationVersion: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
|
|
75
|
+
components: Schema.Struct<{
|
|
76
|
+
webfetchHook: typeof Schema.Boolean;
|
|
77
|
+
runtimeSkill: typeof Schema.Boolean;
|
|
78
|
+
mcp: typeof Schema.Boolean;
|
|
79
|
+
}>;
|
|
80
|
+
runtimeState: Schema.Literal<["unverified", "reload_required", "blocked"]>;
|
|
81
|
+
reloadState: Schema.Literal<["not_required", "required"]>;
|
|
82
|
+
consentState: Schema.Literal<["not_required", "may_be_required"]>;
|
|
83
|
+
policyState: Schema.Literal<["unverified", "blocked"]>;
|
|
84
|
+
policyCodes: Schema.filter<Schema.Array$<Schema.Literal<["managed_policy_blocked", "target_read_only"]>>>;
|
|
85
|
+
}>;
|
|
86
|
+
}>, never, {
|
|
87
|
+
readonly auth: {
|
|
88
|
+
readonly state: "absent" | "healthy" | "refresh_required" | "unusable";
|
|
89
|
+
readonly healthy: boolean;
|
|
90
|
+
};
|
|
91
|
+
} & {
|
|
92
|
+
readonly cli: {
|
|
93
|
+
readonly version: string;
|
|
94
|
+
};
|
|
95
|
+
} & {
|
|
96
|
+
readonly harness: "claude-code" | "codex" | "cursor" | "opencode";
|
|
97
|
+
} & {
|
|
98
|
+
readonly installation: {
|
|
99
|
+
readonly configured: boolean;
|
|
100
|
+
readonly integrationVersion?: string | undefined;
|
|
101
|
+
readonly components: {
|
|
102
|
+
readonly webfetchHook: boolean;
|
|
103
|
+
readonly runtimeSkill: boolean;
|
|
104
|
+
readonly mcp: boolean;
|
|
105
|
+
};
|
|
106
|
+
readonly runtimeState: "blocked" | "reload_required" | "unverified";
|
|
107
|
+
readonly reloadState: "not_required" | "required";
|
|
108
|
+
readonly consentState: "may_be_required" | "not_required";
|
|
109
|
+
readonly policyState: "blocked" | "unverified";
|
|
110
|
+
readonly policyCodes: readonly ("managed_policy_blocked" | "target_read_only")[];
|
|
111
|
+
};
|
|
112
|
+
} & {
|
|
113
|
+
readonly pendingAuthorization: {
|
|
114
|
+
readonly state: "none";
|
|
115
|
+
readonly count: 0;
|
|
116
|
+
} | {
|
|
117
|
+
readonly state: "approval_pending";
|
|
118
|
+
readonly count: 1;
|
|
119
|
+
readonly approvalExpiresAt: DateTime.Utc;
|
|
120
|
+
};
|
|
121
|
+
} & {
|
|
122
|
+
readonly schemaVersion: 1;
|
|
123
|
+
} & {
|
|
124
|
+
readonly scope: "global" | "project";
|
|
125
|
+
} & {
|
|
126
|
+
readonly status: "ok";
|
|
127
|
+
}, {}, {}>;
|
|
128
|
+
export declare class StatusResult extends StatusResult_base {
|
|
129
|
+
}
|
|
130
|
+
export declare const StatusServiceErrorCode: Schema.Literal<["credential_config_malformed", "credential_storage_insecure", "credential_health_failed", "pending_state_malformed", "pending_state_unavailable", "harness_inspection_failed", "invalid_status_result"]>;
|
|
131
|
+
declare const StatusServiceError_base: Schema.TaggedErrorClass<StatusServiceError, "StatusServiceError", {
|
|
132
|
+
readonly _tag: Schema.tag<"StatusServiceError">;
|
|
133
|
+
} & {
|
|
134
|
+
code: Schema.Literal<["credential_config_malformed", "credential_storage_insecure", "credential_health_failed", "pending_state_malformed", "pending_state_unavailable", "harness_inspection_failed", "invalid_status_result"]>;
|
|
135
|
+
recoverable: typeof Schema.Boolean;
|
|
136
|
+
}>;
|
|
137
|
+
export declare class StatusServiceError extends StatusServiceError_base {
|
|
138
|
+
get message(): "Credential storage is not secure enough to inspect." | "Local diagnostics returned an invalid result." | "Pending authorization state could not be inspected safely." | "Pending authorization state is malformed." | "Stored credential configuration is malformed." | "Stored credentials could not be inspected safely." | "The harness configuration could not be inspected safely.";
|
|
139
|
+
}
|
|
140
|
+
declare const StatusService_base: Effect.Service.Class<StatusService, "@expandai/cli/Init/StatusService", {
|
|
141
|
+
readonly dependencies: readonly [import("effect/Layer").Layer<ConfigManager, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<PendingInitStore, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<HarnessRegistry, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, import("@effect/platform/FileSystem").FileSystem>];
|
|
142
|
+
readonly effect: Effect.Effect<{
|
|
143
|
+
readonly run: (request: StatusRequest) => Effect.Effect<StatusResult, StatusServiceError, never>;
|
|
144
|
+
}, never, ConfigManager | HarnessRegistry | PendingInitStore>;
|
|
145
|
+
}>;
|
|
146
|
+
export declare class StatusService extends StatusService_base {
|
|
147
|
+
}
|
|
148
|
+
export {};
|
|
149
|
+
//# sourceMappingURL=Status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../src/Init/Status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAOzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EAAE,aAAa,EAA+D,MAAM,cAAc,CAAA;AAKzG,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;;;;;;;;;;;;AAKtD,qBAAa,aAAc,SAAQ,kBAGjC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCL,qBAAa,YAAa,SAAQ,iBAShC;CAAG;AAEL,eAAO,MAAM,sBAAsB,0NAQlC,CAAA;;;;;;;AAED,qBAAa,kBAAmB,SAAQ,uBAGtC;IACD,IAAI,OAAO,8XAiBV;CACD;;;;;;;AAoGD,qBAAa,aAAc,SAAQ,kBAqDjC;CAAG"}
|
|
@@ -1,59 +1,87 @@
|
|
|
1
1
|
import { Effect, Schema } from 'effect';
|
|
2
|
-
import { ConfigIo } from '../Domain.js';
|
|
2
|
+
import { type CliCommand, ConfigIo } from '../Domain.js';
|
|
3
|
+
/** Claude Code WebFetch hook invocation persisted in harness settings. */
|
|
4
|
+
export declare const HOOK_INVOCATION = "expandai hook claude-code";
|
|
5
|
+
export declare const HOOK_COMMAND = "expandai hook claude-code";
|
|
3
6
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
+
* The hook line for a resolved CLI. Defaults to the bare `expandai` command;
|
|
8
|
+
* when the CLI is not on PATH — an `npx expandai init` with no global install —
|
|
9
|
+
* `CliInvocation` resolves to the npx form and the written hook stays runnable.
|
|
7
10
|
*/
|
|
8
|
-
export declare
|
|
11
|
+
export declare function hookCommandFor(cli?: CliCommand): string;
|
|
9
12
|
export declare const WEBFETCH_MATCHER = "WebFetch";
|
|
10
|
-
export declare const HookCommandEntry: Schema.
|
|
13
|
+
export declare const HookCommandEntry: Schema.TypeLiteral<{
|
|
11
14
|
type: Schema.Literal<["command"]>;
|
|
12
15
|
command: typeof Schema.String;
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
expandaiProfileVersion: Schema.optional<typeof Schema.String>;
|
|
17
|
+
/** Whether this install added the `WebFetch` deny rule — see `makeExpandaiMatcher`. */
|
|
18
|
+
expandaiManagedDeny: Schema.optional<typeof Schema.Boolean>;
|
|
19
|
+
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>;
|
|
20
|
+
export declare const HookMatcher: Schema.TypeLiteral<{
|
|
15
21
|
matcher: Schema.optional<typeof Schema.String>;
|
|
16
|
-
hooks: Schema.Array$<Schema.
|
|
22
|
+
hooks: Schema.Array$<Schema.TypeLiteral<{
|
|
17
23
|
type: Schema.Literal<["command"]>;
|
|
18
24
|
command: typeof Schema.String;
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
expandaiProfileVersion: Schema.optional<typeof Schema.String>;
|
|
26
|
+
/** Whether this install added the `WebFetch` deny rule — see `makeExpandaiMatcher`. */
|
|
27
|
+
expandaiManagedDeny: Schema.optional<typeof Schema.Boolean>;
|
|
28
|
+
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
|
|
29
|
+
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>;
|
|
21
30
|
declare const HooksSection: Schema.TypeLiteral<{
|
|
22
|
-
PreToolUse: Schema.optional<Schema.Array$<Schema.
|
|
31
|
+
PreToolUse: Schema.optional<Schema.Array$<Schema.TypeLiteral<{
|
|
23
32
|
matcher: Schema.optional<typeof Schema.String>;
|
|
24
|
-
hooks: Schema.Array$<Schema.
|
|
33
|
+
hooks: Schema.Array$<Schema.TypeLiteral<{
|
|
25
34
|
type: Schema.Literal<["command"]>;
|
|
26
35
|
command: typeof Schema.String;
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
expandaiProfileVersion: Schema.optional<typeof Schema.String>;
|
|
37
|
+
/** Whether this install added the `WebFetch` deny rule — see `makeExpandaiMatcher`. */
|
|
38
|
+
expandaiManagedDeny: Schema.optional<typeof Schema.Boolean>;
|
|
39
|
+
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
|
|
40
|
+
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>>;
|
|
29
41
|
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>;
|
|
30
42
|
export declare const SettingsSchema: Schema.transform<Schema.SchemaClass<unknown, string, never>, Schema.TypeLiteral<{
|
|
31
43
|
hooks: Schema.optionalWith<Schema.TypeLiteral<{
|
|
32
|
-
PreToolUse: Schema.optional<Schema.Array$<Schema.
|
|
44
|
+
PreToolUse: Schema.optional<Schema.Array$<Schema.TypeLiteral<{
|
|
33
45
|
matcher: Schema.optional<typeof Schema.String>;
|
|
34
|
-
hooks: Schema.Array$<Schema.
|
|
46
|
+
hooks: Schema.Array$<Schema.TypeLiteral<{
|
|
35
47
|
type: Schema.Literal<["command"]>;
|
|
36
48
|
command: typeof Schema.String;
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
expandaiProfileVersion: Schema.optional<typeof Schema.String>;
|
|
50
|
+
/** Whether this install added the `WebFetch` deny rule — see `makeExpandaiMatcher`. */
|
|
51
|
+
expandaiManagedDeny: Schema.optional<typeof Schema.Boolean>;
|
|
52
|
+
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
|
|
53
|
+
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>>;
|
|
39
54
|
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>, {
|
|
40
55
|
default: () => typeof HooksSection.Type;
|
|
41
56
|
}>;
|
|
57
|
+
permissions: Schema.optional<Schema.TypeLiteral<{
|
|
58
|
+
deny: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
59
|
+
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
|
|
42
60
|
}, readonly [Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}[];
|
|
49
|
-
};
|
|
61
|
+
export interface ClaudeHookPlan {
|
|
62
|
+
readonly changed: boolean;
|
|
63
|
+
readonly settings: typeof SettingsSchema.Type;
|
|
64
|
+
}
|
|
65
|
+
export declare function isExpandaiHookCommand(command: string): boolean;
|
|
50
66
|
declare const ClaudeHook_base: Effect.Service.Class<ClaudeHook, "@expandai/cli/Install/Claude/Hook", {
|
|
51
67
|
readonly dependencies: readonly [import("effect/Layer").Layer<ConfigIo, never, never>];
|
|
52
68
|
readonly effect: Effect.Effect<{
|
|
53
|
-
readonly install: (
|
|
54
|
-
readonly uninstall: (
|
|
55
|
-
|
|
69
|
+
readonly install: (_scope: "global" | "project") => Effect.Effect<void, never, never>;
|
|
70
|
+
readonly uninstall: (_scope: "global" | "project") => Effect.Effect<void, never, never>;
|
|
71
|
+
readonly pathFor: (scope: "global" | "project") => Effect.Effect<string, never, never>;
|
|
72
|
+
}, import("effect/ConfigError").ConfigError, never>;
|
|
56
73
|
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Nothing here writes to `settings.json`, and nothing here removes from it.
|
|
76
|
+
*
|
|
77
|
+
* A `WebFetch` deny entry is a bare string with nowhere to record who wrote it,
|
|
78
|
+
* and our hook is not proof either: `hook install` used to write the hook on its
|
|
79
|
+
* own, so a settings file carrying our hook and a `WebFetch` deny may well hold a
|
|
80
|
+
* rule the user added afterwards. Removing it would revoke a restriction its
|
|
81
|
+
* owner chose. Since Claude Code no longer gets a hook or a deny rule from us,
|
|
82
|
+
* there is nothing of ours left to clean up, and guessing is the only thing a
|
|
83
|
+
* cleanup pass could do.
|
|
84
|
+
*/
|
|
57
85
|
export declare class ClaudeHook extends ClaudeHook_base {
|
|
58
86
|
}
|
|
59
87
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hook.d.ts","sourceRoot":"","sources":["../../../../src/Install/Claude/Hook.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Hook.d.ts","sourceRoot":"","sources":["../../../../src/Install/Claude/Hook.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,MAAM,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/D,OAAO,EAAE,KAAK,UAAU,EAAE,QAAQ,EAA+B,MAAM,cAAc,CAAA;AAGrF,0EAA0E;AAC1E,eAAO,MAAM,eAAe,8BAA8B,CAAA;AAC1D,eAAO,MAAM,YAAY,8BAAkB,CAAA;AAG3C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,UAAuB,GAAG,MAAM,CAEnE;AACD,eAAO,MAAM,gBAAgB,aAAa,CAAA;AAE1C,eAAO,MAAM,gBAAgB;;;;IAK3B,uFAAuF;;0EAIxF,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;QANtB,uFAAuF;;;0EAYxF,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;YAdhB,uFAAuF;;;;0EAiBxF,CAAA;AAOD,eAAO,MAAM,cAAc;;;;;;;;gBAxBzB,uFAAuF;;;;;uBA2BpB,OAAO,YAAY,CAAC,IAAI;;;;;2EAM5F,CAAA;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,cAAc,CAAC,IAAI,CAAA;CAC7C;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAW9D;;;;;;;;;AAED;;;;;;;;;;GAUG;AAEH,qBAAa,UAAW,SAAQ,eAgC9B;CAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from 'effect';
|
|
2
|
-
import { ConfigIo, McpParseError, McpWriteError } from '../Domain.js';
|
|
2
|
+
import { type CliCommand, ConfigIo, McpParseError, McpServersConfigSchema, McpWriteError } from '../Domain.js';
|
|
3
3
|
declare const Entry_base: Schema.Class<Entry, {
|
|
4
4
|
type: Schema.Literal<["stdio"]>;
|
|
5
5
|
command: typeof Schema.NonEmptyTrimmedString;
|
|
@@ -11,32 +11,35 @@ declare const Entry_base: Schema.Class<Entry, {
|
|
|
11
11
|
args: Schema.Array$<typeof Schema.String>;
|
|
12
12
|
env: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
13
13
|
}>, never, {
|
|
14
|
-
readonly type: "stdio";
|
|
15
|
-
} & {
|
|
16
|
-
readonly command: string;
|
|
17
|
-
} & {
|
|
18
|
-
readonly args: readonly string[];
|
|
19
|
-
} & {
|
|
20
14
|
readonly env?: {
|
|
21
15
|
readonly [x: string]: string;
|
|
22
16
|
} | undefined;
|
|
17
|
+
} & {
|
|
18
|
+
readonly args: readonly string[];
|
|
19
|
+
} & {
|
|
20
|
+
readonly command: string;
|
|
21
|
+
} & {
|
|
22
|
+
readonly type: "stdio";
|
|
23
23
|
}, {}, {}>;
|
|
24
|
-
/**
|
|
25
|
-
* Claude Code MCP descriptor — `mcpServers` shape (de facto Claude Desktop
|
|
26
|
-
* convention; also read by Cursor and other clients).
|
|
27
|
-
*
|
|
28
|
-
* - global → `~/.claude.json` (Claude Code's user-scope store)
|
|
29
|
-
* - project → `<cwd>/.mcp.json` (the agent-agnostic project file)
|
|
30
|
-
*/
|
|
24
|
+
/** Claude Code MCP descriptor stored under the Expand-owned server key. */
|
|
31
25
|
export declare class Entry extends Entry_base {
|
|
32
26
|
}
|
|
27
|
+
export interface ClaudeMcpPlan {
|
|
28
|
+
readonly changed: boolean;
|
|
29
|
+
readonly config: typeof McpServersConfigSchema.Type;
|
|
30
|
+
}
|
|
31
|
+
/** Claude execs the descriptor directly, so `command`/`args` stay separate. */
|
|
32
|
+
export declare function claudeMcpEntry(cli?: CliCommand): Entry;
|
|
33
|
+
export declare const CLAUDE_MCP_ENTRY: Entry;
|
|
34
|
+
export declare function planClaudeMcp(config: typeof McpServersConfigSchema.Type, cli?: CliCommand): ClaudeMcpPlan;
|
|
35
|
+
export declare function planClaudeMcpRemoval(config: typeof McpServersConfigSchema.Type): ClaudeMcpPlan;
|
|
33
36
|
declare const ClaudeMcp_base: Effect.Service.Class<ClaudeMcp, "@expandai/cli/Install/Claude/Mcp", {
|
|
34
37
|
readonly dependencies: readonly [import("effect/Layer").Layer<ConfigIo, never, never>];
|
|
35
38
|
readonly effect: Effect.Effect<{
|
|
36
|
-
readonly install: (scope: "
|
|
37
|
-
readonly uninstall: (scope: "
|
|
38
|
-
readonly isInstalled: (scope: "
|
|
39
|
-
readonly pathFor: (scope: "
|
|
39
|
+
readonly install: (scope: "global" | "project") => Effect.Effect<void, McpParseError | McpWriteError, never>;
|
|
40
|
+
readonly uninstall: (scope: "global" | "project") => Effect.Effect<void, McpParseError | McpWriteError, never>;
|
|
41
|
+
readonly isInstalled: (scope: "global" | "project") => Effect.Effect<boolean, McpParseError, never>;
|
|
42
|
+
readonly pathFor: (scope: "global" | "project") => Effect.Effect<string, never, never>;
|
|
40
43
|
}, import("effect/ConfigError").ConfigError, ConfigIo>;
|
|
41
44
|
}>;
|
|
42
45
|
export declare class ClaudeMcp extends ClaudeMcp_base {
|