Skip to content

Conversation

@kylecarbs
Copy link
Member

Summary

Migrates core packages from blink.so to the OSS repository:

  • database - Drizzle-based PostgreSQL access layer
  • runtime - Agent runtime wrapper
  • api - API routes and client
  • site - Next.js frontend
  • server - blink-server CLI

Changes

  • Replace MIT LICENSE with AGPL-3.0
  • Remove billing pages from site
  • Stub out compute-protocol-worker and billing dependencies
  • Remove ai-gateway tests (billing-dependent)
  • Update root package.json with new workspaces and scripts
  • Update CI workflow to build new packages
  • Add prettier-plugin-organize-imports
  • Copy root files: schema.sql, bunfig.toml, scripts/db.ts, .env.example, AGENTS.md
  • Merge .gitignore with blink.so patterns
  • Rename packages/cli to blink-cli to avoid conflict
  • Remove example/template data directories (contained secrets)

Generated with cmux

const bindings: Bindings = {
apiBaseURL: srv.url,
matchRequestHost: (hostname) => {
const regex = new RegExp(`^(.*)\.${srv.url.host}$`);

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High test

The escape sequence '.' is equivalent to just '.', so the sequence may still represent a meta-character when it is used in a
regular expression
.

Copilot Autofix

AI 2 days ago

To fix the problem, escape the period correctly in the string for the RegExp constructor. In JavaScript string literals, a literal backslash is represented as \\, so you should use "\\." in the pattern. In a template literal such as a backtick string, you must double the backslash to get a single backslash through to the final regular expression. Update the line in packages/api/src/test.ts (line 90) so that the regular expression uses "\\." rather than "\.". No additional imports, methods, or dependencies are required.


Suggested changeset 1
packages/api/src/test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/api/src/test.ts b/packages/api/src/test.ts
--- a/packages/api/src/test.ts
+++ b/packages/api/src/test.ts
@@ -87,7 +87,7 @@
   const bindings: Bindings = {
     apiBaseURL: srv.url,
     matchRequestHost: (hostname) => {
-      const regex = new RegExp(`^(.*)\.${srv.url.host}$`);
+      const regex = new RegExp(`^(.*)\\.${srv.url.host}$`);
       const exec = regex.exec(hostname);
       if (exec) {
         return exec[1];
EOF
@@ -87,7 +87,7 @@
const bindings: Bindings = {
apiBaseURL: srv.url,
matchRequestHost: (hostname) => {
const regex = new RegExp(`^(.*)\.${srv.url.host}$`);
const regex = new RegExp(`^(.*)\\.${srv.url.host}$`);
const exec = regex.exec(hostname);
if (exec) {
return exec[1];
Copilot is powered by AI and may make mistakes. Always verify output.
- Copy database, runtime, api, site, server packages from blink.so
- Replace MIT LICENSE with AGPL-3.0 from coder/coder
- Remove billing pages from site
- Stub out compute-protocol-worker and billing dependencies
- Remove ai-gateway tests (billing-dependent)
- Update root package.json with new workspaces and scripts
- Update CI workflow to build new packages
- Add prettier-plugin-organize-imports
- Copy root files: bunfig.toml, .env.example, AGENTS.md, scripts/db.ts
- Remove packages/billing/ entirely (was stub package)
- Update all package.json files to use Zod ^4.0.0
- Revert Zod 3 compatibility changes (z.string().uuid() -> z.uuid() etc.)
- Inline billing stubs in ai-gateway.server.ts (Money, ingestUsageEvent)

_Generated with cmux_
- Update CI to run all tests: bun test --timeout 30000
- Add missing workspace deps:
  - api: @blink.so/database, @blink.so/runtime, drizzle-orm, postgres, uuid, happy-dom
  - site: @blink.so/api, @blink.so/database, uuid
  - runtime: @blink.so/api, hono
  - scout-agent: workspace:* for all @blink-sdk/* packages, @octokit/core, @slack/bolt
  - database: bcrypt-ts

_Generated with cmux_
Add 50ms delay in afterAll to allow React's deferred work to complete
before deleting globalThis.window, preventing 'window is not defined' error.

_Generated with cmux_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant