@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.
- package/README.md +6 -4
- package/dist/internal/components/approvals-tray.d.ts +44 -6
- package/dist/internal/components/approvals-tray.js +252 -30
- package/dist/internal/components/ask-assistant-bridge.js +7 -1
- package/dist/internal/components/connect-controls.js +4 -2
- package/dist/internal/components/connect-dialog.d.ts +8 -1
- package/dist/internal/components/connect-dialog.js +23 -10
- package/dist/internal/components/connect-panel.d.ts +3 -2
- package/dist/internal/components/connect-panel.js +680 -340
- package/dist/internal/components/connect-steps.d.ts +72 -0
- package/dist/internal/components/connect-steps.js +341 -0
- package/dist/internal/components/console-not-found.d.ts +14 -0
- package/dist/internal/components/console-not-found.js +57 -0
- package/dist/internal/components/dashboard-grid.d.ts +10 -5
- package/dist/internal/components/dashboard-grid.js +8 -9
- package/dist/internal/components/dev-toolbar.d.ts +27 -5
- package/dist/internal/components/dev-toolbar.js +214 -176
- package/dist/internal/components/ekanos-logo.d.ts +18 -0
- package/dist/internal/components/ekanos-logo.js +74 -0
- package/dist/internal/components/events-panel.d.ts +13 -4
- package/dist/internal/components/events-panel.js +478 -81
- package/dist/internal/components/harness-widget-provider.d.ts +6 -8
- package/dist/internal/components/harness-widget-provider.js +5 -19
- package/dist/internal/components/health-panel.d.ts +8 -1
- package/dist/internal/components/health-panel.js +328 -31
- package/dist/internal/components/integration-badge.js +4 -2
- package/dist/internal/components/integration-tab-skeletons.d.ts +8 -0
- package/dist/internal/components/integration-tab-skeletons.js +76 -0
- package/dist/internal/components/not-found-state.d.ts +39 -0
- package/dist/internal/components/not-found-state.js +127 -0
- package/dist/internal/components/operation-runner-panel.d.ts +1 -1
- package/dist/internal/components/operation-runner-panel.js +624 -189
- package/dist/internal/components/operation-scope.d.ts +13 -0
- package/dist/internal/components/operation-scope.js +79 -0
- package/dist/internal/components/page-skeletons.d.ts +11 -0
- package/dist/internal/components/page-skeletons.js +61 -0
- package/dist/internal/components/provenance-banner.d.ts +13 -4
- package/dist/internal/components/provenance-banner.js +35 -10
- package/dist/internal/components/run-log-copy.d.ts +17 -0
- package/dist/internal/components/run-log-copy.js +67 -0
- package/dist/internal/components/run-log-detail.d.ts +22 -0
- package/dist/internal/components/run-log-detail.js +295 -0
- package/dist/internal/components/run-log-empty.d.ts +13 -0
- package/dist/internal/components/run-log-empty.js +46 -0
- package/dist/internal/components/run-log.d.ts +23 -3
- package/dist/internal/components/run-log.js +384 -130
- package/dist/internal/components/runtime-strip.d.ts +5 -1
- package/dist/internal/components/runtime-strip.js +82 -5
- package/dist/internal/components/schema-form.d.ts +2 -1
- package/dist/internal/components/schema-form.js +212 -79
- package/dist/internal/components/scrollable-nav.js +14 -2
- package/dist/internal/components/segmented-control.d.ts +19 -0
- package/dist/internal/components/segmented-control.js +46 -0
- package/dist/internal/components/shell-header.d.ts +25 -0
- package/dist/internal/components/shell-header.js +126 -0
- package/dist/internal/components/surface-nav.d.ts +12 -4
- package/dist/internal/components/surface-nav.js +79 -80
- package/dist/internal/components/widget-surface.d.ts +5 -1
- package/dist/internal/components/widget-surface.js +86 -14
- package/dist/internal/components/workflow-runner.d.ts +23 -10
- package/dist/internal/components/workflow-runner.js +451 -69
- package/dist/internal/lib/connect-model.d.ts +134 -0
- package/dist/internal/lib/connect-model.js +282 -0
- package/dist/internal/lib/connection-facts.js +2 -1
- package/dist/internal/lib/console-client.js +5 -2
- package/dist/internal/lib/console-hooks.d.ts +4 -1
- package/dist/internal/lib/console-hooks.js +3 -2
- package/dist/internal/lib/console-types.d.ts +6 -0
- package/dist/internal/lib/docs-links.d.ts +27 -0
- package/dist/internal/lib/docs-links.js +55 -1
- package/dist/internal/lib/event-delivery.d.ts +33 -0
- package/dist/internal/lib/event-delivery.js +66 -0
- package/dist/internal/lib/font-files/OFL-BricolageGrotesque.txt +93 -0
- package/dist/internal/lib/font-files/OFL-Figtree.txt +93 -0
- package/dist/internal/lib/font-files/bricolage-grotesque-latin-variable.woff2 +0 -0
- package/dist/internal/lib/font-files/figtree-latin-variable.woff2 +0 -0
- package/dist/internal/lib/fonts.js +13 -12
- package/dist/internal/lib/health-model.d.ts +58 -0
- package/dist/internal/lib/health-model.js +140 -0
- package/dist/internal/lib/integration-console-href.d.ts +5 -0
- package/dist/internal/lib/integration-console-href.js +7 -1
- package/dist/internal/lib/oauth-setup-guide.d.ts +28 -0
- package/dist/internal/lib/oauth-setup-guide.js +35 -1
- package/dist/internal/lib/operation-catalog.d.ts +70 -0
- package/dist/internal/lib/operation-catalog.js +261 -0
- package/dist/internal/lib/overview-model.d.ts +34 -0
- package/dist/internal/lib/overview-model.js +91 -0
- package/dist/internal/lib/registry-entry.d.ts +8 -0
- package/dist/internal/lib/registry-entry.js +11 -0
- package/dist/internal/lib/repo-name.d.ts +9 -0
- package/dist/internal/lib/repo-name.js +21 -0
- package/dist/internal/lib/run-log-view.d.ts +66 -1
- package/dist/internal/lib/run-log-view.js +183 -4
- package/dist/internal/lib/runner-view.d.ts +15 -0
- package/dist/internal/lib/runner-view.js +18 -0
- package/dist/internal/lib/schema-form-model.d.ts +17 -0
- package/dist/internal/lib/schema-form-model.js +50 -0
- package/dist/internal/lib/setup-checklist.d.ts +34 -0
- package/dist/internal/lib/setup-checklist.js +79 -0
- package/dist/internal/lib/toolbar-context.d.ts +0 -1
- package/dist/internal/lib/toolbar-context.js +0 -2
- package/dist/internal/lib/toolbar-visibility.d.ts +9 -2
- package/dist/internal/lib/toolbar-visibility.js +5 -0
- package/dist/internal/lib/use-operation-effects.d.ts +7 -0
- package/dist/internal/lib/use-operation-effects.js +28 -0
- package/dist/internal/lib/use-run-log-query.d.ts +9 -0
- package/dist/internal/lib/use-run-log-query.js +35 -0
- package/dist/internal/lib/widget-grid-gaps.d.ts +18 -0
- package/dist/internal/lib/widget-grid-gaps.js +41 -0
- package/dist/internal/lib/workflow-summary.d.ts +54 -0
- package/dist/internal/lib/workflow-summary.js +147 -0
- package/dist/internal/routes/console-home-page.js +2 -1
- package/dist/internal/routes/experience-connect-page.js +46 -17
- package/dist/internal/routes/experience-layout-page.d.ts +6 -6
- package/dist/internal/routes/experience-layout-page.js +3 -119
- package/dist/internal/routes/experience-page-host.js +61 -5
- package/dist/internal/routes/experience-pages-page.d.ts +5 -0
- package/dist/internal/routes/experience-pages-page.js +118 -0
- package/dist/internal/routes/experience-review-queue-page.d.ts +4 -1
- package/dist/internal/routes/experience-review-queue-page.js +108 -12
- package/dist/internal/routes/experience-runs-page.js +57 -4
- package/dist/internal/routes/experience-summary-page.d.ts +19 -0
- package/dist/internal/routes/experience-summary-page.js +212 -52
- package/dist/internal/routes/experience-widget-page.js +58 -7
- package/dist/internal/routes/experience-widgets-page.d.ts +2 -3
- package/dist/internal/routes/experience-widgets-page.js +29 -4
- package/dist/internal/routes/experience-workflow-page.js +81 -9
- package/dist/internal/routes/experience-workflows-page.js +85 -21
- package/dist/internal/routes/integration-layout.js +28 -3
- package/dist/internal/routes/integrations-connect-page.js +16 -6
- package/dist/internal/routes/integrations-events-page.js +22 -1
- package/dist/internal/routes/integrations-health-page.js +16 -1
- package/dist/internal/routes/integrations-layout.js +28 -4
- package/dist/internal/routes/integrations-list-page.d.ts +0 -1
- package/dist/internal/routes/integrations-list-page.js +11 -9
- package/dist/internal/routes/integrations-operation-page.js +53 -17
- package/dist/internal/routes/integrations-operations-page.js +539 -49
- package/dist/internal/routes/integrations-overview-page.js +332 -69
- package/dist/internal/routes/integrations-runs-page.js +53 -3
- package/dist/internal/routes/integrations-scope.d.ts +15 -2
- package/dist/internal/routes/integrations-scope.js +66 -18
- package/dist/internal/routes/preview-index-page.js +2 -2
- package/dist/internal/routes/repo-home-page.d.ts +2 -2
- package/dist/internal/routes/repo-home-page.js +429 -236
- package/dist/internal/routes/repo-layout.d.ts +12 -0
- package/dist/internal/routes/repo-layout.js +50 -38
- package/dist/internal/routes/repo-package-layouts.js +22 -8
- package/dist/internal/routes/single-widget-page.d.ts +1 -1
- package/dist/internal/routes/single-widget-page.js +28 -5
- package/dist/internal/routes/tile-page.d.ts +1 -1
- package/dist/internal/routes/tile-page.js +1 -2
- package/dist/internal/routes/widgets-page.d.ts +1 -1
- package/dist/internal/routes/widgets-page.js +5 -3
- package/dist/registry.d.ts +4 -5
- package/dist/registry.js +0 -1
- package/dist/routes.d.ts +8 -1
- package/dist/routes.js +4 -0
- package/package.json +14 -14
|
@@ -1,89 +1,352 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { Button } from "@ekanos/ui/button";
|
|
3
5
|
import { Card } from "@ekanos/ui/card";
|
|
6
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
7
|
+
import { Skeleton } from "@ekanos/ui/skeleton";
|
|
4
8
|
import { StatusBadge } from "@ekanos/ui/status-badge";
|
|
9
|
+
import { cn } from "@ekanos/ui/utils";
|
|
10
|
+
import { useQuery } from "@tanstack/react-query";
|
|
11
|
+
import { CopyValue } from "../components/connect-steps.js";
|
|
5
12
|
import { ConnectionChip } from "../components/connection-chip.js";
|
|
6
13
|
import {
|
|
7
14
|
ProvenanceBadge,
|
|
8
15
|
describeProvenance,
|
|
9
|
-
provenanceTitle
|
|
10
|
-
shortDigest
|
|
16
|
+
provenanceTitle
|
|
11
17
|
} from "../components/integration-badge.js";
|
|
12
|
-
import {
|
|
18
|
+
import { OverviewSkeleton } from "../components/integration-tab-skeletons.js";
|
|
19
|
+
import { CONNECTION_KIND_LABEL } from "../lib/connection-facts.js";
|
|
20
|
+
import { useConnection, useRuns } from "../lib/console-hooks.js";
|
|
21
|
+
import {
|
|
22
|
+
hasHealthCheck,
|
|
23
|
+
healthKey,
|
|
24
|
+
healthVerdict
|
|
25
|
+
} from "../lib/health-model.js";
|
|
26
|
+
import { integrationConsoleHref } from "../lib/integration-console-href.js";
|
|
27
|
+
import {
|
|
28
|
+
levelsLine,
|
|
29
|
+
overviewNext,
|
|
30
|
+
runModesLine
|
|
31
|
+
} from "../lib/overview-model.js";
|
|
32
|
+
import { registryEntryFor } from "../lib/registry-entry.js";
|
|
33
|
+
import { useOptionalHarnessRegistry } from "../registry-context.js";
|
|
13
34
|
import { IntegrationScope } from "./integrations-scope.js";
|
|
14
35
|
function Fact({
|
|
15
36
|
label,
|
|
16
|
-
children
|
|
37
|
+
children,
|
|
38
|
+
testId
|
|
17
39
|
}) {
|
|
18
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
19
|
-
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground text-
|
|
20
|
-
/* @__PURE__ */ jsx(
|
|
40
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1 sm:grid sm:grid-cols-[10rem_minmax(0,1fr)] sm:gap-4 sm:py-0.5", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground text-sm", children: label }),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"dd",
|
|
44
|
+
{
|
|
45
|
+
className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-sm",
|
|
46
|
+
"data-test": testId,
|
|
47
|
+
children
|
|
48
|
+
}
|
|
49
|
+
)
|
|
21
50
|
] });
|
|
22
51
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
52
|
+
function NextAction({
|
|
53
|
+
next,
|
|
54
|
+
base
|
|
55
|
+
}) {
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
Card,
|
|
58
|
+
{
|
|
59
|
+
layout: "bleed",
|
|
60
|
+
render: /* @__PURE__ */ jsx("section", {}),
|
|
61
|
+
className: "flex min-w-0 flex-col gap-4 p-5",
|
|
62
|
+
"data-test": "overview-next",
|
|
63
|
+
"data-next": next.id,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
66
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs font-medium tracking-wider uppercase", children: next.eyebrow }),
|
|
67
|
+
/* @__PURE__ */ jsx("h3", { className: "font-heading font-heading-title text-lg", children: next.title }),
|
|
68
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: next.detail })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsx("ol", { className: "flex flex-col gap-2", "data-test": "overview-checklist", children: next.checklist.map((item) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 text-sm", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
Icon,
|
|
73
|
+
{
|
|
74
|
+
name: item.done ? "check-circle" : "circle",
|
|
75
|
+
className: cn(
|
|
76
|
+
"size-4 shrink-0",
|
|
77
|
+
item.done ? "text-success" : "text-muted-foreground"
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
"span",
|
|
83
|
+
{
|
|
84
|
+
className: cn(item.done && "text-muted-foreground line-through"),
|
|
85
|
+
children: item.label
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: item.done ? "(done)" : "(to do)" })
|
|
89
|
+
] }, item.id)) }),
|
|
90
|
+
base ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
91
|
+
/* @__PURE__ */ jsxs(
|
|
92
|
+
Button,
|
|
93
|
+
{
|
|
94
|
+
nativeButton: false,
|
|
95
|
+
render: /* @__PURE__ */ jsx(
|
|
96
|
+
Link,
|
|
97
|
+
{
|
|
98
|
+
href: next.segment ? `${base}/${next.segment}` : base,
|
|
99
|
+
"data-test": "overview-primary"
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
children: [
|
|
103
|
+
next.action,
|
|
104
|
+
/* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
next.secondary ? /* @__PURE__ */ jsx(
|
|
109
|
+
Button,
|
|
110
|
+
{
|
|
111
|
+
variant: "ghost",
|
|
112
|
+
nativeButton: false,
|
|
113
|
+
render: /* @__PURE__ */ jsx(
|
|
114
|
+
Link,
|
|
115
|
+
{
|
|
116
|
+
href: `${base}/${next.secondary.segment}`,
|
|
117
|
+
"data-test": "overview-secondary"
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
children: next.secondary.label
|
|
121
|
+
}
|
|
122
|
+
) : null
|
|
123
|
+
] }) : null
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function QuickLink({
|
|
129
|
+
href,
|
|
130
|
+
icon,
|
|
131
|
+
title,
|
|
132
|
+
figure,
|
|
133
|
+
detail,
|
|
134
|
+
testId
|
|
135
|
+
}) {
|
|
136
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
137
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [
|
|
138
|
+
/* @__PURE__ */ jsx(Icon, { name: icon, className: "size-4" }),
|
|
139
|
+
title
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ jsx("span", { className: "font-heading font-heading-semibold text-2xl tracking-tight", children: figure }),
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: detail })
|
|
143
|
+
] });
|
|
144
|
+
return href ? /* @__PURE__ */ jsx(
|
|
145
|
+
Card,
|
|
146
|
+
{
|
|
147
|
+
layout: "bleed",
|
|
148
|
+
interactive: true,
|
|
149
|
+
render: /* @__PURE__ */ jsx(Link, { href }),
|
|
150
|
+
className: "flex min-w-0 flex-col gap-1 p-4",
|
|
151
|
+
"data-test": testId,
|
|
152
|
+
children: body
|
|
153
|
+
}
|
|
154
|
+
) : /* @__PURE__ */ jsx(
|
|
155
|
+
Card,
|
|
156
|
+
{
|
|
157
|
+
layout: "bleed",
|
|
158
|
+
className: "flex min-w-0 flex-col gap-1 p-4",
|
|
159
|
+
"data-test": testId,
|
|
160
|
+
children: body
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
function Overview({
|
|
165
|
+
integration,
|
|
166
|
+
contract
|
|
167
|
+
}) {
|
|
168
|
+
const slug = integration.integration;
|
|
169
|
+
const connection = useConnection(slug);
|
|
170
|
+
const runs = useRuns();
|
|
171
|
+
const health = useQuery({
|
|
172
|
+
queryKey: healthKey(slug),
|
|
173
|
+
queryFn: () => null,
|
|
174
|
+
enabled: false,
|
|
175
|
+
staleTime: Infinity,
|
|
176
|
+
gcTime: Infinity
|
|
177
|
+
});
|
|
178
|
+
const base = integrationConsoleHref(integration);
|
|
179
|
+
const link = (segment) => base ? `${base}/${segment}` : null;
|
|
180
|
+
const provenance = integration.provenance;
|
|
181
|
+
const realOverride = provenance.kind === "local" && provenance.scope !== "repo" && !integration.own;
|
|
182
|
+
const facts = connection.data?.facts ?? null;
|
|
183
|
+
const ownRuns = runs.data?.filter((run) => run.integration === slug);
|
|
184
|
+
const reads = contract.operations.filter((op) => op.effect === "read").length;
|
|
185
|
+
const writes = contract.operations.length - reads;
|
|
186
|
+
const next = facts ? overviewNext({
|
|
187
|
+
slug,
|
|
188
|
+
facts,
|
|
189
|
+
operations: contract.operations.length,
|
|
190
|
+
ran: (ownRuns?.length ?? 0) > 0
|
|
191
|
+
}) : null;
|
|
192
|
+
const registry = useOptionalHarnessRegistry();
|
|
193
|
+
const definition = registryEntryFor(registry, slug)?.definition;
|
|
194
|
+
const declared = definition ? definition.health !== void 0 : contract.health === true;
|
|
195
|
+
const healthCard = overviewHealthCard({
|
|
196
|
+
last: health.data ?? null,
|
|
197
|
+
declared,
|
|
198
|
+
slug
|
|
199
|
+
});
|
|
200
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-6", "data-test": "overview", children: [
|
|
201
|
+
next ? /* @__PURE__ */ jsx(NextAction, { next, base }) : connection.isError ? /* @__PURE__ */ jsxs("p", { className: "text-destructive text-sm", role: "alert", children: [
|
|
202
|
+
"Could not read the connection: ",
|
|
203
|
+
connection.error.message
|
|
204
|
+
] }) : /* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full rounded-lg" }),
|
|
205
|
+
/* @__PURE__ */ jsxs(
|
|
206
|
+
"nav",
|
|
207
|
+
{
|
|
208
|
+
"aria-label": `${slug} sections`,
|
|
209
|
+
className: "grid grid-cols-2 gap-3 lg:grid-cols-4",
|
|
210
|
+
"data-test": "overview-links",
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ jsx(
|
|
213
|
+
QuickLink,
|
|
214
|
+
{
|
|
215
|
+
href: link("operations"),
|
|
216
|
+
icon: "list",
|
|
217
|
+
title: "Operations",
|
|
218
|
+
figure: contract.operations.length,
|
|
219
|
+
detail: `${reads} read \xB7 ${writes} write`,
|
|
220
|
+
testId: "overview-link-operations"
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
/* @__PURE__ */ jsx(
|
|
224
|
+
QuickLink,
|
|
225
|
+
{
|
|
226
|
+
href: link("events"),
|
|
227
|
+
icon: "lightning",
|
|
228
|
+
title: "Events",
|
|
229
|
+
figure: contract.events.length,
|
|
230
|
+
detail: contract.events.length === 0 ? "None declared" : "Send a test event",
|
|
231
|
+
testId: "overview-link-events"
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ jsx(
|
|
235
|
+
QuickLink,
|
|
236
|
+
{
|
|
237
|
+
href: link("health"),
|
|
238
|
+
icon: "heartbeat",
|
|
239
|
+
title: "Health",
|
|
240
|
+
figure: /* @__PURE__ */ jsx("span", { className: cn(healthCard.long && "text-lg"), children: healthCard.figure }),
|
|
241
|
+
detail: healthCard.detail,
|
|
242
|
+
testId: "overview-link-health"
|
|
243
|
+
}
|
|
244
|
+
),
|
|
245
|
+
/* @__PURE__ */ jsx(
|
|
246
|
+
QuickLink,
|
|
247
|
+
{
|
|
248
|
+
href: link("runs"),
|
|
249
|
+
icon: "clock-counter-clockwise",
|
|
250
|
+
title: "Run log",
|
|
251
|
+
figure: ownRuns ? ownRuns.length : /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-10" }),
|
|
252
|
+
detail: ownRuns && ownRuns.length > 0 ? `${ownRuns.filter((run) => run.status !== "ok").length} refused or failed` : "No runs yet",
|
|
253
|
+
testId: "overview-link-runs"
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
),
|
|
259
|
+
/* @__PURE__ */ jsxs(
|
|
260
|
+
Card,
|
|
261
|
+
{
|
|
262
|
+
layout: "bleed",
|
|
263
|
+
render: /* @__PURE__ */ jsx("section", {}),
|
|
264
|
+
className: "flex min-w-0 flex-col gap-4 p-5",
|
|
265
|
+
"data-test": "overview-facts",
|
|
266
|
+
children: [
|
|
267
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center justify-between gap-3", children: [
|
|
268
|
+
/* @__PURE__ */ jsx("h3", { className: "font-heading font-heading-title text-base", children: "Details" }),
|
|
269
|
+
realOverride ? /* @__PURE__ */ jsx(StatusBadge, { tone: "warning", children: "Local override: this project cannot be published" }) : null
|
|
270
|
+
] }),
|
|
271
|
+
/* @__PURE__ */ jsxs("dl", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
272
|
+
/* @__PURE__ */ jsx(Fact, { label: "Integration", children: /* @__PURE__ */ jsx("code", { className: "font-mono", children: contract.integration }) }),
|
|
273
|
+
/* @__PURE__ */ jsxs(Fact, { label: "Loaded from", children: [
|
|
274
|
+
/* @__PURE__ */ jsx(
|
|
275
|
+
ProvenanceBadge,
|
|
276
|
+
{
|
|
277
|
+
provenance,
|
|
278
|
+
own: integration.own === true
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
/* @__PURE__ */ jsx(
|
|
282
|
+
"span",
|
|
283
|
+
{
|
|
284
|
+
className: "text-muted-foreground min-w-0 text-xs [overflow-wrap:anywhere]",
|
|
285
|
+
title: provenanceTitle(provenance),
|
|
286
|
+
children: describeProvenance(provenance)
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
] }),
|
|
290
|
+
/* @__PURE__ */ jsx(Fact, { label: "Connection", children: facts ? /* @__PURE__ */ jsx(ConnectionChip, { facts }) : /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-28" }) }),
|
|
291
|
+
/* @__PURE__ */ jsxs(Fact, { label: "Auth", children: [
|
|
292
|
+
CONNECTION_KIND_LABEL[contract.connection.auth === "oauth2" ? "oauth" : contract.connection.auth === "api_key" ? "keys" : "none"],
|
|
293
|
+
contract.connection.levels.length > 0 ? /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
294
|
+
"\xB7 ",
|
|
295
|
+
levelsLine(contract.connection.levels)
|
|
296
|
+
] }) : null
|
|
297
|
+
] }),
|
|
298
|
+
/* @__PURE__ */ jsxs(Fact, { label: "Run modes", testId: "supported-modes", children: [
|
|
299
|
+
runModesLine(integration.runModes),
|
|
300
|
+
integration.fixturesOnlyReason && !integration.runModes.includes("live") ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: integration.fixturesOnlyReason }) : null
|
|
301
|
+
] }),
|
|
302
|
+
/* @__PURE__ */ jsxs(Fact, { label: "Compat line", children: [
|
|
303
|
+
/* @__PURE__ */ jsx("code", { className: "font-mono", children: contract.version }),
|
|
304
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
|
|
305
|
+
"the version experiences pin \xB7 contract ",
|
|
306
|
+
contract.contractVersion
|
|
307
|
+
] })
|
|
308
|
+
] }),
|
|
309
|
+
/* @__PURE__ */ jsx(Fact, { label: "Contract digest", children: /* @__PURE__ */ jsx("div", { className: "w-full max-w-xl", children: /* @__PURE__ */ jsx(
|
|
310
|
+
CopyValue,
|
|
311
|
+
{
|
|
312
|
+
value: contract.digest,
|
|
313
|
+
label: "contract digest",
|
|
314
|
+
testId: "overview-digest"
|
|
315
|
+
}
|
|
316
|
+
) }) })
|
|
317
|
+
] })
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
] });
|
|
322
|
+
}
|
|
323
|
+
function overviewHealthCard(args) {
|
|
324
|
+
if (!hasHealthCheck(args)) {
|
|
325
|
+
return {
|
|
326
|
+
figure: "No check declared",
|
|
327
|
+
detail: "See how to add one",
|
|
328
|
+
long: true
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
if (args.last) {
|
|
332
|
+
return {
|
|
333
|
+
figure: healthVerdict(args).headline,
|
|
334
|
+
detail: "Last check this session",
|
|
335
|
+
long: args.last.kind === "error"
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
return { figure: "Not run", detail: "Run the check", long: false };
|
|
27
339
|
}
|
|
28
340
|
function IntegrationOverviewPage() {
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
own: integration.own === true
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ jsx(
|
|
42
|
-
"span",
|
|
43
|
-
{
|
|
44
|
-
className: "text-muted-foreground text-xs",
|
|
45
|
-
title: provenanceTitle(provenance),
|
|
46
|
-
children: describeProvenance(provenance)
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
] }),
|
|
50
|
-
/* @__PURE__ */ jsxs("dl", { className: "grid gap-5 sm:grid-cols-2", children: [
|
|
51
|
-
/* @__PURE__ */ jsx(Fact, { label: "Integration", children: /* @__PURE__ */ jsx("code", { children: contract.integration }) }),
|
|
52
|
-
/* @__PURE__ */ jsx(Fact, { label: "Version", children: /* @__PURE__ */ jsx("code", { children: contract.version }) }),
|
|
53
|
-
/* @__PURE__ */ jsx(Fact, { label: "Connection", children: /* @__PURE__ */ jsx(ConnectionFact, { integration: integration.integration }) }),
|
|
54
|
-
/* @__PURE__ */ jsxs(Fact, { label: "Auth", children: [
|
|
55
|
-
contract.connection.auth,
|
|
56
|
-
" \xB7",
|
|
57
|
-
" ",
|
|
58
|
-
contract.connection.levels.join(", ")
|
|
59
|
-
] }),
|
|
60
|
-
/* @__PURE__ */ jsxs(Fact, { label: "Operations", children: [
|
|
61
|
-
contract.operations.length,
|
|
62
|
-
" \xB7 ",
|
|
63
|
-
contract.events.length,
|
|
64
|
-
" event",
|
|
65
|
-
contract.events.length === 1 ? "" : "s"
|
|
66
|
-
] }),
|
|
67
|
-
/* @__PURE__ */ jsx(Fact, { label: "Contract", children: /* @__PURE__ */ jsxs("code", { children: [
|
|
68
|
-
contract.contractVersion,
|
|
69
|
-
" ",
|
|
70
|
-
shortDigest(contract.digest)
|
|
71
|
-
] }) })
|
|
72
|
-
] }),
|
|
73
|
-
/* @__PURE__ */ jsxs(
|
|
74
|
-
"p",
|
|
75
|
-
{
|
|
76
|
-
className: "text-muted-foreground text-xs",
|
|
77
|
-
"data-test": "supported-modes",
|
|
78
|
-
children: [
|
|
79
|
-
"Supports: ",
|
|
80
|
-
integration.runModes.join(", ")
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
),
|
|
84
|
-
realOverride ? /* @__PURE__ */ jsx(StatusBadge, { tone: "warning", children: "Local override: this project cannot be published" }) : null
|
|
85
|
-
] });
|
|
86
|
-
} });
|
|
341
|
+
return /* @__PURE__ */ jsx(
|
|
342
|
+
IntegrationScope,
|
|
343
|
+
{
|
|
344
|
+
title: "Overview",
|
|
345
|
+
description: (slug) => `Where ${slug} stands: what to do next, what its contract declares and where it is loaded from.`,
|
|
346
|
+
skeleton: /* @__PURE__ */ jsx(OverviewSkeleton, {}),
|
|
347
|
+
children: ({ integration, contract }) => /* @__PURE__ */ jsx(Overview, { integration, contract })
|
|
348
|
+
}
|
|
349
|
+
);
|
|
87
350
|
}
|
|
88
351
|
export {
|
|
89
352
|
IntegrationOverviewPage
|
|
@@ -2,11 +2,61 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useParams } from "next/navigation";
|
|
4
4
|
import { RunLog } from "../components/run-log.js";
|
|
5
|
+
import { RunLogEmpty } from "../components/run-log-empty.js";
|
|
6
|
+
import { useContract, useProject } from "../lib/console-hooks.js";
|
|
7
|
+
import {
|
|
8
|
+
integrationConsoleHref,
|
|
9
|
+
integrationForSlug
|
|
10
|
+
} from "../lib/integration-console-href.js";
|
|
11
|
+
import { runTargetHref } from "../lib/run-log-view.js";
|
|
12
|
+
import { useRunLogQuery } from "../lib/use-run-log-query.js";
|
|
5
13
|
function IntegrationRunsPage() {
|
|
6
14
|
const { slug } = useParams();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
const project = useProject();
|
|
16
|
+
const integration = project.data ? integrationForSlug(project.data.integrations, slug) : void 0;
|
|
17
|
+
const id = integration?.integration ?? slug;
|
|
18
|
+
const contract = useContract(id, { enabled: integration !== void 0 });
|
|
19
|
+
const [query, setQuery] = useRunLogQuery();
|
|
20
|
+
const base = integration ? integrationConsoleHref(integration) ?? `/integrations/${slug}` : `/integrations/${slug}`;
|
|
21
|
+
const hasEvents = (contract.data?.events.length ?? 0) > 0;
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", "data-test": "integration-runs", children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
24
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Run log" }),
|
|
25
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
26
|
+
"Every operation call and test event for ",
|
|
27
|
+
slug,
|
|
28
|
+
", newest first. Open a run to see its status, timing and where it came from."
|
|
29
|
+
] })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
RunLog,
|
|
33
|
+
{
|
|
34
|
+
integration: id,
|
|
35
|
+
query,
|
|
36
|
+
onQueryChange: setQuery,
|
|
37
|
+
targetHrefFor: (run) => runTargetHref(base, run.opKey),
|
|
38
|
+
empty: /* @__PURE__ */ jsx(
|
|
39
|
+
RunLogEmpty,
|
|
40
|
+
{
|
|
41
|
+
text: hasEvents ? "Calls from the operation runner, widgets, workflows and test events land here as they happen. Run an operation or send a test event to see one." : "Calls from the operation runner, widgets and workflows land here as they happen. Run an operation to see one.",
|
|
42
|
+
links: [
|
|
43
|
+
{
|
|
44
|
+
href: `${base}/operations`,
|
|
45
|
+
label: "Run an operation",
|
|
46
|
+
testId: "run-log-empty-operations"
|
|
47
|
+
},
|
|
48
|
+
...hasEvents ? [
|
|
49
|
+
{
|
|
50
|
+
href: `${base}/events`,
|
|
51
|
+
label: "Send a test event",
|
|
52
|
+
testId: "run-log-empty-events"
|
|
53
|
+
}
|
|
54
|
+
] : []
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
)
|
|
10
60
|
] });
|
|
11
61
|
}
|
|
12
62
|
export {
|
|
@@ -5,8 +5,21 @@ export interface IntegrationScopeValue {
|
|
|
5
5
|
integration: ConsoleIntegration;
|
|
6
6
|
contract: ConsoleContract;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
export declare function
|
|
8
|
+
/** A console tab's heading: its title, then one sentence on what it is for. */
|
|
9
|
+
export declare function TabHeader({ title, description, }: {
|
|
10
10
|
title: string;
|
|
11
|
+
description: ReactNode;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the `[slug]` segment to its integration and contract, or 404s, and
|
|
15
|
+
* opens the tab with its title and one-line description. While the contract
|
|
16
|
+
* loads it draws a skeleton shaped like the page.
|
|
17
|
+
*/
|
|
18
|
+
export declare function IntegrationScope({ title, description, skeleton, children, }: {
|
|
19
|
+
title: string;
|
|
20
|
+
/** One sentence: what this tab is for. */
|
|
21
|
+
description: (slug: string) => ReactNode;
|
|
22
|
+
/** The shape of the page while it loads; a heading over rows by default. */
|
|
23
|
+
skeleton?: ReactNode;
|
|
11
24
|
children: (scope: IntegrationScopeValue) => ReactNode;
|
|
12
25
|
}): import("react").JSX.Element;
|
|
@@ -1,32 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { Alert, AlertDescription } from "@ekanos/ui/alert";
|
|
3
|
+
import { useParams } from "next/navigation";
|
|
4
|
+
import { Alert, AlertDescription, AlertTitle } from "@ekanos/ui/alert";
|
|
5
|
+
import { IntegrationNotFound } from "../components/console-not-found.js";
|
|
6
|
+
import { PageSkeleton } from "../components/page-skeletons.js";
|
|
5
7
|
import { useContract, useProject } from "../lib/console-hooks.js";
|
|
8
|
+
import { integrationForSlug } from "../lib/integration-console-href.js";
|
|
9
|
+
function TabHeader({
|
|
10
|
+
title,
|
|
11
|
+
description
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-1", "data-test": "tab-header", children: [
|
|
14
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: title }),
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
"p",
|
|
17
|
+
{
|
|
18
|
+
className: "text-muted-foreground text-sm",
|
|
19
|
+
"data-test": "tab-header-description",
|
|
20
|
+
children: description
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
] });
|
|
24
|
+
}
|
|
6
25
|
function IntegrationScope({
|
|
7
26
|
title,
|
|
27
|
+
description,
|
|
28
|
+
skeleton,
|
|
8
29
|
children
|
|
9
30
|
}) {
|
|
10
31
|
const { slug } = useParams();
|
|
11
32
|
const project = useProject();
|
|
12
|
-
const integration = project.data
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (project.data && !integration)
|
|
17
|
-
if (
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
"Could not load
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
33
|
+
const integration = project.data ? integrationForSlug(project.data.integrations, slug) : void 0;
|
|
34
|
+
const contract = useContract(integration?.integration ?? slug, {
|
|
35
|
+
enabled: integration !== void 0
|
|
36
|
+
});
|
|
37
|
+
if (project.data && !integration) return /* @__PURE__ */ jsx(IntegrationNotFound, { slug });
|
|
38
|
+
if (project.isError) {
|
|
39
|
+
return /* @__PURE__ */ jsxs(Alert, { variant: "destructive", "data-test": "project-error", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Could not load this project" }),
|
|
41
|
+
/* @__PURE__ */ jsxs(AlertDescription, { children: [
|
|
42
|
+
project.error.message,
|
|
43
|
+
". Check the terminal running",
|
|
44
|
+
" ",
|
|
45
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
46
|
+
" for the error, then reload this page."
|
|
47
|
+
] })
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
if (integration && contract.isError) {
|
|
51
|
+
return /* @__PURE__ */ jsxs(Alert, { variant: "destructive", "data-test": "contract-error", children: [
|
|
52
|
+
/* @__PURE__ */ jsxs(AlertTitle, { children: [
|
|
53
|
+
"Could not load the ",
|
|
54
|
+
slug,
|
|
55
|
+
" contract"
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ jsxs(AlertDescription, { children: [
|
|
58
|
+
contract.error.message,
|
|
59
|
+
". Check the terminal running",
|
|
60
|
+
" ",
|
|
61
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
62
|
+
" for the error (a definition that does not build is the usual cause), then reload this page."
|
|
63
|
+
] })
|
|
64
|
+
] });
|
|
24
65
|
}
|
|
25
66
|
if (!project.data || !integration || !contract.data) {
|
|
26
|
-
return /* @__PURE__ */ jsx("
|
|
67
|
+
return /* @__PURE__ */ jsx("div", { "aria-busy": "true", "data-test": "integration-scope-loading", children: skeleton ?? /* @__PURE__ */ jsx(PageSkeleton, { label: `Loading ${title}` }) });
|
|
27
68
|
}
|
|
28
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", "data-test": `page-${title}`, children: [
|
|
29
|
-
/* @__PURE__ */ jsx(
|
|
69
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-6", "data-test": `page-${title}`, children: [
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
TabHeader,
|
|
72
|
+
{
|
|
73
|
+
title,
|
|
74
|
+
description: description(integration.integration)
|
|
75
|
+
}
|
|
76
|
+
),
|
|
30
77
|
children({
|
|
31
78
|
project: project.data,
|
|
32
79
|
integration,
|
|
@@ -35,5 +82,6 @@ function IntegrationScope({
|
|
|
35
82
|
] });
|
|
36
83
|
}
|
|
37
84
|
export {
|
|
38
|
-
IntegrationScope
|
|
85
|
+
IntegrationScope,
|
|
86
|
+
TabHeader
|
|
39
87
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { redirect } from "next/navigation";
|
|
3
3
|
import { previewHref, previewSections } from "../lib/preview-sections.js";
|
|
4
4
|
import { useHarnessIntegration } from "../registry-context.js";
|
|
5
5
|
function PreviewIndexPage() {
|
|
6
6
|
const integration = useHarnessIntegration();
|
|
7
|
-
if (!integration)
|
|
7
|
+
if (!integration) return null;
|
|
8
8
|
const [first] = previewSections(integration);
|
|
9
9
|
if (!first) return null;
|
|
10
10
|
redirect(previewHref(integration.slug, first.segment));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** "This repo": every integration and experience `ekanos dev` is serving. */
|
|
2
|
-
export declare function RepoHomePage(): import("react").JSX.Element;
|
|
1
|
+
/** "This repo": what to do first, then every integration and experience `ekanos dev` is serving. */
|
|
2
|
+
export declare function RepoHomePage(): import("react").JSX.Element | null;
|