@ekanos/harness 0.27.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +6 -4
  2. package/dist/internal/components/approvals-tray.d.ts +44 -6
  3. package/dist/internal/components/approvals-tray.js +252 -30
  4. package/dist/internal/components/ask-assistant-bridge.js +7 -1
  5. package/dist/internal/components/connect-controls.js +4 -2
  6. package/dist/internal/components/connect-dialog.d.ts +8 -1
  7. package/dist/internal/components/connect-dialog.js +23 -10
  8. package/dist/internal/components/connect-panel.d.ts +3 -2
  9. package/dist/internal/components/connect-panel.js +680 -340
  10. package/dist/internal/components/connect-steps.d.ts +72 -0
  11. package/dist/internal/components/connect-steps.js +341 -0
  12. package/dist/internal/components/console-not-found.d.ts +14 -0
  13. package/dist/internal/components/console-not-found.js +57 -0
  14. package/dist/internal/components/dashboard-grid.d.ts +10 -5
  15. package/dist/internal/components/dashboard-grid.js +8 -9
  16. package/dist/internal/components/dev-toolbar.d.ts +27 -5
  17. package/dist/internal/components/dev-toolbar.js +214 -176
  18. package/dist/internal/components/ekanos-logo.d.ts +18 -0
  19. package/dist/internal/components/ekanos-logo.js +74 -0
  20. package/dist/internal/components/events-panel.d.ts +13 -4
  21. package/dist/internal/components/events-panel.js +478 -81
  22. package/dist/internal/components/harness-widget-provider.d.ts +6 -8
  23. package/dist/internal/components/harness-widget-provider.js +5 -19
  24. package/dist/internal/components/health-panel.d.ts +8 -1
  25. package/dist/internal/components/health-panel.js +328 -31
  26. package/dist/internal/components/integration-badge.js +4 -2
  27. package/dist/internal/components/integration-tab-skeletons.d.ts +8 -0
  28. package/dist/internal/components/integration-tab-skeletons.js +76 -0
  29. package/dist/internal/components/not-found-state.d.ts +39 -0
  30. package/dist/internal/components/not-found-state.js +127 -0
  31. package/dist/internal/components/operation-runner-panel.d.ts +1 -1
  32. package/dist/internal/components/operation-runner-panel.js +624 -189
  33. package/dist/internal/components/operation-scope.d.ts +13 -0
  34. package/dist/internal/components/operation-scope.js +79 -0
  35. package/dist/internal/components/page-skeletons.d.ts +11 -0
  36. package/dist/internal/components/page-skeletons.js +61 -0
  37. package/dist/internal/components/provenance-banner.d.ts +13 -4
  38. package/dist/internal/components/provenance-banner.js +35 -10
  39. package/dist/internal/components/run-log-copy.d.ts +17 -0
  40. package/dist/internal/components/run-log-copy.js +67 -0
  41. package/dist/internal/components/run-log-detail.d.ts +22 -0
  42. package/dist/internal/components/run-log-detail.js +295 -0
  43. package/dist/internal/components/run-log-empty.d.ts +13 -0
  44. package/dist/internal/components/run-log-empty.js +46 -0
  45. package/dist/internal/components/run-log.d.ts +23 -3
  46. package/dist/internal/components/run-log.js +384 -130
  47. package/dist/internal/components/runtime-strip.d.ts +5 -1
  48. package/dist/internal/components/runtime-strip.js +82 -5
  49. package/dist/internal/components/schema-form.d.ts +2 -1
  50. package/dist/internal/components/schema-form.js +212 -79
  51. package/dist/internal/components/scrollable-nav.js +14 -2
  52. package/dist/internal/components/segmented-control.d.ts +19 -0
  53. package/dist/internal/components/segmented-control.js +46 -0
  54. package/dist/internal/components/shell-header.d.ts +25 -0
  55. package/dist/internal/components/shell-header.js +126 -0
  56. package/dist/internal/components/surface-nav.d.ts +12 -4
  57. package/dist/internal/components/surface-nav.js +79 -80
  58. package/dist/internal/components/widget-surface.d.ts +5 -1
  59. package/dist/internal/components/widget-surface.js +86 -14
  60. package/dist/internal/components/workflow-runner.d.ts +23 -10
  61. package/dist/internal/components/workflow-runner.js +451 -69
  62. package/dist/internal/lib/connect-model.d.ts +134 -0
  63. package/dist/internal/lib/connect-model.js +282 -0
  64. package/dist/internal/lib/connection-facts.js +2 -1
  65. package/dist/internal/lib/console-client.js +5 -2
  66. package/dist/internal/lib/console-hooks.d.ts +4 -1
  67. package/dist/internal/lib/console-hooks.js +3 -2
  68. package/dist/internal/lib/console-types.d.ts +6 -0
  69. package/dist/internal/lib/docs-links.d.ts +27 -0
  70. package/dist/internal/lib/docs-links.js +55 -1
  71. package/dist/internal/lib/event-delivery.d.ts +33 -0
  72. package/dist/internal/lib/event-delivery.js +66 -0
  73. package/dist/internal/lib/font-files/OFL-BricolageGrotesque.txt +93 -0
  74. package/dist/internal/lib/font-files/OFL-Figtree.txt +93 -0
  75. package/dist/internal/lib/font-files/bricolage-grotesque-latin-variable.woff2 +0 -0
  76. package/dist/internal/lib/font-files/figtree-latin-variable.woff2 +0 -0
  77. package/dist/internal/lib/fonts.js +13 -12
  78. package/dist/internal/lib/health-model.d.ts +58 -0
  79. package/dist/internal/lib/health-model.js +140 -0
  80. package/dist/internal/lib/integration-console-href.d.ts +5 -0
  81. package/dist/internal/lib/integration-console-href.js +7 -1
  82. package/dist/internal/lib/oauth-setup-guide.d.ts +28 -0
  83. package/dist/internal/lib/oauth-setup-guide.js +35 -1
  84. package/dist/internal/lib/operation-catalog.d.ts +70 -0
  85. package/dist/internal/lib/operation-catalog.js +261 -0
  86. package/dist/internal/lib/overview-model.d.ts +34 -0
  87. package/dist/internal/lib/overview-model.js +91 -0
  88. package/dist/internal/lib/registry-entry.d.ts +8 -0
  89. package/dist/internal/lib/registry-entry.js +11 -0
  90. package/dist/internal/lib/repo-name.d.ts +9 -0
  91. package/dist/internal/lib/repo-name.js +21 -0
  92. package/dist/internal/lib/run-log-view.d.ts +66 -1
  93. package/dist/internal/lib/run-log-view.js +183 -4
  94. package/dist/internal/lib/runner-view.d.ts +15 -0
  95. package/dist/internal/lib/runner-view.js +18 -0
  96. package/dist/internal/lib/schema-form-model.d.ts +17 -0
  97. package/dist/internal/lib/schema-form-model.js +50 -0
  98. package/dist/internal/lib/setup-checklist.d.ts +34 -0
  99. package/dist/internal/lib/setup-checklist.js +79 -0
  100. package/dist/internal/lib/toolbar-context.d.ts +0 -1
  101. package/dist/internal/lib/toolbar-context.js +0 -2
  102. package/dist/internal/lib/toolbar-visibility.d.ts +9 -2
  103. package/dist/internal/lib/toolbar-visibility.js +5 -0
  104. package/dist/internal/lib/use-operation-effects.d.ts +7 -0
  105. package/dist/internal/lib/use-operation-effects.js +28 -0
  106. package/dist/internal/lib/use-run-log-query.d.ts +9 -0
  107. package/dist/internal/lib/use-run-log-query.js +35 -0
  108. package/dist/internal/lib/widget-grid-gaps.d.ts +18 -0
  109. package/dist/internal/lib/widget-grid-gaps.js +41 -0
  110. package/dist/internal/lib/workflow-summary.d.ts +54 -0
  111. package/dist/internal/lib/workflow-summary.js +147 -0
  112. package/dist/internal/routes/console-home-page.js +2 -1
  113. package/dist/internal/routes/experience-connect-page.js +46 -17
  114. package/dist/internal/routes/experience-layout-page.d.ts +6 -6
  115. package/dist/internal/routes/experience-layout-page.js +3 -119
  116. package/dist/internal/routes/experience-page-host.js +61 -5
  117. package/dist/internal/routes/experience-pages-page.d.ts +5 -0
  118. package/dist/internal/routes/experience-pages-page.js +118 -0
  119. package/dist/internal/routes/experience-review-queue-page.d.ts +4 -1
  120. package/dist/internal/routes/experience-review-queue-page.js +108 -12
  121. package/dist/internal/routes/experience-runs-page.js +57 -4
  122. package/dist/internal/routes/experience-summary-page.d.ts +19 -0
  123. package/dist/internal/routes/experience-summary-page.js +212 -52
  124. package/dist/internal/routes/experience-widget-page.js +58 -7
  125. package/dist/internal/routes/experience-widgets-page.d.ts +2 -3
  126. package/dist/internal/routes/experience-widgets-page.js +29 -4
  127. package/dist/internal/routes/experience-workflow-page.js +81 -9
  128. package/dist/internal/routes/experience-workflows-page.js +85 -21
  129. package/dist/internal/routes/integration-layout.js +28 -3
  130. package/dist/internal/routes/integrations-connect-page.js +16 -6
  131. package/dist/internal/routes/integrations-events-page.js +22 -1
  132. package/dist/internal/routes/integrations-health-page.js +16 -1
  133. package/dist/internal/routes/integrations-layout.js +28 -4
  134. package/dist/internal/routes/integrations-list-page.d.ts +0 -1
  135. package/dist/internal/routes/integrations-list-page.js +11 -9
  136. package/dist/internal/routes/integrations-operation-page.js +53 -17
  137. package/dist/internal/routes/integrations-operations-page.js +539 -49
  138. package/dist/internal/routes/integrations-overview-page.js +332 -69
  139. package/dist/internal/routes/integrations-runs-page.js +53 -3
  140. package/dist/internal/routes/integrations-scope.d.ts +15 -2
  141. package/dist/internal/routes/integrations-scope.js +66 -18
  142. package/dist/internal/routes/preview-index-page.js +2 -2
  143. package/dist/internal/routes/repo-home-page.d.ts +2 -2
  144. package/dist/internal/routes/repo-home-page.js +429 -236
  145. package/dist/internal/routes/repo-layout.d.ts +12 -0
  146. package/dist/internal/routes/repo-layout.js +50 -38
  147. package/dist/internal/routes/repo-package-layouts.js +22 -8
  148. package/dist/internal/routes/single-widget-page.d.ts +1 -1
  149. package/dist/internal/routes/single-widget-page.js +28 -5
  150. package/dist/internal/routes/tile-page.d.ts +1 -1
  151. package/dist/internal/routes/tile-page.js +1 -2
  152. package/dist/internal/routes/widgets-page.d.ts +1 -1
  153. package/dist/internal/routes/widgets-page.js +5 -3
  154. package/dist/registry.d.ts +4 -5
  155. package/dist/registry.js +0 -1
  156. package/dist/routes.d.ts +8 -1
  157. package/dist/routes.js +4 -0
  158. package/package.json +14 -14
