@comecaramelos/dsh-chrome-mcp 0.0.1 → 2.0.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/README.md +44 -95
- package/assets/dsh-chrome-mcp-social.png +0 -0
- package/assets/icon.svg +71 -0
- package/assets/prelaunch-windows-chrome.html +277 -0
- package/lib/client.js +3005 -568
- package/lib/client.js.map +7 -0
- package/lib/host/apply.d.ts +40 -0
- package/lib/host/apply.d.ts.map +1 -0
- package/lib/host/apply.js +57 -0
- package/lib/host/apply.js.map +1 -0
- package/lib/host/bridge.d.ts +74 -0
- package/lib/host/bridge.d.ts.map +1 -0
- package/lib/host/bridge.js +168 -0
- package/lib/host/bridge.js.map +1 -0
- package/lib/host/catalog.d.ts +31 -0
- package/lib/host/catalog.d.ts.map +1 -0
- package/lib/host/catalog.js +92 -0
- package/lib/host/catalog.js.map +1 -0
- package/lib/host/commands/chrome-path.d.ts +4 -0
- package/lib/host/commands/chrome-path.d.ts.map +1 -0
- package/lib/host/commands/chrome-path.js +65 -0
- package/lib/host/commands/chrome-path.js.map +1 -0
- package/lib/host/commands/chrome-refresh.d.ts +17 -0
- package/lib/host/commands/chrome-refresh.d.ts.map +1 -0
- package/lib/host/commands/chrome-refresh.js +37 -0
- package/lib/host/commands/chrome-refresh.js.map +1 -0
- package/lib/host/commands/index.d.ts +26 -0
- package/lib/host/commands/index.d.ts.map +1 -0
- package/lib/host/commands/index.js +41 -0
- package/lib/host/commands/index.js.map +1 -0
- package/lib/host/constants.d.ts +306 -0
- package/lib/host/constants.d.ts.map +1 -0
- package/lib/host/constants.js +319 -0
- package/lib/host/constants.js.map +1 -0
- package/lib/host/controller/_trace.d.ts +3 -0
- package/lib/host/controller/_trace.d.ts.map +1 -0
- package/lib/host/controller/_trace.js +14 -0
- package/lib/host/controller/_trace.js.map +1 -0
- package/lib/host/controller/bridge-run.d.ts +40 -0
- package/lib/host/controller/bridge-run.d.ts.map +1 -0
- package/lib/host/controller/bridge-run.js +85 -0
- package/lib/host/controller/bridge-run.js.map +1 -0
- package/lib/host/controller/captures.d.ts +15 -0
- package/lib/host/controller/captures.d.ts.map +1 -0
- package/lib/host/controller/captures.js +85 -0
- package/lib/host/controller/captures.js.map +1 -0
- package/lib/host/controller/commits.d.ts +4 -0
- package/lib/host/controller/commits.d.ts.map +1 -0
- package/lib/host/controller/commits.js +131 -0
- package/lib/host/controller/commits.js.map +1 -0
- package/lib/host/controller/connections.d.ts +38 -0
- package/lib/host/controller/connections.d.ts.map +1 -0
- package/lib/host/controller/connections.js +71 -0
- package/lib/host/controller/connections.js.map +1 -0
- package/lib/host/controller/controller.d.ts +35 -0
- package/lib/host/controller/controller.d.ts.map +1 -0
- package/lib/host/controller/controller.js +234 -0
- package/lib/host/controller/controller.js.map +1 -0
- package/lib/host/controller/index.d.ts +30 -0
- package/lib/host/controller/index.d.ts.map +1 -0
- package/lib/host/controller/index.js +27 -0
- package/lib/host/controller/index.js.map +1 -0
- package/lib/host/controller/notes.d.ts +26 -0
- package/lib/host/controller/notes.d.ts.map +1 -0
- package/lib/host/controller/notes.js +44 -0
- package/lib/host/controller/notes.js.map +1 -0
- package/lib/host/controller/persist.d.ts +16 -0
- package/lib/host/controller/persist.d.ts.map +1 -0
- package/lib/host/controller/persist.js +98 -0
- package/lib/host/controller/persist.js.map +1 -0
- package/lib/host/controller/publish.d.ts +4 -0
- package/lib/host/controller/publish.d.ts.map +1 -0
- package/lib/host/controller/publish.js +56 -0
- package/lib/host/controller/publish.js.map +1 -0
- package/lib/host/controller/runs.d.ts +80 -0
- package/lib/host/controller/runs.d.ts.map +1 -0
- package/lib/host/controller/runs.js +394 -0
- package/lib/host/controller/runs.js.map +1 -0
- package/lib/host/controller/state.d.ts +172 -0
- package/lib/host/controller/state.d.ts.map +1 -0
- package/lib/host/controller/state.js +2 -0
- package/lib/host/controller/state.js.map +1 -0
- package/lib/host/controller/windows-run.d.ts +17 -0
- package/lib/host/controller/windows-run.d.ts.map +1 -0
- package/lib/host/controller/windows-run.js +109 -0
- package/lib/host/controller/windows-run.js.map +1 -0
- package/lib/host/discovery/candidates.d.ts +47 -0
- package/lib/host/discovery/candidates.d.ts.map +1 -0
- package/lib/host/discovery/candidates.js +68 -0
- package/lib/host/discovery/candidates.js.map +1 -0
- package/lib/host/discovery/index.d.ts +19 -0
- package/lib/host/discovery/index.d.ts.map +1 -0
- package/lib/host/discovery/index.js +19 -0
- package/lib/host/discovery/index.js.map +1 -0
- package/lib/host/discovery/probe.d.ts +29 -0
- package/lib/host/discovery/probe.d.ts.map +1 -0
- package/lib/host/discovery/probe.js +155 -0
- package/lib/host/discovery/probe.js.map +1 -0
- package/lib/host/discovery/scan.d.ts +72 -0
- package/lib/host/discovery/scan.d.ts.map +1 -0
- package/lib/host/discovery/scan.js +195 -0
- package/lib/host/discovery/scan.js.map +1 -0
- package/lib/host/flags.d.ts +65 -0
- package/lib/host/flags.d.ts.map +1 -0
- package/lib/host/flags.js +186 -0
- package/lib/host/flags.js.map +1 -0
- package/lib/host/kind.d.ts +45 -0
- package/lib/host/kind.d.ts.map +1 -0
- package/lib/host/kind.js +251 -0
- package/lib/host/kind.js.map +1 -0
- package/lib/host/manager.d.ts +21 -0
- package/lib/host/manager.d.ts.map +1 -0
- package/lib/host/manager.js +113 -0
- package/lib/host/manager.js.map +1 -0
- package/lib/host/migration.d.ts +26 -0
- package/lib/host/migration.d.ts.map +1 -0
- package/lib/host/migration.js +127 -0
- package/lib/host/migration.js.map +1 -0
- package/lib/host/platform.d.ts +38 -0
- package/lib/host/platform.d.ts.map +1 -0
- package/lib/host/platform.js +64 -0
- package/lib/host/platform.js.map +1 -0
- package/lib/host/plugin-meta.d.ts +21 -0
- package/lib/host/plugin-meta.d.ts.map +1 -0
- package/lib/host/plugin-meta.js +21 -0
- package/lib/host/plugin-meta.js.map +1 -0
- package/lib/host/schema.d.ts +361 -0
- package/lib/host/schema.d.ts.map +1 -0
- package/lib/host/schema.js +196 -0
- package/lib/host/schema.js.map +1 -0
- package/lib/host/settings.d.ts +28 -0
- package/lib/host/settings.d.ts.map +1 -0
- package/lib/host/settings.js +91 -0
- package/lib/host/settings.js.map +1 -0
- package/lib/host/status.d.ts +25 -0
- package/lib/host/status.d.ts.map +1 -0
- package/lib/host/status.js +45 -0
- package/lib/host/status.js.map +1 -0
- package/lib/host/tool.d.ts +65 -0
- package/lib/host/tool.d.ts.map +1 -0
- package/lib/host/tool.js +52 -0
- package/lib/host/tool.js.map +1 -0
- package/lib/host/types/config.d.ts +101 -0
- package/lib/host/types/config.d.ts.map +1 -0
- package/lib/host/types/config.js +2 -0
- package/lib/host/types/config.js.map +1 -0
- package/lib/host/types/executable.d.ts +35 -0
- package/lib/host/types/executable.d.ts.map +1 -0
- package/lib/host/types/executable.js +9 -0
- package/lib/host/types/executable.js.map +1 -0
- package/lib/host/types/index.d.ts +24 -0
- package/lib/host/types/index.d.ts.map +1 -0
- package/lib/host/types/index.js +2 -0
- package/lib/host/types/index.js.map +1 -0
- package/lib/host/types/plugin.d.ts +38 -0
- package/lib/host/types/plugin.d.ts.map +1 -0
- package/lib/host/types/plugin.js +10 -0
- package/lib/host/types/plugin.js.map +1 -0
- package/lib/host/types/services.d.ts +26 -0
- package/lib/host/types/services.d.ts.map +1 -0
- package/lib/host/types/services.js +9 -0
- package/lib/host/types/services.js.map +1 -0
- package/lib/host/types/settings.d.ts +180 -0
- package/lib/host/types/settings.d.ts.map +1 -0
- package/lib/host/types/settings.js +2 -0
- package/lib/host/types/settings.js.map +1 -0
- package/lib/host/types/stderr.d.ts +51 -0
- package/lib/host/types/stderr.d.ts.map +1 -0
- package/lib/host/types/stderr.js +9 -0
- package/lib/host/types/stderr.js.map +1 -0
- package/lib/host/types/windows.d.ts +39 -0
- package/lib/host/types/windows.d.ts.map +1 -0
- package/lib/host/types/windows.js +9 -0
- package/lib/host/types/windows.js.map +1 -0
- package/lib/host/values.d.ts +204 -0
- package/lib/host/values.d.ts.map +1 -0
- package/lib/host/values.js +404 -0
- package/lib/host/values.js.map +1 -0
- package/lib/host/windows/connect-flags.d.ts +27 -0
- package/lib/host/windows/connect-flags.d.ts.map +1 -0
- package/lib/host/windows/connect-flags.js +97 -0
- package/lib/host/windows/connect-flags.js.map +1 -0
- package/lib/host/windows/index.d.ts +31 -0
- package/lib/host/windows/index.d.ts.map +1 -0
- package/lib/host/windows/index.js +30 -0
- package/lib/host/windows/index.js.map +1 -0
- package/lib/host/windows/landing.d.ts +47 -0
- package/lib/host/windows/landing.d.ts.map +1 -0
- package/lib/host/windows/landing.js +174 -0
- package/lib/host/windows/landing.js.map +1 -0
- package/lib/host/windows/link.d.ts +11 -0
- package/lib/host/windows/link.d.ts.map +1 -0
- package/lib/host/windows/link.js +52 -0
- package/lib/host/windows/link.js.map +1 -0
- package/lib/host/windows/paths.d.ts +64 -0
- package/lib/host/windows/paths.d.ts.map +1 -0
- package/lib/host/windows/paths.js +148 -0
- package/lib/host/windows/paths.js.map +1 -0
- package/lib/host/windows/run.d.ts +74 -0
- package/lib/host/windows/run.d.ts.map +1 -0
- package/lib/host/windows/run.js +211 -0
- package/lib/host/windows/run.js.map +1 -0
- package/lib/host/windows/spawn.d.ts +22 -0
- package/lib/host/windows/spawn.d.ts.map +1 -0
- package/lib/host/windows/spawn.js +73 -0
- package/lib/host/windows/spawn.js.map +1 -0
- package/lib/index.d.ts +102 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +102 -636
- package/lib/index.js.map +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +57 -14
- package/cordis.patch.yml +0 -5
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function createChromeRefreshCommand(controller) {
|
|
2
|
+
return {
|
|
3
|
+
name: "chrome-refresh",
|
|
4
|
+
description: "Re-run Chrome executable discovery and merge what exists into the saved rows",
|
|
5
|
+
input: { hint: "(no arguments)" },
|
|
6
|
+
async handler() {
|
|
7
|
+
const live = controller.live;
|
|
8
|
+
const before = live.executableDiscoveryRevision;
|
|
9
|
+
try {
|
|
10
|
+
await controller.run();
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
return { kind: "error", text: `The executable run failed: ${String(error instanceof Error ? error.message : error)}` };
|
|
14
|
+
}
|
|
15
|
+
if (live.executableDiscoveryRevision === before) {
|
|
16
|
+
return { kind: "error", text: "The executable run did not complete." };
|
|
17
|
+
}
|
|
18
|
+
const statuses = live.executableStatus;
|
|
19
|
+
const found = statuses.filter((status) => status.version !== "");
|
|
20
|
+
const failed = statuses.filter((status) => status.error !== "");
|
|
21
|
+
const blocked = statuses.filter((status) => status.note !== "" && status.version === "" && status.error === "");
|
|
22
|
+
const lines = [`Executable run: ${found.length} runnable, ${failed.length} failed, ${blocked.length} offered-but-never-probed. Found paths merge into the saved rows.`];
|
|
23
|
+
for (const status of statuses) {
|
|
24
|
+
const answer = status.version !== "" ? status.version : status.error !== "" ? `failed: ${status.error}` : status.note;
|
|
25
|
+
lines.push(` - ${status.path}: ${answer}`);
|
|
26
|
+
}
|
|
27
|
+
// A discovery that found nothing runnable is a failed run reported
|
|
28
|
+
// the way the card reports it — through the error line it carries.
|
|
29
|
+
if (found.length === 0 && live.lastError !== "")
|
|
30
|
+
return { kind: "error", text: `${lines.join("\n")}\n${live.lastError}` };
|
|
31
|
+
if (live.lastError !== "")
|
|
32
|
+
lines.push(`Note: ${live.lastError}`);
|
|
33
|
+
return { kind: "success", text: lines.join("\n") };
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=chrome-refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chrome-refresh.js","sourceRoot":"","sources":["../../../src/host/commands/chrome-refresh.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,0BAA0B,CAAC,UAA+B;IACtE,OAAO;QACH,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,8EAA8E;QAC3F,KAAK,EAAE,EAAE,IAAI,EAA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E,CAAC;gBAC5B,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;gBACtH,KAAK,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC,CAAC;YAChD,CAAC;YACD,mEAAmE;YACnE,mEAAmE;YACnE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,EAAE;gBAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAC1H,IAAI,IAAI,CAAC,SAAS,KAAK,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;YACjE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACvD,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slash commands — the headless mirror of the card's two executable actions.
|
|
3
|
+
*
|
|
4
|
+
* The Web card is the primary surface, but a host with no GUI (or a user in an
|
|
5
|
+
* agent conversation) gets the same two actions: `/chrome-path` picks the
|
|
6
|
+
* executable and `/chrome-refresh` re-runs the discovery, both writing the SAME
|
|
7
|
+
* persisted fields through the SAME write-back channel as the card, so the pill,
|
|
8
|
+
* the command and the default answers never disagree.
|
|
9
|
+
*
|
|
10
|
+
* Registration rides the `commands` service lazily for the same reason the
|
|
11
|
+
* MCP tool avoids a static injection: the service may resolve only after
|
|
12
|
+
* `apply` returns, and a host without a commands plane simply gets no
|
|
13
|
+
* registration. Every `register()` disposer is retained so a hot re-apply of
|
|
14
|
+
* this plugin releases them — the registry throws on a duplicate name.
|
|
15
|
+
*/
|
|
16
|
+
import type { ChromeMcpController } from "../controller/index.js";
|
|
17
|
+
import type { ChromeMcpConfig, PluginContext } from "../types/index.js";
|
|
18
|
+
/**
|
|
19
|
+
* Register this plugin's commands on the `commands` service.
|
|
20
|
+
*
|
|
21
|
+
* @param ctx - plugin context.
|
|
22
|
+
* @param config - the validated row config (only the log prefix reads it).
|
|
23
|
+
* @param controller - the live state the commands drive through.
|
|
24
|
+
*/
|
|
25
|
+
export declare function installChromeMcpCommands(ctx: PluginContext, config: ChromeMcpConfig, controller: ChromeMcpController): void;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAqB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAU3F;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,GAAG,IAAI,CA0B3H"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createChromePathCommand } from "./chrome-path.js";
|
|
2
|
+
import { createChromeRefreshCommand } from "./chrome-refresh.js";
|
|
3
|
+
/**
|
|
4
|
+
* Register this plugin's commands on the `commands` service.
|
|
5
|
+
*
|
|
6
|
+
* @param ctx - plugin context.
|
|
7
|
+
* @param config - the validated row config (only the log prefix reads it).
|
|
8
|
+
* @param controller - the live state the commands drive through.
|
|
9
|
+
*/
|
|
10
|
+
export function installChromeMcpCommands(ctx, config, controller) {
|
|
11
|
+
ctx.effect(() => {
|
|
12
|
+
const commandDisposers = [];
|
|
13
|
+
let registered = false;
|
|
14
|
+
ctx.inject(["commands"], (inner) => {
|
|
15
|
+
if (registered)
|
|
16
|
+
return;
|
|
17
|
+
const commands = inner.commands;
|
|
18
|
+
// A host without a commands plane answers this half with nothing.
|
|
19
|
+
if (commands === undefined)
|
|
20
|
+
return;
|
|
21
|
+
registered = true;
|
|
22
|
+
for (const definition of [createChromePathCommand(controller), createChromeRefreshCommand(controller)]) {
|
|
23
|
+
// The registry throws on a duplicate name — a re-apply racing a
|
|
24
|
+
// still-live registration. The earlier definitions stay live, so
|
|
25
|
+
// a warning beats breaking `apply`.
|
|
26
|
+
try {
|
|
27
|
+
commandDisposers.push(commands.register(definition));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
ctx.logger.warn(`dsh-chrome-mcp(${config.serverName}): command "${definition.name}" registration skipped: ${String(error)}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return () => {
|
|
35
|
+
for (const dispose of commandDisposers.splice(0))
|
|
36
|
+
dispose();
|
|
37
|
+
registered = false;
|
|
38
|
+
};
|
|
39
|
+
}, "chrome-mcp: slash commands");
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/host/commands/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAQjE;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAkB,EAAE,MAAuB,EAAE,UAA+B;IACjH,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE;QACZ,MAAM,gBAAgB,GAAsB,EAAE,CAAC;QAC/C,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,GAAG,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,KAAoB,EAAE,EAAE;YAC9C,IAAI,UAAU;gBAAE,OAAO;YACvB,MAAM,QAAQ,GAAI,KAAwC,CAAC,QAAQ,CAAC;YACpE,kEAAkE;YAClE,IAAI,QAAQ,KAAK,SAAS;gBAAE,OAAO;YACnC,UAAU,GAAG,IAAI,CAAC;YAClB,KAAK,MAAM,UAAU,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,EAAE,0BAA0B,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;gBACrG,gEAAgE;gBAChE,iEAAiE;gBACjE,oCAAoC;gBACpC,IAAI,CAAC;oBACD,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;gBACzD,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACb,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,MAAM,CAAC,UAAU,eAAe,UAAU,CAAC,IAAI,2BAA2B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACjI,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACR,KAAK,MAAM,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;gBAAE,OAAO,EAAE,CAAC;YAC5D,UAAU,GAAG,KAAK,CAAC;QACvB,CAAC,CAAC;IACN,CAAC,EAAE,4BAA4B,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-half fixed identifiers, budgets and validation patterns.
|
|
3
|
+
*
|
|
4
|
+
* The strings are a public contract — the profile entry id is both the
|
|
5
|
+
* persistence key and the Web card's configuration-form key — and the budgets
|
|
6
|
+
* are what the README and the tests quote, so they live here once and every
|
|
7
|
+
* module imports rather than repeats them.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The profile entry id the bundle patch inserts (`cordis.patch.yml`), and the
|
|
11
|
+
* key every read and write of the configuration form goes through. Since dsh
|
|
12
|
+
* 0.2.0 the card addresses the Host through the **entry id**, not a namespace of
|
|
13
|
+
* its own, and `serverName` is not part of that identity. The Host reads the
|
|
14
|
+
* live id off its own fiber (`chromeMcpEntryId`) so a renamed row keeps
|
|
15
|
+
* working; this constant is what the loud failure and the log lines name.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ENTRY_ID = "mcp-chrome";
|
|
18
|
+
/** Environment variable that seeds the launch flags for one dsh run. */
|
|
19
|
+
export declare const FLAGS_ENV_VAR = "DSH_CHROME_MCP_FLAGS";
|
|
20
|
+
/**
|
|
21
|
+
* Flag entries are appended verbatim to the bridge argv and reach Chrome via
|
|
22
|
+
* a direct execve (no shell), so shell metacharacters cannot execute here.
|
|
23
|
+
* What must never reach argv is control characters (newlines, NULs) — they
|
|
24
|
+
* corrupt the argument framing, so entries may not contain any. This is the
|
|
25
|
+
* `extraFlags` field's own pattern: a form write naming a control character is
|
|
26
|
+
* refused Host-side, by the schema rather than by a `validate` hook.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CONTROL_PATTERN: RegExp;
|
|
29
|
+
/**
|
|
30
|
+
* One `extraFlags` entry as a form write may land it: non-empty, and no control
|
|
31
|
+
* character. This is the field's own pattern, so the gate that refuses them is
|
|
32
|
+
* the **schema**, not a `validate` hook — the write path runs it Host-side, on
|
|
33
|
+
* every layer (a row config carrying a newline fails to resolve rather than
|
|
34
|
+
* reaching argv as a corrupt entry). Spaces inside a value stay allowed: a
|
|
35
|
+
* Windows-style path in a flag value is one argv item, never a shell word (see
|
|
36
|
+
* ./flags.ts `validateExtraFlags` for what the paths the form never edits —
|
|
37
|
+
* `DSH_CHROME_MCP_FLAGS`, the row config — still check).
|
|
38
|
+
*/
|
|
39
|
+
export declare const EXTRA_FLAG_PATTERN: RegExp;
|
|
40
|
+
/** Flags every launch carries unless the user overrides them. */
|
|
41
|
+
export declare const DEFAULT_EXTRA_FLAGS: string[];
|
|
42
|
+
/**
|
|
43
|
+
* The flags the card's **Flags WSL** control appends for a WSL ↔ Windows
|
|
44
|
+
* debugging setup — a fixed recommendation, not a setting and never persisted.
|
|
45
|
+
* The shape is what makes it actually reach the browser:
|
|
46
|
+
*
|
|
47
|
+
* - the debug port travels as `--chromeArg=--remote-debugging-port=9222`:
|
|
48
|
+
* the bridge's strict parser knows only its own option names, so a bare
|
|
49
|
+
* `--remote-debugging-port` is reported as `Unknown arguments` and dropped
|
|
50
|
+
* before any browser is launched; as a `chromeArg` it lands in Chrome's own
|
|
51
|
+
* argv and the debugging port opens (see the "Browser switches" hard
|
|
52
|
+
* constraint).
|
|
53
|
+
*
|
|
54
|
+
* A `--user-data-dir` entry is deliberately **not** recommended alongside it.
|
|
55
|
+
* The idea of carrying the profile as a project-rooted `.chrome` was measured
|
|
56
|
+
* to be impossible for the Windows executable: a Windows `chrome.exe` profile
|
|
57
|
+
* directory has to live on a Windows-local path — neither the WSL checkout
|
|
58
|
+
* nor the `\\wsl.localhost` mount can carry its locks (9P) — so the
|
|
59
|
+
* **Prelaunch Windows Chrome** run launches with its own Windows-native
|
|
60
|
+
* profile under `%LOCALAPPDATA%`, and the one entry this list recommends is
|
|
61
|
+
* the debug port the run answers on.
|
|
62
|
+
*/
|
|
63
|
+
export declare const WSL_EXTRA_FLAGS: string[];
|
|
64
|
+
/** Upstream configuration docs surfaced by the client card link. */
|
|
65
|
+
export declare const CONFIGURATION_DOCS_URL = "https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/configuration.md";
|
|
66
|
+
/** Timeout for one check subprocess (chrome executable probe). */
|
|
67
|
+
export declare const CHECK_TIMEOUT_MS = 15000;
|
|
68
|
+
/**
|
|
69
|
+
* What a Windows executable answers when no version folder sits beside it. On
|
|
70
|
+
* Windows a Chromium browser does not answer `--version`: it opens a window
|
|
71
|
+
* (or hands one to the instance already running), so it is never spawned to
|
|
72
|
+
* ask — the version is read off the install's own `<major>.<minor>.<build>.<patch>`
|
|
73
|
+
* folder instead, and an install without one answers this.
|
|
74
|
+
*/
|
|
75
|
+
export declare const WINDOWS_VERSION_UNKNOWN = "version unknown";
|
|
76
|
+
/**
|
|
77
|
+
* How long a failed executable run waits before its one bounded retry. The
|
|
78
|
+
* failure this answers is not "nothing is installed here" — it is a host that
|
|
79
|
+
* is not ready yet at the moment the run fires (a WSL boot whose interop
|
|
80
|
+
* mount has not been served yet, a drive not yet mounted). Without the retry
|
|
81
|
+
* that answer would stand until someone fired the run again by hand.
|
|
82
|
+
*/
|
|
83
|
+
export declare const DISCOVERY_RETRY_DELAY_MS = 15000;
|
|
84
|
+
/** How many retries one run chain may arm. Bounded so a machine with nothing
|
|
85
|
+
* installed is never probed forever — four passes span a boot window, and the
|
|
86
|
+
* manual trigger stays the answer beyond it. */
|
|
87
|
+
export declare const DISCOVERY_RETRY_MAX = 4;
|
|
88
|
+
/**
|
|
89
|
+
* Why a Windows `chrome.exe` on a WSL host is **never probed** — and, since the
|
|
90
|
+
* Windows executables this host carries *are* offered as candidates, what such a
|
|
91
|
+
* candidate reads as instead of a failure. The exec answers successfully — which
|
|
92
|
+
* is what makes the selection look healthy — but answering means *attaching to
|
|
93
|
+
* the Windows browser session*, and that brings a browser instance up (measured
|
|
94
|
+
* on WSL2 + Google Chrome 153: `chrome.exe --version` spawns the browser process
|
|
95
|
+
* plus its crashpad handler). No tool call could ever drive what it started (the
|
|
96
|
+
* debug pipes do not cross the interop boundary), so the probe buys nothing and
|
|
97
|
+
* costs a running browser: the check answers nothing, and the scan keeps the
|
|
98
|
+
* entry visible carrying this reason — as its **note**, never as a failure,
|
|
99
|
+
* because the **Prelaunch Windows Chrome** run drives it in connect mode.
|
|
100
|
+
*/
|
|
101
|
+
export declare const WSL_WINDOWS_LAUNCH_ERROR = "Windows chrome.exe cannot be launched from WSL \u2014 run Prelaunch Windows Chrome to drive it in connect mode";
|
|
102
|
+
/** Max length of a reported error line. */
|
|
103
|
+
export declare const ERROR_CAP = 240;
|
|
104
|
+
/**
|
|
105
|
+
* Log lines the bridge emits after a lost connection recovered — clear
|
|
106
|
+
* the captured connection error when one shows up.
|
|
107
|
+
*/
|
|
108
|
+
export declare const BRIDGE_RECONNECTED: RegExp;
|
|
109
|
+
/** One bridge log level: the levels the captured wrapper shadows. */
|
|
110
|
+
export declare const LOG_LEVELS: readonly ["trace", "debug", "info", "warn", "error", "fatal"];
|
|
111
|
+
/**
|
|
112
|
+
* Bridge console-output routing modes (mirrors the reference plugin's gateway
|
|
113
|
+
* stderr modes). "log" redirects the spawned child's stderr into a log file;
|
|
114
|
+
* "console" inherits it onto the dsh console.
|
|
115
|
+
*/
|
|
116
|
+
export declare const BRIDGE_STDERR_MODES: ReadonlyArray<"log" | "console">;
|
|
117
|
+
/** Modes accepted by the `stderrMode` user layer: also the empty string
|
|
118
|
+
* ("" → follow the row config `bridgeStderr`). */
|
|
119
|
+
export declare const STDERR_MODE_FIELD_PATTERN: RegExp;
|
|
120
|
+
/** Row-config `bridgeStderrLog` accepts "" (the per-spawn default) or a
|
|
121
|
+
* POSIX absolute path; nothing else. */
|
|
122
|
+
export declare const OPTIONAL_PATH_PATTERN: RegExp;
|
|
123
|
+
/**
|
|
124
|
+
* The connection kinds this component registers with the manager's
|
|
125
|
+
* `mcpConnections` service. They are the
|
|
126
|
+
* component: the row stands up no bridge of its own any more, every live bridge
|
|
127
|
+
* is one of these connections.
|
|
128
|
+
*
|
|
129
|
+
* `chrome` — the local `chrome-devtools-mcp` bridge, what the row used to start
|
|
130
|
+
* for itself. `chrome-windows` — the Windows browser driven through the WSL
|
|
131
|
+
* interop mount (the run the **Prelaunch Windows Chrome** button answers with),
|
|
132
|
+
* async to launch. The ids are the contract with `servers` entries; the labels
|
|
133
|
+
* are what the picker lists. Neither kind caps its entries and neither carries
|
|
134
|
+
* a composer pill.
|
|
135
|
+
*/
|
|
136
|
+
export declare const KIND_ID_CHROME = "chrome";
|
|
137
|
+
export declare const KIND_ID_WINDOWS = "chrome-windows";
|
|
138
|
+
export declare const KIND_CHROME_LABEL = "Chrome MCP";
|
|
139
|
+
export declare const KIND_CHROME_SUMMARY = "Runs `chrome-devtools-mcp` and launches a local Chrome. The executable and the flags are picked on the connection.";
|
|
140
|
+
export declare const KIND_WINDOWS_LABEL = "Windows Chrome (WSL debug port)";
|
|
141
|
+
export declare const KIND_WINDOWS_SUMMARY = "Opens the Windows Chrome through the WSL interop mount and connects to its debugging port. WSL only.";
|
|
142
|
+
/**
|
|
143
|
+
* The keys one entry's `extra` carries for these kinds. They are a contract with
|
|
144
|
+
* the manager's entry editor: what the fields write is exactly what `resolve`
|
|
145
|
+
* reads back. `extraFlags` is a `lines` field, so its value is one flag per
|
|
146
|
+
* line joined by newlines (see ./kind.ts `parseFlagLines`).
|
|
147
|
+
*/
|
|
148
|
+
export declare const KIND_FIELDS: {
|
|
149
|
+
readonly executable: "executable";
|
|
150
|
+
readonly extraFlags: "extraFlags";
|
|
151
|
+
readonly stderrMode: "stderrMode";
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Whether the translation of a **standalone** row config has been offered and
|
|
155
|
+
* turned down. It is a volatile field of this
|
|
156
|
+
* row — what was refused is this row's configuration, so the dismissal lives
|
|
157
|
+
* here and nowhere else.
|
|
158
|
+
*/
|
|
159
|
+
export declare const MIGRATION_DISMISSED_FIELD = "migrationDismissed";
|
|
160
|
+
/** One entry's extra flag lines joined the way a `lines` field stores them. */
|
|
161
|
+
export declare const FLAG_LINE_SEPARATOR = "\n";
|
|
162
|
+
/** Why the `chrome-windows` kind refuses an entry off WSL (spec §2: not-applicable). */
|
|
163
|
+
export declare const NOT_WSL_ERROR = "This host is not a WSL instance: there is no Windows-side browser to drive \u2014 use the Chrome MCP kind instead";
|
|
164
|
+
/**
|
|
165
|
+
* `chromePath` user layer: a filesystem path or a PATH-resolved name. Nothing
|
|
166
|
+
* travels through a shell here either, so the only hard constraint is that no
|
|
167
|
+
* control character reaches it; the length cap keeps one absurd value out of
|
|
168
|
+
* argv and out of the row's own patch layer.
|
|
169
|
+
*/
|
|
170
|
+
export declare const CHROME_PATH_PATTERN: RegExp;
|
|
171
|
+
/** Upper bound of the **legacy** UI-authored custom-executable MRU (oldest
|
|
172
|
+
* drops off). The MRU is the older shape of the saved-executables list: a host
|
|
173
|
+
* whose settings still carry it folds its paths into the `executables` rows the
|
|
174
|
+
* first time the picker scans (see ./catalog.ts `mergeEntries`), after which the
|
|
175
|
+
* rows are the only source of saved executables. */
|
|
176
|
+
export declare const CUSTOM_PATHS_CAP = 10;
|
|
177
|
+
/** Longest display name a saved-executable row may carry — the `name` half is
|
|
178
|
+
* UI-only (what the pill and the dropdown render), the `id` half is what goes on
|
|
179
|
+
* the wire. */
|
|
180
|
+
export declare const CATALOG_NAME_MAX_LENGTH = 200;
|
|
181
|
+
/** Upper bound of the saved-executable rows, merged-list side: the tail drops
|
|
182
|
+
* off, so a scan that keeps discovering new ids cannot grow the persisted
|
|
183
|
+
* catalog without limit. */
|
|
184
|
+
export declare const CATALOG_MAX_LENGTH = 50;
|
|
185
|
+
/**
|
|
186
|
+
* The Windows-side Chrome/Edge executables this host carries. The
|
|
187
|
+
* **Prelaunch Windows Chrome** button locates through them, and — on a WSL host
|
|
188
|
+
* only — the executable run folds the ones this machine actually carries into its
|
|
189
|
+
* candidate list, so the picker can name the executable the run drives. They are
|
|
190
|
+
* never *probed* from here (`WSL_WINDOWS_LAUNCH_ERROR`): the run drives them in
|
|
191
|
+
* *connect* mode, which is the only Windows path ever measured to work. The list
|
|
192
|
+
* is host-served logic: the card carries no copy of it.
|
|
193
|
+
*/
|
|
194
|
+
export declare const WINDOWS_CHROME_CANDIDATES: readonly ["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe", "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"];
|
|
195
|
+
/** The debugging port every Windows Chrome launch carries first — kept
|
|
196
|
+
* coherent with the port the **Flags WSL** control recommends. */
|
|
197
|
+
export declare const WINDOWS_CHROME_PORT = 9222;
|
|
198
|
+
/** The debugging-port pool the run falls through when the first port is already
|
|
199
|
+
* carrying a listener: [first, first+1, …]. A listener answers "reachable",
|
|
200
|
+
* which is what makes the port's own reachability sample its in-use signal. */
|
|
201
|
+
export declare const WINDOWS_CHROME_PORT_POOL: readonly [9222, 9223, 9224];
|
|
202
|
+
/**
|
|
203
|
+
* Ports that **only Windows ever listens on** (RPC endpoint mapper, RDP). The
|
|
204
|
+
* prereq check connects one of them: on a `mirrored` networkingMode host the
|
|
205
|
+
* connect succeeds, on a NAT host it gives up — the sample must discriminate,
|
|
206
|
+
* which is exactly what makes it the prereq (measured: 135/3389 CONNECTED
|
|
207
|
+
* under mirrored, closed ports TIME OUT, never refuse). A port that WSL might
|
|
208
|
+
* hold locally (445 via Samba) must never be used: it would answer reachable
|
|
209
|
+
* even when the Windows loopback is unreachable.
|
|
210
|
+
*/
|
|
211
|
+
export declare const WINDOWS_CHROME_PREREQ_PORTS: readonly [135, 3389];
|
|
212
|
+
/** How long to wait for the launched Windows Chrome to open its port. */
|
|
213
|
+
export declare const WINDOWS_CHROME_WAIT_MS = 10000;
|
|
214
|
+
/** How long one TCP reachability sample waits before calling the port
|
|
215
|
+
* unreachable (a NAT host's closed port times out; it never refuses). */
|
|
216
|
+
export declare const WINDOWS_CHROME_SAMPLE_MS = 1000;
|
|
217
|
+
/** Poll cadence while waiting for a launched Windows Chrome to bind its port. */
|
|
218
|
+
export declare const WINDOWS_CHROME_POLL_MS = 500;
|
|
219
|
+
/**
|
|
220
|
+
* The Windows-side working directory the launch runs with. Nothing depends on
|
|
221
|
+
* it (every argument is absolute), it only keeps relative path resolution off
|
|
222
|
+
* any UNC (WSL-side) path — the shape the old `cmd.exe /c start` form needed
|
|
223
|
+
* too (measured 2026-10-04, see .probe/windows-chrome-connect-probe.log).
|
|
224
|
+
*/
|
|
225
|
+
export declare const WINDOWS_CHROME_START_CWD = "/mnt/c/Windows";
|
|
226
|
+
/** The UNC root modern WSL exports to Windows-side processes. */
|
|
227
|
+
export declare const WSL_UNC_ROOT = "\\\\wsl.localhost\\";
|
|
228
|
+
/**
|
|
229
|
+
* The Windows-side directory name the run profiles under
|
|
230
|
+
* (`%LOCALAPPDATA%\dsh-chrome-mcp\<.chrome|\.chrome-<port>>`). The profile
|
|
231
|
+
* must live on the Windows filesystem: the WSL-side directories, served to
|
|
232
|
+
* Windows through 9P, cannot carry the locks Chrome's SQLite tables and its
|
|
233
|
+
* singleton socket take — a profile rooted there opens every table as a
|
|
234
|
+
* zero-byte file and shows "an error occurred while opening your profile" on
|
|
235
|
+
* every launch (measured live 2026-10-04 against Chrome 154). The workspace
|
|
236
|
+
* keeps a `.chrome` view of this directory through the link the run refreshes
|
|
237
|
+
* (see `linkWindowsChromeProfile`).
|
|
238
|
+
*/
|
|
239
|
+
export declare const WINDOWS_CHROME_PROFILE_DIRNAME = "dsh-chrome-mcp";
|
|
240
|
+
/** The connect-mode flag the button writes; its value is the debugging URL. */
|
|
241
|
+
export declare const BROWSER_URL_FLAG_PREFIX = "--browserUrl=";
|
|
242
|
+
/**
|
|
243
|
+
* The flags a brand-new Windows profile is launched with, beside the port and
|
|
244
|
+
* the profile directory. A fresh `--user-data-dir` IS a first run for the
|
|
245
|
+
* browser: Windows Chrome opens the welcome tab and the default-search-engine
|
|
246
|
+
* chooser on it, and in connect mode nothing clicks through it — the debugging
|
|
247
|
+
* session is left sitting on the FRE page. Both flags suppress that
|
|
248
|
+
* experience, exactly like the manual recipe the button replaces. They travel
|
|
249
|
+
* on the **browser's own** argv (the `start` line), never as `--chromeArg=`:
|
|
250
|
+
* here it is Chrome being told at launch what not to show, not the bridge
|
|
251
|
+
* parser (see the browser-switches bullet under Hard constraints).
|
|
252
|
+
*/
|
|
253
|
+
export declare const WINDOWS_CHROME_FIRST_RUN_FLAGS: readonly ["--no-first-run", "--no-default-browser-check"];
|
|
254
|
+
/**
|
|
255
|
+
* The page the Windows launch opens, package-root-relative. It is the one asset
|
|
256
|
+
* this plugin ships outside `lib`, and it is **read host-side**: the run renders
|
|
257
|
+
* it with its own answers, writes it through the interop mount next to the
|
|
258
|
+
* profile directory (so the Windows-side browser can actually read it), and hands
|
|
259
|
+
* the browser the `file:///…` URL. It exists because the honest answer to "why
|
|
260
|
+
* did a window just open?" is prose the argv cannot carry — and the usual
|
|
261
|
+
* placeholder is not an option: `example.com` carries an explicit notice against
|
|
262
|
+
* being used for automation and tests.
|
|
263
|
+
*/
|
|
264
|
+
export declare const WINDOWS_CHROME_LANDING_ASSET = "assets/prelaunch-windows-chrome.html";
|
|
265
|
+
/** The base name of the landing file written beside each profile directory
|
|
266
|
+
* (`…\dsh-chrome-mcp\prelaunch-<port>.html`) — a sibling of the profile, never a
|
|
267
|
+
* file inside it, so it never reads as profile churn. */
|
|
268
|
+
export declare const WINDOWS_CHROME_LANDING_BASENAME = "prelaunch";
|
|
269
|
+
/** What one Windows Chrome run may currently be doing (the card derives its
|
|
270
|
+
* button state, pill muting and disabled reason from this single field).
|
|
271
|
+
* `"not-applicable"` is the non-WSL answer the plan asks the button to read as
|
|
272
|
+
* disabled-off; `"launch-failed"` and the rest are the §4 failure states. */
|
|
273
|
+
export declare const WINDOWS_CHROME_STATES: readonly ["off", "launching", "connected", "unreachable", "not-found", "launch-failed", "not-applicable"];
|
|
274
|
+
/** Schema pattern for `windowsChromeStatus.state`. */
|
|
275
|
+
export declare const WINDOWS_CHROME_STATE_PATTERN: RegExp;
|
|
276
|
+
/**
|
|
277
|
+
* The prereq answer — the one manual step that is not the button's job
|
|
278
|
+
* (configuring `~/.wslconfig` is out of scope, reading/reaching it is not).
|
|
279
|
+
*/
|
|
280
|
+
export declare const WINDOWS_CHROME_PREREQ_ERROR = "Windows Chrome needs networkingMode=mirrored in %USERPROFILE%\\.wslconfig, then wsl --shutdown: today the Windows loopback is not reachable from this WSL host";
|
|
281
|
+
/** Where the effective selection came from (`effectiveSource`): a `chromePath`
|
|
282
|
+
* written by the card (or seeded once by the host) or the row config. Nothing
|
|
283
|
+
* resolves on its own, so there is no "auto". */
|
|
284
|
+
export declare const EFFECTIVE_SOURCES: readonly ["selected", "row-config"];
|
|
285
|
+
/**
|
|
286
|
+
* Environment variables WSL exports into every distro session. Their presence
|
|
287
|
+
* answers "are we running inside WSL?" — the first one carries the distro name,
|
|
288
|
+
* `WSL_INTEROP` the interop-path directory (`/run/WSL/<pid>`).
|
|
289
|
+
*/
|
|
290
|
+
export declare const WSL_ENV_VARS: readonly ["WSL_DISTRO_NAME", "WSL_DISTRO_LABEL", "WSL_INTEROP"];
|
|
291
|
+
/**
|
|
292
|
+
* The `binfmt_misc` registration WSL installs for PE binaries: its presence
|
|
293
|
+
* marks a WSL kernel. It is only the **fallback** signal — inside a host the
|
|
294
|
+
* launch environment is authoritative, and an empty one is an answer (see
|
|
295
|
+
* ./platform.ts).
|
|
296
|
+
*/
|
|
297
|
+
export declare const WSL_INTEROP_MARKER = "/proc/sys/fs/binfmt_misc/WSLInterop";
|
|
298
|
+
/** Windows executables reachable through the interop mount (`/mnt/c/...`) or by
|
|
299
|
+
* their Windows spelling (UNC, drive letter). */
|
|
300
|
+
export declare const WINDOWS_PATH_PATTERN: RegExp;
|
|
301
|
+
/** The PE suffix. WSL execve's a `.exe` from any path (the Windows loader reads
|
|
302
|
+
* the Linux filesystem over UNC), so the suffix alone marks a Windows binary. */
|
|
303
|
+
export declare const WINDOWS_EXE_PATTERN: RegExp;
|
|
304
|
+
/** Schema pattern for `effectiveSource` ("" = nothing resolved yet). */
|
|
305
|
+
export declare const EFFECTIVE_SOURCE_PATTERN: RegExp;
|
|
306
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/host/constants.ts"],"names":[],"mapp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