@ekanos/harness 0.27.0 → 0.29.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 (158) hide show
  1. package/README.md +6 -4
  2. package/dist/internal/components/approvals-tray.d.ts +44 -6
  3. package/dist/internal/components/approvals-tray.js +252 -30
  4. package/dist/internal/components/ask-assistant-bridge.js +7 -1
  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 +82 -5
  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 -4
  57. package/dist/internal/components/surface-nav.js +79 -80
  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 +27 -0
  70. package/dist/internal/lib/docs-links.js +55 -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/font-files/OFL-BricolageGrotesque.txt +93 -0
  74. package/dist/internal/lib/font-files/OFL-Figtree.txt +93 -0
  75. package/dist/internal/lib/font-files/bricolage-grotesque-latin-variable.woff2 +0 -0
  76. package/dist/internal/lib/font-files/figtree-latin-variable.woff2 +0 -0
  77. package/dist/internal/lib/fonts.js +13 -12
  78. package/dist/internal/lib/health-model.d.ts +58 -0
  79. package/dist/internal/lib/health-model.js +140 -0
  80. package/dist/internal/lib/integration-console-href.d.ts +5 -0
  81. package/dist/internal/lib/integration-console-href.js +7 -1
  82. package/dist/internal/lib/oauth-setup-guide.d.ts +28 -0
  83. package/dist/internal/lib/oauth-setup-guide.js +35 -1
  84. package/dist/internal/lib/operation-catalog.d.ts +70 -0
  85. package/dist/internal/lib/operation-catalog.js +261 -0
  86. package/dist/internal/lib/overview-model.d.ts +34 -0
  87. package/dist/internal/lib/overview-model.js +91 -0
  88. package/dist/internal/lib/registry-entry.d.ts +8 -0
  89. package/dist/internal/lib/registry-entry.js +11 -0
  90. package/dist/internal/lib/repo-name.d.ts +9 -0
  91. package/dist/internal/lib/repo-name.js +21 -0
  92. package/dist/internal/lib/run-log-view.d.ts +66 -1
  93. package/dist/internal/lib/run-log-view.js +183 -4
  94. package/dist/internal/lib/runner-view.d.ts +15 -0
  95. package/dist/internal/lib/runner-view.js +18 -0
  96. package/dist/internal/lib/schema-form-model.d.ts +17 -0
  97. package/dist/internal/lib/schema-form-model.js +50 -0
  98. package/dist/internal/lib/setup-checklist.d.ts +34 -0
  99. package/dist/internal/lib/setup-checklist.js +79 -0
  100. package/dist/internal/lib/toolbar-context.d.ts +0 -1
  101. package/dist/internal/lib/toolbar-context.js +0 -2
  102. package/dist/internal/lib/toolbar-visibility.d.ts +9 -2
  103. package/dist/internal/lib/toolbar-visibility.js +5 -0
  104. package/dist/internal/lib/use-operation-effects.d.ts +7 -0
  105. package/dist/internal/lib/use-operation-effects.js +28 -0
  106. package/dist/internal/lib/use-run-log-query.d.ts +9 -0
  107. package/dist/internal/lib/use-run-log-query.js +35 -0
  108. package/dist/internal/lib/widget-grid-gaps.d.ts +18 -0
  109. package/dist/internal/lib/widget-grid-gaps.js +41 -0
  110. package/dist/internal/lib/workflow-summary.d.ts +54 -0
  111. package/dist/internal/lib/workflow-summary.js +147 -0
  112. package/dist/internal/routes/console-home-page.js +2 -1
  113. package/dist/internal/routes/experience-connect-page.js +46 -17
  114. package/dist/internal/routes/experience-layout-page.d.ts +6 -6
  115. package/dist/internal/routes/experience-layout-page.js +3 -119
  116. package/dist/internal/routes/experience-page-host.js +61 -5
  117. package/dist/internal/routes/experience-pages-page.d.ts +5 -0
  118. package/dist/internal/routes/experience-pages-page.js +118 -0
  119. package/dist/internal/routes/experience-review-queue-page.d.ts +4 -1
  120. package/dist/internal/routes/experience-review-queue-page.js +108 -12
  121. package/dist/internal/routes/experience-runs-page.js +57 -4
  122. package/dist/internal/routes/experience-summary-page.d.ts +19 -0
  123. package/dist/internal/routes/experience-summary-page.js +212 -52
  124. package/dist/internal/routes/experience-widget-page.js +58 -7
  125. package/dist/internal/routes/experience-widgets-page.d.ts +2 -3
  126. package/dist/internal/routes/experience-widgets-page.js +29 -4
  127. package/dist/internal/routes/experience-workflow-page.js +81 -9
  128. package/dist/internal/routes/experience-workflows-page.js +85 -21
  129. package/dist/internal/routes/integration-layout.js +28 -3
  130. package/dist/internal/routes/integrations-connect-page.js +16 -6
  131. package/dist/internal/routes/integrations-events-page.js +22 -1
  132. package/dist/internal/routes/integrations-health-page.js +16 -1
  133. package/dist/internal/routes/integrations-layout.js +28 -4
  134. package/dist/internal/routes/integrations-list-page.d.ts +0 -1
  135. package/dist/internal/routes/integrations-list-page.js +11 -9
  136. package/dist/internal/routes/integrations-operation-page.js +53 -17
  137. package/dist/internal/routes/integrations-operations-page.js +539 -49
  138. package/dist/internal/routes/integrations-overview-page.js +332 -69
  139. package/dist/internal/routes/integrations-runs-page.js +53 -3
  140. package/dist/internal/routes/integrations-scope.d.ts +15 -2
  141. package/dist/internal/routes/integrations-scope.js +66 -18
  142. package/dist/internal/routes/preview-index-page.js +2 -2
  143. package/dist/internal/routes/repo-home-page.d.ts +2 -2
  144. package/dist/internal/routes/repo-home-page.js +429 -236
  145. package/dist/internal/routes/repo-layout.d.ts +12 -0
  146. package/dist/internal/routes/repo-layout.js +50 -38
  147. package/dist/internal/routes/repo-package-layouts.js +22 -8
  148. package/dist/internal/routes/single-widget-page.d.ts +1 -1
  149. package/dist/internal/routes/single-widget-page.js +28 -5
  150. package/dist/internal/routes/tile-page.d.ts +1 -1
  151. package/dist/internal/routes/tile-page.js +1 -2
  152. package/dist/internal/routes/widgets-page.d.ts +1 -1
  153. package/dist/internal/routes/widgets-page.js +5 -3
  154. package/dist/registry.d.ts +4 -5
  155. package/dist/registry.js +0 -1
  156. package/dist/routes.d.ts +8 -1
  157. package/dist/routes.js +4 -0
  158. package/package.json +14 -14
