@ekanos/harness 0.26.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +6 -4
  2. package/dist/api-types.d.ts +4 -0
  3. package/dist/internal/components/approvals-tray.d.ts +44 -6
  4. package/dist/internal/components/approvals-tray.js +252 -30
  5. package/dist/internal/components/connect-controls.js +4 -2
  6. package/dist/internal/components/connect-dialog.d.ts +8 -1
  7. package/dist/internal/components/connect-dialog.js +23 -10
  8. package/dist/internal/components/connect-panel.d.ts +3 -2
  9. package/dist/internal/components/connect-panel.js +680 -340
  10. package/dist/internal/components/connect-steps.d.ts +72 -0
  11. package/dist/internal/components/connect-steps.js +341 -0
  12. package/dist/internal/components/console-not-found.d.ts +14 -0
  13. package/dist/internal/components/console-not-found.js +57 -0
  14. package/dist/internal/components/dashboard-grid.d.ts +10 -5
  15. package/dist/internal/components/dashboard-grid.js +8 -9
  16. package/dist/internal/components/dev-toolbar.d.ts +27 -5
  17. package/dist/internal/components/dev-toolbar.js +214 -176
  18. package/dist/internal/components/ekanos-logo.d.ts +18 -0
  19. package/dist/internal/components/ekanos-logo.js +74 -0
  20. package/dist/internal/components/events-panel.d.ts +13 -4
  21. package/dist/internal/components/events-panel.js +478 -81
  22. package/dist/internal/components/harness-widget-provider.d.ts +6 -8
  23. package/dist/internal/components/harness-widget-provider.js +5 -19
  24. package/dist/internal/components/health-panel.d.ts +8 -1
  25. package/dist/internal/components/health-panel.js +328 -31
  26. package/dist/internal/components/integration-badge.js +4 -2
  27. package/dist/internal/components/integration-tab-skeletons.d.ts +8 -0
  28. package/dist/internal/components/integration-tab-skeletons.js +76 -0
  29. package/dist/internal/components/not-found-state.d.ts +39 -0
  30. package/dist/internal/components/not-found-state.js +127 -0
  31. package/dist/internal/components/operation-runner-panel.d.ts +1 -1
  32. package/dist/internal/components/operation-runner-panel.js +624 -189
  33. package/dist/internal/components/operation-scope.d.ts +13 -0
  34. package/dist/internal/components/operation-scope.js +79 -0
  35. package/dist/internal/components/page-skeletons.d.ts +11 -0
  36. package/dist/internal/components/page-skeletons.js +61 -0
  37. package/dist/internal/components/provenance-banner.d.ts +13 -4
  38. package/dist/internal/components/provenance-banner.js +35 -10
  39. package/dist/internal/components/run-log-copy.d.ts +17 -0
  40. package/dist/internal/components/run-log-copy.js +67 -0
  41. package/dist/internal/components/run-log-detail.d.ts +22 -0
  42. package/dist/internal/components/run-log-detail.js +295 -0
  43. package/dist/internal/components/run-log-empty.d.ts +13 -0
  44. package/dist/internal/components/run-log-empty.js +46 -0
  45. package/dist/internal/components/run-log.d.ts +23 -3
  46. package/dist/internal/components/run-log.js +384 -130
  47. package/dist/internal/components/runtime-strip.d.ts +5 -1
  48. package/dist/internal/components/runtime-strip.js +115 -10
  49. package/dist/internal/components/schema-form.d.ts +2 -1
  50. package/dist/internal/components/schema-form.js +212 -79
  51. package/dist/internal/components/scrollable-nav.js +14 -2
  52. package/dist/internal/components/segmented-control.d.ts +19 -0
  53. package/dist/internal/components/segmented-control.js +46 -0
  54. package/dist/internal/components/shell-header.d.ts +25 -0
  55. package/dist/internal/components/shell-header.js +126 -0
  56. package/dist/internal/components/surface-nav.d.ts +12 -3
  57. package/dist/internal/components/surface-nav.js +72 -83
  58. package/dist/internal/components/widget-surface.d.ts +5 -1
  59. package/dist/internal/components/widget-surface.js +86 -14
  60. package/dist/internal/components/workflow-runner.d.ts +23 -10
  61. package/dist/internal/components/workflow-runner.js +451 -69
  62. package/dist/internal/lib/connect-model.d.ts +134 -0
  63. package/dist/internal/lib/connect-model.js +282 -0
  64. package/dist/internal/lib/connection-facts.js +2 -1
  65. package/dist/internal/lib/console-client.js +5 -2
  66. package/dist/internal/lib/console-hooks.d.ts +4 -1
  67. package/dist/internal/lib/console-hooks.js +3 -2
  68. package/dist/internal/lib/console-types.d.ts +6 -0
  69. package/dist/internal/lib/docs-links.d.ts +28 -0
  70. package/dist/internal/lib/docs-links.js +57 -1
  71. package/dist/internal/lib/event-delivery.d.ts +33 -0
  72. package/dist/internal/lib/event-delivery.js +66 -0
  73. package/dist/internal/lib/experience-runtime.d.ts +2 -1
  74. package/dist/internal/lib/experience-runtime.js +5 -3
  75. package/dist/internal/lib/font-files/OFL-BricolageGrotesque.txt +93 -0
  76. package/dist/internal/lib/font-files/OFL-Figtree.txt +93 -0
  77. package/dist/internal/lib/font-files/bricolage-grotesque-latin-variable.woff2 +0 -0
  78. package/dist/internal/lib/font-files/figtree-latin-variable.woff2 +0 -0
  79. package/dist/internal/lib/fonts.js +13 -12
  80. package/dist/internal/lib/health-model.d.ts +58 -0
  81. package/dist/internal/lib/health-model.js +140 -0
  82. package/dist/internal/lib/integration-console-href.d.ts +15 -0
  83. package/dist/internal/lib/integration-console-href.js +16 -0
  84. package/dist/internal/lib/oauth-setup-guide.d.ts +28 -0
  85. package/dist/internal/lib/oauth-setup-guide.js +35 -1
  86. package/dist/internal/lib/operation-catalog.d.ts +70 -0
  87. package/dist/internal/lib/operation-catalog.js +261 -0
  88. package/dist/internal/lib/overview-model.d.ts +34 -0
  89. package/dist/internal/lib/overview-model.js +91 -0
  90. package/dist/internal/lib/registry-entry.d.ts +8 -0
  91. package/dist/internal/lib/registry-entry.js +11 -0
  92. package/dist/internal/lib/repo-name.d.ts +9 -0
  93. package/dist/internal/lib/repo-name.js +21 -0
  94. package/dist/internal/lib/run-log-view.d.ts +66 -1
  95. package/dist/internal/lib/run-log-view.js +183 -4
  96. package/dist/internal/lib/runner-view.d.ts +15 -0
  97. package/dist/internal/lib/runner-view.js +18 -0
  98. package/dist/internal/lib/schema-form-model.d.ts +17 -0
  99. package/dist/internal/lib/schema-form-model.js +50 -0
  100. package/dist/internal/lib/setup-checklist.d.ts +34 -0
  101. package/dist/internal/lib/setup-checklist.js +79 -0
  102. package/dist/internal/lib/toolbar-context.d.ts +0 -1
  103. package/dist/internal/lib/toolbar-context.js +0 -2
  104. package/dist/internal/lib/toolbar-visibility.d.ts +9 -2
  105. package/dist/internal/lib/toolbar-visibility.js +5 -0
  106. package/dist/internal/lib/use-operation-effects.d.ts +7 -0
  107. package/dist/internal/lib/use-operation-effects.js +28 -0
  108. package/dist/internal/lib/use-run-log-query.d.ts +9 -0
  109. package/dist/internal/lib/use-run-log-query.js +35 -0
  110. package/dist/internal/lib/widget-grid-gaps.d.ts +18 -0
  111. package/dist/internal/lib/widget-grid-gaps.js +41 -0
  112. package/dist/internal/lib/workflow-summary.d.ts +54 -0
  113. package/dist/internal/lib/workflow-summary.js +147 -0
  114. package/dist/internal/routes/console-home-page.js +2 -1
  115. package/dist/internal/routes/experience-connect-page.js +51 -22
  116. package/dist/internal/routes/experience-layout-page.js +75 -26
  117. package/dist/internal/routes/experience-page-host.js +63 -5
  118. package/dist/internal/routes/experience-review-queue-page.d.ts +4 -1
  119. package/dist/internal/routes/experience-review-queue-page.js +108 -12
  120. package/dist/internal/routes/experience-runs-page.js +57 -4
  121. package/dist/internal/routes/experience-summary-page.d.ts +19 -0
  122. package/dist/internal/routes/experience-summary-page.js +219 -62
  123. package/dist/internal/routes/experience-widget-page.js +58 -7
  124. package/dist/internal/routes/experience-widgets-page.d.ts +2 -3
  125. package/dist/internal/routes/experience-widgets-page.js +29 -4
  126. package/dist/internal/routes/experience-workflow-page.js +81 -9
  127. package/dist/internal/routes/experience-workflows-page.js +85 -21
  128. package/dist/internal/routes/integration-layout.js +28 -3
  129. package/dist/internal/routes/integrations-connect-page.js +16 -6
  130. package/dist/internal/routes/integrations-events-page.js +22 -1
  131. package/dist/internal/routes/integrations-health-page.js +16 -1
  132. package/dist/internal/routes/integrations-layout.js +28 -4
  133. package/dist/internal/routes/integrations-list-page.d.ts +0 -1
  134. package/dist/internal/routes/integrations-list-page.js +11 -9
  135. package/dist/internal/routes/integrations-operation-page.js +53 -17
  136. package/dist/internal/routes/integrations-operations-page.js +539 -49
  137. package/dist/internal/routes/integrations-overview-page.js +332 -69
  138. package/dist/internal/routes/integrations-runs-page.js +53 -3
  139. package/dist/internal/routes/integrations-scope.d.ts +15 -2
  140. package/dist/internal/routes/integrations-scope.js +66 -18
  141. package/dist/internal/routes/preview-index-page.js +2 -2
  142. package/dist/internal/routes/repo-home-page.d.ts +2 -2
  143. package/dist/internal/routes/repo-home-page.js +428 -236
  144. package/dist/internal/routes/repo-layout.d.ts +12 -0
  145. package/dist/internal/routes/repo-layout.js +50 -38
  146. package/dist/internal/routes/repo-package-layouts.js +22 -8
  147. package/dist/internal/routes/single-widget-page.d.ts +1 -1
  148. package/dist/internal/routes/single-widget-page.js +28 -5
  149. package/dist/internal/routes/tile-page.d.ts +1 -1
  150. package/dist/internal/routes/tile-page.js +1 -2
  151. package/dist/internal/routes/widgets-page.d.ts +1 -1
  152. package/dist/internal/routes/widgets-page.js +5 -3
  153. package/dist/internal/server/ekanos-api-router.js +20 -5
  154. package/dist/internal/server/repo-api-router.js +20 -7
  155. package/dist/registry.d.ts +4 -5
  156. package/dist/registry.js +0 -1
  157. package/dist/routes.d.ts +5 -0
  158. package/dist/routes.js +2 -0
  159. package/package.json +8 -8
@@ -1,18 +1,43 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { EmptyNote } from "@ekanos/ui/empty-note";
4
+ import { DocsLink } from "../components/docs-link.js";
3
5
  import { WidgetSurface } from "../components/widget-surface.js";
4
- import { useExperienceSurfaces } from "../lib/console-context.js";
6
+ import { useConsoleLinks, useExperienceSurfaces } from "../lib/console-context.js";
5
7
  import { useProject } from "../lib/console-hooks.js";
8
+ import { DOCS } from "../lib/docs-links.js";
6
9
  function ExperienceWidgetsPage() {
7
10
  const project = useProject();
11
+ const links = useConsoleLinks();
8
12
  const { widgets } = useExperienceSurfaces();
9
13
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-widgets", children: [
10
- /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Widgets" }),
11
- widgets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This experience registers no widgets." }) : /* @__PURE__ */ jsx(
14
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
15
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Widgets" }),
16
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Every widget this experience registers, in the dashboard grid the product uses, answering from fixtures until its integration is connected. Open one on its own from its caption." })
17
+ ] }),
18
+ widgets.length === 0 ? /* @__PURE__ */ jsxs(
19
+ EmptyNote,
20
+ {
21
+ icon: "grid-four",
22
+ title: "No widgets",
23
+ action: /* @__PURE__ */ jsx(DocsLink, { href: DOCS.widgets, children: "Widgets reference" }),
24
+ "data-test": "widgets-empty",
25
+ children: [
26
+ "This experience registers no widgets. Add them to ",
27
+ /* @__PURE__ */ jsx("code", { children: "widgets" }),
28
+ " ",
29
+ "in ",
30
+ /* @__PURE__ */ jsx("code", { children: "defineExperience" }),
31
+ " and they render here."
32
+ ]
33
+ }
34
+ ) : /* @__PURE__ */ jsx(
12
35
  WidgetSurface,
13
36
  {
14
37
  widgets,
15
- productSlug: project.data?.name ?? "experience"
38
+ productSlug: project.data?.name ?? "experience",
39
+ controls: true,
40
+ widgetHref: (id) => `${links.experience}/widgets/${encodeURIComponent(id)}`
16
41
  }
17
42
  )
