Skip to content

feat(embed): add the browser client (client + kit) - #13

Merged
mattj-monad merged 1 commit into
feature/pro-400from
feature/pro-401
Jul 31, 2026
Merged

feat(embed): add the browser client (client + kit)#13
mattj-monad merged 1 commit into
feature/pro-400from
feature/pro-401

Conversation

@mattj-monad

Copy link
Copy Markdown
Contributor

Layer 2 of the Monad Embed SDK staged rollout (PRO-401). Stacked on #12 (PRO-400) — review/merge that first; this PR targets feature/pro-400.

What this adds

The two remaining @monad-inc/embed entrypoints (connect is already on main):

  • src/client — the 9-route browser client (createEmbedClient) host front-ends call: catalog, connectors, session, and pipeline build/status/state/remove.
  • src/kit — the backend-only Monad client (session, catalog, pipeline, teams) hosts/routers use server-side.

Plus the ./client and ./kit subpath exports and the tsup/tsconfig build wiring.

Shared eslint config finalized here

This is the first layer with lintable SDK source, so I brought the shared eslint.config.js to its final form in one place: ignore **/.venv/** (Python harness assets), grant node globals to .mjs/.cjs scripts, and allow _-prefixed unused args. Downstream router/conformance layers won't need to touch it.

Verification (local)

  • tsc --noEmit clean; vitest 19/19 green (client 12, kit 7)
  • lint: 0 errors (3 intentional no-explicit-any warnings — Monad API responses are deliberately untyped JSON)
  • prettier --check clean; tsup build succeeds for connect/client/kit

Stack

400 (contract) → 401 (client) → 402 (TS router + conformance) → 403 (Go) → 404 (Python) → 405 (docs/CI).

🤖 Generated with Claude Code

https://claude.ai/code/session_011ASKA2VrufrNLGGrcFjY7n

Adds the two remaining @monad-inc/embed entrypoints, typed to the /embed
contract (connect is already on main):

- src/client — the 9-route browser client (createEmbedClient) host front-ends
  call: catalog, connectors, session, pipeline build/status/state/remove.
- src/kit — the backend-only Monad client (session, catalog, pipeline, teams)
  hosts/routers use server-side.

Wires the ./client and ./kit subpath exports and the tsup/tsconfig build, and
finalizes the shared eslint config in one place (ignore .venv, grant node
globals to .mjs/.cjs scripts, allow _-prefixed unused args) so downstream
router/conformance layers don't re-touch it. 19 unit tests, green against mocks.

Layer 2 (PRO-401) of the staged rollout; stacked on the contract (PRO-400).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ASKA2VrufrNLGGrcFjY7n
@mattj-monad

Copy link
Copy Markdown
Contributor Author

Force-pushed a review fix. The browser client's success path now surfaces a non-JSON 2xx — e.g. an expired-host-session HTML login page served with status 200 — as a branded EmbedRequestError('invalid_response') instead of a raw SyntaxError the caller isn't told to expect. 19 unit tests green.

@andrewc-monad andrewc-monad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. There's 1 or 2 things I'd suggest to change but they'd be more over-reaching and might affect other PRs above this one in the stack, so they can be pushed to later.

@mattj-monad
mattj-monad merged commit ea45039 into feature/pro-400 Jul 31, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants