@comecaramelos/dsh-chrome-mcp 1.0.0 → 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 -39
- package/lib/client.js +2186 -614
- package/lib/client.js.map +4 -4
- package/lib/host/apply.d.ts +38 -1
- package/lib/host/apply.d.ts.map +1 -1
- package/lib/host/apply.js +43 -17
- package/lib/host/apply.js.map +1 -1
- package/lib/host/bridge.d.ts +28 -19
- package/lib/host/bridge.d.ts.map +1 -1
- package/lib/host/bridge.js +71 -79
- package/lib/host/bridge.js.map +1 -1
- package/lib/host/catalog.d.ts +2 -2
- package/lib/host/catalog.js +2 -2
- 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 +107 -30
- package/lib/host/constants.d.ts.map +1 -1
- package/lib/host/constants.js +107 -30
- package/lib/host/constants.js.map +1 -1
- 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 +4 -2
- package/lib/host/controller/bridge-run.d.ts.map +1 -1
- package/lib/host/controller/bridge-run.js +24 -8
- package/lib/host/controller/bridge-run.js.map +1 -1
- package/lib/host/controller/captures.d.ts +9 -16
- package/lib/host/controller/captures.d.ts.map +1 -1
- package/lib/host/controller/captures.js +73 -48
- package/lib/host/controller/captures.js.map +1 -1
- package/lib/host/controller/commits.d.ts +2 -2
- package/lib/host/controller/commits.d.ts.map +1 -1
- package/lib/host/controller/commits.js +97 -41
- package/lib/host/controller/commits.js.map +1 -1
- 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 +19 -24
- package/lib/host/controller/controller.d.ts.map +1 -1
- package/lib/host/controller/controller.js +181 -114
- package/lib/host/controller/controller.js.map +1 -1
- package/lib/host/controller/index.d.ts +18 -14
- package/lib/host/controller/index.d.ts.map +1 -1
- package/lib/host/controller/index.js +16 -14
- package/lib/host/controller/index.js.map +1 -1
- package/lib/host/controller/notes.d.ts +9 -9
- package/lib/host/controller/notes.d.ts.map +1 -1
- package/lib/host/controller/notes.js +16 -21
- package/lib/host/controller/notes.js.map +1 -1
- package/lib/host/controller/persist.d.ts +10 -3
- package/lib/host/controller/persist.d.ts.map +1 -1
- package/lib/host/controller/persist.js +89 -42
- package/lib/host/controller/persist.js.map +1 -1
- 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 +34 -10
- package/lib/host/controller/runs.d.ts.map +1 -1
- package/lib/host/controller/runs.js +241 -58
- package/lib/host/controller/runs.js.map +1 -1
- package/lib/host/controller/state.d.ts +122 -20
- package/lib/host/controller/state.d.ts.map +1 -1
- package/lib/host/controller/windows-run.d.ts +10 -2
- package/lib/host/controller/windows-run.d.ts.map +1 -1
- package/lib/host/controller/windows-run.js +66 -35
- package/lib/host/controller/windows-run.js.map +1 -1
- package/lib/host/discovery/candidates.d.ts +23 -13
- package/lib/host/discovery/candidates.d.ts.map +1 -1
- package/lib/host/discovery/candidates.js +20 -8
- package/lib/host/discovery/candidates.js.map +1 -1
- package/lib/host/discovery/index.d.ts +1 -0
- package/lib/host/discovery/index.d.ts.map +1 -1
- package/lib/host/discovery/index.js +1 -0
- package/lib/host/discovery/index.js.map +1 -1
- package/lib/host/discovery/probe.d.ts +16 -5
- package/lib/host/discovery/probe.d.ts.map +1 -1
- package/lib/host/discovery/probe.js +68 -10
- package/lib/host/discovery/probe.js.map +1 -1
- package/lib/host/discovery/scan.d.ts +14 -9
- package/lib/host/discovery/scan.d.ts.map +1 -1
- package/lib/host/discovery/scan.js +56 -30
- package/lib/host/discovery/scan.js.map +1 -1
- package/lib/host/flags.d.ts +28 -5
- package/lib/host/flags.d.ts.map +1 -1
- package/lib/host/flags.js +75 -7
- package/lib/host/flags.js.map +1 -1
- 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/plugin-meta.d.ts +12 -3
- package/lib/host/plugin-meta.d.ts.map +1 -1
- package/lib/host/plugin-meta.js +13 -4
- package/lib/host/plugin-meta.js.map +1 -1
- package/lib/host/schema.d.ts +301 -247
- package/lib/host/schema.d.ts.map +1 -1
- package/lib/host/schema.js +145 -120
- package/lib/host/schema.js.map +1 -1
- package/lib/host/settings.d.ts +22 -3
- package/lib/host/settings.d.ts.map +1 -1
- package/lib/host/settings.js +81 -60
- package/lib/host/settings.js.map +1 -1
- package/lib/host/status.d.ts +7 -10
- package/lib/host/status.d.ts.map +1 -1
- package/lib/host/status.js +8 -23
- package/lib/host/status.js.map +1 -1
- package/lib/host/tool.d.ts +13 -7
- package/lib/host/tool.d.ts.map +1 -1
- package/lib/host/tool.js +4 -3
- package/lib/host/tool.js.map +1 -1
- package/lib/host/types/config.d.ts +66 -12
- package/lib/host/types/config.d.ts.map +1 -1
- package/lib/host/types/executable.d.ts +8 -3
- package/lib/host/types/executable.d.ts.map +1 -1
- package/lib/host/types/index.d.ts +5 -4
- package/lib/host/types/index.d.ts.map +1 -1
- 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 +118 -65
- package/lib/host/types/settings.d.ts.map +1 -1
- package/lib/host/types/stderr.d.ts +3 -5
- package/lib/host/types/stderr.d.ts.map +1 -1
- package/lib/host/values.d.ts +152 -37
- package/lib/host/values.d.ts.map +1 -1
- package/lib/host/values.js +304 -112
- package/lib/host/values.js.map +1 -1
- package/lib/host/windows/connect-flags.d.ts +19 -8
- package/lib/host/windows/connect-flags.d.ts.map +1 -1
- package/lib/host/windows/connect-flags.js +50 -20
- package/lib/host/windows/connect-flags.js.map +1 -1
- package/lib/host/windows/index.d.ts +1 -1
- package/lib/host/windows/index.d.ts.map +1 -1
- package/lib/host/windows/index.js +1 -1
- package/lib/host/windows/index.js.map +1 -1
- package/lib/host/windows/paths.d.ts +27 -6
- package/lib/host/windows/paths.d.ts.map +1 -1
- package/lib/host/windows/paths.js +40 -13
- package/lib/host/windows/paths.js.map +1 -1
- package/lib/host/windows/run.d.ts.map +1 -1
- package/lib/host/windows/run.js +3 -2
- package/lib/host/windows/run.js.map +1 -1
- package/lib/index.d.ts +72 -56
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +74 -55
- package/lib/index.js.map +1 -1
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +35 -14
- package/cordis.patch.yml +0 -5
package/lib/host/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/host/schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
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AE/C;;iBAEa;;aAEf,CAAC;AAEH;;;;;;4DAM4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
package/lib/host/schema.js
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The single zod `Config` of the plugin row.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Since dsh 0.2.0 the Web GUI card edits the **row configuration** through the
|
|
5
|
+
* profile's configuration form — there is no separate `settings.yaml` namespace
|
|
6
|
+
* and no base layer to publish state over. So one schema carries everything the
|
|
7
|
+
* card reads and writes, and every field the card touches is declared
|
|
8
|
+
* `.volatile()`: a volatile field is editable through the form without
|
|
9
|
+
* remounting the plugin, its user layer rides the profile patch instead of
|
|
10
|
+
* `settings.yaml`, and a live value the Host commits never reaches the patch
|
|
11
|
+
* (the form write strips the volatile fields out of the stored layer before
|
|
12
|
+
* merging).
|
|
13
|
+
*
|
|
14
|
+
* Ordinary fields (`serverName`, `command`, `package`, `chromePaths`, `env`,
|
|
15
|
+
* `cwd`, `toolCallTimeoutMs`, `maxInstructionBytes`, `failOnStartupError`,
|
|
16
|
+
* `reconnect`, `bridgeStderrLog`) are composition-only: the card reads them, it
|
|
17
|
+
* never edits them, and a form write naming one of them is refused by
|
|
18
|
+
* dsh-settings.
|
|
19
|
+
*
|
|
20
|
+
* Host-resolved fields carry the live value in the reference, so the Host
|
|
21
|
+
* publishes them through the live mirror (dsh-ancesters `createLiveMirror`) — never with the form.
|
|
9
22
|
*/
|
|
10
23
|
import z from "@deepseek-ai/schemastery";
|
|
11
|
-
import { CHROME_PATH_PATTERN, DEFAULT_EXTRA_FLAGS, EFFECTIVE_SOURCE_PATTERN, OPTIONAL_PATH_PATTERN, STDERR_MODE_FIELD_PATTERN, WINDOWS_CHROME_STATE_PATTERN, WSL_EXTRA_FLAGS } from "./constants.js";
|
|
24
|
+
import { CHROME_PATH_PATTERN, DEFAULT_EXTRA_FLAGS, EFFECTIVE_SOURCE_PATTERN, EXTRA_FLAG_PATTERN, OPTIONAL_PATH_PATTERN, STDERR_MODE_FIELD_PATTERN, WINDOWS_CHROME_STATE_PATTERN, WSL_EXTRA_FLAGS } from "./constants.js";
|
|
12
25
|
import { defaultChromePaths } from "./discovery/index.js";
|
|
13
26
|
/** Reconnect policy passthrough; mirrors dsh-mcp-client's schema. */
|
|
14
27
|
const Reconnect = z.object({
|
|
@@ -17,16 +30,58 @@ const Reconnect = z.object({
|
|
|
17
30
|
maxDelayMs: z.number().min(1).max(600000).default(30000),
|
|
18
31
|
maxAttempts: z.number().step(1).min(1).max(Number.MAX_SAFE_INTEGER).default(10)
|
|
19
32
|
});
|
|
33
|
+
/**
|
|
34
|
+
* One saved-executable catalog row: `id` is the path that goes on the wire
|
|
35
|
+
* (`--executablePath=<id>`), `name` the label the user chose for the UI
|
|
36
|
+
* ("" = render the path). User layer.
|
|
37
|
+
*/
|
|
38
|
+
const ExecutableEntry = z.object({
|
|
39
|
+
id: z.string().default("").pattern(CHROME_PATH_PATTERN),
|
|
40
|
+
name: z.string().default("")
|
|
41
|
+
});
|
|
42
|
+
/** What one saved row's probe answered with, keyed by its id (`path`): the
|
|
43
|
+
* `--version` line, the failure that makes it not runnable, and the note that
|
|
44
|
+
* explains an executable this host offers without probing (`note` is never a
|
|
45
|
+
* failure — the one case is a Windows executable under WSL, driven by the
|
|
46
|
+
* **Prelaunch Windows Chrome** run). */
|
|
47
|
+
const ExecutableStatus = z.object({
|
|
48
|
+
path: z.string().default("").pattern(CHROME_PATH_PATTERN),
|
|
49
|
+
version: z.string().default(""),
|
|
50
|
+
error: z.string().default(""),
|
|
51
|
+
note: z.string().default("")
|
|
52
|
+
});
|
|
53
|
+
/** The served Windows-Chrome state: what the **Prelaunch Windows Chrome** run is
|
|
54
|
+
* doing, the debugging port it settled on (0 = none) and the failure line. */
|
|
55
|
+
const WindowsChromeStatus = z.object({
|
|
56
|
+
state: z.string().pattern(WINDOWS_CHROME_STATE_PATTERN).default("off"),
|
|
57
|
+
port: z.number().default(0),
|
|
58
|
+
error: z.string().default("")
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* The plugin row's configuration, and the configuration form the Web GUI card
|
|
62
|
+
* edits. Every `.volatile()` field below is live: a user edit lands in the
|
|
63
|
+
* profile patch and commits without a remount, and the Host's own live answers
|
|
64
|
+
* ride the same references without ever being persisted.
|
|
65
|
+
*/
|
|
20
66
|
export const Config = z.object({
|
|
21
67
|
serverName: z.string().pattern(/^[A-Za-z0-9_-]{1,32}$/).default("chrome"),
|
|
22
68
|
command: z.string().default("npx"),
|
|
23
69
|
package: z.string().min(1).default("chrome-devtools-mcp@latest"),
|
|
24
|
-
|
|
25
|
-
|
|
70
|
+
/** Flags appended after `npx -y <package>`; the card's last UI edit. The
|
|
71
|
+
* field's own pattern is what refuses them (an entry that carries a control
|
|
72
|
+
* character never resolves, so a write is refused Host-side rather than
|
|
73
|
+
* landing in argv); an executable-pinning flag is rejected by the Host fold
|
|
74
|
+
* because the executable is picked below. */
|
|
75
|
+
extraFlags: z.array(z.string().pattern(EXTRA_FLAG_PATTERN)).default(DEFAULT_EXTRA_FLAGS).volatile(),
|
|
26
76
|
chromePaths: z.array(String).default(defaultChromePaths()),
|
|
27
77
|
env: z.dict(String).default({}),
|
|
28
78
|
cwd: z.string().default(""),
|
|
29
79
|
toolCallTimeoutMs: z.number().default(60000),
|
|
80
|
+
/** Ceiling for the bridge's server instructions (UTF-8 bytes, attribution
|
|
81
|
+
* included); an oversized description rejects the connection. Mirrors
|
|
82
|
+
* `dsh-mcp-client`'s own field and default (32768) — a passthrough for a
|
|
83
|
+
* server whose instructions run longer than the cap. */
|
|
84
|
+
maxInstructionBytes: z.number().step(1).min(1).default(32768),
|
|
30
85
|
failOnStartupError: z.boolean().default(false),
|
|
31
86
|
reconnect: Reconnect,
|
|
32
87
|
/** Bridge console-output routing: "log" (default) redirects the spawned
|
|
@@ -37,135 +92,105 @@ export const Config = z.object({
|
|
|
37
92
|
bridgeStderr: z.union([z.const("log"), z.const("console")]).default("log"),
|
|
38
93
|
/** Log path override for "log" mode; "" = auto (see
|
|
39
94
|
* {@link bridgeStderrLogPath}). Absolute paths only. */
|
|
40
|
-
bridgeStderrLog: z.string().default("").pattern(OPTIONAL_PATH_PATTERN)
|
|
41
|
-
|
|
42
|
-
/** One saved-executable catalog row: `id` is the path that goes on the wire
|
|
43
|
-
* (`--executablePath=<id>`), `name` the label the user chose for the UI
|
|
44
|
-
* ("" = render the path). Persisted. */
|
|
45
|
-
const ExecutableEntrySchema = z.object({
|
|
46
|
-
id: z.string().default("").pattern(CHROME_PATH_PATTERN),
|
|
47
|
-
name: z.string().default("")
|
|
48
|
-
});
|
|
49
|
-
/** What one saved row's probe answered with, keyed by its id (`path`): the
|
|
50
|
-
* `--version` line, and the failure that makes it not runnable. Base layer. */
|
|
51
|
-
const ExecutableStatusSchema = z.object({
|
|
52
|
-
path: z.string().default("").pattern(CHROME_PATH_PATTERN),
|
|
53
|
-
version: z.string().default(""),
|
|
54
|
-
error: z.string().default("")
|
|
55
|
-
});
|
|
56
|
-
/** The served Windows-Chrome state: what the **Prelaunch Windows Chrome** run is
|
|
57
|
-
* doing, the debugging port it settled on (0 = none) and the failure line.
|
|
58
|
-
* Base layer. */
|
|
59
|
-
const WindowsChromeStatusSchema = z.object({
|
|
60
|
-
state: z.string().pattern(WINDOWS_CHROME_STATE_PATTERN).default("off"),
|
|
61
|
-
port: z.number().default(0),
|
|
62
|
-
error: z.string().default("")
|
|
63
|
-
});
|
|
64
|
-
/**
|
|
65
|
-
* User-settings section served to the Web GUI card.
|
|
66
|
-
*
|
|
67
|
-
* Persisted (user layer in `$DSH_HOME/settings.yaml`): `extraFlags`,
|
|
68
|
-
* `chromePath` (the executable the picker selected — or that the host seeded
|
|
69
|
-
* once), `executables` (the saved-executables rows: `id` = path, `name` = UI
|
|
70
|
-
* label), `refreshExecutablesNonce` (the card's **Search executables**
|
|
71
|
-
* trigger), `openWindowsChromeNonce` (the card's **Prelaunch Windows Chrome**
|
|
72
|
-
* trigger), `chromeCustomPaths` (the **legacy** hand-typed MRU: folded into the
|
|
73
|
-
* rows once by the first scan, never written again) and `stderrMode` (the
|
|
74
|
-
* "Reduce log output" toggle: "log" captures the bridge's stderr into a
|
|
75
|
-
* per-spawn log file, "console" echoes it, "" follows the row-config
|
|
76
|
-
* `bridgeStderr`).
|
|
77
|
-
* Served but never persisted (composition base layer held in memory by the
|
|
78
|
-
* host): `lastError`, `executableDiscoveryRevision`, `chromeVersion`,
|
|
79
|
-
* `executableStatus`, `chromeMissing`, `effectiveChromePath`,
|
|
80
|
-
* `effectiveSource`, `wslWindowsExecutable`, `windowsChromeStatus`,
|
|
81
|
-
* `carriesConnectionMode`, the static `rowStderr` mirror, the static
|
|
82
|
-
* `defaultExtraFlags` mirror (the canonical defaults list the card's
|
|
83
|
-
* **Restore defaults** control appends) and the static `wslExtraFlags` mirror
|
|
84
|
-
* (the recommended WSL ↔ Windows flags the card's **Flags WSL** control
|
|
85
|
-
* appends) — the client's polls stop when the served revision advances past its
|
|
86
|
-
* action-time value.
|
|
87
|
-
*/
|
|
88
|
-
export const SettingsSchema = z.object({
|
|
89
|
-
/** Flags appended after `npx -y <package>`; persisted last UI edit. An
|
|
90
|
-
* executable-pinning flag is rejected: the executable is picked below. */
|
|
91
|
-
extraFlags: z.array(String).default(DEFAULT_EXTRA_FLAGS),
|
|
92
|
-
/** Written by the UI **Search executables** button; the host reacts to it by
|
|
93
|
-
* re-probing the saved rows and merging what it finds back into them. */
|
|
94
|
-
refreshExecutablesNonce: z.number().default(0),
|
|
95
|
-
/** Written by the UI **Prelaunch Windows Chrome** button; the host reacts to it
|
|
96
|
-
* by running the Windows launch: locate the Windows Chrome, prove the
|
|
97
|
-
* mirrored-loopback prereq, launch it with a debugging port, and write the
|
|
98
|
-
* `--browserUrl` connect entry that leaves the bridge in connect mode. */
|
|
99
|
-
openWindowsChromeNonce: z.number().default(0),
|
|
95
|
+
bridgeStderrLog: z.string().default("").pattern(OPTIONAL_PATH_PATTERN),
|
|
96
|
+
// ---- user-authored, form-editable -------------------------------------
|
|
100
97
|
/**
|
|
101
98
|
* The executable the bridge launches with: picked in the picker (a saved
|
|
102
|
-
* row's `id`) or seeded once by the
|
|
103
|
-
* yet — there is no auto state to fall back to.
|
|
99
|
+
* row's `id`) or seeded once by the Host's first scan. "" = nothing
|
|
100
|
+
* resolved yet — there is no auto state to fall back to.
|
|
104
101
|
*/
|
|
105
|
-
chromePath: z.string().default("").pattern(CHROME_PATH_PATTERN),
|
|
102
|
+
chromePath: z.string().default("").pattern(CHROME_PATH_PATTERN).volatile(),
|
|
106
103
|
/** The picker's saved rows — `{ id: path, name: label }`, user-authored. The
|
|
107
|
-
*
|
|
104
|
+
* Host re-normalizes (trim, dedupe, caps) on every read, and a scan merges
|
|
108
105
|
* what it discovers into them without dropping a name the user chose. */
|
|
109
|
-
executables: z.array(
|
|
106
|
+
executables: z.array(ExecutableEntry).default([]).volatile(),
|
|
107
|
+
/** The ids of saved rows the user dropped. Every run folds what it found
|
|
108
|
+
* back into the rows, and the found list keeps answering a path the user
|
|
109
|
+
* just deleted, so without this record a dropped row stood back up on the
|
|
110
|
+
* very run the deletion queued (measured live 2026-10-12: the (x86)
|
|
111
|
+
* Windows-executable row read as a delete that never landed). Merge steps
|
|
112
|
+
* skip every id standing here; a list write carrying the id again clears
|
|
113
|
+
* it. Host-authored: the card never edits this field. */
|
|
114
|
+
droppedExecutables: z.array(z.string().default("").pattern(CHROME_PATH_PATTERN)).default([]).volatile(),
|
|
110
115
|
/**
|
|
111
116
|
* **Legacy** MRU of hand-typed executables, newest first. The saved rows
|
|
112
|
-
* replace it: a
|
|
113
|
-
* rows during the first scan (see ./catalog.ts `mergeEntries`), so the
|
|
114
|
-
* is read once and never written again.
|
|
117
|
+
* replace it: a Host whose profile still carries it folds its paths into
|
|
118
|
+
* the rows during the first scan (see ./catalog.ts `mergeEntries`), so the
|
|
119
|
+
* field is read once and never written again.
|
|
115
120
|
*/
|
|
116
|
-
chromeCustomPaths: z.array(z.string().default("").pattern(CHROME_PATH_PATTERN)).default([]),
|
|
121
|
+
chromeCustomPaths: z.array(z.string().default("").pattern(CHROME_PATH_PATTERN)).default([]).volatile(),
|
|
117
122
|
/**
|
|
118
|
-
*
|
|
123
|
+
* The card's "Reduce log output" toggle: "log" captures the bridge's
|
|
119
124
|
* stderr into the log file, "console" echoes it (debug). "" follows the
|
|
120
|
-
* row-config `bridgeStderr
|
|
125
|
+
* row-config `bridgeStderr`.
|
|
126
|
+
*/
|
|
127
|
+
stderrMode: z.string().default("").pattern(STDERR_MODE_FIELD_PATTERN).volatile(),
|
|
128
|
+
/** The mode the bridge actually routes console output through — the UI
|
|
129
|
+
* toggle when it states one, else the row config. Mirrored live so the
|
|
130
|
+
* toggle never reads a phantom state (see `resolveStderrMode`). */
|
|
131
|
+
stderrEffective: z.union([z.const("log"), z.const("console")]).default("log").volatile(),
|
|
132
|
+
/** Written by the card's **Fetch executables** button; the Host reacts by
|
|
133
|
+
* re-probing the saved rows and merging what it finds back into them. */
|
|
134
|
+
refreshExecutablesNonce: z.number().default(0).volatile(),
|
|
135
|
+
/** Written by the card's **Prelaunch Windows Chrome** button; the Host
|
|
136
|
+
* reacts by running the Windows launch: locate the Windows Chrome, prove
|
|
137
|
+
* the mirrored-loopback prereq, launch it with a debugging port, and write
|
|
138
|
+
* the `--browserUrl` connect entry that leaves the bridge in connect mode. */
|
|
139
|
+
openWindowsChromeNonce: z.number().default(0).volatile(),
|
|
140
|
+
/**
|
|
141
|
+
* Whether the translation of this row's **standalone** configuration was
|
|
142
|
+
* offered and turned down. Host-authored:
|
|
143
|
+
* the card never edits it — only the proposal's dismiss action does.
|
|
121
144
|
*/
|
|
122
|
-
|
|
145
|
+
migrationDismissed: z.boolean().default(false).volatile(),
|
|
146
|
+
// ---- Host-published live state ----------------------------------------
|
|
123
147
|
/** Last check/connection failure, human-readable; empty when healthy. */
|
|
124
|
-
lastError: z.string().default(""),
|
|
148
|
+
lastError: z.string().default("").volatile(),
|
|
125
149
|
/** Known error: the last failure was "no Chrome executable detected". */
|
|
126
|
-
chromeMissing: z.boolean().default(false),
|
|
150
|
+
chromeMissing: z.boolean().default(false).volatile(),
|
|
127
151
|
/** Executable-run counter (success or failure); completion signal for every
|
|
128
152
|
* executable action the card can take. */
|
|
129
|
-
executableDiscoveryRevision: z.number().default(0),
|
|
153
|
+
executableDiscoveryRevision: z.number().default(0).volatile(),
|
|
130
154
|
/** The version the **selected** executable answered with; "" when nothing
|
|
131
155
|
* answered — nothing picked, a connect mode, or a blocked path. */
|
|
132
|
-
chromeVersion: z.string().default(""),
|
|
156
|
+
chromeVersion: z.string().default("").volatile(),
|
|
133
157
|
/** Per-row probe status keyed by path: the version the row answered with,
|
|
134
|
-
* and the failure for a row that is present but not runnable (or blocked).
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/** The path the bridge actually launches with ("" when nothing is fixed).
|
|
139
|
-
* Base layer, never persisted. */
|
|
140
|
-
effectiveChromePath: z.string().default("").pattern(CHROME_PATH_PATTERN),
|
|
158
|
+
* and the failure for a row that is present but not runnable (or blocked). */
|
|
159
|
+
executableStatus: z.array(ExecutableStatus).default([]).volatile(),
|
|
160
|
+
/** The path the bridge actually launches with ("" when nothing is fixed). */
|
|
161
|
+
effectiveChromePath: z.string().default("").pattern(CHROME_PATH_PATTERN).volatile(),
|
|
141
162
|
/** Where `effectiveChromePath` came from — picked (`"selected"`), row config
|
|
142
|
-
* (`"row-config"`) or nothing yet ("").
|
|
143
|
-
effectiveSource: z.string().default("").pattern(EFFECTIVE_SOURCE_PATTERN),
|
|
144
|
-
/**
|
|
145
|
-
*
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
|
|
163
|
+
* (`"row-config"`) or nothing yet (""). */
|
|
164
|
+
effectiveSource: z.string().default("").pattern(EFFECTIVE_SOURCE_PATTERN).volatile(),
|
|
165
|
+
/** The canonical default extra-flags list — the list the card's **Restore
|
|
166
|
+
* defaults** control appends to what the editor holds. Mirror of
|
|
167
|
+
* `DEFAULT_EXTRA_FLAGS`, served so the card carries no copy of it. */
|
|
168
|
+
defaultExtraFlags: z.array(String).default(DEFAULT_EXTRA_FLAGS).volatile(),
|
|
169
|
+
/** The recommended WSL ↔ Windows extra-flags list — the list the card's
|
|
170
|
+
* **Flags WSL** control appends, missing entries only. Mirror of
|
|
171
|
+
* `WSL_EXTRA_FLAGS`, served so the card carries no copy of it. */
|
|
172
|
+
wslExtraFlags: z.array(String).default(WSL_EXTRA_FLAGS).volatile(),
|
|
173
|
+
/** True while this Host runs under WSL and the selected executable is a
|
|
174
|
+
* Windows binary — the state the card's notice explains (see ./platform.ts). */
|
|
175
|
+
wslWindowsExecutable: z.boolean().default(false).volatile(),
|
|
176
|
+
/** What the **Prelaunch Windows Chrome** run is doing — the single field
|
|
177
|
+
* the card derives the button's state, its disabled reason and the pill's
|
|
178
|
+
* connect-mode muting from. Every half (locate, prereq, launch, port) lives
|
|
179
|
+
* Host-side (./windows/), so the card carries no list of Windows paths or
|
|
180
|
+
* reachability rules. */
|
|
181
|
+
windowsChromeStatus: WindowsChromeStatus.default({ state: "off", port: 0, error: "" }).volatile(),
|
|
182
|
+
/** True while the bridge launches with a connect-mode flag (`--browserUrl`
|
|
183
|
+
* / `--wsEndpoint`): no local executable is then launched or probed, so the
|
|
184
|
+
* card mutes the picker. */
|
|
185
|
+
carriesConnectionMode: z.boolean().default(false).volatile(),
|
|
186
|
+
/** The flags a live connection of this component's own kinds actually
|
|
187
|
+
* launches with — mirrored from the last `resolve`, not from any layer, so
|
|
188
|
+
* the machine page states what is running rather than what was last
|
|
189
|
+
* configured. Empty while nothing resolves. */
|
|
190
|
+
runningFlags: z.array(String).default([]).volatile(),
|
|
191
|
+
/** The note the last live connection answered with — where its console
|
|
192
|
+
* output goes, or the Windows URL it connected to. "" when the answer was
|
|
193
|
+
* silent. */
|
|
194
|
+
runningNote: z.string().default("").volatile()
|
|
170
195
|
});
|
|
171
196
|
//# sourceMappingURL=schema.js.map
|
package/lib/host/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/host/schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/host/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,CAAC,MAAM,0BAA0B,CAAC;AAEzC,OAAO,EACH,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,4BAA4B,EAC5B,eAAe,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qEAAqE;AACrE,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IAC1D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,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AE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;IAC1E;;sEAEkE;IAClE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAClE;oFACgF;IAChF,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;IAC3D;;;;6BAIyB;IACzB,mBAAmB,EAAE,mBAAmB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;IACjG;;gCAE4B;IAC5B,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;IAC5D;;;mDAG+C;IAC/C,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpD;;iBAEa;IACb,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC"}
|
package/lib/host/settings.d.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import type { ChromeMcpController } from "./controller/index.js";
|
|
2
2
|
import type { PluginContext } from "./types/index.js";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The profile entry id this instance is keyed by, read off its own loader entry.
|
|
5
|
+
* Throws when the plugin was not started as a profile entry: the id is the key
|
|
6
|
+
* every read and write goes through, so inventing one would alias (or silently
|
|
7
|
+
* address nothing) instead of failing loud.
|
|
5
8
|
* @param ctx - plugin context.
|
|
6
|
-
* @param controller - the live state created by `apply`.
|
|
7
9
|
*/
|
|
8
|
-
export declare function
|
|
10
|
+
export declare function chromeMcpEntryId(ctx: PluginContext): string;
|
|
11
|
+
/**
|
|
12
|
+
* Attach the row's configuration form to one controller: resolve the entry id,
|
|
13
|
+
* keep the auto page off, and route the commits the form produces.
|
|
14
|
+
*
|
|
15
|
+
* Registration rides one fiber effect for the same reason `tool.ts` registers
|
|
16
|
+
* lazily: the disposer has to leave with the instance, and an HMR reload must not
|
|
17
|
+
* leave a prior instance still configuring (the second `configure` for one fiber
|
|
18
|
+
* throws). A host that is not a profile entry gets a loud error and no form; its
|
|
19
|
+
* row config keeps driving the bridge exactly as a row-only config always did.
|
|
20
|
+
* @param ctx - plugin context.
|
|
21
|
+
* @param controller - the live state the form drives.
|
|
22
|
+
*/
|
|
23
|
+
export declare function installChromeMcpForm(ctx: PluginContext, controller: ChromeMcpController): void;
|
|
24
|
+
/** Every live-only key a Host write-back clears from the stored row (exported
|
|
25
|
+
* here for the tests and for the write paths that carry the `unset` ops — the
|
|
26
|
+
* same shape the reference's `settings.ts` keeps). */
|
|
27
|
+
export declare const LIVE_MIRROR_KEYS: readonly string[];
|
|
9
28
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/host/settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/host/settings.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAoBrE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAU3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAiB9F;AAED;;sDAEsD;AACtD,eAAO,MAAM,gBAAgB,mBAAmB,CAAC"}
|
package/lib/host/settings.js
CHANGED
|
@@ -1,70 +1,91 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Host half — the
|
|
2
|
+
* Host half — the configuration form.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Since dsh 0.2.0 the card edits the **row configuration** through the profile's
|
|
5
|
+
* configuration form: one `Config` (./schema.ts), keyed by the row's profile
|
|
6
|
+
* entry id. So this module no longer installs a namespace — it attaches the row
|
|
7
|
+
* to the form and routes what the form answers into the controller. Three things
|
|
8
|
+
* it owns:
|
|
6
9
|
*
|
|
7
|
-
* -
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* - **Identity.** Everything reads and writes by the profile **entry id** read
|
|
11
|
+
* off this fiber's own loader entry (`chromeMcpEntryId`). It is not a namespace
|
|
12
|
+
* and never derived from `serverName`: two instances would collide on the same
|
|
13
|
+
* row, so an instance that is not a profile entry says so loudly rather than
|
|
14
|
+
* inventing a key of its own.
|
|
15
|
+
* - **The auto page stays off.** `settings.configure({ auto: false }, fiber)`
|
|
16
|
+
* keeps the Host from standing up a generated page while the card owns the
|
|
17
|
+
* row's page — and it is a *disposable* call that throws the second time for
|
|
18
|
+
* one fiber, so it rides one fiber effect and disposes with it (verified live,
|
|
19
|
+
* .probe/MIGRATION-CONTRACT.md §2e: `auto` only decides the generated page, and
|
|
20
|
+
* the entry stays fully described either way).
|
|
21
|
+
* - **Commit routing.** A form commit lands as a volatile commit on this fiber,
|
|
22
|
+
* which the loader reports as `loader/volatile-update` carrying the paths it
|
|
23
|
+
* touched. Only the *user-authored* paths mean anything to the running bridge,
|
|
24
|
+
* so those are what route — and that same filter is what keeps a live publish
|
|
25
|
+
* (which only ever commits live fields) from re-entering the router.
|
|
17
26
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
import { attachSettingsForm } from "@comecaramelos/dsh-ancesters/host";
|
|
28
|
+
import { ENTRY_ID } from "./constants.js";
|
|
29
|
+
import { liveMirrorKeys } from "./values.js";
|
|
30
|
+
/** The fields the card edits. A commit that touches nothing here changes nothing
|
|
31
|
+
* the running bridge does, which is what keeps a live publish out of the router. */
|
|
32
|
+
const USER_FIELDS = new Set([
|
|
33
|
+
"extraFlags",
|
|
34
|
+
"chromePath",
|
|
35
|
+
"executables",
|
|
36
|
+
"chromeCustomPaths",
|
|
37
|
+
"stderrMode",
|
|
38
|
+
"refreshExecutablesNonce",
|
|
39
|
+
"openWindowsChromeNonce"
|
|
40
|
+
]);
|
|
23
41
|
/**
|
|
24
|
-
*
|
|
42
|
+
* The profile entry id this instance is keyed by, read off its own loader entry.
|
|
43
|
+
* Throws when the plugin was not started as a profile entry: the id is the key
|
|
44
|
+
* every read and write goes through, so inventing one would alias (or silently
|
|
45
|
+
* address nothing) instead of failing loud.
|
|
25
46
|
* @param ctx - plugin context.
|
|
26
|
-
* @param controller - the live state created by `apply`.
|
|
27
47
|
*/
|
|
28
|
-
export function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
controller.onSettingsChange();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
48
|
+
export function chromeMcpEntryId(ctx) {
|
|
49
|
+
const fiber = ctx.fiber;
|
|
50
|
+
const id = fiber?.entry?.options?.id;
|
|
51
|
+
if (typeof id !== "string" || id === "") {
|
|
52
|
+
throw new Error(`dsh-chrome-mcp: this instance is not a profile entry, so the configuration form has no entry id to address it by ` +
|
|
53
|
+
`(the bundle patch inserts \`id: "${ENTRY_ID}"\` — a bare ctx.plugin() mount has no form)`);
|
|
54
|
+
}
|
|
55
|
+
return id;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Attach the row's configuration form to one controller: resolve the entry id,
|
|
59
|
+
* keep the auto page off, and route the commits the form produces.
|
|
60
|
+
*
|
|
61
|
+
* Registration rides one fiber effect for the same reason `tool.ts` registers
|
|
62
|
+
* lazily: the disposer has to leave with the instance, and an HMR reload must not
|
|
63
|
+
* leave a prior instance still configuring (the second `configure` for one fiber
|
|
64
|
+
* throws). A host that is not a profile entry gets a loud error and no form; its
|
|
65
|
+
* row config keeps driving the bridge exactly as a row-only config always did.
|
|
66
|
+
* @param ctx - plugin context.
|
|
67
|
+
* @param controller - the live state the form drives.
|
|
68
|
+
*/
|
|
69
|
+
export function installChromeMcpForm(ctx, controller) {
|
|
70
|
+
// The mechanics — the entry id read off this fiber (loud when it is not a
|
|
71
|
+
// profile entry), the generated page kept off once per fiber and disposed
|
|
72
|
+
// with it, and the commit filter on `loader/volatile-update` — are
|
|
73
|
+
// ancestros' `attachSettingsForm`. A commit naming a **user** field routes
|
|
74
|
+
// (flags, the executable, the saved rows, the toggle, the two triggers); a
|
|
75
|
+
// commit naming only **live** fields routes nothing. The mirror's own
|
|
76
|
+
// re-assert after a reset is the live mirror's business (./controller/
|
|
77
|
+
// publish.ts), not this router's.
|
|
78
|
+
attachSettingsForm(ctx, {
|
|
79
|
+
name: `dsh-chrome-mcp(${controller.config.serverName})`,
|
|
80
|
+
userFields: [...USER_FIELDS],
|
|
81
|
+
liveKeys: liveMirrorKeys(),
|
|
82
|
+
onAttach: (form) => controller.attachForm(form),
|
|
83
|
+
onDetach: () => controller.detachForm(),
|
|
84
|
+
onCommit: () => controller.onFormCommit()
|
|
68
85
|
});
|
|
69
86
|
}
|
|
87
|
+
/** Every live-only key a Host write-back clears from the stored row (exported
|
|
88
|
+
* here for the tests and for the write paths that carry the `unset` ops — the
|
|
89
|
+
* same shape the reference's `settings.ts` keeps). */
|
|
90
|
+
export const LIVE_MIRROR_KEYS = liveMirrorKeys();
|
|
70
91
|
//# sourceMappingURL=settings.js.map
|
package/lib/host/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/host/settings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/host/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;oFACoF;AACpF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS;IAChC,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,mBAAmB;IACnB,YAAY;IACZ,yBAAyB;IACzB,wBAAwB;CAC3B,CAAC,CAAC;AAOH;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAkB;IAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAuD,CAAC;IAC1E,MAAM,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;IACrC,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACX,mHAAmH;YAC/G,oCAAoC,QAAQ,8CAA8C,CACjG,CAAC;IACN,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAkB,EAAE,UAA+B;IACpF,0EAA0E;IAC1E,0EAA0E;IAC1E,mEAAmE;IACnE,2EAA2E;IAC3E,2EAA2E;IAC3E,sEAAsE;IACtE,uEAAuE;IACvE,kCAAkC;IAClC,kBAAkB,CAAC,GAAY,EAAE;QAC7B,IAAI,EAAE,kBAAkB,UAAU,CAAC,MAAM,CAAC,UAAU,GAAG;QACvD,UAAU,EAAE,CAAC,GAAG,WAAW,CAAC;QAC5B,QAAQ,EAAE,cAAc,EAAE;QAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,IAAgC,CAAC;QAC3E,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE;QACvC,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE;KAC5C,CAAC,CAAC;AACP,CAAC;AAED;;sDAEsD;AACtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,EAAE,CAAC"}
|
package/lib/host/status.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ToolCallResult } from "./types/index.js";
|
|
2
1
|
/** First non-empty line of a text block, capped. */
|
|
3
2
|
export declare function firstLine(text: unknown, cap?: number): string;
|
|
4
3
|
/**
|
|
@@ -15,14 +14,12 @@ export declare function firstLine(text: unknown, cap?: number): string;
|
|
|
15
14
|
*/
|
|
16
15
|
export declare function isChromeMissing(text: unknown): boolean;
|
|
17
16
|
/**
|
|
18
|
-
* Summarize one chrome-tool call result for the card's status line
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @param result - settled tools-service execution result.
|
|
25
|
-
* @returns the note, or null when the call did not fail.
|
|
17
|
+
* Summarize one chrome-tool call result for the card's status line — the rule
|
|
18
|
+
* is ancestros' (`host/status.toolResultNote`): failed calls answer
|
|
19
|
+
* "<tool> failed: <first text line>", successes `null` (the caller clears the
|
|
20
|
+
* stored error). Tool-level errors (browser unreachable, "Target closed", …)
|
|
21
|
+
* are returned to the calling agent and never reach a bridge line, so the
|
|
22
|
+
* tool-call capture is the only place they surface.
|
|
26
23
|
*/
|
|
27
|
-
export
|
|
24
|
+
export { toolResultNote } from "@comecaramelos/dsh-ancesters/host";
|
|
28
25
|
//# sourceMappingURL=status.d.ts.map
|