feat(connector): M4 — @understudy/connector + publish pipeline - #4
Merged
Conversation
…th packages The understudy-side half of M4 (consumer integration + published contract): - packages/connector (@understudy/connector 0.1.0): reference breakwater connectors consumers import as Mastra tools — observe (snapshot/get_tabs/ wait, ungated read) / act (click/type/navigate/key/scroll/switch_tab; grant-gated, idempotent, dry-runnable, 60/min) / fillCredential (vaulted fill_secret, 30/min) — plus callBrowserWrite/callBrowserDryRun helpers mirroring metamind's shipped intake/connectors.ts. Deltas vs the smart-compliance sketch (it predates M3): bearer caller auth, fill_secret from protocol v0.3.0, full protocol coverage, an optional breakwater policies pass-through (audit/evaluators/fetch), and Mastra's silent input-validation sentinel normalized to a throw. Egress pins to URL.hostname (.host carries :port, which breakwater's allowlist rejects at construction — would have broken every wrangler-dev consumer loop). 22 tests against the real breakwater wrapper: grant fail-closed, wrong-connector grant, idempotent replay + release-on-throw retry, rate-limit denial, per-hop egress redirect denial, dry-run precedence, no-plaintext wire assertion. - Publish prep: MIT (LICENSE at root + per-package), files-scoped tarballs for @understudy/protocol 0.3.0 + @understudy/connector 0.1.0, npm READMEs, repository/keywords/sideEffects/prepublishOnly metadata. - Release flow: changesets + GitHub Actions (ci.yml: typecheck/test/build; release.yml: single-branch adaptation of anchorage's flow — Version Packages PR when changesets are pending, publish with tags/releases/ provenance when not). First master push publishes 0.3.0/0.1.0 directly (versions pre-set, no changeset needed). Requires the NPM_TOKEN secret; publish waits on the npm "understudy" org. - pnpm-workspace: minimumReleaseAgeExclude for @proofoftech/breakwater (every published version is younger than the 7-day quarantine). - Docs: root README pre-Topology-1 header rewritten; technical plan points at packages/connector as the canonical consumer reference. Workspace: 131 tests green (protocol 19 / extension 37 / connector 22 / backend 53), pnpm -r typecheck clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@understudy/protocol and @understudy/connector resolve via dist/ (the npm-publish-correct layout), but dist is gitignored - on a fresh checkout the backend/connector typecheck hits TS2307 before anything is built. Build ./packages/* first (topological: protocol before connector); same ordering fix in the README's fresh-clone commands. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The understudy-side half of M4 (consumer integration + published contract): the reference breakwater connector package consumers import, publish-ready npm metadata for both packages, and the changesets + GitHub Actions release pipeline. The remaining M4 half (metamind / smart-compliance Mastra agent + flowsafe approvals driving understudy end-to-end) is cross-repo and not in scope here.
packages/connector—@understudy/connector0.1.0observebrowser.observesnapshot(a11y/dom/screenshot),get_tabs,waitactbrowser.actclick,type,navigate,key,scroll,switch_tabfillCredentialbrowser.fill_credentialfill_secret(opaquesecretRef; plaintext never enters the Worker/model/audit)Plus
callBrowserWrite/callBrowserDryRunworkflow helpers mirroring metamind's shippedintake/connectors.ts. Verified against anchorage breakwater v0.3.x source and the shipped M3 service contract — deliberate deltas from the smart-compliance docs sketch (which predates M3): bearer caller auth,fill_secretfrom protocol v0.3.0, full protocol coverage, an optional breakwater policies pass-through (audit logger,tenantIsolation, test fetch seam), and Mastra's silent input-validation sentinel normalized to a throw.resolve_refstays unreachable (internal service↔extension probe; consumers use thedryRunflag).Load-bearing fix caught in review: egress declares
URL.hostname, not.host—.hostcarries:port, which breakwater's egress allowlist rejects at construction, so everywrangler dev(localhost:8787) consumer loop would have thrown.Publish + release
files-scoped tarballs (5 files each;workspace:^verified to rewrite to^0.3.0), npm READMEs, full publish metadata for@understudy/protocol0.3.0 and@understudy/connector0.1.0.ci.yml(typecheck/test/build) +release.yml— single-branch changesets flow adapted from anchorage: Version Packages PR when changesets are pending, publish with tags/GitHub releases/provenance when not. First push to master publishes 0.3.0/0.1.0 directly (versions pre-set; no changeset file on purpose).understudyorg (scope verified unclaimed 2026-07-16) and add an automation-tokenNPM_TOKENrepo secret. Without it the publish step fails loudly (ENEEDAUTH); nothing partial happens.pnpm-workspace.yaml:minimumReleaseAgeExcludefor@proofoftech/breakwater(every published version is younger than the 7-day supply-chain quarantine).Docs
Root README's stale pre-Topology-1 header ("backend brain") rewritten; technical plan repo layout / Consumer integration / M4 status updated to point at
packages/connectoras the canonical reference.Test plan
pnpm -r typecheck— 4/4 projects cleanpnpm -r test— 131 passed (protocol 19 / extension 37 / connector 22 / backend 53)npm pack --dry-runboth packages — 5-file tarballs incl. LICENSE; connector tarball's protocol dep rewrites to^0.3.0.hostnameegress fix + regression test, audit/policies seam + test, QA's recommended coverage (rate-limit denial, wrong-connector grant, release-on-throw retry, wait-failure, validation-sentinel) folded inNPM_TOKENsecret, then master push publishes both packages (release.yml)🤖 Generated with Claude Code