@ekanos/harness 0.18.0 → 0.20.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 (187) 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/ask-assistant-bridge.js +1 -1
  9. package/dist/internal/components/connect-controls.d.ts +12 -0
  10. package/dist/internal/components/connect-controls.js +69 -0
  11. package/dist/internal/components/connect-dialog.d.ts +19 -0
  12. package/dist/internal/components/connect-dialog.js +61 -0
  13. package/dist/internal/components/connect-panel.d.ts +25 -0
  14. package/dist/internal/components/connect-panel.js +292 -0
  15. package/dist/internal/components/connection-chip.d.ts +14 -0
  16. package/dist/internal/components/connection-chip.js +75 -0
  17. package/dist/internal/components/dashboard-grid.js +38 -24
  18. package/dist/internal/components/dev-toolbar.js +176 -103
  19. package/dist/internal/components/events-panel.d.ts +10 -0
  20. package/dist/internal/components/events-panel.js +111 -0
  21. package/dist/internal/components/health-panel.d.ts +4 -0
  22. package/dist/internal/components/health-panel.js +56 -0
  23. package/dist/internal/components/integration-badge.d.ts +29 -0
  24. package/dist/internal/components/integration-badge.js +105 -0
  25. package/dist/internal/components/local-oauth-panel.js +21 -1
  26. package/dist/internal/components/operation-runner-panel.d.ts +12 -0
  27. package/dist/internal/components/operation-runner-panel.js +331 -0
  28. package/dist/internal/components/provenance-banner.d.ts +12 -0
  29. package/dist/internal/components/provenance-banner.js +107 -0
  30. package/dist/internal/components/repo-connection.d.ts +10 -0
  31. package/dist/internal/components/repo-connection.js +32 -0
  32. package/dist/internal/components/run-log.d.ts +9 -0
  33. package/dist/internal/components/run-log.js +228 -0
  34. package/dist/internal/components/runtime-strip.d.ts +12 -0
  35. package/dist/internal/components/runtime-strip.js +158 -0
  36. package/dist/internal/components/schema-form.d.ts +13 -0
  37. package/dist/internal/components/schema-form.js +382 -0
  38. package/dist/internal/components/scrollable-nav.d.ts +12 -0
  39. package/dist/internal/components/scrollable-nav.js +68 -0
  40. package/dist/internal/components/surface-nav.d.ts +31 -1
  41. package/dist/internal/components/surface-nav.js +244 -31
  42. package/dist/internal/components/workflow-runner.d.ts +14 -0
  43. package/dist/internal/components/workflow-runner.js +104 -0
  44. package/dist/internal/lib/bundled-secrets.d.ts +9 -0
  45. package/dist/internal/lib/bundled-secrets.js +24 -0
  46. package/dist/internal/lib/chrome-slot.d.ts +2 -0
  47. package/dist/internal/lib/chrome-slot.js +25 -0
  48. package/dist/internal/lib/connection-facts.d.ts +44 -0
  49. package/dist/internal/lib/connection-facts.js +116 -0
  50. package/dist/internal/lib/console-client.d.ts +55 -0
  51. package/dist/internal/lib/console-client.js +295 -0
  52. package/dist/internal/lib/console-context.d.ts +56 -0
  53. package/dist/internal/lib/console-context.js +67 -0
  54. package/dist/internal/lib/console-hooks.d.ts +33 -0
  55. package/dist/internal/lib/console-hooks.js +118 -0
  56. package/dist/internal/lib/console-types.d.ts +279 -0
  57. package/dist/internal/lib/console-types.js +0 -0
  58. package/dist/internal/lib/experience-runtime.d.ts +8 -0
  59. package/dist/internal/lib/experience-runtime.js +22 -0
  60. package/dist/internal/lib/preview-sections.d.ts +13 -0
  61. package/dist/internal/lib/preview-sections.js +32 -0
  62. package/dist/internal/lib/repo-context.d.ts +20 -0
  63. package/dist/internal/lib/repo-context.js +64 -0
  64. package/dist/internal/lib/run-log-view.d.ts +24 -0
  65. package/dist/internal/lib/run-log-view.js +57 -0
  66. package/dist/internal/lib/schema-form-model.d.ts +34 -0
  67. package/dist/internal/lib/schema-form-model.js +272 -0
  68. package/dist/internal/lib/toolbar-context.d.ts +9 -1
  69. package/dist/internal/lib/toolbar-context.js +13 -3
  70. package/dist/internal/lib/toolbar-visibility.d.ts +16 -0
  71. package/dist/internal/lib/toolbar-visibility.js +31 -0
  72. package/dist/internal/registry-context.d.ts +2 -0
  73. package/dist/internal/registry-context.js +11 -9
  74. package/dist/internal/routes/activation-page.js +44 -20
  75. package/dist/internal/routes/console-home-page.d.ts +5 -0
  76. package/dist/internal/routes/console-home-page.js +18 -0
  77. package/dist/internal/routes/experience-connect-page.d.ts +6 -0
  78. package/dist/internal/routes/experience-connect-page.js +127 -0
  79. package/dist/internal/routes/experience-layout-page.d.ts +8 -0
  80. package/dist/internal/routes/experience-layout-page.js +126 -0
  81. package/dist/internal/routes/experience-page-host.d.ts +7 -0
  82. package/dist/internal/routes/experience-page-host.js +79 -0
  83. package/dist/internal/routes/experience-review-queue-page.d.ts +2 -0
  84. package/dist/internal/routes/experience-review-queue-page.js +60 -0
  85. package/dist/internal/routes/experience-runs-page.d.ts +1 -0
  86. package/dist/internal/routes/experience-runs-page.js +13 -0
  87. package/dist/internal/routes/experience-summary-page.d.ts +1 -0
  88. package/dist/internal/routes/experience-summary-page.js +101 -0
  89. package/dist/internal/routes/experience-widget-page.d.ts +1 -0
  90. package/dist/internal/routes/experience-widget-page.js +26 -0
  91. package/dist/internal/routes/experience-widgets-page.d.ts +6 -0
  92. package/dist/internal/routes/experience-widgets-page.js +22 -0
  93. package/dist/internal/routes/experience-workflow-page.d.ts +1 -0
  94. package/dist/internal/routes/experience-workflow-page.js +24 -0
  95. package/dist/internal/routes/experience-workflows-page.d.ts +1 -0
  96. package/dist/internal/routes/experience-workflows-page.js +44 -0
  97. package/dist/internal/routes/index-page.d.ts +10 -9
  98. package/dist/internal/routes/index-page.js +3 -68
  99. package/dist/internal/routes/integration-layout.d.ts +12 -1
  100. package/dist/internal/routes/integration-layout.js +20 -6
  101. package/dist/internal/routes/integrations-connect-page.d.ts +1 -0
  102. package/dist/internal/routes/integrations-connect-page.js +19 -0
  103. package/dist/internal/routes/integrations-events-page.d.ts +1 -0
  104. package/dist/internal/routes/integrations-events-page.js +10 -0
  105. package/dist/internal/routes/integrations-health-page.d.ts +1 -0
  106. package/dist/internal/routes/integrations-health-page.js +10 -0
  107. package/dist/internal/routes/integrations-layout.d.ts +17 -0
  108. package/dist/internal/routes/integrations-layout.js +106 -0
  109. package/dist/internal/routes/integrations-list-page.d.ts +2 -0
  110. package/dist/internal/routes/integrations-list-page.js +94 -0
  111. package/dist/internal/routes/integrations-operation-page.d.ts +1 -0
  112. package/dist/internal/routes/integrations-operation-page.js +29 -0
  113. package/dist/internal/routes/integrations-operations-page.d.ts +1 -0
  114. package/dist/internal/routes/integrations-operations-page.js +61 -0
  115. package/dist/internal/routes/integrations-overview-page.d.ts +1 -0
  116. package/dist/internal/routes/integrations-overview-page.js +90 -0
  117. package/dist/internal/routes/integrations-runs-page.d.ts +1 -0
  118. package/dist/internal/routes/integrations-runs-page.js +14 -0
  119. package/dist/internal/routes/integrations-scope.d.ts +12 -0
  120. package/dist/internal/routes/integrations-scope.js +39 -0
  121. package/dist/internal/routes/legacy-preview-redirect.d.ts +6 -0
  122. package/dist/internal/routes/legacy-preview-redirect.js +12 -0
  123. package/dist/internal/routes/preview-index-page.d.ts +2 -0
  124. package/dist/internal/routes/preview-index-page.js +14 -0
  125. package/dist/internal/routes/repo-connections-page.d.ts +6 -0
  126. package/dist/internal/routes/repo-connections-page.js +8 -0
  127. package/dist/internal/routes/repo-home-page.d.ts +2 -0
  128. package/dist/internal/routes/repo-home-page.js +320 -0
  129. package/dist/internal/routes/repo-layout.d.ts +7 -0
  130. package/dist/internal/routes/repo-layout.js +76 -0
  131. package/dist/internal/routes/repo-package-layouts.d.ts +20 -0
  132. package/dist/internal/routes/repo-package-layouts.js +104 -0
  133. package/dist/internal/routes/root-layout.d.ts +3 -1
  134. package/dist/internal/routes/root-layout.js +13 -3
  135. package/dist/internal/routes/single-widget-page.js +5 -12
  136. package/dist/internal/routes/tile-page.js +20 -41
  137. package/dist/internal/routes/triggers-page.js +55 -62
  138. package/dist/internal/routes/widgets-page.js +1 -1
  139. package/dist/internal/server/api-router.js +46 -4
  140. package/dist/internal/server/approvals.d.ts +44 -0
  141. package/dist/internal/server/approvals.js +76 -0
  142. package/dist/internal/server/contract-sources.d.ts +28 -0
  143. package/dist/internal/server/contract-sources.js +83 -0
  144. package/dist/internal/server/definition-loader.d.ts +22 -0
  145. package/dist/internal/server/definition-loader.js +125 -0
  146. package/dist/internal/server/ekanos-api-router.d.ts +34 -0
  147. package/dist/internal/server/ekanos-api-router.js +835 -0
  148. package/dist/internal/server/experience-loader.d.ts +57 -0
  149. package/dist/internal/server/experience-loader.js +146 -0
  150. package/dist/internal/server/integration-lookup.d.ts +29 -0
  151. package/dist/internal/server/integration-lookup.js +33 -0
  152. package/dist/internal/server/integration-resolver.d.ts +121 -0
  153. package/dist/internal/server/integration-resolver.js +605 -0
  154. package/dist/internal/server/live-invoker.d.ts +11 -0
  155. package/dist/internal/server/live-invoker.js +106 -0
  156. package/dist/internal/server/local-secrets.d.ts +82 -1
  157. package/dist/internal/server/local-secrets.js +112 -1
  158. package/dist/internal/server/local-state.d.ts +12 -0
  159. package/dist/internal/server/local-state.js +45 -0
  160. package/dist/internal/server/oauth-persistence.d.ts +19 -0
  161. package/dist/internal/server/oauth-persistence.js +76 -0
  162. package/dist/internal/server/operation-runner.d.ts +95 -0
  163. package/dist/internal/server/operation-runner.js +231 -0
  164. package/dist/internal/server/project-manifest.d.ts +71 -0
  165. package/dist/internal/server/project-manifest.js +215 -0
  166. package/dist/internal/server/registry-cache.d.ts +68 -0
  167. package/dist/internal/server/registry-cache.js +328 -0
  168. package/dist/internal/server/repo-api-router.d.ts +33 -0
  169. package/dist/internal/server/repo-api-router.js +391 -0
  170. package/dist/internal/server/run-log.d.ts +22 -0
  171. package/dist/internal/server/run-log.js +32 -0
  172. package/dist/internal/server/semantics.d.ts +28 -0
  173. package/dist/internal/server/semantics.js +67 -0
  174. package/dist/internal/server/session-catalog.d.ts +67 -0
  175. package/dist/internal/server/session-catalog.js +18 -0
  176. package/dist/internal/server/workflow-runner.d.ts +36 -0
  177. package/dist/internal/server/workflow-runner.js +183 -0
  178. package/dist/registry.d.ts +7 -0
  179. package/dist/resolver.d.ts +145 -0
  180. package/dist/resolver.js +211 -0
  181. package/dist/routes.d.ts +66 -2
  182. package/dist/routes.js +61 -3
  183. package/dist/runtime.d.ts +46 -0
  184. package/dist/runtime.js +60 -0
  185. package/package.json +23 -9
  186. package/dist/internal/routes/integration-index-page.d.ts +0 -13
  187. package/dist/internal/routes/integration-index-page.js +0 -17
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { use } from "react";
4
+ import Link from "next/link";
5
+ import { useParams } from "next/navigation";
6
+ import { Card } from "@ekanos/ui/card";
7
+ import {
8
+ QueryClientContext,
9
+ useQueryClient
10
+ } from "@tanstack/react-query";
11
+ import { ConnectControls } from "../components/connect-controls.js";
12
+ import {
13
+ CONNECTION_TYPE,
14
+ ConnectionStatusChip,
15
+ levelList
16
+ } from "../components/repo-connection.js";
17
+ import { isReady } from "../lib/connection-facts.js";
18
+ import { refreshRuntime } from "../lib/console-hooks.js";
19
+ import { RepoProviders, repoKeys, useRepo } from "../lib/repo-context.js";
20
+ function Checklist({
21
+ name,
22
+ consoleQueryClient
23
+ }) {
24
+ const repo = useRepo();
25
+ const queryClient = useQueryClient();
26
+ const refresh = () => Promise.all([
27
+ queryClient.invalidateQueries({ queryKey: repoKeys.repo }),
28
+ consoleQueryClient ? refreshRuntime(consoleQueryClient) : void 0
29
+ ]);
30
+ if (!repo.data) {
31
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "Loading\u2026" });
32
+ }
33
+ const experience = repo.data.experiences.find((entry) => entry.name === name);
34
+ if (!experience) {
35
+ return /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", children: [
36
+ "No experience named ",
37
+ name,
38
+ " in this repo."
39
+ ] });
40
+ }
41
+ const done = (facts) => isReady(facts ?? null);
42
+ const ready = experience.integrations.filter(
43
+ (used) => done(used.connection?.facts)
44
+ ).length;
45
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "connect-checklist", children: [
46
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
47
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Connect" }),
48
+ /* @__PURE__ */ jsxs(
49
+ "p",
50
+ {
51
+ className: "text-muted-foreground text-fine",
52
+ "data-test": "checklist-progress",
53
+ children: [
54
+ ready,
55
+ " of ",
56
+ experience.integrations.length,
57
+ " integrations ready."
58
+ ]
59
+ }
60
+ )
61
+ ] }),
62
+ /* @__PURE__ */ jsx("ol", { className: "flex flex-col gap-3", children: experience.integrations.map((used, index) => /* @__PURE__ */ jsxs(
63
+ Card,
64
+ {
65
+ layout: "bleed",
66
+ render: /* @__PURE__ */ jsx("li", {}),
67
+ className: "flex flex-col gap-3 p-5",
68
+ "data-test": `step-${used.name}`,
69
+ "data-done": done(used.connection?.facts),
70
+ children: [
71
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-2", children: [
72
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-fine", children: [
73
+ index + 1,
74
+ "."
75
+ ] }),
76
+ /* @__PURE__ */ jsx(
77
+ Link,
78
+ {
79
+ href: `/integrations/${used.name}`,
80
+ className: "text-label hover:underline",
81
+ children: used.name
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(ConnectionStatusChip, { connection: used.connection }),
85
+ used.connection && used.connection.facts.kind !== "none" && used.connection.facts.state !== "connected" ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-fine", children: CONNECTION_TYPE[used.connection.type] }) : null,
86
+ !used.sameRepo ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-fine", children: "from the registry" }) : null
87
+ ] }),
88
+ /* @__PURE__ */ jsxs("p", { className: "text-fine", "data-test": `step-levels-${used.name}`, children: [
89
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Connected by " }),
90
+ levelList(used.levels),
91
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: " after publishing" })
92
+ ] }),
93
+ used.levelProblem ? /* @__PURE__ */ jsx("p", { className: "text-warning-foreground bg-warning text-fine rounded-md px-3 py-2", children: used.levelProblem }) : null,
94
+ used.connection?.detail ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-fine", children: used.connection.detail }) : null,
95
+ used.sameRepo ? /* @__PURE__ */ jsx(
96
+ ConnectControls,
97
+ {
98
+ name: used.name,
99
+ connection: used.connection,
100
+ returnPath: `/experiences/${experience.name}/connect`,
101
+ onChanged: refresh
102
+ }
103
+ ) : null
104
+ ]
105
+ },
106
+ used.name
107
+ )) }),
108
+ experience.integrations.length > 0 ? null : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "This experience uses no integrations." })
109
+ ] });
110
+ }
111
+ function ExperienceConnectPage({
112
+ client,
113
+ name
114
+ }) {
115
+ const params = useParams();
116
+ const consoleQueryClient = use(QueryClientContext);
117
+ return /* @__PURE__ */ jsx(RepoProviders, { ...client ? { client } : {}, children: /* @__PURE__ */ jsx(
118
+ Checklist,
119
+ {
120
+ name: name ?? params.name,
121
+ ...consoleQueryClient ? { consoleQueryClient } : {}
122
+ }
123
+ ) });
124
+ }
125
+ export {
126
+ ExperienceConnectPage
127
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * How the experience's `suggestedLayout` would arrange for each audience: a nav
3
+ * of workspaces, each a canvas of widgets and a list of pages. The "viewing as"
4
+ * switcher is built from the audience names the layout itself carries, plus
5
+ * Everyone. A Source maps a name to its own audience of the same name when the
6
+ * layout is applied; this view shows what each name would get.
7
+ */
8
+ export declare function ExperienceLayoutPage(): import("react").JSX.Element;
@@ -0,0 +1,126 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import Link from "next/link";
5
+ import {
6
+ layoutAudienceNames,
7
+ resolveLayoutForAudience
8
+ } from "@ekanos/sdk/experience";
9
+ import { Button } from "@ekanos/ui/button";
10
+ import { Card } from "@ekanos/ui/card";
11
+ import { StatusBadge } from "@ekanos/ui/status-badge";
12
+ import { WidgetSurface } from "../components/widget-surface.js";
13
+ import { useConsoleLinks, useExperienceSurfaces } from "../lib/console-context.js";
14
+ import { useProject } from "../lib/console-hooks.js";
15
+ const EVERYONE = "";
16
+ function ExperienceLayoutPage() {
17
+ const project = useProject();
18
+ const links = useConsoleLinks();
19
+ const { widgets, pages, suggestedLayout } = useExperienceSurfaces();
20
+ const [view, setView] = useState({ audience: EVERYONE, workspace: "" });
21
+ if (!suggestedLayout) {
22
+ return /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", "data-test": "layout-empty", children: [
23
+ "This experience suggests no layout. Add ",
24
+ /* @__PURE__ */ jsx("code", { children: "suggestedLayout" }),
25
+ " to",
26
+ " ",
27
+ /* @__PURE__ */ jsx("code", { children: "defineExperience" }),
28
+ " to show how its widgets and pages would arrange into workspaces."
29
+ ] });
30
+ }
31
+ const audiences = layoutAudienceNames(suggestedLayout);
32
+ const resolved = resolveLayoutForAudience(
33
+ suggestedLayout,
34
+ view.audience === EVERYONE ? null : view.audience
35
+ );
36
+ const active = resolved.workspaces.find(
37
+ (workspace) => workspace.slug === view.workspace
38
+ ) ?? resolved.workspaces[0];
39
+ const productSlug = project.data?.name ?? "experience";
40
+ const shown = (refs) => refs.flatMap((ref) => {
41
+ const id = ref.slice(ref.indexOf(":") + 1);
42
+ const widget = widgets.find((w) => w.id === id);
43
+ return widget ? [widget] : [];
44
+ });
45
+ const itemRefs = active?.items.map((item) => item.ref) ?? [];
46
+ const widgetItems = shown(
47
+ itemRefs.filter((ref) => ref.startsWith("widget:"))
48
+ );
49
+ const pageItems = itemRefs.filter((ref) => ref.startsWith("page:")).map((ref) => ref.slice("page:".length)).flatMap((id) => {
50
+ const page = pages.find((p) => p.id === id);
51
+ return page ? [page] : [];
52
+ });
53
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-layout", children: [
54
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
55
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Suggested layout" }),
56
+ /* @__PURE__ */ jsxs("label", { className: "text-meta ml-auto flex items-center gap-2", children: [
57
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Viewing as" }),
58
+ /* @__PURE__ */ jsxs(
59
+ "select",
60
+ {
61
+ value: view.audience,
62
+ onChange: (event) => setView({ audience: event.target.value, workspace: "" }),
63
+ className: "border-input bg-background text-meta rounded-md border px-3 py-2",
64
+ "data-test": "layout-audience",
65
+ children: [
66
+ /* @__PURE__ */ jsx("option", { value: EVERYONE, children: "Everyone" }),
67
+ audiences.map((name) => /* @__PURE__ */ jsx("option", { value: name, children: name }, name))
68
+ ]
69
+ }
70
+ )
71
+ ] })
72
+ ] }),
73
+ resolved.workspaces.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", "data-test": "layout-none", children: [
74
+ "Nothing in this layout is for",
75
+ " ",
76
+ view.audience === EVERYONE ? "everyone" : view.audience,
77
+ "."
78
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
79
+ /* @__PURE__ */ jsx(
80
+ "nav",
81
+ {
82
+ "aria-label": "Workspaces",
83
+ className: "flex flex-wrap gap-1",
84
+ "data-test": "layout-workspaces",
85
+ children: resolved.workspaces.map((workspace) => /* @__PURE__ */ jsx(
86
+ Button,
87
+ {
88
+ variant: workspace.slug === active?.slug ? "secondary" : "ghost",
89
+ size: "sm",
90
+ "aria-current": workspace.slug === active?.slug ? "page" : void 0,
91
+ onClick: () => setView((prev) => ({ ...prev, workspace: workspace.slug })),
92
+ "data-test": `layout-workspace-${workspace.slug}`,
93
+ children: workspace.name
94
+ },
95
+ workspace.slug
96
+ ))
97
+ }
98
+ ),
99
+ widgetItems.length > 0 ? /* @__PURE__ */ jsx(WidgetSurface, { widgets: widgetItems, productSlug }) : null,
100
+ pageItems.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2", "data-test": "layout-pages", children: pageItems.map((page) => /* @__PURE__ */ jsxs(
101
+ Card,
102
+ {
103
+ layout: "bleed",
104
+ render: /* @__PURE__ */ jsx("li", {}),
105
+ className: "flex items-center gap-3 p-4",
106
+ "data-test": `layout-page-${page.id}`,
107
+ children: [
108
+ /* @__PURE__ */ jsx(
109
+ Link,
110
+ {
111
+ href: `${links.experience}/pages/${page.id}`,
112
+ className: "text-label hover:underline",
113
+ children: page.title
114
+ }
115
+ ),
116
+ /* @__PURE__ */ jsx(StatusBadge, { tone: "neutral", children: page.kind ?? "custom" })
117
+ ]
118
+ },
119
+ page.id
120
+ )) }) : null
121
+ ] })
122
+ ] });
123
+ }
124
+ export {
125
+ ExperienceLayoutPage
126
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A page host: the experience page in a sidebar-less frame. A canvas shows its
3
+ * own widgets in the dashboard grid; a custom page mounts its component with
4
+ * the route below its path (`path` prop); an overview without a component gets
5
+ * the host's default, every widget of the experience.
6
+ */
7
+ export declare function ExperiencePageHost(): import("react").JSX.Element;
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { notFound, useParams } from "next/navigation";
5
+ import { cn } from "@ekanos/ui/utils";
6
+ import { WidgetSurface } from "../components/widget-surface.js";
7
+ import { useConsoleLinks, useExperienceSurfaces } from "../lib/console-context.js";
8
+ import { useProject } from "../lib/console-hooks.js";
9
+ function ExperiencePageHost() {
10
+ const { id, path: rawPath } = useParams();
11
+ const { pages, widgets } = useExperienceSurfaces();
12
+ const links = useConsoleLinks();
13
+ const project = useProject();
14
+ const page = pages.find((entry) => entry.id === id);
15
+ if (!page) notFound();
16
+ const kind = page.kind ?? "custom";
17
+ const path = rawPath ?? [];
18
+ const sub = path.join("/");
19
+ const productSlug = project.data?.name ?? "experience";
20
+ if (sub !== "" && !page.routes?.some((route) => route.path === sub)) {
21
+ notFound();
22
+ }
23
+ const base = `${links.experience}/pages/${page.id}`;
24
+ const Page = page.component;
25
+ return /* @__PURE__ */ jsxs(
26
+ "div",
27
+ {
28
+ className: "flex flex-col gap-4",
29
+ "data-test": "experience-page",
30
+ "data-page-kind": kind,
31
+ children: [
32
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: page.title }),
33
+ page.routes && page.routes.length > 0 ? /* @__PURE__ */ jsx(
34
+ "nav",
35
+ {
36
+ "aria-label": `${page.title} sections`,
37
+ className: "flex flex-wrap gap-1",
38
+ "data-test": "experience-page-routes",
39
+ children: [{ path: "", title: page.title }, ...page.routes].map((route) => /* @__PURE__ */ jsx(
40
+ Link,
41
+ {
42
+ href: route.path === "" ? base : `${base}/${route.path}`,
43
+ "aria-current": route.path === sub ? "page" : void 0,
44
+ className: cn(
45
+ "text-meta rounded-md px-3 py-2",
46
+ route.path === sub ? "bg-accent text-accent-foreground text-label" : "text-muted-foreground hover:bg-accent/50"
47
+ ),
48
+ children: route.title
49
+ },
50
+ route.path
51
+ ))
52
+ }
53
+ ) : null,
54
+ kind === "canvas" ? /* @__PURE__ */ jsx(
55
+ WidgetSurface,
56
+ {
57
+ widgets: widgets.filter(
58
+ (widget) => page.widgets?.includes(widget.id)
59
+ ),
60
+ productSlug
61
+ }
62
+ ) : Page ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border p-5", children: /* @__PURE__ */ jsx(Page, { path }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
63
+ /* @__PURE__ */ jsx(
64
+ "p",
65
+ {
66
+ className: "text-muted-foreground text-meta",
67
+ "data-test": "default-overview",
68
+ children: "No overview component: the host shows all of this experience's widgets."
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx(WidgetSurface, { widgets, productSlug })
72
+ ] })
73
+ ]
74
+ }
75
+ );
76
+ }
77
+ export {
78
+ ExperiencePageHost
79
+ };
@@ -0,0 +1,2 @@
1
+ /** The declared review-queue sections, each rendered through the runner. */
2
+ export declare function ExperienceReviewQueuePage(): import("react").JSX.Element;
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Alert, AlertDescription } from "@ekanos/ui/alert";
4
+ import { Card } from "@ekanos/ui/card";
5
+ import { StatusBadge } from "@ekanos/ui/status-badge";
6
+ import { useQuery } from "@tanstack/react-query";
7
+ import { useConsoleClient } from "../lib/console-context.js";
8
+ import { useExperience } from "../lib/console-hooks.js";
9
+ function Section({ section }) {
10
+ const client = useConsoleClient();
11
+ const result = useQuery({
12
+ queryKey: ["console", "review-section", section.id],
13
+ queryFn: () => client.runOperation({
14
+ integration: section.integration,
15
+ opKey: section.opKey,
16
+ args: section.args,
17
+ mode: "fixtures",
18
+ channel: "rsc",
19
+ origin: "review-queue"
20
+ })
21
+ });
22
+ return /* @__PURE__ */ jsxs(
23
+ Card,
24
+ {
25
+ layout: "bleed",
26
+ render: /* @__PURE__ */ jsx("li", {}),
27
+ className: "flex flex-col gap-3 p-5",
28
+ "data-test": "review-section",
29
+ children: [
30
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
31
+ /* @__PURE__ */ jsx("h3", { className: "text-label", children: section.title }),
32
+ /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-fine", children: [
33
+ section.integration,
34
+ ":",
35
+ section.opKey
36
+ ] })
37
+ ] }),
38
+ result.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx(AlertDescription, { children: result.error.message }) }) : result.data?.status === "ok" ? /* @__PURE__ */ jsx("pre", { className: "bg-muted text-fine max-h-72 overflow-auto rounded-md p-3", children: JSON.stringify(result.data.output, null, 2) }) : result.data?.status === "refused" ? /* @__PURE__ */ jsxs(StatusBadge, { tone: "destructive", children: [
39
+ result.data.reason,
40
+ ": ",
41
+ result.data.message
42
+ ] }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-fine", children: "Loading\u2026" })
43
+ ]
44
+ }
45
+ );
46
+ }
47
+ function ExperienceReviewQueuePage() {
48
+ const experience = useExperience();
49
+ const sections = experience.data?.reviewQueue ?? [];
50
+ if (experience.isPending) {
51
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "Loading\u2026" });
52
+ }
53
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-review-queue", children: [
54
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Review queue" }),
55
+ sections.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "This experience declares no review-queue sections." }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: sections.map((section) => /* @__PURE__ */ jsx(Section, { section }, section.id)) })
56
+ ] });
57
+ }
58
+ export {
59
+ ExperienceReviewQueuePage
60
+ };
@@ -0,0 +1 @@
1
+ export declare function ExperienceRunsPage(): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { RunLog } from "../components/run-log.js";
4
+ function ExperienceRunsPage() {
5
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-runs", children: [
6
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Run log" }),
7
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-fine", children: "Every operation call from any surface, with its provenance." }),
8
+ /* @__PURE__ */ jsx(RunLog, {})
9
+ ] });
10
+ }
11
+ export {
12
+ ExperienceRunsPage
13
+ };
@@ -0,0 +1 @@
1
+ export declare function ExperienceSummaryPage(): import("react").JSX.Element;
@@ -0,0 +1,101 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { StatusBadge } from "@ekanos/ui/status-badge";
5
+ import {
6
+ Table,
7
+ TableBody,
8
+ TableCell,
9
+ TableHead,
10
+ TableHeader,
11
+ TableRow
12
+ } from "@ekanos/ui/table";
13
+ import {
14
+ ProvenanceBadge,
15
+ RunModeBadge,
16
+ describeProvenance,
17
+ provenanceDisplayPath,
18
+ provenanceTitle
19
+ } from "../components/integration-badge.js";
20
+ import { localIntegrations } from "../components/provenance-banner.js";
21
+ import { useProject } from "../lib/console-hooks.js";
22
+ const CHECK_TONES = {
23
+ ok: "success",
24
+ failed: "destructive",
25
+ unknown: "neutral"
26
+ };
27
+ function ExperienceSummaryPage() {
28
+ const project = useProject();
29
+ if (!project.data) {
30
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "Loading\u2026" });
31
+ }
32
+ const { integrations, checks } = project.data;
33
+ const overrides = localIntegrations(integrations).length;
34
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", "data-test": "experience-summary", children: [
35
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
36
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Integrations" }),
37
+ /* @__PURE__ */ jsx(StatusBadge, { tone: overrides > 0 ? "warning" : "success", children: overrides > 0 ? `${overrides} local override${overrides === 1 ? "" : "s"}` : "no overrides" }),
38
+ checks ? /* @__PURE__ */ jsxs(Fragment, { children: [
39
+ /* @__PURE__ */ jsxs(StatusBadge, { tone: CHECK_TONES[checks.pins], children: [
40
+ "integration pins: ",
41
+ checks.pins
42
+ ] }),
43
+ /* @__PURE__ */ jsxs(StatusBadge, { tone: CHECK_TONES[checks.boundary], children: [
44
+ "boundary: ",
45
+ checks.boundary
46
+ ] })
47
+ ] }) : null
48
+ ] }),
49
+ /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs(Table, { children: [
50
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
51
+ /* @__PURE__ */ jsx(TableHead, { children: "Integration" }),
52
+ /* @__PURE__ */ jsx(TableHead, { children: "Provenance" }),
53
+ /* @__PURE__ */ jsx(TableHead, { children: "Run modes" }),
54
+ /* @__PURE__ */ jsx(TableHead, { children: "Binding" })
55
+ ] }) }),
56
+ /* @__PURE__ */ jsx(TableBody, { children: integrations.map((integration) => /* @__PURE__ */ jsxs(
57
+ TableRow,
58
+ {
59
+ "data-test": "integration-row",
60
+ children: [
61
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs(
62
+ Link,
63
+ {
64
+ href: `/integrations/${integration.integration}`,
65
+ className: "hover:underline",
66
+ children: [
67
+ integration.integration,
68
+ "@",
69
+ integration.version
70
+ ]
71
+ }
72
+ ) }),
73
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
74
+ /* @__PURE__ */ jsx(
75
+ ProvenanceBadge,
76
+ {
77
+ provenance: integration.provenance,
78
+ own: integration.own === true
79
+ }
80
+ ),
81
+ /* @__PURE__ */ jsx(
82
+ "span",
83
+ {
84
+ className: "text-muted-foreground text-fine",
85
+ title: provenanceTitle(integration.provenance),
86
+ children: provenanceDisplayPath(integration.provenance) || describeProvenance(integration.provenance)
87
+ }
88
+ )
89
+ ] }) }),
90
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("div", { className: "flex gap-1", children: integration.runModes.map((mode) => /* @__PURE__ */ jsx(RunModeBadge, { mode }, mode)) }) }),
91
+ /* @__PURE__ */ jsx(TableCell, { className: "text-fine", children: integration.bindingMode ?? "default" })
92
+ ]
93
+ },
94
+ integration.integration
95
+ )) })
96
+ ] }) })
97
+ ] });
98
+ }
99
+ export {
100
+ ExperienceSummaryPage
101
+ };
@@ -0,0 +1 @@
1
+ export declare function ExperienceWidgetPage(): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { notFound, useParams } from "next/navigation";
4
+ import { WidgetSurface } from "../components/widget-surface.js";
5
+ import { useExperienceSurfaces } from "../lib/console-context.js";
6
+ import { useProject } from "../lib/console-hooks.js";
7
+ function ExperienceWidgetPage() {
8
+ const { id } = useParams();
9
+ const project = useProject();
10
+ const { widgets } = useExperienceSurfaces();
11
+ const widget = widgets.find((entry) => entry.id === id);
12
+ if (!widget) notFound();
13
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-widget", children: [
14
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: widget.title }),
15
+ /* @__PURE__ */ jsx(
16
+ WidgetSurface,
17
+ {
18
+ widgets: [{ ...widget, width: "full" }],
19
+ productSlug: project.data?.name ?? "experience"
20
+ }
21
+ )
22
+ ] });
23
+ }
24
+ export {
25
+ ExperienceWidgetPage
26
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The experience's widgets in the dashboard grid. The variant switch
3
+ * (default / empty / error) is the dev toolbar's, which drives the scenario
4
+ * fixtures the runtime answers from.
5
+ */
6
+ export declare function ExperienceWidgetsPage(): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { WidgetSurface } from "../components/widget-surface.js";
4
+ import { useExperienceSurfaces } from "../lib/console-context.js";
5
+ import { useProject } from "../lib/console-hooks.js";
6
+ function ExperienceWidgetsPage() {
7
+ const project = useProject();
8
+ const { widgets } = useExperienceSurfaces();
9
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-widgets", children: [
10
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Widgets" }),
11
+ widgets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "This experience registers no widgets." }) : /* @__PURE__ */ jsx(
12
+ WidgetSurface,
13
+ {
14
+ widgets,
15
+ productSlug: project.data?.name ?? "experience"
16
+ }
17
+ )
18
+ ] });
19
+ }
20
+ export {
21
+ ExperienceWidgetsPage
22
+ };
@@ -0,0 +1 @@
1
+ export declare function ExperienceWorkflowPage(): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { notFound, useParams } from "next/navigation";
4
+ import { WorkflowRunner } from "../components/workflow-runner.js";
5
+ import { useExperience } from "../lib/console-hooks.js";
6
+ function ExperienceWorkflowPage() {
7
+ const { id } = useParams();
8
+ const experience = useExperience();
9
+ if (experience.isPending) {
10
+ return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: "Loading\u2026" });
11
+ }
12
+ const template = (experience.data?.workflows ?? []).find(
13
+ (entry) => entry.id === id
14
+ );
15
+ if (!template) notFound();
16
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
17
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: template.title }),
18
+ template.description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-meta", children: template.description }) : null,
19
+ /* @__PURE__ */ jsx(WorkflowRunner, { template }, template.id)
20
+ ] });
21
+ }
22
+ export {
23
+ ExperienceWorkflowPage
24
+ };
@@ -0,0 +1 @@
1
+ export declare function ExperienceWorkflowsPage(): import("react").JSX.Element;