@ekanos/harness 0.19.0 → 0.21.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.
@@ -17,7 +17,7 @@ function AskAssistantBridge() {
17
17
  Icon,
18
18
  {
19
19
  name: "fa-solid fa-wand-magic-sparkles",
20
- className: "text-primary h-5 w-5"
20
+ className: "text-muted-foreground h-5 w-5"
21
21
  }
22
22
  ),
23
23
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
@@ -194,7 +194,7 @@ function DevToolbar() {
194
194
  live && controls.data ? /* @__PURE__ */ jsxs(
195
195
  "span",
196
196
  {
197
- className: "text-primary text-label flex items-center gap-2",
197
+ className: "text-primary-strong text-label flex items-center gap-2",
198
198
  "data-test": "toolbar-live-badge",
199
199
  children: [
200
200
  /* @__PURE__ */ jsx(Icon, { name: "fa-solid fa-tower-broadcast", className: "h-4 w-4" }),
@@ -141,6 +141,12 @@ function experienceTabs(base = "/experience", repo = false) {
141
141
  icon: "fa-solid fa-table-cells-large",
142
142
  prefix: true
143
143
  },
144
+ {
145
+ href: `${base}/layout`,
146
+ label: "Layout",
147
+ icon: "fa-solid fa-table-columns",
148
+ prefix: true
149
+ },
144
150
  {
145
151
  href: `${base}/workflows`,
146
152
  label: "Workflows",
@@ -1,15 +1,31 @@
1
1
  import { type ComponentType, type ReactNode } from 'react';
2
+ import type { SuggestedLayout } from '@ekanos/sdk/experience';
2
3
  import { QueryClient } from '@tanstack/react-query';
3
4
  import type { HarnessWidget } from '../../registry.js';
4
5
  import { type ConsoleClient } from './console-client.js';
5
6
  /** What the experience repo's entry contributes beyond the server's JSON. */
6
- export interface ExperienceSurfaces {
7
- widgets: HarnessWidget[];
8
- pages: Array<{
9
- id: string;
7
+ export interface ExperienceSurfacePage {
8
+ id: string;
9
+ title: string;
10
+ /** Absent on a definition from before page kinds: a custom page. */
11
+ kind?: 'overview' | 'canvas' | 'custom';
12
+ path?: string;
13
+ /** Canvas pages: ids of the experience's own widgets. */
14
+ widgets?: readonly string[];
15
+ /** Custom pages: the sub-routes the component handles. */
16
+ routes?: ReadonlyArray<{
17
+ path: string;
10
18
  title: string;
11
- component: ComponentType;
12
19
  }>;
20
+ /** Absent on a canvas, and on an overview that uses the host's default. */
21
+ component?: ComponentType<{
22
+ path: string[];
23
+ }>;
24
+ }
25
+ export interface ExperienceSurfaces {
26
+ widgets: HarnessWidget[];
27
+ pages: ExperienceSurfacePage[];
28
+ suggestedLayout?: SuggestedLayout;
13
29
  }
14
30
  /**
15
31
  * Where the console's links point. A single project mounts the Experience
@@ -0,0 +1,8 @@
1
+ /**
2
+ * How the experience's `suggestedLayout` would arrange for each audience: a nav
3
+ * of workspaces, each a canvas of widgets and a list of pages. The "viewing as"
4
+ * switcher is built from the audience names the layout itself carries, plus
5
+ * Everyone. A Source maps a name to its own audience of the same name when the
6
+ * layout is applied; this view shows what each name would get.
7
+ */
8
+ export declare function ExperienceLayoutPage(): import("react").JSX.Element;
@@ -0,0 +1,126 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import Link from "next/link";
5
+ import {
6
+ layoutAudienceNames,
7
+ resolveLayoutForAudience
8
+ } from "@ekanos/sdk/experience";
9
+ import { Button } from "@ekanos/ui/button";
10
+ import { Card } from "@ekanos/ui/card";
11
+ import { StatusBadge } from "@ekanos/ui/status-badge";
12
+ import { WidgetSurface } from "../components/widget-surface.js";
13
+ import { useConsoleLinks, useExperienceSurfaces } from "../lib/console-context.js";
14
+ import { useProject } from "../lib/console-hooks.js";
15
+ const EVERYONE = "";
16
+ function ExperienceLayoutPage() {
17
+ const project = useProject();
18
+ const links = useConsoleLinks();
19
+ const { widgets, pages, suggestedLayout } = useExperienceSurfaces();
20
+ const [view, setView] = useState({ audience: EVERYONE, workspace: "" });
21
+ if (!suggestedLayout) {
22
+ return /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", "data-test": "layout-empty", children: [
23
+ "This experience suggests no layout. Add ",
24
+ /* @__PURE__ */ jsx("code", { children: "suggestedLayout" }),
25
+ " to",
26
+ " ",
27
+ /* @__PURE__ */ jsx("code", { children: "defineExperience" }),
28
+ " to show how its widgets and pages would arrange into workspaces."
29
+ ] });
30
+ }
31
+ const audiences = layoutAudienceNames(suggestedLayout);
32
+ const resolved = resolveLayoutForAudience(
33
+ suggestedLayout,
34
+ view.audience === EVERYONE ? null : view.audience
35
+ );
36
+ const active = resolved.workspaces.find(
37
+ (workspace) => workspace.slug === view.workspace
38
+ ) ?? resolved.workspaces[0];
39
+ const productSlug = project.data?.name ?? "experience";
40
+ const shown = (refs) => refs.flatMap((ref) => {
41
+ const id = ref.slice(ref.indexOf(":") + 1);
42
+ const widget = widgets.find((w) => w.id === id);
43
+ return widget ? [widget] : [];
44
+ });
45
+ const itemRefs = active?.items.map((item) => item.ref) ?? [];
46
+ const widgetItems = shown(
47
+ itemRefs.filter((ref) => ref.startsWith("widget:"))
48
+ );
49
+ const pageItems = itemRefs.filter((ref) => ref.startsWith("page:")).map((ref) => ref.slice("page:".length)).flatMap((id) => {
50
+ const page = pages.find((p) => p.id === id);
51
+ return page ? [page] : [];
52
+ });
53
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-layout", children: [
54
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
55
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: "Suggested layout" }),
56
+ /* @__PURE__ */ jsxs("label", { className: "text-meta ml-auto flex items-center gap-2", children: [
57
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Viewing as" }),
58
+ /* @__PURE__ */ jsxs(
59
+ "select",
60
+ {
61
+ value: view.audience,
62
+ onChange: (event) => setView({ audience: event.target.value, workspace: "" }),
63
+ className: "border-input bg-background text-meta rounded-md border px-3 py-2",
64
+ "data-test": "layout-audience",
65
+ children: [
66
+ /* @__PURE__ */ jsx("option", { value: EVERYONE, children: "Everyone" }),
67
+ audiences.map((name) => /* @__PURE__ */ jsx("option", { value: name, children: name }, name))
68
+ ]
69
+ }
70
+ )
71
+ ] })
72
+ ] }),
73
+ resolved.workspaces.length === 0 ? /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-meta", "data-test": "layout-none", children: [
74
+ "Nothing in this layout is for",
75
+ " ",
76
+ view.audience === EVERYONE ? "everyone" : view.audience,
77
+ "."
78
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
79
+ /* @__PURE__ */ jsx(
80
+ "nav",
81
+ {
82
+ "aria-label": "Workspaces",
83
+ className: "flex flex-wrap gap-1",
84
+ "data-test": "layout-workspaces",
85
+ children: resolved.workspaces.map((workspace) => /* @__PURE__ */ jsx(
86
+ Button,
87
+ {
88
+ variant: workspace.slug === active?.slug ? "secondary" : "ghost",
89
+ size: "sm",
90
+ "aria-current": workspace.slug === active?.slug ? "page" : void 0,
91
+ onClick: () => setView((prev) => ({ ...prev, workspace: workspace.slug })),
92
+ "data-test": `layout-workspace-${workspace.slug}`,
93
+ children: workspace.name
94
+ },
95
+ workspace.slug
96
+ ))
97
+ }
98
+ ),
99
+ widgetItems.length > 0 ? /* @__PURE__ */ jsx(WidgetSurface, { widgets: widgetItems, productSlug }) : null,
100
+ pageItems.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2", "data-test": "layout-pages", children: pageItems.map((page) => /* @__PURE__ */ jsxs(
101
+ Card,
102
+ {
103
+ layout: "bleed",
104
+ render: /* @__PURE__ */ jsx("li", {}),
105
+ className: "flex items-center gap-3 p-4",
106
+ "data-test": `layout-page-${page.id}`,
107
+ children: [
108
+ /* @__PURE__ */ jsx(
109
+ Link,
110
+ {
111
+ href: `${links.experience}/pages/${page.id}`,
112
+ className: "text-label hover:underline",
113
+ children: page.title
114
+ }
115
+ ),
116
+ /* @__PURE__ */ jsx(StatusBadge, { tone: "neutral", children: page.kind ?? "custom" })
117
+ ]
118
+ },
119
+ page.id
120
+ )) }) : null
121
+ ] })
122
+ ] });
123
+ }
124
+ export {
125
+ ExperienceLayoutPage
126
+ };
@@ -1,2 +1,7 @@
1
- /** A page host: the experience page in a sidebar-less frame. */
1
+ /**
2
+ * A page host: the experience page in a sidebar-less frame. A canvas shows its
3
+ * own widgets in the dashboard grid; a custom page mounts its component with
4
+ * the route below its path (`path` prop); an overview without a component gets
5
+ * the host's default, every widget of the experience.
6
+ */
2
7
  export declare function ExperiencePageHost(): import("react").JSX.Element;