18
43
  ] });
@@ -1,22 +1,94 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { notFound, useParams } from "next/navigation";
3
+ import Link from "next/link";
4
+ import { useParams } from "next/navigation";
5
+ import { Icon } from "@ekanos/ui/icon";
6
+ import { cn } from "@ekanos/ui/utils";
7
+ import { NotFoundState } from "../components/not-found-state.js";
8
+ import { PageSkeleton } from "../components/page-skeletons.js";
9
+ import { FOCUS_RING } from "../components/scrollable-nav.js";
4
10
  import { WorkflowRunner } from "../components/workflow-runner.js";
11
+ import { useConsoleLinks } from "../lib/console-context.js";
5
12
  import { useExperience } from "../lib/console-hooks.js";
13
+ import { useOperationEffects } from "../lib/use-operation-effects.js";
14
+ import { workflowIntegrations, workflowSummary } from "../lib/workflow-summary.js";
6
15
  function ExperienceWorkflowPage() {
7
16
  const { id } = useParams();
8
17
  const experience = useExperience();
9
- if (experience.isPending) {
10
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
11
- }
18
+ const links = useConsoleLinks();
12
19
  const template = (experience.data?.workflows ?? []).find(
13
20
  (entry) => entry.id === id
14
21
  );
15
- if (!template) notFound();
16
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
17
- /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: template.title }),
18
- template.description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: template.description }) : null,
19
- /* @__PURE__ */ jsx(WorkflowRunner, { template }, template.id)
22
+ const effectOf = useOperationEffects(
23
+ template ? workflowIntegrations(template) : []
24
+ );
25
+ if (experience.isPending) {
26
+ return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading workflow" });
27
+ }
28
+ if (!template) {
29
+ const workflows = experience.data?.workflows ?? [];
30
+ const name = decodeURIComponent(id);
31
+ return /* @__PURE__ */ jsx(
32
+ NotFoundState,
33
+ {
34
+ testId: "workflow-not-found",
35
+ title: `No workflow called \u201C${name}\u201D`,
36
+ description: workflows.length > 0 ? "This experience has no workflow template with that id. Pick one it does have." : "This experience has no workflow templates yet.",
37
+ options: workflows.map((entry) => ({
38
+ label: entry.id,
39
+ href: `${links.experience}/workflows/${entry.id}`,
40
+ hint: entry.title
41
+ })),
42
+ ...workflows.length > 0 ? { optionsLabel: "The workflows in this experience" } : {},
43
+ action: {
44
+ label: "All workflows",
45
+ href: `${links.experience}/workflows`
46
+ }
47
+ }
48
+ );
49
+ }
50
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", "data-test": "experience-workflow", children: [
51
+ /* @__PURE__ */ jsxs(
52
+ Link,
53
+ {
54
+ href: `${links.experience}/workflows`,
55
+ className: cn(
56
+ "text-muted-foreground hover:text-foreground flex w-fit items-center gap-1.5 rounded-sm text-sm",
57
+ FOCUS_RING
58
+ ),
59
+ children: [
60
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-left", className: "h-4 w-4" }),
61
+ "All workflows"
62
+ ]
63
+ }
64
+ ),
65
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
66
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: template.title }),
67
+ template.description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: template.description }) : null,
68
+ /* @__PURE__ */ jsxs(
69
+ "p",
70
+ {
71
+ className: "text-muted-foreground text-sm",
72
+ "data-test": "workflow-summary",
73
+ children: [
74
+ template.steps.length,
75
+ " step",
76
+ template.steps.length === 1 ? "" : "s",
77
+ ":",
78
+ " ",
79
+ workflowSummary(template, effectOf)
80
+ ]
81
+ }
82
+ )
83
+ ] }),
84
+ /* @__PURE__ */ jsx(
85
+ WorkflowRunner,
86
+ {
87
+ template,
88
+ effectOf
89
+ },
90
+ template.id
91
+ )
20
92
  ] });
