@ekanos/harness 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +5 -4
  2. package/dist/internal/components/approvals-tray.js +5 -5
  3. package/dist/internal/components/ask-assistant-bridge.js +6 -6
  4. package/dist/internal/components/connect-panel.js +16 -9
  5. package/dist/internal/components/connection-chip.js +2 -2
  6. package/dist/internal/components/dashboard-grid.js +1 -1
  7. package/dist/internal/components/dev-toolbar.js +5 -5
  8. package/dist/internal/components/docs-link.js +3 -3
  9. package/dist/internal/components/events-panel.js +11 -11
  10. package/dist/internal/components/health-panel.js +3 -10
  11. package/dist/internal/components/integration-badge.js +4 -4
  12. package/dist/internal/components/local-oauth-panel.js +14 -14
  13. package/dist/internal/components/operation-runner-panel.d.ts +3 -1
  14. package/dist/internal/components/operation-runner-panel.js +22 -44
  15. package/dist/internal/components/provenance-banner.js +3 -3
  16. package/dist/internal/components/run-log.js +13 -13
  17. package/dist/internal/components/runtime-strip.js +4 -4
  18. package/dist/internal/components/schema-form.js +9 -9
  19. package/dist/internal/components/scrollable-nav.d.ts +1 -1
  20. package/dist/internal/components/scrollable-nav.js +1 -1
  21. package/dist/internal/components/surface-nav.js +26 -26
  22. package/dist/internal/components/viewport-frame.js +1 -1
  23. package/dist/internal/components/widget-boundary.js +3 -3
  24. package/dist/internal/components/widget-surface.d.ts +5 -0
  25. package/dist/internal/components/widget-surface.js +12 -3
  26. package/dist/internal/components/workflow-runner.js +6 -6
  27. package/dist/internal/lib/console-context.js +2 -1
  28. package/dist/internal/lib/console-types.d.ts +4 -3
  29. package/dist/internal/lib/experience-runtime.d.ts +9 -1
  30. package/dist/internal/lib/experience-runtime.js +35 -7
  31. package/dist/internal/lib/run-log-view.js +5 -3
  32. package/dist/internal/routes/activation-page.js +17 -17
  33. package/dist/internal/routes/console-home-page.js +1 -1
  34. package/dist/internal/routes/experience-connect-page.js +12 -12
  35. package/dist/internal/routes/experience-layout-page.js +6 -6
  36. package/dist/internal/routes/experience-page-host.js +4 -4
  37. package/dist/internal/routes/experience-review-queue-page.js +7 -7
  38. package/dist/internal/routes/experience-runs-page.js +2 -2
  39. package/dist/internal/routes/experience-summary-page.js +4 -4
  40. package/dist/internal/routes/experience-widget-page.js +6 -3
  41. package/dist/internal/routes/experience-widgets-page.js +2 -2
  42. package/dist/internal/routes/experience-workflow-page.js +3 -3
  43. package/dist/internal/routes/experience-workflows-page.js +6 -6
  44. package/dist/internal/routes/integration-layout.js +1 -1
  45. package/dist/internal/routes/integrations-layout.js +2 -2
  46. package/dist/internal/routes/integrations-list-page.js +8 -8
  47. package/dist/internal/routes/integrations-operations-page.js +5 -5
  48. package/dist/internal/routes/integrations-overview-page.js +4 -4
  49. package/dist/internal/routes/integrations-runs-page.js +1 -1
  50. package/dist/internal/routes/integrations-scope.js +2 -2
  51. package/dist/internal/routes/repo-home-page.js +19 -19
  52. package/dist/internal/routes/repo-layout.js +4 -4
  53. package/dist/internal/routes/repo-package-layouts.js +2 -2
  54. package/dist/internal/routes/root-layout.js +1 -1
  55. package/dist/internal/routes/single-widget-page.js +5 -2
  56. package/dist/internal/routes/tile-page.js +8 -8
  57. package/dist/internal/routes/triggers-page.js +31 -31
  58. package/dist/internal/routes/widgets-page.js +1 -1
  59. package/dist/internal/server/ekanos-api-router.js +2 -2
  60. package/dist/internal/server/integration-resolver.d.ts +6 -0
  61. package/dist/internal/server/integration-resolver.js +5 -1
  62. package/dist/internal/server/local-secrets.d.ts +6 -5
  63. package/dist/internal/server/operation-runner.d.ts +7 -5
  64. package/dist/internal/server/operation-runner.js +23 -2
  65. package/dist/internal/surfaces.js +4 -4
  66. package/dist/registry.d.ts +9 -2
  67. package/dist/styles.css +7 -167
  68. package/package.json +8 -8
