Add activated workspace reflection and Studio definition watches

Expose bounded snapshot-bound definition reads and latest-only watches from the serving checked bundle. Add checked reflection dependency ports, generated SDK bindings and selector-scoped invocation authority.

Move Studio factory, contract and query discovery to public reflection inventories. Share an active-definition watch across canvas and standalone routes and invalidate/reload on epoch changes instead of polling GetWorkspace.

Document the API and deferred scope; cover compiler/codegen, SDK injection, transport authorization, activation publication, pagination and reconnect behavior. Keep all work local; no deployment or publication.
This commit is contained in:
Timothy J. Aveni
2026-09-19 10:18:47 -07:00
parent 696009f6fd
commit d0f9454532
21 changed files with 1143 additions and 74 deletions
+7 -1
View File
@@ -2,6 +2,8 @@ import http from "node:http";
import { type QxObjectRef } from "./references.js";
export * from "./bindings.js";
export * from "./queries.js";
export * from "./reflection.js";
import type { QxReflectionPort } from "./reflection.js";
export { relationshipMap, relationshipList, relationshipSet } from "./relationships.js";
export { createMigrationContext, migrationObjectId, serveMigration, type MigrationContext, type MigrationInput, type MigrationOutput, type MigrationEdge, } from "./migration.js";
import { type Client, type ConnectRouter } from "@connectrpc/connect";
@@ -67,7 +69,10 @@ export type QueryPort = {
execute(variables: Record<string, Value>, expectedDefinitionDigest?: string): Promise<QueryResponse>;
watch(variables: Record<string, Value>, signal: AbortSignal, expectedDefinitionDigest?: string): AsyncIterable<import("./quixos/orch_pb.js").QueryEvent>;
};
export type RuntimePort = StatePort | EdgePort | InterfacePort | ConstructorPort | QueryPort;
export type ReflectionPort = QxReflectionPort & {
reflection: true;
};
export type RuntimePort = StatePort | EdgePort | InterfacePort | ConstructorPort | QueryPort | ReflectionPort;
export type RuntimeContext = {
tryConform(object: QxObjectRef, interfaceRevisionId: string): Promise<InterfacePort | undefined>;
/** Cooperative cancellation. Completion is acknowledged only after the handler returns. */
@@ -82,6 +87,7 @@ export type RuntimeContext = {
interface(portId: string): InterfacePort;
constructor(portId: string): ConstructorPort;
query(portId: string): QueryPort;
reflection(portId: string): ReflectionPort;
};
export type RuntimeSession = {
id: string;