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:
Vendored
+4
@@ -63,6 +63,10 @@ export type QxOperationSpec = {
|
||||
outputType: QxValueType;
|
||||
};
|
||||
export type QxPortSpec = {
|
||||
kind: "reflection";
|
||||
id: string;
|
||||
selectors: string[];
|
||||
} | {
|
||||
kind: "query";
|
||||
id: string;
|
||||
definitionDigest: string;
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../src/bindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAGL,SAAS,EAGT,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AACxC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACrE,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAAE,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC;IAAC,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAA;CAAE,CAAC;AACrF,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AACvD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,cAAc,CAA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CAAA;CAAE,GAC3G;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,WAAW,CAAA;CAAE,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACnC,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AA6B7D,eAAO,MAAM,aAAa,SAAU,WAAW,SAAS,KAAK,GAAG,SAAS,YAAY,UAAU,KAAG,GAyCjG,CAAC;AAOF,eAAO,MAAM,aAAa,SAAU,WAAW,SAAS,GAAG,YAAY,UAAU,KAAG,KA8BnF,CAAC;AAmBF,uFAAuF;AACvF,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,CAAC,QAC1B,aAAa,WACV,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,YAChC,UAAU,KACnB,cAAc,GAAG,cAkInB,CAAC"}
|
||||
Vendored
+2
@@ -171,6 +171,8 @@ export const bindQxHandler = (spec, handler, messages) => {
|
||||
bindInterfaceView(target, defineQxInterfaceContract(port.interfaceRevisionId, port.operations), messages),
|
||||
];
|
||||
}
|
||||
case "reflection":
|
||||
return [name, raw.reflection(port.id)];
|
||||
case "query": {
|
||||
const query = raw.query(port.id);
|
||||
const variablesToWire = (variables) => {
|
||||
|
||||
Vendored
+7
-1
@@ -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;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+16
@@ -4,6 +4,7 @@ import { createInvocationRegistry } from "./invocations.js";
|
||||
import { isObjectReference, referenceFromWire, referenceToWire, assertReferenceFree, } from "./references.js";
|
||||
export * from "./bindings.js";
|
||||
export * from "./queries.js";
|
||||
export * from "./reflection.js";
|
||||
export { relationshipMap, relationshipList, relationshipSet } from "./relationships.js";
|
||||
import { AsyncLocalStorage } from "node:async_hooks";
|
||||
import { createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
||||
@@ -156,6 +157,20 @@ export const createRuntimeContext = (camino, orch, request) => {
|
||||
const ports = new Map();
|
||||
for (const dependency of request.dependencies) {
|
||||
switch (dependency.binding.case) {
|
||||
case "reflection": {
|
||||
const scope = dependency.binding.value;
|
||||
const scoped = (input) => {
|
||||
if (!scope.selectors.includes(input.selector.kind))
|
||||
throw new Error("Undeclared reflection selector");
|
||||
return { ...input, workspaceId: scope.workspaceId, workspaceEpoch: scope.workspaceEpoch };
|
||||
};
|
||||
ports.set(dependency.portId, {
|
||||
reflection: true,
|
||||
read: (input) => orch.readDefinitions(scoped(input)),
|
||||
watch: (input, signal) => orch.watchDefinitions(scoped(input), { signal }),
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "queryId":
|
||||
case "workspaceQuery": {
|
||||
if (dependency.binding.case === "workspaceQuery" && !dependency.binding.value.scope)
|
||||
@@ -315,6 +330,7 @@ export const createRuntimeContext = (camino, orch, request) => {
|
||||
interface: (portId) => requirePort(portId, "interfaceRevisionId"),
|
||||
constructor: (portId) => requirePort(portId, "atomId"),
|
||||
query: (portId) => requirePort(portId, "queryId"),
|
||||
reflection: (portId) => requirePort(portId, "reflection"),
|
||||
};
|
||||
};
|
||||
export const derived = (get) => ({ kind: "derived", get });
|
||||
|
||||
Vendored
+356
@@ -9,6 +9,346 @@ import type { Message } from "@bufbuild/protobuf";
|
||||
* Describes the file quixos/orch.proto.
|
||||
*/
|
||||
export declare const file_quixos_orch: GenFile;
|
||||
/**
|
||||
* Activated definitions, not runtime metrics or object data. Nested type JSON
|
||||
* uses the compiler's canonical ValueType/InterfaceRevision public contracts.
|
||||
*
|
||||
* @generated from message quixos.orch.DefinitionSelector
|
||||
*/
|
||||
export type DefinitionSelector = Message<"quixos.orch.DefinitionSelector"> & {
|
||||
/**
|
||||
* active | atoms | interfaces | conformances | queries | indexes
|
||||
*
|
||||
* @generated from field: string kind = 1;
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
* @generated from field: repeated string ids = 2;
|
||||
*/
|
||||
ids: string[];
|
||||
/**
|
||||
* @generated from field: string atom_id = 3;
|
||||
*/
|
||||
atomId: string;
|
||||
/**
|
||||
* @generated from field: string interface_revision_id = 4;
|
||||
*/
|
||||
interfaceRevisionId: string;
|
||||
/**
|
||||
* @generated from field: string package_revision_id = 5;
|
||||
*/
|
||||
packageRevisionId: string;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.DefinitionSelector.
|
||||
* Use `create(DefinitionSelectorSchema)` to create a new message.
|
||||
*/
|
||||
export declare const DefinitionSelectorSchema: GenMessage<DefinitionSelector>;
|
||||
/**
|
||||
* @generated from message quixos.orch.DefinitionIdentity
|
||||
*/
|
||||
export type DefinitionIdentity = Message<"quixos.orch.DefinitionIdentity"> & {
|
||||
/**
|
||||
* @generated from field: string workspace_id = 1;
|
||||
*/
|
||||
workspaceId: string;
|
||||
/**
|
||||
* @generated from field: string workspace_revision_id = 2;
|
||||
*/
|
||||
workspaceRevisionId: string;
|
||||
/**
|
||||
* @generated from field: string source_root_commit = 3;
|
||||
*/
|
||||
sourceRootCommit: string;
|
||||
/**
|
||||
* @generated from field: string workspace_epoch = 4;
|
||||
*/
|
||||
workspaceEpoch: string;
|
||||
/**
|
||||
* @generated from field: string definition_digest = 5;
|
||||
*/
|
||||
definitionDigest: string;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.DefinitionIdentity.
|
||||
* Use `create(DefinitionIdentitySchema)` to create a new message.
|
||||
*/
|
||||
export declare const DefinitionIdentitySchema: GenMessage<DefinitionIdentity>;
|
||||
/**
|
||||
* @generated from message quixos.orch.DefinitionRequest
|
||||
*/
|
||||
export type DefinitionRequest = Message<"quixos.orch.DefinitionRequest"> & {
|
||||
/**
|
||||
* @generated from field: quixos.orch.DefinitionSelector selector = 1;
|
||||
*/
|
||||
selector?: DefinitionSelector | undefined;
|
||||
/**
|
||||
* 1..100; 0 uses 50
|
||||
*
|
||||
* @generated from field: uint32 first = 2;
|
||||
*/
|
||||
first: number;
|
||||
/**
|
||||
* @generated from field: string after = 3;
|
||||
*/
|
||||
after: string;
|
||||
/**
|
||||
* issued definition_digest; current serving snapshot only
|
||||
*
|
||||
* @generated from field: string snapshot = 4;
|
||||
*/
|
||||
snapshot: string;
|
||||
/**
|
||||
* required for injected package authority
|
||||
*
|
||||
* @generated from field: string workspace_id = 5;
|
||||
*/
|
||||
workspaceId: string;
|
||||
/**
|
||||
* required for invocation-bound package calls
|
||||
*
|
||||
* @generated from field: string workspace_epoch = 6;
|
||||
*/
|
||||
workspaceEpoch: string;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.DefinitionRequest.
|
||||
* Use `create(DefinitionRequestSchema)` to create a new message.
|
||||
*/
|
||||
export declare const DefinitionRequestSchema: GenMessage<DefinitionRequest>;
|
||||
/**
|
||||
* @generated from message quixos.orch.ReflectedAtom
|
||||
*/
|
||||
export type ReflectedAtom = Message<"quixos.orch.ReflectedAtom"> & {
|
||||
/**
|
||||
* @generated from field: string id = 1;
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* @generated from field: string display_name = 2;
|
||||
*/
|
||||
displayName: string;
|
||||
/**
|
||||
* @generated from field: string constructor_input_type_json = 3;
|
||||
*/
|
||||
constructorInputTypeJson: string;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.ReflectedAtom.
|
||||
* Use `create(ReflectedAtomSchema)` to create a new message.
|
||||
*/
|
||||
export declare const ReflectedAtomSchema: GenMessage<ReflectedAtom>;
|
||||
/**
|
||||
* @generated from message quixos.orch.ReflectedInterface
|
||||
*/
|
||||
export type ReflectedInterface = Message<"quixos.orch.ReflectedInterface"> & {
|
||||
/**
|
||||
* @generated from field: string id = 1;
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* @generated from field: string interface_id = 2;
|
||||
*/
|
||||
interfaceId: string;
|
||||
/**
|
||||
* @generated from field: string display_name = 3;
|
||||
*/
|
||||
displayName: string;
|
||||
/**
|
||||
* canonical interface contract, excluding source location
|
||||
*
|
||||
* @generated from field: string contract_json = 4;
|
||||
*/
|
||||
contractJson: string;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.ReflectedInterface.
|
||||
* Use `create(ReflectedInterfaceSchema)` to create a new message.
|
||||
*/
|
||||
export declare const ReflectedInterfaceSchema: GenMessage<ReflectedInterface>;
|
||||
/**
|
||||
* @generated from message quixos.orch.ReflectedConformance
|
||||
*/
|
||||
export type ReflectedConformance = Message<"quixos.orch.ReflectedConformance"> & {
|
||||
/**
|
||||
* @generated from field: string id = 1;
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* @generated from field: string atom_id = 2;
|
||||
*/
|
||||
atomId: string;
|
||||
/**
|
||||
* @generated from field: string interface_revision_id = 3;
|
||||
*/
|
||||
interfaceRevisionId: string;
|
||||
/**
|
||||
* @generated from field: string definition_id = 4;
|
||||
*/
|
||||
definitionId: string;
|
||||
/**
|
||||
* @generated from field: repeated string operation_ids = 5;
|
||||
*/
|
||||
operationIds: string[];
|
||||
/**
|
||||
* @generated from field: repeated quixos.orch.ClassCapability class_capabilities = 6;
|
||||
*/
|
||||
classCapabilities: ClassCapability[];
|
||||
/**
|
||||
* @generated from field: bool instance = 7;
|
||||
*/
|
||||
instance: boolean;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.ReflectedConformance.
|
||||
* Use `create(ReflectedConformanceSchema)` to create a new message.
|
||||
*/
|
||||
export declare const ReflectedConformanceSchema: GenMessage<ReflectedConformance>;
|
||||
/**
|
||||
* @generated from message quixos.orch.ReflectedQuery
|
||||
*/
|
||||
export type ReflectedQuery = Message<"quixos.orch.ReflectedQuery"> & {
|
||||
/**
|
||||
* @generated from field: string id = 1;
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* @generated from field: string name = 2;
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* @generated from field: string package_revision_id = 3;
|
||||
*/
|
||||
packageRevisionId: string;
|
||||
/**
|
||||
* @generated from field: string definition_digest = 4;
|
||||
*/
|
||||
definitionDigest: string;
|
||||
/**
|
||||
* @generated from field: string binding_digest = 5;
|
||||
*/
|
||||
bindingDigest: string;
|
||||
/**
|
||||
* @generated from field: string root_kind = 6;
|
||||
*/
|
||||
rootKind: string;
|
||||
/**
|
||||
* @generated from field: string interface_revision_id = 7;
|
||||
*/
|
||||
interfaceRevisionId: string;
|
||||
/**
|
||||
* @generated from field: string variables_type_json = 8;
|
||||
*/
|
||||
variablesTypeJson: string;
|
||||
/**
|
||||
* @generated from field: string output_type_json = 9;
|
||||
*/
|
||||
outputTypeJson: string;
|
||||
/**
|
||||
* @generated from field: string effects_json = 10;
|
||||
*/
|
||||
effectsJson: string;
|
||||
/**
|
||||
* @generated from field: bool watch = 11;
|
||||
*/
|
||||
watch: boolean;
|
||||
/**
|
||||
* @generated from field: quixos.WorkspaceQueryScope workspace_scope = 12;
|
||||
*/
|
||||
workspaceScope?: WorkspaceQueryScope | undefined;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.ReflectedQuery.
|
||||
* Use `create(ReflectedQuerySchema)` to create a new message.
|
||||
*/
|
||||
export declare const ReflectedQuerySchema: GenMessage<ReflectedQuery>;
|
||||
/**
|
||||
* @generated from message quixos.orch.ReflectedIndex
|
||||
*/
|
||||
export type ReflectedIndex = Message<"quixos.orch.ReflectedIndex"> & {
|
||||
/**
|
||||
* @generated from field: string id = 1;
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* @generated from field: string contract_json = 2;
|
||||
*/
|
||||
contractJson: string;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.ReflectedIndex.
|
||||
* Use `create(ReflectedIndexSchema)` to create a new message.
|
||||
*/
|
||||
export declare const ReflectedIndexSchema: GenMessage<ReflectedIndex>;
|
||||
/**
|
||||
* @generated from message quixos.orch.DefinitionRecord
|
||||
*/
|
||||
export type DefinitionRecord = Message<"quixos.orch.DefinitionRecord"> & {
|
||||
/**
|
||||
* @generated from oneof quixos.orch.DefinitionRecord.definition
|
||||
*/
|
||||
definition: {
|
||||
/**
|
||||
* @generated from field: quixos.orch.ReflectedAtom atom = 1;
|
||||
*/
|
||||
value: ReflectedAtom;
|
||||
case: "atom";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: quixos.orch.ReflectedInterface interface = 2;
|
||||
*/
|
||||
value: ReflectedInterface;
|
||||
case: "interface";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: quixos.orch.ReflectedConformance conformance = 3;
|
||||
*/
|
||||
value: ReflectedConformance;
|
||||
case: "conformance";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: quixos.orch.ReflectedQuery query = 4;
|
||||
*/
|
||||
value: ReflectedQuery;
|
||||
case: "query";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: quixos.orch.ReflectedIndex index = 5;
|
||||
*/
|
||||
value: ReflectedIndex;
|
||||
case: "index";
|
||||
} | {
|
||||
case: undefined;
|
||||
value?: undefined;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.DefinitionRecord.
|
||||
* Use `create(DefinitionRecordSchema)` to create a new message.
|
||||
*/
|
||||
export declare const DefinitionRecordSchema: GenMessage<DefinitionRecord>;
|
||||
/**
|
||||
* @generated from message quixos.orch.DefinitionPage
|
||||
*/
|
||||
export type DefinitionPage = Message<"quixos.orch.DefinitionPage"> & {
|
||||
/**
|
||||
* @generated from field: quixos.orch.DefinitionIdentity identity = 1;
|
||||
*/
|
||||
identity?: DefinitionIdentity | undefined;
|
||||
/**
|
||||
* @generated from field: repeated quixos.orch.DefinitionRecord records = 2;
|
||||
*/
|
||||
records: DefinitionRecord[];
|
||||
/**
|
||||
* @generated from field: string next_cursor = 3;
|
||||
*/
|
||||
nextCursor: string;
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.orch.DefinitionPage.
|
||||
* Use `create(DefinitionPageSchema)` to create a new message.
|
||||
*/
|
||||
export declare const DefinitionPageSchema: GenMessage<DefinitionPage>;
|
||||
/**
|
||||
* @generated from message quixos.orch.QueryEvent
|
||||
*/
|
||||
@@ -779,6 +1119,22 @@ export declare const PackageRuntimeStatusSchema: GenMessage<PackageRuntimeStatus
|
||||
* @generated from service quixos.orch.OrchestratorRuntime
|
||||
*/
|
||||
export declare const OrchestratorRuntime: GenService<{
|
||||
/**
|
||||
* @generated from rpc quixos.orch.OrchestratorRuntime.ReadDefinitions
|
||||
*/
|
||||
readDefinitions: {
|
||||
methodKind: "unary";
|
||||
input: typeof DefinitionRequestSchema;
|
||||
output: typeof DefinitionPageSchema;
|
||||
};
|
||||
/**
|
||||
* @generated from rpc quixos.orch.OrchestratorRuntime.WatchDefinitions
|
||||
*/
|
||||
watchDefinitions: {
|
||||
methodKind: "server_streaming";
|
||||
input: typeof DefinitionRequestSchema;
|
||||
output: typeof DefinitionPageSchema;
|
||||
};
|
||||
/**
|
||||
* @generated from rpc quixos.orch.OrchestratorRuntime.ExecuteQuery
|
||||
*/
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+80
-30
File diff suppressed because one or more lines are too long
Vendored
+28
@@ -176,6 +176,12 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
|
||||
*/
|
||||
value: WorkspaceQueryDependency;
|
||||
case: "workspaceQuery";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: quixos.ReflectionDependency reflection = 9;
|
||||
*/
|
||||
value: ReflectionDependency;
|
||||
case: "reflection";
|
||||
} | {
|
||||
case: undefined;
|
||||
value?: undefined;
|
||||
@@ -193,6 +199,28 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
|
||||
* Use `create(InjectedDependencySchema)` to create a new message.
|
||||
*/
|
||||
export declare const InjectedDependencySchema: GenMessage<InjectedDependency>;
|
||||
/**
|
||||
* @generated from message quixos.ReflectionDependency
|
||||
*/
|
||||
export type ReflectionDependency = Message<"quixos.ReflectionDependency"> & {
|
||||
/**
|
||||
* @generated from field: string workspace_id = 1;
|
||||
*/
|
||||
workspaceId: string;
|
||||
/**
|
||||
* @generated from field: string workspace_epoch = 2;
|
||||
*/
|
||||
workspaceEpoch: string;
|
||||
/**
|
||||
* @generated from field: repeated string selectors = 3;
|
||||
*/
|
||||
selectors: string[];
|
||||
};
|
||||
/**
|
||||
* Describes the message quixos.ReflectionDependency.
|
||||
* Use `create(ReflectionDependencySchema)` to create a new message.
|
||||
*/
|
||||
export declare const ReflectionDependencySchema: GenMessage<ReflectionDependency>;
|
||||
/**
|
||||
* Scope evidence is not authority by itself. The caller must also hold the
|
||||
* matching workspace-query grant (or the authenticated workspace user grant).
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"refs_pb.d.ts","sourceRoot":"","sources":["../../src/quixos/refs_pb.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEjF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,OACihD,CAAC;AAEjjD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG;IAC5D;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAAU,CAAC,aAAa,CACxB,CAAC;AAEnC;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG;IAC1D;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;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IACH,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,UAAU,CAAC,mBAAmB,CACpC,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,iCAAiC,CAAC,GAAG;IAClF;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,UAAU,CAAC,wBAAwB,CAC9C,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAAG;IAC9D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAAU,CAAC,cAAc,CAC1B,CAAC"}
|
||||
Vendored
+9
-4
@@ -5,7 +5,7 @@ import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
|
||||
/**
|
||||
* Describes the file quixos/refs.proto.
|
||||
*/
|
||||
export const file_quixos_refs = /*@__PURE__*/ fileDesc("ChFxdWl4b3MvcmVmcy5wcm90bxIGcXVpeG9zInUKDUNhcGFiaWxpdHlSZWYSHQoVaW50ZXJmYWNlX3JldmlzaW9uX2lkGAEgASgJEhQKDG9wZXJhdGlvbl9pZBgCIAEoCRIvCgtjb25mb3JtYW5jZRgDIAEoCzIaLnF1aXhvcy5Db25mb3JtYW5jZVdpdG5lc3Mi0QEKDEZpZWxkRWRpdGluZxIbChNnZXR0ZXJfb3BlcmF0aW9uX2lkGAEgASgJEhsKE3NldHRlcl9vcGVyYXRpb25faWQYAiABKAkSFQoNZG9jdW1lbnRfdHlwZRgDIAEoCRIWCg5iaW5kaW5nX2RpZ2VzdBg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W5kZW5jeUgAEh8KFWludGVyZmFjZV9yZXZpc2lvbl9pZBgEIAEoCUgAEh0KE2NvbnN0cnVjdG9yX2F0b21faWQYBSABKAlIABISCghxdWVyeV9pZBgHIAEoCUgAEjsKD3dvcmtzcGFjZV9xdWVyeRgIIAEoCzIgLnF1aXhvcy5Xb3Jrc3BhY2VRdWVyeURlcGVuZGVuY3lIABIyCgpyZWZsZWN0aW9uGAkgASgLMhwucXVpeG9zLlJlZmxlY3Rpb25EZXBlbmRlbmN5SAASEQoJb2JqZWN0X2lkGAYgASgJQgkKB2JpbmRpbmciWAoUUmVmbGVjdGlvbkRlcGVuZGVuY3kSFAoMd29ya3NwYWNlX2lkGAEgASgJEhcKD3dvcmtzcGFjZV9lcG9jaBgCIAEoCRIRCglzZWxlY3RvcnMYAyADKAkimgEKE1dvcmtzcGFjZVF1ZXJ5U2NvcGUSFAoMd29ya3NwYWNlX2lkGAEgASgJEh0KFXdvcmtzcGFjZV9yZXZpc2lvbl9pZBgCIAEoCRIXCg93b3Jrc3BhY2VfZXBvY2gYAyABKAkSHQoVaW50ZXJmYWNlX3JldmlzaW9uX2lkGAQgASgJEhYKDmJpbmRpbmdfZGlnZXN0GAUgASgJIlgKGFdvcmtzcGFjZVF1ZXJ5RGVwZW5kZW5jeRIQCghxdWVyeV9pZBgBIAEoCRIqCgVzY29wZRgCIAEoCzIbLnF1aXhvcy5Xb3Jrc3BhY2VRdWVyeVNjb3BlIj0KDkVkZ2VEZXBlbmRlbmN5EhQKDGVkZ2VfdHlwZV9pZBgBIAEoCRIVCg1wcm9qZWN0aW9uX2lkGAIgASgJYgZwcm90bzM");
|
||||
/**
|
||||
* Describes the message quixos.CapabilityRef.
|
||||
* Use `create(CapabilityRefSchema)` to create a new message.
|
||||
@@ -53,18 +53,23 @@ export const PackageExportRefSchema = /*@__PURE__*/ messageDesc(file_quixos_refs
|
||||
* Use `create(InjectedDependencySchema)` to create a new message.
|
||||
*/
|
||||
export const InjectedDependencySchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 4);
|
||||
/**
|
||||
* Describes the message quixos.ReflectionDependency.
|
||||
* Use `create(ReflectionDependencySchema)` to create a new message.
|
||||
*/
|
||||
export const ReflectionDependencySchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 5);
|
||||
/**
|
||||
* Describes the message quixos.WorkspaceQueryScope.
|
||||
* Use `create(WorkspaceQueryScopeSchema)` to create a new message.
|
||||
*/
|
||||
export const WorkspaceQueryScopeSchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 5);
|
||||
export const WorkspaceQueryScopeSchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 6);
|
||||
/**
|
||||
* Describes the message quixos.WorkspaceQueryDependency.
|
||||
* Use `create(WorkspaceQueryDependencySchema)` to create a new message.
|
||||
*/
|
||||
export const WorkspaceQueryDependencySchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 6);
|
||||
export const WorkspaceQueryDependencySchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 7);
|
||||
/**
|
||||
* Describes the message quixos.EdgeDependency.
|
||||
* Use `create(EdgeDependencySchema)` to create a new message.
|
||||
*/
|
||||
export const EdgeDependencySchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 7);
|
||||
export const EdgeDependencySchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 8);
|
||||
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
import type { DefinitionPage } from "./quixos/orch_pb.js";
|
||||
export type { DefinitionPage, DefinitionIdentity, DefinitionRecord, ReflectedAtom, ReflectedInterface, ReflectedConformance, ReflectedQuery, ReflectedIndex, } from "./quixos/orch_pb.js";
|
||||
export type ReflectionKind = "active" | "atoms" | "interfaces" | "conformances" | "queries" | "indexes";
|
||||
export type ReflectionSelector<K extends string = ReflectionKind> = K extends "active" ? {
|
||||
kind: K;
|
||||
} : K extends "atoms" ? {
|
||||
kind: K;
|
||||
ids?: string[];
|
||||
interfaceRevisionId?: string;
|
||||
} : K extends "conformances" ? {
|
||||
kind: K;
|
||||
ids?: string[];
|
||||
atomId?: string;
|
||||
interfaceRevisionId?: string;
|
||||
} : K extends "queries" ? {
|
||||
kind: K;
|
||||
ids?: string[];
|
||||
packageRevisionId?: string;
|
||||
interfaceRevisionId?: string;
|
||||
} : {
|
||||
kind: K;
|
||||
ids?: string[];
|
||||
};
|
||||
export type ReflectionRequest<K extends string = ReflectionKind> = {
|
||||
selector: ReflectionSelector<K>;
|
||||
first?: number;
|
||||
after?: string;
|
||||
snapshot?: string;
|
||||
};
|
||||
/** Read-only metadata. Returned capability IDs confer no invocation authority. */
|
||||
export type QxReflectionPort<K extends string = ReflectionKind> = {
|
||||
read(request: ReflectionRequest<K>): Promise<DefinitionPage>;
|
||||
watch(request: Omit<ReflectionRequest<K>, "after" | "snapshot">, signal: AbortSignal): AsyncIterable<DefinitionPage>;
|
||||
};
|
||||
//# sourceMappingURL=reflection.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"reflection.d.ts","sourceRoot":"","sources":["../src/reflection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AACxG,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,cAAc,IAAI,CAAC,SAAS,QAAQ,GAClF;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,GACX,CAAC,SAAS,OAAO,GACf;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAAE,GACzD,CAAC,SAAS,cAAc,GACtB;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1E,CAAC,SAAS,SAAS,GACjB;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAAE,GACrF;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AACtC,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,cAAc,IAAI;IACjE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,cAAc,IAAI;IAChE,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7D,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;CACtH,CAAC"}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -51,6 +51,7 @@ export type QxValueType =
|
||||
| { kind: "optional" | "list"; value: QxValueType };
|
||||
export type QxOperationSpec = { id: string; inputType: QxValueType; outputType: QxValueType };
|
||||
export type QxPortSpec =
|
||||
| { kind: "reflection"; id: string; selectors: string[] }
|
||||
| { kind: "query"; id: string; definitionDigest: string; variables: QxValueType; output: QxValueType; watch: boolean }
|
||||
| { kind: "state"; id: string; valueType: QxValueType; primitives: string[] }
|
||||
| { kind: "edge"; id: string; primitives: string[] }
|
||||
@@ -246,6 +247,8 @@ export const bindQxHandler = <C, O>(
|
||||
bindInterfaceView(target, defineQxInterfaceContract(port.interfaceRevisionId, port.operations), messages),
|
||||
];
|
||||
}
|
||||
case "reflection":
|
||||
return [name, raw.reflection(port.id)];
|
||||
case "query": {
|
||||
const query = raw.query(port.id);
|
||||
const variablesToWire = (variables: unknown) => {
|
||||
|
||||
+19
-1
@@ -10,6 +10,8 @@ import {
|
||||
} from "./references.js";
|
||||
export * from "./bindings.js";
|
||||
export * from "./queries.js";
|
||||
export * from "./reflection.js";
|
||||
import type { QxReflectionPort, ReflectionRequest } from "./reflection.js";
|
||||
export { relationshipMap, relationshipList, relationshipSet } from "./relationships.js";
|
||||
import { AsyncLocalStorage } from "node:async_hooks";
|
||||
import { createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
||||
@@ -208,7 +210,8 @@ export type QueryPort = {
|
||||
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>;
|
||||
@@ -224,6 +227,7 @@ export type RuntimeContext = {
|
||||
interface(portId: string): InterfacePort;
|
||||
constructor(portId: string): ConstructorPort;
|
||||
query(portId: string): QueryPort;
|
||||
reflection(portId: string): ReflectionPort;
|
||||
};
|
||||
|
||||
export type RuntimeSession = {
|
||||
@@ -285,6 +289,19 @@ export const createRuntimeContext = (
|
||||
const ports = new Map<string, RuntimePort>();
|
||||
for (const dependency of request.dependencies) {
|
||||
switch (dependency.binding.case) {
|
||||
case "reflection": {
|
||||
const scope = dependency.binding.value;
|
||||
const scoped = (input: ReflectionRequest) => {
|
||||
if (!scope.selectors.includes(input.selector.kind)) throw new Error("Undeclared reflection selector");
|
||||
return { ...input, workspaceId: scope.workspaceId, workspaceEpoch: scope.workspaceEpoch };
|
||||
};
|
||||
ports.set(dependency.portId, {
|
||||
reflection: true,
|
||||
read: (input: ReflectionRequest) => orch.readDefinitions(scoped(input)),
|
||||
watch: (input: ReflectionRequest, signal: AbortSignal) => orch.watchDefinitions(scoped(input), { signal }),
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "queryId":
|
||||
case "workspaceQuery": {
|
||||
if (dependency.binding.case === "workspaceQuery" && !dependency.binding.value.scope)
|
||||
@@ -453,6 +470,7 @@ export const createRuntimeContext = (
|
||||
interface: (portId: string) => requirePort<InterfacePort>(portId, "interfaceRevisionId"),
|
||||
constructor: (portId: string) => requirePort<ConstructorPort>(portId, "atomId"),
|
||||
query: (portId: string) => requirePort<QueryPort>(portId, "queryId"),
|
||||
reflection: (portId: string) => requirePort<ReflectionPort>(portId, "reflection"),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
+451
-30
File diff suppressed because one or more lines are too long
+37
-4
@@ -10,7 +10,7 @@ import type { Message } from "@bufbuild/protobuf";
|
||||
* Describes the file quixos/refs.proto.
|
||||
*/
|
||||
export const file_quixos_refs: GenFile = /*@__PURE__*/
|
||||
fileDesc("ChFxdWl4b3MvcmVmcy5wcm90bxIGcXVpeG9zInUKDUNhcGFiaWxpdHlSZWYSHQoVaW50ZXJmYWNlX3JldmlzaW9uX2lkGAEgASgJEhQKDG9wZXJhdGlvbl9pZBgCIAEoCRIvCgtjb25mb3JtYW5jZRgDIAEoCzIaLnF1aXhvcy5Db25mb3JtYW5jZ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-213,6 +213,12 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
|
||||
*/
|
||||
value: WorkspaceQueryDependency;
|
||||
case: "workspaceQuery";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: quixos.ReflectionDependency reflection = 9;
|
||||
*/
|
||||
value: ReflectionDependency;
|
||||
case: "reflection";
|
||||
} | { case: undefined; value?: undefined };
|
||||
|
||||
/**
|
||||
@@ -231,6 +237,33 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
|
||||
export const InjectedDependencySchema: GenMessage<InjectedDependency> = /*@__PURE__*/
|
||||
messageDesc(file_quixos_refs, 4);
|
||||
|
||||
/**
|
||||
* @generated from message quixos.ReflectionDependency
|
||||
*/
|
||||
export type ReflectionDependency = Message<"quixos.ReflectionDependency"> & {
|
||||
/**
|
||||
* @generated from field: string workspace_id = 1;
|
||||
*/
|
||||
workspaceId: string;
|
||||
|
||||
/**
|
||||
* @generated from field: string workspace_epoch = 2;
|
||||
*/
|
||||
workspaceEpoch: string;
|
||||
|
||||
/**
|
||||
* @generated from field: repeated string selectors = 3;
|
||||
*/
|
||||
selectors: string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message quixos.ReflectionDependency.
|
||||
* Use `create(ReflectionDependencySchema)` to create a new message.
|
||||
*/
|
||||
export const ReflectionDependencySchema: GenMessage<ReflectionDependency> = /*@__PURE__*/
|
||||
messageDesc(file_quixos_refs, 5);
|
||||
|
||||
/**
|
||||
* Scope evidence is not authority by itself. The caller must also hold the
|
||||
* matching workspace-query grant (or the authenticated workspace user grant).
|
||||
@@ -269,7 +302,7 @@ export type WorkspaceQueryScope = Message<"quixos.WorkspaceQueryScope"> & {
|
||||
* Use `create(WorkspaceQueryScopeSchema)` to create a new message.
|
||||
*/
|
||||
export const WorkspaceQueryScopeSchema: GenMessage<WorkspaceQueryScope> = /*@__PURE__*/
|
||||
messageDesc(file_quixos_refs, 5);
|
||||
messageDesc(file_quixos_refs, 6);
|
||||
|
||||
/**
|
||||
* @generated from message quixos.WorkspaceQueryDependency
|
||||
@@ -291,7 +324,7 @@ export type WorkspaceQueryDependency = Message<"quixos.WorkspaceQueryDependency"
|
||||
* Use `create(WorkspaceQueryDependencySchema)` to create a new message.
|
||||
*/
|
||||
export const WorkspaceQueryDependencySchema: GenMessage<WorkspaceQueryDependency> = /*@__PURE__*/
|
||||
messageDesc(file_quixos_refs, 6);
|
||||
messageDesc(file_quixos_refs, 7);
|
||||
|
||||
/**
|
||||
* @generated from message quixos.EdgeDependency
|
||||
@@ -313,5 +346,5 @@ export type EdgeDependency = Message<"quixos.EdgeDependency"> & {
|
||||
* Use `create(EdgeDependencySchema)` to create a new message.
|
||||
*/
|
||||
export const EdgeDependencySchema: GenMessage<EdgeDependency> = /*@__PURE__*/
|
||||
messageDesc(file_quixos_refs, 7);
|
||||
messageDesc(file_quixos_refs, 8);
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import type { DefinitionPage } from "./quixos/orch_pb.js";
|
||||
export type {
|
||||
DefinitionPage,
|
||||
DefinitionIdentity,
|
||||
DefinitionRecord,
|
||||
ReflectedAtom,
|
||||
ReflectedInterface,
|
||||
ReflectedConformance,
|
||||
ReflectedQuery,
|
||||
ReflectedIndex,
|
||||
} from "./quixos/orch_pb.js";
|
||||
export type ReflectionKind = "active" | "atoms" | "interfaces" | "conformances" | "queries" | "indexes";
|
||||
export type ReflectionSelector<K extends string = ReflectionKind> = K extends "active"
|
||||
? { kind: K }
|
||||
: K extends "atoms"
|
||||
? { kind: K; ids?: string[]; interfaceRevisionId?: string }
|
||||
: K extends "conformances"
|
||||
? { kind: K; ids?: string[]; atomId?: string; interfaceRevisionId?: string }
|
||||
: K extends "queries"
|
||||
? { kind: K; ids?: string[]; packageRevisionId?: string; interfaceRevisionId?: string }
|
||||
: { kind: K; ids?: string[] };
|
||||
export type ReflectionRequest<K extends string = ReflectionKind> = {
|
||||
selector: ReflectionSelector<K>;
|
||||
first?: number;
|
||||
after?: string;
|
||||
snapshot?: string;
|
||||
};
|
||||
/** Read-only metadata. Returned capability IDs confer no invocation authority. */
|
||||
export type QxReflectionPort<K extends string = ReflectionKind> = {
|
||||
read(request: ReflectionRequest<K>): Promise<DefinitionPage>;
|
||||
watch(request: Omit<ReflectionRequest<K>, "after" | "snapshot">, signal: AbortSignal): AsyncIterable<DefinitionPage>;
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { create } from "@bufbuild/protobuf";
|
||||
import { InjectedDependencySchema } from "../dist/quixos/refs_pb.js";
|
||||
import { DefinitionPageSchema } from "../dist/quixos/orch_pb.js";
|
||||
import { createRuntimeContext, bindQxHandler } from "../dist/index.js";
|
||||
|
||||
test("checked reflection bindings preserve injected scope, selector authority and cancellation", async () => {
|
||||
const seen = [];
|
||||
const page = create(DefinitionPageSchema, { identity: { workspaceId: "ws", workspaceEpoch: "7" } });
|
||||
const signal = new AbortController().signal;
|
||||
const raw = createRuntimeContext(
|
||||
{},
|
||||
{
|
||||
readDefinitions: async (request) => {
|
||||
seen.push(request);
|
||||
return page;
|
||||
},
|
||||
async *watchDefinitions(request, options) {
|
||||
assert.equal(options.signal, signal);
|
||||
seen.push(request);
|
||||
yield page;
|
||||
},
|
||||
},
|
||||
{
|
||||
objectId: "",
|
||||
input: {},
|
||||
dependencies: [
|
||||
create(InjectedDependencySchema, {
|
||||
portId: "meta",
|
||||
binding: { case: "reflection", value: { workspaceId: "ws", workspaceEpoch: "7", selectors: ["atoms"] } },
|
||||
}),
|
||||
],
|
||||
},
|
||||
);
|
||||
const handler = bindQxHandler(
|
||||
{
|
||||
receiver: "none",
|
||||
inputType: { kind: "builtin", name: "unit" },
|
||||
outputType: { kind: "builtin", name: "unit" },
|
||||
ports: { meta: { kind: "reflection", id: "meta", selectors: ["atoms"] } },
|
||||
},
|
||||
async (context) => {
|
||||
await context.ports.meta.read({ selector: { kind: "atoms" }, workspaceId: "forged", workspaceEpoch: "9" });
|
||||
for await (const result of context.ports.meta.watch({ selector: { kind: "atoms" } }, signal))
|
||||
assert.equal(result, page);
|
||||
assert.throws(() => context.ports.meta.read({ selector: { kind: "queries" } }), /Undeclared reflection/);
|
||||
},
|
||||
{},
|
||||
);
|
||||
await handler(raw);
|
||||
assert.equal(seen.length, 2);
|
||||
for (const request of seen) {
|
||||
assert.equal(request.workspaceId, "ws");
|
||||
assert.equal(request.workspaceEpoch, "7");
|
||||
}
|
||||
assert.throws(() => raw.reflection("missing"), /Missing/);
|
||||
});
|
||||
Reference in New Issue
Block a user