@@ -8,14 +8,22 @@ import {
8
8
  import { useToolbar } from "../lib/toolbar-context.js";
9
9
  import { DashboardGrid } from "./dashboard-grid.js";
10
10
  import { ViewportFrame } from "./viewport-frame.js";
11
+ function withFocusedDefault(widget) {
12
+ return widget.size || widget.layouts || widget.width ? widget : { ...widget, width: "full" };
13
+ }
14
+ const WIDTH_COLUMNS = { compact: 3, half: 6, full: 12 };
11
15
  function toWidgetConfig(widget, productSlug, unhealthy) {
12
16
  return {
13
17
  id: widget.id,
14
18
  name: widget.title,
15
19
  component: widget.component,
16
- // `w > 6` is what the grid reads as full-width.
17
20
  widgetState: "active",
18
- layouts: { lg: { x: 0, y: 0, w: widget.width === "full" ? 12 : 6, h: 4 } },
21
+ // Same precedence as the host: `size`, then `layouts.lg.w`, then `width`.
22
+ // The grid reads `w > 6` as full and `w <= 3` as compact.
23
+ ...widget.size ? { size: widget.size } : {},
24
+ layouts: widget.layouts ?? {
25
+ lg: { x: 0, y: 0, w: WIDTH_COLUMNS[widget.width ?? "half"], h: 4 }
26
+ },
19
27
  // Passed through ONLY when the registry entry declared them, so the
20
28
  // default lives in exactly one place: `dashboard-grid.tsx`, which is a copy
21
29
  // of the host's own grid and applies the host's own `?? false`.
@@ -74,5 +82,6 @@ export {
74
82
  HARNESS_ACCOUNT_ID,
75
83
  HARNESS_SOURCE_ID,
76
84
  WidgetSurface,
77
- toWidgetConfig
85
+ toWidgetConfig,
86
+ withFocusedDefault
78
87
  };
@@ -71,10 +71,10 @@ function WorkflowRunner({
71
71
  "data-status": status,
72
72
  children: [
73
73
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
74
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-fine", children: index + 1 }),
75
- /* @__PURE__ */ jsx("span", { className: "text-label", children: step.label }),
76
- /* @__PURE__ */ jsx("code", { className: "text-muted-foreground text-fine", children: step.type }),
77
- step.integration && step.opKey ? /* @__PURE__ */ jsxs("code", { className: "text-fine", children: [
74
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: index + 1 }),
75
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: step.label }),
76
+ /* @__PURE__ */ jsx("code", { className: "text-muted-foreground text-xs", children: step.type }),
77
+ step.integration && step.opKey ? /* @__PURE__ */ jsxs("code", { className: "text-xs", children: [
78
78
  step.integration,
79
79
  ":",
80
80
  step.opKey
@@ -84,12 +84,12 @@ function WorkflowRunner({
84
84
  state?.detail ? /* @__PURE__ */ jsx(
85
85
  "p",
86
86
  {
87
- className: status === "failed" || status === "rejected" ? "text-destructive-strong text-fine" : "text-muted-foreground text-fine",
87
+ className: status === "failed" || status === "rejected" ? "text-destructive text-xs" : "text-muted-foreground text-xs",
88
88
  role: status === "failed" ? "alert" : void 0,
89
89
  children: state.detail
90
90
  }
91
91
  ) : null,
92
- state?.output !== void 0 ? /* @__PURE__ */ jsx("pre", { className: "bg-muted text-fine max-h-48 overflow-auto rounded-md p-2", children: JSON.stringify(state.output, null, 2) }) : null
92
+ state?.output !== void 0 ? /* @__PURE__ */ jsx("pre", { className: "bg-muted max-h-48 overflow-auto rounded-md p-2 text-xs", children: JSON.stringify(state.output, null, 2) }) : null
93
93
  ]
94
94
  },
95
95
  step.id
@@ -6,6 +6,7 @@ import {
6
6
  useState
7
7
  } from "react";
8
8
  import { ExperienceRuntimeProvider } from "@ekanos/sdk/experience/client";
9
+ import { WidgetEventProvider } from "@ekanos/sdk/hooks";
9
10
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
10
11
  import { createHttpConsoleClient } from "./console-client.js";
11
12
  import { createExperienceRuntime } from "./experience-runtime.js";
@@ -37,7 +38,7 @@ function ConsoleProviders({
37
38
  defaultOptions: { queries: { retry: false, staleTime: 2e3 } }
38
39
  })
39
40
  }));
40
- return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient ?? defaults.queryClient, children: /* @__PURE__ */ jsx(ClientContext, { value: client ?? defaults.client, children: /* @__PURE__ */ jsx(LinksContext, { value: links, children: /* @__PURE__ */ jsx(PollContext, { value: pollMs, children: /* @__PURE__ */ jsx(SurfacesContext, { value: experience, children: /* @__PURE__ */ jsx(ExperienceRuntimeProvider, { runtime: defaults.runtime, children }) }) }) }) }) });
41
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient ?? defaults.queryClient, children: /* @__PURE__ */ jsx(ClientContext, { value: client ?? defaults.client, children: /* @__PURE__ */ jsx(LinksContext, { value: links, children: /* @__PURE__ */ jsx(PollContext, { value: pollMs, children: /* @__PURE__ */ jsx(SurfacesContext, { value: experience, children: /* @__PURE__ */ jsx(ExperienceRuntimeProvider, { runtime: defaults.runtime, children: /* @__PURE__ */ jsx(WidgetEventProvider, { children }) }) }) }) }) }) });
41
42
  }
