Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/build-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,6 @@ jobs:
echo "has_signing_secrets=true" >> "$GITHUB_OUTPUT"
fi

- name: Typecheck desktop and launcher
run: pnpm exec turbo run typecheck --filter=@bb/desktop --filter=bb-app --output-logs=new-only

- name: Package x64 installer
env:
WIN_CSC_LINK: ${{ secrets.WINDOWS_CERTIFICATE_PFX }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ jobs:
TURBO_CACHE_RESTORE_OUTCOME: ${{ steps.cache.outcome }}
run: bash .github/actions/setup-workspace/install-dependencies.sh --ignore-scripts --filter bb --filter "@bb/process-utils..." --filter "@bb/host-workspace..." --filter "@bb/host-watcher..." --filter "@bb/agent-runtime..." --filter "@bb/provider-bridge-protocol..." --filter "@bb/provider-bridge-acp..." --filter "@bb/host-daemon-contract..." --filter "@bb/config..." --filter "@bb/db..." --filter "bb-plugin-provider-acp..." --filter "bb-plugin-provider-codex..." --filter "bb-plugin-provider-claude-code..." --filter "bb-plugin-echo-provider..." --filter "@bb/app..."

- name: Typecheck and test foundation packages
- name: Lint and test foundation packages
shell: bash
run: pnpm exec turbo run lint typecheck test --filter=@bb/process-utils --filter=@bb/host-workspace --filter=@bb/host-watcher --filter=@bb/agent-runtime --filter=@bb/provider-bridge-protocol --filter=@bb/provider-bridge-acp --filter=@bb/host-daemon-contract --filter=@bb/config --filter=@bb/db --cache-dir="${TURBO_CACHE_DIR:-.turbo/cache}" --continue --concurrency=2 --output-logs=new-only --summarize
run: pnpm exec turbo run lint test --filter=@bb/process-utils --filter=@bb/host-workspace --filter=@bb/host-watcher --filter=@bb/agent-runtime --filter=@bb/provider-bridge-protocol --filter=@bb/provider-bridge-acp --filter=@bb/host-daemon-contract --filter=@bb/config --filter=@bb/db --cache-dir="${TURBO_CACHE_DIR:-.turbo/cache}" --continue --concurrency=2 --output-logs=new-only --summarize

- name: Bound saved Turbo cache
run: node scripts/prune-turbo-cache.mjs --dir .turbo/cache --max-size-mb 256 --keep-run-summaries .turbo/runs
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/publish-bb-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,6 @@ jobs:
echo "version=${NIGHTLY_VERSION}" >> "$GITHUB_OUTPUT"
echo "Applied bb-app and desktop version ${NIGHTLY_VERSION}."

- name: Typecheck desktop and launcher
run: pnpm exec turbo run typecheck --filter=@bb/desktop --filter=bb-app --output-logs=new-only

- name: Package x64 nightly installer
# Signs when the Windows certificate secrets exist; without them the
# installer is unsigned and Windows SmartScreen warns before running it.
Expand Down
4 changes: 2 additions & 2 deletions apps/ai-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "wrangler dev",
"deploy": "wrangler deploy",
"test": "vitest run --config vitest.config.ts",
"typecheck": "tsc --noEmit"
"typecheck": "tsrs --noEmit"
},
"dependencies": {
"@bb/connect-db": "workspace:*",
Expand All @@ -21,8 +21,8 @@
"better-sqlite3": "12.10.0",
"esbuild": "^0.28.1",
"miniflare": "^4.20260701.0",
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-7": "npm:typescript@^7.0.2",
"vitest": "^4.1.1",
"wrangler": "^4.100.0"
}
Expand Down
4 changes: 2 additions & 2 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"storybook": "ladle serve",
"storybook:build": "ladle build",
"lint": "oxlint src vite.config.ts vite.dev.config.ts vite-bundle-stats.ts vite-font-preload.ts vite-split-prefetch.ts vite-forkable-plugin-paths.ts vite-shared-ui-seam.ts vite-react-compiler.ts",
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.node.json",
"typecheck": "tsrs --noEmit && tsrs --noEmit -p tsconfig.node.json",
"test": "node scripts/generate-pwa-icons.mjs --check && vitest run --config vitest.config.ts",
"bench": "cross-env BB_SIDEBAR_BENCH=1 PROMPTBOX_PERF=1 vitest run --config vitest.config.ts src/components/sidebar/sidebar.bench.test.tsx src/components/promptbox/editor/prompt-paste-performance.test.ts"
},
Expand Down Expand Up @@ -137,8 +137,8 @@
"remark-parse": "^11.0.0",
"sharp": "^0.34.5",
"tailwindcss": "^4.3.0",
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-7": "npm:typescript@^7.0.2",
"unified": "^11.0.5",
"vite": "^8.0.12"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/lib/system-config-atoms.local-access.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe("local host daemon access atoms", () => {
await store.get(localHostDaemonAccessStateAtom);
expect(mocks.fetchSdkSystemConfig).not.toHaveBeenCalled();
mocks.fetchSdkSystemConfig.mockImplementation(
({ signal } = {}) =>
({ signal }: { signal?: AbortSignal } = {}) =>
new Promise((resolve) => {
requests.push({ resolve });
signal?.addEventListener(
Expand Down
6 changes: 3 additions & 3 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "node ../../scripts/build-node-entry.mjs src/index.ts dist/index.js --clean-dist --split",
"start": "node dist/index.js",
"clean": "rimraf dist",
"typecheck": "tsc --noEmit",
"typecheck": "tsrs --noEmit",
"test": "vitest run"
},
"dependencies": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"@types/node": "^22.0.0",
"esbuild": "^0.28.0",
"tailwindcss": "^4.3.0",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-7": "npm:typescript@^7.0.2"
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"typescript": "npm:@typescript/typescript6@^6.0.2"
}
}
4 changes: 2 additions & 2 deletions apps/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "wrangler dev",
"deploy": "wrangler deploy",
"test": "vitest run --config vitest.config.ts",
"typecheck": "tsc --noEmit"
"typecheck": "tsrs --noEmit"
},
"dependencies": {
"@bb/connect-db": "workspace:*",
Expand All @@ -25,8 +25,8 @@
"better-auth": "^1.6.23",
"esbuild": "^0.28.1",
"miniflare": "^4.20260701.0",
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-7": "npm:typescript@^7.0.2",
"wrangler": "^4.100.0"
}
}
3 changes: 2 additions & 1 deletion apps/demo-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "wrangler dev",
"deploy": "wrangler deploy",
"typecheck": "tsc --noEmit",
"typecheck": "tsrs --noEmit",
"test": "vitest run --config vitest.config.ts",
"build": "tsx scripts/build-assets.ts"
},
Expand All @@ -22,6 +22,7 @@
"@types/node": "^22.0.0",
"bb-plugin-navigation": "workspace:*",
"bb-plugin-thread-list": "workspace:*",
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"tsx": "^4.23.1",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"vitest": "^4.1.1",
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"smoke:browser-cdp": "node scripts/smoke-browser-cdp.mjs",
"start": "pnpm run package && node scripts/run-packaged-app.mjs",
"test": "install-electron && vitest run --config vitest.config.ts",
"typecheck": "tsc --noEmit",
"typecheck": "tsrs --noEmit",
"smoke:browser-broker": "node scripts/smoke-browser-broker.mjs",
"smoke:browser-address": "node scripts/smoke-browser-address.mjs"
},
Expand Down Expand Up @@ -57,9 +57,9 @@
"electron-builder-squirrel-windows": "26.15.7",
"esbuild": "^0.28.0",
"rimraf": "^6.1.0",
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"tsx": "^4.23.1",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-7": "npm:typescript@^7.0.2",
"vitest": "^4.1.1",
"yaml": "^2.8.2"
}
Expand Down
8 changes: 5 additions & 3 deletions apps/desktop/src/desktop-browser-capture.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { nativeImage, type NativeImage, type WebContents } from "electron";
import { jsonObjectSchema } from "@bb/domain";
import { z } from "zod";
import type { DesktopBrowserCdpPage } from "./desktop-browser-cdp.js";
import {
Expand Down Expand Up @@ -27,7 +28,7 @@ export async function captureDesktopBrowserCdpScreenshot(
let frameTimer: ReturnType<typeof setTimeout> | undefined;
const command = contents.debugger
.sendCommand("Page.captureScreenshot", params, sessionId)
.then((result) => z.record(z.string(), z.json()).parse(result))
.then((result) => jsonObjectSchema.parse(result))
.finally(() => {
finished = true;
finish();
Expand Down Expand Up @@ -107,10 +108,11 @@ export async function captureDesktopBrowserPage(
if (!debuggerApi.isAttached()) {
debuggerApi.attach("1.3");
ownsAttachment = true;
previousBackgroundThrottling = getDesktopBrowserThrottling(contents);
previousBackgroundThrottling =
getDesktopBrowserThrottling(contents);
setDesktopBrowserThrottling(contents, false);
debuggerApi.on("detach", detached);
z.record(z.string(), z.json()).parse(
jsonObjectSchema.parse(
await debuggerApi.sendCommand(
"Emulation.setFocusEmulationEnabled",
{ enabled: true },
Expand Down
8 changes: 4 additions & 4 deletions apps/desktop/src/desktop-browser-cdp-adapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Event, WebContents } from "electron";
import { jsonObjectSchema } from "@bb/domain";
import { z } from "zod";
import { captureDesktopBrowserCdpScreenshot } from "./desktop-browser-capture.js";
import type {
Expand All @@ -12,10 +13,9 @@ import {
setDesktopBrowserThrottling,
} from "./desktop-browser-throttling.js";

const cdpObjectSchema = z.record(z.string(), z.json());
const cdpMessageSchema = z.object({
method: z.string().min(1),
params: cdpObjectSchema,
params: jsonObjectSchema,
sessionId: z.string(),
});

Expand Down Expand Up @@ -99,7 +99,7 @@ function createPage(
const ready = nativeDebugger
.sendCommand("Emulation.setFocusEmulationEnabled", { enabled: true })
.then((result) => {
cdpObjectSchema.parse(result);
jsonObjectSchema.parse(result);
if (generation === attachmentGeneration) attachmentReady = null;
});
attachmentReady = ready;
Expand Down Expand Up @@ -152,7 +152,7 @@ function createPage(
}
}
signal?.throwIfAborted();
const result = cdpObjectSchema.parse(
const result = jsonObjectSchema.parse(
await (method === "Page.captureScreenshot"
? captureDesktopBrowserCdpScreenshot(webContents, params, sessionId)
: nativeDebugger.sendCommand(method, params, sessionId)),
Expand Down
6 changes: 3 additions & 3 deletions apps/desktop/src/desktop-browser-cdp.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { createHash, randomBytes, randomUUID } from "node:crypto";
import { createServer } from "node:http";
import { WebSocket, WebSocketServer } from "ws";
import { jsonObjectSchema } from "@bb/domain";
import { z } from "zod";

const objectSchema = z.record(z.string(), z.json());
type CdpObject = z.infer<typeof objectSchema>;
type CdpObject = z.infer<typeof jsonObjectSchema>;
const commandSchema = z
.object({
id: z.number().int().nonnegative(),
method: z.string().min(1).max(256),
params: objectSchema.default({}),
params: jsonObjectSchema.default({}),
sessionId: z.string().min(1).max(256).optional(),
})
.strict();
Expand Down
8 changes: 4 additions & 4 deletions apps/desktop/test/desktop-browser-cdp.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { once } from "node:events";
import { afterEach, describe, expect, it, vi } from "vitest";
import { WebSocket } from "ws";
import { jsonObjectSchema } from "@bb/domain";
import { z } from "zod";
import {
createDesktopBrowserCdpBridge,
Expand All @@ -11,8 +12,7 @@ import {
} from "../src/desktop-browser-cdp.js";
import { createDeferredPromise } from "@bb/test-helpers";

const messageSchema = z.record(z.string(), z.json());
type Message = z.infer<typeof messageSchema>;
type Message = z.infer<typeof jsonObjectSchema>;
const disposers: Array<() => Promise<void>> = [];

afterEach(async () => {
Expand Down Expand Up @@ -143,7 +143,7 @@ async function connect(endpoint: string) {
await once(socket, "open");
const messages: Message[] = [];
socket.on("message", (data) =>
messages.push(messageSchema.parse(JSON.parse(data.toString()))),
messages.push(jsonObjectSchema.parse(JSON.parse(data.toString()))),
);
disposers.push(async () => {
if (socket.readyState === WebSocket.CLOSED) return;
Expand All @@ -164,7 +164,7 @@ async function connect(endpoint: string) {
2000,
);
const onMessage = (data: Buffer) => {
const message = messageSchema.parse(JSON.parse(data.toString()));
const message = jsonObjectSchema.parse(JSON.parse(data.toString()));
if (message.id !== requestId) return;
clearTimeout(timer);
socket.off("message", onMessage);
Expand Down
12 changes: 6 additions & 6 deletions apps/desktop/test/fixtures/browser-cdp-smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { join } from "node:path";
import { promisify } from "node:util";
import { app, BrowserWindow, nativeImage } from "electron";
import { WebSocket, WebSocketServer } from "ws";
import { jsonObjectSchema } from "@bb/domain";
import { z } from "zod";
import { desktopBrowserResultSchemas } from "@bb/host-daemon-contract";
import {
Expand All @@ -22,8 +23,7 @@ import { createDesktopBrowserBroker } from "../../src/desktop-browser-broker.js"
const execute = promisify(execFile);
const keepAlive = setInterval(() => {}, 1000);
app.once("quit", () => clearInterval(keepAlive));
const objectSchema = z.record(z.string(), z.json());
type CdpObject = z.infer<typeof objectSchema>;
type CdpObject = z.infer<typeof jsonObjectSchema>;
const configSchema = z.object({
artifacts: z.string().min(1),
devBrowser: z.string().min(1),
Expand All @@ -37,7 +37,7 @@ const targetListSchema = z.object({
});
const responseSchema = z.object({
id: z.number().optional(),
result: objectSchema.optional(),
result: jsonObjectSchema.optional(),
error: z.object({ message: z.string() }).optional(),
method: z.string().optional(),
});
Expand Down Expand Up @@ -275,7 +275,7 @@ async function main() {
.object({
id: z.number(),
method: z.string(),
params: objectSchema.optional(),
params: jsonObjectSchema.optional(),
sessionId: z.string().optional(),
})
.parse(JSON.parse(bytes.toString()));
Expand All @@ -296,7 +296,7 @@ async function main() {
else queued.push(bytes);
});
upstream.on("message", (data) => {
const message = objectSchema.parse(JSON.parse(data.toString()));
const message = jsonObjectSchema.parse(JSON.parse(data.toString()));
if (message.method === "Target.attachedToTarget") {
const info = z
.object({
Expand Down Expand Up @@ -594,7 +594,7 @@ async function main() {
);
assert.deepEqual(
z
.object({ result: z.object({ value: objectSchema }) })
.object({ result: z.object({ value: jsonObjectSchema }) })
.parse(hiddenResult).result.value,
{
title: "Other thread sentinel",
Expand Down
6 changes: 3 additions & 3 deletions apps/host-daemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"start": "node dist/index.js",
"dev": "node --conditions=source --import tsx scripts/dev-supervisor.mjs",
"clean": "rimraf dist",
"typecheck": "tsc --noEmit",
"typecheck": "tsrs --noEmit",
"test": "vitest run --config vitest.config.ts"
},
"dependencies": {
Expand Down Expand Up @@ -62,8 +62,8 @@
"@types/semver": "^7.7.1",
"esbuild": "^0.28.0",
"hono": "^4.7.0",
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"tsx": "^4.23.1",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-7": "npm:typescript@^7.0.2"
"typescript": "npm:@typescript/typescript6@^6.0.2"
}
}
3 changes: 2 additions & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:android:local": "bash scripts/build-android-local.sh",
"build:android:dev": "bash scripts/build-android-dev.sh",
"prebuild": "expo prebuild",
"typecheck": "tsc --noEmit",
"typecheck": "tsrs --noEmit",
"lint": "oxlint app src scripts plugins metro.config.js app.config.js",
"test": "vitest run --config vitest.config.ts",
"theme:generate": "node --conditions=source --import tsx scripts/generate-native-theme.ts",
Expand Down Expand Up @@ -81,6 +81,7 @@
"postcss": "^8.5.26",
"sf-symbols-typescript": "^2.2.0",
"tailwindcss": "^4.3.0",
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"vitest": "^4.1.1"
}
Expand Down
4 changes: 2 additions & 2 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dev": "node --conditions=source --import tsx scripts/dev-supervisor.mjs",
"clean": "rimraf dist",
"generate:bb-official-marketplace": "node --conditions=source --import tsx scripts/generate-bb-official-marketplace.ts",
"typecheck": "tsc --noEmit",
"typecheck": "tsrs --noEmit",
"test": "vitest run --config vitest.config.ts",
"test:provider-corpus": "vitest run --config vitest.config.ts test/provider-corpus"
},
Expand Down Expand Up @@ -64,9 +64,9 @@
"@types/semver": "^7.7.0",
"@types/ws": "^8.18.1",
"ajv": "8.20.0",
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
"tsx": "^4.23.1",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-7": "npm:typescript@^7.0.2",
"vitest": "^4.1.1"
}
}
Loading
Loading