@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
@@ -1,35 +1,43 @@
1
1
  "use client";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import Link from "next/link";
4
4
  import { Button } from "@ekanos/ui/button";
5
5
  import { Card } from "@ekanos/ui/card";
6
+ import { EmptyNote } from "@ekanos/ui/empty-note";
7
+ import { Icon } from "@ekanos/ui/icon";
8
+ import { Skeleton } from "@ekanos/ui/skeleton";
6
9
  import { StatusBadge } from "@ekanos/ui/status-badge";
10
+ import { cn } from "@ekanos/ui/utils";
7
11
  import { useQueryClient } from "@tanstack/react-query";
8
12
  import { ConnectControls } from "../components/connect-controls.js";
13
+ import { DocsLink } from "../components/docs-link.js";
9
14
  import {
10
15
  CONNECTION_TYPE,
11
16
  ConnectionStatusChip,
12
17
  levelList
13
18
  } from "../components/repo-connection.js";
19
+ import { FOCUS_RING } from "../components/scrollable-nav.js";
14
20
  import { isReady, relativePath } from "../lib/connection-facts.js";
21
+ import { DOCS } from "../lib/docs-links.js";
15
22
  import { repoKeys, useRepo, useRepoHealth } from "../lib/repo-context.js";
23
+ import {
24
+ keysNeededLabel,
25
+ missingKeys,
26
+ needsConnecting,
27
+ setupSteps,
28
+ shortName
29
+ } from "../lib/setup-checklist.js";
16
30
  const HEALTH_TONE = {
17
31
  healthy: "success",
18
32
  degraded: "warning",
19
33
  unhealthy: "destructive",
20
34
  unknown: "neutral"
21
35
  };