@@ -1,17 +1,78 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
3
4
  import { notFound, useParams } from "next/navigation";
4
- import { useExperienceSurfaces } from "../lib/console-context.js";
5
+ import { cn } from "@ekanos/ui/utils";
6
+ import { WidgetSurface } from "../components/widget-surface.js";
7
+ import { useConsoleLinks, useExperienceSurfaces } from "../lib/console-context.js";
8
+ import { useProject } from "../lib/console-hooks.js";
5
9
  function ExperiencePageHost() {
6
- const { id } = useParams();
7
- const { pages } = useExperienceSurfaces();
10
+ const { id, path: rawPath } = useParams();
11
+ const { pages, widgets } = useExperienceSurfaces();
12
+ const links = useConsoleLinks();
13
+ const project = useProject();
8
14
  const page = pages.find((entry) => entry.id === id);
9
15
  if (!page) notFound();
16
+ const kind = page.kind ?? "custom";
17
+ const path = rawPath ?? [];
18
+ const sub = path.join("/");
19
+ const productSlug = project.data?.name ?? "experience";
20
+ if (sub !== "" && !page.routes?.some((route) => route.path === sub)) {
21
+ notFound();
22
+ }
23
+ const base = `${links.experience}/pages/${page.id}`;
10
24
  const Page = page.component;
11
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-page", children: [
12
- /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: page.title }),
13
- /* @__PURE__ */ jsx("div", { className: "rounded-lg border p-5", children: /* @__PURE__ */ jsx(Page, {}) })
14
- ] });
25
+ return /* @__PURE__ */ jsxs(
26
+ "div",
27
+ {
28
+ className: "flex flex-col gap-4",
29
+ "data-test": "experience-page",
30
+ "data-page-kind": kind,
31
+ children: [
32
+ /* @__PURE__ */ jsx("h2", { className: "heading-subhead-lg font-normal", children: page.title }),
33
+ page.routes && page.routes.length > 0 ? /* @__PURE__ */ jsx(
34
+ "nav",
35
+ {
36
+ "aria-label": `${page.title} sections`,
37
+ className: "flex flex-wrap gap-1",
38
+ "data-test": "experience-page-routes",
39
+ children: [{ path: "", title: page.title }, ...page.routes].map((route) => /* @__PURE__ */ jsx(
40
+ Link,
41
+ {
42
+ href: route.path === "" ? base : `${base}/${route.path}`,
43
+ "aria-current": route.path === sub ? "page" : void 0,
44
+ className: cn(
45
+ "text-meta rounded-md px-3 py-2",
46
+ route.path === sub ? "bg-accent text-accent-foreground text-label" : "text-muted-foreground hover:bg-accent/50"
47
+ ),
48
+ children: route.title
49
+ },
50
+ route.path
51
+ ))
52
+ }
53
+ ) : null,
54
+ kind === "canvas" ? /* @__PURE__ */ jsx(
55
+ WidgetSurface,
56
+ {
57
+ widgets: widgets.filter(
58
+ (widget) => page.widgets?.includes(widget.id)
59
+ ),
60
+ productSlug
61
+ }
62
+ ) : Page ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border p-5", children: /* @__PURE__ */ jsx(Page, { path }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
63
+ /* @__PURE__ */ jsx(
64
+ "p",
65
+ {
66
+ className: "text-muted-foreground text-meta",
67
+ "data-test": "default-overview",
68
+ children: "No overview component: the host shows all of this experience's widgets."
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx(WidgetSurface, { widgets, productSlug })
72
+ ] })
73
+ ]
74
+ }
75
+ );
15
76
  }
