@peekdev/mcp 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +178 -0
- package/dist/db/open.d.ts +19 -1
- package/dist/db/open.d.ts.map +1 -1
- package/dist/db/open.js +25 -1
- package/dist/db/open.js.map +1 -1
- package/dist/entrypoint.d.ts +8 -0
- package/dist/entrypoint.d.ts.map +1 -0
- package/dist/entrypoint.js +33 -0
- package/dist/entrypoint.js.map +1 -0
- package/dist/mcp/action-schema.d.ts +156 -0
- package/dist/mcp/action-schema.d.ts.map +1 -1
- package/dist/mcp/action-schema.js +69 -0
- package/dist/mcp/action-schema.js.map +1 -1
- package/dist/mcp/event-blobs.d.ts +12 -2
- package/dist/mcp/event-blobs.d.ts.map +1 -1
- package/dist/mcp/event-blobs.js +55 -6
- package/dist/mcp/event-blobs.js.map +1 -1
- package/dist/mcp/event-walker.d.ts +30 -0
- package/dist/mcp/event-walker.d.ts.map +1 -1
- package/dist/mcp/event-walker.js +67 -1
- package/dist/mcp/event-walker.js.map +1 -1
- package/dist/mcp/host-bridge.d.ts +50 -1
- package/dist/mcp/host-bridge.d.ts.map +1 -1
- package/dist/mcp/host-bridge.js +133 -0
- package/dist/mcp/host-bridge.js.map +1 -1
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +11 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/playwright-repro.d.ts.map +1 -1
- package/dist/mcp/playwright-repro.js +58 -9
- package/dist/mcp/playwright-repro.js.map +1 -1
- package/dist/mcp/server.d.ts +3 -2
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +301 -63
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/summary.d.ts +7 -0
- package/dist/mcp/summary.d.ts.map +1 -1
- package/dist/mcp/summary.js +7 -1
- package/dist/mcp/summary.js.map +1 -1
- package/dist/native-host/action-protocol.d.ts +15 -2
- package/dist/native-host/action-protocol.d.ts.map +1 -1
- package/dist/native-host/audit.d.ts +1 -1
- package/dist/native-host/audit.d.ts.map +1 -1
- package/dist/native-host/audit.js +1 -1
- package/dist/native-host/audit.js.map +1 -1
- package/dist/native-host/host-socket.d.ts +137 -0
- package/dist/native-host/host-socket.d.ts.map +1 -0
- package/dist/native-host/host-socket.js +369 -0
- package/dist/native-host/host-socket.js.map +1 -0
- package/dist/native-host/host.d.ts +11 -0
- package/dist/native-host/host.d.ts.map +1 -1
- package/dist/native-host/host.js +54 -0
- package/dist/native-host/host.js.map +1 -1
- package/dist/native-host/ingest.js +4 -4
- package/dist/native-host/ingest.js.map +1 -1
- package/dist/native-host/installer.d.ts +21 -0
- package/dist/native-host/installer.d.ts.map +1 -1
- package/dist/native-host/installer.js +64 -2
- package/dist/native-host/installer.js.map +1 -1
- package/dist/native-host/manifest.d.ts +7 -2
- package/dist/native-host/manifest.d.ts.map +1 -1
- package/dist/native-host/manifest.js +29 -15
- package/dist/native-host/manifest.js.map +1 -1
- package/dist/native-host/socket-path.d.ts +10 -0
- package/dist/native-host/socket-path.d.ts.map +1 -0
- package/dist/native-host/socket-path.js +31 -0
- package/dist/native-host/socket-path.js.map +1 -0
- package/dist/postinstall.d.ts.map +1 -1
- package/dist/postinstall.js +15 -15
- package/dist/postinstall.js.map +1 -1
- package/package.json +34 -4
|
@@ -17,14 +17,67 @@
|
|
|
17
17
|
import { execFileSync } from 'node:child_process';
|
|
18
18
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
19
19
|
import { dirname } from 'node:path';
|
|
20
|
+
/**
|
|
21
|
+
* Decode the `stderr` `execFileSync` attaches to a thrown error. `execFileSync`
|
|
22
|
+
* populates `err.stderr` as a Buffer (or string, depending on `encoding`) when
|
|
23
|
+
* the child writes to stderr before a non-zero exit.
|
|
24
|
+
*/
|
|
25
|
+
function decodeStderr(value) {
|
|
26
|
+
if (value == null)
|
|
27
|
+
return '';
|
|
28
|
+
if (typeof value === 'string')
|
|
29
|
+
return value;
|
|
30
|
+
if (Buffer.isBuffer(value))
|
|
31
|
+
return value.toString('utf8');
|
|
32
|
+
// Some shapes hand back a Uint8Array / array-like; coerce defensively.
|
|
33
|
+
try {
|
|
34
|
+
return Buffer.from(value).toString('utf8');
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return String(value);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Turn the error `execFileSync` throws when `reg.exe` exits non-zero into a
|
|
42
|
+
* message that actually says *why* it failed.
|
|
43
|
+
*
|
|
44
|
+
* Windows-hardening fix: previously the default `execFn` ran `reg.exe` with
|
|
45
|
+
* `stdio: 'ignore'`, so on failure (EACCES on a redirected/locked HKCU hive,
|
|
46
|
+
* the host running under a restricted token, etc.) the child's stderr was
|
|
47
|
+
* discarded and `installManifests` recorded a useless bare "Command failed".
|
|
48
|
+
* Capturing stderr and folding it (plus the exit status) into the thrown
|
|
49
|
+
* Error's message means the per-target `result.error` is now actionable.
|
|
50
|
+
*
|
|
51
|
+
* Accepts the raw caught value (typed `unknown`) so callers don't have to
|
|
52
|
+
* pre-narrow; reads `.stderr` / `.status` off `execFileSync`'s error shape.
|
|
53
|
+
*/
|
|
54
|
+
export function formatRegExecError(err) {
|
|
55
|
+
const e = (err ?? {});
|
|
56
|
+
const stderr = decodeStderr(e.stderr).trim();
|
|
57
|
+
const status = typeof e.status === 'number' ? e.status : undefined;
|
|
58
|
+
const baseMessage = typeof e.message === 'string' ? e.message : String(err);
|
|
59
|
+
// Prefer the child's own stderr (the OS-level reason); fall back to the
|
|
60
|
+
// thrown error's message (e.g. `spawn reg.exe ENOENT` when reg.exe is
|
|
61
|
+
// missing from PATH) so we never produce an empty detail.
|
|
62
|
+
const detail = stderr.length > 0 ? stderr : baseMessage;
|
|
63
|
+
const exitPart = status !== undefined ? ` (exit ${status})` : '';
|
|
64
|
+
return `reg.exe failed${exitPart}: ${detail}`;
|
|
65
|
+
}
|
|
20
66
|
/**
|
|
21
67
|
* Build a real-OS sink. Exported so tests can inject a fake `execFn` while
|
|
22
68
|
* still exercising the platform guard. Production callers use {@link realSink}.
|
|
23
69
|
*/
|
|
24
70
|
export function buildRealSink(deps = {}) {
|
|
71
|
+
// Default execFn: run reg.exe with stderr PIPED (not 'ignore') so a non-zero
|
|
72
|
+
// exit throws an error carrying `.stderr` (and `.status`). That detail is
|
|
73
|
+
// folded into the rethrown message at the writeRegistryKey call site (below),
|
|
74
|
+
// so installManifests records a useful per-target error instead of a bare
|
|
75
|
+
// "Command failed". `stdout` stays ignored (reg.exe's success chatter is
|
|
76
|
+
// noise); only stderr is captured.
|
|
77
|
+
const wrapExecError = deps.wrapExecError ?? formatRegExecError;
|
|
25
78
|
const execFn = deps.execFn ??
|
|
26
79
|
((file, args) => {
|
|
27
|
-
execFileSync(file, [...args], { stdio: 'ignore' });
|
|
80
|
+
execFileSync(file, [...args], { stdio: ['ignore', 'ignore', 'pipe'] });
|
|
28
81
|
});
|
|
29
82
|
const platform = deps.platform ?? process.platform;
|
|
30
83
|
return {
|
|
@@ -47,7 +100,16 @@ export function buildRealSink(deps = {}) {
|
|
|
47
100
|
// /ve → set the (Default) value (the one Chrome/Edge read)
|
|
48
101
|
// /d → data to write
|
|
49
102
|
// /f → force, no Y/N prompt
|
|
50
|
-
execFn
|
|
103
|
+
// Wrap any execFn throw so the rethrown message carries reg.exe's stderr
|
|
104
|
+
// + exit status (the default execFn pipes stderr precisely so this detail
|
|
105
|
+
// is available). installManifests catches per-target and records the
|
|
106
|
+
// message, so the user finally sees *why* the registry write failed.
|
|
107
|
+
try {
|
|
108
|
+
execFn('reg.exe', ['add', key, '/ve', '/d', manifestPath, '/f']);
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
throw new Error(wrapExecError(err));
|
|
112
|
+
}
|
|
51
113
|
},
|
|
52
114
|
};
|
|
53
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../../src/native-host/installer.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,4EAA4E;AAC5E,gFAAgF;AAChF,mDAAmD;AACnD,EAAE;AACF,+BAA+B;AAC/B,8EAA8E;AAC9E,8EAA8E;AAC9E,0CAA0C;AAC1C,2EAA2E;AAC3E,6CAA6C;AAC7C,+DAA+D;AAC/D,iEAAiE;AACjE,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../../src/native-host/installer.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,4EAA4E;AAC5E,gFAAgF;AAChF,mDAAmD;AACnD,EAAE;AACF,+BAA+B;AAC/B,8EAA8E;AAC9E,8EAA8E;AAC9E,0CAA0C;AAC1C,2EAA2E;AAC3E,6CAA6C;AAC7C,+DAA+D;AAC/D,iEAAiE;AACjE,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC;;;;GAIG;AACH,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1D,uEAAu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AM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBACrC,mEAAmE;gBACnE,mEAAmE;gBACnE,oEAAoE;gBACpE,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;gBAClD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YAC7D,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC;gBACX,GAAG,IAAI;gBACP,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACxD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -58,7 +58,12 @@ export interface InstallTarget {
|
|
|
58
58
|
* - Windows: HKCU registry keys for Chrome + Edge (the default value of each
|
|
59
59
|
* key is the on-disk manifest path).
|
|
60
60
|
*
|
|
61
|
-
* `homeDir` is injected for testability.
|
|
61
|
+
* `homeDir` is injected for testability. `localAppData` (Windows only) is the
|
|
62
|
+
* real `%LOCALAPPDATA%` — injected by the caller from `process.env.LOCALAPPDATA`
|
|
63
|
+
* so the function stays pure — and is REQUIRED to be correct on machines where
|
|
64
|
+
* `AppData\Local` is redirected away from `homeDir` (OneDrive Known-Folder-Move,
|
|
65
|
+
* ADMX folder redirection, roaming/UNC profiles). When absent it falls back to
|
|
66
|
+
* the conventional `homeDir\AppData\Local`.
|
|
62
67
|
*/
|
|
63
|
-
export declare function resolveInstallTargets(platform: SupportedPlatform, homeDir: string): InstallTarget[];
|
|
68
|
+
export declare function resolveInstallTargets(platform: SupportedPlatform, homeDir: string, localAppData?: string): InstallTarget[];
|
|
64
69
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/native-host/manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/native-host/manifest.ts"],"names":[],"mappings":"AAaA,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AAEpD,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,2BAA6B,CAAC;AAE5D,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;CACpC;AAID;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,EAAE,CAY1D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,kBAAkB,CAQ3F;AAED,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAE7D,sDAAsD;AACtD,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,GACpB,aAAa,EAAE,CA6FjB"}
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
// home directory, host-binary path, and extension IDs so the postinstall
|
|
4
4
|
// side-effects (filesystem / registry writes) can be unit-tested without
|
|
5
5
|
// touching the real OS.
|
|
6
|
-
|
|
6
|
+
// Use the TARGET platform's path flavour (posix for darwin/linux, win32 for
|
|
7
|
+
// Windows) rather than the ambient `join`, so resolveInstallTargets stays a
|
|
8
|
+
// pure function of (platform, homeDir) — a darwin target reads as a `/`-path
|
|
9
|
+
// and a win32 target as a `\`-path even when this runs on the other OS (unit
|
|
10
|
+
// tests on Linux CI, the windows-latest job, etc.).
|
|
11
|
+
import { posix, win32 } from 'node:path';
|
|
7
12
|
/** Reverse-DNS native-host id (ADR-0009 / NAMING.md). */
|
|
8
13
|
export const NATIVE_HOST_NAME = 'com.cubenest.peek';
|
|
9
14
|
/** The manifest filename written into each NativeMessagingHosts directory. */
|
|
@@ -56,37 +61,42 @@ export function buildManifest(hostBinaryPath, ids) {
|
|
|
56
61
|
* - Windows: HKCU registry keys for Chrome + Edge (the default value of each
|
|
57
62
|
* key is the on-disk manifest path).
|
|
58
63
|
*
|
|
59
|
-
* `homeDir` is injected for testability.
|
|
64
|
+
* `homeDir` is injected for testability. `localAppData` (Windows only) is the
|
|
65
|
+
* real `%LOCALAPPDATA%` — injected by the caller from `process.env.LOCALAPPDATA`
|
|
66
|
+
* so the function stays pure — and is REQUIRED to be correct on machines where
|
|
67
|
+
* `AppData\Local` is redirected away from `homeDir` (OneDrive Known-Folder-Move,
|
|
68
|
+
* ADMX folder redirection, roaming/UNC profiles). When absent it falls back to
|
|
69
|
+
* the conventional `homeDir\AppData\Local`.
|
|
60
70
|
*/
|
|
61
|
-
export function resolveInstallTargets(platform, homeDir) {
|
|
71
|
+
export function resolveInstallTargets(platform, homeDir, localAppData) {
|
|
62
72
|
switch (platform) {
|
|
63
73
|
case 'darwin': {
|
|
64
|
-
const appSupport = join(homeDir, 'Library', 'Application Support');
|
|
74
|
+
const appSupport = posix.join(homeDir, 'Library', 'Application Support');
|
|
65
75
|
return [
|
|
66
76
|
{
|
|
67
77
|
browser: 'macOS Chrome',
|
|
68
|
-
manifestPath: join(appSupport, 'Google', 'Chrome', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
78
|
+
manifestPath: posix.join(appSupport, 'Google', 'Chrome', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
69
79
|
},
|
|
70
80
|
{
|
|
71
81
|
browser: 'macOS Chromium',
|
|
72
|
-
manifestPath: join(appSupport, 'Chromium', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
82
|
+
manifestPath: posix.join(appSupport, 'Chromium', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
73
83
|
},
|
|
74
84
|
{
|
|
75
85
|
browser: 'macOS Edge',
|
|
76
|
-
manifestPath: join(appSupport, 'Microsoft Edge', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
86
|
+
manifestPath: posix.join(appSupport, 'Microsoft Edge', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
77
87
|
},
|
|
78
88
|
];
|
|
79
89
|
}
|
|
80
90
|
case 'linux': {
|
|
81
|
-
const config = join(homeDir, '.config');
|
|
91
|
+
const config = posix.join(homeDir, '.config');
|
|
82
92
|
return [
|
|
83
93
|
{
|
|
84
94
|
browser: 'Linux Chrome',
|
|
85
|
-
manifestPath: join(config, 'google-chrome', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
95
|
+
manifestPath: posix.join(config, 'google-chrome', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
86
96
|
},
|
|
87
97
|
{
|
|
88
98
|
browser: 'Linux Chromium',
|
|
89
|
-
manifestPath: join(config, 'chromium', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
99
|
+
manifestPath: posix.join(config, 'chromium', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
90
100
|
},
|
|
91
101
|
];
|
|
92
102
|
}
|
|
@@ -96,18 +106,22 @@ export function resolveInstallTargets(platform, homeDir) {
|
|
|
96
106
|
// a file path), and
|
|
97
107
|
// - the registry key whose default value points at that path.
|
|
98
108
|
// The conventional location is %LOCALAPPDATA%\<vendor>\<browser>\
|
|
99
|
-
// NativeMessagingHosts\<host>.json.
|
|
100
|
-
// injected
|
|
101
|
-
|
|
109
|
+
// NativeMessagingHosts\<host>.json. Prefer the REAL %LOCALAPPDATA% the
|
|
110
|
+
// caller injected (correct under OneDrive KFM / enterprise redirection,
|
|
111
|
+
// where AppData\Local is NOT under homeDir); fall back to the conventional
|
|
112
|
+
// homeDir\AppData\Local when it's unset.
|
|
113
|
+
const base = localAppData && localAppData.length > 0
|
|
114
|
+
? localAppData
|
|
115
|
+
: win32.join(homeDir, 'AppData', 'Local');
|
|
102
116
|
return [
|
|
103
117
|
{
|
|
104
118
|
browser: 'Windows Chrome',
|
|
105
|
-
manifestPath: join(
|
|
119
|
+
manifestPath: win32.join(base, 'Google', 'Chrome', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
106
120
|
registryKey: `HKCU\\Software\\Google\\Chrome\\NativeMessagingHosts\\${NATIVE_HOST_NAME}`,
|
|
107
121
|
},
|
|
108
122
|
{
|
|
109
123
|
browser: 'Windows Edge',
|
|
110
|
-
manifestPath: join(
|
|
124
|
+
manifestPath: win32.join(base, 'Microsoft', 'Edge', 'NativeMessagingHosts', MANIFEST_FILENAME),
|
|
111
125
|
registryKey: `HKCU\\Software\\Microsoft\\Edge\\NativeMessagingHosts\\${NATIVE_HOST_NAME}`,
|
|
112
126
|
},
|
|
113
127
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/native-host/manifest.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,yEAAyE;AACzE,wBAAwB;AAExB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/native-host/manifest.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,yEAAyE;AACzE,wBAAwB;AAExB,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,oDAAoD;AACpD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEzC,yDAAyD;AACzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAEpD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,gBAAgB,OAAO,CAAC;AAkB5D,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAiB;IAC9C,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;QAC5B,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC;YAAE,SAAS;QACvD,MAAM,MAAM,GAAG,sBAAsB,EAAE,GAAG,CAAC;QAC3C,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,SAAS;QAC/B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,C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BACF;gBACD;oBACE,OAAO,EAAE,gBAAgB;oBACzB,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,iBAAiB,CAAC;iBACxF;aACF,CAAC;QACJ,CAAC;QACD,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,kDAAkD;YAClD,wEAAwE;YACxE,wBAAwB;YACxB,gEAAgE;YAChE,kEAAkE;YAClE,uEAAuE;YACvE,wEAAwE;YACxE,2EAA2E;YAC3E,yCAAyC;YACzC,MAAM,IAAI,GACR,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC;gBACrC,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO;gBACL;oBACE,OAAO,EAAE,gBAAgB;oBACzB,YAAY,EAAE,KAAK,CAAC,IAAI,CACtB,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,sBAAsB,EACtB,iBAAiB,CAClB;oBACD,WAAW,EAAE,yDAAyD,gBAAgB,EAAE;iBACzF;gBACD;oBACE,OAAO,EAAE,cAAc;oBACvB,YAAY,EAAE,KAAK,CAAC,IAAI,CACtB,IAAI,EACJ,WAAW,EACX,MAAM,EACN,sBAAsB,EACtB,iBAAiB,CAClB;oBACD,WAAW,EAAE,0DAA0D,gBAAgB,EAAE;iBAC1F;aACF,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The local socket / named-pipe path the {@link LocalSocketHostBridge} connects
|
|
3
|
+
* to and the {@link HostSocketServer} listens on.
|
|
4
|
+
*
|
|
5
|
+
* @param peekHome the peek data dir (defaults to {@link peekHomeDir}, which
|
|
6
|
+
* honors `$PEEK_HOME`). On win32 the named pipe is a fixed namespace path and
|
|
7
|
+
* this argument is ignored.
|
|
8
|
+
*/
|
|
9
|
+
export declare function hostSocketPath(peekHome?: string): string;
|
|
10
|
+
//# sourceMappingURL=socket-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket-path.d.ts","sourceRoot":"","sources":["../../src/native-host/socket-path.ts"],"names":[],"mappings":"AAkBA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,SAAgB,GAAG,MAAM,CAI/D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Local IPC endpoint path for the MCP-process ↔ native-host bridge (Task 3.24
|
|
2
|
+
// IPC layer). The two `peek-mcp` processes share the peek data dir; the
|
|
3
|
+
// simplest cross-platform local-only IPC is a Unix domain socket on
|
|
4
|
+
// macOS/Linux (`<peekHome>/host.sock`) and a named pipe on Windows.
|
|
5
|
+
//
|
|
6
|
+
// Item D: the socket lives DIRECTLY inside the peek data dir (peekHomeDir(),
|
|
7
|
+
// which honors $PEEK_HOME) as `host.sock`. The native host binds at the same
|
|
8
|
+
// `join(peekHomeDir(), 'host.sock')`, so a user who relocates the store via
|
|
9
|
+
// PEEK_HOME gets the bridge and the host on ONE path — not the bridge dialing
|
|
10
|
+
// ~/.peek/host.sock while the host listens elsewhere.
|
|
11
|
+
//
|
|
12
|
+
// Pure path derivation — no `node:net`, no filesystem — so it unit-tests
|
|
13
|
+
// cleanly. The peek-home dir is injectable for tests.
|
|
14
|
+
import { platform } from 'node:os';
|
|
15
|
+
import { join } from 'node:path';
|
|
16
|
+
import { peekHomeDir } from '../db/open.js';
|
|
17
|
+
/**
|
|
18
|
+
* The local socket / named-pipe path the {@link LocalSocketHostBridge} connects
|
|
19
|
+
* to and the {@link HostSocketServer} listens on.
|
|
20
|
+
*
|
|
21
|
+
* @param peekHome the peek data dir (defaults to {@link peekHomeDir}, which
|
|
22
|
+
* honors `$PEEK_HOME`). On win32 the named pipe is a fixed namespace path and
|
|
23
|
+
* this argument is ignored.
|
|
24
|
+
*/
|
|
25
|
+
export function hostSocketPath(peekHome = peekHomeDir()) {
|
|
26
|
+
// Windows named pipes live in the `\\.\pipe\` namespace, not the filesystem.
|
|
27
|
+
if (platform() === 'win32')
|
|
28
|
+
return '\\\\.\\pipe\\peek-host';
|
|
29
|
+
return join(peekHome, 'host.sock');
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=socket-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket-path.js","sourceRoot":"","sources":["../../src/native-host/socket-path.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wEAAwE;AACxE,oEAAoE;AACpE,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,sDAAsD;AACtD,EAAE;AACF,yEAAyE;AACzE,sDAAsD;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,QAAQ,GAAG,WAAW,EAAE;IACrD,6EAA6E;IAC7E,IAAI,QAAQ,EAAE,KAAK,OAAO;QAAE,OAAO,wBAAwB,CAAC;IAC5D,OAAO,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AA4CA,wBAAgB,cAAc,IAAI,IAAI,CA4CrC"}
|
package/dist/postinstall.js
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
//
|
|
12
12
|
// Either way the script logs what it wrote / would write and where, so the
|
|
13
13
|
// install side-effects are always visible to the user (Task 3.4 requirement).
|
|
14
|
-
import {
|
|
14
|
+
import { homedir } from 'node:os';
|
|
15
|
+
import { isDirectInvocation } from './entrypoint.js';
|
|
15
16
|
import { hostBinaryPath, loadExtensionIds } from './native-host/config.js';
|
|
16
17
|
import { installManifests } from './native-host/installer.js';
|
|
17
18
|
import { buildManifest, resolveInstallTargets, } from './native-host/manifest.js';
|
|
@@ -40,10 +41,18 @@ export function runPostinstall() {
|
|
|
40
41
|
console.log(`peek: native-host registration is not supported on '${platform}'; skipping.`);
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
// Resolve home via os.homedir() to match peek-cli (init.ts / status.ts) and
|
|
45
|
+
// to fix the Git-Bash-on-Windows divergence: Git Bash sets $HOME to a POSIX
|
|
46
|
+
// path (/c/Users/jane), whereas homedir() returns the native %USERPROFILE%
|
|
47
|
+
// (C:\Users\jane) — which is where Chrome/Edge actually read the host
|
|
48
|
+
// manifest. This also drops the empty-string fallback.
|
|
49
|
+
const home = homedir();
|
|
44
50
|
const ids = loadExtensionIds();
|
|
45
51
|
const manifest = buildManifest(hostBinaryPath(), ids);
|
|
46
|
-
|
|
52
|
+
// Inject the real %LOCALAPPDATA% (Windows) so a redirected AppData\Local
|
|
53
|
+
// (OneDrive KFM / enterprise folder redirection) resolves correctly;
|
|
54
|
+
// undefined on macOS/Linux, where the win32 branch is never taken.
|
|
55
|
+
const targets = resolveInstallTargets(platform, home, process.env.LOCALAPPDATA);
|
|
47
56
|
const consented = isTruthyEnv(process.env.PEEK_INSTALL_NATIVE_HOST);
|
|
48
57
|
const dryRun = !consented;
|
|
49
58
|
console.log(`peek native messaging host: ${manifest.name}`);
|
|
@@ -59,18 +68,9 @@ export function runPostinstall() {
|
|
|
59
68
|
}
|
|
60
69
|
}
|
|
61
70
|
// Run when invoked directly (postinstall / manual). Guarded so importing this
|
|
62
|
-
// module for tests does not trigger the side-effect path.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
(() => {
|
|
66
|
-
try {
|
|
67
|
-
return import.meta.url === `file://${realpathSync(process.argv[1])}`;
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
})());
|
|
73
|
-
if (invokedDirectly) {
|
|
71
|
+
// module for tests does not trigger the side-effect path. Uses pathToFileURL
|
|
72
|
+
// (see entrypoint.ts) so the guard is correct on Windows backslash paths.
|
|
73
|
+
if (isDirectInvocation(import.meta.url, process.argv[1])) {
|
|
74
74
|
try {
|
|
75
75
|
runPostinstall();
|
|
76
76
|
}
|
package/dist/postinstall.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AACA,yEAAyE;AACzE,EAAE;AACF,gFAAgF;AAChF,2EAA2E;AAC3E,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,4DAA4D;AAC5D,8BAA8B;AAC9B,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAE9E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AACA,yEAAyE;AACzE,EAAE;AACF,gFAAgF;AAChF,2EAA2E;AAC3E,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,4DAA4D;AAC5D,8BAA8B;AAC9B,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAE9E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAsB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAEL,aAAa,EACb,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,SAAS,GAAiC,CAA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B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,wDAAwD;QACxD,OAAO,CAAC,GAAG,CAAC,+BAA+B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjG,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peekdev/mcp",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.1.0-alpha.21",
|
|
4
|
+
"mcpName": "io.github.Cubenest/peek-mcp",
|
|
5
|
+
"description": "peek native messaging host + stdio MCP server. Owns ~/.peek/sessions.db (better-sqlite3) and bridges the browser extension, CLI, and AI tools to a single local source of truth.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"peek",
|
|
8
|
+
"mcp",
|
|
9
|
+
"mcp-server",
|
|
10
|
+
"model-context-protocol",
|
|
11
|
+
"claude-code",
|
|
12
|
+
"cursor",
|
|
13
|
+
"browser",
|
|
14
|
+
"rrweb",
|
|
15
|
+
"ai-coding-agent"
|
|
16
|
+
],
|
|
5
17
|
"license": "Apache-2.0",
|
|
18
|
+
"funding": {
|
|
19
|
+
"type": "github",
|
|
20
|
+
"url": "https://github.com/sponsors/harry-harish"
|
|
21
|
+
},
|
|
6
22
|
"type": "module",
|
|
7
23
|
"bin": {
|
|
8
24
|
"peek-mcp": "./dist/index.js"
|
|
@@ -21,6 +37,14 @@
|
|
|
21
37
|
"./native-host": {
|
|
22
38
|
"types": "./dist/native-host/index.d.ts",
|
|
23
39
|
"import": "./dist/native-host/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./mcp/playwright-repro": {
|
|
42
|
+
"types": "./dist/mcp/playwright-repro.d.ts",
|
|
43
|
+
"import": "./dist/mcp/playwright-repro.js"
|
|
44
|
+
},
|
|
45
|
+
"./mcp/event-blobs": {
|
|
46
|
+
"types": "./dist/mcp/event-blobs.d.ts",
|
|
47
|
+
"import": "./dist/mcp/event-blobs.js"
|
|
24
48
|
}
|
|
25
49
|
},
|
|
26
50
|
"files": [
|
|
@@ -35,7 +59,7 @@
|
|
|
35
59
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
36
60
|
"better-sqlite3": "^12.10.0",
|
|
37
61
|
"zod": "^3.25.76",
|
|
38
|
-
"@cubenest/rrweb-core": "0.1.0-alpha.
|
|
62
|
+
"@cubenest/rrweb-core": "0.1.0-alpha.7"
|
|
39
63
|
},
|
|
40
64
|
"devDependencies": {
|
|
41
65
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -50,7 +74,13 @@
|
|
|
50
74
|
"url": "https://github.com/Cubenest/rrweb-stack",
|
|
51
75
|
"directory": "packages/peek-mcp"
|
|
52
76
|
},
|
|
53
|
-
"
|
|
77
|
+
"bugs": {
|
|
78
|
+
"url": "https://github.com/Cubenest/rrweb-stack/issues"
|
|
79
|
+
},
|
|
80
|
+
"homepage": "https://peek.cubenest.in",
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=22"
|
|
83
|
+
},
|
|
54
84
|
"scripts": {
|
|
55
85
|
"build": "tsc -p tsconfig.json && node ./scripts/postbuild.mjs",
|
|
56
86
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|