@@ -0,0 +1,118 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { Card } from "@ekanos/ui/card";
5
+ import {
6
+ EmptyMedia,
7
+ EmptyState,
8
+ EmptyStateHeading,
9
+ EmptyStateText
10
+ } from "@ekanos/ui/empty-state";
11
+ import { Icon } from "@ekanos/ui/icon";
12
+ import { StatusBadge } from "@ekanos/ui/status-badge";
13
+ import { DocsLink } from "../components/docs-link.js";
14
+ import {
15
+ useConsoleLinks,
16
+ useExperienceSurfaces
17
+ } from "../lib/console-context.js";
18
+ import { DOCS } from "../lib/docs-links.js";
19
+ const PAGE_HINT = `pages: [
20
+ {
21
+ id: 'desk',
22
+ title: 'Desk',
23
+ path: 'desk',
24
+ component: DeskPage,
25
+ },
26
+ ],`;
27
+ const KIND_LABELS = {
28
+ custom: "Page",
29
+ canvas: "Widget page",
30
+ overview: "Overview page"
31
+ };
32
+ function pageKindLabel(kind) {
33
+ return KIND_LABELS[kind ?? "custom"] ?? "Page";
34
+ }
35
+ function pageDetail(page) {
36
+ if (page.kind === "canvas") {
37
+ const count = page.widgets?.length ?? 0;
38
+ return `${count} widget${count === 1 ? "" : "s"}`;
39
+ }
40
+ const sections = page.routes?.length ?? 0;
41
+ if (sections > 0) {
42
+ return `${sections + 1} sections`;
43
+ }
44
+ return page.kind === "overview" && !page.component ? "Shows every widget in the experience" : null;
45
+ }
46
+ function ExperiencePagesPage() {
47
+ const links = useConsoleLinks();
48
+ const { pages } = useExperienceSurfaces();
49
+ if (pages.length === 0) {
50
+ return /* @__PURE__ */ jsxs(
51
+ EmptyState,
52
+ {
53
+ className: "min-w-0 py-12 *:max-w-full *:min-w-0",
54
+ "data-test": "pages-empty",
55
+ children: [
56
+ /* @__PURE__ */ jsx(EmptyMedia, { variant: "icon", children: /* @__PURE__ */ jsx(Icon, { name: "browser" }) }),
57
+ /* @__PURE__ */ jsx(EmptyStateHeading, { children: "No pages yet" }),
58
+ /* @__PURE__ */ jsxs(EmptyStateText, { className: "max-w-md", children: [
59
+ "A page is a full screen this experience ships, such as a desk or a detail view. Add ",
60
+ /* @__PURE__ */ jsx("code", { children: "pages" }),
61
+ " to ",
62
+ /* @__PURE__ */ jsx("code", { children: "defineExperience" }),
63
+ " ",
64
+ "and each one opens here."
65
+ ] }),
66
+ /* @__PURE__ */ jsx("pre", { className: "bg-muted mt-3 w-full max-w-md min-w-0 overflow-x-auto rounded-md px-3 py-2 text-left text-xs", children: PAGE_HINT }),
67
+ /* @__PURE__ */ jsx(DocsLink, { href: DOCS.pageKinds, className: "mt-3", children: "Pages" })
68
+ ]
69
+ }
70
+ );
71
+ }
72
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-pages", children: [
73
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
74
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Pages" }),
75
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Every page this experience ships. Where each one appears is set by whoever arranges the workspaces." })
76
+ ] }),
77
+ /* @__PURE__ */ jsx(
78
+ Card,
79
+ {
80
+ layout: "bleed",
81
+ render: /* @__PURE__ */ jsx("ul", {}),
82
+ className: "gap-0 divide-y overflow-hidden py-0",
83
+ children: pages.map((page) => {
84
+ const detail = pageDetail(page);
85
+ return /* @__PURE__ */ jsx("li", { "data-test": `page-row-${page.id}`, children: /* @__PURE__ */ jsxs(
86
+ Link,
87
+ {
88
+ href: `${links.experience}/pages/${page.id}`,
89
+ className: "hover:bg-muted focus-visible:ring-ring flex items-center gap-3 px-4 py-3 text-sm focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset",
90
+ children: [
91
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
92
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: page.title }),
93
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground flex min-w-0 gap-2 text-xs", children: [
94
+ /* @__PURE__ */ jsx("code", { className: "truncate font-mono", children: page.id }),
95
+ detail ? /* @__PURE__ */ jsx("span", { children: detail }) : null
96
+ ] })
97
+ ] }),
98
+ /* @__PURE__ */ jsx(StatusBadge, { tone: "neutral", className: "ml-auto shrink-0", children: pageKindLabel(page.kind) }),
99
+ /* @__PURE__ */ jsx(
100
+ Icon,
101
+ {
102
+ name: "caret-right",
103
+ className: "text-muted-foreground size-4 shrink-0",
104
+ "aria-hidden": true
105
+ }
106
+ )
107
+ ]
108
+ }
109
+ ) }, page.id);
110
+ })
111
+ }
112
+ )
113
+ ] });
114
+ }
115
+ export {
116
+ ExperiencePagesPage,
117
+ pageKindLabel
118
+ };
@@ -1,2 +1,5 @@
1
- /** The declared review-queue sections, each rendered through the runner. */
1
+ /**
2
+ * What needs a person: approvals waiting on a decision (workflow gates and
3
+ * held writes), then the read-only lists the experience declares for review.
4
+ */
2
5
  export declare function ExperienceReviewQueuePage(): import("react").JSX.Element;
@@ -1,11 +1,28 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
3
4
  import { Alert, AlertDescription } from "@ekanos/ui/alert";
5
+ import { Button } from "@ekanos/ui/button";
4
6
  import { Card } from "@ekanos/ui/card";
7
+ import { EmptyNote } from "@ekanos/ui/empty-note";
8
+ import {
9
+ EmptyMedia,
10
+ EmptyState,
11
+ EmptyStateHeading,
12
+ EmptyStateText
13
+ } from "@ekanos/ui/empty-state";
14
+ import { Icon } from "@ekanos/ui/icon";
15
+ import { Skeleton } from "@ekanos/ui/skeleton";
5
16
  import { StatusBadge } from "@ekanos/ui/status-badge";
6
17
  import { useQuery } from "@tanstack/react-query";
7
- import { useConsoleClient } from "../lib/console-context.js";
8
- import { useExperience } from "../lib/console-hooks.js";
18
+ import { ApprovalList, DecisionLog } from "../components/approvals-tray.js";
19
+ import { DocsLink } from "../components/docs-link.js";
20
+ import { PageSkeleton } from "../components/page-skeletons.js";
21
+ import { useConsoleClient, useConsoleLinks } from "../lib/console-context.js";
22
+ import { useApprovals, useExperience } from "../lib/console-hooks.js";
23
+ import { DOCS } from "../lib/docs-links.js";
24
+ import { shortName } from "../lib/setup-checklist.js";
25
+ import { hasApprovalGate, splitOpKey } from "../lib/workflow-summary.js";
9
26
  function Section({ section }) {
10
27
  const client = useConsoleClient();
11
28
  const result = useQuery({
@@ -29,30 +46,109 @@ function Section({ section }) {
29
46
  children: [
30
47
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
31
48
  /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: section.title }),
32
- /* @__PURE__ */ jsxs("code", { className: "text-muted-foreground text-xs", children: [
33
- section.integration,
34
- ":",
35
- section.opKey
49
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
50
+ "reads ",
51
+ shortName(section.integration),
52
+ " ",
53
+ /* @__PURE__ */ jsx("code", { children: splitOpKey(section.opKey)?.name ?? section.opKey })
36
54
  ] })
37
55
  ] }),
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 max-h-72 overflow-auto rounded-md p-3 text-xs", children: JSON.stringify(result.data.output, null, 2) }) : result.data?.status === "refused" ? /* @__PURE__ */ jsxs(StatusBadge, { tone: "destructive", children: [
56
+ result.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */ jsxs(AlertDescription, { children: [
57
+ "The read failed: ",
58
+ result.error.message
59
+ ] }) }) : result.data?.status === "ok" ? /* @__PURE__ */ jsx("pre", { className: "bg-muted max-h-72 overflow-auto rounded-md p-3 text-xs", children: JSON.stringify(result.data.output, null, 2) }) : result.data?.status === "refused" ? /* @__PURE__ */ jsxs(StatusBadge, { tone: "destructive", children: [
39
60
  result.data.reason,
40
61
  ": ",
41
62
  result.data.message
42
- ] }) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "Loading\u2026" })
63
+ ] }) : /* @__PURE__ */ jsx(Skeleton, { className: "h-24 w-full" })
43
64
  ]