42
43
  function useConsoleClient() {
43
44
  const client = use(ClientContext);
@@ -13,7 +13,7 @@ export type JsonSchema = {
13
13
  export type RunMode = 'fixtures' | 'live';
14
14
  export type ScenarioVariant = 'default' | 'empty' | 'error';
15
15
  export type ProjectKind = 'integration' | 'experience';
16
- export type ExecutionChannel = 'http' | 'rsc' | 'workflow';
16
+ export type ExecutionChannel = 'http' | 'rsc' | 'workflow' | 'interactive';
17
17
  export type IntegrationProvenance = {
18
18
  kind: 'registry';
19
19
  contractVersion: string;
@@ -156,8 +156,9 @@ export interface RunRequest {
156
156
  origin?: string;
157
157
  }
158
158
  /**
159
- * A write on the http channel is held open until the approvals tray decides
160
- * it, so the promise for a write resolves after the decision.
159
+ * A write on the `interactive` channel runs directly (a person's click); a
160
+ * `workflow` write is held open until the approvals tray decides it, so its
161
+ * promise resolves after the decision.
161
162
  */
162
163
  export type RunResponse = {
163
164
  status: 'ok';
@@ -4,5 +4,13 @@ import type { ExperienceRuntime } from '@ekanos/sdk/experience/runtime';
4
4
  * `useOperationMutation` read it from `ExperienceRuntimeProvider`, which the
5
5
  * console mounts around every route, so an experience widget renders under
6
6
  * the harness exactly as it will under the host.
7
+ *
8
+ * A write arrives on the `interactive` channel and runs directly. An operation
9
+ * that requires `confirmed: true` answers `confirmation_required`; this runtime
10
+ * then asks the person and resends with `confirmed: true`, as the host's
11
+ * dialog does. A widget's own `confirmed` on the first attempt is dropped so it
12
+ * cannot skip the question. Cancelling resolves `write_not_approved`.
7
13
  */
8
- export declare function createExperienceRuntime(apiPrefix?: string): ExperienceRuntime;
14
+ export declare function createExperienceRuntime(apiPrefix?: string, options?: {
15
+ confirm?: (message: string) => boolean | Promise<boolean>;
16
+ }): ExperienceRuntime;
@@ -1,14 +1,42 @@
1
+ import { OPERATION_REFUSAL_MESSAGES } from "@ekanos/integration-schema";
1
2
  import { createHarnessRuntime } from "../../runtime.js";
2
- function createExperienceRuntime(apiPrefix) {
3
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4
+ function createExperienceRuntime(apiPrefix, options = {}) {
3
5
  const harness = createHarnessRuntime(apiPrefix ? { apiPrefix } : {});
4
6
  void harness.refresh().catch(() => void 0);
7
+ const confirm = options.confirm ?? ((message) => globalThis.confirm(message));
8
+ const send = (request, input) => harness.call({
9
+ integration: request.integration,
10
+ op: request.op,
11
+ input,
12
+ channel: request.channel
13
+ });
5
14
  return {
6
- call: (request) => harness.call({
7
- integration: request.integration,
8
- op: request.op,
9
- input: request.input,
10
- channel: request.channel
11
- }),
15
+ call: async (request) => {
16
+ if (request.channel !== "interactive")
17
+ return send(request, request.input);
18
+ const first = isRecord(request.input) ? Object.fromEntries(
19
+ Object.entries(request.input).filter(
20
+ ([key]) => key !== "confirmed"
21
+ )
22
+ ) : request.input;
23
+ const result = await send(request, first);
24
+ if (result.ok || result.reason !== "confirmation_required") return result;
25
+ const approved = await confirm(
26
+ result.message || OPERATION_REFUSAL_MESSAGES.confirmation_required
27
+ );
28
+ if (!approved) {
29
+ return {
30
+ ok: false,
31
+ reason: "write_not_approved",
32
+ message: OPERATION_REFUSAL_MESSAGES.write_not_approved
33
+ };
34
+ }
35
+ return send(request, {
36
+ ...isRecord(first) ? first : {},
37
+ confirmed: true
38
+ });
39
+ },
12
40
  integrations: () => harness.integrations().map((integration) => ({
13
41
  name: integration.integration,
14
42
  version: integration.version,
@@ -7,7 +7,8 @@ const RUN_OUTCOMES = [
7
7
  ];
8
8
  const HELD_REASONS = /* @__PURE__ */ new Set([
9
9
  "write_not_approved",
10
- "write_refused_on_channel"
10
+ "write_refused_on_channel",
11
+ "confirmation_required"
11
12
  ]);
12
13
  function runOutcome(run) {
13
14
  if (run.status === "ok") return "ok";
@@ -18,8 +19,9 @@ const REASON_EXPLANATIONS = {
18
19
  slot_unknown: "This experience doesn't use that integration.",
19
20
  operation_not_declared: "This experience didn't declare that operation in its integrations.",
20
21
  operation_not_in_contract: "The integration's contract has no operation with that name.",
21
- write_refused_on_channel: "This channel is not allowed to make changes, so the write was held back.",
22
- write_not_approved: "A write needs approval first, and it was rejected or expired.",
22
+ write_refused_on_channel: "This channel is not allowed to make changes. A widget or page writes on a person's click; a read channel never does.",
23
+ write_not_approved: "A workflow write needs approval first, and it was rejected or expired, or the person cancelled the confirmation.",
24
+ confirmation_required: "This operation requires `confirmed: true` in its input: a person must confirm it with a second click.",
23
25
  mode_not_permitted: "The integration doesn't allow that run mode (live or fixtures) for this call.",
24
26
  binding_missing: "The integration is not connected.",
25
27
  invalid_input: "The input didn't match the operation's schema.",
@@ -115,8 +115,8 @@ function ActivationPageBody({
115
115
  className: "flex flex-wrap items-center justify-between gap-3 p-5",
116
116
  children: [
117
117
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
118
- /* @__PURE__ */ jsx("span", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: facts ? /* @__PURE__ */ jsx(ConnectionChip, { facts }) : /* @__PURE__ */ jsx("span", { className: "text-label", children: "Activation preview" }) }),
119
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-meta", children: connected ? "The dialog shows the manage view, whose only action is Disconnect." : definition?.oauth ? "Save your local OAuth credentials below, then open the connect dialog and click Connect." : "The dialog shows the scope disclosure and your activation form." })
118
+ /* @__PURE__ */ jsx("span", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: facts ? /* @__PURE__ */ jsx(ConnectionChip, { facts }) : /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Activation preview" }) }),
119
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: connected ? "The dialog shows the manage view, whose only action is Disconnect." : definition?.oauth ? "Save your local OAuth credentials below, then open the connect dialog and click Connect." : "The dialog shows the scope disclosure and your activation form." })
120
120
  ] }),
121
121
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
122
122
  /* @__PURE__ */ jsx(
@@ -166,7 +166,7 @@ function ActivationPageBody({
166
166
  onOpenChange: (next) => setFlow((prev) => ({ ...prev, open: next })),
167
167
  children: /* @__PURE__ */ jsxs(DialogContent, { "data-test": "integration-connect-dialog", children: [
168
168
  /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
169
- /* @__PURE__ */ jsx("span", { className: "bg-muted text-muted-foreground text-title flex h-10 w-10 shrink-0 items-center justify-center rounded-full", children: integration.name.trim().charAt(0).toUpperCase() || "?" }),
169
+ /* @__PURE__ */ jsx("span", { className: "bg-muted text-muted-foreground flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-base font-semibold", children: integration.name.trim().charAt(0).toUpperCase() || "?" }),
170
170
  /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
171
171
  /* @__PURE__ */ jsx(DialogTitle, { children: integration.name }),
172
172
  /* @__PURE__ */ jsx(DialogDescription, { children: summary })
@@ -219,7 +219,7 @@ function ActivationPageBody({
219
219
  ] })
220
220
  ] })
221
221
  }
222
- ) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "This integration registers no activation form." }),
222
+ ) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This integration registers no activation form." }),
223
223
  capabilities.length === 0 && permissions.length === 0 ? /* @__PURE__ */ jsxs(Alert, { children: [
224
224
  /* @__PURE__ */ jsx(AlertTitle, { children: "No capabilities or permissions declared" }),
225
225
  /* @__PURE__ */ jsx(AlertDescription, { children: /* @__PURE__ */ jsxs("p", { children: [
@@ -235,7 +235,7 @@ function ActivationPageBody({
235
235
  ] }) : null,
236
236
  flow.result ? /* @__PURE__ */ jsxs(Card, { layout: "bleed", className: "flex flex-col gap-3 p-6", children: [
237
237
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
238
- /* @__PURE__ */ jsx("h2", { className: "text-subhead", children: "Submitted payload" }),
238
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", children: "Submitted payload" }),
239
239
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
240
240
  hasSensitiveValues(flow.result) ? /* @__PURE__ */ jsx(
241
241
  Button,
@@ -262,7 +262,7 @@ function ActivationPageBody({
262
262
  )
263
263
  ] })
264
264
  ] }),
265
- /* @__PURE__ */ jsx("pre", { className: "bg-muted text-fine overflow-x-auto rounded-md p-3", children: JSON.stringify(
265
+ /* @__PURE__ */ jsx("pre", { className: "bg-muted overflow-x-auto rounded-md p-3 text-xs", children: JSON.stringify(
266
266
  flow.revealed ? flow.result : redactSensitive(flow.result),
267
267
  null,
268
268
  2
@@ -289,16 +289,16 @@ function OnActivatePanel({
289
289
  "data-test": "activation-onactivate-outcome",
290
290
  children: [
291
291
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Badge, { variant: badge.variant, children: badge.label }) }),
292
- outcome.status === "skipped" ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", children: [
292
+ outcome.status === "skipped" ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
293
293
  "This integration declares no ",
294
294
  /* @__PURE__ */ jsx("code", { children: "onActivate" }),
295
295
  " hook \u2014 a perfectly good answer for one with nothing to seed at connect time. Add one to ",
296
296
  /* @__PURE__ */ jsx("code", { children: "defineIntegration()" }),
297
297
  " to warm a cache or sanity-check a credential the moment a user connects."
298
298
  ] }) : outcome.status === "threw" ? /* @__PURE__ */ jsxs(Fragment, { children: [
299
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "In production this is NON-FATAL: the throw is logged and shown to the user as a warning, and the activation stays connected \u2014 this hook is for cache seeding and eager validation, not a connect gate." }),
300
- /* @__PURE__ */ jsx("pre", { className: "bg-muted text-fine overflow-x-auto rounded-md p-3", children: outcome.message })
301
- ] }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: mode === "live" ? "Ran on the dev server against the live context \u2014 the same storage and secrets the OAuth loop and your schedules use, with ctx.fetch reaching your vendor under the declared egress." : "Ran against the same kind of capability context (storage, secrets, egress) your schedules and webhooks run against." })
299
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "In production this is NON-FATAL: the throw is logged and shown to the user as a warning, and the activation stays connected \u2014 this hook is for cache seeding and eager validation, not a connect gate." }),
300
+ /* @__PURE__ */ jsx("pre", { className: "bg-muted overflow-x-auto rounded-md p-3 text-xs", children: outcome.message })
301
+ ] }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: mode === "live" ? "Ran on the dev server against the live context \u2014 the same storage and secrets the OAuth loop and your schedules use, with ctx.fetch reaching your vendor under the declared egress." : "Ran against the same kind of capability context (storage, secrets, egress) your schedules and webhooks run against." })
302
302
  ]
303
303
  }
304
304
  );
@@ -308,8 +308,8 @@ function CapabilityList({
308
308
  }) {
309
309
  if (capabilities.length === 0) return null;
310
310
  return /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-2", children: [
311
- /* @__PURE__ */ jsx("h3", { className: "text-muted-foreground text-eyebrow font-semibold uppercase", children: "What it does" }),
312
- /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1.5", children: capabilities.map((capability) => /* @__PURE__ */ jsxs("li", { className: "text-foreground text-body-sm", children: [
311
+ /* @__PURE__ */ jsx("h3", { className: "text-muted-foreground text-xs font-semibold tracking-wider uppercase", children: "What it does" }),
312
+ /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1.5", children: capabilities.map((capability) => /* @__PURE__ */ jsxs("li", { className: "text-foreground text-sm", children: [
313
313
  capability.label,
314
314
  capability.description ? /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
315
315
  " ",
@@ -324,10 +324,10 @@ function PermissionList({
324
324
  }) {
325
325
  if (permissions.length === 0) return null;
326
326
  return /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-2", children: [
327
- /* @__PURE__ */ jsx("h3", { className: "text-muted-foreground text-eyebrow font-semibold uppercase", children: "What it can access" }),
327
+ /* @__PURE__ */ jsx("h3", { className: "text-muted-foreground text-xs font-semibold tracking-wider uppercase", children: "What it can access" }),
328
328
  /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2", children: permissions.map((permission) => /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-0.5", children: [
329
329
  /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
330
- /* @__PURE__ */ jsx("span", { className: "text-foreground text-label", children: permission.label }),
330
+ /* @__PURE__ */ jsx("span", { className: "text-foreground text-sm font-medium", children: permission.label }),
331
331
  /* @__PURE__ */ jsx(
332
332
  StatusBadge,
333
333
  {
@@ -336,7 +336,7 @@ function PermissionList({
336
336
  }
337
337
  )
338
338
  ] }),
339
- permission.detail ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-meta", children: permission.detail }) : null
339
+ permission.detail ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: permission.detail }) : null
340
340
  ] }, permission.label)) })
341
341
  ] });
342
342
  }
@@ -347,14 +347,14 @@ function ConnectedState({
347
347
  onDisconnect
348
348
  }) {
349
349
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
350
- /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", children: [
350
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
351
351
  name,
352
352
  " is connected."
353
353
  ] }),
354
354
  /* @__PURE__ */ jsx(
355
355
  "p",
356
356
  {
357
- className: "text-muted-foreground text-meta",
357
+ className: "text-muted-foreground text-sm",
358
358
  "data-test": "activation-mode-notice",
359
359
  children: mode === "live" ? hasLiveActivationData ? "The toolbar is on Live API \u2014 this activation data is available to live-mode widgets on this visit." : "The toolbar is on Live API. This activation submitted no data of its own; an OAuth integration\u2019s credentials live on the dev server, where onTokens stored them." : "This surface is Ekanos-mocked; widgets read fixtures \u2014 switch the toolbar to Live API to exercise real requests."
360
360
  }
@@ -5,7 +5,7 @@ import { useProject } from "../lib/console-hooks.js";
5
5
  function ConsoleHomePage() {
6
6
  const project = useProject();
7
7
  if (!project.data) {
8
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "Loading\u2026" });
8
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
9
9
  }
10
10
  const first = project.data.integrations[0];
11
11
  if (project.data.kind === "integration" && first) {
@@ -28,11 +28,11 @@ function Checklist({
28
28
  consoleQueryClient ? refreshRuntime(consoleQueryClient) : void 0
29
29
  ]);
30
30
  if (!repo.data) {
31
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "Loading\u2026" });
31
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
32
32
  }
