@ekanos/harness 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/api-types.d.ts +4 -0
- package/dist/internal/components/approvals-tray.d.ts +44 -6
- package/dist/internal/components/approvals-tray.js +252 -30
- 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 +115 -10
- 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 -3
- package/dist/internal/components/surface-nav.js +72 -83
- 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 +28 -0
- package/dist/internal/lib/docs-links.js +57 -1
- package/dist/internal/lib/event-delivery.d.ts +33 -0
- package/dist/internal/lib/event-delivery.js +66 -0
- package/dist/internal/lib/experience-runtime.d.ts +2 -1
- package/dist/internal/lib/experience-runtime.js +5 -3
- 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 +15 -0
- package/dist/internal/lib/integration-console-href.js +16 -0
- 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 +51 -22
- package/dist/internal/routes/experience-layout-page.js +75 -26
- package/dist/internal/routes/experience-page-host.js +63 -5
- 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 +219 -62
- 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 +428 -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/internal/server/ekanos-api-router.js +20 -5
- package/dist/internal/server/repo-api-router.js +20 -7
- package/dist/registry.d.ts +4 -5
- package/dist/registry.js +0 -1
- package/dist/routes.d.ts +5 -0
- package/dist/routes.js +2 -0
- package/package.json +8 -8
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type RepoClient } from '../lib/console-client.js';
|
|
3
|
+
/** The repo home's header and content column. Mount under `RepoProviders`. */
|
|
4
|
+
export declare function RepoFrame({ children }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* An `/integrations/<name>` or `/experiences/<name>` this repo has no package
|
|
9
|
+
* for, in the repo's own frame, listing the packages it does have.
|
|
10
|
+
*/
|
|
11
|
+
export declare function RepoNotFound({ kind, name, }: {
|
|
12
|
+
kind: 'integration' | 'experience';
|
|
13
|
+
name: string;
|
|
14
|
+
}): import("react").JSX.Element | null;
|
|
3
15
|
/** The layout of the repo home: `ekanos dev` at a repo root. */
|
|
4
16
|
export declare function RepoLayout({ children, client, }: {
|
|
5
17
|
children: ReactNode;
|
|
@@ -1,46 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
import { usePathname } from "next/navigation";
|
|
5
3
|
import { Alert, AlertDescription } from "@ekanos/ui/alert";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import {
|
|
5
|
+
NotFoundState
|
|
6
|
+
} from "../components/not-found-state.js";
|
|
7
|
+
import { PageSkeleton } from "../components/page-skeletons.js";
|
|
8
|
+
import { ShellHeader } from "../components/shell-header.js";
|
|
9
9
|
import { RepoProviders, useRepo } from "../lib/repo-context.js";
|
|
10
|
-
|
|
11
|
-
function repoName(root) {
|
|
12
|
-
return root.split(/[\\/]/).filter(Boolean).pop() ?? root;
|
|
13
|
-
}
|
|
10
|
+
import { repoName } from "../lib/repo-name.js";
|
|
14
11
|
function RepoFrame({ children }) {
|
|
15
12
|
const repo = useRepo();
|
|
16
|
-
const pathname = usePathname();
|
|
17
13
|
return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen flex-col", "data-test": "repo-frame", children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return /* @__PURE__ */ jsxs(
|
|
26
|
-
Link,
|
|
27
|
-
{
|
|
28
|
-
href: tab.href,
|
|
29
|
-
"aria-current": active ? "page" : void 0,
|
|
30
|
-
className: cn(
|
|
31
|
-
"flex items-center gap-2 rounded-md px-3 py-2 whitespace-nowrap transition-colors",
|
|
32
|
-
FOCUS_RING,
|
|
33
|
-
active ? "bg-accent text-accent-foreground text-sm font-medium" : "text-muted-foreground hover:bg-accent text-sm"
|
|
34
|
-
),
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ jsx(Icon, { name: tab.icon, className: "h-4 w-4" }),
|
|
37
|
-
tab.label
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
tab.href
|
|
41
|
-
);
|
|
42
|
-
}) })
|
|
43
|
-
] }),
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
ShellHeader,
|
|
16
|
+
{
|
|
17
|
+
title: repo.data ? repoName(repo.data.root) : "This repo",
|
|
18
|
+
kind: "repo"
|
|
19
|
+
}
|
|
20
|
+
),
|
|
44
21
|
/* @__PURE__ */ jsxs(
|
|
45
22
|
"main",
|
|
46
23
|
{
|
|
@@ -50,7 +27,10 @@ function RepoFrame({ children }) {
|
|
|
50
27
|
children: [
|
|
51
28
|
repo.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", "data-test": "repo-error", children: /* @__PURE__ */ jsxs(AlertDescription, { children: [
|
|
52
29
|
"Could not reach the harness server: ",
|
|
53
|
-
repo.error.message
|
|
30
|
+
repo.error.message,
|
|
31
|
+
". Check that ",
|
|
32
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
33
|
+
" is still running, then reload."
|
|
54
34
|
] }) }) : null,
|
|
55
35
|
repo.data && repo.data.problems.length > 0 ? /* @__PURE__ */ jsx(Alert, { variant: "warning", "data-test": "repo-problems", children: /* @__PURE__ */ jsx(AlertDescription, { children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1", children: repo.data.problems.map((problem) => /* @__PURE__ */ jsxs("li", { children: [
|
|
56
36
|
/* @__PURE__ */ jsx("code", { children: problem.where }),
|
|
@@ -63,6 +43,36 @@ function RepoFrame({ children }) {
|
|
|
63
43
|
)
|
|
64
44
|
] });
|
|
65
45
|
}
|
|
46
|
+
function RepoNotFound({
|
|
47
|
+
kind,
|
|
48
|
+
name
|
|
49
|
+
}) {
|
|
50
|
+
const repo = useRepo();
|
|
51
|
+
if (!repo.data) {
|
|
52
|
+
return repo.isError ? null : /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading the repo" });
|
|
53
|
+
}
|
|
54
|
+
const options = kind === "integration" ? repo.data.integrations.map((row) => ({
|
|
55
|
+
label: row.name,
|
|
56
|
+
href: row.consoleHref,
|
|
57
|
+
hint: `v${row.version}`
|
|
58
|
+
})) : repo.data.experiences.map((row) => ({
|
|
59
|
+
label: row.name,
|
|
60
|
+
href: row.viewHref,
|
|
61
|
+
hint: `v${row.version}`
|
|
62
|
+
}));
|
|
63
|
+
const plural = kind === "integration" ? "integrations" : "experiences";
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
NotFoundState,
|
|
66
|
+
{
|
|
67
|
+
testId: `${kind}-not-found`,
|
|
68
|
+
title: `No ${kind} called \u201C${name}\u201D`,
|
|
69
|
+
description: options.length > 0 ? `This repo has no ${kind} package named ${name}. Pick one of its ${plural}, or check the name in the address.` : `This repo has no ${plural} yet, so there is nothing at this address.`,
|
|
70
|
+
options,
|
|
71
|
+
...options.length > 0 ? { optionsLabel: `The ${plural} in this repo` } : {},
|
|
72
|
+
action: { label: "Back to the repo home", href: "/" }
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
66
76
|
function RepoLayout({
|
|
67
77
|
children,
|
|
68
78
|
client
|
|
@@ -70,5 +80,7 @@ function RepoLayout({
|
|
|
70
80
|
return /* @__PURE__ */ jsx(RepoProviders, { ...client ? { client } : {}, children: /* @__PURE__ */ jsx(RepoFrame, { children }) });
|
|
71
81
|
}
|
|
72
82
|
export {
|
|
73
|
-
|
|
83
|
+
RepoFrame,
|
|
84
|
+
RepoLayout,
|
|
85
|
+
RepoNotFound
|
|
74
86
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
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
|
+
import { HeaderSkeleton, PageSkeleton } from "../components/page-skeletons.js";
|
|
5
6
|
import { createHttpConsoleClient, packageApiBase } from "../lib/console-client.js";
|
|
6
7
|
import { RepoProviders, useRepo } from "../lib/repo-context.js";
|
|
8
|
+
import { RepoNameProvider, repoName } from "../lib/repo-name.js";
|
|
7
9
|
import { ConsoleLayout } from "./integrations-layout.js";
|
|
10
|
+
import { RepoFrame, RepoNotFound } from "./repo-layout.js";
|
|
8
11
|
const REPO_HOME = "/";
|
|
9
12
|
function RepoExperienceLayout({
|
|
10
13
|
children,
|
|
@@ -22,8 +25,10 @@ function RepoExperienceLayout({
|
|
|
22
25
|
() => ({ experience: `/experiences/${name}`, repoHome: REPO_HOME }),
|
|
23
26
|
[name]
|
|
24
27
|
);
|
|
25
|
-
if (!surfaces)
|
|
26
|
-
|
|
28
|
+
if (!surfaces) {
|
|
29
|
+
return /* @__PURE__ */ jsx(RepoProviders, { children: /* @__PURE__ */ jsx(RepoFrame, { children: /* @__PURE__ */ jsx(RepoNotFound, { kind: "experience", name: decodeURIComponent(name) }) }) });
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ jsx(RepoProviders, { children: /* @__PURE__ */ jsx(WithRepoName, { children: /* @__PURE__ */ jsx(
|
|
27
32
|
ConsoleLayout,
|
|
28
33
|
{
|
|
29
34
|
client: resolved,
|
|
@@ -32,7 +37,11 @@ function RepoExperienceLayout({
|
|
|
32
37
|
apiBase: base,
|
|
33
38
|
children
|
|
34
39
|
}
|
|
35
|
-
);
|
|
40
|
+
) }) });
|
|
41
|
+
}
|
|
42
|
+
function WithRepoName({ children }) {
|
|
43
|
+
const repo = useRepo();
|
|
44
|
+
return /* @__PURE__ */ jsx(RepoNameProvider, { name: repo.data ? repoName(repo.data.root) : null, children });
|
|
36
45
|
}
|
|
37
46
|
function IntegrationScopeLayout({
|
|
38
47
|
children,
|
|
@@ -47,14 +56,19 @@ function IntegrationScopeLayout({
|
|
|
47
56
|
] });
|
|
48
57
|
}
|
|
49
58
|
if (!repo.data) {
|
|
50
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen flex-col", children: [
|
|
60
|
+
/* @__PURE__ */ jsx(HeaderSkeleton, {}),
|
|
61
|
+
/* @__PURE__ */ jsx("main", { className: "mx-auto w-full max-w-5xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading the integration" }) })
|
|
62
|
+
] });
|
|
51
63
|
}
|
|
52
64
|
const own = repo.data.integrations.some((row) => row.name === slug);
|
|
53
65
|
const host = own ? null : repo.data.experiences.find(
|
|
54
66
|
(experience) => experience.integrations.some((used) => used.name === slug)
|
|
55
67
|
);
|
|
56
|
-
if (!own && !host)
|
|
57
|
-
|
|
68
|
+
if (!own && !host) {
|
|
69
|
+
return /* @__PURE__ */ jsx(RepoFrame, { children: /* @__PURE__ */ jsx(RepoNotFound, { kind: "integration", name: decodeURIComponent(slug) }) });
|
|
70
|
+
}
|
|
71
|
+
return /* @__PURE__ */ jsx(RepoNameProvider, { name: repoName(repo.data.root), children: /* @__PURE__ */ jsx(
|
|
58
72
|
ScopedConsole,
|
|
59
73
|
{
|
|
60
74
|
base: packageApiBase(
|
|
@@ -65,7 +79,7 @@ function IntegrationScopeLayout({
|
|
|
65
79
|
...client ? { client } : {},
|
|
66
80
|
children
|
|
67
81
|
}
|
|
68
|
-
);
|
|
82
|
+
) });
|
|
69
83
|
}
|
|
70
84
|
function ScopedConsole({
|
|
71
85
|
base,
|
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { notFound } from "next/navigation";
|
|
4
3
|
import { findWidget } from "../../registry.js";
|
|
4
|
+
import { NotFoundState } from "../components/not-found-state.js";
|
|
5
5
|
import {
|
|
6
6
|
WidgetSurface,
|
|
7
7
|
withFocusedDefault
|
|
8
8
|
} from "../components/widget-surface.js";
|
|
9
|
+
import { previewHref } from "../lib/preview-sections.js";
|
|
9
10
|
import { useHarnessIntegration, useHarnessWidgetId } from "../registry-context.js";
|
|
10
11
|
function SingleWidgetPage() {
|
|
11
12
|
const integration = useHarnessIntegration();
|
|
12
13
|
const widgetId = useHarnessWidgetId();
|
|
13
|
-
if (!integration)
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
if (!integration) return null;
|
|
15
|
+
const id = decodeURIComponent(widgetId);
|
|
16
|
+
const widget = findWidget(integration, id);
|
|
17
|
+
const allHref = previewHref(integration.slug, "widgets");
|
|
18
|
+
if (!widget) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
NotFoundState,
|
|
21
|
+
{
|
|
22
|
+
testId: "widget-not-found",
|
|
23
|
+
title: `No widget called \u201C${id}\u201D`,
|
|
24
|
+
description: `${integration.name} registers no widget with that id. Pick one it does register.`,
|
|
25
|
+
options: integration.widgets.map((entry) => ({
|
|
26
|
+
label: entry.id,
|
|
27
|
+
href: previewHref(
|
|
28
|
+
integration.slug,
|
|
29
|
+
`widgets/${encodeURIComponent(entry.id)}`
|
|
30
|
+
),
|
|
31
|
+
hint: entry.title
|
|
32
|
+
})),
|
|
33
|
+
...integration.widgets.length > 0 ? { optionsLabel: `The widgets ${integration.name} registers` } : {},
|
|
34
|
+
action: { label: "All widgets", href: allHref }
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
16
38
|
return /* @__PURE__ */ jsx("div", { className: "min-w-0", "data-test": "single-widget", children: /* @__PURE__ */ jsx(
|
|
17
39
|
WidgetSurface,
|
|
18
40
|
{
|
|
19
41
|
widgets: [withFocusedDefault(widget)],
|
|
20
|
-
productSlug: integration.slug
|
|
42
|
+
productSlug: integration.slug,
|
|
43
|
+
controls: true
|
|
21
44
|
}
|
|
22
45
|
) });
|
|
23
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function TilePage(): import("react").JSX.Element;
|
|
1
|
+
export declare function TilePage(): import("react").JSX.Element | null;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { notFound } from "next/navigation";
|
|
4
3
|
import { Card } from "@ekanos/ui/card";
|
|
5
4
|
import { HARNESS_ACCOUNT_ID } from "../../registry.js";
|
|
6
5
|
import { ViewportFrame } from "../components/viewport-frame.js";
|
|
@@ -19,7 +18,7 @@ const NEIGHBOURS = [
|
|
|
19
18
|
];
|
|
20
19
|
function TilePage() {
|
|
21
20
|
const integration = useHarnessIntegration();
|
|
22
|
-
if (!integration)
|
|
21
|
+
if (!integration) return null;
|
|
23
22
|
const Tile = integration.tile;
|
|
24
23
|
return /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-col gap-6", "data-test": "tile", children: Tile ? /* @__PURE__ */ jsx(ViewportFrame, { children: /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-4", children: [
|
|
25
24
|
/* @__PURE__ */ jsxs("header", { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function WidgetsPage(): import("react").JSX.Element;
|
|
1
|
+
export declare function WidgetsPage(): import("react").JSX.Element | null;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { notFound } from "next/navigation";
|
|
4
3
|
import { WidgetSurface } from "../components/widget-surface.js";
|
|
4
|
+
import { previewHref } from "../lib/preview-sections.js";
|
|
5
5
|
import { useHarnessIntegration } from "../registry-context.js";
|
|
6
6
|
function WidgetsPage() {
|
|
7
7
|
const integration = useHarnessIntegration();
|
|
8
|
-
if (!integration)
|
|
8
|
+
if (!integration) return null;
|
|
9
9
|
return /* @__PURE__ */ jsx("div", { className: "min-w-0", "data-test": "widgets", children: integration.widgets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "This integration registers no widgets." }) : /* @__PURE__ */ jsx(
|
|
10
10
|
WidgetSurface,
|
|
11
11
|
{
|
|
12
12
|
widgets: integration.widgets,
|
|
13
|
-
productSlug: integration.slug
|
|
13
|
+
productSlug: integration.slug,
|
|
14
|
+
controls: true,
|
|
15
|
+
widgetHref: (id) => previewHref(integration.slug, `widgets/${encodeURIComponent(id)}`)
|
|
14
16
|
}
|
|
15
17
|
) });
|
|
16
18
|
}
|
|
@@ -37,7 +37,6 @@ import {
|
|
|
37
37
|
import { isPinnedToFixtures, setPinnedToFixtures } from "./local-state.js";
|
|
38
38
|
import { loopbackRefusal, isLoopbackHost } from "./loopback-guard.js";
|
|
39
39
|
import { describeOAuthConnections } from "./oauth-connections.js";
|
|
40
|
-
import { hasStoredOauthConnection } from "./oauth-persistence.js";
|
|
41
40
|
import {
|
|
42
41
|
createFileFixtureSource,
|
|
43
42
|
runOperation
|
|
@@ -230,16 +229,32 @@ function createEkanosApiRouter(partial = {}) {
|
|
|
230
229
|
});
|
|
231
230
|
}
|
|
232
231
|
const usesOauth = Boolean(definition.oauth) || Object.keys(definition.oauthConnections ?? {}).length > 0;
|
|
233
|
-
const
|
|
232
|
+
const oauthHeld = usesOauth && describeOAuthConnections({
|
|
233
|
+
definition,
|
|
234
|
+
filled: Object.keys(secrets.values),
|
|
235
|
+
values: secrets.values,
|
|
236
|
+
held: getLiveStore().get(definition.slug),
|
|
237
|
+
stored: readOauthConnections({
|
|
238
|
+
projectRoot: integration.credentialRoot,
|
|
239
|
+
slug: definition.slug
|
|
240
|
+
}),
|
|
241
|
+
personal: {
|
|
242
|
+
slug: definition.slug,
|
|
243
|
+
switches: readConsoleSwitches(integration.credentialRoot),
|
|
244
|
+
stored: readPersonTier({
|
|
245
|
+
projectRoot: integration.credentialRoot,
|
|
246
|
+
slug: definition.slug,
|
|
247
|
+
userId: HARNESS_USER_ID
|
|
248
|
+
}).oauth
|
|
249
|
+
}
|
|
250
|
+
}).some((connection) => connection.connected);
|
|
234
251
|
return deriveConnectionFacts({
|
|
235
252
|
...base,
|
|
236
253
|
usesOauth,
|
|
237
254
|
declared: names,
|
|
238
255
|
missing: secrets.missing,
|
|
239
256
|
activationFieldsSet: Object.keys(secrets.activation),
|
|
240
|
-
oauthHeld
|
|
241
|
-
held && (held.connection || Object.keys(held.connections).length > 0)
|
|
242
|
-
) || hasStoredOauthConnection(integration.credentialRoot, definition.slug),
|
|
257
|
+
oauthHeld,
|
|
243
258
|
manageable: true,
|
|
244
259
|
target: selectConnectionTarget(secrets.activation, names)
|
|
245
260
|
});
|
|
@@ -120,7 +120,10 @@ function createRepoApiRouter(partial) {
|
|
|
120
120
|
declared: data?.declared ?? [],
|
|
121
121
|
missing: data?.missing ?? [],
|
|
122
122
|
activationFieldsSet: data?.activationFieldsSet ?? [],
|
|
123
|
-
|
|
123
|
+
// The package reports each OAuth connection in the tier it connects
|
|
124
|
+
// into (a `level: 'user'` one is the person's); fall back to any held
|
|
125
|
+
// token only for a package that does not report them.
|
|
126
|
+
oauthHeld: manageable && (data?.oauth ?? contractAuth === "oauth2") && (data?.oauthConnections ? data.oauthConnections.some((connection) => connection.connected) : hasOauthConnection(pkg.name, pkg.dir)),
|
|
124
127
|
manageable,
|
|
125
128
|
target: data?.target ?? [],
|
|
126
129
|
supportsLive: manageable,
|
|
@@ -177,7 +180,7 @@ function createRepoApiRouter(partial) {
|
|
|
177
180
|
return failed(error instanceof Error ? error.message : String(error));
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
|
-
async function experienceRow(request, pkg, connections,
|
|
183
|
+
async function experienceRow(request, pkg, connections, repoPackageName) {
|
|
181
184
|
const row = {
|
|
182
185
|
name: pkg.name,
|
|
183
186
|
version: pkg.version,
|
|
@@ -192,10 +195,11 @@ function createRepoApiRouter(partial) {
|
|
|
192
195
|
}
|
|
193
196
|
const integrations = [];
|
|
194
197
|
for (const view of resolved.data.integrations) {
|
|
195
|
-
const
|
|
198
|
+
const local = repoPackageName(view.integration);
|
|
199
|
+
const sameRepo = local !== null;
|
|
196
200
|
let connection = null;
|
|
197
201
|
if (sameRepo) {
|
|
198
|
-
connection = connections.get(
|
|
202
|
+
connection = connections.get(local) ?? null;
|
|
199
203
|
} else {
|
|
200
204
|
const contract = await call(request, pkg, [
|
|
201
205
|
"contract",
|
|
@@ -233,7 +237,9 @@ function createRepoApiRouter(partial) {
|
|
|
233
237
|
...unsupported.length > 0 ? {
|
|
234
238
|
levelProblem: `Asks for ${unsupported.join(", ")} but ${view.integration} supports ${supported.join(", ") || "no level"}.`
|
|
235
239
|
} : {},
|
|
236
|
-
connectHref: sameRepo ? `/integrations/${
|
|
240
|
+
connectHref: sameRepo ? `/integrations/${local}/connect` : null,
|
|
241
|
+
consoleHref: sameRepo ? `/integrations/${local}` : null,
|
|
242
|
+
packageName: local
|
|
237
243
|
});
|
|
238
244
|
}
|
|
239
245
|
return { ...row, integrations };
|
|
@@ -247,6 +253,11 @@ function createRepoApiRouter(partial) {
|
|
|
247
253
|
(p) => p.kind === "experience"
|
|
248
254
|
);
|
|
249
255
|
const repoNames = new Set(integrationPackages.map((p) => p.name));
|
|
256
|
+
const repoPackageName = (integration) => {
|
|
257
|
+
const slash = integration.lastIndexOf("/");
|
|
258
|
+
const name = slash === -1 ? integration : integration.slice(0, slash) === repo.namespace ? integration.slice(slash + 1) : null;
|
|
259
|
+
return name !== null && repoNames.has(name) ? name : null;
|
|
260
|
+
};
|
|
250
261
|
const connections = /* @__PURE__ */ new Map();
|
|
251
262
|
const integrations = [];
|
|
252
263
|
for (const pkg of integrationPackages) {
|
|
@@ -257,12 +268,14 @@ function createRepoApiRouter(partial) {
|
|
|
257
268
|
const experiences = [];
|
|
258
269
|
for (const pkg of experiencePackages) {
|
|
259
270
|
experiences.push(
|
|
260
|
-
await experienceRow(request, pkg, connections,
|
|
271
|
+
await experienceRow(request, pkg, connections, repoPackageName)
|
|
261
272
|
);
|
|
262
273
|
}
|
|
263
274
|
for (const experience of experiences) {
|
|
264
275
|
for (const used of experience.integrations) {
|
|
265
|
-
|
|
276
|
+
if (!used.sameRepo) continue;
|
|
277
|
+
const local = repoPackageName(used.name);
|
|
278
|
+
integrations.find((row) => row.name === local)?.usedBy.push(experience.name);
|
|
266
279
|
}
|
|
267
280
|
}
|
|
268
281
|
const connectable = integrations.filter(
|
package/dist/registry.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export interface HarnessWidget {
|
|
|
85
85
|
size?: 'compact' | 'half' | 'full';
|
|
86
86
|
/** Same as an integration widget's `layouts`; the grid reads `lg.w` and `lg.maxHeight`. */
|
|
87
87
|
layouts?: WidgetLayouts;
|
|
88
|
+
/** @deprecated Ignored: widgets no longer collapse. */
|
|
88
89
|
isCollapsible?: boolean;
|
|
89
90
|
isPinnable?: boolean;
|
|
90
91
|
/** Renders the "Ask about this" AI footer bar. */
|
|
@@ -454,12 +455,10 @@ export declare function asHarnessDefinition<Schemas extends StorageSchemas>(defi
|
|
|
454
455
|
* DERIVE THE WIDGET LIST FROM THE DEFINITION YOU ALREADY WROTE
|
|
455
456
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
456
457
|
*
|
|
457
|
-
* `HarnessWidget` restates `id`, `title`, `component`, `
|
|
458
|
-
* `
|
|
458
|
+
* `HarnessWidget` restates `id`, `title`, `component`, `isPinnable` and
|
|
459
|
+
* `aiFooterEnabled` — every one of which is already in
|
|
459
460
|
* `defineIntegration({ components: { widgets } })`. Writing both by hand means
|
|
460
|
-
* two declarations of the same thing with nothing detecting drift
|
|
461
|
-
* how `isCollapsible` came to be declared in one place and read from the
|
|
462
|
-
* other.
|
|
461
|
+
* two declarations of the same thing with nothing detecting drift.
|
|
463
462
|
*
|
|
464
463
|
* This derives the harness entry from the definition, so the definition stays
|
|
465
464
|
* the single source and the harness entry adds only what is genuinely
|
package/dist/registry.js
CHANGED
|
@@ -26,7 +26,6 @@ function harnessWidgetsFromDefinition(definition, overrides = {}) {
|
|
|
26
26
|
// Chrome flags come from the definition and are passed through ONLY when
|
|
27
27
|
// it declares them, so an undeclared flag still lands on the host's
|
|
28
28
|
// default rather than one invented here.
|
|
29
|
-
...widget.isCollapsible === void 0 ? {} : { isCollapsible: widget.isCollapsible },
|
|
30
29
|
...widget.isPinnable === void 0 ? {} : { isPinnable: widget.isPinnable },
|
|
31
30
|
...widget.aiFooterEnabled === void 0 ? {} : { aiFooterEnabled: widget.aiFooterEnabled },
|
|
32
31
|
...override
|
package/dist/routes.d.ts
CHANGED
|
@@ -88,3 +88,8 @@ export { RepoHomePage } from './internal/routes/repo-home-page.js';
|
|
|
88
88
|
export { RepoConnectionsPage } from './internal/routes/repo-connections-page.js';
|
|
89
89
|
export { ExperienceConnectPage } from './internal/routes/experience-connect-page.js';
|
|
90
90
|
export { RepoExperienceLayout, RepoIntegrationLayout, } from './internal/routes/repo-package-layouts.js';
|
|
91
|
+
/**
|
|
92
|
+
* The shell's `app/not-found.tsx`: an address no route matches, in the
|
|
93
|
+
* harness's own header with a way home, instead of the framework's bare 404.
|
|
94
|
+
*/
|
|
95
|
+
export { NotFoundPage } from './internal/components/not-found-state.js';
|
package/dist/routes.js
CHANGED
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
RepoExperienceLayout,
|
|
38
38
|
RepoIntegrationLayout
|
|
39
39
|
} from "./internal/routes/repo-package-layouts.js";
|
|
40
|
+
import { NotFoundPage } from "./internal/components/not-found-state.js";
|
|
40
41
|
export {
|
|
41
42
|
ActivationPage,
|
|
42
43
|
ConsoleHomePage,
|
|
@@ -61,6 +62,7 @@ export {
|
|
|
61
62
|
IntegrationRunsPage,
|
|
62
63
|
IntegrationsListPage,
|
|
63
64
|
LegacyPreviewRedirect,
|
|
65
|
+
NotFoundPage,
|
|
64
66
|
PreviewIndexPage,
|
|
65
67
|
PreviewLayout,
|
|
66
68
|
RepoConnectionsPage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekanos/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Ekanos integration dev harness — every surface of an integration rendered in real Ekanos chrome, from fixtures, with no Supabase or auth; and, in live mode, a real localhost OAuth loop over your own dev-app credentials.",
|
|
6
6
|
"homepage": "https://sdk.ekanos.dev/harness/overview",
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@ekanos/integration-schema": "0.
|
|
75
|
+
"@ekanos/integration-schema": "0.28.0",
|
|
76
76
|
"next-themes": "0.4.6",
|
|
77
77
|
"tw-animate-css": "1.4.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@ekanos/sdk": "0.
|
|
81
|
-
"@ekanos/ui": "0.
|
|
80
|
+
"@ekanos/sdk": "0.28.0",
|
|
81
|
+
"@ekanos/ui": "0.28.0",
|
|
82
82
|
"@kit/tsconfig": "0.1.0",
|
|
83
83
|
"@tailwindcss/postcss": "4.3.4",
|
|
84
84
|
"@tanstack/react-query": "5.106.1",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
"zod": "4.6.7"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"@ekanos/sdk": "^0.
|
|
102
|
-
"@ekanos/ui": "^0.
|
|
101
|
+
"@ekanos/sdk": "^0.28.0",
|
|
102
|
+
"@ekanos/ui": "^0.28.0",
|
|
103
103
|
"@tanstack/react-query": "^5.101.4",
|
|
104
104
|
"next": "^16.0.0",
|
|
105
105
|
"next-intl": "^4.14.7",
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
"zod": "^3.25.76 || ^4.0.0"
|
|
111
111
|
},
|
|
112
112
|
"ekanos": {
|
|
113
|
-
"shellContract":
|
|
113
|
+
"shellContract": 6
|
|
114
114
|
},
|
|
115
115
|
"scripts": {
|
|
116
|
-
"build": "tsup && tsc -p tsconfig.build.json && node scripts/rewrite-esm-specifiers.mjs && node scripts/build-css.mjs",
|
|
116
|
+
"build": "tsup && tsc -p tsconfig.build.json && node scripts/rewrite-esm-specifiers.mjs && node scripts/copy-fonts.mjs && node scripts/build-css.mjs",
|
|
117
117
|
"clean": "git clean -xdf .turbo node_modules dist",
|
|
118
118
|
"typecheck": "tsc --noEmit",
|
|
119
119
|
"test": "vitest run --config vitest.config.ts",
|