44
65
  }
45
66
  );
46
67
  }
68
+ function NothingWaiting({
69
+ workflows
70
+ }) {
71
+ const links = useConsoleLinks();
72
+ const gated = workflows.find(hasApprovalGate);
73
+ return /* @__PURE__ */ jsxs(EmptyState, { className: "py-12", "data-test": "review-queue-empty", children: [
74
+ /* @__PURE__ */ jsx(EmptyMedia, { variant: "icon", children: /* @__PURE__ */ jsx(Icon, { name: "tray" }) }),
75
+ /* @__PURE__ */ jsx(EmptyStateHeading, { children: "Nothing waiting for approval" }),
76
+ /* @__PURE__ */ jsxs(EmptyStateText, { className: "max-w-md", children: [
77
+ "When a workflow reaches an approval gate, it stops here until you approve or reject it.",
78
+ " ",
79
+ gated ? `Run ${gated.title} to see one.` : "None of this experience\u2019s workflows has an approval gate yet."
80
+ ] }),
81
+ /* @__PURE__ */ jsx(
82
+ Button,
83
+ {
84
+ className: "mt-4",
85
+ nativeButton: false,
86
+ render: /* @__PURE__ */ jsx(
87
+ Link,
88
+ {
89
+ href: gated ? `${links.experience}/workflows/${gated.id}` : `${links.experience}/workflows`
90
+ }
91
+ ),
92
+ "data-test": "review-queue-empty-action",
93
+ children: gated ? `Open ${gated.title}` : "Open workflows"
94
+ }
95
+ )
96
+ ] });
97
+ }
47
98
  function ExperienceReviewQueuePage() {
48
99
  const experience = useExperience();
100
+ const approvals = useApprovals();
49
101
  const sections = experience.data?.reviewQueue ?? [];
102
+ const workflows = experience.data?.workflows ?? [];
103
+ const waiting = approvals.data ?? [];
50
104
  if (experience.isPending) {
51
- return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
105
+ return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading the review queue" });
52
106
  }
53
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-review-queue", children: [
54
- /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Review queue" }),
55
- sections.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", 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)) })
107
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8", "data-test": "experience-review-queue", children: [
108
+ /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-test": "review-approvals", children: [
109
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
110
+ /* @__PURE__ */ jsxs("h2", { className: "font-heading text-xl font-normal", children: [
111
+ "Waiting for approval",
112
+ waiting.length > 0 ? /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
113
+ " (",
114
+ waiting.length,
115
+ ")"
116
+ ] }) : null
117
+ ] }),
118
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Workflow approval gates and held writes. Approving lets the run continue; rejecting stops it." })
119
+ ] }),
120
+ /* @__PURE__ */ jsx(DecisionLog, {}),
121
+ approvals.isPending ? /* @__PURE__ */ jsx(Skeleton, { className: "h-28 w-full" }) : waiting.length === 0 ? /* @__PURE__ */ jsx(NothingWaiting, { workflows }) : /* @__PURE__ */ jsx(
122
+ ApprovalList,
123
+ {
124
+ approvals: waiting,
125
+ workflowTitles: Object.fromEntries(
126
+ workflows.map((template) => [template.id, template.title])
127
+ )
128
+ }
129
+ )
130
+ ] }),
131
+ /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-test": "review-sections", children: [
132
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
133
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Review lists" }),
134
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Read-only lists this experience declares for a person to look over, each filled by one read operation." })
135
+ ] }),
136
+ sections.length === 0 ? /* @__PURE__ */ jsxs(
137
+ EmptyNote,
138
+ {
139
+ icon: "list-checks",
140
+ title: "No review lists",
141
+ action: /* @__PURE__ */ jsx(DocsLink, { href: DOCS.experiences, children: "defineExperience reference" }),
142
+ children: [
143
+ "Add ",
144
+ /* @__PURE__ */ jsx("code", { children: "reviewQueue" }),
145
+ " to ",
146
+ /* @__PURE__ */ jsx("code", { children: "defineExperience" }),
147
+ ", each section naming one read operation, and its results show here."
148
+ ]
149
+ }
150
+ ) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: sections.map((section) => /* @__PURE__ */ jsx(Section, { section }, section.id)) })
151
+ ] })
56
152
  ] });