33
33
  const experience = repo.data.experiences.find((entry) => entry.name === name);
34
34
  if (!experience) {
35
- return /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", children: [
35
+ return /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
36
36
  "No experience named ",
37
37
  name,
38
38
  " in this repo."
@@ -44,11 +44,11 @@ function Checklist({
44
44
  ).length;
45
45
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "connect-checklist", children: [
46
46
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
47
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Connect" }),
47
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Connect" }),
48
48
  /* @__PURE__ */ jsxs(
49
49
  "p",
50
50
  {
51
- className: "text-muted-foreground text-fine",
51
+ className: "text-muted-foreground text-xs",
52
52
  "data-test": "checklist-progress",
53
53
  children: [
54
54
  ready,
@@ -69,7 +69,7 @@ function Checklist({
69
69
  "data-done": done(used.connection?.facts),
70
70
  children: [
71
71
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-2", children: [
72
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-fine", children: [
72
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
73
73
  index + 1,
74
74
  "."
75
75
  ] }),
@@ -77,21 +77,21 @@ function Checklist({
77
77
  Link,
78
78
  {
79
79
  href: `/integrations/${used.name}`,
80
- className: "text-label hover:underline",
80
+ className: "text-sm font-medium hover:underline",
81
81
  children: used.name
82
82
  }
83
83
  ),
84
84
  /* @__PURE__ */ jsx(ConnectionStatusChip, { connection: used.connection }),
85
- used.connection && used.connection.facts.kind !== "none" && used.connection.facts.state !== "connected" ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-fine", children: CONNECTION_TYPE[used.connection.type] }) : null,
86
- !used.sameRepo ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-fine", children: "from the registry" }) : null
85
+ used.connection && used.connection.facts.kind !== "none" && used.connection.facts.state !== "connected" ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: CONNECTION_TYPE[used.connection.type] }) : null,
86
+ !used.sameRepo ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: "from the registry" }) : null
87
87
  ] }),
88
- /* @__PURE__ */ jsxs("p", { className: "text-fine", "data-test": `step-levels-${used.name}`, children: [
88
+ /* @__PURE__ */ jsxs("p", { className: "text-xs", "data-test": `step-levels-${used.name}`, children: [
89
89
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Connected by " }),
90
90
  levelList(used.levels),
91
91
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: " after publishing" })
92
92
  ] }),
93
- used.levelProblem ? /* @__PURE__ */ jsx("p", { className: "text-warning-foreground bg-warning text-fine rounded-md px-3 py-2", children: used.levelProblem }) : null,
94
- used.connection?.detail ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-fine", children: used.connection.detail }) : null,
93
+ used.levelProblem ? /* @__PURE__ */ jsx("p", { className: "text-warning-foreground bg-warning rounded-md px-3 py-2 text-xs", children: used.levelProblem }) : null,
94
+ used.connection?.detail ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: used.connection.detail }) : null,
95
95
  used.sameRepo ? /* @__PURE__ */ jsx(
96
96
  ConnectControls,
97
97
  {
@@ -105,7 +105,7 @@ function Checklist({
105
105
  },
106
106
  used.name
107
107
  )) }),
108
- experience.integrations.length > 0 ? null : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "This experience uses no integrations." })
108
+ experience.integrations.length > 0 ? null : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This experience uses no integrations." })
109
109
  ] });
110
110
  }