@@ -12,9 +12,7 @@ function HarnessWidgetProvider({
12
12
  className,
13
13
  state: renderState,
14
14
  isEnabled = true,
15
- isCollapsible = false,
16
15
  isPinnable = false,
17
- defaultCollapsed = false,
18
16
  defaultPinned = false,
19
17
  maxContentHeight,
20
18
  askContext,
@@ -22,15 +20,9 @@ function HarnessWidgetProvider({
22
20
  health,
23
21
  children
24
22
  }) {
25
- const [toggles, setToggles] = useState({
26
- collapsed: defaultCollapsed,
27
- pinned: defaultPinned
28
- });
29
- const toggleCollapsed = useCallback(() => {
30
- setToggles((current) => ({ ...current, collapsed: !current.collapsed }));
31
- }, []);
23
+ const [pinned, setPinned] = useState(defaultPinned);
32
24
  const togglePinned = useCallback(() => {
33
- setToggles((current) => ({ ...current, pinned: !current.pinned }));
25
+ setPinned((current) => !current);
34
26
  }, []);
35
27
  const baseRenderState = renderState !== "active" ? renderState : isEnabled ? "active" : "disabled";
36
28
  const effectiveRenderState = baseRenderState === "active" && health?.status === "unhealthy" && health?.lastSuccessAt ? "disabled" : baseRenderState;
@@ -38,19 +30,16 @@ function HarnessWidgetProvider({
38
30
  () => ({
39
31
  state: {
40
32
  state: effectiveRenderState,
41
- collapsed: toggles.collapsed,
42
- pinned: toggles.pinned,
43
- pendingCollapse: false,
33
+ pinned,
44
34
  pendingPin: false
45
35
  },
46
- actions: { toggleCollapsed, togglePinned },
36
+ actions: { togglePinned },
47
37
  meta: {
48
38
  widgetId,
49
39
  title,
50
40
  subtitle,
51
41
  description,
52
42
  maxContentHeight,
53
- isCollapsible,
54
43
  isPinnable,
55
44
  askContext,
56
45
  aiFooterEnabled,
@@ -60,16 +49,13 @@ function HarnessWidgetProvider({
60
49
  }),
61
50
  [
62
51
  effectiveRenderState,
63
- toggles.collapsed,
64
- toggles.pinned,
65
- toggleCollapsed,
52
+ pinned,
66
53
  togglePinned,
67
54
  widgetId,
68
55
  title,
69
56
  subtitle,
70
57
  description,
71
58
  maxContentHeight,
72
- isCollapsible,
73
59
  isPinnable,
74
60
  askContext,
75
61
  aiFooterEnabled,
@@ -1,4 +1,11 @@
1
1
  import type { ConsoleIntegration } from '../lib/console-types.js';
2
- export declare function HealthPanel({ integration, }: {
2
+ /**
3
+ * The Health tab: a one-line verdict with when it was last checked and Run
4
+ * check, then each check as a row with its status. The last result stays in
5
+ * the query cache, so it is still there after visiting another tab.
6
+ */
7
+ export declare function HealthPanel({ integration, contractDeclares, }: {
3
8
  integration: ConsoleIntegration;
9
+ /** Whether the contract says a `health.check` is declared; read when no definition is injected. */
10
+ contractDeclares?: boolean;
4
11
  }): import("react").JSX.Element;
@@ -1,49 +1,346 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { Alert, AlertDescription } from "@ekanos/ui/alert";
3
+ import { useState } from "react";
4
+ import Link from "next/link";
5
+ import { Alert, AlertDescription, AlertTitle } from "@ekanos/ui/alert";
4
6
  import { Button } from "@ekanos/ui/button";
7
+ import { Card } from "@ekanos/ui/card";
8
+ import { Icon } from "@ekanos/ui/icon";
9
+ import { Skeleton } from "@ekanos/ui/skeleton";
10
+ import { Spinner } from "@ekanos/ui/spinner";
5
11
  import { StatusBadge } from "@ekanos/ui/status-badge";
6
- import { useConsoleMutation } from "../lib/console-hooks.js";
7
- const TONES = {
8
- healthy: "success",
9
- degraded: "warning",
10
- unhealthy: "destructive",
11
- unknown: "neutral"
12
+ import { cn } from "@ekanos/ui/utils";
13
+ import { useQuery, useQueryClient } from "@tanstack/react-query";
14
+ import { formatWhen } from "../lib/connect-model.js";
15
+ import { useConnection, useConsoleMutation } from "../lib/console-hooks.js";
16
+ import { DOCS } from "../lib/docs-links.js";
17
+ import {
18
+ hasHealthCheck,
19
+ healthCheckRows,
20
+ healthCheckSnippet,
21
+ healthKey,
22
+ healthVerdict
23
+ } from "../lib/health-model.js";
24
+ import { integrationConsoleHref } from "../lib/integration-console-href.js";
25
+ import { registryEntryFor } from "../lib/registry-entry.js";
26
+ import { useOptionalHarnessRegistry } from "../registry-context.js";
27
+ const VERDICT_STYLE = {
28
+ clear: { icon: "check-circle", tile: "bg-muted text-foreground" },
29
+ warning: { icon: "warning-circle", tile: "bg-warning-surface text-warning" },
30
+ destructive: {
31
+ icon: "x-circle",
32
+ tile: "bg-destructive-surface text-destructive"
33
+ },
34
+ neutral: { icon: "heartbeat", tile: "bg-muted text-muted-foreground" }
35
+ };
36
+ const ROW_TONE = {
37
+ clear: "clear",
38
+ warning: "warning",
39
+ destructive: "destructive",
40
+ neutral: "neutral"
12
41
  };
13
42
  function HealthPanel({
14
- integration
43
+ integration,
44
+ contractDeclares
15
45
  }) {
16
- const check = useConsoleMutation(
17
- (c, integration2) => c.runHealth(integration2)
18
- );
46
+ const slug = integration.integration;
47
+ const queryClient = useQueryClient();
48
+ const connection = useConnection(slug);
49
+ const registry = useOptionalHarnessRegistry();
50
+ const definition = registryEntryFor(registry, slug)?.definition;
51
+ const declared = definition ? definition.health !== void 0 : contractDeclares;
52
+ const record = useQuery({
53
+ queryKey: healthKey(slug),
54
+ queryFn: () => null,
55
+ enabled: false,
56
+ staleTime: Infinity,
57
+ gcTime: Infinity
58
+ });
59
+ const last = record.data ?? null;
60
+ const check = useConsoleMutation((c, name) => c.runHealth(name));
61
+ const remember = (next) => queryClient.setQueryData(healthKey(slug), next);
62
+ const run = () => check.mutate(slug, {
63
+ onSuccess: (result) => remember({ kind: "result", result, at: (/* @__PURE__ */ new Date()).toISOString() }),
64
+ onError: (error) => remember({
65
+ kind: "error",
66
+ message: error.message,
67
+ at: (/* @__PURE__ */ new Date()).toISOString()
68
+ })
69
+ });
19
70
  if (integration.provenance.kind === "registry" && !integration.runModes.includes("live")) {
20
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", "data-test": "health-published", children: "Published: not checked locally. Health runs only against a local override." });
71
+ return /* @__PURE__ */ jsxs(
72
+ Card,
73
+ {
74
+ layout: "bleed",
75
+ render: /* @__PURE__ */ jsx("section", {}),
76
+ className: "flex flex-col gap-2 p-5",
77
+ "data-test": "health-published",
78
+ children: [
79
+ /* @__PURE__ */ jsx("h3", { className: "font-heading font-heading-title text-base", children: "Not checked locally" }),
80
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
81
+ slug,
82
+ " is the published package, which answers from fixtures here. Health runs only against a local copy of the integration with its own connection."
83
+ ] })
84
+ ]
85
+ }
86
+ );
21
87
  }
22
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "health-panel", children: [
23
- check.data || check.isError ? null : /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", "data-test": "health-empty", children: [
24
- "Not run yet. Run a health check to see whether",
25
- " ",
26
- integration.integration,
27
- " is reachable with the connection it has now."
28
- ] }),
88
+ const facts = connection.data?.facts ?? null;
89
+ const verdict = healthVerdict({ last, declared, slug });
90
+ const rows = healthCheckRows({ facts, last, declared });
91
+ const style = VERDICT_STYLE[verdict.tone];
92
+ const runnable = hasHealthCheck({ last, declared });
93
+ const connectHref = runnable && facts?.state === "not_connected" ? withSegment(integrationConsoleHref(integration), "connect") : null;
94
+ return /* @__PURE__ */ jsxs(
95
+ "div",
96
+ {
97
+ className: "flex min-w-0 flex-col gap-6",
98
+ "data-test": "health-panel",
99
+ "data-declared": runnable ? "yes" : "no",
100
+ children: [
101
+ /* @__PURE__ */ jsxs(
102
+ Card,
103
+ {
104
+ layout: "bleed",
105
+ render: /* @__PURE__ */ jsx("section", {}),
106
+ className: "flex min-w-0 flex-col gap-4 p-5 sm:flex-row sm:items-start",
107
+ "data-test": "health-verdict",
108
+ "data-tone": verdict.tone,
109
+ children: [
110
+ /* @__PURE__ */ jsx(
111
+ "span",
112
+ {
113
+ className: cn(
114
+ "flex size-10 shrink-0 items-center justify-center rounded-lg",
115
+ style.tile
116
+ ),
117
+ "aria-hidden": true,
118
+ children: /* @__PURE__ */ jsx(Icon, { name: style.icon, className: "size-5" })
119
+ }
120
+ ),
121
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", "aria-live": "polite", children: [
122
+ /* @__PURE__ */ jsx(
123
+ "h3",
124
+ {
125
+ className: "font-heading font-heading-title text-lg",
126
+ "data-test": "health-headline",
127
+ children: verdict.headline
128
+ }
129
+ ),
130
+ /* @__PURE__ */ jsx(
131
+ "p",
132
+ {
133
+ className: "text-muted-foreground text-sm",
134
+ "data-test": last ? "health-result" : "health-empty",
135
+ children: verdict.detail
136
+ }
137
+ ),
138
+ runnable || last ? /* @__PURE__ */ jsx(
139
+ "p",
140
+ {
141
+ className: "text-muted-foreground text-xs",
142
+ "data-test": "health-checked-at",
143
+ children: last ? `Last checked ${formatWhen(last.at)}` : "Not checked this session"
144
+ }
145
+ ) : null
146
+ ] }),
147
+ /* @__PURE__ */ jsx("div", { className: "flex shrink-0 flex-col items-start gap-1 sm:items-end", children: runnable ? /* @__PURE__ */ jsxs(
148
+ Button,
149
+ {
150
+ type: "button",
151
+ disabled: check.isPending,
152
+ onClick: run,
153
+ "data-test": "run-health",
154
+ children: [
155
+ check.isPending ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(Icon, { name: "arrow-clockwise" }),
156
+ check.isPending ? "Checking\u2026" : last ? "Run again" : "Run check"
157
+ ]
158
+ }
159
+ ) : /* @__PURE__ */ jsxs(
160
+ Button,
161
+ {
162
+ variant: "outline",
163
+ nativeButton: false,
164
+ render: /* @__PURE__ */ jsx(
165
+ "a",
166
+ {
167
+ href: DOCS.consoleHealth,
168
+ target: "_blank",
169
+ rel: "noreferrer",
170
+ "data-test": "health-docs"
171
+ }
172
+ ),
173
+ children: [
174
+ "How health checks work",
175
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-square-out" })
176
+ ]
177
+ }
178
+ ) })
179
+ ]
180
+ }
181
+ ),
182
+ runnable ? null : /* @__PURE__ */ jsxs(
183
+ Card,
184
+ {
185
+ layout: "bleed",
186
+ render: /* @__PURE__ */ jsx("section", {}),
187
+ className: "flex min-w-0 flex-col gap-3 p-5",
188
+ "data-test": "health-declare",
189
+ children: [
190
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
191
+ /* @__PURE__ */ jsx("h3", { className: "font-heading font-heading-title text-base", children: "Declare a check" }),
192
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
193
+ "Add ",
194
+ /* @__PURE__ */ jsx("code", { className: "font-mono", children: "health" }),
195
+ " to the object you pass to ",
196
+ /* @__PURE__ */ jsx("code", { className: "font-mono", children: "defineIntegration" }),
197
+ ".",
198
+ " ",
199
+ /* @__PURE__ */ jsx("code", { className: "font-mono", children: "check" }),
200
+ " gets the integration context and resolves ",
201
+ /* @__PURE__ */ jsx("code", { className: "font-mono", children: "healthy" }),
202
+ ",",
203
+ " ",
204
+ /* @__PURE__ */ jsx("code", { className: "font-mono", children: "degraded" }),
205
+ ",",
206
+ " ",
207
+ /* @__PURE__ */ jsx("code", { className: "font-mono", children: "unhealthy" }),
208
+ " or",
209
+ " ",
210
+ /* @__PURE__ */ jsx("code", { className: "font-mono", children: "unknown" }),
211
+ ", with an optional",
212
+ " ",
213
+ /* @__PURE__ */ jsx("code", { className: "font-mono", children: "detail" }),
214
+ ". Save, and Run check appears here."
215
+ ] })
216
+ ] }),
217
+ /* @__PURE__ */ jsx(
218
+ SnippetBlock,
219
+ {
220
+ code: healthCheckSnippet(definition?.egress),
221
+ testId: "health-snippet"
222
+ }
223
+ )
224
+ ]
225
+ }
226
+ ),
227
+ connectHref ? /* @__PURE__ */ jsxs(Alert, { variant: "warning", "data-test": "health-not-connected", children: [
228
+ /* @__PURE__ */ jsxs(AlertTitle, { children: [
229
+ slug,
230
+ " is not connected"
231
+ ] }),
232
+ /* @__PURE__ */ jsxs(AlertDescription, { children: [
233
+ /* @__PURE__ */ jsxs("p", { children: [
234
+ "The check calls ",
235
+ slug,
236
+ " with its connection, so it will fail until you connect."
237
+ ] }),
238
+ /* @__PURE__ */ jsxs(
239
+ Button,
240
+ {
241
+ variant: "outline",
242
+ size: "sm",
243
+ className: "mt-2",
244
+ nativeButton: false,
245
+ render: /* @__PURE__ */ jsx(Link, { href: connectHref, "data-test": "health-connect-link" }),
246
+ children: [
247
+ "Go to Connect",
248
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
249
+ ]
250
+ }
251
+ )
252
+ ] })
253
+ ] }) : null,
254
+ /* @__PURE__ */ jsxs(
255
+ "section",
256
+ {
257
+ className: "flex min-w-0 flex-col gap-2",
258
+ "data-test": "health-checks",
259
+ children: [
260
+ /* @__PURE__ */ jsx("h3", { className: "font-heading font-heading-title text-base", children: "Checks" }),
261
+ /* @__PURE__ */ jsx(
262
+ Card,
263
+ {
264
+ layout: "bleed",
265
+ render: /* @__PURE__ */ jsx("ul", {}),
266
+ className: "flex flex-col gap-0 divide-y py-0",
267
+ children: rows.map((row) => /* @__PURE__ */ jsxs(
268
+ "li",
269
+ {
270
+ className: "flex min-w-0 flex-col gap-1 px-4 py-3 sm:flex-row sm:items-start sm:gap-4",
271
+ "data-test": `health-check-${row.id}`,
272
+ children: [
273
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
274
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: row.label }),
275
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs [overflow-wrap:anywhere]", children: row.detail })
276
+ ] }),
277
+ connection.isPending && row.id === "connection" ? /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-24" }) : /* @__PURE__ */ jsx(
278
+ StatusBadge,
279
+ {
280
+ tone: ROW_TONE[row.tone],
281
+ className: "self-start",
282
+ "data-test": `health-check-${row.id}-status`,
283
+ children: row.status
284
+ }
285
+ )
286
+ ]
287
+ },
288
+ row.id
289
+ ))
290
+ }
291
+ ),
292
+ connection.isError ? /* @__PURE__ */ jsxs("p", { className: "text-destructive text-xs", role: "alert", children: [
293
+ "Could not read the connection: ",
294
+ connection.error.message
295
+ ] }) : null
296
+ ]
297
+ }
298
+ )
299
+ ]
300
+ }
301
+ );
302
+ }
303
+ function SnippetBlock({ code, testId }) {
304
+ return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
29
305
  /* @__PURE__ */ jsx(
30
- Button,
306
+ "pre",
31
307
  {
32
- type: "button",
33
- className: "self-start",
34
- disabled: check.isPending,
35
- onClick: () => check.mutate(integration.integration),
36
- "data-test": "run-health",
37
- children: check.isPending ? "Checking\u2026" : "Run health check"
308
+ className: "bg-muted min-w-0 overflow-x-auto rounded-md p-3 font-mono text-xs leading-relaxed",
309
+ "data-test": testId,
310
+ children: /* @__PURE__ */ jsx("code", { children: code })
38
311
  }
39
312
  ),
40
- check.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx(AlertDescription, { children: check.error.message }) }) : null,
41
- check.data ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", "data-test": "health-result", children: [
42
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(StatusBadge, { tone: TONES[check.data.status], children: check.data.status }) }),
43
- check.data.message ? /* @__PURE__ */ jsx("p", { className: "text-sm", children: check.data.message }) : null
44
- ] }) : null
313
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(CopySnippet, { code, testId }) })
45
314
  ] });
46
315
  }
316
+ function CopySnippet({ code, testId }) {
317
+ const [copied, setCopied] = useState(false);
318
+ return /* @__PURE__ */ jsxs(
319
+ Button,
320
+ {
321
+ type: "button",
322
+ variant: "outline",
323
+ size: "sm",
324
+ onClick: async () => {
325
+ try {
326
+ await navigator.clipboard.writeText(code);
327
+ setCopied(true);
328
+ setTimeout(() => setCopied(false), 1500);
329
+ } catch (error) {
330
+ console.warn("[harness] could not copy to the clipboard:", error);
331
+ }
332
+ },
333
+ "data-test": `${testId}-copy`,
334
+ children: [
335
+ /* @__PURE__ */ jsx(Icon, { name: copied ? "check" : "copy" }),
336
+ copied ? "Copied" : "Copy snippet"
337
+ ]
338
+ }
339
+ );
340
+ }
341
+ function withSegment(base, segment) {
342
+ return base ? `${base}/${segment}` : null;
343
+ }
47
344
  export {
48
345
  HealthPanel
49
346
  };
@@ -4,6 +4,7 @@ import Link from "next/link";
4
4
  import { Badge } from "@ekanos/ui/badge";
5
5
  import { Icon } from "@ekanos/ui/icon";
