sliccy 0.1.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/LICENSE +191 -0
- package/README.md +512 -0
- package/dist/cli/chrome-launch.d.ts +47 -0
- package/dist/cli/chrome-launch.js +324 -0
- package/dist/cli/cli-log-dedup.d.ts +19 -0
- package/dist/cli/cli-log-dedup.js +62 -0
- package/dist/cli/electron-controller.d.ts +38 -0
- package/dist/cli/electron-controller.js +287 -0
- package/dist/cli/electron-main.d.ts +1 -0
- package/dist/cli/electron-main.js +183 -0
- package/dist/cli/electron-runtime.d.ts +58 -0
- package/dist/cli/electron-runtime.js +133 -0
- package/dist/cli/file-logger.d.ts +38 -0
- package/dist/cli/file-logger.js +207 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +1023 -0
- package/dist/cli/launch-url.d.ts +9 -0
- package/dist/cli/launch-url.js +34 -0
- package/dist/cli/qa-setup.d.ts +1 -0
- package/dist/cli/qa-setup.js +36 -0
- package/dist/cli/release-package.d.ts +17 -0
- package/dist/cli/release-package.js +232 -0
- package/dist/cli/runtime-flags.d.ts +21 -0
- package/dist/cli/runtime-flags.js +154 -0
- package/dist/cli/sync-release-version.d.ts +2 -0
- package/dist/cli/sync-release-version.js +34 -0
- package/dist/tray-url-shared.d.ts +11 -0
- package/dist/tray-url-shared.js +56 -0
- package/dist/ui/assets/___vite-browser-external_commonjs-proxy-7ULRRj69.js +1 -0
- package/dist/ui/assets/__vite-browser-external-D7Ct-6yo.js +1 -0
- package/dist/ui/assets/addon-fit-DOCEibfw.js +12 -0
- package/dist/ui/assets/bsh-watchdog-D19WB0U1.js +2 -0
- package/dist/ui/assets/index-BVQAdk-Y.js +8 -0
- package/dist/ui/assets/index-BjJrFm2K.js +43 -0
- package/dist/ui/assets/index-C1dglHrI.js +3 -0
- package/dist/ui/assets/index-D3Enm5ux.js +13091 -0
- package/dist/ui/assets/index-D7hjyFh1.js +2 -0
- package/dist/ui/assets/index-D8uSC2sl.js +45 -0
- package/dist/ui/assets/index-DEglHp2j.js +1 -0
- package/dist/ui/assets/index-DvjzakYY.js +14406 -0
- package/dist/ui/assets/index-deZeJCgO.js +1 -0
- package/dist/ui/assets/index-mz3VYh0I.js +131 -0
- package/dist/ui/assets/index-r2m8Dpaz.js +54 -0
- package/dist/ui/assets/index-ygVJ3eFG.js +11 -0
- package/dist/ui/assets/lick-manager-proxy-G3WuipZ-.js +1 -0
- package/dist/ui/assets/magic-string.es-BPLJknd7.js +10 -0
- package/dist/ui/assets/oauth-service-DIahkF-o.js +1 -0
- package/dist/ui/assets/offscreen-client-ByVIJGHW.js +1 -0
- package/dist/ui/assets/pdfjs-uyZuKmOq.js +59 -0
- package/dist/ui/assets/pyodide-D73G_Ygx.mjs +4 -0
- package/dist/ui/assets/sql-wasm-BggYNCID.js +2 -0
- package/dist/ui/assets/stream-lEC9OYG2.js +1 -0
- package/dist/ui/assets/xterm-Bb8UKAlD.js +27 -0
- package/dist/ui/assets/xterm-DOrYoP_4.css +32 -0
- package/dist/ui/electron-overlay-entry.js +360 -0
- package/dist/ui/favicon.png +0 -0
- package/dist/ui/fonts/AdobeClean-Bold.otf +0 -0
- package/dist/ui/fonts/AdobeClean-ExtraBold.otf +0 -0
- package/dist/ui/fonts/AdobeClean-Medium.otf +0 -0
- package/dist/ui/fonts/AdobeClean-Regular.otf +0 -0
- package/dist/ui/index.html +1981 -0
- package/dist/ui/preview-sw.js +4 -0
- package/package.json +81 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface CliLaunchUrlOptions {
|
|
2
|
+
serveOrigin: string;
|
|
3
|
+
lead: boolean;
|
|
4
|
+
leadWorkerBaseUrl?: string | null;
|
|
5
|
+
envWorkerBaseUrl?: string | null;
|
|
6
|
+
join: boolean;
|
|
7
|
+
joinUrl?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function resolveCliBrowserLaunchUrl(options: CliLaunchUrlOptions): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { buildCanonicalTrayLaunchUrl, normalizeTrayWorkerBaseUrl, parseTrayJoinUrl, } from '../tray-url-shared.js';
|
|
2
|
+
function buildTrayJoinLaunchUrl(locationHref, joinUrl) {
|
|
3
|
+
const parsedJoinUrl = parseTrayJoinUrl(joinUrl);
|
|
4
|
+
if (!parsedJoinUrl) {
|
|
5
|
+
throw new Error(`Invalid tray join URL: ${joinUrl}`);
|
|
6
|
+
}
|
|
7
|
+
return buildCanonicalTrayLaunchUrl(locationHref, parsedJoinUrl.joinUrl);
|
|
8
|
+
}
|
|
9
|
+
function buildTrayLeadLaunchUrl(locationHref, workerBaseUrl) {
|
|
10
|
+
const normalizedBase = normalizeTrayWorkerBaseUrl(workerBaseUrl);
|
|
11
|
+
if (!normalizedBase) {
|
|
12
|
+
throw new Error(`Invalid tray worker base URL: ${workerBaseUrl}`);
|
|
13
|
+
}
|
|
14
|
+
return buildCanonicalTrayLaunchUrl(locationHref, normalizedBase);
|
|
15
|
+
}
|
|
16
|
+
export function resolveCliBrowserLaunchUrl(options) {
|
|
17
|
+
if (options.lead && options.join) {
|
|
18
|
+
throw new Error('The --lead and --join launch flows are mutually exclusive.');
|
|
19
|
+
}
|
|
20
|
+
if (options.join) {
|
|
21
|
+
if (!options.joinUrl) {
|
|
22
|
+
throw new Error('The --join launch flow requires a tray join URL via --join <url> or --join=<url>.');
|
|
23
|
+
}
|
|
24
|
+
return buildTrayJoinLaunchUrl(options.serveOrigin, options.joinUrl);
|
|
25
|
+
}
|
|
26
|
+
if (!options.lead) {
|
|
27
|
+
return options.serveOrigin;
|
|
28
|
+
}
|
|
29
|
+
const workerBaseUrl = normalizeTrayWorkerBaseUrl(options.leadWorkerBaseUrl ?? options.envWorkerBaseUrl ?? null);
|
|
30
|
+
if (!workerBaseUrl) {
|
|
31
|
+
throw new Error('The --lead launch flow requires a tray worker base URL via --lead <url>, --lead=<url>, or WORKER_BASE_URL.');
|
|
32
|
+
}
|
|
33
|
+
return buildTrayLeadLaunchUrl(options.serveOrigin, workerBaseUrl);
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { existsSync } from 'fs';
|
|
2
|
+
import { resolve } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { CLI_PROFILE_NAMES, ensureQaProfileScaffold, findChromeExecutable, resolveQaProfilesRoot, } from './chrome-launch.js';
|
|
5
|
+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
6
|
+
const projectRoot = resolve(__dirname, '..', '..');
|
|
7
|
+
async function main() {
|
|
8
|
+
const chromePath = findChromeExecutable();
|
|
9
|
+
if (!chromePath) {
|
|
10
|
+
console.error('Could not find Chrome or Chrome for Testing. Set CHROME_PATH and retry.');
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
const extensionPath = resolve(projectRoot, 'dist', 'extension');
|
|
14
|
+
if (!existsSync(extensionPath)) {
|
|
15
|
+
console.error('dist/extension was not found. Run `npm run build:extension` first.');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const profiles = await ensureQaProfileScaffold(projectRoot);
|
|
19
|
+
console.log('SLICC QA profiles are ready.');
|
|
20
|
+
console.log(`Chrome executable: ${chromePath}`);
|
|
21
|
+
console.log(`QA profile root: ${resolveQaProfilesRoot(projectRoot)}`);
|
|
22
|
+
console.log(`Extension build: ${extensionPath}`);
|
|
23
|
+
console.log('Profiles:');
|
|
24
|
+
for (const profile of profiles) {
|
|
25
|
+
const extensionLabel = profile.extensionPath ? ' (auto-loads dist/extension)' : '';
|
|
26
|
+
console.log(`- ${profile.id}: ${profile.userDataDir}${extensionLabel}`);
|
|
27
|
+
}
|
|
28
|
+
console.log('Next commands:');
|
|
29
|
+
for (const profileName of CLI_PROFILE_NAMES) {
|
|
30
|
+
console.log(`- npm run qa:${profileName}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
void main().catch((error) => {
|
|
34
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
35
|
+
process.exit(1);
|
|
36
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ZipEntry {
|
|
2
|
+
path: string;
|
|
3
|
+
data: Buffer;
|
|
4
|
+
mode: number;
|
|
5
|
+
}
|
|
6
|
+
interface ReleaseManifest {
|
|
7
|
+
version: string;
|
|
8
|
+
extensionArchive: string;
|
|
9
|
+
npmPackageTarball: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function sanitizeArtifactName(value: string): string;
|
|
12
|
+
export declare function assertMatchingVersions(packageVersion: string, extensionVersion: string): void;
|
|
13
|
+
export declare function collectZipEntries(rootDir: string): ZipEntry[];
|
|
14
|
+
export declare function createDeterministicZip(entries: readonly ZipEntry[]): Buffer;
|
|
15
|
+
export declare function parseNpmPackFilename(output: string): string;
|
|
16
|
+
export declare function packageReleaseArtifacts(): ReleaseManifest;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { spawnSync } from 'child_process';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync, } from 'fs';
|
|
3
|
+
import { resolve, relative, join } from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { deflateRawSync } from 'zlib';
|
|
6
|
+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
+
const PROJECT_ROOT = resolve(__dirname, '..', '..');
|
|
8
|
+
const RELEASE_DIR = resolve(PROJECT_ROOT, 'artifacts', 'release');
|
|
9
|
+
const FIXED_ZIP_DATE = new Date(Date.UTC(1980, 0, 1, 0, 0, 0));
|
|
10
|
+
const ZIP_VERSION = 20;
|
|
11
|
+
const ZIP_UTF8_FLAG = 0x0800;
|
|
12
|
+
const ZIP_METHOD_DEFLATE = 8;
|
|
13
|
+
const ZIP_FILE_MODE = 0o100644;
|
|
14
|
+
const CRC32_TABLE = buildCrc32Table();
|
|
15
|
+
function comparePaths(left, right) {
|
|
16
|
+
if (left < right)
|
|
17
|
+
return -1;
|
|
18
|
+
if (left > right)
|
|
19
|
+
return 1;
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
export function sanitizeArtifactName(value) {
|
|
23
|
+
return value
|
|
24
|
+
.trim()
|
|
25
|
+
.toLowerCase()
|
|
26
|
+
.replace(/^@/, '')
|
|
27
|
+
.replace(/[\\/]+/g, '-')
|
|
28
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
29
|
+
.replace(/-+/g, '-')
|
|
30
|
+
.replace(/^-|-$/g, '');
|
|
31
|
+
}
|
|
32
|
+
export function assertMatchingVersions(packageVersion, extensionVersion) {
|
|
33
|
+
if (packageVersion !== extensionVersion) {
|
|
34
|
+
throw new Error(`package.json version (${packageVersion}) must match manifest.json version (${extensionVersion}) before packaging release artifacts.`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function collectZipEntries(rootDir) {
|
|
38
|
+
const entries = [];
|
|
39
|
+
const walk = (currentDir) => {
|
|
40
|
+
for (const name of readdirSync(currentDir).sort(comparePaths)) {
|
|
41
|
+
const fullPath = join(currentDir, name);
|
|
42
|
+
const stats = statSync(fullPath);
|
|
43
|
+
if (stats.isDirectory()) {
|
|
44
|
+
walk(fullPath);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (!stats.isFile())
|
|
48
|
+
continue;
|
|
49
|
+
entries.push({
|
|
50
|
+
path: relative(rootDir, fullPath).split('\\').join('/'),
|
|
51
|
+
data: readFileSync(fullPath),
|
|
52
|
+
mode: ZIP_FILE_MODE,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
walk(rootDir);
|
|
57
|
+
return entries;
|
|
58
|
+
}
|
|
59
|
+
export function createDeterministicZip(entries) {
|
|
60
|
+
const sortedEntries = [...entries].sort((left, right) => comparePaths(left.path, right.path));
|
|
61
|
+
const { dosDate, dosTime } = encodeDosDateTime(FIXED_ZIP_DATE);
|
|
62
|
+
const localSections = [];
|
|
63
|
+
const centralSections = [];
|
|
64
|
+
let offset = 0;
|
|
65
|
+
for (const entry of sortedEntries) {
|
|
66
|
+
const fileName = Buffer.from(entry.path, 'utf8');
|
|
67
|
+
const compressed = deflateRawSync(entry.data, { level: 9 });
|
|
68
|
+
const crc = crc32(entry.data);
|
|
69
|
+
const localHeader = Buffer.alloc(30);
|
|
70
|
+
localHeader.writeUInt32LE(0x04034b50, 0);
|
|
71
|
+
localHeader.writeUInt16LE(ZIP_VERSION, 4);
|
|
72
|
+
localHeader.writeUInt16LE(ZIP_UTF8_FLAG, 6);
|
|
73
|
+
localHeader.writeUInt16LE(ZIP_METHOD_DEFLATE, 8);
|
|
74
|
+
localHeader.writeUInt16LE(dosTime, 10);
|
|
75
|
+
localHeader.writeUInt16LE(dosDate, 12);
|
|
76
|
+
localHeader.writeUInt32LE(crc, 14);
|
|
77
|
+
localHeader.writeUInt32LE(compressed.length, 18);
|
|
78
|
+
localHeader.writeUInt32LE(entry.data.length, 22);
|
|
79
|
+
localHeader.writeUInt16LE(fileName.length, 26);
|
|
80
|
+
localHeader.writeUInt16LE(0, 28);
|
|
81
|
+
const localSection = Buffer.concat([localHeader, fileName, compressed]);
|
|
82
|
+
localSections.push(localSection);
|
|
83
|
+
const centralHeader = Buffer.alloc(46);
|
|
84
|
+
centralHeader.writeUInt32LE(0x02014b50, 0);
|
|
85
|
+
centralHeader.writeUInt16LE((3 << 8) | ZIP_VERSION, 4);
|
|
86
|
+
centralHeader.writeUInt16LE(ZIP_VERSION, 6);
|
|
87
|
+
centralHeader.writeUInt16LE(ZIP_UTF8_FLAG, 8);
|
|
88
|
+
centralHeader.writeUInt16LE(ZIP_METHOD_DEFLATE, 10);
|
|
89
|
+
centralHeader.writeUInt16LE(dosTime, 12);
|
|
90
|
+
centralHeader.writeUInt16LE(dosDate, 14);
|
|
91
|
+
centralHeader.writeUInt32LE(crc, 16);
|
|
92
|
+
centralHeader.writeUInt32LE(compressed.length, 20);
|
|
93
|
+
centralHeader.writeUInt32LE(entry.data.length, 24);
|
|
94
|
+
centralHeader.writeUInt16LE(fileName.length, 28);
|
|
95
|
+
centralHeader.writeUInt16LE(0, 30);
|
|
96
|
+
centralHeader.writeUInt16LE(0, 32);
|
|
97
|
+
centralHeader.writeUInt16LE(0, 34);
|
|
98
|
+
centralHeader.writeUInt16LE(0, 36);
|
|
99
|
+
centralHeader.writeUInt32LE((entry.mode << 16) >>> 0, 38);
|
|
100
|
+
centralHeader.writeUInt32LE(offset, 42);
|
|
101
|
+
const centralSection = Buffer.concat([centralHeader, fileName]);
|
|
102
|
+
centralSections.push(centralSection);
|
|
103
|
+
offset += localSection.length;
|
|
104
|
+
}
|
|
105
|
+
const centralDirectory = Buffer.concat(centralSections);
|
|
106
|
+
const endRecord = Buffer.alloc(22);
|
|
107
|
+
endRecord.writeUInt32LE(0x06054b50, 0);
|
|
108
|
+
endRecord.writeUInt16LE(0, 4);
|
|
109
|
+
endRecord.writeUInt16LE(0, 6);
|
|
110
|
+
endRecord.writeUInt16LE(sortedEntries.length, 8);
|
|
111
|
+
endRecord.writeUInt16LE(sortedEntries.length, 10);
|
|
112
|
+
endRecord.writeUInt32LE(centralDirectory.length, 12);
|
|
113
|
+
endRecord.writeUInt32LE(offset, 16);
|
|
114
|
+
endRecord.writeUInt16LE(0, 20);
|
|
115
|
+
return Buffer.concat([...localSections, centralDirectory, endRecord]);
|
|
116
|
+
}
|
|
117
|
+
function buildCrc32Table() {
|
|
118
|
+
const table = new Uint32Array(256);
|
|
119
|
+
for (let index = 0; index < 256; index += 1) {
|
|
120
|
+
let value = index;
|
|
121
|
+
for (let bit = 0; bit < 8; bit += 1) {
|
|
122
|
+
value = (value & 1) === 1 ? (value >>> 1) ^ 0xedb88320 : value >>> 1;
|
|
123
|
+
}
|
|
124
|
+
table[index] = value >>> 0;
|
|
125
|
+
}
|
|
126
|
+
return table;
|
|
127
|
+
}
|
|
128
|
+
function crc32(buffer) {
|
|
129
|
+
let crc = 0xffffffff;
|
|
130
|
+
for (const value of buffer) {
|
|
131
|
+
crc = CRC32_TABLE[(crc ^ value) & 0xff] ^ (crc >>> 8);
|
|
132
|
+
}
|
|
133
|
+
return (crc ^ 0xffffffff) >>> 0;
|
|
134
|
+
}
|
|
135
|
+
function encodeDosDateTime(value) {
|
|
136
|
+
const year = Math.max(value.getUTCFullYear(), 1980);
|
|
137
|
+
const dosDate = ((year - 1980) << 9)
|
|
138
|
+
| ((value.getUTCMonth() + 1) << 5)
|
|
139
|
+
| value.getUTCDate();
|
|
140
|
+
const dosTime = (value.getUTCHours() << 11)
|
|
141
|
+
| (value.getUTCMinutes() << 5)
|
|
142
|
+
| Math.floor(value.getUTCSeconds() / 2);
|
|
143
|
+
return { dosDate, dosTime };
|
|
144
|
+
}
|
|
145
|
+
function readJsonFile(path) {
|
|
146
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
147
|
+
}
|
|
148
|
+
function requirePath(path, description) {
|
|
149
|
+
if (!existsSync(path)) {
|
|
150
|
+
throw new Error(`${description} was not found at ${path}. Run the required build command(s) first.`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function toProjectRelative(path) {
|
|
154
|
+
return relative(PROJECT_ROOT, path).split('\\').join('/');
|
|
155
|
+
}
|
|
156
|
+
function resolveNpmCommand() {
|
|
157
|
+
const npmExecPath = process.env['npm_execpath'];
|
|
158
|
+
if (npmExecPath) {
|
|
159
|
+
return { command: process.execPath, argsPrefix: [npmExecPath] };
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
command: process.platform === 'win32' ? 'npm.cmd' : 'npm',
|
|
163
|
+
argsPrefix: [],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export function parseNpmPackFilename(output) {
|
|
167
|
+
const parsed = JSON.parse(output);
|
|
168
|
+
const filename = parsed[0]?.filename;
|
|
169
|
+
if (!filename) {
|
|
170
|
+
throw new Error(`npm pack did not report an output filename. Raw output: ${output.trim()}`);
|
|
171
|
+
}
|
|
172
|
+
return filename;
|
|
173
|
+
}
|
|
174
|
+
function createExtensionArchive(metadata) {
|
|
175
|
+
const extensionDir = resolve(PROJECT_ROOT, 'dist', 'extension');
|
|
176
|
+
requirePath(extensionDir, 'Extension build output');
|
|
177
|
+
const zipPath = resolve(RELEASE_DIR, `${sanitizeArtifactName(metadata.name)}-extension-v${metadata.version}.zip`);
|
|
178
|
+
const zipBuffer = createDeterministicZip(collectZipEntries(extensionDir));
|
|
179
|
+
writeFileSync(zipPath, zipBuffer);
|
|
180
|
+
return zipPath;
|
|
181
|
+
}
|
|
182
|
+
function createNpmPackageTarball() {
|
|
183
|
+
requirePath(resolve(PROJECT_ROOT, 'dist', 'cli'), 'CLI build output');
|
|
184
|
+
requirePath(resolve(PROJECT_ROOT, 'dist', 'ui'), 'UI build output');
|
|
185
|
+
const npm = resolveNpmCommand();
|
|
186
|
+
const result = spawnSync(npm.command, [...npm.argsPrefix, 'pack', '--json', '--ignore-scripts', '--pack-destination', RELEASE_DIR], {
|
|
187
|
+
cwd: PROJECT_ROOT,
|
|
188
|
+
encoding: 'utf8',
|
|
189
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
190
|
+
});
|
|
191
|
+
if (result.status !== 0) {
|
|
192
|
+
throw new Error((result.stderr || result.stdout || 'npm pack failed').trim());
|
|
193
|
+
}
|
|
194
|
+
return resolve(RELEASE_DIR, parseNpmPackFilename(result.stdout));
|
|
195
|
+
}
|
|
196
|
+
function writeReleaseManifest(manifest) {
|
|
197
|
+
const manifestPath = resolve(RELEASE_DIR, 'release-artifacts.json');
|
|
198
|
+
writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
|
|
199
|
+
return manifestPath;
|
|
200
|
+
}
|
|
201
|
+
export function packageReleaseArtifacts() {
|
|
202
|
+
const packageJson = readJsonFile(resolve(PROJECT_ROOT, 'package.json'));
|
|
203
|
+
const extensionManifest = readJsonFile(resolve(PROJECT_ROOT, 'manifest.json'));
|
|
204
|
+
assertMatchingVersions(packageJson.version, extensionManifest.version);
|
|
205
|
+
rmSync(RELEASE_DIR, { recursive: true, force: true });
|
|
206
|
+
mkdirSync(RELEASE_DIR, { recursive: true });
|
|
207
|
+
const extensionArchive = createExtensionArchive(extensionManifest);
|
|
208
|
+
const npmPackageTarball = createNpmPackageTarball();
|
|
209
|
+
const manifest = {
|
|
210
|
+
version: packageJson.version,
|
|
211
|
+
extensionArchive: toProjectRelative(extensionArchive),
|
|
212
|
+
npmPackageTarball: toProjectRelative(npmPackageTarball),
|
|
213
|
+
};
|
|
214
|
+
writeReleaseManifest(manifest);
|
|
215
|
+
return manifest;
|
|
216
|
+
}
|
|
217
|
+
function main() {
|
|
218
|
+
const manifest = packageReleaseArtifacts();
|
|
219
|
+
console.log(`Created extension archive: ${manifest.extensionArchive}`);
|
|
220
|
+
console.log(`Created npm package tarball: ${manifest.npmPackageTarball}`);
|
|
221
|
+
console.log(`Created release manifest: ${toProjectRelative(resolve(RELEASE_DIR, 'release-artifacts.json'))}`);
|
|
222
|
+
}
|
|
223
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
|
|
224
|
+
try {
|
|
225
|
+
main();
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
229
|
+
console.error(`[package:release] ${message}`);
|
|
230
|
+
process.exit(1);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
2
|
+
export interface CliRuntimeFlags {
|
|
3
|
+
dev: boolean;
|
|
4
|
+
serveOnly: boolean;
|
|
5
|
+
cdpPort: number;
|
|
6
|
+
electron: boolean;
|
|
7
|
+
electronApp: string | null;
|
|
8
|
+
kill: boolean;
|
|
9
|
+
lead: boolean;
|
|
10
|
+
leadWorkerBaseUrl: string | null;
|
|
11
|
+
profile: string | null;
|
|
12
|
+
join: boolean;
|
|
13
|
+
joinUrl: string | null;
|
|
14
|
+
logLevel: LogLevel;
|
|
15
|
+
logDir: string | null;
|
|
16
|
+
/** Initial prompt to auto-submit when the UI loads */
|
|
17
|
+
prompt: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare const DEFAULT_CLI_CDP_PORT = 9222;
|
|
20
|
+
export declare const DEFAULT_ELECTRON_ATTACH_CDP_PORT = 9223;
|
|
21
|
+
export declare function parseCliRuntimeFlags(argv: string[]): CliRuntimeFlags;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
export const DEFAULT_CLI_CDP_PORT = 9222;
|
|
2
|
+
export const DEFAULT_ELECTRON_ATTACH_CDP_PORT = 9223;
|
|
3
|
+
function looksLikeUrl(value) {
|
|
4
|
+
return /^[a-z][a-z0-9+.-]*:\/\//i.test(value.trim());
|
|
5
|
+
}
|
|
6
|
+
const VALID_LOG_LEVELS = new Set(['debug', 'info', 'warn', 'error']);
|
|
7
|
+
export function parseCliRuntimeFlags(argv) {
|
|
8
|
+
let dev = false;
|
|
9
|
+
let serveOnly = false;
|
|
10
|
+
let cdpPort = DEFAULT_CLI_CDP_PORT;
|
|
11
|
+
let explicitCdpPort = false;
|
|
12
|
+
let electron = false;
|
|
13
|
+
let electronApp = null;
|
|
14
|
+
let kill = false;
|
|
15
|
+
let lead = false;
|
|
16
|
+
let leadWorkerBaseUrl = null;
|
|
17
|
+
let profile = null;
|
|
18
|
+
let join = false;
|
|
19
|
+
let joinUrl = null;
|
|
20
|
+
let logLevel = 'info';
|
|
21
|
+
let logDir = null;
|
|
22
|
+
let prompt = null;
|
|
23
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
24
|
+
const arg = argv[index];
|
|
25
|
+
if (arg === '--dev') {
|
|
26
|
+
dev = true;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (arg === '--serve-only') {
|
|
30
|
+
serveOnly = true;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (arg.startsWith('--cdp-port=')) {
|
|
34
|
+
const value = Number.parseInt(arg.slice('--cdp-port='.length), 10);
|
|
35
|
+
if (Number.isFinite(value) && value > 0) {
|
|
36
|
+
cdpPort = value;
|
|
37
|
+
explicitCdpPort = true;
|
|
38
|
+
}
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (arg.startsWith('--log-level=')) {
|
|
42
|
+
const value = arg.slice('--log-level='.length);
|
|
43
|
+
if (VALID_LOG_LEVELS.has(value)) {
|
|
44
|
+
logLevel = value;
|
|
45
|
+
}
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (arg.startsWith('--log-dir=')) {
|
|
49
|
+
logDir = arg.slice('--log-dir='.length) || null;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (arg.startsWith('--prompt=')) {
|
|
53
|
+
prompt = arg.slice('--prompt='.length) || null;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (arg === '--prompt') {
|
|
57
|
+
const nextArg = argv[index + 1];
|
|
58
|
+
if (nextArg && !nextArg.startsWith('--')) {
|
|
59
|
+
prompt = nextArg;
|
|
60
|
+
index += 1;
|
|
61
|
+
}
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (arg === '--electron') {
|
|
65
|
+
electron = true;
|
|
66
|
+
const nextArg = argv[index + 1];
|
|
67
|
+
if (nextArg && !nextArg.startsWith('--') && !electronApp) {
|
|
68
|
+
electronApp = nextArg.trim() || null;
|
|
69
|
+
index += 1;
|
|
70
|
+
}
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (arg === '--kill') {
|
|
74
|
+
kill = true;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (arg === '--profile') {
|
|
78
|
+
const nextArg = argv[index + 1];
|
|
79
|
+
if (nextArg && !nextArg.startsWith('--')) {
|
|
80
|
+
profile = nextArg.trim() || null;
|
|
81
|
+
index += 1;
|
|
82
|
+
}
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (arg.startsWith('--profile=')) {
|
|
86
|
+
profile = arg.slice('--profile='.length).trim() || null;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (arg === '--lead') {
|
|
90
|
+
lead = true;
|
|
91
|
+
const nextArg = argv[index + 1];
|
|
92
|
+
if (nextArg && !nextArg.startsWith('--') && looksLikeUrl(nextArg)) {
|
|
93
|
+
leadWorkerBaseUrl = nextArg.trim() || null;
|
|
94
|
+
index += 1;
|
|
95
|
+
}
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (arg.startsWith('--lead=')) {
|
|
99
|
+
lead = true;
|
|
100
|
+
leadWorkerBaseUrl = arg.slice('--lead='.length).trim() || null;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (arg === '--join') {
|
|
104
|
+
join = true;
|
|
105
|
+
const nextArg = argv[index + 1];
|
|
106
|
+
if (nextArg && !nextArg.startsWith('--') && looksLikeUrl(nextArg)) {
|
|
107
|
+
joinUrl = nextArg.trim() || null;
|
|
108
|
+
index += 1;
|
|
109
|
+
}
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (arg.startsWith('--join=')) {
|
|
113
|
+
join = true;
|
|
114
|
+
joinUrl = arg.slice('--join='.length).trim() || null;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (arg === '--electron-app') {
|
|
118
|
+
electron = true;
|
|
119
|
+
const nextArg = argv[index + 1];
|
|
120
|
+
if (nextArg && !nextArg.startsWith('--')) {
|
|
121
|
+
electronApp = nextArg.trim() || null;
|
|
122
|
+
index += 1;
|
|
123
|
+
}
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (arg.startsWith('--electron-app=')) {
|
|
127
|
+
electron = true;
|
|
128
|
+
electronApp = arg.slice('--electron-app='.length).trim() || null;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (electron && !arg.startsWith('--') && !electronApp) {
|
|
132
|
+
electronApp = arg.trim() || null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (electron && !explicitCdpPort) {
|
|
136
|
+
cdpPort = DEFAULT_ELECTRON_ATTACH_CDP_PORT;
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
dev,
|
|
140
|
+
serveOnly,
|
|
141
|
+
cdpPort,
|
|
142
|
+
electron,
|
|
143
|
+
electronApp,
|
|
144
|
+
kill,
|
|
145
|
+
lead,
|
|
146
|
+
leadWorkerBaseUrl,
|
|
147
|
+
profile,
|
|
148
|
+
join,
|
|
149
|
+
joinUrl,
|
|
150
|
+
logLevel,
|
|
151
|
+
logDir,
|
|
152
|
+
prompt,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
2
|
+
import { resolve } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
5
|
+
const PROJECT_ROOT = resolve(__dirname, '..', '..');
|
|
6
|
+
export function updateManifestVersionContents(contents, version) {
|
|
7
|
+
const manifest = JSON.parse(contents);
|
|
8
|
+
if (typeof manifest.version !== 'string') {
|
|
9
|
+
throw new Error('manifest.json must contain a string version before semantic-release can update it.');
|
|
10
|
+
}
|
|
11
|
+
manifest.version = version;
|
|
12
|
+
return `${JSON.stringify(manifest, null, 2)}\n`;
|
|
13
|
+
}
|
|
14
|
+
export function writeManifestVersion(manifestPath, version) {
|
|
15
|
+
writeFileSync(manifestPath, updateManifestVersionContents(readFileSync(manifestPath, 'utf8'), version));
|
|
16
|
+
}
|
|
17
|
+
function main() {
|
|
18
|
+
const version = process.argv[2];
|
|
19
|
+
if (!version) {
|
|
20
|
+
throw new Error('Usage: node dist/cli/sync-release-version.js <version>');
|
|
21
|
+
}
|
|
22
|
+
writeManifestVersion(resolve(PROJECT_ROOT, 'manifest.json'), version);
|
|
23
|
+
console.log(`Updated manifest.json version to ${version}`);
|
|
24
|
+
}
|
|
25
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
|
|
26
|
+
try {
|
|
27
|
+
main();
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
31
|
+
console.error(`[sync-release-version] ${message}`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const TRAY_QUERY_PARAM = "tray";
|
|
2
|
+
export declare const TRAY_WORKER_QUERY_PARAM = "trayWorkerUrl";
|
|
3
|
+
export declare const TRAY_LEGACY_LEAD_QUERY_PARAM = "lead";
|
|
4
|
+
export interface ParsedTrayJoinUrl {
|
|
5
|
+
workerBaseUrl: string;
|
|
6
|
+
trayId: string;
|
|
7
|
+
joinUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function normalizeTrayWorkerBaseUrl(raw: string | null | undefined): string | null;
|
|
10
|
+
export declare function parseTrayJoinUrl(raw: string | null | undefined): ParsedTrayJoinUrl | null;
|
|
11
|
+
export declare function buildCanonicalTrayLaunchUrl(locationHref: string, trayValue: string): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const TRAY_QUERY_PARAM = 'tray';
|
|
2
|
+
export const TRAY_WORKER_QUERY_PARAM = 'trayWorkerUrl';
|
|
3
|
+
export const TRAY_LEGACY_LEAD_QUERY_PARAM = 'lead';
|
|
4
|
+
export function normalizeTrayWorkerBaseUrl(raw) {
|
|
5
|
+
if (!raw)
|
|
6
|
+
return null;
|
|
7
|
+
try {
|
|
8
|
+
const url = new URL(raw.trim());
|
|
9
|
+
url.search = '';
|
|
10
|
+
url.hash = '';
|
|
11
|
+
if (url.pathname !== '/') {
|
|
12
|
+
url.pathname = url.pathname.replace(/\/+$/, '') || '/';
|
|
13
|
+
}
|
|
14
|
+
const normalized = url.toString();
|
|
15
|
+
return normalized.endsWith('/') ? normalized.slice(0, -1) : normalized;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function parseTrayJoinUrl(raw) {
|
|
22
|
+
if (!raw)
|
|
23
|
+
return null;
|
|
24
|
+
try {
|
|
25
|
+
const url = new URL(raw.trim());
|
|
26
|
+
url.search = '';
|
|
27
|
+
url.hash = '';
|
|
28
|
+
const normalizedJoinUrl = url.toString();
|
|
29
|
+
const segments = url.pathname.split('/').filter(Boolean);
|
|
30
|
+
if (segments.length < 2 || segments.at(-2) !== 'join') {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const token = decodeURIComponent(segments.at(-1));
|
|
34
|
+
const [trayId, secret, ...rest] = token.split('.');
|
|
35
|
+
if (!trayId || !secret || rest.length > 0) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
segments.splice(-2, 2);
|
|
39
|
+
url.pathname = segments.length > 0 ? `/${segments.join('/')}` : '/';
|
|
40
|
+
const workerBaseUrl = normalizeTrayWorkerBaseUrl(url.toString());
|
|
41
|
+
if (!workerBaseUrl) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return { workerBaseUrl, trayId, joinUrl: normalizedJoinUrl };
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function buildCanonicalTrayLaunchUrl(locationHref, trayValue) {
|
|
51
|
+
const url = new URL(locationHref);
|
|
52
|
+
url.searchParams.delete(TRAY_WORKER_QUERY_PARAM);
|
|
53
|
+
url.searchParams.delete(TRAY_LEGACY_LEAD_QUERY_PARAM);
|
|
54
|
+
url.searchParams.set(TRAY_QUERY_PARAM, trayValue);
|
|
55
|
+
return url.toString();
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./__vite-browser-external-D7Ct-6yo.js";import{g as r}from"./index-DvjzakYY.js";const a=r(e);export{a as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={},t=Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"}));export{t as _};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
3
|
+
* @license MIT
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
6
|
+
* @license MIT
|
|
7
|
+
*
|
|
8
|
+
* Originally forked from (with the author's permission):
|
|
9
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
10
|
+
* http://bellard.org/jslinux/
|
|
11
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
12
|
+
*/var p=2,c=1,d=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let i=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,s=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(s.getPropertyValue("height")),o=Math.max(0,parseInt(s.getPropertyValue("width"))),t=window.getComputedStyle(this._terminal.element),r={top:parseInt(t.getPropertyValue("padding-top")),bottom:parseInt(t.getPropertyValue("padding-bottom")),right:parseInt(t.getPropertyValue("padding-right")),left:parseInt(t.getPropertyValue("padding-left"))},a=r.top+r.bottom,n=r.right+r.left,h=l-a,m=o-n-i;return{cols:Math.max(p,Math.floor(m/e.css.cell.width)),rows:Math.max(c,Math.floor(h/e.css.cell.height))}}};export{d as FitAddon};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as u}from"./index-DvjzakYY.js";const l=["/workspace","/shared"];async function d(s){const t=[],e=new Set;for(const r of l)await s.exists(r)&&await p(s,r,t,e);return t}async function p(s,t,e,r){for await(const n of s.walk(t)){if(!n.endsWith(".bsh")||r.has(n))continue;r.add(n);const i=g(n);if(!i)continue;const a=await s.readFile(n,{encoding:"utf-8"}),c=typeof a=="string"?a:new TextDecoder().decode(a),f=m(c);e.push({path:n,hostnamePattern:i,matchPatterns:f})}}function g(s){const t=s.split("/").pop()??"";if(!t.endsWith(".bsh"))return null;const e=t.slice(0,-4);return e?e.startsWith("-.")?"*"+e.slice(1):e:null}function m(s){const t=s.split(`
|
|
2
|
+
`).slice(0,10),e=[];for(const r of t){const n=r.match(/^\s*\/\/\s*@match\s+(.+)$/);n&&e.push(n[1].trim())}return e}function h(s,t){if(t.startsWith("*.")){const e=t.slice(1);return s.endsWith(e)&&s.length>e.length}return s===t}function v(s,t){try{const e=new URL(s),r=t.match(/^(\*|https?):\/\/([^/]+)(\/.*)?$/);if(!r)return!1;const[,n,i,a]=r;return n!=="*"&&e.protocol.slice(0,-1)!==n||!h(e.hostname,i)?!1:a?x(e.pathname+e.search,a):!0}catch{return!1}}function x(s,t){const e="^"+t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(e).test(s)}function w(s,t){try{const e=new URL(t);return s.filter(r=>h(e.hostname,r.hostnamePattern)?r.matchPatterns.length>0?r.matchPatterns.some(n=>v(t,n)):!0:!1)}catch{return[]}}const o=u("bsh-watchdog");class S{transport;fs;execute;discoveryIntervalMs;entries=[];discoveryTimer=null;running=!1;executing=new Set;constructor(t){this.transport=t.transport,this.fs=t.fs,this.execute=t.execute,this.discoveryIntervalMs=t.discoveryIntervalMs??3e4}async start(){this.running||(this.running=!0,await this.discover(),this.discoveryTimer=setInterval(()=>{this.discover()},this.discoveryIntervalMs),this.transport.on("Page.frameNavigated",this.onFrameNavigated),o.info("BSH watchdog started",{scriptCount:this.entries.length}))}stop(){this.running&&(this.running=!1,this.transport.off("Page.frameNavigated",this.onFrameNavigated),this.discoveryTimer&&(clearInterval(this.discoveryTimer),this.discoveryTimer=null),this.entries=[],this.executing.clear(),o.info("BSH watchdog stopped"))}async discover(){try{this.entries=await d(this.fs),o.debug("BSH discovery complete",{count:this.entries.length})}catch(t){o.error("BSH discovery failed",{error:t instanceof Error?t.message:String(t)})}}getEntries(){return this.entries}onFrameNavigated=t=>{const e=t.frame;if(e?.parentId||!e?.url)return;const r=e.url;if(!r.startsWith("http://")&&!r.startsWith("https://")||this.entries.length===0)return;const n=w(this.entries,r);if(n.length!==0)for(const i of n){const a=`${i.path}::${r}`;this.executing.has(a)||(this.executing.add(a),o.info("BSH watchdog executing script",{script:i.path,url:r}),this.execute(i.path).then(c=>{c.exitCode!==0?o.warn("BSH script failed",{script:i.path,url:r,exitCode:c.exitCode,stderr:c.stderr.slice(0,200)}):o.info("BSH script completed",{script:i.path,url:r})}).catch(c=>{o.error("BSH script execution error",{script:i.path,url:r,error:c instanceof Error?c.message:String(c)})}).finally(()=>{this.executing.delete(a)}))}}}export{S as BshWatchdog};
|