Main entries
@ekanos/harness/registry
Types and helpers for building your harness.config.ts. Server-safe.
Your registry entry:
slug, name, description, widgets, plus optional
fixtures, tile, activationForm, definition, triggerMocks, live,
oauth.One widget to render:
id, title, component, plus optional width,
isPinnable, aiFooterEnabled, seeds.Live mode config:
seeds (react-query keys that stay mocked in live mode),
default ('live' to open in live mode until the toolbar is changed),
egress (only for an entry with no definition), FetchProvider
(deprecated; for composing an authenticated fetch once).Fixtures-mode mock context for triggers and actions:
storage
(account/user rows), secrets (account/admin tiers), fetchHandlers
(dynamic or stateful responses).Derive
HarnessWidget[] from your definition to avoid duplication. The
overrides map, keyed by widget id, supplies harness-only fields (width,
seeds); an unknown key throws.Erase the storage generic so your
IntegrationDefinition<S> fits in the heterogeneous registry array.@ekanos/harness/config
Identity function that exists for type inference. Also throws if a slug or
widget id is not URL-safe, or if one is duplicated.
@ekanos/harness/app
Components and metadata mounted by the generated shell. The entry itself carries no 'use client' directive.
The client boundary of the whole harness; mounts the providers and the
registry context. Props:
integrations: HarnessIntegration[], children.@ekanos/harness/routes
Client page components (the entry is 'use client') re-exported by the shell’s one-line route files, for example export { WidgetsPage as default } from '@ekanos/harness/routes';.
Wrapper for the integration’s Preview pages (
/integrations/<slug>/preview). Renders the section nav. The console’s own tabs (Overview, Connect, Operations, Events, Health, Run log) are separate pages in the same package, mounted by the generated shell.@ekanos/harness/hooks
Hooks for code that only ever runs inside the harness (a debug banner, a dev-only branch), never a widget’s shipped data path. For activation data in widget code, prefer useActivationData() from @ekanos/sdk/hooks.
Returns the EFFECTIVE data mode (accounting for a missing
live block or
egress mismatch forcing fixtures).Returns the activation data last submitted for this integration. Held in
memory only, never written to
localStorage, a fixture, or the registry;
cleared on reload and on Disconnect.@ekanos/harness/api
Server-only entry. Never import from a 'use client' module.
Returns
{ GET, POST, PUT } route handlers for the shell’s one API route. Serves oauth/{connect,callback,status}, storage, trigger, local-setup, and actions/<actionName> under /api/integrations/[slug]/. See Live Mode.@ekanos/harness/styles.css
Tailwind layer, design tokens (with the Phosphor icon fonts), and @source globs covering the harness chrome.
@ekanos/harness/mocks/team-account-workspace
Stand-in for the host’s useTeamAccountWorkspace(). The generated next.config.mjs aliases @kit/team-accounts/hooks/use-team-account-workspace onto it, so unmodified widget source runs unchanged.
Data modes
DataMode
@ekanos/harness/registry. Returned by useHarnessDataMode() and passed as the mode prop to a live.FetchProvider.
Errors you will see
These are not exported by@ekanos/harness; match them by error.name.
NoRecordedResponseError
Thrown (as a rejected fetch) when a request has no matching fixture. Carries method and url (credentials redacted), and its message includes the fixture line to paste. See Fixtures.
MissingFixtureError
Thrown when a react-query query has neither a seed nor a queryFn of its own.
EgressDeniedError
From @ekanos/sdk/context. Thrown in live mode when a request targets an origin outside the declared egress. Carries origin, an optional reason, and code: 'EGRESS_DENIED'.
LiveActionNotConfirmedError
Thrown when a live-mode action’s confirmation prompt is declined. See Actions.
Handler context
Webhook, schedule, action,onActivate, and onTokens handlers receive the SDK’s IntegrationContext (exported as a type from @ekanos/sdk): accountId, accountSlug, userId, actor, sourceId, integration, timezone, storage, secrets, fetch, and logger. In fixtures mode it is a createMockContext() context; in live mode, the server-held live context.
TypeScript
The published package ships its types indist/*.d.ts. To check your harness.config.ts, run npx tsc --noEmit in your project.