6
6
  import { cn } from "@ekanos/ui/utils";
7
+ import { integrationConsoleHref } from "../lib/integration-console-href.js";
7
8
  function shortDigest(digest) {
8
9
  return `${digest.replace(/^sha256:/, "").slice(0, 6)}\u2026`;
9
10
  }
@@ -82,12 +83,13 @@ function IntegrationBadge({
82
83
  }
83
84
  )
84
85
  ] });
85
- if (!linked)
86
+ const href = linked ? integrationConsoleHref(integration) : null;
87
+ if (!href)
86
88
  return /* @__PURE__ */ jsx("span", { "data-test": `integration-badge-${integration.integration}`, children: label });
87
89
  return /* @__PURE__ */ jsx(
88
90
  Link,
89
91
  {
90
- href: `/integrations/${integration.integration}`,
92
+ href,
91
93
  "data-test": `integration-badge-${integration.integration}`,
92
94
  className: "hover:bg-accent -mx-1 inline-flex rounded-md px-1 py-0.5 transition-colors",
93
95
  children: label
@@ -0,0 +1,8 @@
1
+ /** Overview: the next-step card, four figures, the details card. */
2
+ export declare function OverviewSkeleton(): import("react").JSX.Element;
3
+ /** Connect: the status card, then numbered steps. */
4
+ export declare function ConnectTabSkeleton(): import("react").JSX.Element;
5
+ /** Health: the verdict card, then the check rows. */
6
+ export declare function HealthTabSkeleton(): import("react").JSX.Element;
7
+ /** Events: the event list beside the payload editor. */
8
+ export declare function EventsTabSkeleton(): import("react").JSX.Element;
@@ -0,0 +1,76 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Skeleton } from "@ekanos/ui/skeleton";
3
+ import { RowsSkeleton } from "./page-skeletons.js";
4
+ function HeadingSkeleton() {
5
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
6
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-40" }),
7
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-96 max-w-full" })
8
+ ] });
9
+ }
10
+ function OverviewSkeleton() {
11
+ return /* @__PURE__ */ jsxs(
12
+ "div",
13
+ {
14
+ className: "flex flex-col gap-6",
15
+ role: "status",
16
+ "aria-label": "Loading the overview",
17
+ children: [
18
+ /* @__PURE__ */ jsx(HeadingSkeleton, {}),
19
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-44 w-full rounded-lg" }),
20
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3 lg:grid-cols-4", children: [0, 1, 2, 3].map((tile) => /* @__PURE__ */ jsx(Skeleton, { className: "h-24 rounded-lg" }, tile)) }),
21
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-64 w-full rounded-lg" })
22
+ ]
23
+ }
24
+ );
25
+ }
26
+ function ConnectTabSkeleton() {
27
+ return /* @__PURE__ */ jsxs(
28
+ "div",
29
+ {
30
+ className: "flex flex-col gap-6",
31
+ role: "status",
32
+ "aria-label": "Loading the connection",
33
+ children: [
34
+ /* @__PURE__ */ jsx(HeadingSkeleton, {}),
35
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full rounded-lg" }),
36
+ [0, 1].map((step) => /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
37
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-7 rounded-full" }),
38
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-3", children: [
39
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-48" }),
40
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full rounded-lg" })
41
+ ] })
42
+ ] }, step))
43
+ ]
44
+ }
45
+ );
46
+ }
47
+ function HealthTabSkeleton() {
48
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
49
+ /* @__PURE__ */ jsx(HeadingSkeleton, {}),
50
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-28 w-full rounded-lg" }),
51
+ /* @__PURE__ */ jsx(RowsSkeleton, { rows: 2, label: "Loading the checks" })
52
+ ] });
53
+ }
54
+ function EventsTabSkeleton() {
55
+ return /* @__PURE__ */ jsxs(
56
+ "div",
57
+ {
58
+ className: "flex flex-col gap-6",
59
+ role: "status",
60
+ "aria-label": "Loading the events",
61
+ children: [
62
+ /* @__PURE__ */ jsx(HeadingSkeleton, {}),
63
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-4 lg:grid-cols-[16rem_minmax(0,1fr)]", children: [
64
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: [0, 1, 2, 3].map((row) => /* @__PURE__ */ jsx(Skeleton, { className: "h-12 rounded-md" }, row)) }),
65
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-80 rounded-lg" })
66
+ ] })
67
+ ]
68
+ }
69
+ );
70
+ }
71
+ export {
72
+ ConnectTabSkeleton,
73
+ EventsTabSkeleton,
74
+ HealthTabSkeleton,
75
+ OverviewSkeleton
76
+ };
@@ -0,0 +1,39 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface NotFoundOption {
3
+ label: string;
4
+ /** Absent when the harness serves no page for it: listed as plain text. */
5
+ href?: string | null;
6
+ /** A quiet fact after the name, such as a version or a kind. */
7
+ hint?: string;
8
+ }
9
+ /**
10
+ * What a route could not find, in the shell's own chrome: the thing named
11
+ * plainly, the things that do exist as links, and one way back.
12
+ *
13
+ * Routes render this instead of calling `notFound()`: a client `notFound()`
14
+ * escapes every layout to the shell's root boundary, which drops the header
15
+ * and leaves no way back.
16
+ */
17
+ export declare function NotFoundState({ title, description, options, optionsLabel, action, testId, }: {
18
+ title: ReactNode;
19
+ description?: ReactNode;
20
+ options?: readonly NotFoundOption[];
21
+ /** The sentence above the options, e.g. "Integrations in this project". */
22
+ optionsLabel?: string;
23
+ action: {
24
+ label: string;
25
+ href: string;
26
+ };
27
+ testId?: string;
28
+ }): import("react").JSX.Element;
29
+ /**
30
+ * A not-found with its own header, for where no layout draws one: the shell's
31
+ * root `not-found` (an address no route matches) and a preview address whose
32
+ * integration is not in the registry.
33
+ */
34
+ export declare function NotFoundPage({ title, description, options, optionsLabel, }?: {
35
+ title?: ReactNode;
36
+ description?: ReactNode;
37
+ options?: readonly NotFoundOption[];
38
+ optionsLabel?: string;
39
+ }): import("react").JSX.Element;