111
111
  function ExperienceConnectPage({
@@ -19,7 +19,7 @@ function ExperienceLayoutPage() {
19
19
  const { widgets, pages, suggestedLayout } = useExperienceSurfaces();
20
20
  const [view, setView] = useState({ audience: EVERYONE, workspace: "" });
21
21
  if (!suggestedLayout) {
22
- return /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", "data-test": "layout-empty", children: [
22
+ return /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", "data-test": "layout-empty", children: [
23
23
  "This experience suggests no layout. Add ",
24
24
  /* @__PURE__ */ jsx("code", { children: "suggestedLayout" }),
25
25
  " to",
@@ -52,15 +52,15 @@ function ExperienceLayoutPage() {
52
52
  });
53
53
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-layout", children: [
54
54
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
55
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Suggested layout" }),
56
- /* @__PURE__ */ jsxs("label", { className: "text-meta ml-auto flex items-center gap-2", children: [
55
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Suggested layout" }),
56
+ /* @__PURE__ */ jsxs("label", { className: "ml-auto flex items-center gap-2 text-sm", children: [
57
57
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Viewing as" }),
58
58
  /* @__PURE__ */ jsxs(
59
59
  "select",
60
60
  {
61
61
  value: view.audience,
62
62
  onChange: (event) => setView({ audience: event.target.value, workspace: "" }),
63
- className: "border-input bg-background text-meta rounded-md border px-3 py-2",
63
+ className: "border-input bg-background rounded-md border px-3 py-2 text-sm",
64
64
  "data-test": "layout-audience",
65
65
  children: [
66
66
  /* @__PURE__ */ jsx("option", { value: EVERYONE, children: "Everyone" }),
@@ -70,7 +70,7 @@ function ExperienceLayoutPage() {
70
70
  )
71
71
  ] })
72
72
  ] }),
73
- resolved.workspaces.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", "data-test": "layout-none", children: [
73
+ resolved.workspaces.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", "data-test": "layout-none", children: [
74
74
  "Nothing in this layout is for",
75
75
  " ",
76
76
  view.audience === EVERYONE ? "everyone" : view.audience,
@@ -109,7 +109,7 @@ function ExperienceLayoutPage() {
109
109
  Link,
110
110
  {
111
111
  href: `${links.experience}/pages/${page.id}`,
112
- className: "text-label hover:underline",
112
+ className: "text-sm font-medium hover:underline",
113
113
  children: page.title
114
114
  }
115
115
  ),
@@ -29,7 +29,7 @@ function ExperiencePageHost() {
29
29
  "data-test": "experience-page",
30
30
  "data-page-kind": kind,
31
31
  children: [
32
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: page.title }),
32
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: page.title }),
33
33
  page.routes && page.routes.length > 0 ? /* @__PURE__ */ jsx(
34
34
  "nav",
35
35
  {
@@ -42,8 +42,8 @@ function ExperiencePageHost() {
42
42
  href: route.path === "" ? base : `${base}/${route.path}`,
43
43
  "aria-current": route.path === sub ? "page" : void 0,
44
44
  className: cn(
45
- "text-meta rounded-md px-3 py-2",
46
- route.path === sub ? "bg-accent text-accent-foreground text-label" : "text-muted-foreground hover:bg-accent/50"
45
+ "rounded-md px-3 py-2 text-sm",
46
+ route.path === sub ? "bg-accent text-accent-foreground text-sm font-medium" : "text-muted-foreground hover:bg-accent"
47
47
  ),
48
48
  children: route.title
49
49
  },
@@ -63,7 +63,7 @@ function ExperiencePageHost() {
63
63
  /* @__PURE__ */ jsx(
64
64
  "p",
65
65
  {
66
- className: "text-muted-foreground text-meta",
66
+ className: "text-muted-foreground text-sm",
67
67
  "data-test": "default-overview",
68
68
  children: "No overview component: the host shows all of this experience's widgets."
69
69
  }
@@ -28,18 +28,18 @@ function Section({ section }) {
28
28
  "data-test": "review-section",
29
29
  children: [
30
30
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
31
- /* @__PURE__ */ jsx("h3", { className: "text-label", children: section.title }),
32
- /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-fine", children: [
31
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: section.title }),
32
+ /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-xs", children: [
33
33
  section.integration,
34
34
  ":",
35
35
  section.opKey
36
36
  ] })
37
37
  ] }),
38
- result.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx(AlertDescription, { children: result.error.message }) }) : result.data?.status === "ok" ? /* @__PURE__ */ jsx("pre", { className: "bg-muted text-fine max-h-72 overflow-auto rounded-md p-3", children: JSON.stringify(result.data.output, null, 2) }) : result.data?.status === "refused" ? /* @__PURE__ */ jsxs(StatusBadge, { tone: "destructive", children: [
38
+ result.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx(AlertDescription, { children: result.error.message }) }) : result.data?.status === "ok" ? /* @__PURE__ */ jsx("pre", { className: "bg-muted max-h-72 overflow-auto rounded-md p-3 text-xs", children: JSON.stringify(result.data.output, null, 2) }) : result.data?.status === "refused" ? /* @__PURE__ */ jsxs(StatusBadge, { tone: "destructive", children: [
39
39
  result.data.reason,
40
40
  ": ",
41
41
  result.data.message
42
- ] }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-fine", children: "Loading\u2026" })
42
+ ] }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "Loading\u2026" })
43
43
  ]