22
- function Count({
23
- label,
24
- value,
25
- testId
26
- }) {
27
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", "data-test": testId, children: [
28
- /* @__PURE__ */ jsx("span", { className: "font-heading font-heading-semibold text-2xl tracking-tight", children: value }),
29
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: label })
30
- ] });
31
- }
32
- function HealthCell({ name, live }) {
36
+ const QUIET_LINK = cn(
37
+ "text-muted-foreground hover:text-foreground rounded-sm text-xs underline-offset-2 hover:underline",
38
+ FOCUS_RING
39
+ );
40
+ function HealthCell({ name }) {
33
41
  const health = useRepoHealth();
34
42
  const result = health.data;
35
43
  if (result) {
@@ -43,16 +51,6 @@ function HealthCell({ name, live }) {
43
51
  }
44
52
  );
45
53
  }
46
- if (!live) {
47
- return /* @__PURE__ */ jsx(
48
- "span",
49
- {
50
- className: "text-muted-foreground text-xs",
51
- "data-test": `health-${name}`,
52
- children: "Not checked locally"
53
- }
54
- );
55
- }
56
54
  return /* @__PURE__ */ jsx(
57
55
  Button,
58
56
  {
@@ -65,253 +63,448 @@ function HealthCell({ name, live }) {
65
63
  }
66
64
  );
67
65
  }
68
- function RepoHomePage() {
69
- const repo = useRepo();
70
- const queryClient = useQueryClient();
71
- if (!repo.data) {
72
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
73
- }
74
- const { counts, integrations, experiences } = repo.data;
75
- const refresh = () => queryClient.invalidateQueries({ queryKey: repoKeys.repo });
76
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8", "data-test": "repo-home", children: [
77
- /* @__PURE__ */ jsxs(
78
- "div",
79
- {
80
- className: "grid grid-cols-2 gap-6 sm:grid-cols-5",
81
- "data-test": "repo-counts",
82
- children: [
83
- /* @__PURE__ */ jsx(
84
- Count,
85
- {
86
- label: "Integrations",
87
- value: counts.integrations,
88
- testId: "count-integrations"
89
- }
90
- ),
91
- /* @__PURE__ */ jsx(
92
- Count,
93
- {
94
- label: "Experiences",
95
- value: counts.experiences,
96
- testId: "count-experiences"
97
- }
98
- ),
99
- /* @__PURE__ */ jsx(
100
- Count,
101
- {
102
- label: "Connected",
103
- value: counts.connected,
104
- testId: "count-connected"
105
- }
106
- ),
107
- /* @__PURE__ */ jsx(
108
- Count,
66
+ function Counts({ counts }) {
67
+ const items = [
68
+ { value: counts.integrations, label: "integrations", id: "integrations" },
69
+ { value: counts.experiences, label: "experiences", id: "experiences" },
70
+ { value: counts.connected, label: "connected", id: "connected" },
71
+ {
72
+ value: counts.notConnected,
73
+ label: "to connect",
74
+ id: "not-connected"
75
+ },
76
+ {
77
+ value: counts.noConnectionNeeded,
78
+ label: "need no connection",
79
+ id: "no-connection-needed"
80
+ }
81
+ ];
82
+ return /* @__PURE__ */ jsx(
83
+ "p",
84
+ {
85
+ className: "text-muted-foreground flex flex-wrap gap-x-3 gap-y-1 text-xs",
86
+ "data-test": "repo-counts",
87
+ children: items.map((item, index) => /* @__PURE__ */ jsxs("span", { "data-test": `count-${item.id}`, children: [
88
+ index > 0 ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "mr-3", children: "\xB7" }) : null,
89
+ /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium tabular-nums", children: item.value }),
90
+ " ",
91
+ item.label
92
+ ] }, item.id))
93
+ }
94
+ );
95
+ }
96
+ function StepRow({ step, first }) {
97
+ return /* @__PURE__ */ jsxs(
98
+ "li",
99
+ {
100
+ className: "flex items-start gap-3 px-5 py-3",
101
+ "data-test": `setup-step-${step.id}`,
102
+ "data-done": step.done,
103
+ children: [
104
+ /* @__PURE__ */ jsx(
105
+ "span",
106
+ {
107
+ className: cn(
108
+ "mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full border",
109
+ step.done && "bg-success border-success text-background"
110
+ ),
111
+ "aria-hidden": "true",
112
+ children: step.done ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "h-3 w-3" }) : null
113
+ }
114
+ ),
115
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
116
+ /* @__PURE__ */ jsxs(
117
+ "span",
109
118
  {
110
- label: "No connection needed",
111
- value: counts.noConnectionNeeded,
112
- testId: "count-no-connection-needed"
119
+ className: cn(
120
+ "text-sm font-medium",
121
+ step.done && "text-muted-foreground line-through"
122
+ ),
123
+ children: [
124
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: step.done ? "Done: " : "To do: " }),
125
+ step.title
126
+ ]
113
127
  }
114
128
  ),
115
- /* @__PURE__ */ jsx(
116
- Count,
117
- {
118
- label: "Need connecting",
119
- value: counts.notConnected,
120
- testId: "count-not-connected"
121
- }
122
- )
129
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: step.hint })
130
+ ] }),
131
+ step.done ? null : /* @__PURE__ */ jsx(
132
+ Button,
133
+ {
134
+ size: "sm",
135
+ variant: first ? "default" : "outline",
136
+ nativeButton: false,
137
+ render: /* @__PURE__ */ jsx(Link, { href: step.href }),
138
+ "data-test": `setup-action-${step.id}`,
139
+ children: step.actionLabel
140
+ }
141
+ )
142
+ ]
143
+ }
144
+ );
145
+ }
146
+ function SetupChecklist({ repo }) {
147
+ const steps = setupSteps(repo);
148
+ const done = steps.filter((step) => step.done).length;
149
+ const firstOpen = steps.find((step) => !step.done)?.id;
150
+ if (done === steps.length) {
151
+ return /* @__PURE__ */ jsxs(
152
+ Card,
153
+ {
154
+ layout: "bleed",
155
+ className: "flex flex-col gap-2 p-5",
156
+ "data-test": "setup-all-set",
157
+ children: [
158
+ /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-sm font-medium", children: [
159
+ /* @__PURE__ */ jsx(Icon, { name: "check-circle", className: "text-success h-5 w-5" }),
160
+ steps.length === 0 ? "Nothing to connect: everything runs as shipped." : "All set: every integration is connected and every experience can run live."
161
+ ] }),
162
+ /* @__PURE__ */ jsx(Counts, { counts: repo.counts })
123
163
  ]
124
164
  }
