@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.
Files changed (32) hide show
  1. package/dist/api-types.d.ts +21 -0
  2. package/dist/internal/components/host-freshness.d.ts +12 -0
  3. package/dist/internal/components/host-freshness.js +61 -0
  4. package/dist/internal/components/publish-status.d.ts +39 -0
  5. package/dist/internal/components/publish-status.js +363 -0
  6. package/dist/internal/components/shell-header.js +16 -0
  7. package/dist/internal/components/surface-nav.js +12 -0
  8. package/dist/internal/lib/console-client.js +2 -1
  9. package/dist/internal/lib/console-types.d.ts +4 -2
  10. package/dist/internal/lib/docs-links.d.ts +2 -0
  11. package/dist/internal/lib/docs-links.js +6 -1
  12. package/dist/internal/lib/host-data.d.ts +44 -0
  13. package/dist/internal/lib/host-data.js +159 -0
  14. package/dist/internal/lib/name-scope.d.ts +28 -0
  15. package/dist/internal/lib/name-scope.js +54 -0
  16. package/dist/internal/routes/catalog-pages.d.ts +15 -0
  17. package/dist/internal/routes/catalog-pages.js +425 -0
  18. package/dist/internal/routes/experience-summary-page.js +9 -0
  19. package/dist/internal/routes/integrations-overview-page.js +11 -1
  20. package/dist/internal/routes/publishes-pages.d.ts +4 -0
  21. package/dist/internal/routes/publishes-pages.js +19 -0
  22. package/dist/internal/routes/repo-home-page.js +7 -2
  23. package/dist/internal/server/ekanos-api-router.js +8 -0
  24. package/dist/internal/server/host-snapshots.d.ts +18 -0
  25. package/dist/internal/server/host-snapshots.js +67 -0
  26. package/dist/internal/server/package-naming.d.ts +14 -0
  27. package/dist/internal/server/package-naming.js +43 -0
  28. package/dist/internal/server/repo-api-router.js +17 -3
  29. package/dist/internal/server/session-catalog.d.ts +12 -0
  30. package/dist/routes.d.ts +7 -0
  31. package/dist/routes.js +14 -0
  32. package/package.json +7 -7
@@ -0,0 +1,14 @@
1
+ import { type Availability } from '@ekanos/integration-schema/repo';
2
+ import type { PackageNaming } from '../../api-types.js';
3
+ /**
4
+ * How a package publishes, from its `ekanos.json` and the repo around it. The
5
+ * namespace falls back to the package's own `source` (the Source slug a new
6
+ * Source's namespace defaults from), the same inference discovery makes for a
7
+ * repo.
8
+ */
9
+ export declare function namingOf(pkg: {
10
+ ekanosJson: Record<string, unknown>;
11
+ availability?: Availability;
12
+ }, repoNamespace: string | null): PackageNaming;
13
+ /** {@link namingOf} for the project at `projectRoot`; null when it has no readable `ekanos.json`. */
14
+ export declare function readProjectNaming(projectRoot: string): PackageNaming | null;
@@ -0,0 +1,43 @@
1
+ import { isValidNamespace } from "@ekanos/integration-schema";
2
+ import {
3
+ AvailabilitySchema
4
+ } from "@ekanos/integration-schema/repo";
5
+ import * as fs from "node:fs";
6
+ import * as path from "node:path";
7
+ import { repoOf } from "./integration-resolver.js";
8
+ function namingOf(pkg, repoNamespace) {
9
+ const source = pkg.ekanosJson.source;
10
+ return {
11
+ availability: pkg.availability?.mode === "global" ? "global" : "restricted",
12
+ namespace: repoNamespace ?? (typeof source === "string" && isValidNamespace(source) ? source : null)
13
+ };
14
+ }
15
+ function readProjectNaming(projectRoot) {
16
+ let ekanosJson;
17
+ try {
18
+ const parsed = JSON.parse(
19
+ fs.readFileSync(path.join(projectRoot, "ekanos.json"), "utf8")
20
+ );
21
+ if (typeof parsed !== "object" || parsed === null) return null;
22
+ ekanosJson = parsed;
23
+ } catch (error) {
24
+ if (error.code === "ENOENT") return null;
25
+ console.error(
26
+ `[harness:naming] ${projectRoot}/ekanos.json could not be read`,
27
+ error
28
+ );
29
+ return null;
30
+ }
31
+ const availability = AvailabilitySchema.safeParse(ekanosJson.availability);
32
+ return namingOf(
33
+ {
34
+ ekanosJson,
35
+ ...availability.success ? { availability: availability.data } : {}
36
+ },
37
+ repoOf(projectRoot)?.namespace ?? null
38
+ );
39
+ }
40
+ export {
41
+ namingOf,
42
+ readProjectNaming
43
+ };
@@ -5,9 +5,11 @@ 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";
12
+ import { namingOf } from "./package-naming.js";
11
13
  import { readSessionCatalog } from "./session-catalog.js";
12
14
  function json(body, init = {}) {
13
15
  return new Response(JSON.stringify(body), {
@@ -263,13 +265,17 @@ function createRepoApiRouter(partial) {
263
265
  for (const pkg of integrationPackages) {
264
266
  const { row, connection } = await integrationRow(request, pkg);
265
267
  connections.set(pkg.name, connection);
266
- integrations.push(row);
268
+ integrations.push({ ...row, naming: namingOf(pkg, repo.namespace) });
267
269
  }
268
270
  const experiences = [];
269
271
  for (const pkg of experiencePackages) {
270
- experiences.push(
271
- await experienceRow(request, pkg, connections, repoPackageName)
272
+ const row = await experienceRow(
273
+ request,
274
+ pkg,
275
+ connections,
276
+ repoPackageName
272
277
  );
278
+ experiences.push({ ...row, naming: namingOf(pkg, repo.namespace) });
273
279
  }
274
280
  for (const experience of experiences) {
275
281
  for (const used of experience.integrations) {
@@ -323,6 +329,14 @@ function createRepoApiRouter(partial) {
323
329
  }
324
330
  const method = request.method.toUpperCase();
325
331
  const [head, second, third, fourth] = segments;
332
+ if (head === "host") {
333
+ const hosted = handleHostRoute(
334
+ partial.repoRoot,
335
+ method,
336
+ segments.slice(1)
337
+ );
338
+ if (hosted) return hosted;
339
+ }
326
340
  try {
327
341
  if (head === "repo" && segments.length === 1) {
328
342
  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.29.0",
3
+ "version": "0.31.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.29.0",
75
+ "@ekanos/integration-schema": "0.31.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.29.0",
81
- "@ekanos/ui": "0.29.0",
80
+ "@ekanos/sdk": "0.31.0",
81
+ "@ekanos/ui": "0.31.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.29.0",
102
- "@ekanos/ui": "^0.29.0",
101
+ "@ekanos/sdk": "^0.31.0",
102
+ "@ekanos/ui": "^0.31.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": 7
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",