@ekanos/harness 0.17.0 → 0.19.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 (184) hide show
  1. package/dist/api-types.d.ts +490 -0
  2. package/dist/api-types.js +6 -0
  3. package/dist/api.d.ts +33 -0
  4. package/dist/api.js +36 -1
  5. package/dist/app.js +6 -1
  6. package/dist/internal/components/approvals-tray.d.ts +17 -0
  7. package/dist/internal/components/approvals-tray.js +116 -0
  8. package/dist/internal/components/connect-controls.d.ts +12 -0
  9. package/dist/internal/components/connect-controls.js +69 -0
  10. package/dist/internal/components/connect-dialog.d.ts +19 -0
  11. package/dist/internal/components/connect-dialog.js +61 -0
  12. package/dist/internal/components/connect-panel.d.ts +25 -0
  13. package/dist/internal/components/connect-panel.js +292 -0
  14. package/dist/internal/components/connection-chip.d.ts +14 -0
  15. package/dist/internal/components/connection-chip.js +75 -0
  16. package/dist/internal/components/dashboard-grid.js +38 -24
  17. package/dist/internal/components/dev-toolbar.js +176 -103
  18. package/dist/internal/components/events-panel.d.ts +10 -0
  19. package/dist/internal/components/events-panel.js +111 -0
  20. package/dist/internal/components/health-panel.d.ts +4 -0
  21. package/dist/internal/components/health-panel.js +56 -0
  22. package/dist/internal/components/integration-badge.d.ts +29 -0
  23. package/dist/internal/components/integration-badge.js +105 -0
  24. package/dist/internal/components/local-oauth-panel.js +21 -1
  25. package/dist/internal/components/operation-runner-panel.d.ts +12 -0
  26. package/dist/internal/components/operation-runner-panel.js +331 -0
  27. package/dist/internal/components/provenance-banner.d.ts +12 -0
  28. package/dist/internal/components/provenance-banner.js +107 -0
  29. package/dist/internal/components/repo-connection.d.ts +10 -0
  30. package/dist/internal/components/repo-connection.js +32 -0
  31. package/dist/internal/components/run-log.d.ts +9 -0
  32. package/dist/internal/components/run-log.js +228 -0
  33. package/dist/internal/components/runtime-strip.d.ts +12 -0
  34. package/dist/internal/components/runtime-strip.js +158 -0
  35. package/dist/internal/components/schema-form.d.ts +13 -0
  36. package/dist/internal/components/schema-form.js +382 -0
  37. package/dist/internal/components/scrollable-nav.d.ts +12 -0
  38. package/dist/internal/components/scrollable-nav.js +68 -0
  39. package/dist/internal/components/surface-nav.d.ts +31 -1
  40. package/dist/internal/components/surface-nav.js +238 -31
  41. package/dist/internal/components/workflow-runner.d.ts +14 -0
  42. package/dist/internal/components/workflow-runner.js +104 -0
  43. package/dist/internal/lib/bundled-secrets.d.ts +9 -0
  44. package/dist/internal/lib/bundled-secrets.js +24 -0
  45. package/dist/internal/lib/chrome-slot.d.ts +2 -0
  46. package/dist/internal/lib/chrome-slot.js +25 -0
  47. package/dist/internal/lib/connection-facts.d.ts +44 -0
  48. package/dist/internal/lib/connection-facts.js +116 -0
  49. package/dist/internal/lib/console-client.d.ts +55 -0
  50. package/dist/internal/lib/console-client.js +295 -0
  51. package/dist/internal/lib/console-context.d.ts +40 -0
  52. package/dist/internal/lib/console-context.js +67 -0
  53. package/dist/internal/lib/console-hooks.d.ts +33 -0
  54. package/dist/internal/lib/console-hooks.js +118 -0
  55. package/dist/internal/lib/console-types.d.ts +279 -0
  56. package/dist/internal/lib/console-types.js +0 -0
  57. package/dist/internal/lib/experience-runtime.d.ts +8 -0
  58. package/dist/internal/lib/experience-runtime.js +22 -0
  59. package/dist/internal/lib/preview-sections.d.ts +13 -0
  60. package/dist/internal/lib/preview-sections.js +32 -0
  61. package/dist/internal/lib/repo-context.d.ts +20 -0
  62. package/dist/internal/lib/repo-context.js +64 -0
  63. package/dist/internal/lib/run-log-view.d.ts +24 -0
  64. package/dist/internal/lib/run-log-view.js +57 -0
  65. package/dist/internal/lib/schema-form-model.d.ts +34 -0
  66. package/dist/internal/lib/schema-form-model.js +272 -0
  67. package/dist/internal/lib/toolbar-context.d.ts +9 -1
  68. package/dist/internal/lib/toolbar-context.js +13 -3
  69. package/dist/internal/lib/toolbar-visibility.d.ts +16 -0
  70. package/dist/internal/lib/toolbar-visibility.js +31 -0
  71. package/dist/internal/registry-context.d.ts +2 -0
  72. package/dist/internal/registry-context.js +11 -9
  73. package/dist/internal/routes/activation-page.js +44 -20
  74. package/dist/internal/routes/console-home-page.d.ts +5 -0
  75. package/dist/internal/routes/console-home-page.js +18 -0
  76. package/dist/internal/routes/experience-connect-page.d.ts +6 -0
  77. package/dist/internal/routes/experience-connect-page.js +127 -0
  78. package/dist/internal/routes/experience-page-host.d.ts +2 -0
  79. package/dist/internal/routes/experience-page-host.js +18 -0
  80. package/dist/internal/routes/experience-review-queue-page.d.ts +2 -0
  81. package/dist/internal/routes/experience-review-queue-page.js +60 -0
  82. package/dist/internal/routes/experience-runs-page.d.ts +1 -0
  83. package/dist/internal/routes/experience-runs-page.js +13 -0
  84. package/dist/internal/routes/experience-summary-page.d.ts +1 -0
  85. package/dist/internal/routes/experience-summary-page.js +101 -0
  86. package/dist/internal/routes/experience-widget-page.d.ts +1 -0
  87. package/dist/internal/routes/experience-widget-page.js +26 -0
  88. package/dist/internal/routes/experience-widgets-page.d.ts +6 -0
  89. package/dist/internal/routes/experience-widgets-page.js +22 -0
  90. package/dist/internal/routes/experience-workflow-page.d.ts +1 -0
  91. package/dist/internal/routes/experience-workflow-page.js +24 -0
  92. package/dist/internal/routes/experience-workflows-page.d.ts +1 -0
  93. package/dist/internal/routes/experience-workflows-page.js +44 -0
  94. package/dist/internal/routes/index-page.d.ts +10 -9
  95. package/dist/internal/routes/index-page.js +3 -68
  96. package/dist/internal/routes/integration-layout.d.ts +12 -1
  97. package/dist/internal/routes/integration-layout.js +20 -6
  98. package/dist/internal/routes/integrations-connect-page.d.ts +1 -0
  99. package/dist/internal/routes/integrations-connect-page.js +19 -0
  100. package/dist/internal/routes/integrations-events-page.d.ts +1 -0
  101. package/dist/internal/routes/integrations-events-page.js +10 -0
  102. package/dist/internal/routes/integrations-health-page.d.ts +1 -0
  103. package/dist/internal/routes/integrations-health-page.js +10 -0
  104. package/dist/internal/routes/integrations-layout.d.ts +17 -0
  105. package/dist/internal/routes/integrations-layout.js +106 -0
  106. package/dist/internal/routes/integrations-list-page.d.ts +2 -0
  107. package/dist/internal/routes/integrations-list-page.js +94 -0
  108. package/dist/internal/routes/integrations-operation-page.d.ts +1 -0
  109. package/dist/internal/routes/integrations-operation-page.js +29 -0
  110. package/dist/internal/routes/integrations-operations-page.d.ts +1 -0
  111. package/dist/internal/routes/integrations-operations-page.js +61 -0
  112. package/dist/internal/routes/integrations-overview-page.d.ts +1 -0
  113. package/dist/internal/routes/integrations-overview-page.js +90 -0
  114. package/dist/internal/routes/integrations-runs-page.d.ts +1 -0
  115. package/dist/internal/routes/integrations-runs-page.js +14 -0
  116. package/dist/internal/routes/integrations-scope.d.ts +12 -0
  117. package/dist/internal/routes/integrations-scope.js +39 -0
  118. package/dist/internal/routes/legacy-preview-redirect.d.ts +6 -0
  119. package/dist/internal/routes/legacy-preview-redirect.js +12 -0
  120. package/dist/internal/routes/preview-index-page.d.ts +2 -0
  121. package/dist/internal/routes/preview-index-page.js +14 -0
  122. package/dist/internal/routes/repo-connections-page.d.ts +6 -0
  123. package/dist/internal/routes/repo-connections-page.js +8 -0
  124. package/dist/internal/routes/repo-home-page.d.ts +2 -0
  125. package/dist/internal/routes/repo-home-page.js +320 -0
  126. package/dist/internal/routes/repo-layout.d.ts +7 -0
  127. package/dist/internal/routes/repo-layout.js +76 -0
  128. package/dist/internal/routes/repo-package-layouts.d.ts +20 -0
  129. package/dist/internal/routes/repo-package-layouts.js +104 -0
  130. package/dist/internal/routes/root-layout.d.ts +3 -1
  131. package/dist/internal/routes/root-layout.js +13 -3
  132. package/dist/internal/routes/single-widget-page.js +5 -12
  133. package/dist/internal/routes/tile-page.js +20 -41
  134. package/dist/internal/routes/triggers-page.js +55 -62
  135. package/dist/internal/routes/widgets-page.js +1 -1
  136. package/dist/internal/server/api-router.js +46 -4
  137. package/dist/internal/server/approvals.d.ts +44 -0
  138. package/dist/internal/server/approvals.js +76 -0
  139. package/dist/internal/server/contract-sources.d.ts +28 -0
  140. package/dist/internal/server/contract-sources.js +83 -0
  141. package/dist/internal/server/definition-loader.d.ts +22 -0
  142. package/dist/internal/server/definition-loader.js +125 -0
  143. package/dist/internal/server/ekanos-api-router.d.ts +34 -0
  144. package/dist/internal/server/ekanos-api-router.js +835 -0
  145. package/dist/internal/server/experience-loader.d.ts +57 -0
  146. package/dist/internal/server/experience-loader.js +146 -0
  147. package/dist/internal/server/integration-lookup.d.ts +29 -0
  148. package/dist/internal/server/integration-lookup.js +33 -0
  149. package/dist/internal/server/integration-resolver.d.ts +121 -0
  150. package/dist/internal/server/integration-resolver.js +605 -0
  151. package/dist/internal/server/live-invoker.d.ts +11 -0
  152. package/dist/internal/server/live-invoker.js +106 -0
  153. package/dist/internal/server/local-secrets.d.ts +82 -1
  154. package/dist/internal/server/local-secrets.js +112 -1
  155. package/dist/internal/server/local-state.d.ts +12 -0
  156. package/dist/internal/server/local-state.js +45 -0
  157. package/dist/internal/server/oauth-persistence.d.ts +19 -0
  158. package/dist/internal/server/oauth-persistence.js +76 -0
  159. package/dist/internal/server/operation-runner.d.ts +95 -0
  160. package/dist/internal/server/operation-runner.js +231 -0
  161. package/dist/internal/server/project-manifest.d.ts +71 -0
  162. package/dist/internal/server/project-manifest.js +215 -0
  163. package/dist/internal/server/registry-cache.d.ts +68 -0
  164. package/dist/internal/server/registry-cache.js +328 -0
  165. package/dist/internal/server/repo-api-router.d.ts +33 -0
  166. package/dist/internal/server/repo-api-router.js +391 -0
  167. package/dist/internal/server/run-log.d.ts +22 -0
  168. package/dist/internal/server/run-log.js +32 -0
  169. package/dist/internal/server/semantics.d.ts +28 -0
  170. package/dist/internal/server/semantics.js +67 -0
  171. package/dist/internal/server/session-catalog.d.ts +67 -0
  172. package/dist/internal/server/session-catalog.js +18 -0
  173. package/dist/internal/server/workflow-runner.d.ts +36 -0
  174. package/dist/internal/server/workflow-runner.js +183 -0
  175. package/dist/registry.d.ts +7 -0
  176. package/dist/resolver.d.ts +145 -0
  177. package/dist/resolver.js +211 -0
  178. package/dist/routes.d.ts +64 -2
  179. package/dist/routes.js +59 -3
  180. package/dist/runtime.d.ts +46 -0
  181. package/dist/runtime.js +60 -0
  182. package/package.json +30 -16
  183. package/dist/internal/routes/integration-index-page.d.ts +0 -13
  184. package/dist/internal/routes/integration-index-page.js +0 -17
