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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .agents/skills/publish-capture/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: publish-capture
description: Give concise publishing instructions for @replayio/self-healing-capture, or assist with its authorized release from the Self Healing repository.
---

# Publish the capture package

Read `packages/capture/package.json`, `scripts/publish-capture.ts`, and the release
section of `packages/capture/README.md` from the intended release revision. Confirm
the version from the manifest; do not carry a version number forward from an old
conversation. Use merged main unless the user specifies another reviewed revision.

## Giving instructions

Lead with one copy-pasteable shell command. Use the user's actual repository path,
properly shell-quoted. For a merged release that still needs to be pulled:

```sh
cd '<repository-path>' && git switch main && git pull --ff-only && npm ci && npm run capture:publish
```

If the terminal is already at the prepared release checkout, give only:

```sh
npm run capture:publish
```

State the Node requirement from the release docs (currently 22.14+) and that npm
will prompt for login/2FA with an account authorized to publish to `@replayio`.
That is normally the whole answer. Explain script internals or troubleshooting
only when relevant to the user's question. Keep CI/test infrastructure details in
development documentation rather than the user-facing publishing instructions.

The release script owns version-existence checks, verification, build, packing,
authentication, publication, and registry visibility checks. Use that entry point
rather than expanding its internals into manual commands. A request for instructions
means provide the command, not execute publication. Installing the release in a
customer application is a separate task.

## Assisting with an authorized release

Check for local changes before switching branches; preserve them. Run publication
in an interactive terminal so npm can handle its authentication prompts. Do not
request credentials in chat. For a requested rehearsal, use
`npm run capture:publish -- --dry-run`.

An already-published version is a successful no-op. If npm accepted publication but
registry visibility is pending, follow the script's printed verification command;
do not republish or bump the version merely because propagation is delayed.
Report the actual result and exact version. Merging the PR or deploying the service
does not establish npm publication.
13 changes: 12 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ jobs:
node-version: 22
cache: npm
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm test
- run: npm run build
- run: npm pack --workspace @replayio/self-healing-capture --pack-destination /tmp
browser-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm run test:browser
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
node-version: 22
cache: npm
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm test
- run: npm run build
- name: Check Infisical configuration
Expand Down
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ This is an initial Netlify/React/TypeScript service scaffold modeled on Loop QA.
- Keep factory/provider secrets server-side. Connections store only AES-GCM encrypted Subtext credentials, bound to their keyed fingerprint; never store plaintext keys. Do not add session recording data to the coordination database.
- Run relevant tests for changes. For the initial service, `npm test` covers the handler and real Postgres semantics through PGlite; `npm run build` checks TypeScript and the frontend.
- Keep deployment and database migration explicit. Preview environments must not share production databases or credentials.

For capture package publishing instructions or release assistance, use
[the publish-capture skill](.agents/skills/publish-capture/SKILL.md).
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ Use Node 22.13 or newer and npm. No provider account or database is needed to vi

```sh
npm ci
npx playwright install chromium # browser-backed capture selector tests
npm run dev # landing page only, http://localhost:5173
npm run dev:netlify # landing page + REST API, http://localhost:8888
npm test # isolated PGlite Postgres tests; no external services
npm run build # strict TypeScript check + production frontend
```

Browser-backed capture selector tests run separately in PR CI. To run them locally,
use `npx playwright install chromium` followed by `npm run test:browser`. They are
not part of `npm test`, production deployment, or package publishing.

For local database development, copy `.env.example` to `.env`, set `DATABASE_URL`, and apply the bootstrap migration with `node --env-file=.env --import tsx scripts/migrate.ts`. Netlify Dev loads `.env` automatically.

Provision with a **Subtext API key** using `POST /api/v1/accounts` (`provisionAccount`). It returns a **Self Healing account API key**. All subsequent API calls authenticate with that returned key, not the Subtext key. Each account has a dedicated QA service identity and token. Subtext and QA credentials stay encrypted server-side; QA receives only session-scoped proxy callbacks.
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"db:migrate": "node --import tsx scripts/migrate.ts",
"deploy:ci": "node --import tsx scripts/deploy-ci.ts",
"build:capture": "npm run build --workspace @replayio/self-healing-capture",
"capture:publish": "node --import tsx scripts/publish-capture.ts"
"capture:publish": "node --import tsx scripts/publish-capture.ts",
"test:browser": "node --import tsx --test tests/browser/*.test.ts"
},
"dependencies": {
"@neondatabase/serverless": "^0.10.0",
Expand Down
4 changes: 1 addition & 3 deletions packages/capture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ to UPGRADING.md and include verification steps.
Publish locally with interactive npm authentication and 2FA:

```sh
npm ci
npx playwright install chromium
npm run capture:publish
npm ci && npm run capture:publish
```

Run from a terminal using Node 22.14+ and an npm account with publishing access to `@replayio`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { test } from "node:test";
import { chromium } from "@playwright/test";
import { readFileSync } from "node:fs";
import ts from "typescript";
import type { interactionSelector as SelectorFunction } from "../packages/capture/src/interaction-selector.ts";
import type { interactionSelector as SelectorFunction } from "../../packages/capture/src/interaction-selector.ts";
// Serialize the package's TypeScript output, without tsx's Node-only function-name helpers.
const interactionSelector = new Function(
ts.transpileModule(
readFileSync(
new URL(
"../packages/capture/src/interaction-selector.ts",
"../../packages/capture/src/interaction-selector.ts",
import.meta.url,
),
"utf8",
Expand Down
Loading