16
77
  export {
17
78
  ExperiencePageHost
@@ -15,7 +15,9 @@ export declare class ContractFileError extends Error {
15
15
  /** Read and fully verify one contract file. Throws on anything inadmissible. */
16
16
  export declare function readContractFile(file: string): Contract;
17
17
  /**
18
- * Every contract in `dir` for `integration`. Two spellings are read: the
18
+ * Every contract in `dir` for `integration`, a package **token** (`slug` or
19
+ * `ns__slug`), so a namespaced package never matches a global file of the same
20
+ * slug. Two spellings are read: the
19
21
  * monorepo registry's `<integration>.contract.json` and the experience
20
22
  * snapshot's `<integration>@<line>.contract.json`. A file that fails
21
23
  * verification throws — a corrupt registry must not look like "absent".
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  compareSemver,
3
+ contractToken,
3
4
  verifyContract
4
5
  } from "@ekanos/integration-schema";
5
6
  import * as fs from "node:fs";
@@ -41,14 +42,16 @@ function listContractsInDir(dir, integration) {
41
42
  }
42
43
  const out = [];
43
44
  for (const name of names.sort()) {
44
- const match = /^([a-z][a-z0-9-]*)(?:@(\d+(?:\.\d+)?))?\.contract\.json$/.exec(name);
45
+ const match = /^([a-z][a-z0-9-]*(?:__[a-z][a-z0-9-]*)?)(?:@(\d+(?:\.\d+)?))?\.contract\.json$/.exec(
46
+ name
47
+ );
45
48
  if (!match || match[1] !== integration) continue;
46
49
  const file = path.join(dir, name);
47
50
  const contract = readContractFile(file);
48
- if (contract.integration !== integration) {
51
+ if (contractToken(contract) !== integration) {
49
52
  throw new ContractFileError(
50
53
  file,
51
- `declares integration "${contract.integration}", not "${integration}".`
54
+ `declares integration "${contractToken(contract)}", not "${integration}".`
52
55
  );
53
56
  }
54
57
  out.push({ contract, file });
@@ -1,3 +1,4 @@
1
+ import { integrationRefToken } from "@ekanos/integration-schema";
1
2
  import { importEntryFromSource } from "./definition-loader.js";
2
3
  import { readProjectManifest } from "./project-manifest.js";
3
4
  function isRecord(value) {
@@ -130,10 +131,13 @@ function usedByIndex(experience, declaredIntegrations) {
130
131
  if (step.type !== "fusion_tool") continue;
131
132
  const integration = typeof step.slot === "string" ? declaredIntegrations.get(step.slot) : void 0;
132
133
  if (integration && typeof step.tool === "string") {
133
- add(`${integration.integration}@${integration.version}/${step.tool}`, {
134
- kind: "workflow",
135
- id: workflow.id
136
- });
134
+ add(
135
+ `${integrationRefToken(integration.integration) ?? integration.integration}@${integration.version}/${step.tool}`,
136
+ {
137
+ kind: "workflow",
138
+ id: workflow.id
139
+ }
140
+ );
137
141
  }
138
142
  }
139
143
  }
@@ -109,8 +109,9 @@ export interface ResolveIntegrationsOptions {
109
109
  */
110
110
  export declare function repoOf(projectRoot: string, notices?: string[]): RepoDiscovery | null;
111
111
  /**
112
- * An integration package of the same repo as `projectRoot` with this name, other
113
- * than the project itself. Same-repo is not an override: it needs no
112
+ * An integration package of the same repo as `projectRoot` that `name` (a
113
+ * reference: `slug` or `ns/slug`) names, other than the project itself. A
114
+ * namespaced reference matches only under the repo's own namespace. Same-repo is not an override: it needs no
114
115
  * `ekanos.local.json` and never blocks publishing.
115
116
  */
116
117
  export declare function sameRepoPackage(repo: RepoDiscovery | null, projectRoot: string, name: string): RepoPackage | null;
@@ -1,10 +1,13 @@
1
1
  import {
2
- compatLine
2
+ compatLine,
3
+ contractForRef,
4
+ parseIntegrationRef
3
5
  } from "@ekanos/integration-schema";
4
6
  import {
5
7
  RepoManifestError,
6
8
  discoverRepo,
7
- findRepoRoot
9
+ findRepoRoot,
10
+ repoIntegrationForRef
8
11
  } from "@ekanos/integration-schema/repo";
9
12
  import * as fs from "node:fs";
10
13
  import * as path from "node:path";
@@ -41,9 +44,8 @@ function repoOf(projectRoot, notices) {
41
44
  function sameRepoPackage(repo, projectRoot, name) {
42
45
  if (!repo) return null;
43
46
  const here = path.resolve(projectRoot);
44
- return repo.packages.find(
45
- (pkg) => pkg.kind === "integration" && pkg.name === name && pkg.dir !== here
46
- ) ?? null;
47
+ const pkg = repoIntegrationForRef(repo, name);
48
+ return pkg && pkg.dir !== here ? pkg : null;
47
49
  }
48
50
  function relativeToRepo(repo, dir) {
49
51
  if (!repo) return void 0;
@@ -77,7 +79,7 @@ function pinProblems(entry, contract, lines) {
77
79
  return problems;
78
80
  }
79
81
  for (const id of entry.operations) {
80
- const expectedPrefix = `${entry.name}@${entry.version}/`;
82
+ const expectedPrefix = `${parseIntegrationRef(entry.name).slug}@${entry.version}/`;
81
83
  if (!id.startsWith(expectedPrefix) || !findOperation(contract, id)) {
82
84
  problems.push(
83
85
  `integration "${entry.name}": ${entry.name}@${entry.version} does not provide ${opKey(id) || id}.`
@@ -284,7 +286,8 @@ async function resolveLocal(entry, override, bindingMode, options, snapshotDir,
284
286
  `integration "${entry.name}": ${error instanceof Error ? error.message : String(error)}`
285
287
  );
286
288
  }
287
- if (!overrideManifest.slugs.includes(entry.name)) {
289
+ const ref = parseIntegrationRef(entry.name);
290
+ if (!overrideManifest.slugs.includes(ref.slug)) {
288
291
  return fail(
289
292
  `integration "${entry.name}": override at ${override.path} is integration "${overrideManifest.slug ?? "(none)"}", but the integration uses "${entry.name}".`
290
293
  );
@@ -293,7 +296,7 @@ async function resolveLocal(entry, override, bindingMode, options, snapshotDir,
293
296
  if (sameRepo) {
294
297
  } else if (options.catalog) {
295
298
  const row = options.catalog.products.find(
296
- (product) => product.slug === entry.name
299
+ (product) => product.slug === parseIntegrationRef(entry.name).token
297
300
  );
298
301
  const seat = options.catalog.viewer.roles.length > 0;
299
302
  canDevelop = Boolean(row && row.owned === true && seat);
@@ -310,20 +313,23 @@ async function resolveLocal(entry, override, bindingMode, options, snapshotDir,
310
313
  const loadSource = options.loadSourceDefinition ?? loadDefinitionFromSource;
311
314
  const definition = await loadSource(override.path);
312
315
  const packageVersion = readPackageVersion(override.path);
313
- const contract = await contractForOverride({
316
+ const derived = await contractForOverride({
314
317
  definition,
315
318
  projectDir: override.path,
316
319
  packageVersion,
317
320
  derive: options.deriveContract
318
321
  });
319
- if (!contract) {
322
+ if (!derived) {
320
323
  return fail(
321
324
  `integration "${entry.name}": ${override.path} has no contract.json and no contract could be derived; run "ekanos contract" there.`
322
325
  );
323
326
  }
324
- if (contract.integration !== entry.name) {
327
+ let contract;
328
+ try {
329
+ contract = contractForRef(derived, entry.name);
330
+ } catch (error) {
325
331
  return fail(
326
- `integration "${entry.name}": the contract at ${override.path} is for "${contract.integration}", not "${entry.name}".`
332
+ `integration "${entry.name}": the contract at ${override.path} does not fit: ${error instanceof Error ? error.message : String(error)}`
327
333
  );
328
334
  }
329
335
  const problems = pinProblems(entry, contract, [contract.compatLine]);
@@ -416,7 +422,10 @@ function readCommittedContract(dir) {
416
422
  }
417
423
  function snapshotContract(snapshotDir, entry) {
418
424
  try {
419
- return pickLine(listContractsInDir(snapshotDir, entry.name), entry.version)?.contract ?? null;
425
+ return pickLine(
426
+ listContractsInDir(snapshotDir, parseIntegrationRef(entry.name).token),
427
+ entry.version
428
+ )?.contract ?? null;
420
429
  } catch {
421
430
  return null;
422
431
  }
@@ -426,10 +435,11 @@ async function resolveRegistry(entry, bindingMode, options, contractsDir, snapsh
426
435
  result.errors.push({ integration: entry.name, message });
427
436
  return null;
428
437
  };
438
+ const { token } = parseIntegrationRef(entry.name);
429
439
  let canDevelop = "unverified";
430
440
  if (options.catalog) {
431
441
  const row = options.catalog.products.find(
432
- (product) => product.slug === entry.name
442
+ (product) => product.slug === token
433
443
  );
434
444
  if (!row) {
435
445
  return fail(
@@ -453,7 +463,7 @@ async function resolveRegistry(entry, bindingMode, options, contractsDir, snapsh
453
463
  };
454
464
  const ensured = await installer.ensure({
455
465
  projectRoot: options.projectRoot,
456
- integration: entry.name,
466
+ integration: token,
457
467
  version: entry.version
458
468
  });
459
469
  if (ensured.ok) {
@@ -468,7 +478,7 @@ async function resolveRegistry(entry, bindingMode, options, contractsDir, snapsh
468
478
  origin: `${entry.name}@${ensured.version}`,
469
479
  stale: false,
470
480
  cachedPackage: {
471
- name: `@companydotcom/integration-${entry.name}`,
481
+ name: `@companydotcom/integration-${token}`,
472
482
  version: ensured.version
473
483
  }
474
484
  };
@@ -494,7 +504,7 @@ async function resolveRegistry(entry, bindingMode, options, contractsDir, snapsh
494
504
  if (!contract) {
495
505
  let candidates = [];
496
506
  if (contractsDir) {
497
- candidates = listContractsInDir(contractsDir, entry.name);
507
+ candidates = listContractsInDir(contractsDir, token);
498
508
  lines = availableLines(candidates);
499
509
  const picked = pickLine(candidates, entry.version);
500
510
  if (picked) {
@@ -510,7 +520,7 @@ async function resolveRegistry(entry, bindingMode, options, contractsDir, snapsh
510
520
  }
511
521
  }
512
522
  if (!contract) {
513
- const snapshots = listContractsInDir(snapshotDir, entry.name);
523
+ const snapshots = listContractsInDir(snapshotDir, token);
514
524
  lines = [.../* @__PURE__ */ new Set([...lines, ...availableLines(snapshots)])].sort();
515
525
  const picked = pickLine(snapshots, entry.version);
516
526
  if (picked) {
@@ -100,7 +100,7 @@ async function runOperation(request, deps) {
100
100
  if (!parsedKey) return refuse("operation_not_declared");
101
101
  const kind = parsedKey[1];
102
102
  const name = parsedKey[2];
103
- const id = `${integration.integration}@${integration.version}/${kind}/${name}`;
103
+ const id = `${integration.integration.slice(integration.integration.indexOf("/") + 1)}@${integration.version}/${kind}/${name}`;
104
104
  if (!integration.operations.includes(id))
105
105
  return refuse("operation_not_declared");
106
106
  operation = integration.contract.operations.find((candidate) => candidate.id === id) ?? null;
@@ -104,8 +104,16 @@ function readProjectManifest(projectRoot) {
104
104
  entry: parsed.data.entry ?? null,
105
105
  integrations: entries.map((entry) => ({
106
106
  ...entry,
107
+ // A contract's operation ids carry the bare slug, even for a package
108
+ // named under a namespace (`vastly/news` -> `news@...`).
107
109
  operations: entry.operations.map(
108
- (id) => canonicalOperationId(entry, id)
110
+ (id) => canonicalOperationId(
111
+ {
112
+ name: entry.name.slice(entry.name.indexOf("/") + 1),
113
+ version: entry.version
114
+ },
115
+ id
116
+ )
109
117
  )
110
118
  })),
111
119
  deprecatedUses,
@@ -14,7 +14,7 @@ export type ExecutorLimits = {
14
14
  maxOutputBytes: number;
15
15
  deadlineMs: number;
16
16
  };
17
- export declare const REFUSAL_MESSAGES: Record<"binding_missing" | "deadline_exceeded" | "execution_failed" | "input_too_large" | "invalid_input" | "mode_not_permitted" | "operation_not_declared" | "operation_not_in_contract" | "output_invalid" | "output_too_large" | "product_unavailable" | "rate_limited" | "slot_unknown" | "write_not_approved" | "write_refused_on_channel", string>;
17
+ export declare const REFUSAL_MESSAGES: Record<"binding_missing" | "confirmation_required" | "deadline_exceeded" | "execution_failed" | "input_too_large" | "invalid_input" | "mode_not_permitted" | "operation_not_declared" | "operation_not_in_contract" | "output_invalid" | "output_too_large" | "product_unavailable" | "rate_limited" | "slot_unknown" | "write_not_approved" | "write_refused_on_channel", string>;
18
18
  export type ValidationOutcome = {
19
19
  valid: true;
20
20
  } | {
@@ -12,7 +12,7 @@ export declare function readSessionCatalog(projectRoot: string): {
12
12
  slug: string;
13
13
  name: string;
14
14
  summary: string | null;
15
- kind: "experience" | "integration";
15
+ kind: "experience" | "feature" | "integration";
16
16
  availability: "available" | "enabled" | "turned-off";
17
17
  partner: boolean;
18
18
  owned?: boolean | undefined;
@@ -29,6 +29,7 @@ export declare function createPinsResolver(options: import('./internal/server/in
29
29
  contract: {
30
30
  schemaVersion: 1;
31
31
  integration: string;
32
+ namespace?: string | undefined;
32
33
  packageVersion: string;
33
34
  contractVersion: string;
34
35
  compatLine: string;
@@ -83,6 +84,7 @@ export declare function createRegistryContractSource(options: {
83
84
  contract: {
84
85
  schemaVersion: 1;
85
86
  integration: string;
87
+ namespace?: string | undefined;
86
88
  packageVersion: string;
87
89
  contractVersion: string;
88
90
  compatLine: string;
package/dist/routes.d.ts CHANGED
@@ -43,7 +43,8 @@ export { TriggersPage } from './internal/routes/triggers-page.js';
43
43
  * /experience ExperienceSummaryPage
44
44
  * /experience/widgets ExperienceWidgetsPage
45
45
  * /experience/widgets/[id] ExperienceWidgetPage
46
- * /experience/pages/[id] ExperiencePageHost
46
+ * /experience/pages/[id]/[...path] ExperiencePageHost
47
+ * /experience/layout ExperienceLayoutPage
47
48
  * /experience/workflows ExperienceWorkflowsPage
48
49
  * /experience/workflows/[id] ExperienceWorkflowPage
49
50
  * /experience/review-queue ExperienceReviewQueuePage
@@ -64,11 +65,12 @@ export { ExperienceSummaryPage } from './internal/routes/experience-summary-page
64
65
  export { ExperienceWidgetsPage } from './internal/routes/experience-widgets-page.js';
65
66
  export { ExperienceWidgetPage } from './internal/routes/experience-widget-page.js';
66
67
  export { ExperiencePageHost } from './internal/routes/experience-page-host.js';
68
+ export { ExperienceLayoutPage } from './internal/routes/experience-layout-page.js';
67
69
  export { ExperienceWorkflowsPage } from './internal/routes/experience-workflows-page.js';
68
70
  export { ExperienceWorkflowPage } from './internal/routes/experience-workflow-page.js';
69
71
  export { ExperienceReviewQueuePage } from './internal/routes/experience-review-queue-page.js';
70
72
  export { ExperienceRunsPage } from './internal/routes/experience-runs-page.js';
71
- export type { ExperienceSurfaces } from './internal/lib/console-context.js';
73
+ export type { ExperienceSurfacePage, ExperienceSurfaces, } from './internal/lib/console-context.js';
72
74
  export type { ConsoleClient } from './internal/lib/console-client.js';
73
75
  /**
74
76
  * The repo shell (`ekanos dev` at a repo root): the repo home, the
package/dist/routes.js CHANGED
@@ -24,6 +24,7 @@ import { ExperienceSummaryPage } from "./internal/routes/experience-summary-page
24
24
  import { ExperienceWidgetsPage } from "./internal/routes/experience-widgets-page.js";
25
25
  import { ExperienceWidgetPage } from "./internal/routes/experience-widget-page.js";
26
26
  import { ExperiencePageHost } from "./internal/routes/experience-page-host.js";
27
+ import { ExperienceLayoutPage } from "./internal/routes/experience-layout-page.js";
27
28
  import { ExperienceWorkflowsPage } from "./internal/routes/experience-workflows-page.js";
28
29
  import { ExperienceWorkflowPage } from "./internal/routes/experience-workflow-page.js";
29
30
  import { ExperienceReviewQueuePage } from "./internal/routes/experience-review-queue-page.js";
@@ -41,6 +42,7 @@ export {
41
42
  ConsoleHomePage,
42
43
  ConsoleLayout,
43
44
  ExperienceConnectPage,
45
+ ExperienceLayoutPage,
44
46
  ExperiencePageHost,
45
47
  ExperienceReviewQueuePage,
46
48
  ExperienceRunsPage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekanos/harness",
3
- "version": "0.19.0",
3
+ "version": "0.21.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,15 +72,15 @@
72
72
  "access": "public"
73
73
  },
74
74
  "dependencies": {
75
- "@ekanos/integration-schema": "0.19.0",
75
+ "@ekanos/integration-schema": "0.21.0",
76
76
  "@fortawesome/fontawesome-free": "^7.3.1",
77
77
  "next-themes": "0.4.6",
78
78
  "tw-animate-css": "1.4.0",
79
79
  "zod": "4.6.7"
80
80
  },
81
81
  "devDependencies": {
82
- "@ekanos/sdk": "0.19.0",
83
- "@ekanos/ui": "0.19.0",
82
+ "@ekanos/sdk": "0.21.0",
83
+ "@ekanos/ui": "0.21.0",
84
84
  "@kit/tsconfig": "0.1.0",
85
85
  "@tailwindcss/postcss": "4.3.3",
86
86
  "@tanstack/react-query": "5.104.4",
@@ -99,8 +99,8 @@
99
99
  "vitest": "4.1.10"
100
100
  },
101
101
  "peerDependencies": {
102
- "@ekanos/sdk": "^0.19.0",
103
- "@ekanos/ui": "^0.19.0",
102
+ "@ekanos/sdk": "^0.21.0",
103
+ "@ekanos/ui": "^0.21.0",
104
104
  "@tanstack/react-query": "^5.101.4",
105
105
  "next": "^16.0.0",
106
106
  "next-intl": "^4.14.7",