@ekanos/harness 0.29.0 → 0.30.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/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 +27 -0
- package/dist/internal/components/publish-status.js +326 -0
- package/dist/internal/components/shell-header.js +16 -0
- package/dist/internal/components/surface-nav.js +12 -0
- 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/routes/catalog-pages.d.ts +15 -0
- package/dist/internal/routes/catalog-pages.js +425 -0
- package/dist/internal/routes/experience-summary-page.js +8 -0
- package/dist/internal/routes/integrations-overview-page.js +2 -0
- 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 +5 -2
- package/dist/internal/server/ekanos-api-router.js +5 -0
- package/dist/internal/server/host-snapshots.d.ts +18 -0
- package/dist/internal/server/host-snapshots.js +67 -0
- package/dist/internal/server/repo-api-router.js +9 -0
- 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
|
@@ -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,27 @@
|
|
|
1
|
+
import type { PublishFinding } from '@ekanos/integration-schema';
|
|
2
|
+
/**
|
|
3
|
+
* The latest published version of a local package, as a chip: "Live on dev ·
|
|
4
|
+
* 0.3.1". Nothing at all when the host could not be read, so a missing login
|
|
5
|
+
* never looks like a missing publish.
|
|
6
|
+
*/
|
|
7
|
+
export declare function PublishChip({ name }: {
|
|
8
|
+
name: string;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
10
|
+
/** One line on the latest publish, for an Overview, linking to its Publishes tab. */
|
|
11
|
+
export declare function LatestPublishLine({ name, href, }: {
|
|
12
|
+
name: string;
|
|
13
|
+
href: string;
|
|
14
|
+
}): import("react").JSX.Element | null;
|
|
15
|
+
/**
|
|
16
|
+
* The checks can report the same finding more than once (one per stage that
|
|
17
|
+
* ran it); a person needs to read it once.
|
|
18
|
+
*/
|
|
19
|
+
export declare function uniqueFindings(findings: readonly PublishFinding[]): PublishFinding[];
|
|
20
|
+
/**
|
|
21
|
+
* Every version of one local package the Source has published, newest first,
|
|
22
|
+
* each with its state, who submitted it and when, its check stages and its
|
|
23
|
+
* findings. The latest is open.
|
|
24
|
+
*/
|
|
25
|
+
export declare function PublishesView({ name }: {
|
|
26
|
+
name: string;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,326 @@
|
|
|
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 { HostFreshness, fullTime, timeAgo } from "./host-freshness.js";
|
|
17
|
+
import { PageSkeleton } from "./page-skeletons.js";
|
|
18
|
+
import { FOCUS_RING } from "./scrollable-nav.js";
|
|
19
|
+
function plural(value, noun) {
|
|
20
|
+
return `${value} ${noun}${value === 1 ? "" : "s"}`;
|
|
21
|
+
}
|
|
22
|
+
function submittedLine(version) {
|
|
23
|
+
const ago = timeAgo(version.submittedAt);
|
|
24
|
+
const parts = [ago ? `Submitted ${ago}` : "Submitted"];
|
|
25
|
+
if (version.submittedBy) parts.push(`by ${version.submittedBy}`);
|
|
26
|
+
return parts.join(" ");
|
|
27
|
+
}
|
|
28
|
+
function countsLine(version) {
|
|
29
|
+
if (version.errorCount == null && version.warnCount == null) return null;
|
|
30
|
+
return `${plural(version.errorCount ?? 0, "error")} \xB7 ${plural(version.warnCount ?? 0, "warning")}`;
|
|
31
|
+
}
|
|
32
|
+
function PublishChip({ name }) {
|
|
33
|
+
const publish = usePublishSnapshot();
|
|
34
|
+
const snapshot = publish.data?.snapshot;
|
|
35
|
+
if (!snapshot || snapshot.unavailable) return null;
|
|
36
|
+
const pkg = findPublishedPackage(snapshot, name);
|
|
37
|
+
const latest = pkg ? sortVersions(pkg.versions)[0] : void 0;
|
|
38
|
+
if (!latest) {
|
|
39
|
+
return /* @__PURE__ */ jsx(StatusBadge, { tone: "neutral", "data-test": "publish-chip", children: "Not published" });
|
|
40
|
+
}
|
|
41
|
+
const state = describePublishState(latest.state);
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
StatusBadge,
|
|
44
|
+
{
|
|
45
|
+
tone: state.tone,
|
|
46
|
+
"data-test": "publish-chip",
|
|
47
|
+
title: state.detail,
|
|
48
|
+
children: [
|
|
49
|
+
state.label,
|
|
50
|
+
" \xB7 ",
|
|
51
|
+
latest.version
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function LatestPublishLine({
|
|
57
|
+
name,
|
|
58
|
+
href
|
|
59
|
+
}) {
|
|
60
|
+
const publish = usePublishSnapshot();
|
|
61
|
+
const snapshot = publish.data?.snapshot;
|
|
62
|
+
if (!snapshot || snapshot.unavailable) return null;
|
|
63
|
+
const pkg = findPublishedPackage(snapshot, name);
|
|
64
|
+
const latest = pkg ? sortVersions(pkg.versions)[0] : void 0;
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
|
+
"p",
|
|
67
|
+
{
|
|
68
|
+
className: "text-muted-foreground flex flex-wrap items-center gap-2 text-sm",
|
|
69
|
+
"data-test": "latest-publish",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Icon, { name: "paper-plane-tilt", className: "size-4", "aria-hidden": true }),
|
|
72
|
+
latest ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
74
|
+
"Latest publish: ",
|
|
75
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono", children: latest.version })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ jsx(StatusBadge, { tone: describePublishState(latest.state).tone, children: describePublishState(latest.state).label }),
|
|
78
|
+
/* @__PURE__ */ jsx("span", { title: fullTime(latest.submittedAt), children: timeAgo(latest.submittedAt) })
|
|
79
|
+
] }) : /* @__PURE__ */ jsx("span", { children: "Not published yet." }),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
Link,
|
|
82
|
+
{
|
|
83
|
+
href,
|
|
84
|
+
className: cn("text-foreground rounded-sm underline", FOCUS_RING),
|
|
85
|
+
children: "Publishes"
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
const SEVERITY = {
|
|
93
|
+
error: { label: "Errors", tone: "destructive" },
|
|
94
|
+
warn: { label: "Warnings", tone: "warning" },
|
|
95
|
+
info: { label: "Notes", tone: "info" }
|
|
96
|
+
};
|
|
97
|
+
function uniqueFindings(findings) {
|
|
98
|
+
const seen = /* @__PURE__ */ new Set();
|
|
99
|
+
return findings.filter((finding) => {
|
|
100
|
+
const key = [
|
|
101
|
+
finding.severity,
|
|
102
|
+
finding.check,
|
|
103
|
+
finding.message,
|
|
104
|
+
finding.file ?? "",
|
|
105
|
+
finding.line ?? ""
|
|
106
|
+
].join("\0");
|
|
107
|
+
if (seen.has(key)) return false;
|
|
108
|
+
seen.add(key);
|
|
109
|
+
return true;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function FindingRow({ finding }) {
|
|
113
|
+
const where = finding.file ? `${finding.file}${finding.line ? `:${finding.line}` : ""}` : null;
|
|
114
|
+
return /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-1 px-4 py-3 text-sm", "data-test": "finding", children: [
|
|
115
|
+
/* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
116
|
+
/* @__PURE__ */ jsx("code", { className: "text-muted-foreground font-mono text-xs", children: finding.check }),
|
|
117
|
+
where ? /* @__PURE__ */ jsx("code", { className: "font-mono text-xs", children: where }) : null,
|
|
118
|
+
finding.resolvedAt ? /* @__PURE__ */ jsx(StatusBadge, { tone: "success", children: "Resolved" }) : null
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ jsx("span", { children: finding.message }),
|
|
121
|
+
finding.hint ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: finding.hint }) : null
|
|
122
|
+
] });
|
|
123
|
+
}
|
|
124
|
+
function VersionCard({
|
|
125
|
+
version,
|
|
126
|
+
open
|
|
127
|
+
}) {
|
|
128
|
+
const state = describePublishState(version.state);
|
|
129
|
+
const findings = uniqueFindings(version.findings ?? []);
|
|
130
|
+
const counts = countsLine(version);
|
|
131
|
+
return /* @__PURE__ */ jsx(
|
|
132
|
+
Card,
|
|
133
|
+
{
|
|
134
|
+
layout: "bleed",
|
|
135
|
+
className: "overflow-hidden p-0",
|
|
136
|
+
"data-test": "publish-version",
|
|
137
|
+
children: /* @__PURE__ */ jsxs("details", { open, className: "group", children: [
|
|
138
|
+
/* @__PURE__ */ jsxs(
|
|
139
|
+
"summary",
|
|
140
|
+
{
|
|
141
|
+
className: cn(
|
|
142
|
+
"hover:bg-muted flex cursor-pointer list-none flex-wrap items-center gap-x-3 gap-y-1 px-4 py-3",
|
|
143
|
+
FOCUS_RING
|
|
144
|
+
),
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
Icon,
|
|
148
|
+
{
|
|
149
|
+
name: "caret-right",
|
|
150
|
+
className: "text-muted-foreground size-4 transition-transform group-open:rotate-90",
|
|
151
|
+
"aria-hidden": true
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm font-medium", children: version.version }),
|
|
155
|
+
/* @__PURE__ */ jsx(StatusBadge, { tone: state.tone, children: state.label }),
|
|
156
|
+
/* @__PURE__ */ jsx(
|
|
157
|
+
"span",
|
|
158
|
+
{
|
|
159
|
+
className: "text-muted-foreground text-xs",
|
|
160
|
+
title: fullTime(version.submittedAt),
|
|
161
|
+
children: submittedLine(version)
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
counts ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground ml-auto text-xs", children: counts }) : null
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 border-t px-4 py-3", children: [
|
|
169
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: state.detail }),
|
|
170
|
+
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(
|
|
171
|
+
StatusBadge,
|
|
172
|
+
{
|
|
173
|
+
tone: stage.status === "pass" ? "success" : stage.status === "fail" ? "destructive" : "neutral",
|
|
174
|
+
children: [
|
|
175
|
+
stage.id,
|
|
176
|
+
" \xB7",
|
|
177
|
+
" ",
|
|
178
|
+
stage.status === "skipped" ? "skipped" : `${(stage.durationMs / 1e3).toFixed(1)}s`
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
) }, stage.id)) }) : null,
|
|
182
|
+
["error", "warn", "info"].map((severity) => {
|
|
183
|
+
const group = findings.filter((f) => f.severity === severity);
|
|
184
|
+
if (group.length === 0) return null;
|
|
185
|
+
const list = /* @__PURE__ */ jsx(
|
|
186
|
+
Card,
|
|
187
|
+
{
|
|
188
|
+
layout: "bleed",
|
|
189
|
+
render: /* @__PURE__ */ jsx("ul", {}),
|
|
190
|
+
className: "gap-0 divide-y overflow-hidden py-0",
|
|
191
|
+
children: group.map((finding, index) => /* @__PURE__ */ jsx(
|
|
192
|
+
FindingRow,
|
|
193
|
+
{
|
|
194
|
+
finding
|
|
195
|
+
},
|
|
196
|
+
finding.id ?? `${finding.check}-${index}`
|
|
197
|
+
))
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
const heading = /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
201
|
+
SEVERITY[severity].label,
|
|
202
|
+
/* @__PURE__ */ jsx(StatusBadge, { tone: SEVERITY[severity].tone, children: group.length })
|
|
203
|
+
] });
|
|
204
|
+
return severity === "info" ? /* @__PURE__ */ jsxs(
|
|
205
|
+
"details",
|
|
206
|
+
{
|
|
207
|
+
className: "group/notes flex flex-col gap-1",
|
|
208
|
+
"data-test": "publish-notes",
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ jsxs(
|
|
211
|
+
"summary",
|
|
212
|
+
{
|
|
213
|
+
className: cn(
|
|
214
|
+
"flex w-fit cursor-pointer list-none items-center gap-1 rounded-sm",
|
|
215
|
+
FOCUS_RING
|
|
216
|
+
),
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
Icon,
|
|
220
|
+
{
|
|
221
|
+
name: "caret-right",
|
|
222
|
+
className: "text-muted-foreground size-3.5 transition-transform group-open/notes:rotate-90",
|
|
223
|
+
"aria-hidden": true
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
heading
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
/* @__PURE__ */ jsx("div", { className: "pt-1", children: list })
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
severity
|
|
234
|
+
) : /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-1", children: [
|
|
235
|
+
/* @__PURE__ */ jsx("h4", { children: heading }),
|
|
236
|
+
list
|
|
237
|
+
] }, severity);
|
|
238
|
+
}),
|
|
239
|
+
findings.length === 0 && version.state !== "submitted" ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "No findings." }) : null,
|
|
240
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground font-mono text-xs", children: version.archiveSha256 ? `sha256 ${version.archiveSha256.slice(0, 16)}\u2026` : null })
|
|
241
|
+
] })
|
|
242
|
+
] })
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
function PublishesView({ name }) {
|
|
247
|
+
const publish = usePublishSnapshot();
|
|
248
|
+
if (publish.isPending) return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading publishes" });
|
|
249
|
+
if (publish.isError) {
|
|
250
|
+
return /* @__PURE__ */ jsx(Alert, { variant: "destructive", "data-test": "publishes-error", children: /* @__PURE__ */ jsxs(AlertDescription, { children: [
|
|
251
|
+
"Could not read the publish status from the harness server:",
|
|
252
|
+
" ",
|
|
253
|
+
publish.error.message,
|
|
254
|
+
". Check that ",
|
|
255
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
256
|
+
" is still running, then reload."
|
|
257
|
+
] }) });
|
|
258
|
+
}
|
|
259
|
+
const snapshot = publish.data.snapshot;
|
|
260
|
+
const header = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
261
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Publishes" }),
|
|
262
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
263
|
+
"Every version of ",
|
|
264
|
+
/* @__PURE__ */ jsx("code", { children: name }),
|
|
265
|
+
" sent with",
|
|
266
|
+
" ",
|
|
267
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos publish" }),
|
|
268
|
+
", where it is now, and what the checks found."
|
|
269
|
+
] }),
|
|
270
|
+
snapshot ? /* @__PURE__ */ jsx(HostFreshness, { fetchedAt: snapshot.fetchedAt, host: snapshot.host }) : null
|
|
271
|
+
] });
|
|
272
|
+
if (!snapshot) {
|
|
273
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "publishes", children: [
|
|
274
|
+
header,
|
|
275
|
+
/* @__PURE__ */ jsxs(EmptyNote, { icon: "paper-plane-tilt", title: "No publish status yet", children: [
|
|
276
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
277
|
+
" reads your publishes from Ekanos when it starts. If this stays empty, upgrade with ",
|
|
278
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos upgrade" }),
|
|
279
|
+
" ",
|
|
280
|
+
"and restart ",
|
|
281
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos dev" }),
|
|
282
|
+
"."
|
|
283
|
+
] })
|
|
284
|
+
] });
|
|
285
|
+
}
|
|
286
|
+
if (snapshot.unavailable) {
|
|
287
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "publishes", children: [
|
|
288
|
+
header,
|
|
289
|
+
/* @__PURE__ */ jsx(Alert, { variant: "warning", "data-test": "publishes-unavailable", children: /* @__PURE__ */ jsx(AlertDescription, { children: snapshot.unavailable.message }) })
|
|
290
|
+
] });
|
|
291
|
+
}
|
|
292
|
+
const pkg = findPublishedPackage(snapshot, name);
|
|
293
|
+
const versions = pkg ? sortVersions(pkg.versions) : [];
|
|
294
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "publishes", children: [
|
|
295
|
+
header,
|
|
296
|
+
versions.length === 0 ? /* @__PURE__ */ jsxs(
|
|
297
|
+
EmptyNote,
|
|
298
|
+
{
|
|
299
|
+
icon: "paper-plane-tilt",
|
|
300
|
+
title: "Not published yet",
|
|
301
|
+
"data-test": "publishes-none",
|
|
302
|
+
children: [
|
|
303
|
+
"Run ",
|
|
304
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos publish" }),
|
|
305
|
+
" from this package to send a version to",
|
|
306
|
+
" ",
|
|
307
|
+
snapshot.source ?? "your Source",
|
|
308
|
+
". It shows here within a minute."
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: versions.map((version, index) => /* @__PURE__ */ jsx(
|
|
312
|
+
VersionCard,
|
|
313
|
+
{
|
|
314
|
+
version,
|
|
315
|
+
open: index === 0
|
|
316
|
+
},
|
|
317
|
+
version.id
|
|
318
|
+
)) })
|
|
319
|
+
] });
|
|
320
|
+
}
|
|
321
|
+
export {
|
|
322
|
+
LatestPublishLine,
|
|
323
|
+
PublishChip,
|
|
324
|
+
PublishesView,
|
|
325
|
+
uniqueFindings
|
|
326
|
+
};
|
|
@@ -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`,
|
|
@@ -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;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CatalogProduct, CatalogSnapshot, PublishStatusSnapshot, PublishedPackage, PublishedVersion } from '@ekanos/integration-schema';
|
|
2
|
+
export declare const HOST_KEYS: {
|
|
3
|
+
catalog: readonly ['host', 'catalog'];
|
|
4
|
+
publish: readonly ['host', 'publish-status'];
|
|
5
|
+
};
|
|
6
|
+
export declare function useCatalogSnapshot(): import("@tanstack/react-query").UseQueryResult<{
|
|
7
|
+
snapshot: CatalogSnapshot | null;
|
|
8
|
+
}, Error>;
|
|
9
|
+
export declare function usePublishSnapshot(): import("@tanstack/react-query").UseQueryResult<{
|
|
10
|
+
snapshot: PublishStatusSnapshot | null;
|
|
11
|
+
}, Error>;
|
|
12
|
+
/** Ask `ekanos dev` for a fresh read; the polled files pick it up a moment later. */
|
|
13
|
+
export declare function useRefreshHostData(): import("@tanstack/react-query").UseMutationResult<void, Error, void, unknown>;
|
|
14
|
+
export type PublishTone = 'clear' | 'success' | 'warning' | 'destructive' | 'info' | 'neutral';
|
|
15
|
+
export declare function describePublishState(state: string): {
|
|
16
|
+
label: string;
|
|
17
|
+
tone: PublishTone;
|
|
18
|
+
detail: string;
|
|
19
|
+
};
|
|
20
|
+
/** Newest first, by submission time, then version string. */
|
|
21
|
+
export declare function sortVersions(versions: readonly PublishedVersion[]): PublishedVersion[];
|
|
22
|
+
/**
|
|
23
|
+
* The published package for a local one. A namespaced package (`acme/news`)
|
|
24
|
+
* is published under its slug, so either form matches.
|
|
25
|
+
*/
|
|
26
|
+
export declare function findPublishedPackage(snapshot: PublishStatusSnapshot | null | undefined, name: string): PublishedPackage | null;
|
|
27
|
+
export type CatalogKindFilter = 'all' | 'integration' | 'experience';
|
|
28
|
+
export type CatalogAvailabilityFilter = 'all' | 'enabled' | 'available' | 'mine';
|
|
29
|
+
/**
|
|
30
|
+
* The products to show: integrations and experiences only (a Feature is part
|
|
31
|
+
* of the platform, not something to build on), matching every word of the
|
|
32
|
+
* query, ranked with name matches first.
|
|
33
|
+
*/
|
|
34
|
+
export declare function filterCatalog(products: readonly CatalogProduct[], filters: {
|
|
35
|
+
query: string;
|
|
36
|
+
kind: CatalogKindFilter;
|
|
37
|
+
availability: CatalogAvailabilityFilter;
|
|
38
|
+
}): CatalogProduct[];
|
|
39
|
+
/**
|
|
40
|
+
* The name a person reads and types for a catalog entry: a Source's own
|
|
41
|
+
* package is listed by its token (`acme__news`) and named `acme/news`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function catalogPackageName(slug: string): string;
|
|
44
|
+
export declare function catalogHref(slug: string): string;
|