57
153
  }
58
154
  export {
@@ -1,11 +1,64 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { RunLog } from "../components/run-log.js";
4
+ import { RunLogEmpty } from "../components/run-log-empty.js";
5
+ import { useConsoleLinks } from "../lib/console-context.js";
6
+ import { useProject } from "../lib/console-hooks.js";
7
+ import { integrationConsoleHref } from "../lib/integration-console-href.js";
8
+ import { runTargetHref } from "../lib/run-log-view.js";
9
+ import { useRunLogQuery } from "../lib/use-run-log-query.js";
4
10
  function ExperienceRunsPage() {
5
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-runs", children: [
6
- /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Run log" }),
7
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: "Every operation call from any surface, with its provenance." }),
8
- /* @__PURE__ */ jsx(RunLog, {})
11
+ const links = useConsoleLinks();
12
+ const project = useProject();
13
+ const [query, setQuery] = useRunLogQuery();
14
+ const consoles = new Map(
15
+ (project.data?.integrations ?? []).map((integration) => [
16
+ integration.integration,
17
+ integrationConsoleHref(integration)
18
+ ])
19
+ );
20
+ const firstConsole = [...consoles.values()].find(
21
+ (href) => href !== null
22
+ );
23
+ const emptyLinks = [
24
+ {
25
+ href: `${links.experience}/workflows`,
26
+ label: "Run a workflow",
27
+ testId: "run-log-empty-workflows"
28
+ },
29
+ {
30
+ href: `${links.experience}/widgets`,
31
+ label: "Open the widgets",
32
+ testId: "run-log-empty-widgets"
33
+ },
34
+ ...firstConsole ? [
35
+ {
36
+ href: `${firstConsole}/operations`,
37
+ label: "Run an operation",
38
+ testId: "run-log-empty-operations"
39
+ }
40
+ ] : []
41
+ ];
42
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", "data-test": "experience-runs", children: [
43
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
44
+ /* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Run log" }),
45
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Every operation this experience calls, from its widgets, pages, workflows and review queue, newest first. Open a run to see its status, timing and where it came from." })
46
+ ] }),
47
+ /* @__PURE__ */ jsx(
48
+ RunLog,
49
+ {
50
+ query,
51
+ onQueryChange: setQuery,
52
+ targetHrefFor: (run) => runTargetHref(consoles.get(run.integration) ?? null, run.opKey),
53
+ empty: /* @__PURE__ */ jsx(
54
+ RunLogEmpty,
55
+ {
56
+ text: "Each call the experience makes lands here as it happens: a widget loading, a workflow step, a review-queue action. Run a workflow or open a widget to see one.",
57
+ links: emptyLinks
58
+ }
59
+ )
60
+ }
61
+ )
9
62
  ] });
10
63
  }
11
64
  export {
@@ -1 +1,20 @@
1
+ import { type StatusTone } from '@ekanos/ui/status-badge';
2
+ import type { CheckStatus } from '../lib/console-types.js';
3
+ interface CheckLine {
4
+ id: string;
5
+ label: string;
6
+ tone: StatusTone;
7
+ status: string;
8
+ text: React.ReactNode;
9
+ }
10
+ /** The three checks, each in plain words: what it means and what to do. */
11
+ export declare function summaryChecks(input: {
12
+ overrides: number;
13
+ checks?: {
14
+ pins: CheckStatus;
15
+ boundary: CheckStatus;
16
+ } | undefined;
17
+ }): CheckLine[];
18
+ /** What this experience is, whether it is ready, and what there is to look at. */
1
19
  export declare function ExperienceSummaryPage(): import("react").JSX.Element;
20
+ export {};