@@ -0,0 +1,320 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { Button } from "@ekanos/ui/button";
5
+ import { Card } from "@ekanos/ui/card";
6
+ import { StatusBadge } from "@ekanos/ui/status-badge";
7
+ import { useQueryClient } from "@tanstack/react-query";
8
+ import { ConnectControls } from "../components/connect-controls.js";
9
+ import {
10
+ CONNECTION_TYPE,
11
+ ConnectionStatusChip,
12
+ levelList
13
+ } from "../components/repo-connection.js";
14
+ import { isReady, relativePath } from "../lib/connection-facts.js";
15
+ import { repoKeys, useRepo, useRepoHealth } from "../lib/repo-context.js";
16
+ const HEALTH_TONE = {
17
+ healthy: "success",
18
+ degraded: "warning",
19
+ unhealthy: "destructive",
20
+ unknown: "neutral"
21
+ };
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: "heading-headline", children: value }),
29
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-fine", children: label })
30
+ ] });
31
+ }
32
+ function HealthCell({ name, live }) {
33
+ const health = useRepoHealth();
34
+ const result = health.data;
35
+ if (result) {
36
+ return /* @__PURE__ */ jsx(
37
+ StatusBadge,
38
+ {
39
+ tone: HEALTH_TONE[result.status],
40
+ "data-test": `health-${name}`,
41
+ title: result.message,
42
+ children: result.status
43
+ }
44
+ );
45
+ }
46
+ if (!live) {
47
+ return /* @__PURE__ */ jsx(
48
+ "span",
49
+ {
50
+ className: "text-muted-foreground text-fine",
51
+ "data-test": `health-${name}`,
52
+ children: "Not checked locally"
53
+ }
54
+ );
55
+ }
56
+ return /* @__PURE__ */ jsx(
57
+ Button,
58
+ {
59
+ variant: "ghost",
60
+ size: "sm",
61
+ disabled: health.isPending,
62
+ onClick: () => health.mutate(name),
63
+ "data-test": `check-health-${name}`,
64
+ children: health.isPending ? "Checking\u2026" : health.isError ? "Retry check" : "Check health"
65
+ }
66
+ );
67
+ }
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-meta", 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,
109
+ {
110
+ label: "No connection needed",
111
+ value: counts.noConnectionNeeded,
112
+ testId: "count-no-connection-needed"
113
+ }
114
+ ),
115
+ /* @__PURE__ */ jsx(
116
+ Count,
117
+ {
118
+ label: "Need connecting",
119
+ value: counts.notConnected,
120
+ testId: "count-not-connected"
121
+ }
122
+ )
123
+ ]
124
+ }
125
+ ),
126
+ /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-4", "data-test": "repo-integrations", children: [
127
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Integrations" }),
128
+ integrations.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", 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,
135
+ {
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-label hover:underline",
147
+ children: row.name
148
+ }
149
+ ),
150
+ /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-fine", children: [
151
+ "v",
152
+ row.version
153
+ ] }),
154
+ row.contractVersion ? /* @__PURE__ */ jsxs(
155
+ "code",
156
+ {
157
+ className: "text-muted-foreground text-fine",
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-fine", children: CONNECTION_TYPE[row.connection.type] }) : null
167
+ ] }),
168
+ row.connection ? /* @__PURE__ */ jsxs("dl", { className: "text-fine grid grid-cols-1 gap-x-6 gap-y-1 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",
190
+ {
191
+ className: "text-muted-foreground text-fine",
192
+ "data-test": `detail-${row.name}`,
193
+ children: row.connection.detail
194
+ }
195
+ ) : null,
196
+ row.error ? /* @__PURE__ */ jsx(
197
+ "p",
198
+ {
199
+ className: "text-destructive text-fine",
200
+ "data-test": `error-${row.name}`,
201
+ children: row.error
202
+ }
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
+ ),
212
+ /* @__PURE__ */ jsx(
213
+ ConnectControls,
214
+ {
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"
231
+ }
232
+ )
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: "heading-subhead-lg font-normal", children: "Experiences" }),
241
+ experiences.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", 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: [
255
+ /* @__PURE__ */ jsx(
256
+ Link,
257
+ {
258
+ href: row.viewHref,
259
+ className: "text-label hover:underline",
260
+ children: row.name
261
+ }
262
+ ),
263
+ /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-fine", children: [
264
+ "v",
265
+ row.version
266
+ ] })
267
+ ] }),
268
+ row.error ? /* @__PURE__ */ jsx("p", { className: "text-destructive text-fine", children: row.error }) : null,
269
+ /* @__PURE__ */ jsx(
270
+ "ul",
271
+ {
272
+ className: "flex flex-wrap gap-2",
273
+ "aria-label": "Integrations it uses",
274
+ children: row.integrations.map((used) => /* @__PURE__ */ jsxs(
275
+ "li",
276
+ {
277
+ className: "flex items-center gap-2",
278
+ "data-test": `uses-${row.name}-${used.name}`,
279
+ children: [
280
+ /* @__PURE__ */ jsx("code", { className: "text-fine", children: used.name }),
281
+ /* @__PURE__ */ jsx(ConnectionStatusChip, { connection: used.connection })
282
+ ]
283
+ },
284
+ used.name
285
+ ))
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
+ ]
312
+ },
313
+ row.name
314
+ )) })
315
+ ] })
316
+ ] });
317
+ }
318
+ export {
319
+ RepoHomePage
320
+ };
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type RepoClient } from '../lib/console-client.js';
3
+ /** The layout of the repo home: `ekanos dev` at a repo root. */
4
+ export declare function RepoLayout({ children, client, }: {
5
+ children: ReactNode;
6
+ client?: RepoClient;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { usePathname } from "next/navigation";
5
+ 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";
9
+ import { RepoProviders, useRepo } from "../lib/repo-context.js";
10
+ const TABS = [
11
+ { href: "/", label: "This repo", icon: "fa-solid fa-table-list" }
12
+ ];
13
+ function repoName(root) {
14
+ return root.split(/[\\/]/).filter(Boolean).pop() ?? root;
15
+ }
16
+ function RepoFrame({ children }) {
17
+ const repo = useRepo();
18
+ const pathname = usePathname();
19
+ return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen flex-col", "data-test": "repo-frame", children: [
20
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 border-b px-4 py-4 sm:px-6", children: [
21
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-3", children: [
22
+ /* @__PURE__ */ jsx("h1", { className: "heading-headline", children: repo.data ? repoName(repo.data.root) : "This repo" }),
23
+ /* @__PURE__ */ jsx("code", { className: "text-muted-foreground text-fine", children: "repo" })
24
+ ] }),
25
+ /* @__PURE__ */ jsx(ScrollableNav, { label: "Repo", children: TABS.map((tab) => {
26
+ const active = tab.href === "/" ? pathname === "/" : pathname.startsWith(tab.href);
27
+ return /* @__PURE__ */ jsxs(
28
+ Link,
29
+ {
30
+ href: tab.href,
31
+ "aria-current": active ? "page" : void 0,
32
+ className: cn(
33
+ "flex items-center gap-2 rounded-md px-3 py-2 whitespace-nowrap transition-colors",
34
+ FOCUS_RING,
35
+ active ? "bg-accent text-accent-foreground text-label" : "text-muted-foreground hover:bg-accent/50 text-meta"
36
+ ),
37
+ children: [
38
+ /* @__PURE__ */ jsx(Icon, { name: tab.icon, className: "h-4 w-4" }),
39
+ tab.label
40
+ ]
41
+ },
42
+ tab.href
43
+ );
44
+ }) })
45
+ ] }),
46
+ /* @__PURE__ */ jsxs(
47
+ "main",
48
+ {
49
+ id: "main-content",
50
+ tabIndex: -1,
51
+ className: "mx-auto flex w-full max-w-5xl min-w-0 flex-col gap-6 px-4 py-8 outline-none sm:px-6",
52
+ children: [
53
+ repo.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", "data-test": "repo-error", children: /* @__PURE__ */ jsxs(AlertDescription, { children: [
54
+ "Could not reach the harness server: ",
55
+ repo.error.message
56
+ ] }) }) : null,
57
+ 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: [
58
+ /* @__PURE__ */ jsx("code", { children: problem.where }),
59
+ ": ",
60
+ problem.message
61
+ ] }, problem.where)) }) }) }) : null,
62
+ children
63
+ ]
64
+ }
65
+ )
66
+ ] });
67
+ }
68
+ function RepoLayout({
69
+ children,
70
+ client
71
+ }) {
72
+ return /* @__PURE__ */ jsx(RepoProviders, { ...client ? { client } : {}, children: /* @__PURE__ */ jsx(RepoFrame, { children }) });
73
+ }
74
+ export {
75
+ RepoLayout
76
+ };
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ConsoleClient } from '../lib/console-client.js';
3
+ import type { ExperienceSurfaces } from '../lib/console-context.js';
4
+ /**
5
+ * `/experiences/<name>/…`: the existing Experience view, served by that
6
+ * package's own router. `entries` is the generated map from package name to
7
+ * the experience entry's widgets and pages (React components, so it is
8
+ * imported statically by the shell).
9
+ */
10
+ export declare function RepoExperienceLayout({ children, entries, client, }: {
11
+ children: ReactNode;
12
+ entries: Record<string, ExperienceSurfaces>;
13
+ client?: ConsoleClient;
14
+ }): import("react").JSX.Element;
15
+ /** `/integrations/<name>/…`: the existing Integration console for one package. */
16
+ export declare function RepoIntegrationLayout({ children, slug, client, }: {
17
+ children: ReactNode;
18
+ slug?: string;
19
+ client?: ConsoleClient;
20
+ }): import("react").JSX.Element;
@@ -0,0 +1,104 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useMemo } from "react";
4
+ import { notFound, useParams } from "next/navigation";
5
+ import { createHttpConsoleClient, packageApiBase } from "../lib/console-client.js";
6
+ import { RepoProviders, useRepo } from "../lib/repo-context.js";
7
+ import { ConsoleLayout } from "./integrations-layout.js";
8
+ const REPO_HOME = "/";
9
+ function RepoExperienceLayout({
10
+ children,
11
+ entries,
12
+ client
13
+ }) {
14
+ const { name } = useParams();
15
+ const surfaces = entries[name];
16
+ const base = packageApiBase("experience", name);
17
+ const resolved = useMemo(
18
+ () => client ?? createHttpConsoleClient(void 0, base),
19
+ [client, base]
20
+ );
21
+ const links = useMemo(
22
+ () => ({ experience: `/experiences/${name}`, repoHome: REPO_HOME }),
23
+ [name]
24
+ );
25
+ if (!surfaces) notFound();
26
+ return /* @__PURE__ */ jsx(
27
+ ConsoleLayout,
28
+ {
29
+ client: resolved,
30
+ experience: surfaces,
31
+ links,
32
+ apiBase: base,
33
+ children
34
+ }
35
+ );
36
+ }
37
+ function IntegrationScopeLayout({
38
+ children,
39
+ slug,
40
+ client
41
+ }) {
42
+ const repo = useRepo();
43
+ if (repo.isError) {
44
+ return /* @__PURE__ */ jsxs("p", { className: "text-destructive text-meta px-6 py-10", children: [
45
+ "Could not reach the harness server: ",
46
+ repo.error.message
47
+ ] });
48
+ }
49
+ if (!repo.data) {
50
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta px-6 py-10", children: "Loading\u2026" });
51
+ }
52
+ const own = repo.data.integrations.some((row) => row.name === slug);
53
+ const host = own ? null : repo.data.experiences.find(
54
+ (experience) => experience.integrations.some((used) => used.name === slug)
55
+ );
56
+ if (!own && !host) notFound();
57
+ return /* @__PURE__ */ jsx(
58
+ ScopedConsole,
59
+ {
60
+ base: packageApiBase(
61
+ own ? "integration" : "experience",
62
+ own ? slug : host?.name ?? slug
63
+ ),
64
+ experienceBase: host ? `/experiences/${host.name}` : "/experience",
65
+ ...client ? { client } : {},
66
+ children
67
+ }
68
+ );
69
+ }
70
+ function ScopedConsole({
71
+ base,
72
+ experienceBase,
73
+ client,
74
+ children
75
+ }) {
76
+ const resolved = useMemo(
77
+ () => client ?? createHttpConsoleClient(void 0, base),
78
+ [client, base]
79
+ );
80
+ const links = useMemo(
81
+ () => ({ experience: experienceBase, repoHome: REPO_HOME }),
82
+ [experienceBase]
83
+ );
84
+ return /* @__PURE__ */ jsx(ConsoleLayout, { client: resolved, links, apiBase: base, children });
85
+ }
86
+ function RepoIntegrationLayout({
87
+ children,
88
+ slug,
89
+ client
90
+ }) {
91
+ const params = useParams();
92
+ return /* @__PURE__ */ jsx(RepoProviders, { children: /* @__PURE__ */ jsx(
93
+ IntegrationScopeLayout,
94
+ {
95
+ slug: slug ?? params.slug,
96
+ ...client ? { client } : {},
97
+ children
98
+ }
99
+ ) });
100
+ }
101
+ export {
102
+ RepoExperienceLayout,
103
+ RepoIntegrationLayout
104
+ };
@@ -28,7 +28,9 @@ import type { HarnessIntegration } from '../../registry.js';
28
28
  * `integrations` is the partner's registry, handed down from the shell's
