hmcp-gateway 0.0.2 → 0.1.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 +77 -0
- package/README.md +41 -9
- package/bin/hmcp-gateway.js +20 -0
- package/catalog/atlassian.yaml +41 -0
- package/catalog/brave-search.yaml +57 -0
- package/catalog/context7.yaml +42 -0
- package/catalog/fetch.yaml +37 -0
- package/catalog/figma.yaml +48 -0
- package/catalog/filesystem.yaml +48 -0
- package/catalog/git.yaml +48 -0
- package/catalog/github.yaml +103 -0
- package/catalog/huggingface.yaml +59 -0
- package/catalog/linear.yaml +47 -0
- package/catalog/memory.yaml +47 -0
- package/catalog/notion.yaml +41 -0
- package/catalog/playwright.yaml +38 -0
- package/catalog/postgres.yaml +66 -0
- package/catalog/sentry.yaml +39 -0
- package/catalog/sequential-thinking.yaml +29 -0
- package/catalog/stripe.yaml +41 -0
- package/catalog/supabase.yaml +45 -0
- package/catalog/time.yaml +49 -0
- package/dist/adopt-cli.d.ts +351 -0
- package/dist/adopt-cli.js +1857 -0
- package/dist/adopt-emit.d.ts +64 -0
- package/dist/adopt-emit.js +248 -0
- package/dist/adopt-plan.d.ts +108 -0
- package/dist/adopt-plan.js +386 -0
- package/dist/catalog.d.ts +140 -0
- package/dist/catalog.js +250 -0
- package/dist/classify.d.ts +23 -0
- package/dist/classify.js +47 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +535 -0
- package/dist/client-allow.d.ts +42 -0
- package/dist/client-allow.js +95 -0
- package/dist/client-config.d.ts +200 -0
- package/dist/client-config.js +784 -0
- package/dist/config-source.d.ts +106 -0
- package/dist/config-source.js +156 -0
- package/dist/config.d.ts +159 -0
- package/dist/config.js +330 -0
- package/dist/connect-client.d.ts +49 -0
- package/dist/connect-client.js +249 -0
- package/dist/contracts.d.ts +251 -0
- package/dist/contracts.js +9 -0
- package/dist/credential.d.ts +63 -0
- package/dist/credential.js +136 -0
- package/dist/draft.d.ts +71 -0
- package/dist/draft.js +596 -0
- package/dist/exposure-cli.d.ts +28 -0
- package/dist/exposure-cli.js +119 -0
- package/dist/gateway.d.ts +756 -0
- package/dist/gateway.js +2106 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +26 -0
- package/dist/notify.d.ts +44 -0
- package/dist/notify.js +93 -0
- package/dist/oauth.d.ts +139 -0
- package/dist/oauth.js +641 -0
- package/dist/observe.d.ts +10 -0
- package/dist/observe.js +26 -0
- package/dist/open.d.ts +24 -0
- package/dist/open.js +31 -0
- package/dist/packs.d.ts +119 -0
- package/dist/packs.js +131 -0
- package/dist/pin-cli.d.ts +28 -0
- package/dist/pin-cli.js +103 -0
- package/dist/probe-upstream.d.ts +31 -0
- package/dist/probe-upstream.js +377 -0
- package/dist/registry-map.d.ts +39 -0
- package/dist/registry-map.js +390 -0
- package/dist/rule-cli.d.ts +51 -0
- package/dist/rule-cli.js +412 -0
- package/dist/serve-http.d.ts +67 -0
- package/dist/serve-http.js +478 -0
- package/dist/snippet.d.ts +20 -0
- package/dist/snippet.js +826 -0
- package/dist/status-cli.d.ts +61 -0
- package/dist/status-cli.js +195 -0
- package/dist/suggest-cli.d.ts +43 -0
- package/dist/suggest-cli.js +279 -0
- package/dist/toolname.d.ts +47 -0
- package/dist/toolname.js +149 -0
- package/dist/upstream-errors.d.ts +54 -0
- package/dist/upstream-errors.js +330 -0
- package/dist/upstream.d.ts +128 -0
- package/dist/upstream.js +413 -0
- package/dist/version.d.ts +10 -0
- package/dist/version.js +11 -0
- package/package.json +50 -6
- package/packs/brave-search.yaml +20 -0
- package/packs/context7.yaml +13 -0
- package/packs/fetch.yaml +14 -0
- package/packs/filesystem.yaml +79 -0
- package/packs/git.yaml +29 -0
- package/packs/github.yaml +47 -0
- package/packs/huggingface.yaml +16 -0
- package/packs/memory.yaml +23 -0
- package/packs/playwright.yaml +41 -0
- package/packs/sequential-thinking.yaml +13 -0
- package/packs/time.yaml +14 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { type Effect, type Posture } from "hmcp-core";
|
|
2
|
+
import { type Scope } from "./client-config.js";
|
|
3
|
+
import { type SkippedServer } from "./adopt-plan.js";
|
|
4
|
+
import { type ProbedTool } from "./adopt-emit.js";
|
|
5
|
+
import { type AppliedPack } from "./packs.js";
|
|
6
|
+
/**
|
|
7
|
+
* Putting the gateway in front of the MCP servers a client already has.
|
|
8
|
+
*
|
|
9
|
+
* The gateway has always been able to do this; what it could not do was be
|
|
10
|
+
* installed. Doing it by hand means writing an upstream block per server with
|
|
11
|
+
* its exact command and environment, writing a policy, editing the client's
|
|
12
|
+
* own config to point at the gateway instead, and adding a row to the registry
|
|
13
|
+
* so the console can see it. Four files, and every one of them a chance to
|
|
14
|
+
* produce something that looks protected and is not.
|
|
15
|
+
*
|
|
16
|
+
* So the shape of this command is: say what it would do, then do it on
|
|
17
|
+
* `--apply`, and keep enough to undo it. The report is the important half. A
|
|
18
|
+
* gateway that refuses a tool the agent needed is a bad afternoon; a gateway
|
|
19
|
+
* that silently stopped passing a tool on, and nobody noticed, is the failure
|
|
20
|
+
* worth designing against.
|
|
21
|
+
*
|
|
22
|
+
* Factored out of `cli.ts` with an injected `write` so tests call it rather
|
|
23
|
+
* than shelling out, as `exposure-cli.ts` does.
|
|
24
|
+
*/
|
|
25
|
+
export declare class AdoptCommandError extends Error {
|
|
26
|
+
}
|
|
27
|
+
export interface AdoptCommandOptions {
|
|
28
|
+
readonly scope?: Scope | undefined;
|
|
29
|
+
readonly cwd?: string | undefined;
|
|
30
|
+
readonly home?: string | undefined;
|
|
31
|
+
/** Write the files and edit the client config. Off by default. */
|
|
32
|
+
readonly apply?: boolean | undefined;
|
|
33
|
+
/** The gateway's `name`, which becomes the audit component. */
|
|
34
|
+
readonly name?: string | undefined;
|
|
35
|
+
/** What the gateway's entry is called in the client config. */
|
|
36
|
+
readonly entryName?: string | undefined;
|
|
37
|
+
readonly posture?: Posture | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Leave out the ready-made classification for a recognised server. The
|
|
40
|
+
* packs only ever name tools the server actually advertised, but someone
|
|
41
|
+
* who wants to classify their own surface from nothing should be able to.
|
|
42
|
+
*/
|
|
43
|
+
readonly noPacks?: boolean | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Which mode the gateway starts in. Left unset, `adopt` asks when it is
|
|
46
|
+
* applying and there is someone to ask, and otherwise starts in observe.
|
|
47
|
+
*/
|
|
48
|
+
readonly mode?: "observe" | "enforce" | undefined;
|
|
49
|
+
/** What a tool nothing classified gets under enforcement. Defaults to `approve`. */
|
|
50
|
+
readonly onUnclassified?: "deny" | "approve" | undefined;
|
|
51
|
+
/** Asks the operator a question. Supplied by the CLI when attached to a terminal. */
|
|
52
|
+
readonly ask?: ((question: string) => Promise<string>) | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Add an allow rule for the gateway's tools to the client's own settings, so
|
|
55
|
+
* a call is not asked about twice. Left unset, `adopt` offers when it is
|
|
56
|
+
* applying, enforcing, and there is someone to ask; otherwise it prints the
|
|
57
|
+
* rule and leaves the client's settings alone.
|
|
58
|
+
*/
|
|
59
|
+
readonly clientAllow?: boolean | undefined;
|
|
60
|
+
readonly copyEnv?: boolean | undefined;
|
|
61
|
+
readonly allowLocalHttp?: boolean | undefined;
|
|
62
|
+
readonly strictEgress?: boolean | undefined;
|
|
63
|
+
/** `--name <original>=<upstream>` pairs. */
|
|
64
|
+
readonly names?: readonly string[] | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The same renames as a map, for a caller that is not parsing a command
|
|
67
|
+
* line. Takes precedence over `names`, and is never split on `=`, so an
|
|
68
|
+
* original name containing one is renamed rather than misread.
|
|
69
|
+
*/
|
|
70
|
+
readonly rename?: Readonly<Record<string, string>> | undefined;
|
|
71
|
+
/** Point the client at this build on disk instead of at a published version. */
|
|
72
|
+
readonly local?: boolean | undefined;
|
|
73
|
+
/** The published version to pin in the client entry. */
|
|
74
|
+
readonly pinVersion?: string | undefined;
|
|
75
|
+
/** Write a relative `-c` path, for a config meant to be committed and shared. */
|
|
76
|
+
readonly relativeConfig?: boolean | undefined;
|
|
77
|
+
readonly register?: boolean | undefined;
|
|
78
|
+
readonly id?: string | undefined;
|
|
79
|
+
readonly registry?: string | undefined;
|
|
80
|
+
/** Where the generated files go, overriding the per-scope default. */
|
|
81
|
+
readonly outDir?: string | undefined;
|
|
82
|
+
readonly write?: ((line: string) => void) | undefined;
|
|
83
|
+
}
|
|
84
|
+
export interface RevertCommandOptions {
|
|
85
|
+
readonly scope?: Scope | undefined;
|
|
86
|
+
readonly cwd?: string | undefined;
|
|
87
|
+
readonly home?: string | undefined;
|
|
88
|
+
/** Also delete the generated gateway.yaml and policy.yaml. */
|
|
89
|
+
readonly purge?: boolean | undefined;
|
|
90
|
+
readonly registry?: string | undefined;
|
|
91
|
+
readonly write?: ((line: string) => void) | undefined;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* What the client is told to run.
|
|
95
|
+
*
|
|
96
|
+
* `--local` and `--pin` each say so outright. With neither, the answer
|
|
97
|
+
* follows where this command itself came from: an installed package pins its
|
|
98
|
+
* own version, so the client runs what the operator just ran; a checkout
|
|
99
|
+
* points at itself, because the alternative is an entry naming a package on
|
|
100
|
+
* the registry that is not this build -- and, before a release exists, is not
|
|
101
|
+
* there at all, so the client's gateway entry would simply fail to start.
|
|
102
|
+
*/
|
|
103
|
+
export declare function clientCommand(options: Pick<AdoptCommandOptions, "local" | "pinVersion">): {
|
|
104
|
+
command: string;
|
|
105
|
+
args: string[];
|
|
106
|
+
local: boolean;
|
|
107
|
+
};
|
|
108
|
+
/** The choices that decide what the report says will happen to each tool. */
|
|
109
|
+
interface Starting {
|
|
110
|
+
readonly posture: Posture;
|
|
111
|
+
readonly mode: "observe" | "enforce";
|
|
112
|
+
readonly onUnclassified: "deny" | "approve";
|
|
113
|
+
/** What the gateway's entry is called in the client. */
|
|
114
|
+
readonly entryName: string;
|
|
115
|
+
}
|
|
116
|
+
export interface AppliedPackReport extends AppliedPack {
|
|
117
|
+
readonly packName: string;
|
|
118
|
+
readonly packLabel: string;
|
|
119
|
+
readonly upstreamName: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* What enforcement would do with one probed tool, in the order `decide()`
|
|
123
|
+
* asks: a hidden tool is never served, an unclassified one falls to
|
|
124
|
+
* `on_unclassified`, a pack rule naming it exactly wins next, and otherwise
|
|
125
|
+
* the posture decides. Under observe mode none of it happens yet, which is
|
|
126
|
+
* why this is a "would".
|
|
127
|
+
*/
|
|
128
|
+
export type AdoptVerdict = "run" | "ask" | "blocked" | "hidden";
|
|
129
|
+
export interface AdoptToolReport {
|
|
130
|
+
readonly name: string;
|
|
131
|
+
readonly upstream: string;
|
|
132
|
+
readonly effect: Effect | null;
|
|
133
|
+
readonly effectSource: string;
|
|
134
|
+
readonly hidden: boolean;
|
|
135
|
+
readonly injection: {
|
|
136
|
+
readonly patternIds: readonly string[];
|
|
137
|
+
readonly action: string;
|
|
138
|
+
} | null;
|
|
139
|
+
readonly verdict: AdoptVerdict;
|
|
140
|
+
/** What decided it: a pack rule's id, `defaults.on_unclassified`, `defaults.mode`, or `on_injection`. */
|
|
141
|
+
readonly decidedBy: string;
|
|
142
|
+
}
|
|
143
|
+
export interface AdoptUpstreamReport {
|
|
144
|
+
readonly name: string;
|
|
145
|
+
readonly originalName: string;
|
|
146
|
+
readonly transport: "stdio" | "http";
|
|
147
|
+
readonly command: string | null;
|
|
148
|
+
readonly args: readonly string[];
|
|
149
|
+
readonly url: string | null;
|
|
150
|
+
/**
|
|
151
|
+
* Names only. A value is a credential as often as not, and this report is
|
|
152
|
+
* served to a browser; the names are what a person needs to recognise it.
|
|
153
|
+
*/
|
|
154
|
+
readonly envNames: readonly string[];
|
|
155
|
+
readonly passEnv: readonly string[];
|
|
156
|
+
readonly headerNames: readonly string[];
|
|
157
|
+
readonly warnings: readonly string[];
|
|
158
|
+
/** Already fronted by the gateway this run merges into, rather than newly adopted. */
|
|
159
|
+
readonly alreadyFronted: boolean;
|
|
160
|
+
}
|
|
161
|
+
export interface AdoptReport {
|
|
162
|
+
readonly scope: Scope;
|
|
163
|
+
readonly client: string;
|
|
164
|
+
readonly clientConfigPath: string;
|
|
165
|
+
readonly where: string;
|
|
166
|
+
/**
|
|
167
|
+
* `ready`: a gateway can be written. `already-adopted`: a gateway is in
|
|
168
|
+
* place and nothing new appeared. `nothing-to-wrap`: every server was
|
|
169
|
+
* skipped. `probe-failed`: an upstream would not connect.
|
|
170
|
+
*/
|
|
171
|
+
readonly status: "ready" | "already-adopted" | "nothing-to-wrap" | "probe-failed";
|
|
172
|
+
readonly existingGateway: {
|
|
173
|
+
readonly entryName: string;
|
|
174
|
+
readonly configPath: string | null;
|
|
175
|
+
readonly upstreams: readonly string[];
|
|
176
|
+
} | null;
|
|
177
|
+
/** Every server in the client config other than the gateway's own entry. */
|
|
178
|
+
readonly serversFound: readonly string[];
|
|
179
|
+
readonly upstreams: readonly AdoptUpstreamReport[];
|
|
180
|
+
readonly skipped: readonly SkippedServer[];
|
|
181
|
+
readonly malformed: readonly {
|
|
182
|
+
readonly name: string;
|
|
183
|
+
readonly message: string;
|
|
184
|
+
}[];
|
|
185
|
+
/** Variables moved onto the gateway's client entry. Names, never values. */
|
|
186
|
+
readonly gatewayEnvNames: readonly string[];
|
|
187
|
+
readonly egressAllow: readonly string[];
|
|
188
|
+
readonly starting: {
|
|
189
|
+
readonly posture: Posture;
|
|
190
|
+
readonly mode: "observe" | "enforce";
|
|
191
|
+
readonly onUnclassified: "deny" | "approve";
|
|
192
|
+
readonly entryName: string;
|
|
193
|
+
readonly gatewayName: string;
|
|
194
|
+
} | null;
|
|
195
|
+
readonly tools: readonly AdoptToolReport[];
|
|
196
|
+
/** Tools the gateway will not pass on at all, other than for their length. */
|
|
197
|
+
readonly withheld: readonly {
|
|
198
|
+
readonly name: string;
|
|
199
|
+
readonly upstream: string;
|
|
200
|
+
readonly reason: string;
|
|
201
|
+
}[];
|
|
202
|
+
readonly namesTooLong: readonly {
|
|
203
|
+
readonly name: string;
|
|
204
|
+
readonly clientName: string;
|
|
205
|
+
readonly length: number;
|
|
206
|
+
readonly limit: number;
|
|
207
|
+
readonly upstream: string;
|
|
208
|
+
}[];
|
|
209
|
+
readonly probeFailures: readonly {
|
|
210
|
+
readonly upstream: string;
|
|
211
|
+
readonly message: string;
|
|
212
|
+
}[];
|
|
213
|
+
readonly findings: readonly {
|
|
214
|
+
readonly ruleId: string;
|
|
215
|
+
readonly severity: string;
|
|
216
|
+
readonly title: string;
|
|
217
|
+
readonly message: string;
|
|
218
|
+
readonly fix: string;
|
|
219
|
+
}[];
|
|
220
|
+
readonly packs: readonly AppliedPackReport[];
|
|
221
|
+
readonly clientAllow: {
|
|
222
|
+
readonly path: string;
|
|
223
|
+
readonly rule: string;
|
|
224
|
+
readonly alreadyAllowed: boolean;
|
|
225
|
+
readonly willAdd: boolean;
|
|
226
|
+
} | null;
|
|
227
|
+
readonly files: {
|
|
228
|
+
readonly gatewayConfig: string;
|
|
229
|
+
readonly policy: string;
|
|
230
|
+
/** policy.yaml exists and a merge leaves it exactly as it is. */
|
|
231
|
+
readonly policyKept: boolean;
|
|
232
|
+
readonly clientConfig: string;
|
|
233
|
+
readonly wholeFileBackup: string | null;
|
|
234
|
+
readonly backupRecord: string;
|
|
235
|
+
readonly clientSettings: string | null;
|
|
236
|
+
readonly registry: string | null;
|
|
237
|
+
} | null;
|
|
238
|
+
/** Things a person must read before applying: secrets on disk, relaxed egress. */
|
|
239
|
+
readonly warnings: readonly string[];
|
|
240
|
+
/** Why applying would be refused. Empty means it would go ahead. */
|
|
241
|
+
readonly blocking: readonly string[];
|
|
242
|
+
}
|
|
243
|
+
export interface AdoptApplied {
|
|
244
|
+
readonly configPath: string | null;
|
|
245
|
+
readonly policyPath: string | null;
|
|
246
|
+
readonly policyKept: boolean;
|
|
247
|
+
readonly clientConfigPath: string;
|
|
248
|
+
/** Entries replaced by the gateway's one, by the name the client had. */
|
|
249
|
+
readonly replaced: readonly string[];
|
|
250
|
+
readonly wholeFileBackup: string | null;
|
|
251
|
+
readonly backupRecord: string;
|
|
252
|
+
readonly registryId: string | null;
|
|
253
|
+
readonly clientAllowAdded: {
|
|
254
|
+
readonly path: string;
|
|
255
|
+
readonly rule: string;
|
|
256
|
+
} | null;
|
|
257
|
+
/** A replaced entry carried a literal value, which both backups now hold. */
|
|
258
|
+
readonly literalSecretsInBackup: boolean;
|
|
259
|
+
}
|
|
260
|
+
export interface AdoptResult extends AdoptReport {
|
|
261
|
+
readonly applied: AdoptApplied | null;
|
|
262
|
+
}
|
|
263
|
+
/** Refused before anything was written; carries the report that says why. */
|
|
264
|
+
export declare class AdoptRefusedError extends AdoptCommandError {
|
|
265
|
+
readonly report: AdoptResult;
|
|
266
|
+
constructor(report: AdoptResult);
|
|
267
|
+
}
|
|
268
|
+
export declare function verdictFor(tool: ProbedTool, starting: Starting, packRules: ReadonlyMap<string, string[]>): [AdoptVerdict, string];
|
|
269
|
+
export declare function runAdoptCommand(options: AdoptCommandOptions): Promise<void>;
|
|
270
|
+
/**
|
|
271
|
+
* The options a caller with no terminal gives: every choice explicit, and
|
|
272
|
+
* nothing asked. `mode` left out means observe, as it does for the CLI when
|
|
273
|
+
* nobody is there to answer.
|
|
274
|
+
*/
|
|
275
|
+
export type AdoptLibraryOptions = Omit<AdoptCommandOptions, "apply" | "ask" | "write" | "names">;
|
|
276
|
+
/** What adopting would do, with nothing written. Upstreams are started once to ask what they offer. */
|
|
277
|
+
export declare function adoptPlan(options: AdoptLibraryOptions): Promise<AdoptResult>;
|
|
278
|
+
/**
|
|
279
|
+
* Adopts. Throws `AdoptRefusedError`, with nothing written, when the plan
|
|
280
|
+
* has anything blocking; `AdoptCommandError` for a refusal the CLI also makes.
|
|
281
|
+
*/
|
|
282
|
+
export declare function adoptApply(options: AdoptLibraryOptions): Promise<AdoptResult>;
|
|
283
|
+
export interface AdoptRevertResult {
|
|
284
|
+
readonly scope: Scope;
|
|
285
|
+
readonly client: string;
|
|
286
|
+
readonly clientConfigPath: string;
|
|
287
|
+
/** The original entries put back, by name. */
|
|
288
|
+
readonly restored: readonly string[];
|
|
289
|
+
/** The gateway's entry had already gone from the client config. */
|
|
290
|
+
readonly entryMissing: boolean;
|
|
291
|
+
readonly clientAllowRemoved: {
|
|
292
|
+
readonly path: string;
|
|
293
|
+
readonly rule: string;
|
|
294
|
+
} | null;
|
|
295
|
+
readonly clientAllowError: string | null;
|
|
296
|
+
readonly registryRemoved: string | null;
|
|
297
|
+
readonly deleted: readonly string[];
|
|
298
|
+
readonly leftInPlace: readonly string[];
|
|
299
|
+
/** Named by the backup, and not deleted because nothing shows adopt wrote it. */
|
|
300
|
+
readonly refusedToDelete: readonly {
|
|
301
|
+
readonly path: string;
|
|
302
|
+
readonly why: string;
|
|
303
|
+
}[];
|
|
304
|
+
readonly backupRemoved: string;
|
|
305
|
+
/** "bytes": the app's file is byte-for-byte what it was; "removed": it did not exist before and is gone. */
|
|
306
|
+
readonly fileRestored: "bytes" | "removed" | "rewritten";
|
|
307
|
+
/** A copy of the app's file as it was, left because the file changed since. It holds the old values. */
|
|
308
|
+
readonly copyLeft: string | null;
|
|
309
|
+
/** Other apps whose settings still run this toolbox, so it was kept. */
|
|
310
|
+
readonly stillUsedBy: readonly string[];
|
|
311
|
+
/** Locked keys the toolbox's servers named. Undo leaves them where they are, and says so (R2 N7). */
|
|
312
|
+
readonly keysKept: readonly string[];
|
|
313
|
+
}
|
|
314
|
+
export declare function runRevertCommand(options: RevertCommandOptions): Promise<void>;
|
|
315
|
+
/** Puts one scope back as it was before adoption. Purge deletes only files adopt wrote. */
|
|
316
|
+
export declare function adoptRevert(options: Omit<RevertCommandOptions, "write">): Promise<AdoptRevertResult>;
|
|
317
|
+
/** One place a client keeps MCP servers, as found on disk. */
|
|
318
|
+
export interface ClientScopeReport {
|
|
319
|
+
readonly scope: Scope;
|
|
320
|
+
readonly client: string;
|
|
321
|
+
readonly path: string;
|
|
322
|
+
readonly where: string;
|
|
323
|
+
readonly exists: boolean;
|
|
324
|
+
/** Entries in the file, the gateway's own included. */
|
|
325
|
+
readonly serverCount: number;
|
|
326
|
+
/** A gateway entry of ours is already there. */
|
|
327
|
+
readonly alreadyAdopted: boolean;
|
|
328
|
+
/** An adoption backup for this scope is beside the file. */
|
|
329
|
+
readonly canRevert: boolean;
|
|
330
|
+
/** Why the file or its backup could not be read, when one could not. */
|
|
331
|
+
readonly error: string | null;
|
|
332
|
+
/**
|
|
333
|
+
* The app looks installed: its config folder is there. A guess, and only
|
|
334
|
+
* used to order and label -- an app with no folder yet can still be
|
|
335
|
+
* connected, since writing the file creates it.
|
|
336
|
+
*/
|
|
337
|
+
readonly installed: boolean;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Every scope this build knows, and what is in each, without writing.
|
|
341
|
+
*
|
|
342
|
+
* `canRevert` checks the backup's own scope: `local` and `user` share
|
|
343
|
+
* `~/.claude.json`, and so share the one backup file beside it.
|
|
344
|
+
*/
|
|
345
|
+
export declare function detectClients(options?: {
|
|
346
|
+
cwd?: string;
|
|
347
|
+
home?: string;
|
|
348
|
+
entryName?: string;
|
|
349
|
+
platform?: string;
|
|
350
|
+
}): ClientScopeReport[];
|
|
351
|
+
export {};
|