125
- ),
126
- /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-4", "data-test": "repo-integrations", children: [
127
- /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Integrations" }),
128
- integrations.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
129
- "No integrations in this repo yet. Run",
130
- " ",
131
- /* @__PURE__ */ jsx("code", { children: "ekanos new integration <name>" }),
132
- "."
133
- ] }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: integrations.map((row) => /* @__PURE__ */ jsxs(
134
- Card,
165
+ );
166
+ }
167
+ return /* @__PURE__ */ jsxs(Card, { layout: "bleed", className: "flex flex-col", "data-test": "setup-checklist", children: [
168
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 px-5 pt-5 pb-4", children: [
169
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline justify-between gap-2", children: [
170
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Get set up" }),
171
+ /* @__PURE__ */ jsxs(
172
+ "span",
173
+ {
174
+ className: "text-muted-foreground text-sm tabular-nums",
175
+ "data-test": "setup-progress",
176
+ children: [
177
+ done,
178
+ " of ",
179
+ steps.length,
180
+ " done"
181
+ ]
182
+ }
183
+ )
184
+ ] }),
185
+ /* @__PURE__ */ jsx(
186
+ "div",
135
187
  {
136
- layout: "bleed",
137
- render: /* @__PURE__ */ jsx("li", {}),
138
- className: "flex flex-col gap-3 p-5",
139
- "data-test": `integration-${row.name}`,
140
- children: [
141
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-2", children: [
142
- /* @__PURE__ */ jsx(
143
- Link,
144
- {
145
- href: row.consoleHref,
146
- className: "text-sm font-medium hover:underline",
147
- children: row.name
148
- }
149
- ),
150
- /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-xs", children: [
151
- "v",
152
- row.version
153
- ] }),
154
- row.contractVersion ? /* @__PURE__ */ jsxs(
155
- "code",
156
- {
157
- className: "text-muted-foreground text-xs",
158
- "data-test": `contract-${row.name}`,
159
- children: [
160
- "contract ",
161
- row.contractVersion
162
- ]
163
- }
164
- ) : null,
165
- /* @__PURE__ */ jsx(ConnectionStatusChip, { connection: row.connection }),
166
- row.connection && row.connection.facts.kind !== "none" && row.connection.facts.state !== "connected" ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: CONNECTION_TYPE[row.connection.type] }) : null
188
+ className: "flex gap-1",
189
+ role: "progressbar",
190
+ "aria-label": "Setup progress",
191
+ "aria-valuemin": 0,
192
+ "aria-valuemax": steps.length,
193
+ "aria-valuenow": done,
194
+ children: steps.map((step) => /* @__PURE__ */ jsx(
195
+ "span",
196
+ {
197
+ className: cn(
198
+ "h-1.5 flex-1 rounded-full",
199
+ step.done ? "bg-primary" : "bg-muted"
200
+ )
201
+ },
202
+ step.id
203
+ ))
204
+ }
205
+ ),
206
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
207
+ "You can explore now: until an integration is connected, it answers from fixtures. Connect each one to run its reads live.",
208
+ " ",
209
+ /* @__PURE__ */ jsx(DocsLink, { href: DOCS.connecting, className: "inline-flex", children: "How connecting works" })
210
+ ] })
211
+ ] }),
212
+ /* @__PURE__ */ jsx("ol", { className: "divide-y border-t", children: steps.map((step) => /* @__PURE__ */ jsx(StepRow, { step, first: step.id === firstOpen }, step.id)) }),
213
+ /* @__PURE__ */ jsx("div", { className: "border-t px-5 py-3", children: /* @__PURE__ */ jsx(Counts, { counts: repo.counts }) })
214
+ ] });
215
+ }
216
+ function IntegrationRow({
217
+ row,
218
+ root,
219
+ onChanged
220
+ }) {
221
+ const connection = row.connection;
222
+ const facts = connection?.facts ?? null;
223
+ const keys = keysNeededLabel(facts);
224
+ const connected = facts?.state === "connected";
225
+ const live = isReady(facts) && facts?.state !== "managed";
226
+ const connectHref = `${row.consoleHref}/connect`;
227
+ return /* @__PURE__ */ jsxs(
228
+ "li",
229
+ {
230
+ className: "flex flex-col gap-3 px-5 py-4 md:flex-row md:items-start md:gap-6",
231
+ "data-test": `integration-${row.name}`,
232
+ children: [
233
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
234
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
235
+ /* @__PURE__ */ jsx(
236
+ Link,
237
+ {
238
+ href: row.consoleHref,
239
+ className: cn("rounded-sm font-medium hover:underline", FOCUS_RING),
240
+ children: row.name
241
+ }
242
+ ),
243
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground font-mono text-xs", children: [
244
+ "v",
245
+ row.version
167
246
  ] }),
168
- row.connection ? /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-x-6 gap-y-1 text-xs sm:grid-cols-[auto_1fr]", children: [
169
- row.connection.facts.kind !== "none" ? /* @__PURE__ */ jsxs(Fragment, { children: [
170
- /* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: "After publishing" }),
171
- /* @__PURE__ */ jsx("dd", { "data-test": `levels-${row.name}`, children: levelList(row.connection.levels) })
172
- ] }) : null,
173
- row.connection.storeRoot ? /* @__PURE__ */ jsxs(Fragment, { children: [
174
- /* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: "Local store" }),
175
- /* @__PURE__ */ jsx(
176
- "dd",
177
- {
178
- className: "break-all",
179
- title: row.connection.storeRoot,
180
- children: /* @__PURE__ */ jsx("code", { children: row.connection.displayRoot ?? relativePath(
181
- row.connection.storeRoot,
182
- repo.data.root
183
- ) })
184
- }
185
- )
186
- ] }) : null
187
- ] }) : null,
188
- row.connection?.detail ? /* @__PURE__ */ jsx(
189
- "p",
247
+ row.contractVersion ? /* @__PURE__ */ jsxs(
248
+ "span",
190
249
  {
191
- className: "text-muted-foreground text-xs",
250
+ className: "text-muted-foreground font-mono text-xs",
251
+ "data-test": `contract-${row.name}`,
252
+ title: "The operation contract version experiences pin",
253
+ children: [
254
+ "contract ",
255
+ row.contractVersion
256
+ ]
257
+ }
258
+ ) : null
259
+ ] }),
260
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
261
+ /* @__PURE__ */ jsx(ConnectionStatusChip, { connection }),
262
+ connection && needsConnecting(facts) && !connected ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: CONNECTION_TYPE[connection.type] }) : null,
263
+ keys ? /* @__PURE__ */ jsx(
264
+ Link,
265
+ {
266
+ href: connectHref,
267
+ className: cn(QUIET_LINK, "text-foreground underline"),
268
+ title: missingKeys(facts?.detail).join(", "),
192
269
  "data-test": `detail-${row.name}`,
193
- children: row.connection.detail
270
+ children: keys
194
271
  }
195
- ) : null,
196
- row.error ? /* @__PURE__ */ jsx(
197
- "p",
272
+ ) : connection?.detail && !connected ? /* @__PURE__ */ jsx(
273
+ "span",
198
274
  {
199
- className: "text-destructive text-xs",
200
- "data-test": `error-${row.name}`,
201
- children: row.error
275
+ className: "text-muted-foreground text-xs",
276
+ "data-test": `detail-${row.name}`,
277
+ children: connection.detail
202
278
  }
203
- ) : null,
204
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
205
- /* @__PURE__ */ jsx(
206
- HealthCell,
207
- {
208
- name: row.name,
209
- live: isReady(row.connection?.facts ?? null) && row.connection?.facts.state !== "managed"
210
- }
211
- ),
279
+ ) : null
280
+ ] }),
281
+ connection ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground flex flex-wrap gap-x-3 gap-y-1 text-xs", children: [
282
+ facts && facts.kind !== "none" ? /* @__PURE__ */ jsxs("span", { children: [
283
+ "Once published, connected by",
284
+ " ",
212
285
  /* @__PURE__ */ jsx(
213
- ConnectControls,
286
+ "span",
214
287
  {
215
- name: row.name,
216
- connection: row.connection,
217
- returnPath: "/",
218
- onChanged: refresh
219
- }
220
- ),
221
- /* @__PURE__ */ jsx(
222
- Button,
223
- {
224
- variant: "outline",
225
- size: "sm",
226
- className: "sm:ml-auto",
227
- nativeButton: false,
228
- render: /* @__PURE__ */ jsx(Link, { href: row.consoleHref }),
229
- "data-test": `console-${row.name}`,
230
- children: "Open console"
288
+ className: "text-foreground",
289
+ "data-test": `levels-${row.name}`,
290
+ children: levelList(connection.levels)
231
291
  }
232
292
  )
233
- ] })
234
- ]
235
- },
236
- row.name
237
- )) })
238
- ] }),
239
- /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-4", "data-test": "repo-experiences", children: [
240
- /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Experiences" }),
241
- experiences.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
242
- "No experiences in this repo yet. Run",
243
- " ",
244
- /* @__PURE__ */ jsx("code", { children: "ekanos new experience <name>" }),
245
- "."
246
- ] }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: experiences.map((row) => /* @__PURE__ */ jsxs(
247
- Card,
248
- {
249
- layout: "bleed",
250
- render: /* @__PURE__ */ jsx("li", {}),
251
- className: "flex flex-col gap-3 p-5",
252
- "data-test": `experience-${row.name}`,
253
- children: [
254
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-2", children: [
293
+ ] }) : null,
294
+ connection.storeRoot ? /* @__PURE__ */ jsxs("span", { children: [
295
+ "Local credentials in",
296
+ " ",
255
297
  /* @__PURE__ */ jsx(
256
- Link,
298
+ "code",
257
299
  {
258
- href: row.viewHref,
259
- className: "text-sm font-medium hover:underline",
260
- children: row.name
300
+ className: "text-foreground break-all",
301
+ title: connection.storeRoot,
302
+ children: connection.displayRoot ?? relativePath(connection.storeRoot, root)
261
303
  }
262
- ),
263
- /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-xs", children: [
264
- "v",
265
- row.version
266
- ] })
267
- ] }),
268
- row.error ? /* @__PURE__ */ jsx("p", { className: "text-destructive text-xs", children: row.error }) : null,
304
+ )
305
+ ] }) : null,
306
+ row.usedBy.length > 0 ? /* @__PURE__ */ jsxs("span", { children: [
307
+ "Used by ",
308
+ row.usedBy.join(", ")
309
+ ] }) : null
310
+ ] }) : null,
311
+ row.error ? /* @__PURE__ */ jsx(
312
+ "p",
313
+ {
314
+ className: "text-destructive text-xs",
315
+ "data-test": `error-${row.name}`,
316
+ children: row.error
317
+ }
318
+ ) : null,
319
+ /* @__PURE__ */ jsxs("p", { className: "flex flex-wrap gap-x-3 gap-y-1", children: [
320
+ /* @__PURE__ */ jsx(Link, { href: `${row.consoleHref}/operations`, className: QUIET_LINK, children: "Operations" }),
321
+ /* @__PURE__ */ jsx(Link, { href: `${row.consoleHref}/events`, className: QUIET_LINK, children: "Events" }),
322
+ /* @__PURE__ */ jsx(Link, { href: `${row.consoleHref}/runs`, className: QUIET_LINK, children: "Run log" })
323
+ ] })
324
+ ] }),
325
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 md:justify-end", children: [
326
+ live ? /* @__PURE__ */ jsx(HealthCell, { name: row.name }) : null,
327
+ /* @__PURE__ */ jsx(
328
+ ConnectControls,
329
+ {
330
+ name: row.name,
331
+ connection,
332
+ returnPath: "/",
333
+ onChanged
334
+ }
335
+ ),
336
+ /* @__PURE__ */ jsx(
337
+ Button,
338
+ {
339
+ variant: connected || !needsConnecting(facts) ? "outline" : "ghost",
340
+ size: "sm",
341
+ nativeButton: false,
342
+ render: /* @__PURE__ */ jsx(Link, { href: row.consoleHref }),
343
+ "data-test": `console-${row.name}`,
344
+ children: "Open console"
345
+ }
346
+ )
347
+ ] })
348
+ ]
349
+ }
350
+ );
351
+ }
352
+ function ExperienceRow({ row }) {
353
+ const waiting = row.integrations.filter(
354
+ (used) => !isReady(used.connection?.facts ?? null)
355
+ );
356
+ const ready = waiting.length === 0;
357
+ return /* @__PURE__ */ jsxs(
358
+ "li",
359
+ {
360
+ className: "flex flex-col gap-3 px-5 py-4 md:flex-row md:items-start md:gap-6",
361
+ "data-test": `experience-${row.name}`,
362
+ children: [
363
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
364
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
269
365
  /* @__PURE__ */ jsx(
270
- "ul",
366
+ Link,
271
367
  {
272
- className: "flex flex-wrap gap-2",
273
- "aria-label": "Integrations it uses",
274
- children: row.integrations.map((used) => /* @__PURE__ */ jsxs(
368
+ href: row.viewHref,
369
+ className: cn("rounded-sm font-medium hover:underline", FOCUS_RING),
370
+ children: row.name
371
+ }
372
+ ),
373
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground font-mono text-xs", children: [
374
+ "v",
375
+ row.version
376
+ ] })
377
+ ] }),
378
+ row.error ? /* @__PURE__ */ jsx("p", { className: "text-destructive text-xs", children: row.error }) : null,
379
+ row.integrations.length > 0 ? /* @__PURE__ */ jsxs(
380
+ "ul",
381
+ {
382
+ className: "flex flex-wrap items-center gap-x-3 gap-y-1",
383
+ "aria-label": "Integrations it uses",
384
+ children: [
385
+ /* @__PURE__ */ jsx("li", { className: "text-muted-foreground text-xs", children: "Uses" }),
386
+ row.integrations.map((used) => /* @__PURE__ */ jsxs(
275
387
  "li",
276
388
  {
277
- className: "flex items-center gap-2",
389
+ className: "flex items-center gap-1.5",
278
390
  "data-test": `uses-${row.name}-${used.name}`,
279
391
  children: [
280
- /* @__PURE__ */ jsx("code", { className: "text-xs", children: used.name }),
392
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-xs", title: used.name, children: shortName(used.name) }),
281
393
  /* @__PURE__ */ jsx(ConnectionStatusChip, { connection: used.connection })
282
394
  ]
283
395
  },
284
396
  used.name
285
397
  ))
286
- }
287
- ),
288
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
289
- /* @__PURE__ */ jsx(
290
- Button,
291
- {
292
- variant: "outline",
293
- size: "sm",
294
- nativeButton: false,
295
- render: /* @__PURE__ */ jsx(Link, { href: row.viewHref }),
296
- "data-test": `view-${row.name}`,
297
- children: "View"
298
- }
299
- ),
300
- /* @__PURE__ */ jsx(
301
- Button,
302
- {
303
- variant: "ghost",
304
- size: "sm",
305
- nativeButton: false,
306
- render: /* @__PURE__ */ jsx(Link, { href: row.connectHref }),
307
- children: "Connect checklist"
308
- }
309
- )
310
- ] })
311
- ]
398
+ ]
399
+ }
400
+ ) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "Uses no integrations." }),
401
+ /* @__PURE__ */ jsxs("p", { className: "flex flex-wrap gap-x-3 gap-y-1", children: [
402
+ /* @__PURE__ */ jsx(Link, { href: `${row.viewHref}/widgets`, className: QUIET_LINK, children: "Widgets" }),
403
+ /* @__PURE__ */ jsx(Link, { href: `${row.viewHref}/pages`, className: QUIET_LINK, children: "Pages" }),
404
+ /* @__PURE__ */ jsx(Link, { href: `${row.viewHref}/workflows`, className: QUIET_LINK, children: "Workflows" }),
405
+ /* @__PURE__ */ jsx(Link, { href: `${row.viewHref}/review-queue`, className: QUIET_LINK, children: "Review queue" })
406
+ ] })
407
+ ] }),
408
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 md:justify-end", children: [
409
+ ready ? null : /* @__PURE__ */ jsx(
410
+ Button,
411
+ {
412
+ variant: "outline",
413
+ size: "sm",
414
+ nativeButton: false,
415
+ render: /* @__PURE__ */ jsx(Link, { href: row.connectHref }),
416
+ "data-test": `checklist-${row.name}`,
417
+ children: "Connect checklist"
418
+ }
419
+ ),
420
+ /* @__PURE__ */ jsx(
421
+ Button,
422
+ {
423
+ variant: ready ? "outline" : "ghost",
424
+ size: "sm",
425
+ nativeButton: false,
426
+ render: /* @__PURE__ */ jsx(Link, { href: row.viewHref }),
427
+ "data-test": `view-${row.name}`,
428
+ children: "Open"
429
+ }
430
+ )
431
+ ] })
432
+ ]
433
+ }
434
+ );
435
+ }
436
+ function RepoHomeSkeleton() {
437
+ return /* @__PURE__ */ jsxs(
438
+ "div",
439
+ {
440
+ className: "flex flex-col gap-8",
441
+ role: "status",
442
+ "aria-label": "Loading the repo",
443
+ "data-test": "repo-home-skeleton",
444
+ children: [
445
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 rounded-lg border p-5", children: [
446
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-40" }),
447
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-1.5 w-full" }),
448
+ Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 pt-2", children: [
449
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-5 rounded-full" }),
450
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" }),
451
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-24" })
452
+ ] }, index))
453
+ ] }),
454
+ Array.from({ length: 2 }, (_, index) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
455
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-32" }),
456
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-24 w-full" })
457
+ ] }, index))
458
+ ]
459
+ }
460
+ );
461
+ }
462
+ function RepoHomePage() {
463
+ const repo = useRepo();
464
+ const queryClient = useQueryClient();
465
+ if (!repo.data) {
466
+ return repo.isError ? null : /* @__PURE__ */ jsx(RepoHomeSkeleton, {});
467
+ }
468
+ const { integrations, experiences } = repo.data;
469
+ const refresh = () => queryClient.invalidateQueries({ queryKey: repoKeys.repo });
470
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-10", "data-test": "repo-home", children: [
471
+ /* @__PURE__ */ jsx(SetupChecklist, { repo: repo.data }),
472
+ /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-test": "repo-integrations", children: [
473
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
474
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Integrations" }),
475
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Each opens its own console: connect it, run its operations, send test events, read its run log." })
476
+ ] }),
477
+ integrations.length === 0 ? /* @__PURE__ */ jsxs(EmptyNote, { icon: "plug", title: "No integrations in this repo yet", children: [
478
+ "Run ",
479
+ /* @__PURE__ */ jsx("code", { children: "ekanos new integration <name>" }),
480
+ " to add one."
481
+ ] }) : /* @__PURE__ */ jsx(Card, { layout: "bleed", render: /* @__PURE__ */ jsx("ul", {}), className: "divide-y", children: integrations.map((row) => /* @__PURE__ */ jsx(
482
+ IntegrationRow,
483
+ {
484
+ row,
485
+ root: repo.data.root,
486
+ onChanged: refresh
312
487
  },
313
488
  row.name
314
489
  )) })
490
+ ] }),
491
+ /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-test": "repo-experiences", children: [
492
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
493
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Experiences" }),
494
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Each previews its widgets, layout and workflows against the integrations it uses." })
495
+ ] }),
496
+ experiences.length === 0 ? /* @__PURE__ */ jsxs(
497
+ EmptyNote,
498
+ {
499
+ icon: "squares-four",
500
+ title: "No experiences in this repo yet",
501
+ children: [
502
+ "Run ",
503
+ /* @__PURE__ */ jsx("code", { children: "ekanos new experience <name>" }),
504
+ " to add one."
505
+ ]
506
+ }
507
+ ) : /* @__PURE__ */ jsx(Card, { layout: "bleed", render: /* @__PURE__ */ jsx("ul", {}), className: "divide-y", children: experiences.map((row) => /* @__PURE__ */ jsx(ExperienceRow, { row }, row.name)) })
315
508
  ] })
316
509
  ] });
317
510
  }