perf(ci): share PR setup and stage platform release checks (#980)
This commit is contained in:
1 parent
f5e288ca01
commit
7c65518836
20 files changed
+2706
-1489
No files matched your search
+133
-42
@@ -1,6 +1,8 @@
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { appendFile, readFile } from 'node:fs/promises';
|
||||
import { appendFile } from 'node:fs/promises';
|
||||
import { isDeepStrictEqual } from 'node:util';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import { affectedTests, orderTests, readTimings } from './ci-tests.mjs';
|
||||
|
||||
const checks = [
|
||||
'types',
|
||||
@@ -17,7 +19,7 @@ const checks = [
|
||||
];
|
||||
const git = (...args) => execFileSync('git', args, { encoding: 'utf8' });
|
||||
|
||||
export function selectChecks(paths) {
|
||||
export function selectChecks(paths, event = 'workflow_dispatch') {
|
||||
const scope = Object.fromEntries(checks.map((name) => [name, false]));
|
||||
let testMode = 'changed';
|
||||
const testFiles = [];
|
||||
@@ -25,9 +27,9 @@ export function selectChecks(paths) {
|
||||
names.forEach((name) => {
|
||||
scope[name] = true;
|
||||
});
|
||||
const integration = () => {
|
||||
const integration = (mode = 'affected') => {
|
||||
enable('types', 'integration', 'evals');
|
||||
testMode = 'all';
|
||||
if (testMode !== 'all') testMode = mode;
|
||||
};
|
||||
const full = () => {
|
||||
enable(...checks);
|
||||
@@ -55,21 +57,29 @@ export function selectChecks(paths) {
|
||||
enable('types', 'build');
|
||||
if (!/\.(css|svg|png|jpe?g|webp|gif|woff2?|ico)$/.test(path)) {
|
||||
enable('integration');
|
||||
if (testMode !== 'all') testMode = 'web';
|
||||
testMode = 'all';
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (path.startsWith('public/') || /^(vite\.config\.ts|index\.html)$/.test(path)) {
|
||||
enable('build');
|
||||
if (path === 'vite.config.ts') enable('types');
|
||||
if (path === 'vite.config.ts') {
|
||||
integration('all');
|
||||
enable('types');
|
||||
}
|
||||
if (/\.(html|js)$/.test(path)) {
|
||||
enable('integration');
|
||||
if (testMode !== 'all') testMode = 'web';
|
||||
testMode = 'all';
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (path.startsWith('src/')) {
|
||||
integration();
|
||||
if (
|
||||
!/\.[cm]?[jt]sx?$/.test(path) ||
|
||||
/(?:^|[-_.])worker\.[cm]?[jt]sx?$/i.test(path.split('/').at(-1))
|
||||
)
|
||||
testMode = 'all';
|
||||
if (/^src\/(shared|ports)\//.test(path)) enable('build', 'desktop');
|
||||
if (/^src\/providers\/(docker|container-browser|agent-browser)\//.test(path))
|
||||
enable('images', 'desktop');
|
||||
@@ -93,14 +103,20 @@ export function selectChecks(paths) {
|
||||
continue;
|
||||
}
|
||||
if (path === 'tsconfig.json') {
|
||||
integration();
|
||||
integration('all');
|
||||
enable('build');
|
||||
continue;
|
||||
}
|
||||
if (path.startsWith('desktop/')) {
|
||||
enable('desktop');
|
||||
if (path.startsWith('desktop/ui/') || path === 'desktop/scripts/build-ui.mjs')
|
||||
enable('types', 'build');
|
||||
if (/^desktop\/(main|preload)\//.test(path)) {
|
||||
enable('integration');
|
||||
testMode = 'all';
|
||||
}
|
||||
if (path.startsWith('desktop/ui/') || path === 'desktop/scripts/build-ui.mjs') {
|
||||
enable('types', 'build', 'integration');
|
||||
testMode = 'all';
|
||||
}
|
||||
if (
|
||||
/^desktop\/(package\.json|pnpm-(lock|workspace)\.yaml|main\/(settings|mac-encryption|artifact-files|artifact-file-handlers|updates)\.mjs|scripts\/(check-native-updates|release-tools|patch-osx-sign|build-app|runtime-inputs)\.mjs)$/.test(
|
||||
path,
|
||||
@@ -135,16 +151,24 @@ export function selectChecks(paths) {
|
||||
}
|
||||
if (path.startsWith('deployment/self-host/') || /^(\.dockerignore|Dockerfile\.)/.test(path)) {
|
||||
enable('images', 'desktop');
|
||||
if (path.startsWith('deployment/self-host/')) {
|
||||
enable('integration');
|
||||
testMode = 'all';
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (path === 'scripts/Dockerfile.integration' || path === 'scripts/test-integration.mjs') {
|
||||
integration();
|
||||
integration('all');
|
||||
continue;
|
||||
}
|
||||
if (path === 'scripts/check-architecture.mjs') {
|
||||
enable('types');
|
||||
continue;
|
||||
}
|
||||
if (/^(\.oxlintrc\.json|bunfig\.toml)$/.test(path)) {
|
||||
enable('types', 'ci');
|
||||
continue;
|
||||
}
|
||||
if (/^scripts\/eval-rtk(?:-report)?\.(ts|mjs)$/.test(path)) {
|
||||
enable('images');
|
||||
continue;
|
||||
@@ -178,34 +202,54 @@ export function selectChecks(paths) {
|
||||
if (/^(\.gitignore|\.prettierignore|\.prettierrc(?:\.json)?)$/.test(path)) continue;
|
||||
full();
|
||||
}
|
||||
if (['pull_request', 'merge_group'].includes(event)) {
|
||||
scope.macos = false;
|
||||
scope.windows = false;
|
||||
scope.images = false;
|
||||
}
|
||||
return { ...scope, testMode, testFiles };
|
||||
}
|
||||
|
||||
export function requireChecks(needs) {
|
||||
if (needs.scope?.result !== 'success')
|
||||
throw new Error('CI could not select the required checks.');
|
||||
for (const name of checks) {
|
||||
if (!['true', 'false'].includes(needs.scope.outputs?.[name]))
|
||||
throw new Error(`The ${name} scope is missing or invalid.`);
|
||||
}
|
||||
for (const [name, job] of Object.entries(needs)) {
|
||||
if (!['success', 'skipped'].includes(job.result))
|
||||
throw new Error(`The ${name} check did not pass: ${job.result}.`);
|
||||
}
|
||||
for (const name of [
|
||||
'quality',
|
||||
'secrets',
|
||||
...checks.filter((name) => !['types', 'build', 'ci', 'network'].includes(name)),
|
||||
]) {
|
||||
const required = ['quality', 'secrets'].includes(name) || needs.scope.outputs[name] === 'true';
|
||||
if (required && needs[name]?.result !== 'success')
|
||||
throw new Error(`${name} check did not pass: ${needs[name]?.result ?? 'missing'}.`);
|
||||
}
|
||||
export function selectDesktopTests(paths, available) {
|
||||
const applicationOnly =
|
||||
paths !== null &&
|
||||
paths.every(
|
||||
(path) =>
|
||||
/^(src\/(web|shared|ports|server|runtime)\/|tests\/|docs\/|public\/|evals\/|desktop\/ui\/)/.test(
|
||||
path,
|
||||
) || /\.md$/.test(path),
|
||||
);
|
||||
return applicationOnly
|
||||
? available.filter((path) => !/\/(runtime-assets|linux-release)\.test\.mjs$/.test(path))
|
||||
: available;
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
if (process.argv.includes('--require-checks')) {
|
||||
requireChecks(JSON.parse(process.env.CI_NEEDS));
|
||||
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
||||
if (process.argv.includes('--format')) {
|
||||
const files = JSON.parse(process.env.NOD_FORMAT_FILES);
|
||||
if (files === null || files.length)
|
||||
execFileSync(
|
||||
'pnpm',
|
||||
['exec', 'prettier', '--check', '--ignore-unknown', '--', ...(files ?? ['.'])],
|
||||
{ stdio: 'inherit' },
|
||||
);
|
||||
} else if (process.argv.includes('--desktop-tests')) {
|
||||
execFileSync(
|
||||
process.execPath,
|
||||
[
|
||||
'--test',
|
||||
...(process.env.NOD_DESKTOP_RELEASE_ACCEPTANCE === 'false'
|
||||
? [
|
||||
'--test-skip-pattern',
|
||||
'^all four checked bundles publish together as one regular Nod release$',
|
||||
]
|
||||
: []),
|
||||
...JSON.parse(process.env.NOD_DESKTOP_TEST_FILES),
|
||||
],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
},
|
||||
);
|
||||
} else {
|
||||
let base = process.env.CI_DIFF_BASE;
|
||||
if (!base && process.env.GITHUB_REF === 'refs/heads/release/desktop')
|
||||
@@ -215,6 +259,7 @@ if (import.meta.main) {
|
||||
if (!/^[a-f0-9]{40}$/.test(base)) throw new Error('The CI base revision is invalid.');
|
||||
try {
|
||||
git('cat-file', '-e', `${base}^{commit}`);
|
||||
base = git('merge-base', base, 'HEAD').trim();
|
||||
paths = git('diff', '--name-only', '--no-renames', '-z', base, 'HEAD')
|
||||
.split('\0')
|
||||
.filter(Boolean);
|
||||
@@ -237,18 +282,64 @@ if (import.meta.main) {
|
||||
paths = paths.filter((path) => path !== 'desktop/package.json');
|
||||
}
|
||||
}
|
||||
const { testMode, testFiles, ...scope } = selectChecks(paths);
|
||||
const available = git('ls-files', '-z', '--', 'tests/*.test.ts').split('\0').filter(Boolean);
|
||||
let { testMode, testFiles, ...scope } = selectChecks(paths, process.env.GITHUB_EVENT_NAME);
|
||||
if (['push', 'merge_group'].includes(process.env.GITHUB_EVENT_NAME)) {
|
||||
scope.integration = true;
|
||||
testMode = 'all';
|
||||
}
|
||||
const tracked = git('ls-files', '-z').split('\0').filter(Boolean);
|
||||
const available = tracked.filter((path) => /^tests\/[^/]+\.test\.ts$/.test(path));
|
||||
const selected = new Set(testFiles.filter((path) => available.includes(path)));
|
||||
if (testMode === 'all') available.forEach((path) => selected.add(path));
|
||||
if (testMode === 'web') {
|
||||
for (const path of available)
|
||||
if (/src\/web\/|dist\/web|public\//.test(await readFile(path, 'utf8'))) selected.add(path);
|
||||
if (testMode === 'affected') {
|
||||
const incremental =
|
||||
!process.env.GITHUB_EVENT_NAME || process.env.GITHUB_EVENT_NAME === 'pull_request';
|
||||
let affected = available;
|
||||
if (incremental) {
|
||||
try {
|
||||
affected = affectedTests(base, available);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`${error.message}\nTest dependency selection failed. All integration test files will run.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
affected.forEach((path) => selected.add(path));
|
||||
}
|
||||
if (testMode === 'changed' && !selected.size) scope.integration = false;
|
||||
if (scope.integration && !selected.size)
|
||||
if (scope.integration && testMode === 'all' && !selected.size)
|
||||
throw new Error('No integration test files were selected.');
|
||||
const output = { ...scope, test_files: JSON.stringify([...selected].sort()) };
|
||||
if (!selected.size) scope.integration = false;
|
||||
const timings = process.env.CI_TEST_TIMINGS
|
||||
? await readTimings(process.env.CI_TEST_TIMINGS)
|
||||
: {};
|
||||
const selectedFiles = [...selected].sort();
|
||||
const formatAll =
|
||||
paths === null ||
|
||||
paths.some((path) => /^(\.prettier|package\.json$|pnpm-lock\.yaml$)/.test(path));
|
||||
const quality = ['format'];
|
||||
if (
|
||||
scope.types ||
|
||||
scope.ci ||
|
||||
paths === null ||
|
||||
paths.some((path) => /\.[cm]?[jt]sx?$|\.oxlintrc\.json$/.test(path))
|
||||
)
|
||||
quality.push('lint');
|
||||
if (scope.types) quality.push('types');
|
||||
if (scope.build) quality.push('build');
|
||||
const output = {
|
||||
...scope,
|
||||
test_files: JSON.stringify(await orderTests(selectedFiles, timings)),
|
||||
desktop_test_files: JSON.stringify(
|
||||
selectDesktopTests(
|
||||
paths,
|
||||
tracked.filter((path) => /^desktop\/test\/[^/]+\.test\.mjs$/.test(path)),
|
||||
),
|
||||
),
|
||||
quality_checks: JSON.stringify(quality),
|
||||
format_files: JSON.stringify(
|
||||
formatAll ? null : paths.filter((path) => tracked.includes(path)),
|
||||
),
|
||||
};
|
||||
if (process.env.GITHUB_OUTPUT)
|
||||
await appendFile(
|
||||
process.env.GITHUB_OUTPUT,
|
||||
|
||||
@@ -6,7 +6,17 @@ import { join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import test from 'node:test';
|
||||
import { parse } from 'yaml';
|
||||
import { requireChecks, selectChecks } from './ci-scope.mjs';
|
||||
import { selectChecks, selectDesktopTests } from './ci-scope.mjs';
|
||||
import { readTimings, orderTests } from './ci-tests.mjs';
|
||||
|
||||
const ciWorkflow = parse(await readFile(new URL('../workflows/ci.yml', import.meta.url), 'utf8'));
|
||||
const requireChecks = (needs) =>
|
||||
new Function(
|
||||
'process',
|
||||
ciWorkflow.jobs.checks.steps.find((step) => step.name === 'Require valid check selection').run,
|
||||
)({
|
||||
env: { CI_SCOPE_RESULT: needs.scope?.result, CI_SCOPE: JSON.stringify(needs.scope?.outputs) },
|
||||
});
|
||||
|
||||
const enabled = (paths) =>
|
||||
Object.entries(selectChecks(paths))
|
||||
@@ -18,7 +28,7 @@ test('text and media changes do not select application tests or native checks',
|
||||
assert.deepEqual(enabled(['README.md', 'AGENTS.md', 'docs/src/content/docs/use/chat.md']), []);
|
||||
assert.deepEqual(enabled(['public/logos/nod.svg', 'src/web/styles.css']), ['build', 'types']);
|
||||
assert.deepEqual(enabled(['src/web/components/message.tsx']), ['build', 'integration', 'types']);
|
||||
assert.equal(selectChecks(['src/web/components/message.tsx']).testMode, 'web');
|
||||
assert.equal(selectChecks(['src/web/components/message.tsx']).testMode, 'all');
|
||||
});
|
||||
|
||||
test('test-only changes select those files without image or platform checks', () => {
|
||||
@@ -29,9 +39,9 @@ test('test-only changes select those files without image or platform checks', ()
|
||||
assert.equal(selectChecks(['tests/fixtures/composio-defaults.mts']).testMode, 'all');
|
||||
});
|
||||
|
||||
test('server changes keep the full Linux suite without native checks', () => {
|
||||
test('server changes select affected Linux tests without native checks', () => {
|
||||
assert.deepEqual(enabled(['src/server/thread.ts']), ['evals', 'integration', 'types']);
|
||||
assert.equal(selectChecks(['src/server/thread.ts', 'tests/pi.test.ts']).testMode, 'all');
|
||||
assert.equal(selectChecks(['src/server/thread.ts', 'tests/pi.test.ts']).testMode, 'affected');
|
||||
assert.equal(selectChecks(['src/web/app.tsx', 'src/server/thread.ts']).testMode, 'all');
|
||||
assert.equal(selectChecks(['src/server/thread.ts', 'src/web/app.tsx']).testMode, 'all');
|
||||
});
|
||||
@@ -46,10 +56,48 @@ test('container and native checks follow their inputs', () => {
|
||||
assert.equal(selectChecks(['desktop/ui/setup.tsx']).macos, false);
|
||||
assert.equal(selectChecks(['desktop/runtime/index.mjs']).network, true);
|
||||
assert.equal(selectChecks(['desktop/runtime/index.mjs']).desktop, true);
|
||||
assert.equal(selectChecks(['desktop/runtime/index.mjs']).integration, false);
|
||||
for (const name of ['worker.ts', 'audio-codec-worker.ts', 'phonemizer-worker.ts'])
|
||||
assert.equal(selectChecks([`src/providers/synthetic/${name}`]).testMode, 'all');
|
||||
for (const name of ['workerpool.ts', 'workerless.ts', 'networkworker.ts'])
|
||||
assert.equal(selectChecks([`src/providers/synthetic/${name}`]).testMode, 'affected');
|
||||
assert.equal(selectChecks(['deployment/n8n/install.ps1']).windows, true);
|
||||
assert.deepEqual(enabled(['evals/src/cli.ts']), ['evals']);
|
||||
});
|
||||
|
||||
test('application changes do not select desktop release and runtime fixtures', () => {
|
||||
const files = [
|
||||
'desktop/test/settings.test.mjs',
|
||||
'desktop/test/notifications.test.mjs',
|
||||
'desktop/test/runtime-assets.test.mjs',
|
||||
'desktop/test/linux-release.test.mjs',
|
||||
];
|
||||
assert.deepEqual(
|
||||
selectDesktopTests(['src/shared/model.ts', 'tests/pi.test.ts'], files),
|
||||
files.slice(0, 2),
|
||||
);
|
||||
assert.deepEqual(
|
||||
selectDesktopTests(['src/web/app.tsx', 'src/shared/model.ts'], files),
|
||||
files.slice(0, 2),
|
||||
);
|
||||
for (const path of [
|
||||
'desktop/main/app.mjs',
|
||||
'desktop/preload/index.mjs',
|
||||
'deployment/self-host/docker-proxy.mjs',
|
||||
]) {
|
||||
assert.equal(selectChecks([path]).integration, true);
|
||||
assert.equal(selectChecks([path]).testMode, 'all');
|
||||
}
|
||||
for (const paths of [
|
||||
null,
|
||||
['desktop/runtime/index.mjs'],
|
||||
['src/providers/docker/index.ts'],
|
||||
['.github/workflows/ci.yml'],
|
||||
['package.json'],
|
||||
])
|
||||
assert.deepEqual(selectDesktopTests(paths, files), files);
|
||||
});
|
||||
|
||||
test('unknown inputs, dependency changes and CI selection changes run all checks', () => {
|
||||
const full = enabled(null);
|
||||
for (const path of [
|
||||
@@ -70,80 +118,152 @@ function results(paths) {
|
||||
.filter(([, value]) => typeof value === 'boolean')
|
||||
.map(([name, value]) => [name, String(value)]),
|
||||
);
|
||||
return {
|
||||
scope: { result: 'success', outputs },
|
||||
quality: { result: 'success' },
|
||||
secrets: { result: 'success' },
|
||||
...Object.fromEntries(
|
||||
['integration', 'desktop', 'macos', 'windows', 'n8n', 'evals', 'images'].map((name) => [
|
||||
name,
|
||||
{ result: scope[name] ? 'success' : 'skipped' },
|
||||
]),
|
||||
),
|
||||
};
|
||||
return { scope: { result: 'success', outputs } };
|
||||
}
|
||||
|
||||
test('the required result accepts only valid scopes and successful selected jobs', () => {
|
||||
test('the required result rejects failed selection and missing scope flags', () => {
|
||||
for (const paths of [[], ['src/web/app.tsx'], ['src/server/thread.ts'], null])
|
||||
assert.doesNotThrow(() => requireChecks(results(paths)));
|
||||
for (const name of [
|
||||
'scope',
|
||||
'quality',
|
||||
'secrets',
|
||||
'integration',
|
||||
'desktop',
|
||||
'macos',
|
||||
'windows',
|
||||
'n8n',
|
||||
'evals',
|
||||
'images',
|
||||
]) {
|
||||
for (const result of ['failure', 'cancelled', 'skipped']) {
|
||||
const needs = results(null);
|
||||
needs[name].result = result;
|
||||
assert.throws(() => requireChecks(needs), /did not pass|could not select/);
|
||||
}
|
||||
for (const result of ['failure', 'cancelled', 'skipped']) {
|
||||
const needs = results(null);
|
||||
delete needs[name];
|
||||
assert.throws(() => requireChecks(needs), /missing|could not select/);
|
||||
needs.scope.result = result;
|
||||
assert.throws(() => requireChecks(needs), /could not select/);
|
||||
}
|
||||
assert.throws(() => requireChecks({}), /could not select/);
|
||||
for (const name of enabled(null)) {
|
||||
const needs = results(null);
|
||||
delete needs.scope.outputs[name];
|
||||
assert.throws(() => requireChecks(needs), /scope is missing or invalid/);
|
||||
needs.scope.outputs[name] = 'invalid';
|
||||
assert.throws(() => requireChecks(needs), /scope is missing or invalid/);
|
||||
}
|
||||
const missing = results([]);
|
||||
delete missing.scope.outputs.windows;
|
||||
assert.throws(() => requireChecks(missing), /windows scope is missing/);
|
||||
});
|
||||
|
||||
test('every selected job is part of the required result and can run in parallel', async () => {
|
||||
const workflow = parse(await readFile(new URL('../workflows/ci.yml', import.meta.url), 'utf8'));
|
||||
const jobs = workflow.jobs;
|
||||
for (const name of [
|
||||
'quality',
|
||||
'secrets',
|
||||
'integration',
|
||||
'desktop',
|
||||
'macos',
|
||||
'windows',
|
||||
'n8n',
|
||||
'evals',
|
||||
'images',
|
||||
]) {
|
||||
assert.ok(jobs.checks.needs.includes(name), `${name} must be required.`);
|
||||
if (!['quality', 'secrets'].includes(name)) {
|
||||
assert.equal(jobs[name].needs, 'scope');
|
||||
assert.equal(jobs[name].if, `needs.scope.outputs.${name} == 'true'`);
|
||||
}
|
||||
test('PRs keep release acceptance off the merge path and retain it on main', () => {
|
||||
for (const event of ['pull_request', 'merge_group']) {
|
||||
const scope = selectChecks(null, event);
|
||||
assert.equal(scope.integration, true);
|
||||
assert.equal(scope.testMode, 'all');
|
||||
for (const name of ['macos', 'windows', 'images']) assert.equal(scope[name], false);
|
||||
}
|
||||
for (const event of ['push', 'schedule', 'workflow_dispatch'])
|
||||
for (const name of ['macos', 'windows', 'images'])
|
||||
assert.equal(selectChecks(null, event)[name], true);
|
||||
});
|
||||
|
||||
test('the shared runner and qualification jobs use the selected scope', async () => {
|
||||
const jobs = ciWorkflow.jobs;
|
||||
assert.equal(jobs.checks.name, 'Checks, tests and build');
|
||||
assert.equal(jobs.checks.needs, undefined);
|
||||
for (const name of ['macos', 'windows', 'images']) {
|
||||
assert.equal(jobs[name].needs, 'checks');
|
||||
assert.equal(jobs[name].if, `needs.checks.outputs.${name} == 'true'`);
|
||||
}
|
||||
for (const name of enabled(null))
|
||||
assert.equal(jobs.scope.outputs[name], '${{ steps.scope.outputs.' + name + ' }}');
|
||||
assert.equal(jobs.checks.name, 'Checks, tests and build');
|
||||
assert.ok(jobs.checks.if.includes('!cancelled()'));
|
||||
assert.ok(workflow.on.schedule.length);
|
||||
assert.ok(workflow.on.merge_group);
|
||||
assert.equal(jobs.checks.outputs[name], '${{ steps.scope.outputs.' + name + ' }}');
|
||||
assert.ok(ciWorkflow.on.schedule.length);
|
||||
assert.ok(ciWorkflow.on.merge_group);
|
||||
const bundle = parse(
|
||||
await readFile(new URL('../workflows/self-host-bundle.yml', import.meta.url), 'utf8'),
|
||||
);
|
||||
assert.equal(bundle.on.pull_request, undefined);
|
||||
const titles = parse(
|
||||
await readFile(new URL('../workflows/pr-title.yml', import.meta.url), 'utf8'),
|
||||
);
|
||||
assert.ok(titles.on.merge_group);
|
||||
});
|
||||
|
||||
test('shared checks start in parallel and preserve a failure from any command', async (t) => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'nod-ci-parallel-'));
|
||||
t.after(() => rm(root, { recursive: true, force: true }));
|
||||
const log = join(root, 'commands.log');
|
||||
const program = `#!${process.execPath}
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const label = path.basename(process.argv[1]) + ' ' + process.argv.slice(2).join(' ');
|
||||
const log = process.env.CI_COMMAND_LOG;
|
||||
const newline = String.fromCharCode(10);
|
||||
fs.appendFileSync(log, 'start ' + label + newline);
|
||||
const start = Date.now();
|
||||
const timer = setInterval(() => {
|
||||
const count = fs.readFileSync(log, 'utf8').split(newline).filter(line => line.startsWith('start ')).length;
|
||||
if (count < 8 && Date.now() - start < 5000) return;
|
||||
clearInterval(timer);
|
||||
fs.appendFileSync(log, 'end ' + label + newline);
|
||||
if (count < 8) process.exit(3);
|
||||
if (process.env.CI_FAIL_LINT === 'true' && process.argv.includes('lint')) {
|
||||
process.stderr.write('Synthetic lint failure.' + newline);
|
||||
process.exit(7);
|
||||
}
|
||||
}, 10);
|
||||
`;
|
||||
for (const name of ['node', 'pnpm', 'sudo'])
|
||||
await writeFile(join(root, name), program, { mode: 0o755 });
|
||||
const step = ciWorkflow.jobs.checks.steps.find(
|
||||
(step) => step.name === 'Run checks in parallel with shared setup',
|
||||
);
|
||||
const execute = (fail) =>
|
||||
execFileSync('bash', ['-e', '-o', 'pipefail', '-c', step.run], {
|
||||
encoding: 'utf8',
|
||||
timeout: 10_000,
|
||||
stdio: 'pipe',
|
||||
env: {
|
||||
...process.env,
|
||||
PATH: `${root}:${process.env.PATH}`,
|
||||
CI_COMMAND_LOG: log,
|
||||
CI_FAIL_LINT: String(fail),
|
||||
...Object.fromEntries(
|
||||
['LINT', 'TYPES', 'BUILD', 'INTEGRATION', 'DESKTOP', 'EVALS', 'N8N', 'NETWORK'].map(
|
||||
(name) => [`NOD_CHECK_${name}`, 'true'],
|
||||
),
|
||||
),
|
||||
},
|
||||
});
|
||||
await writeFile(log, '');
|
||||
execute(false);
|
||||
const lines = (await readFile(log, 'utf8')).trim().split(String.fromCharCode(10));
|
||||
assert.ok(lines.findIndex((line) => line.startsWith('end ')) >= 8);
|
||||
await writeFile(log, '');
|
||||
assert.throws(
|
||||
() => execute(true),
|
||||
(error) => error.status === 1 && error.stderr.includes('Synthetic lint failure.'),
|
||||
);
|
||||
});
|
||||
|
||||
test('release publication acceptance stays enabled outside PR checks', async (t) => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'nod-ci-release-stage-'));
|
||||
t.after(() => rm(root, { recursive: true, force: true }));
|
||||
const file = join(root, 'release.test.mjs');
|
||||
const marker = join(root, 'core-ran');
|
||||
await writeFile(
|
||||
file,
|
||||
`import test from 'node:test';
|
||||
import { writeFileSync } from 'node:fs';
|
||||
test('all four checked bundles publish together as one regular Nod release', () => { throw new Error('Synthetic release acceptance failure.'); });
|
||||
test('runtime isolation contract', () => writeFileSync(${JSON.stringify(marker)}, 'checked'));
|
||||
`,
|
||||
);
|
||||
const helper = fileURLToPath(new URL('./ci-scope.mjs', import.meta.url));
|
||||
const environment = { ...process.env };
|
||||
delete environment.NODE_TEST_CONTEXT;
|
||||
const execute = (release) =>
|
||||
execFileSync(process.execPath, [helper, '--desktop-tests'], {
|
||||
encoding: 'utf8',
|
||||
stdio: 'pipe',
|
||||
env: {
|
||||
...environment,
|
||||
NOD_DESKTOP_TEST_FILES: JSON.stringify([file]),
|
||||
NOD_DESKTOP_RELEASE_ACCEPTANCE: String(release),
|
||||
},
|
||||
});
|
||||
execute(false);
|
||||
assert.equal(await readFile(marker, 'utf8'), 'checked');
|
||||
assert.throws(
|
||||
() => execute(true),
|
||||
(error) => error.status !== 0 && error.stdout.includes('Synthetic release acceptance failure.'),
|
||||
);
|
||||
});
|
||||
|
||||
test('workflow queues use supported values and do not cancel queued releases', async () => {
|
||||
const directory = new URL('../workflows/', import.meta.url);
|
||||
for (const name of await readdir(directory)) {
|
||||
@@ -185,7 +305,7 @@ test('Git diffs handle renamed files, removed tests, release metadata and missin
|
||||
return git('rev-parse', 'HEAD');
|
||||
};
|
||||
const script = new URL('./ci-scope.mjs', import.meta.url);
|
||||
const run = (base) =>
|
||||
const run = (base, event = 'pull_request') =>
|
||||
JSON.parse(
|
||||
execFileSync(process.execPath, [fileURLToPath(script)], {
|
||||
cwd: root,
|
||||
@@ -194,6 +314,7 @@ test('Git diffs handle renamed files, removed tests, release metadata and missin
|
||||
env: {
|
||||
PATH: process.env.PATH,
|
||||
CI_DIFF_BASE: base,
|
||||
GITHUB_EVENT_NAME: event,
|
||||
GITHUB_OUTPUT: join(root, '.git', 'scope-output'),
|
||||
GITHUB_STEP_SUMMARY: join(root, '.git', 'scope-summary'),
|
||||
},
|
||||
@@ -215,6 +336,8 @@ test('Git diffs handle renamed files, removed tests, release metadata and missin
|
||||
await writeFile(join(root, 'README.md'), 'Changed text.\n');
|
||||
commit();
|
||||
assert.equal(run(base).integration, false);
|
||||
assert.equal(run(base, 'push').integration, true);
|
||||
assert.equal(run(base, 'merge_group').integration, true);
|
||||
await writeFile(join(root, 'tests/b.test.ts'), 'Changed test.\n');
|
||||
const testChange = commit();
|
||||
assert.deepEqual(JSON.parse(run(base).test_files), ['tests/b.test.ts']);
|
||||
@@ -237,9 +360,134 @@ test('Git diffs handle renamed files, removed tests, release metadata and missin
|
||||
await writeFile(join(root, 'tests/new.test.ts'), 'Synthetic new test.\n');
|
||||
commit();
|
||||
assert.deepEqual(JSON.parse(run(release).test_files), ['tests/a.test.ts', 'tests/new.test.ts']);
|
||||
assert.equal(run('').macos, true);
|
||||
assert.equal(run('0'.repeat(40)).macos, true);
|
||||
assert.equal(run('f'.repeat(40)).macos, true);
|
||||
assert.equal(run('').macos, false);
|
||||
assert.equal(run('', 'workflow_dispatch').macos, true);
|
||||
assert.equal(run('0'.repeat(40)).integration, true);
|
||||
assert.equal(run('f'.repeat(40)).integration, true);
|
||||
assert.throws(() => run('not-a-commit'), /base revision is invalid/);
|
||||
assert.match(await readFile(join(root, '.git', 'scope-summary'), 'utf8'), /Selected checks/);
|
||||
const beforeLock = git('rev-parse', 'HEAD');
|
||||
await writeFile(join(root, 'pnpm-lock.yaml'), 'synthetic: true\n');
|
||||
commit();
|
||||
assert.ok(JSON.parse(run(beforeLock).quality_checks).includes('lint'));
|
||||
});
|
||||
|
||||
test('slow test files start first and every selected file stays in the queue', async () => {
|
||||
const files = [
|
||||
'tests/slow.test.ts',
|
||||
'tests/medium.test.ts',
|
||||
'tests/short.test.ts',
|
||||
'tests/tiny.test.ts',
|
||||
];
|
||||
const times = Object.fromEntries(files.map((file, index) => [file, [90, 50, 30, 10][index]]));
|
||||
assert.deepEqual(await orderTests([...files].reverse(), times), files);
|
||||
assert.deepEqual(await orderTests([], {}), []);
|
||||
const cold = await orderTests(['tests/accounts.test.ts', 'tests/pi.test.ts']);
|
||||
assert.deepEqual(cold.sort(), ['tests/accounts.test.ts', 'tests/pi.test.ts']);
|
||||
});
|
||||
|
||||
test('new test times replace old values and keep files outside a partial run', async (t) => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'nod-ci-times-'));
|
||||
t.after(() => rm(root, { recursive: true, force: true }));
|
||||
const old = join(root, 'old');
|
||||
const latest = join(root, 'latest');
|
||||
await mkdir(old);
|
||||
await mkdir(latest);
|
||||
await writeFile(
|
||||
join(old, 'timings.json'),
|
||||
JSON.stringify({ 'tests/a.test.ts': 10, 'tests/b.test.ts': 20 }),
|
||||
);
|
||||
await writeFile(
|
||||
join(latest, '1.json'),
|
||||
JSON.stringify({
|
||||
'tests/a.test.ts': 5,
|
||||
'tests/c.test.ts': 30,
|
||||
'tests/bad.test.ts': -1,
|
||||
'unrelated.txt': 100,
|
||||
}),
|
||||
);
|
||||
assert.deepEqual(await readTimings(old, latest), {
|
||||
'tests/a.test.ts': 5,
|
||||
'tests/b.test.ts': 20,
|
||||
'tests/c.test.ts': 30,
|
||||
});
|
||||
assert.deepEqual(await readTimings(join(root, 'absent')), {});
|
||||
});
|
||||
|
||||
test('Vitest follows imports without running test files and reruns non-imported inputs', async (t) => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'nod-ci-related-'));
|
||||
t.after(() => rm(root, { recursive: true, force: true }));
|
||||
const git = (...args) => execFileSync('git', args, { cwd: root, encoding: 'utf8' }).trim();
|
||||
git('init', '--quiet', '--initial-branch=main');
|
||||
git('config', 'commit.gpgsign', 'false');
|
||||
git('config', 'core.hooksPath', '/dev/null');
|
||||
for (const directory of ['src', 'tests']) await mkdir(join(root, directory));
|
||||
await writeFile(join(root, 'src/leaf.ts'), 'export const value = 1;\n');
|
||||
await writeFile(join(root, 'src/route.ts'), "export { value } from './leaf';\n");
|
||||
await writeFile(join(root, 'src/other.ts'), 'export const value = 2;\n');
|
||||
await writeFile(
|
||||
join(root, 'tests/route.test.ts'),
|
||||
"import '../src/route';\nthrow new Error('Test selection must not execute this file.');\n",
|
||||
);
|
||||
await writeFile(
|
||||
join(root, 'tests/other.test.ts'),
|
||||
"import '../src/other';\nthrow new Error('Test selection must not execute this file.');\n",
|
||||
);
|
||||
git('add', '.');
|
||||
git(
|
||||
'-c',
|
||||
'user.name=Synthetic CI',
|
||||
'-c',
|
||||
'user.email=ci@example.test',
|
||||
'commit',
|
||||
'--quiet',
|
||||
'-m',
|
||||
'Synthetic base',
|
||||
);
|
||||
const base = git('rev-parse', 'HEAD');
|
||||
await writeFile(join(root, 'src/leaf.ts'), 'export const value = 3;\n');
|
||||
const helper = fileURLToPath(new URL('./ci-tests.mjs', import.meta.url));
|
||||
const files = ['tests/other.test.ts', 'tests/route.test.ts'];
|
||||
const select = () =>
|
||||
JSON.parse(
|
||||
execFileSync(
|
||||
process.execPath,
|
||||
[
|
||||
'--input-type=module',
|
||||
'-e',
|
||||
`import { affectedTests } from ${JSON.stringify('file://' + helper)}; console.log(JSON.stringify(affectedTests(${JSON.stringify(base)}, ${JSON.stringify(files)})));`,
|
||||
],
|
||||
{ cwd: root, encoding: 'utf8' },
|
||||
),
|
||||
);
|
||||
assert.deepEqual(select(), ['tests/route.test.ts']);
|
||||
await writeFile(join(root, 'pnpm-lock.yaml'), 'synthetic: true\n');
|
||||
assert.deepEqual(select().sort(), files);
|
||||
await rm(join(root, 'pnpm-lock.yaml'));
|
||||
for (const path of [
|
||||
'desktop/main/engine.mjs',
|
||||
'deployment/self-host/docker-proxy.mjs',
|
||||
'src/providers/synthetic/worker.ts',
|
||||
]) {
|
||||
await mkdir(join(root, path, '..'), { recursive: true });
|
||||
await writeFile(
|
||||
join(root, path),
|
||||
'throw new Error("This input must not execute during selection.");\n',
|
||||
);
|
||||
assert.deepEqual(select().sort(), files, path);
|
||||
await rm(join(root, path));
|
||||
}
|
||||
for (const path of [
|
||||
'desktop/runtime/index.mjs',
|
||||
'src/providers/synthetic/workerpool.ts',
|
||||
'src/providers/synthetic/workerless.ts',
|
||||
]) {
|
||||
await mkdir(join(root, path, '..'), { recursive: true });
|
||||
await writeFile(
|
||||
join(root, path),
|
||||
'throw new Error("This input must not execute during selection.");\n',
|
||||
);
|
||||
assert.deepEqual(select(), ['tests/route.test.ts'], path);
|
||||
await rm(join(root, path));
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { mkdir, readFile, readdir, stat, writeFile } from 'node:fs/promises';
|
||||
import { relative } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
export function affectedTests(base, available) {
|
||||
const cli = fileURLToPath(new URL('./vitest.mjs', import.meta.resolve('vitest/package.json')));
|
||||
const config = fileURLToPath(new URL('../vitest.config.mts', import.meta.url));
|
||||
const selected = JSON.parse(
|
||||
execFileSync(
|
||||
process.execPath,
|
||||
[cli, 'list', '--config', config, '--changed', base, '--filesOnly', '--json'],
|
||||
{ encoding: 'utf8', maxBuffer: 10 * 1024 * 1024 },
|
||||
),
|
||||
);
|
||||
if (!Array.isArray(selected) || selected.some((entry) => typeof entry.file !== 'string'))
|
||||
throw new Error('Vitest returned an invalid test file selection.');
|
||||
return selected
|
||||
.map(({ file }) => relative(process.cwd(), file))
|
||||
.filter((file) => available.includes(file));
|
||||
}
|
||||
|
||||
export async function orderTests(files, timings = {}) {
|
||||
if (!files.length) return [];
|
||||
const weighted = await Promise.all(
|
||||
files.map(async (file) => ({
|
||||
file,
|
||||
weight:
|
||||
Number.isFinite(timings[file]) && timings[file] > 0
|
||||
? timings[file]
|
||||
: Math.max(1000, (await stat(file)).size / 10),
|
||||
})),
|
||||
);
|
||||
weighted.sort((a, b) => b.weight - a.weight || a.file.localeCompare(b.file));
|
||||
return weighted.map(({ file }) => file);
|
||||
}
|
||||
|
||||
export async function readTimings(...directories) {
|
||||
const timings = {};
|
||||
for (const directory of directories) {
|
||||
for (const name of await readdir(directory).catch((error) => {
|
||||
if (error.code !== 'ENOENT') throw error;
|
||||
return [];
|
||||
})) {
|
||||
if (!name.endsWith('.json')) continue;
|
||||
const entries = JSON.parse(await readFile(`${directory}/${name}`, 'utf8'));
|
||||
for (const [file, time] of Object.entries(entries))
|
||||
if (/^tests\/[^/]+\.test\.ts$/.test(file) && Number.isFinite(time) && time > 0)
|
||||
timings[file] = time;
|
||||
}
|
||||
}
|
||||
return timings;
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
const directory = process.env.CI_TEST_TIMINGS;
|
||||
const timings = await readTimings(directory, process.env.CI_NEW_TEST_TIMINGS);
|
||||
await mkdir(directory, { recursive: true });
|
||||
await writeFile(`${directory}/timings.json`, JSON.stringify(timings));
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
include: ['tests/*.test.ts'],
|
||||
forceRerunTriggers: [
|
||||
'**/package.json',
|
||||
'**/*lock*',
|
||||
'**/tsconfig*.json',
|
||||
'**/{vitest,vite}.config.*',
|
||||
'**/pnpm-workspace.yaml',
|
||||
'**/.github/**',
|
||||
'**/scripts/**',
|
||||
'**/tests/fixtures/**',
|
||||
'**/tests/*fixture*',
|
||||
'**/src/runtime/skills/**',
|
||||
'**/src/**/*.json',
|
||||
'**/src/web/**',
|
||||
'**/desktop/ui/**',
|
||||
'**/desktop/main/**',
|
||||
'**/desktop/preload/**',
|
||||
'**/deployment/self-host/**',
|
||||
'**/src/providers/**/worker.*',
|
||||
'**/src/providers/**/*[-_.]worker.*',
|
||||
'**/desktop/scripts/build-ui.mjs',
|
||||
'**/public/**',
|
||||
'**/index.html',
|
||||
],
|
||||
},
|
||||
});
|
||||
+175
-220
@@ -18,40 +18,9 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
scope:
|
||||
name: Select checks for changed files
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
types: ${{ steps.scope.outputs.types }}
|
||||
build: ${{ steps.scope.outputs.build }}
|
||||
integration: ${{ steps.scope.outputs.integration }}
|
||||
desktop: ${{ steps.scope.outputs.desktop }}
|
||||
macos: ${{ steps.scope.outputs.macos }}
|
||||
windows: ${{ steps.scope.outputs.windows }}
|
||||
n8n: ${{ steps.scope.outputs.n8n }}
|
||||
evals: ${{ steps.scope.outputs.evals }}
|
||||
images: ${{ steps.scope.outputs.images }}
|
||||
network: ${{ steps.scope.outputs.network }}
|
||||
ci: ${{ steps.scope.outputs.ci }}
|
||||
test_files: ${{ steps.scope.outputs.test_files }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
|
||||
with:
|
||||
node-version: '24.21.0'
|
||||
- name: Read the changed paths
|
||||
id: scope
|
||||
env:
|
||||
CI_DIFF_BASE: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.event.before || '' }}
|
||||
run: node .github/scripts/ci-scope.mjs
|
||||
|
||||
notes:
|
||||
name: Delete Git notes
|
||||
needs: scope
|
||||
needs: checks
|
||||
if: ${{ !cancelled() && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
@@ -68,38 +37,164 @@ jobs:
|
||||
echo "Deleted $ref"
|
||||
done
|
||||
|
||||
quality:
|
||||
name: Formatting, types and client build
|
||||
needs: scope
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
timeout-minutes: 10
|
||||
checks:
|
||||
name: Checks, tests and build
|
||||
runs-on: blacksmith-16vcpu-ubuntu-2404
|
||||
timeout-minutes: 15
|
||||
outputs:
|
||||
types: ${{ steps.scope.outputs.types }}
|
||||
build: ${{ steps.scope.outputs.build }}
|
||||
integration: ${{ steps.scope.outputs.integration }}
|
||||
desktop: ${{ steps.scope.outputs.desktop }}
|
||||
macos: ${{ steps.scope.outputs.macos }}
|
||||
windows: ${{ steps.scope.outputs.windows }}
|
||||
n8n: ${{ steps.scope.outputs.n8n }}
|
||||
evals: ${{ steps.scope.outputs.evals }}
|
||||
images: ${{ steps.scope.outputs.images }}
|
||||
network: ${{ steps.scope.outputs.network }}
|
||||
ci: ${{ steps.scope.outputs.ci }}
|
||||
test_files: ${{ steps.scope.outputs.test_files }}
|
||||
desktop_test_files: ${{ steps.scope.outputs.desktop_test_files }}
|
||||
quality_checks: ${{ steps.scope.outputs.quality_checks }}
|
||||
format_files: ${{ steps.scope.outputs.format_files }}
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
env:
|
||||
POSTGRES_USER: nod
|
||||
POSTGRES_PASSWORD: nod-ci
|
||||
POSTGRES_DB: nod_ci
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -h 127.0.0.1 -U nod -d nod_ci"
|
||||
--health-interval 1s
|
||||
--health-timeout 5s
|
||||
--health-retries 30
|
||||
env:
|
||||
CI: 'true'
|
||||
TEST_DATABASE_URL: postgresql://nod:nod-ci@127.0.0.1:5432/nod_ci
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
fetch-depth: ${{ (github.head_ref == 'release/desktop' || github.ref == 'refs/heads/release/desktop') && '0' || '1' }}
|
||||
fetch-depth: ${{ (github.head_ref == 'release/desktop' || github.ref == 'refs/heads/release/desktop') && '0' || '2' }}
|
||||
persist-credentials: false
|
||||
- name: Install tooling and dependencies
|
||||
- name: Install tooling and dependencies once
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Check CI selection and required results
|
||||
run: node --test .github/scripts/ci-scope.test.mjs
|
||||
- name: Check formatting
|
||||
run: pnpm run format:check
|
||||
- name: Check types and import boundaries
|
||||
if: needs.scope.outputs.types == 'true'
|
||||
run: pnpm run lint
|
||||
- name: Build the web and desktop clients
|
||||
if: needs.scope.outputs.build == 'true'
|
||||
run: pnpm exec vite build && node desktop/scripts/build-ui.mjs
|
||||
- uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830
|
||||
with:
|
||||
path: .local/ci-test-timings
|
||||
key: ci-test-timings-v2-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
restore-keys: |
|
||||
ci-test-timings-v2-
|
||||
ci-test-timings-v1-
|
||||
- name: Select tests with the installed tools
|
||||
id: scope
|
||||
env:
|
||||
CI_DIFF_BASE: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.event.before || '' }}
|
||||
CI_TEST_TIMINGS: .local/ci-test-timings
|
||||
run: node .github/scripts/ci-scope.mjs
|
||||
- name: Require valid check selection
|
||||
shell: node {0}
|
||||
env:
|
||||
CI_SCOPE_RESULT: ${{ steps.scope.outcome }}
|
||||
CI_SCOPE: ${{ toJSON(steps.scope.outputs) }}
|
||||
run: |
|
||||
if (process.env.CI_SCOPE_RESULT !== 'success')
|
||||
throw new Error('CI could not select the required checks.');
|
||||
const scope = JSON.parse(process.env.CI_SCOPE);
|
||||
for (const name of ['types', 'build', 'integration', 'desktop', 'macos', 'windows', 'n8n', 'evals', 'images', 'network', 'ci']) {
|
||||
if (!['true', 'false'].includes(scope[name]))
|
||||
throw new Error(`The ${name} scope is missing or invalid.`);
|
||||
}
|
||||
- name: Prepare the browser fixture without building an image
|
||||
if: steps.scope.outputs.integration == 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
missing=()
|
||||
for program in Xvfb xauth xdotool ffmpeg; do
|
||||
command -v "$program" >/dev/null || missing+=("${program,,}")
|
||||
done
|
||||
if (( ${#missing[@]} )); then
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install --yes --no-install-recommends "${missing[@]}"
|
||||
fi
|
||||
if ! command -v chromium >/dev/null; then
|
||||
chrome="$(command -v google-chrome || command -v google-chrome-stable)"
|
||||
sudo ln -s "$chrome" /usr/bin/chromium
|
||||
fi
|
||||
sudo ln -s "$PWD" /app
|
||||
mkdir -p "$RUNNER_TEMP/integration-timings"
|
||||
- name: Install desktop tooling without downloading Electron
|
||||
if: steps.scope.outputs.desktop == 'true'
|
||||
env:
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
|
||||
run: pnpm --dir desktop install --frozen-lockfile
|
||||
- name: Run checks in parallel with shared setup
|
||||
shell: bash
|
||||
env:
|
||||
NOD_FORMAT_FILES: ${{ steps.scope.outputs.format_files }}
|
||||
NOD_CHECK_LINT: ${{ contains(fromJSON(steps.scope.outputs.quality_checks), 'lint') }}
|
||||
NOD_CHECK_TYPES: ${{ steps.scope.outputs.types }}
|
||||
NOD_CHECK_BUILD: ${{ steps.scope.outputs.build }}
|
||||
NOD_CHECK_INTEGRATION: ${{ steps.scope.outputs.integration }}
|
||||
NOD_CHECK_DESKTOP: ${{ steps.scope.outputs.desktop }}
|
||||
NOD_CHECK_EVALS: ${{ steps.scope.outputs.evals }}
|
||||
NOD_CHECK_N8N: ${{ steps.scope.outputs.n8n }}
|
||||
NOD_CHECK_NETWORK: ${{ steps.scope.outputs.network }}
|
||||
NOD_TEST_FILES: ${{ steps.scope.outputs.test_files }}
|
||||
NOD_DESKTOP_TEST_FILES: ${{ steps.scope.outputs.desktop_test_files }}
|
||||
NOD_TEST_TIMINGS: ${{ runner.temp }}/integration-timings/1.json
|
||||
NOD_TEST_NATIVE_DOWNLOAD: 'true'
|
||||
NOD_TEST_BROWSER_EXECUTABLE: /usr/bin/chromium
|
||||
NOD_DESKTOP_RELEASE_ACCEPTANCE: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
|
||||
run: |
|
||||
pids=()
|
||||
(node --test .github/scripts/ci-scope.test.mjs && node .github/scripts/ci-scope.mjs --format) &
|
||||
pids+=("$!")
|
||||
if [[ "$NOD_CHECK_LINT" == true ]]; then
|
||||
pnpm run lint &
|
||||
pids+=("$!")
|
||||
fi
|
||||
if [[ "$NOD_CHECK_TYPES" == true ]]; then
|
||||
pnpm run typecheck &
|
||||
pids+=("$!")
|
||||
fi
|
||||
if [[ "$NOD_CHECK_BUILD" == true || "$NOD_CHECK_INTEGRATION" == true ]]; then
|
||||
(pnpm exec vite build && node desktop/scripts/build-ui.mjs &&
|
||||
if [[ "$NOD_CHECK_INTEGRATION" == true ]]; then node scripts/test-integration.mjs --run; fi) &
|
||||
pids+=("$!")
|
||||
fi
|
||||
if [[ "$NOD_CHECK_DESKTOP" == true ]]; then
|
||||
node .github/scripts/ci-scope.mjs --desktop-tests &
|
||||
pids+=("$!")
|
||||
fi
|
||||
if [[ "$NOD_CHECK_EVALS" == true ]]; then
|
||||
(pnpm --dir evals run check && pnpm --dir evals test) &
|
||||
pids+=("$!")
|
||||
fi
|
||||
if [[ "$NOD_CHECK_N8N" == true ]]; then
|
||||
node --test deployment/n8n/*.test.mjs &
|
||||
pids+=("$!")
|
||||
fi
|
||||
if [[ "$NOD_CHECK_NETWORK" == true ]]; then
|
||||
sudo env NOD_TEST_RUNTIME_NETWORK=1 "$(command -v node)" --test --test-name-pattern='workload firewall refresh' desktop/test/runtime-assets.test.mjs &
|
||||
pids+=("$!")
|
||||
fi
|
||||
status=0
|
||||
for pid in "${pids[@]}"; do
|
||||
wait "$pid" || status=1
|
||||
done
|
||||
exit "$status"
|
||||
- name: Check the release version and source
|
||||
if: >-
|
||||
(github.event_name == 'pull_request' &&
|
||||
github.head_ref == 'release/desktop' &&
|
||||
github.event.pull_request.head.repo.full_name == github.repository) ||
|
||||
(github.event_name == 'pull_request' && github.head_ref == 'release/desktop' &&
|
||||
github.event.pull_request.head.repo.full_name == github.repository) ||
|
||||
github.ref == 'refs/heads/release/desktop'
|
||||
run: node .github/scripts/prepare-desktop-release.mjs --check
|
||||
- name: Install verified actionlint 1.7.12
|
||||
if: needs.scope.outputs.ci == 'true'
|
||||
- name: Check workflow syntax and expressions
|
||||
if: steps.scope.outputs.ci == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
@@ -107,154 +202,32 @@ jobs:
|
||||
gh release download v1.7.12 --repo rhysd/actionlint --pattern actionlint_1.7.12_linux_amd64.tar.gz --output "$RUNNER_TEMP/actionlint.tar.gz"
|
||||
printf '%s %s\n' '8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8' "$RUNNER_TEMP/actionlint.tar.gz" | sha256sum --check --status
|
||||
tar --extract --gzip --file "$RUNNER_TEMP/actionlint.tar.gz" --directory "$RUNNER_TEMP/actionlint" actionlint
|
||||
- name: Check workflow syntax and expressions
|
||||
if: needs.scope.outputs.ci == 'true'
|
||||
run: >-
|
||||
"$RUNNER_TEMP/actionlint/actionlint" -shellcheck= -pyflakes=
|
||||
-ignore 'label "blacksmith-.*" is unknown'
|
||||
-ignore 'unexpected key "queue" for "concurrency" section'
|
||||
|
||||
integration:
|
||||
name: Linux integration tests
|
||||
needs: scope
|
||||
if: needs.scope.outputs.integration == 'true'
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
timeout-minutes: 20
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
"$RUNNER_TEMP/actionlint/actionlint" -shellcheck= -pyflakes= -ignore 'label "blacksmith-.*" is unknown' -ignore 'unexpected key "queue" for "concurrency" section'
|
||||
- name: Save test file times
|
||||
if: always() && steps.scope.outputs.integration == 'true'
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
|
||||
with:
|
||||
name: integration-timings-1
|
||||
path: ${{ runner.temp }}/integration-timings/*.json
|
||||
if-no-files-found: ignore
|
||||
retention-days: 7
|
||||
- name: Merge test file times
|
||||
if: success() && steps.scope.outputs.integration == 'true'
|
||||
env:
|
||||
POSTGRES_USER: nod
|
||||
POSTGRES_PASSWORD: nod-ci
|
||||
POSTGRES_DB: nod_ci
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -h 127.0.0.1 -U nod -d nod_ci"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 12
|
||||
env:
|
||||
CI: 'true'
|
||||
TEST_DATABASE_URL: postgresql://nod:nod-ci@127.0.0.1:5432/nod_ci
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
CI_TEST_TIMINGS: .local/ci-test-timings
|
||||
CI_NEW_TEST_TIMINGS: ${{ runner.temp }}/integration-timings
|
||||
run: node .github/scripts/ci-tests.mjs
|
||||
- name: Cache test times for later runs
|
||||
if: success() && steps.scope.outputs.integration == 'true'
|
||||
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up the integration image cache
|
||||
uses: useblacksmith/setup-docker-builder@06dd9c83a5d541274d2e3ac67625560979275267
|
||||
with:
|
||||
cache-key: n8n-io/nod/ci-integration
|
||||
- name: Build the integration fixture
|
||||
run: docker buildx build --load --platform linux/amd64 --file scripts/Dockerfile.integration --tag nod-ci-integration .
|
||||
- name: Build the web fixture and run the selected tests
|
||||
env:
|
||||
NOD_TEST_FILES: ${{ needs.scope.outputs.test_files }}
|
||||
run: >-
|
||||
docker run --rm --network host --shm-size=1g
|
||||
--env TEST_DATABASE_URL
|
||||
--env NOD_TEST_FILES
|
||||
--env NOD_TEST_NATIVE_DOWNLOAD=true
|
||||
--env NOD_TEST_BROWSER_EXECUTABLE=/usr/bin/chromium
|
||||
--volume "$PWD/src:/app/src:ro"
|
||||
--volume "$PWD/tests:/app/tests:ro"
|
||||
--volume "$PWD/scripts:/app/scripts:ro"
|
||||
--volume "$PWD/public:/app/public:ro"
|
||||
--volume "$PWD/desktop/main:/app/desktop/main:ro"
|
||||
--volume "$PWD/desktop/preload:/app/desktop/preload:ro"
|
||||
--volume "$PWD/desktop/ui:/app/desktop/ui:ro"
|
||||
--volume "$PWD/deployment/self-host:/app/deployment/self-host:ro"
|
||||
--volume "$PWD/tsconfig.json:/app/tsconfig.json:ro"
|
||||
--volume "$PWD/vite.config.ts:/app/vite.config.ts:ro"
|
||||
--volume "$PWD/index.html:/app/index.html:ro"
|
||||
--tmpfs /app/.local:uid=1000,gid=1000
|
||||
--tmpfs /app/dist:uid=1000,gid=1000
|
||||
--tmpfs /app/node_modules/.vite-temp:uid=1000,gid=1000
|
||||
--init --entrypoint sh nod-ci-integration
|
||||
-c 'node_modules/.bin/vite build && node scripts/test-integration.mjs --run'
|
||||
|
||||
desktop:
|
||||
name: Desktop contracts and network isolation
|
||||
needs: scope
|
||||
if: needs.scope.outputs.desktop == 'true'
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install tooling and dependencies
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install desktop tooling without downloading Electron
|
||||
env:
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
|
||||
run: pnpm --dir desktop install --frozen-lockfile
|
||||
- name: Check desktop lifecycle, storage and release contracts
|
||||
run: pnpm run desktop:test
|
||||
- name: Check desktop network isolation during restart
|
||||
if: needs.scope.outputs.network == 'true'
|
||||
run: >-
|
||||
sudo env NOD_TEST_RUNTIME_NETWORK=1 "$(command -v node)"
|
||||
--test --test-name-pattern='workload firewall refresh'
|
||||
desktop/test/runtime-assets.test.mjs
|
||||
|
||||
evals:
|
||||
name: Eval harness contracts
|
||||
needs: scope
|
||||
if: needs.scope.outputs.evals == 'true'
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
timeout-minutes: 10
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
env:
|
||||
POSTGRES_USER: nod
|
||||
POSTGRES_PASSWORD: nod-ci
|
||||
POSTGRES_DB: nod_ci
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -h 127.0.0.1 -U nod -d nod_ci"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 12
|
||||
env:
|
||||
CI: 'true'
|
||||
TEST_DATABASE_URL: postgresql://nod:nod-ci@127.0.0.1:5432/nod_ci
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install tooling and dependencies
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Check the eval harness with disposable schemas
|
||||
run: |
|
||||
pnpm --dir evals run check
|
||||
pnpm --dir evals test
|
||||
|
||||
n8n:
|
||||
name: n8n delivery contracts
|
||||
needs: scope
|
||||
if: needs.scope.outputs.n8n == 'true'
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install tooling and dependencies
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Check n8n delivery contracts
|
||||
run: node --test deployment/n8n/*.test.mjs
|
||||
path: .local/ci-test-timings
|
||||
key: ci-test-timings-v2-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
|
||||
images:
|
||||
name: Container and self-host checks
|
||||
needs: scope
|
||||
if: needs.scope.outputs.images == 'true'
|
||||
needs: checks
|
||||
if: needs.checks.outputs.images == 'true'
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
timeout-minutes: 25
|
||||
steps:
|
||||
@@ -276,7 +249,7 @@ jobs:
|
||||
docker tag nod-ci-browser nod-browser:ci
|
||||
docker tag nod-ci-workspace nod-workspace:ci
|
||||
- name: Check workspace egress and command recovery in the workspace image
|
||||
if: needs.scope.outputs.images == 'true'
|
||||
if: needs.checks.outputs.images == 'true'
|
||||
env:
|
||||
NOD_TEST_WORKSPACE_IMAGE: nod-ci-workspace
|
||||
run: pnpm exec tsx --test --test-name-pattern='workspace egress|fully detached' tests/sandbox.test.ts
|
||||
@@ -289,28 +262,10 @@ jobs:
|
||||
- name: Verify automatic RTK savings and unfiltered exports
|
||||
run: node --import tsx scripts/eval-rtk.ts --smoke --image nod-ci-workspace
|
||||
|
||||
checks:
|
||||
name: Checks, tests and build
|
||||
needs: [scope, quality, integration, desktop, macos, windows, n8n, evals, images, secrets]
|
||||
if: ${{ !cancelled() }}
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
|
||||
with:
|
||||
node-version: '24.21.0'
|
||||
- name: Require every selected check to pass
|
||||
env:
|
||||
CI_NEEDS: ${{ toJSON(needs) }}
|
||||
run: node .github/scripts/ci-scope.mjs --require-checks
|
||||
|
||||
macos:
|
||||
name: macOS native identity and updates (${{ matrix.arch }})
|
||||
needs: scope
|
||||
if: needs.scope.outputs.macos == 'true'
|
||||
needs: checks
|
||||
if: needs.checks.outputs.macos == 'true'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -349,8 +304,8 @@ jobs:
|
||||
|
||||
windows:
|
||||
name: Windows setup and installer
|
||||
needs: scope
|
||||
if: needs.scope.outputs.windows == 'true'
|
||||
needs: checks
|
||||
if: needs.checks.outputs.windows == 'true'
|
||||
runs-on: windows-2025
|
||||
timeout-minutes: 35
|
||||
env:
|
||||
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
codeql:
|
||||
name: CodeQL (${{ matrix.language }})
|
||||
if: ${{ !github.event.repository.private || vars.NOD_PRIVATE_CODEQL == 'true' }}
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ${{ matrix.language == 'javascript-typescript' && 'blacksmith-16vcpu-ubuntu-2404' || 'blacksmith-4vcpu-ubuntu-2404' }}
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -27,31 +27,6 @@ on:
|
||||
- 'src/providers/process.ts'
|
||||
- 'src/shared/**'
|
||||
- 'src/ports/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/self-host-bundle.yml'
|
||||
- '.github/scripts/server-release.mjs'
|
||||
- 'desktop/scripts/release-tools.mjs'
|
||||
- 'desktop/scripts/runtime-inputs.mjs'
|
||||
- 'desktop/scripts/runtime-build-lock.json'
|
||||
- 'desktop/test/runtime-assets.test.mjs'
|
||||
- 'deployment/self-host/**'
|
||||
- 'docs/src/content/docs/**'
|
||||
- 'Dockerfile.browser'
|
||||
- 'Dockerfile.workspace'
|
||||
- '.dockerignore'
|
||||
- 'package.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- 'tsconfig.json'
|
||||
- 'vite.config.ts'
|
||||
- 'patches/**'
|
||||
- 'src/providers/docker/**'
|
||||
- 'src/providers/container-browser/**'
|
||||
- 'src/providers/agent-browser/**'
|
||||
- 'src/providers/process.ts'
|
||||
- 'src/shared/**'
|
||||
- 'src/ports/**'
|
||||
schedule:
|
||||
- cron: '47 4 * * 0'
|
||||
workflow_dispatch:
|
||||
|
||||
+295
@@ -0,0 +1,295 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"plugins": [
|
||||
"unicorn",
|
||||
"typescript",
|
||||
"oxc",
|
||||
"react",
|
||||
"react-perf",
|
||||
"jsx-a11y",
|
||||
"import",
|
||||
"promise",
|
||||
"node"
|
||||
],
|
||||
"categories": {
|
||||
"correctness": "error",
|
||||
"suspicious": "error",
|
||||
"pedantic": "error",
|
||||
"perf": "error",
|
||||
"style": "error",
|
||||
"restriction": "error"
|
||||
},
|
||||
"rules": {
|
||||
"array-callback-return": "off",
|
||||
"arrow-body-style": "off",
|
||||
"class-methods-use-this": "off",
|
||||
"complexity": "off",
|
||||
"curly": "off",
|
||||
"default-case": "off",
|
||||
"default-param-last": "off",
|
||||
"eqeqeq": "off",
|
||||
"func-name-matching": "off",
|
||||
"func-names": "off",
|
||||
"func-style": "off",
|
||||
"guard-for-in": "off",
|
||||
"id-length": "off",
|
||||
"init-declarations": "off",
|
||||
"logical-assignment-operators": "off",
|
||||
"max-classes-per-file": "off",
|
||||
"max-depth": "off",
|
||||
"max-lines": "off",
|
||||
"max-lines-per-function": "off",
|
||||
"max-params": "off",
|
||||
"max-statements": "off",
|
||||
"new-cap": "off",
|
||||
"no-await-in-loop": "off",
|
||||
"no-bitwise": "off",
|
||||
"no-console": "off",
|
||||
"no-continue": "off",
|
||||
"no-control-regex": "off",
|
||||
"no-div-regex": "off",
|
||||
"no-duplicate-imports": "off",
|
||||
"no-empty": "off",
|
||||
"no-empty-function": "off",
|
||||
"no-eq-null": "off",
|
||||
"no-implicit-coercion": "off",
|
||||
"no-inner-declarations": "off",
|
||||
"no-lone-blocks": "off",
|
||||
"no-loop-func": "off",
|
||||
"no-magic-numbers": "off",
|
||||
"no-misleading-character-class": "off",
|
||||
"no-multi-assign": "off",
|
||||
"no-negated-condition": "off",
|
||||
"no-nested-ternary": "off",
|
||||
"no-new": "off",
|
||||
"no-new-func": "off",
|
||||
"no-param-reassign": "off",
|
||||
"no-plusplus": "off",
|
||||
"no-promise-executor-return": "off",
|
||||
"no-regex-spaces": "off",
|
||||
"no-script-url": "off",
|
||||
"no-sequences": "off",
|
||||
"no-shadow": "off",
|
||||
"no-template-curly-in-string": "off",
|
||||
"no-ternary": "off",
|
||||
"no-unassigned-vars": "off",
|
||||
"no-undefined": "off",
|
||||
"no-underscore-dangle": "off",
|
||||
"no-unexpected-multiline": "off",
|
||||
"no-unmodified-loop-condition": "off",
|
||||
"no-unsafe-finally": "off",
|
||||
"no-unused-expressions": "off",
|
||||
"no-unused-vars": "off",
|
||||
"no-use-before-define": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-useless-return": "off",
|
||||
"no-void": "off",
|
||||
"object-shorthand": "off",
|
||||
"one-var": "off",
|
||||
"operator-assignment": "off",
|
||||
"prefer-arrow-callback": "off",
|
||||
"prefer-const": "off",
|
||||
"prefer-destructuring": "off",
|
||||
"prefer-named-capture-group": "off",
|
||||
"prefer-object-spread": "off",
|
||||
"prefer-regex-literals": "off",
|
||||
"prefer-template": "off",
|
||||
"preserve-caught-error": "off",
|
||||
"require-await": "off",
|
||||
"require-unicode-regexp": "off",
|
||||
"require-yield": "off",
|
||||
"sort-imports": "off",
|
||||
"sort-keys": "off",
|
||||
"sort-vars": "off",
|
||||
"import/consistent-type-specifier-style": "off",
|
||||
"import/exports-last": "off",
|
||||
"import/first": "off",
|
||||
"import/group-exports": "off",
|
||||
"import/max-dependencies": "off",
|
||||
"import/newline-after-import": "off",
|
||||
"import/no-anonymous-default-export": "off",
|
||||
"import/no-commonjs": "off",
|
||||
"import/no-cycle": "off",
|
||||
"import/no-default-export": "off",
|
||||
"import/no-duplicates": "off",
|
||||
"import/no-named-as-default": "off",
|
||||
"import/no-named-as-default-member": "off",
|
||||
"import/no-named-export": "off",
|
||||
"import/no-namespace": "off",
|
||||
"import/no-nodejs-modules": "off",
|
||||
"import/no-relative-parent-imports": "off",
|
||||
"import/no-unassigned-import": "off",
|
||||
"import/prefer-default-export": "off",
|
||||
"import/unambiguous": "off",
|
||||
"jsx-a11y/click-events-have-key-events": "off",
|
||||
"jsx-a11y/control-has-associated-label": "off",
|
||||
"jsx-a11y/interactive-supports-focus": "off",
|
||||
"jsx-a11y/label-has-associated-control": "off",
|
||||
"jsx-a11y/media-has-caption": "off",
|
||||
"jsx-a11y/no-autofocus": "off",
|
||||
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
||||
"jsx-a11y/no-noninteractive-tabindex": "off",
|
||||
"jsx-a11y/no-redundant-roles": "off",
|
||||
"jsx-a11y/no-static-element-interactions": "off",
|
||||
"jsx-a11y/prefer-tag-over-role": "off",
|
||||
"node/callback-return": "off",
|
||||
"node/no-process-env": "off",
|
||||
"node/no-sync": "off",
|
||||
"node/no-top-level-await": "off",
|
||||
"oxc/approx-constant": "off",
|
||||
"oxc/no-async-await": "off",
|
||||
"oxc/no-async-endpoint-handlers": "off",
|
||||
"oxc/no-map-spread": "off",
|
||||
"oxc/no-optional-chaining": "off",
|
||||
"oxc/no-rest-spread-properties": "off",
|
||||
"promise/always-return": "off",
|
||||
"promise/avoid-new": "off",
|
||||
"promise/catch-or-return": "off",
|
||||
"promise/no-callback-in-promise": "off",
|
||||
"promise/no-multiple-resolved": "off",
|
||||
"promise/no-nesting": "off",
|
||||
"promise/no-promise-in-callback": "off",
|
||||
"promise/param-names": "off",
|
||||
"promise/prefer-await-to-callbacks": "off",
|
||||
"promise/prefer-await-to-then": "off",
|
||||
"promise/prefer-catch": "off",
|
||||
"react/button-has-type": "off",
|
||||
"react/exhaustive-effect-dependencies": "off",
|
||||
"react/forbid-component-props": "off",
|
||||
"react/function-component-definition": "off",
|
||||
"react/globals": "off",
|
||||
"react/hook-use-state": "off",
|
||||
"react/iframe-missing-sandbox": "off",
|
||||
"react/immutability": "off",
|
||||
"react/jsx-filename-extension": "off",
|
||||
"react/jsx-handler-names": "off",
|
||||
"react/jsx-key": "off",
|
||||
"react/jsx-max-depth": "off",
|
||||
"react/jsx-no-constructed-context-values": "off",
|
||||
"react/jsx-no-literals": "off",
|
||||
"react/jsx-no-target-blank": "off",
|
||||
"react/jsx-no-useless-fragment": "off",
|
||||
"react/jsx-props-no-spreading": "off",
|
||||
"react/memo-dependencies": "off",
|
||||
"react/no-array-index-key": "off",
|
||||
"react/no-children-prop": "off",
|
||||
"react/no-clone-element": "off",
|
||||
"react/no-multi-comp": "off",
|
||||
"react/no-object-type-as-default-prop": "off",
|
||||
"react/no-react-children": "off",
|
||||
"react/no-set-state": "off",
|
||||
"react/no-unescaped-entities": "off",
|
||||
"react/no-unstable-nested-components": "off",
|
||||
"react/only-export-components": "off",
|
||||
"react/purity": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/refs": "off",
|
||||
"react/self-closing-comp": "off",
|
||||
"react/set-state-in-effect": "off",
|
||||
"react/state-in-constructor": "off",
|
||||
"react/todo": "off",
|
||||
"react/use-memo": "off",
|
||||
"react/exhaustive-deps": "off",
|
||||
"react/rules-of-hooks": "off",
|
||||
"react-perf/jsx-no-jsx-as-prop": "off",
|
||||
"react-perf/jsx-no-new-array-as-prop": "off",
|
||||
"react-perf/jsx-no-new-function-as-prop": "off",
|
||||
"react-perf/jsx-no-new-object-as-prop": "off",
|
||||
"typescript/array-type": "off",
|
||||
"typescript/ban-types": "off",
|
||||
"typescript/consistent-type-definitions": "off",
|
||||
"typescript/consistent-type-imports": "off",
|
||||
"typescript/explicit-function-return-type": "off",
|
||||
"typescript/explicit-member-accessibility": "off",
|
||||
"typescript/explicit-module-boundary-types": "off",
|
||||
"typescript/method-signature-style": "off",
|
||||
"typescript/no-dynamic-delete": "off",
|
||||
"typescript/no-explicit-any": "off",
|
||||
"typescript/no-import-type-side-effects": "off",
|
||||
"typescript/no-invalid-void-type": "off",
|
||||
"typescript/no-non-null-assertion": "off",
|
||||
"typescript/no-require-imports": "off",
|
||||
"typescript/no-unsafe-function-type": "off",
|
||||
"typescript/no-var-requires": "off",
|
||||
"typescript/parameter-properties": "off",
|
||||
"unicorn/catch-error-name": "off",
|
||||
"unicorn/consistent-assert": "off",
|
||||
"unicorn/consistent-existence-index-check": "off",
|
||||
"unicorn/consistent-function-scoping": "off",
|
||||
"unicorn/custom-error-definition": "off",
|
||||
"unicorn/empty-brace-spaces": "off",
|
||||
"unicorn/error-message": "off",
|
||||
"unicorn/escape-case": "off",
|
||||
"unicorn/explicit-length-check": "off",
|
||||
"unicorn/explicit-timer-delay": "off",
|
||||
"unicorn/import-style": "off",
|
||||
"unicorn/max-nested-calls": "off",
|
||||
"unicorn/new-for-builtins": "off",
|
||||
"unicorn/no-array-callback-reference": "off",
|
||||
"unicorn/no-array-fill-with-reference-type": "off",
|
||||
"unicorn/no-array-for-each": "off",
|
||||
"unicorn/no-array-method-this-argument": "off",
|
||||
"unicorn/no-array-reduce": "off",
|
||||
"unicorn/no-array-reverse": "off",
|
||||
"unicorn/no-array-sort": "off",
|
||||
"unicorn/no-await-expression-member": "off",
|
||||
"unicorn/no-document-cookie": "off",
|
||||
"unicorn/no-hex-escape": "off",
|
||||
"unicorn/no-immediate-mutation": "off",
|
||||
"unicorn/no-lonely-if": "off",
|
||||
"unicorn/no-magic-array-flat-depth": "off",
|
||||
"unicorn/no-negated-condition": "off",
|
||||
"unicorn/no-nested-ternary": "off",
|
||||
"unicorn/no-new-array": "off",
|
||||
"unicorn/no-null": "off",
|
||||
"unicorn/no-object-as-default-parameter": "off",
|
||||
"unicorn/no-process-exit": "off",
|
||||
"unicorn/no-thenable": "off",
|
||||
"unicorn/no-unreadable-array-destructuring": "off",
|
||||
"unicorn/no-unreadable-iife": "off",
|
||||
"unicorn/no-useless-collection-argument": "off",
|
||||
"unicorn/no-useless-fallback-in-spread": "off",
|
||||
"unicorn/no-useless-spread": "off",
|
||||
"unicorn/no-useless-undefined": "off",
|
||||
"unicorn/no-zero-fractions": "off",
|
||||
"unicorn/number-literal-case": "off",
|
||||
"unicorn/numeric-separators-style": "off",
|
||||
"unicorn/prefer-add-event-listener": "off",
|
||||
"unicorn/prefer-array-find": "off",
|
||||
"unicorn/prefer-array-flat": "off",
|
||||
"unicorn/prefer-array-index-of": "off",
|
||||
"unicorn/prefer-at": "off",
|
||||
"unicorn/prefer-code-point": "off",
|
||||
"unicorn/prefer-dom-node-append": "off",
|
||||
"unicorn/prefer-dom-node-dataset": "off",
|
||||
"unicorn/prefer-event-target": "off",
|
||||
"unicorn/prefer-export-from": "off",
|
||||
"unicorn/prefer-global-this": "off",
|
||||
"unicorn/prefer-import-meta-properties": "off",
|
||||
"unicorn/prefer-includes": "off",
|
||||
"unicorn/prefer-logical-operator-over-ternary": "off",
|
||||
"unicorn/prefer-math-min-max": "off",
|
||||
"unicorn/prefer-math-trunc": "off",
|
||||
"unicorn/prefer-native-coercion-functions": "off",
|
||||
"unicorn/prefer-negative-index": "off",
|
||||
"unicorn/prefer-number-properties": "off",
|
||||
"unicorn/prefer-query-selector": "off",
|
||||
"unicorn/prefer-response-static-json": "off",
|
||||
"unicorn/prefer-set-has": "off",
|
||||
"unicorn/prefer-single-call": "off",
|
||||
"unicorn/prefer-spread": "off",
|
||||
"unicorn/prefer-string-raw": "off",
|
||||
"unicorn/prefer-string-replace-all": "off",
|
||||
"unicorn/prefer-string-starts-ends-with": "off",
|
||||
"unicorn/prefer-structured-clone": "off",
|
||||
"unicorn/prefer-ternary": "off",
|
||||
"unicorn/prefer-top-level-await": "off",
|
||||
"unicorn/prefer-type-error": "off",
|
||||
"unicorn/relative-url-style": "off",
|
||||
"unicorn/require-array-join-separator": "off",
|
||||
"unicorn/require-post-message-target-origin": "off",
|
||||
"unicorn/switch-case-braces": "off",
|
||||
"unicorn/text-encoding-identifier-case": "off"
|
||||
},
|
||||
"ignorePatterns": ["docs/dist/**", "desktop/dist/**"]
|
||||
}
|
||||
@@ -40,7 +40,7 @@ pnpm run test:integration
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
`pnpm run check` checks types, import boundaries, and formatting. `pnpm test` runs deterministic tests and skips database cases without `TEST_DATABASE_URL`. The integration command runs every test in Linux with disposable PostgreSQL and Chromium fixtures. The build command checks types and builds the app.
|
||||
`pnpm run check` checks types, lint rules, import boundaries, and formatting. `pnpm run typecheck` uses the pinned Bun type checker. `pnpm run lint` runs Oxlint and the import checks. `pnpm install` installs both tools. The application and its tests still run on Node.js. `pnpm test` runs deterministic tests and skips database cases without `TEST_DATABASE_URL`. The integration command runs every test in Linux with disposable PostgreSQL and Chromium fixtures. The build command checks types and builds the app.
|
||||
|
||||
## Git hooks
|
||||
|
||||
@@ -49,7 +49,7 @@ pnpm run build
|
||||
| Hook | What runs |
|
||||
| ---------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Pre-commit | Prettier formats your staged files. If [Gitleaks](https://github.com/gitleaks/gitleaks) is installed, it scans them for secrets. |
|
||||
| Pre-push | `pnpm run lint`: `pnpm run check` without formatting. It type-checks and checks import boundaries. |
|
||||
| Pre-push | `pnpm run typecheck` and `pnpm run lint` run in parallel. |
|
||||
|
||||
Secret scanning skips its generic keyword check in tests and fixtures. Known key formats fail everywhere, so keep test values synthetic.
|
||||
|
||||
@@ -116,6 +116,8 @@ flowchart LR
|
||||
|
||||
The network has no internet access, and your source folders are mounted read-only. The run fails if any test is skipped.
|
||||
|
||||
Keep independent browser cases in the matching test files so they can run in separate processes. Use short retry intervals in fixtures that check retry results, not the delay. Keep the same request count and failure checks.
|
||||
|
||||
Wait for a controlled frame to finish loading before checking an old control binding. A reload can still show the previous document while navigation is pending.
|
||||
|
||||
## Manual acceptance harness
|
||||
@@ -169,42 +171,48 @@ To compare with an image built without RTK, run `--phase baseline --baseline <co
|
||||
|
||||
## What CI checks
|
||||
|
||||
CI reads the changed files on pull requests, merge queue checks and pushes to `main`. Formatting, CI selection tests and secret scanning always run. The run summary lists the selected checks and the number of integration test files.
|
||||
CI reads the changed files on pull requests, merge queue checks and pushes to `main`. Formatting, CI selection tests and secret scanning always run. Formatting checks changed files. A change to formatter settings or root dependencies checks all files. The run summary lists the selected checks and the number of integration test files.
|
||||
|
||||
The required **Checks, tests and build** result keeps its existing name. It waits for each selected job. A failed scope check, missing scope output, failed job or selected job that was skipped makes this result fail. The native Windows result is included. No branch protection change is needed.
|
||||
The required **Checks, tests and build** result keeps its existing name. One Linux runner installs dependencies once. It runs formatting, Oxlint, type checks, desktop contracts, eval contracts and application tests in parallel. A failed command fails the result. Failed or incomplete check selection also fails the result. No branch protection change is needed.
|
||||
|
||||
Application, desktop, native, eval and container jobs can run in parallel after file selection. Linux checks do not wait for Mac checks. Type checks run once in the quality job. Integration tests build their own web fixture inside the cached test image. They use the dependencies in that image without an install on the runner, and run up to four test files at a time, within the available CPU count.
|
||||
The runner builds the clients before application tests. It uses the runner's Chromium and a disposable PostgreSQL service. Each test file has its own process. Up to eight files run at once. Independent native browser control cases also run in parallel, with separate profiles and servers. Recorded file times put the slowest files first. Without recorded times, file size sets the order. Successful runs cache file paths and times. Test results and private content do not enter this cache.
|
||||
|
||||
Pull requests and merge queue checks run the selected Linux checks and security scans. Native Mac, Windows installer and container deployment acceptance run on `main` when their inputs change. Daily and manual runs use every check. The desktop publication rehearsal also runs outside pull requests and the merge queue. Other selected desktop contracts stay on the PR path. Release packaging requires successful CI for the exact source revision. Release workflows also check the packaged apps before publication.
|
||||
|
||||
On a pull request, Vitest lists files with `--changed` against the merge base. It follows imports and does not execute the tests. The existing Node.js runner executes the selected files with PostgreSQL and Chromium. A failed selection runs all files. Merge queue checks and pushes to `main` always run the full Linux suite.
|
||||
|
||||
Inputs outside the import graph force a full test run. These include lockfiles, type and test configuration, client build settings, shared test fixtures, runtime skills and JSON data. Dynamically started provider worker entry points, mounted desktop code and self-host files also use full runs. Desktop runtime changes select desktop and network checks. Web source, public HTML and desktop UI code also use a full run because tests read the generated clients. Oxlint enables each stable rule that the current code can pass. Its configuration lists the rules disabled for existing findings.
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
files[Changed files] --> scope{{Select checks}}:::accent
|
||||
scope -- text only --> light[Formatting and secrets]:::muted
|
||||
scope -- web --> web[Client build and web tests]:::go
|
||||
scope -- web --> web[Client build and Linux tests]:::go
|
||||
scope -- tests only --> tests[Changed test files]
|
||||
scope -- server --> core[Full Linux test suite]:::go
|
||||
scope -- platform or container --> area[Checks for that area]
|
||||
scope -- unknown input --> all[Every check]:::go
|
||||
scope -- server --> core[Tests reached through imports]:::go
|
||||
scope -- platform or container --> area[Linux contracts for that area]
|
||||
scope -- unknown input --> all[Every check for this stage]:::go
|
||||
```
|
||||
|
||||
| You change | CI also runs |
|
||||
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `docs/`, Markdown files, `LICENSE` or `NOTICE` | No application checks. Docs changes also run the **Docs** workflow. |
|
||||
| Only a release's version, manifest and changelog | The release metadata and source check. Installers are built after merge. |
|
||||
| Web code or public HTML and JavaScript | The client build and tests that refer to web code, built web files or public files. Web source changes also run type and import checks. |
|
||||
| Web CSS or public images and fonts | The client build. Web source changes also run type and import checks. |
|
||||
| Test files only | Type checks and the changed test files that still exist. A renamed test runs under its new name. A change to a shared test fixture runs the full Linux suite. |
|
||||
| Server, runtime, provider, shared or port code | Type and import checks, the full Linux suite and eval harness checks. Shared and port code also select client and desktop checks. |
|
||||
| Container recipes, container provider code or self-host deployment files | Container build and deployment checks, plus desktop contracts. |
|
||||
| Desktop files | Desktop contracts. Desktop UI changes also select the client build and type checks. Native Mac and Windows checks run only for their source, package, fixture and build inputs. |
|
||||
| `evals/` | Eval harness type and contract checks with disposable PostgreSQL schemas. |
|
||||
| `deployment/n8n/` | n8n delivery contracts, plus Windows checks when installer inputs change. |
|
||||
| Root package files, dependency patches, CI selection code or unknown inputs | Every check. |
|
||||
| You change | CI also runs |
|
||||
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `docs/`, Markdown files, `LICENSE` or `NOTICE` | No application checks. Docs changes also run the **Docs** workflow. |
|
||||
| Only a release's version, manifest and changelog | The release metadata and source check. Installers are built after merge. |
|
||||
| Web code or public HTML and JavaScript | The client build and full Linux suite. Web source changes also run type, lint and import checks. |
|
||||
| Web CSS or public images and fonts | The client build. Web source changes also run type and import checks. |
|
||||
| Test files only | Type, lint, import and formatting checks, plus the changed test files that still exist. A renamed test runs under its new name. A change to a shared test fixture runs the full Linux suite. |
|
||||
| Server, runtime, provider, shared or port code | Type, lint and import checks, tests reached through imports, and eval harness checks. Shared and port code also select client and desktop checks. |
|
||||
| Container recipes, container provider code or self-host deployment files | Desktop contracts and affected Linux tests. Self-host files select the full Linux suite. Main also runs container build and deployment acceptance. |
|
||||
| Desktop files | Desktop contracts. Desktop main, preload and UI changes also select the full Linux suite. Runtime changes select desktop and network checks. UI changes select the client build and type checks. Application-only changes skip desktop release and runtime fixtures. Main selects native Mac and Windows acceptance for their source, package, fixture and build inputs. |
|
||||
| `evals/` | Eval harness type and contract checks with disposable PostgreSQL schemas. |
|
||||
| `deployment/n8n/` | n8n delivery contracts. Main also selects Windows acceptance when installer inputs change. |
|
||||
| Root package files, dependency patches, CI selection code or unknown inputs | Every check for the current stage. |
|
||||
|
||||
A daily CI run at 03:17 UTC uses every check, including both Mac architectures and full Windows update acceptance. A manual CI run also uses every check, except a run on `release/desktop`, which compares that branch with `main`. The scope job reads full Git history so a base branch update does not hide the diff base. If that base is unavailable, CI runs every check. New pull request commits cancel older runs for that pull request. Main runs stay bound to each commit because releases require CI to pass on their exact source. Daily runs have a separate group so a push cannot cancel them.
|
||||
A daily CI run at 03:17 UTC uses every check, including both Mac architectures and full Windows update acceptance. A manual CI run also uses every check, except a run on `release/desktop`, which compares that branch with `main`. The shared runner fetches two commits to read the merge base. A manual run on `release/desktop` fetches full history. If that base is unavailable, CI runs every check. New pull request commits cancel older runs for that pull request. Main runs stay bound to each commit because releases require CI to pass on their exact source. Daily runs have a separate group so a push cannot cancel them.
|
||||
|
||||
The **Self-host bundle** workflow builds and checks both Linux architectures when package, container, deployment, or bundled documentation inputs change. It also runs each Sunday at 04:47 UTC and on request. Ordinary web and server changes do not create both bundles. To get a bundle for a specific revision, run that workflow on the revision. Draft release creation still needs its separate manual input.
|
||||
The **Self-host bundle** workflow builds and checks both Linux architectures on `main` when package, container, deployment, or bundled documentation inputs change. Pull requests do not export these release bundles. It also runs each Sunday at 04:47 UTC and on request. Ordinary web and server changes do not create both bundles. To get a bundle for a specific revision, run that workflow on the revision. Draft release creation still needs its separate manual input.
|
||||
|
||||
The selection and required-result rules are in [`.github/scripts/ci-scope.mjs`](https://github.com/n8n-io/nod/blob/main/.github/scripts/ci-scope.mjs). CI tests these rules with disposable Git repositories, including renames, removed tests and version-only releases. Workflow changes also run a pinned, checksum-verified actionlint to check syntax and expressions.
|
||||
The selection rules are in [`.github/scripts/ci-scope.mjs`](https://github.com/n8n-io/nod/blob/main/.github/scripts/ci-scope.mjs). The shared runner selects checks and affected tests after installing the tools. It starts without waiting for a separate selection job. CI tests these rules with disposable Git repositories, including renames, removed tests and version-only releases. Workflow changes also run a pinned, checksum-verified actionlint to check syntax and expressions.
|
||||
|
||||
Actionlint 1.7.12 [does not yet accept GitHub's `queue` key](https://github.com/rhysd/actionlint/issues/657). CI ignores that specific parser error and checks the queue values and cancellation settings in its own tests.
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"check": "tsc --noEmit",
|
||||
"check": "bun check --no-script",
|
||||
"test": "node --import tsx --test tests/*.test.ts",
|
||||
"eval": "tsx src/cli.ts"
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ pre-commit:
|
||||
- run: '! command -v gitleaks'
|
||||
|
||||
pre-push:
|
||||
parallel: true
|
||||
jobs:
|
||||
- name: types
|
||||
run: pnpm run typecheck
|
||||
- name: lint
|
||||
run: pnpm run lint
|
||||
+8
-4
@@ -17,16 +17,17 @@
|
||||
"desktop:windows:prepare": "node desktop/scripts/prepare-windows-runtime.mjs",
|
||||
"desktop:windows:build": "node desktop/scripts/build-windows.mjs",
|
||||
"desktop:test": "pnpm --dir desktop test",
|
||||
"build": "tsc --noEmit && vite build && node desktop/scripts/build-ui.mjs",
|
||||
"check": "pnpm run lint && pnpm run format:check",
|
||||
"lint": "tsc --noEmit && node scripts/check-architecture.mjs",
|
||||
"build": "pnpm run typecheck && vite build && node desktop/scripts/build-ui.mjs",
|
||||
"check": "pnpm run typecheck && pnpm run lint && pnpm run format:check",
|
||||
"lint": "oxlint && node scripts/check-architecture.mjs",
|
||||
"test": "tsx --test tests/*.test.ts",
|
||||
"start": "node scripts/start.mjs --production",
|
||||
"test:integration": "node scripts/test-integration.mjs",
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check .",
|
||||
"eval:voice": "tsx scripts/voice-eval.ts",
|
||||
"eval:capability": "tsx evals/src/cli.ts"
|
||||
"eval:capability": "tsx evals/src/cli.ts",
|
||||
"typecheck": "bun check --no-script"
|
||||
},
|
||||
"dependencies": {
|
||||
"@1password/sdk": "0.5.0",
|
||||
@@ -101,6 +102,7 @@
|
||||
"@types/react": "^19.2.2",
|
||||
"@types/react-dom": "^19.2.2",
|
||||
"@vitejs/plugin-react": "^6.1.2",
|
||||
"bun": "1.4.4",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"emoji-picker-react": "4.22.3",
|
||||
@@ -112,6 +114,7 @@
|
||||
"linkify-it": "6.1.0",
|
||||
"lucide-react": "^1.72.0",
|
||||
"mammoth": "1.13.0",
|
||||
"oxlint": "1.94.0",
|
||||
"posthog-js": "1.438.5",
|
||||
"prettier": "3.9.10",
|
||||
"qrcode.react": "4.2.0",
|
||||
@@ -127,6 +130,7 @@
|
||||
"typescript": "^6.0.3",
|
||||
"unist-util-visit": "^5.2.0",
|
||||
"vite": "^8.3.5",
|
||||
"vitest": "5.1.0",
|
||||
"yaml": "2.9.1"
|
||||
},
|
||||
"packageManager": "pnpm@10.34.5"
|
||||
|
||||
Generated
+511
-17
@@ -246,6 +246,9 @@ importers:
|
||||
'@vitejs/plugin-react':
|
||||
specifier: ^6.1.2
|
||||
version: 6.1.2(vite@8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1))
|
||||
bun:
|
||||
specifier: 1.4.4
|
||||
version: 1.4.4
|
||||
class-variance-authority:
|
||||
specifier: ^0.7.1
|
||||
version: 0.7.1
|
||||
@@ -279,6 +282,9 @@ importers:
|
||||
mammoth:
|
||||
specifier: 1.13.0
|
||||
version: 1.13.0
|
||||
oxlint:
|
||||
specifier: 1.94.0
|
||||
version: 1.94.0
|
||||
posthog-js:
|
||||
specifier: 1.438.5
|
||||
version: 1.438.5(@types/react@19.3.0)(react@19.3.1)
|
||||
@@ -324,6 +330,9 @@ importers:
|
||||
vite:
|
||||
specifier: ^8.3.5
|
||||
version: 8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)
|
||||
vitest:
|
||||
specifier: 5.1.0
|
||||
version: 5.1.0(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(jsdom@30.1.3(@noble/hashes@2.4.0))(vite@8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1))
|
||||
yaml:
|
||||
specifier: 2.9.1
|
||||
version: 2.9.1
|
||||
@@ -1176,9 +1185,195 @@ packages:
|
||||
resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==}
|
||||
engines: {node: '>=8.0.0'}
|
||||
|
||||
'@oven/bun-darwin-aarch64@1.4.4':
|
||||
resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@oven/bun-darwin-x64@1.4.4':
|
||||
resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@oven/bun-freebsd-aarch64@1.4.4':
|
||||
resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
|
||||
'@oven/bun-freebsd-x64@1.4.4':
|
||||
resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@oven/bun-linux-aarch64-android@1.4.4':
|
||||
resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@oven/bun-linux-aarch64-musl@1.4.4':
|
||||
resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oven/bun-linux-aarch64@1.4.4':
|
||||
resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oven/bun-linux-x64-android@1.4.4':
|
||||
resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
|
||||
'@oven/bun-linux-x64-musl@1.4.4':
|
||||
resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oven/bun-linux-x64@1.4.4':
|
||||
resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oven/bun-windows-aarch64@1.4.4':
|
||||
resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@oven/bun-windows-x64@1.4.4':
|
||||
resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@oxc-project/types@0.156.0':
|
||||
resolution: {integrity: sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==}
|
||||
|
||||
'@oxlint/binding-android-arm-eabi@1.94.0':
|
||||
resolution: {integrity: sha512-730FKSBsKg/NawYnpI3gXRroXptOVqY32iYBPLUZaSx0vgYzOeiNtwojZL4gJdzo9wDvHUlstShmGRHrWcbRYg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
|
||||
'@oxlint/binding-android-arm64@1.94.0':
|
||||
resolution: {integrity: sha512-8v8TICIiZpXLot1HSq5+vsG9NEKQ5czQBYlUqJR75OVfFDr3cGOmRU/CtHDWnS4tm8nW+Z4Y357qGToSfYqFvA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@oxlint/binding-darwin-arm64@1.94.0':
|
||||
resolution: {integrity: sha512-NePcRMO/ltt1Pnytohl6pl0bd/QyRX8HbpptuDz9LK7FTsFD4lKxDMBt7di9k6IFLO0J05jO2nm7wGqIh6dRHA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@oxlint/binding-darwin-x64@1.94.0':
|
||||
resolution: {integrity: sha512-QV+m+OaEgLmYyillvP1wKXhMm6tDZEWx3vG7Wjmx9ybg15+6YMfqzvp6e+uPukC6zNywuule0vMn0fZgihZzZA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@oxlint/binding-freebsd-x64@1.94.0':
|
||||
resolution: {integrity: sha512-KVZjca581nrV6P71kZ9M1otBib9LH0IMn9rr4mrnbRp18V0HiZhBHbU26gji/Ieq2G34qMacnMc3zrmKmvWqWA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@oxlint/binding-linux-arm-gnueabihf@1.94.0':
|
||||
resolution: {integrity: sha512-AMQtgQJk8DgdIV+qaQ5sFoHAko4iKa8zo+gYqELy2grtU8hXWB08DAGB3u90aQL1YSxbd3zqHjgcODBHDFyzBQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@oxlint/binding-linux-arm-musleabihf@1.94.0':
|
||||
resolution: {integrity: sha512-ZLzoGVGAmQkp9leeB5rNxAXLcvlmkmd/GY71LKd5uikk+28NEApY3S2FB3pq6MkfOCFFnFg6QgD9lJIjd07D0Q==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@oxlint/binding-linux-arm64-gnu@1.94.0':
|
||||
resolution: {integrity: sha512-N1dW6o7cY90hLVkDsvz8nWIFOwbO+n272pvW7uLYB7u47HagJVnLChfK6QA9dWFdiPudud9zfksVUOciHc5PNA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/binding-linux-arm64-musl@1.94.0':
|
||||
resolution: {integrity: sha512-7tCF4OV/bGDQ2xxgb+sDI97SpmmDrUII4JxTG553voJVA9cnkbXSGSXzo78Ax73BuhEOPoQc2Qi6VrfT0cDG2A==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxlint/binding-linux-ppc64-gnu@1.94.0':
|
||||
resolution: {integrity: sha512-B5vUHE4wNisVEuaYxwFUn6tY+vw7A+9APxxqGKI+UmP3yKLpkhnt0qsaCrzjpX55F8rCRHBaTvIDdYo32NE36g==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/binding-linux-riscv64-gnu@1.94.0':
|
||||
resolution: {integrity: sha512-/U0b15+c4hTodo8YhEqDlQ6OjnGKvc8igjM/mh23ukqqCUBKiBCaxqUV8bcaofK9uZ+f8wCygkyXLS6LN25YSA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/binding-linux-riscv64-musl@1.94.0':
|
||||
resolution: {integrity: sha512-ba94Vwl0qOnwXIXNDR33AEbLXuX++ckM74t+9Te7CiPSPAHivhOYyeEkUAicrvOEei1pxXkWggLbFeBFFBTuHA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxlint/binding-linux-s390x-gnu@1.94.0':
|
||||
resolution: {integrity: sha512-GVwwwms3O8pdgbCiPavwq2vltyB4661GkDz6kJduZ0E5nsSJUDJ0svaP+ePYpuDVYi4+K1qhCKnWa/Ec8I4LUA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/binding-linux-x64-gnu@1.94.0':
|
||||
resolution: {integrity: sha512-iUfCFJN8ZIresSnpTfiIkhF3s8X+XA4I9KJ249QwR2QYTMwh0+pla1pj1xaFi+HtR9McjM4Jaemf70HzX7ilOQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/binding-linux-x64-musl@1.94.0':
|
||||
resolution: {integrity: sha512-RqWVeWpDACS4Oh0m21OBmy+CQ50CbbhuHFmNNPVS2P/4R3d188MjEuEuV7So82/tAM8UAT+UuMDtRDESd9NJ7g==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxlint/binding-openharmony-arm64@1.94.0':
|
||||
resolution: {integrity: sha512-K/2DHOUoypwYVqzxJMRPdMuBKjAetZEAsGPP7rHimd+2+5J1TxM+17pG8kw+ayH4+rqBXiPd+H9wgPcU+fF77A==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [openharmony]
|
||||
|
||||
'@oxlint/binding-win32-arm64-msvc@1.94.0':
|
||||
resolution: {integrity: sha512-hYOCaOJiB4ZCGswBWKl3JQrhqu6mnC5DCUw/1UMNzRXgsHIJ0V226J43LAVICVIDGlhFUZTYShFW+wHWpt6qCQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@oxlint/binding-win32-ia32-msvc@1.94.0':
|
||||
resolution: {integrity: sha512-1l1FDlzbPmAeDoZ8UGspOE2dOmz1ZL6SlDsvOmRCmWSQjCdTy5LzUepS8mO/SGpAoz4D6WAt/yNZAUyHqbkmkQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@oxlint/binding-win32-x64-msvc@1.94.0':
|
||||
resolution: {integrity: sha512-I3eZdd4bemIJQDNv9XDV/FEofDxIoN32tzCv98wIgLdW05EqxZb5hF4AwPrRzHD/dQhl0n7KgPy5AQPfM0HWrA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@pedrobef/vozz@0.2.7':
|
||||
resolution: {integrity: sha512-d/gFcSn03n7ZDDFyfIQfOw+erI0lOBRk4+qAPKEpVEBalZ2qohHWoQig4hRqWdWLpiAdYk/X/I48n+fH7gc1SQ==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -1199,6 +1394,7 @@ packages:
|
||||
|
||||
'@posthog/core@1.61.2':
|
||||
resolution: {integrity: sha512-l3b6Dc2NmItwmyu6ot7K2jtStQOAQjZw/PB/gpZwk2W6SBCbvPg6YJzReSBSQLuok19ridbfVNk70a5hgoGX2Q==}
|
||||
|
||||
'@posthog/core@1.67.2':
|
||||
resolution: {integrity: sha512-FcDdAm3L2UKxA2NWCxwG8KKgZ4QjGBl7f9WASLlCVPeKgXI0FeguSq81x0f2htEB37itKbUwLkNFgA3FV4b7iQ==}
|
||||
|
||||
@@ -1207,6 +1403,7 @@ packages:
|
||||
|
||||
'@posthog/types@1.418.0':
|
||||
resolution: {integrity: sha512-WqDXUWH1R8OilBp2PfDpQIRZSCs3QyOnw7H3YK7lvZLCMIsOqSZAKJrrqYWt4f7FvnVCACRuNGCC0HKh3J/HWw==}
|
||||
|
||||
'@posthog/types@1.425.0':
|
||||
resolution: {integrity: sha512-VaAlT5cl2wQ8mRkC3agp32YqI1HCZyeDE9qc5cziXgtbqK8kGeodhqZpJgSIPz0wAl3yRtKN4yOL+d7wxDRPww==}
|
||||
|
||||
@@ -1900,9 +2097,15 @@ packages:
|
||||
'@tokenizer/token@0.3.0':
|
||||
resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==}
|
||||
|
||||
'@types/chai@5.2.3':
|
||||
resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==}
|
||||
|
||||
'@types/debug@4.1.13':
|
||||
resolution: {integrity: sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==}
|
||||
|
||||
'@types/deep-eql@4.0.2':
|
||||
resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
|
||||
|
||||
'@types/estree-jsx@1.0.5':
|
||||
resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==}
|
||||
|
||||
@@ -1978,6 +2181,20 @@ packages:
|
||||
oxc-transform-react:
|
||||
optional: true
|
||||
|
||||
'@vitest/mocker@5.1.0':
|
||||
resolution: {integrity: sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==}
|
||||
peerDependencies:
|
||||
msw: ^2.4.9 || ^3.0.0
|
||||
vite: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
peerDependenciesMeta:
|
||||
msw:
|
||||
optional: true
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
'@vitest/spy@5.1.0':
|
||||
resolution: {integrity: sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==}
|
||||
|
||||
'@wasm-audio-decoders/common@9.0.7':
|
||||
resolution: {integrity: sha512-WRaUuWSKV7pkttBygml/a6dIEpatq2nnZGFIoPTc5yPLkxL6Wk4YaslPM98OPQvWacvNZ+Py9xROGDtrFBDzag==}
|
||||
|
||||
@@ -2064,6 +2281,10 @@ packages:
|
||||
resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
assertion-error@2.0.1:
|
||||
resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
async-function@1.0.0:
|
||||
resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -2123,6 +2344,12 @@ packages:
|
||||
buffer-equal-constant-time@1.0.1:
|
||||
resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==}
|
||||
|
||||
bun@1.4.4:
|
||||
resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==}
|
||||
cpu: [arm64, x64]
|
||||
os: [darwin, linux, android, freebsd, win32]
|
||||
hasBin: true
|
||||
|
||||
bytes@3.1.2:
|
||||
resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==}
|
||||
engines: {node: '>= 0.8'}
|
||||
@@ -2145,6 +2372,10 @@ packages:
|
||||
ccount@2.0.1:
|
||||
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
|
||||
|
||||
chai@6.3.0:
|
||||
resolution: {integrity: sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
chalk@6.0.0:
|
||||
resolution: {integrity: sha512-2uNTXIuTTxk7ciZgAU1BQcgnchcG0xXnrs6jzkQfj9SsRa9M2s5zE8WT96hS6KmG4MzWHSrvH43DF1m4XRkrFg==}
|
||||
engines: {node: '>=22'}
|
||||
@@ -2446,6 +2677,9 @@ packages:
|
||||
resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
es-module-lexer@2.3.2:
|
||||
resolution: {integrity: sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==}
|
||||
|
||||
es-object-atoms@1.1.2:
|
||||
resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -2480,6 +2714,9 @@ packages:
|
||||
estree-util-is-identifier-name@3.0.0:
|
||||
resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==}
|
||||
|
||||
estree-walker@3.0.3:
|
||||
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
|
||||
|
||||
etag@1.8.1:
|
||||
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
|
||||
engines: {node: '>= 0.6'}
|
||||
@@ -2495,6 +2732,10 @@ packages:
|
||||
resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
|
||||
expect-type@1.4.0:
|
||||
resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
express-rate-limit@8.7.0:
|
||||
resolution: {integrity: sha512-hOwV7WOxXfjRpAM1DSJWZDXx3GhplwD8IfwuwvogD8i1Qnkgosw/H45s4ZnFAUHDAhPjlY9hLBvJhKmGMyY26g==}
|
||||
engines: {node: '>= 16'}
|
||||
@@ -3462,6 +3703,10 @@ packages:
|
||||
resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
obug@3.0.0:
|
||||
resolution: {integrity: sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==}
|
||||
engines: {node: '>=12.20.0'}
|
||||
|
||||
on-exit-leak-free@2.1.2:
|
||||
resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
@@ -3563,6 +3808,19 @@ packages:
|
||||
resolution: {integrity: sha512-19YVAg7T+WTrxggPukVq7DjTv6+PJ867TmhCvBsYwmbFCsZd344rq2Ld1p0wo8f8Qrrhgp82c6FJRqdXWtSEhg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
oxlint@1.94.0:
|
||||
resolution: {integrity: sha512-Fnt+3wSKRhtLmvgRfxgRX0excSPCoyiXRol4eWKZLtXxWMQtwQ3KjKQUYXOw5loyinfnZfGzh4RCYf7opfL0vw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
oxlint-tsgolint: '>=7.0.2007'
|
||||
vite-plus: '*'
|
||||
peerDependenciesMeta:
|
||||
oxlint-tsgolint:
|
||||
optional: true
|
||||
vite-plus:
|
||||
optional: true
|
||||
|
||||
p-limit@6.2.0:
|
||||
resolution: {integrity: sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -3687,9 +3945,6 @@ packages:
|
||||
pino@10.1.1:
|
||||
resolution: {integrity: sha512-3qqVfpJtRQUCAOs4rTOEwLH6mwJJ/CSAlbis8fKOiMzTtXh0HN/VLsn3UWVTJ7U8DsWmxeNon2IpGb+wORXH4g==}
|
||||
hasBin: true
|
||||
pino@10.3.1:
|
||||
resolution: {integrity: sha512-r34yH/GlQpKZbU1BvFFqOjhISRo1MNx1tWYsYvmj6KIRHSPMT2+yHOEb1SG6NMvRoHRF0a07kCOox/9yakl1vg==}
|
||||
hasBin: true
|
||||
|
||||
pkce-challenge@5.0.1:
|
||||
resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==}
|
||||
@@ -4184,6 +4439,9 @@ packages:
|
||||
resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
std-env@4.3.0:
|
||||
resolution: {integrity: sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==}
|
||||
|
||||
stop-iteration-iterator@1.1.0:
|
||||
resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -4245,6 +4503,14 @@ packages:
|
||||
resolution: {integrity: sha512-e2zZ96wSChazBsbENf/Pcm/4swHt2cEKQ92rhUjkL9GCKiTDJIaTBenjE/m9DXi0QBmTMDkFDdOomUy20A1tDQ==}
|
||||
engines: {node: '>=20'}
|
||||
|
||||
tinybench@6.2.3:
|
||||
resolution: {integrity: sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
|
||||
tinyexec@1.3.1:
|
||||
resolution: {integrity: sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
tinyglobby@0.2.17:
|
||||
resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
@@ -4498,6 +4764,47 @@ packages:
|
||||
yaml:
|
||||
optional: true
|
||||
|
||||
vitest@5.1.0:
|
||||
resolution: {integrity: sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==}
|
||||
engines: {node: ^22.12.0 || ^24.0.0 || >=26.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@edge-runtime/vm': '*'
|
||||
'@opentelemetry/api': ^1.9.0
|
||||
'@types/node': ^22.0.0 || >=24.0.0
|
||||
'@vitest/browser-playwright': 5.1.0
|
||||
'@vitest/browser-preview': 5.1.0
|
||||
'@vitest/browser-webdriverio': ^5.0.0-beta.5 || >=5.0.0
|
||||
'@vitest/coverage-istanbul': 5.1.0
|
||||
'@vitest/coverage-v8': 5.1.0
|
||||
'@vitest/ui': 5.1.0
|
||||
happy-dom: '*'
|
||||
jsdom: '*'
|
||||
vite: ^6.4.0 || ^7.0.0 || ^8.0.0
|
||||
peerDependenciesMeta:
|
||||
'@edge-runtime/vm':
|
||||
optional: true
|
||||
'@opentelemetry/api':
|
||||
optional: true
|
||||
'@types/node':
|
||||
optional: true
|
||||
'@vitest/browser-playwright':
|
||||
optional: true
|
||||
'@vitest/browser-preview':
|
||||
optional: true
|
||||
'@vitest/browser-webdriverio':
|
||||
optional: true
|
||||
'@vitest/coverage-istanbul':
|
||||
optional: true
|
||||
'@vitest/coverage-v8':
|
||||
optional: true
|
||||
'@vitest/ui':
|
||||
optional: true
|
||||
happy-dom:
|
||||
optional: true
|
||||
jsdom:
|
||||
optional: true
|
||||
|
||||
w3c-keyname@2.2.8:
|
||||
resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==}
|
||||
|
||||
@@ -4554,6 +4861,11 @@ packages:
|
||||
engines: {node: '>= 8'}
|
||||
hasBin: true
|
||||
|
||||
why-is-node-running@3.2.1:
|
||||
resolution: {integrity: sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==}
|
||||
engines: {node: '>=20.11'}
|
||||
hasBin: true
|
||||
|
||||
win-guid@0.2.1:
|
||||
resolution: {integrity: sha512-gEIQU4mkgl2OPeoNrWflcJFJ3Ae2BPd4eCsHHA/XikslkIVms/nHhvnvzIZV7VLmBvtFlDOzLt9rrZT+n6D67A==}
|
||||
|
||||
@@ -5533,8 +5845,101 @@ snapshots:
|
||||
|
||||
'@opentelemetry/api@1.9.1': {}
|
||||
|
||||
'@oven/bun-darwin-aarch64@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-darwin-x64@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-freebsd-aarch64@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-freebsd-x64@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-linux-aarch64-android@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-linux-aarch64-musl@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-linux-aarch64@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-linux-x64-android@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-linux-x64-musl@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-linux-x64@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-windows-aarch64@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oven/bun-windows-x64@1.4.4':
|
||||
optional: true
|
||||
|
||||
'@oxc-project/types@0.156.0': {}
|
||||
|
||||
'@oxlint/binding-android-arm-eabi@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-android-arm64@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-darwin-arm64@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-darwin-x64@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-freebsd-x64@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-arm-gnueabihf@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-arm-musleabihf@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-arm64-gnu@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-arm64-musl@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-ppc64-gnu@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-riscv64-gnu@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-riscv64-musl@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-s390x-gnu@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-x64-gnu@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-linux-x64-musl@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-openharmony-arm64@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-win32-arm64-msvc@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-win32-ia32-msvc@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@oxlint/binding-win32-x64-msvc@1.94.0':
|
||||
optional: true
|
||||
|
||||
'@pedrobef/vozz@0.2.7(@types/node@24.19.2)':
|
||||
dependencies:
|
||||
'@huggingface/transformers': 3.8.1(@types/node@24.19.2)
|
||||
@@ -5555,6 +5960,7 @@ snapshots:
|
||||
'@posthog/core@1.61.2':
|
||||
dependencies:
|
||||
'@posthog/types': 1.418.0
|
||||
|
||||
'@posthog/core@1.67.2':
|
||||
dependencies:
|
||||
'@posthog/types': 1.425.0
|
||||
@@ -5562,6 +5968,7 @@ snapshots:
|
||||
'@posthog/types@1.415.2': {}
|
||||
|
||||
'@posthog/types@1.418.0': {}
|
||||
|
||||
'@posthog/types@1.425.0': {}
|
||||
|
||||
'@protobufjs/aspromise@1.1.2': {}
|
||||
@@ -6184,10 +6591,17 @@ snapshots:
|
||||
|
||||
'@tokenizer/token@0.3.0': {}
|
||||
|
||||
'@types/chai@5.2.3':
|
||||
dependencies:
|
||||
'@types/deep-eql': 4.0.2
|
||||
assertion-error: 2.0.1
|
||||
|
||||
'@types/debug@4.1.13':
|
||||
dependencies:
|
||||
'@types/ms': 2.1.0
|
||||
|
||||
'@types/deep-eql@4.0.2': {}
|
||||
|
||||
'@types/estree-jsx@1.0.5':
|
||||
dependencies:
|
||||
'@types/estree': 1.0.9
|
||||
@@ -6255,6 +6669,17 @@ snapshots:
|
||||
'@rolldown/pluginutils': 1.0.1
|
||||
vite: 8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)
|
||||
|
||||
'@vitest/mocker@5.1.0(vite@8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1))':
|
||||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.31
|
||||
'@vitest/spy': 5.1.0
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 1.4.5
|
||||
optionalDependencies:
|
||||
vite: 8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)
|
||||
|
||||
'@vitest/spy@5.1.0': {}
|
||||
|
||||
'@wasm-audio-decoders/common@9.0.7':
|
||||
dependencies:
|
||||
'@eshaz/web-worker': 1.2.2
|
||||
@@ -6345,6 +6770,8 @@ snapshots:
|
||||
get-intrinsic: 1.3.0
|
||||
is-array-buffer: 3.0.5
|
||||
|
||||
assertion-error@2.0.1: {}
|
||||
|
||||
async-function@1.0.0: {}
|
||||
|
||||
async-mutex@0.5.0:
|
||||
@@ -6403,6 +6830,21 @@ snapshots:
|
||||
|
||||
buffer-equal-constant-time@1.0.1: {}
|
||||
|
||||
bun@1.4.4:
|
||||
optionalDependencies:
|
||||
'@oven/bun-darwin-aarch64': 1.4.4
|
||||
'@oven/bun-darwin-x64': 1.4.4
|
||||
'@oven/bun-freebsd-aarch64': 1.4.4
|
||||
'@oven/bun-freebsd-x64': 1.4.4
|
||||
'@oven/bun-linux-aarch64': 1.4.4
|
||||
'@oven/bun-linux-aarch64-android': 1.4.4
|
||||
'@oven/bun-linux-aarch64-musl': 1.4.4
|
||||
'@oven/bun-linux-x64': 1.4.4
|
||||
'@oven/bun-linux-x64-android': 1.4.4
|
||||
'@oven/bun-linux-x64-musl': 1.4.4
|
||||
'@oven/bun-windows-aarch64': 1.4.4
|
||||
'@oven/bun-windows-x64': 1.4.4
|
||||
|
||||
bytes@3.1.2: {}
|
||||
|
||||
cacheable@2.5.0:
|
||||
@@ -6432,6 +6874,8 @@ snapshots:
|
||||
|
||||
ccount@2.0.1: {}
|
||||
|
||||
chai@6.3.0: {}
|
||||
|
||||
chalk@6.0.0: {}
|
||||
|
||||
character-entities-html4@2.1.0: {}
|
||||
@@ -6769,6 +7213,8 @@ snapshots:
|
||||
|
||||
es-errors@1.3.0: {}
|
||||
|
||||
es-module-lexer@2.3.2: {}
|
||||
|
||||
es-object-atoms@1.1.2:
|
||||
dependencies:
|
||||
es-errors: 1.3.0
|
||||
@@ -6828,6 +7274,10 @@ snapshots:
|
||||
|
||||
estree-util-is-identifier-name@3.0.0: {}
|
||||
|
||||
estree-walker@3.0.3:
|
||||
dependencies:
|
||||
'@types/estree': 1.0.9
|
||||
|
||||
etag@1.8.1: {}
|
||||
|
||||
eventemitter3@5.0.4: {}
|
||||
@@ -6838,6 +7288,8 @@ snapshots:
|
||||
dependencies:
|
||||
eventsource-parser: 3.1.1
|
||||
|
||||
expect-type@1.4.0: {}
|
||||
|
||||
express-rate-limit@8.7.0(express@5.2.1):
|
||||
dependencies:
|
||||
debug: 4.4.3
|
||||
@@ -6923,7 +7375,7 @@ snapshots:
|
||||
fast-json-stringify: 7.0.1
|
||||
find-my-way: 9.10.0
|
||||
light-my-request: 6.6.0
|
||||
pino: 10.3.1
|
||||
pino: 10.1.1
|
||||
process-warning: 5.1.0
|
||||
rfdc: 1.4.1
|
||||
secure-json-parse: 4.1.0
|
||||
@@ -8159,6 +8611,8 @@ snapshots:
|
||||
has-symbols: 1.1.0
|
||||
object-keys: 1.1.1
|
||||
|
||||
obug@3.0.0: {}
|
||||
|
||||
on-exit-leak-free@2.1.2: {}
|
||||
|
||||
on-finished@2.4.1:
|
||||
@@ -8242,6 +8696,28 @@ snapshots:
|
||||
object-keys: 1.1.1
|
||||
safe-push-apply: 1.0.0
|
||||
|
||||
oxlint@1.94.0:
|
||||
optionalDependencies:
|
||||
'@oxlint/binding-android-arm-eabi': 1.94.0
|
||||
'@oxlint/binding-android-arm64': 1.94.0
|
||||
'@oxlint/binding-darwin-arm64': 1.94.0
|
||||
'@oxlint/binding-darwin-x64': 1.94.0
|
||||
'@oxlint/binding-freebsd-x64': 1.94.0
|
||||
'@oxlint/binding-linux-arm-gnueabihf': 1.94.0
|
||||
'@oxlint/binding-linux-arm-musleabihf': 1.94.0
|
||||
'@oxlint/binding-linux-arm64-gnu': 1.94.0
|
||||
'@oxlint/binding-linux-arm64-musl': 1.94.0
|
||||
'@oxlint/binding-linux-ppc64-gnu': 1.94.0
|
||||
'@oxlint/binding-linux-riscv64-gnu': 1.94.0
|
||||
'@oxlint/binding-linux-riscv64-musl': 1.94.0
|
||||
'@oxlint/binding-linux-s390x-gnu': 1.94.0
|
||||
'@oxlint/binding-linux-x64-gnu': 1.94.0
|
||||
'@oxlint/binding-linux-x64-musl': 1.94.0
|
||||
'@oxlint/binding-openharmony-arm64': 1.94.0
|
||||
'@oxlint/binding-win32-arm64-msvc': 1.94.0
|
||||
'@oxlint/binding-win32-ia32-msvc': 1.94.0
|
||||
'@oxlint/binding-win32-x64-msvc': 1.94.0
|
||||
|
||||
p-limit@6.2.0:
|
||||
dependencies:
|
||||
yocto-queue: 1.2.2
|
||||
@@ -8386,19 +8862,6 @@ snapshots:
|
||||
safe-stable-stringify: 2.5.0
|
||||
sonic-boom: 4.2.1
|
||||
thread-stream: 4.2.0
|
||||
pino@10.3.1:
|
||||
dependencies:
|
||||
'@pinojs/redact': 0.4.0
|
||||
atomic-sleep: 1.0.0
|
||||
on-exit-leak-free: 2.1.2
|
||||
pino-abstract-transport: 3.0.0
|
||||
pino-std-serializers: 7.1.0
|
||||
process-warning: 5.1.0
|
||||
quick-format-unescaped: 4.0.4
|
||||
real-require: 0.2.0
|
||||
safe-stable-stringify: 2.5.0
|
||||
sonic-boom: 4.2.1
|
||||
thread-stream: 4.2.0
|
||||
|
||||
pkce-challenge@5.0.1: {}
|
||||
|
||||
@@ -9028,6 +9491,8 @@ snapshots:
|
||||
|
||||
statuses@2.0.2: {}
|
||||
|
||||
std-env@4.3.0: {}
|
||||
|
||||
stop-iteration-iterator@1.1.0:
|
||||
dependencies:
|
||||
es-errors: 1.3.0
|
||||
@@ -9103,6 +9568,10 @@ snapshots:
|
||||
dependencies:
|
||||
real-require: 1.0.0
|
||||
|
||||
tinybench@6.2.3: {}
|
||||
|
||||
tinyexec@1.3.1: {}
|
||||
|
||||
tinyglobby@0.2.17:
|
||||
dependencies:
|
||||
fdir: 6.5.0(picomatch@4.0.7)
|
||||
@@ -9328,6 +9797,29 @@ snapshots:
|
||||
tsx: 4.23.15
|
||||
yaml: 2.9.1
|
||||
|
||||
vitest@5.1.0(@opentelemetry/api@1.9.1)(@types/node@24.19.2)(jsdom@30.1.3(@noble/hashes@2.4.0))(vite@8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)):
|
||||
dependencies:
|
||||
'@types/chai': 5.2.3
|
||||
'@vitest/mocker': 5.1.0(vite@8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1))
|
||||
chai: 6.3.0
|
||||
es-module-lexer: 2.3.2
|
||||
expect-type: 1.4.0
|
||||
magic-string: 1.4.5
|
||||
obug: 3.0.0
|
||||
picomatch: 4.0.7
|
||||
std-env: 4.3.0
|
||||
tinybench: 6.2.3
|
||||
tinyexec: 1.3.1
|
||||
tinyglobby: 0.2.17
|
||||
vite: 8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)
|
||||
why-is-node-running: 3.2.1
|
||||
optionalDependencies:
|
||||
'@opentelemetry/api': 1.9.1
|
||||
'@types/node': 24.19.2
|
||||
jsdom: 30.1.3(@noble/hashes@2.4.0)
|
||||
transitivePeerDependencies:
|
||||
- msw
|
||||
|
||||
w3c-keyname@2.2.8: {}
|
||||
|
||||
w3c-xmlserializer@6.0.0:
|
||||
@@ -9401,6 +9893,8 @@ snapshots:
|
||||
dependencies:
|
||||
isexe: 2.0.0
|
||||
|
||||
why-is-node-running@3.2.1: {}
|
||||
|
||||
win-guid@0.2.1: {}
|
||||
|
||||
wrappy@1.0.2: {}
|
||||
|
||||
@@ -19,6 +19,7 @@ overrides:
|
||||
set-cookie-parser@<2.7.3: 2.7.3
|
||||
sharp: 0.35.5
|
||||
allowBuilds:
|
||||
bun: true
|
||||
agent-browser: true
|
||||
esbuild: true
|
||||
fsevents: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { spawn } from 'node:child_process';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { readdir } from 'node:fs/promises';
|
||||
import { resolve } from 'node:path';
|
||||
import { readdir, writeFile } from 'node:fs/promises';
|
||||
import { relative, resolve } from 'node:path';
|
||||
import { availableParallelism } from 'node:os';
|
||||
import { pipeline } from 'node:stream/promises';
|
||||
import { run } from 'node:test';
|
||||
@@ -54,13 +54,18 @@ if (process.argv.includes('--run')) {
|
||||
throw new Error('The integration test selection must name existing test files.');
|
||||
const tests = run({
|
||||
files,
|
||||
concurrency: Math.min(4, availableParallelism()),
|
||||
concurrency: Math.min(8, availableParallelism()),
|
||||
execArgv: ['--import', 'tsx'],
|
||||
});
|
||||
tests.on('test:summary', ({ success, counts }) => {
|
||||
const timings = {};
|
||||
tests.on('test:summary', ({ success, counts, file, duration_ms }) => {
|
||||
if (!success || counts.skipped || counts.todo || counts.cancelled) process.exitCode = 1;
|
||||
if (file) timings[relative(process.cwd(), file)] = Math.ceil(duration_ms);
|
||||
else console.error(`Integration timings: ${JSON.stringify(timings)}`);
|
||||
});
|
||||
await pipeline(tests, new spec(), process.stdout);
|
||||
if (process.env.NOD_TEST_TIMINGS)
|
||||
await writeFile(process.env.NOD_TEST_TIMINGS, JSON.stringify(timings));
|
||||
} else {
|
||||
const name = `nod-tests-${randomUUID()}`;
|
||||
const database = `${name}-db`;
|
||||
@@ -148,6 +153,8 @@ if (process.argv.includes('--run')) {
|
||||
'NOD_TEST_NATIVE_DOWNLOAD=true',
|
||||
'--env',
|
||||
'NOD_TEST_BROWSER_EXECUTABLE=/usr/bin/chromium',
|
||||
'--env',
|
||||
'NOD_TEST_FILES',
|
||||
...mounts,
|
||||
'--init',
|
||||
'--entrypoint',
|
||||
|
||||
+148
-3
@@ -1,10 +1,22 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import type { ChildProcessWithoutNullStreams } from 'node:child_process';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { PassThrough } from 'node:stream';
|
||||
import {
|
||||
browserNamespace,
|
||||
createContainerBrowserComputer,
|
||||
type BrowserBridgeLauncher,
|
||||
} from '../src/providers/container-browser/index.ts';
|
||||
import { runBrowserBridge } from '../src/providers/container-browser/bridge.ts';
|
||||
import { startContainerBrowserWorker } from '../src/providers/container-browser/worker.ts';
|
||||
import { fakeComputer } from './runtime-fixtures.ts';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { stat } from 'node:fs/promises';
|
||||
import { stat, mkdtemp, rm } from 'node:fs/promises';
|
||||
import { createServer } from 'node:http';
|
||||
import type { Socket } from 'node:net';
|
||||
import { resolve } from 'node:path';
|
||||
import { resolve, join } from 'node:path';
|
||||
import { runInNewContext } from 'node:vm';
|
||||
import { BrowserActionError } from '../src/ports/computer.ts';
|
||||
import { BrowserActionError, type Computer } from '../src/ports/computer.ts';
|
||||
import { createAgentBrowserComputer } from '../src/providers/agent-browser/index.ts';
|
||||
import {
|
||||
DaemonCommandError,
|
||||
@@ -400,3 +412,136 @@ export async function fakeDevtools(model: DevtoolsModel) {
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function workerComputer() {
|
||||
const calls: Array<{ method: string; input?: unknown }> = [];
|
||||
let act: Computer['act'] = async (_id, input) => {
|
||||
return {
|
||||
text: input.text ?? 'Synthetic page',
|
||||
url: input.url ?? 'https://example.com/',
|
||||
};
|
||||
};
|
||||
const computer: Computer = {
|
||||
...fakeComputer(),
|
||||
screenStatus: () => ({ state: 'live', capturedAt: '2026-09-25T12:00:00.000Z' }),
|
||||
act: (id, input, signal) => {
|
||||
calls.push({ method: 'act', input });
|
||||
return act(id, input, signal);
|
||||
},
|
||||
screenshot: async () => Buffer.from('masked synthetic image'),
|
||||
injectCredentials: async (input) => {
|
||||
calls.push({ method: 'injectCredentials', input });
|
||||
return { status: 'submitted' };
|
||||
},
|
||||
currentPage: async () => {
|
||||
calls.push({ method: 'currentPage' });
|
||||
return { origin: 'https://example.com', url: 'https://example.com/login' };
|
||||
},
|
||||
bindProfile: async (_id, profileId) => {
|
||||
calls.push({ method: 'bindProfile', input: profileId });
|
||||
},
|
||||
hold: async () => {},
|
||||
close: async () => {
|
||||
calls.push({ method: 'close' });
|
||||
},
|
||||
clear: async (id) => {
|
||||
calls.push({ method: 'clear', input: id });
|
||||
},
|
||||
discard: async (id) => {
|
||||
calls.push({ method: 'discard', input: id });
|
||||
},
|
||||
fillCard: async (input) => {
|
||||
calls.push({ method: 'fillCard', input });
|
||||
},
|
||||
cardDestinations: async (id, fields) => {
|
||||
calls.push({ method: 'cardDestinations', input: { id, fields } });
|
||||
return { document: 'loader-1', destinations: { number: 'https://pay.fixture.test' } };
|
||||
},
|
||||
checkoutImage: async (id) => {
|
||||
calls.push({ method: 'checkoutImage', input: id });
|
||||
return new Uint8Array([255, 216, 255]);
|
||||
},
|
||||
dispose: async () => {
|
||||
calls.push({ method: 'dispose' });
|
||||
},
|
||||
};
|
||||
return {
|
||||
computer,
|
||||
calls,
|
||||
setAct(value: Computer['act']) {
|
||||
act = value;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export async function createBrowserWorkerFixture(
|
||||
control: {
|
||||
beforeFirstBridge?: Promise<void>;
|
||||
computer?: Computer | (() => Computer);
|
||||
} = {},
|
||||
) {
|
||||
const root = await mkdtemp('/tmp/sk-browser-');
|
||||
const socketPath = join(root, 'control.sock');
|
||||
const instances = new Map<string, ReturnType<typeof workerComputer>>();
|
||||
const worker = await startContainerBrowserWorker({
|
||||
socketPath,
|
||||
dataRoot: root,
|
||||
createComputer: async (path) => {
|
||||
if (typeof control.computer === 'function') return control.computer();
|
||||
if (control.computer) return control.computer;
|
||||
const value = workerComputer();
|
||||
instances.set(path, value);
|
||||
return value.computer;
|
||||
},
|
||||
});
|
||||
const launches: Array<{ command: string; args: string[]; env: NodeJS.ProcessEnv | undefined }> =
|
||||
[];
|
||||
const bridges: ChildProcessWithoutNullStreams[] = [];
|
||||
const launch: BrowserBridgeLauncher = (command, args, options) => {
|
||||
launches.push({ command, args, env: options.env });
|
||||
const process = Object.assign(new EventEmitter(), {
|
||||
stdin: new PassThrough(),
|
||||
stdout: new PassThrough(),
|
||||
stderr: new PassThrough(),
|
||||
kill() {
|
||||
this.stdin.destroy();
|
||||
return true;
|
||||
},
|
||||
});
|
||||
void Promise.resolve(launches.length === 1 ? control.beforeFirstBridge : undefined)
|
||||
.then(() => runBrowserBridge({ input: process.stdin, output: process.stdout, socketPath }))
|
||||
.then((code) => {
|
||||
process.stdout.end();
|
||||
process.stderr.end();
|
||||
process.emit('close', code);
|
||||
});
|
||||
const bridge = process as unknown as ChildProcessWithoutNullStreams;
|
||||
bridges.push(bridge);
|
||||
return bridge;
|
||||
};
|
||||
const clients: Computer[] = [];
|
||||
function client(dataRoot: string, options: { timeoutMs?: number; drainTimeoutMs?: number } = {}) {
|
||||
const value = createContainerBrowserComputer({ dataRoot, spawn: launch, ...options });
|
||||
clients.push(value);
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
root,
|
||||
socketPath,
|
||||
worker,
|
||||
launches,
|
||||
bridges,
|
||||
instances,
|
||||
client,
|
||||
instance(dataRoot: string) {
|
||||
const value = instances.get(join(root, browserNamespace(dataRoot)));
|
||||
assert.ok(value);
|
||||
return value;
|
||||
},
|
||||
async close() {
|
||||
await Promise.allSettled(clients.map((client) => client.dispose()));
|
||||
await worker.close();
|
||||
await rm(root, { recursive: true, force: true });
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,13 @@
|
||||
import { createBrowserWorkerFixture as harness } from './browser-fixture.ts';
|
||||
import { existingDaemonCommand } from '../src/providers/agent-browser/screens.ts';
|
||||
import { openDevtools } from '../src/providers/agent-browser/devtools.ts';
|
||||
import { createServer as createHttpServer } from 'node:http';
|
||||
import { mkdtemp, rm } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { setTimeout as delay } from 'node:timers/promises';
|
||||
import { BrowserActionError, type BrowserAction } from '../src/ports/computer.ts';
|
||||
import { createAgentBrowserComputer } from '../src/providers/agent-browser/index.ts';
|
||||
import assert from 'node:assert/strict';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import test from 'node:test';
|
||||
@@ -408,3 +418,548 @@ test(
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function deferred<T = void>() {
|
||||
let resolve!: (value: T) => void;
|
||||
const promise = new Promise<T>((done) => {
|
||||
resolve = done;
|
||||
});
|
||||
return { promise, resolve };
|
||||
}
|
||||
|
||||
test(
|
||||
'reloading a page reached by a form POST does not resubmit it',
|
||||
{ timeout: 60_000 },
|
||||
async () => {
|
||||
let posts = 0;
|
||||
const server = createHttpServer((request, response) => {
|
||||
response.setHeader('content-type', 'text/html');
|
||||
if (request.method === 'POST') {
|
||||
posts += 1;
|
||||
response.end(`<title>Done</title><p>count ${posts}</p>`);
|
||||
return;
|
||||
}
|
||||
response.end('<form method="post" action="/submit"><button id="go">Go</button></form>');
|
||||
});
|
||||
await new Promise<void>((resolve) => server.listen(0, '127.0.0.1', resolve));
|
||||
const origin = `http://127.0.0.1:${(server.address() as { port: number }).port}`;
|
||||
const directory = await mkdtemp(join(tmpdir(), 'nod-reload-'));
|
||||
const computer = createAgentBrowserComputer({
|
||||
dataRoot: directory,
|
||||
browserExecutable: process.env.NOD_TEST_BROWSER_EXECUTABLE,
|
||||
privateNetwork: true,
|
||||
headless: true,
|
||||
});
|
||||
try {
|
||||
await computer.act('post', { action: 'open', url: origin });
|
||||
await computer.act('post', { action: 'click', selector: '#go' });
|
||||
await computer.act('post', { action: 'wait', text: 'count 1' });
|
||||
assert.equal(posts, 1);
|
||||
await computer.act('post', { action: 'reload' });
|
||||
await computer.act('post', { action: 'wait', load: 'load' });
|
||||
assert.equal(posts, 1);
|
||||
await computer.act('post', { action: 'open', url: origin });
|
||||
await computer.act('post', { action: 'reload' });
|
||||
assert.equal(posts, 1);
|
||||
} finally {
|
||||
await computer.dispose();
|
||||
server.closeAllConnections();
|
||||
await new Promise<void>((resolve) => server.close(() => resolve()));
|
||||
await rm(directory, { recursive: true, force: true });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'private submission keeps SPA state, delayed requests and field formats, and pauses scripts while a value stays',
|
||||
{ timeout: 60_000 },
|
||||
async () => {
|
||||
const submitted = deferred<string>();
|
||||
const cardSubmitted = deferred<string>();
|
||||
let submissions = 0;
|
||||
const server = createHttpServer(async (request, response) => {
|
||||
response.setHeader('content-type', 'text/html');
|
||||
if (request.url === '/record') {
|
||||
let body = '';
|
||||
for await (const bytes of request) body += bytes;
|
||||
submissions++;
|
||||
submitted.resolve(body);
|
||||
response.end('Accepted');
|
||||
} else if (request.url === '/card-record') {
|
||||
let body = '';
|
||||
for await (const bytes of request) body += bytes;
|
||||
cardSubmitted.resolve(body);
|
||||
response.end('Accepted');
|
||||
} else if (request.url === '/delayed') {
|
||||
response.end(`<input id="company"><input id="password" type="password"><button id="submit">Continue</button><script>
|
||||
document.querySelector('button').onclick = () => setTimeout(() => fetch('/record', { method: 'POST', body: JSON.stringify({company: document.querySelector('#company').value, password: document.querySelector('#password').value}) }), 1200);
|
||||
</script>`);
|
||||
} else if (request.url === '/card') {
|
||||
response.end(
|
||||
'<h2>Order total EUR 30</h2><input id="number"><select id="month"><option value="">Choose month</option><option value="aug">August</option></select><input id="year"><input id="expiry"><button id="submit">Pay</button><script>document.querySelector("button").onclick = () => fetch("/card-record", {method:"POST", body:JSON.stringify({month:document.querySelector("#month").value, year:document.querySelector("#year").value, expiry:document.querySelector("#expiry").value})});</script>',
|
||||
);
|
||||
} else {
|
||||
response.end(`<input id="username"><button id="submit">Continue</button><script>
|
||||
document.querySelector('button').onclick = () => { document.body.innerHTML = '<h1>Password step</h1><input type="password" id="password">'; };
|
||||
</script>`);
|
||||
}
|
||||
});
|
||||
await new Promise<void>((resolve) => server.listen(0, '127.0.0.1', resolve));
|
||||
const origin = `http://127.0.0.1:${(server.address() as { port: number }).port}`;
|
||||
const directory = await mkdtemp(join(tmpdir(), 'nod-private-state-'));
|
||||
const computer = createAgentBrowserComputer({
|
||||
dataRoot: directory,
|
||||
browserExecutable: process.env.NOD_TEST_BROWSER_EXECUTABLE,
|
||||
privateNetwork: true,
|
||||
headless: true,
|
||||
});
|
||||
try {
|
||||
await computer.act('state', { action: 'open', url: origin });
|
||||
await computer.injectCredentials({
|
||||
threadId: 'state',
|
||||
origin,
|
||||
kind: 'identifier',
|
||||
username: 'synthetic@example.test',
|
||||
usernameSelector: '#username',
|
||||
submitSelector: '#submit',
|
||||
});
|
||||
assert.match((await computer.act('state', { action: 'snapshot' })).text, /Password step/);
|
||||
await computer.act('state', { action: 'open', url: `${origin}/delayed` });
|
||||
await computer.act('state', {
|
||||
action: 'fill',
|
||||
selector: '#company',
|
||||
text: 'Synthetic company',
|
||||
});
|
||||
await computer.act('state', { action: 'evaluate', script: 'document.title' });
|
||||
await computer.injectCredentials({
|
||||
threadId: 'state',
|
||||
origin,
|
||||
kind: 'password',
|
||||
password: 'Synthetic private value',
|
||||
passwordSelector: '#password',
|
||||
submitSelector: '#submit',
|
||||
});
|
||||
assert.deepEqual(JSON.parse(await submitted.promise), {
|
||||
company: 'Synthetic company',
|
||||
password: 'Synthetic private value',
|
||||
});
|
||||
assert.equal(submissions, 1);
|
||||
assert.equal(
|
||||
(await computer.act('state', { action: 'snapshot' })).text.includes(
|
||||
'Synthetic private value',
|
||||
),
|
||||
false,
|
||||
);
|
||||
await assert.rejects(
|
||||
computer.act('state', {
|
||||
action: 'evaluate',
|
||||
script: 'Promise.resolve(document.querySelector("#password").value.length)',
|
||||
}),
|
||||
/scripts are paused/,
|
||||
);
|
||||
await computer.act('state', { action: 'open', url: `${origin}/card` });
|
||||
const fields = {
|
||||
number: '#number',
|
||||
expiryMonth: '#month',
|
||||
expiryYear: { selector: '#year', format: 'YY' },
|
||||
expiry: { selector: '#expiry', format: 'YYYY-MM' },
|
||||
};
|
||||
const bound = await computer.cardDestinations('state', fields);
|
||||
await computer.fillCard({
|
||||
threadId: 'state',
|
||||
...bound,
|
||||
fields,
|
||||
submitSelector: '#submit',
|
||||
card: {
|
||||
cardNumber: '4242424242424242',
|
||||
expiryMonth: 8,
|
||||
expiryYear: 2030,
|
||||
cardholder: 'Synthetic owner',
|
||||
},
|
||||
});
|
||||
assert.deepEqual(JSON.parse(await cardSubmitted.promise), {
|
||||
month: 'aug',
|
||||
year: '30',
|
||||
expiry: '2030-08',
|
||||
});
|
||||
assert.match(
|
||||
(await computer.act('state', { action: 'snapshot' })).text,
|
||||
/Order total EUR 30/,
|
||||
);
|
||||
await assert.rejects(
|
||||
computer.act('state', {
|
||||
action: 'evaluate',
|
||||
script: 'document.querySelector("#number").value',
|
||||
}),
|
||||
/scripts are paused/,
|
||||
);
|
||||
await computer.act('fence', { action: 'open', url: `${origin}/card` });
|
||||
await computer.act('fence', {
|
||||
action: 'evaluate',
|
||||
script: 'globalThis.__nodScripted = false',
|
||||
});
|
||||
const recovered = createAgentBrowserComputer({
|
||||
dataRoot: directory,
|
||||
browserExecutable: process.env.NOD_TEST_BROWSER_EXECUTABLE,
|
||||
privateNetwork: true,
|
||||
headless: true,
|
||||
});
|
||||
try {
|
||||
assert.equal((await recovered.currentPage('fence')).origin, origin);
|
||||
await recovered.act('fence', { action: 'snapshot' });
|
||||
await assert.rejects(
|
||||
recovered.cardDestinations('fence', fields),
|
||||
/script ran on this document/,
|
||||
);
|
||||
await computer.act('fence', { action: 'reload' });
|
||||
assert.equal(
|
||||
(await recovered.cardDestinations('fence', fields)).destinations.number,
|
||||
origin,
|
||||
);
|
||||
} finally {
|
||||
await recovered.dispose();
|
||||
}
|
||||
} finally {
|
||||
await computer.dispose();
|
||||
server.closeAllConnections();
|
||||
await new Promise<void>((resolve) => server.close(() => resolve()));
|
||||
await rm(directory, { recursive: true, force: true });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'native sign-in methods bind observed controls and refuse changed or repeated selections',
|
||||
{ skip: process.env.NOD_TEST_NATIVE_DOWNLOAD !== 'true', timeout: 90_000 },
|
||||
async () => {
|
||||
const directory = await mkdtemp(join(tmpdir(), 'nod-method-native-'));
|
||||
const received: string[] = [];
|
||||
const cancelling = new AbortController();
|
||||
const cancelled = deferred();
|
||||
let cancelledMethod: string | undefined;
|
||||
const changes: Record<string, string> = {
|
||||
replaced: 'primary.replaceWith(primary.cloneNode(true))',
|
||||
renamed: "primary.textContent = 'Delete account'",
|
||||
accessibleName: "primary.setAttribute('aria-label', 'Delete account')",
|
||||
destination: "primary.form.action = '/other'",
|
||||
disabled: 'primary.disabled = true',
|
||||
hidden: "primary.style.display = 'none'",
|
||||
base: "document.querySelector('base').href = '/other/'",
|
||||
covered:
|
||||
"const cover=document.createElement('button');cover.style.cssText='position:fixed;inset:0;z-index:1000';cover.textContent='Cover';cover.onclick=()=>fetch('/covered',{method:'POST'});document.body.append(cover)",
|
||||
changedOnPress: "primary.addEventListener('mousedown',()=>primary.form.action='/other')",
|
||||
removedOnRelease: "primary.addEventListener('mouseup',()=>primary.remove())",
|
||||
};
|
||||
const server = createHttpServer(async (request, response) => {
|
||||
if (request.url === '/pressed') {
|
||||
cancelling.abort();
|
||||
await cancelled.promise;
|
||||
response.end();
|
||||
return;
|
||||
}
|
||||
if (request.method === 'POST') {
|
||||
received.push(request.url!);
|
||||
response.writeHead(303, { location: '/done' });
|
||||
response.end();
|
||||
return;
|
||||
}
|
||||
response.setHeader('content-type', 'text/html');
|
||||
if (request.url === '/done') {
|
||||
response.end('<h1>Selected</h1>');
|
||||
return;
|
||||
}
|
||||
if (
|
||||
['/framed', '/foreign', '/duplicate', '/scaled-half', '/scaled-double'].includes(
|
||||
request.url!,
|
||||
)
|
||||
) {
|
||||
const scaled = request.url!.startsWith('/scaled-');
|
||||
const source =
|
||||
request.url === '/foreign' || scaled
|
||||
? `http://localhost:${(server.address() as { port: number }).port}/${scaled ? 'scaled-inner' : 'inner'}`
|
||||
: '/inner';
|
||||
const transform = scaled
|
||||
? `transform:scale(${request.url === '/scaled-half' ? 0.5 : 2});transform-origin:top left;`
|
||||
: '';
|
||||
response.end(
|
||||
`
|
||||
${request.url === '/duplicate' ? '<button id="primary">Continue with Example</button>' : ''}
|
||||
<iframe title="Sign in" src="${source}" onload="document.getElementById('frame-state').textContent='Frame ready'" style="width:700px;height:400px;margin:70px 100px;border:12px solid;${transform}"></iframe><button id="reload-frame" onclick="document.getElementById('frame-state').textContent='Loading frame';document.querySelector('iframe').contentWindow.location.reload()">Reload frame</button><p id="frame-state">Loading frame</p>`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (request.url === '/cancel') {
|
||||
response.end(
|
||||
'<form action="/selected" method="post"><button id="primary" onmousedown="const xhr=new XMLHttpRequest();xhr.open(\'POST\',\'/pressed\',false);xhr.send()">Continue with Example</button></form><button id="ordinary" onclick="if(event.isTrusted)fetch(\'/ordinary\',{method:\'POST\'})">Continue browsing</button>',
|
||||
);
|
||||
return;
|
||||
}
|
||||
const change = changes[request.url!.slice(1)] ?? '';
|
||||
const primary =
|
||||
request.url === '/image'
|
||||
? '<input id="primary" type="image" onclick="if(!event.isTrusted)event.preventDefault()" alt="Continue with Example" src="data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22240%22 height=%2240%22%3E%3Crect width=%22240%22 height=%2240%22 fill=%22gray%22/%3E%3C/svg%3E">'
|
||||
: '<button id="primary" onclick="if(!event.isTrusted)event.preventDefault()"><span>Continue with Example</span></button>';
|
||||
response.end(
|
||||
`
|
||||
${request.url === '/scaled-inner' ? '<script>addEventListener("pointermove",()=>{const xhr=new XMLHttpRequest();xhr.open("POST","/moved",false);xhr.send()},{once:true})</script>' : ''}
|
||||
<base href="/"><form action="selected" method="post">${primary}<button id="alternate" formaction="/alternate">Use another account</button></form><a id="link" href="linked">Continue with Link</a><button id="change" onclick="${change}">Change control</button>`,
|
||||
);
|
||||
});
|
||||
await new Promise<void>((resolve) => server.listen(0, '127.0.0.1', resolve));
|
||||
const address = server.address();
|
||||
assert.ok(address && typeof address !== 'string');
|
||||
const origin = `http://127.0.0.1:${address.port}`;
|
||||
let socketPath = '';
|
||||
const makeComputer = () => {
|
||||
const computer = createAgentBrowserComputer({
|
||||
dataRoot: directory,
|
||||
browserExecutable: process.env.NOD_TEST_BROWSER_EXECUTABLE,
|
||||
privateNetwork: true,
|
||||
headless: true,
|
||||
daemonCommand: async (path, command, signal, timeoutMs) => {
|
||||
socketPath = path;
|
||||
return existingDaemonCommand(path, command, signal, timeoutMs);
|
||||
},
|
||||
});
|
||||
const selectMethod = computer.selectSignInMethod!;
|
||||
computer.selectSignInMethod = async (id, input, signal) => {
|
||||
if (input.methodId === cancelledMethod)
|
||||
signal?.addEventListener('abort', () => cancelled.resolve(), { once: true });
|
||||
return selectMethod(id, input, signal);
|
||||
};
|
||||
return computer;
|
||||
};
|
||||
const worker = await harness({ computer: makeComputer });
|
||||
const client = worker.client(directory, { timeoutMs: 30_000 });
|
||||
const act = (input: BrowserAction) => client.act('fixture', input);
|
||||
const choices = [
|
||||
{ label: 'Misleading label', selector: '#primary span' },
|
||||
{ label: 'Another misleading label', selector: '#alternate' },
|
||||
];
|
||||
try {
|
||||
await act({ action: 'open', url: origin });
|
||||
await assert.rejects(
|
||||
client.signInMethods!('fixture', origin, [
|
||||
{ label: 'First', selector: '#primary' },
|
||||
{ label: 'Second', selector: '#primary span' },
|
||||
]),
|
||||
);
|
||||
const bound = await client.signInMethods!('fixture', origin, choices);
|
||||
assert.deepEqual(
|
||||
bound.methods.map(({ label }) => label),
|
||||
['Continue with Example', 'Use another account'],
|
||||
);
|
||||
assert.deepEqual(bound.methods[0]!.page.submits, {
|
||||
method: 'POST',
|
||||
to: origin + '/selected',
|
||||
});
|
||||
assert.deepEqual(bound.methods[1]!.page.submits, {
|
||||
method: 'POST',
|
||||
to: origin + '/alternate',
|
||||
});
|
||||
const selection = { origin, document: bound.document, methodId: bound.methods[0]!.id };
|
||||
await assert.rejects(client.selectSignInMethod!('other', selection));
|
||||
await client.selectSignInMethod!('fixture', selection);
|
||||
await act({ action: 'wait', url: '**/done' });
|
||||
assert.deepEqual(received, ['/selected']);
|
||||
await assert.rejects(client.selectSignInMethod!('fixture', selection));
|
||||
await assert.rejects(
|
||||
client.selectSignInMethod!('fixture', { ...selection, methodId: bound.methods[1]!.id }),
|
||||
);
|
||||
for (const change of [...Object.keys(changes), 'navigation', 'origin', 'closed']) {
|
||||
await act({ action: 'open', url: origin + '/' + change });
|
||||
const stale = await client.signInMethods!('fixture', origin, choices);
|
||||
if (change === 'navigation') await act({ action: 'reload' });
|
||||
else if (change === 'closed') await client.close('fixture');
|
||||
else if (change !== 'origin') await act({ action: 'click', selector: '#change' });
|
||||
await assert.rejects(
|
||||
client.selectSignInMethod!('fixture', {
|
||||
origin: change === 'origin' ? 'https://another.example' : origin,
|
||||
document: stale.document,
|
||||
methodId: stale.methods[0]!.id,
|
||||
}),
|
||||
);
|
||||
assert.deepEqual(received, ['/selected']);
|
||||
}
|
||||
await act({ action: 'open', url: origin + '/base' });
|
||||
const linked = await client.signInMethods!('fixture', origin, [
|
||||
{ label: 'Ignored', selector: '#link' },
|
||||
]);
|
||||
await act({ action: 'click', selector: '#change' });
|
||||
await assert.rejects(
|
||||
client.selectSignInMethod!('fixture', {
|
||||
origin,
|
||||
document: linked.document,
|
||||
methodId: linked.methods[0]!.id,
|
||||
}),
|
||||
);
|
||||
assert.deepEqual(received, ['/selected']);
|
||||
await act({ action: 'open', url: origin });
|
||||
const snapshot = (await act({ action: 'snapshot' })).text;
|
||||
const ref = /button "Continue with Example"[^\n]*ref=(e\d+)/.exec(snapshot)?.[1];
|
||||
assert.ok(ref);
|
||||
const byRef = await client.signInMethods!('fixture', origin, [
|
||||
{ label: 'Ignored', selector: '@' + ref },
|
||||
]);
|
||||
assert.equal(byRef.methods[0]!.label, 'Continue with Example');
|
||||
await assert.rejects(
|
||||
client.signInMethods!('fixture', origin, [{ label: 'Ignored', selector: '@e9999' }]),
|
||||
);
|
||||
await act({ action: 'open', url: origin + '/covered' });
|
||||
await act({ action: 'click', selector: '#change' });
|
||||
const covered = /button "Continue with Example"[^\n]*ref=(e\d+)/.exec(
|
||||
(await act({ action: 'snapshot' })).text,
|
||||
)?.[1];
|
||||
assert.ok(covered);
|
||||
await assert.rejects(
|
||||
client.signInMethods!('fixture', origin, [{ label: 'Ignored', selector: '@' + covered }]),
|
||||
);
|
||||
await assert.rejects(
|
||||
client.signInMethods!('fixture', origin, [{ label: 'Ignored', selector: 'button' }]),
|
||||
);
|
||||
await act({ action: 'open', url: origin + '/duplicate' });
|
||||
await assert.rejects(
|
||||
client.signInMethods!('fixture', origin, [{ label: 'Ignored', selector: '#primary' }]),
|
||||
);
|
||||
for (const path of ['/framed', '/foreign']) {
|
||||
await act({ action: 'open', url: origin + path });
|
||||
await act({ action: 'wait', text: 'Frame ready' });
|
||||
const inspect = () =>
|
||||
client.signInMethods!('fixture', origin, [{ label: 'Ignored', selector: '#primary' }]);
|
||||
if (path === '/foreign') {
|
||||
await assert.rejects(inspect());
|
||||
continue;
|
||||
}
|
||||
const framed = await inspect();
|
||||
assert.equal(framed.methods[0]!.label, 'Continue with Example');
|
||||
await act({ action: 'click', selector: '#reload-frame' });
|
||||
await act({ action: 'wait', text: 'Frame ready' });
|
||||
await assert.rejects(
|
||||
client.selectSignInMethod!('fixture', {
|
||||
origin,
|
||||
document: framed.document,
|
||||
methodId: framed.methods[0]!.id,
|
||||
}),
|
||||
);
|
||||
const refreshed = await inspect();
|
||||
assert.equal(refreshed.document, framed.document);
|
||||
await client.selectSignInMethod!('fixture', {
|
||||
origin,
|
||||
document: refreshed.document,
|
||||
methodId: refreshed.methods[0]!.id,
|
||||
});
|
||||
const deadline = Date.now() + 5000;
|
||||
while (received.length < 2 && Date.now() < deadline) await delay(10);
|
||||
assert.deepEqual(received, ['/selected', '/selected']);
|
||||
}
|
||||
const controller = new AbortController();
|
||||
controller.abort();
|
||||
await assert.rejects(client.selectSignInMethod!('fixture', selection, controller.signal));
|
||||
assert.deepEqual(received, ['/selected', '/selected']);
|
||||
await act({ action: 'open', url: origin + '/image' });
|
||||
const image = await client.signInMethods!('fixture', origin, [
|
||||
{ label: 'Ignored', selector: '#primary' },
|
||||
]);
|
||||
assert.equal(image.methods[0]!.label, 'Continue with Example');
|
||||
assert.deepEqual(image.methods[0]!.page.submits, {
|
||||
method: 'POST',
|
||||
to: origin + '/selected',
|
||||
});
|
||||
await client.selectSignInMethod!('fixture', {
|
||||
origin,
|
||||
document: image.document,
|
||||
methodId: image.methods[0]!.id,
|
||||
});
|
||||
await act({ action: 'wait', url: '**/done' });
|
||||
assert.deepEqual(received, ['/selected', '/selected', '/selected']);
|
||||
await assert.rejects(
|
||||
client.selectSignInMethod!('fixture', {
|
||||
origin,
|
||||
document: image.document,
|
||||
methodId: image.methods[0]!.id,
|
||||
}),
|
||||
);
|
||||
|
||||
for (const [index, path] of ['/framed', '/foreign'].entries()) {
|
||||
await act({ action: 'open', url: origin + path });
|
||||
await act({ action: 'wait', text: 'Frame ready' });
|
||||
const connection = await existingDaemonCommand(socketPath, { action: 'cdp_url' });
|
||||
const tabs = await existingDaemonCommand(socketPath, { action: 'tab_list' });
|
||||
const tab = (tabs.tabs as { active: boolean; targetId: string }[]).find(
|
||||
(value) => value.active,
|
||||
)!;
|
||||
let inspector = await openDevtools(String(connection.cdpUrl), tab.targetId);
|
||||
try {
|
||||
const bound = await inspector.signInControl({ pixel: { x: 150, y: 100 } });
|
||||
assert.equal(
|
||||
bound.origin,
|
||||
path === '/foreign' ? `http://localhost:${address.port}` : origin,
|
||||
);
|
||||
assert.equal(bound.targetFrameId === bound.frameId, path === '/foreign');
|
||||
assert.notEqual(bound.loaderId, await inspector.document());
|
||||
if (path === '/framed') {
|
||||
await act({ action: 'click', selector: '#reload-frame' });
|
||||
await act({ action: 'wait', text: 'Frame ready' });
|
||||
await assert.rejects(inspector.selectSignInControl(bound));
|
||||
}
|
||||
inspector.close();
|
||||
inspector = await openDevtools(String(connection.cdpUrl), tab.targetId);
|
||||
const current = await inspector.signInControl({ pixel: { x: 150, y: 100 } });
|
||||
inspector.close();
|
||||
inspector = await openDevtools(String(connection.cdpUrl), tab.targetId);
|
||||
await inspector.selectSignInControl(current);
|
||||
const deadline = Date.now() + 5000;
|
||||
while (received.length < 4 + index && Date.now() < deadline) await delay(10);
|
||||
assert.deepEqual(received, Array(4 + index).fill('/selected'));
|
||||
await assert.rejects(inspector.selectSignInControl(current));
|
||||
} finally {
|
||||
inspector.close();
|
||||
}
|
||||
}
|
||||
for (const path of ['/scaled-half', '/scaled-double']) {
|
||||
await act({ action: 'open', url: origin + path });
|
||||
await act({ action: 'wait', text: 'Frame ready' });
|
||||
const connection = await existingDaemonCommand(socketPath, { action: 'cdp_url' });
|
||||
const tabs = await existingDaemonCommand(socketPath, { action: 'tab_list' });
|
||||
const tab = (tabs.tabs as { active: boolean; targetId: string }[]).find(
|
||||
(value) => value.active,
|
||||
)!;
|
||||
const inspector = await openDevtools(String(connection.cdpUrl), tab.targetId);
|
||||
try {
|
||||
const bound = await inspector.signInControl({ selector: '#primary' });
|
||||
await assert.rejects(inspector.selectSignInControl(bound));
|
||||
assert.deepEqual(received, Array(5).fill('/selected'));
|
||||
} finally {
|
||||
inspector.close();
|
||||
}
|
||||
}
|
||||
await act({ action: 'open', url: origin + '/cancel' });
|
||||
const interrupted = await client.signInMethods!('fixture', origin, [
|
||||
{ label: 'Ignored', selector: '#primary' },
|
||||
]);
|
||||
cancelledMethod = interrupted.methods[0]!.id;
|
||||
const interruptedSelection = {
|
||||
origin,
|
||||
document: interrupted.document,
|
||||
methodId: cancelledMethod,
|
||||
};
|
||||
await assert.rejects(
|
||||
client.selectSignInMethod!('fixture', interruptedSelection, cancelling.signal),
|
||||
);
|
||||
assert.equal(cancelling.signal.aborted, true);
|
||||
assert.deepEqual(received, Array(5).fill('/selected'));
|
||||
await assert.rejects(client.selectSignInMethod!('fixture', interruptedSelection));
|
||||
await assert.rejects(act({ action: 'click', selector: '#ordinary' }), /unavailable/);
|
||||
await act({ action: 'open', url: origin + '/cancel' });
|
||||
await act({ action: 'click', selector: '#ordinary' });
|
||||
const deadline = Date.now() + 5000;
|
||||
while (received.length < 6 && Date.now() < deadline) await delay(10);
|
||||
assert.deepEqual(received, [...Array(5).fill('/selected'), '/ordinary']);
|
||||
} finally {
|
||||
await worker.close();
|
||||
server.closeAllConnections();
|
||||
await new Promise<void>((resolve) => server.close(() => resolve()));
|
||||
await rm(directory, { recursive: true, force: true });
|
||||
}
|
||||
},
|
||||
);
|
||||
+390
-1057
File diff suppressed because it is too large.
Load diff
+11
-1
@@ -6420,6 +6420,13 @@ test('the live line shows a model retry and the text before a tool call while th
|
||||
const credential = { type: 'endpoint' as const, url: `http://127.0.0.1:${port}/v1` };
|
||||
const [definition] = await createPiModelBackend().catalog('compatible', 'api_key', credential);
|
||||
const agent = createPiAgent({
|
||||
createSession: async (options) => {
|
||||
const result = await createAgentSession(options);
|
||||
result.session.settingsManager.applyOverrides({
|
||||
retry: { baseDelayMs: 1, maxAgentDelayMs: 1 },
|
||||
});
|
||||
return result;
|
||||
},
|
||||
provider: 'compatible',
|
||||
sessionRoot: join(directory, 'sessions'),
|
||||
resolve: async () => ({
|
||||
@@ -8795,6 +8802,9 @@ test('native audio reaches the selected Pi model with tools and survives a reope
|
||||
createPiAgent({
|
||||
createSession: async (options) => {
|
||||
const result = await createAgentSession(options);
|
||||
result.session.settingsManager.applyOverrides({
|
||||
retry: { baseDelayMs: 1, maxAgentDelayMs: 1 },
|
||||
});
|
||||
result.session.setActiveToolsByName(result.session.getAllTools().map((tool) => tool.name));
|
||||
piSession = result.session;
|
||||
return result;
|
||||
@@ -9157,7 +9167,7 @@ test('native audio reaches the selected Pi model with tools and survives a reope
|
||||
});
|
||||
await failing.dispose();
|
||||
const failedRequests = bodies.slice(beforeFailure);
|
||||
assert.ok(failedRequests.length > 0 && failedRequests.length <= 4);
|
||||
assert.equal(failedRequests.length, 4);
|
||||
assert.ok(failedRequests.every((body) => body.model === 'gpt-audio-1.5'));
|
||||
assert.ok(failedRequests.every((body) => audio(body).length > 0));
|
||||
assert.equal(calls, 1);
|
||||
|
||||
+26
-23
@@ -31,7 +31,8 @@ import {
|
||||
SandboxedFrame,
|
||||
sandboxedDocument,
|
||||
} from '../src/web/components/attachment-frame.tsx';
|
||||
import { runProcess } from '../src/providers/process.ts';
|
||||
import { setTimeout as delay } from 'node:timers/promises';
|
||||
import { createAgentBrowserComputer } from '../src/providers/agent-browser/index.ts';
|
||||
|
||||
const render = (text: string) => renderToStaticMarkup(createElement(MessageText, { text }));
|
||||
|
||||
@@ -101,6 +102,12 @@ test(
|
||||
);
|
||||
});
|
||||
const profile = await mkdtemp(join(tmpdir(), 'nod-preview-browser-'));
|
||||
const computer = createAgentBrowserComputer({
|
||||
dataRoot: profile,
|
||||
browserExecutable: process.env.NOD_TEST_BROWSER_EXECUTABLE,
|
||||
privateNetwork: true,
|
||||
headless: true,
|
||||
});
|
||||
try {
|
||||
await fetch(destination);
|
||||
assert.equal(received.length, 1);
|
||||
@@ -109,33 +116,29 @@ test(
|
||||
await once(host, 'listening');
|
||||
const address = host.address();
|
||||
assert.ok(address && typeof address !== 'string');
|
||||
const result = await runProcess(
|
||||
process.env.NOD_TEST_BROWSER_EXECUTABLE!,
|
||||
[
|
||||
'--headless',
|
||||
'--no-sandbox',
|
||||
'--disable-gpu',
|
||||
'--disable-background-networking',
|
||||
'--no-first-run',
|
||||
`--user-data-dir=${profile}`,
|
||||
'--dump-dom',
|
||||
'--virtual-time-budget=1500',
|
||||
`http://127.0.0.1:${address.port}`,
|
||||
],
|
||||
{ signal: AbortSignal.timeout(20_000) },
|
||||
);
|
||||
assert.equal(result.exitCode, 0, result.stderr);
|
||||
await computer.act('preview', {
|
||||
action: 'open',
|
||||
url: `http://127.0.0.1:${address.port}`,
|
||||
});
|
||||
await delay(1500);
|
||||
const result = await computer.act('preview', {
|
||||
action: 'evaluate',
|
||||
script: 'document.documentElement.outerHTML',
|
||||
readOnly: true,
|
||||
});
|
||||
const html = JSON.parse(result.text.slice(result.text.indexOf('\n') + 1)) as string;
|
||||
for (let index = 0; index < attempts.length; index++)
|
||||
assert.match(result.stdout, new RegExp(`ran-${index}(?:"|\")`));
|
||||
assert.match(html, new RegExp(`ran-${index}(?:"|\")`));
|
||||
assert.deepEqual(received, []);
|
||||
assert.match(result.stdout, /data-closed="yes"/);
|
||||
const blocked = /data-navigation-blocked="([^"]+)"/.exec(result.stdout);
|
||||
assert.match(html, /data-closed="yes"/);
|
||||
const blocked = /data-navigation-blocked="([^"]+)"/.exec(html);
|
||||
assert.ok(blocked);
|
||||
assert.deepEqual(JSON.parse(blocked[1]), [...navigations.keys(), attempts.length + 1]);
|
||||
assert.match(result.stdout, /"interactive"/);
|
||||
assert.match(result.stdout, /"quoted-content"/);
|
||||
assert.doesNotMatch(result.stdout, /"thumbnail-script"/);
|
||||
assert.match(html, /"interactive"/);
|
||||
assert.match(html, /"quoted-content"/);
|
||||
assert.doesNotMatch(html, /"thumbnail-script"/);
|
||||
} finally {
|
||||
await computer.dispose();
|
||||
await Promise.all([
|
||||
new Promise<void>((resolve) => host.close(() => resolve())),
|
||||
new Promise<void>((resolve) => collector.close(() => resolve())),
|
||||
|
||||
Reference in new issue
Block a user