44
44
  }
45
45
  );
@@ -48,11 +48,11 @@ function ExperienceReviewQueuePage() {
48
48
  const experience = useExperience();
49
49
  const sections = experience.data?.reviewQueue ?? [];
50
50
  if (experience.isPending) {
51
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "Loading\u2026" });
51
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
52
52
  }
53
53
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-review-queue", children: [
54
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Review queue" }),
55
- sections.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "This experience declares no review-queue sections." }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: sections.map((section) => /* @__PURE__ */ jsx(Section, { section }, section.id)) })
54
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Review queue" }),
55
+ sections.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This experience declares no review-queue sections." }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: sections.map((section) => /* @__PURE__ */ jsx(Section, { section }, section.id)) })
56
56
  ] });
57
57
  }
58
58
  export {
@@ -3,8 +3,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { RunLog } from "../components/run-log.js";
4
4
  function ExperienceRunsPage() {
5
5
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-runs", children: [
6
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Run log" }),
7
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-fine", children: "Every operation call from any surface, with its provenance." }),
6
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Run log" }),
7
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "Every operation call from any surface, with its provenance." }),
8
8
  /* @__PURE__ */ jsx(RunLog, {})
9
9
  ] });
10
10
  }
@@ -27,13 +27,13 @@ const CHECK_TONES = {
27
27
  function ExperienceSummaryPage() {
28
28
  const project = useProject();
29
29
  if (!project.data) {
30
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "Loading\u2026" });
30
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
31
31
  }
32
32
  const { integrations, checks } = project.data;
33
33
  const overrides = localIntegrations(integrations).length;
34
34
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", "data-test": "experience-summary", children: [
35
35
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
36
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Integrations" }),
36
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Integrations" }),
37
37
  /* @__PURE__ */ jsx(StatusBadge, { tone: overrides > 0 ? "warning" : "success", children: overrides > 0 ? `${overrides} local override${overrides === 1 ? "" : "s"}` : "no overrides" }),
38
38
  checks ? /* @__PURE__ */ jsxs(Fragment, { children: [
39
39
  /* @__PURE__ */ jsxs(StatusBadge, { tone: CHECK_TONES[checks.pins], children: [
@@ -81,14 +81,14 @@ function ExperienceSummaryPage() {
81
81
  /* @__PURE__ */ jsx(
82
82
  "span",
83
83
  {
84
- className: "text-muted-foreground text-fine",
84
+ className: "text-muted-foreground text-xs",
85
85
  title: provenanceTitle(integration.provenance),
86
86
  children: provenanceDisplayPath(integration.provenance) || describeProvenance(integration.provenance)
87
87
  }
88
88
  )
89
89
  ] }) }),
90
90
  /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("div", { className: "flex gap-1", children: integration.runModes.map((mode) => /* @__PURE__ */ jsx(RunModeBadge, { mode }, mode)) }) }),
91
- /* @__PURE__ */ jsx(TableCell, { className: "text-fine", children: integration.bindingMode ?? "default" })
91
+ /* @__PURE__ */ jsx(TableCell, { className: "text-xs", children: integration.bindingMode ?? "default" })
92
92
  ]
93
93
  },
94
94
  integration.integration
@@ -1,7 +1,10 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { notFound, useParams } from "next/navigation";
4
- import { WidgetSurface } from "../components/widget-surface.js";
4
+ import {
5
+ WidgetSurface,
6
+ withFocusedDefault
7
+ } from "../components/widget-surface.js";
5
8
  import { useExperienceSurfaces } from "../lib/console-context.js";
6
9
  import { useProject } from "../lib/console-hooks.js";
7
10
  function ExperienceWidgetPage() {
@@ -11,11 +14,11 @@ function ExperienceWidgetPage() {
11
14
  const widget = widgets.find((entry) => entry.id === id);
12
15
  if (!widget) notFound();
13
16
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-widget", children: [
14
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: widget.title }),
17
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: widget.title }),
15
18
  /* @__PURE__ */ jsx(
16
19
  WidgetSurface,
17
20
  {
18
- widgets: [{ ...widget, width: "full" }],
21
+ widgets: [withFocusedDefault(widget)],
19
22
  productSlug: project.data?.name ?? "experience"
20
23
  }
21
24
  )
@@ -7,8 +7,8 @@ function ExperienceWidgetsPage() {
7
7
  const project = useProject();
8
8
  const { widgets } = useExperienceSurfaces();
9
9
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-widgets", children: [
10
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Widgets" }),
11
- widgets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "This experience registers no widgets." }) : /* @__PURE__ */ jsx(
10
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Widgets" }),
11
+ widgets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This experience registers no widgets." }) : /* @__PURE__ */ jsx(
12
12
  WidgetSurface,
13
13
  {
14
14
  widgets,