@peekdev/cli 0.1.0-alpha.1 → 0.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +32 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/extension-id.d.ts +16 -0
- package/dist/lib/extension-id.d.ts.map +1 -0
- package/dist/lib/extension-id.js +49 -0
- package/dist/lib/extension-id.js.map +1 -0
- package/dist/lib/prompt.d.ts +13 -0
- package/dist/lib/prompt.d.ts.map +1 -1
- package/dist/lib/prompt.js +40 -0
- package/dist/lib/prompt.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +14 -5
- package/dist/version.js.map +1 -1
- package/package.json +16 -12
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAyOA,+DAA+D;AAC/D,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAgC7D"}
|
package/dist/commands/init.js
CHANGED
|
@@ -9,9 +9,10 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
9
9
|
import { homedir } from 'node:os';
|
|
10
10
|
import { parseArgs } from 'node:util';
|
|
11
11
|
import { buildManifest, hostBinaryPath, installManifests, loadExtensionIds, realSink, resolveInstallTargets, } from '@peekdev/mcp/native-host';
|
|
12
|
+
import { chromeExtensionOrigin, validateChromeExtensionId } from '../lib/extension-id.js';
|
|
12
13
|
import { atomicWriteFileSync } from '../lib/fs-atomic.js';
|
|
13
14
|
import { PEEK_BLOCK_SNIPPET, containsJsonComments, detectClients, hasPeekServer, mergePeekConfig, serializeConfig, } from '../lib/init-config.js';
|
|
14
|
-
import { confirm, multiSelect } from '../lib/prompt.js';
|
|
15
|
+
import { confirm, multiSelect, promptText } from '../lib/prompt.js';
|
|
15
16
|
const SUPPORTED = ['darwin', 'linux', 'win32'];
|
|
16
17
|
/** Thrown by `readConfig` when the file is JSONC (comments) — we won't rewrite it. */
|
|
17
18
|
class JsoncConfigError extends Error {
|
|
@@ -118,6 +119,36 @@ async function registerNativeHost(platform, homeDir) {
|
|
|
118
119
|
process.stdout.write(`Could not load extension IDs (${err instanceof Error ? err.message : String(err)}); skipping native-host registration.\n`);
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
122
|
+
// P-10 (2026-05-28 QA walk): the shipped extension-ids.json carries
|
|
123
|
+
// `PLACEHOLDER_*` strings for every slot until the extension is in the
|
|
124
|
+
// Chrome Web Store / Edge Add-ons, and `allowedOrigins()` (correctly) drops
|
|
125
|
+
// those. With nothing else to fill in, the written manifest ends up with
|
|
126
|
+
// `"allowed_origins": []` and Chrome silently blocks
|
|
127
|
+
// `chrome.runtime.connectNative()` — zero sessions ever reach the host.
|
|
128
|
+
//
|
|
129
|
+
// The fix: prompt for the locally-loaded extension's ID (the per-machine
|
|
130
|
+
// 32-char a–p string Chrome assigns to an unpacked extension), validate
|
|
131
|
+
// its shape, and override extensionIds.dev with the captured value before
|
|
132
|
+
// building the manifest. An empty submission is OK — only sensible for a
|
|
133
|
+
// user loading the published CWS build, where the chromeWebStore slot is
|
|
134
|
+
// populated and the `dev` placeholder doesn't matter.
|
|
135
|
+
process.stdout.write([
|
|
136
|
+
'',
|
|
137
|
+
'Paste your unpacked extension ID (from chrome://extensions/, Developer mode toggle ON).',
|
|
138
|
+
"Leave empty to skip — only do this if you're loading the published CWS build.",
|
|
139
|
+
'',
|
|
140
|
+
].join('\n'));
|
|
141
|
+
const captured = await promptText('Extension ID: ', {
|
|
142
|
+
validate: validateChromeExtensionId,
|
|
143
|
+
allowEmpty: true,
|
|
144
|
+
});
|
|
145
|
+
if (captured) {
|
|
146
|
+
extensionIds = { ...extensionIds, dev: captured };
|
|
147
|
+
process.stdout.write(`allowed_origins includes: ${chromeExtensionOrigin(captured)}\n`);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
process.stdout.write('No extension ID provided — `allowed_origins` will only include published IDs (if any).\n');
|
|
151
|
+
}
|
|
121
152
|
const allTargets = resolveInstallTargets(platform, homeDir);
|
|
122
153
|
const chosen = await multiSelect('Register native messaging host for:', allTargets.map((t) => ({
|
|
123
154
|
value: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+EAA+E;AAC/E,6EAA6E;AAC7E,wEAAwE;AACxE,0EAA0E;AAC1E,+EAA+E;AAC/E,2EAA2E;AAE3E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAGL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;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AO,CAAC,IAAc;IAC1C,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QAC3B,IAAI,EAAE,IAAI;QACV,OAAO,EAAE;YACP,kBAAkB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SACpC;QACD,gBAAgB,EAAE,KAAK;KACxB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,OAAO,GAAG,OAAO,EAAE,CAAC;IAC1B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;IAE3F,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QAC5B,MAAM,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAChC,IAAI,SAAS,CAAC,QAAQ,CAAC,QAA6B,CAAC,EAAE,CAAC;YACtD,MAAM,kBAAkB,CAAC,QAA6B,EAAE,OAAO,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,mDAAmD,QAAQ,gBAAgB,CAC5E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,SAAS,EAAE,CAAC;IACZ,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAsCA,wBAAsB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BlE"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
// Arg parsing uses the built-in node:util parseArgs at each command boundary
|
|
10
10
|
// (no CLI framework dependency); this top-level dispatcher just routes on the
|
|
11
11
|
// first positional so each subcommand owns its own option schema.
|
|
12
|
+
import { realpathSync } from 'node:fs';
|
|
12
13
|
import { runAudit } from './commands/audit.js';
|
|
13
14
|
import { runInit } from './commands/init.js';
|
|
14
15
|
import { runSessions } from './commands/sessions.js';
|
|
@@ -68,7 +69,16 @@ async function main() {
|
|
|
68
69
|
// Run only when invoked directly as the `peek` bin (npx / shell), not when this
|
|
69
70
|
// module is imported (tests, or another package consuming `run`). Guarded the
|
|
70
71
|
// same way as @peekdev/mcp's entry so an ESM `import` has no side effects.
|
|
71
|
-
const invokedDirectly = process.argv[1] !== undefined &&
|
|
72
|
+
const invokedDirectly = process.argv[1] !== undefined &&
|
|
73
|
+
(import.meta.url === `file://${process.argv[1]}` ||
|
|
74
|
+
(() => {
|
|
75
|
+
try {
|
|
76
|
+
return import.meta.url === `file://${realpathSync(process.argv[1])}`;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
})());
|
|
72
82
|
if (invokedDirectly) {
|
|
73
83
|
main().catch((err) => {
|
|
74
84
|
process.stderr.write(`peek: fatal — ${err instanceof Error ? (err.stack ?? err.message) : String(err)}\n`);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,8EAA8E;AAC9E,oEAAoE;AACpE,gBAAgB;AAChB,4CAA4C;AAC5C,cAAc;AACd,mBAAmB;AACnB,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,kEAAkE;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,oBA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C,CAAC,EAAE,CAAC;YACvE,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;AACV,IAAI,eAAe,EAAE,CAAC;IACpB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,iBAAiB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CACrF,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate a candidate Chrome extension ID. Returns `null` if the input is the
|
|
3
|
+
* expected 32-character `a–p` shape; otherwise a user-facing error message.
|
|
4
|
+
*
|
|
5
|
+
* Trims internal whitespace defensively — users routinely paste from
|
|
6
|
+
* `chrome://extensions/` with a trailing newline or leading space.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateChromeExtensionId(raw: string): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Build the `chrome-extension://<id>/` origin Chrome expects in a native-host
|
|
11
|
+
* manifest's `allowed_origins`. Mirrors `allowedOrigins()` in peek-mcp's
|
|
12
|
+
* manifest.ts but emits the bare origin string for a single id (the manifest
|
|
13
|
+
* builder de-dupes when it folds multiple IDs together).
|
|
14
|
+
*/
|
|
15
|
+
export declare function chromeExtensionOrigin(id: string): string;
|
|
16
|
+
//# sourceMappingURL=extension-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-id.d.ts","sourceRoot":"","sources":["../../src/lib/extension-id.ts"],"names":[],"mappings":"AAqBA;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYpE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAExD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Chrome extension ID validator + helpers used by `peek init` (P-10 fix,
|
|
2
|
+
// 2026-05-28 QA walk).
|
|
3
|
+
//
|
|
4
|
+
// Chrome derives the unpacked-extension ID from the SHA-256 of the absolute
|
|
5
|
+
// path of the extension folder, mapped through a 16-letter alphabet (a–p).
|
|
6
|
+
// That makes every loaded-unpacked extension ID a 32-character string of
|
|
7
|
+
// lowercase a–p — and the same shape Chrome uses for Web Store IDs. peek init
|
|
8
|
+
// captures this ID and writes it into the native-host manifest's
|
|
9
|
+
// `allowed_origins` so Chrome will let the unpacked extension connect to the
|
|
10
|
+
// native host (without an entry the manifest ships with `allowed_origins: []`
|
|
11
|
+
// and Chrome silently blocks `chrome.runtime.connectNative()`).
|
|
12
|
+
//
|
|
13
|
+
// Pure helpers — no prompt I/O lives here. The prompt loop in
|
|
14
|
+
// commands/init.ts calls `validateChromeExtensionId` from prompt.ts's
|
|
15
|
+
// `promptText({ validate })` so tests cover the input shape independently of
|
|
16
|
+
// the readline machinery.
|
|
17
|
+
/** Length + alphabet Chrome uses for both unpacked and Web Store extension IDs. */
|
|
18
|
+
const EXTENSION_ID_LENGTH = 32;
|
|
19
|
+
const EXTENSION_ID_PATTERN = /^[a-p]{32}$/;
|
|
20
|
+
/**
|
|
21
|
+
* Validate a candidate Chrome extension ID. Returns `null` if the input is the
|
|
22
|
+
* expected 32-character `a–p` shape; otherwise a user-facing error message.
|
|
23
|
+
*
|
|
24
|
+
* Trims internal whitespace defensively — users routinely paste from
|
|
25
|
+
* `chrome://extensions/` with a trailing newline or leading space.
|
|
26
|
+
*/
|
|
27
|
+
export function validateChromeExtensionId(raw) {
|
|
28
|
+
const id = raw.trim();
|
|
29
|
+
if (id.length === 0) {
|
|
30
|
+
return 'Extension ID is required (or leave empty to skip).';
|
|
31
|
+
}
|
|
32
|
+
if (id.length !== EXTENSION_ID_LENGTH) {
|
|
33
|
+
return `Expected a 32-character ID; got ${id.length}. (Copy it from chrome://extensions/.)`;
|
|
34
|
+
}
|
|
35
|
+
if (!EXTENSION_ID_PATTERN.test(id)) {
|
|
36
|
+
return 'Extension IDs are 32 lowercase letters a–p only. Re-copy from chrome://extensions/.';
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Build the `chrome-extension://<id>/` origin Chrome expects in a native-host
|
|
42
|
+
* manifest's `allowed_origins`. Mirrors `allowedOrigins()` in peek-mcp's
|
|
43
|
+
* manifest.ts but emits the bare origin string for a single id (the manifest
|
|
44
|
+
* builder de-dupes when it folds multiple IDs together).
|
|
45
|
+
*/
|
|
46
|
+
export function chromeExtensionOrigin(id) {
|
|
47
|
+
return `chrome-extension://${id}/`;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=extension-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-id.js","sourceRoot":"","sources":["../../src/lib/extension-id.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,uBAAuB;AACvB,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,8EAA8E;AAC9E,iEAAiE;AACjE,6EAA6E;AAC7E,8EAA8E;AAC9E,gEAAgE;AAChE,EAAE;AACF,8DAA8D;AAC9D,sEAAsE;AACtE,6EAA6E;AAC7E,0BAA0B;AAE1B,mFAAmF;AACnF,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,GAAW;IACnD,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACtB,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO,oDAAoD,CAAC;IAC9D,CAAC;IACD,IAAI,EAAE,CAAC,MAAM,KAAK,mBAAmB,EAAE,CAAC;QACtC,OAAO,mCAAmC,EAAE,CAAC,MAAM,wCAAwC,CAAC;IAC9F,CAAC;IACD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACnC,OAAO,qFAAqF,CAAC;IAC/F,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAAU;IAC9C,OAAO,sBAAsB,EAAE,GAAG,CAAC;AACrC,CAAC"}
|
package/dist/lib/prompt.d.ts
CHANGED
|
@@ -22,4 +22,17 @@ export interface Choice<T> {
|
|
|
22
22
|
export declare function multiSelect<T>(message: string, choices: Choice<T>[]): Promise<T[]>;
|
|
23
23
|
/** Yes/no confirm. `defaultYes` controls the [Y/n] vs [y/N] default on empty input. */
|
|
24
24
|
export declare function confirm(message: string, defaultYes?: boolean): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Free-form text prompt with optional validation + retry. Returns the trimmed
|
|
27
|
+
* input — or undefined if the user submits an empty line and `allowEmpty` is
|
|
28
|
+
* true (the caller can interpret empty as "skip").
|
|
29
|
+
*
|
|
30
|
+
* `validate` returns `null` for OK or a message string to print as the reason
|
|
31
|
+
* and re-ask. Used by `peek init` to capture the unpacked-extension ID with a
|
|
32
|
+
* Chrome-shape check (P-10 fix, 2026-05-28 QA walk).
|
|
33
|
+
*/
|
|
34
|
+
export declare function promptText(message: string, options?: {
|
|
35
|
+
validate?: (raw: string) => string | null;
|
|
36
|
+
allowEmpty?: boolean;
|
|
37
|
+
}): Promise<string | undefined>;
|
|
25
38
|
//# sourceMappingURL=prompt.d.ts.map
|
package/dist/lib/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/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AAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAkCxF;AAED,uFAAuF;AACvF,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAUlF;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACjB,GACL,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA4B7B"}
|
package/dist/lib/prompt.js
CHANGED
|
@@ -59,4 +59,44 @@ export async function confirm(message, defaultYes = true) {
|
|
|
59
59
|
rl.close();
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Free-form text prompt with optional validation + retry. Returns the trimmed
|
|
64
|
+
* input — or undefined if the user submits an empty line and `allowEmpty` is
|
|
65
|
+
* true (the caller can interpret empty as "skip").
|
|
66
|
+
*
|
|
67
|
+
* `validate` returns `null` for OK or a message string to print as the reason
|
|
68
|
+
* and re-ask. Used by `peek init` to capture the unpacked-extension ID with a
|
|
69
|
+
* Chrome-shape check (P-10 fix, 2026-05-28 QA walk).
|
|
70
|
+
*/
|
|
71
|
+
export async function promptText(message, options = {}) {
|
|
72
|
+
const { validate, allowEmpty = false } = options;
|
|
73
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
74
|
+
try {
|
|
75
|
+
// Re-ask on validation failure until the user enters a valid value (or an
|
|
76
|
+
// empty line when allowed). Bounded to a small constant so a non-TTY pipe
|
|
77
|
+
// can't lock the wizard if it keeps streaming garbage.
|
|
78
|
+
for (let attempt = 0; attempt < 5; attempt += 1) {
|
|
79
|
+
const raw = (await ask(rl, message)).trim();
|
|
80
|
+
if (raw.length === 0) {
|
|
81
|
+
if (allowEmpty)
|
|
82
|
+
return undefined;
|
|
83
|
+
process.stdout.write(' (empty input not allowed; please try again)\n');
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (validate) {
|
|
87
|
+
const err = validate(raw);
|
|
88
|
+
if (err !== null) {
|
|
89
|
+
process.stdout.write(` ${err}\n`);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return raw;
|
|
94
|
+
}
|
|
95
|
+
process.stdout.write(' (too many invalid attempts; skipping)\n');
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
rl.close();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
62
102
|
//# sourceMappingURL=prompt.js.map
|
package/dist/lib/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/lib/prompt.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAE1E,OAAO,EAAkB,eAAe,EAAE,MAAM,eAAe,CAAC;AAkBhE,SAAS,GAAG,CAAC,EAAa,EAAE,QAAgB;IAC1C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAI,OAAe,EAAE,OAAoB;IACxE,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7E,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,OA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}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION
|
|
1
|
+
export declare const CLI_VERSION: string;
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,WAAW,QAAe,CAAC"}
|
package/dist/version.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
// CLI version string surfaced by `peek --version` / `peek --help`.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
1
|
+
// CLI version string surfaced by `peek --version` / `peek --help`.
|
|
2
|
+
//
|
|
3
|
+
// Read at runtime from this package's package.json (via `createRequire` to
|
|
4
|
+
// keep an awkward JSON ESM import out of the source) so the printed version
|
|
5
|
+
// always matches what npm shipped. The previous hardcoded literal drifted
|
|
6
|
+
// out of sync with package.json across the alpha.0 → alpha.2 bumps because
|
|
7
|
+
// Changesets only edits package.json, not source literals (P-8 bug found in
|
|
8
|
+
// the 2026-05-28 QA walk).
|
|
9
|
+
//
|
|
10
|
+
// The relative path is from the compiled dist/version.js → ../package.json.
|
|
11
|
+
import { createRequire } from 'node:module';
|
|
12
|
+
const _require = createRequire(import.meta.url);
|
|
13
|
+
const _pkg = _require('../package.json');
|
|
14
|
+
export const CLI_VERSION = _pkg.version;
|
|
6
15
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,2BAA2B;AAC3B,EAAE;AACF,4EAA4E;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChD,MAAM,IAAI,GAAG,QAAQ,CAAC,iBAAiB,CAAwB,CAAC;AAEhE,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peekdev/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.3",
|
|
4
4
|
"description": "peek command-line tool. A thin read-mostly client of the native host's ~/.peek/sessions.db (ADR-0007): status, sessions list/show/export/delete, the `peek init` MCP-client wizard, and `peek audit log`.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -15,15 +15,14 @@
|
|
|
15
15
|
"import": "./dist/index.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"files": [
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"NOTICE",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
24
23
|
"dependencies": {
|
|
25
|
-
"
|
|
26
|
-
"
|
|
24
|
+
"better-sqlite3": "^12.10.0",
|
|
25
|
+
"@peekdev/mcp": "0.1.0-alpha.3"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -35,8 +34,13 @@
|
|
|
35
34
|
},
|
|
36
35
|
"repository": {
|
|
37
36
|
"type": "git",
|
|
38
|
-
"url": "
|
|
37
|
+
"url": "https://github.com/Cubenest/rrweb-stack",
|
|
39
38
|
"directory": "packages/peek-cli"
|
|
40
39
|
},
|
|
41
|
-
"homepage": "https://github.com/Cubenest/rrweb-stack/tree/main/packages/peek-cli#readme"
|
|
42
|
-
|
|
40
|
+
"homepage": "https://github.com/Cubenest/rrweb-stack/tree/main/packages/peek-cli#readme",
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.json && node ./scripts/postbuild.mjs",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
44
|
+
"test": "vitest run --passWithNoTests"
|
|
45
|
+
}
|
|
46
|
+
}
|