21
93
  }
22
94
  export {
@@ -2,41 +2,105 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import Link from "next/link";
4
4
  import { Card } from "@ekanos/ui/card";
5
+ import { EmptyNote } from "@ekanos/ui/empty-note";
6
+ import { Icon } from "@ekanos/ui/icon";
7
+ import { cn } from "@ekanos/ui/utils";
8
+ import { DocsLink } from "../components/docs-link.js";
9
+ import { PageSkeleton } from "../components/page-skeletons.js";
10
+ import { FOCUS_RING } from "../components/scrollable-nav.js";
5
11
  import { useConsoleLinks } from "../lib/console-context.js";
6
12
  import { useExperience } from "../lib/console-hooks.js";
13
+ import { DOCS } from "../lib/docs-links.js";
14
+ import { shortName } from "../lib/setup-checklist.js";
15
+ import { useOperationEffects } from "../lib/use-operation-effects.js";
16
+ import {
17
+ hasApprovalGate,
18
+ workflowIntegrations,
19
+ workflowSummary
20
+ } from "../lib/workflow-summary.js";
7
21
  function ExperienceWorkflowsPage() {
8
22
  const experience = useExperience();
9
23
  const links = useConsoleLinks();
24
+ const workflows = experience.data?.workflows ?? [];
25
+ const effectOf = useOperationEffects([
26
+ ...new Set(workflows.flatMap((template) => workflowIntegrations(template)))
27
+ ]);
10
28
  if (!experience.data && experience.isPending) {
11
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
29
+ return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading workflows" });
12
30
  }
13
31
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-workflows", children: [
14
- /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Workflow templates" }),
15
- (experience.data?.workflows ?? []).length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This experience declares no workflow templates." }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: (experience.data?.workflows ?? []).map((template) => /* @__PURE__ */ jsxs(
16
- Card,
32
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
33
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Workflow templates" }),
34
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Each template runs here against fixtures. Open one to see its steps and run it." })
35
+ ] }),
36
+ workflows.length === 0 ? /* @__PURE__ */ jsxs(
37
+ EmptyNote,
17
38
  {
18
- layout: "bleed",
19
- render: /* @__PURE__ */ jsx("li", {}),
20
- className: "flex flex-col gap-1 p-5",
39
+ icon: "flow-arrow",
40
+ title: "No workflow templates",
41
+ action: /* @__PURE__ */ jsx(DocsLink, { href: DOCS.workflows, children: "Write a workflow template" }),
21
42
  children: [
22
- /* @__PURE__ */ jsx(
43
+ "Add ",
44
+ /* @__PURE__ */ jsx("code", { children: "workflows" }),
45
+ " to ",
46
+ /* @__PURE__ */ jsx("code", { children: "defineExperience" }),
47
+ " with",
48
+ " ",
49
+ /* @__PURE__ */ jsx("code", { children: "defineWorkflowTemplate" }),
50
+ " and it appears here."
51
+ ]
52
+ }
53
+ ) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: workflows.map((template) => {
54
+ const gated = hasApprovalGate(template);
55
+ const used = workflowIntegrations(template).map(shortName);
56
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
57
+ Card,
58
+ {
59
+ layout: "bleed",
60
+ render: /* @__PURE__ */ jsx(
23
61
  Link,
24
62
  {
25
- href: `${links.experience}/workflows/${template.id}`,
26
- className: "text-sm font-medium hover:underline",
27
- children: template.title
63
+ href: `${links.experience}/workflows/${template.id}`
28
64
  }
29
65
  ),
30
- template.description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: template.description }) : null,
31
- /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-xs", children: [
32
- template.steps.length,
33
- " step",
34
- template.steps.length === 1 ? "" : "s"
35
- ] })
36
- ]
37
- },
38
- template.id
39
- )) })
66
+ className: cn(
67
+ "hover:bg-muted group flex flex-row items-start gap-4 p-5 transition-colors",
68
+ FOCUS_RING
69
+ ),
70
+ "data-test": `workflow-card-${template.id}`,
71
+ children: [
72
+ /* @__PURE__ */ jsx("span", { className: "bg-muted text-foreground flex size-9 shrink-0 items-center justify-center rounded-lg", children: /* @__PURE__ */ jsx(Icon, { name: "flow-arrow", className: "h-5 w-5" }) }),
73
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
74
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium group-hover:underline", children: template.title }),
75
+ template.description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: template.description }) : null,
76
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: workflowSummary(template, effectOf) }),
77
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-xs", children: [
78
+ /* @__PURE__ */ jsxs("span", { children: [
79
+ template.steps.length,
80
+ " step",
81
+ template.steps.length === 1 ? "" : "s"
82
+ ] }),
83
+ gated ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
84
+ /* @__PURE__ */ jsx(Icon, { name: "hand", className: "h-3.5 w-3.5" }),
85
+ "Approval gate"
86
+ ] }) : null,
87
+ used.length > 0 ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
88
+ /* @__PURE__ */ jsx(Icon, { name: "plug", className: "h-3.5 w-3.5" }),
89
+ used.join(", ")
90
+ ] }) : null
91
+ ] })
92
+ ] }),
93
+ /* @__PURE__ */ jsx(
94
+ Icon,
95
+ {
96
+ name: "caret-right",
97
+ className: "text-muted-foreground mt-2 h-4 w-4 shrink-0"
98
+ }
99
+ )
100
+ ]
101
+ }
102
+ ) }, template.id);
103
+ }) })
40
104
  ] });