29
29
  * `app/layout.tsx`. Nothing in this package imports it.
30
30
  */
31
- export declare function RootLayout({ integrations, children, }: {
31
+ export declare function RootLayout({ integrations, repo, children, }: {
32
32
  integrations: HarnessIntegration[];
33
+ /** Set by a repo-root shell: the toolbar drops the global Data switch. */
34
+ repo?: boolean;
33
35
  children: React.ReactNode;
34
36
  }): import("react").JSX.Element;
@@ -11,6 +11,7 @@ import { ToolbarProvider } from "../lib/toolbar-context.js";
11
11
  import { HarnessRegistryProvider } from "../registry-context.js";
12
12
  function RootLayout({
13
13
  integrations,
14
+ repo = false,
14
15
  children
15
16
  }) {
16
17
  return /* @__PURE__ */ jsx("html", { lang: "en", className: fontVariables, suppressHydrationWarning: true, children: /* @__PURE__ */ jsx(
@@ -21,11 +22,20 @@ function RootLayout({
21
22
  ThemeProvider,
22
23
  {
23
24
  attribute: "class",
24
- defaultTheme: "light",
25
- enableSystem: false,
25
+ defaultTheme: "system",
26
+ enableSystem: true,
26
27
  enableColorScheme: false,
27
28
  disableTransitionOnChange: true,
28
- children: /* @__PURE__ */ jsxs(ToolbarProvider, { children: [
29
+ children: /* @__PURE__ */ jsxs(ToolbarProvider, { repo, children: [
30
+ /* @__PURE__ */ jsx(
31
+ "a",
32
+ {
33
+ href: "#main-content",
34
+ className: "bg-background text-foreground text-label focus-visible:ring-ring sr-only z-50 rounded-md px-4 py-2 focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus-visible:ring-3",
35
+ "data-test": "skip-to-content",
36
+ children: "Skip to content"
37
+ }
38
+ ),
29
39
  /* @__PURE__ */ jsx(DevToolbar, {}),
30
40
  children
31
41
  ] })
@@ -10,20 +10,13 @@ function SingleWidgetPage() {
10
10
  if (!integration) notFound();
11
11
  const widget = findWidget(integration, widgetId);
12
12
  if (!widget) notFound();
13
- return /* @__PURE__ */ jsx(
14
- "main",
13
+ return /* @__PURE__ */ jsx("div", { className: "min-w-0", "data-test": "single-widget", children: /* @__PURE__ */ jsx(
14
+ WidgetSurface,
15
15
  {
16
- className: "mx-auto w-full max-w-4xl px-6 py-8",
17
- "data-test": "single-widget",
18
- children: /* @__PURE__ */ jsx(
19
- WidgetSurface,
20
- {
21
- widgets: [{ ...widget, width: "full" }],
22
- productSlug: integration.slug
23
- }
24
- )
16
+ widgets: [{ ...widget, width: "full" }],
17
+ productSlug: integration.slug
25
18
  }
26
- );
19
+ ) });
27
20
  }
28
21
  export {
29
22
  SingleWidgetPage