Integrate Aetheria reactive state worktree
This commit is contained in:
parent
426cd8f656
commit
65133ac8a0
61 changed files with 3427 additions and 402 deletions
|
|
@ -44,6 +44,7 @@ export type AetheriaRuntimeViewportFeedSnapshot = {
|
|||
daemonHealth: DaemonHealthProjection;
|
||||
authorityStatus: AuthorityStatusProjection;
|
||||
starbridgeSession: StarbridgeSessionProjection;
|
||||
assetManifest: AssetManifestProjection;
|
||||
receivedAtUtc: string;
|
||||
sampleMs: number;
|
||||
};
|
||||
|
|
@ -108,6 +109,7 @@ export type ViewObject = {
|
|||
targetEntityIndex: number;
|
||||
isActive: boolean;
|
||||
visibility: number;
|
||||
iconAsset: AssetRef;
|
||||
status: EntityStatus;
|
||||
inventory: InventoryItem[];
|
||||
};
|
||||
|
|
@ -125,6 +127,7 @@ export type InventoryItem = {
|
|||
quality: number;
|
||||
durability: number;
|
||||
enabled: boolean;
|
||||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type SelectedObjectProjection = {
|
||||
|
|
@ -218,6 +221,33 @@ export type StarbridgeStationStockItemProjection = {
|
|||
quality: number;
|
||||
durability: number;
|
||||
source: string;
|
||||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type AssetManifestProjection = {
|
||||
schema: string;
|
||||
publishedAtUtc: string;
|
||||
runId: string;
|
||||
baseUri: string;
|
||||
assets: AssetManifestEntry[];
|
||||
};
|
||||
|
||||
export type AssetManifestEntry = {
|
||||
ref: AssetRef;
|
||||
sizeBytes: number;
|
||||
width: number;
|
||||
height: number;
|
||||
tags: string[];
|
||||
};
|
||||
|
||||
export type AssetRef = {
|
||||
assetKey: string;
|
||||
kind: string;
|
||||
uri: string;
|
||||
transport: string;
|
||||
contentHash: string;
|
||||
mimeType: string;
|
||||
metadata: Record<string, string>;
|
||||
};
|
||||
|
||||
export type StarbridgeWaveForecastProjection = {
|
||||
|
|
@ -269,6 +299,7 @@ export type AetheriaRtsApi = {
|
|||
daemonHealth(): Promise<DaemonHealthProjection>;
|
||||
authorityStatus(): Promise<AuthorityStatusProjection>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionProjection>;
|
||||
assetManifest(): Promise<AssetManifestProjection>;
|
||||
watchViewportFeed(request: AetheriaRuntimeViewportFeedRequest, callback: (snapshot: AetheriaRuntimeViewportFeedSnapshot) => void): () => void;
|
||||
setMoveVector(request: AetheriaRuntimeSetMoveVectorRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
setTarget(request: AetheriaRuntimeSetTargetRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import {
|
|||
describeAetheriaRuntimeRtsQueryHandles,
|
||||
describeAetheriaRuntimeRtsSurfaceCatalog,
|
||||
type AetheriaRuntimeDaemonCommandReceipt,
|
||||
type AssetManifestProjection,
|
||||
type AuthorityStatusProjection,
|
||||
type DaemonHealthProjection,
|
||||
type GravityViewportResponse,
|
||||
|
|
@ -47,6 +48,7 @@ import {
|
|||
} from "./aetheria-rts-bindings.js";
|
||||
import {
|
||||
projectAuthorityStatus,
|
||||
projectAssetManifest,
|
||||
projectDaemonHealth,
|
||||
projectGravityViewportFromFrame,
|
||||
projectInventoryFromFrame,
|
||||
|
|
@ -127,6 +129,7 @@ export class AetheriaCultMeshClient {
|
|||
daemonHealth: async () => projectDaemonHealth(await this.fetchDaemonHealthDocument()),
|
||||
authorityStatus: async () => projectAuthorityStatus(await this.fetchAuthorityPolicyDocument()),
|
||||
starbridgeSession: async () => projectStarbridgeSessionSummary(await this.fetchStarbridgeSessionSummaryDocument()),
|
||||
assetManifest: async () => projectAssetManifest(await this.fetchAssetManifestDocument()),
|
||||
};
|
||||
this.queries = createAetheriaRuntimeRtsQueryHandles(
|
||||
executors,
|
||||
|
|
@ -139,6 +142,7 @@ export class AetheriaCultMeshClient {
|
|||
daemonHealth: CultMesh.pollingQueryWatcher(executors.daemonHealth, { intervalMs: 250 }),
|
||||
authorityStatus: CultMesh.pollingQueryWatcher(executors.authorityStatus, { intervalMs: 250 }),
|
||||
starbridgeSession: CultMesh.pollingQueryWatcher(executors.starbridgeSession, { intervalMs: 250 }),
|
||||
assetManifest: CultMesh.pollingQueryWatcher(executors.assetManifest, { intervalMs: 1000 }),
|
||||
},
|
||||
);
|
||||
this.documents = createAetheriaRuntimeRtsDocuments(
|
||||
|
|
@ -148,6 +152,7 @@ export class AetheriaCultMeshClient {
|
|||
daemonHealth: async () => this.fetchDaemonHealthDocument(),
|
||||
authorityPolicy: async () => this.fetchAuthorityPolicyDocument(),
|
||||
starbridgeSession: async () => this.fetchStarbridgeSessionSummaryDocument(),
|
||||
assetManifest: async () => this.fetchAssetManifestDocument(),
|
||||
},
|
||||
);
|
||||
this.operations = createAetheriaRuntimeRtsOperationHandles(
|
||||
|
|
@ -223,6 +228,9 @@ export class AetheriaCultMeshClient {
|
|||
return this.aetheria.daemon.starbridgeSession();
|
||||
}
|
||||
|
||||
public async assetManifest(): Promise<AssetManifestProjection> {
|
||||
return this.aetheria.daemon.assetManifest();
|
||||
}
|
||||
|
||||
public projectionDiagnostics(): Readonly<Record<string, AetheriaRuntimeRtsProjectionDiagnostic>> {
|
||||
return describeAetheriaRuntimeRtsQueryHandles(this.queries);
|
||||
|
|
@ -285,6 +293,9 @@ export class AetheriaCultMeshClient {
|
|||
return this.fetchPublicationDocument(AetheriaRtsSchemas.starbridgeSessionSummary);
|
||||
}
|
||||
|
||||
private async fetchAssetManifestDocument(): Promise<unknown> {
|
||||
return this.fetchPublicationDocument(AetheriaRtsSchemas.assetManifest);
|
||||
}
|
||||
|
||||
private fetchPublicationDocument(schemaId: string): Promise<unknown> {
|
||||
return this.publications.latest({ schemaId }, this.queryContext());
|
||||
|
|
@ -321,6 +332,7 @@ export class AetheriaCultMeshClient {
|
|||
...this.queries.daemonHealth.sources,
|
||||
...this.queries.authorityStatus.sources,
|
||||
...this.queries.starbridgeSession.sources,
|
||||
...this.queries.assetManifest.sources,
|
||||
],
|
||||
routeHint: this.queryVerse.context.routeHint,
|
||||
watchFeed: (request, context, callback) => {
|
||||
|
|
@ -363,6 +375,7 @@ export class AetheriaCultMeshClient {
|
|||
daemonHealth,
|
||||
authorityStatus,
|
||||
starbridgeSession,
|
||||
assetManifest,
|
||||
selectedObject,
|
||||
inventory,
|
||||
] = await Promise.all([
|
||||
|
|
@ -370,6 +383,7 @@ export class AetheriaCultMeshClient {
|
|||
this.aetheria.daemon.health(),
|
||||
this.aetheria.daemon.authorityStatus(),
|
||||
this.aetheria.daemon.starbridgeSession(),
|
||||
this.aetheria.daemon.assetManifest(),
|
||||
selectedEntityIndex >= 0
|
||||
? this.aetheria.selectedObject(selectedEntityIndex)
|
||||
: Promise.resolve(null),
|
||||
|
|
@ -385,6 +399,7 @@ export class AetheriaCultMeshClient {
|
|||
daemonHealth,
|
||||
authorityStatus,
|
||||
starbridgeSession,
|
||||
assetManifest,
|
||||
receivedAtUtc: new Date().toISOString(),
|
||||
sampleMs: performance.now() - startedAt,
|
||||
};
|
||||
|
|
@ -514,6 +529,17 @@ function createAetheriaPublicationDocuments(
|
|||
),
|
||||
localPath: `${statePath}.daemon.starbridge.session.cc`,
|
||||
},
|
||||
{
|
||||
...CultMesh.publicationDocument(
|
||||
AetheriaRtsSchemas.assetManifest,
|
||||
"daemon:aetheria.asset_manifest.latest.v1",
|
||||
{
|
||||
documentId: "daemon:aetheria.asset_manifest.latest.v1",
|
||||
sourceId: "daemon:aetheria.asset_manifest.latest.v1",
|
||||
},
|
||||
),
|
||||
localPath: `${statePath}.daemon.assets.cc`,
|
||||
},
|
||||
];
|
||||
|
||||
return documents.map(document => mode === "remote" && document.remoteRecordKey
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ export type {
|
|||
AetheriaRuntimeSetTargetRequest as RtsSetTargetRequest,
|
||||
AetheriaRuntimeViewportFeedRequest,
|
||||
AetheriaRuntimeViewportFeedSnapshot,
|
||||
AssetManifestEntry,
|
||||
AssetManifestProjection,
|
||||
AssetRef,
|
||||
AuthorityRuleProjection,
|
||||
AuthorityStatusProjection,
|
||||
BodyView,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ export const AetheriaRtsSchemas = {
|
|||
eveCommand: "gamecult.eve.command.v1",
|
||||
daemonFrame: "gamecult.aetheria.daemon_frame.v1",
|
||||
daemonHealth: "gamecult.aetheria.daemon_health.v1",
|
||||
assetManifest: "gamecult.aetheria.asset_manifest.v1",
|
||||
rtsViewport: "gamecult.aetheria.rts_viewport.v1",
|
||||
objectsViewport: "gamecult.aetheria.objects_viewport.v1",
|
||||
gravityViewport: "gamecult.aetheria.gravity_viewport.v1",
|
||||
|
|
@ -110,6 +111,7 @@ export const AetheriaRtsIpcChannels = {
|
|||
daemonHealth: "aetheria-rts:daemon-health",
|
||||
authorityStatus: "aetheria-rts:authority-status",
|
||||
starbridgeSession: "aetheria-rts:starbridge-session",
|
||||
assetManifest: "aetheria-rts:asset-manifest",
|
||||
setMoveVector: "aetheria-rts:set-move-vector",
|
||||
setTarget: "aetheria-rts:set-target",
|
||||
surfaceCatalog: "aetheria-rts:surface-catalog",
|
||||
|
|
@ -299,6 +301,55 @@ export const aetheriaRuntimeDaemonHealthDocumentSlots: Record<AetheriaRuntimeDae
|
|||
commandBoundaryPath: 12,
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeAssetRefSlot =
|
||||
| "assetKey"
|
||||
| "kind"
|
||||
| "uri"
|
||||
| "transport"
|
||||
| "contentHash"
|
||||
| "mimeType"
|
||||
| "metadata";
|
||||
|
||||
export const aetheriaRuntimeAssetRefSlots: Record<AetheriaRuntimeAssetRefSlot, number> = {
|
||||
assetKey: 0,
|
||||
kind: 1,
|
||||
uri: 2,
|
||||
transport: 3,
|
||||
contentHash: 4,
|
||||
mimeType: 5,
|
||||
metadata: 6,
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeAssetManifestDocumentSlot =
|
||||
| "schema"
|
||||
| "publishedAtUtc"
|
||||
| "runId"
|
||||
| "baseUri"
|
||||
| "assets";
|
||||
|
||||
export const aetheriaRuntimeAssetManifestDocumentSlots: Record<AetheriaRuntimeAssetManifestDocumentSlot, number> = {
|
||||
schema: 0,
|
||||
publishedAtUtc: 1,
|
||||
runId: 2,
|
||||
baseUri: 3,
|
||||
assets: 4,
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeAssetManifestEntrySlot =
|
||||
| "ref"
|
||||
| "sizeBytes"
|
||||
| "width"
|
||||
| "height"
|
||||
| "tags";
|
||||
|
||||
export const aetheriaRuntimeAssetManifestEntrySlots: Record<AetheriaRuntimeAssetManifestEntrySlot, number> = {
|
||||
ref: 0,
|
||||
sizeBytes: 1,
|
||||
width: 2,
|
||||
height: 3,
|
||||
tags: 4,
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeRtsViewportDocumentSlot =
|
||||
| "schema"
|
||||
| "frameId"
|
||||
|
|
@ -1045,7 +1096,8 @@ export type AetheriaRuntimeRtsViewportObjectSlot =
|
|||
| "isActive"
|
||||
| "visibility"
|
||||
| "status"
|
||||
| "inventory";
|
||||
| "inventory"
|
||||
| "iconAsset";
|
||||
|
||||
export const aetheriaRuntimeRtsViewportObjectSlots: Record<AetheriaRuntimeRtsViewportObjectSlot, number> = {
|
||||
entityIndex: 0,
|
||||
|
|
@ -1066,6 +1118,7 @@ export const aetheriaRuntimeRtsViewportObjectSlots: Record<AetheriaRuntimeRtsVie
|
|||
visibility: 15,
|
||||
status: 16,
|
||||
inventory: 17,
|
||||
iconAsset: 18,
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeRtsEntityStatusSlot =
|
||||
|
|
@ -1088,7 +1141,8 @@ export type AetheriaRuntimeRtsInventoryItemSlot =
|
|||
| "enabled"
|
||||
| "sourceIndex"
|
||||
| "x"
|
||||
| "y";
|
||||
| "y"
|
||||
| "iconAsset";
|
||||
|
||||
export const aetheriaRuntimeRtsInventoryItemSlots: Record<AetheriaRuntimeRtsInventoryItemSlot, number> = {
|
||||
source: 0,
|
||||
|
|
@ -1100,6 +1154,7 @@ export const aetheriaRuntimeRtsInventoryItemSlots: Record<AetheriaRuntimeRtsInve
|
|||
sourceIndex: 6,
|
||||
x: 7,
|
||||
y: 8,
|
||||
iconAsset: 9,
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeRtsGravityInfluenceSlot =
|
||||
|
|
@ -1240,7 +1295,8 @@ export type AetheriaRuntimeStarbridgeStationStockItemSlot =
|
|||
| "quantity"
|
||||
| "quality"
|
||||
| "durability"
|
||||
| "source";
|
||||
| "source"
|
||||
| "iconAsset";
|
||||
|
||||
export const aetheriaRuntimeStarbridgeStationStockItemSlots: Record<AetheriaRuntimeStarbridgeStationStockItemSlot, number> = {
|
||||
itemKey: 0,
|
||||
|
|
@ -1248,6 +1304,7 @@ export const aetheriaRuntimeStarbridgeStationStockItemSlots: Record<AetheriaRunt
|
|||
quality: 2,
|
||||
durability: 3,
|
||||
source: 4,
|
||||
iconAsset: 5,
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeStarbridgeWaveDefinitionSlot =
|
||||
|
|
@ -1446,6 +1503,7 @@ export type ViewObject = {
|
|||
targetEntityIndex: number;
|
||||
isActive: boolean;
|
||||
visibility: number;
|
||||
iconAsset: AssetRef;
|
||||
status: EntityStatus;
|
||||
inventory: InventoryItem[];
|
||||
};
|
||||
|
|
@ -1463,6 +1521,7 @@ export type InventoryItem = {
|
|||
quality: number;
|
||||
durability: number;
|
||||
enabled: boolean;
|
||||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type SelectedObjectProjection = {
|
||||
|
|
@ -1556,6 +1615,33 @@ export type StarbridgeStationStockItemProjection = {
|
|||
quality: number;
|
||||
durability: number;
|
||||
source: string;
|
||||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type AssetManifestProjection = {
|
||||
schema: string;
|
||||
publishedAtUtc: string;
|
||||
runId: string;
|
||||
baseUri: string;
|
||||
assets: AssetManifestEntry[];
|
||||
};
|
||||
|
||||
export type AssetManifestEntry = {
|
||||
ref: AssetRef;
|
||||
sizeBytes: number;
|
||||
width: number;
|
||||
height: number;
|
||||
tags: string[];
|
||||
};
|
||||
|
||||
export type AssetRef = {
|
||||
assetKey: string;
|
||||
kind: string;
|
||||
uri: string;
|
||||
transport: string;
|
||||
contentHash: string;
|
||||
mimeType: string;
|
||||
metadata: Record<string, string>;
|
||||
};
|
||||
|
||||
export type StarbridgeWaveForecastProjection = {
|
||||
|
|
@ -1632,6 +1718,7 @@ export type AetheriaRuntimeViewportFeedSnapshot = {
|
|||
daemonHealth: DaemonHealthProjection;
|
||||
authorityStatus: AuthorityStatusProjection;
|
||||
starbridgeSession: StarbridgeSessionProjection;
|
||||
assetManifest: AssetManifestProjection;
|
||||
receivedAtUtc: string;
|
||||
sampleMs: number;
|
||||
};
|
||||
|
|
@ -1645,6 +1732,7 @@ export type AetheriaRtsMainClient = {
|
|||
daemonHealth(): Promise<DaemonHealthProjection>;
|
||||
authorityStatus(): Promise<AuthorityStatusProjection>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionProjection>;
|
||||
assetManifest(): Promise<AssetManifestProjection>;
|
||||
watchViewportFeed(request: AetheriaRuntimeViewportFeedRequest, callback: (snapshot: AetheriaRuntimeViewportFeedSnapshot) => void): CultMeshUnsubscribe;
|
||||
setMoveVector(request: AetheriaRuntimeSetMoveVectorRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
setTarget(request: AetheriaRuntimeSetTargetRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
|
|
@ -1673,6 +1761,7 @@ export function registerAetheriaRtsIpcHandlers(
|
|||
ipcMain.handle(AetheriaRtsIpcChannels.daemonHealth, async () => getClient().daemonHealth());
|
||||
ipcMain.handle(AetheriaRtsIpcChannels.authorityStatus, async () => getClient().authorityStatus());
|
||||
ipcMain.handle(AetheriaRtsIpcChannels.starbridgeSession, async () => getClient().starbridgeSession());
|
||||
ipcMain.handle(AetheriaRtsIpcChannels.assetManifest, async () => getClient().assetManifest());
|
||||
ipcMain.handle(AetheriaRtsIpcChannels.viewportFeed, async (event, request: { subscriptionId: string; feed: AetheriaRuntimeViewportFeedRequest }) => {
|
||||
viewportFeedSubscriptions.get(request.subscriptionId)?.();
|
||||
const unsubscribe = getClient().watchViewportFeed(request.feed, snapshot => {
|
||||
|
|
@ -1722,6 +1811,7 @@ export type AetheriaRuntimeRtsQueryExecutors = {
|
|||
daemonHealth: AetheriaRuntimeQueryExecutor<void, DaemonHealthProjection>;
|
||||
authorityStatus: AetheriaRuntimeQueryExecutor<void, AuthorityStatusProjection>;
|
||||
starbridgeSession: AetheriaRuntimeQueryExecutor<void, StarbridgeSessionProjection>;
|
||||
assetManifest: AetheriaRuntimeQueryExecutor<void, AssetManifestProjection>;
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeRtsQueryWatchers = Partial<{
|
||||
|
|
@ -1733,6 +1823,7 @@ export type AetheriaRuntimeRtsQueryWatchers = Partial<{
|
|||
daemonHealth: CultMeshQueryWatcher<void, DaemonHealthProjection>;
|
||||
authorityStatus: CultMeshQueryWatcher<void, AuthorityStatusProjection>;
|
||||
starbridgeSession: CultMeshQueryWatcher<void, StarbridgeSessionProjection>;
|
||||
assetManifest: CultMeshQueryWatcher<void, AssetManifestProjection>;
|
||||
}>;
|
||||
|
||||
export type AetheriaRuntimeRtsProjectionDiagnostic = CultMeshQuerySurfaceDiagnostic;
|
||||
|
|
@ -1752,6 +1843,7 @@ export type AetheriaRuntimeRtsDocumentResolvers = Partial<{
|
|||
daemonHealth: (context: CultMeshQueryContext) => Promise<unknown>;
|
||||
authorityPolicy: (context: CultMeshQueryContext) => Promise<unknown>;
|
||||
starbridgeSession: (context: CultMeshQueryContext) => Promise<unknown>;
|
||||
assetManifest: (context: CultMeshQueryContext) => Promise<unknown>;
|
||||
}>;
|
||||
|
||||
export type AetheriaRuntimeRtsStatePointerResolvers = AetheriaRuntimeRtsDocumentResolvers;
|
||||
|
|
@ -1772,6 +1864,10 @@ export const AetheriaRuntimeRtsProjectionSources = {
|
|||
starbridgeSession: CultMesh.projectionSource("daemon:aetheria.starbridge.session.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.starbridgeSessionSummary,
|
||||
description: "latest Starbridge session summary"
|
||||
}),
|
||||
assetManifest: CultMesh.projectionSource("daemon:aetheria.asset_manifest.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.assetManifest,
|
||||
description: "latest daemon asset manifest"
|
||||
})
|
||||
} as const;
|
||||
|
||||
|
|
@ -1816,6 +1912,15 @@ export function createAetheriaRuntimeRtsDocuments(
|
|||
sources: [AetheriaRuntimeRtsProjectionSources.starbridgeSession],
|
||||
},
|
||||
),
|
||||
assetManifest: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.assetManifest.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.assetManifest },
|
||||
async (context) => resolvers.assetManifest?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.assetManifest],
|
||||
},
|
||||
),
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
|
@ -1875,6 +1980,12 @@ export function createAetheriaRuntimeRtsQueryHandles(
|
|||
executors.starbridgeSession,
|
||||
{ routeHint, watchProjection: watchers.starbridgeSession },
|
||||
).asQuerySurface(),
|
||||
assetManifest: CultMesh.projectionRecipe<void, AssetManifestProjection>(
|
||||
AetheriaRtsSchemas.assetManifest,
|
||||
[AetheriaRuntimeRtsProjectionSources.assetManifest],
|
||||
executors.assetManifest,
|
||||
{ routeHint, watchProjection: watchers.assetManifest },
|
||||
).asQuerySurface(),
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
|
@ -1890,6 +2001,7 @@ export function describeAetheriaRuntimeRtsQueryHandles(
|
|||
daemonHealth: describeAetheriaRuntimeRtsQuerySurface(handles.daemonHealth),
|
||||
authorityStatus: describeAetheriaRuntimeRtsQuerySurface(handles.authorityStatus),
|
||||
starbridgeSession: describeAetheriaRuntimeRtsQuerySurface(handles.starbridgeSession),
|
||||
assetManifest: describeAetheriaRuntimeRtsQuerySurface(handles.assetManifest),
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
|
@ -1905,6 +2017,7 @@ export function describeAetheriaRuntimeRtsSurfaceCatalog(
|
|||
CultMesh.describeSurface(documents.daemonHealth),
|
||||
CultMesh.describeSurface(documents.authorityPolicy),
|
||||
CultMesh.describeSurface(documents.starbridgeSession),
|
||||
CultMesh.describeSurface(documents.assetManifest),
|
||||
CultMesh.describeSurface(handles.mapViewport),
|
||||
CultMesh.describeSurface(handles.objectsViewport),
|
||||
CultMesh.describeSurface(handles.gravityViewport),
|
||||
|
|
@ -1913,6 +2026,7 @@ export function describeAetheriaRuntimeRtsSurfaceCatalog(
|
|||
CultMesh.describeSurface(handles.daemonHealth),
|
||||
CultMesh.describeSurface(handles.authorityStatus),
|
||||
CultMesh.describeSurface(handles.starbridgeSession),
|
||||
CultMesh.describeSurface(handles.assetManifest),
|
||||
...(operations
|
||||
? [
|
||||
CultMesh.describeSurface(operations.setMoveVector),
|
||||
|
|
@ -1998,10 +2112,12 @@ export function createAetheriaRuntimeRtsVerseFacade(
|
|||
const daemonHealth = CultMesh.bindQuery(queryVerse, queries.daemonHealth);
|
||||
const authorityStatus = CultMesh.bindQuery(queryVerse, queries.authorityStatus);
|
||||
const starbridgeSession = CultMesh.bindQuery(queryVerse, queries.starbridgeSession);
|
||||
const assetManifest = CultMesh.bindQuery(queryVerse, queries.assetManifest);
|
||||
const daemonFrameDocument = CultMesh.bindDocument(queryVerse, documents.daemonFrame);
|
||||
const daemonHealthDocument = CultMesh.bindDocument(queryVerse, documents.daemonHealth);
|
||||
const authorityPolicyDocument = CultMesh.bindDocument(queryVerse, documents.authorityPolicy);
|
||||
const starbridgeSessionDocument = CultMesh.bindDocument(queryVerse, documents.starbridgeSession);
|
||||
const assetManifestDocument = CultMesh.bindDocument(queryVerse, documents.assetManifest);
|
||||
const setMoveVector = CultMesh.bindOperation(commandVerse, operations.setMoveVector);
|
||||
const setTarget = CultMesh.bindOperation(commandVerse, operations.setTarget);
|
||||
|
||||
|
|
@ -2064,10 +2180,12 @@ export function createAetheriaRuntimeRtsVerseFacade(
|
|||
health: () => daemonHealthDocument.latest(),
|
||||
authorityPolicy: () => authorityPolicyDocument.latest(),
|
||||
starbridgeSession: () => starbridgeSessionDocument.latest(),
|
||||
assetManifest: () => assetManifestDocument.latest(),
|
||||
},
|
||||
health: () => daemonHealth.execute(undefined),
|
||||
authorityStatus: () => authorityStatus.execute(undefined),
|
||||
starbridgeSession: () => starbridgeSession.execute(undefined),
|
||||
assetManifest: () => assetManifest.execute(undefined),
|
||||
},
|
||||
} as const;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
import {
|
||||
AetheriaRtsSchemas,
|
||||
aetheriaRuntimeAssetManifestDocumentSlots as assetManifestSlots,
|
||||
aetheriaRuntimeAssetManifestEntrySlots as assetManifestEntrySlots,
|
||||
aetheriaRuntimeAssetRefSlots as assetRefSlots,
|
||||
aetheriaRuntimeAuthorityRuleSlots as authorityRuleSlots,
|
||||
aetheriaRuntimeBodySnapshotCommitSlots as bodySlots,
|
||||
aetheriaRuntimeCargoBayLoadoutCommitSlots as cargoBaySlots,
|
||||
|
|
@ -20,6 +23,8 @@ import {
|
|||
} from "./aetheria-rts-generated-bindings.js";
|
||||
import { cultMeshRectFromBounds, cultMeshViewportRequest } from "cultmesh-ts";
|
||||
import type {
|
||||
AssetManifestProjection,
|
||||
AssetRef,
|
||||
AuthorityStatusProjection,
|
||||
BodyView,
|
||||
DaemonHealthProjection,
|
||||
|
|
@ -222,6 +227,17 @@ export function projectStarbridgeSessionSummary(summaryDocument: unknown): Starb
|
|||
};
|
||||
}
|
||||
|
||||
export function projectAssetManifest(assetManifestDocument: unknown): AssetManifestProjection {
|
||||
const manifest = arr(assetManifestDocument);
|
||||
return {
|
||||
schema: str(manifest[assetManifestSlots.schema]) || AetheriaRtsSchemas.assetManifest,
|
||||
publishedAtUtc: str(manifest[assetManifestSlots.publishedAtUtc]),
|
||||
runId: str(manifest[assetManifestSlots.runId]),
|
||||
baseUri: str(manifest[assetManifestSlots.baseUri]),
|
||||
assets: list<unknown[]>(manifest[assetManifestSlots.assets]).map(toAssetManifestEntry),
|
||||
};
|
||||
}
|
||||
|
||||
function frameContext(frameDocument: unknown): {
|
||||
frameId: number;
|
||||
runId: string;
|
||||
|
|
@ -251,11 +267,13 @@ function normalizeViewport(request: ViewportRequest): ViewportRequest {
|
|||
}
|
||||
|
||||
function toViewObject(entity: unknown[], runId: string, zoneIndex: number): ViewObject {
|
||||
const kind = str(entity[entitySlots.kind]);
|
||||
const controlled = isPlayerControlled(entity);
|
||||
return {
|
||||
entityIndex: num(entity[entitySlots.entityIndex], -1),
|
||||
entityKey: entityKey(runId, zoneIndex, num(entity[entitySlots.entityIndex], -1)),
|
||||
displayName: str(entity[entitySlots.name]),
|
||||
kind: str(entity[entitySlots.kind]),
|
||||
kind,
|
||||
factionKey: str(entity[entitySlots.factionKey]),
|
||||
x: num(entity[entitySlots.positionX]),
|
||||
y: num(entity[entitySlots.positionZ]),
|
||||
|
|
@ -264,10 +282,11 @@ function toViewObject(entity: unknown[], runId: string, zoneIndex: number): View
|
|||
directionY: num(entity[entitySlots.directionY]),
|
||||
velocityX: num(entity[entitySlots.velocityX]),
|
||||
velocityY: num(entity[entitySlots.velocityY]),
|
||||
controlled: isPlayerControlled(entity),
|
||||
controlled,
|
||||
targetEntityIndex: num(entity[entitySlots.targetEntityIndex], -1),
|
||||
isActive: bool(entity[entitySlots.isActive]),
|
||||
visibility: num(entity[entitySlots.visibility]),
|
||||
iconAsset: entityIconAsset(kind, controlled),
|
||||
status: {
|
||||
hull: stat(entity, "hull"),
|
||||
shield: stat(entity, "shield"),
|
||||
|
|
@ -289,12 +308,14 @@ function toStarbridgeBaseStatus(status: unknown[]): StarbridgeSessionProjection[
|
|||
}
|
||||
|
||||
function toStarbridgeStationStockItem(item: unknown[]): StarbridgeSessionProjection["stationStock"][number] {
|
||||
const itemKey = str(item[starbridgeStockSlots.itemKey]);
|
||||
return {
|
||||
itemKey: str(item[starbridgeStockSlots.itemKey]),
|
||||
itemKey,
|
||||
quantity: num(item[starbridgeStockSlots.quantity]),
|
||||
quality: num(item[starbridgeStockSlots.quality]),
|
||||
durability: num(item[starbridgeStockSlots.durability]),
|
||||
source: str(item[starbridgeStockSlots.source]) || "station",
|
||||
iconAsset: assetRef(arr(item[starbridgeStockSlots.iconAsset]), itemIconAsset(itemKey)),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -359,13 +380,15 @@ function inventory(entity: unknown[]): InventoryItem[] {
|
|||
|
||||
function addSlot(items: InventoryItem[], source: string, slot: unknown[]): void {
|
||||
const item = arr(slot[itemSlotSlots.item]);
|
||||
const itemKey = str(item[itemSlots.itemKey]);
|
||||
items.push({
|
||||
source,
|
||||
itemKey: str(item[itemSlots.itemKey]),
|
||||
itemKey,
|
||||
quantity: num(item[itemSlots.quantity]),
|
||||
quality: num(item[itemSlots.quality]),
|
||||
durability: num(item[itemSlots.durability]),
|
||||
enabled: bool(item[itemSlots.enabled]),
|
||||
iconAsset: itemIconAsset(itemKey),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -416,6 +439,84 @@ function entityKey(runId: string, zoneIndex: number, entityIndex: number): strin
|
|||
return `global:aetheria.run_state.${runId}.zone.${zoneIndex}.entity.${entityIndex}.v1`;
|
||||
}
|
||||
|
||||
function toAssetManifestEntry(entry: unknown[]): AssetManifestProjection["assets"][number] {
|
||||
return {
|
||||
ref: assetRef(arr(entry[assetManifestEntrySlots.ref])),
|
||||
sizeBytes: num(entry[assetManifestEntrySlots.sizeBytes]),
|
||||
width: num(entry[assetManifestEntrySlots.width]),
|
||||
height: num(entry[assetManifestEntrySlots.height]),
|
||||
tags: stringList(entry[assetManifestEntrySlots.tags]),
|
||||
};
|
||||
}
|
||||
|
||||
function entityIconAsset(kind: string, controlled: boolean): AssetRef {
|
||||
if (controlled)
|
||||
return spriteAsset("map.entity.player", "Sprites/Map/player");
|
||||
|
||||
const normalized = kind.trim().toLowerCase();
|
||||
if (normalized.includes("station"))
|
||||
return spriteAsset("map.entity.station", "Sprites/Map/station");
|
||||
if (normalized.includes("orbital"))
|
||||
return spriteAsset("map.entity.orbital", "Sprites/Map/orbital");
|
||||
|
||||
return spriteAsset("map.entity.ship", "Sprites/Map/ship");
|
||||
}
|
||||
|
||||
function itemIconAsset(itemKey: string): AssetRef {
|
||||
const key = itemKey.trim();
|
||||
return key.length > 0
|
||||
? textureAsset(`item.${key}.icon`, `item.${key}.icon`)
|
||||
: emptyAsset("texture");
|
||||
}
|
||||
|
||||
function spriteAsset(assetKey: string, resourcePath: string): AssetRef {
|
||||
return asset(assetKey, "sprite", `resources://${resourcePath}`, "resources", "image/*");
|
||||
}
|
||||
|
||||
function textureAsset(assetKey: string, resourcePath: string): AssetRef {
|
||||
return asset(assetKey, "texture", resourcePath.startsWith("resources://") ? resourcePath : `resources://${resourcePath}`, "resources", "image/*");
|
||||
}
|
||||
|
||||
function assetRef(value: unknown[], fallback: AssetRef = emptyAsset()): AssetRef {
|
||||
const assetKey = str(value[assetRefSlots.assetKey]);
|
||||
if (assetKey.length === 0)
|
||||
return fallback;
|
||||
|
||||
return asset(
|
||||
assetKey,
|
||||
str(value[assetRefSlots.kind]),
|
||||
str(value[assetRefSlots.uri]),
|
||||
str(value[assetRefSlots.transport]),
|
||||
str(value[assetRefSlots.mimeType]),
|
||||
str(value[assetRefSlots.contentHash]),
|
||||
stringRecord(value[assetRefSlots.metadata]),
|
||||
);
|
||||
}
|
||||
|
||||
function asset(
|
||||
assetKey: string,
|
||||
kind: string,
|
||||
uri: string,
|
||||
transport: string,
|
||||
mimeType: string,
|
||||
contentHash = "",
|
||||
metadata: Record<string, string> = {},
|
||||
): AssetRef {
|
||||
return {
|
||||
assetKey,
|
||||
kind,
|
||||
uri,
|
||||
transport,
|
||||
contentHash,
|
||||
mimeType,
|
||||
metadata,
|
||||
};
|
||||
}
|
||||
|
||||
function emptyAsset(kind = ""): AssetRef {
|
||||
return asset("", kind, "", "", "");
|
||||
}
|
||||
|
||||
function arr(value: unknown): unknown[] {
|
||||
return Array.isArray(value) ? value : [];
|
||||
}
|
||||
|
|
@ -432,6 +533,17 @@ function stringList(value: unknown): string[] {
|
|||
return Array.isArray(value) ? value.map(candidate => str(candidate)).filter(candidate => candidate.length > 0) : [];
|
||||
}
|
||||
|
||||
function stringRecord(value: unknown): Record<string, string> {
|
||||
if (!value || typeof value !== "object" || Array.isArray(value))
|
||||
return {};
|
||||
|
||||
return Object.fromEntries(
|
||||
Object.entries(value)
|
||||
.map(([key, candidate]) => [key, str(candidate)])
|
||||
.filter(([, candidate]) => candidate.length > 0),
|
||||
);
|
||||
}
|
||||
|
||||
function str(value: unknown): string {
|
||||
return typeof value === "string" ? value : "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ async function runElectronSmoke(window: BrowserWindow): Promise<Record<string, u
|
|||
const health = api ? await api.daemonHealth() : null;
|
||||
const authority = api ? await api.authorityStatus() : null;
|
||||
const starbridge = api ? await api.starbridgeSession() : null;
|
||||
const assetManifest = api ? await api.assetManifest() : null;
|
||||
const surfaceCatalog = api ? await api.surfaceCatalog() : null;
|
||||
const surfaceCatalogIndex = api ? await api.surfaceCatalogIndex() : null;
|
||||
const viewport = api ? await api.mapViewport({ minX: -5000, minY: -5000, maxX: 5000, maxY: 5000 }) : null;
|
||||
|
|
@ -168,6 +169,7 @@ async function runElectronSmoke(window: BrowserWindow): Promise<Record<string, u
|
|||
typeof api.daemonHealth === "function" &&
|
||||
typeof api.authorityStatus === "function" &&
|
||||
typeof api.starbridgeSession === "function" &&
|
||||
typeof api.assetManifest === "function" &&
|
||||
typeof api.surfaceCatalog === "function" &&
|
||||
typeof api.surfaceCatalogIndex === "function",
|
||||
status,
|
||||
|
|
@ -183,6 +185,7 @@ async function runElectronSmoke(window: BrowserWindow): Promise<Record<string, u
|
|||
health,
|
||||
authority,
|
||||
starbridge,
|
||||
assetManifest,
|
||||
surfaceCatalog,
|
||||
surfaceCatalogIndex,
|
||||
moveReceipt
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ const channels = {
|
|||
daemonHealth: "aetheria-rts:daemon-health",
|
||||
authorityStatus: "aetheria-rts:authority-status",
|
||||
starbridgeSession: "aetheria-rts:starbridge-session",
|
||||
assetManifest: "aetheria-rts:asset-manifest",
|
||||
setMoveVector: "aetheria-rts:set-move-vector",
|
||||
setTarget: "aetheria-rts:set-target",
|
||||
surfaceCatalog: "aetheria-rts:surface-catalog",
|
||||
|
|
@ -45,6 +46,7 @@ contextBridge.exposeInMainWorld("aetheriaRts", {
|
|||
daemonHealth: () => ipcRenderer.invoke(channels.daemonHealth),
|
||||
authorityStatus: () => ipcRenderer.invoke(channels.authorityStatus),
|
||||
starbridgeSession: () => ipcRenderer.invoke(channels.starbridgeSession),
|
||||
assetManifest: () => ipcRenderer.invoke(channels.assetManifest),
|
||||
setMoveVector: request => ipcRenderer.invoke(channels.setMoveVector, request),
|
||||
setTarget: request => ipcRenderer.invoke(channels.setTarget, request),
|
||||
surfaceCatalog: () => ipcRenderer.invoke(channels.surfaceCatalog),
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const repoRoot = resolve(root, "..");
|
|||
const sources = [
|
||||
resolve(repoRoot, "Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonDocuments.cs"),
|
||||
resolve(repoRoot, "Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeEveCommandDocument.cs"),
|
||||
resolve(repoRoot, "Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeAssetDocuments.cs"),
|
||||
resolve(repoRoot, "Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs"),
|
||||
resolve(repoRoot, "Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeRtsViewportDocuments.cs"),
|
||||
resolve(repoRoot, "Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStarbridgeDocuments.cs"),
|
||||
|
|
@ -31,6 +32,7 @@ const ipcChannels = [
|
|||
["daemonHealth", "aetheria-rts:daemon-health"],
|
||||
["authorityStatus", "aetheria-rts:authority-status"],
|
||||
["starbridgeSession", "aetheria-rts:starbridge-session"],
|
||||
["assetManifest", "aetheria-rts:asset-manifest"],
|
||||
["setMoveVector", "aetheria-rts:set-move-vector"],
|
||||
["setTarget", "aetheria-rts:set-target"],
|
||||
["surfaceCatalog", "aetheria-rts:surface-catalog"],
|
||||
|
|
@ -71,6 +73,19 @@ const documents = [
|
|||
className: "AetheriaRuntimeDaemonHealthDocument",
|
||||
schemaName: "daemonHealth",
|
||||
},
|
||||
{
|
||||
exportName: "aetheriaRuntimeAssetRef",
|
||||
className: "AetheriaRuntimeAssetRef",
|
||||
},
|
||||
{
|
||||
exportName: "aetheriaRuntimeAssetManifestDocument",
|
||||
className: "AetheriaRuntimeAssetManifestDocument",
|
||||
schemaName: "assetManifest",
|
||||
},
|
||||
{
|
||||
exportName: "aetheriaRuntimeAssetManifestEntry",
|
||||
className: "AetheriaRuntimeAssetManifestEntry",
|
||||
},
|
||||
{
|
||||
exportName: "aetheriaRuntimeRtsViewportDocument",
|
||||
className: "AetheriaRuntimeRtsViewportDocument",
|
||||
|
|
@ -285,18 +300,12 @@ if (check) {
|
|||
|
||||
function readExisting(path) {
|
||||
try {
|
||||
return normalizeGeneratedText(readFileSync(path, "utf8"));
|
||||
return readFileSync(path, "utf8");
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeGeneratedText(text) {
|
||||
return text
|
||||
.replace(/^\uFEFF/u, "")
|
||||
.replace(/\r\n/gu, "\n");
|
||||
}
|
||||
|
||||
function parseEnum(text, enumName) {
|
||||
const body = readTypeBody(text, `enum ${enumName}`);
|
||||
const entries = [];
|
||||
|
|
@ -438,6 +447,7 @@ export type AetheriaRuntimeViewportFeedSnapshot = {
|
|||
daemonHealth: DaemonHealthProjection;
|
||||
authorityStatus: AuthorityStatusProjection;
|
||||
starbridgeSession: StarbridgeSessionProjection;
|
||||
assetManifest: AssetManifestProjection;
|
||||
receivedAtUtc: string;
|
||||
sampleMs: number;
|
||||
};
|
||||
|
|
@ -451,6 +461,7 @@ export type AetheriaRtsMainClient = {
|
|||
daemonHealth(): Promise<DaemonHealthProjection>;
|
||||
authorityStatus(): Promise<AuthorityStatusProjection>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionProjection>;
|
||||
assetManifest(): Promise<AssetManifestProjection>;
|
||||
watchViewportFeed(request: AetheriaRuntimeViewportFeedRequest, callback: (snapshot: AetheriaRuntimeViewportFeedSnapshot) => void): CultMeshUnsubscribe;
|
||||
setMoveVector(request: AetheriaRuntimeSetMoveVectorRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
setTarget(request: AetheriaRuntimeSetTargetRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
|
|
@ -479,6 +490,7 @@ export function registerAetheriaRtsIpcHandlers(
|
|||
ipcMain.handle(AetheriaRtsIpcChannels.daemonHealth, async () => getClient().daemonHealth());
|
||||
ipcMain.handle(AetheriaRtsIpcChannels.authorityStatus, async () => getClient().authorityStatus());
|
||||
ipcMain.handle(AetheriaRtsIpcChannels.starbridgeSession, async () => getClient().starbridgeSession());
|
||||
ipcMain.handle(AetheriaRtsIpcChannels.assetManifest, async () => getClient().assetManifest());
|
||||
ipcMain.handle(AetheriaRtsIpcChannels.viewportFeed, async (event, request: { subscriptionId: string; feed: AetheriaRuntimeViewportFeedRequest }) => {
|
||||
viewportFeedSubscriptions.get(request.subscriptionId)?.();
|
||||
const unsubscribe = getClient().watchViewportFeed(request.feed, snapshot => {
|
||||
|
|
@ -528,6 +540,7 @@ export type AetheriaRuntimeRtsQueryExecutors = {
|
|||
daemonHealth: AetheriaRuntimeQueryExecutor<void, DaemonHealthProjection>;
|
||||
authorityStatus: AetheriaRuntimeQueryExecutor<void, AuthorityStatusProjection>;
|
||||
starbridgeSession: AetheriaRuntimeQueryExecutor<void, StarbridgeSessionProjection>;
|
||||
assetManifest: AetheriaRuntimeQueryExecutor<void, AssetManifestProjection>;
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeRtsQueryWatchers = Partial<{
|
||||
|
|
@ -539,6 +552,7 @@ export type AetheriaRuntimeRtsQueryWatchers = Partial<{
|
|||
daemonHealth: CultMeshQueryWatcher<void, DaemonHealthProjection>;
|
||||
authorityStatus: CultMeshQueryWatcher<void, AuthorityStatusProjection>;
|
||||
starbridgeSession: CultMeshQueryWatcher<void, StarbridgeSessionProjection>;
|
||||
assetManifest: CultMeshQueryWatcher<void, AssetManifestProjection>;
|
||||
}>;
|
||||
|
||||
export type AetheriaRuntimeRtsProjectionDiagnostic = CultMeshQuerySurfaceDiagnostic;
|
||||
|
|
@ -558,6 +572,7 @@ export type AetheriaRuntimeRtsDocumentResolvers = Partial<{
|
|||
daemonHealth: (context: CultMeshQueryContext) => Promise<unknown>;
|
||||
authorityPolicy: (context: CultMeshQueryContext) => Promise<unknown>;
|
||||
starbridgeSession: (context: CultMeshQueryContext) => Promise<unknown>;
|
||||
assetManifest: (context: CultMeshQueryContext) => Promise<unknown>;
|
||||
}>;
|
||||
|
||||
export type AetheriaRuntimeRtsStatePointerResolvers = AetheriaRuntimeRtsDocumentResolvers;
|
||||
|
|
@ -578,6 +593,10 @@ export const AetheriaRuntimeRtsProjectionSources = {
|
|||
starbridgeSession: CultMesh.projectionSource("daemon:aetheria.starbridge.session.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.starbridgeSessionSummary,
|
||||
description: "latest Starbridge session summary"
|
||||
}),
|
||||
assetManifest: CultMesh.projectionSource("daemon:aetheria.asset_manifest.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.assetManifest,
|
||||
description: "latest daemon asset manifest"
|
||||
})
|
||||
} as const;
|
||||
|
||||
|
|
@ -622,6 +641,15 @@ export function createAetheriaRuntimeRtsDocuments(
|
|||
sources: [AetheriaRuntimeRtsProjectionSources.starbridgeSession],
|
||||
},
|
||||
),
|
||||
assetManifest: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.assetManifest.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.assetManifest },
|
||||
async (context) => resolvers.assetManifest?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.assetManifest],
|
||||
},
|
||||
),
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
|
@ -681,6 +709,12 @@ export function createAetheriaRuntimeRtsQueryHandles(
|
|||
executors.starbridgeSession,
|
||||
{ routeHint, watchProjection: watchers.starbridgeSession },
|
||||
).asQuerySurface(),
|
||||
assetManifest: CultMesh.projectionRecipe<void, AssetManifestProjection>(
|
||||
AetheriaRtsSchemas.assetManifest,
|
||||
[AetheriaRuntimeRtsProjectionSources.assetManifest],
|
||||
executors.assetManifest,
|
||||
{ routeHint, watchProjection: watchers.assetManifest },
|
||||
).asQuerySurface(),
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
|
@ -696,6 +730,7 @@ export function describeAetheriaRuntimeRtsQueryHandles(
|
|||
daemonHealth: describeAetheriaRuntimeRtsQuerySurface(handles.daemonHealth),
|
||||
authorityStatus: describeAetheriaRuntimeRtsQuerySurface(handles.authorityStatus),
|
||||
starbridgeSession: describeAetheriaRuntimeRtsQuerySurface(handles.starbridgeSession),
|
||||
assetManifest: describeAetheriaRuntimeRtsQuerySurface(handles.assetManifest),
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
|
@ -711,6 +746,7 @@ export function describeAetheriaRuntimeRtsSurfaceCatalog(
|
|||
CultMesh.describeSurface(documents.daemonHealth),
|
||||
CultMesh.describeSurface(documents.authorityPolicy),
|
||||
CultMesh.describeSurface(documents.starbridgeSession),
|
||||
CultMesh.describeSurface(documents.assetManifest),
|
||||
CultMesh.describeSurface(handles.mapViewport),
|
||||
CultMesh.describeSurface(handles.objectsViewport),
|
||||
CultMesh.describeSurface(handles.gravityViewport),
|
||||
|
|
@ -719,6 +755,7 @@ export function describeAetheriaRuntimeRtsSurfaceCatalog(
|
|||
CultMesh.describeSurface(handles.daemonHealth),
|
||||
CultMesh.describeSurface(handles.authorityStatus),
|
||||
CultMesh.describeSurface(handles.starbridgeSession),
|
||||
CultMesh.describeSurface(handles.assetManifest),
|
||||
...(operations
|
||||
? [
|
||||
CultMesh.describeSurface(operations.setMoveVector),
|
||||
|
|
@ -804,10 +841,12 @@ export function createAetheriaRuntimeRtsVerseFacade(
|
|||
const daemonHealth = CultMesh.bindQuery(queryVerse, queries.daemonHealth);
|
||||
const authorityStatus = CultMesh.bindQuery(queryVerse, queries.authorityStatus);
|
||||
const starbridgeSession = CultMesh.bindQuery(queryVerse, queries.starbridgeSession);
|
||||
const assetManifest = CultMesh.bindQuery(queryVerse, queries.assetManifest);
|
||||
const daemonFrameDocument = CultMesh.bindDocument(queryVerse, documents.daemonFrame);
|
||||
const daemonHealthDocument = CultMesh.bindDocument(queryVerse, documents.daemonHealth);
|
||||
const authorityPolicyDocument = CultMesh.bindDocument(queryVerse, documents.authorityPolicy);
|
||||
const starbridgeSessionDocument = CultMesh.bindDocument(queryVerse, documents.starbridgeSession);
|
||||
const assetManifestDocument = CultMesh.bindDocument(queryVerse, documents.assetManifest);
|
||||
const setMoveVector = CultMesh.bindOperation(commandVerse, operations.setMoveVector);
|
||||
const setTarget = CultMesh.bindOperation(commandVerse, operations.setTarget);
|
||||
|
||||
|
|
@ -870,10 +909,12 @@ export function createAetheriaRuntimeRtsVerseFacade(
|
|||
health: () => daemonHealthDocument.latest(),
|
||||
authorityPolicy: () => authorityPolicyDocument.latest(),
|
||||
starbridgeSession: () => starbridgeSessionDocument.latest(),
|
||||
assetManifest: () => assetManifestDocument.latest(),
|
||||
},
|
||||
health: () => daemonHealth.execute(undefined),
|
||||
authorityStatus: () => authorityStatus.execute(undefined),
|
||||
starbridgeSession: () => starbridgeSession.execute(undefined),
|
||||
assetManifest: () => assetManifest.execute(undefined),
|
||||
},
|
||||
} as const;
|
||||
}
|
||||
|
|
@ -991,6 +1032,7 @@ export type AetheriaRuntimeViewportFeedSnapshot = {
|
|||
daemonHealth: DaemonHealthProjection;
|
||||
authorityStatus: AuthorityStatusProjection;
|
||||
starbridgeSession: StarbridgeSessionProjection;
|
||||
assetManifest: AssetManifestProjection;
|
||||
receivedAtUtc: string;
|
||||
sampleMs: number;
|
||||
};
|
||||
|
|
@ -1006,6 +1048,7 @@ export type AetheriaRtsApi = {
|
|||
daemonHealth(): Promise<DaemonHealthProjection>;
|
||||
authorityStatus(): Promise<AuthorityStatusProjection>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionProjection>;
|
||||
assetManifest(): Promise<AssetManifestProjection>;
|
||||
watchViewportFeed(request: AetheriaRuntimeViewportFeedRequest, callback: (snapshot: AetheriaRuntimeViewportFeedSnapshot) => void): () => void;
|
||||
setMoveVector(request: AetheriaRuntimeSetMoveVectorRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
setTarget(request: AetheriaRuntimeSetTargetRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
|
|
@ -1077,6 +1120,7 @@ export type ViewObject = {
|
|||
targetEntityIndex: number;
|
||||
isActive: boolean;
|
||||
visibility: number;
|
||||
iconAsset: AssetRef;
|
||||
status: EntityStatus;
|
||||
inventory: InventoryItem[];
|
||||
};
|
||||
|
|
@ -1094,6 +1138,7 @@ export type InventoryItem = {
|
|||
quality: number;
|
||||
durability: number;
|
||||
enabled: boolean;
|
||||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type SelectedObjectProjection = {
|
||||
|
|
@ -1187,6 +1232,33 @@ export type StarbridgeStationStockItemProjection = {
|
|||
quality: number;
|
||||
durability: number;
|
||||
source: string;
|
||||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type AssetManifestProjection = {
|
||||
schema: string;
|
||||
publishedAtUtc: string;
|
||||
runId: string;
|
||||
baseUri: string;
|
||||
assets: AssetManifestEntry[];
|
||||
};
|
||||
|
||||
export type AssetManifestEntry = {
|
||||
ref: AssetRef;
|
||||
sizeBytes: number;
|
||||
width: number;
|
||||
height: number;
|
||||
tags: string[];
|
||||
};
|
||||
|
||||
export type AssetRef = {
|
||||
assetKey: string;
|
||||
kind: string;
|
||||
uri: string;
|
||||
transport: string;
|
||||
contentHash: string;
|
||||
mimeType: string;
|
||||
metadata: Record<string, string>;
|
||||
};
|
||||
|
||||
export type StarbridgeWaveForecastProjection = {
|
||||
|
|
@ -1261,6 +1333,7 @@ function renderPreload() {
|
|||
name === "daemonHealth" ||
|
||||
name === "authorityStatus" ||
|
||||
name === "starbridgeSession" ||
|
||||
name === "assetManifest" ||
|
||||
name === "surfaceCatalog" ||
|
||||
name === "surfaceCatalogIndex";
|
||||
const parameters = hasNoArguments ? "()" : "request";
|
||||
|
|
|
|||
Loading…
Reference in a new issue