diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd47528f..96880ba8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,22 +21,18 @@ jobs: name: Test and validate Workers runs-on: ubuntu-latest timeout-minutes: 10 - services: - postgres: - image: postgres:17 - env: - POSTGRES_HOST_AUTH_METHOD: trust - ports: - - 5432:5432 - options: >- - --health-cmd "pg_isready -U postgres" - --health-interval 5s - --health-timeout 5s - --health-retries 10 env: - AUTH_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postgres + AUTH_TEST_DATABASE_URL: postgresql://postgres:local-ci-only@localhost:5432/postgres steps: + # ubuntu-latest includes PostgreSQL; no rate-limited container pull is needed. + - name: Start disposable runner PostgreSQL + run: | + sudo systemctl start postgresql + sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'local-ci-only'" + pg_isready -h localhost -p 5432 - uses: actions/checkout@v5 + with: + fetch-depth: 0 - uses: actions/setup-node@v5 with: node-version: 24 @@ -44,7 +40,10 @@ jobs: - run: npm ci - name: Verify generated API contract run: | - npm run generate:openapi - git diff --exit-code -- packages/docs/openapi.yaml - - run: npm run build:css + npm run generate + git diff --exit-code -- packages/docs/openapi.yaml packages/api-client/src/schema.d.ts + - name: Install browser for static application checks + run: npx playwright install --with-deps chromium - run: npm run check + - name: Exercise compiled jobs/invocation/run slice against PostgreSQL + run: npm run test:static-slice --workspace=factorize diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7f70bdf4..f8701c22 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,7 @@ on: permissions: contents: read + actions: read concurrency: group: production @@ -21,31 +22,67 @@ jobs: environment: production steps: - uses: actions/checkout@v5 + with: + fetch-depth: 0 - uses: actions/setup-node@v5 with: node-version: 24 cache: npm - run: npm ci - - run: npm run build:css + - name: Require the additive API stage before static cutover + run: node scripts/verify-public-routing.mjs https://app.factorize.sh --api-ready + - run: npm run build:app + - name: Retain legacy open-tab stylesheet during migration + run: git show 2d63d6480c398d29513329d7a604a4585d21de24:packages/api/public/styles.css > packages/app/dist/styles.css + - name: Snapshot this release before restoring older chunks + run: cp -R packages/app/dist "$RUNNER_TEMP/factorize-app-release" + - name: Restore assets from trusted production deployments in the last 30 days + uses: actions/github-script@v8 + with: + script: | + const fs = require('node:fs'); + const { execFileSync } = require('node:child_process'); + const { isTrustedAppRelease } = await import(`${process.env.GITHUB_WORKSPACE}/scripts/trusted-app-release.mjs`); + const artifacts = await github.paginate(github.rest.actions.listArtifactsForRepo, { ...context.repo, per_page: 100 }); + for (const artifact of artifacts) { + if (artifact.name !== 'factorize-app-assets' || artifact.expired || !artifact.workflow_run) continue; + const { data: run } = await github.rest.actions.getWorkflowRun({ ...context.repo, run_id: artifact.workflow_run.id }); + const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, { ...context.repo, run_id: run.id, per_page: 100 }); + if (!isTrustedAppRelease(artifact, run, jobs, `${context.repo.owner}/${context.repo.repo}`)) continue; + const { data } = await github.rest.actions.downloadArtifact({ ...context.repo, artifact_id: artifact.id, archive_format: 'zip' }); + const archive = `${process.env.RUNNER_TEMP}/factorize-assets-${artifact.id}.zip`; + fs.writeFileSync(archive, Buffer.from(data)); + execFileSync('python3', ['scripts/retain-app-assets.py', archive, 'packages/app/dist'], { stdio: 'inherit' }); + fs.unlinkSync(archive); + } - name: Apply database migrations run: npm run db:migrate --workspace=factorize env: DATABASE_URL: ${{ secrets.DATABASE_URL }} - name: Configure authentication email Worker secret - working-directory: packages/app + working-directory: packages/api run: | node -e 'process.stdout.write(JSON.stringify({ POSTMARK_SERVER_TOKEN: process.env.POSTMARK_SERVER_TOKEN }))' | npx wrangler secret bulk env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} POSTMARK_SERVER_TOKEN: ${{ secrets.POSTMARK_SERVER_TOKEN }} - - name: Deploy app Worker - run: npm run deploy:app + - name: Deploy marketing site + run: npm run deploy:marketing env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - - name: Deploy marketing site - run: npm run deploy:marketing + - name: Deploy app Worker + run: npm run deploy:prepared --workspace=factorize env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + - name: Retain deployed assets for subsequent releases and rollback + uses: actions/upload-artifact@v4 + with: + name: factorize-app-assets + path: ${{ runner.temp }}/factorize-app-release + retention-days: 35 + if-no-files-found: error + - name: Verify public production routing after deployment + run: node scripts/verify-public-routing.mjs https://app.factorize.sh --wait diff --git a/.gitignore b/.gitignore index 99aabf26..ff23a125 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,7 @@ coverage/ .idea/ .vscode/ *.swp + +# Local TLS and Python test caches +.dev-certs/ +__pycache__/ diff --git a/AGENTS.md b/AGENTS.md index cecfd0e5..245dc703 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,6 +6,16 @@ This project in Linear is "Factorize" - Every JSON application endpoint must live under `/api/v1` and be documented in `packages/docs/openapi.yaml`. - Frontend code must call the same `/api/v1` endpoints as external clients. Never add a frontend-only `/api/*` route. -- Register API operations only in `packages/app/src/protected-api.ts`; page, auth callback, webhook, health, and internal routes belong in their existing non-API namespaces. +- Register API operations only in `packages/api/src/protected-api.ts`; page, auth callback, webhook, health, and internal routes belong in their existing non-API namespaces. - A new API operation must include authorization, validation, OpenAPI documentation, and contract or boundary tests in the same change. - `/auth`, `/oauth`, `/webhooks`, `/internal`, `/mcp`, and `/healthz` are explicit non-API namespaces and must not be used to hide frontend application endpoints. + +## Package boundaries + +- `packages/api` owns the Worker. Its npm name remains `factorize` during the staged migration; this does not change production infrastructure identity. +- `packages/app` is the static frontend (`factorize-app`). It may only import the generated public contract through `factorize-api-client`; never import backend implementations. +- `packages/api-client` is generated from the published OpenAPI document. It must have no backend or frontend implementation dependencies. Run `npm run generate` after contract changes. +- Run `npm run check:boundaries` to validate imports, including dynamic imports and type imports. Do not add aliases or build configuration that bypasses these boundaries. +- Application HTML belongs to the static frontend. Backend protocol/form compatibility handlers may redirect or return JSON/text but must not generate UI HTML. +- Keep full-list/detail/trace and conditional-write omission compatibility for external REST/MCP clients. +- Deploy the documented additive API anchor before static cutover; preserve Worker identity/bindings/migrations and retain old hashed assets. Follow the release and rollback gates in `docs/package-migration.md`. diff --git a/README.md b/README.md index d405626b..d9cf65cc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Factorize [![CI](https://github.com/GenerationSoftware/factorize/actions/workflows/ci.yml/badge.svg)](https://github.com/GenerationSoftware/factorize/actions/workflows/ci.yml) -[![Deploy to Cloudflare](https://img.shields.io/badge/Deploy_to-Cloudflare-F38020?style=flat&logo=cloudflare&logoColor=white)](https://deploy.workers.cloudflare.com/?url=https://github.com/GenerationSoftware/factorize&path=packages/app) +[![Deploy to Cloudflare](https://img.shields.io/badge/Deploy_to-Cloudflare-F38020?style=flat&logo=cloudflare&logoColor=white)](https://deploy.workers.cloudflare.com/?url=https://github.com/GenerationSoftware/factorize&path=packages/api) **A no-code software factory for Linear teams.** Factorize turns selected Linear issue changes into coding-agent jobs on isolated, ephemeral exe.dev VMs. @@ -21,21 +21,21 @@ Linear webhook → Cloudflare Worker → Durable Object → exe.dev /exec → is ## Deploy to Cloudflare -Click the **Deploy to Cloudflare** button above to create a copy of the app Worker in your own Cloudflare account. The button selects `packages/app` as the Worker root; Cloudflare provisions the Durable Object binding and configures Workers Builds for the copied repository. +Click the **Deploy to Cloudflare** button above to create a copy of the app Worker in your own Cloudflare account. The button selects `packages/api` as the Worker root; Cloudflare provisions the bindings for the copied repository. Configure Workers Builds to run `npm run build --workspace=factorize-app` before deploying; static output lives beside the backend package. Follow the API-first bootstrap in the rollout guide. > The Deploy to Cloudflare button works for public GitHub or GitLab repositories. If you are using a private fork, deploy with Wrangler instead. ### Deploy with Wrangler 1. Clone the repository and install dependencies. -2. Set `APP_ORIGIN` in `packages/app/wrangler.jsonc` to your final HTTPS Worker URL or custom domain. -3. Create a dedicated OAuth KV namespace with `npm exec --workspace=factorize -- wrangler kv namespace create OAUTH_KV`, then set its ID in `packages/app/wrangler.jsonc`. +2. Set `APP_ORIGIN` in `packages/api/wrangler.jsonc` to your final HTTPS Worker URL or custom domain. +3. Create a dedicated OAuth KV namespace with `npm exec --workspace=factorize -- wrangler kv namespace create OAUTH_KV`, then set its ID in `packages/api/wrangler.jsonc`. 4. Configure the Linear OAuth callback as `https://your-domain.example/auth/linear/callback`. -5. Build assets, add secrets, and deploy: +5. Bootstrap the additive API stage and verify its marker as described in [the rollout guide](docs/package-migration.md), then build assets, add secrets, and deploy: ```bash npm ci -npm run build:css +npm run build:app npm exec --workspace=factorize -- wrangler secret put LINEAR_CLIENT_ID npm exec --workspace=factorize -- wrangler secret put LINEAR_CLIENT_SECRET @@ -62,7 +62,7 @@ For a headless machine, authenticate first with `npx wrangler login --device --b ```bash npm install -cp packages/app/.dev.vars.example packages/app/.dev.vars +cp packages/api/.dev.vars.example packages/api/.dev.vars npm run dev ``` @@ -84,7 +84,7 @@ Factorize owns authentication in PostgreSQL. Create a native account at `/auth/s Postmark sends one-hour, single-use verification and password-reset links. `/auth/verify/request` resends verification; `/auth/password-reset` handles recovery. Links never appear in application responses or logs. Passwords use salted PBKDF2-SHA-256. **Change password** in the account menu requires the current password. Password reset, password change and sign-out invalidate existing sessions via membership session versions, including delegated API credentials. -Before deploying, configure `POSTMARK_SERVER_TOKEN` as a **production GitHub environment secret**. The deployment copies it to a Worker secret; the verified sender and transactional message stream are non-secret Worker vars in `packages/app/wrangler.jsonc`. For a manual Postmark preflight, set the following environment variables along with `APP_ORIGIN`: +Before deploying, configure `POSTMARK_SERVER_TOKEN` as a **production GitHub environment secret**. The deployment copies it to a Worker secret; the verified sender and transactional message stream are non-secret Worker vars in `packages/api/wrangler.jsonc`. For a manual Postmark preflight, set the following environment variables along with `APP_ORIGIN`: | Setting | Required value | | --- | --- | @@ -142,7 +142,7 @@ Cloudflare Worker failures can also start Jobs through the separately deployable | `CLICKUP_CLIENT_SECRET` | ClickUp OAuth client secret; ClickUp also uses a per-installation webhook secret stored encrypted by Factorize | | `CREDENTIAL_ENCRYPTION_KEY` | Base64-encoded 32-byte key for encrypted credentials | | `SESSION_SIGNING_SECRET` | Independent secret for signed browser sessions | -| `APP_ORIGIN` | Public Worker origin, configured in `packages/app/wrangler.jsonc` | +| `APP_ORIGIN` | Public Worker origin, configured in `packages/api/wrangler.jsonc` | | `OAUTH_KV` | KV binding containing OAuth clients, grants, refresh tokens, and revocation state | Never commit `.dev.vars` or production secret values. The included `.dev.vars.example` is a safe template. @@ -151,11 +151,11 @@ Never commit `.dev.vars` or production secret values. The included `.dev.vars.ex | Command | What it does | | --- | --- | -| `npm run dev` | Build CSS and start local Wrangler development | -| `npm run build:css` | Compile Tailwind into `packages/app/public/styles.css` | +| `npm run dev` | Build the static frontend and start HTTPS Vite + local API development | +| `npm run build:app` | Build static React/Tailwind assets in `packages/app/dist` | | `npm test` | Run the unit test suite | -| `npm run check` | Type-check/test the app and dry-run both Worker deployments | -| `npm run deploy:app` | Deploy only the `factorize` app Worker | +| `npm run check` | Check package boundaries/contracts, React/API tests, local routing and Worker dry runs | +| `npm run deploy:app` | Verify the API stage, build static assets and deploy the existing `factorize` Worker | | `npm run deploy:tail-relay` | Deploy only the `factorize-tail-relay` Worker | | `npm run deploy` | Deploy the app, then the Tail relay; stop on the first failure | @@ -224,3 +224,20 @@ Factorize also supports the OAuth 2.0 Device Authorization Grant (RFC 8628) for [Apache License 2.0](LICENSE) Test line for the Factorize PR-check and merge-queue flow. + +### Static application migration + +The Worker lives in `packages/api`, the static React frontend in `packages/app`, and the OpenAPI-generated public client in `packages/api-client`. The frontend consumes only documented `/api/v1` operations. Same-origin routing preserves the existing Worker and state identities. See [the required API-first rollout and rollback procedure](docs/package-migration.md). + +| Command | Purpose | +| --- | --- | +| `npm run dev:api` | Run the local HTTPS API Worker | +| `npm run dev:app` | Run the static frontend development server | +| `npm run generate` | Generate OpenAPI and browser client types | +| `npm run build:app` | Build static frontend assets | +| `npm run check:boundaries` | Reject frontend/backend implementation imports | +| `npm run check` | Validate packages, generated client, tests and builds | + +Use Node 24. Keep local secrets in `packages/api/.dev.vars`; the static frontend does not expose environment variables. + +The static app includes native auth, consent/device, jobs/editor/provider, run/history/trace, integration and credential-management screens. Install Chromium with `npx playwright install --with-deps chromium` before checking. Local development uses HTTPS at `https://localhost:5173`; `npm run dev` creates an ignored local Vite certificate. See [the migration guide](docs/package-migration.md) for local database setup, production gates, asset retention and rollback. No production deployment is implied by this source migration. diff --git a/docs/execution-trace-stream.md b/docs/execution-trace-stream.md index 5202fb14..ce15e302 100644 --- a/docs/execution-trace-stream.md +++ b/docs/execution-trace-stream.md @@ -19,7 +19,7 @@ Normalized execution streams contain UTF-8, newline-terminated JSON objects in a Required fields: `version` (1), `id`, `type`, `title`, `preview`. Optional fields: `parentId`, `role`, `occurredAt` (ISO timestamp), `display` (object). Event types -match `TraceEventType` in `packages/app/src/trace.ts`. Sequence is assigned by the +match `TraceEventType` in `packages/api/src/trace.ts`. Sequence is assigned by the projection, never trusted from the producer. Producers must append whole records and finish each with LF. They must write human stdout/stderr to their separate supervisor logs, never to the stream. The supervisor creates the stream directory @@ -96,7 +96,7 @@ persisted source declaration continue to use native discovery. Native fallback parsing retains tool IDs, result names and error flags, including across artifact read chunks. -`packages/app/test/fixtures/claude-2.1.293/` contains synthetic, version-pinned +`packages/api/test/fixtures/claude-2.1.293/` contains synthetic, version-pinned schema fixtures for Claude Code 2.1.293 (the installed CLI version used during implementation). They model default root/subagent-tool behavior, not forwarded child text. Boundary tests execute the exact guest supervisor with a fake CLI, diff --git a/docs/marketing-app.md b/docs/marketing-app.md index 3eeb41ff..fb052f13 100644 --- a/docs/marketing-app.md +++ b/docs/marketing-app.md @@ -3,7 +3,7 @@ Factorize is deployed as a Cloudflare Pages site and an app Worker: - `packages/marketing` owns the public landing page at `https://factorize.sh`. It is a static Cloudflare Pages project named `factorize-marketing`; its production branch is `main` and its output directory is `packages/marketing/public`. It contains no authenticated APIs or tenant data. Login and Create a Job links cross to `https://app.factorize.sh`. -- `packages/app` owns the authenticated dashboard, OAuth callbacks, API/MCP endpoints, provider webhooks, and job deep links at `https://app.factorize.sh`. Its `/` route is the signed-out login entry point and redirects signed-in users to `/jobs`. +- `packages/api` owns the authenticated dashboard, OAuth callbacks, API/MCP endpoints, provider webhooks, and job deep links at `https://app.factorize.sh`. Its `/` route is the signed-out login entry point and redirects signed-in users to `/jobs`. The Pages project is connected to `GenerationSoftware/factorize` for pull request previews, but Cloudflare's automatic production deployments are disabled. Production deploys from `main` run through `.github/workflows/deploy.yml`, where failures are visible in GitHub Actions. For a manual deployment, authenticate Wrangler and run `npm run deploy:marketing`; this uploads `packages/marketing/public` to the `factorize-marketing` project. diff --git a/docs/package-migration.md b/docs/package-migration.md new file mode 100644 index 00000000..d4ffd662 --- /dev/null +++ b/docs/package-migration.md @@ -0,0 +1,242 @@ +# GEN-2157 static application and rollout + +## Architecture + +`packages/api` owns the existing `factorize` Cloudflare Worker, protocols, database, +scheduler, execution and ingestion. `packages/app` is a static Vite/React/Tailwind +application with lazy TanStack Router routes and a single TanStack Query cache. +`packages/api-client` contains browser-safe types/client generated from the executable +API catalog and committed OpenAPI. Browser features import that public package only. +CI rejects static, dynamic and type imports across implementation boundaries, checks +client/contract drift and keeps merge-group checks. + +The same Worker identity and ASSETS binding serve the separate static build under +`https://app.factorize.sh`. The Worker does not generate application/consent/device +HTML. `ui.ts`, browser-source generators, generated CSS and their extracted-script/ +source-substring tests are retired. Feature browser tests exercise compiled React. +No database migration or production binding/resource/secret/issuer is renamed. +`scripts/hosting-invariants.test.mjs` compares all backend configuration with the +pre-cutover snapshot, including all six Durable Object migrations. + +## Exact route ownership + +| Read namespace | Owner | Other methods | +| --- | --- | --- | +| `/`, `/jobs`, `/jobs/new`, `/jobs/:id`, `/jobs/:id/edit`, `/job-runs/:id` | Static GET/HEAD entry | Backend 404 | +| `/settings`, `/settings/integrations`, `/settings/api-keys`, `/settings/authorized-clients`, `/settings/password` | Static GET/HEAD entry | Backend 404 | +| `/auth/login`, `/auth/signup`, `/auth/password-reset`, `/auth/verify`, `/auth/verify/request` | Static GET/HEAD entry | Existing form handlers where registered | +| `/authorize` | Backend validates owner, client and OAuth request, then static GET/HEAD consent | Existing signed POST consent handler, Origin protected | +| `/device` | Backend owner check, then static GET/HEAD device screen | Existing POST device approval, Origin protected and row locked | +| `/assets/:filename`, `/styles.css` compatibility asset | Static asset binding | Backend 404 | +| `/api/v1` and descendants | API for every method, including errors | Never SPA HTML | +| `/oauth`, `/mcp`, `/.well-known/*` | OAuth/device/MCP protocols | Never SPA HTML | +| Provider `/auth/linear`, `/auth/clickup`, `/auth/github/install`, their registered callbacks/setup URLs | Existing backend redirects/callbacks | Never SPA HTML | +| `/webhooks`, `/internal`, `/healthz` | Existing backend handlers | Never SPA HTML | +| Unknown paths or extra application segments | Backend 404 | Never SPA HTML | + +The assets configuration uses `run_worker_first:true` and `not_found_handling:none`. +There is no blanket SPA fallback. Explicit deep links fetch the built `/index.html`; +query parameters stay in the browser URL and are never embedded in HTML. Static +route guards are UX only; every API request retains server-side authorization. + +## Public contracts and compatibility + +All JSON application operations are catalogued/dispatched under `/api/v1` through +`packages/api/src/protected-api.ts`. Public schemas describe required/nullable fields +and safe mappings for identity, jobs/triggers, targets/provider resources, settings, +keys/clients, runs and trace pages. Full run mapping enumerates existing safe row +fields/aliases; manual invocation occurrence may be null. Secret fields never enter +public integration/job responses. Invalid server output is an internal error, not a +400 client validation error. Opaque user context and diagnostic payloads remain JSON +records, not backend implementation types. + +Session/native auth uses existing Secure-on-HTTPS, HttpOnly, SameSite=Lax cookies. +Exact declared public auth operations bypass authentication; other application +operations do not. Auth JSON rejects Authorization headers. Cookie mutations, +including login/logout and consent/device decisions, require exact APP_ORIGIN and +reject cross-site fetch metadata. Bearer REST/MCP clients and signed callbacks keep +their existing policy. Owner-session restrictions, tenant membership, session version, +revocation, non-enumerating requests and transactional one-time tokens remain server +owned. Safe local return paths and the interrupted OAuth/device cookie survive login. +Identity changes clear tenant queries/mutations and remount local feature state. +Passwords, grants and API keys are never stored in localStorage; only theme preference is. + +Consent previews bind a parsed server-owned OAuth request to owner/tenant/session +version and expiry. Decisions recheck registered redirects and selected scopes before +issuance. Device previews expose only client/scopes/code/expiry; decisions lock pending +records and never expose protocol credentials to the browser. Legacy native form POST +URLs remain: successes retain cookies/redirects, and errors/instructions use plain text, +without backend HTML rendering. Existing OAuth token/register/metadata URLs are unchanged. + +Full jobs arrays, full run detail, legacy trace pages and MCP tool names remain available. +Summaries/selectors are additive bounded pages, UUID-descending with exclusive cursor, +literal case-insensitive search and optional enabled filter; keep filters fixed between +pages. Statistics are batched and prompts/config are omitted from summaries. No +cross-request snapshot across job pages is promised. Conditional writes use optional +`expectedUpdatedAt`: stale writes return `409 stale_job`; omission retains legacy +last-writer-wins REST/MCP behavior. Enabled-state changes advance the revision. The +editor performs a three-way merge and requires explicit choices for overlapping fields; +triggers reconcile atomically while retaining server identities. + +Canonical run states include succeeded/stopping/stopped. `state=done` retains compatibility +with historical done and canonical succeeded; ignored remains a literal legacy filter. +Status avoids full detail decryption/assembly. Trace revisions bind metadata/pages to one +statement snapshot; mismatches reset from zero and discard old caches. Live appends retain +revision; canonical replacement/replay changes it. Polling continues through terminal +artifact/cleanup finalization. Rich data loads on expansion; continuous traces virtualize +DOM and retain expanded/focused/selection-endpoint rows. Markdown never interprets raw +HTML, and ANSI becomes escaped React text with generated style values. + +## Local development and validation + +Use Node 24.12+ and `npm ci`. Install Chromium with +`npx playwright install --with-deps chromium`. `npm run dev` builds the frontend and +starts Vite and local Wrangler together. Open `https://localhost:5173`, accepting the +local development certificate. OpenSSL creates ignored `.dev-certs` for Vite; Wrangler +uses its own local HTTPS certificate. `npm run dev:api` and `npm run dev:app` also work +in separate terminals. The API dev command sets APP_ORIGIN to the HTTPS Vite origin; +the proxy preserves Host/Origin and same-origin cookies. The OAuth library requires an +HTTPS issuer even locally. The proxy's self-signed-certificate exception is development +configuration only; production CSP/CORS/issuer identifiers do not change. + +Keep local secrets in ignored `packages/api/.dev.vars`, and provide a local PostgreSQL +Hyperdrive connection using the documented Wrangler environment variable +`CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE`. Vite exposes no environment +prefix and never reads API secrets. Regenerate the development certificate after its +30-day expiry by deleting `.dev-certs` and restarting. + +- `npm run generate`: OpenAPI then generated client; drift is checked in CI. +- `npm run build:app`: static production output. `build:css` is a compatibility alias. +- `npm run build`: frontend and marketing production builds. +- `npm run check`: hosting/infrastructure/deployment gates, package boundaries, generated + client, TypeScript, compiled browser suites, API tests, actual local Cloudflare routing, + real OAuth/device/REST/MCP protocol round trips when AUTH_TEST_DATABASE_URL is set, + and API/tail-relay dry runs. The hosting runtime test uses local KV/assets and a loopback + Hyperdrive URL, never production state. +- `npm run test:static-slice --workspace=factorize`: compiled React through actual Worker + routing/dispatcher/repositories and disposable PostgreSQL. Build app first; set + AUTH_TEST_DATABASE_URL to a disposable local admin database. +- `npm run validate --workspace=factorize-docs` and `npm run build:marketing` preserve docs/ + marketing checks. Tail relay remains independently deployable. + +The protocol runtime test uses an isolated local KV directory and disposable PostgreSQL, +actual dynamic client registration, signed owner sessions, PKCE consent, device approval, +OAuth MCP calls and scoped API-key REST/MCP calls. It verifies session-version revocation +and preserves the OAuth `/mcp` audience (OAuth tokens do not gain REST access). + +CI provisions PostgreSQL, installs Chromium and runs the real static slice after the +root checks. Browser feature fixtures complement the real dispatcher/DB slice: external +provider infrastructure and actual execution scheduling are not launched by those tests. +Performance samples and limitations are in +`packages/api/performance/GEN-2157-feature-parity.md`. Historical baseline artifacts remain. +`gen-2157-legacy-compatibility.json` records seven legacy screens against the new API, +using five Chromium samples per screen and disposable PostgreSQL with 20 ms query delay. + +## Staged production rollout + +1. Deploy **API compatibility anchor `ff4b51b`** before the static cutover. This anchor + contains every dependent API addition and the documented session response header + `X-Factorize-Contract:gen-2157-static-v1`, while still serving legacy HTML and CSS. + Use an isolated checkout/worktree of that commit, `npm ci`, `npm run build:css`, and + the existing `npm run deploy:app` for the same Worker. Do not change state bindings, + secrets, origins or database state. The root stage check and legacy Chromium repeat + validate old-frontend/new-API compatibility. For a fresh self-hosted installation, + bootstrap this API stage at the configured HTTPS origin before deploying the static tree. +2. Verify the public session marker with + `node scripts/verify-public-routing.mjs https://app.factorize.sh --api-ready`. + The final production workflow checks this **before** migrations, secret configuration + or deployment, and refuses static cutover if the API stage is absent. Normal root/API + deploy commands perform the same gate and build static output. For direct CLI deployment + after the first cutover, set `FACTORIZE_RETAINED_ASSET_ARCHIVES` to trusted release zip + archives from every app deployment in the previous 30 days (OS path delimiter). The + command restores them and checks the live entry bundle is included; otherwise it refuses + deployment. Prefer the workflow, which selects these archives automatically. `deploy:prepared` is + reserved for the workflow after its gate, build and asset restoration. +3. Deploy the final tree with the existing production workflow/environment. It builds + static assets, seeds the old stylesheet from preserved commit `2d63d64`, restores + immutable chunks from actual successful trusted app deployments in the last 30 days, + and deploys the existing `factorize` Worker. All prior infrastructure identities and + migration history remain unchanged. Marketing is deployed before the app so its failure + cannot prevent recording a successful app snapshot. No new state resources are provisioned. +4. The workflow uploads the **current release only**, not recursively retained chunks, + as a 35-day artifact. Future restoration trusts this repository's deploy workflow on main or the explicit + initial-cutover branch `gen-2157-auth-contracts` (not arbitrary branches or forks) + and verifies its app-deployment step succeeded, including runs whose later verification + failed. Extraction restores only safe asset filenames/legacy CSS; never entry HTML, + configuration, symlinks or traversal paths, and immutable collisions fail closed. +5. The workflow runs `scripts/verify-public-routing.mjs` against the real public origin + after deployment. It verifies deep links, external bundles, static CSP/security/cache + headers, API/protocol error ownership and unchanged OAuth issuer/device metadata. + Complete authenticated owner/provider/OAuth/MCP smoke checks in the production environment + as part of release review. Local runtime/DB/browser checks alone do not establish + production acceptance; see the separate production evidence and owner report below. + +Static responses use external-bundle CSP with no nonce/unsafe-inline, nosniff, DENY frame +policy, same-origin referrer policy, permissions policy and HTTPS HSTS. Hashed assets cache +immutably; entry HTML revalidates. Missing chunks are no-store and display an explicit +recovery notice; no automatic reload discards a draft. Open tabs older than the retention +window may need a deliberate reload. Small root HTML is never restored from an old artifact. + +## Rollback + +Use **`ff4b51b`**, which retains all new APIs while restoring legacy page ownership. +Never revert database state or rename/recreate a Worker to roll back the frontend. +In an isolated anchor checkout, build legacy CSS; restore the last current/retained +`assets/` from trusted successful deployment artifacts into `packages/api/public/assets/`. +Do not copy index.html. The anchor's assets-first binding serves those hashed assets to +already-open SPA tabs while its backend serves legacy deep links. Keep `/styles.css`. +Deploy that checkout with its existing root command. OAuth KV, sessions, R2, Hyperdrive, +scheduler and migration history remain the same. Verify session marker, legacy login, +jobs/run/settings links and existing bearer REST/MCP clients. A corrected static rollout +can then deploy from the final tree using the same retained asset set. + +The local rollback runtime test starts the actual `ff4b51b` Worker with restored compiled +chunks and proves legacy login/deep-link ownership, the additive API marker, stylesheet +and unchanged chunk bytes. CI fetches history so the preserved anchor is available. + +Local tests check restoration collisions/path safety, the unchanged infrastructure +snapshot and actual Cloudflare local route ownership. They do not perform a production +rollback, configure external OAuth clients, or migrate production data. Production +release gates intentionally remain operator-visible rather than silently claiming a +successful rollout from a draft PR or a prior agent's exit status. + +## Production execution evidence (2026-10-09) + +The compatibility anchor `ff4b51b` and static tree `c64590c` were deployed through +the existing production workflow, preserving infrastructure identity. The final +[deployment run](https://github.com/GenerationSoftware/factorize/actions/runs/37994318377) +passed, including archive restoration/upload and public routing/security/cache +verification. The first static run reached the previous Worker immediately after +deploy and failed on a 302 for `/jobs`; a later complete verifier passed. Post-deploy +verification now retries the full suite for at most 55 seconds of propagation waits +and still fails persistent errors. The API-first pre-write gate remains immediate. + +Asset restoration explicitly trusts main and the initial cutover branch +`gen-2157-auth-contracts`, with repository/workflow/successful Worker-step checks. +This preserves initial-cutover chunks when future main deployments take over. +Read-only production bearer REST/MCP checks and anonymous Chromium auth/deep-link +screens passed. See `packages/api/performance/gen-2157-production-rollout.json`. +The earlier cutover-validation artifact remains historical local evidence. + +Brendan Asselstine subsequently reported on GEN-2157 at 2026-10-09 21:46 UTC: +“I have checked app.factorize.sh and everything seems to work.” This supplies the +owner review requested after deployment. It is a general production acceptance +report, not an itemized automated result for each provider/OAuth/device scenario. +The attached integration remains bearer-only; no owner credentials were obtained. +A fresh public routing/security/cache verification also passed during final review. + +## Branch and pull request lineage + +All three branches share one linear history based on main `82a9cda`: + +| Reference | Role | +| --- | --- | +| PR #205 / `gen-2157-package-boundary` at `a5c8579` | Initial mechanical move and package foundation; entirely included in #206 | +| `gen-2157-api-rollout-anchor` at `ff4b51b` | Intermediate additive API deployment and rollback checkpoint; intentionally retains legacy UI | +| PR #206 / `gen-2157-auth-contracts` | Complete migration, including the foundation, API anchor, static cutover and deployment fixes | + +PR #206 is the canonical merge candidate. #205 requires no separate merge. The +anchor is older than #206, not a newer implementation, and must remain available +for documented rollback and the rollback runtime test. Preserve merge history +when landing #206 so the deployment's historical stylesheet and rollback commits +remain reachable; do not squash away the staged migration history. diff --git a/docs/pi-session-contract.md b/docs/pi-session-contract.md index d22380ba..3650479f 100644 --- a/docs/pi-session-contract.md +++ b/docs/pi-session-contract.md @@ -11,7 +11,7 @@ The compatibility reference is the release's [session format](https://github.com/earendil-works/pi/blob/v1.1.0/packages/coding-agent/docs/session-format.md) and [message types](https://github.com/earendil-works/pi/blob/v1.1.0/packages/coding-agent/docs/message-types.md), also shipped in the binary's docs directory. Fixtures live in -`packages/app/test/fixtures/pi/1.1.0`; their README documents reproduction. +`packages/api/test/fixtures/pi/1.1.0`; their README documents reproduction. Pi's primary source is the native session discovered under its run-specific `--session-dir`. Both live projection and terminal reconciliation read this file. diff --git a/package-lock.json b/package-lock.json index e92cad35..f0d50a4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,42 @@ "version": "0.1.0", "workspaces": [ "packages/*" - ] + ], + "engines": { + "node": ">=24.12.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } }, "node_modules/@cloudflare/kv-asset-handler": { "version": "0.5.0", @@ -2941,46 +2976,112 @@ "node": "^22.20 || ^24.12 || >=25" } }, - "node_modules/@parcel/watcher": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", - "integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==", + "node_modules/@oxc-project/types": { + "version": "0.153.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.153.0.tgz", + "integrity": "sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@poppinss/colors": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", + "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", "dev": true, - "hasInstallScript": true, "license": "MIT", "dependencies": { - "detect-libc": "^1.0.3", - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "node-addon-api": "^7.0.0" - }, - "engines": { - "node": ">= 10.0.0" + "kleur": "^4.1.5" + } + }, + "node_modules/@poppinss/dumper": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", + "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@sindresorhus/is": "^7.0.2", + "supports-color": "^10.0.0" + } + }, + "node_modules/@poppinss/exception": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", + "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js-replace": "^1.0.1" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@redocly/config": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.22.0.tgz", + "integrity": "sha512-gAy93Ddo01Z3bHuVdPWfCwzgfaYgMdaZPcfL7JZ7hWJoK9V0lXDbigTWkhiPFAaLWzbOJ+kbUQG1+XwIm0KRGQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/openapi-core": { + "version": "1.34.20", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.34.20.tgz", + "integrity": "sha512-ypeBZ/6BKXR9+7/TtbKhbl4UgD7raHhPS12oknlKno2A8+lnFkxIwiE/Aklu6L2cd/ioH+fCWuMxi9/p3EyAPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@redocly/ajv": "8.11.2", + "@redocly/config": "0.22.0", + "colorette": "1.4.0", + "https-proxy-agent": "7.0.6", + "js-levenshtein": "1.1.6", + "js-yaml": "4.3.2", + "minimatch": "5.1.9", + "pluralize": "8.0.0", + "yaml-ast-parser": "0.0.43" }, - "optionalDependencies": { - "@parcel/watcher-android-arm64": "2.5.1", - "@parcel/watcher-darwin-arm64": "2.5.1", - "@parcel/watcher-darwin-x64": "2.5.1", - "@parcel/watcher-freebsd-x64": "2.5.1", - "@parcel/watcher-linux-arm-glibc": "2.5.1", - "@parcel/watcher-linux-arm-musl": "2.5.1", - "@parcel/watcher-linux-arm64-glibc": "2.5.1", - "@parcel/watcher-linux-arm64-musl": "2.5.1", - "@parcel/watcher-linux-x64-glibc": "2.5.1", - "@parcel/watcher-linux-x64-musl": "2.5.1", - "@parcel/watcher-win32-arm64": "2.5.1", - "@parcel/watcher-win32-ia32": "2.5.1", - "@parcel/watcher-win32-x64": "2.5.1" - } - }, - "node_modules/@parcel/watcher-android-arm64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz", - "integrity": "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==", + "engines": { + "node": ">=18.17.0", + "npm": ">=9.5.0" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.13.tgz", + "integrity": "sha512-Vu/NICrgdRvUOeaJZIyB2FP63s6fO/4ud5l8dXmxDx9yDyn+mN0y+gsvsVviSli+T361Aqo0h46EuMoobrwawA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.13.tgz", + "integrity": "sha512-6LEoIrGy5vvCd2boNnv2soPSUZj/PRvhp8R/t9KlX+mIZxThIE/ZqxrGXxmuNX0FuvQFvLdZr7S4HrYpYBVhEQ==", "cpu": [ "arm64" ], @@ -2991,17 +3092,13 @@ "android" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-darwin-arm64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz", - "integrity": "sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.13.tgz", + "integrity": "sha512-CaJSRzlQ6Q+zkDMVA9OkVxBjVoPRCDEE3v0FSJ9kIQBgRjFApA3Si4ijhbNVUji7ZJt+PfO0e46qy4nPInHUPA==", "cpu": [ "arm64" ], @@ -3012,17 +3109,13 @@ "darwin" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-darwin-x64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz", - "integrity": "sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.13.tgz", + "integrity": "sha512-e4r340I5hxSzJkD3YJBxgzq/rJ3wwxwdLLb2FPt1Zpyem20nrQPT11DDEEkazwxaHumH8wpglsp/Ozgj/wT6mw==", "cpu": [ "x64" ], @@ -3033,17 +3126,13 @@ "darwin" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-freebsd-x64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz", - "integrity": "sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.13.tgz", + "integrity": "sha512-hoBWDZ4/K/mJKVMbsgUd1jfpA2DiOrJ54mpegObU9TBHBBrtX4FLIXJJQRDPZ/2Dn91GvPob+Z2hwKJzf4E5SQ==", "cpu": [ "x64" ], @@ -3054,21 +3143,34 @@ "freebsd" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-linux-arm-glibc": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz", - "integrity": "sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.13.tgz", + "integrity": "sha512-oF9fZu3vTWnTiVAkDFxU9PJLt1nh20K9RRpuHsR7ZnE2L7XookBbDBVLojCVSLGbvtSlxeUNnjAj6DbNsKyzbg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.13.tgz", + "integrity": "sha512-DTpb/+jMiqWMPgphn4ksW1zW+XLJ6dJJ9FMvnIk9I291LhCctMPhMYJrP5t9p6C9qa3KXadDdUEZHBaPh3kNxQ==", + "cpu": [ + "arm64" + ], + "dev": true, "libc": [ "glibc" ], @@ -3078,19 +3180,15 @@ "linux" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-linux-arm-musl": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz", - "integrity": "sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==", + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.13.tgz", + "integrity": "sha512-xU+Kvv9N2A3SY35zFh1FWWNjxbadE/BKeqnkXe7vScU4GZsw757BlVmDLITZEq8DPpk6m7uoDYkK7P+x/uU5Ow==", "cpu": [ - "arm" + "arm64" ], "dev": true, "libc": [ @@ -3102,19 +3200,15 @@ "linux" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-linux-arm64-glibc": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz", - "integrity": "sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==", + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.13.tgz", + "integrity": "sha512-XMk/hnhh25oQ756Lclb1Q11h4ll0xC0Esa5w4Vzp+mAE2S3AGJgeM0SonrIgY8fHhjarb6hcoTuwoFG0VVP2ig==", "cpu": [ - "arm64" + "ppc64" ], "dev": true, "libc": [ @@ -3126,23 +3220,19 @@ "linux" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-linux-arm64-musl": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz", - "integrity": "sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==", + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.13.tgz", + "integrity": "sha512-U1BoTHYmlywE2n3HUWjzZ+8EQsKr+OwpxYuDWaubx42tUL8QSL7nOqRz/NVHanibbFP3M1Rxuprz/wNcbMKjqw==", "cpu": [ - "arm64" + "s390x" ], "dev": true, "libc": [ - "musl" + "glibc" ], "license": "MIT", "optional": true, @@ -3150,17 +3240,13 @@ "linux" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-linux-x64-glibc": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz", - "integrity": "sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==", + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.13.tgz", + "integrity": "sha512-J4cm80Pc6wEwV5AZ42o62sIQgDk+Y7R2s646jIwuvO+4V46QB58N4vVuMPWCBaNgursXLpmUWJV//WQAkPvHBQ==", "cpu": [ "x64" ], @@ -3174,17 +3260,13 @@ "linux" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-linux-x64-musl": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz", - "integrity": "sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==", + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.13.tgz", + "integrity": "sha512-W0euZS40U4V6JkmEnVCIX9mcsL6cbXQ4X8c2w+MMOIjFg68TXUW+u3RT+2e1t1pv9mg/EP3pDtK3POXdQ7Rxyw==", "cpu": [ "x64" ], @@ -3198,17 +3280,13 @@ "linux" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-win32-arm64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz", - "integrity": "sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==", + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.13.tgz", + "integrity": "sha512-do/AF/4n9MRshia3a5aXoy8xM2c6mgfT6D7H/dY6my5z+hfCIR4ab7mk4IRj++nsEQpKy39kd0DQnDq+r692tw==", "cpu": [ "arm64" ], @@ -3216,22 +3294,18 @@ "license": "MIT", "optional": true, "os": [ - "win32" + "openharmony" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-win32-ia32": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz", - "integrity": "sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==", + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.13.tgz", + "integrity": "sha512-6FtUf2cJZobutJdxnGYX8z0vtbgqU0b2v8vfBhkXb9wp2MppMFtkunE+IaOntyi01rkIQoPW2GHABtfzsC0BRQ==", "cpu": [ - "ia32" + "arm64" ], "dev": true, "license": "MIT", @@ -3240,17 +3314,13 @@ "win32" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@parcel/watcher-win32-x64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz", - "integrity": "sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==", + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.13.tgz", + "integrity": "sha512-UKhFaZTeTcbKrb3iU82m17jVcPEAoqDkCN5MBqgPyZSwp/cQmib21crTS0DdH7T1B7wZRWEI89YQAOJMet5yhg==", "cpu": [ "x64" ], @@ -3261,52 +3331,13 @@ "win32" ], "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher/node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/@poppinss/colors": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", - "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", - "dev": true, - "license": "MIT", - "dependencies": { - "kleur": "^4.1.5" - } - }, - "node_modules/@poppinss/dumper": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", - "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@poppinss/colors": "^4.1.5", - "@sindresorhus/is": "^7.0.2", - "supports-color": "^10.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@poppinss/exception": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", - "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", "dev": true, "license": "MIT" }, @@ -3719,25 +3750,6 @@ "dev": true, "license": "CC0-1.0" }, - "node_modules/@tailwindcss/cli": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@tailwindcss/cli/-/cli-4.3.3.tgz", - "integrity": "sha512-ZvS/n1ZHOBKcVlhkt8l5NNr1EDXk1NboYO5CYDOs6NUmvT9z6bzkwsosaJftY57T/3gWNzWMJzIXLodZC8ssdw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@parcel/watcher": "2.5.1", - "@tailwindcss/node": "4.3.3", - "@tailwindcss/oxide": "4.3.3", - "enhanced-resolve": "^5.24.1", - "mri": "^1.2.0", - "picocolors": "^1.1.1", - "tailwindcss": "4.3.3" - }, - "bin": { - "tailwindcss": "dist/index.mjs" - } - }, "node_modules/@tailwindcss/node": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.3.tgz", @@ -4007,33 +4019,225 @@ "node": ">= 20" } }, - "node_modules/@types/chai": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", - "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "node_modules/@tailwindcss/vite": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.3.tgz", + "integrity": "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw==", "dev": true, "license": "MIT", "dependencies": { - "@types/deep-eql": "*", - "assertion-error": "^2.0.1" + "@tailwindcss/node": "4.3.3", + "@tailwindcss/oxide": "4.3.3", + "tailwindcss": "4.3.3" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, - "node_modules/@types/deep-eql": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", - "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", - "dev": true, - "license": "MIT" + "node_modules/@tanstack/history": { + "version": "1.162.4", + "resolved": "https://registry.npmjs.org/@tanstack/history/-/history-1.162.4.tgz", + "integrity": "sha512-utTS5L2OkeYUzXGohL1Z8sefu1GLNOJcxe8Hd6iIdc/Xo1K1nDB2JEp4iSFhvYh33xKC9V91TxrS8qfrpoKobQ==", + "license": "MIT", + "engines": { + "node": ">=20.19" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } }, - "node_modules/@types/mustache": { - "version": "4.2.6", + "node_modules/@tanstack/query-core": { + "version": "5.104.1", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.104.1.tgz", + "integrity": "sha512-TiRghcrGkUTE+M4JBxvpPSpBhxvIzQairw+cksrHYGr+2uwC77yW1SY9nYxnYRYOppvucf8rEg6b5byoz4rTpw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.104.1", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.104.1.tgz", + "integrity": "sha512-Zz70EgjahNI7aCz8BZxM3vUGU44ycxEAzMuCUjLeA7SVhhOkg3ZgPjPJPvHjs6Rmky/dtmnu1WzjGHNHmhCoZQ==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.104.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, + "node_modules/@tanstack/react-router": { + "version": "1.170.41", + "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.170.41.tgz", + "integrity": "sha512-Mpvw8Wm5MGDbTqI8Yc9flLKxbOHwoWocv0H2aGKcgw2a017oK5nZWqa954P+DrUx/8fI98YNywnHP5XcD3tQ9w==", + "license": "MIT", + "dependencies": { + "@tanstack/history": "1.162.4", + "@tanstack/react-store": "^0.11.2", + "@tanstack/router-core": "1.171.34", + "isbot": "^5.1.22" + }, + "engines": { + "node": ">=20.19" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": ">=18.0.0 || >=19.0.0", + "react-dom": ">=18.0.0 || >=19.0.0" + } + }, + "node_modules/@tanstack/react-store": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@tanstack/react-store/-/react-store-0.11.2.tgz", + "integrity": "sha512-oj5O5DmiMWE+ih+SioX2ayC1kbK7d3fpLx0B75fPJr9nY3zU+hoW010yr64qXsY/9fyiLVE2bn5mGNV3owm8RQ==", + "license": "MIT", + "dependencies": { + "@tanstack/store": "0.11.2", + "use-sync-external-store": "^1.6.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@tanstack/react-virtual": { + "version": "3.14.14", + "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.14.14.tgz", + "integrity": "sha512-eo/arVIpYi9rGJXR5y4fDoTiz+BBOc4HKVBKQMoPRswxJtP6HV8iupW/DkBE9TRh+PjzikIDHw2h7aV25g0Z4w==", + "license": "MIT", + "dependencies": { + "@tanstack/virtual-core": "3.18.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@tanstack/router-core": { + "version": "1.171.34", + "resolved": "https://registry.npmjs.org/@tanstack/router-core/-/router-core-1.171.34.tgz", + "integrity": "sha512-X+19pGuuLVPvvAvPYw9v/+ktRk5cCll8AtfpBpOhDRmVgUMrfqze0467xtq8YRVVs/mmo5rVtWn/7Tp32RDBKw==", + "license": "MIT", + "dependencies": { + "@tanstack/history": "1.162.4", + "cookie-es": "^3.0.0", + "seroval": "^1.6.7", + "seroval-plugins": "^1.6.7" + }, + "engines": { + "node": ">=20.19" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/store": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@tanstack/store/-/store-0.11.2.tgz", + "integrity": "sha512-sJ4mjol8uQsHV0gOJzzjwXfh2Fwm+Sz0+8deqiTm4jGbMdjzNSW+xZCFm0kUa870uhd8yi+DpKnZb5Kc4apa0Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/virtual-core": { + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.18.0.tgz", + "integrity": "sha512-8frWsyfyBwLGoDQ6wN6Lq3CoT8j4BPJUzE6nH4P9mruLhxPOamk82prC3JxRMLJzYnNa9ISaZ8NtfxEiOGkHEQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/debug": { + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "license": "MIT" + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/hast": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/mustache": { + "version": "4.2.6", "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-4.2.6.tgz", "integrity": "sha512-t+8/QWTAhOFlrF1IVZqKnMRJi84EgkIK5Kh0p2JV4OLywUvCwJPFxbJAl7XAow7DVIHsF+xW9f1MVzg0L6Szjw==", "dev": true, @@ -4061,6 +4265,31 @@ "pg-types": "^2.2.0" } }, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, "node_modules/@types/whatwg-mimetype": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/whatwg-mimetype/-/whatwg-mimetype-3.0.2.tgz", @@ -4078,6 +4307,12 @@ "@types/node": "*" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", + "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", + "license": "ISC" + }, "node_modules/@vitest/expect": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz", @@ -4216,6 +4451,16 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", @@ -4233,6 +4478,23 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -4243,6 +4505,23 @@ "node": ">=12" } }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/birpc": { "version": "0.2.14", "resolved": "https://registry.npmjs.org/birpc/-/birpc-0.2.14.tgz", @@ -4260,17 +4539,14 @@ "dev": true, "license": "MIT" }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "node_modules/brace-expansion": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", "dev": true, "license": "MIT", "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" + "balanced-match": "^1.0.0" } }, "node_modules/buffer-from": { @@ -4303,6 +4579,16 @@ "node": ">=8" } }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chai": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", @@ -4320,6 +4606,53 @@ "node": ">=18" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/check-error": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", @@ -4382,6 +4715,23 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true, + "license": "MIT" + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/cookie": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", @@ -4396,6 +4746,12 @@ "url": "https://opencollective.com/express" } }, + "node_modules/cookie-es": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-3.1.1.tgz", + "integrity": "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==", + "license": "MIT" + }, "node_modules/cron-parser": { "version": "5.10.1", "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-5.10.1.tgz", @@ -4408,11 +4764,16 @@ "node": ">=18" } }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -4426,6 +4787,19 @@ } } }, + "node_modules/decode-named-character-reference": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", + "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/deep-eql": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", @@ -4436,6 +4810,15 @@ "node": ">=6" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -4453,6 +4836,19 @@ "dev": true, "license": "MIT" }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/drizzle-kit": { "version": "0.31.10", "resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.31.10.tgz", @@ -5164,6 +5560,16 @@ "@esbuild/win32-x64": "0.28.2" } }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/estree-walker": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", @@ -5197,7 +5603,21 @@ "node": ">=12.0.0" } }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, "node_modules/factorize": { + "resolved": "packages/api", + "link": true + }, + "node_modules/factorize-api-client": { + "resolved": "packages/api-client", + "link": true + }, + "node_modules/factorize-app": { "resolved": "packages/app", "link": true }, @@ -5255,19 +5675,6 @@ } } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -5329,6 +5736,46 @@ "node": ">=20.0.0" } }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hono": { "version": "4.13.7", "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.7.tgz", @@ -5338,44 +5785,119 @@ "node": ">=16.9.0" } }, - "node_modules/is-arrayish": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", - "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", - "dev": true, - "license": "MIT" + "node_modules/html-url-attributes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz", + "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 14" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/index-to-position": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz", + "integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==", "dev": true, "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inline-style-parser": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", + "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", + "license": "MIT" + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "license": "MIT", "dependencies": { - "is-extglob": "^2.1.1" + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/is-arrayish": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", + "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", "dev": true, + "license": "MIT" + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "license": "MIT", "engines": { - "node": ">=0.12.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isbot": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/isbot/-/isbot-5.2.2.tgz", + "integrity": "sha512-iQcBXcd+Rv/pkubRyGh2utW2j1oPG5hZY6TUhVPpqK4G+o3IbxpJNx04hgksjc/N7GK5pEorUxDeg31cFgEk/w==", + "license": "Unlicense", + "engines": { + "node": ">=18" } }, "node_modules/jiti": { @@ -5388,6 +5910,16 @@ "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/js-tokens": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", @@ -5395,6 +5927,29 @@ "dev": true, "license": "MIT" }, + "node_modules/js-yaml": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -5685,6 +6240,16 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/loupe": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", @@ -5711,1039 +6276,2314 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, + "node_modules/mdast-util-from-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.1.0.tgz", + "integrity": "sha512-KRLgmPaP2H1ul2bpoJkOS+9pAcDAAj9Nu1mqLnh8NLeJG5tlvj42TH80PIGBpROWlRXLk0lDrWNuZCFy/tsB4A==", "license": "MIT", "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" }, - "engines": { - "node": ">=8.6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/micromatch/node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", - "dev": true, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", "license": "MIT", - "engines": { - "node": ">=8.6" + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "dev": true, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", "license": "MIT", - "bin": { - "mime": "cli.js" + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, - "engines": { - "node": ">=10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/miniflare": { - "version": "5.20260910.0-alpha", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20260910.0-alpha.tgz", - "integrity": "sha512-V41TxLjX1Dq4pys8X5GAl/CrUY0//QcXCIdYwy01Cev+JdsWOWzzN0IP45lojgw+fEVY9QdepzVIziT2IxhbUQ==", - "dev": true, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", "license": "MIT", "dependencies": { - "@cspotcode/source-map-support": "0.8.1", - "sharp": "0.35.4", - "undici": "7.29.0", - "workerd": "1.20260910.1", - "ws": "8.21.0", - "youch": "4.1.0-beta.10" + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, - "engines": { - "node": ">=22.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", "license": "MIT", - "engines": { - "node": ">=4" + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" + "node_modules/mdast-util-to-hast": { + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "node_modules/mdast-util-to-markdown": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.2.0.tgz", + "integrity": "sha512-2Jn/ADrHFFyyniBMi0bncTbJqU78K3/TEYvzvwrWWzD9MYPUa/Gm4r3nOeKFQg/PDM5BsbDYdc8ackW4NTY6NA==", "license": "MIT", - "bin": { - "mustache": "bin/mustache" + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/nanoid": { - "version": "3.3.18", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", - "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", - "dev": true, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.3.tgz", + "integrity": "sha512-oGYfQzHSG5dOMovQcJ3fyTmZlWAWpi0XA0sJwJs+i6OT88o1+Jtw/8z0CmdowSLxGhhFK89rQ/oXph/wN02PNw==", "funding": [ { - "type": "github", - "url": "https://github.com/sponsors/ai" + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" } ], "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-edit-map": "^1.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.4.tgz", + "integrity": "sha512-wxEeE8v8XVvOrxn1TZj74qYhAtTQsSqufHVS3uNVyT1MupXxhyaHk8/9xDNPh9BmL77QNDgWTkZ3RsYHB2ry7w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.1.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-edit-map": "^1.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.3" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/node-addon-api": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", - "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/path-to-regexp": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", - "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, - "node_modules/pathval": { + "node_modules/micromark-factory-label": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", - "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", - "dev": true, + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "engines": { - "node": ">= 14.16" + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/pg": { - "version": "8.16.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", - "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", + "node_modules/micromark-factory-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.1.0.tgz", + "integrity": "sha512-fS8hnLIjnjvdQIj39Geug8wWsR0HrYZ43KShKxNfwT7t2LOHo/LbWZEzEaSOjwtjdCsjoE6syHhonEzW0zv0+Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", "dependencies": { - "pg-connection-string": "^2.9.1", - "pg-pool": "^3.10.1", - "pg-protocol": "^1.10.3", - "pg-types": "2.2.0", - "pgpass": "1.0.5" - }, - "engines": { - "node": ">= 16.0.0" - }, - "optionalDependencies": { - "pg-cloudflare": "^1.2.7" - }, - "peerDependencies": { - "pg-native": ">=3.0.1" - }, - "peerDependenciesMeta": { - "pg-native": { - "optional": true - } + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/pg-cloudflare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.4.0.tgz", - "integrity": "sha512-Vo7z/6rrQYxpNRylp4Tlob2elzbh+N/MOQbxFVWCxS7oEx6jF53GTJFxK2WWpKuBRkmiin4Mt+xofFDjx09R0A==", + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "optional": true - }, - "node_modules/pg-connection-string": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.14.0.tgz", - "integrity": "sha512-XwWDGcLRGCXAR8F/AM5bG7Q+A3Wm2s6QeEjlOKZLlH3UYcguiqCWKyWXVag5TLTIjR7oOJUY8kcADaZgWPyLeg==", - "license": "MIT" - }, - "node_modules/pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "license": "ISC", - "engines": { - "node": ">=4.0.0" + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/pg-pool": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.14.0.tgz", - "integrity": "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==", + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "peerDependencies": { - "pg": ">=8.0" + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/pg-protocol": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.16.0.tgz", - "integrity": "sha512-sILXutLVjCLjcDuOmvhX5e2Z4cS5qG/6Bu3VkpFwdf/633ElGLpEh9bgmuI5I4sqKqkifQiGyiCcx1HdtrK7tg==", - "license": "MIT" - }, - "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", "dependencies": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - }, - "engines": { - "node": ">=4" + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", "dependencies": { - "split2": "^4.1.0" + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", - "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", - "dev": true, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/playwright": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.0.tgz", - "integrity": "sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==", - "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.64.0" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/playwright-core": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.0.tgz", - "integrity": "sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "playwright-core": "cli.js" - }, - "engines": { - "node": ">=20" + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/postcss": { - "version": "8.5.28", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz", - "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", - "dev": true, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", "funding": [ { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" }, { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" }, { - "type": "github", - "url": "https://github.com/sponsors/ai" + "type": "OpenCollective", + "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.18", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "engines": { - "node": ">=4" + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/postgres-bytea": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz", - "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==", + "node_modules/micromark-util-edit-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-edit-map/-/micromark-util-edit-map-1.0.0.tgz", + "integrity": "sha512-Pa2ljlsEL6sVwFaYeyrOLSYbQt73JvGbPOYFq+9AElXiSnfI5Q4465RRZ1sHv7lDjDOnGRDDaqPXqClqWK/q1Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "engines": { - "node": ">=0.10.0" + "dependencies": { + "micromark-util-types": "^2.0.0" } }, - "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "engines": { - "node": ">=0.10.0" + "dependencies": { + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", "dependencies": { - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" + "micromark-util-types": "^2.0.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "engines": { - "node": ">=0.10.0" + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/rollup": { - "version": "4.63.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.1.tgz", - "integrity": "sha512-3Df9jsstwhccuEfmAMi9l8XUh/GOkVObmFTU7CCVBysEbcOZLl84jCtaAZMcPiMz2EGKsATzQcU+Xr3n/wU6cg==", + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.3.tgz", + "integrity": "sha512-oxB2Ik03hI0gv+VNn9tnh1t1YEe9MDPptViAEgfdf3YQHsn0pzGTgCdlSCJXcwhqm8phaEuM7zeEu3QQzVBrPg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "dev": true, "license": "MIT", - "dependencies": { - "@types/estree": "1.0.9" - }, "bin": { - "rollup": "dist/bin/rollup" + "mime": "cli.js" }, "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@napi-rs/lzma-linux-x64-gnu": "1.5.1", - "@rollup/rollup-android-arm-eabi": "4.63.1", - "@rollup/rollup-android-arm64": "4.63.1", - "@rollup/rollup-darwin-arm64": "4.63.1", - "@rollup/rollup-darwin-x64": "4.63.1", - "@rollup/rollup-freebsd-arm64": "4.63.1", - "@rollup/rollup-freebsd-x64": "4.63.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.63.1", - "@rollup/rollup-linux-arm-musleabihf": "4.63.1", - "@rollup/rollup-linux-arm64-gnu": "4.63.1", - "@rollup/rollup-linux-arm64-musl": "4.63.1", - "@rollup/rollup-linux-loong64-gnu": "4.63.1", - "@rollup/rollup-linux-loong64-musl": "4.63.1", - "@rollup/rollup-linux-ppc64-gnu": "4.63.1", - "@rollup/rollup-linux-ppc64-musl": "4.63.1", - "@rollup/rollup-linux-riscv64-gnu": "4.63.1", - "@rollup/rollup-linux-riscv64-musl": "4.63.1", - "@rollup/rollup-linux-s390x-gnu": "4.63.1", - "@rollup/rollup-linux-x64-gnu": "4.63.1", - "@rollup/rollup-linux-x64-musl": "4.63.1", - "@rollup/rollup-openbsd-x64": "4.63.1", - "@rollup/rollup-openharmony-arm64": "4.63.1", - "@rollup/rollup-win32-arm64-msvc": "4.63.1", - "@rollup/rollup-win32-ia32-msvc": "4.63.1", - "@rollup/rollup-win32-x64-gnu": "4.63.1", - "@rollup/rollup-win32-x64-msvc": "4.63.1", - "fsevents": "~2.3.2" + "node": ">=10.0.0" } }, - "node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "node_modules/miniflare": { + "version": "5.20260910.0-alpha", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20260910.0-alpha.tgz", + "integrity": "sha512-V41TxLjX1Dq4pys8X5GAl/CrUY0//QcXCIdYwy01Cev+JdsWOWzzN0IP45lojgw+fEVY9QdepzVIziT2IxhbUQ==", "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.35.4", + "undici": "7.29.0", + "workerd": "1.20260910.1", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" }, "engines": { - "node": ">=10" + "node": ">=22.0.0" } }, - "node_modules/sharp": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.4.tgz", - "integrity": "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==", + "node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, - "license": "Apache-2.0", + "license": "ISC", "dependencies": { - "@img/colour": "^1.1.0", - "detect-libc": "^2.1.2", - "semver": "^7.8.5" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.35.4", - "@img/sharp-darwin-x64": "0.35.4", - "@img/sharp-freebsd-wasm32": "0.35.4", - "@img/sharp-libvips-darwin-arm64": "1.3.3", - "@img/sharp-libvips-darwin-x64": "1.3.3", - "@img/sharp-libvips-linux-arm": "1.3.3", - "@img/sharp-libvips-linux-arm64": "1.3.3", - "@img/sharp-libvips-linux-ppc64": "1.3.3", - "@img/sharp-libvips-linux-riscv64": "1.3.3", - "@img/sharp-libvips-linux-s390x": "1.3.3", - "@img/sharp-libvips-linux-x64": "1.3.3", - "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", - "@img/sharp-libvips-linuxmusl-x64": "1.3.3", - "@img/sharp-linux-arm": "0.35.4", - "@img/sharp-linux-arm64": "0.35.4", - "@img/sharp-linux-ppc64": "0.35.4", - "@img/sharp-linux-riscv64": "0.35.4", - "@img/sharp-linux-s390x": "0.35.4", - "@img/sharp-linux-x64": "0.35.4", - "@img/sharp-linuxmusl-arm64": "0.35.4", - "@img/sharp-linuxmusl-x64": "0.35.4", - "@img/sharp-webcontainers-wasm32": "0.35.4", - "@img/sharp-win32-arm64": "0.35.4", - "@img/sharp-win32-ia32": "0.35.4", - "@img/sharp-win32-x64": "0.35.4" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } + "node": ">=10" } }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, - "node_modules/simple-swizzle": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", - "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", - "dev": true, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", "license": "MIT", - "dependencies": { - "is-arrayish": "^0.3.1" + "bin": { + "mustache": "bin/mustache" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, - "license": "BSD-3-Clause", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, "engines": { - "node": ">=0.10.0" + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" + "node_modules/openapi-fetch": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/openapi-fetch/-/openapi-fetch-0.17.0.tgz", + "integrity": "sha512-PsbZR1wAPcG91eEthKhN+Zn92FMHxv+/faECIwjXdxfTODGSGegYv0sc1Olz+HYPvKOuoXfp+0pA2XVt2cI0Ig==", + "license": "MIT", + "dependencies": { + "openapi-typescript-helpers": "^0.1.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "node_modules/openapi-typescript": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-7.13.0.tgz", + "integrity": "sha512-EFP392gcqXS7ntPvbhBzbF8TyBA+baIYEm791Hy5YkjDYKTnk/Tn5OQeKm5BIZvJihpp8Zzr4hzx0Irde1LNGQ==", "dev": true, "license": "MIT", "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "license": "ISC", - "engines": { - "node": ">= 10.x" + "@redocly/openapi-core": "^1.34.6", + "ansi-colors": "^4.1.3", + "change-case": "^5.4.4", + "parse-json": "^8.3.0", + "supports-color": "^10.2.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "openapi-typescript": "bin/cli.js" + }, + "peerDependencies": { + "typescript": "^5.x" } }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, - "node_modules/std-env": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", - "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", - "dev": true, + "node_modules/openapi-typescript-helpers": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/openapi-typescript-helpers/-/openapi-typescript-helpers-0.1.0.tgz", + "integrity": "sha512-OKTGPthhivLw/fHz6c3OPtg72vi86qaMlqbJuVJ23qOvQ+53uw1n7HdmkJFibloF7QEjDrDkzJiOJuockM/ljw==", "license": "MIT" }, - "node_modules/stoppable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", - "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4", - "npm": ">=6" - } - }, - "node_modules/strip-literal": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", - "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", - "dev": true, + "node_modules/parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", "license": "MIT", "dependencies": { - "js-tokens": "^9.0.1" + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/supports-color": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", - "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, + "node_modules/parse-json": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", "dev": true, "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" + }, "engines": { "node": ">=18" }, "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tailwindcss": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.3.tgz", - "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==", + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", "dev": true, "license": "MIT" }, - "node_modules/tapable": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", - "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/tinybench": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, "license": "MIT" }, - "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">= 14.16" + } }, - "node_modules/tinyglobby": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", - "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", - "dev": true, + "node_modules/pg": { + "version": "8.16.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", + "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", "license": "MIT", "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" + "pg-connection-string": "^2.9.1", + "pg-pool": "^3.10.1", + "pg-protocol": "^1.10.3", + "pg-types": "2.2.0", + "pgpass": "1.0.5" }, "engines": { - "node": ">=12.0.0" + "node": ">= 16.0.0" }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" + "optionalDependencies": { + "pg-cloudflare": "^1.2.7" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } } }, - "node_modules/tinypool": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", - "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", - "dev": true, + "node_modules/pg-cloudflare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.4.0.tgz", + "integrity": "sha512-Vo7z/6rrQYxpNRylp4Tlob2elzbh+N/MOQbxFVWCxS7oEx6jF53GTJFxK2WWpKuBRkmiin4Mt+xofFDjx09R0A==", "license": "MIT", + "optional": true + }, + "node_modules/pg-connection-string": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.14.0.tgz", + "integrity": "sha512-XwWDGcLRGCXAR8F/AM5bG7Q+A3Wm2s6QeEjlOKZLlH3UYcguiqCWKyWXVag5TLTIjR7oOJUY8kcADaZgWPyLeg==", + "license": "MIT" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": ">=4.0.0" } }, - "node_modules/tinyrainbow": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", - "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", - "dev": true, + "node_modules/pg-pool": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.14.0.tgz", + "integrity": "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==", "license": "MIT", - "engines": { - "node": ">=14.0.0" + "peerDependencies": { + "pg": ">=8.0" } }, - "node_modules/tinyspy": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz", - "integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==", - "dev": true, + "node_modules/pg-protocol": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.16.0.tgz", + "integrity": "sha512-sILXutLVjCLjcDuOmvhX5e2Z4cS5qG/6Bu3VkpFwdf/633ElGLpEh9bgmuI5I4sqKqkifQiGyiCcx1HdtrK7tg==", + "license": "MIT" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, "engines": { - "node": ">=14.0.0" + "node": ">=4" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", "license": "MIT", "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" + "split2": "^4.1.0" } }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, - "license": "0BSD", - "optional": true + "license": "ISC" }, - "node_modules/tsx": { - "version": "4.23.15", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz", - "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/playwright": { + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.0.tgz", + "integrity": "sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==", + "dev": true, + "license": "Apache-2.0", "dependencies": { - "esbuild": "~0.28.0" + "playwright-core": "1.64.0" }, "bin": { - "tsx": "dist/cli.mjs" + "playwright": "cli.js" }, "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" + "node": ">=20" } }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "node_modules/playwright-core": { + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.0.tgz", + "integrity": "sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==", "dev": true, "license": "Apache-2.0", "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "playwright-core": "cli.js" }, "engines": { - "node": ">=14.17" + "node": ">=20" } }, - "node_modules/undici": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.0.tgz", - "integrity": "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==", + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, "license": "MIT", "engines": { - "node": ">=20.18.1" + "node": ">=4" } }, - "node_modules/undici-types": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", - "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", - "devOptional": true, - "license": "MIT" - }, - "node_modules/unenv": { - "version": "2.0.0-rc.24", - "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", - "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", + "node_modules/postcss": { + "version": "8.5.29", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz", + "integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "license": "MIT", "dependencies": { - "pathe": "^2.0.3" + "nanoid": "^3.3.19", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" } }, - "node_modules/vite": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz", - "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==", - "dev": true, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", "license": "MIT", - "dependencies": { - "esbuild": "^0.27.0 || ^0.28.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" - }, - "bin": { - "vite": "bin/vite.js" - }, "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "lightningcss": "^1.21.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } + "node": ">=4" } }, - "node_modules/vite-node": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", - "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", - "dev": true, + "node_modules/postgres-bytea": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz", + "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", "license": "MIT", "dependencies": { - "cac": "^6.7.14", - "debug": "^4.4.1", - "es-module-lexer": "^1.7.0", - "pathe": "^2.0.3", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" - }, - "bin": { - "vite-node": "vite-node.mjs" + "xtend": "^4.0.0" }, "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, + "node": ">=0.10.0" + } + }, + "node_modules/property-information": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz", + "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==", + "license": "MIT", "funding": { - "url": "https://opencollective.com/vitest" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/vitest": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz", - "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==", - "dev": true, + "node_modules/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz", + "integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==", "license": "MIT", "dependencies": { - "@types/chai": "^5.2.2", - "@vitest/expect": "3.2.7", - "@vitest/mocker": "3.2.7", - "@vitest/pretty-format": "^3.2.7", - "@vitest/runner": "3.2.7", - "@vitest/snapshot": "3.2.7", - "@vitest/spy": "3.2.7", - "@vitest/utils": "3.2.7", - "chai": "^5.2.0", - "debug": "^4.4.1", - "expect-type": "^1.2.1", - "magic-string": "^0.30.17", - "pathe": "^2.0.3", - "picomatch": "^4.0.2", - "std-env": "^3.9.0", - "tinybench": "^2.9.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.14", - "tinypool": "^1.1.1", - "tinyrainbow": "^2.0.0", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", - "vite-node": "3.2.4", - "why-is-node-running": "^2.3.0" + "scheduler": "^0.28.0" }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + "peerDependencies": { + "react": "^19.3.0" + } + }, + "node_modules/react-markdown": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-10.1.0.tgz", + "integrity": "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "html-url-attributes": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "unified": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "type": "opencollective", + "url": "https://opencollective.com/unified" }, "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/debug": "^4.1.12", - "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "3.2.7", - "@vitest/ui": "3.2.7", - "happy-dom": "*", - "jsdom": "*" + "@types/react": ">=18", + "react": ">=18" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/debug": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "node_modules/remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" + "node": ">=0.10.0" } }, - "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/rolldown": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.13.tgz", + "integrity": "sha512-/5apOkwWxtACcQtZ5WlrAsKS4JwXVThQPJZ3RqIruRY9UG9M8e0VlXN068xum/JRKA4aIUoJ13ghe/kGCvidiQ==", "dev": true, "license": "MIT", "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" + "@oxc-project/types": "=0.153.0", + "@rolldown/pluginutils": "^1.0.0" }, "bin": { - "why-is-node-running": "cli.js" + "rolldown": "bin/cli.mjs" }, "engines": { - "node": ">=8" + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.13", + "@rolldown/binding-android-arm64": "1.2.13", + "@rolldown/binding-darwin-arm64": "1.2.13", + "@rolldown/binding-darwin-x64": "1.2.13", + "@rolldown/binding-freebsd-x64": "1.2.13", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.13", + "@rolldown/binding-linux-arm64-gnu": "1.2.13", + "@rolldown/binding-linux-arm64-musl": "1.2.13", + "@rolldown/binding-linux-ppc64-gnu": "1.2.13", + "@rolldown/binding-linux-s390x-gnu": "1.2.13", + "@rolldown/binding-linux-x64-gnu": "1.2.13", + "@rolldown/binding-linux-x64-musl": "1.2.13", + "@rolldown/binding-openharmony-arm64": "1.2.13", + "@rolldown/binding-win32-arm64-msvc": "1.2.13", + "@rolldown/binding-win32-x64-msvc": "1.2.13" } }, - "node_modules/workerd": { - "version": "1.20260910.1", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260910.1.tgz", - "integrity": "sha512-/HF0f8LmgT60Uk+ZPDbMnlUHjecfV8w4VMo61iFxW7ky7EexTdwbzUCANWZQiG0w1cBihjJTkhzmReeZLGarXw==", + "node_modules/rollup": { + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.1.tgz", + "integrity": "sha512-3Df9jsstwhccuEfmAMi9l8XUh/GOkVObmFTU7CCVBysEbcOZLl84jCtaAZMcPiMz2EGKsATzQcU+Xr3n/wU6cg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.63.1", + "@rollup/rollup-android-arm64": "4.63.1", + "@rollup/rollup-darwin-arm64": "4.63.1", + "@rollup/rollup-darwin-x64": "4.63.1", + "@rollup/rollup-freebsd-arm64": "4.63.1", + "@rollup/rollup-freebsd-x64": "4.63.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.63.1", + "@rollup/rollup-linux-arm-musleabihf": "4.63.1", + "@rollup/rollup-linux-arm64-gnu": "4.63.1", + "@rollup/rollup-linux-arm64-musl": "4.63.1", + "@rollup/rollup-linux-loong64-gnu": "4.63.1", + "@rollup/rollup-linux-loong64-musl": "4.63.1", + "@rollup/rollup-linux-ppc64-gnu": "4.63.1", + "@rollup/rollup-linux-ppc64-musl": "4.63.1", + "@rollup/rollup-linux-riscv64-gnu": "4.63.1", + "@rollup/rollup-linux-riscv64-musl": "4.63.1", + "@rollup/rollup-linux-s390x-gnu": "4.63.1", + "@rollup/rollup-linux-x64-gnu": "4.63.1", + "@rollup/rollup-linux-x64-musl": "4.63.1", + "@rollup/rollup-openbsd-x64": "4.63.1", + "@rollup/rollup-openharmony-arm64": "4.63.1", + "@rollup/rollup-win32-arm64-msvc": "4.63.1", + "@rollup/rollup-win32-ia32-msvc": "4.63.1", + "@rollup/rollup-win32-x64-gnu": "4.63.1", + "@rollup/rollup-win32-x64-msvc": "4.63.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/seroval": { + "version": "1.6.9", + "resolved": "https://registry.npmjs.org/seroval/-/seroval-1.6.9.tgz", + "integrity": "sha512-UeEzHwAK+yl0YLbsvROV1t5yMYEwZZ0CfKYxDvUgS2fO9Vxdf8djqVIB+OuVpuawRNPqw68LE1Du/GMsW2ZPqA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/seroval-plugins": { + "version": "1.6.9", + "resolved": "https://registry.npmjs.org/seroval-plugins/-/seroval-plugins-1.6.9.tgz", + "integrity": "sha512-kiDK/Tb8IWZ61WEU8pA2PDmAuw37gKph9Y77OZlD56mg0Y2g0Bg7gZ1HeHhs5d40w+nRoUq/wj08V26ilbez9g==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "seroval": "^1.0" + } + }, + "node_modules/sharp": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.4.tgz", + "integrity": "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.4", + "@img/sharp-darwin-x64": "0.35.4", + "@img/sharp-freebsd-wasm32": "0.35.4", + "@img/sharp-libvips-darwin-arm64": "1.3.3", + "@img/sharp-libvips-darwin-x64": "1.3.3", + "@img/sharp-libvips-linux-arm": "1.3.3", + "@img/sharp-libvips-linux-arm64": "1.3.3", + "@img/sharp-libvips-linux-ppc64": "1.3.3", + "@img/sharp-libvips-linux-riscv64": "1.3.3", + "@img/sharp-libvips-linux-s390x": "1.3.3", + "@img/sharp-libvips-linux-x64": "1.3.3", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", + "@img/sharp-libvips-linuxmusl-x64": "1.3.3", + "@img/sharp-linux-arm": "0.35.4", + "@img/sharp-linux-arm64": "0.35.4", + "@img/sharp-linux-ppc64": "0.35.4", + "@img/sharp-linux-riscv64": "0.35.4", + "@img/sharp-linux-s390x": "0.35.4", + "@img/sharp-linux-x64": "0.35.4", + "@img/sharp-linuxmusl-arm64": "0.35.4", + "@img/sharp-linuxmusl-x64": "0.35.4", + "@img/sharp-webcontainers-wasm32": "0.35.4", + "@img/sharp-win32-arm64": "0.35.4", + "@img/sharp-win32-ia32": "0.35.4", + "@img/sharp-win32-x64": "0.35.4" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/simple-swizzle": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", + "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/stoppable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", + "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4", + "npm": ">=6" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/strip-literal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", + "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/style-to-js": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", + "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.14" + } + }, + "node_modules/style-to-object": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", + "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.7" + } + }, + "node_modules/supports-color": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tailwindcss": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.3.tgz", + "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz", + "integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/tsx": { + "version": "4.23.15", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz", + "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.0.tgz", + "integrity": "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/unenv": { + "version": "2.0.0-rc.24", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", + "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "pathe": "^2.0.3" + } + }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/uri-js-replace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uri-js-replace/-/uri-js-replace-1.0.1.tgz", + "integrity": "sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==", + "dev": true, + "license": "MIT" + }, + "node_modules/use-sync-external-store": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz", + "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vite": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz", + "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0 || ^0.28.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz", + "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.7", + "@vitest/mocker": "3.2.7", + "@vitest/pretty-format": "^3.2.7", + "@vitest/runner": "3.2.7", + "@vitest/snapshot": "3.2.7", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.7", + "@vitest/ui": "3.2.7", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/workerd": { + "version": "1.20260910.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260910.1.tgz", + "integrity": "sha512-/HF0f8LmgT60Uk+ZPDbMnlUHjecfV8w4VMo61iFxW7ky7EexTdwbzUCANWZQiG0w1cBihjJTkhzmReeZLGarXw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20260910.1", + "@cloudflare/workerd-darwin-arm64": "1.20260910.1", + "@cloudflare/workerd-linux-64": "1.20260910.1", + "@cloudflare/workerd-linux-arm64": "1.20260910.1", + "@cloudflare/workerd-windows-64": "1.20260910.1" + } + }, + "node_modules/wrangler": { + "version": "4.131.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.131.0.tgz", + "integrity": "sha512-ElsBshkzBhpIeaqc7sP5lsAEXYTrHPxWGKExK+HwIRYFleiKkW4ozvQidW36OXcsIUbZ0pPJJUP5RDodKbN0cA==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/kv-asset-handler": "0.5.0", + "@cloudflare/unenv-preset": "2.16.1", + "blake3-wasm": "2.1.5", + "esbuild": "0.28.1", + "miniflare": "5.20260910.0-alpha", + "path-to-regexp": "6.3.0", + "unenv": "2.0.0-rc.24", + "workerd": "1.20260910.1" + }, + "bin": { + "cf-wrangler": "bin/cf-wrangler.js", + "wrangler": "bin/wrangler.js", + "wrangler2": "bin/wrangler.js" + }, + "engines": { + "node": ">=22.0.0" + }, + "optionalDependencies": { + "fsevents": "2.3.3" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^5.20260910.1" + }, + "peerDependenciesMeta": { + "@cloudflare/workers-types": { + "optional": true + } + } + }, + "node_modules/wrangler/node_modules/@esbuild/aix-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", + "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/darwin-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/darwin-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", + "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/freebsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", + "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-loong64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", + "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-mips64el": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "cpu": [ + "ppc64" + ], "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "bin": { - "workerd": "bin/workerd" - }, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20260910.1", - "@cloudflare/workerd-darwin-arm64": "1.20260910.1", - "@cloudflare/workerd-linux-64": "1.20260910.1", - "@cloudflare/workerd-linux-arm64": "1.20260910.1", - "@cloudflare/workerd-windows-64": "1.20260910.1" + "node": ">=18" } }, - "node_modules/wrangler": { - "version": "4.131.0", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.131.0.tgz", - "integrity": "sha512-ElsBshkzBhpIeaqc7sP5lsAEXYTrHPxWGKExK+HwIRYFleiKkW4ozvQidW36OXcsIUbZ0pPJJUP5RDodKbN0cA==", + "node_modules/wrangler/node_modules/@esbuild/linux-riscv64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "MIT OR Apache-2.0", - "dependencies": { - "@cloudflare/kv-asset-handler": "0.5.0", - "@cloudflare/unenv-preset": "2.16.1", - "blake3-wasm": "2.1.5", - "esbuild": "0.28.1", - "miniflare": "5.20260910.0-alpha", - "path-to-regexp": "6.3.0", - "unenv": "2.0.0-rc.24", - "workerd": "1.20260910.1" - }, - "bin": { - "cf-wrangler": "bin/cf-wrangler.js", - "wrangler": "bin/wrangler.js", - "wrangler2": "bin/wrangler.js" - }, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=22.0.0" - }, - "optionalDependencies": { - "fsevents": "2.3.3" - }, - "peerDependencies": { - "@cloudflare/workers-types": "^5.20260910.1" - }, - "peerDependenciesMeta": { - "@cloudflare/workers-types": { - "optional": true - } + "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/aix-ppc64": { + "node_modules/wrangler/node_modules/@esbuild/linux-s390x": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", "cpu": [ - "ppc64" + "s390x" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "aix" + "linux" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/android-arm": { + "node_modules/wrangler/node_modules/@esbuild/linux-x64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", "cpu": [ - "arm" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "android" + "linux" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/android-arm64": { + "node_modules/wrangler/node_modules/@esbuild/netbsd-arm64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", "cpu": [ "arm64" ], @@ -6751,16 +8591,16 @@ "license": "MIT", "optional": true, "os": [ - "android" + "netbsd" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/android-x64": { + "node_modules/wrangler/node_modules/@esbuild/netbsd-x64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", "cpu": [ "x64" ], @@ -6768,16 +8608,16 @@ "license": "MIT", "optional": true, "os": [ - "android" + "netbsd" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/darwin-arm64": { + "node_modules/wrangler/node_modules/@esbuild/openbsd-arm64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", "cpu": [ "arm64" ], @@ -6785,16 +8625,16 @@ "license": "MIT", "optional": true, "os": [ - "darwin" + "openbsd" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/darwin-x64": { + "node_modules/wrangler/node_modules/@esbuild/openbsd-x64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", + "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", "cpu": [ "x64" ], @@ -6802,16 +8642,16 @@ "license": "MIT", "optional": true, "os": [ - "darwin" + "openbsd" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/freebsd-arm64": { + "node_modules/wrangler/node_modules/@esbuild/openharmony-arm64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", "cpu": [ "arm64" ], @@ -6819,16 +8659,16 @@ "license": "MIT", "optional": true, "os": [ - "freebsd" + "openharmony" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/freebsd-x64": { + "node_modules/wrangler/node_modules/@esbuild/sunos-x64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", "cpu": [ "x64" ], @@ -6836,474 +8676,628 @@ "license": "MIT", "optional": true, "os": [ - "freebsd" + "sunos" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-arm": { + "node_modules/wrangler/node_modules/@esbuild/win32-arm64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", "cpu": [ - "arm" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-arm64": { + "node_modules/wrangler/node_modules/@esbuild/win32-ia32": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", "cpu": [ - "arm64" + "ia32" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], "engines": { "node": ">=18" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-ia32": { + "node_modules/wrangler/node_modules/@esbuild/win32-x64": { "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", + "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", "cpu": [ - "ia32" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], "engines": { - "node": ">=18" + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/esbuild": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.1", + "@esbuild/android-arm": "0.28.1", + "@esbuild/android-arm64": "0.28.1", + "@esbuild/android-x64": "0.28.1", + "@esbuild/darwin-arm64": "0.28.1", + "@esbuild/darwin-x64": "0.28.1", + "@esbuild/freebsd-arm64": "0.28.1", + "@esbuild/freebsd-x64": "0.28.1", + "@esbuild/linux-arm": "0.28.1", + "@esbuild/linux-arm64": "0.28.1", + "@esbuild/linux-ia32": "0.28.1", + "@esbuild/linux-loong64": "0.28.1", + "@esbuild/linux-mips64el": "0.28.1", + "@esbuild/linux-ppc64": "0.28.1", + "@esbuild/linux-riscv64": "0.28.1", + "@esbuild/linux-s390x": "0.28.1", + "@esbuild/linux-x64": "0.28.1", + "@esbuild/netbsd-arm64": "0.28.1", + "@esbuild/netbsd-x64": "0.28.1", + "@esbuild/openbsd-arm64": "0.28.1", + "@esbuild/openbsd-x64": "0.28.1", + "@esbuild/openharmony-arm64": "0.28.1", + "@esbuild/sunos-x64": "0.28.1", + "@esbuild/win32-arm64": "0.28.1", + "@esbuild/win32-ia32": "0.28.1", + "@esbuild/win32-x64": "0.28.1" + } + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", - "cpu": [ - "loong64" - ], + "node_modules/yaml-ast-parser": { + "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "license": "Apache-2.0" + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", "engines": { - "node": ">=18" + "node": ">=12" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", - "cpu": [ - "mips64el" - ], + "node_modules/youch": { + "version": "4.1.0-beta.10", + "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", + "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@poppinss/dumper": "^0.6.4", + "@speed-highlight/core": "^1.2.7", + "cookie": "^1.0.2", + "youch-core": "^0.3.3" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", - "cpu": [ - "ppc64" - ], + "node_modules/youch-core": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", + "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@poppinss/exception": "^1.2.2", + "error-stack-parser-es": "^1.0.5" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", - "cpu": [ - "riscv64" - ], - "dev": true, + "node_modules/zod": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.2.tgz", + "integrity": "sha512-lh5RCAGFa1Cm2hjtNwLQhSs/AsqdWnTQaBER9fEwN/88pSh7KOtJavtBx/0VlkN/uFd61SwYmljLMDAsHlvzBQ==", "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://github.com/sponsors/colinhacks" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "packages/api": { + "name": "factorize", + "version": "0.1.0", + "dependencies": { + "@cloudflare/workers-oauth-provider": "^0.10.3", + "@modelcontextprotocol/hono": "^2.0.0", + "@modelcontextprotocol/server": "^2.0.0", + "cron-parser": "^5.10.1", + "drizzle-orm": "^0.45.2", + "hono": "^4.11.4", + "mustache": "^4.2.0", + "pg": "8.16.3", + "zod": "^4.6.2" + }, + "devDependencies": { + "@cloudflare/vitest-pool-workers": "^0.10.10", + "@cloudflare/workers-types": "^5.20260910.1", + "@types/mustache": "^4.2.6", + "@types/node": "^26.5.1", + "@types/pg": "^8.15.5", + "ajv": "^8.20.0", + "drizzle-kit": "^0.31.10", + "happy-dom": "^20.14.5", + "playwright": "^1.64.0", + "tsx": "^4.23.15", + "typescript": "^5.9.3", + "vitest": "^3.2.4", + "wrangler": "^4.44.0", + "yaml": "^2.9.1" + } + }, + "packages/api-client": { + "name": "factorize-api-client", + "version": "0.1.0", + "dependencies": { + "openapi-fetch": "0.17.0" + }, + "devDependencies": { + "openapi-typescript": "7.13.0", + "typescript": "^5.9.3" + } + }, + "packages/app": { + "name": "factorize-app", + "version": "0.1.0", + "dependencies": { + "@tanstack/react-query": "5.104.1", + "@tanstack/react-router": "1.170.41", + "@tanstack/react-virtual": "^3.14.14", + "factorize-api-client": "0.1.0", + "react": "19.3.0", + "react-dom": "19.3.0", + "react-markdown": "^10.1.0" + }, + "devDependencies": { + "@tailwindcss/vite": "4.3.3", + "@types/react": "^19.2.0", + "@types/react-dom": "^19.2.0", + "playwright": "^1.64.0", + "tailwindcss": "4.3.3", + "typescript": "^5.9.3", + "vite": "8.3.4" + } + }, + "packages/app/node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "packages/app/node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", "cpu": [ - "s390x" + "arm64" ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", "optional": true, "os": [ - "linux" + "android" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "packages/app/node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", "cpu": [ - "x64" + "arm64" ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", "optional": true, "os": [ - "linux" + "darwin" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", - "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "packages/app/node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", "cpu": [ - "arm64" + "x64" ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", "optional": true, "os": [ - "netbsd" + "darwin" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "packages/app/node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", "optional": true, "os": [ - "netbsd" + "freebsd" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", - "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "packages/app/node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", "cpu": [ - "arm64" + "arm" ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", "optional": true, "os": [ - "openbsd" + "linux" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "packages/app/node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", "cpu": [ - "x64" + "arm64" ], "dev": true, - "license": "MIT", + "libc": [ + "glibc" + ], + "license": "MPL-2.0", "optional": true, "os": [ - "openbsd" + "linux" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", - "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "packages/app/node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", + "libc": [ + "musl" + ], + "license": "MPL-2.0", "optional": true, "os": [ - "openharmony" + "linux" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "packages/app/node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", + "libc": [ + "glibc" + ], + "license": "MPL-2.0", "optional": true, "os": [ - "sunos" + "linux" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "packages/app/node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", "cpu": [ - "arm64" + "x64" ], "dev": true, - "license": "MIT", + "libc": [ + "musl" + ], + "license": "MPL-2.0", "optional": true, "os": [ - "win32" + "linux" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "packages/app/node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", "cpu": [ - "ia32" + "arm64" ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "packages/app/node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", "cpu": [ "x64" ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/wrangler/node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "packages/app/node_modules/vite": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz", + "integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==", "dev": true, - "hasInstallScript": true, "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.29", + "rolldown": "~1.2.12", + "tinyglobby": "^0.2.17" + }, "bin": { - "esbuild": "bin/esbuild" + "vite": "bin/vite.js" }, "engines": { - "node": ">=18" + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" - } - }, - "node_modules/ws": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", - "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" + "fsevents": "~2.3.3" }, "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { - "bufferutil": { + "@types/node": { "optional": true }, - "utf-8-validate": { + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { "optional": true } } }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "license": "MIT", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/yaml": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", - "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, - "node_modules/youch": { - "version": "4.1.0-beta.10", - "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", - "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@poppinss/colors": "^4.1.5", - "@poppinss/dumper": "^0.6.4", - "@speed-highlight/core": "^1.2.7", - "cookie": "^1.0.2", - "youch-core": "^0.3.3" - } - }, - "node_modules/youch-core": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", - "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@poppinss/exception": "^1.2.2", - "error-stack-parser-es": "^1.0.5" - } - }, - "node_modules/zod": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.2.tgz", - "integrity": "sha512-lh5RCAGFa1Cm2hjtNwLQhSs/AsqdWnTQaBER9fEwN/88pSh7KOtJavtBx/0VlkN/uFd61SwYmljLMDAsHlvzBQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, - "packages/app": { - "name": "factorize", - "version": "0.1.0", - "dependencies": { - "@cloudflare/workers-oauth-provider": "^0.10.3", - "@modelcontextprotocol/hono": "^2.0.0", - "@modelcontextprotocol/server": "^2.0.0", - "cron-parser": "^5.10.1", - "drizzle-orm": "^0.45.2", - "hono": "^4.11.4", - "mustache": "^4.2.0", - "pg": "8.16.3", - "zod": "^4.6.2" - }, - "devDependencies": { - "@cloudflare/vitest-pool-workers": "^0.10.10", - "@cloudflare/workers-types": "^5.20260910.1", - "@tailwindcss/cli": "^4.1.14", - "@types/mustache": "^4.2.6", - "@types/node": "^26.5.1", - "@types/pg": "^8.15.5", - "ajv": "^8.20.0", - "drizzle-kit": "^0.31.10", - "happy-dom": "^20.14.5", - "playwright": "^1.64.0", - "tailwindcss": "^4.1.14", - "tsx": "^4.23.15", - "typescript": "^5.9.3", - "vitest": "^3.2.4", - "wrangler": "^4.44.0", - "yaml": "^2.9.1" - } - }, "packages/docs": { "name": "factorize-docs", "version": "0.1.0" diff --git a/package.json b/package.json index 38a46344..03889c7b 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,36 @@ "name": "factorize-workspace", "version": "0.1.0", "private": true, - "workspaces": ["packages/*"], + "workspaces": [ + "packages/*" + ], "scripts": { - "dev": "npm run dev --workspace=factorize", + "dev": "npm run build:app && node scripts/dev.mjs", "dev:marketing": "npm run dev --workspace=factorize-marketing", "build:marketing": "npm run build:marketing --workspace=factorize-marketing", - "build:css": "npm run build:css --workspace=factorize", + "build:css": "npm run build:app", "test": "npm run test --workspaces --if-present", - "check": "npm run check --workspace=factorize && npm run check --workspace=factorize-marketing && npm run check --workspace=factorize-tail-relay", + "check": "npm run check:hosting && npm run check:boundaries && npm run check:client && npm run check --workspace=factorize-app && npm run check --workspace=factorize && npm run test:hosting-runtime && npm run test:oauth-runtime && npm run test:rollback-runtime && npm run check --workspace=factorize-marketing && npm run check --workspace=factorize-tail-relay", "deploy": "npm run deploy:marketing && npm run deploy:app && npm run deploy:tail-relay", "deploy:marketing": "npm run deploy --workspace=factorize-marketing", "deploy:app": "npm run deploy --workspace=factorize", "deploy:tail-relay": "npm run deploy --workspace=factorize-tail-relay", "generate:openapi": "npm run generate:openapi --workspace=factorize", - "check:openapi": "npm run check:openapi --workspace=factorize" + "check:openapi": "npm run check:openapi --workspace=factorize", + "dev:api": "npm run dev --workspace=factorize", + "dev:app": "node scripts/dev-cert.mjs && npm run dev --workspace=factorize-app", + "build:app": "npm run build --workspace=factorize-app", + "generate:client": "npm run generate --workspace=factorize-api-client", + "check:client": "npm run check --workspace=factorize-api-client", + "check:boundaries": "node --test scripts/check-package-boundaries.test.mjs && node scripts/check-package-boundaries.mjs", + "generate": "npm run generate:openapi && npm run generate:client", + "build": "npm run build:app && npm run build:marketing", + "check:hosting": "node --test scripts/hosting-invariants.test.mjs scripts/deployment-gate.test.mjs scripts/trusted-app-release.test.mjs && python3 scripts/test-retain-app-assets.py", + "test:hosting-runtime": "node --test scripts/hosting-runtime.test.mjs", + "test:oauth-runtime": "node --test scripts/oauth-runtime.test.mjs", + "test:rollback-runtime": "node --test scripts/rollback-runtime.test.mjs" + }, + "engines": { + "node": ">=24.12.0" } } diff --git a/packages/api-client/package.json b/packages/api-client/package.json new file mode 100644 index 00000000..4eaa248c --- /dev/null +++ b/packages/api-client/package.json @@ -0,0 +1,14 @@ +{ + "name": "factorize-api-client", + "version": "0.1.0", + "private": true, + "type": "module", + "exports": { ".": "./src/index.ts" }, + "scripts": { + "generate": "node scripts/generate.mjs", + "check:generated": "node scripts/generate.mjs --check", + "check": "npm run check:generated && tsc --noEmit" + }, + "dependencies": { "openapi-fetch": "0.17.0" }, + "devDependencies": { "openapi-typescript": "7.13.0", "typescript": "^5.9.3" } +} diff --git a/packages/api-client/scripts/generate.mjs b/packages/api-client/scripts/generate.mjs new file mode 100644 index 00000000..124df0ed --- /dev/null +++ b/packages/api-client/scripts/generate.mjs @@ -0,0 +1,13 @@ +import { readFileSync, writeFileSync } from "node:fs"; +import openapiTS, { astToString } from "openapi-typescript"; + +const target = new URL("../src/schema.d.ts", import.meta.url); +const contract = new URL("../../docs/openapi.yaml", import.meta.url); +const output = "// Generated from packages/docs/openapi.yaml. Do not edit.\n" + + astToString(await openapiTS(contract)); +if (process.argv.includes("--check")) { + if (readFileSync(target, "utf8") !== output) { + console.error("API client is stale. Run npm run generate:client."); + process.exitCode = 1; + } +} else writeFileSync(target, output); diff --git a/packages/api-client/src/index.ts b/packages/api-client/src/index.ts new file mode 100644 index 00000000..26c34b9b --- /dev/null +++ b/packages/api-client/src/index.ts @@ -0,0 +1,6 @@ +import createClient from "openapi-fetch"; +import type { paths } from "./schema"; + +export type { paths, components, operations } from "./schema"; +// Same-origin HttpOnly cookies; no browser token storage or backend imports. +export const api = createClient({ credentials: "same-origin" }); diff --git a/packages/api-client/src/schema.d.ts b/packages/api-client/src/schema.d.ts new file mode 100644 index 00000000..590680ae --- /dev/null +++ b/packages/api-client/src/schema.d.ts @@ -0,0 +1,5109 @@ +// Generated from packages/docs/openapi.yaml. Do not edit. +export interface paths { + "/api/v1/session": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get current browser session + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + get: operations["get_api_v1_session"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/auth/login": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Sign in + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + post: operations["post_api_v1_auth_login"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/auth/signup": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Request signup; existing accounts return the same accepted response + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + post: operations["post_api_v1_auth_signup"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/auth/email-verification/request": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Request email verification + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + post: operations["post_api_v1_auth_email_verification_request"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/auth/email-verification/complete": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Complete email verification + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + post: operations["post_api_v1_auth_email_verification_complete"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/auth/password-reset/request": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Request password reset + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + post: operations["post_api_v1_auth_password_reset_request"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/auth/password-reset/complete": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Complete password reset + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + post: operations["post_api_v1_auth_password_reset_complete"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/auth/password": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Change password and invalidate sessions + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + post: operations["post_api_v1_auth_password"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/auth/logout": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Revoke current session and clear browser cookie + * @description Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached. + */ + post: operations["post_api_v1_auth_logout"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/oauth/device/preview": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Inspect a device authorization code */ + post: operations["post_api_v1_oauth_device_preview"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/oauth/device/decision": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Approve or deny a device authorization code */ + post: operations["post_api_v1_oauth_device_decision"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/oauth/consent/preview": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Inspect an OAuth consent request */ + post: operations["post_api_v1_oauth_consent_preview"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/oauth/consent/decision": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Decide an OAuth consent request */ + post: operations["post_api_v1_oauth_consent_decision"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/trigger-contexts": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get template autocomplete metadata + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_trigger_contexts"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/exe-connections": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List exe connections + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_exe_connections"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/github-installations": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List GitHub installations + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_github_installations"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/execution-targets": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List execution targets + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_execution_targets"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/job-trigger-availability": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List available trigger kinds + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_job_trigger_availability"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/schedules/preview": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Preview schedule + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_schedules_preview"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/cloudflare-tail": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List Tail integrations + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_integrations_cloudflare_tail"]; + put?: never; + /** + * Create a Tail integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_integrations_cloudflare_tail"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List installed integrations + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_integrations"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/exe": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Create an exe.dev integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + put: operations["put_api_v1_integrations_exe"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/exe/test": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Test exe.dev credentials + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_integrations_exe_test"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/amp": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Create an Amp integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + put: operations["put_api_v1_integrations_amp"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/amp/test": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Test Amp credentials + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_integrations_amp_test"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/providers/linear/projects": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List Linear projects + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_providers_linear_projects"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/providers/linear/options": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List Linear trigger options + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_providers_linear_options"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/providers/clickup/lists": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List ClickUp lists + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_providers_clickup_lists"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/providers/clickup/options": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List ClickUp trigger options + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_providers_clickup_options"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/providers/github/installations": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List GitHub installations for provider setup + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_providers_github_installations"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/access/authorized-clients": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List authorized OAuth clients + * @description Requires the flows:read scope. + * + * An interactive owner session is required; bearer tokens cannot call this operation. + */ + get: operations["get_api_v1_access_authorized_clients"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/access-tokens": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List access tokens + * @description Requires the flows:read scope. + * + * An interactive owner session is required; bearer tokens cannot call this operation. + */ + get: operations["get_api_v1_access_tokens"]; + put?: never; + /** + * Create an access token + * @description Requires the flows:write scope. + * + * An interactive owner session is required; bearer tokens cannot call this operation. + */ + post: operations["post_api_v1_access_tokens"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/access-tokens/{tokenId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Revoke an access token + * @description Requires the flows:write scope. + * + * An interactive owner session is required; bearer tokens cannot call this operation. + */ + delete: operations["delete_api_v1_access_tokens_tokenId"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/access/authorized-clients/{clientId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Revoke an authorized OAuth client + * @description Requires the flows:write scope. + * + * An interactive owner session is required; bearer tokens cannot call this operation. + */ + delete: operations["delete_api_v1_access_authorized_clients_clientId"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/exe/{connectionId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Remove an exe.dev integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + delete: operations["delete_api_v1_integrations_exe_connectionId"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/amp/{connectionId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Remove an Amp integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + delete: operations["delete_api_v1_integrations_amp_connectionId"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/cloudflare-tail/{integrationId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Update a Tail integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + put: operations["put_api_v1_integrations_cloudflare_tail_integrationId"]; + post?: never; + /** + * Remove a Tail integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + delete: operations["delete_api_v1_integrations_cloudflare_tail_integrationId"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/cloudflare-tail/{integrationId}/test": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Test a Tail integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_integrations_cloudflare_tail_integrationId_test"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/providers/github/installations/{installationId}/repositories": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List installation repositories + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_providers_github_installations_installationId_repositories"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/providers/github/installations/{installationId}/repositories/{repositoryId}/issue-options": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List GitHub issue trigger options + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_providers_github_installations_installationId_repositories_repositoryId_issue_options"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/providers/github/installations/{installationId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Disconnect a GitHub installation + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + delete: operations["delete_api_v1_providers_github_installations_installationId"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/integrations/exe/{connectionId}/diagnostics": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Probe exe.dev permissions and a disposable VM's agent/model integration + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_integrations_exe_connectionId_diagnostics"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/job-summaries": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List bounded job summaries + * @description Additive list representation, ordered by immutable UUID descending. Cursor is the last ID; filters must remain the same between pages. Literal case-insensitive name/slug search. No prompts or trigger configuration; statistics are batched. Existing GET /jobs remains an array. + * + * Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_job_summaries"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/job-selector": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Search bounded lifecycle job options + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_job_selector"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/jobs": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List jobs + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_jobs"]; + put?: never; + /** + * Create job + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_jobs"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/job-handlers/test": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Test webhook handler + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_job_handlers_test"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/jobs/{jobId}/invocations": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Invoke job + * @description Requires the runs:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_jobs_jobId_invocations"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/jobs/{jobId}/events": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List webhook activity + * @description Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_jobs_jobId_events"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/jobs/{jobId}/enable": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Enable job + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_jobs_jobId_enable"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/jobs/{jobId}/disable": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Disable job + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_jobs_jobId_disable"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/jobs/{jobId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get job + * @description Requires the flows:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_jobs_jobId"]; + /** + * Replace job + * @description Supply expectedUpdatedAt from GET for atomic optimistic concurrency. Stale edits return 409 stale_job. Omission preserves legacy REST/MCP last-writer-wins updates. Trigger identity is preserved. + * + * Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + put: operations["put_api_v1_jobs_jobId"]; + post?: never; + /** + * Delete job + * @description Requires the flows:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + delete: operations["delete_api_v1_jobs_jobId"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List runs + * @description Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_runs"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/search": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Search jobs and runs + * @description Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_search"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/webhooks/deliveries": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Search webhook deliveries + * @description Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_webhooks_deliveries"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/webhooks/deliveries/{deliveryId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get webhook delivery detail and processing timeline + * @description Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_webhooks_deliveries_deliveryId"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs/{runId}/status": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get lightweight run status + * @description No prompt decryption, invocation context, artifacts, activity or diagnostics assembly. Continue polling terminal runs while finalizing is true. trace_revision changes on generation transition or canonical projection/replay; live appends retain the revision. Full detail remains available at GET /runs/{runId}. + * + * Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_runs_runId_status"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs/{runId}/trace-pages": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get revision-bound trace page + * @description First request omits revision and uses after=0. Subsequent requests supply the returned revision. A changed generation or canonical projection returns reset=true and events from zero in the new revision, from one database snapshot. Discard all cached old pages before merging the response. nextCursor=null means caught up, not finalized; poll after the last sequence while active/finalizing. Legacy GET /trace remains unchanged. + * + * Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_runs_runId_trace_pages"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs/{runId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get run + * @description Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_runs_runId"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs/{runId}/trace": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get paginated run trace events + * @description Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_runs_runId_trace"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs/{runId}/trace/replay": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Replay a retained trace artifact or restore a native-session projection + * @description Requires runs:write and an interactive tenant owner session. One terminal run per request, limited to 10 attempts per tenant per minute including retries and failures. Projection and result commit atomically; no artifacts are deleted. Retry failed requests with the same requestId. Conflicting reuse is rejected. Missing bytes cannot be recovered. Does not change the source declaration of an active or future run. + * + * Requires the runs:write scope. + * + * An interactive owner session is required; bearer tokens cannot call this operation. + */ + post: operations["post_api_v1_runs_runId_trace_replay"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs/{runId}/diagnostics": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get credential-safe run lifecycle diagnostics + * @description Requires the runs:read scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + get: operations["get_api_v1_runs_runId_diagnostics"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs/{runId}/stop": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Stop run + * @description Requires the runs:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_runs_runId_stop"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v1/runs/{runId}/kill": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Kill run and immediately release its concurrency slot + * @description Requires the runs:write scope. + * + * Accepts a scoped bearer token or interactive owner session. + */ + post: operations["post_api_v1_runs_runId_kill"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + Error: { + error: { + code: string; + message: string; + }; + }; + Run: { + id: string; + job_id: string; + issue_id: string; + issue_url: string | null; + issue_title: string; + run_name: string; + agent_name: string; + workspace_name: string; + agent_kind: string; + /** @enum {string} */ + state: "queued" | "starting" | "running" | "blocked" | "stopping" | "succeeded" | "failed" | "stopped" | "done" | "ignored"; + provider: string; + backend_kind: string; + capabilities: string[]; + destination_url: string | null; + /** @enum {string} */ + artifact_state: "pending" | "collecting" | "stored" | "partial" | "failed"; + artifact_error: string | null; + created_at: string; + updated_at: string; + started_at: string | null; + } & { + [key: string]: unknown; + }; + RunPage: { + items: { + id: string; + job_id: string; + issue_id: string; + issue_url: string | null; + issue_title: string; + run_name: string; + agent_name: string; + workspace_name: string; + agent_kind: string; + /** @enum {string} */ + state: "queued" | "starting" | "running" | "blocked" | "stopping" | "succeeded" | "failed" | "stopped" | "done" | "ignored"; + provider: string; + backend_kind: string; + capabilities: string[]; + destination_url: string | null; + /** @enum {string} */ + artifact_state: "pending" | "collecting" | "stored" | "partial" | "failed"; + artifact_error: string | null; + created_at: string; + updated_at: string; + started_at: string | null; + }[]; + nextCursor: string | null; + }; + /** @description First terminal backend observation, retained independently of collection and cleanup errors. Null for older or nonterminal runs. Commands and raw backend responses are never included. */ + ExecutionDiagnostics: { + /** @enum {string} */ + state: "succeeded" | "failed" | "stopped"; + /** @description Bounded credential-redacted backend observation detail */ + detail: string | null; + systemd: { + loadState: string; + activeState: string; + subState: string; + result: string; + /** @description systemd ExecMainCode (for example 1 for exit and 2 for signal) */ + execMainCode: number | null; + /** @description systemd exit status or signal number; null if unavailable */ + execMainStatus: number | null; + } | null; + } | null; + /** @description Stored redacted harness stderr artifact, or null if unavailable. Uses the combined log for older VMs. Retains at most the first 64 KiB, drops a truncated final line, and redacts recognizable credentials before storage. The object key is a storage locator, not a public or signed URL. This artifact remains available after VM deletion. */ + HarnessLog: { + id: string; + /** @constant */ + kind: "terminal_log"; + object_key: string; + provider: string; + /** @constant */ + format: "text"; + format_version?: string | null; + cli_version?: string | null; + /** @description Live source generation bound to the terminal snapshot; unknown for historical receipts. */ + source_generation?: string | null; + native_session_id?: string | null; + /** @description Byte count (PostgreSQL bigint may serialize as a decimal string) */ + byte_size: number | string; + sha256: string; + /** @enum {string} */ + state: "stored"; + /** Format: date-time */ + created_at: string; + } | null; + TraceSource: { + /** @enum {string} */ + kind: "execution_stream" | "native_session"; + /** @description Guest source path; historical native sources may use a discovery root */ + path: string; + /** @constant */ + mediaType: "application/x-ndjson"; + /** @enum {string} */ + provider: "codex" | "claude" | "pi"; + formatVersion?: string; + cliVersion?: string; + harnessVersion?: string; + /** @description Native session discovery only */ + discoverCommand?: string; + }; + TraceSources: { + primary?: components["schemas"]["TraceSource"]; + nativeSession?: components["schemas"]["TraceSource"]; + } | null; + /** @description Committed projection receipt. Null means no durable reconciliation evidence; it does not mean complete. */ + TraceProjection: { + /** @enum {string} */ + source_kind?: "execution_stream" | "native_session"; + artifact_sha256?: string; + parser_version?: string; + /** Format: date-time */ + updated_at?: string; + reconciliation?: { + /** @enum {string} */ + state?: "matched" | "mismatch" | "no_live_cursor" | "reprojected"; + events?: number; + liveEvents?: number; + mismatches?: number; + liveOffset?: number | null; + artifactBytes?: number; + generation?: string | null; + /** + * @description Completion evidence from the exact retained canonical Codex bytes. + * @enum {string} + */ + codexCompletion?: "turn.completed" | "missing_turn_completed"; + }; + } | null; + TraceDiagnostics: { + /** @description Agent trace provider; the outer diagnostics provider remains the trigger provider. */ + provider: string | null; + /** @enum {string} */ + primarySource: "execution_stream" | "native_session"; + sourceVersion: string | null; + projection: components["schemas"]["TraceProjection"]; + liveCursor: { + generation?: string; + committed_offset?: number | string; + pending_bytes?: number; + /** Format: date-time */ + updated_at?: string; + } | null; + counts: { + events?: number; + parse_warnings?: number; + unknown_events?: number; + unknownEventRate?: number; + }; + /** @description Tenant/run-scoped receipts; storage keys are locators, never public download URLs. Includes kind, provider, source_path, source_generation, format and source/CLI/harness versions, byte size, checksum and storage state. */ + artifacts: Record[]; + /** + * @description Canonical Codex runs do not capture native sessions. Historical native receipts remain readable. + * @enum {string} + */ + nativeArtifactState: "stored" | "missing" | "not_applicable"; + /** @description Native projection selected for a run originally declared with an execution stream primary. */ + fallbackUsed: boolean; + /** @description Latest completed replay request ID */ + lastReplay: Record | null; + }; + TraceReplayResult: { + /** Format: uuid */ + requestId: string; + /** Format: uuid */ + runId: string; + /** @enum {string} */ + status: "projected" | "already_projected" | "skipped" | "unrecoverable"; + /** @enum {string} */ + reason?: "run_active" | "ambiguous_artifacts" | "missing_artifact" | "unsupported_artifact" | "artifact_not_retained"; + /** @enum {string} */ + sourceKind?: "execution_stream" | "native_session"; + sha256?: string; + parserVersion?: string; + reconciliation?: Record; + }; + RunDetail: { + id: string; + state: string; + /** @description Live file generation; clients reset trace pagination when it changes. */ + trace_generation?: string | null; + trace_projection?: components["schemas"]["TraceProjection"]; + trace_sources?: components["schemas"]["TraceSources"]; + execution_diagnostics: components["schemas"]["ExecutionDiagnostics"]; + harness_log: components["schemas"]["HarnessLog"]; + /** @description Secondary artifact or cleanup error; does not replace execution_diagnostics */ + artifact_error?: string | null; + /** @description Current job name, included so run content does not require a separate job request. */ + job_name: string; + prompt: string; + context: { + [key: string]: unknown; + }; + invocation: { + id: string; + source: string; + claim_key: string; + trigger_id: string | null; + context: { + [key: string]: unknown; + }; + occurrence: { + [key: string]: unknown; + } | null; + created_at: string; + }; + activity: { + action: string; + detail: string; + created_at: string; + }[]; + tenant_id?: string; + invocation_id?: string; + execution_handle?: { + backendKind: string; + id: string; + } | null; + execution_backend_kind?: string; + execution_capabilities?: string[]; + claim_released?: boolean; + vm_cleanup_attempt?: number; + vm_cleanup_complete?: boolean; + /** Format: date-time */ + cleanup_next_at?: string | null; + occurrence?: { + [key: string]: unknown; + } | null; + invocation_source?: string; + invocation_claim_key?: string; + invocation_trigger_id?: string | null; + /** Format: date-time */ + invocation_created_at?: string; + } & WithRequired; + RunDiagnostics: { + runId: string; + jobId: string; + state: string; + provider?: string; + backendKind?: string; + trace?: components["schemas"]["TraceDiagnostics"]; + traceSources?: components["schemas"]["TraceSources"]; + execution: components["schemas"]["ExecutionDiagnostics"]; + harnessLog: components["schemas"]["HarnessLog"]; + artifact: { + state?: string; + /** @description Secondary collection or cleanup error. Collection is retried up to three times before cleanup proceeds with partial artifacts. Cleanup failures remain retryable. */ + error?: string | null; + }; + activity: Record[]; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + }; + JobInput: { + name: string; + slug: string; + promptTemplate: string; + runNameTemplate?: string; + /** @default 1 */ + concurrencyLimit: number; + executionTargetId: string; + model?: string; + effort?: string; + /** @default [] */ + triggers: ({ + id?: string; + slug?: string; + /** @constant */ + kind: "manual"; + /** @default true */ + enabled: boolean; + /** @default {} */ + config: Record; + } | { + id?: string; + slug?: string; + /** @constant */ + kind: "schedule"; + /** @default true */ + enabled: boolean; + config: { + cron: string; + timezone: string; + }; + } | { + id?: string; + slug?: string; + /** @constant */ + kind: "webhook"; + /** @default true */ + enabled: boolean; + config: { + handlerCode?: string; + /** @constant */ + provider: "linear"; + projectId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + } | { + handlerCode?: string; + /** @constant */ + provider: "clickup"; + listId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + } | { + handlerCode?: string; + /** @constant */ + provider: "github"; + installationId: number; + repositoryId: number; + event?: string; + action?: string; + matchRules?: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + } | { + handlerCode?: string; + /** @constant */ + provider: "cloudflareTail"; + integrationId: string; + }; + } | { + id?: string; + slug?: string; + /** @constant */ + kind: "jobLifecycle"; + /** @default true */ + enabled: boolean; + config: { + sourceJobIds: string[]; + states: ("succeeded" | "failed" | "stopped" | "edited")[]; + }; + })[]; + }; + ManualInvocation: { + /** @default */ + prompt: string; + data?: { + [key: string]: unknown; + }; + name?: string; + idempotencyKey?: string; + }; + JobHandlerTest: { + handlerCode: string; + payload: { + [key: string]: unknown; + }; + }; + TraceReplayRequest: { + /** + * Format: uuid + * @description Tenant-scoped idempotency key; preserve it when retrying. Use a new key to reconsider a previously skipped or unrecoverable run. + */ + requestId: string; + /** + * @description Primary replays the persisted source declaration (native for historical runs); native_session selects retained native bytes for other providers or historical native-only Codex runs. Canonical Codex runs reject native replay. + * @default primary + * @enum {string} + */ + source: "primary" | "native_session"; + }; + }; + responses: { + /** @description Invalid request */ + Error400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Invalid or revoked credentials */ + Error401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Missing scope or required owner session */ + Error403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Resource not found */ + Error404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Operation conflict */ + Error409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unsupported media type; use application/json */ + Error415: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Rate limit exceeded */ + Error429: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal error */ + Error500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Service unavailable */ + Error503: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + get_api_v1_session: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Unauthenticated sessions return authenticated:false; expired, unverified, removed or revoked owners are unauthenticated. */ + 200: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + authenticated: false; + } | { + /** @constant */ + authenticated: true; + user: { + id: string; + /** Format: email */ + email: string; + }; + workspace: { + id: string; + name: string | null; + /** @constant */ + role: "owner"; + }; + capabilities: ("flows:read" | "flows:write" | "runs:read" | "runs:write")[]; + /** Format: date-time */ + expiresAt: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_auth_login: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** Format: email */ + email: string; + password: string; + returnTo?: string; + }; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + returnTo: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_auth_signup: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** Format: email */ + email: string; + password: string; + }; + }; + }; + responses: { + /** @description Success */ + 202: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_auth_email_verification_request: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** Format: email */ + email: string; + }; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_auth_email_verification_complete: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + token: string; + }; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_auth_password_reset_request: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** Format: email */ + email: string; + }; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_auth_password_reset_complete: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + token: string; + password: string; + }; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_auth_password: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + currentPassword: string; + password: string; + }; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_auth_logout: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Success */ + 200: { + headers: { + /** @description Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover. */ + "X-Factorize-Contract"?: "gen-2157-static-v1"; + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_oauth_device_preview: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + userCode: string; + }; + }; + }; + responses: { + /** @description Pending device request */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + userCode: string; + clientName: string; + scopes: string[]; + expiresAt: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_oauth_device_decision: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + userCode: string; + /** @enum {string} */ + decision: "allow" | "deny"; + }; + }; + }; + responses: { + /** @description Device decision */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @enum {string} */ + status: "approved" | "denied"; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_oauth_consent_preview: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + authorizationQuery: string; + }; + }; + }; + responses: { + /** @description Owner-bound expiring consent */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + clientName: string; + scopes: string[]; + request: string; + signature: string; + expiresAt: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_oauth_consent_decision: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + request: string; + signature: string; + /** @enum {string} */ + decision: "allow" | "deny"; + scopes: ("flows:read" | "flows:write" | "runs:read" | "runs:write")[]; + }; + }; + }; + responses: { + /** @description Validated protocol destination */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + redirectTo: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_trigger_contexts: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Paths by trigger kind/provider */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + [key: string]: { + path: string; + /** @enum {string} */ + type: "string" | "number" | "boolean" | "object" | "array" | "unknown"; + description: string; + example?: unknown; + }[]; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_exe_connections: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Safe metadata */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + connectionId: string; + /** @enum {string} */ + agentKind: "codex" | "claude" | "pi"; + /** @default [] */ + tags: string[]; + /** @default [] */ + models: string[]; + /** @default */ + modelsRefreshedAt: string; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_github_installations: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Installations */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + installationId: number | string; + accountLogin: string; + accountType: string; + state: string; + updatedAt: string; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_execution_targets: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Targets */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + /** @enum {string} */ + kind: "exe-vm" | "amp"; + name: string; + workspace: string; + cwd: string; + agentKind: string; + models?: string[]; + modelsRefreshedAt?: string | null; + efforts?: string[]; + capabilities: string[]; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_job_trigger_availability: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Availability */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + manual: true; + /** @constant */ + schedule: true; + /** @constant */ + jobLifecycle: true; + linear: boolean; + clickup: boolean; + github: boolean; + cloudflareTail: boolean; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_schedules_preview: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + cron: string; + timezone: string; + }; + }; + }; + responses: { + /** @description Next occurrence */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: date-time */ + nextRunAt: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_integrations_cloudflare_tail: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Integrations */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + integrationId: string; + name: string; + /** @constant */ + status: "connected"; + /** @constant */ + secretConfigured: true; + createdAt?: string; + updatedAt?: string; + referencedJobCount: number; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_integrations_cloudflare_tail: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + integrationId?: string; + name: string; + signingSecret?: "" | string; + generateSecret?: boolean; + }; + }; + }; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + integrationId: string; + name: string; + /** @constant */ + status: "connected"; + /** @constant */ + secretConfigured: true; + generatedSecret?: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_integrations: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Credential-safe integration status */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + linear: { + organizationName: string | null; + viewerEmail: string | null; + } | null; + clickup: { + teamName: string | null; + } | null; + exe: { + connectionId: string; + /** @enum {string} */ + agentKind: "codex" | "claude" | "pi"; + /** @default [] */ + tags: string[]; + /** @default [] */ + models: string[]; + /** @default */ + modelsRefreshedAt: string; + } | null; + exeConnections: { + connectionId: string; + /** @enum {string} */ + agentKind: "codex" | "claude" | "pi"; + /** @default [] */ + tags: string[]; + /** @default [] */ + models: string[]; + /** @default */ + modelsRefreshedAt: string; + }[]; + ampConnections: { + connectionId: string; + project: string; + apiBaseUrl?: string; + }[]; + cloudflareTail: { + count: number; + installations: { + integrationId: string; + name: string; + /** @constant */ + status: "connected"; + /** @constant */ + secretConfigured: true; + createdAt?: string; + updatedAt?: string; + referencedJobCount: number; + }[]; + }; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + put_api_v1_integrations_exe: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + connectionId?: string; + apiToken: string; + /** @enum {string} */ + agentKind: "codex" | "claude" | "pi"; + tags?: string[]; + }; + }; + }; + responses: { + /** @description Saved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ok: boolean; + connectionId: string; + models: string[]; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_integrations_exe_test: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + connectionId?: string; + apiToken?: string; + /** @enum {string} */ + agentKind?: "codex" | "claude" | "pi"; + tags?: string[]; + }; + }; + }; + responses: { + /** @description Test result */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ok: boolean; + missingPermissions: string[]; + tags: string[]; + checks: { + command: string; + ok: boolean; + httpStatus: number; + exitCode: number | null; + output: string; + }[]; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + put_api_v1_integrations_amp: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + connectionId?: string; + accessToken: string; + project: string; + /** Format: uri */ + apiBaseUrl?: string; + }; + }; + }; + responses: { + /** @description Saved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ok: boolean; + connectionId: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_integrations_amp_test: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + connectionId?: string; + accessToken?: string; + project?: string; + /** Format: uri */ + apiBaseUrl?: string; + }; + }; + }; + responses: { + /** @description Test result */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ok: boolean; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_providers_linear_projects: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Projects */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name: string; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_providers_linear_options: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Options */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + statuses: { + id: string; + name: string; + }[]; + users: { + id: string; + name: string; + }[]; + labels: { + id: string; + name: string; + }[]; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_providers_clickup_lists: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Lists */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name: string; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_providers_clickup_options: { + parameters: { + query?: { + listId?: string; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Options */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + statuses: { + id: string; + name: string; + }[]; + users: { + id: string; + name: string; + }[]; + labels: { + id: string; + name: string; + }[]; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_providers_github_installations: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Installations */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + installationId: number | string; + accountLogin: string; + accountType: string; + state: string; + updatedAt: string; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_access_authorized_clients: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Clients */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + grantId: string; + clientId: string; + clientName: string; + scopes: string[]; + authorizationDate: string; + expiresAt: string | null; + lastUsedAt: string | null; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_access_tokens: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Token metadata */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name: string; + scopes: ("flows:read" | "flows:write" | "runs:read" | "runs:write")[]; + created_at: string; + expires_at: string; + last_used_at?: string | null; + revoked_at?: string | null; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_access_tokens: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name: string; + scopes: ("flows:read" | "flows:write" | "runs:read" | "runs:write")[]; + expiryDays: 7 | 30 | 90; + }; + }; + }; + responses: { + /** @description Created token */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name: string; + scopes: ("flows:read" | "flows:write" | "runs:read" | "runs:write")[]; + created_at: string; + expires_at: string; + last_used_at?: string | null; + revoked_at?: string | null; + token: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + delete_api_v1_access_tokens_tokenId: { + parameters: { + query?: never; + header?: never; + path: { + tokenId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Revoked */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + delete_api_v1_access_authorized_clients_clientId: { + parameters: { + query?: never; + header?: never; + path: { + clientId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Revoked grants */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + delete_api_v1_integrations_exe_connectionId: { + parameters: { + query?: never; + header?: never; + path: { + connectionId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Removed */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + delete_api_v1_integrations_amp_connectionId: { + parameters: { + query?: never; + header?: never; + path: { + connectionId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Removed */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + put_api_v1_integrations_cloudflare_tail_integrationId: { + parameters: { + query?: never; + header?: never; + path: { + integrationId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + integrationId?: string; + name: string; + signingSecret?: "" | string; + generateSecret?: boolean; + }; + }; + }; + responses: { + /** @description Updated */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + integrationId: string; + name: string; + /** @constant */ + status: "connected"; + /** @constant */ + secretConfigured: true; + generatedSecret?: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + delete_api_v1_integrations_cloudflare_tail_integrationId: { + parameters: { + query?: never; + header?: never; + path: { + integrationId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Removed */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_integrations_cloudflare_tail_integrationId_test: { + parameters: { + query?: never; + header?: never; + path: { + integrationId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Test result */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ok: boolean; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_providers_github_installations_installationId_repositories: { + parameters: { + query?: never; + header?: never; + path: { + installationId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Repositories */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: number; + name: string; + fullName: string; + owner: string; + private: boolean; + defaultBranch: string; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_providers_github_installations_installationId_repositories_repositoryId_issue_options: { + parameters: { + query?: never; + header?: never; + path: { + installationId: string; + repositoryId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Options */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + statuses: { + id: string; + name: string; + }[]; + users: { + id: string; + name: string; + }[]; + labels: { + id: string; + name: string; + }[]; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + delete_api_v1_providers_github_installations_installationId: { + parameters: { + query?: never; + header?: never; + path: { + installationId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Disconnected */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_integrations_exe_connectionId_diagnostics: { + parameters: { + query?: never; + header?: never; + path: { + connectionId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Credential-safe diagnostic result */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_job_summaries: { + parameters: { + query?: { + limit?: number; + cursor?: string; + q?: string; + enabled?: "true" | "false"; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Summary page */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + items: { + /** Format: uuid */ + id: string; + name: string; + slug: string; + enabled: boolean; + model: string; + effort: string; + agentKind: string; + concurrencyLimit: number; + runningCount: number; + lastRunState: ("queued" | "starting" | "running" | "blocked" | "stopping" | "succeeded" | "failed" | "stopped" | "done" | "ignored") | null; + createdAt: string; + updatedAt: string; + }[]; + nextCursor: string | null; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_job_selector: { + parameters: { + query?: { + limit?: number; + cursor?: string; + q?: string; + enabled?: "true" | "false"; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Selector page; same ordering/filter semantics as job-summaries */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + items: { + /** Format: uuid */ + id: string; + name: string; + slug: string; + enabled: boolean; + }[]; + nextCursor: string | null; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_jobs: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Jobs */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id: string; + name: string; + slug: string; + enabled: boolean; + promptTemplate: string; + runNameTemplate: string; + model: string; + effort?: string; + executionTarget: { + connectionId: string; + workspace?: string; + cwd?: string; + agentKind: string; + }; + executionTargetId: string; + agentKind: string; + concurrencyLimit: number; + runningCount: number; + currentRuns: number; + maxConcurrency: number; + lastRunState: ("queued" | "starting" | "running" | "blocked" | "stopping" | "succeeded" | "failed" | "stopped" | "done" | "ignored") | null; + triggers: ({ + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "manual"; + /** @default true */ + enabled: boolean; + /** @default {} */ + config: Record; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "schedule"; + /** @default true */ + enabled: boolean; + config: { + cron: string; + timezone: string; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "webhook"; + /** @default true */ + enabled: boolean; + config: { + handlerCode?: string; + /** @constant */ + provider: "linear"; + projectId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "clickup"; + listId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "github"; + installationId: number; + repositoryId: number; + event?: string; + action?: string; + matchRules?: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "cloudflareTail"; + integrationId: string; + destination?: string; + secretConfigured?: boolean; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "jobLifecycle"; + /** @default true */ + enabled: boolean; + config: { + sourceJobIds: string[]; + states: ("succeeded" | "failed" | "stopped" | "edited")[]; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + })[]; + createdAt: string; + updatedAt: string; + }[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_jobs: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["JobInput"]; + }; + }; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id: string; + name: string; + slug: string; + enabled: boolean; + promptTemplate: string; + runNameTemplate: string; + model: string; + effort?: string; + executionTarget: { + connectionId: string; + workspace?: string; + cwd?: string; + agentKind: string; + }; + executionTargetId: string; + agentKind: string; + concurrencyLimit: number; + runningCount: number; + currentRuns: number; + maxConcurrency: number; + lastRunState: ("queued" | "starting" | "running" | "blocked" | "stopping" | "succeeded" | "failed" | "stopped" | "done" | "ignored") | null; + triggers: ({ + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "manual"; + /** @default true */ + enabled: boolean; + /** @default {} */ + config: Record; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "schedule"; + /** @default true */ + enabled: boolean; + config: { + cron: string; + timezone: string; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "webhook"; + /** @default true */ + enabled: boolean; + config: { + handlerCode?: string; + /** @constant */ + provider: "linear"; + projectId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "clickup"; + listId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "github"; + installationId: number; + repositoryId: number; + event?: string; + action?: string; + matchRules?: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "cloudflareTail"; + integrationId: string; + destination?: string; + secretConfigured?: boolean; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "jobLifecycle"; + /** @default true */ + enabled: boolean; + config: { + sourceJobIds: string[]; + states: ("succeeded" | "failed" | "stopped" | "edited")[]; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + })[]; + createdAt: string; + updatedAt: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_job_handlers_test: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["JobHandlerTest"]; + }; + }; + responses: { + /** @description Decision */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @constant */ + ok: true; + decision: boolean | { + [key: string]: unknown; + }; + } | { + /** @constant */ + ok: false; + /** @enum {string} */ + category: "handler_error" | "invalid_return" | "timeout" | "platform_error"; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_jobs_jobId_invocations: { + parameters: { + query?: never; + header?: never; + path: { + jobId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ManualInvocation"]; + }; + }; + responses: { + /** @description Accepted */ + 202: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + invocationId: string; + runId: string; + state: string; + duplicate: boolean; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + /** @description queue_full — this job already has one queued run. Retry after it starts. Duplicate idempotency keys return the original run. */ + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_jobs_jobId_events: { + parameters: { + query?: { + limit?: number; + }; + header?: never; + path: { + jobId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Activity */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record[]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_jobs_jobId_enable: { + parameters: { + query?: never; + header?: never; + path: { + jobId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Enabled */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_jobs_jobId_disable: { + parameters: { + query?: never; + header?: never; + path: { + jobId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Disabled */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_jobs_jobId: { + parameters: { + query?: never; + header?: never; + path: { + jobId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Job */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id: string; + name: string; + slug: string; + enabled: boolean; + promptTemplate: string; + runNameTemplate: string; + model: string; + effort?: string; + executionTarget: { + connectionId: string; + workspace?: string; + cwd?: string; + agentKind: string; + }; + executionTargetId: string; + agentKind: string; + concurrencyLimit: number; + runningCount: number; + currentRuns: number; + maxConcurrency: number; + lastRunState: ("queued" | "starting" | "running" | "blocked" | "stopping" | "succeeded" | "failed" | "stopped" | "done" | "ignored") | null; + triggers: ({ + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "manual"; + /** @default true */ + enabled: boolean; + /** @default {} */ + config: Record; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "schedule"; + /** @default true */ + enabled: boolean; + config: { + cron: string; + timezone: string; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "webhook"; + /** @default true */ + enabled: boolean; + config: { + handlerCode?: string; + /** @constant */ + provider: "linear"; + projectId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "clickup"; + listId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "github"; + installationId: number; + repositoryId: number; + event?: string; + action?: string; + matchRules?: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "cloudflareTail"; + integrationId: string; + destination?: string; + secretConfigured?: boolean; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "jobLifecycle"; + /** @default true */ + enabled: boolean; + config: { + sourceJobIds: string[]; + states: ("succeeded" | "failed" | "stopped" | "edited")[]; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + })[]; + createdAt: string; + updatedAt: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + put_api_v1_jobs_jobId: { + parameters: { + query?: never; + header?: never; + path: { + jobId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name: string; + slug: string; + promptTemplate: string; + runNameTemplate?: string; + /** @default 1 */ + concurrencyLimit?: number; + executionTargetId: string; + model?: string; + effort?: string; + /** @default [] */ + triggers?: ({ + id?: string; + slug?: string; + /** @constant */ + kind: "manual"; + /** @default true */ + enabled?: boolean; + /** @default {} */ + config?: Record; + } | { + id?: string; + slug?: string; + /** @constant */ + kind: "schedule"; + /** @default true */ + enabled?: boolean; + config: { + cron: string; + timezone: string; + }; + } | { + id?: string; + slug?: string; + /** @constant */ + kind: "webhook"; + /** @default true */ + enabled?: boolean; + config: { + handlerCode?: string; + /** @constant */ + provider: "linear"; + projectId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + } | { + handlerCode?: string; + /** @constant */ + provider: "clickup"; + listId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + } | { + handlerCode?: string; + /** @constant */ + provider: "github"; + installationId: number; + repositoryId: number; + event?: string; + action?: string; + matchRules?: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + } | { + handlerCode?: string; + /** @constant */ + provider: "cloudflareTail"; + integrationId: string; + }; + } | { + id?: string; + slug?: string; + /** @constant */ + kind: "jobLifecycle"; + /** @default true */ + enabled?: boolean; + config: { + sourceJobIds: string[]; + states: ("succeeded" | "failed" | "stopped" | "edited")[]; + }; + })[]; + /** Format: date-time */ + expectedUpdatedAt?: string; + }; + }; + }; + responses: { + /** @description Updated */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id: string; + name: string; + slug: string; + enabled: boolean; + promptTemplate: string; + runNameTemplate: string; + model: string; + effort?: string; + executionTarget: { + connectionId: string; + workspace?: string; + cwd?: string; + agentKind: string; + }; + executionTargetId: string; + agentKind: string; + concurrencyLimit: number; + runningCount: number; + currentRuns: number; + maxConcurrency: number; + lastRunState: ("queued" | "starting" | "running" | "blocked" | "stopping" | "succeeded" | "failed" | "stopped" | "done" | "ignored") | null; + triggers: ({ + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "manual"; + /** @default true */ + enabled: boolean; + /** @default {} */ + config: Record; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "schedule"; + /** @default true */ + enabled: boolean; + config: { + cron: string; + timezone: string; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "webhook"; + /** @default true */ + enabled: boolean; + config: { + handlerCode?: string; + /** @constant */ + provider: "linear"; + projectId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "clickup"; + listId: string; + matchRules: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "github"; + installationId: number; + repositoryId: number; + event?: string; + action?: string; + matchRules?: { + /** @enum {string} */ + type: "owner" | "creator" | "status" | "label" | "assignee"; + targetId: string; + }[]; + secretConfigured?: boolean; + } | { + handlerCode?: string; + /** @constant */ + provider: "cloudflareTail"; + integrationId: string; + destination?: string; + secretConfigured?: boolean; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + } | { + /** Format: uuid */ + id: string; + slug: string; + /** @constant */ + kind: "jobLifecycle"; + /** @default true */ + enabled: boolean; + config: { + sourceJobIds: string[]; + states: ("succeeded" | "failed" | "stopped" | "edited")[]; + }; + /** Format: uuid */ + jobId: string; + createdAt: string; + updatedAt: string; + })[]; + createdAt: string; + updatedAt: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + /** @description stale_job: reload and reconcile before retrying */ + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + delete_api_v1_jobs_jobId: { + parameters: { + query?: never; + header?: never; + path: { + jobId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_runs: { + parameters: { + query?: { + jobId?: string; + state?: "queued" | "starting" | "running" | "done" | "blocked" | "failed" | "ignored" | "succeeded" | "stopping" | "stopped"; + contextQuery?: string; + limit?: number; + cursor?: string; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Paginated runs */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["RunPage"]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_search: { + parameters: { + query?: { + q?: string; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Search results */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + items: { + /** @enum {string} */ + kind: "job" | "run"; + id: string; + title: string; + subtitle: string; + url: string; + }[]; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_webhooks_deliveries: { + parameters: { + query?: { + provider?: string; + deliveryId?: string; + event?: string; + action?: string; + outcome?: string; + jobId?: string; + q?: string; + cursor?: string; + limit?: number; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Cursor-paginated safe delivery records */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_webhooks_deliveries_deliveryId: { + parameters: { + query?: never; + header?: never; + path: { + deliveryId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Safe delivery detail */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_runs_runId_status: { + parameters: { + query?: never; + header?: never; + path: { + runId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Status */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + job_id: string; + /** @enum {string} */ + state: "queued" | "starting" | "running" | "blocked" | "stopping" | "succeeded" | "failed" | "stopped"; + run_name: string; + job_name: string; + destination_url: string | null; + created_at: string; + updated_at: string; + started_at: string | null; + /** @enum {string} */ + artifact_state: "pending" | "collecting" | "stored" | "partial" | "failed"; + finalizing: boolean; + trace_revision: string; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_runs_runId_trace_pages: { + parameters: { + query?: { + after?: number; + limit?: number; + revision?: string; + }; + header?: never; + path: { + runId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Revision-bound page */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + items: { + sequence: number; + id: string; + parentId?: string; + /** @enum {string} */ + type: "user_message" | "assistant_message" | "reasoning" | "tool_call" | "tool_result" | "command" | "file_change" | "compaction" | "branch" | "usage" | "warning" | "error" | "metadata"; + role?: string; + title: string; + preview: string; + occurredAt?: string; + display: { + [key: string]: unknown; + }; + }[]; + nextCursor: number | null; + revision: string; + reset: boolean; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_runs_runId: { + parameters: { + query?: never; + header?: never; + path: { + runId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Run including durable execution diagnostics and harness artifact location */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["RunDetail"]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_runs_runId_trace: { + parameters: { + query?: { + after?: number; + limit?: number; + }; + header?: never; + path: { + runId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Trace page */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + items: Record[]; + nextCursor: number | null; + }; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_runs_runId_trace_replay: { + parameters: { + query?: never; + header?: never; + path: { + runId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TraceReplayRequest"]; + }; + }; + responses: { + /** @description Durable replay result */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TraceReplayResult"]; + }; + }; + /** @description Invalid request */ + 400: components["responses"]["Error400"]; + /** @description Invalid owner session */ + 401: components["responses"]["Error401"]; + /** @description Missing runs:write scope or interactive owner session */ + 403: components["responses"]["Error403"]; + /** @description Run not found within the tenant */ + 404: components["responses"]["Error404"]; + /** @description Request ID conflict or artifact ownership/checksum mismatch */ + 409: components["responses"]["Error409"]; + 415: components["responses"]["Error415"]; + /** @description Tenant rate limit reached; wait one minute before retrying */ + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + /** @description Artifact storage unavailable */ + 503: components["responses"]["Error503"]; + }; + }; + get_api_v1_runs_runId_diagnostics: { + parameters: { + query?: never; + header?: never; + path: { + runId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Credential-safe execution metadata and durable harness artifact location */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["RunDiagnostics"]; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_runs_runId_stop: { + parameters: { + query?: never; + header?: never; + path: { + runId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Stopped */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; + post_api_v1_runs_runId_kill: { + parameters: { + query?: never; + header?: never; + path: { + runId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Killed */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["Error400"]; + 401: components["responses"]["Error401"]; + 403: components["responses"]["Error403"]; + 404: components["responses"]["Error404"]; + 409: components["responses"]["Error409"]; + 429: components["responses"]["Error429"]; + 500: components["responses"]["Error500"]; + 503: components["responses"]["Error503"]; + }; + }; +} +type WithRequired = T & { + [P in K]-?: T[P]; +}; diff --git a/packages/api-client/tsconfig.json b/packages/api-client/tsconfig.json new file mode 100644 index 00000000..06198dbc --- /dev/null +++ b/packages/api-client/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "ES2022", "module": "ESNext", "moduleResolution": "Bundler", + "lib": ["ES2022", "DOM"], "types": [], "strict": true, + "skipLibCheck": true, "noEmit": true + }, + "include": ["src"] +} diff --git a/packages/app/.dev.vars.example b/packages/api/.dev.vars.example similarity index 100% rename from packages/app/.dev.vars.example rename to packages/api/.dev.vars.example diff --git a/packages/app/drizzle.config.ts b/packages/api/drizzle.config.ts similarity index 100% rename from packages/app/drizzle.config.ts rename to packages/api/drizzle.config.ts diff --git a/packages/app/migrations/0001_app_schema.sql b/packages/api/migrations/0001_app_schema.sql similarity index 100% rename from packages/app/migrations/0001_app_schema.sql rename to packages/api/migrations/0001_app_schema.sql diff --git a/packages/app/migrations/0002_native_run_artifacts.sql b/packages/api/migrations/0002_native_run_artifacts.sql similarity index 100% rename from packages/app/migrations/0002_native_run_artifacts.sql rename to packages/api/migrations/0002_native_run_artifacts.sql diff --git a/packages/app/migrations/0003_incremental_trace_ingestion.sql b/packages/api/migrations/0003_incremental_trace_ingestion.sql similarity index 100% rename from packages/app/migrations/0003_incremental_trace_ingestion.sql rename to packages/api/migrations/0003_incremental_trace_ingestion.sql diff --git a/packages/app/migrations/0003_postgres_runtime_completion.sql b/packages/api/migrations/0003_postgres_runtime_completion.sql similarity index 100% rename from packages/app/migrations/0003_postgres_runtime_completion.sql rename to packages/api/migrations/0003_postgres_runtime_completion.sql diff --git a/packages/app/migrations/0004_trigger_lifecycle.sql b/packages/api/migrations/0004_trigger_lifecycle.sql similarity index 100% rename from packages/app/migrations/0004_trigger_lifecycle.sql rename to packages/api/migrations/0004_trigger_lifecycle.sql diff --git a/packages/app/migrations/0005_oauth_device_authorizations.sql b/packages/api/migrations/0005_oauth_device_authorizations.sql similarity index 100% rename from packages/app/migrations/0005_oauth_device_authorizations.sql rename to packages/api/migrations/0005_oauth_device_authorizations.sql diff --git a/packages/app/migrations/0006_job_delete_cascade.sql b/packages/api/migrations/0006_job_delete_cascade.sql similarity index 100% rename from packages/app/migrations/0006_job_delete_cascade.sql rename to packages/api/migrations/0006_job_delete_cascade.sql diff --git a/packages/app/migrations/0007_harness_diagnostics.sql b/packages/api/migrations/0007_harness_diagnostics.sql similarity index 100% rename from packages/app/migrations/0007_harness_diagnostics.sql rename to packages/api/migrations/0007_harness_diagnostics.sql diff --git a/packages/app/migrations/0007_job_edit_deliveries.sql b/packages/api/migrations/0007_job_edit_deliveries.sql similarity index 100% rename from packages/app/migrations/0007_job_edit_deliveries.sql rename to packages/api/migrations/0007_job_edit_deliveries.sql diff --git a/packages/app/migrations/0008_native_accounts.sql b/packages/api/migrations/0008_native_accounts.sql similarity index 100% rename from packages/app/migrations/0008_native_accounts.sql rename to packages/api/migrations/0008_native_accounts.sql diff --git a/packages/app/migrations/0009_remove_auth_usernames.sql b/packages/api/migrations/0009_remove_auth_usernames.sql similarity index 100% rename from packages/app/migrations/0009_remove_auth_usernames.sql rename to packages/api/migrations/0009_remove_auth_usernames.sql diff --git a/packages/app/migrations/0010_trace_sources.sql b/packages/api/migrations/0010_trace_sources.sql similarity index 100% rename from packages/app/migrations/0010_trace_sources.sql rename to packages/api/migrations/0010_trace_sources.sql diff --git a/packages/app/migrations/0011_trace_rollout.sql b/packages/api/migrations/0011_trace_rollout.sql similarity index 100% rename from packages/app/migrations/0011_trace_rollout.sql rename to packages/api/migrations/0011_trace_rollout.sql diff --git a/packages/app/migrations/0012_canonical_trace_receipts.sql b/packages/api/migrations/0012_canonical_trace_receipts.sql similarity index 100% rename from packages/app/migrations/0012_canonical_trace_receipts.sql rename to packages/api/migrations/0012_canonical_trace_receipts.sql diff --git a/packages/app/migrations/README.md b/packages/api/migrations/README.md similarity index 100% rename from packages/app/migrations/README.md rename to packages/api/migrations/README.md diff --git a/packages/api/package.json b/packages/api/package.json new file mode 100644 index 00000000..77bacab4 --- /dev/null +++ b/packages/api/package.json @@ -0,0 +1,50 @@ +{ + "name": "factorize", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "dev": "wrangler dev --local-protocol https --var APP_ORIGIN:https://localhost:5173", + "check": "npm run check:openapi && npm run check:api-boundaries && node --test scripts/validate-auth-email.check.mjs && tsc --noEmit && vitest run && wrangler deploy --dry-run", + "check:api-boundaries": "node scripts/check-api-boundaries.mjs", + "test": "vitest run", + "deploy": "node ../../scripts/prepare-app-deploy.mjs && wrangler deploy", + "benchmark:loading": "vitest run --config scripts/loading-baseline.config.ts", + "db:migrate": "node scripts/migrate.mjs", + "db:verify": "node scripts/verify-schema.mjs", + "db:studio": "drizzle-kit studio --config drizzle.config.ts", + "auth:validate-email": "node scripts/validate-auth-email.mjs", + "generate:openapi": "tsx scripts/generate-openapi.ts", + "check:openapi": "tsx scripts/generate-openapi.ts --check", + "test:static-slice": "vitest run --config scripts/static-slice.config.ts", + "benchmark:migration": "vitest run --config scripts/migration-measurements.config.ts", + "deploy:prepared": "wrangler deploy" + }, + "dependencies": { + "@cloudflare/workers-oauth-provider": "^0.10.3", + "@modelcontextprotocol/hono": "^2.0.0", + "@modelcontextprotocol/server": "^2.0.0", + "cron-parser": "^5.10.1", + "drizzle-orm": "^0.45.2", + "hono": "^4.11.4", + "mustache": "^4.2.0", + "pg": "8.16.3", + "zod": "^4.6.2" + }, + "devDependencies": { + "@cloudflare/vitest-pool-workers": "^0.10.10", + "@cloudflare/workers-types": "^5.20260910.1", + "@types/mustache": "^4.2.6", + "@types/node": "^26.5.1", + "@types/pg": "^8.15.5", + "ajv": "^8.20.0", + "drizzle-kit": "^0.31.10", + "happy-dom": "^20.14.5", + "playwright": "^1.64.0", + "tsx": "^4.23.15", + "typescript": "^5.9.3", + "vitest": "^3.2.4", + "wrangler": "^4.44.0", + "yaml": "^2.9.1" + } +} diff --git a/packages/app/performance/GEN-2154.md b/packages/api/performance/GEN-2154.md similarity index 100% rename from packages/app/performance/GEN-2154.md rename to packages/api/performance/GEN-2154.md diff --git a/packages/api/performance/GEN-2157-bounded-reads.md b/packages/api/performance/GEN-2157-bounded-reads.md new file mode 100644 index 00000000..a421a5bc --- /dev/null +++ b/packages/api/performance/GEN-2157-bounded-reads.md @@ -0,0 +1,34 @@ +# Bounded-read migration measurements + +Local repeatable evidence, October 9, 2026; Node 24.21.0, PostgreSQL 16. Run +`AUTH_TEST_DATABASE_URL= npm run benchmark:migration --workspace=factorize`. +The runner creates and removes isolated databases and writes `gen-2157-bounded-reads.json`. +Five measured samples follow one warmup. Calls include service authorization. Query counts include +membership lookup. Request counts are equivalent API operations, **not measured browser navigations**. +No production latency or throughput claim is made. Local timings include pool/crypto overhead and +are sensitive to concurrent VM work. + +| Representation, large fixture | Queries | JSON bytes | Median ms | +| --- | ---: | ---: | ---: | +| Legacy jobs array | 4 | 10,347,734 | 716.52 | +| Summary jobs, 30 items | 2 | 8,583 | 4.93 | +| Individual job | 4 | 50,925 | 14.91 | +| Job + legacy all-jobs editor reads | 8 | 10,398,662 | 705.19 | +| Job + bounded selector reads | 6 | 54,141 | 16.30 | +| Legacy full run detail poll | 6 | 151,363 | 14.98 | +| Lightweight run status poll | 2 | 360 | 4.12 | +| Revision-bound trace page, 100 events | 2 | 59,670 | 5.44 | + +The large workspace has 205 jobs with 50,000-character prompts, 50,000-character invocation +context and 20,000 trace events. The raw artifact also records the ten-job fixture and timing ranges. +The editor comparison measures available API reads; the React editor is not yet implemented. +A full job-detail response remains necessary for an editor and intentionally retains its prompt. +The summary query never selects encrypted prompts/configuration and performs one batch statistics +aggregation for the selected page. The selector skips statistics. The run-status query never +selects/decrypts prompts or assembles invocation context, activity, diagnostics or artifacts. + +The initial React trace view renders one page of at most 100 events. This bounds its DOM but does +not establish virtualized long-trace/continuous-scroll parity, which remains a cutover gate. +Browser rendering/frame/focus/selection measurements and production request/header/cache evidence +remain outstanding. The compiled-browser slice verifies actual API/DB navigation and invocation, +but routes requests through the test interceptor, not Cloudflare's production hosting layer. diff --git a/packages/api/performance/GEN-2157-feature-parity.md b/packages/api/performance/GEN-2157-feature-parity.md new file mode 100644 index 00000000..ed52e46f --- /dev/null +++ b/packages/api/performance/GEN-2157-feature-parity.md @@ -0,0 +1,62 @@ +# GEN-2157 feature reads and long traces + +The committed `gen-2157-feature-reads.json` records a warmup and five samples for +both a 10-job workspace and a 205-job workspace with 50k-character prompts/context +and 20,000 trace events. The API service includes authoritative authorization. +Queries count database calls; request counts represent equivalent API operations, +not complete browser navigation. Timing includes local PostgreSQL 16 and encryption, +not Cloudflare/Hyperdrive or network transit. Historical artifacts remain unchanged; +changes in fixture trigger configuration and random ordering mean their exact byte +counts and timings must not be used as controlled before/after comparisons. + +For the current large fixture: + +| Operation | Requests | Queries incl. auth | JSON bytes | +| --- | ---: | ---: | ---: | +| Compatible full jobs array | 1 | 4 | 10,347,884 | +| 30 summaries | 1 | 2 | 8,595 | +| Full editor job | 1 | 4 | 50,940 | +| Legacy editor job + all jobs | 2 | 8 | 10,398,827 | +| Static editor job + targets + availability + template metadata | 4 | 10 | 56,706 | +| Optional 30-item lifecycle selector | 1 | 2 | 3,225 | +| Compatible full run detail | 1 | 6 | 151,363 | +| Frequent status | 1 | 2 | 360 | +| Revision-bound 100-event trace page | 1 | 2 | 59,670 | + +The static editor does not request the selector unless its lifecycle picker is open; +provider resources load for the selected provider and selected installation/list/repo. +Full detail and diagnostics load on expansion. Active refresh uses status and trace +pages, continues through terminal artifact finalization, and invalidates expanded +metadata on state/finalization transitions. Continuous trace refresh rereads only the +last loaded page, rather than every accumulated page. + +`gen-2157-trace-browser.json` records one compiled React/Chromium sample with mocked +HTTP pages: 20,000 events, 102 trace requests including live/reset reads, and at most +38 mounted event rows. Expanded details survive scrolling, and a live generation +change discards old pages. The virtualizer retains focused and selection-endpoint rows +in addition to its viewport/overscan. The measured traversal includes Playwright +scrolling and waits; it is not a frame-time benchmark or production performance claim. +Memory still grows with loaded event data; DOM work is bounded independently. + +Reproduce service reads with `AUTH_TEST_DATABASE_URL` pointing to a disposable local +PostgreSQL admin database and `npm run benchmark:migration --workspace=factorize`. +Reproduce browser evidence after `npm run build:app` with +`GEN_2157_RECORD_TRACE=1 node --test packages/app/test/jobs.browser.test.mjs`. +The compiled-app/actual-Worker/PostgreSQL test separately proves job navigation, +invocation idempotency, canonical reset, concurrent edit reconciliation, trigger +identity, encrypted prompts, API-key lifecycle and static CSP routing. It does not +launch execution providers or validate Cloudflare's deployed production edge. + +`gen-2157-cutover-validation.json` records final package/runtime checks and their +limits. The actual local protocol runtime exercises public registration, PKCE, +static consent, device approval, OAuth MCP calls, API-key REST/MCP access, scopes +and session-version revocation using isolated KV/PostgreSQL. The actual rollback +runtime restores `ff4b51b`, its legacy UI and compiled chunks without state changes. +HTTPS Vite-to-Worker session proxying also passed. + +The initial pre-cutover check returned 401 for `/api/v1/session`; that historical +result is recorded in `gen-2157-cutover-validation.json`. The subsequent API anchor +and static production deployments succeeded, as recorded separately in +`gen-2157-production-rollout.json`. Brendan's later Linear production review reports +that app.factorize.sh works. See `docs/package-migration.md` for release evidence, +its limits, branch lineage and the preserved rollback checkpoint. diff --git a/packages/app/performance/gen-2154-after.json b/packages/api/performance/gen-2154-after.json similarity index 100% rename from packages/app/performance/gen-2154-after.json rename to packages/api/performance/gen-2154-after.json diff --git a/packages/app/performance/gen-2154-before.json b/packages/api/performance/gen-2154-before.json similarity index 100% rename from packages/app/performance/gen-2154-before.json rename to packages/api/performance/gen-2154-before.json diff --git a/packages/app/performance/gen-2154-proxy-baseline.jsonl b/packages/api/performance/gen-2154-proxy-baseline.jsonl similarity index 100% rename from packages/app/performance/gen-2154-proxy-baseline.jsonl rename to packages/api/performance/gen-2154-proxy-baseline.jsonl diff --git a/packages/api/performance/gen-2157-bounded-reads.json b/packages/api/performance/gen-2157-bounded-reads.json new file mode 100644 index 00000000..cd1671f1 --- /dev/null +++ b/packages/api/performance/gen-2157-bounded-reads.json @@ -0,0 +1,218 @@ +{ + "date": "2026-10-09", + "node": "v24.21.0", + "samples": 5, + "warmup": 1, + "database": "local PostgreSQL 16, no injected latency", + "scope": "Service-level calls incl authorization; requests are equivalent API requests, not browser navigation measurements. Large fixture: 205 jobs/50k prompts/50k run context/20k trace events.", + "report": [ + { + "jobs": 10, + "trace_events": 0, + "operation": "legacy_jobs", + "requests": 1, + "queries": 4, + "bytes": 9285, + "median_ms": 13.87, + "range_ms": [ + 10.38, + 15.19 + ] + }, + { + "jobs": 10, + "trace_events": 0, + "operation": "summary_jobs", + "requests": 1, + "queries": 2, + "bytes": 2733, + "median_ms": 5.4, + "range_ms": [ + 4.94, + 5.99 + ] + }, + { + "jobs": 10, + "trace_events": 0, + "operation": "job_detail", + "requests": 1, + "queries": 4, + "bytes": 931, + "median_ms": 11.1, + "range_ms": [ + 9.54, + 16.4 + ] + }, + { + "jobs": 10, + "trace_events": 0, + "operation": "legacy_editor_job_and_all_jobs", + "requests": 2, + "queries": 8, + "bytes": 10219, + "median_ms": 15.5, + "range_ms": [ + 13.34, + 17.39 + ] + }, + { + "jobs": 10, + "trace_events": 0, + "operation": "bounded_editor_job_and_selector", + "requests": 2, + "queries": 6, + "bytes": 1873, + "median_ms": 13.5, + "range_ms": [ + 11.39, + 17.64 + ] + }, + { + "jobs": 10, + "trace_events": 0, + "operation": "legacy_run_poll", + "requests": 1, + "queries": 6, + "bytes": 1351, + "median_ms": 11.17, + "range_ms": [ + 8.79, + 16.82 + ] + }, + { + "jobs": 10, + "trace_events": 0, + "operation": "lightweight_status_poll", + "requests": 1, + "queries": 2, + "bytes": 360, + "median_ms": 5.33, + "range_ms": [ + 4.66, + 5.87 + ] + }, + { + "jobs": 10, + "trace_events": 0, + "operation": "revision_trace_page", + "requests": 1, + "queries": 2, + "bytes": 88, + "median_ms": 4.37, + "range_ms": [ + 3.88, + 4.58 + ] + }, + { + "jobs": 205, + "trace_events": 20000, + "operation": "legacy_jobs", + "requests": 1, + "queries": 4, + "bytes": 10347734, + "median_ms": 716.52, + "range_ms": [ + 686.33, + 736.79 + ] + }, + { + "jobs": 205, + "trace_events": 20000, + "operation": "summary_jobs", + "requests": 1, + "queries": 2, + "bytes": 8583, + "median_ms": 4.93, + "range_ms": [ + 4.6, + 5.17 + ] + }, + { + "jobs": 205, + "trace_events": 20000, + "operation": "job_detail", + "requests": 1, + "queries": 4, + "bytes": 50925, + "median_ms": 14.91, + "range_ms": [ + 13.23, + 15.77 + ] + }, + { + "jobs": 205, + "trace_events": 20000, + "operation": "legacy_editor_job_and_all_jobs", + "requests": 2, + "queries": 8, + "bytes": 10398662, + "median_ms": 705.19, + "range_ms": [ + 704.71, + 738.27 + ] + }, + { + "jobs": 205, + "trace_events": 20000, + "operation": "bounded_editor_job_and_selector", + "requests": 2, + "queries": 6, + "bytes": 54141, + "median_ms": 16.3, + "range_ms": [ + 13.79, + 17.58 + ] + }, + { + "jobs": 205, + "trace_events": 20000, + "operation": "legacy_run_poll", + "requests": 1, + "queries": 6, + "bytes": 151363, + "median_ms": 14.98, + "range_ms": [ + 13.49, + 17.82 + ] + }, + { + "jobs": 205, + "trace_events": 20000, + "operation": "lightweight_status_poll", + "requests": 1, + "queries": 2, + "bytes": 360, + "median_ms": 4.12, + "range_ms": [ + 3.97, + 4.67 + ] + }, + { + "jobs": 205, + "trace_events": 20000, + "operation": "revision_trace_page", + "requests": 1, + "queries": 2, + "bytes": 59670, + "median_ms": 5.44, + "range_ms": [ + 5.04, + 6.9 + ] + } + ] +} diff --git a/packages/api/performance/gen-2157-cutover-validation.json b/packages/api/performance/gen-2157-cutover-validation.json new file mode 100644 index 00000000..e39c8763 --- /dev/null +++ b/packages/api/performance/gen-2157-cutover-validation.json @@ -0,0 +1,42 @@ +{ + "observedAt": "2026-10-09T21:14:38.019736+00:00", + "scope": "Local validation and read-only public gate; no production deployment or state mutation", + "checks": { + "rootCheck": { + "command": "npm run check", + "passed": true, + "apiTestsPassed": 327, + "apiExistingSkips": 5, + "appTestsPassed": 26, + "boundaryTestsPassed": 11, + "runtimeChecks": [ + "static route/security/cache ownership", + "OAuth PKCE consent/device grants, REST API keys, MCP, scope and session revocation", + "legacy rollback anchor with retained static chunks" + ] + }, + "staticSlice": { + "passed": true, + "tests": 2, + "scope": "Compiled React through Worker static routing, API dispatcher, repositories and disposable PostgreSQL" + }, + "docs": { + "passed": true + }, + "marketingBuild": { + "passed": true + }, + "devProxy": { + "passed": true, + "scope": "HTTPS Vite to actual local Worker public session endpoint" + } + }, + "publicApiFirstGate": { + "origin": "https://app.factorize.sh", + "passed": false, + "httpStatus": 401, + "expectedStatus": 200, + "requiredContract": "gen-2157-static-v1", + "nextAction": "Deploy additive anchor ff4b51b preserving existing infrastructure; verify marker before final static deployment. Then execute public routing/CSP/cache and authenticated release smoke checks." + } +} diff --git a/packages/api/performance/gen-2157-feature-reads.json b/packages/api/performance/gen-2157-feature-reads.json new file mode 100644 index 00000000..44469e9f --- /dev/null +++ b/packages/api/performance/gen-2157-feature-reads.json @@ -0,0 +1,690 @@ +{ + "date": "2026-10-09", + "node": "v24.21.0", + "samples": 5, + "warmup": 1, + "database": "local PostgreSQL 16, no injected latency", + "scope": "Service-level calls incl authorization; requests are equivalent API requests, not browser navigation measurements. Large fixture: 205 jobs/50k prompts/50k run context/20k trace events.", + "report": [ + { + "sample_ms": [ + 26.310199999999895, + 22.98316499999987, + 20.792189000000008, + 20.043088000000125, + 20.3160170000001 + ], + "query_samples": [ + 4, + 4, + 4, + 4, + 4 + ], + "byte_samples": [ + 9435, + 9435, + 9435, + 9435, + 9435 + ], + "jobs": 10, + "trace_events": 0, + "operation": "legacy_jobs", + "requests": 1, + "queries": 4, + "bytes": 9435, + "median_ms": 20.79, + "range_ms": [ + 20.04, + 26.31 + ] + }, + { + "sample_ms": [ + 9.107628000000204, + 9.095299999999952, + 8.321853000000146, + 7.958208999999897, + 8.152628999999934 + ], + "query_samples": [ + 2, + 2, + 2, + 2, + 2 + ], + "byte_samples": [ + 2733, + 2733, + 2733, + 2733, + 2733 + ], + "jobs": 10, + "trace_events": 0, + "operation": "summary_jobs", + "requests": 1, + "queries": 2, + "bytes": 2733, + "median_ms": 8.32, + "range_ms": [ + 7.96, + 9.11 + ] + }, + { + "sample_ms": [ + 17.970960000000105, + 16.91041499999983, + 16.312992000000122, + 16.56998599999997, + 23.949039999999968 + ], + "query_samples": [ + 4, + 4, + 4, + 4, + 4 + ], + "byte_samples": [ + 946, + 946, + 946, + 946, + 946 + ], + "jobs": 10, + "trace_events": 0, + "operation": "job_detail", + "requests": 1, + "queries": 4, + "bytes": 946, + "median_ms": 16.91, + "range_ms": [ + 16.31, + 23.95 + ] + }, + { + "sample_ms": [ + 23.809070000000247, + 25.183915999999954, + 24.013676000000032, + 37.21445399999993, + 28.50173700000005 + ], + "query_samples": [ + 8, + 8, + 8, + 8, + 8 + ], + "byte_samples": [ + 10384, + 10384, + 10384, + 10384, + 10384 + ], + "jobs": 10, + "trace_events": 0, + "operation": "legacy_editor_job_and_all_jobs", + "requests": 2, + "queries": 8, + "bytes": 10384, + "median_ms": 25.18, + "range_ms": [ + 23.81, + 37.21 + ] + }, + { + "sample_ms": [ + 21.523561999999856, + 18.779860999999983, + 20.095708000000286, + 24.286433000000216, + 21.864972999999736 + ], + "query_samples": [ + 6, + 6, + 6, + 6, + 6 + ], + "byte_samples": [ + 1888, + 1888, + 1888, + 1888, + 1888 + ], + "jobs": 10, + "trace_events": 0, + "operation": "bounded_editor_job_and_selector", + "requests": 2, + "queries": 6, + "bytes": 1888, + "median_ms": 21.52, + "range_ms": [ + 18.78, + 24.29 + ] + }, + { + "sample_ms": [ + 31.79145500000004, + 28.596528000000035, + 26.6319910000002, + 32.48185700000022, + 26.161837000000105 + ], + "query_samples": [ + 10, + 10, + 10, + 10, + 10 + ], + "byte_samples": [ + 6712, + 6712, + 6712, + 6712, + 6712 + ], + "jobs": 10, + "trace_events": 0, + "operation": "static_editor_configuration", + "requests": 4, + "queries": 10, + "bytes": 6712, + "median_ms": 28.6, + "range_ms": [ + 26.16, + 32.48 + ] + }, + { + "sample_ms": [ + 7.006546000000071, + 7.498811999999816, + 8.104589000000033, + 6.787148000000343, + 7.483979999999974 + ], + "query_samples": [ + 2, + 2, + 2, + 2, + 2 + ], + "byte_samples": [ + 939, + 939, + 939, + 939, + 939 + ], + "jobs": 10, + "trace_events": 0, + "operation": "static_lifecycle_selector", + "requests": 1, + "queries": 2, + "bytes": 939, + "median_ms": 7.48, + "range_ms": [ + 6.79, + 8.1 + ] + }, + { + "sample_ms": [ + 15.712484000000131, + 17.310743000000002, + 15.804701000000023, + 16.729064000000108, + 22.629125999999815 + ], + "query_samples": [ + 6, + 6, + 6, + 6, + 6 + ], + "byte_samples": [ + 1351, + 1351, + 1351, + 1351, + 1351 + ], + "jobs": 10, + "trace_events": 0, + "operation": "legacy_run_poll", + "requests": 1, + "queries": 6, + "bytes": 1351, + "median_ms": 16.73, + "range_ms": [ + 15.71, + 22.63 + ] + }, + { + "sample_ms": [ + 8.108594000000267, + 8.069676000000072, + 6.569183000000066, + 7.992391000000225, + 7.291392999999971 + ], + "query_samples": [ + 2, + 2, + 2, + 2, + 2 + ], + "byte_samples": [ + 360, + 360, + 360, + 360, + 360 + ], + "jobs": 10, + "trace_events": 0, + "operation": "lightweight_status_poll", + "requests": 1, + "queries": 2, + "bytes": 360, + "median_ms": 7.99, + "range_ms": [ + 6.57, + 8.11 + ] + }, + { + "sample_ms": [ + 7.96372700000029, + 8.539678999999978, + 7.028558999999859, + 7.692050999999992, + 6.982440999999653 + ], + "query_samples": [ + 2, + 2, + 2, + 2, + 2 + ], + "byte_samples": [ + 88, + 88, + 88, + 88, + 88 + ], + "jobs": 10, + "trace_events": 0, + "operation": "revision_trace_page", + "requests": 1, + "queries": 2, + "bytes": 88, + "median_ms": 7.69, + "range_ms": [ + 6.98, + 8.54 + ] + }, + { + "sample_ms": [ + 739.4635589999998, + 729.1292779999994, + 745.8092079999997, + 719.7077710000003, + 767.6228360000005 + ], + "query_samples": [ + 4, + 4, + 4, + 4, + 4 + ], + "byte_samples": [ + 10347884, + 10347884, + 10347884, + 10347884, + 10347884 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "legacy_jobs", + "requests": 1, + "queries": 4, + "bytes": 10347884, + "median_ms": 739.46, + "range_ms": [ + 719.71, + 767.62 + ] + }, + { + "sample_ms": [ + 9.623789999999644, + 9.709197000000131, + 8.962331000000631, + 10.002966999998534, + 9.090131999999358 + ], + "query_samples": [ + 2, + 2, + 2, + 2, + 2 + ], + "byte_samples": [ + 8623, + 8623, + 8623, + 8623, + 8623 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "summary_jobs", + "requests": 1, + "queries": 2, + "bytes": 8623, + "median_ms": 9.62, + "range_ms": [ + 8.96, + 10 + ] + }, + { + "sample_ms": [ + 22.21664899999996, + 22.110599999999977, + 22.35985299999993, + 19.95539800000006, + 20.326152999999977 + ], + "query_samples": [ + 4, + 4, + 4, + 4, + 4 + ], + "byte_samples": [ + 50940, + 50940, + 50940, + 50940, + 50940 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "job_detail", + "requests": 1, + "queries": 4, + "bytes": 50940, + "median_ms": 22.11, + "range_ms": [ + 19.96, + 22.36 + ] + }, + { + "sample_ms": [ + 724.4078690000006, + 744.6739529999995, + 723.9835359999997, + 805.8122299999995, + 753.3043890000008 + ], + "query_samples": [ + 8, + 8, + 8, + 8, + 8 + ], + "byte_samples": [ + 10398827, + 10398827, + 10398827, + 10398827, + 10398827 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "legacy_editor_job_and_all_jobs", + "requests": 2, + "queries": 8, + "bytes": 10398827, + "median_ms": 744.67, + "range_ms": [ + 723.98, + 805.81 + ] + }, + { + "sample_ms": [ + 26.42352899999969, + 34.85347399999955, + 25.96983, + 24.1469560000005, + 19.362090999999054 + ], + "query_samples": [ + 6, + 6, + 6, + 6, + 6 + ], + "byte_samples": [ + 54196, + 54196, + 54196, + 54196, + 54196 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "bounded_editor_job_and_selector", + "requests": 2, + "queries": 6, + "bytes": 54196, + "median_ms": 25.97, + "range_ms": [ + 19.36, + 34.85 + ] + }, + { + "sample_ms": [ + 25.699156000000585, + 28.28454099999908, + 31.340061000000787, + 28.466334000000643, + 37.43268999999964 + ], + "query_samples": [ + 10, + 10, + 10, + 10, + 10 + ], + "byte_samples": [ + 56706, + 56706, + 56706, + 56706, + 56706 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "static_editor_configuration", + "requests": 4, + "queries": 10, + "bytes": 56706, + "median_ms": 28.47, + "range_ms": [ + 25.7, + 37.43 + ] + }, + { + "sample_ms": [ + 7.569438000000446, + 8.284057000000757, + 7.597529999999097, + 7.713553999999931, + 9.649117000000842 + ], + "query_samples": [ + 2, + 2, + 2, + 2, + 2 + ], + "byte_samples": [ + 3253, + 3253, + 3253, + 3253, + 3253 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "static_lifecycle_selector", + "requests": 1, + "queries": 2, + "bytes": 3253, + "median_ms": 7.71, + "range_ms": [ + 7.57, + 9.65 + ] + }, + { + "sample_ms": [ + 21.076774999999543, + 24.765440000001036, + 26.34469100000024, + 22.33176099999946, + 23.367921000000933 + ], + "query_samples": [ + 6, + 6, + 6, + 6, + 6 + ], + "byte_samples": [ + 151363, + 151363, + 151363, + 151363, + 151363 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "legacy_run_poll", + "requests": 1, + "queries": 6, + "bytes": 151363, + "median_ms": 23.37, + "range_ms": [ + 21.08, + 26.34 + ] + }, + { + "sample_ms": [ + 8.507170999999289, + 7.821495000000141, + 8.717835999999807, + 8.76709899999878, + 9.86457899999914 + ], + "query_samples": [ + 2, + 2, + 2, + 2, + 2 + ], + "byte_samples": [ + 360, + 360, + 360, + 360, + 360 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "lightweight_status_poll", + "requests": 1, + "queries": 2, + "bytes": 360, + "median_ms": 8.72, + "range_ms": [ + 7.82, + 9.86 + ] + }, + { + "sample_ms": [ + 19.620065999999497, + 13.485984999999346, + 9.733213999999862, + 9.250261000001046, + 8.035133999999744 + ], + "query_samples": [ + 2, + 2, + 2, + 2, + 2 + ], + "byte_samples": [ + 59670, + 59670, + 59670, + 59670, + 59670 + ], + "jobs": 205, + "trace_events": 20000, + "operation": "revision_trace_page", + "requests": 1, + "queries": 2, + "bytes": 59670, + "median_ms": 9.73, + "range_ms": [ + 8.04, + 19.62 + ] + } + ] +} diff --git a/packages/api/performance/gen-2157-foundation.json b/packages/api/performance/gen-2157-foundation.json new file mode 100644 index 00000000..05c7dc14 --- /dev/null +++ b/packages/api/performance/gen-2157-foundation.json @@ -0,0 +1,544 @@ +{ + "samples": 5, + "query_delay_ms": 20, + "environment": "Disposable local PostgreSQL; signed cookie Worker dispatch; headless Chromium with local CSS; intercepted HTTP, no Cloudflare/Hyperdrive/network transit", + "results": [ + { + "screen": "Jobs", + "endpoint": { + "median_ms": 124, + "range_ms": [ + 111.5, + 148.6 + ] + }, + "useful_content": { + "median_ms": 322.9, + "range_ms": [ + 214.9, + 357.9 + ] + } + }, + { + "screen": "Job detail", + "endpoint": { + "median_ms": 129.2, + "range_ms": [ + 102.2, + 146.1 + ] + }, + "useful_content": { + "median_ms": 325.1, + "range_ms": [ + 250.6, + 347.5 + ] + } + }, + { + "screen": "Run detail", + "endpoint": { + "median_ms": 92.2, + "range_ms": [ + 84.8, + 115.4 + ] + }, + "useful_content": { + "median_ms": 201.4, + "range_ms": [ + 196.5, + 300.2 + ] + } + }, + { + "screen": "Job create", + "endpoint": { + "median_ms": 62.3, + "range_ms": [ + 56.2, + 91.9 + ] + }, + "useful_content": { + "median_ms": 259.2, + "range_ms": [ + 211.7, + 346.2 + ] + } + }, + { + "screen": "Job edit", + "endpoint": { + "median_ms": 110.9, + "range_ms": [ + 102.9, + 116 + ] + }, + "useful_content": { + "median_ms": 319.2, + "range_ms": [ + 309, + 368.8 + ] + } + }, + { + "screen": "Integrations", + "endpoint": { + "median_ms": 58.1, + "range_ms": [ + 56.7, + 72.3 + ] + }, + "useful_content": { + "median_ms": 194.1, + "range_ms": [ + 133.5, + 197.5 + ] + } + }, + { + "screen": "API Keys", + "endpoint": { + "median_ms": 53.2, + "range_ms": [ + 49.1, + 57.3 + ] + }, + "useful_content": { + "median_ms": 185.4, + "range_ms": [ + 163.3, + 208.6 + ] + } + } + ], + "indexes": [ + { + "indexname": "job_runs_launch_lease", + "indexdef": "CREATE INDEX job_runs_launch_lease ON app.job_runs USING btree (launch_lease_expires_at) WHERE (state = 'starting'::text)" + }, + { + "indexname": "job_runs_pkey", + "indexdef": "CREATE UNIQUE INDEX job_runs_pkey ON app.job_runs USING btree (tenant_id, id)" + }, + { + "indexname": "job_runs_poll_due", + "indexdef": "CREATE INDEX job_runs_poll_due ON app.job_runs USING btree (next_poll_at) WHERE (state = ANY (ARRAY['running'::text, 'blocked'::text, 'stopping'::text]))" + }, + { + "indexname": "job_runs_queue", + "indexdef": "CREATE INDEX job_runs_queue ON app.job_runs USING btree (state, created_at) WHERE (state = 'queued'::text)" + }, + { + "indexname": "job_runs_tenant_id_invocation_id_key", + "indexdef": "CREATE UNIQUE INDEX job_runs_tenant_id_invocation_id_key ON app.job_runs USING btree (tenant_id, invocation_id)" + } + ], + "plans": { + "old_single_job": [ + { + "Plan": { + "Node Type": "Aggregate", + "Strategy": "Plain", + "Partial Mode": "Simple", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 9.54, + "Total Cost": 9.55, + "Plan Rows": 1, + "Plan Width": 64, + "Actual Startup Time": 0.06, + "Actual Total Time": 0.061, + "Actual Rows": 1, + "Actual Loops": 1, + "Shared Hit Blocks": 5, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 9.52, + "Total Cost": 9.52, + "Plan Rows": 1, + "Plan Width": 40, + "Actual Startup Time": 0.032, + "Actual Total Time": 0.033, + "Actual Rows": 3, + "Actual Loops": 1, + "Sort Key": [ + "created_at DESC" + ], + "Sort Method": "quicksort", + "Sort Space Used": 25, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 5, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Bitmap Heap Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Relation Name": "job_runs", + "Alias": "job_runs", + "Startup Cost": 4.16, + "Total Cost": 9.51, + "Plan Rows": 1, + "Plan Width": 40, + "Actual Startup Time": 0.009, + "Actual Total Time": 0.01, + "Actual Rows": 3, + "Actual Loops": 1, + "Recheck Cond": "(tenant_id = '6a1a9d6e-1a5c-4ea8-9cf7-f8a877d9cb1d'::uuid)", + "Rows Removed by Index Recheck": 0, + "Filter": "(job_id = '736f0c9f-ec2f-4b2b-bb2b-eb2a2c56e1ee'::uuid)", + "Rows Removed by Filter": 0, + "Exact Heap Blocks": 1, + "Lossy Heap Blocks": 0, + "Shared Hit Blocks": 2, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Bitmap Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Index Name": "job_runs_tenant_id_invocation_id_key", + "Startup Cost": 0, + "Total Cost": 4.16, + "Plan Rows": 2, + "Plan Width": 0, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.004, + "Actual Rows": 3, + "Actual Loops": 1, + "Index Cond": "(tenant_id = '6a1a9d6e-1a5c-4ea8-9cf7-f8a877d9cb1d'::uuid)", + "Shared Hit Blocks": 1, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 197, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.54, + "Triggers": [], + "Execution Time": 0.131 + } + ], + "new_batch": [ + { + "Plan": { + "Node Type": "Nested Loop", + "Parallel Aware": false, + "Async Capable": false, + "Join Type": "Inner", + "Startup Cost": 9.6, + "Total Cost": 9.64, + "Plan Rows": 1, + "Plan Width": 80, + "Actual Startup Time": 0.041, + "Actual Total Time": 0.042, + "Actual Rows": 1, + "Actual Loops": 1, + "Inner Unique": true, + "Join Filter": "(selected_runs.job_id = selected_runs_1.job_id)", + "Rows Removed by Join Filter": 0, + "Shared Hit Blocks": 8, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Bitmap Heap Scan", + "Parent Relationship": "InitPlan", + "Subplan Name": "CTE selected_runs", + "Parallel Aware": false, + "Async Capable": false, + "Relation Name": "job_runs", + "Alias": "job_runs", + "Startup Cost": 4.19, + "Total Cost": 9.54, + "Plan Rows": 1, + "Plan Width": 72, + "Actual Startup Time": 0.009, + "Actual Total Time": 0.01, + "Actual Rows": 3, + "Actual Loops": 1, + "Recheck Cond": "(tenant_id = '6a1a9d6e-1a5c-4ea8-9cf7-f8a877d9cb1d'::uuid)", + "Rows Removed by Index Recheck": 0, + "Filter": "(job_id = ANY ('{736f0c9f-ec2f-4b2b-bb2b-eb2a2c56e1ee,3371c66e-320f-40ce-9f9e-f475d24e5706,a1bf9cb0-37f0-4cdb-82c1-04736944c260,794aa4c5-2839-418a-9158-d0034df47f14,b0873769-8aa1-4f31-bb07-3c328e343de9,610e5889-9b78-4c27-9262-80f22a3b60ab,b53176ac-9202-4b9c-953a-577d9e729cef,47b75432-b6b7-4dfe-bf75-5dbb233dbbd3,ea31fe0f-e0bf-4499-b195-07f4e12caa11,4992b263-130e-4047-96b8-23e32c085046}'::uuid[]))", + "Rows Removed by Filter": 0, + "Exact Heap Blocks": 1, + "Lossy Heap Blocks": 0, + "Shared Hit Blocks": 2, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Bitmap Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Index Name": "job_runs_tenant_id_invocation_id_key", + "Startup Cost": 0, + "Total Cost": 4.16, + "Plan Rows": 2, + "Plan Width": 0, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.004, + "Actual Rows": 3, + "Actual Loops": 1, + "Index Cond": "(tenant_id = '6a1a9d6e-1a5c-4ea8-9cf7-f8a877d9cb1d'::uuid)", + "Shared Hit Blocks": 1, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + { + "Node Type": "Aggregate", + "Strategy": "Hashed", + "Partial Mode": "Simple", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.03, + "Total Cost": 0.04, + "Plan Rows": 1, + "Plan Width": 48, + "Actual Startup Time": 0.018, + "Actual Total Time": 0.019, + "Actual Rows": 1, + "Actual Loops": 1, + "Group Key": [ + "selected_runs.job_id" + ], + "Planned Partitions": 0, + "HashAgg Batches": 1, + "Peak Memory Usage": 24, + "Disk Usage": 0, + "Shared Hit Blocks": 2, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "CTE Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "CTE Name": "selected_runs", + "Alias": "selected_runs", + "Startup Cost": 0, + "Total Cost": 0.02, + "Plan Rows": 1, + "Plan Width": 48, + "Actual Startup Time": 0.01, + "Actual Total Time": 0.012, + "Actual Rows": 3, + "Actual Loops": 1, + "Shared Hit Blocks": 2, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + { + "Node Type": "Unique", + "Parent Relationship": "Inner", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.03, + "Total Cost": 0.04, + "Plan Rows": 1, + "Plan Width": 72, + "Actual Startup Time": 0.021, + "Actual Total Time": 0.021, + "Actual Rows": 1, + "Actual Loops": 1, + "Shared Hit Blocks": 6, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.03, + "Total Cost": 0.04, + "Plan Rows": 1, + "Plan Width": 72, + "Actual Startup Time": 0.021, + "Actual Total Time": 0.021, + "Actual Rows": 1, + "Actual Loops": 1, + "Sort Key": [ + "selected_runs_1.job_id", + "selected_runs_1.created_at DESC", + "selected_runs_1.id DESC" + ], + "Sort Method": "quicksort", + "Sort Space Used": 25, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 6, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "CTE Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "CTE Name": "selected_runs", + "Alias": "selected_runs_1", + "Startup Cost": 0, + "Total Cost": 0.02, + "Plan Rows": 1, + "Plan Width": 72, + "Actual Startup Time": 0, + "Actual Total Time": 0, + "Actual Rows": 3, + "Actual Loops": 1, + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 200, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.398, + "Triggers": [], + "Execution Time": 0.096 + } + ] + } +} diff --git a/packages/api/performance/gen-2157-legacy-compatibility.json b/packages/api/performance/gen-2157-legacy-compatibility.json new file mode 100644 index 00000000..c4050610 --- /dev/null +++ b/packages/api/performance/gen-2157-legacy-compatibility.json @@ -0,0 +1,544 @@ +{ + "samples": 5, + "query_delay_ms": 20, + "environment": "Disposable local PostgreSQL; signed cookie Worker dispatch; headless Chromium with local CSS; intercepted HTTP, no Cloudflare/Hyperdrive/network transit", + "results": [ + { + "screen": "Jobs", + "endpoint": { + "median_ms": 118.9, + "range_ms": [ + 104, + 125.2 + ] + }, + "useful_content": { + "median_ms": 269.4, + "range_ms": [ + 204.2, + 302.7 + ] + } + }, + { + "screen": "Job detail", + "endpoint": { + "median_ms": 111.1, + "range_ms": [ + 111, + 115.5 + ] + }, + "useful_content": { + "median_ms": 285.7, + "range_ms": [ + 277.6, + 289.7 + ] + } + }, + { + "screen": "Run detail", + "endpoint": { + "median_ms": 92.2, + "range_ms": [ + 86.1, + 113.2 + ] + }, + "useful_content": { + "median_ms": 165.4, + "range_ms": [ + 162.1, + 173.6 + ] + } + }, + { + "screen": "Job create", + "endpoint": { + "median_ms": 58.1, + "range_ms": [ + 49.1, + 60.2 + ] + }, + "useful_content": { + "median_ms": 280.4, + "range_ms": [ + 216.2, + 287.3 + ] + } + }, + { + "screen": "Job edit", + "endpoint": { + "median_ms": 112.3, + "range_ms": [ + 107.8, + 115.6 + ] + }, + "useful_content": { + "median_ms": 293.9, + "range_ms": [ + 284.4, + 310.8 + ] + } + }, + { + "screen": "Integrations", + "endpoint": { + "median_ms": 59.5, + "range_ms": [ + 52.9, + 62.2 + ] + }, + "useful_content": { + "median_ms": 173, + "range_ms": [ + 167.1, + 191.8 + ] + } + }, + { + "screen": "API Keys", + "endpoint": { + "median_ms": 56.8, + "range_ms": [ + 49.9, + 61.2 + ] + }, + "useful_content": { + "median_ms": 153.4, + "range_ms": [ + 126, + 172.8 + ] + } + } + ], + "indexes": [ + { + "indexname": "job_runs_launch_lease", + "indexdef": "CREATE INDEX job_runs_launch_lease ON app.job_runs USING btree (launch_lease_expires_at) WHERE (state = 'starting'::text)" + }, + { + "indexname": "job_runs_pkey", + "indexdef": "CREATE UNIQUE INDEX job_runs_pkey ON app.job_runs USING btree (tenant_id, id)" + }, + { + "indexname": "job_runs_poll_due", + "indexdef": "CREATE INDEX job_runs_poll_due ON app.job_runs USING btree (next_poll_at) WHERE (state = ANY (ARRAY['running'::text, 'blocked'::text, 'stopping'::text]))" + }, + { + "indexname": "job_runs_queue", + "indexdef": "CREATE INDEX job_runs_queue ON app.job_runs USING btree (state, created_at) WHERE (state = 'queued'::text)" + }, + { + "indexname": "job_runs_tenant_id_invocation_id_key", + "indexdef": "CREATE UNIQUE INDEX job_runs_tenant_id_invocation_id_key ON app.job_runs USING btree (tenant_id, invocation_id)" + } + ], + "plans": { + "old_single_job": [ + { + "Plan": { + "Node Type": "Aggregate", + "Strategy": "Plain", + "Partial Mode": "Simple", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 9.54, + "Total Cost": 9.55, + "Plan Rows": 1, + "Plan Width": 64, + "Actual Startup Time": 0.031, + "Actual Total Time": 0.031, + "Actual Rows": 1, + "Actual Loops": 1, + "Shared Hit Blocks": 5, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 9.52, + "Total Cost": 9.52, + "Plan Rows": 1, + "Plan Width": 40, + "Actual Startup Time": 0.022, + "Actual Total Time": 0.022, + "Actual Rows": 3, + "Actual Loops": 1, + "Sort Key": [ + "created_at DESC" + ], + "Sort Method": "quicksort", + "Sort Space Used": 25, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 5, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Bitmap Heap Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Relation Name": "job_runs", + "Alias": "job_runs", + "Startup Cost": 4.16, + "Total Cost": 9.51, + "Plan Rows": 1, + "Plan Width": 40, + "Actual Startup Time": 0.007, + "Actual Total Time": 0.008, + "Actual Rows": 3, + "Actual Loops": 1, + "Recheck Cond": "(tenant_id = '9bf10b7a-06b3-4927-be00-22eee6a0bf4e'::uuid)", + "Rows Removed by Index Recheck": 0, + "Filter": "(job_id = '5c6a72b1-b330-46e8-90f2-1d03b72829c5'::uuid)", + "Rows Removed by Filter": 0, + "Exact Heap Blocks": 1, + "Lossy Heap Blocks": 0, + "Shared Hit Blocks": 2, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Bitmap Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Index Name": "job_runs_tenant_id_invocation_id_key", + "Startup Cost": 0, + "Total Cost": 4.16, + "Plan Rows": 2, + "Plan Width": 0, + "Actual Startup Time": 0.003, + "Actual Total Time": 0.003, + "Actual Rows": 3, + "Actual Loops": 1, + "Index Cond": "(tenant_id = '9bf10b7a-06b3-4927-be00-22eee6a0bf4e'::uuid)", + "Shared Hit Blocks": 1, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 197, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.392, + "Triggers": [], + "Execution Time": 0.071 + } + ], + "new_batch": [ + { + "Plan": { + "Node Type": "Nested Loop", + "Parallel Aware": false, + "Async Capable": false, + "Join Type": "Inner", + "Startup Cost": 9.6, + "Total Cost": 9.64, + "Plan Rows": 1, + "Plan Width": 80, + "Actual Startup Time": 0.063, + "Actual Total Time": 0.064, + "Actual Rows": 1, + "Actual Loops": 1, + "Inner Unique": true, + "Join Filter": "(selected_runs.job_id = selected_runs_1.job_id)", + "Rows Removed by Join Filter": 0, + "Shared Hit Blocks": 8, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Bitmap Heap Scan", + "Parent Relationship": "InitPlan", + "Subplan Name": "CTE selected_runs", + "Parallel Aware": false, + "Async Capable": false, + "Relation Name": "job_runs", + "Alias": "job_runs", + "Startup Cost": 4.19, + "Total Cost": 9.54, + "Plan Rows": 1, + "Plan Width": 72, + "Actual Startup Time": 0.013, + "Actual Total Time": 0.014, + "Actual Rows": 3, + "Actual Loops": 1, + "Recheck Cond": "(tenant_id = '9bf10b7a-06b3-4927-be00-22eee6a0bf4e'::uuid)", + "Rows Removed by Index Recheck": 0, + "Filter": "(job_id = ANY ('{5c6a72b1-b330-46e8-90f2-1d03b72829c5,12e89021-a863-4924-b04a-c97bda9d662e,348afbc1-3417-4017-8a9e-7d3583d5daa6,a8409680-20f0-4959-b706-1b9da2599bc3,0460f5d7-191b-4c9a-9536-f16289b38e69,57702628-4842-4ac7-a0aa-a1ff31c79889,8425509b-dc60-43e7-9bed-f7fe421f141c,e652551b-0320-4d07-b11e-0510ad5a7285,7834dec6-8213-4ff0-a150-12d6fd5f310a,8f6fa244-b783-493d-96ef-ee8453a9a809}'::uuid[]))", + "Rows Removed by Filter": 0, + "Exact Heap Blocks": 1, + "Lossy Heap Blocks": 0, + "Shared Hit Blocks": 2, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Bitmap Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Index Name": "job_runs_tenant_id_invocation_id_key", + "Startup Cost": 0, + "Total Cost": 4.16, + "Plan Rows": 2, + "Plan Width": 0, + "Actual Startup Time": 0.006, + "Actual Total Time": 0.006, + "Actual Rows": 3, + "Actual Loops": 1, + "Index Cond": "(tenant_id = '9bf10b7a-06b3-4927-be00-22eee6a0bf4e'::uuid)", + "Shared Hit Blocks": 1, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + { + "Node Type": "Aggregate", + "Strategy": "Hashed", + "Partial Mode": "Simple", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.03, + "Total Cost": 0.04, + "Plan Rows": 1, + "Plan Width": 48, + "Actual Startup Time": 0.025, + "Actual Total Time": 0.026, + "Actual Rows": 1, + "Actual Loops": 1, + "Group Key": [ + "selected_runs.job_id" + ], + "Planned Partitions": 0, + "HashAgg Batches": 1, + "Peak Memory Usage": 24, + "Disk Usage": 0, + "Shared Hit Blocks": 2, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "CTE Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "CTE Name": "selected_runs", + "Alias": "selected_runs", + "Startup Cost": 0, + "Total Cost": 0.02, + "Plan Rows": 1, + "Plan Width": 48, + "Actual Startup Time": 0.015, + "Actual Total Time": 0.017, + "Actual Rows": 3, + "Actual Loops": 1, + "Shared Hit Blocks": 2, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + { + "Node Type": "Unique", + "Parent Relationship": "Inner", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.03, + "Total Cost": 0.04, + "Plan Rows": 1, + "Plan Width": 72, + "Actual Startup Time": 0.036, + "Actual Total Time": 0.036, + "Actual Rows": 1, + "Actual Loops": 1, + "Shared Hit Blocks": 6, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.03, + "Total Cost": 0.04, + "Plan Rows": 1, + "Plan Width": 72, + "Actual Startup Time": 0.035, + "Actual Total Time": 0.035, + "Actual Rows": 1, + "Actual Loops": 1, + "Sort Key": [ + "selected_runs_1.job_id", + "selected_runs_1.created_at DESC", + "selected_runs_1.id DESC" + ], + "Sort Method": "quicksort", + "Sort Space Used": 25, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 6, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "CTE Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "CTE Name": "selected_runs", + "Alias": "selected_runs_1", + "Startup Cost": 0, + "Total Cost": 0.02, + "Plan Rows": 1, + "Plan Width": 72, + "Actual Startup Time": 0, + "Actual Total Time": 0.001, + "Actual Rows": 3, + "Actual Loops": 1, + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 200, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.586, + "Triggers": [], + "Execution Time": 0.164 + } + ] + } +} diff --git a/packages/api/performance/gen-2157-production-rollout.json b/packages/api/performance/gen-2157-production-rollout.json new file mode 100644 index 00000000..3390d715 --- /dev/null +++ b/packages/api/performance/gen-2157-production-rollout.json @@ -0,0 +1,151 @@ +{ + "observedAt": "2026-10-09T21:36:51.952439+00:00", + "scope": "Production rollout and automated read-only acceptance, supplemented by subsequent owner review", + "deployedCommit": "c64590cd3d8a6bcf39c9e71b90b9bf3f6f001170", + "anchor": { + "commit": "ff4b51bcbea0d30afbdbbccb0719c3f3bfb4e77c", + "run": "https://github.com/GenerationSoftware/factorize/actions/runs/37993971255", + "conclusion": "success" + }, + "staticRollout": { + "run": "https://github.com/GenerationSoftware/factorize/actions/runs/37994318377", + "conclusion": "success", + "retainedReleaseArtifactId": 11646108499, + "publicRoutingSecurityCachePassed": true + }, + "recoveredFailure": { + "run": "https://github.com/GenerationSoftware/factorize/actions/runs/37994119517", + "failure": "Immediate public verifier reached prior Worker: /jobs returned 302. Static deployment and archive upload succeeded. Subsequent complete verifier passed. Added bounded propagation retry and verified successful second rollout." + }, + "rest": { + "observedAt": "2026-10-09T21:33:53.777035+00:00", + "checks": [ + { + "path": "/api/v1/job-summaries?limit=2", + "status": 200, + "expected": 200, + "passed": true + }, + { + "path": "/api/v1/job-selector?limit=2", + "status": 200, + "expected": 200, + "passed": true + }, + { + "path": "/api/v1/trigger-contexts", + "status": 200, + "expected": 200, + "passed": true + }, + { + "path": "/api/v1/execution-targets", + "status": 200, + "expected": 200, + "passed": true + }, + { + "path": "/api/v1/job-trigger-availability", + "status": 200, + "expected": 200, + "passed": true + }, + { + "path": "/api/v1/access-tokens", + "status": 403, + "expected": 403, + "passed": true + }, + { + "path": "/api/v1/access/authorized-clients", + "status": 403, + "expected": 403, + "passed": true + }, + { + "path": "/api/v1/session", + "status": 403, + "expected": 403, + "passed": true + }, + { + "path": "/api/v1/runs?limit=1", + "status": 200, + "expected": 200, + "passed": true + }, + { + "path": "/api/v1/runs/f8ae3688-a65c-4149-a511-4762d796c222/status", + "status": 200, + "expected": 200, + "passed": true + }, + { + "path": "/api/v1/runs/f8ae3688-a65c-4149-a511-4762d796c222/trace-pages?limit=2", + "status": 200, + "expected": 200, + "passed": true + } + ], + "scope": "Read-only production REST through attached bearer integration; no cookie-owner or provider mutation checks" + }, + "mcp": { + "observedAt": "2026-10-09T21:35:28.704523+00:00", + "scope": "Read-only production MCP initialization/tool discovery with attached bearer credentials", + "checks": [ + { + "method": "initialize", + "status": 200, + "passed": true + }, + { + "method": "tools/list", + "status": 200, + "passed": true + } + ] + }, + "anonymousBrowser": { + "observedAt": "2026-10-09T21:36:24.826Z", + "scope": "Anonymous Chromium against production static screens; no auth mutations", + "checks": [ + { + "path": "/jobs", + "status": 200, + "heading": "Sign in to Factorize", + "passed": true + }, + { + "path": "/auth/signup", + "status": 200, + "heading": "Create your Factorize account", + "passed": true + }, + { + "path": "/auth/password-reset", + "status": 200, + "heading": "Reset password", + "passed": true + }, + { + "path": "/auth/verify", + "status": 200, + "heading": "Verify your email", + "passed": true + } + ], + "pageErrors": [] + }, + "ownerReview": { + "reportedAt": "2026-10-09T21:46:38.834Z", + "reporter": "Brendan Asselstine", + "source": "https://linear.app/generation/issue/GEN-2157", + "commentId": "0ae991ba-5863-4dbc-8b8f-1902d9f5dbb0", + "statement": "I have checked app.factorize.sh and everything seems to work", + "scope": "Owner-reported general production acceptance; individual provider/OAuth/device scenarios were not itemized. This supplements the historical automated evidence above." + }, + "outstandingAtInitialObservation": { + "ownerProviderOAuthDeviceChecks": "Not completed: attached integration supplies bearer credentials, not an interactive owner session. Auth API, API keys and authorized-client management correctly reject this access with 403.", + "nextAction": "An authenticated owner must verify job edit/invoke/run trace, provider integration setup, API-key create/revoke, OAuth consent and device approval at app.factorize.sh, then report results. Keep issue In Progress and PR draft until release acceptance is complete." + } +} diff --git a/packages/api/performance/gen-2157-trace-browser.json b/packages/api/performance/gen-2157-trace-browser.json new file mode 100644 index 00000000..0a43547f --- /dev/null +++ b/packages/api/performance/gen-2157-trace-browser.json @@ -0,0 +1,11 @@ +{ + "date": "2026-10-09", + "browser": "156.0.8078.4", + "fixtureEvents": 20000, + "traceRequests": 102, + "peakMountedEvents": 38, + "loadAllPagesMs": 13159.14, + "expandedStatePreserved": true, + "liveRevisionResetObserved": true, + "scope": "One compiled-SPA Chromium sample with mocked HTTP trace pages, includes Playwright scrolling and selector waits; no production network/DB or frame-time claim." +} diff --git a/packages/app/public/android-chrome-192x192.png b/packages/api/public/android-chrome-192x192.png similarity index 100% rename from packages/app/public/android-chrome-192x192.png rename to packages/api/public/android-chrome-192x192.png diff --git a/packages/app/public/android-chrome-512x512.png b/packages/api/public/android-chrome-512x512.png similarity index 100% rename from packages/app/public/android-chrome-512x512.png rename to packages/api/public/android-chrome-512x512.png diff --git a/packages/app/public/apple-touch-icon.png b/packages/api/public/apple-touch-icon.png similarity index 100% rename from packages/app/public/apple-touch-icon.png rename to packages/api/public/apple-touch-icon.png diff --git a/packages/app/public/bee-mark-monochrome.png b/packages/api/public/bee-mark-monochrome.png similarity index 100% rename from packages/app/public/bee-mark-monochrome.png rename to packages/api/public/bee-mark-monochrome.png diff --git a/packages/app/public/bee-mark.png b/packages/api/public/bee-mark.png similarity index 100% rename from packages/app/public/bee-mark.png rename to packages/api/public/bee-mark.png diff --git a/packages/app/public/favicon-16x16.png b/packages/api/public/favicon-16x16.png similarity index 100% rename from packages/app/public/favicon-16x16.png rename to packages/api/public/favicon-16x16.png diff --git a/packages/app/public/favicon-32x32.png b/packages/api/public/favicon-32x32.png similarity index 100% rename from packages/app/public/favicon-32x32.png rename to packages/api/public/favicon-32x32.png diff --git a/packages/app/public/favicon-48x48.png b/packages/api/public/favicon-48x48.png similarity index 100% rename from packages/app/public/favicon-48x48.png rename to packages/api/public/favicon-48x48.png diff --git a/packages/app/public/favicon.ico b/packages/api/public/favicon.ico similarity index 100% rename from packages/app/public/favicon.ico rename to packages/api/public/favicon.ico diff --git a/packages/app/public/site.webmanifest b/packages/api/public/site.webmanifest similarity index 100% rename from packages/app/public/site.webmanifest rename to packages/api/public/site.webmanifest diff --git a/packages/app/scripts/check-api-boundaries.mjs b/packages/api/scripts/check-api-boundaries.mjs similarity index 100% rename from packages/app/scripts/check-api-boundaries.mjs rename to packages/api/scripts/check-api-boundaries.mjs diff --git a/packages/app/scripts/generate-openapi.ts b/packages/api/scripts/generate-openapi.ts similarity index 92% rename from packages/app/scripts/generate-openapi.ts rename to packages/api/scripts/generate-openapi.ts index 22ec9d75..7f91070e 100644 --- a/packages/app/scripts/generate-openapi.ts +++ b/packages/api/scripts/generate-openapi.ts @@ -4,7 +4,7 @@ import { generateOpenApi } from "../src/api-contract"; const target = new URL("../../docs/openapi.yaml", import.meta.url); export const generated = - "# Generated by npm run generate:openapi. Edit packages/app/src/api-contract.ts.\n" + + "# Generated by npm run generate:openapi. Edit packages/api/src/api-contract.ts.\n" + stringify(generateOpenApi(), { lineWidth: 0, aliasDuplicateObjects: false }); if (process.argv.includes("--check")) { if (readFileSync(target, "utf8") !== generated) { diff --git a/packages/app/scripts/loading-baseline.config.ts b/packages/api/scripts/loading-baseline.config.ts similarity index 100% rename from packages/app/scripts/loading-baseline.config.ts rename to packages/api/scripts/loading-baseline.config.ts diff --git a/packages/app/scripts/migrate.mjs b/packages/api/scripts/migrate.mjs similarity index 100% rename from packages/app/scripts/migrate.mjs rename to packages/api/scripts/migrate.mjs diff --git a/packages/api/scripts/migration-measurements.config.ts b/packages/api/scripts/migration-measurements.config.ts new file mode 100644 index 00000000..5a73bade --- /dev/null +++ b/packages/api/scripts/migration-measurements.config.ts @@ -0,0 +1,2 @@ +import { defineConfig } from "vitest/config"; +export default defineConfig({ test: { include: ["test/migration-measurements.e2e.test.ts"] } }); diff --git a/packages/api/scripts/static-slice.config.ts b/packages/api/scripts/static-slice.config.ts new file mode 100644 index 00000000..2f1e6b66 --- /dev/null +++ b/packages/api/scripts/static-slice.config.ts @@ -0,0 +1,2 @@ +import { defineConfig } from "vitest/config"; +export default defineConfig({ test: { include: ["test/static-slice.e2e.test.ts"] } }); diff --git a/packages/app/scripts/validate-auth-email.check.mjs b/packages/api/scripts/validate-auth-email.check.mjs similarity index 100% rename from packages/app/scripts/validate-auth-email.check.mjs rename to packages/api/scripts/validate-auth-email.check.mjs diff --git a/packages/app/scripts/validate-auth-email.mjs b/packages/api/scripts/validate-auth-email.mjs similarity index 100% rename from packages/app/scripts/validate-auth-email.mjs rename to packages/api/scripts/validate-auth-email.mjs diff --git a/packages/app/scripts/verify-schema.mjs b/packages/api/scripts/verify-schema.mjs similarity index 100% rename from packages/app/scripts/verify-schema.mjs rename to packages/api/scripts/verify-schema.mjs diff --git a/packages/app/src/access-tokens.ts b/packages/api/src/access-tokens.ts similarity index 100% rename from packages/app/src/access-tokens.ts rename to packages/api/src/access-tokens.ts diff --git a/packages/app/src/agent-driver.ts b/packages/api/src/agent-driver.ts similarity index 100% rename from packages/app/src/agent-driver.ts rename to packages/api/src/agent-driver.ts diff --git a/packages/app/src/alarm-coordinator.ts b/packages/api/src/alarm-coordinator.ts similarity index 100% rename from packages/app/src/alarm-coordinator.ts rename to packages/api/src/alarm-coordinator.ts diff --git a/packages/app/src/amp-backend.ts b/packages/api/src/amp-backend.ts similarity index 100% rename from packages/app/src/amp-backend.ts rename to packages/api/src/amp-backend.ts diff --git a/packages/app/src/api-contract.ts b/packages/api/src/api-contract.ts similarity index 68% rename from packages/app/src/api-contract.ts rename to packages/api/src/api-contract.ts index e02e1562..82722e6d 100644 --- a/packages/app/src/api-contract.ts +++ b/packages/api/src/api-contract.ts @@ -1,3 +1,9 @@ +import { searchResponse } from "./search-contracts"; +import { consentPreviewInput, consentPreviewResponse, consentDecisionInput, consentDecisionResponse } from "./consent-api"; +import { exeConnection, integrationStatus, authorizedClient, accessToken, createdAccessToken, savedExe, testedExe, savedAmp, savedTail, okResult } from "./settings-contracts"; +import { executionTargetResponse, triggerAvailabilityResponse, namedOption, providerOptions, githubInstallation, githubRepository, tailIntegration } from "./editor-contracts"; +import { runSummaryResponse, runPageResponse, runStatusResponse, revisionTracePage, revisionTraceQuery } from "./run-read-contracts"; +import { jobPageQuery, jobSummaryPage, jobSelectorPage, jobResponse, jobUpdateInput } from "./job-contracts"; import { z } from "zod"; import type { ApiService } from "./flow-service"; import { @@ -9,6 +15,7 @@ import { } from "./flow-schemas"; import { traceReplaySchema } from "./trace-replay-schemas"; import document from "./api-document.json"; +import { authInputs, authSuccess, loginSuccess, sessionResponse, type AuthAction } from "./auth-api"; type JsonSchema = Record; export interface RouteContract { @@ -16,6 +23,7 @@ export interface RouteContract { path: string; scope: z.infer; ownerSession: boolean; + authOperation?: AuthAction; body?: z.ZodType; query?: z.ZodObject; parameters: z.ZodObject; @@ -109,7 +117,7 @@ function route( documentation: RouteContract["documentation"], execute: RouteContract["execute"], options: Partial< - Pick + Pick > = {}, ): RouteContract { const keys = [...path.matchAll(/\{([^}]+)\}/g)].map((match) => match[1]); @@ -142,7 +150,38 @@ function route( /** The executable API catalog: change an operation here, then run generate:openapi. * Service methods retain tenant/identity authorization for both REST and MCP. */ +function authRoute(method: string, path: string, action: AuthAction, summary: string, response: z.ZodType, body?: z.ZodType, status = 200): RouteContract { + return { + method, path, authOperation: action, scope: "flows:read", ownerSession: action === "password", + parameters: z.object({}), body, status, + documentation: { + summary, + description: "Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.", + responses: { [status]: { description: "session" === action ? "Unauthenticated sessions return authenticated:false; expired, unverified, removed or revoked owners are unauthenticated." : "Success", headers: { "X-Factorize-Contract": { description: "Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.", schema: { type: "string", const: "gen-2157-static-v1" } } }, content: { "application/json": { schema: jsonSchema(response, "output") } } } }, + }, + execute: async () => { throw new Error("Auth operations must use the protected API dispatcher"); }, + }; +} + export const API_ROUTES: RouteContract[] = [ + authRoute("GET", "/api/v1/session", "session", "Get current browser session", sessionResponse), + authRoute("POST", "/api/v1/auth/login", "login", "Sign in", loginSuccess, authInputs.login), + authRoute("POST", "/api/v1/auth/signup", "signup", "Request signup; existing accounts return the same accepted response", authSuccess, authInputs.signup, 202), + authRoute("POST", "/api/v1/auth/email-verification/request", "verification-request", "Request email verification", authSuccess, authInputs.request), + authRoute("POST", "/api/v1/auth/email-verification/complete", "verification", "Complete email verification", authSuccess, authInputs.verify), + authRoute("POST", "/api/v1/auth/password-reset/request", "reset-request", "Request password reset", authSuccess, authInputs.request), + authRoute("POST", "/api/v1/auth/password-reset/complete", "reset", "Complete password reset", authSuccess, authInputs.reset), + authRoute("POST", "/api/v1/auth/password", "password", "Change password and invalidate sessions", authSuccess, authInputs.change), + authRoute("POST", "/api/v1/auth/logout", "logout", "Revoke current session and clear browser cookie", authSuccess), + + route("POST", "/api/v1/oauth/device/preview", "flows:read", { summary: "Inspect a device authorization code", responses: { "200": { description: "Pending device request", content: { "application/json": { schema: jsonSchema(z.object({ userCode: z.string(), clientName: z.string(), scopes: z.array(z.string()), expiresAt: z.string() }), "output") } } } } }, async () => undefined, { body: z.object({ userCode: z.string().min(1).max(32) }).strict(), authOperation: "device-preview", ownerSession: true }), + route("POST", "/api/v1/oauth/device/decision", "flows:write", { summary: "Approve or deny a device authorization code", responses: { "200": { description: "Device decision", content: { "application/json": { schema: jsonSchema(z.object({ status: z.enum(["approved", "denied"]) }), "output") } } } } }, async () => undefined, { body: z.object({ userCode: z.string().min(1).max(32), decision: z.enum(["allow", "deny"]) }).strict(), authOperation: "device-decision", ownerSession: true }), + route("POST", "/api/v1/oauth/consent/preview", "flows:read", { summary: "Inspect an OAuth consent request", responses: { "200": { description: "Owner-bound expiring consent", content: { "application/json": { schema: jsonSchema(consentPreviewResponse, "output") } } } } }, async () => undefined, { body: consentPreviewInput, authOperation: "consent-preview", ownerSession: true }), + route("POST", "/api/v1/oauth/consent/decision", "flows:write", { summary: "Decide an OAuth consent request", responses: { "200": { description: "Validated protocol destination", content: { "application/json": { schema: jsonSchema(consentDecisionResponse, "output") } } } } }, async () => undefined, { body: consentDecisionInput, authOperation: "consent-decision", ownerSession: true }), + route("GET", "/api/v1/trigger-contexts", "flows:read", { + summary: "Get template autocomplete metadata", + responses: { "200": { description: "Paths by trigger kind/provider", content: { "application/json": { schema: jsonSchema(z.record(z.string(), z.array(z.object({ path: z.string(), type: z.enum(["string", "number", "boolean", "object", "array", "unknown"]), description: z.string(), example: z.unknown().optional() }))), "output") } } } }, + }, service => service.triggerContextMetadata()), route( "GET", "/api/v1/exe-connections", @@ -154,7 +193,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Safe metadata", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(exeConnection), "output"), }, }, }, @@ -173,7 +212,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Installations", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(githubInstallation), "output"), }, }, }, @@ -192,7 +231,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Targets", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(executionTargetResponse), "output"), }, }, }, @@ -206,7 +245,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:read", { summary: "List available trigger kinds", - responses: { "200": { description: "Availability" } }, + responses: { "200": { description: "Availability", content: { "application/json": { schema: jsonSchema(triggerAvailabilityResponse, "output") } } } }, }, (service) => service.listJobTriggerAvailability(), ), @@ -247,7 +286,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Integrations", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(tailIntegration), "output"), }, }, }, @@ -262,7 +301,7 @@ export const API_ROUTES: RouteContract[] = [ { summary: "List installed integrations", responses: { - "200": { description: "Credential-safe integration status" }, + "200": { description: "Credential-safe integration status", content: { "application/json": { schema: jsonSchema(integrationStatus, "output") } } }, }, }, (service) => service.integrationStatus(), @@ -273,7 +312,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Create an exe.dev integration", - responses: { "200": { description: "Saved" } }, + responses: { "200": { description: "Saved", content: { "application/json": { schema: jsonSchema(savedExe, "output") } } } }, }, (service, { body }) => service.saveExeIntegration(body), { body: exeBody }, @@ -284,7 +323,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Test exe.dev credentials", - responses: { "200": { description: "Test result" } }, + responses: { "200": { description: "Test result", content: { "application/json": { schema: jsonSchema(testedExe, "output") } } } }, }, (service, { body }) => service.testExeIntegration(body), { body: exeTestBody }, @@ -295,7 +334,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Create an Amp integration", - responses: { "200": { description: "Saved" } }, + responses: { "200": { description: "Saved", content: { "application/json": { schema: jsonSchema(savedAmp, "output") } } } }, }, (service, { body }) => service.saveAmpIntegration(body), { body: ampBody }, @@ -306,7 +345,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Test Amp credentials", - responses: { "200": { description: "Test result" } }, + responses: { "200": { description: "Test result", content: { "application/json": { schema: jsonSchema(okResult, "output") } } } }, }, (service, { body }) => service.testAmpIntegration(body), { body: ampTestBody }, @@ -317,7 +356,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Create a Tail integration", - responses: { "201": { description: "Created" } }, + responses: { "201": { description: "Created", content: { "application/json": { schema: jsonSchema(savedTail, "output") } } } }, }, (service, { body }) => service.saveTailIntegration(body), { body: tailBody }, @@ -333,7 +372,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Projects", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(namedOption), "output"), }, }, }, @@ -347,7 +386,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:read", { summary: "List Linear trigger options", - responses: { "200": { description: "Options" } }, + responses: { "200": { description: "Options", content: { "application/json": { schema: jsonSchema(providerOptions, "output") } } } }, }, (service) => service.linearOptions(), ), @@ -362,7 +401,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Lists", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(namedOption), "output"), }, }, }, @@ -376,7 +415,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:read", { summary: "List ClickUp trigger options", - responses: { "200": { description: "Options" } }, + responses: { "200": { description: "Options", content: { "application/json": { schema: jsonSchema(providerOptions, "output") } } } }, }, (service, { query }) => service.clickUpOptions(query.listId), { query: clickUpQuery }, @@ -392,7 +431,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Installations", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(githubInstallation), "output"), }, }, }, @@ -411,7 +450,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Clients", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(authorizedClient), "output"), }, }, }, @@ -431,7 +470,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Token metadata", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(accessToken), "output"), }, }, }, @@ -446,7 +485,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Create an access token", - responses: { "201": { description: "Created token" } }, + responses: { "201": { description: "Created token", content: { "application/json": { schema: jsonSchema(createdAccessToken, "output") } } } }, }, (service, { body }) => service.createAccessToken(body), { body: accessTokenBody, ownerSession: true }, @@ -501,7 +540,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Update a Tail integration", - responses: { "200": { description: "Updated" } }, + responses: { "200": { description: "Updated", content: { "application/json": { schema: jsonSchema(savedTail, "output") } } } }, }, (service, { params, body }) => service.saveTailIntegration({ @@ -527,7 +566,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Test a Tail integration", - responses: { "200": { description: "Test result" } }, + responses: { "200": { description: "Test result", content: { "application/json": { schema: jsonSchema(okResult, "output") } } } }, }, (service, { params }) => service.testTailIntegration(params.integrationId), ), @@ -542,7 +581,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Repositories", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(githubRepository), "output"), }, }, }, @@ -557,7 +596,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:read", { summary: "List GitHub issue trigger options", - responses: { "200": { description: "Options" } }, + responses: { "200": { description: "Options", content: { "application/json": { schema: jsonSchema(providerOptions, "output") } } } }, }, (service, { params }) => service.githubIssueOptions( @@ -590,6 +629,15 @@ export const API_ROUTES: RouteContract[] = [ (service, { params }) => service.diagnoseExeIntegration(params.connectionId), ), + route("GET", "/api/v1/job-summaries", "flows:read", { + summary: "List bounded job summaries", + description: "Additive list representation, ordered by immutable UUID descending. Cursor is the last ID; filters must remain the same between pages. Literal case-insensitive name/slug search. No prompts or trigger configuration; statistics are batched. Existing GET /jobs remains an array.", + responses: { "200": { description: "Summary page", content: { "application/json": { schema: jsonSchema(jobSummaryPage, "output") } } } }, + }, (service, { query }) => service.listJobSummaries(query), { query: jobPageQuery }), + route("GET", "/api/v1/job-selector", "flows:read", { + summary: "Search bounded lifecycle job options", + responses: { "200": { description: "Selector page; same ordering/filter semantics as job-summaries", content: { "application/json": { schema: jsonSchema(jobSelectorPage, "output") } } } }, + }, (service, { query }) => service.listJobSummaries(query, true), { query: jobPageQuery }), route( "GET", "/api/v1/jobs", @@ -601,7 +649,7 @@ export const API_ROUTES: RouteContract[] = [ description: "Jobs", content: { "application/json": { - schema: { type: "array", items: { type: "object" } }, + schema: jsonSchema(z.array(jobResponse), "output"), }, }, }, @@ -613,7 +661,7 @@ export const API_ROUTES: RouteContract[] = [ "POST", "/api/v1/jobs", "flows:write", - { summary: "Create job", responses: { "201": { description: "Created" } } }, + { summary: "Create job", responses: { "201": { description: "Created", content: { "application/json": { schema: jsonSchema(jobResponse, "output") } } } } }, (service, { body }) => service.createJob(body), { body: jobInputSchema }, ), @@ -623,7 +671,7 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Test webhook handler", - responses: { "200": { description: "Decision" } }, + responses: { "200": { description: "Decision", content: { "application/json": { schema: jsonSchema(z.discriminatedUnion("ok", [z.object({ ok: z.literal(true), decision: z.union([z.boolean(), z.record(z.string(), z.unknown())]) }), z.object({ ok: z.literal(false), category: z.enum(["handler_error", "invalid_return", "timeout", "platform_error"]) })]), "output") } } } }, }, (service, { body }) => service.testJobHandler(body), { body: jobHandlerTestSchema }, @@ -703,7 +751,7 @@ export const API_ROUTES: RouteContract[] = [ "GET", "/api/v1/jobs/{jobId}", "flows:read", - { summary: "Get job", responses: { "200": { description: "Job" } } }, + { summary: "Get job", responses: { "200": { description: "Job", content: { "application/json": { schema: jsonSchema(jobResponse, "output") } } } } }, (service, { params }) => service.getJob(params.jobId), ), route( @@ -712,10 +760,11 @@ export const API_ROUTES: RouteContract[] = [ "flows:write", { summary: "Replace job", - responses: { "200": { description: "Updated" } }, + description: "Supply expectedUpdatedAt from GET for atomic optimistic concurrency. Stale edits return 409 stale_job. Omission preserves legacy REST/MCP last-writer-wins updates. Trigger identity is preserved.", + responses: { "200": { description: "Updated", content: { "application/json": { schema: jsonSchema(jobResponse, "output") } } }, "409": { description: "stale_job: reload and reconcile before retrying" } }, }, (service, { params, body }) => service.updateJob(params.jobId, body), - { body: jobInputSchema }, + { body: jobUpdateInput }, ), route( "DELETE", @@ -750,7 +799,7 @@ export const API_ROUTES: RouteContract[] = [ "runs:read", { summary: "Search jobs and runs", - responses: { "200": { description: "Search results" } }, + responses: { "200": { description: "Search results", content: { "application/json": { schema: jsonSchema(searchResponse, "output") } } } }, }, (service, { query }) => service.search(query.q), { query: searchQuery }, @@ -778,6 +827,16 @@ export const API_ROUTES: RouteContract[] = [ }, (service, { params }) => service.getWebhookDelivery(params.deliveryId), ), + route("GET", "/api/v1/runs/{runId}/status", "runs:read", { + summary: "Get lightweight run status", + description: "No prompt decryption, invocation context, artifacts, activity or diagnostics assembly. Continue polling terminal runs while finalizing is true. trace_revision changes on generation transition or canonical projection/replay; live appends retain the revision. Full detail remains available at GET /runs/{runId}.", + responses: { "200": { description: "Status", content: { "application/json": { schema: jsonSchema(runStatusResponse, "output") } } } }, + }, (service, { params }) => service.getRunStatus(params.runId), { parameters: z.object({ runId: z.guid() }) }), + route("GET", "/api/v1/runs/{runId}/trace-pages", "runs:read", { + summary: "Get revision-bound trace page", + description: "First request omits revision and uses after=0. Subsequent requests supply the returned revision. A changed generation or canonical projection returns reset=true and events from zero in the new revision, from one database snapshot. Discard all cached old pages before merging the response. nextCursor=null means caught up, not finalized; poll after the last sequence while active/finalizing. Legacy GET /trace remains unchanged.", + responses: { "200": { description: "Revision-bound page", content: { "application/json": { schema: jsonSchema(revisionTracePage, "output") } } } }, + }, (service, { params, query }) => service.getRevisionTrace(params.runId, query.after, query.limit, query.revision), { query: revisionTraceQuery, parameters: z.object({ runId: z.guid() }) }), route( "GET", "/api/v1/runs/{runId}", @@ -940,6 +999,9 @@ export function matchApiOperation(method: string, path: string) { } return undefined; } +export function isBrowserAuthOperation(method: string, path: string): boolean { + return API_ROUTES.some(route => route.authOperation && route.method === method && route.path === path); +} export function isDeclaredApiOperation(method: string, path: string): boolean { return matchApiOperation(method, path) !== undefined; } @@ -984,6 +1046,8 @@ export function generateOpenApi() { }; const schemas = { ...document.components.schemas, + Run: { ...jsonSchema(runSummaryResponse, "output"), additionalProperties: true }, + RunPage: jsonSchema(runPageResponse, "output"), ...Object.fromEntries( Object.entries(namedBodies).map(([name, schema]) => [ name, @@ -1037,8 +1101,8 @@ export function generateOpenApi() { ...route.documentation, description: [ route.documentation.description, - `Requires the ${route.scope} scope.`, - route.ownerSession + route.authOperation ? undefined : `Requires the ${route.scope} scope.`, + route.authOperation ? undefined : route.ownerSession ? "An interactive owner session is required; bearer tokens cannot call this operation." : "Accepts a scoped bearer token or interactive owner session.", ] @@ -1046,8 +1110,8 @@ export function generateOpenApi() { .join("\n\n"), operationId: `${route.method.toLowerCase()}_${route.path.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_|_$/g, "")}`, tags: [route.path.split("/")[3]], - security: [{ bearerAuth: [] }], - "x-required-scope": route.scope, + security: route.authOperation ? (route.ownerSession ? [{ cookieAuth: [] }] : []) : [{ bearerAuth: [] }, { cookieAuth: [] }], + ...(route.authOperation ? { "x-browser-auth-operation": route.authOperation } : { "x-required-scope": route.scope }), "x-owner-session-required": route.ownerSession, ...(parameters.length ? { parameters } : {}), ...(route.body @@ -1065,7 +1129,7 @@ export function generateOpenApi() { } return { ...document, - components: { ...document.components, schemas, responses: errorResponses }, + components: { ...document.components, securitySchemes: { ...document.components.securitySchemes, cookieAuth: { type: "apiKey", in: "cookie", name: "factorize_session" } }, schemas, responses: errorResponses }, paths, }; } diff --git a/packages/app/src/api-document.json b/packages/api/src/api-document.json similarity index 83% rename from packages/app/src/api-document.json rename to packages/api/src/api-document.json index ee5f23bd..bcecae1d 100644 --- a/packages/app/src/api-document.json +++ b/packages/api/src/api-document.json @@ -561,7 +561,12 @@ "id", "state", "execution_diagnostics", - "harness_log" + "harness_log", + "prompt", + "context", + "invocation", + "activity", + "job_name" ], "properties": { "id": { @@ -599,6 +604,150 @@ "job_name": { "type": "string", "description": "Current job name, included so run content does not require a separate job request." + }, + "prompt": { + "type": "string" + }, + "context": { + "type": "object", + "additionalProperties": true + }, + "invocation": { + "type": "object", + "required": [ + "id", + "source", + "claim_key", + "trigger_id", + "context", + "occurrence", + "created_at" + ], + "properties": { + "id": { + "type": "string" + }, + "source": { + "type": "string" + }, + "claim_key": { + "type": "string" + }, + "trigger_id": { + "type": [ + "string", + "null" + ] + }, + "context": { + "type": "object", + "additionalProperties": true + }, + "occurrence": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "created_at": { + "type": "string" + } + } + }, + "activity": { + "type": "array", + "items": { + "type": "object", + "required": [ + "action", + "detail", + "created_at" + ], + "properties": { + "action": { + "type": "string" + }, + "detail": { + "type": "string" + }, + "created_at": { + "type": "string" + } + } + } + }, + "tenant_id": { + "type": "string" + }, + "invocation_id": { + "type": "string" + }, + "execution_handle": { + "type": [ + "object", + "null" + ], + "required": [ + "backendKind", + "id" + ], + "properties": { + "backendKind": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "execution_backend_kind": { + "type": "string" + }, + "execution_capabilities": { + "type": "array", + "items": { + "type": "string" + } + }, + "claim_released": { + "type": "boolean" + }, + "vm_cleanup_attempt": { + "type": "integer" + }, + "vm_cleanup_complete": { + "type": "boolean" + }, + "cleanup_next_at": { + "type": [ + "string", + "null" + ], + "format": "date-time" + }, + "occurrence": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "invocation_source": { + "type": "string" + }, + "invocation_claim_key": { + "type": "string" + }, + "invocation_trigger_id": { + "type": [ + "string", + "null" + ] + }, + "invocation_created_at": { + "type": "string", + "format": "date-time" } } }, diff --git a/packages/app/src/artifact-upload.ts b/packages/api/src/artifact-upload.ts similarity index 100% rename from packages/app/src/artifact-upload.ts rename to packages/api/src/artifact-upload.ts diff --git a/packages/app/src/artifacts.ts b/packages/api/src/artifacts.ts similarity index 100% rename from packages/app/src/artifacts.ts rename to packages/api/src/artifacts.ts diff --git a/packages/api/src/auth-api.ts b/packages/api/src/auth-api.ts new file mode 100644 index 00000000..8df2e4d3 --- /dev/null +++ b/packages/api/src/auth-api.ts @@ -0,0 +1,128 @@ +import { inspectDevice, decideDevice } from "./device-oauth"; +import { consentPreview, consentDecision, consentPreviewInput, consentDecisionInput } from "./consent-api"; +import { serialize } from "hono/utils/cookie"; +import { z } from "zod"; +import { AuthRepository } from "./postgres/auth-repository"; +import { IdentityRepository } from "./postgres/identity-repository"; +import { databaseFor } from "./postgres/database"; +import { readSession, requestCookie, signSession, type Session } from "./session"; +import type { Env } from "./types"; + +export const SESSION_SCOPES = ["flows:read", "flows:write", "runs:read", "runs:write"] as const; +const email = z.string().trim().toLowerCase().email().max(320); +const password = z.string().min(12).max(200).meta({ writeOnly: true }); +const token = z.string().min(1).max(512).meta({ writeOnly: true }); +export const authInputs = { + login: z.object({ email, password, returnTo: z.string().max(4096).optional() }).strict(), + signup: z.object({ email, password }).strict(), + request: z.object({ email }).strict(), + verify: z.object({ token }).strict(), + reset: z.object({ token, password }).strict(), + change: z.object({ currentPassword: password, password }).strict(), +}; +export const sessionResponse = z.discriminatedUnion("authenticated", [ + z.object({ authenticated: z.literal(false) }).strict(), + z.object({ + authenticated: z.literal(true), + user: z.object({ id: z.string(), email: z.email() }).strict(), + workspace: z.object({ id: z.string(), name: z.string().nullable(), role: z.literal("owner") }).strict(), + capabilities: z.array(z.enum(SESSION_SCOPES)), + expiresAt: z.iso.datetime(), + }).strict(), +]); +export const authSuccess = z.object({ ok: z.literal(true) }).strict(); +export const loginSuccess = authSuccess.extend({ returnTo: z.string() }); + +/** Only local application/protocol destinations; never trust a return cookie or form field. */ +export function safeReturnTo(value: string | undefined): string { + if (!value || !value.startsWith("/") || value.startsWith("//") || /[\\\x00-\x20]/.test(value)) return "/settings/integrations"; + try { + const url = new URL(value, "https://local.invalid"); + if (url.origin !== "https://local.invalid") return "/settings/integrations"; + if (!/^\/(?:authorize|device|jobs(?:\/[^/]+(?:\/edit)?)?|job-runs\/[^/]+|settings(?:\/(?:integrations|api-keys|password))?)$/.test(url.pathname)) return "/settings/integrations"; + return url.pathname + url.search + url.hash; + } catch { return "/settings/integrations"; } +} + +export function validBrowserOrigin(request: Request, env: Env): boolean { + return request.headers.get("Origin") === env.APP_ORIGIN && request.headers.get("Sec-Fetch-Site") !== "cross-site"; +} +export function authJson(body: unknown, status = 200): Response { + return Response.json(body, { status, headers: { "X-Factorize-Contract": "gen-2157-static-v1", "Cache-Control": "no-store", "X-Content-Type-Options": "nosniff", Pragma: "no-cache" } }); +} +const failure = (status: number, message: string) => authJson({ error: { code: status === 401 ? "invalid_token" : status === 403 ? "forbidden" : "invalid_request", message } }, status); +function sessionCookie(env: Env, value: string, maxAge: number): string { + return serialize("factorize_session", value, { httpOnly: true, secure: new URL(env.APP_ORIGIN).protocol === "https:", sameSite: "Lax", path: "/", maxAge }); +} +async function currentSession(request: Request, env: Env): Promise { + const session = await readSession(requestCookie(request, "factorize_session"), env.SESSION_SIGNING_SECRET); + if (!session) return null; + const member = await new IdentityRepository(databaseFor(env), session.tenantId).member(session.userId); + return member?.role === "owner" && member.sessionVersion === session.sessionVersion ? { ...session, email: member.email } : null; +} +export type AuthAction = "session" | "login" | "signup" | "verification-request" | "verification" | "reset-request" | "reset" | "password" | "logout" | "consent-preview" | "consent-decision" | "device-preview" | "device-decision"; + +export async function executeAuth(action: AuthAction, request: Request, env: Env, input: Record = {}): Promise { + // These operations use browser cookies only. Ignore neither a bad bearer nor a + // good bearer and silently fall back to a potentially unrelated browser identity. + if (request.headers.has("Authorization")) return failure(403, "An interactive browser session is required."); + if (action === "session" || action === "logout" || action === "password" || action === "consent-preview" || action === "consent-decision" || action === "device-preview" || action === "device-decision") { + const session = await currentSession(request, env); + if (action === "session") { + if (!session) return authJson({ authenticated: false }); + const workspace = (await databaseFor(env).pool.query<{ name: string | null }>("SELECT name FROM app.tenants WHERE id=$1", [session.tenantId])).rows[0]; + return authJson(sessionResponse.parse({ + authenticated: true, user: { id: session.userId, email: session.email }, + workspace: { id: session.tenantId, name: workspace?.name ?? null, role: "owner" }, + capabilities: [...SESSION_SCOPES], expiresAt: new Date(session.exp * 1000).toISOString(), + })); + } + if (action === "device-preview" || action === "device-decision") { + if (!session) return failure(401, "Sign in before authorizing a device."); + if (!env.OAUTH_PROVIDER) return failure(400, "Device authorization is unavailable."); + const result = action === "device-preview" ? await inspectDevice(env, String(input.userCode)) : await decideDevice(env, env.OAUTH_PROVIDER, session, String(input.userCode), input.decision as "allow" | "deny"); + return result ? authJson(result) : failure(400, "Invalid or expired device code."); + } + if (action === "consent-preview" || action === "consent-decision") { + if (!session) return failure(401, "Sign in before authorizing a client."); + try { + const data = action === "consent-preview" ? await consentPreview(env, session, consentPreviewInput.parse(input)) : await consentDecision(env, session, consentDecisionInput.parse(input)); + return data ? authJson(data) : failure(400, "Invalid or expired authorization request."); + } catch { return failure(400, "Invalid authorization request."); } + } + if (action === "logout") { + if (session) await new IdentityRepository(databaseFor(env), session.tenantId).revoke(session.userId); + const response = authJson({ ok: true }); + response.headers.append("Set-Cookie", sessionCookie(env, "", 0)); + return response; + } + if (!session) return failure(401, "The request is not authorized."); + const result = await new AuthRepository(databaseFor(env), env).changePassword(session.userId, input); + if (result.status !== 200) return failure(result.status, "error" in result.body ? result.body.error : "Password change failed."); + const response = authJson({ ok: true }); + response.headers.append("Set-Cookie", sessionCookie(env, "", 0)); + return response; + } + const repo = new AuthRepository(databaseFor(env), env); + if (action === "login") { + const result = await repo.login(input); + if (result.status !== 200 || !result.body.userId || !result.body.tenantId || !result.body.email || result.body.sessionVersion === undefined) return failure(result.status, "error" in result.body ? (result.body.error ?? "Sign in failed.") : "Sign in failed."); + const identity = result.body; + const member = await new IdentityRepository(databaseFor(env), identity.tenantId).member(identity.userId); + if (member?.role !== "owner" || member.sessionVersion !== identity.sessionVersion) return failure(403, "This account cannot access the workspace."); + const lifetime = 7 * 24 * 60 * 60; + const response = authJson({ ok: true, returnTo: safeReturnTo(requestCookie(request, "factorize_oauth_return") ?? input.returnTo as string | undefined) }); + response.headers.append("Set-Cookie", sessionCookie(env, await signSession({ ...identity, exp: Math.floor(Date.now() / 1000) + lifetime }, env.SESSION_SIGNING_SECRET), lifetime)); + response.headers.append("Set-Cookie", serialize("factorize_oauth_return", "", { httpOnly: true, secure: new URL(env.APP_ORIGIN).protocol === "https:", sameSite: "Lax", path: "/", maxAge: 0 })); + return response; + } + const result = action === "signup" ? await repo.signup(input) + : action === "verification-request" ? await repo.requestEmail(input, "verify") + : action === "verification" ? await repo.completeVerification(String(input.token)) + : action === "reset-request" ? await repo.requestReset(input) + : await repo.completeReset(input); + // The new public signup contract intentionally does not enumerate accounts. + // Keep legacy form status compatibility until those screens are cut over. + if (action === "signup" && (result.status === 201 || result.status === 409)) return authJson({ ok: true }, 202); + return result.status < 300 ? authJson({ ok: true }) : failure(result.status, "error" in result.body ? result.body.error : "Request failed."); +} diff --git a/packages/app/src/auth-email.ts b/packages/api/src/auth-email.ts similarity index 100% rename from packages/app/src/auth-email.ts rename to packages/api/src/auth-email.ts diff --git a/packages/app/src/auth.ts b/packages/api/src/auth.ts similarity index 100% rename from packages/app/src/auth.ts rename to packages/api/src/auth.ts diff --git a/packages/app/src/claude-stream.ts b/packages/api/src/claude-stream.ts similarity index 100% rename from packages/app/src/claude-stream.ts rename to packages/api/src/claude-stream.ts diff --git a/packages/app/src/clickup.ts b/packages/api/src/clickup.ts similarity index 100% rename from packages/app/src/clickup.ts rename to packages/api/src/clickup.ts diff --git a/packages/app/src/cloudflare-tail.ts b/packages/api/src/cloudflare-tail.ts similarity index 100% rename from packages/app/src/cloudflare-tail.ts rename to packages/api/src/cloudflare-tail.ts diff --git a/packages/app/src/codex-trace.ts b/packages/api/src/codex-trace.ts similarity index 100% rename from packages/app/src/codex-trace.ts rename to packages/api/src/codex-trace.ts diff --git a/packages/api/src/consent-api.ts b/packages/api/src/consent-api.ts new file mode 100644 index 00000000..07a09444 --- /dev/null +++ b/packages/api/src/consent-api.ts @@ -0,0 +1,38 @@ +import { z } from "zod"; +import type { AuthRequest } from "@cloudflare/workers-oauth-provider"; +import { hmac } from "./crypto"; +import type { Env, OAuthProps } from "./types"; +import type { Session } from "./session"; +export const consentPreviewInput = z.object({ authorizationQuery: z.string().min(1).max(8192) }).strict(); +export const consentDecisionInput = z.object({ request: z.string().min(1).max(16384), signature: z.string().min(1).max(256), decision: z.enum(["allow", "deny"]), scopes: z.array(z.enum(["flows:read", "flows:write", "runs:read", "runs:write"])) }).strict(); +export const consentPreviewResponse = z.object({ clientName: z.string(), scopes: z.array(z.string()), request: z.string(), signature: z.string(), expiresAt: z.string() }); +export const consentDecisionResponse = z.object({ redirectTo: z.string() }); +const supported = ["flows:read", "flows:write", "runs:read", "runs:write"]; +const encode = (value: unknown) => btoa(String.fromCharCode(...new TextEncoder().encode(JSON.stringify(value)))); +const decode = (value: string) => JSON.parse(new TextDecoder().decode(Uint8Array.from(atob(value), char => char.charCodeAt(0)))); +const binding = (payload: string, session: Session) => `${payload}.${session.tenantId}.${session.userId}.${session.sessionVersion}`; +const equal = (a: string, b: string) => { let diff = a.length ^ b.length; for (let i = 0; i < Math.max(a.length, b.length); i++) diff |= (a.charCodeAt(i) || 0) ^ (b.charCodeAt(i) || 0); return diff === 0; }; +export async function consentPreview(env: Env, session: Session, input: z.infer) { + if (!env.OAUTH_PROVIDER) throw new Error("OAuth provider unavailable"); + const parsed = await env.OAUTH_PROVIDER.parseAuthRequest(new Request(`${env.APP_ORIGIN}/authorize?${input.authorizationQuery.replace(/^\?/, "")}`)); + const client = await env.OAUTH_PROVIDER.lookupClient(parsed.clientId); + if (!client) return null; + const expiresAt = Math.min(session.exp, Math.floor(Date.now() / 1000) + 600); + const request = encode({ parsed, expiresAt }); + return { clientName: client.clientName ?? "this client", scopes: parsed.scope.filter(scope => supported.includes(scope)), request, signature: await hmac(binding(request, session), env.SESSION_SIGNING_SECRET), expiresAt: new Date(expiresAt * 1000).toISOString() }; +} +export async function consentDecision(env: Env, session: Session, input: z.infer) { + if (!env.OAUTH_PROVIDER || !equal(input.signature, await hmac(binding(input.request, session), env.SESSION_SIGNING_SECRET))) return null; + let envelope: { parsed: AuthRequest; expiresAt: number }; + try { envelope = decode(input.request); } catch { return null; } + if (!Number.isFinite(envelope.expiresAt) || envelope.expiresAt <= Math.floor(Date.now() / 1000)) return null; + const parsed = envelope.parsed; + // Revalidate client registration and redirect URI before grant issuance. + const client = await env.OAUTH_PROVIDER.lookupClient(parsed.clientId); + if (!client || !client.redirectUris.includes(parsed.redirectUri)) return null; + if (input.scopes.some(scope => !parsed.scope.includes(scope) || !supported.includes(scope))) return null; + if (input.decision === "deny") { const redirect = new URL(parsed.redirectUri); redirect.searchParams.set("error", "access_denied"); redirect.searchParams.set("state", parsed.state); if (parsed.issuer) redirect.searchParams.set("iss", parsed.issuer); return { redirectTo: redirect.toString() }; } + const props: OAuthProps = { tenantId: session.tenantId, userId: session.userId, sessionVersion: session.sessionVersion, scopes: input.scopes, authMethod: "oauth" }; + const { redirectTo } = await env.OAUTH_PROVIDER.completeAuthorization({ request: parsed, userId: session.userId, metadata: { tenantId: session.tenantId }, scope: input.scopes, props }); + return { redirectTo }; +} diff --git a/packages/app/src/crypto.ts b/packages/api/src/crypto.ts similarity index 100% rename from packages/app/src/crypto.ts rename to packages/api/src/crypto.ts diff --git a/packages/app/src/custom-handler.ts b/packages/api/src/custom-handler.ts similarity index 100% rename from packages/app/src/custom-handler.ts rename to packages/api/src/custom-handler.ts diff --git a/packages/app/src/device-oauth.ts b/packages/api/src/device-oauth.ts similarity index 80% rename from packages/app/src/device-oauth.ts rename to packages/api/src/device-oauth.ts index 1c8653ea..489a4371 100644 --- a/packages/app/src/device-oauth.ts +++ b/packages/api/src/device-oauth.ts @@ -1,3 +1,4 @@ +import { staticApp } from "./static-app"; import type { AuthRequest } from "@cloudflare/workers-oauth-provider"; import { hmac } from "./crypto"; import type { Env, OAuthProps } from "./types"; @@ -191,30 +192,41 @@ export async function deviceVerification(request: Request, env: Env, oauth: OAut const url = new URL(request.url); const form = request.method === "POST" ? await request.formData() : null; const suppliedCode = String(form?.get("user_code") ?? url.searchParams.get("user_code") ?? ""); - const normalized = normalizeUserCode(suppliedCode); - const deviceCode = normalized.length === 8 ? await deviceCodeForUser(env, normalized) : null; - const record = deviceCode ? await readDevice(env, deviceCode) : null; - const valid = record && record.status === "pending" && record.expiresAt > Math.floor(Date.now() / 1000); - if (request.method === "GET") { - const detail = valid ? `

Authorize ${escapeHtml(record.clientName)}

Signed in as ${escapeHtml(session.email)}.

This client is requesting: ${record.scope.length ? record.scope.map(escapeHtml).join(", ") : "basic access"}.

` : `

Connect a device

Enter the code shown by your application.

`; - return new Response(`Connect a device — Factorize
${detail}

${valid ? ` ` : ``}

`, { headers: { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" } }); - } - if (request.method !== "POST") return new Response("Method not allowed", { status: 405, headers: { Allow: "GET, POST" } }); - if (!valid || !deviceCode || !record) return new Response("Invalid or expired device code", { status: 400 }); - if (form?.get("decision") === "deny") { - record.status = "denied"; - await writeDevice(env, deviceCode, normalized, record); - return confirmation("Authorization denied", "You can close this window."); - } - if (form?.get("decision") !== "allow") return Response.redirect(`${env.APP_ORIGIN}/device?user_code=${encodeURIComponent(displayUserCode(normalized))}`, 303); - const props: OAuthProps = { tenantId: session.tenantId, userId: session.userId, sessionVersion: session.sessionVersion, scopes: record.scope }; - const authRequest: AuthRequest = { responseType: "code", clientId: record.clientId, redirectUri: record.redirectUri, scope: record.scope, state: "", codeChallenge: record.codeChallenge, codeChallengeMethod: "S256", resource: record.resource, issuer: env.APP_ORIGIN }; - const result = await oauth.completeAuthorization({ request: authRequest, userId: session.userId, metadata: { tenantId: session.tenantId }, scope: record.scope, props, revokeExistingGrants: false }); - record.status = "approved"; - record.authorizationCode = new URL(result.redirectTo).searchParams.get("code") ?? undefined; - if (!record.authorizationCode) return new Response("Could not complete device authorization", { status: 500 }); - await writeDevice(env, deviceCode, normalized, record); - return confirmation("Device connected", "Authorization is complete. You can close this window."); + if (request.method === "GET" || request.method === "HEAD") return (await staticApp(request, env))!; + if (request.method !== "POST") return new Response("Method not allowed", { status: 405, headers: { Allow: "GET, HEAD, POST" } }); + if (request.headers.get("Origin") !== env.APP_ORIGIN || request.headers.get("Sec-Fetch-Site") === "cross-site") return new Response("Invalid request origin", { status: 403 }); + const decision = form?.get("decision"); + if (decision !== "allow" && decision !== "deny") return Response.redirect(`${env.APP_ORIGIN}/device?user_code=${encodeURIComponent(suppliedCode)}`, 303); + const result = await decideDevice(env, oauth, session, suppliedCode, decision); + return new Response(result ? result.status === "approved" ? "Device connected. You can close this window." : "Authorization denied. You can close this window." : "Invalid or expired device code", { status: result ? 200 : 400, headers: { "Content-Type": "text/plain; charset=utf-8", "Cache-Control": "no-store" } }); +} + +export async function inspectDevice(env: Env, userCode: string) { + const normalized = normalizeUserCode(userCode); + const code = normalized.length === 8 ? await deviceCodeForUser(env, normalized) : null; + const record = code ? await readDevice(env, code) : null; + if (!record || record.status !== "pending" || record.expiresAt <= Math.floor(Date.now() / 1000)) return null; + return { userCode: displayUserCode(normalized), clientName: record.clientName, scopes: record.scope, expiresAt: new Date(record.expiresAt * 1000).toISOString() }; +} +export async function decideDevice(env: Env, oauth: OAuthHelpers, session: { tenantId: string; userId: string; sessionVersion: number }, userCode: string, decision: "allow" | "deny") { + const normalized = normalizeUserCode(userCode); + const code = normalized.length === 8 ? await deviceCodeForUser(env, normalized) : null; + if (!code) return null; + const authorize = async (record: DeviceRecord | null, write: (record: DeviceRecord) => Promise) => { + if (!record || record.status !== "pending" || record.expiresAt <= Math.floor(Date.now() / 1000)) return null; + if (decision === "deny") { record.status = "denied"; await write(record); return { status: "denied" as const }; } + const props: OAuthProps = { tenantId: session.tenantId, userId: session.userId, sessionVersion: session.sessionVersion, scopes: record.scope, authMethod: "oauth" }; + const authRequest: AuthRequest = { responseType: "code", clientId: record.clientId, redirectUri: record.redirectUri, scope: record.scope, state: "", codeChallenge: record.codeChallenge, codeChallengeMethod: "S256", resource: record.resource, issuer: env.APP_ORIGIN }; + const result = await oauth.completeAuthorization({ request: authRequest, userId: session.userId, metadata: { tenantId: session.tenantId }, scope: record.scope, props, revokeExistingGrants: false }); + record.authorizationCode = new URL(result.redirectTo).searchParams.get("code") ?? undefined; + if (!record.authorizationCode) throw new Error("Incomplete device authorization"); + record.status = "approved"; await write(record); return { status: "approved" as const }; + }; + if (!env.DATABASE && !env.HYPERDRIVE) return authorize(await readDevice(env, code), record => writeDevice(env, code, normalized, record)); + return databaseFor(env).transaction(async client => { + const row = (await client.query("SELECT record FROM app.oauth_device_authorizations WHERE device_code=$1 AND expires_at>now() FOR UPDATE", [code])).rows[0]; + return authorize(row?.record ?? null, async record => { await client.query("UPDATE app.oauth_device_authorizations SET record=$2,updated_at=now() WHERE device_code=$1", [code, JSON.stringify(record)]); }); + }); } export async function addDeviceMetadata(response: Response, appOrigin: string): Promise { @@ -252,8 +264,3 @@ export async function deviceClientRegistration(request: Request, env: Env, oauth result.redirect_uris = originalRedirectUris; return json(result, response.status); } - -function escapeHtml(value: string): string { return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """); } -function confirmation(title: string, message: string): Response { - return new Response(`${escapeHtml(title)} — Factorize

${escapeHtml(title)}

${escapeHtml(message)}

`, { headers: { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" } }); -} diff --git a/packages/api/src/editor-contracts.ts b/packages/api/src/editor-contracts.ts new file mode 100644 index 00000000..965855ba --- /dev/null +++ b/packages/api/src/editor-contracts.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; +export const executionTargetResponse = z.object({ + id: z.string(), kind: z.enum(["exe-vm", "amp"]), name: z.string(), workspace: z.string(), cwd: z.string(), agentKind: z.string(), + models: z.array(z.string()).optional(), modelsRefreshedAt: z.string().nullable().optional(), efforts: z.array(z.string()).optional(), capabilities: z.array(z.string()), +}); +export const triggerAvailabilityResponse = z.object({ manual: z.literal(true), schedule: z.literal(true), jobLifecycle: z.literal(true), linear: z.boolean(), clickup: z.boolean(), github: z.boolean(), cloudflareTail: z.boolean() }); +export const namedOption = z.object({ id: z.string(), name: z.string() }); +export const providerOptions = z.object({ statuses: z.array(namedOption), users: z.array(namedOption), labels: z.array(namedOption) }); +export const githubInstallation = z.object({ installationId: z.union([z.number().int(), z.string().regex(/^[0-9]+$/)]), accountLogin: z.string(), accountType: z.string(), state: z.string(), updatedAt: z.string() }); +export const githubRepository = z.object({ id: z.number().int(), name: z.string(), fullName: z.string(), owner: z.string(), private: z.boolean(), defaultBranch: z.string() }); +export const tailIntegration = z.object({ integrationId: z.string(), name: z.string(), status: z.literal("connected"), secretConfigured: z.literal(true), createdAt: z.string().optional(), updatedAt: z.string().optional(), referencedJobCount: z.number().int() }); diff --git a/packages/app/src/exe-vm-backend.ts b/packages/api/src/exe-vm-backend.ts similarity index 100% rename from packages/app/src/exe-vm-backend.ts rename to packages/api/src/exe-vm-backend.ts diff --git a/packages/app/src/exe.ts b/packages/api/src/exe.ts similarity index 100% rename from packages/app/src/exe.ts rename to packages/api/src/exe.ts diff --git a/packages/app/src/execution.ts b/packages/api/src/execution.ts similarity index 100% rename from packages/app/src/execution.ts rename to packages/api/src/execution.ts diff --git a/packages/app/src/flow-schemas.ts b/packages/api/src/flow-schemas.ts similarity index 97% rename from packages/app/src/flow-schemas.ts rename to packages/api/src/flow-schemas.ts index 6a98b8a5..6524031f 100644 --- a/packages/app/src/flow-schemas.ts +++ b/packages/api/src/flow-schemas.ts @@ -1,7 +1,7 @@ import { z } from "zod"; export const scopeSchema = z.enum(["flows:read", "flows:write", "runs:read", "runs:write"]); -export const runStateSchema = z.enum(["queued", "starting", "running", "done", "blocked", "failed", "ignored"]); +export const runStateSchema = z.enum(["queued", "starting", "running", "done", "blocked", "failed", "ignored", "succeeded", "stopping", "stopped"]); export const matchRuleSchema = z.object({ type: z.enum(["owner", "creator", "status", "label", "assignee"]), targetId: z.string().min(1), diff --git a/packages/app/src/flow-service.ts b/packages/api/src/flow-service.ts similarity index 76% rename from packages/app/src/flow-service.ts rename to packages/api/src/flow-service.ts index d59e5bc3..06be04f0 100644 --- a/packages/app/src/flow-service.ts +++ b/packages/api/src/flow-service.ts @@ -1,10 +1,19 @@ +import { searchResponse } from "./search-contracts"; +import { integrationStatus, exeConnection, accessToken, createdAccessToken, authorizedClient } from "./settings-contracts"; +import { namedOption, providerOptions, githubRepository, executionTargetResponse, githubInstallation, tailIntegration } from "./editor-contracts"; +import { z } from "zod"; +import { runPageResponse, fullRunResponse } from "./run-read-contracts"; +import { triggerContextCatalog } from "./trigger-context"; import type { Env, OAuthProps } from "./types"; import type { JobInput, ManualInvocationInput } from "./flow-schemas"; import { nextOccurrence, validateScheduleConfig } from "./schedule"; import { databaseFor } from "./postgres/database"; import { IdentityRepository } from "./postgres/identity-repository"; import { AccessTokenRepository } from "./postgres/access-token-repository"; -import { PostgresJobRepository } from "./postgres/job-repository"; +import { JobSummaryRepository } from "./postgres/job-summary-repository"; +import { jobResponse } from "./job-contracts"; +import type { JobPageQuery } from "./job-contracts"; +import { PostgresJobRepository, StaleJobEdit } from "./postgres/job-repository"; import { ConnectionRepository } from "./postgres/connection-repository"; import { decrypt, encrypt } from "./crypto"; import { InvocationService, type Job, type Trigger } from "./job-domain"; @@ -27,6 +36,16 @@ export class ServiceError extends Error { constructor(public status: number, public code: string, message: string) { super(message); } } +/** Response validation failures are server defects, never malformed client input. */ +export function publicValue(schema: T, value: unknown): z.output { + const result = schema.safeParse(value); + if (!result.success) { + console.error(JSON.stringify({ event: "public_contract_failure", issues: result.error.issues.map(issue => ({ path: issue.path, code: issue.code })) })); + throw new ServiceError(500, "internal_error", "Factorize returned an invalid resource."); + } + return result.data; +} + type Scope = "flows:read" | "flows:write" | "runs:read" | "runs:write"; export class ApiService { @@ -80,7 +99,7 @@ export class ApiService { private async presentJob(job: Job, loadedStats?: { running_count: string; last_run_state: string | null }) { const stats = loadedStats ?? (await this.jobStatistics([job.id])).get(job.id); const runningCount = Number(stats?.running_count ?? 0); - return { ...job, runNameTemplate: job.runNameTemplate ?? "", executionTargetId: `${job.executionTarget.agentKind === "Amp" ? "amp:" : ""}${job.executionTarget.connectionId}`, agentKind: job.executionTarget.agentKind, runningCount, currentRuns: runningCount, maxConcurrency: job.concurrencyLimit, lastRunState: stats?.last_run_state ?? null }; + return publicValue(jobResponse, { ...job, triggers: job.triggers.map(trigger => ({ ...trigger, config: trigger.kind === "webhook" ? { ...trigger.config, ...(trigger.config.signingSecret || trigger.config.secret ? { secretConfigured: true } : {}), ...(trigger.config.provider === "cloudflareTail" ? { destination: `${this.env.APP_ORIGIN}/webhooks/cloudflare/${encodeURIComponent(this.auth.tenantId)}/${encodeURIComponent(job.id)}` } : {}) } : trigger.config })), runNameTemplate: job.runNameTemplate ?? "", executionTargetId: `${job.executionTarget.agentKind === "Amp" ? "amp:" : ""}${job.executionTarget.connectionId}`, agentKind: job.executionTarget.agentKind, runningCount, currentRuns: runningCount, maxConcurrency: job.concurrencyLimit, lastRunState: stats?.last_run_state ?? null }); } private async authorize(scope: Scope): Promise { @@ -95,19 +114,15 @@ export class ApiService { } private async authorizeOwnerSession(scope: Scope): Promise { await this.authorize(scope); if (this.auth.authMethod !== "session") throw new ServiceError(403, "session_required", "An interactive owner session is required."); } - private publicJob(value: any) { - for (const trigger of value?.triggers ?? []) { - const provider = trigger.kind === "webhook" ? trigger.config?.provider : undefined; - if (provider === "cloudflareTail") trigger.config.destination = `${this.env.APP_ORIGIN}/webhooks/cloudflare/${encodeURIComponent(this.auth.tenantId)}/${encodeURIComponent(value.id)}`; - } - return value; - } - async listExeConnections() { await this.authorize("flows:read"); return (await new IntegrationService(databaseFor(this.env), this.auth.tenantId, this.env.CREDENTIAL_ENCRYPTION_KEY).status()).exeConnections; } - async listGitHubInstallations() { await this.authorize("flows:read"); return new GitHubRepository(databaseFor(this.env), this.auth.tenantId).installations(); } - async listTailIntegrations() { await this.authorize("flows:read"); return new IntegrationService(databaseFor(this.env), this.auth.tenantId, this.env.CREDENTIAL_ENCRYPTION_KEY).tails(); } - async listRuns(query: URLSearchParams) { await this.authorize("runs:read"); return new RunQueryRepository(databaseFor(this.env), this.auth.tenantId).list(query); } - async search(query: string) { await this.authorize("runs:read"); return new OperationsRepository(databaseFor(this.env), this.auth.tenantId).search(query); } + async listExeConnections() { await this.authorize("flows:read"); return publicValue(z.array(exeConnection), (await new IntegrationService(databaseFor(this.env), this.auth.tenantId, this.env.CREDENTIAL_ENCRYPTION_KEY).status()).exeConnections); } + async listGitHubInstallations() { await this.authorize("flows:read"); return publicValue(z.array(githubInstallation), JSON.parse(JSON.stringify(await new GitHubRepository(databaseFor(this.env), this.auth.tenantId).installations()))); } + async listTailIntegrations() { await this.authorize("flows:read"); return publicValue(z.array(tailIntegration), await new IntegrationService(databaseFor(this.env), this.auth.tenantId, this.env.CREDENTIAL_ENCRYPTION_KEY).tails()); } + async listRuns(query: URLSearchParams) { await this.authorize("runs:read"); return publicValue(runPageResponse, JSON.parse(JSON.stringify(await new RunQueryRepository(databaseFor(this.env), this.auth.tenantId).list(query)))); } + async search(query: string) { await this.authorize("runs:read"); return publicValue(searchResponse, await new OperationsRepository(databaseFor(this.env), this.auth.tenantId).search(query)); } + async triggerContextMetadata() { await this.authorize("flows:read"); return triggerContextCatalog; } + async getRunStatus(runId: string) { await this.authorize("runs:read"); const status = await new RunQueryRepository(databaseFor(this.env), this.auth.tenantId).status(runId); if (!status) throw new ServiceError(404, "not_found", "Run not found"); return status; } + async getRevisionTrace(runId: string, after: number, limit: number, revision?: string) { await this.authorize("runs:read"); const page = await new TraceRepository(databaseFor(this.env), this.auth.tenantId).revisionPage(runId, after, limit, revision); if (!page) throw new ServiceError(404, "not_found", "Run not found"); return page; } async getRun(runId: string) { await this.authorize("runs:read"); const repository = new RunQueryRepository(databaseFor(this.env), this.auth.tenantId); @@ -124,11 +139,24 @@ export class ApiService { run.activity = activity; run.execution_diagnostics ??= null; run.trace_sources ??= null; run.trace_projection = projection.rows[0] ?? null; run.trace_generation = cursor.rows[0]?.generation ?? null; run.harness_log = artifacts.find(item => item.kind === "terminal_log") ?? null; - return run; + // Enumerate public fields rather than publishing future database columns. + return publicValue(fullRunResponse, JSON.parse(JSON.stringify({ id: run.id, tenant_id: run.tenant_id, job_id: run.job_id, invocation_id: run.invocation_id, + execution_handle: run.execution_handle ? { backendKind: run.execution_handle.backendKind, id: run.execution_handle.id } : null, + provider: run.provider, issue_id: run.issue_id, issue_url: run.issue_url, issue_title: run.issue_title, + run_name: run.run_name, agent_name: run.agent_name, workspace_name: run.workspace_name, agent_kind: run.agent_kind, + state: run.state, execution_backend_kind: run.execution_backend_kind, backend_kind: run.backend_kind, + execution_capabilities: run.execution_capabilities, capabilities: run.capabilities, destination_url: run.destination_url, + artifact_state: run.artifact_state, artifact_error: run.artifact_error, + claim_released: run.claim_released, vm_cleanup_attempt: run.vm_cleanup_attempt, cleanup_next_at: run.cleanup_next_at, vm_cleanup_complete: run.vm_cleanup_complete, + created_at: run.created_at, updated_at: run.updated_at, started_at: run.started_at, + job_name: run.job_name, prompt: run.prompt, context: run.context, occurrence: run.occurrence, invocation: run.invocation, + invocation_source: run.invocation_source, invocation_claim_key: run.invocation_claim_key, invocation_trigger_id: run.invocation_trigger_id, invocation_created_at: run.invocation_created_at, + activity: run.activity, execution_diagnostics: run.execution_diagnostics, trace_sources: run.trace_sources, + trace_projection: run.trace_projection, trace_generation: run.trace_generation, harness_log: run.harness_log }))); } async getRunTrace(runId: string, after: number, limit: number) { await this.authorize("runs:read"); return new TraceRepository(databaseFor(this.env), this.auth.tenantId).page(runId, after, limit); } async getRunDiagnostics(runId: string) { - const run: any = await this.getRun(runId), database = databaseFor(this.env); + const run = await this.getRun(runId), database = databaseFor(this.env); const [evidence, artifacts] = await Promise.all([ new TraceProjectionRepository(database, this.auth.tenantId).diagnostics(runId), new ArtifactRepository(database, this.auth.tenantId).list(runId), @@ -151,6 +179,7 @@ export class ApiService { } async stopRun(runId: string) { await this.authorize("runs:write"); const stopped = await new RunQueryRepository(databaseFor(this.env), this.auth.tenantId).stop(runId); if (!stopped) throw new ServiceError(409, "operation_failed", "Run is not active"); if (this.env.SCHEDULER) await this.env.SCHEDULER.get(this.env.SCHEDULER.idFromName("global")).fetch("https://scheduler/wake", { method: "POST" }); return stopped; } killRun(runId: string) { return this.stopRun(runId); } + async listJobSummaries(input: JobPageQuery, selector = false) { await this.authorize("flows:read"); return new JobSummaryRepository(databaseFor(this.env), this.auth.tenantId).page(input, selector); } async listJobs() { await this.authorize("flows:read"); const jobs = await this.jobs().list(), stats = await this.jobStatistics(jobs.map(job => job.id)); return Promise.all(jobs.map(job => this.presentJob(job, stats.get(job.id) ?? { running_count: "0", last_run_state: null }))); } async getJob(jobId: string) { await this.authorize("flows:read"); const job = await this.jobs().getJob(jobId); if (!job) throw new ServiceError(404, "not_found", "Job not found"); return this.presentJob(job); } async listJobEvents(jobId: string, limit = 50) { await this.authorize("runs:read"); return new OperationsRepository(databaseFor(this.env), this.auth.tenantId).jobEvents(jobId, limit); } @@ -163,10 +192,10 @@ export class ApiService { const job: Job = { id, name: input.name, slug: input.slug, promptTemplate: input.promptTemplate, runNameTemplate: input.runNameTemplate ?? "", model: input.model ?? "", ...(input.effort ? { effort: input.effort } : {}), executionTarget: await this.executionTarget(input.executionTargetId), concurrencyLimit: input.concurrencyLimit, enabled: true, triggers, createdAt: timestamp, updatedAt: timestamp }; try { return this.presentJob(await this.jobs().create(job)); } catch (error: any) { if (error?.code === "23505") throw new ServiceError(409, "conflict", "Job slug is already in use"); throw error; } } - async updateJob(jobId: string, input: JobInput) { + async updateJob(jobId: string, input: JobInput & { expectedUpdatedAt?: string }) { await this.authorize("flows:write"); const repository = this.jobs(), current = await repository.getJob(jobId); if (!current) throw new ServiceError(404, "not_found", "Job not found"); const triggers = this.normalizedTriggers(input.triggers, current.triggers).map(trigger => ({ ...trigger, jobId })); - const updated = await repository.update({ ...current, name: input.name, slug: input.slug, promptTemplate: input.promptTemplate, runNameTemplate: input.runNameTemplate ?? "", model: input.model ?? "", effort: input.effort, executionTarget: await this.executionTarget(input.executionTargetId), concurrencyLimit: input.concurrencyLimit, triggers, updatedAt: new Date().toISOString() }); + const updated = await repository.update({ ...current, name: input.name, slug: input.slug, promptTemplate: input.promptTemplate, runNameTemplate: input.runNameTemplate ?? "", model: input.model ?? "", effort: input.effort, executionTarget: await this.executionTarget(input.executionTargetId), concurrencyLimit: input.concurrencyLimit, triggers, updatedAt: new Date().toISOString() }, input.expectedUpdatedAt).catch(error => { if (error instanceof StaleJobEdit) throw new ServiceError(409, "stale_job", "This job changed. Reload its configuration before saving."); throw error; }); await this.wakeScheduler(); return this.presentJob(updated); } @@ -199,7 +228,7 @@ export class ApiService { await this.authorize("flows:read"); const connections = await this.connections().all(["exe:", "amp:"]); const targets: any[] = []; for (const [kind, value] of connections) if (kind.startsWith("exe:")) { const id = kind.slice(4); targets.push({ id, kind: "exe-vm", name: "Ephemeral exe.dev VMs", workspace: "ephemeral", cwd: "/home/exedev/workspace", agentKind: value.agentKind, models: value.models ?? [], modelsRefreshedAt: value.modelsRefreshedAt ?? null, efforts: value.agentKind === "codex" ? ["minimal", "low", "medium", "high", "xhigh"] : [], capabilities: ["recovery", "stop"] }); } else if (kind.startsWith("amp:")) { const id = kind.slice(4); targets.push({ id: `amp:${id}`, kind: "amp", name: `Amp · ${value.project}`, workspace: value.project, cwd: "Cloud orb", agentKind: "Amp", capabilities: ["stop"] }); } - return targets; + return publicValue(z.array(executionTargetResponse), targets); } async diagnoseExeIntegration(connectionId: string) { await this.authorize("flows:write"); const value = await new IntegrationService(databaseFor(this.env), this.auth.tenantId, this.env.CREDENTIAL_ENCRYPTION_KEY).diagnoseExe(connectionId); if (!value) throw new ServiceError(404,"not_found","Integration not found"); return value; } async listJobTriggerAvailability() { await this.authorize("flows:read"); const [kinds, installations] = await Promise.all([this.connections().kinds(), new GitHubRepository(databaseFor(this.env),this.auth.tenantId).installations()]), states=installations.map((x:any)=>x.state); return installedTriggerAvailability(kinds.includes("linear"),kinds.includes("clickup"),states,kinds.filter(x=>x.startsWith("cloudflare-tail:")).length); } @@ -216,7 +245,7 @@ export class ApiService { private integrations() { return new IntegrationService(databaseFor(this.env), this.auth.tenantId, this.env.CREDENTIAL_ENCRYPTION_KEY); } private providers() { return new ProviderCatalog(databaseFor(this.env), this.env, this.auth.tenantId); } - async integrationStatus() { await this.authorize("flows:read"); return this.integrations().status(); } + async integrationStatus() { await this.authorize("flows:read"); return publicValue(integrationStatus, await this.integrations().status()); } async saveExeIntegration(input: any) { await this.authorize("flows:write"); return this.integrations().saveExe(input); } async testExeIntegration(input: any) { await this.authorize("flows:write"); return this.integrations().testExe(input); } async removeIntegration(kind: "exe" | "amp", id: string) { await this.authorize("flows:write"); const result = await this.integrations().remove(kind, id); if (result.conflict) throw new ServiceError(409, "conflict", "This integration is used by a job."); if (!result.deleted) throw new ServiceError(404, "not_found", "Integration not found"); return { id, deleted: true }; } @@ -225,12 +254,12 @@ export class ApiService { async saveTailIntegration(input: any) { await this.authorize("flows:write"); return this.integrations().saveTail(input); } async testTailIntegration(id: string) { await this.authorize("flows:write"); const result = await this.integrations().testTail(id); if (!result) throw new ServiceError(404, "not_found", "Integration not found"); return result; } async removeTailIntegration(id: string) { await this.authorize("flows:write"); if (!await this.connections().delete(`cloudflare-tail:${id}`)) throw new ServiceError(404, "not_found", "Integration not found"); return { id, deleted: true }; } - async linearProjects() { await this.authorize("flows:read"); return this.providers().linearProjects(); } - async linearOptions() { await this.authorize("flows:read"); return this.providers().linearOptions(); } - async clickUpLists() { await this.authorize("flows:read"); return this.providers().clickUpLists(); } - async clickUpOptions(listId: string) { await this.authorize("flows:read"); return this.providers().clickUpOptions(listId); } - async githubRepositories(installationId: number) { await this.authorize("flows:read"); return this.providers().githubRepositories(installationId); } - async githubIssueOptions(installationId: number, repositoryId: number) { await this.authorize("flows:read"); return this.providers().githubIssueOptions(installationId, repositoryId); } + async linearProjects() { await this.authorize("flows:read"); return publicValue(z.array(namedOption), await this.providers().linearProjects()); } + async linearOptions() { await this.authorize("flows:read"); return publicValue(providerOptions, await this.providers().linearOptions()); } + async clickUpLists() { await this.authorize("flows:read"); return publicValue(z.array(namedOption), await this.providers().clickUpLists()); } + async clickUpOptions(listId: string) { await this.authorize("flows:read"); return publicValue(providerOptions, await this.providers().clickUpOptions(listId)); } + async githubRepositories(installationId: number) { await this.authorize("flows:read"); return publicValue(z.array(githubRepository), await this.providers().githubRepositories(installationId)); } + async githubIssueOptions(installationId: number, repositoryId: number) { await this.authorize("flows:read"); return publicValue(providerOptions, await this.providers().githubIssueOptions(installationId, repositoryId)); } async removeGitHubInstallation(id: number) { await this.authorize("flows:write"); if (!await new GitHubRepository(databaseFor(this.env), this.auth.tenantId).delete(id)) throw new ServiceError(404, "not_found", "Installation not found"); return { id, deleted: true }; } async listAuthorizedClients() { @@ -240,10 +269,10 @@ export class ApiService { do { const page = await this.env.OAUTH_PROVIDER.listUserGrants(this.auth.userId, { limit: 100, cursor }); grants.push(...page.items.filter(grant => !grant.expiresAt || grant.expiresAt > Math.floor(Date.now() / 1000))); cursor = page.cursor; } while (cursor); const clients = await Promise.all([...new Set(grants.map(grant => grant.clientId))].map(async clientId => [clientId, await this.env.OAUTH_PROVIDER!.lookupClient(clientId)] as const)); const byId = new Map(clients); - return grants.map(grant => ({ grantId: grant.id, clientId: grant.clientId, clientName: byId.get(grant.clientId)?.clientName ?? grant.clientId, scopes: grant.scope, authorizationDate: new Date(grant.createdAt * 1000).toISOString(), expiresAt: grant.expiresAt ? new Date(grant.expiresAt * 1000).toISOString() : null, lastUsedAt: null })); + return publicValue(z.array(authorizedClient), grants.map(grant => ({ grantId: grant.id, clientId: grant.clientId, clientName: byId.get(grant.clientId)?.clientName ?? grant.clientId, scopes: grant.scope, authorizationDate: new Date(grant.createdAt * 1000).toISOString(), expiresAt: grant.expiresAt ? new Date(grant.expiresAt * 1000).toISOString() : null, lastUsedAt: null }))); } async revokeAuthorizedClient(clientId: string) { await this.authorizeOwnerSession("flows:write"); if (!this.env.OAUTH_PROVIDER) throw new ServiceError(503, "operation_failed", "OAuth management unavailable"); const grants: any[] = []; let cursor: string | undefined; do { const page = await this.env.OAUTH_PROVIDER.listUserGrants(this.auth.userId, { limit: 100, cursor }); grants.push(...page.items.filter(grant => grant.clientId === clientId)); cursor = page.cursor; } while (cursor); await Promise.all(grants.map(grant => this.env.OAUTH_PROVIDER!.revokeGrant(grant.id, this.auth.userId))); return { revoked: grants.length }; } - async listAccessTokens() { await this.authorizeOwnerSession("flows:read"); return new AccessTokenRepository(databaseFor(this.env), this.auth.tenantId).list(); } - async createAccessToken(input: any) { await this.authorizeOwnerSession("flows:write"); const name = typeof input?.name === "string" ? input.name.trim() : "", requested: string[] = Array.isArray(input?.scopes) ? [...new Set(input.scopes.filter((scope: unknown): scope is string => typeof scope === "string"))] : [], expiryDays = Number(input?.expiryDays); if (!name || name.length > 100 || !requested.length || requested.some(scope => !ACCESS_SCOPES.includes(scope as any)) || ![7, 30, 90].includes(expiryDays)) throw new ServiceError(400, "invalid_request", "A name, supported scopes, and expiryDays of 7, 30, or 90 are required."); const token = issueAccessToken(this.auth.tenantId), expiresAt = new Date(Date.now() + expiryDays * 86_400_000).toISOString(); const metadata = await new AccessTokenRepository(databaseFor(this.env), this.auth.tenantId).create({ name, scopes: requested, expiresAt, digest: await accessTokenDigest(token), userId: this.auth.userId, sessionVersion: this.auth.sessionVersion }); if (!metadata) throw new ServiceError(401, "invalid_token", "The owner session is no longer active."); return { ...metadata, token }; } + async listAccessTokens() { await this.authorizeOwnerSession("flows:read"); return publicValue(z.array(accessToken), JSON.parse(JSON.stringify(await new AccessTokenRepository(databaseFor(this.env), this.auth.tenantId).list()))); } + async createAccessToken(input: any) { await this.authorizeOwnerSession("flows:write"); const name = typeof input?.name === "string" ? input.name.trim() : "", requested: string[] = Array.isArray(input?.scopes) ? [...new Set(input.scopes.filter((scope: unknown): scope is string => typeof scope === "string"))] : [], expiryDays = Number(input?.expiryDays); if (!name || name.length > 100 || !requested.length || requested.some(scope => !ACCESS_SCOPES.includes(scope as any)) || ![7, 30, 90].includes(expiryDays)) throw new ServiceError(400, "invalid_request", "A name, supported scopes, and expiryDays of 7, 30, or 90 are required."); const token = issueAccessToken(this.auth.tenantId), expiresAt = new Date(Date.now() + expiryDays * 86_400_000).toISOString(); const metadata = await new AccessTokenRepository(databaseFor(this.env), this.auth.tenantId).create({ name, scopes: requested, expiresAt, digest: await accessTokenDigest(token), userId: this.auth.userId, sessionVersion: this.auth.sessionVersion }); if (!metadata) throw new ServiceError(401, "invalid_token", "The owner session is no longer active."); return publicValue(createdAccessToken, JSON.parse(JSON.stringify({ ...metadata, token }))); } async revokeAccessToken(id: string) { await this.authorizeOwnerSession("flows:write"); if (!await new AccessTokenRepository(databaseFor(this.env), this.auth.tenantId).revoke(id)) throw new ServiceError(404, "not_found", "Access token not found"); return { revoked: true }; } } diff --git a/packages/app/src/github-issue-matcher.ts b/packages/api/src/github-issue-matcher.ts similarity index 100% rename from packages/app/src/github-issue-matcher.ts rename to packages/api/src/github-issue-matcher.ts diff --git a/packages/app/src/github.ts b/packages/api/src/github.ts similarity index 100% rename from packages/app/src/github.ts rename to packages/api/src/github.ts diff --git a/packages/app/src/harness-diagnostics.ts b/packages/api/src/harness-diagnostics.ts similarity index 100% rename from packages/app/src/harness-diagnostics.ts rename to packages/api/src/harness-diagnostics.ts diff --git a/packages/app/src/index.ts b/packages/api/src/index.ts similarity index 75% rename from packages/app/src/index.ts rename to packages/api/src/index.ts index 5f5052f4..305c1e63 100644 --- a/packages/app/src/index.ts +++ b/packages/api/src/index.ts @@ -1,9 +1,10 @@ +import { STATIC_CSP, staticApp } from "./static-app"; import { Hono } from "hono"; import { deleteCookie, getCookie, setCookie } from "hono/cookie"; -import { parse } from "hono/utils/cookie"; +import { readSession, signSession, type Session } from "./session"; +export { readSession, signSession, requestCookie, type Session } from "./session"; import { equalHmac, hmac } from "./crypto"; import { createAppJwt, githubHeaders, readSetupState, signSetupState } from "./github"; -import { apiKeysSettingsPage, authPage, jobDetailPage, jobPage, jobsPage, jobRunPage, landingPage, loginPage, settingsPage } from "./ui"; import type { Env } from "./types"; import { databaseFor } from "./postgres/database"; import { AuthRepository } from "./postgres/auth-repository"; @@ -12,17 +13,15 @@ import { ConnectionRepository } from "./postgres/connection-repository"; import { GitHubRepository } from "./postgres/github-repository"; import { WebhookService } from "./postgres/webhook-service"; -const app = new Hono<{ Bindings: Env; Variables: { cspNonce: string; authorizationDuration: number } }>(); +const app = new Hono<{ Bindings: Env; Variables: { authorizationDuration: number } }>(); app.use("*", async (c, next) => { const started = performance.now(); c.set("authorizationDuration", 0); - const nonce = crypto.randomUUID(); - c.set("cspNonce", nonce); await next(); const authorizationDuration = c.get("authorizationDuration"); c.header("Server-Timing", `auth;dur=${authorizationDuration.toFixed(1)}, application;dur=${Math.max(0, performance.now() - started - authorizationDuration).toFixed(1)}`); - c.header("Content-Security-Policy", `default-src 'self'; script-src 'nonce-${nonce}'; style-src 'self'; img-src 'self' data:; connect-src 'self'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'`); + c.header("Content-Security-Policy", STATIC_CSP); // Keep Origin on same-origin form POSTs; no-referrer makes it "null" in // browsers and breaks the auth CSRF check. External requests still omit Referer. c.header("Referrer-Policy", "same-origin"); @@ -44,23 +43,6 @@ app.onError((error, c) => { return c.text("Internal Server Error", 500); }); -export type Session = { tenantId: string; userId: string; email: string; exp: number; sessionVersion: number }; -const textEncoder = new TextEncoder(); - -function b64(value: string): string { return btoa(String.fromCharCode(...textEncoder.encode(value))).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", ""); } -function unb64(value: string): string { const padded = value.replaceAll("-", "+").replaceAll("_", "/") + "===".slice((value.length + 3) % 4); return new TextDecoder().decode(Uint8Array.from(atob(padded), (char) => char.charCodeAt(0))); } -export async function signSession(session: Session, secret: string): Promise { const body = b64(JSON.stringify(session)); return `${body}.${await hmac(body, secret)}`; } -export async function readSession(value: string | undefined, secret: string): Promise { - if (!value) return null; - const [body, signature] = value.split("."); - if (!body || !signature || signature !== await hmac(body, secret)) return null; - try { const session = JSON.parse(unb64(body)) as Session; return session.exp > Math.floor(Date.now() / 1000) ? session : null; } catch { return null; } -} -export const requestCookie = (request: Request, name: string) => { - const header = request.headers.get("Cookie"); - return header ? parse(header, name)[name] : undefined; -}; - async function authIdentity(c: any, path: string, input: Record) { const auth = new AuthRepository(databaseFor(c.env), c.env); const result = path === "/signup" ? await auth.signup(input) : path === "/login" ? await auth.login(input) : path === "/reset/request" ? await auth.requestReset(input) : await auth.completeReset(input); @@ -83,7 +65,6 @@ async function owner(c: any): Promise { } finally { c.set("authorizationDuration", (c.get("authorizationDuration") ?? 0) + performance.now() - started); } } -app.get("/styles.css", (c) => c.env.ASSETS.fetch(c.req.raw)); app.get("/healthz", (c) => c.json({ ok: true })); app.get("/auth/linear", async (c) => { @@ -124,29 +105,26 @@ app.post("/auth/logout", async (c) => { return c.redirect("/"); }); -app.post("/auth/signup", async (c) => { const input = await c.req.parseBody(); const result = await authIdentity(c, "/signup", input as Record); return c.html(render(authPage(result.response.ok ? "Check your email to verify your account" : "Create your Factorize account", result.response.ok ? "verify-request" : "signup", "", result.body.error), c.get("cspNonce")), result.response.status as any); }); -app.post("/auth/login", async (c) => { const input = await c.req.parseBody(); const result = await authIdentity(c, "/login", input as Record); if (!result.response.ok) return c.html(render(authPage("Sign in", "login", String(input.email ?? ""), result.body.error), c.get("cspNonce")), result.response.status as any); if (!await establishSession(c, result.body)) return c.text("This account cannot access the tenant", 403); const oauthReturn = getCookie(c, "factorize_oauth_return"); +app.post("/auth/signup", async (c) => { const input = await c.req.parseBody(); const result = await authIdentity(c, "/signup", input as Record); return c.text(result.response.ok ? "Check your email for the next step." : "The request could not be completed. Try again.", result.response.status as any); }); +app.post("/auth/login", async (c) => { const input = await c.req.parseBody(); const result = await authIdentity(c, "/login", input as Record); if (!result.response.ok) return c.text("The request could not be completed. Return to the sign-in page and try again.", result.response.status as any); if (!await establishSession(c, result.body)) return c.text("This account cannot access the tenant", 403); const oauthReturn = getCookie(c, "factorize_oauth_return"); if (oauthReturn?.startsWith("/authorize?") || oauthReturn?.startsWith("/device")) { deleteCookie(c, "factorize_oauth_return", { path: "/" }); return c.redirect(oauthReturn, 303); } return c.redirect("/settings/integrations", 303); }); -app.post("/auth/password-reset", async (c) => { const input = await c.req.parseBody(); const result = await authIdentity(c, "/reset/request", input as Record); return c.html(render(authPage("Check your email", "reset", "", result.body.error), c.get("cspNonce")), result.response.status as any); }); -app.post("/auth/password-reset/complete", async (c) => { const input = await c.req.parseBody(); const result = await authIdentity(c, "/reset/complete", input as Record); return result.response.ok ? c.redirect("/auth/login", 303) : c.html(render(authPage("Reset password", "complete", String(input.token ?? ""), result.body.error), c.get("cspNonce")), result.response.status as any); }); +app.post("/auth/password-reset", async (c) => { const input = await c.req.parseBody(); const result = await authIdentity(c, "/reset/request", input as Record); return c.text(result.response.ok ? "Check your email for the next step." : "The request could not be completed. Try again.", result.response.status as any); }); +app.post("/auth/password-reset/complete", async (c) => { const input = await c.req.parseBody(); const result = await authIdentity(c, "/reset/complete", input as Record); return result.response.ok ? c.redirect("/auth/login", 303) : c.text("The request could not be completed. Return to the sign-in page and try again.", result.response.status as any); }); -app.get("/auth/verify", (c) => c.html(render(authPage("Verify your email", "verify", c.req.query("token") ?? ""), c.get("cspNonce")))); app.post("/auth/verify", async (c) => { const input = await c.req.parseBody(); const result = await new AuthRepository(databaseFor(c.env), c.env).completeVerification(String(input.token ?? "")); - return result.status === 200 ? c.redirect("/auth/login", 303) : c.html(render(authPage("Verify your email", "verify-request", "", "The verification link is invalid or expired. Request a new one."), c.get("cspNonce")), 400); + return result.status === 200 ? c.redirect("/auth/login", 303) : c.text("The request could not be completed. Return to the sign-in page and try again.", 400); }); app.post("/auth/verify/request", async (c) => { const result = await new AuthRepository(databaseFor(c.env), c.env).requestEmail(await c.req.parseBody(), "verify"); - return c.html(render(authPage("Check your email", "verify-request"), c.get("cspNonce")), result.status as any); + return c.text(result.status === 202 ? "Check your email for the next step." : "The request could not be completed. Try again.", result.status as any); }); -app.get("/auth/verify/request", (c) => c.html(render(authPage("Resend verification email", "verify-request"), c.get("cspNonce")))); -app.get("/settings/password", async (c) => await owner(c) ? c.html(render(authPage("Change password", "change"), c.get("cspNonce"))) : c.redirect("/auth/login")); app.post("/auth/password-change", async (c) => { const session = await owner(c); if (!session) return c.text("Unauthorized", 401); const result = await new AuthRepository(databaseFor(c.env), c.env).changePassword(session.userId, await c.req.parseBody()); - if (result.status !== 200) return c.html(render(authPage("Change password", "change", "", "error" in result.body ? result.body.error : ""), c.get("cspNonce")), result.status as any); + if (result.status !== 200) return c.text("The request could not be completed. Return to the sign-in page and try again.", result.status as any); deleteCookie(c, "factorize_session", { path: "/" }); return c.redirect("/auth/login", 303); }); @@ -256,25 +234,8 @@ app.post("/webhooks/github", async (c) => { await new WebhookService(databaseFor(c.env), c.env, registration.tenant_id).github(event, `github:${delivery}`, eventName); return c.body(null, 202); }); -const render = (page: string, nonce: string) => page.replaceAll(" + + diff --git a/packages/app/package.json b/packages/app/package.json index 7adec6f9..2c3a8345 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,50 +1,30 @@ { - "name": "factorize", + "name": "factorize-app", "version": "0.1.0", "private": true, "type": "module", "scripts": { - "dev": "npm run build:css && wrangler dev", - "build:css": "tailwindcss -i ./src/tailwind.css -o ./public/styles.css --minify", - "check": "npm run check:openapi && npm run check:api-boundaries && node --test scripts/validate-auth-email.check.mjs && tsc --noEmit && vitest run && wrangler deploy --dry-run", - "check:api-boundaries": "node scripts/check-api-boundaries.mjs", - "test": "vitest run", - "deploy": "wrangler deploy", - "benchmark:loading": "vitest run --config scripts/loading-baseline.config.ts", - "db:migrate": "node scripts/migrate.mjs", - "db:verify": "node scripts/verify-schema.mjs", - "db:studio": "drizzle-kit studio --config drizzle.config.ts", - "auth:validate-email": "node scripts/validate-auth-email.mjs", - "generate:openapi": "tsx scripts/generate-openapi.ts", - "check:openapi": "tsx scripts/generate-openapi.ts --check" + "dev": "vite --host 0.0.0.0", + "build": "tsc --noEmit && vite build", + "check": "npm run build && npm test", + "test": "node --test test/*.test.mjs" }, "dependencies": { - "@cloudflare/workers-oauth-provider": "^0.10.3", - "@modelcontextprotocol/hono": "^2.0.0", - "@modelcontextprotocol/server": "^2.0.0", - "cron-parser": "^5.10.1", - "drizzle-orm": "^0.45.2", - "hono": "^4.11.4", - "mustache": "^4.2.0", - "pg": "8.16.3", - "zod": "^4.6.2" + "@tanstack/react-query": "5.104.1", + "@tanstack/react-router": "1.170.41", + "@tanstack/react-virtual": "^3.14.14", + "factorize-api-client": "0.1.0", + "react": "19.3.0", + "react-dom": "19.3.0", + "react-markdown": "^10.1.0" }, "devDependencies": { - "@cloudflare/vitest-pool-workers": "^0.10.10", - "@cloudflare/workers-types": "^5.20260910.1", - "@tailwindcss/cli": "^4.1.14", - "@types/mustache": "^4.2.6", - "@types/node": "^26.5.1", - "@types/pg": "^8.15.5", - "ajv": "^8.20.0", - "drizzle-kit": "^0.31.10", - "happy-dom": "^20.14.5", + "@tailwindcss/vite": "4.3.3", + "@types/react": "^19.2.0", + "@types/react-dom": "^19.2.0", "playwright": "^1.64.0", - "tailwindcss": "^4.1.14", - "tsx": "^4.23.15", + "tailwindcss": "4.3.3", "typescript": "^5.9.3", - "vitest": "^3.2.4", - "wrangler": "^4.44.0", - "yaml": "^2.9.1" + "vite": "8.3.4" } } diff --git a/packages/app/public/styles.css b/packages/app/public/styles.css deleted file mode 100644 index 71fda048..00000000 --- a/packages/app/public/styles.css +++ /dev/null @@ -1,2 +0,0 @@ -/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-800:oklch(47% .157 37.304);--color-orange-950:oklch(26.6% .079 36.259);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-green-950:oklch(26.6% .065 152.934);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-blue-950:oklch(28.2% .091 267.935);--color-slate-100:#f5f1e8;--color-slate-200:#e7e1d4;--color-slate-300:#cec5b4;--color-slate-400:#9b9282;--color-slate-500:#71695e;--color-slate-600:#575047;--color-slate-700:#403b34;--color-slate-800:#2c2924;--color-slate-900:#201e1a;--color-slate-950:#151410;--color-stone-50:#fcfbf6;--color-stone-100:#f6f3e9;--color-stone-200:#e6e0d1;--color-stone-300:#d4cbb9;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-factorize-50:#fff9e6;--color-factorize-100:#fff0b8;--color-factorize-500:#fdc901;--color-factorize-600:#896300;--color-factorize-700:#705000}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{scrollbar-gutter:stable}body>main{flex:1;width:100%;min-width:0}body>footer{padding-bottom:calc(1.5rem + env(safe-area-inset-bottom))}}@layer components{.field{margin-top:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-slate-300);background-color:var(--color-white);width:100%;min-width:0;max-width:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2.5);color:var(--color-slate-950);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-outline-style:none;outline-style:none}.field::placeholder{color:var(--color-slate-400)}.field:focus{border-color:var(--color-factorize-500);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:#fdc90126}@supports (color:color-mix(in lab, red, red)){.field:focus{--tw-ring-color:color-mix(in oklab, var(--color-factorize-500) 15%, transparent)}}.field:where(.dark,.dark *){border-color:var(--color-slate-700);background-color:var(--color-slate-950);color:var(--color-white)}.field:where(.dark,.dark *)::placeholder{color:var(--color-slate-500)}select.field:not([multiple]){appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23575047' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .75rem center;background-repeat:no-repeat;background-size:1.25rem 1.25rem;padding-right:2.75rem}.dark select.field:not([multiple]){background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23cec5b4' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E")}.label{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-slate-700);display:block}.label:where(.dark,.dark *){color:var(--color-slate-300)}.template-editor{min-width:0;max-width:100%;position:relative}.template-editor textarea,.template-editor pre{scrollbar-gutter:stable;white-space:pre-wrap;overflow-wrap:break-word;min-height:11rem;font-family:var(--font-mono);font-size:var(--text-sm);tab-size:4;margin:0;padding:.625rem .75rem;line-height:1.25rem;overflow:auto}.template-editor pre{pointer-events:none;color:var(--color-slate-950);border:1px solid #0000;position:absolute;inset:0}.template-editor textarea{resize:vertical;color:#0000;caret-color:var(--color-slate-950);-webkit-text-fill-color:transparent;background-color:#0000;position:relative}.template-editor textarea::placeholder{color:var(--color-slate-400);-webkit-text-fill-color:var(--color-slate-400)}.template-delimiter{color:var(--color-factorize-600);font-weight:700}.template-expression{color:#2563eb}.dark .template-editor pre{color:var(--color-slate-100)}.dark .template-editor textarea{caret-color:var(--color-slate-100)}.dark .template-delimiter{color:var(--color-factorize-500)}.dark .template-expression{color:#93c5fd}.navbar-bee{transition:filter .15s}.dark .navbar-bee{filter:invert()}.landing-honeycomb{background-color:var(--color-stone-50);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='520' viewBox='0 0 720 520'%3E%3Cg transform='rotate(-7 360 260)' fill='none' stroke='%23705000' stroke-opacity='.07' stroke-width='1.5'%3E%3Cpath d='M25 140 87.5 31.75h125L275 140l-62.5 108.25h-125zM385 380l62.5-108.25h125L635 380l-62.5 108.25h-125z'/%3E%3C/g%3E%3C/svg%3E");background-position:top;background-size:720px 520px}.dark .landing-honeycomb{background-color:var(--color-slate-950);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='520' viewBox='0 0 720 520'%3E%3Cg transform='rotate(-7 360 260)' fill='none' stroke='%23fdc901' stroke-opacity='.05' stroke-width='1.5'%3E%3Cpath d='M25 140 87.5 31.75h125L275 140l-62.5 108.25h-125zM385 380l62.5-108.25h125L635 380l-62.5 108.25h-125z'/%3E%3C/g%3E%3C/svg%3E")}dialog[id$=-setup]{max-height:calc(100dvh - 2rem);margin:auto;overflow-y:auto}#trigger-dialog{width:min(44rem,100vw - 2rem);max-width:calc(100vw - 2rem)}#trigger-dialog>form,#trigger-dialog>form>div{min-width:0;max-width:100%}#trigger-rows td{overflow-wrap:anywhere}@media (min-width:40rem){div:has(>label>select[name=agentKind]){grid-template-columns:max-content minmax(0,1fr)}div:has(>label>select[name=agentKind])>label:first-child{width:11rem}}.trace-list{--trace-surface:#f6f3e9;--trace-border:#e6e0d1;--trace-muted:#71695e;--trace-accent:#705000;--trace-code:#fcfbf6;color:#201e1a}.dark .trace-list{--trace-surface:#2c2924;--trace-border:#403b34;--trace-muted:#b2a897;--trace-accent:#f4d36c;--trace-code:#151410;color:#f5f1e8}.trace-list>*+*{margin-top:1rem}.trace-message{min-width:0;padding:1rem 0}.trace-message h3{color:var(--trace-accent);letter-spacing:.08em;text-transform:uppercase;margin-bottom:.65rem;font-size:.7rem;font-weight:700}.trace-user_message{border-left:3px solid var(--trace-accent);background:var(--trace-surface);border-radius:0 .6rem .6rem 0;padding:1rem 1.25rem}.trace-prose{overflow-wrap:anywhere;font-size:.875rem;line-height:1.75}.trace-line{white-space:pre-wrap}.trace-prose h4{margin:.75rem 0 .25rem;font-weight:700}.trace-prose code{background:var(--trace-surface);border-radius:.25rem;padding:.1rem .3rem;font-size:.85em}.trace-bullet{padding-left:1.25rem;position:relative}.trace-bullet:before{content:"•";color:var(--trace-muted);position:absolute;left:.25rem}.trace-event,.trace-structured{border:1px solid var(--trace-border);border-radius:.6rem;min-width:0;overflow:hidden}.trace-event summary,.trace-structured summary{cursor:pointer;overflow-wrap:anywhere;padding:.75rem 1rem;font-size:.8rem}.trace-event summary:focus-visible,.trace-structured summary:focus-visible{outline:2px solid var(--trace-accent);outline-offset:-2px}.trace-event summary{background:var(--trace-surface)}.trace-event-kind{color:var(--trace-muted);text-transform:uppercase;letter-spacing:.04em;margin-right:.75rem;font-size:.65rem;display:inline-block}.trace-meta{border-style:dashed}.trace-error{border-color:#dc2626}.trace-warning{border-color:#b7791f}.trace-structured{margin:.75rem 0}.trace-structured>div{padding:0 1rem 1rem}.trace-code{background:var(--trace-code);min-width:0}.trace-prose .trace-code{border:1px solid var(--trace-border);border-radius:.5rem;margin:.75rem 0;overflow:hidden}.trace-code-label{border-bottom:1px solid var(--trace-border);color:var(--trace-muted);font:600 .65rem var(--font-mono);padding:.4rem 1rem}.trace-code pre{white-space:pre;max-height:24rem;font:.75rem/1.7 var(--font-mono);tab-size:2;margin:0;padding:1rem;overflow:auto}.trace-code code{font-size:inherit;background:0 0;padding:0}.trace-token-keyword{color:#7e22ce}.trace-token-string{color:#166534}.trace-token-comment{color:#71695e;font-style:italic}.trace-token-number,.trace-token-variable{color:#075985}.dark .trace-token-keyword{color:#d8b4fe}.dark .trace-token-string{color:#86efac}.dark .trace-token-comment{color:#b2a897}.dark .trace-token-number,.dark .trace-token-variable{color:#7dd3fc}.trace-thinking{color:var(--trace-muted);align-items:center;gap:.5rem;padding:.25rem 0;font-size:.8rem;display:flex}.trace-spinner{border:2px solid var(--trace-border);border-top-color:var(--trace-accent);border-radius:50%;width:.8rem;height:.8rem}.trace-activity[hidden]{display:none}.trace-activity:not([hidden]) .trace-spinner{animation:1s linear infinite trace-spin}@keyframes trace-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.trace-activity:not([hidden]) .trace-spinner{animation:none}}}@layer utilities{.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-y-0{inset-block:0}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-5{top:calc(var(--spacing) * 5)}.top-full{top:100%}.right-0{right:0}.right-2\.5{right:calc(var(--spacing) * 2.5)}.right-3{right:calc(var(--spacing) * 3)}.right-5{right:calc(var(--spacing) * 5)}.z-20{z-index:20}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-0{margin-top:0}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-9{margin-top:calc(var(--spacing) * 9)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mt-24{margin-top:calc(var(--spacing) * 24)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-16{height:calc(var(--spacing) * 16)}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[70vh\]{max-height:70vh}.max-h-\[min\(60vh\,32rem\)\]{max-height:min(60vh,32rem)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-11{min-height:calc(var(--spacing) * 11)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-24{min-height:calc(var(--spacing) * 24)}.min-h-32{min-height:calc(var(--spacing) * 32)}.min-h-36{min-height:calc(var(--spacing) * 36)}.min-h-44{min-height:calc(var(--spacing) * 44)}.min-h-\[100dvh\]{min-height:100dvh}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-\[min\(32rem\,calc\(100vw-4rem\)\)\]{width:min(32rem,100vw - 4rem)}.w-\[min\(34rem\,calc\(100\%-2rem\)\)\]{width:min(34rem,100% - 2rem)}.w-\[min\(42rem\,calc\(100\%-2rem\)\)\]{width:min(42rem,100% - 2rem)}.w-\[min\(42rem\,calc\(100vw-2rem\)\)\]{width:min(42rem,100vw - 2rem)}.w-\[min\(44rem\,calc\(100\%-2rem\)\)\]{width:min(44rem,100% - 2rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-36{min-width:calc(var(--spacing) * 36)}.min-w-\[48rem\]{min-width:48rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:var(--spacing)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-stone-200>:not(:last-child)){border-color:var(--color-stone-200)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-xl{border-top-left-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.rounded-r-xl{border-top-right-radius:var(--radius-xl);border-bottom-right-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-amber-300{border-color:var(--color-amber-300)}.border-amber-400{border-color:var(--color-amber-400)}.border-red-200{border-color:var(--color-red-200)}.border-slate-950\/20{border-color:#15141033}@supports (color:color-mix(in lab, red, red)){.border-slate-950\/20{border-color:color-mix(in oklab, var(--color-slate-950) 20%, transparent)}}.border-stone-200{border-color:var(--color-stone-200)}.border-stone-300{border-color:var(--color-stone-300)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-factorize-50{background-color:var(--color-factorize-50)}.bg-factorize-100{background-color:var(--color-factorize-100)}.bg-factorize-500{background-color:var(--color-factorize-500)}.bg-green-100{background-color:var(--color-green-100)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-950{background-color:var(--color-slate-950)}.bg-stone-50{background-color:var(--color-stone-50)}.bg-stone-100{background-color:var(--color-stone-100)}.bg-stone-200{background-color:var(--color-stone-200)}.bg-stone-300{background-color:var(--color-stone-300)}.bg-white{background-color:var(--color-white)}.object-contain{object-fit:contain}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-1{padding-top:var(--spacing)}.pr-28{padding-right:calc(var(--spacing) * 28)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-8{--tw-leading:calc(var(--spacing) * 8);line-height:calc(var(--spacing) * 8)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-amber-950{color:var(--color-amber-950)}.text-blue-800{color:var(--color-blue-800)}.text-factorize-600{color:var(--color-factorize-600)}.text-factorize-700{color:var(--color-factorize-700)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-orange-800{color:var(--color-orange-800)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-slate-100{color:var(--color-slate-100)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-950{color:var(--color-slate-950)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.decoration-slate-400\/60{text-decoration-color:#9b928299}@supports (color:color-mix(in lab, red, red)){.decoration-slate-400\/60{-webkit-text-decoration-color:color-mix(in oklab, var(--color-slate-400) 60%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-slate-400) 60%, transparent);text-decoration-color:color-mix(in oklab, var(--color-slate-400) 60%, transparent)}}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.\[color-scheme\:light\]{color-scheme:light}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-blue-200{--tw-ring-color:var(--color-blue-200)}.ring-stone-200{--tw-ring-color:var(--color-stone-200)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.group-hover\:border-factorize-500:is(:where(.group):hover *){border-color:var(--color-factorize-500)}.group-hover\:text-slate-950:is(:where(.group):hover *){color:var(--color-slate-950)}}.backdrop\:bg-slate-950\/50::backdrop{background-color:#15141080}@supports (color:color-mix(in lab, red, red)){.backdrop\:bg-slate-950\/50::backdrop{background-color:color-mix(in oklab, var(--color-slate-950) 50%, transparent)}}.backdrop\:bg-slate-950\/60::backdrop{background-color:#15141099}@supports (color:color-mix(in lab, red, red)){.backdrop\:bg-slate-950\/60::backdrop{background-color:color-mix(in oklab, var(--color-slate-950) 60%, transparent)}}@media (hover:hover){.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-stone-300:hover{border-color:var(--color-stone-300)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-slate-800:hover{background-color:var(--color-slate-800)}.hover\:bg-stone-50:hover{background-color:var(--color-stone-50)}.hover\:bg-stone-100:hover{background-color:var(--color-stone-100)}.hover\:text-factorize-700:hover{color:var(--color-factorize-700)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:text-slate-500:hover{color:var(--color-slate-500)}.hover\:text-slate-700:hover{color:var(--color-slate-700)}.hover\:text-slate-950:hover{color:var(--color-slate-950)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:ring-factorize-600:focus{--tw-ring-color:var(--color-factorize-600)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-factorize-500:focus-visible{--tw-ring-color:var(--color-factorize-500)}.focus-visible\:ring-factorize-600:focus-visible{--tw-ring-color:var(--color-factorize-600)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-color:var(--color-red-500)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.aria-\[current\=page\]\:bg-stone-100[aria-current=page]{background-color:var(--color-stone-100)}.aria-\[current\=page\]\:font-semibold[aria-current=page]{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.aria-\[current\=page\]\:text-slate-950[aria-current=page]{color:var(--color-slate-950)}.aria-\[current\=page\]\:underline[aria-current=page]{text-decoration-line:underline}.aria-\[current\=page\]\:underline-offset-8[aria-current=page]{text-underline-offset:8px}@media (min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:mt-2{margin-top:calc(var(--spacing) * 2)}.sm\:mt-5{margin-top:calc(var(--spacing) * 5)}.sm\:mt-8{margin-top:calc(var(--spacing) * 8)}.sm\:inline{display:inline}.sm\:w-56{width:calc(var(--spacing) * 56)}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[8rem_minmax\(0\,1fr\)\]{grid-template-columns:8rem minmax(0,1fr)}.sm\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.sm\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1\.4fr\)_auto\]{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) auto}.sm\:flex-row{flex-direction:row}.sm\:items-end{align-items:flex-end}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:p-8{padding:calc(var(--spacing) * 8)}.sm\:p-10{padding:calc(var(--spacing) * 10)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:py-3{padding-block:calc(var(--spacing) * 3)}.sm\:py-12{padding-block:calc(var(--spacing) * 12)}.sm\:py-28{padding-block:calc(var(--spacing) * 28)}.sm\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.sm\:text-7xl{font-size:var(--text-7xl);line-height:var(--tw-leading,var(--text-7xl--line-height))}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:48rem){.md\:mb-1{margin-bottom:var(--spacing)}.md\:block{display:block}.md\:grid-cols-\[13rem_minmax\(0\,1fr\)\]{grid-template-columns:13rem minmax(0,1fr)}.md\:gap-10{gap:calc(var(--spacing) * 10)}.md\:border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.md\:pb-0{padding-bottom:0}}@media (min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:px-8{padding-inline:calc(var(--spacing) * 8)}}:where(.dark\:divide-slate-800:where(.dark,.dark *)>:not(:last-child)){border-color:var(--color-slate-800)}.dark\:border-amber-700:where(.dark,.dark *){border-color:var(--color-amber-700)}.dark\:border-amber-800:where(.dark,.dark *){border-color:var(--color-amber-800)}.dark\:border-red-900:where(.dark,.dark *){border-color:var(--color-red-900)}.dark\:border-slate-700:where(.dark,.dark *){border-color:var(--color-slate-700)}.dark\:border-slate-800:where(.dark,.dark *){border-color:var(--color-slate-800)}.dark\:bg-amber-950:where(.dark,.dark *){background-color:var(--color-amber-950)}.dark\:bg-amber-950\/30:where(.dark,.dark *){background-color:#4619014d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-950\/30:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-amber-950) 30%, transparent)}}.dark\:bg-blue-950:where(.dark,.dark *){background-color:var(--color-blue-950)}.dark\:bg-factorize-500\/20:where(.dark,.dark *){background-color:#fdc90133}@supports (color:color-mix(in lab, red, red)){.dark\:bg-factorize-500\/20:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-factorize-500) 20%, transparent)}}.dark\:bg-factorize-500\/50:where(.dark,.dark *){background-color:#fdc90180}@supports (color:color-mix(in lab, red, red)){.dark\:bg-factorize-500\/50:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-factorize-500) 50%, transparent)}}.dark\:bg-green-950:where(.dark,.dark *){background-color:var(--color-green-950)}.dark\:bg-orange-950:where(.dark,.dark *){background-color:var(--color-orange-950)}.dark\:bg-red-950:where(.dark,.dark *){background-color:var(--color-red-950)}.dark\:bg-red-950\/40:where(.dark,.dark *){background-color:#46080966}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-950\/40:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-red-950) 40%, transparent)}}.dark\:bg-slate-600:where(.dark,.dark *){background-color:var(--color-slate-600)}.dark\:bg-slate-700:where(.dark,.dark *){background-color:var(--color-slate-700)}.dark\:bg-slate-800:where(.dark,.dark *){background-color:var(--color-slate-800)}.dark\:bg-slate-900:where(.dark,.dark *){background-color:var(--color-slate-900)}.dark\:bg-slate-950:where(.dark,.dark *){background-color:var(--color-slate-950)}.dark\:bg-white:where(.dark,.dark *){background-color:var(--color-white)}.dark\:text-amber-100:where(.dark,.dark *){color:var(--color-amber-100)}.dark\:text-amber-200:where(.dark,.dark *){color:var(--color-amber-200)}.dark\:text-amber-300:where(.dark,.dark *){color:var(--color-amber-300)}.dark\:text-blue-200:where(.dark,.dark *){color:var(--color-blue-200)}.dark\:text-factorize-100:where(.dark,.dark *){color:var(--color-factorize-100)}.dark\:text-green-200:where(.dark,.dark *){color:var(--color-green-200)}.dark\:text-green-300:where(.dark,.dark *){color:var(--color-green-300)}.dark\:text-orange-200:where(.dark,.dark *){color:var(--color-orange-200)}.dark\:text-red-200:where(.dark,.dark *){color:var(--color-red-200)}.dark\:text-red-300:where(.dark,.dark *){color:var(--color-red-300)}.dark\:text-slate-100:where(.dark,.dark *){color:var(--color-slate-100)}.dark\:text-slate-200:where(.dark,.dark *){color:var(--color-slate-200)}.dark\:text-slate-300:where(.dark,.dark *){color:var(--color-slate-300)}.dark\:text-slate-400:where(.dark,.dark *){color:var(--color-slate-400)}.dark\:text-slate-500:where(.dark,.dark *){color:var(--color-slate-500)}.dark\:text-slate-950:where(.dark,.dark *){color:var(--color-slate-950)}.dark\:text-white:where(.dark,.dark *){color:var(--color-white)}.dark\:decoration-slate-500\/60:where(.dark,.dark *){text-decoration-color:#71695e99}@supports (color:color-mix(in lab, red, red)){.dark\:decoration-slate-500\/60:where(.dark,.dark *){-webkit-text-decoration-color:color-mix(in oklab, var(--color-slate-500) 60%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-slate-500) 60%, transparent);text-decoration-color:color-mix(in oklab, var(--color-slate-500) 60%, transparent)}}.dark\:\[color-scheme\:dark\]:where(.dark,.dark *){color-scheme:dark}.dark\:ring-blue-900:where(.dark,.dark *){--tw-ring-color:var(--color-blue-900)}.dark\:ring-slate-800:where(.dark,.dark *){--tw-ring-color:var(--color-slate-800)}@media (hover:hover){.dark\:hover\:border-slate-700:where(.dark,.dark *):hover{border-color:var(--color-slate-700)}.dark\:hover\:bg-red-950\/50:where(.dark,.dark *):hover{background-color:#46080980}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-red-950\/50:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-red-950) 50%, transparent)}}.dark\:hover\:bg-slate-200:where(.dark,.dark *):hover{background-color:var(--color-slate-200)}.dark\:hover\:bg-slate-800:where(.dark,.dark *):hover{background-color:var(--color-slate-800)}.dark\:hover\:text-red-300:where(.dark,.dark *):hover{color:var(--color-red-300)}.dark\:hover\:text-slate-200:where(.dark,.dark *):hover{color:var(--color-slate-200)}.dark\:hover\:text-white:where(.dark,.dark *):hover{color:var(--color-white)}}.dark\:focus-visible\:ring-offset-slate-900:where(.dark,.dark *):focus-visible{--tw-ring-offset-color:var(--color-slate-900)}.dark\:focus-visible\:ring-offset-slate-950:where(.dark,.dark *):focus-visible{--tw-ring-offset-color:var(--color-slate-950)}.dark\:aria-\[current\=page\]\:bg-slate-800:where(.dark,.dark *)[aria-current=page]{background-color:var(--color-slate-800)}.dark\:aria-\[current\=page\]\:text-white:where(.dark,.dark *)[aria-current=page]{color:var(--color-white)}.\[\&\:\:-webkit-details-marker\]\:hidden::-webkit-details-marker{display:none}.\[\&\>a\]\:w-full>a,.\[\&\>button\]\:w-full>button{width:100%}#job-detail>div.mt-6>div:last-child>:is(button,a){border-radius:.5rem;min-height:2.5rem;padding:.5rem .75rem}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0} \ No newline at end of file diff --git a/packages/app/src/ansi.ts b/packages/app/src/ansi.ts deleted file mode 100644 index f1bc990d..00000000 --- a/packages/app/src/ansi.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** Convert terminal SGR styling to safe HTML. All emitted markup is generated here. */ -export function ansiToHtml(input: unknown): string { - const palette = ["#0f172a", "#ef4444", "#22c55e", "#eab308", "#3b82f6", "#d946ef", "#06b6d4", "#e2e8f0", "#64748b", "#f87171", "#4ade80", "#facc15", "#60a5fa", "#e879f9", "#22d3ee", "#f8fafc"]; - const escape = (value: string) => value.replace(/[&<>"']/g, char => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[char]!); - const color = (value: number) => { - if (value < 16) return palette[value]; - if (value < 232) { - const offset = value - 16, levels = [0, 95, 135, 175, 215, 255]; - return `rgb(${levels[Math.floor(offset / 36)]},${levels[Math.floor(offset / 6) % 6]},${levels[offset % 6]})`; - } - const gray = 8 + (value - 232) * 10; - return `rgb(${gray},${gray},${gray})`; - }; - type Style = { fg?: string; bg?: string; bold?: boolean; dim?: boolean; italic?: boolean; underline?: boolean; inverse?: boolean; hidden?: boolean; strike?: boolean }; - let style: Style = {}, text = "", html = ""; - const flush = () => { - if (!text) return; - let fg = style.fg, bg = style.bg; - if (style.inverse) { const originalFg = fg ?? "#e2e8f0"; fg = bg ?? "#020617"; bg = originalFg; } - const css = [fg && `color:${fg}`, bg && `background-color:${bg}`, style.bold && "font-weight:700", style.dim && "opacity:.65", style.italic && "font-style:italic", style.underline && "text-decoration:underline", style.strike && "text-decoration:line-through", style.hidden && "visibility:hidden"].filter(Boolean).join(";"); - html += css ? `${escape(text)}` : escape(text); - text = ""; - }; - const apply = (parameters: string) => { - const codes = (parameters === "" ? [0] : parameters.split(";").map(value => /^\d+$/.test(value) ? Number(value) : -1)); - for (let index = 0; index < codes.length; index++) { - const code = codes[index]; - if (code === 0) style = {}; - else if (code === 1) style.bold = true; - else if (code === 2) style.dim = true; - else if (code === 3) style.italic = true; - else if (code === 4) style.underline = true; - else if (code === 7) style.inverse = true; - else if (code === 8) style.hidden = true; - else if (code === 9) style.strike = true; - else if (code === 22) { style.bold = false; style.dim = false; } - else if (code === 23) style.italic = false; - else if (code === 24) style.underline = false; - else if (code === 27) style.inverse = false; - else if (code === 28) style.hidden = false; - else if (code === 29) style.strike = false; - else if (code >= 30 && code <= 37) style.fg = color(code - 30); - else if (code >= 40 && code <= 47) style.bg = color(code - 40); - else if (code >= 90 && code <= 97) style.fg = color(code - 90 + 8); - else if (code >= 100 && code <= 107) style.bg = color(code - 100 + 8); - else if (code === 39) delete style.fg; - else if (code === 49) delete style.bg; - else if ((code === 38 || code === 48) && codes[index + 1] === 5 && codes[index + 2] >= 0 && codes[index + 2] <= 255) { - style[code === 38 ? "fg" : "bg"] = color(codes[index + 2]); index += 2; - } else if ((code === 38 || code === 48) && codes[index + 1] === 2 && codes.slice(index + 2, index + 5).every(value => value >= 0 && value <= 255)) { - style[code === 38 ? "fg" : "bg"] = `rgb(${codes[index + 2]},${codes[index + 3]},${codes[index + 4]})`; index += 4; - } - } - }; - const value = String(input ?? ""); - for (let index = 0; index < value.length;) { - if (value[index] !== "\u001b") { text += value[index++]; continue; } - flush(); - if (value[index + 1] === "[") { - let end = index + 2; - while (end < value.length && !/[\x40-\x7e]/.test(value[end])) end++; - if (end >= value.length) break; - if (value[end] === "m" && /^[\d;]*$/.test(value.slice(index + 2, end))) apply(value.slice(index + 2, end)); - index = end + 1; - } else if (value[index + 1] === "]") { - let end = index + 2; - while (end < value.length && value[end] !== "\u0007" && !(value[end] === "\u001b" && value[end + 1] === "\\")) end++; - index = end < value.length ? end + (value[end] === "\u001b" ? 2 : 1) : value.length; - } else index += Math.min(2, value.length - index); - } - flush(); - return html; -} - -/** - * Browser-safe source for the run detail page. - * - * Do not derive this with `ansiToHtml.toString()`: Wrangler/esbuild decorates - * named functions with its private `__name` helper, which is not present in - * the HTML page where the serialized function runs. - */ -export const ansiToHtmlBrowserSource = String.raw`const ansiToHtml=input=>{ - const palette=['#0f172a','#ef4444','#22c55e','#eab308','#3b82f6','#d946ef','#06b6d4','#e2e8f0','#64748b','#f87171','#4ade80','#facc15','#60a5fa','#e879f9','#22d3ee','#f8fafc']; - const escape=value=>value.replace(/[&<>"']/g,char=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[char])); - const color=value=>{if(value<16)return palette[value];if(value<232){const offset=value-16,levels=[0,95,135,175,215,255];return 'rgb('+levels[Math.floor(offset/36)]+','+levels[Math.floor(offset/6)%6]+','+levels[offset%6]+')'}const gray=8+(value-232)*10;return 'rgb('+gray+','+gray+','+gray+')'}; - let style={},text='',html=''; - const flush=()=>{if(!text)return;let fg=style.fg,bg=style.bg;if(style.inverse){const originalFg=fg??'#e2e8f0';fg=bg??'#020617';bg=originalFg}const css=[fg&&'color:'+fg,bg&&'background-color:'+bg,style.bold&&'font-weight:700',style.dim&&'opacity:.65',style.italic&&'font-style:italic',style.underline&&'text-decoration:underline',style.strike&&'text-decoration:line-through',style.hidden&&'visibility:hidden'].filter(Boolean).join(';');html+=css?''+escape(text)+'':escape(text);text=''}; - const apply=parameters=>{const codes=parameters===''?[0]:parameters.split(';').map(value=>/^\d+$/.test(value)?Number(value):-1);for(let index=0;index=30&&code<=37)style.fg=color(code-30);else if(code>=40&&code<=47)style.bg=color(code-40);else if(code>=90&&code<=97)style.fg=color(code-90+8);else if(code>=100&&code<=107)style.bg=color(code-100+8);else if(code===39)delete style.fg;else if(code===49)delete style.bg;else if((code===38||code===48)&&codes[index+1]===5&&codes[index+2]>=0&&codes[index+2]<=255){style[code===38?'fg':'bg']=color(codes[index+2]);index+=2}else if((code===38||code===48)&&codes[index+1]===2&&codes.slice(index+2,index+5).every(value=>value>=0&&value<=255)){style[code===38?'fg':'bg']='rgb('+codes[index+2]+','+codes[index+3]+','+codes[index+4]+')';index+=4}}}; - const value=String(input??'');for(let index=0;index=value.length)break;if(value[end]==='m'&&/^[\d;]*$/.test(value.slice(index+2,end)))apply(value.slice(index+2,end));index=end+1}else if(value[index+1]===']'){let end=index+2;while(end { + const result = await api.POST("/api/v1/auth/logout"); + if (result.error) throw new Error(messageOf(result.error)); + await refreshIdentity(); + }, + }); + if (!session.data?.authenticated) return null; + return ( + + ); +} diff --git a/packages/app/src/features/auth/auth-screen.tsx b/packages/app/src/features/auth/auth-screen.tsx new file mode 100644 index 00000000..0dad3944 --- /dev/null +++ b/packages/app/src/features/auth/auth-screen.tsx @@ -0,0 +1,73 @@ +import { useState, type FormEvent } from "react"; +import { useMutation } from "@tanstack/react-query"; +import { Link, useSearch } from "@tanstack/react-router"; +import { api } from "factorize-api-client"; +import { messageOf, refreshIdentity } from "./session"; + +export type AuthMode = "login" | "signup" | "reset" | "verify" | "verify-request" | "password"; +const titles: Record = { + login: "Sign in to Factorize", signup: "Create your Factorize account", reset: "Reset password", + verify: "Verify your email", "verify-request": "Resend verification email", password: "Change password", +}; +export function AuthScreen({ mode }: { mode: AuthMode }) { + const search = useSearch({ strict: false }) as { token?: string; returnTo?: string }; + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [currentPassword, setCurrentPassword] = useState(""); + const [notice, setNotice] = useState(""); + const resetCompletion = mode === "reset" && Boolean(search.token); + const mutation = useMutation({ + retry: false, + mutationFn: async () => { + let result; + switch (mode) { + case "login": result = await api.POST("/api/v1/auth/login", { body: { email, password, returnTo: search.returnTo } }); break; + case "signup": result = await api.POST("/api/v1/auth/signup", { body: { email, password } }); break; + case "reset": result = resetCompletion + ? await api.POST("/api/v1/auth/password-reset/complete", { body: { token: search.token!, password } }) + : await api.POST("/api/v1/auth/password-reset/request", { body: { email } }); break; + case "verify": result = await api.POST("/api/v1/auth/email-verification/complete", { body: { token: search.token ?? "" } }); break; + case "verify-request": result = await api.POST("/api/v1/auth/email-verification/request", { body: { email } }); break; + case "password": result = await api.POST("/api/v1/auth/password", { body: { currentPassword, password } }); break; + } + if (result.error || !result.data) throw new Error(messageOf(result.error)); + return result.data; + }, + onSuccess: async data => { + setPassword(""); setCurrentPassword(""); + if (mode === "login") { + await refreshIdentity(); + if ("returnTo" in data && typeof data.returnTo === "string") window.location.assign(data.returnTo); + } else if (mode === "password" || resetCompletion) { + await refreshIdentity(); + setNotice("Password updated. Sign in with your new password."); + } else if (mode === "verify") { + setNotice("Your email is verified. You can now sign in."); + } else { + setNotice("If this email can receive the requested link, check your inbox for the next step."); + } + }, + }); + function submit(event: FormEvent) { event.preventDefault(); setNotice(""); mutation.mutate(); } + const showEmail = mode !== "password" && mode !== "verify" && !resetCompletion; + const showPassword = mode === "login" || mode === "signup" || mode === "password" || resetCompletion; + return ( +
+ Factorize +

{titles[mode]}

+
+ {showEmail && } + {mode === "password" && } + {showPassword && <>{mode !== "login" &&

Use 12–200 characters.

}} + {mode === "verify" && !search.token ?

This link has no verification token. Request a new email below.

: } + {mutation.isError &&

{mutation.error.message}

} + {notice &&

{notice}

} +
+ +
+ ); +} diff --git a/packages/app/src/features/auth/consent.tsx b/packages/app/src/features/auth/consent.tsx new file mode 100644 index 00000000..9f80b7b0 --- /dev/null +++ b/packages/app/src/features/auth/consent.tsx @@ -0,0 +1,13 @@ +import { useState } from "react"; +import { useQuery, useMutation } from "@tanstack/react-query"; +import { api } from "factorize-api-client"; +import { messageOf } from "./session"; +export function ConsentScreen() { + const authorizationQuery = location.search.slice(1), [selected, setSelected] = useState(null); + const preview = useQuery({ queryKey: ["consent", authorizationQuery], queryFn: async ({ signal }) => { const { data, error } = await api.POST("/api/v1/oauth/consent/preview", { signal, body: { authorizationQuery } }); if (!data || error) throw new Error(messageOf(error)); return data; }, staleTime: 0, retry: false }); + const decision = useMutation({ retry: false, mutationFn: async (value: "allow" | "deny") => { if (!preview.data) throw new Error("Load the authorization request first."); const { data, error } = await api.POST("/api/v1/oauth/consent/decision", { body: { request: preview.data.request, signature: preview.data.signature, decision: value, scopes: (selected ?? preview.data.scopes) as ("flows:read" | "flows:write" | "runs:read" | "runs:write")[] } }); if (!data || error) throw new Error(messageOf(error)); location.assign(data.redirectTo); } }); + const scopes = selected ?? preview.data?.scopes ?? []; + return

Authorize {preview.data?.clientName ?? "a client"}

{preview.isPending &&

Validating authorization request…

}{preview.error &&

{preview.error.message}

} + {preview.data && <>

This client requests access to your workspace. Request expires {preview.data.expiresAt}.

Permissions{preview.data.scopes.map(scope => )}
}{decision.error &&

{decision.error.message}

} +
; +} diff --git a/packages/app/src/features/auth/device.tsx b/packages/app/src/features/auth/device.tsx new file mode 100644 index 00000000..b8657433 --- /dev/null +++ b/packages/app/src/features/auth/device.tsx @@ -0,0 +1,15 @@ +import { useState } from "react"; +import { useNavigate, useSearch } from "@tanstack/react-router"; +import { useQuery, useMutation } from "@tanstack/react-query"; +import { api } from "factorize-api-client"; +import { messageOf } from "./session"; +export function DeviceScreen() { + const search = useSearch({ strict: false }) as { user_code: string }, navigate = useNavigate(), [code, setCode] = useState(search.user_code); + const preview = useQuery({ queryKey: ["device", search.user_code], enabled: !!search.user_code, queryFn: async ({ signal }) => { const { data, error } = await api.POST("/api/v1/oauth/device/preview", { signal, body: { userCode: search.user_code } }); if (!data || error) throw new Error(messageOf(error)); return data; }, staleTime: 0, retry: false }); + const decision = useMutation({ retry: false, mutationFn: async (value: "allow" | "deny") => { const { data, error } = await api.POST("/api/v1/oauth/device/decision", { body: { userCode: search.user_code, decision: value } }); if (!data || error) throw new Error(messageOf(error)); return data; } }); + return

Connect a device

{decision.data ?

{decision.data.status === "approved" ? "Device connected" : "Authorization denied"}. You can close this window.

: <> +
{ e.preventDefault(); decision.reset(); void navigate({ to: "/device", search: { user_code: code } }); }}>
+ {preview.isFetching &&

Validating device code…

}{preview.data && <>

Authorize {preview.data.clientName}

Permissions: {preview.data.scopes.join(", ")} · Expires {preview.data.expiresAt}

} + {[preview.error, decision.error].filter(Boolean).map((error, i) =>

{error?.message}

)}} +
; +} diff --git a/packages/app/src/features/auth/identity-boundary.tsx b/packages/app/src/features/auth/identity-boundary.tsx new file mode 100644 index 00000000..8dd3b7bf --- /dev/null +++ b/packages/app/src/features/auth/identity-boundary.tsx @@ -0,0 +1,23 @@ +import { Fragment, useLayoutEffect, useRef, type ReactNode } from "react"; +import { useQuery } from "@tanstack/react-query"; +import { queryClient } from "../../shared/query-client"; +import { sessionQuery } from "./session"; + +/** Session changes in another tab must not leave another tenant's data visible. */ +export function IdentityBoundary({ children }: { children: ReactNode }) { + const session = useQuery(sessionQuery); + const previous = useRef(undefined); + const identity = session.data?.authenticated + ? session.data.user.id + ":" + session.data.workspace.id + ":" + session.data.expiresAt + : session.data ? "anonymous" : undefined; + useLayoutEffect(() => { + if (identity === undefined) return; + if (previous.current !== undefined && previous.current !== identity) { + void queryClient.cancelQueries({ predicate: query => query.queryKey[0] !== "session" }); + queryClient.removeQueries({ predicate: query => query.queryKey[0] !== "session" }); + queryClient.getMutationCache().clear(); + } + previous.current = identity; + }, [identity]); + return {children}; +} diff --git a/packages/app/src/features/auth/protocol-routes.tsx b/packages/app/src/features/auth/protocol-routes.tsx new file mode 100644 index 00000000..5e428149 --- /dev/null +++ b/packages/app/src/features/auth/protocol-routes.tsx @@ -0,0 +1,8 @@ +import { createRoute, lazyRouteComponent, redirect, type AnyRootRoute } from "@tanstack/react-router"; +import { queryClient } from "../../shared/query-client"; +import { sessionQuery } from "./session"; +export function protocolRoutes(root: AnyRootRoute) { + const guard = async ({ location }: { location: { href: string } }) => { if (!(await queryClient.ensureQueryData(sessionQuery)).authenticated) throw redirect({ to: "/auth/login", search: { returnTo: location.href, token: undefined } }); }; + return [createRoute({ getParentRoute: () => root, path: "/authorize", beforeLoad: guard, component: lazyRouteComponent(() => import("./consent"), "ConsentScreen") }), + createRoute({ getParentRoute: () => root, path: "/device", beforeLoad: guard, validateSearch: (s: Record) => ({ user_code: typeof s.user_code === "string" ? s.user_code.slice(0, 32) : "" }), component: lazyRouteComponent(() => import("./device"), "DeviceScreen") })]; +} diff --git a/packages/app/src/features/auth/routes.tsx b/packages/app/src/features/auth/routes.tsx new file mode 100644 index 00000000..2de8dfcc --- /dev/null +++ b/packages/app/src/features/auth/routes.tsx @@ -0,0 +1,25 @@ +import { createRoute, lazyRouteComponent, redirect, type AnyRootRoute } from "@tanstack/react-router"; +import type { AuthMode } from "./auth-screen"; +import { sessionQuery } from "./session"; +import { queryClient } from "../../shared/query-client"; + +const Screen = lazyRouteComponent(() => import("./auth-screen"), "AuthScreen"); +const validateSearch = (input: Record) => ({ + token: typeof input.token === "string" ? input.token : undefined, + returnTo: typeof input.returnTo === "string" ? input.returnTo : undefined, +}); +export function authRoutes(rootRoute: AnyRootRoute) { + function route(path: "/auth/login" | "/auth/signup" | "/auth/password-reset" | "/auth/verify" | "/auth/verify/request" | "/settings/password", mode: AuthMode) { + return createRoute({ + getParentRoute: () => rootRoute, path, validateSearch, + component: () => , + ...(mode === "password" ? { beforeLoad: async () => { + const session = await queryClient.ensureQueryData(sessionQuery); + if (!session.authenticated) { + throw redirect({ to: "/auth/login", search: { returnTo: "/settings/password", token: undefined } }); + } + } } : {}), + }); + } + return [route("/auth/login", "login"), route("/auth/signup", "signup"), route("/auth/password-reset", "reset"), route("/auth/verify", "verify"), route("/auth/verify/request", "verify-request"), route("/settings/password", "password")]; +} diff --git a/packages/app/src/features/auth/session.ts b/packages/app/src/features/auth/session.ts new file mode 100644 index 00000000..36c5254b --- /dev/null +++ b/packages/app/src/features/auth/session.ts @@ -0,0 +1,27 @@ +import { api } from "factorize-api-client"; +import { queryOptions } from "@tanstack/react-query"; +import { queryClient } from "../../shared/query-client"; + +export const sessionQuery = queryOptions({ + queryKey: ["session"], + queryFn: async ({ signal }) => { + const { data, error } = await api.GET("/api/v1/session", { signal }); + if (error || !data) throw new Error("Could not check your session. Please try again."); + return data; + }, + staleTime: 10_000, + refetchInterval: 60_000, + retry: 1, +}); +export async function refreshIdentity() { + await queryClient.cancelQueries(); + queryClient.clear(); + return queryClient.fetchQuery(sessionQuery); +} +export function messageOf(error: unknown): string { + if (error && typeof error === "object" && "error" in error) { + const detail = error.error; + if (detail && typeof detail === "object" && "message" in detail && typeof detail.message === "string") return detail.message; + } + return "Factorize could not complete the request. Please try again."; +} diff --git a/packages/app/src/features/jobs/delete.tsx b/packages/app/src/features/jobs/delete.tsx new file mode 100644 index 00000000..4362f757 --- /dev/null +++ b/packages/app/src/features/jobs/delete.tsx @@ -0,0 +1,9 @@ +import { useNavigate } from "@tanstack/react-router"; +import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { api } from "factorize-api-client"; +import { messageOf } from "../auth/session"; +export function DeleteJob({ jobId, name }: { jobId: string; name: string }) { + const cache = useQueryClient(), navigate = useNavigate(); + const remove = useMutation({ retry: false, mutationFn: async () => { const { error } = await api.DELETE("/api/v1/jobs/{jobId}", { params: { path: { jobId } } }); if (error) throw new Error(messageOf(error)); }, onSuccess: async () => { await cache.invalidateQueries({ queryKey: ["jobs"] }); await cache.invalidateQueries({ queryKey: ["runs"] }); void navigate({ to: "/jobs", search: { q: "" } }); } }); + return
{remove.error &&

{remove.error.message}

}
; +} diff --git a/packages/app/src/features/jobs/detail.tsx b/packages/app/src/features/jobs/detail.tsx new file mode 100644 index 00000000..5efaf8e0 --- /dev/null +++ b/packages/app/src/features/jobs/detail.tsx @@ -0,0 +1,28 @@ +import { DeleteJob } from "./delete"; +import { RunHistory } from "../runs/history"; +import { useParams, Link } from "@tanstack/react-router"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { api } from "factorize-api-client"; +import { jobQuery } from "./queries"; +import { InvokeJob } from "./invoke"; +import { messageOf } from "../auth/session"; +export function JobDetail() { + const { jobId } = useParams({ strict: false }); + const cache = useQueryClient(), query = useQuery(jobQuery(jobId!)); + const enabled = useMutation({ retry: false, mutationFn: async (value: boolean) => { + const { error } = value ? await api.POST("/api/v1/jobs/{jobId}/enable", { params: { path: { jobId: jobId! } } }) : await api.POST("/api/v1/jobs/{jobId}/disable", { params: { path: { jobId: jobId! } } }); + if (error) throw new Error(messageOf(error)); + }, onSuccess: () => cache.invalidateQueries({ queryKey: ["jobs"] }) }); + const job = query.data; + return
Jobs + {query.isPending &&

Loading job…

}{query.error &&

{query.error.message}

} + {job && <>

{job.name}

{job.agentKind} · {job.model || "Default model"} · {job.runningCount}/{job.concurrencyLimit} running

+ Edit job + + {enabled.error &&

{enabled.error.message}

} +
Prompt template
{job.promptTemplate}
+

Triggers

    {job.triggers.map(trigger =>
  • {trigger.slug} · {trigger.kind} · {trigger.enabled ? "Enabled" : "Disabled"}{trigger.kind === "webhook" && trigger.config.provider === "cloudflareTail" && trigger.config.destination && <>

    Tail webhook destination

    {trigger.config.destination}}
  • )}
+ + } +
; +} diff --git a/packages/app/src/features/jobs/editor-queries.ts b/packages/app/src/features/jobs/editor-queries.ts new file mode 100644 index 00000000..96718a82 --- /dev/null +++ b/packages/app/src/features/jobs/editor-queries.ts @@ -0,0 +1,19 @@ +import { queryOptions } from "@tanstack/react-query"; +import { api } from "factorize-api-client"; +import { messageOf } from "../auth/session"; +export const targetsQuery = queryOptions({ queryKey: ["editor", "targets"], queryFn: async ({ signal }) => { + const { data, error } = await api.GET("/api/v1/execution-targets", { signal }); + if (!data || error) throw new Error(messageOf(error)); return data; +}, staleTime: 60_000 }); +export const metadataQuery = queryOptions({ queryKey: ["editor", "templates"], queryFn: async ({ signal }) => { + const { data, error } = await api.GET("/api/v1/trigger-contexts", { signal }); + if (!data || error) throw new Error(messageOf(error)); return data; +}, staleTime: 300_000 }); +export const availabilityQuery = queryOptions({ queryKey: ["editor", "availability"], queryFn: async ({ signal }) => { + const { data, error } = await api.GET("/api/v1/job-trigger-availability", { signal }); + if (!data || error) throw new Error(messageOf(error)); return data; +}, staleTime: 60_000 }); +export const selectorQuery = (q: string, cursor?: string) => queryOptions({ queryKey: ["jobs", "selector", q, cursor], queryFn: async ({ signal }) => { + const { data, error } = await api.GET("/api/v1/job-selector", { signal, params: { query: { q, cursor, limit: 30 } } }); + if (!data || error) throw new Error(messageOf(error)); return data; +}, staleTime: 30_000 }); diff --git a/packages/app/src/features/jobs/editor-state.ts b/packages/app/src/features/jobs/editor-state.ts new file mode 100644 index 00000000..d3bd1931 --- /dev/null +++ b/packages/app/src/features/jobs/editor-state.ts @@ -0,0 +1,28 @@ +import type { components, operations } from "factorize-api-client"; +export type JobInput = components["schemas"]["JobInput"]; +export type Job = operations["get_api_v1_jobs_jobId"]["responses"][200]["content"]["application/json"]; +export type Trigger = JobInput["triggers"][number]; +export const emptyJob = (): JobInput => ({ name: "", slug: "", promptTemplate: "", runNameTemplate: "", executionTargetId: "", concurrencyLimit: 1, model: "", effort: "", triggers: [{ kind: "manual", slug: "trigger-1", enabled: true, config: {} }] }); +export function editableJob(job: Job): JobInput { + return { name: job.name, slug: job.slug, promptTemplate: job.promptTemplate, runNameTemplate: job.runNameTemplate, executionTargetId: job.executionTargetId, concurrencyLimit: job.concurrencyLimit, model: job.model, effort: job.effort ?? "", triggers: job.triggers.map(trigger => { + const { id, slug, kind, enabled } = trigger; + const config = trigger.kind === "webhook" ? Object.fromEntries(Object.entries(trigger.config).filter(([key]) => !["destination", "secretConfigured"].includes(key))) : trigger.config; + return { id, slug, kind, enabled, config } as Trigger; + }) }; +} +// Three-way reconciliation only merges fields changed on one side. Conflicting +// fields require an explicit choice; triggers are atomic to preserve identity. +export function reconcile(base: JobInput, local: JobInput, remote: JobInput) { + const merged = { ...remote }, conflicts: (keyof JobInput)[] = []; + for (const key of Object.keys(base) as (keyof JobInput)[]) { + const changedHere = JSON.stringify(local[key]) !== JSON.stringify(base[key]); + const changedThere = JSON.stringify(remote[key]) !== JSON.stringify(base[key]); + if (changedHere && changedThere && JSON.stringify(local[key]) !== JSON.stringify(remote[key])) conflicts.push(key); + else if (changedHere) Object.assign(merged, { [key]: local[key] }); + } + return { merged, conflicts }; +} + +export function writeInput(draft: JobInput): JobInput { + return { ...draft, triggers: draft.triggers.map(trigger => ({ ...trigger, slug: trigger.slug && /^trigger-[1-9][0-9]*$/.test(trigger.slug) ? trigger.slug : undefined })) }; +} diff --git a/packages/app/src/features/jobs/editor.tsx b/packages/app/src/features/jobs/editor.tsx new file mode 100644 index 00000000..0f344dc0 --- /dev/null +++ b/packages/app/src/features/jobs/editor.tsx @@ -0,0 +1,75 @@ +import { useEffect, useState, useRef } from "react"; +import { Link, useNavigate, useParams, useBlocker } from "@tanstack/react-router"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { api } from "factorize-api-client"; +import { jobQuery } from "./queries"; +import { metadataQuery, targetsQuery } from "./editor-queries"; +import { editableJob, emptyJob, reconcile, writeInput, type Job, type JobInput } from "./editor-state"; +import { TemplateField } from "./template-field"; +import { TriggerEditor } from "./trigger-editor"; +import { messageOf } from "../auth/session"; +export function JobEditor() { + const { jobId } = useParams({ strict: false }); + const job = useQuery({ ...jobQuery(jobId ?? ""), enabled: !!jobId }); + if (jobId && job.isPending) return

Loading job configuration…

; + if (jobId && job.error) return

{job.error.message}

; + return ; +} +function EditorForm({ initial }: { initial?: Job }) { + const navigate = useNavigate(), cache = useQueryClient(); + const [base, setBase] = useState(initial ? editableJob(initial) : emptyJob); + const [draft, setDraft] = useState(base), [revision, setRevision] = useState(initial?.updatedAt); + const [remote, setRemote] = useState(), [conflicts, setConflicts] = useState<(keyof JobInput)[]>([]); + const [reconciling, setReconciling] = useState(false), [saved, setSaved] = useState(false); + const savingNavigation = useRef(false); + const dirty = !saved && JSON.stringify(base) !== JSON.stringify(draft); + useBlocker({ shouldBlockFn: () => dirty && !savingNavigation.current && !window.confirm("Discard unsaved job changes?"), enableBeforeUnload: dirty }); + useEffect(() => { const handler = (event: BeforeUnloadEvent) => { if (dirty) { event.preventDefault(); event.returnValue = ""; } }; window.addEventListener("beforeunload", handler); return () => window.removeEventListener("beforeunload", handler); }, [dirty]); + const targets = useQuery(targetsQuery), metadata = useQuery(metadataQuery); + const target = targets.data?.find(t => t.id === draft.executionTargetId); + const update = (key: K, value: JobInput[K]) => setDraft(previous => ({ ...previous, [key]: value })); + const refreshConflict = useMutation({ retry: false, mutationFn: async () => { + if (!initial) throw new Error("No job selected"); + const { data, error } = await api.GET("/api/v1/jobs/{jobId}", { params: { path: { jobId: initial.id } } }); + if (!data || error) throw new Error(messageOf(error)); return data; + }, onSuccess: value => { setRemote(value); setReconciling(false); } }); + const save = useMutation({ retry: false, mutationFn: async () => { + if (remote || conflicts.length) throw new Error("Resolve the stale edit before saving."); + const result = initial ? await api.PUT("/api/v1/jobs/{jobId}", { params: { path: { jobId: initial.id } }, body: { ...writeInput(draft), expectedUpdatedAt: revision } }) : await api.POST("/api/v1/jobs", { body: writeInput(draft) }); + if (result.error || !result.data) { + if (result.error?.error.code === "stale_job") { setReconciling(true); refreshConflict.mutate(); } + throw new Error(messageOf(result.error)); + } + return result.data; + }, onSuccess: async value => { savingNavigation.current = true; setSaved(true); setBase(editableJob(value)); cache.setQueryData(jobQuery(value.id).queryKey, value); await cache.invalidateQueries({ queryKey: ["jobs"] }); void navigate({ to: "/jobs/$jobId", params: { jobId: value.id } }); } }); + const acceptRemote = () => { if (!remote) return; const value = editableJob(remote); setDraft(value); setBase(value); setRevision(remote.updatedAt); setRemote(undefined); setConflicts([]); save.reset(); }; + const merge = () => { if (!remote) return; const value = editableJob(remote), result = reconcile(base, draft, value); setDraft(result.merged); setConflicts(result.conflicts); setBase(value); setRevision(remote.updatedAt); if (!result.conflicts.length) setRemote(undefined); save.reset(); }; + const resolve = (field: keyof JobInput, local: boolean) => { + // Local values are kept separately from the merged draft until chosen. + setDraft(previous => local ? { ...previous, [field]: localConflictDraft[field] } : previous); setConflicts(previous => previous.filter(key => key !== field)); + if (conflicts.length === 1) setRemote(undefined); + }; + const [localConflictDraft, setLocalConflictDraft] = useState(draft); + return
Jobs

{initial ? "Edit job" : "Create job"}

+ {(remote || reconciling || refreshConflict.error) &&

This job changed while you were editing

Your unsaved draft is retained. Review the latest configuration before retrying.

+ {refreshConflict.isPending &&

Loading latest configuration…

}{refreshConflict.error && <>

{refreshConflict.error.message}

} + {remote && !conflicts.length && <>
{JSON.stringify(editableJob(remote), null, 2)}
} + {conflicts.map(field =>
Both versions changed {field}
Mine: {JSON.stringify(localConflictDraft[field], null, 2)}
Latest: {JSON.stringify(base[field], null, 2)}
)} +
} +
{ e.preventDefault(); save.mutate(); }}> + + + + {targets.isPending &&

Loading execution targets…

}{targets.error &&

{targets.error.message}

}{targets.data?.length === 0 &&

Connect an execution provider in settings before creating a job.

} + + + + update("promptTemplate", value)} triggers={draft.triggers} /> + update("runNameTemplate", value)} triggers={draft.triggers} /> +
Template variables{metadata.error &&

{metadata.error.message}

}{Object.entries(metadata.data ?? {}).map(([kind, fields]) =>

{kind}

    {fields.map(field =>
  • {field.path} — {field.description}
  • )}
)}
+ update("triggers", value)} /> + {save.error &&

{save.error.message}

} + + +
; +} diff --git a/packages/app/src/features/jobs/handler-test.tsx b/packages/app/src/features/jobs/handler-test.tsx new file mode 100644 index 00000000..a5b8f0c6 --- /dev/null +++ b/packages/app/src/features/jobs/handler-test.tsx @@ -0,0 +1,13 @@ +import { useState } from "react"; +import { useMutation } from "@tanstack/react-query"; +import { api } from "factorize-api-client"; +import { messageOf } from "../auth/session"; +export function HandlerTest({ handlerCode }: { handlerCode: string }) { + const [payload, setPayload] = useState("{}"); + const test = useMutation({ retry: false, mutationFn: async () => { + let value: unknown; try { value = JSON.parse(payload); } catch { throw new Error("Enter a valid JSON webhook object."); } + if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Webhook payload must be an object."); + const { data, error } = await api.POST("/api/v1/job-handlers/test", { body: { handlerCode, payload: value as Record } }); if (!data || error) throw new Error(messageOf(error)); return data; + } }); + return
Test webhook handler -

Step 4

Execution target

Select the VM connection, model, and effort for this job.

- -

Add trigger

Provider credentials stay managed by Factorize.

- - - - - -
`, `${uiHelpers} -const jobId=${JSON.stringify(jobId ?? null)},contextCatalog=${JSON.stringify(triggerContextCatalog)},form=$('#job'),dialog=$('#trigger-dialog'),triggerForm=$('#trigger-form');let triggers=[],editing=-1,resources={targets:[],projects:[],clickupLists:[],options:{statuses:[],users:[],labels:[]},clickupOptions:{statuses:[],users:[],labels:[]},githubOptions:{statuses:[],users:[],labels:[]},installations:[],tailInstallations:[],repositories:new Map(),jobs:[]},clientId=0,reservedSlugs=new Set(),availability={}; -let slugEdited=Boolean(jobId);const jobSlug=value=>value.trim().toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-+|-+$/g,'').slice(0,30)||'job';form.name.addEventListener('input',()=>{if(!slugEdited)form.slug.value=jobSlug(form.name.value)});form.slug.addEventListener('input',()=>{slugEdited=true}); -const kinds={manual:'Manual',schedule:'Schedule',linear:'Linear',clickup:'ClickUp',github:'GitHub Issues',cloudflareTail:'Cloudflare Tail',jobLifecycle:'Job lifecycle'}; -const providerKind=t=>t.kind==='webhook'?t.config.provider:t.kind; -const reflection=t=>t.reflection?.paths||contextCatalog[providerKind(t)]||[]; -const triggerHints=()=>triggers.map(t=>({path:t.slug,type:'object',description:'Complete '+kinds[providerKind(t)]+' trigger context as JSON'})); -const contextPaths=()=>triggers.flatMap(t=>[{path:t.slug,type:'object',description:'Complete '+kinds[providerKind(t)]+' trigger context as JSON'},...reflection(t).filter(x=>x.path!=='*').map(x=>({path:t.slug+'.'+x.path,type:x.type,description:x.description}))]); -const nameOf=(items,id)=>items.find(x=>String(x.id)===String(id))?.name||String(id||'Not selected'); -const simpleSchedule=c=>{if(c.timezone!=='UTC')return null;const cron=(c.cron||'').trim(),minutes=cron.match(/^\\*\\/(\\d+) \\* \\* \\* \\*$/),hours=cron.match(/^0 \\*\\/(\\d+) \\* \\* \\*$/);if(cron==='* * * * *')return {unit:'minutes',value:1};if(cron==='0 * * * *')return {unit:'hours',value:1};if(minutes&&Number(minutes[1])>=1&&Number(minutes[1])<=59)return {unit:'minutes',value:Number(minutes[1])};if(hours&&Number(hours[1])>=1&&Number(hours[1])<=23)return {unit:'hours',value:Number(hours[1])};return null}; -function simpleCron(){const unit=triggerForm.elements.intervalUnit.value,value=Number(triggerForm.elements.intervalValue.value),max=unit==='minutes'?59:23;if(!Number.isInteger(value)||value<1||value>max)throw new Error('Enter an interval from 1 to '+max+' '+unit+'.');return unit==='minutes'?'*/'+value+' * * * *':'0 */'+value+' * * *'} -function syncScheduleEditor(){const simple=triggerForm.elements.scheduleMode.value==='simple',unit=triggerForm.elements.intervalUnit.value,max=unit==='minutes'?59:23,value=triggerForm.elements.intervalValue;$('#schedule-simple').classList.toggle('hidden',!simple);$('#schedule-advanced').classList.toggle('hidden',simple);value.required=simple;value.max=String(max);$('#schedule-semantics').textContent='Runs every '+(value.value||'X')+' '+unit+', aligned to UTC clock boundaries.';if(simple){try{triggerForm.elements.cron.value=simpleCron();triggerForm.elements.timezone.value='UTC'}catch{}}previewSchedule()} -const showTriggerDialog=dialog.showModal.bind(dialog);dialog.showModal=()=>{if(triggerForm.dataset.kind==='schedule'){const c=editing>=0?triggers[editing].config:null,simple=c?simpleSchedule(c):{unit:'minutes',value:5};triggerForm.elements.scheduleMode.value=simple?'simple':'advanced';if(simple){triggerForm.elements.intervalUnit.value=simple.unit;triggerForm.elements.intervalValue.value=String(simple.value)}syncScheduleEditor()}showTriggerDialog()}; -async function refreshAvailability(){availability=await request('/api/v1/job-trigger-availability');const select=$('#add-trigger'),selected=select.value;select.replaceChildren(new Option('Add trigger…',''),...Object.entries(kinds).filter(([kind])=>availability[kind]).map(([kind,label])=>new Option(label,kind)));select.value=selected;select.disabled=false} -const ruleLabels={status:'Status',label:'Label',assignee:'Assignee',creator:'Creator',owner:'Owner'}; -const ruleOptions=type=>type==='status'?resources.options.statuses:type==='label'?resources.options.labels:resources.options.users; -const githubRuleOptions=type=>type==='status'?resources.githubOptions.statuses:type==='label'?resources.githubOptions.labels:resources.githubOptions.users; -const ruleSummary=rule=>ruleLabels[rule.type]+' is '+nameOf(ruleOptions(rule.type),rule.targetId); -function summary(t){const c=t.config||{},k=providerKind(t);if(k==='manual')return 'Prompt entered when run';if(k==='schedule')return c.cron+' · '+c.timezone;if(k==='linear')return nameOf(resources.projects,c.projectId)+' · '+(c.matchRules||[]).map(ruleSummary).join(' + ');if(k==='clickup')return nameOf(resources.clickupLists,c.listId)+' · '+(c.matchRules||[]).map(ruleSummary).join(' + ');if(k==='github'){const i=resources.installations.find(x=>String(x.installationId)===String(c.installationId));const repos=resources.repositories.get(String(c.installationId))||[];return (i?.accountLogin||c.installationId)+' · '+(repos.find(x=>String(x.id)===String(c.repositoryId))?.fullName||c.repositoryId)+' · '+c.event+'/'+c.action}if(k==='cloudflareTail')return 'Managed signed Tail endpoint'+(c.handlerCode?' · handler':'');return (c.sourceJobIds||[]).map(id=>resources.jobs.find(j=>j.id===id)?.name||id).join(', ')+' · '+(c.states||[]).join(', ')} -function render(){const rows=$('#trigger-rows');rows.innerHTML=triggers.map((t,i)=>''+esc(t.slug)+''+esc(kinds[providerKind(t)])+(t.actionRequired?'Action required':'')+''+esc(t.actionRequired||summary(t))+'
').join('');$('#trigger-empty').classList.toggle('hidden',triggers.length>0);const hints=triggerHints();$('#context-paths').innerHTML=hints.length?'Available context: '+hints.map(x=>'').join(''):'Add a trigger to expose context.';updateSuggestions()} -const promptEditor=form.elements.promptTemplate,promptHighlight=$('#prompt-highlight'),suggestionMenu=$('#context-suggestions');let matches=[],activeSuggestion=0,expression=null; -function highlightPrompt(){const source=promptEditor.value,pattern=/({{{[\s\S]*?}}}|{{[\s\S]*?}})/g;let html='',last=0,match;while((match=pattern.exec(source))){html+=esc(source.slice(last,match.index));const token=match[0],triple=token.startsWith('{{{'),open=triple?'{{{':'{{',close=triple?'}}}':'}}',value=token.slice(open.length,-close.length);html+=''+open+''+esc(value)+''+close+'';last=pattern.lastIndex}promptHighlight.innerHTML=html+esc(source.slice(last))+'\\n';promptHighlight.scrollTop=promptEditor.scrollTop;promptHighlight.scrollLeft=promptEditor.scrollLeft} -promptEditor.addEventListener('input',highlightPrompt);promptEditor.addEventListener('scroll',highlightPrompt);highlightPrompt(); -function currentExpression(){const end=promptEditor.selectionStart,start=promptEditor.value.lastIndexOf('{{',end);if(start<0||promptEditor.value.slice(start+2,end).includes('}}'))return null;const raw=promptEditor.value.slice(start+2,end);if(!/^\\s*[A-Za-z0-9_.-]*$/.test(raw))return null;return {start,end,query:raw.trim()}} -function closeSuggestions(){matches=[];expression=null;suggestionMenu.classList.add('hidden');suggestionMenu.replaceChildren();promptEditor.setAttribute('aria-expanded','false');promptEditor.removeAttribute('aria-activedescendant')} -function updateSuggestions(){expression=currentExpression();if(!expression)return closeSuggestions();matches=contextPaths().filter(x=>x.path.toLowerCase().includes(expression.query.toLowerCase())).slice(0,12);if(!matches.length)return closeSuggestions();activeSuggestion=Math.min(activeSuggestion,matches.length-1);suggestionMenu.innerHTML=matches.map((x,i)=>'').join('');suggestionMenu.classList.remove('hidden');promptEditor.setAttribute('aria-expanded','true');promptEditor.setAttribute('aria-activedescendant','context-option-'+activeSuggestion);$('#context-announcement').textContent=matches.length+' context suggestions available. '+matches[activeSuggestion].path+' selected.'} -function selectSuggestion(index=activeSuggestion){const choice=matches[index];if(!choice||!expression)return;const before=promptEditor.value.slice(0,expression.start+2),after=promptEditor.value.slice(expression.end),closing=after.startsWith('}}')?'':'}}';promptEditor.value=before+choice.path+closing+after;const caret=before.length+choice.path.length+closing.length;promptEditor.setSelectionRange(caret,caret);closeSuggestions();promptEditor.focus();promptEditor.dispatchEvent(new Event('input',{bubbles:true}))} -function insertHint(path){const start=promptEditor.selectionStart,end=promptEditor.selectionEnd,value='{{'+path+'}}';promptEditor.setRangeText(value,start,end,'end');promptEditor.focus();promptEditor.dispatchEvent(new Event('input',{bubbles:true}));$('#context-announcement').textContent=value+' inserted.'} -promptEditor.addEventListener('input',()=>{activeSuggestion=0;updateSuggestions()});promptEditor.addEventListener('click',updateSuggestions);promptEditor.addEventListener('keyup',e=>{if(!['ArrowDown','ArrowUp','Escape','Tab'].includes(e.key))updateSuggestions()});promptEditor.addEventListener('keydown',e=>{if(suggestionMenu.classList.contains('hidden'))return;if(e.key==='ArrowDown'||e.key==='ArrowUp'){e.preventDefault();activeSuggestion=(activeSuggestion+(e.key==='ArrowDown'?1:-1)+matches.length)%matches.length;updateSuggestions()}else if(e.key==='Tab'||e.key==='Enter'){e.preventDefault();selectSuggestion()}else if(e.key==='Escape'){e.preventDefault();closeSuggestions()}});suggestionMenu.addEventListener('mousedown',e=>e.preventDefault());suggestionMenu.addEventListener('click',e=>{const option=e.target.closest('[data-suggestion]');if(option)selectSuggestion(Number(option.dataset.suggestion))});promptEditor.addEventListener('blur',()=>setTimeout(closeSuggestions,100)); -$('#context-paths').addEventListener('click',e=>{const hint=e.target.closest('[data-context-hint]');if(hint)insertHint(hint.dataset.contextHint)}); -function nextSlug(){let n=1;while(reservedSlugs.has('trigger-'+n))n++;const slug='trigger-'+n;reservedSlugs.add(slug);return slug} -async function repositories(installationId){const key=String(installationId);if(resources.repositories.has(key))return resources.repositories.get(key);const response=await fetch('/api/v1/providers/github/installations/'+encodeURIComponent(key)+'/repositories');const items=response.ok?await response.json():[];resources.repositories.set(key,items);return items} -function options(select,items,label,value='id'){select.replaceChildren(...items.map(x=>new Option(x[label]||x.name,String(x[value]))))} -function syncModels(selected=form.model.value,selectedEffort=form.effort.value){const target=resources.targets.find(x=>String(x.id)===form.executionTargetId.value),amp=target?.kind==='amp',models=target?.models||[],efforts=target?.efforts||[];form.model.replaceChildren(new Option('Harness default',''),...models.map(value=>new Option(value,value)));form.model.disabled=amp;form.model.value=amp?'':selected;if(selected&&!form.model.value){form.model.append(new Option(selected+' (unavailable)',selected));form.model.value=selected}form.effort.replaceChildren(new Option('Harness default',''),...efforts.map(value=>new Option(value,value)));form.effort.disabled=amp||!efforts.length;form.effort.value=form.effort.disabled?'':selectedEffort;$('#model-help').textContent=amp?'This target manages its model in Amp.':models.length?'Models loaded when this VM integration was added.':'No models were returned by this VM integration.';$('#effort-help').textContent=efforts.length?'Select the harness reasoning effort.':'This harness does not expose effort selection.'} -// Select the connected environment and model that will run this job. syncModels(current?.model||'') -async function syncRepositories(selected){const install=triggerForm.elements.installationId.value,repos=await repositories(install);options(triggerForm.elements.repositoryId,repos,'fullName');if(selected)triggerForm.elements.repositoryId.value=String(selected)} -function linearRuleRows(){return [...$('#linear-rules').querySelectorAll('[data-linear-rule]')]} -function syncLinearRuleButtons(){const rows=linearRuleRows();rows.forEach(row=>row.querySelector('[data-remove-linear-rule]').classList.toggle('invisible',rows.length===1))} -function addLinearRule(rule={type:'status',targetId:''}){const row=document.createElement('div');row.dataset.linearRule='';row.className='grid gap-3 rounded-xl border border-stone-200 bg-stone-50 p-4 sm:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_auto] sm:items-end dark:border-slate-700 dark:bg-slate-950';const typeLabel=document.createElement('label');typeLabel.className='label';typeLabel.textContent='Match on';const type=document.createElement('select');type.className='field';type.innerHTML=Object.entries(ruleLabels).map(([value,label])=>'').join('');type.value=rule.type;typeLabel.append(type);const valueLabel=document.createElement('label');valueLabel.className='label';valueLabel.textContent='Value';const value=document.createElement('select');value.className='field';const fill=()=>{value.replaceChildren(new Option('Choose '+ruleLabels[type.value].toLowerCase(),''),...ruleOptions(type.value).map(item=>new Option(item.name,item.id)));value.value=type.value===rule.type?rule.targetId:''};type.onchange=fill;fill();valueLabel.append(value);const remove=document.createElement('button');remove.type='button';remove.dataset.removeLinearRule='';remove.className='rounded-lg border border-red-200 px-3 py-2 text-sm font-semibold text-red-700 hover:bg-red-50 dark:border-red-900 dark:text-red-300';remove.textContent='Remove';remove.onclick=()=>{row.remove();syncLinearRuleButtons()};row.append(typeLabel,valueLabel,remove);$('#linear-rules').append(row);syncLinearRuleButtons()} -function readLinearRules(){return linearRuleRows().map(row=>{const [type,target]=row.querySelectorAll('select');return {type:type.value,targetId:target.value}})} -function clickupRuleRows(){return [...$('#clickup-rules').querySelectorAll('[data-clickup-rule]')]} -function addClickupRule(rule={type:'status',targetId:''}){const row=document.createElement('div');row.dataset.clickupRule='';row.className='grid gap-3 rounded-xl border border-stone-200 bg-stone-50 p-4 sm:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_auto] sm:items-end dark:border-slate-700 dark:bg-slate-950';const typeLabel=document.createElement('label'),type=document.createElement('select'),valueLabel=document.createElement('label'),value=document.createElement('select'),remove=document.createElement('button');typeLabel.className=valueLabel.className='label';typeLabel.textContent='Match on';valueLabel.textContent='Value';type.className=value.className='field';type.innerHTML=Object.entries(ruleLabels).filter(([key])=>key!=='owner').map(([key,label])=>'').join('');type.value=rule.type;const fill=()=>{const items=type.value==='status'?resources.clickupOptions.statuses:type.value==='label'?resources.clickupOptions.labels:resources.clickupOptions.users;value.replaceChildren(new Option('Choose '+ruleLabels[type.value].toLowerCase(),''),...items.map(item=>new Option(item.name,item.id)));value.value=type.value===rule.type?rule.targetId:''};type.onchange=fill;fill();typeLabel.append(type);valueLabel.append(value);remove.type='button';remove.className='rounded-lg border border-red-200 px-3 py-2 text-sm font-semibold text-red-700';remove.textContent='Remove';remove.onclick=()=>row.remove();row.append(typeLabel,valueLabel,remove);$('#clickup-rules').append(row)} -function readClickupRules(){return clickupRuleRows().map(row=>{const [type,target]=row.querySelectorAll('select');return {type:type.value,targetId:target.value}})} -async function syncClickupOptions(rules=[{type:'status',targetId:''}]){const listId=triggerForm.elements.clickupListId.value;resources.clickupOptions=listId?await request('/api/v1/providers/clickup/options?listId='+encodeURIComponent(listId)):{statuses:[],users:[],labels:[]};$('#clickup-rules').replaceChildren();rules.forEach(addClickupRule)} -function githubRuleRows(){return [...$('#github-rules').querySelectorAll('[data-github-rule]')]} -function addGithubRule(rule={type:'status',targetId:''}){const row=document.createElement('div');row.dataset.githubRule='';row.className='grid gap-3 rounded-xl border border-stone-200 bg-stone-50 p-4 sm:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_auto] sm:items-end';const type=document.createElement('select'),value=document.createElement('select'),remove=document.createElement('button');type.className=value.className='field';type.innerHTML=['status','label','assignee','creator'].map(x=>'').join('');type.value=rule.type==='owner'?'assignee':rule.type;const fill=()=>{value.replaceChildren(new Option('Choose '+ruleLabels[type.value].toLowerCase(),''),...githubRuleOptions(type.value).map(x=>new Option(x.name,x.id)));value.value=rule.targetId};type.onchange=fill;fill();remove.type='button';remove.textContent='Remove';remove.onclick=()=>row.remove();row.append(type,value,remove);$('#github-rules').append(row)} -function readGithubRules(){return githubRuleRows().map(row=>{const [type,target]=row.querySelectorAll('select');return {type:type.value,targetId:target.value}})} -async function syncGithubIssueOptions(){const installationId=triggerForm.elements.installationId.value,repositoryId=triggerForm.elements.repositoryId.value;resources.githubOptions=installationId&&repositoryId?await request('/api/v1/providers/github/installations/'+encodeURIComponent(installationId)+'/repositories/'+encodeURIComponent(repositoryId)+'/issue-options'):{statuses:[],users:[],labels:[]};githubRuleRows().forEach(row=>{const [type,value]=row.querySelectorAll('select'),selected=value.value;value.replaceChildren(new Option('Choose '+ruleLabels[type.value].toLowerCase(),''),...githubRuleOptions(type.value).map(x=>new Option(x.name,x.id)));value.value=selected})} -async function openEditor(kind,index=-1){const current=index>=0?triggers[index]:null,k=current?providerKind(current):kind;if(!kinds[k])throw new Error('This trigger type is no longer supported.');editing=index;const c=current?.config||{};$('#dialog-title').textContent=(current?'Edit ':'Add ')+kinds[k]+' trigger';triggerForm.reset();document.querySelectorAll('[data-panel]').forEach(x=>x.classList.add('hidden'));const panel=document.querySelector('[data-panel="'+(k==='manual'?'none':k==='schedule'?'schedule':k==='linear'?'linear':k==='clickup'?'clickup':k==='github'?'github':k==='jobLifecycle'?'jobLifecycle':'webhook')+'"]');panel?.classList.remove('hidden');triggerForm.dataset.kind=k;$('#dialog-error').classList.add('hidden');$('#handler-result').textContent='';if(k==='schedule'){triggerForm.elements.cron.value=c.cron||'0 9 * * *';triggerForm.elements.timezone.value=c.timezone||'UTC'}if(k==='linear'){options(triggerForm.elements.projectId,resources.projects,'name');triggerForm.elements.projectId.value=c.projectId||resources.projects[0]?.id||'';$('#linear-rules').replaceChildren();(c.matchRules?.length?c.matchRules:[{type:'status',targetId:''}]).forEach(addLinearRule)}if(k==='clickup'){options(triggerForm.elements.clickupListId,resources.clickupLists,'name');triggerForm.elements.clickupListId.value=c.listId||resources.clickupLists[0]?.id||'';await syncClickupOptions(c.matchRules)}if(k==='github'){options(triggerForm.elements.installationId,resources.installations,'accountLogin','installationId');triggerForm.elements.installationId.value=String(c.installationId||resources.installations[0]?.installationId||'');await syncRepositories(c.repositoryId);$('#github-rules').replaceChildren();(c.matchRules?.length?c.matchRules:[{type:'status',targetId:''}]).forEach(addGithubRule);await syncGithubIssueOptions()}if(k==='jobLifecycle'){options(triggerForm.elements.sourceJobId,resources.jobs.filter(j=>j.id!==jobId),'name');[...triggerForm.elements.sourceJobId.options].forEach(x=>x.selected=(c.sourceJobIds||[]).includes(x.value));triggerForm.querySelectorAll('[name=lifecycleState]').forEach(x=>x.checked=(c.states||['succeeded','failed']).includes(x.value))}if(['linear','clickup','github','cloudflareTail'].includes(k))triggerForm.elements.handlerCode.value=c.handlerCode||'';dialog.showModal();if(k==='schedule')previewSchedule()} -async function previewSchedule(){const body={cron:triggerForm.elements.cron.value,timezone:triggerForm.elements.timezone.value};try{const x=await request('/api/v1/schedules/preview',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(body)});$('#schedule-preview').textContent='Next occurrence: '+new Date(x.nextRunAt).toLocaleString()}catch(e){$('#schedule-preview').textContent=e.message}} -function configFromForm(){const k=triggerForm.dataset.kind,h=triggerForm.elements.handlerCode?.value.trim(),handler=h?{handlerCode:h}:{};if(k==='manual')return {kind:'manual',config:{}};if(k==='schedule')return {kind:'schedule',config:{cron:triggerForm.elements.cron.value.trim(),timezone:triggerForm.elements.timezone.value}};if(k==='linear')return {kind:'webhook',config:{provider:'linear',projectId:triggerForm.elements.projectId.value,matchRules:readLinearRules(),...handler}};if(k==='clickup')return {kind:'webhook',config:{provider:'clickup',listId:triggerForm.elements.clickupListId.value,matchRules:readClickupRules(),...handler}};if(k==='github')return {kind:'webhook',config:{provider:'github',installationId:Number(triggerForm.elements.installationId.value),repositoryId:Number(triggerForm.elements.repositoryId.value),matchRules:readGithubRules(),...handler}};if(k==='cloudflareTail')return {kind:'webhook',config:{provider:k,integrationId:triggerForm.elements.tailIntegrationId.value}};return {kind:'jobLifecycle',config:{sourceJobIds:[...triggerForm.elements.sourceJobId.selectedOptions].map(x=>x.value),states:[...triggerForm.querySelectorAll('[name=lifecycleState]:checked')].map(x=>x.value)}}} -function validate(candidate){const k=providerKind(candidate);if(k==='manual'&&triggers.some((t,i)=>i!==editing&&providerKind(t)==='manual'))throw new Error('Only one Manual trigger can be configured.');if(k==='linear'&&(!candidate.config.projectId||!candidate.config.matchRules.length||candidate.config.matchRules.some(rule=>!rule.targetId)))throw new Error('Choose a Linear project and a value for every matching rule.');if(k==='clickup'&&(!candidate.config.listId||!candidate.config.matchRules.length||candidate.config.matchRules.some(rule=>!rule.targetId)))throw new Error('Choose a ClickUp list and a value for every matching rule.');if(k==='github'&&(!candidate.config.installationId||!candidate.config.repositoryId||!candidate.config.matchRules.length||candidate.config.matchRules.some(rule=>!rule.targetId)))throw new Error('Choose a GitHub installation, repository, and a value for every matching rule.');if(k==='jobLifecycle'&&(!candidate.config.sourceJobIds[0]||!candidate.config.states.length))throw new Error('Choose a source job and at least one event.');if(triggers.some((t,i)=>i!==editing&&JSON.stringify(t.config)===JSON.stringify(candidate.config)&&t.kind===candidate.kind))throw new Error('An identical trigger is already configured.')} -$('#trigger-rows').onclick=e=>{const b=e.target.closest('button');if(!b)return;const key=['edit','remove'].find(x=>b.dataset[x]!==undefined),i=Number(b.dataset[key]);if(key==='edit')openEditor(providerKind(triggers[i]),i);if(key==='remove'){if(providerKind(triggers[i])==='manual'){const error=$('#error');error.textContent='A Job must keep its Manual trigger. Disable it if manual runs should be unavailable.';error.classList.remove('hidden');return}triggers.splice(i,1);render()}}; -$('#trigger-rows').onchange=e=>{if(e.target.dataset.enable===undefined)return;triggers[Number(e.target.dataset.enable)].enabled=e.target.checked;render()};$('#add-trigger').onchange=e=>{const kind=e.target.value;e.target.value='';if(kind)openEditor(kind)};$('#add-linear-rule').onclick=()=>addLinearRule();$('#add-clickup-rule').onclick=()=>addClickupRule();$('#add-github-rule').onclick=()=>addGithubRule();$('#cancel-trigger').onclick=()=>dialog.close();triggerForm.elements.clickupListId.onchange=()=>syncClickupOptions();triggerForm.elements.installationId.onchange=async()=>{await syncRepositories();$('#github-rules').replaceChildren();addGithubRule();await syncGithubIssueOptions()};triggerForm.elements.repositoryId.onchange=()=>syncGithubIssueOptions();triggerForm.elements.cron.oninput=previewSchedule;triggerForm.elements.timezone.onchange=previewSchedule; -triggerForm.querySelectorAll('[name=scheduleMode]').forEach(input=>input.onchange=syncScheduleEditor);triggerForm.elements.intervalUnit.onchange=syncScheduleEditor;triggerForm.elements.intervalValue.oninput=syncScheduleEditor; -triggerForm.onsubmit=e=>{e.preventDefault();try{const value=configFromForm();validate(value);if(editing>=0)triggers[editing]={...triggers[editing],...value};else triggers.push({...value,id:undefined,slug:nextSlug(),enabled:true,_clientId:++clientId});dialog.close();render()}catch(error){$('#dialog-error').textContent=error.message;$('#dialog-error').classList.remove('hidden')}}; -$('#test-handler').onclick=async()=>{const output=$('#handler-result');try{const handlerCode=triggerForm.elements.handlerCode.value;if(!handlerCode)throw new Error('Enter handler code first.');const payload=JSON.parse(triggerForm.elements.testPayload.value);const result=await request('/api/v1/job-handlers/test',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({handlerCode,payload})});output.textContent=result.ok?'Accepted: '+JSON.stringify(result.decision):'Rejected: '+result.category}catch(e){output.textContent=e.message}}; -async function loadProviderResources(){const pending=[];if(availability.linear)pending.push(Promise.all([request('/api/v1/providers/linear/projects'),request('/api/v1/providers/linear/options')]).then(([projects,linearOptions])=>{resources.projects=projects;resources.options=linearOptions}).catch(()=>{}));if(availability.clickup)pending.push(request('/api/v1/providers/clickup/lists').then(lists=>{resources.clickupLists=lists}).catch(()=>{}));if(availability.github)pending.push(fetch('/api/v1/providers/github/installations').then(response=>response.ok?response.json():[]).then(installations=>{resources.installations=installations.filter(x=>x.state==='active')}).catch(()=>{}));if(availability.cloudflareTail)pending.push(request('/api/v1/integrations/cloudflare-tail').then(tails=>{resources.tailInstallations=tails;options(triggerForm.elements.tailIntegrationId,tails,'name','integrationId')}).catch(()=>{}));await Promise.all(pending)} -async function init(){const [targets,jobs,current]=await Promise.all([request('/api/v1/execution-targets'),request('/api/v1/jobs'),jobId?request('/api/v1/jobs/'+encodeURIComponent(jobId)):null]);resources.targets=targets;resources.jobs=jobs;options(form.executionTargetId,targets,'name');if(current){form.name.value=current.name;form.slug.value=current.slug;form.promptTemplate.value=current.promptTemplate;form.concurrencyLimit.value=current.concurrencyLimit;form.executionTargetId.value=current.executionTargetId;triggers=current.triggers.map(t=>({...t,config:{...t.config}}))}else triggers=[{kind:'manual',slug:'trigger-1',enabled:true,config:{}}];syncModels(current?.model||'',current?.effort||'');highlightPrompt();reservedSlugs=new Set(triggers.map(t=>t.slug));render();await refreshAvailability();loadProviderResources()} -form.executionTargetId.addEventListener('change',()=>syncModels('','')); -window.addEventListener('focus',()=>refreshAvailability().catch(()=>{}));window.addEventListener('pageshow',()=>refreshAvailability().catch(()=>{})); -form.onsubmit=async e=>{e.preventDefault();const error=$('#error');error.classList.add('hidden');try{if(!triggers.length)throw new Error('Add at least one trigger.');const body={name:form.name.value,slug:form.slug.value,promptTemplate:form.promptTemplate.value,model:form.model.value.trim(),effort:form.effort.value.trim(),concurrencyLimit:Number(form.concurrencyLimit.value),executionTargetId:form.executionTargetId.value,triggers:triggers.map(({id,slug,kind,enabled,config})=>({id,slug,kind,enabled,config}))};const result=await request('/api/v1/jobs'+(jobId?'/'+encodeURIComponent(jobId):''),{method:jobId?'PUT':'POST',headers:{'content-type':'application/json'},body:JSON.stringify(body)});location.href='/jobs/'+encodeURIComponent(result.id)}catch(e){error.textContent=e.message;error.classList.remove('hidden');error.scrollIntoView({block:'center'})}};init().catch(e=>{const error=$('#error');error.textContent=e.message;error.classList.remove('hidden')});`); - -export const jobDetailPage = (viewer: { email: string }, jobId: string) => shell("Job — Factorize", viewer, `

Loading job…

-

Run job manually

Add an optional prompt for this run.

`, `${uiHelpers} -const id=$('#job-detail').dataset.id,root=$('#job-detail'); -const manualRunDialog=$('#manual-run-dialog'),manualRunForm=$('#manual-run-form'); -function openManualRun(){closeRunMenu();$('#manual-run-error').classList.toggle('hidden',!runError);manualRunDialog.showModal();$('#manual-run-prompt').focus()} -$('#cancel-manual-run').onclick=()=>manualRunDialog.close();manualRunDialog.onclick=e=>{if(e.target===manualRunDialog)manualRunDialog.close()}; -let manualRunPending=false,manualSubmission=null,runError=''; -function setRunPending(value){manualRunPending=value;['run','run-options','run-with-prompt','submit-manual-run'].forEach(id=>{const button=$('#'+id);if(button){button.disabled=value;if(id==='run')button.textContent=value?'Starting…':'Run'}});const error=$('#run-error');if(error){error.textContent=runError;error.hidden=!runError}let indicator=$('[data-pending-run]');if(value&&!indicator){root.querySelector('[data-job-runs-section]')?.insertAdjacentHTML('afterbegin','

Starting… Awaiting acceptance of your run request.

')}if(!value)indicator?.remove()} -async function submitManualRun(input){ - if(manualRunPending)return; - if(!manualSubmission||JSON.stringify(manualSubmission.input)!==JSON.stringify(input))manualSubmission={input,idempotencyKey:crypto.randomUUID()}; - runError='';closeRunMenu();setRunPending(true);manualRunDialog.close();mutationGeneration++; - try{const x=await request('/api/v1/jobs/'+encodeURIComponent(id)+'/invocations',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({...input,idempotencyKey:manualSubmission.idempotencyKey})});manualSubmission=null;location.href='/job-runs/'+encodeURIComponent(x.runId)} - catch(e){runError=e.message+(e.definitive?'':' Outcome unknown. Retry uses the same submission key.');setRunPending(false);const error=$('#manual-run-error');error.textContent=runError;error.classList.remove('hidden');reconcile(()=>jobRefresh.refresh())} - finally{mutationGeneration++} -} -function closeRunMenu(restoreFocus=false){const menu=$('#run-menu'),button=$('#run-options');if(!menu)return;menu.hidden=true;button.setAttribute('aria-expanded','false');if(restoreFocus)button.focus()} -document.addEventListener('click',e=>{if(!e.target.closest('[data-run-actions]'))closeRunMenu()}); -document.addEventListener('focusin',e=>{if(!e.target.closest('[data-run-actions]'))closeRunMenu()}); -document.addEventListener('keydown',e=>{if(e.key==='Escape'&&$('#run-menu')&&!$('#run-menu').hidden){e.preventDefault();closeRunMenu(true)}}); -async function runImmediately(){return submitManualRun({})} -manualRunForm.onsubmit=e=>{e.preventDefault();return submitManualRun({prompt:manualRunForm.elements.prompt.value})}; -const activeRunStates=['queued','starting','running','blocked','stopping'];let elapsedTimer; -function elapsedSince(value){const seconds=Math.max(0,Math.floor((Date.now()-new Date(value).getTime())/1000)),hours=Math.floor(seconds/3600),minutes=Math.floor(seconds%3600/60),remainder=seconds%60;return(hours?hours+'h ':'')+(minutes||hours?minutes+'m ':'')+remainder+'s elapsed'} -function refreshRunElapsed(){document.querySelectorAll('[data-run-started]').forEach(label=>label.textContent=elapsedSince(label.dataset.runStarted))} -let jobSnapshot,jobActive=false,enabledOverride; -function applyEnabled(){const button=$('#toggle');if(button&&enabledOverride!==undefined){button.textContent=pendingMutations.has('#toggle')?(enabledOverride?'Enabling…':'Disabling…'):(enabledOverride?'Disable':'Enable');const badge=$('[data-enabled-badge]');if(badge)badge.textContent=enabledOverride?'Enabled':'Disabled'}} -async function load(){if(jobRunsState.loading)return;jobRunsState.loading=true;try{const generation=mutationGeneration;const cursor=jobRunsState.cursors[jobRunsState.page];const [j,runs]=await Promise.all([request('/api/v1/jobs/'+encodeURIComponent(id)),request('/api/v1/runs?jobId='+encodeURIComponent(id)+'&limit='+jobRunsPageSize+(cursor?'&cursor='+encodeURIComponent(cursor):''))]);if(generation!==mutationGeneration){reconcile(()=>jobRefresh.refresh());return}if(enabledOverride!==undefined){if(!pendingMutations.has('#toggle'))enabledOverride=undefined;else j.enabled=enabledOverride}const triggers=j.triggers||[],status=jobStatus(j),hasActiveRuns=runs.items.some(r=>activeRunStates.includes(r.state));jobActive=j.runningCount>0||hasActiveRuns;const snapshot=JSON.stringify([j,runs,jobRunsState.page]);if(snapshot===jobSnapshot)return;jobSnapshot=snapshot;clearInterval(elapsedTimer);jobRunsState.runs=runs;replacePageContent(root,'

'+esc(j.name)+'

'+esc(j.runningCount)+'/'+esc(j.concurrencyLimit)+' Running'+''+(j.enabled?'Enabled':'Disabled')+''+'
Details
Triggers
'+(triggers.length?triggers.map(t=>triggerBadge(t.kind)).join(' '):'None')+'
Model
'+esc(j.model||'Harness default')+'
Name template
'+esc(j.runNameTemplate||'Default run name')+'

Prompt template

'+esc(j.promptTemplate)+'
Edit

Runs

'+(runs.items.length?jobRunsMarkup(runs):'

No runs yet.

')+'
',refreshJobRunsPagination);if(hasActiveRuns)elapsedTimer=setInterval(refreshRunElapsed,1000);setRunPending(manualRunPending);$('#run').onclick=runImmediately;$('#run-with-prompt').onclick=openManualRun;$('#run-options').onclick=()=>{const menu=$('#run-menu');menu.hidden=!menu.hidden;$('#run-options').setAttribute('aria-expanded',String(!menu.hidden));if(!menu.hidden)$('#run-with-prompt').focus()};$('#run-options').onkeydown=e=>{if(e.key==='ArrowDown'){e.preventDefault();$('#run-menu').hidden=false;$('#run-options').setAttribute('aria-expanded','true');$('#run-with-prompt').focus()}};applyEnabled();applyPendingMutations();$('#toggle').onclick=()=>mutate('#toggle',j.enabled?'Disabling…':'Enabling…',async()=>{const prior=j.enabled;enabledOverride=!prior;applyEnabled();try{const result=await request('/api/v1/jobs/'+encodeURIComponent(id)+'/'+(prior?'disable':'enable'),{method:'POST'});enabledOverride=result.enabled;j.enabled=result.enabled}catch(e){if(e.definitive)enabledOverride=prior;runError=e.message+(e.definitive?'':' Outcome unknown; checking server state.');setRunPending(manualRunPending)}finally{applyEnabled();reconcile(()=>jobRefresh.refresh())}});$('#delete').onclick=()=>{if(confirm('Delete this job and its queued history?'))mutate('#delete','Deleting…',async()=>{try{await request('/api/v1/jobs/'+encodeURIComponent(id),{method:'DELETE'});location.href='/jobs'}catch(e){runError=e.message;setRunPending(manualRunPending);reconcile(()=>jobRefresh.refresh())}})}}finally{jobRunsState.loading=false}} -const jobRefresh=pageRefresh(load,{delay:()=>jobActive?3000:10000,onError:e=>{if(!jobSnapshot)root.innerHTML='

'+esc(e.message)+'

'}});`); - -export const jobRunPage = (viewer: { email: string }, runId: string) => shell("Run — Factorize", viewer, `

Loading run…

`, `${uiHelpers} -const root=$('#run-detail'),id=root.dataset.id,activeStates=['queued','starting','running','blocked','stopping'];let elapsedTimer,traceCursor=0,traceDone=false,traceLoading=null,currentRun=null; -function triggerProvenance(r){ - const invocation=r.invocation; - if(!invocation)return '

Trigger

Trigger information is not available for this run.

'; - const labels={manual:'Manual',schedule:'Schedule',webhook:'Webhook',jobLifecycle:'Job lifecycle'},context=invocation.context||{},slugs=Object.keys(context),source=Object.hasOwn(labels,invocation.source)?labels[invocation.source]:(invocation.source||'Unknown'); - const row=(label,value)=>value?'
'+label+'
'+esc(value)+'
':''; - return '

Trigger

'+row('Type',source)+row('Trigger',slugs.join(', '))+row('Trigger ID',invocation.trigger_id)+row('Invoked at',invocation.created_at)+'
Trigger details
'+esc(JSON.stringify({context,...(invocation.occurrence?{occurrence:invocation.occurrence}:{})},null,2))+'
'; -} -${tracePresentationBrowserSource} -function loadTrace(reset=false){if(traceLoading)return traceLoading;traceLoading=fetchTrace(reset).finally(()=>{traceLoading=null});return traceLoading} -async function fetchTrace(reset=false){if(reset){traceCursor=0;traceDone=false;const list=$('[data-run-trace]');if(list)list.innerHTML=''}if(traceDone)return;const page=await request('/api/v1/runs/'+encodeURIComponent(id)+'/trace?after='+traceCursor+'&limit=100'),list=$('[data-run-trace]');if(!list)return;list.insertAdjacentHTML('beforeend',page.items.map(traceCard).join(''));list.classList.toggle('trace-at-end',!page.nextCursor);if(page.items.length)traceCursor=page.items.at(-1).sequence;traceDone=!page.nextCursor;const more=$('[data-trace-more]');if(more)more.classList.toggle('hidden',traceDone);const empty=$('[data-trace-empty]');if(empty)empty.classList.toggle('hidden',Boolean(list.children.length))} -function elapsed(r){if(!r.started_at)return ['queued','starting'].includes(r.state)?'Waiting to start':'Start time unavailable';const start=new Date(r.started_at).getTime(),end=activeStates.includes(r.state)?Date.now():new Date(r.updated_at||r.created_at).getTime(),seconds=Math.max(0,Math.floor((end-start)/1000)),hours=Math.floor(seconds/3600),minutes=Math.floor(seconds%3600/60),remainder=seconds%60;return(hours?hours+'h ':'')+(minutes||hours?minutes+'m ':'')+remainder+'s elapsed'} -function queueTime(r){if(!r.started_at&&!['queued','starting'].includes(r.state))return '';const seconds=Math.max(0,Math.floor((new Date(r.started_at||Date.now()).getTime()-new Date(r.created_at).getTime())/1000));return seconds+'s '+(r.started_at?'queue time':'waiting to start')} -function updateElapsed(r){const queue=$('[data-run-queue]');if(queue)queue.textContent=queueTime(r);const label=$('[data-run-elapsed]');if(label)label.textContent=elapsed(r);clearInterval(elapsedTimer);if(activeStates.includes(r.state))elapsedTimer=setInterval(()=>{const current=$('[data-run-elapsed]');if(current)current.textContent=elapsed(r);const queue=$('[data-run-queue]');if(queue)queue.textContent=queueTime(r)},1000)} -function traceSourceLabel(r){const source=r.trace_projection?.source_kind||r.trace_sources?.primary?.kind||'native_session';return (source==='execution_stream'?'Execution stream':'Native session')+' · '+(r.trace_sources?.primary?.provider||r.agent_kind||'agent')+' · '+(r.artifact_state||'pending')+(r.trace_projection?.source_kind==='native_session'&&r.trace_sources?.primary?.kind==='execution_stream'?' · Native fallback':'')} -function updateRun(r){ - currentRun=r; - root.classList.toggle('trace-running',r.state==='running'); - const activity=$('[data-trace-activity]');if(activity)activity.hidden=r.state!=='running'; - const state=$('[data-run-state]');if(state)state.innerHTML=stateBadge(r.state); - if(!['starting','running','blocked'].includes(r.state))$('#kill-run')?.remove(); - const live=$('[data-run-live]');if(live)live.hidden=!activeStates.includes(r.state); - const artifact=$('[data-run-artifact]');if(artifact)artifact.textContent=traceSourceLabel(r)+(r.artifact_error?' · '+r.artifact_error:''); - updateElapsed(r); -} -async function refreshOutput(){const generation=mutationGeneration;const r=await request('/api/v1/runs/'+encodeURIComponent(id));if(generation!==mutationGeneration){reconcile(()=>runRefresh.refresh());return}const reset=currentRun&&(r.trace_generation!==currentRun.trace_generation||JSON.stringify(r.trace_projection)!==JSON.stringify(currentRun.trace_projection)||(activeStates.includes(currentRun.state)&&!activeStates.includes(r.state)));updateRun(r);if(traceLoading)await traceLoading;traceDone=false;await loadTrace(Boolean(reset))} -async function loadRun(){return request('/api/v1/runs/'+encodeURIComponent(id)).then(async r=>{const canKill=['starting','running','blocked'].includes(r.state),runLabel=r.name||r.run_name||r.issue_title||'Run '+r.id.slice(0,8);document.title=runLabel+' — Factorize';root.innerHTML='

'+esc(runLabel)+'

'+elapsed(r)+'

'+queueTime(r)+'

'+stateBadge(r.state)+''+(canKill?'':'')+'
'+triggerProvenance(r)+'
Prompt
'+esc(r.prompt||'Prompt is not available for this run.')+'

Trace

'+esc(traceSourceLabel(r))+'

'+(activeStates.includes(r.state)?'Live · refreshes automatically':'')+'

Trace events are not available yet.

';if(canKill)$('#kill-run').onclick=()=>{if(!confirm('Request this run to stop? It remains visible until the backend confirms termination.'))return;mutate('#kill-run','Stopping…',async()=>{try{const result=await request('/api/v1/runs/'+encodeURIComponent(id)+'/kill',{method:'POST'});updateRun({...currentRun,state:result.state})}catch(e){let error=$('[data-stop-error]');if(!error){root.insertAdjacentHTML('afterbegin','

');error=$('[data-stop-error]')}error.textContent=e.message+(e.definitive?'':' Outcome unknown; checking server state.')}reconcile(()=>runRefresh.refresh())})};$('[data-trace-more]').onclick=()=>{traceDone=false;loadTrace().catch(()=>{})};updateRun(r);await loadTrace()})} -const runRefresh=pageRefresh(async()=>{if(!currentRun)await loadRun();else await refreshOutput()},{delay:()=>activeStates.includes(currentRun.state)?3000:['pending','collecting'].includes(currentRun.artifact_state)?10000:null,onError:e=>{if(!currentRun)root.innerHTML='

'+esc(e.message)+'

'}});`); - -const settingsLayout = (active: "integrations" | "api-keys", content: string) => `
${content}
`; - -const integrationIcons: Record = { - linear: ``, - clickup: ``, - github: ``, - exe: ``, - amp: ``, - tail: ``, -}; - -export const settingsPage = (viewer: { email: string }) => shell("Integrations — Factorize", viewer, settingsLayout("integrations", `${dashboardHead("Integrations", "Connect every provider used by your Jobs. Stored credentials are write-only and are never displayed.")} - -

Available integrations

Choose a provider to review setup before anything changes.

-${[["linear","Linear","Issues and projects"],["clickup","ClickUp","Tasks and lists"],["github","GitHub","Repositories and triggers"],["exe","Exe.dev","VM execution"],["amp","Amp","Cloud execution"],["tail","Cloudflare Tail","Signed Worker Tail events"]].map(([id,name,description])=>``).join("")} -
-

Connect Linear

You’ll leave Factorize to authorize access to your Linear workspace, then return here.

-

Connect ClickUp

Authorize a ClickUp workspace. Factorize will register the task webhook automatically.

-

Install the GitHub App

You’ll choose an account and repositories on GitHub, then return to Factorize.

-

Connect Exe.dev

Each run creates and then deletes an isolated VM. The token must allow ls, integrations list, new, ssh, and rm.

-

Connect Amp

This verifies and stores a write-only token for an Amp cloud project.

-

Install Cloudflare Tail

Name the installation and paste a secret, or have Factorize generate one.

-

Installed integrations

Check status and manage providers already connected to Factorize.

Loading installed integrations…
`), `${uiHelpers} -const badge=(id,label,tone)=>{const el=$(id);el.textContent=label;el.className='text-xs font-medium '+(tone==='warn'?'text-amber-700 dark:text-amber-300':'text-slate-500 dark:text-slate-400')}; -const integrationIcons=${JSON.stringify(integrationIcons)}; -const testButton=(kind,id)=>''; -const installedRow=(name,description,status,tone,actions)=>'
'+integrationIcons[name==='Cloudflare Tail'?'tail':name==='Exe.dev'?'exe':name.toLowerCase()]+'

'+esc(name)+'

Actions
'+actions+'

'+description+'

'+esc(status)+'
'; -async function disconnectGitHub(id){if(!confirm('Disconnect this GitHub installation from Factorize?'))return;await mutate('[data-disconnect-github="'+id+'"]','Disconnecting…',async()=>{await request('/api/v1/providers/github/installations/'+encodeURIComponent(id),{method:'DELETE'});reconcile(load)})} -async function load(){const generation=mutationGeneration;const loading=$('#installed-loading'),list=$('#installed-integrations'),table=$('#installed-table'),empty=$('#installed-empty');loading.classList.remove('hidden');table.classList.add('hidden');empty.classList.add('hidden');$('#integration-error').classList.add('hidden');try{const [s,gh]=await Promise.all([request('/api/v1/integrations'),fetch('/api/v1/providers/github/installations')]),tails=s.cloudflareTail.installations,rows=[];const exe=s.exeConnections||[],amps=s.ampConnections||[];badge('#linear-available-status',(s.linear?1:0)+' installed','neutral');badge('#clickup-available-status',(s.clickup?1:0)+' installed','neutral');badge('#exe-available-status',exe.length+' installed','neutral');badge('#amp-available-status',amps.length+' installed','neutral');badge('#tail-available-status',tails.length+' installed','neutral');$('#linear-action').textContent=s.linear?'Reconnect Linear':'Continue to Linear';if(s.linear)rows.push(installedRow('Linear',esc(s.linear.organizationName||'Linear workspace')+(s.linear.viewerEmail?' · '+esc(s.linear.viewerEmail):''),'Connected','ok',''));if(s.clickup)rows.push(installedRow('ClickUp',esc(s.clickup.teamName||'ClickUp workspace'),'Connected','ok',''));exe.forEach(c=>rows.push(installedRow('Exe.dev',esc(c.agentKind)+(c.models?.length?' · '+c.models.length+' models':'')+(c.tags?.length?' · tags: '+esc(c.tags.join(', ')):' · no VM tags'),'Connected','ok',testButton('exe',c.connectionId)+'')));amps.forEach(c=>rows.push(installedRow('Amp',esc(c.project),'Connected','ok',testButton('amp',c.connectionId)+'')));tails.forEach(c=>rows.push(installedRow('Cloudflare Tail',esc(c.name)+(c.referencedJobCount?' · '+c.referencedJobCount+' jobs':''),'Connected','ok','')));if(gh.status===404){badge('#github-available-status','Unavailable','neutral');$('#github-install').classList.add('hidden')}else if(!gh.ok){badge('#github-available-status','Action required','warn');rows.push(installedRow('GitHub','Installation status could not be loaded.','Action required','warn',''))}else{const installs=await gh.json(),active=installs.filter(x=>x.state==='active');badge('#github-available-status',active.length+' installed',installs.length&&!active.length?'warn':'neutral');$('#github-install').textContent=active.length?'Add another installation':'Continue to GitHub';installs.forEach(x=>rows.push(installedRow('GitHub',esc(x.accountLogin||'Installation '+x.installationId)+' · '+esc(x.accountType||'GitHub'),x.state==='active'?'Connected':x.state,'active'===x.state?'ok':'warn','Configure ↗')))}if(generation!==mutationGeneration){reconcile(load);return}list.innerHTML=rows.join('');loading.classList.add('hidden');table.classList.toggle('hidden',!rows.length);empty.classList.toggle('hidden',rows.length>0);bindActions();applyPendingMutations()}catch(e){loading.classList.add('hidden');empty.classList.remove('hidden');const error=$('#integration-error');error.textContent=e.message||'Could not load integration status. Try again.';error.classList.remove('hidden');['linear','clickup','github','exe','amp','tail'].forEach(id=>badge('#'+id+'-available-status','Unavailable','neutral'))}} -function openSetup(kind){const dialog=$('#'+kind+'-setup');if(!dialog.open)dialog.showModal()} -function closeSetup(kind){const dialog=$('#'+kind+'-setup');if(dialog.open)dialog.close()} -async function tailAction(id,method){await mutate('[data-disconnect-tail="'+id+'"]','Disconnecting…',async()=>{await request('/api/v1/integrations/cloudflare-tail/'+encodeURIComponent(id),{method});reconcile(load)})} -function bindActions(){bindTests();document.querySelectorAll('[data-open-setup]').forEach(button=>button.onclick=()=>{if(button.dataset.openSetup==='tail'){delete $('#tail-connection').dataset.id;$('#tail-connection').reset()}openSetup(button.dataset.openSetup)});document.querySelectorAll('[data-close-setup]').forEach(button=>button.onclick=()=>closeSetup(button.dataset.closeSetup));document.querySelectorAll('dialog').forEach(dialog=>dialog.onclick=e=>{if(e.target===dialog)dialog.close()});document.querySelectorAll('[data-disconnect-github]').forEach(button=>button.onclick=()=>disconnectGitHub(button.dataset.disconnectGithub).catch(showError));document.querySelectorAll('[data-disconnect-tail]').forEach(button=>button.onclick=()=>{if(confirm('Disconnect this Tail installation? Jobs using it will need another installation.'))tailAction(button.dataset.disconnectTail,'DELETE').catch(showError)});document.querySelectorAll('[data-test-tail]').forEach(button=>button.onclick=async()=>{if(button.disabled)return;button.disabled=true;button.textContent='Testing…';try{await request('/api/v1/integrations/cloudflare-tail/'+encodeURIComponent(button.dataset.testTail)+'/test',{method:'POST'});button.textContent='Connected'}catch(e){button.textContent='Action required'}finally{button.disabled=false}});document.querySelectorAll('[data-configure-tail]').forEach(button=>button.onclick=()=>{const form=$('#tail-connection');form.dataset.id=button.dataset.configureTail;form.elements.name.value=button.dataset.name;openSetup('tail')})} -function showError(e){const error=$('#integration-error');error.textContent=(e.message||'The integration action failed.')+(e.definitive?'':' Check server state before retrying.');error.classList.remove('hidden')} -function bindTests(){document.querySelectorAll('[data-test]').forEach(button=>button.onclick=async()=>{ - const kind=button.dataset.test,id=button.dataset.id,selector='[data-test="'+kind+'"][data-id="'+id+'"]'; - if(pendingMutations.has(selector))return; - let label='Action required'; - await mutate(selector,'Testing…',async()=>{try{const result=await request('/api/v1/integrations/'+kind+'/test',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({connectionId:id})});label=result.ok?'Connected':'Action required'}catch(e){showError(e)}}); - document.querySelectorAll(selector).forEach(current=>current.textContent=label); -})} - -document.addEventListener('click',async event=>{const button=event.target.closest('[data-remove-integration]');if(!button||!confirm('Remove this integration?'))return;if(button.disabled)return;return mutate('[data-remove-integration="'+button.dataset.removeIntegration+'"][data-id="'+button.dataset.id+'"]','Removing…',async()=>{try{await request('/api/v1/integrations/'+button.dataset.removeIntegration+'/'+encodeURIComponent(button.dataset.id),{method:'DELETE'});button.closest('article')?.remove();reconcile(load)}catch(error){showError(error);reconcile(load)}})}); -const exePayload=()=>{const form=$('#connection');return {apiToken:form.elements.apiToken.value,agentKind:form.elements.agentKind.value,tags:[...form.elements.tags.selectedOptions].map(option=>option.value)}}; -let exeTokenTimer=0,exeTokenRequest=0,verifiedExeToken='';async function testExeToken(){const form=$('#connection'),m=$('#settings-message'),status=$('#exe-token-status'),valid=$('#exe-token-valid'),button=$('#test-exe-token'),token=form.elements.apiToken.value.trim(),requestId=++exeTokenRequest;if(!token)return;button.disabled=true;status.textContent='Testing token and loading tags…';try{const result=await request('/api/v1/integrations/exe/test',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({apiToken:token})});if(requestId!==exeTokenRequest||token!==form.elements.apiToken.value.trim())return;if(!result.ok){verifiedExeToken='';valid.classList.add('hidden');valid.classList.remove('flex');status.textContent=result.missingPermissions.length?'Missing required permissions: '+result.missingPermissions.join(', '):'The token could not be verified. Check that it is valid and try again.';return}verifiedExeToken=token;valid.classList.remove('hidden');valid.classList.add('flex');form.elements.tags.replaceChildren(...result.tags.map(tag=>new Option(tag,tag)));form.elements.tags.disabled=false;status.textContent=result.tags.length?'Token verified. Select the VM tags to attach.':'Token verified. No integration tags were found.';m.textContent=''}catch(error){if(requestId===exeTokenRequest){verifiedExeToken='';valid.classList.add('hidden');valid.classList.remove('flex');status.textContent=error.message}}finally{if(requestId===exeTokenRequest)button.disabled=false}}$('#test-exe-token').onclick=testExeToken;$('#connection').elements.apiToken.addEventListener('input',event=>{clearTimeout(exeTokenTimer);exeTokenRequest++;verifiedExeToken='';const form=$('#connection'),valid=$('#exe-token-valid'),status=$('#exe-token-status'),token=event.target.value.trim();valid.classList.add('hidden');valid.classList.remove('flex');form.elements.tags.disabled=true;status.textContent=token?'Waiting for you to finish typing…':'Token testing starts automatically after you finish typing.';if(token.length>=16)exeTokenTimer=setTimeout(testExeToken,500)}); -$('#connection').onsubmit=async e=>{e.preventDefault();return mutate('#connection button[type=submit]','Creating…',async()=>{const form=e.currentTarget,m=$('#settings-message');try{m.textContent='Creating a temporary VM to validate the agent and load models…';await request('/api/v1/integrations/exe',{method:'PUT',headers:{'content-type':'application/json'},body:JSON.stringify(exePayload())});form.reset();verifiedExeToken='';$('#exe-token-valid').classList.add('hidden');$('#exe-token-valid').classList.remove('flex');$('#exe-token-status').textContent='Token testing starts automatically after you finish typing.';form.elements.tags.disabled=true;m.textContent='VM connection saved.';await load()}catch(x){m.textContent=x.message}})}; -const ampPayload=()=>{const d=new FormData($('#amp-connection'));return {project:d.get('project'),accessToken:d.get('accessToken'),apiBaseUrl:d.get('apiBaseUrl')}};$('#test-amp').onclick=()=>mutate('#test-amp','Testing…',async()=>{const m=$('#amp-message');try{const x=await request('/api/v1/integrations/amp/test',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(ampPayload())});m.textContent=x.ok?'Amp connection succeeded.':'Amp connection needs attention.'}catch(x){m.textContent=x.message}});$('#amp-connection').onsubmit=async e=>{e.preventDefault();return mutate('#amp-connection button[type=submit]','Creating…',async()=>{const form=e.currentTarget,m=$('#amp-message');try{await request('/api/v1/integrations/amp',{method:'PUT',headers:{'content-type':'application/json'},body:JSON.stringify(ampPayload())});form.reset();m.textContent='Amp connection saved. The token remains write-only.';await load()}catch(x){m.textContent=x.message}})}; -$('#tail-connection').onsubmit=async e=>{e.preventDefault();return mutate('#tail-connection button[type=submit]','Creating…',async()=>{const form=e.currentTarget,d=new FormData(form),m=$('#tail-message'),id=form.dataset.id,url='/api/v1/integrations/cloudflare-tail'+(id?'/'+encodeURIComponent(id):'');try{const x=await request(url,{method:id?'PUT':'POST',headers:{'content-type':'application/json'},body:JSON.stringify({name:d.get('name'),signingSecret:d.get('signingSecret')||undefined,generateSecret:d.get('generateSecret')==='on'})});if(x.generatedSecret){$('#tail-generated-value').textContent=x.generatedSecret;$('#tail-generated').classList.remove('hidden')}form.reset();delete form.dataset.id;m.textContent='Tail installation saved. Its secret remains write-only.';await load()}catch(x){m.textContent=x.message}})};$('#copy-tail-secret').onclick=async()=>{await navigator.clipboard.writeText($('#tail-generated-value').textContent);$('#copy-tail-secret').textContent='Copied'};bindActions();load();`); - -export const apiKeysSettingsPage = (viewer: { email: string }) => shell("API Keys — Factorize", viewer, settingsLayout("api-keys", `${dashboardHead("API Keys", "Manage API keys for programmatic access to Factorize.")} - -

Authorized clients

OAuth, MCP, and API clients you have allowed to access Factorize.

Loading authorized clients…
-

Access Tokens

Create scoped bearer tokens for scripts and API requests.

- - -

Authorization header

Authorization: Bearer <token>
-
Loading access tokens…
`), `${uiHelpers} -const date=value=>value?new Intl.DateTimeFormat(undefined,{dateStyle:'medium',timeStyle:'short'}).format(new Date(value)):'Never'; -const scopes=value=>(value||[]).map(scope=>''+esc(scope)+'').join(' ')||'None'; -const accessError=message=>{const error=$('#access-error');error.textContent=message||'Could not complete the request. Try again.';error.classList.remove('hidden');error.scrollIntoView({block:'nearest'})}; -const clientRow=client=>'

'+esc(client.clientName)+'

Client '+esc(client.clientId)+'

'+scopes(client.scopes)+'
Authorized
'+date(client.authorizationDate)+'
Last used
'+date(client.lastUsedAt)+'
Authorization expires
'+date(client.expiresAt)+'
'; -const tokenRow=token=>'

'+esc(token.name)+'

'+scopes(token.scopes)+'
Expires
'+date(token.expires_at)+'
Created
'+date(token.created_at)+'
Last used
'+date(token.last_used_at)+'
'; -async function loadClients(){const generation=mutationGeneration;const loading=$('#clients-loading'),root=$('#authorized-clients'),empty=$('#clients-empty');loading.classList.remove('hidden');try{const clients=await request('/api/v1/access/authorized-clients');if(generation!==mutationGeneration){reconcile(loadClients);return}root.innerHTML=clients.map(clientRow).join('');root.classList.toggle('hidden',!clients.length);empty.classList.toggle('hidden',clients.length>0);bindClientActions();applyPendingMutations()}catch(error){empty.classList.remove('hidden');accessError(error.message)}finally{loading.classList.add('hidden')}} -async function loadTokens(){const generation=mutationGeneration;const loading=$('#tokens-loading'),root=$('#access-tokens'),empty=$('#tokens-empty');loading.classList.remove('hidden');try{const tokens=(await request('/api/v1/access-tokens')).filter(token=>!token.revoked_at);if(generation!==mutationGeneration){reconcile(loadTokens);return}root.innerHTML=tokens.map(tokenRow).join('');root.classList.toggle('hidden',!tokens.length);empty.classList.toggle('hidden',tokens.length>0);bindTokenActions();applyPendingMutations()}catch(error){empty.classList.remove('hidden');accessError(error.message)}finally{loading.classList.add('hidden')}} -function bindClientActions(){document.querySelectorAll('[data-disconnect-client]').forEach(button=>button.onclick=async()=>{if(!confirm('Disconnect '+button.dataset.clientName+'? All of its tokens will stop working immediately.'))return;return mutate('[data-disconnect-client="'+button.dataset.disconnectClient+'"]','Disconnecting…',async()=>{try{await request('/api/v1/access/authorized-clients/'+encodeURIComponent(button.dataset.disconnectClient),{method:'DELETE'});button.closest('article')?.remove();reconcile(loadClients)}catch(error){accessError(error.message+(error.definitive?'':' Outcome unknown; checking server state.'));reconcile(loadClients)}})})} -function bindTokenActions(){document.querySelectorAll('[data-revoke-token]').forEach(button=>button.onclick=async()=>{if(!confirm('Revoke the access token “'+button.dataset.tokenName+'”? It will stop working immediately.'))return;return mutate('[data-revoke-token="'+button.dataset.revokeToken+'"]','Revoking…',async()=>{try{await request('/api/v1/access-tokens/'+encodeURIComponent(button.dataset.revokeToken),{method:'DELETE'});button.closest('article')?.remove();reconcile(loadTokens)}catch(error){accessError(error.message+(error.definitive?'':' Outcome unknown; checking server state.'));reconcile(loadTokens)}})})} -const form=$('#token-form');$('#open-token-form').onclick=()=>{form.classList.remove('hidden');$('#open-token-form').classList.add('hidden');form.elements.name.focus()};$('#cancel-token-form').onclick=()=>{form.reset();form.classList.add('hidden');$('#open-token-form').classList.remove('hidden');$('#token-form-error').classList.add('hidden')}; -document.querySelectorAll('[data-scope-preset]').forEach(button=>button.onclick=()=>{const read=button.dataset.scopePreset==='read';form.querySelectorAll('[name=scope]').forEach(input=>input.checked=!read||input.value.endsWith(':read'))}); -form.onsubmit=async event=>{event.preventDefault();const error=$('#token-form-error'),submit=form.querySelector('button[type="submit"]');error.classList.add('hidden');if(!submit){error.textContent='The create-token action is unavailable. Refresh and try again.';error.classList.remove('hidden');return}const selected=[...form.querySelectorAll('[name=scope]:checked')].map(input=>input.value);if(!selected.length){error.textContent='Select at least one scope.';error.classList.remove('hidden');return}if(submit.disabled)return;submit.disabled=true;submit.textContent='Creating…';try{const result=await request('/api/v1/access-tokens',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({name:form.elements.name.value,expiryDays:Number(form.elements.expiryDays.value),scopes:selected})});$('#new-token-value').textContent=result.token;const reveal=$('#new-token');reveal.classList.remove('hidden');reveal.focus();form.reset();form.classList.add('hidden');$('#open-token-form').classList.remove('hidden');await loadTokens()}catch(x){error.textContent=(x.message||'Could not create the access token.')+(x.definitive?'':' Outcome unknown. Check the token list before creating another token.');error.classList.remove('hidden')}finally{submit.disabled=false;submit.textContent='Create token'}}; -$('#copy-token').onclick=async()=>{const button=$('#copy-token');try{await navigator.clipboard.writeText($('#new-token-value').textContent);button.textContent='Copied'}catch{button.textContent='Select and copy the token'}setTimeout(()=>button.textContent='Copy',2000)}; -Promise.all([loadClients(),loadTokens()]);`); diff --git a/packages/app/test/ansi.test.mjs b/packages/app/test/ansi.test.mjs new file mode 100644 index 00000000..65c0a0fd --- /dev/null +++ b/packages/app/test/ansi.test.mjs @@ -0,0 +1,11 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { parseAnsi } from "../src/features/runs/ansi.ts"; +test("terminal styles preserve text and strip executable OSC links and cursor commands", () => { + const tokens = parseAnsi('\x1b]8;;javascript:alert(1)\x07\x1b]8;;\x07\x1b[31;1mRed\x1b[0m\x1b[2JPlain'); + assert.equal(tokens.map(token => token.text).join(""), 'RedPlain'); + assert.equal(tokens[1].style.color, "#ef4444"); assert.equal(tokens[1].style.fontWeight, 700); + assert.equal(tokens[2].style.color, undefined); + assert.equal(parseAnsi('\x1b[38;2;12;34;56mRGB')[0].style.color, "rgb(12,34,56)"); + assert.equal(parseAnsi('\x1b[38;5;200mIndexed')[0].style.color, "rgb(255,0,215)"); +}); diff --git a/packages/app/test/ansi.test.ts b/packages/app/test/ansi.test.ts deleted file mode 100644 index 5edfb82f..00000000 --- a/packages/app/test/ansi.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { ansiToHtml, ansiToHtmlBrowserSource } from "../src/ansi"; - -describe("ansiToHtml", () => { - it("renders standard, bright, indexed, and true-color SGR colors", () => { - const html = ansiToHtml("\u001b[31mred\u001b[44m on blue\u001b[0m plain \u001b[92mbright\u001b[38;5;208m indexed\u001b[38;2;1;2;3m rgb"); - expect(html).toContain('color:#ef4444'); - expect(html).toContain('background-color:#3b82f6'); - expect(html).toContain('color:#4ade80'); - expect(html).toContain('color:rgb(255,135,0)'); - expect(html).toContain('color:rgb(1,2,3)'); - expect(html).toContain(" plain "); - }); - - it("handles resets, bold, and dim independently", () => { - const html = ansiToHtml("\u001b[1;2mboth\u001b[22mnormal\u001b[31mred\u001b[39mdefault"); - expect(html).toContain("font-weight:700;opacity:.65"); - expect(html).not.toMatch(/>normal<\/span>/); - expect(html).toContain('color:#ef4444'); - expect(html).toContain("default"); - }); - - it("escapes HTML and strips malformed, partial, and unsupported control sequences", () => { - const html = ansiToHtml('\u001b[999mtext\u001b[31'); - expect(html).toContain('<script>alert("x")</script>'); - expect(html).toContain("text"); - expect(html).not.toContain(" Build", subtitle: "Matching job", url: "/jobs/" + id }] } })); + await page.goto(origin + "/jobs/" + id + "/edit"); + await page.getByLabel("Name", { exact: true }).fill("Unsaved draft"); + await page.getByRole("button", { name: "Search jobs and runs", exact: true }).click(); + await page.getByRole("textbox", { name: "Search jobs and runs", exact: true }).fill("build"); + await page.getByRole("listbox", { name: "Search results" }).getByRole("option").waitFor(); + assert.match(await page.getByRole("listbox", { name: "Search results" }).getByRole("option").innerText(), /", display: {} }], nextCursor: null, revision: "rev-1", reset: false } })); + await page.goto(origin + "/jobs/" + jobId); + await page.getByLabel("JSON data (optional)").fill("[]"); await page.getByRole("button", { name: "Invoke", exact: true }).click(); + await page.getByRole("alert").filter({ hasText: "JSON data must be an object" }).waitFor(); assert.equal(inputs.length, 0); + await page.getByLabel("JSON data (optional)").fill('{"build":42}'); await page.getByLabel("Prompt", { exact: true }).fill("Review"); + await page.getByRole("button", { name: "Invoke", exact: true }).click(); await page.getByRole("alert").filter({ hasText: "Try again" }).waitFor(); + await page.getByRole("button", { name: "Invoke", exact: true }).click(); await page.waitForURL(`**/job-runs/${runId}?**`); + await page.getByText("Thinking · reasoning", { exact: true }).click(); + await page.getByText("", { exact: true }).waitFor(); + assert.equal(inputs.length, 2); assert.equal(inputs[0].idempotencyKey, inputs[1].idempotencyKey); assert.deepEqual(inputs[1].data, { build: 42 }); + assert.equal(await page.locator("main script").count(), 0); await context.close(); +}); +test("trace reset between requests discards old pages and finalization keeps terminal polling alive", async () => { + const { page, context } = await contextFor(); + let statusCalls = 0, reset = false; + await page.route(`**/api/v1/runs/${runId}/status`, route => { statusCalls++; return route.fulfill({ json: { id: runId, job_id: jobId, job_name: "Review builds", run_name: "Run", state: "succeeded", finalizing: true, trace_revision: "old", artifact_state: "collecting", created_at: summary.createdAt, updated_at: summary.updatedAt, started_at: null, destination_url: null } }); }); + await page.route(`**/api/v1/runs/${runId}/trace-pages?**`, route => { + const query = new URL(route.request().url()).searchParams; + if (query.get("after") === "100") reset = true; + return route.fulfill({ json: { items: [{ id: reset ? "new" : "old", sequence: 1, type: "assistant_message", title: reset ? "New projection" : "Old projection", preview: "Safe text", display: {} }], nextCursor: reset ? null : 100, revision: reset ? "new" : "old", reset: reset && query.get("revision") === "old" } }); + }); + await page.goto(origin + "/job-runs/" + runId); await page.getByText("Old projection · assistant_message", { exact: true }).waitFor(); + await page.getByRole("link", { name: "Next trace page" }).click(); await page.getByText("New projection · assistant_message", { exact: true }).waitFor(); + await page.waitForURL("**?after=0"); + assert.equal(await page.getByText("Old projection · assistant_message", { exact: true }).count(), 0); + await page.waitForTimeout(2200); assert.ok(statusCalls >= 2); + await context.close(); +}); +test("20k-event continuous trace keeps DOM bounded, retains expanded details on scroll and resets generations", async () => { + const { page, context } = await contextFor(); let revision = "large", traceRequests = 0, peakNodes = 0; const started = performance.now(); + await page.route(`**/api/v1/runs/${runId}/status`, route => route.fulfill({ json: { id: runId, job_id: jobId, job_name: "Review builds", run_name: "Large trace", state: "succeeded", finalizing: true, trace_revision: revision, artifact_state: "stored", created_at: summary.createdAt, updated_at: summary.updatedAt, started_at: null, destination_url: null } })); + await page.route(`**/api/v1/runs/${runId}/trace-pages?**`, route => { + traceRequests++; const query = new URL(route.request().url()).searchParams, reset = !!query.get("revision") && query.get("revision") !== revision, after = reset ? 0 : Number(query.get("after") || 0), limit = Number(query.get("limit")), count = revision === "large" ? 20000 : 1; + return route.fulfill({ json: { items: Array.from({ length: Math.min(limit, count - after) }, (_, index) => ({ id: `${revision}-${after + index + 1}`, sequence: after + index + 1, type: "assistant_message", title: `${revision} event ${after + index + 1}`, preview: "Safe text", display: {} })), nextCursor: after + limit < count ? after + limit : null, revision, reset } }); + }); + await page.goto(origin + "/job-runs/" + runId); await page.getByLabel("Continuous virtualized trace").check(); + const region = page.getByRole("region", { name: "Continuous trace", exact: true }); + await page.getByText("large event 1 · assistant_message", { exact: true }).waitFor(); await page.getByText("large event 1 · assistant_message", { exact: true }).click(); + for (let count = 400; count <= 20000; count += 200) { + await region.evaluate(el => { el.scrollTop = el.scrollHeight; }); + await page.getByRole("status").filter({ hasText: `${count} events loaded` }).waitFor(); + peakNodes = Math.max(peakNodes, await region.locator("li").count()); + } + assert.ok(await region.locator("li").count() < 60); assert.ok(traceRequests <= 110); + await region.evaluate(el => { el.scrollTop = 0; }); await page.getByText("large event 1 · assistant_message", { exact: true }).waitFor(); assert.equal(await region.locator("details").first().getAttribute("open"), ""); + const loadMs = performance.now() - started, loadedRequests = traceRequests; + revision = "replayed"; + await page.getByText("replayed event 1 · assistant_message", { exact: true }).waitFor(); assert.equal(await page.getByText("large event 1 · assistant_message", { exact: true }).count(), 0); + if (process.env.GEN_2157_RECORD_TRACE) await writeFile(new URL("../../api/performance/gen-2157-trace-browser.json", import.meta.url), JSON.stringify({ date: "2026-10-09", browser: browser.version(), fixtureEvents: 20000, traceRequests: loadedRequests, peakMountedEvents: peakNodes, loadAllPagesMs: Number(loadMs.toFixed(2)), expandedStatePreserved: true, liveRevisionResetObserved: true, scope: "One compiled-SPA Chromium sample with mocked HTTP trace pages, includes Playwright scrolling and selector waits; no production network/DB or frame-time claim." }, null, 2) + "\n"); await context.close(); +}); diff --git a/packages/app/test/loading.browser.test.ts b/packages/app/test/loading.browser.test.ts deleted file mode 100644 index 2954b6dc..00000000 --- a/packages/app/test/loading.browser.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -// @vitest-environment happy-dom -import { afterEach, describe, expect, it, vi } from "vitest"; -import { jobRunPage, settingsPage } from "../src/ui"; -declare const document: any; -const render = (html: string) => { - document.body.innerHTML = html.match(/]*>([\s\S]*?)<\/body>/)![1]; - new Function([...html.matchAll(/", display: {} }], nextCursor: null, revision, reset: false } })); + await page.route(`**/api/v1/runs/${runId}`, route => { detailReads++; return route.fulfill({ json: { prompt: "Private prompt", invocation: { source: "manual", context: { build: 42 }, trigger_id: "trigger-fixture", created_at: time, occurrence: { delivery: "fixture" } }, activity: [{ action: "started", detail: "Launched", created_at: time }] } }); }); + await page.route(`**/api/v1/runs/${runId}/diagnostics`, route => { diagnosticReads++; return route.fulfill({ json: { state: "succeeded", artifact: { state: "stored" }, harnessLog: { object_key: "retained/log.txt" }, execution: { detail: "Safe diagnostic" } } }); }); + await page.route(`**/api/v1/runs/${runId}/trace/replay`, route => { replays.push(route.request().postDataJSON()); if (replays.length === 1) return route.fulfill({ status: 503, json: { error: { code: "unavailable", message: "Retry replay" } } }); revision = "new"; return route.fulfill({ json: { status: "projected" } }); }); + await page.goto(origin + "/job-runs/" + runId); await page.getByText("Old trace · assistant_message", { exact: true }).click(); assert.equal(detailReads, 0); assert.equal(diagnosticReads, 0); + assert.equal(await page.locator('a[href^="javascript:"]').count(), 0); assert.equal(await page.locator("main script").count(), 0); + await page.getByText("Prompt, context and provenance", { exact: true }).click(); await page.getByText("Private prompt", { exact: true }).waitFor(); await page.getByText("trigger-fixture", { exact: true }).waitFor(); await page.getByRole("heading", { name: "Trigger context and occurrence" }).waitFor(); await page.getByText("Diagnostics and artifacts", { exact: true }).click(); await page.getByText(/retained\/log.txt/).waitFor(); assert.equal(detailReads, 1); assert.equal(diagnosticReads, 1); + await page.getByText("Replay trace", { exact: true }).click(); page.once("dialog", dialog => dialog.accept()); await page.getByRole("button", { name: "Replay retained trace" }).click(); await page.getByRole("alert").filter({ hasText: "Retry replay" }).waitFor(); page.once("dialog", dialog => dialog.accept()); await page.getByRole("button", { name: "Replay retained trace" }).click(); await page.getByText("Replayed trace · assistant_message", { exact: true }).waitFor(); + assert.equal(replays[0].requestId, replays[1].requestId); assert.equal(await page.getByText("Old trace · assistant_message", { exact: true }).count(), 0); await context.close(); +}); +test("stopping a run submits once, observes stopping state and keeps terminal finalization visible", async () => { + const { context, page } = await setup(); let state = "running", stops = 0, releaseStop; const pendingStop = new Promise(resolve => { releaseStop = resolve; }); + await page.route(`**/api/v1/runs/${runId}/status`, route => route.fulfill({ json: { id: runId, job_id: jobId, job_name: "Job", run_name: "Run", state, finalizing: state === "stopped", trace_revision: "rev", artifact_state: "collecting", created_at: time, updated_at: time, started_at: time, destination_url: "https://example.test/run" } })); + await page.route(`**/api/v1/runs/${runId}/trace-pages?**`, route => route.fulfill({ json: { items: [{ id: "command", sequence: 1, type: "command", title: "Build command", preview: '\x1b[31m\x1b[0m', display: {} }], nextCursor: null, revision: "rev", reset: false } })); + await page.route(`**/api/v1/runs/${runId}/stop`, async route => { stops++; state = "stopping"; await pendingStop; return route.fulfill({ json: { state } }); }); + await page.goto(origin + "/job-runs/" + runId); await page.getByText("Build command · command", { exact: true }).click(); + const output = page.getByText("", { exact: true }); await output.waitFor(); assert.equal(await output.evaluate(node => getComputedStyle(node).color), "rgb(239, 68, 68)"); assert.equal(await page.locator("main script").count(), 0); + await page.getByRole("button", { name: "Stop run", exact: true }).click(); await page.waitForFunction(() => Array.from(document.querySelectorAll("button")).some(button => button.textContent === "Stop run" && button.disabled)); releaseStop(); + await page.getByRole("status").filter({ hasText: /^stopping$/ }).waitFor(); assert.equal(stops, 1); state = "stopped"; + await page.getByText("stopped · Finalizing trace and artifacts", { exact: true }).waitFor(); assert.equal(await page.getByRole("button", { name: "Stop run", exact: true }).count(), 0); + await context.close(); +}); diff --git a/packages/app/test/settings-mutations.browser.test.ts b/packages/app/test/settings-mutations.browser.test.ts deleted file mode 100644 index 4d4640f4..00000000 --- a/packages/app/test/settings-mutations.browser.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -// @vitest-environment happy-dom -import { afterEach, expect, it, vi } from "vitest"; -import { settingsPage } from "../src/ui"; -declare const document: any; -const flush=async()=>{for(let i=0;i<60;i++)await Promise.resolve()}; -const json=(body: unknown)=>Response.json(body); -afterEach(()=>{vi.unstubAllGlobals();document.body.innerHTML=""}); -it.each(["github","tail","exe"])("retains a %s connection while removal is pending and blocks repeated actions",async kind=>{ - let finish!: (response: Response)=>void,removed=false; - vi.stubGlobal("confirm",()=>true); - const fetcher=vi.fn(async(input: unknown,init?: RequestInit)=>{ - const url=String(input); - if(init?.method==="DELETE")return new Promise(resolve=>{finish=resolve}); - if(url.includes("github/installations"))return json(removed&&kind==="github"?[]:[{installationId:1,state:"active",accountLogin:"owner"}]); - if(url.includes("cloudflare-tail"))return json(removed&&kind==="tail"?[]:[{integrationId:"tail-1",name:"Tail"}]); - return json({cloudflareTail:{installations:removed&&kind==="tail"?[]:[{integrationId:"tail-1",name:"Tail"}]},exeConnections:removed&&kind==="exe"?[]:[{connectionId:"exe-1",agentKind:"codex"}]}); - }); - vi.stubGlobal("fetch",fetcher); - const html=settingsPage({email:"owner@example.com"}); - document.body.innerHTML=html.match(/]*>([\s\S]*?)<\/body>/)![1]; - new Function([...html.matchAll(/\n\n```js\n""\n```'})); - expect(node.querySelector('script,img,svg')).toBeNull(); - expect(node.textContent).toContain('@example.com' }); - expect(html).not.toContain('@example.com'); - expect(html).toContain("<script>"); - }); - - it("keeps Settings in the accessible profile menu and Jobs in primary navigation", () => { - const html = jobsPage({ email: "owner@example.com" }); - const header = html.match(//)?.[0] ?? ""; - const profileMenu = header.match(//)?.[0] ?? ""; - expect(header).toContain('href="/jobs" data-navigation="jobs"'); - expect(header).toContain('href="https://factorize.sh" class="flex items-center gap-2 text-lg font-bold tracking-tight"'); - expect(header).not.toMatch(/]*>Settings<\/a>
Settings")); - expect(profileMenu.indexOf(">Settings")).toBeLessThan(profileMenu.indexOf(">Log out")); - expect(profileMenu).toContain("border-t"); - expect(html).toContain("setAttribute('aria-current','page')"); - }); - - it("edits complete Linear AND rule sets in the current job editor", () => { - const html = jobPage({ email: "owner@example.com" }); - expect(html).toContain('id="linear-rules"'); - expect(html).toContain('id="add-linear-rule"'); - expect(html).toContain('id="github-rules"'); - expect(html).toContain('id="add-github-rule"'); - expect(html).toContain("matchRules:readGithubRules()"); - expect(html).toContain("status:'Status',label:'Label',assignee:'Assignee',creator:'Creator',owner:'Owner'"); - expect(html).toContain("const githubRuleOptions=type=>type==='status'?resources.githubOptions.statuses:type==='label'?resources.githubOptions.labels:resources.githubOptions.users;"); - expect(html).toContain("githubRuleOptions(type.value).map"); - expect(html).toContain("matchRules:readLinearRules()"); - expect(html).toContain("(c.matchRules?.length?c.matchRules:"); - expect(html).not.toContain("const legacyJobPage"); - expectInlineScriptsToParse(html); - }); - - it("combines trigger selection and addition into one accessible control", () => { - const html = jobPage({ email: "owner@example.com" }); - expect(html).toContain(''); - expect(html).toContain('