@ekanos/harness 0.29.0 → 0.31.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/dist/api-types.d.ts +21 -0
- package/dist/internal/components/host-freshness.d.ts +12 -0
- package/dist/internal/components/host-freshness.js +61 -0
- package/dist/internal/components/publish-status.d.ts +39 -0
- package/dist/internal/components/publish-status.js +363 -0
- package/dist/internal/components/shell-header.js +16 -0
- package/dist/internal/components/surface-nav.js +12 -0
- package/dist/internal/lib/console-client.js +2 -1
- package/dist/internal/lib/console-types.d.ts +4 -2
- package/dist/internal/lib/docs-links.d.ts +2 -0
- package/dist/internal/lib/docs-links.js +6 -1
- package/dist/internal/lib/host-data.d.ts +44 -0
- package/dist/internal/lib/host-data.js +159 -0
- package/dist/internal/lib/name-scope.d.ts +28 -0
- package/dist/internal/lib/name-scope.js +54 -0
- package/dist/internal/routes/catalog-pages.d.ts +15 -0
- package/dist/internal/routes/catalog-pages.js +425 -0
- package/dist/internal/routes/experience-summary-page.js +9 -0
- package/dist/internal/routes/integrations-overview-page.js +11 -1
- package/dist/internal/routes/publishes-pages.d.ts +4 -0
- package/dist/internal/routes/publishes-pages.js +19 -0
- package/dist/internal/routes/repo-home-page.js +7 -2
- package/dist/internal/server/ekanos-api-router.js +8 -0
- package/dist/internal/server/host-snapshots.d.ts +18 -0
- package/dist/internal/server/host-snapshots.js +67 -0
- package/dist/internal/server/package-naming.d.ts +14 -0
- package/dist/internal/server/package-naming.js +43 -0
- package/dist/internal/server/repo-api-router.js +17 -3
- package/dist/internal/server/session-catalog.d.ts +12 -0
- package/dist/routes.d.ts +7 -0
- package/dist/routes.js +14 -0
- package/package.json +7 -7
package/dist/api-types.d.ts
CHANGED
|
@@ -172,8 +172,27 @@ export interface ActiveOverride {
|
|
|
172
172
|
via: 'file' | 'env';
|
|
173
173
|
mode: RunMode;
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* How a local package is named when it publishes, as its files declare it:
|
|
177
|
+
* `global`, a bare name (`availability.mode: "global"` in its `ekanos.json`,
|
|
178
|
+
* which needs an approved global name), or `restricted`, the default, named
|
|
179
|
+
* under the publishing Source's namespace (`acme/google-drive`). The host's
|
|
180
|
+
* answer once it is published (`PublishedPackage.namespace`) is authoritative.
|
|
181
|
+
* Naming only: who may see a package is set separately.
|
|
182
|
+
*/
|
|
183
|
+
export interface PackageNaming {
|
|
184
|
+
availability: 'global' | 'restricted';
|
|
185
|
+
/**
|
|
186
|
+
* The namespace it publishes under, as far as the files say: the repo's
|
|
187
|
+
* root `ekanos.json` `namespace`, else the Source every integration names.
|
|
188
|
+
* Null when nothing says.
|
|
189
|
+
*/
|
|
190
|
+
namespace: string | null;
|
|
191
|
+
}
|
|
175
192
|
export interface IntegrationsResponse {
|
|
176
193
|
kind: HarnessKind;
|
|
194
|
+
/** How the project's own package is named when it publishes. */
|
|
195
|
+
naming?: PackageNaming;
|
|
177
196
|
integrations: IntegrationView[];
|
|
178
197
|
overrides: ActiveOverride[];
|
|
179
198
|
/** True while any override is active: `ekanos publish` refuses. */
|
|
@@ -543,6 +562,7 @@ export interface RepoIntegrationRow {
|
|
|
543
562
|
consoleHref: string;
|
|
544
563
|
/** Experience packages of this repo that use it. */
|
|
545
564
|
usedBy: string[];
|
|
565
|
+
naming: PackageNaming;
|
|
546
566
|
}
|
|
547
567
|
export interface RepoExperienceIntegration {
|
|
548
568
|
name: string;
|
|
@@ -568,6 +588,7 @@ export interface RepoExperienceRow {
|
|
|
568
588
|
connectHref: string;
|
|
569
589
|
integrations: RepoExperienceIntegration[];
|
|
570
590
|
error?: string;
|
|
591
|
+
naming: PackageNaming;
|
|
571
592
|
}
|
|
572
593
|
export interface RepoResponse {
|
|
573
594
|
root: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** "3 minutes ago", for a timestamp a person reads at a glance. */
|
|
2
|
+
export declare function timeAgo(iso: string | null | undefined, now?: number): string | null;
|
|
3
|
+
/** The full date and time, for a tooltip beside a relative one. */
|
|
4
|
+
export declare function fullTime(iso: string | null | undefined): string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* When the host was last read, and a way to read it again now. The read runs
|
|
7
|
+
* in `ekanos dev`, which holds the login; the harness only asks for it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function HostFreshness({ fetchedAt, host, }: {
|
|
10
|
+
fetchedAt: string | null | undefined;
|
|
11
|
+
host: string | null | undefined;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@ekanos/ui/button";
|
|
4
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
5
|
+
import { useRefreshHostData } from "../lib/host-data.js";
|
|
6
|
+
function timeAgo(iso, now = Date.now()) {
|
|
7
|
+
if (!iso) return null;
|
|
8
|
+
const then = Date.parse(iso);
|
|
9
|
+
if (Number.isNaN(then)) return null;
|
|
10
|
+
const seconds = Math.max(0, Math.round((now - then) / 1e3));
|
|
11
|
+
if (seconds < 45) return "just now";
|
|
12
|
+
const minutes = Math.round(seconds / 60);
|
|
13
|
+
if (minutes < 60) return `${minutes} minute${minutes === 1 ? "" : "s"} ago`;
|
|
14
|
+
const hours = Math.round(minutes / 60);
|
|
15
|
+
if (hours < 24) return `${hours} hour${hours === 1 ? "" : "s"} ago`;
|
|
16
|
+
const days = Math.round(hours / 24);
|
|
17
|
+
return `${days} day${days === 1 ? "" : "s"} ago`;
|
|
18
|
+
}
|
|
19
|
+
function fullTime(iso) {
|
|
20
|
+
if (!iso) return void 0;
|
|
21
|
+
const date = new Date(iso);
|
|
22
|
+
return Number.isNaN(date.getTime()) ? void 0 : date.toLocaleString();
|
|
23
|
+
}
|
|
24
|
+
function HostFreshness({
|
|
25
|
+
fetchedAt,
|
|
26
|
+
host
|
|
27
|
+
}) {
|
|
28
|
+
const refresh = useRefreshHostData();
|
|
29
|
+
const ago = timeAgo(fetchedAt);
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: "text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",
|
|
34
|
+
"data-test": "host-freshness",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx("span", { title: fullTime(fetchedAt), children: ago ? `Read from ${host ?? "Ekanos"} ${ago}` : "Not read yet" }),
|
|
37
|
+
/* @__PURE__ */ jsxs(
|
|
38
|
+
Button,
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
variant: "ghost",
|
|
42
|
+
size: "xs",
|
|
43
|
+
onClick: () => refresh.mutate(),
|
|
44
|
+
disabled: refresh.isPending,
|
|
45
|
+
"data-test": "host-refresh",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Icon, { name: "arrows-clockwise" }),
|
|
48
|
+
refresh.isPending ? "Asking\u2026" : "Refresh"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
refresh.isError ? /* @__PURE__ */ jsx("span", { className: "text-destructive", children: "Could not ask ekanos dev to refresh. Is it still running?" }) : null
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
HostFreshness,
|
|
59
|
+
fullTime,
|
|
60
|
+
timeAgo
|
|
61
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PublishFinding } from '@ekanos/integration-schema';
|
|
2
|
+
import type { PackageNaming } from '../lib/console-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The latest published version of a local package, as a chip: "Live on dev ·
|
|
5
|
+
* 0.3.1". Nothing at all when the host could not be read, so a missing login
|
|
6
|
+
* never looks like a missing publish.
|
|
7
|
+
*/
|
|
8
|
+
export declare function PublishChip({ name }: {
|
|
9
|
+
name: string;
|
|
10
|
+
}): import("react").JSX.Element | null;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a local package is global or named under a namespace: the host's
|
|
13
|
+
* answer once it is published, else what its `ekanos.json` declares. Nothing
|
|
14
|
+
* when neither says.
|
|
15
|
+
*/
|
|
16
|
+
export declare function NameScopeBadge({ name, naming, }: {
|
|
17
|
+
name: string;
|
|
18
|
+
naming?: PackageNaming | null | undefined;
|
|
19
|
+
}): import("react").JSX.Element | null;
|
|
20
|
+
/** One line on the latest publish, for an Overview, linking to its Publishes tab. */
|
|
21
|
+
export declare function LatestPublishLine({ name, href, naming, }: {
|
|
22
|
+
name: string;
|
|
23
|
+
href: string;
|
|
24
|
+
/** The package's declared naming, shown as a global/namespaced badge. */
|
|
25
|
+
naming?: PackageNaming | null | undefined;
|
|
26
|
+
}): import("react").JSX.Element | null;
|
|
27
|
+
/**
|
|
28
|
+
* The checks can report the same finding more than once (one per stage that
|
|
29
|
+
* ran it); a person needs to read it once.
|
|
30
|
+
*/
|
|
31
|
+
export declare function uniqueFindings(findings: readonly PublishFinding[]): PublishFinding[];
|
|
32
|
+
/**
|
|
33
|
+
* Every version of one local package the Source has published, newest first,
|
|
34
|
+
* each with its state, who submitted it and when, its check stages and its
|
|
35
|
+
* findings. The latest is open.
|
|
36
|
+
*/
|
|
37
|
+
export declare function PublishesView({ name }: {
|
|
38
|
+
name: string;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { Alert, AlertDescription } from "@ekanos/ui/alert";
|
|
5
|
+
import { Card } from "@ekanos/ui/card";
|
|
6
|
+
import { EmptyNote } from "@ekanos/ui/empty-note";
|
|
7
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
8
|
+
import { StatusBadge } from "@ekanos/ui/status-badge";
|
|
9
|
+
import { cn } from "@ekanos/ui/utils";
|
|
10
|
+
import {
|
|
11
|
+
describePublishState,
|
|
12
|
+
findPublishedPackage,
|
|
13
|
+
sortVersions,
|
|
14
|
+
usePublishSnapshot
|
|
15
|
+
} from "../lib/host-data.js";
|
|
16
|
+
import { describeNameScope } from "../lib/name-scope.js";
|
|
17
|
+
import { HostFreshness, fullTime, timeAgo } from "./host-freshness.js";
|
|
18
|
+
import { PageSkeleton } from "./page-skeletons.js";
|
|
19
|
+
import { FOCUS_RING } from "./scrollable-nav.js";
|
|
20
|
+
function plural(value, noun) {
|
|
21
|
+
return `${value} ${noun}${value === 1 ? "" : "s"}`;
|
|
22
|
+
}
|
|
23
|
+
function submittedLine(version) {
|
|
24
|
+
const ago = timeAgo(version.submittedAt);
|
|
25
|
+
const parts = [ago ? `Submitted ${ago}` : "Submitted"];
|
|
26
|
+
if (version.submittedBy) parts.push(`by ${version.submittedBy}`);
|
|
27
|
+
return parts.join(" ");
|
|
28
|
+
}
|
|
29
|
+
function countsLine(version) {
|
|
30
|
+
if (version.errorCount == null && version.warnCount == null) return null;
|
|
31
|
+
return `${plural(version.errorCount ?? 0, "error")} \xB7 ${plural(version.warnCount ?? 0, "warning")}`;
|
|
32
|
+
}
|
|
33
|
+
function PublishChip({ name }) {
|
|
34
|
+
const publish = usePublishSnapshot();
|
|
35
|
+
const snapshot = publish.data?.snapshot;
|
|
36
|
+
if (!snapshot || snapshot.unavailable) return null;
|
|
37
|
+
const pkg = findPublishedPackage(snapshot, name);
|
|
38
|
+
const latest = pkg ? sortVersions(pkg.versions)[0] : void 0;
|
|
39
|
+
if (!latest) {
|
|
40
|
+
return /* @__PURE__ */ jsx(StatusBadge, { tone: "neutral", "data-test": "publish-chip", children: "Not published" });
|
|
41
|
+
}
|
|
42
|
+
const state = describePublishState(latest.state);
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
StatusBadge,
|
|
45
|
+
{
|
|
46
|
+
tone: state.tone,
|
|
47
|
+
"data-test": "publish-chip",
|
|
48
|
+
title: state.detail,
|
|
49
|
+
children: [
|
|
50
|
+
state.label,
|
|
51
|
+
" \xB7 ",
|
|
52
|
+
latest.version
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
function NameScopeBadge({
|
|
58
|
+
name,
|
|
59
|
+
naming
|
|
60
|
+
}) {
|
|
61
|
+
const publish = usePublishSnapshot();
|
|
62
|
+
const snapshot = publish.data?.snapshot;
|
|
63
|
+
const published = snapshot && !snapshot.unavailable ? findPublishedPackage(snapshot, name) : null;
|
|
64
|
+
const scope = describeNameScope({ name, published, declared: naming });
|
|
65
|
+
if (!scope) return null;
|
|
66
|
+
return /* @__PURE__ */ jsxs(
|
|
67
|
+
"span",
|
|
68
|
+
{
|
|
69
|
+
"data-test": "name-scope",
|
|
70
|
+
"data-scope": scope.scope,
|
|
71
|
+
"data-confirmed": scope.confirmed,
|
|
72
|
+
title: scope.detail,
|
|
73
|
+
className: "text-foreground inline-flex h-6 w-fit shrink-0 items-center gap-1 rounded-full border px-2 text-xs font-semibold tracking-wide whitespace-nowrap",
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
Icon,
|
|
77
|
+
{
|
|
78
|
+
name: scope.scope === "global" ? "globe" : "folder-simple",
|
|
79
|
+
className: "size-3",
|
|
80
|
+
"aria-hidden": true
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
scope.label
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
function LatestPublishLine({
|
|
89
|
+
name,
|
|
90
|
+
href,
|
|
91
|
+
naming
|
|
92
|
+
}) {
|
|
93
|
+
const publish = usePublishSnapshot();
|
|
94
|
+
const snapshot = publish.data?.snapshot;
|
|
95
|
+
if (!snapshot || snapshot.unavailable) {
|
|
96
|
+
return naming ? /* @__PURE__ */ jsx("p", { className: "flex flex-wrap items-center gap-2", "data-test": "naming-line", children: /* @__PURE__ */ jsx(NameScopeBadge, { name, naming }) }) : null;
|
|
97
|
+
}
|
|
98
|
+
const pkg = findPublishedPackage(snapshot, name);
|
|
99
|
+
const latest = pkg ? sortVersions(pkg.versions)[0] : void 0;
|
|
100
|
+
return /* @__PURE__ */ jsxs(
|
|
101
|
+
"p",
|
|
102
|
+
{
|
|
103
|
+
className: "text-muted-foreground flex flex-wrap items-center gap-2 text-sm",
|
|
104
|
+
"data-test": "latest-publish",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsx(Icon, { name: "paper-plane-tilt", className: "size-4", "aria-hidden": true }),
|
|
107
|
+
latest ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
108
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
109
|
+
"Latest publish: ",
|
|
110
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono", children: latest.version })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsx(StatusBadge, { tone: describePublishState(latest.state).tone, children: describePublishState(latest.state).label }),
|
|
113
|
+
/* @__PURE__ */ jsx("span", { title: fullTime(latest.submittedAt), children: timeAgo(latest.submittedAt) })
|
|
114
|
+
] }) : /* @__PURE__ */ jsx("span", { children: "Not published yet." }),
|
|
115
|
+
/* @__PURE__ */ jsx(NameScopeBadge, { name, naming }),
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
Link,
|
|
118
|
+
{
|
|
119
|
+
href,
|
|
120
|
+
className: cn("text-foreground rounded-sm underline", FOCUS_RING),
|
|
121
|
+
children: "Publishes"
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
const SEVERITY = {
|
|
129
|
+
error: { label: "Errors", tone: "destructive" },
|
|
130
|
+
warn: { label: "Warnings", tone: "warning" },
|
|
131
|
+
info: { label: "Notes", tone: "info" }
|
|
132
|
+
};
|
|
133
|
+
function uniqueFindings(findings) {
|
|
134
|
+
const seen = /* @__PURE__ */ new Set();
|
|
135
|
+
return findings.filter((finding) => {
|
|
136
|
+
const key = [
|
|
137
|
+
finding.severity,
|
|
138
|
+
finding.check,
|
|
139
|
+
finding.message,
|
|
140
|
+
finding.file ?? "",
|
|
141
|
+
finding.line ?? ""
|
|
142
|
+
].join("\0");
|
|
143
|
+
if (seen.has(key)) return false;
|
|
144
|
+
seen.add(key);
|
|
145
|
+
return true;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function FindingRow({ finding }) {
|
|
149
|
+
const where = finding.file ? `${finding.file}${finding.line ? `:${finding.line}` : ""}` : null;
|
|
150
|
+
return /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-1 px-4 py-3 text-sm", "data-test": "finding", children: [
|
|
151
|
+
/* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
152
|
+
/* @__PURE__ */ jsx("code", { className: "text-muted-foreground font-mono text-xs", children: finding.check }),
|
|
153
|
+
where ? /* @__PURE__ */ jsx("code", { className: "font-mono text-xs", children: where }) : null,
|
|
154
|
+
finding.resolvedAt ? /* @__PURE__ */ jsx(StatusBadge, { tone: "success", children: "Resolved" }) : null
|
|
155
|
+
] }),
|
|
156
|
+
/* @__PURE__ */ jsx("span", { children: finding.message }),
|
|
157
|
+
finding.hint ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: finding.hint }) : null
|
|
158
|
+
] });
|
|
159
|
+
}
|
|
160
|
+
function VersionCard({
|
|
161
|
+
version,
|
|
162
|
+
open
|
|
163
|
+
}) {
|
|
164
|
+
const state = describePublishState(version.state);
|
|
165
|
+
const findings = uniqueFindings(version.findings ?? []);
|
|
166
|
+
const counts = countsLine(version);
|
|
167
|
+
return /* @__PURE__ */ jsx(
|
|
168
|
+
Card,
|
|
169
|
+
{
|
|
170
|
+
layout: "bleed",
|
|
171
|
+
className: "overflow-hidden p-0",
|
|
172
|
+
"data-test": "publish-version",
|
|
173
|
+
children: /* @__PURE__ */ jsxs("details", { open, className: "group", children: [
|
|
174
|
+
/* @__PURE__ */ jsxs(
|
|
175
|
+
"summary",
|
|
176
|
+
{
|
|
177
|
+
className: cn(
|
|
178
|
+
"hover:bg-muted flex cursor-pointer list-none flex-wrap items-center gap-x-3 gap-y-1 px-4 py-3",
|
|
179
|
+
FOCUS_RING
|
|
180
|
+
),
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ jsx(
|
|
183
|
+
Icon,
|
|
184
|
+
{
|
|
185
|
+
name: "caret-right",
|
|
186
|
+
className: "text-muted-foreground size-4 transition-transform group-open:rotate-90",
|
|
187
|
+
"aria-hidden": true
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm font-medium", children: version.version }),
|
|
191
|
+
/* @__PURE__ */ jsx(StatusBadge, { tone: state.tone, children: state.label }),
|
|
192
|
+
/* @__PURE__ */ jsx(
|
|
193
|
+
"span",
|
|
194
|
+
{
|
|
195
|
+
className: "text-muted-foreground text-xs",
|
|
196
|
+
title: fullTime(version.submittedAt),
|
|
197
|
+
children: submittedLine(version)
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
counts ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground ml-auto text-xs", children: counts }) : null
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 border-t px-4 py-3", children: [
|
|
205
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: state.detail }),
|
|
206
|
+
version.stages && version.stages.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "flex flex-wrap gap-2", "data-test": "publish-stages", children: version.stages.map((stage) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
207
|
+
StatusBadge,
|
|
208
|
+
{
|
|
209
|
+
tone: stage.status === "pass" ? "success" : stage.status === "fail" ? "destructive" : "neutral",
|
|
210
|
+
children: [
|
|
211
|
+
stage.id,
|
|
212
|
+
" \xB7",
|
|
213
|
+
" ",
|
|
214
|
+
stage.status === "skipped" ? "skipped" : `${(stage.durationMs / 1e3).toFixed(1)}s`
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
) }, stage.id)) }) : null,
|
|
218
|
+
["error", "warn", "info"].map((severity) => {
|
|
219
|
+
const group = findings.filter((f) => f.severity === severity);
|
|
220
|
+
if (group.length === 0) return null;
|
|
221
|
+
const list = /* @__PURE__ */ jsx(
|
|
222
|
+
Card,
|
|
223
|
+
{
|
|
224
|
+
layout: "bleed",
|
|
225
|
+
render: /* @__PURE__ */ jsx("ul", {}),
|
|
226
|
+
className: "gap-0 divide-y overflow-hidden py-0",
|
|
227
|
+
children: group.map((finding, index) => /* @__PURE__ */ jsx(
|
|
228
|
+
FindingRow,
|
|
229
|
+
{
|
|
230
|
+
finding
|
|
231
|
+
},
|
|
232
|
+
finding.id ?? `${finding.check}-${index}`
|
|
233
|
+
))
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
const heading = /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
237
|
+
SEVERITY[severity].label,
|
|
238
|
+
/* @__PURE__ */ jsx(StatusBadge, { tone: SEVERITY[severity].tone, children: group.length })
|
|
239
|
+
] });
|
|
240
|
+
return severity === "info" ? /* @__PURE__ */ jsxs(
|
|
241
|
+
"details",
|
|
242
|
+
{
|
|
243
|
+
className: "group/notes flex flex-col gap-1",
|
|
244
|
+
"data-test": "publish-notes",
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ jsxs(
|
|
247
|
+
"summary",
|
|
248
|
+
{
|
|
249
|
+
className: cn(
|
|
250
|
+
"flex w-fit cursor-pointer list-none items-center gap-1 rounded-sm",
|
|
251
|
+
FOCUS_RING
|
|
252
|
+
),
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ jsx(
|
|
255
|
+
Icon,
|
|
256
|
+
{
|
|
257
|
+
name: "caret-right",
|
|
258
|
+
className: "text-muted-foreground size-3.5 transition-transform group-open/notes:rotate-90",
|
|
259
|
+
"aria-hidden": true
|
|
260
|
+
}
|
|
261
|
+
),
|
|
262
|
+
heading
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ jsx("div", { className: "pt-1", children: list })
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
severity
|
|
270
|
+
) : /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-1", children: [
|
|
271
|
+
/* @__PURE__ */ jsx("h4", { children: heading }),
|
|
272
|
+
list
|
|
273
|
+
] }, severity);
|
|
274
|
+
}),
|
|
275
|
+
findings.length === 0 && version.state !== "submitted" ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "No findings." }) : null,
|
|
276
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground font-mono text-xs", children: version.archiveSha256 ? `sha256 ${version.archiveSha256.slice(0, 16)}\u2026` : null })
|
|
277
|
+
] })
|
|
278
|
+
] })
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
function PublishesView({ name }) {
|
|
283
|
+
const publish = usePublishSnapshot();
|
|
284
|
+
if (publish.isPending) return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading publishes" });
|
|
285
|
+
if (publish.isError) {
|
|
286
|
+
return /* @__PURE__ */ jsx(Alert, { variant: "destructive", "data-test": "publishes-error", children: /* @__PURE__ */ jsxs(AlertDescription, { children: [
|
|
287
|
+
"Could not read the publish status from the harness server:",
|
|
288
|
+
" ",
|
|
289
|
+
publish.error.message,
|
|
290
|
+
". Check that ",
|
|
291
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
292
|
+
" is still running, then reload."
|
|
293
|
+
] }) });
|
|
294
|
+
}
|
|
295
|
+
const snapshot = publish.data.snapshot;
|
|
296
|
+
const header = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
297
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Publishes" }),
|
|
298
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
299
|
+
"Every version of ",
|
|
300
|
+
/* @__PURE__ */ jsx("code", { children: name }),
|
|
301
|
+
" sent with",
|
|
302
|
+
" ",
|
|
303
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos publish" }),
|
|
304
|
+
", where it is now, and what the checks found."
|
|
305
|
+
] }),
|
|
306
|
+
snapshot ? /* @__PURE__ */ jsx(HostFreshness, { fetchedAt: snapshot.fetchedAt, host: snapshot.host }) : null
|
|
307
|
+
] });
|
|
308
|
+
if (!snapshot) {
|
|
309
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "publishes", children: [
|
|
310
|
+
header,
|
|
311
|
+
/* @__PURE__ */ jsxs(EmptyNote, { icon: "paper-plane-tilt", title: "No publish status yet", children: [
|
|
312
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
313
|
+
" reads your publishes from Ekanos when it starts. If this stays empty, upgrade with ",
|
|
314
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos upgrade" }),
|
|
315
|
+
" ",
|
|
316
|
+
"and restart ",
|
|
317
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
318
|
+
"."
|
|
319
|
+
] })
|
|
320
|
+
] });
|
|
321
|
+
}
|
|
322
|
+
if (snapshot.unavailable) {
|
|
323
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "publishes", children: [
|
|
324
|
+
header,
|
|
325
|
+
/* @__PURE__ */ jsx(Alert, { variant: "warning", "data-test": "publishes-unavailable", children: /* @__PURE__ */ jsx(AlertDescription, { children: snapshot.unavailable.message }) })
|
|
326
|
+
] });
|
|
327
|
+
}
|
|
328
|
+
const pkg = findPublishedPackage(snapshot, name);
|
|
329
|
+
const versions = pkg ? sortVersions(pkg.versions) : [];
|
|
330
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "publishes", children: [
|
|
331
|
+
header,
|
|
332
|
+
versions.length === 0 ? /* @__PURE__ */ jsxs(
|
|
333
|
+
EmptyNote,
|
|
334
|
+
{
|
|
335
|
+
icon: "paper-plane-tilt",
|
|
336
|
+
title: "Not published yet",
|
|
337
|
+
"data-test": "publishes-none",
|
|
338
|
+
children: [
|
|
339
|
+
"Run ",
|
|
340
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos publish" }),
|
|
341
|
+
" from this package to send a version to",
|
|
342
|
+
" ",
|
|
343
|
+
snapshot.source ?? "your Source",
|
|
344
|
+
". It shows here within a minute."
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: versions.map((version, index) => /* @__PURE__ */ jsx(
|
|
348
|
+
VersionCard,
|
|
349
|
+
{
|
|
350
|
+
version,
|
|
351
|
+
open: index === 0
|
|
352
|
+
},
|
|
353
|
+
version.id
|
|
354
|
+
)) })
|
|
355
|
+
] });
|
|
356
|
+
}
|
|
357
|
+
export {
|
|
358
|
+
LatestPublishLine,
|
|
359
|
+
NameScopeBadge,
|
|
360
|
+
PublishChip,
|
|
361
|
+
PublishesView,
|
|
362
|
+
uniqueFindings
|
|
363
|
+
};
|
|
@@ -102,6 +102,22 @@ function ShellHeader({
|
|
|
102
102
|
] })
|
|
103
103
|
] }),
|
|
104
104
|
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
105
|
+
/* @__PURE__ */ jsxs(
|
|
106
|
+
Link,
|
|
107
|
+
{
|
|
108
|
+
href: "/catalog",
|
|
109
|
+
className: cn(
|
|
110
|
+
"text-muted-foreground hover:text-foreground flex items-center gap-1.5 rounded-md px-2 py-1.5 text-sm",
|
|
111
|
+
FOCUS_RING
|
|
112
|
+
),
|
|
113
|
+
"aria-current": pathname.startsWith("/catalog") ? "page" : void 0,
|
|
114
|
+
"data-test": "header-catalog-link",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Icon, { name: "books", className: "size-4", "aria-hidden": true }),
|
|
117
|
+
"Catalog"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
105
121
|
/* @__PURE__ */ jsx(
|
|
106
122
|
DocsLink,
|
|
107
123
|
{
|
|
@@ -124,6 +124,12 @@ function integrationTabs(slug) {
|
|
|
124
124
|
label: "Run log",
|
|
125
125
|
icon: "clock-counter-clockwise",
|
|
126
126
|
prefix: true
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
href: `${base}/publishes`,
|
|
130
|
+
label: "Publishes",
|
|
131
|
+
icon: "paper-plane-tilt",
|
|
132
|
+
prefix: true
|
|
127
133
|
}
|
|
128
134
|
];
|
|
129
135
|
}
|
|
@@ -169,6 +175,12 @@ function experienceTabs(base = "/experience", repo = false) {
|
|
|
169
175
|
icon: "clock-counter-clockwise",
|
|
170
176
|
prefix: true
|
|
171
177
|
},
|
|
178
|
+
{
|
|
179
|
+
href: `${base}/publishes`,
|
|
180
|
+
label: "Publishes",
|
|
181
|
+
icon: "paper-plane-tilt",
|
|
182
|
+
prefix: true
|
|
183
|
+
},
|
|
172
184
|
...repo ? [
|
|
173
185
|
{
|
|
174
186
|
href: `${base}/connect`,
|
|
@@ -140,7 +140,8 @@ function createHttpConsoleClient(fetcher = (input, init) => globalThis.fetch(inp
|
|
|
140
140
|
integrations: wire.integrations.map(integrationView),
|
|
141
141
|
notices: wire.notices,
|
|
142
142
|
errors: wire.errors,
|
|
143
|
-
...experience?.checks ? { checks: experience.checks } : {}
|
|
143
|
+
...experience?.checks ? { checks: experience.checks } : {},
|
|
144
|
+
...wire.naming ? { naming: wire.naming } : {}
|
|
144
145
|
};
|
|
145
146
|
},
|
|
146
147
|
getContract: async (integration) => contractView(
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* so the UI builds and is tested against fakes; once `src/api.ts` publishes
|
|
7
7
|
* the real types, this file is the one place to re-point.
|
|
8
8
|
*/
|
|
9
|
-
import type { ActivationCredentialStatus, HarnessConnectAs, HarnessRunAs, IntegrationConnectionFacts, IntegrationRuntime, OAuthConnectionStatus } from '../../api-types.js';
|
|
10
|
-
export type { ActivationCredentialStatus, HarnessConnectAs, HarnessRunAs, OAuthConnectionStatus, };
|
|
9
|
+
import type { ActivationCredentialStatus, HarnessConnectAs, HarnessRunAs, IntegrationConnectionFacts, IntegrationRuntime, OAuthConnectionStatus, PackageNaming } from '../../api-types.js';
|
|
10
|
+
export type { ActivationCredentialStatus, PackageNaming, HarnessConnectAs, HarnessRunAs, OAuthConnectionStatus, };
|
|
11
11
|
export type JsonSchema = {
|
|
12
12
|
[key: string]: unknown;
|
|
13
13
|
};
|
|
@@ -123,6 +123,8 @@ export interface ConsoleProject {
|
|
|
123
123
|
};
|
|
124
124
|
/** The repo's integration also registers widgets/tile/activation surfaces. */
|
|
125
125
|
legacySurfaces?: boolean;
|
|
126
|
+
/** How the project's own package is named when it publishes. */
|
|
127
|
+
naming?: PackageNaming;
|
|
126
128
|
}
|
|
127
129
|
export interface RunRecord {
|
|
128
130
|
id: string;
|
|
@@ -18,6 +18,8 @@ export declare const DOCS: {
|
|
|
18
18
|
readonly consoleEvents: "https://sdk.ekanos.dev/harness/integration-console#events";
|
|
19
19
|
readonly consoleHealth: "https://sdk.ekanos.dev/harness/integration-console#health";
|
|
20
20
|
readonly runLog: "https://sdk.ekanos.dev/harness/integration-console#run-log";
|
|
21
|
+
readonly publishes: "https://sdk.ekanos.dev/harness/integration-console#publishes";
|
|
22
|
+
readonly catalog: "https://sdk.ekanos.dev/harness/catalog";
|
|
21
23
|
readonly preview: "https://sdk.ekanos.dev/harness/integration-console#preview";
|
|
22
24
|
readonly fixtures: "https://sdk.ekanos.dev/harness/fixtures";
|
|
23
25
|
readonly experiences: "https://sdk.ekanos.dev/guides/experiences";
|
|
@@ -16,6 +16,8 @@ const DOCS = {
|
|
|
16
16
|
consoleEvents: `${SDK_DOCS_URL}/harness/integration-console#events`,
|
|
17
17
|
consoleHealth: `${SDK_DOCS_URL}/harness/integration-console#health`,
|
|
18
18
|
runLog: `${SDK_DOCS_URL}/harness/integration-console#run-log`,
|
|
19
|
+
publishes: `${SDK_DOCS_URL}/harness/integration-console#publishes`,
|
|
20
|
+
catalog: `${SDK_DOCS_URL}/harness/catalog`,
|
|
19
21
|
preview: `${SDK_DOCS_URL}/harness/integration-console#preview`,
|
|
20
22
|
fixtures: `${SDK_DOCS_URL}/harness/fixtures`,
|
|
21
23
|
experiences: `${SDK_DOCS_URL}/guides/experiences`,
|
|
@@ -31,13 +33,15 @@ const CONSOLE_TAB_DOCS = {
|
|
|
31
33
|
operations: DOCS.consoleOperations,
|
|
32
34
|
events: DOCS.consoleEvents,
|
|
33
35
|
health: DOCS.consoleHealth,
|
|
34
|
-
runs: DOCS.runLog
|
|
36
|
+
runs: DOCS.runLog,
|
|
37
|
+
publishes: DOCS.publishes
|
|
35
38
|
};
|
|
36
39
|
const EXPERIENCE_TAB_DOCS = {
|
|
37
40
|
widgets: DOCS.experienceWidgets,
|
|
38
41
|
workflows: DOCS.workflows,
|
|
39
42
|
"review-queue": DOCS.reviewQueue,
|
|
40
43
|
runs: DOCS.runLog,
|
|
44
|
+
publishes: DOCS.publishes,
|
|
41
45
|
connect: DOCS.connecting,
|
|
42
46
|
pages: DOCS.pageKinds
|
|
43
47
|
};
|
|
@@ -45,6 +49,7 @@ function docsHrefFor(pathname) {
|
|
|
45
49
|
const segments = pathname.split("/").filter(Boolean);
|
|
46
50
|
const [first] = segments;
|
|
47
51
|
if (first === void 0) return DOCS.repoHome;
|
|
52
|
+
if (first === "catalog") return DOCS.catalog;
|
|
48
53
|
if (first === "integrations") {
|
|
49
54
|
const tab2 = segments[2];
|
|
50
55
|
if (tab2 === void 0) return DOCS.console;
|