@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
|
@@ -11,6 +11,7 @@ import { cn } from "@ekanos/ui/utils";
|
|
|
11
11
|
import { useQueryClient } from "@tanstack/react-query";
|
|
12
12
|
import { ConnectControls } from "../components/connect-controls.js";
|
|
13
13
|
import { DocsLink } from "../components/docs-link.js";
|
|
14
|
+
import { PublishChip } from "../components/publish-status.js";
|
|
14
15
|
import {
|
|
15
16
|
CONNECTION_TYPE,
|
|
16
17
|
ConnectionStatusChip,
|
|
@@ -244,6 +245,7 @@ function IntegrationRow({
|
|
|
244
245
|
"v",
|
|
245
246
|
row.version
|
|
246
247
|
] }),
|
|
248
|
+
/* @__PURE__ */ jsx(PublishChip, { name: row.name }),
|
|
247
249
|
row.contractVersion ? /* @__PURE__ */ jsxs(
|
|
248
250
|
"span",
|
|
249
251
|
{
|
|
@@ -373,7 +375,8 @@ function ExperienceRow({ row }) {
|
|
|
373
375
|
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground font-mono text-xs", children: [
|
|
374
376
|
"v",
|
|
375
377
|
row.version
|
|
376
|
-
] })
|
|
378
|
+
] }),
|
|
379
|
+
/* @__PURE__ */ jsx(PublishChip, { name: row.name })
|
|
377
380
|
] }),
|
|
378
381
|
row.error ? /* @__PURE__ */ jsx("p", { className: "text-destructive text-xs", children: row.error }) : null,
|
|
379
382
|
row.integrations.length > 0 ? /* @__PURE__ */ jsxs(
|
|
@@ -491,7 +494,7 @@ function RepoHomePage() {
|
|
|
491
494
|
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-test": "repo-experiences", children: [
|
|
492
495
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
493
496
|
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Experiences" }),
|
|
494
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Each previews its widgets,
|
|
497
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Each previews its widgets, pages and workflows against the integrations it uses." })
|
|
495
498
|
] }),
|
|
496
499
|
experiences.length === 0 ? /* @__PURE__ */ jsxs(
|
|
497
500
|
EmptyNote,
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
loadExperience,
|
|
15
15
|
usedByIndex
|
|
16
16
|
} from "./experience-loader.js";
|
|
17
|
+
import { handleHostRoute } from "./host-snapshots.js";
|
|
17
18
|
import { publishIntegrationLookup } from "./integration-lookup.js";
|
|
18
19
|
import {
|
|
19
20
|
formatProvenanceLines,
|
|
@@ -338,6 +339,10 @@ function createEkanosApiRouter(partial = {}) {
|
|
|
338
339
|
return apiError(500, "no_project_root", `${root.message} ${root.hint}`);
|
|
339
340
|
const method = request.method.toUpperCase();
|
|
340
341
|
const [head, ...rest] = segments;
|
|
342
|
+
if (head === "host") {
|
|
343
|
+
const hosted = handleHostRoute(root.root, method, rest);
|
|
344
|
+
if (hosted) return hosted;
|
|
345
|
+
}
|
|
341
346
|
try {
|
|
342
347
|
if ((head === "integrations" || head === "slots") && rest.length === 0) {
|
|
343
348
|
if (method !== "GET")
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type CatalogSnapshot, type PublishStatusSnapshot } from '@ekanos/integration-schema';
|
|
2
|
+
export interface HostCatalogResponse {
|
|
3
|
+
/** Null until `ekanos dev` has written one: an older CLI, or the first read still in flight. */
|
|
4
|
+
snapshot: CatalogSnapshot | null;
|
|
5
|
+
}
|
|
6
|
+
export interface HostPublishResponse {
|
|
7
|
+
snapshot: PublishStatusSnapshot | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function readCatalogSnapshot(root: string): CatalogSnapshot | null;
|
|
10
|
+
export declare function readPublishSnapshot(root: string): PublishStatusSnapshot | null;
|
|
11
|
+
/** Ask the running `ekanos dev` for a fresh read of both snapshots. */
|
|
12
|
+
export declare function requestHostRefresh(root: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* `GET host/catalog`, `GET host/publish-status`, `POST host/refresh`, served
|
|
15
|
+
* from `root` (the project, or the repo root). Null for anything else, so the
|
|
16
|
+
* caller answers its own 404.
|
|
17
|
+
*/
|
|
18
|
+
export declare function handleHostRoute(root: string, method: string, rest: readonly string[]): Response | null;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CatalogSnapshotSchema,
|
|
3
|
+
PublishStatusSnapshotSchema
|
|
4
|
+
} from "@ekanos/integration-schema";
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
|
+
import * as path from "node:path";
|
|
7
|
+
const CATALOG_FILE = path.join(".ekanos", "catalog.json");
|
|
8
|
+
const PUBLISH_FILE = path.join(".ekanos", "publish-status.json");
|
|
9
|
+
const REFRESH_REQUEST = path.join(".ekanos", "refresh-request");
|
|
10
|
+
function readJson(root, file) {
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(fs.readFileSync(path.join(root, file), "utf8"));
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function readCatalogSnapshot(root) {
|
|
18
|
+
const parsed = CatalogSnapshotSchema.safeParse(readJson(root, CATALOG_FILE));
|
|
19
|
+
return parsed.success ? parsed.data : null;
|
|
20
|
+
}
|
|
21
|
+
function readPublishSnapshot(root) {
|
|
22
|
+
const parsed = PublishStatusSnapshotSchema.safeParse(
|
|
23
|
+
readJson(root, PUBLISH_FILE)
|
|
24
|
+
);
|
|
25
|
+
return parsed.success ? parsed.data : null;
|
|
26
|
+
}
|
|
27
|
+
function requestHostRefresh(root) {
|
|
28
|
+
const file = path.join(root, REFRESH_REQUEST);
|
|
29
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
30
|
+
fs.writeFileSync(file, `${(/* @__PURE__ */ new Date()).toISOString()}
|
|
31
|
+
`);
|
|
32
|
+
}
|
|
33
|
+
function json(body, status = 200) {
|
|
34
|
+
return new Response(JSON.stringify(body), {
|
|
35
|
+
status,
|
|
36
|
+
headers: {
|
|
37
|
+
"content-type": "application/json",
|
|
38
|
+
"cache-control": "no-store"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function handleHostRoute(root, method, rest) {
|
|
43
|
+
const [name] = rest;
|
|
44
|
+
if (rest.length !== 1) return null;
|
|
45
|
+
if (name === "catalog") {
|
|
46
|
+
if (method !== "GET") return json({ error: "GET only." }, 405);
|
|
47
|
+
const body = { snapshot: readCatalogSnapshot(root) };
|
|
48
|
+
return json(body);
|
|
49
|
+
}
|
|
50
|
+
if (name === "publish-status") {
|
|
51
|
+
if (method !== "GET") return json({ error: "GET only." }, 405);
|
|
52
|
+
const body = { snapshot: readPublishSnapshot(root) };
|
|
53
|
+
return json(body);
|
|
54
|
+
}
|
|
55
|
+
if (name === "refresh") {
|
|
56
|
+
if (method !== "POST") return json({ error: "POST only." }, 405);
|
|
57
|
+
requestHostRefresh(root);
|
|
58
|
+
return json({ requested: true }, 202);
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
handleHostRoute,
|
|
64
|
+
readCatalogSnapshot,
|
|
65
|
+
readPublishSnapshot,
|
|
66
|
+
requestHostRefresh
|
|
67
|
+
};
|
|
@@ -5,6 +5,7 @@ import { deriveConnectionFacts } from "../lib/connection-facts.js";
|
|
|
5
5
|
import {
|
|
6
6
|
createEkanosApiRouter
|
|
7
7
|
} from "./ekanos-api-router.js";
|
|
8
|
+
import { handleHostRoute } from "./host-snapshots.js";
|
|
8
9
|
import { getLiveStore } from "./live-context.js";
|
|
9
10
|
import { isLoopbackHost, loopbackRefusal } from "./loopback-guard.js";
|
|
10
11
|
import { hasStoredOauthConnection } from "./oauth-persistence.js";
|
|
@@ -323,6 +324,14 @@ function createRepoApiRouter(partial) {
|
|
|
323
324
|
}
|
|
324
325
|
const method = request.method.toUpperCase();
|
|
325
326
|
const [head, second, third, fourth] = segments;
|
|
327
|
+
if (head === "host") {
|
|
328
|
+
const hosted = handleHostRoute(
|
|
329
|
+
partial.repoRoot,
|
|
330
|
+
method,
|
|
331
|
+
segments.slice(1)
|
|
332
|
+
);
|
|
333
|
+
if (hosted) return hosted;
|
|
334
|
+
}
|
|
326
335
|
try {
|
|
327
336
|
if (head === "repo" && segments.length === 1) {
|
|
328
337
|
if (method !== "GET") {
|
|
@@ -12,6 +12,18 @@ export declare function readSessionCatalog(projectRoot: string): {
|
|
|
12
12
|
slug: string;
|
|
13
13
|
name: string;
|
|
14
14
|
summary: string | null;
|
|
15
|
+
description?: string | null | undefined;
|
|
16
|
+
version?: string | null | undefined;
|
|
17
|
+
href?: string | null | undefined;
|
|
18
|
+
experience?: {
|
|
19
|
+
integrations: {
|
|
20
|
+
name: string;
|
|
21
|
+
version: string;
|
|
22
|
+
}[];
|
|
23
|
+
widgets: number;
|
|
24
|
+
pages: number;
|
|
25
|
+
workflows: number;
|
|
26
|
+
} | null | undefined;
|
|
15
27
|
kind: "experience" | "feature" | "integration";
|
|
16
28
|
availability: "available" | "enabled" | "turned-off";
|
|
17
29
|
partner: boolean;
|
package/dist/routes.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export { TriggersPage } from './internal/routes/triggers-page.js';
|
|
|
39
39
|
* /integrations/[slug]/events IntegrationEventsPage
|
|
40
40
|
* /integrations/[slug]/health IntegrationHealthPage
|
|
41
41
|
* /integrations/[slug]/runs IntegrationRunsPage
|
|
42
|
+
* /integrations/[slug]/publishes IntegrationPublishesPage
|
|
42
43
|
* /integrations/[slug]/preview/… PreviewLayout + the Preview surfaces
|
|
43
44
|
* /experience ExperienceSummaryPage
|
|
44
45
|
* /experience/widgets ExperienceWidgetsPage
|
|
@@ -50,9 +51,15 @@ export { TriggersPage } from './internal/routes/triggers-page.js';
|
|
|
50
51
|
* /experience/workflows/[id] ExperienceWorkflowPage
|
|
51
52
|
* /experience/review-queue ExperienceReviewQueuePage
|
|
52
53
|
* /experience/runs ExperienceRunsPage
|
|
54
|
+
* /experience/publishes ExperiencePublishesPage
|
|
55
|
+
* /catalog (layout) CatalogLayout
|
|
56
|
+
* /catalog CatalogPage
|
|
57
|
+
* /catalog/[slug] CatalogProductPage
|
|
53
58
|
* / (mode-aware home) ConsoleHomePage
|
|
54
59
|
*/
|
|
55
60
|
export { ConsoleLayout } from './internal/routes/integrations-layout.js';
|
|
61
|
+
export { ExperiencePublishesPage, IntegrationPublishesPage, } from './internal/routes/publishes-pages.js';
|
|
62
|
+
export { CatalogLayout, CatalogPage, CatalogProductPage, } from './internal/routes/catalog-pages.js';
|
|
56
63
|
export { ConsoleHomePage } from './internal/routes/console-home-page.js';
|
|
57
64
|
export { IntegrationsListPage } from './internal/routes/integrations-list-page.js';
|
|
58
65
|
export { IntegrationOverviewPage } from './internal/routes/integrations-overview-page.js';
|
package/dist/routes.js
CHANGED
|
@@ -11,6 +11,15 @@ import { TilePage } from "./internal/routes/tile-page.js";
|
|
|
11
11
|
import { ActivationPage } from "./internal/routes/activation-page.js";
|
|
12
12
|
import { TriggersPage } from "./internal/routes/triggers-page.js";
|
|
13
13
|
import { ConsoleLayout } from "./internal/routes/integrations-layout.js";
|
|
14
|
+
import {
|
|
15
|
+
ExperiencePublishesPage,
|
|
16
|
+
IntegrationPublishesPage
|
|
17
|
+
} from "./internal/routes/publishes-pages.js";
|
|
18
|
+
import {
|
|
19
|
+
CatalogLayout,
|
|
20
|
+
CatalogPage,
|
|
21
|
+
CatalogProductPage
|
|
22
|
+
} from "./internal/routes/catalog-pages.js";
|
|
14
23
|
import { ConsoleHomePage } from "./internal/routes/console-home-page.js";
|
|
15
24
|
import { IntegrationsListPage } from "./internal/routes/integrations-list-page.js";
|
|
16
25
|
import { IntegrationOverviewPage } from "./internal/routes/integrations-overview-page.js";
|
|
@@ -41,12 +50,16 @@ import {
|
|
|
41
50
|
import { NotFoundPage } from "./internal/components/not-found-state.js";
|
|
42
51
|
export {
|
|
43
52
|
ActivationPage,
|
|
53
|
+
CatalogLayout,
|
|
54
|
+
CatalogPage,
|
|
55
|
+
CatalogProductPage,
|
|
44
56
|
ConsoleHomePage,
|
|
45
57
|
ConsoleLayout,
|
|
46
58
|
ExperienceConnectPage,
|
|
47
59
|
ExperienceLayoutPage,
|
|
48
60
|
ExperiencePageHost,
|
|
49
61
|
ExperiencePagesPage,
|
|
62
|
+
ExperiencePublishesPage,
|
|
50
63
|
ExperienceReviewQueuePage,
|
|
51
64
|
ExperienceRunsPage,
|
|
52
65
|
ExperienceSummaryPage,
|
|
@@ -61,6 +74,7 @@ export {
|
|
|
61
74
|
IntegrationOperationPage,
|
|
62
75
|
IntegrationOperationsPage,
|
|
63
76
|
IntegrationOverviewPage,
|
|
77
|
+
IntegrationPublishesPage,
|
|
64
78
|
IntegrationRunsPage,
|
|
65
79
|
IntegrationsListPage,
|
|
66
80
|
LegacyPreviewRedirect,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekanos/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.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.30.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.30.0",
|
|
81
|
+
"@ekanos/ui": "0.30.0",
|
|
82
82
|
"@kit/tsconfig": "0.1.0",
|
|
83
83
|
"@tailwindcss/postcss": "4.3.5",
|
|
84
84
|
"@tanstack/react-query": "5.107.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.30.0",
|
|
102
|
+
"@ekanos/ui": "^0.30.0",
|
|
103
103
|
"@tanstack/react-query": "^5.101.4",
|
|
104
104
|
"next": "^16.0.0",
|
|
105
105
|
"next-intl": "^4.14.7",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"zod": "^3.25.76 || ^4.0.0"
|
|
111
111
|
},
|
|
112
112
|
"ekanos": {
|
|
113
|
-
"shellContract":
|
|
113
|
+
"shellContract": 8
|
|
114
114
|
},
|
|
115
115
|
"scripts": {
|
|
116
116
|
"build": "tsup && tsc -p tsconfig.build.json && node scripts/rewrite-esm-specifiers.mjs && node scripts/copy-fonts.mjs && node scripts/build-css.mjs",
|