diff --git a/README.md b/README.md index 32552ff..6aaa96c 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ The first executable is deliberately narrow: - includes local Spotiverse on `ws://127.0.0.1:8796/eve/deck` in the known provider seed list; - ingests provider-owned Eve/CultUI dashboards, including `mimir.live.stats` and `voidbot.swarm`, and embeds them as Odin `interface` nodes; - accepts `gamecult.eve.provider_advertisement.v1` documents in CultMesh interface binding stores so daemons can announce schemas, `.cc` witnesses, surfaces, commands, nested Verses, and style capabilities without Odin scraping private dashboards; +- preserves provider semantic addresses such as `asgard.starfire.bifrost/eve/tui` and `asgard.starfire.bifrost/eve/gui`, with CultNet routes and WebSocket bridges carried as transport metadata rather than identity; - persists operator tiling intent as `odin.interface_layout.v1` under ignored `scratch/odin/interface-layout.json`. The next real cut is to make provider advertisements the primary discovery diff --git a/docs/architecture.md b/docs/architecture.md index 12ca8d0..4ede498 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -208,6 +208,30 @@ style capabilities, freshness, and redaction policy. Once an advertisement is available, Odin should prefer it over LAN scans, hardcoded deck URLs, private layout files, or web-dashboard scraping. +Provider advertisements should also publish semantic CultMesh addresses in this +shape: + +```text +asgard../ +``` + +Examples: + +```text +asgard.starfire.odin/eve/allseer +asgard.starfire.bifrost/eve/tui +asgard.starfire.bifrost/eve/gui +asgard.yggdrasil.streampixels/eve/tui +asgard.yggdrasil.streampixels/eve/gui +``` + +The canonical service may omit the current machine when identity should survive +relocation, such as `asgard.bifrost`. Located service addresses name the current +host, such as `asgard.starfire.bifrost` now and +`asgard.yggdrasil.bifrost` after migration. CultNet routes are transport +metadata for resolving those names. WebSocket URLs remain compatibility deck +bridges, not native service identity. + The canonical contract lives in `E:\Projects\Eve\docs\provider-advertisement-contract.md`. diff --git a/src/odin/interfaces.cjs b/src/odin/interfaces.cjs index 1996f2b..d8a8a8c 100644 --- a/src/odin/interfaces.cjs +++ b/src/odin/interfaces.cjs @@ -87,7 +87,16 @@ function createInterfaceDiscovery({ title: advertisement.title || advertisement.providerId, description: advertisement.description || "Provider-owned CultMesh advertisement.", version: String(advertisement.version || 0), - endpoint: advertisement.endpoints?.[0] || advertisement.provider?.endpoint || `cultmesh:${storePath}`, + endpoint: advertisement.cultMeshAddress || advertisement.endpoints?.[0]?.address || advertisement.provider?.endpoint || `cultmesh:${storePath}`, + canonicalService: advertisement.canonicalService || null, + locatedService: advertisement.locatedService || null, + cultMeshAddress: advertisement.cultMeshAddress || null, + endpoints: advertisement.endpoints || [], + routes: advertisement.routes || [], + transportEndpoint: advertisement.routes?.find((route) => route.transport === "cultnet")?.address + || advertisement.routes?.find((route) => route.transport === "compatibility-eve-deck")?.address + || advertisement.provider?.endpoint + || `cultmesh:${storePath}`, capabilities: advertisement.provider?.capabilities || advertisement.capabilities || [], usesCultMesh: true, transport: advertisement.provider?.transport || "CultMesh provider advertisement", @@ -149,6 +158,11 @@ function createInterfaceDiscovery({ updatedAt: state?.updatedAt || binding.updatedAt || new Date().toISOString(), source: `cultmesh:${storePath}`, manifest: binding.provider || null, + canonicalService: binding.provider?.canonicalService || null, + locatedService: binding.provider?.locatedService || null, + cultMeshAddress: binding.provider?.cultMeshAddress || binding.provider?.endpoint || null, + endpoints: binding.provider?.endpoints || [], + routes: binding.provider?.routes || [], surface, }); } diff --git a/src/odin/surface.cjs b/src/odin/surface.cjs index e46ecd9..2dcbb3b 100644 --- a/src/odin/surface.cjs +++ b/src/odin/surface.cjs @@ -36,6 +36,11 @@ function buildSurface({ observedAt, docker, adb, hosts, yggdrasilServices, verse props: { title: entry.title || entry.providerId, verseUri: verseUri(entry), + canonicalService: entry.canonicalService || "", + locatedService: entry.locatedService || "", + cultMeshAddress: entry.cultMeshAddress || "", + endpoints: entry.endpoints || [], + routes: entry.routes || [], providerId: entry.providerId, source: entry.source, status: entry.state, @@ -191,6 +196,8 @@ function metric(id, label, value, tone) { } function verseUri(entry) { + if (entry.cultMeshAddress) return String(entry.cultMeshAddress); + if (entry.locatedService) return String(entry.locatedService); const providerId = String(entry.providerId || "").trim(); if (hasBodyPrefix(providerId)) return providerId; const body = sourceBody(entry.source); diff --git a/src/odin/websocket.cjs b/src/odin/websocket.cjs index 7c99f7a..af1cfd0 100644 --- a/src/odin/websocket.cjs +++ b/src/odin/websocket.cjs @@ -62,7 +62,13 @@ function providerCatalogFromState(state) { title: String(props.title || props.providerId), description: String(props.detail || "Provider-owned Eve/CultUI interface discovered by Odin."), version: String(props.version || 0), - endpoint: props.source || "/eve/deck", + endpoint: props.cultMeshAddress || props.locatedService || props.source || "/eve/deck", + canonicalService: props.canonicalService || null, + locatedService: props.locatedService || null, + cultMeshAddress: props.cultMeshAddress || null, + endpoints: Array.isArray(props.endpoints) ? props.endpoints : [], + routes: Array.isArray(props.routes) ? props.routes : [], + transportEndpoint: transportEndpoint(props), capabilities: providerCapabilities(embeddedRoot), usesCultMesh: String(props.source || "").startsWith("cultmesh:"), transport: String(props.source || "").startsWith("cultmesh:") @@ -76,6 +82,14 @@ function providerCatalogFromState(state) { return [...providers.values()].sort((left, right) => String(left.id).localeCompare(String(right.id))); } +function transportEndpoint(props) { + const routes = Array.isArray(props.routes) ? props.routes : []; + return routes.find((route) => route?.transport === "cultnet")?.address + || routes.find((route) => route?.transport === "compatibility-eve-deck")?.address + || props.source + || ""; +} + function providerCapabilities(root) { const capabilities = new Set(["cultui-surface"]); if (hasCommand(root)) {