@ekanos/harness 0.26.0 → 0.28.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 (159) hide show
  1. package/README.md +6 -4
  2. package/dist/api-types.d.ts +4 -0
  3. package/dist/internal/components/approvals-tray.d.ts +44 -6
  4. package/dist/internal/components/approvals-tray.js +252 -30
  5. package/dist/internal/components/connect-controls.js +4 -2
  6. package/dist/internal/components/connect-dialog.d.ts +8 -1
  7. package/dist/internal/components/connect-dialog.js +23 -10
  8. package/dist/internal/components/connect-panel.d.ts +3 -2
  9. package/dist/internal/components/connect-panel.js +680 -340
  10. package/dist/internal/components/connect-steps.d.ts +72 -0
  11. package/dist/internal/components/connect-steps.js +341 -0
  12. package/dist/internal/components/console-not-found.d.ts +14 -0
  13. package/dist/internal/components/console-not-found.js +57 -0
  14. package/dist/internal/components/dashboard-grid.d.ts +10 -5
  15. package/dist/internal/components/dashboard-grid.js +8 -9
  16. package/dist/internal/components/dev-toolbar.d.ts +27 -5
  17. package/dist/internal/components/dev-toolbar.js +214 -176
  18. package/dist/internal/components/ekanos-logo.d.ts +18 -0
  19. package/dist/internal/components/ekanos-logo.js +74 -0
  20. package/dist/internal/components/events-panel.d.ts +13 -4
  21. package/dist/internal/components/events-panel.js +478 -81
  22. package/dist/internal/components/harness-widget-provider.d.ts +6 -8
  23. package/dist/internal/components/harness-widget-provider.js +5 -19
  24. package/dist/internal/components/health-panel.d.ts +8 -1
  25. package/dist/internal/components/health-panel.js +328 -31
  26. package/dist/internal/components/integration-badge.js +4 -2
  27. package/dist/internal/components/integration-tab-skeletons.d.ts +8 -0
  28. package/dist/internal/components/integration-tab-skeletons.js +76 -0
  29. package/dist/internal/components/not-found-state.d.ts +39 -0
  30. package/dist/internal/components/not-found-state.js +127 -0
  31. package/dist/internal/components/operation-runner-panel.d.ts +1 -1
  32. package/dist/internal/components/operation-runner-panel.js +624 -189
  33. package/dist/internal/components/operation-scope.d.ts +13 -0
  34. package/dist/internal/components/operation-scope.js +79 -0
  35. package/dist/internal/components/page-skeletons.d.ts +11 -0
  36. package/dist/internal/components/page-skeletons.js +61 -0
  37. package/dist/internal/components/provenance-banner.d.ts +13 -4
  38. package/dist/internal/components/provenance-banner.js +35 -10
  39. package/dist/internal/components/run-log-copy.d.ts +17 -0
  40. package/dist/internal/components/run-log-copy.js +67 -0
  41. package/dist/internal/components/run-log-detail.d.ts +22 -0
  42. package/dist/internal/components/run-log-detail.js +295 -0
  43. package/dist/internal/components/run-log-empty.d.ts +13 -0
  44. package/dist/internal/components/run-log-empty.js +46 -0
  45. package/dist/internal/components/run-log.d.ts +23 -3
  46. package/dist/internal/components/run-log.js +384 -130
  47. package/dist/internal/components/runtime-strip.d.ts +5 -1
  48. package/dist/internal/components/runtime-strip.js +115 -10
  49. package/dist/internal/components/schema-form.d.ts +2 -1
  50. package/dist/internal/components/schema-form.js +212 -79
  51. package/dist/internal/components/scrollable-nav.js +14 -2
  52. package/dist/internal/components/segmented-control.d.ts +19 -0
  53. package/dist/internal/components/segmented-control.js +46 -0
  54. package/dist/internal/components/shell-header.d.ts +25 -0
  55. package/dist/internal/components/shell-header.js +126 -0
  56. package/dist/internal/components/surface-nav.d.ts +12 -3
  57. package/dist/internal/components/surface-nav.js +72 -83
  58. package/dist/internal/components/widget-surface.d.ts +5 -1
  59. package/dist/internal/components/widget-surface.js +86 -14
  60. package/dist/internal/components/workflow-runner.d.ts +23 -10
  61. package/dist/internal/components/workflow-runner.js +451 -69
  62. package/dist/internal/lib/connect-model.d.ts +134 -0
  63. package/dist/internal/lib/connect-model.js +282 -0
  64. package/dist/internal/lib/connection-facts.js +2 -1
  65. package/dist/internal/lib/console-client.js +5 -2
  66. package/dist/internal/lib/console-hooks.d.ts +4 -1
  67. package/dist/internal/lib/console-hooks.js +3 -2
  68. package/dist/internal/lib/console-types.d.ts +6 -0
  69. package/dist/internal/lib/docs-links.d.ts +28 -0
  70. package/dist/internal/lib/docs-links.js +57 -1
  71. package/dist/internal/lib/event-delivery.d.ts +33 -0
  72. package/dist/internal/lib/event-delivery.js +66 -0
  73. package/dist/internal/lib/experience-runtime.d.ts +2 -1
  74. package/dist/internal/lib/experience-runtime.js +5 -3
  75. package/dist/internal/lib/font-files/OFL-BricolageGrotesque.txt +93 -0
  76. package/dist/internal/lib/font-files/OFL-Figtree.txt +93 -0
  77. package/dist/internal/lib/font-files/bricolage-grotesque-latin-variable.woff2 +0 -0
  78. package/dist/internal/lib/font-files/figtree-latin-variable.woff2 +0 -0
  79. package/dist/internal/lib/fonts.js +13 -12
  80. package/dist/internal/lib/health-model.d.ts +58 -0
  81. package/dist/internal/lib/health-model.js +140 -0
  82. package/dist/internal/lib/integration-console-href.d.ts +15 -0
  83. package/dist/internal/lib/integration-console-href.js +16 -0
  84. package/dist/internal/lib/oauth-setup-guide.d.ts +28 -0
  85. package/dist/internal/lib/oauth-setup-guide.js +35 -1
  86. package/dist/internal/lib/operation-catalog.d.ts +70 -0
  87. package/dist/internal/lib/operation-catalog.js +261 -0
  88. package/dist/internal/lib/overview-model.d.ts +34 -0
  89. package/dist/internal/lib/overview-model.js +91 -0
  90. package/dist/internal/lib/registry-entry.d.ts +8 -0
  91. package/dist/internal/lib/registry-entry.js +11 -0
  92. package/dist/internal/lib/repo-name.d.ts +9 -0
  93. package/dist/internal/lib/repo-name.js +21 -0
  94. package/dist/internal/lib/run-log-view.d.ts +66 -1
  95. package/dist/internal/lib/run-log-view.js +183 -4
  96. package/dist/internal/lib/runner-view.d.ts +15 -0
  97. package/dist/internal/lib/runner-view.js +18 -0
  98. package/dist/internal/lib/schema-form-model.d.ts +17 -0
  99. package/dist/internal/lib/schema-form-model.js +50 -0
  100. package/dist/internal/lib/setup-checklist.d.ts +34 -0
  101. package/dist/internal/lib/setup-checklist.js +79 -0
  102. package/dist/internal/lib/toolbar-context.d.ts +0 -1
  103. package/dist/internal/lib/toolbar-context.js +0 -2
  104. package/dist/internal/lib/toolbar-visibility.d.ts +9 -2
  105. package/dist/internal/lib/toolbar-visibility.js +5 -0
  106. package/dist/internal/lib/use-operation-effects.d.ts +7 -0
  107. package/dist/internal/lib/use-operation-effects.js +28 -0
  108. package/dist/internal/lib/use-run-log-query.d.ts +9 -0
  109. package/dist/internal/lib/use-run-log-query.js +35 -0
  110. package/dist/internal/lib/widget-grid-gaps.d.ts +18 -0
  111. package/dist/internal/lib/widget-grid-gaps.js +41 -0
  112. package/dist/internal/lib/workflow-summary.d.ts +54 -0
  113. package/dist/internal/lib/workflow-summary.js +147 -0
  114. package/dist/internal/routes/console-home-page.js +2 -1
  115. package/dist/internal/routes/experience-connect-page.js +51 -22
  116. package/dist/internal/routes/experience-layout-page.js +75 -26
  117. package/dist/internal/routes/experience-page-host.js +63 -5
  118. package/dist/internal/routes/experience-review-queue-page.d.ts +4 -1
  119. package/dist/internal/routes/experience-review-queue-page.js +108 -12
  120. package/dist/internal/routes/experience-runs-page.js +57 -4
  121. package/dist/internal/routes/experience-summary-page.d.ts +19 -0
  122. package/dist/internal/routes/experience-summary-page.js +219 -62
  123. package/dist/internal/routes/experience-widget-page.js +58 -7
  124. package/dist/internal/routes/experience-widgets-page.d.ts +2 -3
  125. package/dist/internal/routes/experience-widgets-page.js +29 -4
  126. package/dist/internal/routes/experience-workflow-page.js +81 -9
  127. package/dist/internal/routes/experience-workflows-page.js +85 -21
  128. package/dist/internal/routes/integration-layout.js +28 -3
  129. package/dist/internal/routes/integrations-connect-page.js +16 -6
  130. package/dist/internal/routes/integrations-events-page.js +22 -1
  131. package/dist/internal/routes/integrations-health-page.js +16 -1
  132. package/dist/internal/routes/integrations-layout.js +28 -4
  133. package/dist/internal/routes/integrations-list-page.d.ts +0 -1
  134. package/dist/internal/routes/integrations-list-page.js +11 -9
  135. package/dist/internal/routes/integrations-operation-page.js +53 -17
  136. package/dist/internal/routes/integrations-operations-page.js +539 -49
  137. package/dist/internal/routes/integrations-overview-page.js +332 -69
  138. package/dist/internal/routes/integrations-runs-page.js +53 -3
  139. package/dist/internal/routes/integrations-scope.d.ts +15 -2
  140. package/dist/internal/routes/integrations-scope.js +66 -18
  141. package/dist/internal/routes/preview-index-page.js +2 -2
  142. package/dist/internal/routes/repo-home-page.d.ts +2 -2
  143. package/dist/internal/routes/repo-home-page.js +428 -236
  144. package/dist/internal/routes/repo-layout.d.ts +12 -0
  145. package/dist/internal/routes/repo-layout.js +50 -38
  146. package/dist/internal/routes/repo-package-layouts.js +22 -8
  147. package/dist/internal/routes/single-widget-page.d.ts +1 -1
  148. package/dist/internal/routes/single-widget-page.js +28 -5
  149. package/dist/internal/routes/tile-page.d.ts +1 -1
  150. package/dist/internal/routes/tile-page.js +1 -2
  151. package/dist/internal/routes/widgets-page.d.ts +1 -1
  152. package/dist/internal/routes/widgets-page.js +5 -3
  153. package/dist/internal/server/ekanos-api-router.js +20 -5
  154. package/dist/internal/server/repo-api-router.js +20 -7
  155. package/dist/registry.d.ts +4 -5
  156. package/dist/registry.js +0 -1
  157. package/dist/routes.d.ts +5 -0
  158. package/dist/routes.js +2 -0
  159. package/package.json +8 -8