41
105
  }
42
106
  export {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useMemo } from "react";
4
- import { notFound } from "next/navigation";
4
+ import { useParams } from "next/navigation";
5
5
  import { Alert, AlertDescription, AlertTitle } from "@ekanos/ui/alert";
6
6
  import {
7
7
  findEgressMismatch,
@@ -11,16 +11,23 @@ import {
11
11
  seedsForMode
12
12
  } from "../../registry.js";
13
13
  import { HarnessProviders } from "../components/harness-providers.js";
14
+ import { NotFoundPage, NotFoundState } from "../components/not-found-state.js";
14
15
  import { PreviewNav } from "../components/surface-nav.js";
15
16
  import { compileFixtures, needsSelfOrigin } from "../lib/http-fixtures.js";
17
+ import { previewHref } from "../lib/preview-sections.js";
16
18
  import { useToolbar } from "../lib/toolbar-context.js";
17
- import { useHarnessIntegration } from "../registry-context.js";
19
+ import {
20
+ useHarnessIntegration,
21
+ useOptionalHarnessRegistry
22
+ } from "../registry-context.js";
18
23
  function IntegrationLayout({
19
24
  children,
20
25
  withNav = false
21
26
  }) {
22
27
  const { state } = useToolbar();
23
28
  const integration = useHarnessIntegration();
29
+ const registry = useOptionalHarnessRegistry();
30
+ const { slug } = useParams();
24
31
  const egressMismatch = useMemo(
25
32
  () => integration ? findEgressMismatch(integration) : null,
26
33
  [integration]
@@ -49,7 +56,25 @@ function IntegrationLayout({
49
56
  egress
50
57
  );
51
58
  }, [integration, state.variant, egress]);
52
- if (!integration) notFound();
59
+ if (!integration) {
60
+ const name = decodeURIComponent(slug);
61
+ if (!withNav) return /* @__PURE__ */ jsx(NotFoundPage, {});
62
+ return /* @__PURE__ */ jsx(
63
+ NotFoundState,
64
+ {
65
+ testId: "preview-not-found",
66
+ title: `Nothing to preview for \u201C${name}\u201D`,
67
+ description: `No integration in this harness's registry is called ${name}, so it has no widgets, tile or activation form to show.`,
68
+ options: registry.map((entry) => ({
69
+ label: entry.slug,
70
+ href: previewHref(entry.slug),
71
+ hint: entry.name
72
+ })),
73
+ ...registry.length > 0 ? { optionsLabel: "Integrations with a preview" } : {},
74
+ action: { label: "Back to the console", href: "/" }
75
+ }
76
+ );
77
+ }
53
78
  return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-6", children: [
54
79
  withNav ? /* @__PURE__ */ jsx(PreviewNav, { integration }) : null,
55
80
  egressMismatch ? /* @__PURE__ */ jsx(EgressMismatchNotice, { mismatch: egressMismatch }) : null,
@@ -1,18 +1,28 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { ConnectPanel } from "../components/connect-panel.js";
4
+ import { ConnectTabSkeleton } from "../components/integration-tab-skeletons.js";
5
+ import { registryEntryFor } from "../lib/registry-entry.js";
4
6
  import { useOptionalHarnessRegistry } from "../registry-context.js";
5
7
  import { IntegrationScope } from "./integrations-scope.js";
6
8
  function IntegrationConnectPage() {
7
9
  const registry = useOptionalHarnessRegistry();
8
- return /* @__PURE__ */ jsx(IntegrationScope, { title: "Connect", children: ({ integration, contract }) => /* @__PURE__ */ jsx(
9
- ConnectPanel,
10
+ return /* @__PURE__ */ jsx(
11
+ IntegrationScope,
10
12
  {
11
- integration,
12
- oauth: contract.connection.auth === "oauth2" && integration.provenance.kind === "local",
13
- activationForm: registry.find((entry) => entry.slug === integration.integration)?.activationForm
13
+ title: "Connect",
14
+ description: (slug) => `The credentials ${slug} needs to run live, saved on this machine. Until it is connected, calls answer from fixtures.`,
15
+ skeleton: /* @__PURE__ */ jsx(ConnectTabSkeleton, {}),
16
+ children: ({ integration, contract }) => /* @__PURE__ */ jsx(
17
+ ConnectPanel,
18
+ {
19
+ integration,
20
+ oauth: contract.connection.auth === "oauth2" && integration.provenance.kind === "local",
21
+ activationForm: registryEntryFor(registry, integration.integration)?.activationForm
22
+ }
23
+ )
14
24
  }
15
- ) });
25
+ );
16
26
  }
17
27
  export {
18
28
  IntegrationConnectPage
@@ -1,9 +1,30 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { useSearchParams } from "next/navigation";
3
4
  import { EventsPanel } from "../components/events-panel.js";
5
+ import { EventsTabSkeleton } from "../components/integration-tab-skeletons.js";
6
+ import { integrationConsoleHref } from "../lib/integration-console-href.js";
4
7
  import { IntegrationScope } from "./integrations-scope.js";
5
8
  function IntegrationEventsPage() {
6
- return /* @__PURE__ */ jsx(IntegrationScope, { title: "Events", children: ({ integration, contract }) => /* @__PURE__ */ jsx(EventsPanel, { integration, events: contract.events }) });
9
+ const initialEvent = useSearchParams().get("event");
10
+ return /* @__PURE__ */ jsx(
11
+ IntegrationScope,
12
+ {
13
+ title: "Events",
14
+ description: (slug) => `Send one of ${slug}'s declared events with a payload you edit, as the platform would deliver it, and see what happened.`,
15
+ skeleton: /* @__PURE__ */ jsx(EventsTabSkeleton, {}),
16
+ children: ({ integration, contract }) => /* @__PURE__ */ jsx(
17
+ EventsPanel,
18
+ {
19
+ integration,
20
+ events: contract.events,
21
+ base: integrationConsoleHref(integration) ?? `/integrations/${integration.integration}`,
22
+ initialEvent
23
+ },
24
+ initialEvent ?? ""
25
+ )
26
+ }
27
+ );
7
28
  }
8
29
  export {
9
30
  IntegrationEventsPage
@@ -1,9 +1,24 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { HealthPanel } from "../components/health-panel.js";
4
+ import { HealthTabSkeleton } from "../components/integration-tab-skeletons.js";
4
5
  import { IntegrationScope } from "./integrations-scope.js";
5
6
  function IntegrationHealthPage() {
6
- return /* @__PURE__ */ jsx(IntegrationScope, { title: "Health", children: ({ integration }) => /* @__PURE__ */ jsx(HealthPanel, { integration }) });
7
+ return /* @__PURE__ */ jsx(
8
+ IntegrationScope,
9
+ {
10
+ title: "Health",
11
+ description: (slug) => `Whether ${slug} answers with the connection it has now, using the health check its definition declares.`,
12
+ skeleton: /* @__PURE__ */ jsx(HealthTabSkeleton, {}),
13
+ children: ({ integration, contract }) => /* @__PURE__ */ jsx(
14
+ HealthPanel,
15
+ {
16
+ integration,
17
+ contractDeclares: contract.health === true
18
+ }
19
+ )
20
+ }
21
+ );
7
22
  }
8
23
  export {
9
24
  IntegrationHealthPage
@@ -1,8 +1,10 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { usePathname } from "next/navigation";
3
4
  import { Alert, AlertDescription } from "@ekanos/ui/alert";
4
5
  import { cn } from "@ekanos/ui/utils";
5
6
  import { ApprovalsTray } from "../components/approvals-tray.js";
7
+ import { HeaderSkeleton, PageSkeleton } from "../components/page-skeletons.js";
6
8
  import {
7
9
  ProvenanceBanner,
8
10
  localIntegrations
@@ -10,7 +12,8 @@ import {
10
12
  import { RuntimeStrip } from "../components/runtime-strip.js";
11
13
  import { ConsoleNav } from "../components/surface-nav.js";
12
14
  import {
13
- ConsoleProviders
15
+ ConsoleProviders,
16
+ useConsoleLinks
14
17
  } from "../lib/console-context.js";
15
18
  import { useApprovals, useProject } from "../lib/console-hooks.js";
16
19
  import { useOptionalHarnessRegistry } from "../registry-context.js";
@@ -18,6 +21,8 @@ function ConsoleFrame({ children }) {
18
21
  const project = useProject();
19
22
  const approvals = useApprovals();
20
23
  const registry = useOptionalHarnessRegistry();
24
+ const links = useConsoleLinks();
25
+ const pathname = usePathname() ?? "";
21
26
  if (project.isError) {
22
27
  return /* @__PURE__ */ jsx("main", { className: "mx-auto max-w-3xl px-6 py-10", id: "main-content", children: /* @__PURE__ */ jsx(Alert, { variant: "destructive", "data-test": "project-error", children: /* @__PURE__ */ jsxs(AlertDescription, { children: [
23
28
  "Could not reach the harness server: ",
@@ -25,7 +30,10 @@ function ConsoleFrame({ children }) {
25
30
  ] }) }) });
26
31
  }
27
32
  if (!project.data) {
28
- return /* @__PURE__ */ jsx("main", { className: "text-muted-foreground px-6 py-10 text-sm", children: "Loading project\u2026" });
33
+ return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen flex-col", children: [
34
+ /* @__PURE__ */ jsx(HeaderSkeleton, {}),
35
+ /* @__PURE__ */ jsx("main", { className: "mx-auto w-full max-w-5xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading project" }) })
36
+ ] });
29
37
  }
30
38
  const own = project.data.integrations[0];
31
39
  const registered = own ? registry.find((integration) => integration.slug === own.integration) : void 0;
@@ -33,6 +41,11 @@ function ConsoleFrame({ children }) {
33
41
  registered && (registered.widgets.length > 0 || registered.tile || registered.activationForm)
34
42
  ));
35
43
  const unpublishable = localIntegrations(project.data.integrations).length > 0;
44
+ const inExperience = project.data.kind === "experience" && (pathname === links.experience || pathname.startsWith(`${links.experience}/`));
45
+ const sub = inExperience ? pathname.slice(links.experience.length).split("/").filter(Boolean) : [];
46
+ const tab = sub[0] ?? "";
47
+ const compactStrip = inExperience && tab !== "" && tab !== "connect";
48
+ const approvalsInPage = inExperience && (tab === "review-queue" || tab === "workflows" && sub.length > 1);
36
49
  return /* @__PURE__ */ jsxs(
37
50
  "div",
38
51
  {
@@ -73,8 +86,19 @@ function ConsoleFrame({ children }) {
73
86
  children: project.data.notices.map((notice) => /* @__PURE__ */ jsx("li", { children: notice }, notice))
74
87
  }
75
88
  ) : null,
76
- project.data.kind === "experience" ? /* @__PURE__ */ jsx(RuntimeStrip, {}) : null,
77
- /* @__PURE__ */ jsx("div", { id: "approvals", children: /* @__PURE__ */ jsx(ApprovalsTray, {}) }),
89
+ compactStrip ? /* @__PURE__ */ jsx(
90
+ RuntimeStrip,
91
+ {
92
+ variant: "compact",
93
+ manageHref: links.repoHome ? `${links.experience}/connect` : links.experience
94
+ }
95
+ ) : null,
96
+ approvalsInPage ? null : /* @__PURE__ */ jsx("div", { id: "approvals", className: "empty:hidden", children: /* @__PURE__ */ jsx(
97
+ ApprovalsTray,
98
+ {
99
+ ...project.data.kind === "experience" ? { reviewHref: `${links.experience}/review-queue` } : {}
100
+ }
101
+ ) }),
78
102
  children
79
103
  ]
80
104
  }
@@ -1,2 +1 @@
1
- /** Every integration the project touches: an experience's integrations, or itself. */
2
1
  export declare function IntegrationsListPage(): import("react").JSX.Element;
@@ -4,14 +4,23 @@ import Link from "next/link";
4
4
  import { redirect } from "next/navigation";
5
5
  import { Card } from "@ekanos/ui/card";
6
6
  import { ProvenanceBadge, RunModeBadge } from "../components/integration-badge.js";
7
+ import { PageSkeleton } from "../components/page-skeletons.js";
7
8
  import { useProject } from "../lib/console-hooks.js";
9
+ import { integrationConsoleHref } from "../lib/integration-console-href.js";
8
10
  import { previewHref } from "../lib/preview-sections.js";
9
11
  import { useOptionalHarnessRegistry } from "../registry-context.js";
12
+ function IntegrationName({ integration }) {
13
+ const href = integrationConsoleHref(integration);
14
+ if (!href) {
15
+ return /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: integration.integration });
16
+ }
17
+ return /* @__PURE__ */ jsx(Link, { href, className: "text-sm font-medium hover:underline", children: integration.integration });
18
+ }
10
19
  function IntegrationsListPage() {
11
20
  const project = useProject();
12
21
  const registry = useOptionalHarnessRegistry();
13
22
  if (!project.data) {
14
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
23
+ return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading integrations" });
15
24
  }
16
25
  const own = project.data.integrations[0];
17
26
  if (project.data.kind === "integration" && own) {
@@ -52,14 +61,7 @@ function IntegrationsListPage() {
52
61
  className: "flex flex-col gap-2 p-5",
53
62
  children: [
54
63
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
55
- /* @__PURE__ */ jsx(
56
- Link,
57
- {
58
- href: `/integrations/${integration.integration}`,
59
- className: "text-sm font-medium hover:underline",
60
- children: integration.integration
61
- }
62
- ),
64
+ /* @__PURE__ */ jsx(IntegrationName, { integration }),
63
65
  /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-xs", children: [
64
66
  integration.integration,
65
67
  "@",
@@ -1,28 +1,64 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
- import { notFound, useParams } from "next/navigation";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { useParams, usePathname } from "next/navigation";
5
+ import { Icon } from "@ekanos/ui/icon";
6
+ import { OperationNotFound } from "../components/console-not-found.js";
4
7
  import {
5
8
  OperationRunnerPanel,
6
9
  operationKey
7
10
  } from "../components/operation-runner-panel.js";
8
- import { IntegrationScope } from "./integrations-scope.js";
11
+ import {
12
+ OperationRunnerSkeleton,
13
+ OperationScope
14
+ } from "../components/operation-scope.js";
15
+ function operationsHref(pathname) {
16
+ const at = pathname.lastIndexOf("/operations/");
17
+ return at === -1 ? pathname : pathname.slice(0, at + "/operations".length);
18
+ }
9
19
  function IntegrationOperationPage() {
10
20
  const { kind, name } = useParams();
11
- return /* @__PURE__ */ jsx(IntegrationScope, { title: "Run an operation", children: ({ integration, contract }) => {
12
- const operation = contract.operations.find(
13
- (entry) => entry.kind === kind && entry.name === name
14
- );
15
- if (!operation) notFound();
16
- return /* @__PURE__ */ jsx(
17
- OperationRunnerPanel,
21
+ const pathname = usePathname();
22
+ const decodedName = decodeURIComponent(name);
23
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "page-Run an operation", children: [
24
+ /* @__PURE__ */ jsxs(
25
+ Link,
18
26
  {
19
- integration,
20
- operation,
21
- usedBy: contract.usedBy[operationKey(operation)] ?? []
22
- },
23
- operation.id
24
- );
25
- } });
27
+ href: operationsHref(pathname),
28
+ className: "text-muted-foreground hover:text-foreground focus-visible:ring-ring inline-flex w-fit items-center gap-1.5 rounded-sm text-sm outline-none focus-visible:ring-2",
29
+ "data-test": "operation-back",
30
+ children: [
31
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-left", "aria-hidden": true, className: "size-4" }),
32
+ "Operations"
33
+ ]
34
+ }
35
+ ),
36
+ /* @__PURE__ */ jsx(OperationScope, { skeleton: /* @__PURE__ */ jsx(OperationRunnerSkeleton, {}), children: ({ integration, contract }) => {
37
+ const operation = contract.operations.find(
38
+ (entry) => entry.kind === kind && entry.name === decodedName
39
+ );
40
+ if (!operation) {
41
+ return /* @__PURE__ */ jsx(
42
+ OperationNotFound,
43
+ {
44
+ kind,
45
+ name: decodedName,
46
+ integration: integration.integration,
47
+ operationsHref: operationsHref(pathname)
48
+ }
49
+ );
50
+ }
51
+ return /* @__PURE__ */ jsx(
52
+ OperationRunnerPanel,
53
+ {
54
+ integration,
55
+ operation,
56
+ usedBy: contract.usedBy[operationKey(operation)] ?? []
57
+ },
58
+ operation.id
59
+ );
60
+ } })
61
+ ] });
26
62
  }
27
63
  export {
28
64
  IntegrationOperationPage