@somewhere-tech/cli 0.36.1 → 0.37.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/dist/commands/browser.js +37 -5
- package/dist/commands/browser.js.map +1 -1
- package/dist/commands/deploy.js +15 -8
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/init.js +67 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/skills.js +81 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/verify.js +267 -52
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/client.js +11 -1
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/init-agent-guide.js +10 -5
- package/dist/lib/init-agent-guide.js.map +1 -1
- package/dist/lib/skills-pack.generated.js +39 -0
- package/dist/lib/skills-pack.generated.js.map +1 -0
- package/dist/lib/skills-pack.js +251 -0
- package/dist/lib/skills-pack.js.map +1 -0
- package/dist/lib/verify-progress.js +15 -0
- package/dist/lib/verify-progress.js.map +1 -0
- package/dist/lib/verify-report.js +17 -0
- package/dist/lib/verify-report.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/runtime/VENDOR.json +2 -2
- package/runtime/browser-probes.mjs +2 -5
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, readlinkSync, rmSync, rmdirSync, symlinkSync, writeFileSync, } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
export const SKILLS_DIR = '.agents/skills';
|
|
5
|
+
export const CLAUDE_SKILLS_DIR = '.claude/skills';
|
|
6
|
+
export const SKILLS_LOCK = 'skills-lock.json';
|
|
7
|
+
const SKILL_PATH = /^([a-z0-9][a-z0-9-]*)\/SKILL\.md$/;
|
|
8
|
+
const sha256 = (text) => createHash('sha256').update(text).digest('hex');
|
|
9
|
+
/** Recompute every file hash and the pack digest; throw on any mismatch. */
|
|
10
|
+
export function verifyPack(pack) {
|
|
11
|
+
if (!pack || pack.schema !== 1 || pack.name !== 'somewhere-skills' || typeof pack.version !== 'string' || !Array.isArray(pack.files) || pack.files.length === 0) {
|
|
12
|
+
throw new Error('Skills pack is malformed (expected schema 1 with files).');
|
|
13
|
+
}
|
|
14
|
+
const paths = new Set();
|
|
15
|
+
for (const file of pack.files) {
|
|
16
|
+
if (typeof file.path !== 'string' || !SKILL_PATH.test(file.path)) {
|
|
17
|
+
throw new Error(`Skills pack names an unexpected path: ${String(file.path)}`);
|
|
18
|
+
}
|
|
19
|
+
if (paths.has(file.path))
|
|
20
|
+
throw new Error(`Skills pack repeats ${file.path}.`);
|
|
21
|
+
paths.add(file.path);
|
|
22
|
+
if (typeof file.content !== 'string' || sha256(file.content) !== file.sha256) {
|
|
23
|
+
throw new Error(`Skills pack file ${file.path} does not match its sha256.`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const digest = sha256(pack.files.map((f) => `${f.path}\0${f.sha256}\n`).join(''));
|
|
27
|
+
if (digest !== pack.sha256 || !pack.version.endsWith(`+${digest.slice(0, 12)}`)) {
|
|
28
|
+
throw new Error('Skills pack digest does not match its files.');
|
|
29
|
+
}
|
|
30
|
+
return pack;
|
|
31
|
+
}
|
|
32
|
+
export function skillNames(pack) {
|
|
33
|
+
return pack.files.map((f) => SKILL_PATH.exec(f.path)[1]);
|
|
34
|
+
}
|
|
35
|
+
export function readLock(dir) {
|
|
36
|
+
const path = join(dir, SKILLS_LOCK);
|
|
37
|
+
if (!existsSync(path))
|
|
38
|
+
return null;
|
|
39
|
+
if (isSymlink(path))
|
|
40
|
+
throw new Error('Skills lock must not be a symlink.');
|
|
41
|
+
const lock = JSON.parse(readFileSync(path, 'utf8'));
|
|
42
|
+
if (!lock || lock.pack !== 'somewhere-skills' || typeof lock.version !== 'string'
|
|
43
|
+
|| !lock.files || typeof lock.files !== 'object' || Array.isArray(lock.files)
|
|
44
|
+
|| Object.entries(lock.files).some(([file, hash]) => !/^\.agents\/skills\/[a-z0-9][a-z0-9-]*\/SKILL\.md$/.test(file)
|
|
45
|
+
|| typeof hash !== 'string' || !/^[a-f0-9]{64}$/.test(hash))) {
|
|
46
|
+
throw new Error('Skills lock is malformed; nothing was changed.');
|
|
47
|
+
}
|
|
48
|
+
return lock;
|
|
49
|
+
}
|
|
50
|
+
/** Link .claude/skills/<name> to the .agents copy; copy when links are refused. */
|
|
51
|
+
function linkForClaude(dir, name) {
|
|
52
|
+
const at = join(dir, CLAUDE_SKILLS_DIR, name);
|
|
53
|
+
const target = join('..', '..', SKILLS_DIR, name);
|
|
54
|
+
mkdirSync(join(dir, CLAUDE_SKILLS_DIR), { recursive: true });
|
|
55
|
+
if (existsSync(at) || isSymlink(at)) {
|
|
56
|
+
if (isSymlink(at) && readlinkSync(at) === target)
|
|
57
|
+
return 'link';
|
|
58
|
+
writeFileSync(join(at, 'SKILL.md'), readFileSync(join(dir, SKILLS_DIR, name, 'SKILL.md')));
|
|
59
|
+
return 'copy';
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
symlinkSync(target, at, 'dir');
|
|
63
|
+
return 'link';
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
mkdirSync(at, { recursive: true });
|
|
67
|
+
writeFileSync(join(at, 'SKILL.md'), readFileSync(join(dir, SKILLS_DIR, name, 'SKILL.md')));
|
|
68
|
+
return 'copy';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function isSymlink(path) {
|
|
72
|
+
try {
|
|
73
|
+
return lstatSync(path).isSymbolicLink();
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Write the pack and its lock. Only skills this pack (or the previous lock)
|
|
81
|
+
* owns are touched. Local edits, same-name project skills, and symlinked
|
|
82
|
+
* write paths are refused before any file is changed.
|
|
83
|
+
*/
|
|
84
|
+
export function installSkills(dir, pack, opts) {
|
|
85
|
+
verifyPack(pack);
|
|
86
|
+
const previous = readLock(dir);
|
|
87
|
+
const state = previous ? inspectFiles(dir, previous) : null;
|
|
88
|
+
const names = skillNames(pack);
|
|
89
|
+
preflightInstall(dir, pack, previous, state);
|
|
90
|
+
const removed = [];
|
|
91
|
+
for (const path of Object.keys(previous?.files ?? {})) {
|
|
92
|
+
const match = /^\.agents\/skills\/([a-z0-9-]+)\/SKILL\.md$/.exec(path);
|
|
93
|
+
if (match && !names.includes(match[1])) {
|
|
94
|
+
rmSync(join(dir, path));
|
|
95
|
+
removeEmptyDir(join(dir, SKILLS_DIR, match[1]));
|
|
96
|
+
const claudePath = join(dir, CLAUDE_SKILLS_DIR, match[1]);
|
|
97
|
+
if (isSymlink(claudePath))
|
|
98
|
+
rmSync(claudePath);
|
|
99
|
+
else if (existsSync(claudePath)) {
|
|
100
|
+
rmSync(join(claudePath, 'SKILL.md'));
|
|
101
|
+
removeEmptyDir(claudePath);
|
|
102
|
+
}
|
|
103
|
+
removed.push(match[1]);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const files = {};
|
|
107
|
+
let claude = 'link';
|
|
108
|
+
for (const file of pack.files) {
|
|
109
|
+
const rel = `${SKILLS_DIR}/${file.path}`;
|
|
110
|
+
mkdirSync(join(dir, SKILLS_DIR, SKILL_PATH.exec(file.path)[1]), { recursive: true });
|
|
111
|
+
writeFileSync(join(dir, rel), file.content);
|
|
112
|
+
files[rel] = file.sha256;
|
|
113
|
+
if (linkForClaude(dir, SKILL_PATH.exec(file.path)[1]) === 'copy')
|
|
114
|
+
claude = 'copy';
|
|
115
|
+
}
|
|
116
|
+
const lock = {
|
|
117
|
+
pack: pack.name,
|
|
118
|
+
version: pack.version,
|
|
119
|
+
sha256: pack.sha256,
|
|
120
|
+
cli: opts.cli,
|
|
121
|
+
source: opts.source,
|
|
122
|
+
files,
|
|
123
|
+
};
|
|
124
|
+
writeFileSync(join(dir, SKILLS_LOCK), `${JSON.stringify(lock, null, 2)}\n`);
|
|
125
|
+
return {
|
|
126
|
+
version: pack.version,
|
|
127
|
+
written: Object.keys(files),
|
|
128
|
+
removed,
|
|
129
|
+
claude,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function removeEmptyDir(path) {
|
|
133
|
+
try {
|
|
134
|
+
rmdirSync(path);
|
|
135
|
+
}
|
|
136
|
+
catch { /* Extra project files keep their directory. */ }
|
|
137
|
+
}
|
|
138
|
+
function preflightInstall(dir, pack, previous, state) {
|
|
139
|
+
const conflicts = [...(state?.missing ?? []), ...(state?.modified ?? [])];
|
|
140
|
+
for (const path of ['.agents', SKILLS_DIR, '.claude', CLAUDE_SKILLS_DIR]) {
|
|
141
|
+
const full = join(dir, path);
|
|
142
|
+
if (isSymlink(full) || (existsSync(full) && !lstatSync(full).isDirectory()))
|
|
143
|
+
conflicts.push(path);
|
|
144
|
+
}
|
|
145
|
+
const names = new Set([...skillNames(pack), ...Object.keys(previous?.files ?? {})
|
|
146
|
+
.map(path => path.split('/')[2])]);
|
|
147
|
+
for (const name of names) {
|
|
148
|
+
const rel = `${SKILLS_DIR}/${name}/SKILL.md`;
|
|
149
|
+
const at = join(dir, SKILLS_DIR, name);
|
|
150
|
+
const owned = previous?.files[rel];
|
|
151
|
+
if (isSymlink(at) || isSymlink(join(dir, rel)) || (existsSync(at) && !owned))
|
|
152
|
+
conflicts.push(at);
|
|
153
|
+
const claude = join(dir, CLAUDE_SKILLS_DIR, name);
|
|
154
|
+
if (isSymlink(claude)) {
|
|
155
|
+
if (!owned || readlinkSync(claude) !== join('..', '..', SKILLS_DIR, name))
|
|
156
|
+
conflicts.push(claude);
|
|
157
|
+
}
|
|
158
|
+
else if (existsSync(claude)) {
|
|
159
|
+
const copy = join(claude, 'SKILL.md');
|
|
160
|
+
if (!owned || isSymlink(copy) || !existsSync(copy)
|
|
161
|
+
|| sha256(readFileSync(copy, 'utf8')) !== owned)
|
|
162
|
+
conflicts.push(claude);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (conflicts.length)
|
|
166
|
+
throw new Error(`Skills conflict; nothing changed: ${[...new Set(conflicts)].join(', ')}. Preserve your edits or move conflicting skills before updating.`);
|
|
167
|
+
}
|
|
168
|
+
function inspectFiles(dir, lock) {
|
|
169
|
+
const missing = [];
|
|
170
|
+
const modified = [];
|
|
171
|
+
for (const [path, hash] of Object.entries(lock.files)) {
|
|
172
|
+
const full = join(dir, path);
|
|
173
|
+
if (!existsSync(full))
|
|
174
|
+
missing.push(path);
|
|
175
|
+
else if (sha256(readFileSync(full, 'utf8')) !== hash)
|
|
176
|
+
modified.push(path);
|
|
177
|
+
}
|
|
178
|
+
return { missing, modified };
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* modified = a skill file was edited or deleted after install;
|
|
182
|
+
* missing = no skills-lock.json;
|
|
183
|
+
* current / stale = the lock matches (or not) the pack the docs host serves
|
|
184
|
+
* now, or — when the host cannot be reached — this CLI's bundled pack;
|
|
185
|
+
* unknown = offline, and the installed pack came from the docs host, so
|
|
186
|
+
* this CLI cannot tell whether it is still the latest.
|
|
187
|
+
*/
|
|
188
|
+
export function skillsStatus(dir, bundled, cli, latest) {
|
|
189
|
+
const lock = readLock(dir);
|
|
190
|
+
const base = { bundled: bundled.version, latest: latest?.version ?? null, cli };
|
|
191
|
+
if (!lock) {
|
|
192
|
+
return {
|
|
193
|
+
...base, state: 'missing', installed: null, lock_cli: null, missing: [], modified: [],
|
|
194
|
+
message: 'No skills installed here. Run `somewhere skills update` to add them.',
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const { missing, modified } = inspectFiles(dir, lock);
|
|
198
|
+
const common = { ...base, installed: lock.version, lock_cli: lock.cli, missing, modified };
|
|
199
|
+
if (missing.length || modified.length) {
|
|
200
|
+
return {
|
|
201
|
+
...common, state: 'modified',
|
|
202
|
+
message: `${missing.length + modified.length} skill file(s) differ from the installed pack. \`somewhere skills update\` preserves conflicts; review your edits first.`,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const reference = latest ?? bundled;
|
|
206
|
+
if (lock.version === reference.version) {
|
|
207
|
+
return { ...common, state: 'current', message: `Skills ${lock.version} match ${latest ? 'the latest pack' : `the pack in CLI ${cli}`}.` };
|
|
208
|
+
}
|
|
209
|
+
if (!latest && lock.source === 'docs-host') {
|
|
210
|
+
return {
|
|
211
|
+
...common, state: 'unknown',
|
|
212
|
+
message: `Skills ${lock.version} came from the docs host, which could not be reached to check for a newer pack.`,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
...common, state: 'stale',
|
|
217
|
+
message: `Skills ${lock.version} are out of date (latest ${reference.version}). Run \`somewhere skills update\`.`,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
export const DOCS_BASE = 'https://somewhere.tech';
|
|
221
|
+
/**
|
|
222
|
+
* The pack the docs host serves now, hash-verified. null when the host is
|
|
223
|
+
* unreachable or has no pack (offline, or a host that predates the route);
|
|
224
|
+
* a pack that fails verification THROWS — it is never installed.
|
|
225
|
+
*/
|
|
226
|
+
export async function fetchLatestPack(timeoutMs = 5000) {
|
|
227
|
+
const configured = process.env.SOMEWHERE_DOCS_BASE;
|
|
228
|
+
if (configured && configured.replace(/\/$/, '') !== DOCS_BASE) {
|
|
229
|
+
throw new Error('Skills updates require the trusted https://somewhere.tech origin. Checksums verify integrity, not publisher authenticity.');
|
|
230
|
+
}
|
|
231
|
+
let res;
|
|
232
|
+
try {
|
|
233
|
+
res = await fetch(`${DOCS_BASE}/skills/pack.json`, { signal: AbortSignal.timeout(timeoutMs), redirect: 'manual' });
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
if (res.status === 404)
|
|
239
|
+
return null;
|
|
240
|
+
if (!res.ok)
|
|
241
|
+
throw new Error(`The docs host answered ${res.status} for the skills pack.`);
|
|
242
|
+
let body;
|
|
243
|
+
try {
|
|
244
|
+
body = await res.json();
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
throw new Error('The docs host returned a skills pack that is not JSON.');
|
|
248
|
+
}
|
|
249
|
+
return verifyPack(body);
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=skills-pack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-pack.js","sourceRoot":"","sources":["../../src/lib/skills-pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqCjC,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAClD,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAE9C,MAAM,UAAU,GAAG,mCAAmC,CAAC;AAEvD,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAEjF,4EAA4E;AAC5E,MAAM,UAAU,UAAU,CAAC,IAAgB;IACzC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChK,MAAM,IAAI,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C;QAC9D,MAAM,IAAI,KAAK,CAAC,2HAA2H,CAAC,CAAC;IAC/I,CAAC;IACD,IAAI,GAAa,CAAC;IAClB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,SAAS,mBAAmB,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,CAAC,MAAM,uBAAuB,CAAC,CAAC;IAC1F,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,UAAU,CAAC,IAAkB,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Human progress is separate from the result and never retries the operation. */
|
|
2
|
+
export async function withVerifyProgress(run, human) {
|
|
3
|
+
const timer = human ? setTimeout(() => {
|
|
4
|
+
process.stderr.write('Verification is still running after 60 seconds. Waiting for its result; do not restart the actions.\n');
|
|
5
|
+
}, 60_000) : undefined;
|
|
6
|
+
timer?.unref();
|
|
7
|
+
try {
|
|
8
|
+
return await run();
|
|
9
|
+
}
|
|
10
|
+
finally {
|
|
11
|
+
if (timer)
|
|
12
|
+
clearTimeout(timer);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=verify-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-progress.js","sourceRoot":"","sources":["../../src/lib/verify-progress.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAI,GAAqB,EAAE,KAAc;IAC/E,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE;QACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uGAAuG,CAAC,CAAC;IAChI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,IAAI,CAAC;QACH,OAAO,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;YAAS,CAAC;QACT,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { chmodSync, mkdirSync, mkdtempSync, renameSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { cliConfigDir } from './config.js';
|
|
4
|
+
/** Bearer screenshot URLs belong in private CLI state, never deployable source. */
|
|
5
|
+
export function saveVerifyReport(report) {
|
|
6
|
+
const root = join(cliConfigDir(), 'verify-reports');
|
|
7
|
+
mkdirSync(root, { recursive: true, mode: 0o700 });
|
|
8
|
+
chmodSync(root, 0o700);
|
|
9
|
+
const directory = mkdtempSync(join(root, 'run-'));
|
|
10
|
+
chmodSync(directory, 0o700);
|
|
11
|
+
const pending = join(directory, 'report.pending');
|
|
12
|
+
const destination = join(directory, 'report.json');
|
|
13
|
+
writeFileSync(pending, JSON.stringify(report, null, 2) + '\n', { mode: 0o600, flag: 'wx' });
|
|
14
|
+
renameSync(pending, destination);
|
|
15
|
+
return destination;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=verify-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-report.js","sourceRoot":"","sources":["../../src/lib/verify-report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,mFAAmF;AACnF,MAAM,UAAU,gBAAgB,CAAC,MAAe;IAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,gBAAgB,CAAC,CAAC;IACpD,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAClD,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvB,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACnD,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5F,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACjC,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@somewhere-tech/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@somewhere-tech/cli",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.37.0",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@modelcontextprotocol/sdk",
|
|
12
12
|
"chokidar",
|
package/package.json
CHANGED
package/runtime/VENDOR.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
2
|
+
"commit": "9238fb4e6b5a0c2ed2c1c3abcb09fc2f3be82453",
|
|
3
3
|
"files": {
|
|
4
|
-
"browser-probes.mjs": "
|
|
4
|
+
"browser-probes.mjs": "f5cddafd996eb871fe9428f92cef3fc23fd489b302102aa36954d441d12d4e5f"
|
|
5
5
|
}
|
|
6
6
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// VENDORED from worker/src/utils/browser-test.ts
|
|
2
|
-
// — the exact runtime deployed functions run against. Do not edit by hand;
|
|
3
|
-
// re-sync with: node scripts/extract-runtime.mjs <monorepo>
|
|
1
|
+
// VENDORED browser probe from worker/src/utils/browser-test.ts @ 9238fb4e6b5a0c2ed2c1c3abcb09fc2f3be82453
|
|
4
2
|
export const MAX_OUTLINE_NODES = 200;
|
|
5
|
-
|
|
6
|
-
export const DOM_OUTLINE_SCRIPT = "(() => {\n const computeOutlineVisibility = function computeOutlineVisibility(\n info,\n) {\n const visible =\n !info.hiddenAncestor &&\n !info.ariaHiddenAncestor &&\n info.display !== 'none' &&\n info.visibility !== 'hidden' &&\n !(info.width === 0 && info.height === 0);\n const disabled = info.disabled || info.ariaDisabled === 'true';\n return { visible, disabled };\n};\n const cssPath = (el) => {\n const parts = [];\n let node = el;\n let depth = 0;\n while (node && node.nodeType === 1 && depth < 4 && node.tagName.toLowerCase() !== 'body') {\n let sel = node.tagName.toLowerCase();\n if (node.id) { parts.unshift(sel + '#' + CSS.escape(node.id)); break; }\n const parent = node.parentNode;\n if (parent) {\n const sameTag = Array.from(parent.children).filter((c) => c.tagName === node.tagName);\n if (sameTag.length > 1) sel += ':nth-of-type(' + (sameTag.indexOf(node) + 1) + ')';\n }\n parts.unshift(sel);\n node = node.parentNode;\n depth++;\n }\n return parts.join(' > ');\n };\n const interactive = 'a,button,input,select,textarea,[role=button],[role=link],[role=tab],[onclick],[data-testid]';\n const seen = new Set();\n const outline = [];\n for (const el of Array.from(document.querySelectorAll(interactive))) {\n if (outline.length >= 200) break;\n if (seen.has(el)) continue;\n seen.add(el);\n const testid = el.getAttribute('data-testid') || '';\n const id = el.id || '';\n const name = el.getAttribute('name') || '';\n const aria = el.getAttribute('aria-label') || '';\n const text = ((el.innerText || el.value || el.getAttribute('placeholder') || '') + '').trim().slice(0, 80);\n let selector;\n if (testid) selector = '[data-testid=\"' + testid + '\"]';\n else if (id) selector = '#' + CSS.escape(id);\n else if (name) selector = el.tagName.toLowerCase() + '[name=\"' + name + '\"]';\n else selector = cssPath(el);\n const style = getComputedStyle(el);\n const rect = el.getBoundingClientRect();\n const { visible, disabled } = computeOutlineVisibility({\n hiddenAncestor: !!el.closest('[hidden]'),\n ariaHiddenAncestor: !!el.closest('[aria-hidden=\"true\"]'),\n display: style.display,\n visibility: style.visibility,\n width: rect.width,\n height: rect.height,\n disabled: !!el.disabled,\n ariaDisabled: el.getAttribute('aria-disabled'),\n });\n const entry = { tag: el.tagName.toLowerCase(), id, testid, name, aria, text, selector, visible };\n if (disabled) entry.disabled = true;\n outline.push(entry);\n }\n const testid_map = {};\n for (const el of Array.from(document.querySelectorAll('[data-testid]'))) {\n const t = el.getAttribute('data-testid');\n if (t && !(t in testid_map)) testid_map[t] = '[data-testid=\"' + t + '\"]';\n }\n return { outline, testid_map };\n})()";
|
|
3
|
+
export const DOM_OUTLINE_SCRIPT = "(() => {\n const computeOutlineVisibility = function computeOutlineVisibility(\n info,\n) {\n const visible =\n !info.hiddenAncestor &&\n !info.ariaHiddenAncestor &&\n info.display !== 'none' &&\n info.visibility !== 'hidden' &&\n !(info.width === 0 && info.height === 0);\n const disabled = info.disabled || info.ariaDisabled === 'true';\n return { visible, disabled };\n};\n const cssPath = (el) => {\n const parts = [];\n let node = el;\n let depth = 0;\n while (node && node.nodeType === 1 && depth < 4 && node.tagName.toLowerCase() !== 'body') {\n let sel = node.tagName.toLowerCase();\n if (node.id) { parts.unshift(sel + '#' + CSS.escape(node.id)); break; }\n const parent = node.parentNode;\n if (parent) {\n const sameTag = Array.from(parent.children).filter((c) => c.tagName === node.tagName);\n if (sameTag.length > 1) sel += ':nth-of-type(' + (sameTag.indexOf(node) + 1) + ')';\n }\n parts.unshift(sel);\n node = node.parentNode;\n depth++;\n }\n return parts.join(' > ');\n };\n const interactive = 'a,button,input,select,textarea,[role=button],[role=link],[role=tab],[onclick],[data-testid]';\n const seen = new Set();\n const outline = [];\n for (const el of Array.from(document.querySelectorAll(interactive))) {\n if (outline.length >= 200) break;\n if (seen.has(el)) continue;\n seen.add(el);\n const testid = el.getAttribute('data-testid') || '';\n const id = el.id || '';\n const name = el.getAttribute('name') || '';\n const aria = el.getAttribute('aria-label') || '';\n const text = ((el.innerText || (el.matches('input[type=submit],input[type=button],input[type=reset]') ? el.value : '') || el.getAttribute('placeholder') || '') + '').trim().slice(0, 80); // never a field's value (pfb_8d3c75d6476e)\n let selector;\n if (testid) selector = '[data-testid=\"' + testid + '\"]';\n else if (id) selector = '#' + CSS.escape(id);\n else if (name) selector = el.tagName.toLowerCase() + '[name=\"' + name + '\"]';\n else selector = cssPath(el);\n const style = getComputedStyle(el);\n const rect = el.getBoundingClientRect();\n const { visible, disabled } = computeOutlineVisibility({\n hiddenAncestor: !!el.closest('[hidden]'),\n ariaHiddenAncestor: !!el.closest('[aria-hidden=\"true\"]'),\n display: style.display,\n visibility: style.visibility,\n width: rect.width,\n height: rect.height,\n disabled: !!el.disabled,\n ariaDisabled: el.getAttribute('aria-disabled'),\n });\n const entry = { tag: el.tagName.toLowerCase(), id, testid, name, aria, text, selector, visible };\n if (disabled) entry.disabled = true;\n outline.push(entry);\n }\n const testid_map = {};\n for (const el of Array.from(document.querySelectorAll('[data-testid]'))) {\n const t = el.getAttribute('data-testid');\n if (t && !(t in testid_map)) testid_map[t] = '[data-testid=\"' + t + '\"]';\n }\n return { outline, testid_map };\n})()";
|