@@ -1,5 +1,17 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type RepoClient } from '../lib/console-client.js';
3
+ /** The repo home's header and content column. Mount under `RepoProviders`. */
4
+ export declare function RepoFrame({ children }: {
5
+ children: ReactNode;
6
+ }): import("react").JSX.Element;
7
+ /**
8
+ * An `/integrations/<name>` or `/experiences/<name>` this repo has no package
9
+ * for, in the repo's own frame, listing the packages it does have.
10
+ */
11
+ export declare function RepoNotFound({ kind, name, }: {
12
+ kind: 'integration' | 'experience';
13
+ name: string;
14
+ }): import("react").JSX.Element | null;
3
15
  /** The layout of the repo home: `ekanos dev` at a repo root. */
4
16
  export declare function RepoLayout({ children, client, }: {
5
17
  children: ReactNode;
@@ -1,46 +1,23 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import Link from "next/link";
4
- import { usePathname } from "next/navigation";
5
3
  import { Alert, AlertDescription } from "@ekanos/ui/alert";
6
- import { Icon } from "@ekanos/ui/icon";
7
- import { cn } from "@ekanos/ui/utils";
8
- import { FOCUS_RING, ScrollableNav } from "../components/scrollable-nav.js";
4
+ import {
5
+ NotFoundState
6
+ } from "../components/not-found-state.js";
7
+ import { PageSkeleton } from "../components/page-skeletons.js";
8
+ import { ShellHeader } from "../components/shell-header.js";
9
9
  import { RepoProviders, useRepo } from "../lib/repo-context.js";
10
- const TABS = [{ href: "/", label: "This repo", icon: "columns" }];
11
- function repoName(root) {
12
- return root.split(/[\\/]/).filter(Boolean).pop() ?? root;
13
- }
10
+ import { repoName } from "../lib/repo-name.js";
14
11
  function RepoFrame({ children }) {
15
12
  const repo = useRepo();
16
- const pathname = usePathname();
17
13
  return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen flex-col", "data-test": "repo-frame", children: [
18
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 border-b px-4 py-4 sm:px-6", children: [
19
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-3", children: [
20
- /* @__PURE__ */ jsx("h1", { className: "font-heading font-heading-semibold text-2xl tracking-tight", children: repo.data ? repoName(repo.data.root) : "This repo" }),
21
- /* @__PURE__ */ jsx("code", { className: "text-muted-foreground text-xs", children: "repo" })
22
- ] }),
23
- /* @__PURE__ */ jsx(ScrollableNav, { label: "Repo", children: TABS.map((tab) => {
24
- const active = tab.href === "/" ? pathname === "/" : pathname.startsWith(tab.href);
25
- return /* @__PURE__ */ jsxs(
26
- Link,
27
- {
28
- href: tab.href,
29
- "aria-current": active ? "page" : void 0,
30
- className: cn(
31
- "flex items-center gap-2 rounded-md px-3 py-2 whitespace-nowrap transition-colors",
32
- FOCUS_RING,
33
- active ? "bg-accent text-accent-foreground text-sm font-medium" : "text-muted-foreground hover:bg-accent text-sm"
34
- ),
35
- children: [
36
- /* @__PURE__ */ jsx(Icon, { name: tab.icon, className: "h-4 w-4" }),
37
- tab.label
38
- ]
39
- },
40
- tab.href
41
- );
42
- }) })
43
- ] }),
14
+ /* @__PURE__ */ jsx(
15
+ ShellHeader,
16
+ {
17
+ title: repo.data ? repoName(repo.data.root) : "This repo",
18
+ kind: "repo"
19
+ }
20
+ ),
44
21
  /* @__PURE__ */ jsxs(
45
22
  "main",
46
23
  {
@@ -50,7 +27,10 @@ function RepoFrame({ children }) {
50
27
  children: [
51
28
  repo.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", "data-test": "repo-error", children: /* @__PURE__ */ jsxs(AlertDescription, { children: [
52
29
  "Could not reach the harness server: ",
53
- repo.error.message
30
+ repo.error.message,
31
+ ". Check that ",
32
+ /* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
33
+ " is still running, then reload."
54
34
  ] }) }) : null,
55
35
  repo.data && repo.data.problems.length > 0 ? /* @__PURE__ */ jsx(Alert, { variant: "warning", "data-test": "repo-problems", children: /* @__PURE__ */ jsx(AlertDescription, { children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1", children: repo.data.problems.map((problem) => /* @__PURE__ */ jsxs("li", { children: [
56
36
  /* @__PURE__ */ jsx("code", { children: problem.where }),
@@ -63,6 +43,36 @@ function RepoFrame({ children }) {
63
43
  )
64
44
  ] });
65
45
  }
46
+ function RepoNotFound({
47
+ kind,
48
+ name
49
+ }) {
50
+ const repo = useRepo();
51
+ if (!repo.data) {
52
+ return repo.isError ? null : /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading the repo" });
53
+ }
54
+ const options = kind === "integration" ? repo.data.integrations.map((row) => ({
55
+ label: row.name,
56
+ href: row.consoleHref,
57
+ hint: `v${row.version}`
58
+ })) : repo.data.experiences.map((row) => ({
59
+ label: row.name,
60
+ href: row.viewHref,
61
+ hint: `v${row.version}`
62
+ }));
63
+ const plural = kind === "integration" ? "integrations" : "experiences";
64
+ return /* @__PURE__ */ jsx(
65
+ NotFoundState,
66
+ {
67
+ testId: `${kind}-not-found`,
68
+ title: `No ${kind} called \u201C${name}\u201D`,
69
+ description: options.length > 0 ? `This repo has no ${kind} package named ${name}. Pick one of its ${plural}, or check the name in the address.` : `This repo has no ${plural} yet, so there is nothing at this address.`,
70
+ options,
71
+ ...options.length > 0 ? { optionsLabel: `The ${plural} in this repo` } : {},
72
+ action: { label: "Back to the repo home", href: "/" }
73
+ }
74
+ );
75
+ }
66
76
  function RepoLayout({
67
77
  children,
68
78
  client
@@ -70,5 +80,7 @@ function RepoLayout({
70
80
  return /* @__PURE__ */ jsx(RepoProviders, { ...client ? { client } : {}, children: /* @__PURE__ */ jsx(RepoFrame, { children }) });
71
81
  }
72
82
  export {
73
- RepoLayout
83
+ RepoFrame,
84
+ RepoLayout,
85
+ RepoNotFound
74
86
  };
@@ -1,10 +1,13 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useMemo } from "react";
4
- import { notFound, useParams } from "next/navigation";
4
+ import { useParams } from "next/navigation";
5
+ import { HeaderSkeleton, PageSkeleton } from "../components/page-skeletons.js";
5
6
  import { createHttpConsoleClient, packageApiBase } from "../lib/console-client.js";
6
7
  import { RepoProviders, useRepo } from "../lib/repo-context.js";
8
+ import { RepoNameProvider, repoName } from "../lib/repo-name.js";
7
9
  import { ConsoleLayout } from "./integrations-layout.js";
10
+ import { RepoFrame, RepoNotFound } from "./repo-layout.js";
8
11
  const REPO_HOME = "/";
9
12
  function RepoExperienceLayout({
10
13
  children,
@@ -22,8 +25,10 @@ function RepoExperienceLayout({
22
25
  () => ({ experience: `/experiences/${name}`, repoHome: REPO_HOME }),
23
26
  [name]
24
27
  );
25
- if (!surfaces) notFound();
26
- return /* @__PURE__ */ jsx(
28
+ if (!surfaces) {
29
+ return /* @__PURE__ */ jsx(RepoProviders, { children: /* @__PURE__ */ jsx(RepoFrame, { children: /* @__PURE__ */ jsx(RepoNotFound, { kind: "experience", name: decodeURIComponent(name) }) }) });
30
+ }
31
+ return /* @__PURE__ */ jsx(RepoProviders, { children: /* @__PURE__ */ jsx(WithRepoName, { children: /* @__PURE__ */ jsx(
27
32
  ConsoleLayout,
28
33
  {
29
34
  client: resolved,
@@ -32,7 +37,11 @@ function RepoExperienceLayout({
32
37
  apiBase: base,
33
38
  children
34
39
  }
35
- );
40
+ ) }) });
41
+ }
42
+ function WithRepoName({ children }) {
43
+ const repo = useRepo();
44
+ return /* @__PURE__ */ jsx(RepoNameProvider, { name: repo.data ? repoName(repo.data.root) : null, children });
36
45
  }
37
46
  function IntegrationScopeLayout({
38
47
  children,
@@ -47,14 +56,19 @@ function IntegrationScopeLayout({
47
56
  ] });
48
57
  }
49
58
  if (!repo.data) {
50
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground px-6 py-10 text-sm", children: "Loading\u2026" });
59
+ return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen flex-col", children: [
60
+ /* @__PURE__ */ jsx(HeaderSkeleton, {}),
61
+ /* @__PURE__ */ jsx("main", { className: "mx-auto w-full max-w-5xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading the integration" }) })
62
+ ] });
51
63
  }
52
64
  const own = repo.data.integrations.some((row) => row.name === slug);
53
65
  const host = own ? null : repo.data.experiences.find(
54
66
  (experience) => experience.integrations.some((used) => used.name === slug)
55
67
  );
56
- if (!own && !host) notFound();
57
- return /* @__PURE__ */ jsx(
68
+ if (!own && !host) {
69
+ return /* @__PURE__ */ jsx(RepoFrame, { children: /* @__PURE__ */ jsx(RepoNotFound, { kind: "integration", name: decodeURIComponent(slug) }) });
70
+ }
71
+ return /* @__PURE__ */ jsx(RepoNameProvider, { name: repoName(repo.data.root), children: /* @__PURE__ */ jsx(
58
72
  ScopedConsole,
59
73
  {
60
74
  base: packageApiBase(
@@ -65,7 +79,7 @@ function IntegrationScopeLayout({
65
79
  ...client ? { client } : {},
66
80
  children
67
81
  }
68
- );
82
+ ) });
69
83
  }
70
84
  function ScopedConsole({
71
85
  base,
@@ -3,4 +3,4 @@
3
3
  * multi-widget page — a single `full`-width entry — so what you tune here is
4
4
  * what you get over there.
5
5
  */
6
- export declare function SingleWidgetPage(): import("react").JSX.Element;
6
+ export declare function SingleWidgetPage(): import("react").JSX.Element | null;
@@ -1,23 +1,46 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { notFound } from "next/navigation";
4
3
  import { findWidget } from "../../registry.js";
4
+ import { NotFoundState } from "../components/not-found-state.js";
5
5
  import {
6
6
  WidgetSurface,
7
7
  withFocusedDefault
8
8
  } from "../components/widget-surface.js";
9
+ import { previewHref } from "../lib/preview-sections.js";
9
10
  import { useHarnessIntegration, useHarnessWidgetId } from "../registry-context.js";
10
11
  function SingleWidgetPage() {
11
12
  const integration = useHarnessIntegration();
12
13
  const widgetId = useHarnessWidgetId();
13
- if (!integration) notFound();
14
- const widget = findWidget(integration, widgetId);
15
- if (!widget) notFound();
14
+ if (!integration) return null;
15
+ const id = decodeURIComponent(widgetId);
16
+ const widget = findWidget(integration, id);
17
+ const allHref = previewHref(integration.slug, "widgets");
18
+ if (!widget) {
19
+ return /* @__PURE__ */ jsx(
20
+ NotFoundState,
21
+ {
22
+ testId: "widget-not-found",
23
+ title: `No widget called \u201C${id}\u201D`,
24
+ description: `${integration.name} registers no widget with that id. Pick one it does register.`,
25
+ options: integration.widgets.map((entry) => ({
26
+ label: entry.id,
27
+ href: previewHref(
28
+ integration.slug,
29
+ `widgets/${encodeURIComponent(entry.id)}`
30
+ ),
31
+ hint: entry.title
32
+ })),
33
+ ...integration.widgets.length > 0 ? { optionsLabel: `The widgets ${integration.name} registers` } : {},
34
+ action: { label: "All widgets", href: allHref }
35
+ }
36
+ );
37
+ }
16
38
  return /* @__PURE__ */ jsx("div", { className: "min-w-0", "data-test": "single-widget", children: /* @__PURE__ */ jsx(
17
39
  WidgetSurface,
18
40
  {
19
41
  widgets: [withFocusedDefault(widget)],
20
- productSlug: integration.slug
42
+ productSlug: integration.slug,
43
+ controls: true
21
44
  }
22
45
  ) });
23
46
  }
@@ -1 +1 @@
1
- export declare function TilePage(): import("react").JSX.Element;
1
+ export declare function TilePage(): import("react").JSX.Element | null;
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { notFound } from "next/navigation";
4
3
  import { Card } from "@ekanos/ui/card";
5
4
  import { HARNESS_ACCOUNT_ID } from "../../registry.js";
6
5
  import { ViewportFrame } from "../components/viewport-frame.js";
@@ -19,7 +18,7 @@ const NEIGHBOURS = [
19
18
  ];
20
19
  function TilePage() {
21
20
  const integration = useHarnessIntegration();
22
- if (!integration) notFound();
21
+ if (!integration) return null;
23
22
  const Tile = integration.tile;
24
23
  return /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-col gap-6", "data-test": "tile", children: Tile ? /* @__PURE__ */ jsx(ViewportFrame, { children: /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-4", children: [
25
24
  /* @__PURE__ */ jsxs("header", { children: [
@@ -1 +1 @@
1
- export declare function WidgetsPage(): import("react").JSX.Element;
1
+ export declare function WidgetsPage(): import("react").JSX.Element | null;
@@ -1,16 +1,18 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { notFound } from "next/navigation";
4
3
  import { WidgetSurface } from "../components/widget-surface.js";
4
+ import { previewHref } from "../lib/preview-sections.js";
5
5
  import { useHarnessIntegration } from "../registry-context.js";
6
6
  function WidgetsPage() {
7
7
  const integration = useHarnessIntegration();
8
- if (!integration) notFound();
8
+ if (!integration) return null;
9
9
  return /* @__PURE__ */ jsx("div", { className: "min-w-0", "data-test": "widgets", children: integration.widgets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This integration registers no widgets." }) : /* @__PURE__ */ jsx(
10
10
  WidgetSurface,
11
11
  {
12
12
  widgets: integration.widgets,
13
- productSlug: integration.slug
13
+ productSlug: integration.slug,
14
+ controls: true,
15
+ widgetHref: (id) => previewHref(integration.slug, `widgets/${encodeURIComponent(id)}`)
14
16
  }
15
17
  ) });
16
18
  }
@@ -37,7 +37,6 @@ import {
37
37
  import { isPinnedToFixtures, setPinnedToFixtures } from "./local-state.js";
38
38
  import { loopbackRefusal, isLoopbackHost } from "./loopback-guard.js";
39
39
  import { describeOAuthConnections } from "./oauth-connections.js";
40
- import { hasStoredOauthConnection } from "./oauth-persistence.js";
41
40
  import {
42
41
  createFileFixtureSource,
43
42
  runOperation
@@ -230,16 +229,32 @@ function createEkanosApiRouter(partial = {}) {
230
229
  });
231
230
  }
232
231
  const usesOauth = Boolean(definition.oauth) || Object.keys(definition.oauthConnections ?? {}).length > 0;
233
- const held = getLiveStore().get(definition.slug);
232
+ const oauthHeld = usesOauth && describeOAuthConnections({
233
+ definition,
234
+ filled: Object.keys(secrets.values),
235
+ values: secrets.values,
236
+ held: getLiveStore().get(definition.slug),
237
+ stored: readOauthConnections({
238
+ projectRoot: integration.credentialRoot,
239
+ slug: definition.slug
240
+ }),
241
+ personal: {
242
+ slug: definition.slug,
243
+ switches: readConsoleSwitches(integration.credentialRoot),
244
+ stored: readPersonTier({
245
+ projectRoot: integration.credentialRoot,
246
+ slug: definition.slug,
247
+ userId: HARNESS_USER_ID
248
+ }).oauth
249
+ }
250
+ }).some((connection) => connection.connected);
234
251
  return deriveConnectionFacts({
235
252
  ...base,
236
253
  usesOauth,
237
254
  declared: names,
238
255
  missing: secrets.missing,
239
256
  activationFieldsSet: Object.keys(secrets.activation),
240
- oauthHeld: Boolean(
241
- held && (held.connection || Object.keys(held.connections).length > 0)
242
- ) || hasStoredOauthConnection(integration.credentialRoot, definition.slug),
257
+ oauthHeld,
243
258
  manageable: true,
244
259
  target: selectConnectionTarget(secrets.activation, names)
245
260
  });
@@ -120,7 +120,10 @@ function createRepoApiRouter(partial) {
120
120
  declared: data?.declared ?? [],
121
121
  missing: data?.missing ?? [],
122
122
  activationFieldsSet: data?.activationFieldsSet ?? [],
123
- oauthHeld: manageable && (data?.oauth ?? contractAuth === "oauth2") && hasOauthConnection(pkg.name, pkg.dir),
123
+ // The package reports each OAuth connection in the tier it connects
124
+ // into (a `level: 'user'` one is the person's); fall back to any held
125
+ // token only for a package that does not report them.
126
+ oauthHeld: manageable && (data?.oauth ?? contractAuth === "oauth2") && (data?.oauthConnections ? data.oauthConnections.some((connection) => connection.connected) : hasOauthConnection(pkg.name, pkg.dir)),
124
127
  manageable,
125
128
  target: data?.target ?? [],
126
129
  supportsLive: manageable,
@@ -177,7 +180,7 @@ function createRepoApiRouter(partial) {
177
180
  return failed(error instanceof Error ? error.message : String(error));
178
181
  }
179
182
  }
180
- async function experienceRow(request, pkg, connections, repoNames) {
183
+ async function experienceRow(request, pkg, connections, repoPackageName) {
181
184
  const row = {
182
185
  name: pkg.name,
183
186
  version: pkg.version,
@@ -192,10 +195,11 @@ function createRepoApiRouter(partial) {
192
195
  }
193
196
  const integrations = [];
194
197
  for (const view of resolved.data.integrations) {
195
- const sameRepo = repoNames.has(view.integration);
198
+ const local = repoPackageName(view.integration);
199
+ const sameRepo = local !== null;
196
200
  let connection = null;
197
201
  if (sameRepo) {
198
- connection = connections.get(view.integration) ?? null;
202
+ connection = connections.get(local) ?? null;
199
203
  } else {
200
204
  const contract = await call(request, pkg, [
201
205
  "contract",
@@ -233,7 +237,9 @@ function createRepoApiRouter(partial) {
233
237
  ...unsupported.length > 0 ? {
234
238
  levelProblem: `Asks for ${unsupported.join(", ")} but ${view.integration} supports ${supported.join(", ") || "no level"}.`
235
239
  } : {},
236
- connectHref: sameRepo ? `/integrations/${view.integration}/connect` : null
240
+ connectHref: sameRepo ? `/integrations/${local}/connect` : null,
241
+ consoleHref: sameRepo ? `/integrations/${local}` : null,
242
+ packageName: local
237
243
  });
238
244
  }
239
245
  return { ...row, integrations };
@@ -247,6 +253,11 @@ function createRepoApiRouter(partial) {
247
253
  (p) => p.kind === "experience"
248
254
  );
249
255
  const repoNames = new Set(integrationPackages.map((p) => p.name));
256
+ const repoPackageName = (integration) => {
257
+ const slash = integration.lastIndexOf("/");
258
+ const name = slash === -1 ? integration : integration.slice(0, slash) === repo.namespace ? integration.slice(slash + 1) : null;
259
+ return name !== null && repoNames.has(name) ? name : null;
260
+ };
250
261
  const connections = /* @__PURE__ */ new Map();
251
262
  const integrations = [];
252
263
  for (const pkg of integrationPackages) {
@@ -257,12 +268,14 @@ function createRepoApiRouter(partial) {
257
268
  const experiences = [];
258
269
  for (const pkg of experiencePackages) {
259
270
  experiences.push(
260
- await experienceRow(request, pkg, connections, repoNames)
271
+ await experienceRow(request, pkg, connections, repoPackageName)
261
272
  );
262
273
  }
263
274
  for (const experience of experiences) {
264
275
  for (const used of experience.integrations) {
265
- integrations.find((row) => row.name === used.name)?.usedBy.push(experience.name);
276
+ if (!used.sameRepo) continue;
277
+ const local = repoPackageName(used.name);
278
+ integrations.find((row) => row.name === local)?.usedBy.push(experience.name);
266
279
  }
267
280
  }
268
281
  const connectable = integrations.filter(
@@ -85,6 +85,7 @@ export interface HarnessWidget {
85
85
  size?: 'compact' | 'half' | 'full';
86
86
  /** Same as an integration widget's `layouts`; the grid reads `lg.w` and `lg.maxHeight`. */
87
87
  layouts?: WidgetLayouts;
88
+ /** @deprecated Ignored: widgets no longer collapse. */
88
89
  isCollapsible?: boolean;
89
90
  isPinnable?: boolean;
90
91
  /** Renders the "Ask about this" AI footer bar. */
@@ -454,12 +455,10 @@ export declare function asHarnessDefinition<Schemas extends StorageSchemas>(defi
454
455
  * DERIVE THE WIDGET LIST FROM THE DEFINITION YOU ALREADY WROTE
455
456
  * ─────────────────────────────────────────────────────────────────────────────
456
457
  *
457
- * `HarnessWidget` restates `id`, `title`, `component`, `isCollapsible`,
458
- * `isPinnable` and `aiFooterEnabled` — every one of which is already in
458
+ * `HarnessWidget` restates `id`, `title`, `component`, `isPinnable` and
459
+ * `aiFooterEnabled` — every one of which is already in
459
460
  * `defineIntegration({ components: { widgets } })`. Writing both by hand means
460
- * two declarations of the same thing with nothing detecting drift, and it is
461
- * how `isCollapsible` came to be declared in one place and read from the
462
- * other.
461
+ * two declarations of the same thing with nothing detecting drift.
463
462
  *
464
463
  * This derives the harness entry from the definition, so the definition stays
465
464
  * the single source and the harness entry adds only what is genuinely
package/dist/registry.js CHANGED
@@ -26,7 +26,6 @@ function harnessWidgetsFromDefinition(definition, overrides = {}) {
26
26
  // Chrome flags come from the definition and are passed through ONLY when
27
27
  // it declares them, so an undeclared flag still lands on the host's
28
28
  // default rather than one invented here.
29
- ...widget.isCollapsible === void 0 ? {} : { isCollapsible: widget.isCollapsible },
30
29
  ...widget.isPinnable === void 0 ? {} : { isPinnable: widget.isPinnable },
31
30
  ...widget.aiFooterEnabled === void 0 ? {} : { aiFooterEnabled: widget.aiFooterEnabled },
32
31
  ...override
package/dist/routes.d.ts CHANGED
@@ -88,3 +88,8 @@ export { RepoHomePage } from './internal/routes/repo-home-page.js';
88
88
  export { RepoConnectionsPage } from './internal/routes/repo-connections-page.js';
89
89
  export { ExperienceConnectPage } from './internal/routes/experience-connect-page.js';
90
90
  export { RepoExperienceLayout, RepoIntegrationLayout, } from './internal/routes/repo-package-layouts.js';
91
+ /**
92
+ * The shell's `app/not-found.tsx`: an address no route matches, in the
93
+ * harness's own header with a way home, instead of the framework's bare 404.
94
+ */
95
+ export { NotFoundPage } from './internal/components/not-found-state.js';
package/dist/routes.js CHANGED
@@ -37,6 +37,7 @@ import {
37
37
  RepoExperienceLayout,
38
38
  RepoIntegrationLayout
39
39
  } from "./internal/routes/repo-package-layouts.js";
40
+ import { NotFoundPage } from "./internal/components/not-found-state.js";
40
41
  export {
41
42
  ActivationPage,
42
43
  ConsoleHomePage,
@@ -61,6 +62,7 @@ export {
61
62
  IntegrationRunsPage,
62
63
  IntegrationsListPage,
63
64
  LegacyPreviewRedirect,
65
+ NotFoundPage,
64
66
  PreviewIndexPage,
65
67
  PreviewLayout,
66
68
  RepoConnectionsPage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekanos/harness",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "private": false,
5
5
  "description": "The Ekanos integration dev harness — every surface of an integration rendered in real Ekanos chrome, from fixtures, with no Supabase or auth; and, in live mode, a real localhost OAuth loop over your own dev-app credentials.",
6
6
  "homepage": "https://sdk.ekanos.dev/harness/overview",
@@ -72,13 +72,13 @@
72
72
  "access": "public"
73
73
  },
74
74
  "dependencies": {
75
- "@ekanos/integration-schema": "0.26.0",
75
+ "@ekanos/integration-schema": "0.28.0",
76
76
  "next-themes": "0.4.6",
77
77
  "tw-animate-css": "1.4.0"
78
78
  },
79
79
  "devDependencies": {
80
- "@ekanos/sdk": "0.26.0",
81
- "@ekanos/ui": "0.26.0",
80
+ "@ekanos/sdk": "0.28.0",
81
+ "@ekanos/ui": "0.28.0",
82
82
  "@kit/tsconfig": "0.1.0",
83
83
  "@tailwindcss/postcss": "4.3.4",
84
84
  "@tanstack/react-query": "5.106.1",
@@ -98,8 +98,8 @@
98
98
  "zod": "4.6.7"
99
99
  },
100
100
  "peerDependencies": {
101
- "@ekanos/sdk": "^0.26.0",
102
- "@ekanos/ui": "^0.26.0",
101
+ "@ekanos/sdk": "^0.28.0",
102
+ "@ekanos/ui": "^0.28.0",
103
103
  "@tanstack/react-query": "^5.101.4",
104
104
  "next": "^16.0.0",
105
105
  "next-intl": "^4.14.7",
@@ -110,10 +110,10 @@
110
110
  "zod": "^3.25.76 || ^4.0.0"
111
111
  },
112
112
  "ekanos": {
113
- "shellContract": 5
113
+ "shellContract": 6
114
114
  },
115
115
  "scripts": {
116
- "build": "tsup && tsc -p tsconfig.build.json && node scripts/rewrite-esm-specifiers.mjs && node scripts/build-css.mjs",
116
+ "build": "tsup && tsc -p tsconfig.build.json && node scripts/rewrite-esm-specifiers.mjs && node scripts/copy-fonts.mjs && node scripts/build-css.mjs",
117
117
  "clean": "git clean -xdf .turbo node_modules dist",
118
118
  "typecheck": "tsc --noEmit",
119
119
  "test": "vitest run --config vitest.config.ts",