@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
|
@@ -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(
|
|
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__ */
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Workflows" }),
|
|
34
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Each workflow 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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
39
|
+
icon: "flow-arrow",
|
|
40
|
+
title: "No workflows yet",
|
|
41
|
+
action: /* @__PURE__ */ jsx(DocsLink, { href: DOCS.workflows, children: "Write a workflow" }),
|
|
21
42
|
children: [
|
|
22
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 {
|
|
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 {
|
|
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)
|
|
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(
|
|
9
|
-
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
IntegrationScope,
|
|
10
12
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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(
|
|
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__ */
|
|
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
|
-
|
|
77
|
-
|
|
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
|
}
|
|
@@ -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(
|
|
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
|
|
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 {
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|