Add checked React field bindings and Web Studio factories
Replace opaque props with checked generic presentation contracts and lazy typed interface references. Generate readonly/writable field APIs and component checks. Preserve CRDT editing through explicit resolved getter/setter contracts, binding- fenced delta RPCs, native watches and replica-aware field adapters. Custom setters retain semantic writes; storage snapshots never grant write authority. Cover concurrent edits, lost acknowledgements, readonly contracts and authorization. Add receiver-free static factory dispatch, state-field binding shorthand, and conformance-based creation. Migrate TODO, editable scaffolds and authoring guides. Verify language/codegen, SDK, RPC, browser lifecycle, local scaffolds, production browser bundling and CRDT persistence with temporary PostgreSQL.
This commit is contained in:
Vendored
+1
-1
@@ -10,7 +10,6 @@ export type MessageBinding<T> = {
|
|||||||
decode(value: Value): T;
|
decode(value: Value): T;
|
||||||
};
|
};
|
||||||
export type QxLiveValue = ReturnType<typeof liveValue>;
|
export type QxLiveValue = ReturnType<typeof liveValue>;
|
||||||
export declare const opaqueReactPropsBinding: MessageBinding<Record<string, unknown>>;
|
|
||||||
export type BindingValue<B> = B extends MessageBinding<infer T> ? T : never;
|
export type BindingValue<B> = B extends MessageBinding<infer T> ? T : never;
|
||||||
export type QxHandler<C, O> = (context: C) => O | Promise<O>;
|
export type QxHandler<C, O> = (context: C) => O | Promise<O>;
|
||||||
export type QxDerived<C, O> = {
|
export type QxDerived<C, O> = {
|
||||||
@@ -71,6 +70,7 @@ export type QxPortSpec = {
|
|||||||
inputType: QxValueType;
|
inputType: QxValueType;
|
||||||
};
|
};
|
||||||
export type QxHandlerSpec = {
|
export type QxHandlerSpec = {
|
||||||
|
receiver?: "none";
|
||||||
inputType: QxValueType;
|
inputType: QxValueType;
|
||||||
outputType: QxValueType;
|
outputType: QxValueType;
|
||||||
eventType?: QxValueType;
|
eventType?: QxValueType;
|
||||||
|
|||||||
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,CA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E;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;AAG7D,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,cA4GnB,CAAC"}
|
||||||
Vendored
+6
-25
@@ -2,21 +2,6 @@ import { create } from "@bufbuild/protobuf";
|
|||||||
import { ValueSchema, ObjectValueSchema } from "./camino/api_pb.js";
|
import { ValueSchema, ObjectValueSchema } from "./camino/api_pb.js";
|
||||||
import { derived, jsToProtoValue, liveValue, protoValueToJs, } from "./index.js";
|
import { derived, jsToProtoValue, liveValue, protoValueToJs, } from "./index.js";
|
||||||
import { assertReferenceFree, referenceToWire } from "./references.js";
|
import { assertReferenceFree, referenceToWire } from "./references.js";
|
||||||
const reactPropsDescriptor = "org.quixos.web-studio.ReactProps";
|
|
||||||
// Explicit temporary props exception, matching orch's RPC contract. Field shapes
|
|
||||||
// remain unchecked pending generics; ordinary messages and state do not gain it.
|
|
||||||
export const opaqueReactPropsBinding = {
|
|
||||||
encode(value) {
|
|
||||||
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
||||||
throw new Error("React props must be an object");
|
|
||||||
return jsToProtoValue(value);
|
|
||||||
},
|
|
||||||
decode(value) {
|
|
||||||
if (value.kind.case !== "objectValue")
|
|
||||||
throw new Error("React props must be an object");
|
|
||||||
return protoValueToJs(value);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
export const qxDerived = (get) => ({ kind: "derived", get });
|
export const qxDerived = (get) => ({ kind: "derived", get });
|
||||||
// Conversion belongs at the binding boundary. It does not add orchestrator validation.
|
// Conversion belongs at the binding boundary. It does not add orchestrator validation.
|
||||||
export const decodeQxValue = (type, value, messages) => {
|
export const decodeQxValue = (type, value, messages) => {
|
||||||
@@ -42,11 +27,9 @@ export const decodeQxValue = (type, value, messages) => {
|
|||||||
return value.kind.value.values.map((entry) => decodeQxValue(type.value, entry, messages));
|
return value.kind.value.values.map((entry) => decodeQxValue(type.value, entry, messages));
|
||||||
}
|
}
|
||||||
if (type.kind === "message") {
|
if (type.kind === "message") {
|
||||||
if (type.descriptorId !== reactPropsDescriptor)
|
assertReferenceFree(protoValueToJs(value));
|
||||||
assertReferenceFree(protoValueToJs(value));
|
|
||||||
const decoded = requireMessage(messages, type.descriptorId).decode(value);
|
const decoded = requireMessage(messages, type.descriptorId).decode(value);
|
||||||
if (type.descriptorId !== reactPropsDescriptor)
|
assertReferenceFree(decoded);
|
||||||
assertReferenceFree(decoded);
|
|
||||||
return decoded;
|
return decoded;
|
||||||
}
|
}
|
||||||
if (type.kind === "object-ref") {
|
if (type.kind === "object-ref") {
|
||||||
@@ -99,12 +82,10 @@ export const encodeQxValue = (type, value, messages) => {
|
|||||||
referenceToWire(value);
|
referenceToWire(value);
|
||||||
return jsToProtoValue(value);
|
return jsToProtoValue(value);
|
||||||
}
|
}
|
||||||
if (type.kind !== "message" || type.descriptorId !== reactPropsDescriptor)
|
assertReferenceFree(value);
|
||||||
assertReferenceFree(value);
|
|
||||||
if (type.kind === "message") {
|
if (type.kind === "message") {
|
||||||
const encoded = requireMessage(messages, type.descriptorId).encode(value);
|
const encoded = requireMessage(messages, type.descriptorId).encode(value);
|
||||||
if (type.descriptorId !== reactPropsDescriptor)
|
assertReferenceFree(protoValueToJs(encoded));
|
||||||
assertReferenceFree(protoValueToJs(encoded));
|
|
||||||
return encoded;
|
return encoded;
|
||||||
}
|
}
|
||||||
return jsToProtoValue(value);
|
return jsToProtoValue(value);
|
||||||
@@ -197,9 +178,9 @@ export const bindQxHandler = (spec, handler, messages) => {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
return {
|
return {
|
||||||
objectId: raw.objectId,
|
...(spec.receiver === "none" ? {} : { objectId: raw.objectId }),
|
||||||
signal: raw.signal,
|
signal: raw.signal,
|
||||||
...(raw.openSession
|
...(spec.receiver !== "none" && raw.openSession
|
||||||
? {
|
? {
|
||||||
openSession: async () => {
|
openSession: async () => {
|
||||||
const session = await raw.openSession();
|
const session = await raw.openSession();
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGxF,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAoC,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAExG,OAAO,EACL,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AAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,YAAY,OAAO,EAAE,MAAM,EAI1B;CACF;AAOD,eAAO,MAAM,oBAAoB,WACvB,YAAY,QACd,UAAU,WACP,cAAc,KACtB,cAuLF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACrF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,cAAc,CAAA;CAAE,CAAC;AACtE,eAAO,MAAM,OAAO,QAAS,cAAc,KAAG,cAA4C,CAAC;AA0B3F,eAAO,MAAM,0BAA0B,WAAY;IACjD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAAC,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,cAwJiB,aAAa,kBAgN9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,WAAY;IAC1C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAAC,CAAC;CAC1D,yEAaA,CAAC;AACF,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7B,YAAY,EAAE,OAAO,qBAAqB,EAAE,kBAAkB,EAAE,CAAC;CAClE,CAAC"}
|
||||||
Vendored
+3
-1
@@ -292,7 +292,9 @@ export const createRuntimeContext = (camino, orch, request) => {
|
|||||||
return port;
|
return port;
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
objectId: referenceFromWire(request.objectId),
|
get objectId() {
|
||||||
|
return referenceFromWire(request.objectId);
|
||||||
|
},
|
||||||
input: protoFieldsToJs(request.input),
|
input: protoFieldsToJs(request.input),
|
||||||
inputProto: request.input,
|
inputProto: request.input,
|
||||||
ports,
|
ports,
|
||||||
|
|||||||
Vendored
+171
-4
@@ -1,5 +1,5 @@
|
|||||||
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
||||||
import type { CaminoObject, Value } from "../camino/api_pb.js";
|
import type { CaminoObject, CrdtValue, Value } from "../camino/api_pb.js";
|
||||||
import type { PackageDescriptor } from "./package_pb.js";
|
import type { PackageDescriptor } from "./package_pb.js";
|
||||||
import type { CapabilityRef, PackageExportRef } from "./refs_pb.js";
|
import type { CapabilityRef, PackageExportRef } from "./refs_pb.js";
|
||||||
import type { DerivedDependency } from "./runtime_pb.js";
|
import type { DerivedDependency } from "./runtime_pb.js";
|
||||||
@@ -113,6 +113,30 @@ export type InvokeCapabilityRequest = Message<"quixos.orch.InvokeCapabilityReque
|
|||||||
* Use `create(InvokeCapabilityRequestSchema)` to create a new message.
|
* Use `create(InvokeCapabilityRequestSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export declare const InvokeCapabilityRequestSchema: GenMessage<InvokeCapabilityRequest>;
|
export declare const InvokeCapabilityRequestSchema: GenMessage<InvokeCapabilityRequest>;
|
||||||
|
/**
|
||||||
|
* @generated from message quixos.orch.InvokeClassCapabilityRequest
|
||||||
|
*/
|
||||||
|
export type InvokeClassCapabilityRequest = Message<"quixos.orch.InvokeClassCapabilityRequest"> & {
|
||||||
|
/**
|
||||||
|
* @generated from field: string conformance_id = 1;
|
||||||
|
*/
|
||||||
|
conformanceId: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: string operation_id = 2;
|
||||||
|
*/
|
||||||
|
operationId: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: map<string, camino.Value> input = 3;
|
||||||
|
*/
|
||||||
|
input: {
|
||||||
|
[key: string]: Value;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Describes the message quixos.orch.InvokeClassCapabilityRequest.
|
||||||
|
* Use `create(InvokeClassCapabilityRequestSchema)` to create a new message.
|
||||||
|
*/
|
||||||
|
export declare const InvokeClassCapabilityRequestSchema: GenMessage<InvokeClassCapabilityRequest>;
|
||||||
/**
|
/**
|
||||||
* @generated from message quixos.orch.InvokeCapabilityResponse
|
* @generated from message quixos.orch.InvokeCapabilityResponse
|
||||||
*/
|
*/
|
||||||
@@ -141,12 +165,80 @@ export type InvokeCapabilityResponse = Message<"quixos.orch.InvokeCapabilityResp
|
|||||||
* @generated from field: repeated quixos.runtime.DerivedDependency dependencies = 6;
|
* @generated from field: repeated quixos.runtime.DerivedDependency dependencies = 6;
|
||||||
*/
|
*/
|
||||||
dependencies: DerivedDependency[];
|
dependencies: DerivedDependency[];
|
||||||
|
/**
|
||||||
|
* @generated from field: quixos.orch.FieldEditing field_editing = 7;
|
||||||
|
*/
|
||||||
|
fieldEditing?: FieldEditing | undefined;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Describes the message quixos.orch.InvokeCapabilityResponse.
|
* Describes the message quixos.orch.InvokeCapabilityResponse.
|
||||||
* Use `create(InvokeCapabilityResponseSchema)` to create a new message.
|
* Use `create(InvokeCapabilityResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export declare const InvokeCapabilityResponseSchema: GenMessage<InvokeCapabilityResponse>;
|
export declare const InvokeCapabilityResponseSchema: GenMessage<InvokeCapabilityResponse>;
|
||||||
|
/**
|
||||||
|
* Resolved from the checked native getter/setter binding, not Value.source.
|
||||||
|
*
|
||||||
|
* @generated from message quixos.orch.FieldEditing
|
||||||
|
*/
|
||||||
|
export type FieldEditing = Message<"quixos.orch.FieldEditing"> & {
|
||||||
|
/**
|
||||||
|
* @generated from field: string getter_operation_id = 1;
|
||||||
|
*/
|
||||||
|
getterOperationId: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: string setter_operation_id = 2;
|
||||||
|
*/
|
||||||
|
setterOperationId: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: string document_type = 3;
|
||||||
|
*/
|
||||||
|
documentType: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: string binding_digest = 4;
|
||||||
|
*/
|
||||||
|
bindingDigest: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Describes the message quixos.orch.FieldEditing.
|
||||||
|
* Use `create(FieldEditingSchema)` to create a new message.
|
||||||
|
*/
|
||||||
|
export declare const FieldEditingSchema: GenMessage<FieldEditing>;
|
||||||
|
/**
|
||||||
|
* @generated from message quixos.orch.EditCapabilityFieldRequest
|
||||||
|
*/
|
||||||
|
export type EditCapabilityFieldRequest = Message<"quixos.orch.EditCapabilityFieldRequest"> & {
|
||||||
|
/**
|
||||||
|
* The public getter; setter must belong to the same value member.
|
||||||
|
*
|
||||||
|
* @generated from field: quixos.CapabilityRef capability = 1;
|
||||||
|
*/
|
||||||
|
capability?: CapabilityRef | undefined;
|
||||||
|
/**
|
||||||
|
* @generated from field: string object_id = 2;
|
||||||
|
*/
|
||||||
|
objectId: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: string setter_operation_id = 3;
|
||||||
|
*/
|
||||||
|
setterOperationId: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: string binding_digest = 4;
|
||||||
|
*/
|
||||||
|
bindingDigest: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: camino.CrdtValue update = 5;
|
||||||
|
*/
|
||||||
|
update?: CrdtValue | undefined;
|
||||||
|
/**
|
||||||
|
* @generated from field: string client_mutation_id = 6;
|
||||||
|
*/
|
||||||
|
clientMutationId: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Describes the message quixos.orch.EditCapabilityFieldRequest.
|
||||||
|
* Use `create(EditCapabilityFieldRequestSchema)` to create a new message.
|
||||||
|
*/
|
||||||
|
export declare const EditCapabilityFieldRequestSchema: GenMessage<EditCapabilityFieldRequest>;
|
||||||
/**
|
/**
|
||||||
* @generated from message quixos.orch.WatchCapabilityRequest
|
* @generated from message quixos.orch.WatchCapabilityRequest
|
||||||
*/
|
*/
|
||||||
@@ -203,6 +295,10 @@ export type WatchCapabilityEvent = Message<"quixos.orch.WatchCapabilityEvent"> &
|
|||||||
* @generated from field: bool initial = 7;
|
* @generated from field: bool initial = 7;
|
||||||
*/
|
*/
|
||||||
initial: boolean;
|
initial: boolean;
|
||||||
|
/**
|
||||||
|
* @generated from field: quixos.orch.FieldEditing field_editing = 8;
|
||||||
|
*/
|
||||||
|
fieldEditing?: FieldEditing | undefined;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Describes the message quixos.orch.WatchCapabilityEvent.
|
* Describes the message quixos.orch.WatchCapabilityEvent.
|
||||||
@@ -212,7 +308,14 @@ export declare const WatchCapabilityEventSchema: GenMessage<WatchCapabilityEvent
|
|||||||
/**
|
/**
|
||||||
* @generated from message quixos.orch.GetWorkspaceRequest
|
* @generated from message quixos.orch.GetWorkspaceRequest
|
||||||
*/
|
*/
|
||||||
export type GetWorkspaceRequest = Message<"quixos.orch.GetWorkspaceRequest"> & {};
|
export type GetWorkspaceRequest = Message<"quixos.orch.GetWorkspaceRequest"> & {
|
||||||
|
/**
|
||||||
|
* Revision polling must not download the entire interface graph.
|
||||||
|
*
|
||||||
|
* @generated from field: bool include_interface_contracts = 1;
|
||||||
|
*/
|
||||||
|
includeInterfaceContracts: boolean;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Describes the message quixos.orch.GetWorkspaceRequest.
|
* Describes the message quixos.orch.GetWorkspaceRequest.
|
||||||
* Use `create(GetWorkspaceRequestSchema)` to create a new message.
|
* Use `create(GetWorkspaceRequestSchema)` to create a new message.
|
||||||
@@ -235,8 +338,8 @@ export type GetWorkspaceResponse = Message<"quixos.orch.GetWorkspaceResponse"> &
|
|||||||
*/
|
*/
|
||||||
sourceRootCommit: string;
|
sourceRootCommit: string;
|
||||||
/**
|
/**
|
||||||
* Checked constructors whose wire input can be empty. Web Studio intersects
|
* Checked constructors whose wire input can be empty. The create panel uses
|
||||||
* this with its temporary Createable marker; the marker is not a factory.
|
* class factory conformances instead of this constructor inventory.
|
||||||
*
|
*
|
||||||
* @generated from field: repeated string empty_input_constructible_atom_ids = 4;
|
* @generated from field: repeated string empty_input_constructible_atom_ids = 4;
|
||||||
*/
|
*/
|
||||||
@@ -249,12 +352,60 @@ export type GetWorkspaceResponse = Message<"quixos.orch.GetWorkspaceResponse"> &
|
|||||||
* @generated from field: repeated quixos.orch.ConstructorInputContract constructor_inputs = 6;
|
* @generated from field: repeated quixos.orch.ConstructorInputContract constructor_inputs = 6;
|
||||||
*/
|
*/
|
||||||
constructorInputs: ConstructorInputContract[];
|
constructorInputs: ConstructorInputContract[];
|
||||||
|
/**
|
||||||
|
* Exact closed interface contracts used by checked presentation consumers.
|
||||||
|
*
|
||||||
|
* @generated from field: string interfaces_json = 7;
|
||||||
|
*/
|
||||||
|
interfacesJson: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: repeated quixos.orch.ClassCapability class_capabilities = 8;
|
||||||
|
*/
|
||||||
|
classCapabilities: ClassCapability[];
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Describes the message quixos.orch.GetWorkspaceResponse.
|
* Describes the message quixos.orch.GetWorkspaceResponse.
|
||||||
* Use `create(GetWorkspaceResponseSchema)` to create a new message.
|
* Use `create(GetWorkspaceResponseSchema)` to create a new message.
|
||||||
*/
|
*/
|
||||||
export declare const GetWorkspaceResponseSchema: GenMessage<GetWorkspaceResponse>;
|
export declare const GetWorkspaceResponseSchema: GenMessage<GetWorkspaceResponse>;
|
||||||
|
/**
|
||||||
|
* @generated from message quixos.orch.ClassCapability
|
||||||
|
*/
|
||||||
|
export type ClassCapability = Message<"quixos.orch.ClassCapability"> & {
|
||||||
|
/**
|
||||||
|
* @generated from field: string conformance_id = 1;
|
||||||
|
*/
|
||||||
|
conformanceId: 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: string operation_id = 5;
|
||||||
|
*/
|
||||||
|
operationId: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: string input_type_json = 6;
|
||||||
|
*/
|
||||||
|
inputTypeJson: string;
|
||||||
|
/**
|
||||||
|
* @generated from field: string output_type_json = 7;
|
||||||
|
*/
|
||||||
|
outputTypeJson: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Describes the message quixos.orch.ClassCapability.
|
||||||
|
* Use `create(ClassCapabilitySchema)` to create a new message.
|
||||||
|
*/
|
||||||
|
export declare const ClassCapabilitySchema: GenMessage<ClassCapability>;
|
||||||
/**
|
/**
|
||||||
* @generated from message quixos.orch.CapabilityInputContract
|
* @generated from message quixos.orch.CapabilityInputContract
|
||||||
*/
|
*/
|
||||||
@@ -516,6 +667,22 @@ export declare const OrchestratorRuntime: GenService<{
|
|||||||
input: typeof InvokeCapabilityRequestSchema;
|
input: typeof InvokeCapabilityRequestSchema;
|
||||||
output: typeof InvokeCapabilityResponseSchema;
|
output: typeof InvokeCapabilityResponseSchema;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* @generated from rpc quixos.orch.OrchestratorRuntime.EditCapabilityField
|
||||||
|
*/
|
||||||
|
editCapabilityField: {
|
||||||
|
methodKind: "unary";
|
||||||
|
input: typeof EditCapabilityFieldRequestSchema;
|
||||||
|
output: typeof InvokeCapabilityResponseSchema;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @generated from rpc quixos.orch.OrchestratorRuntime.InvokeClassCapability
|
||||||
|
*/
|
||||||
|
invokeClassCapability: {
|
||||||
|
methodKind: "unary";
|
||||||
|
input: typeof InvokeClassCapabilityRequestSchema;
|
||||||
|
output: typeof InvokeCapabilityResponseSchema;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @generated from rpc quixos.orch.OrchestratorRuntime.WatchCapability
|
* @generated from rpc quixos.orch.OrchestratorRuntime.WatchCapability
|
||||||
*/
|
*/
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+39
-19
File diff suppressed because one or more lines are too long
+7
-19
@@ -16,19 +16,6 @@ declare const watchBrand: unique symbol;
|
|||||||
export type QxWatchHandle = string & { readonly [watchBrand]: true };
|
export type QxWatchHandle = string & { readonly [watchBrand]: true };
|
||||||
export type MessageBinding<T> = { encode(value: T): Value; decode(value: Value): T };
|
export type MessageBinding<T> = { encode(value: T): Value; decode(value: Value): T };
|
||||||
export type QxLiveValue = ReturnType<typeof liveValue>;
|
export type QxLiveValue = ReturnType<typeof liveValue>;
|
||||||
const reactPropsDescriptor = "org.quixos.web-studio.ReactProps";
|
|
||||||
// Explicit temporary props exception, matching orch's RPC contract. Field shapes
|
|
||||||
// remain unchecked pending generics; ordinary messages and state do not gain it.
|
|
||||||
export const opaqueReactPropsBinding: MessageBinding<Record<string, unknown>> = {
|
|
||||||
encode(value) {
|
|
||||||
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("React props must be an object");
|
|
||||||
return jsToProtoValue(value);
|
|
||||||
},
|
|
||||||
decode(value) {
|
|
||||||
if (value.kind.case !== "objectValue") throw new Error("React props must be an object");
|
|
||||||
return protoValueToJs(value) as Record<string, unknown>;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
export type BindingValue<B> = B extends MessageBinding<infer T> ? T : never;
|
export type BindingValue<B> = B extends MessageBinding<infer T> ? T : never;
|
||||||
export type QxHandler<C, O> = (context: C) => O | Promise<O>;
|
export type QxHandler<C, O> = (context: C) => O | Promise<O>;
|
||||||
export type QxDerived<C, O> = { kind: "derived"; get: QxHandler<C, O> };
|
export type QxDerived<C, O> = { kind: "derived"; get: QxHandler<C, O> };
|
||||||
@@ -51,6 +38,7 @@ export type QxPortSpec =
|
|||||||
| { kind: "interface"; id: string; operations: Record<string, QxOperationSpec> }
|
| { kind: "interface"; id: string; operations: Record<string, QxOperationSpec> }
|
||||||
| { kind: "constructor"; id: string; inputType: QxValueType };
|
| { kind: "constructor"; id: string; inputType: QxValueType };
|
||||||
export type QxHandlerSpec = {
|
export type QxHandlerSpec = {
|
||||||
|
receiver?: "none";
|
||||||
inputType: QxValueType;
|
inputType: QxValueType;
|
||||||
outputType: QxValueType;
|
outputType: QxValueType;
|
||||||
eventType?: QxValueType;
|
eventType?: QxValueType;
|
||||||
@@ -79,9 +67,9 @@ export const decodeQxValue = (type: QxValueType, value: Value | undefined, messa
|
|||||||
return value.kind.value.values.map((entry) => decodeQxValue(type.value, entry, messages));
|
return value.kind.value.values.map((entry) => decodeQxValue(type.value, entry, messages));
|
||||||
}
|
}
|
||||||
if (type.kind === "message") {
|
if (type.kind === "message") {
|
||||||
if (type.descriptorId !== reactPropsDescriptor) assertReferenceFree(protoValueToJs(value));
|
assertReferenceFree(protoValueToJs(value));
|
||||||
const decoded = requireMessage(messages, type.descriptorId).decode(value);
|
const decoded = requireMessage(messages, type.descriptorId).decode(value);
|
||||||
if (type.descriptorId !== reactPropsDescriptor) assertReferenceFree(decoded);
|
assertReferenceFree(decoded);
|
||||||
return decoded;
|
return decoded;
|
||||||
}
|
}
|
||||||
if (type.kind === "object-ref") {
|
if (type.kind === "object-ref") {
|
||||||
@@ -130,10 +118,10 @@ export const encodeQxValue = (type: QxValueType, value: any, messages: QxMessage
|
|||||||
referenceToWire(value);
|
referenceToWire(value);
|
||||||
return jsToProtoValue(value);
|
return jsToProtoValue(value);
|
||||||
}
|
}
|
||||||
if (type.kind !== "message" || type.descriptorId !== reactPropsDescriptor) assertReferenceFree(value);
|
assertReferenceFree(value);
|
||||||
if (type.kind === "message") {
|
if (type.kind === "message") {
|
||||||
const encoded = requireMessage(messages, type.descriptorId).encode(value);
|
const encoded = requireMessage(messages, type.descriptorId).encode(value);
|
||||||
if (type.descriptorId !== reactPropsDescriptor) assertReferenceFree(protoValueToJs(encoded));
|
assertReferenceFree(protoValueToJs(encoded));
|
||||||
return encoded;
|
return encoded;
|
||||||
}
|
}
|
||||||
return jsToProtoValue(value);
|
return jsToProtoValue(value);
|
||||||
@@ -245,9 +233,9 @@ export const bindQxHandler = <C, O>(
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
objectId: raw.objectId,
|
...(spec.receiver === "none" ? {} : { objectId: raw.objectId }),
|
||||||
signal: raw.signal,
|
signal: raw.signal,
|
||||||
...(raw.openSession
|
...(spec.receiver !== "none" && raw.openSession
|
||||||
? {
|
? {
|
||||||
openSession: async () => {
|
openSession: async () => {
|
||||||
const session = await raw.openSession!();
|
const session = await raw.openSession!();
|
||||||
|
|||||||
+3
-1
@@ -409,7 +409,9 @@ export const createRuntimeContext = (
|
|||||||
return port as T;
|
return port as T;
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
objectId: referenceFromWire(request.objectId),
|
get objectId() {
|
||||||
|
return referenceFromWire(request.objectId);
|
||||||
|
},
|
||||||
input: protoFieldsToJs(request.input),
|
input: protoFieldsToJs(request.input),
|
||||||
inputProto: request.input,
|
inputProto: request.input,
|
||||||
ports,
|
ports,
|
||||||
|
|||||||
+218
-22
File diff suppressed because one or more lines are too long
+23
-17
@@ -8,29 +8,35 @@ import {
|
|||||||
jsToProtoValue,
|
jsToProtoValue,
|
||||||
liveValue,
|
liveValue,
|
||||||
protoValueToJs,
|
protoValueToJs,
|
||||||
opaqueReactPropsBinding,
|
|
||||||
} from "../dist/index.js";
|
} from "../dist/index.js";
|
||||||
const scalar = (name) => ({ kind: "scalar", name });
|
const scalar = (name) => ({ kind: "scalar", name });
|
||||||
const unit = { kind: "builtin", name: "unit" };
|
const unit = { kind: "builtin", name: "unit" };
|
||||||
test("opaque React props retain managed references while ordinary messages remain closed", () => {
|
test("free function handlers never acquire a receiver or object session", async () => {
|
||||||
|
const handler = bindQxHandler(
|
||||||
|
{ receiver: "none", inputType: unit, outputType: unit, ports: {} },
|
||||||
|
async (context) => {
|
||||||
|
assert.equal("objectId" in context, false);
|
||||||
|
assert.equal("openSession" in context, false);
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
|
await handler({
|
||||||
|
inputProto: {},
|
||||||
|
get objectId() {
|
||||||
|
throw new Error("no receiver exists");
|
||||||
|
},
|
||||||
|
openSession() {
|
||||||
|
assert.fail("no object session");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
test("React props no longer have an opaque-message reference escape hatch", () => {
|
||||||
const descriptorId = "org.quixos.web-studio.ReactProps";
|
const descriptorId = "org.quixos.web-studio.ReactProps";
|
||||||
const reference = referenceFromWire("obj:task");
|
const reference = referenceFromWire("obj:task");
|
||||||
const type = { kind: "message", descriptorId };
|
const type = { kind: "message", descriptorId };
|
||||||
const messages = { [descriptorId]: opaqueReactPropsBinding };
|
const messages = { [descriptorId]: { encode: jsToProtoValue, decode: protoValueToJs } };
|
||||||
const decoded = decodeQxValue(type, encodeQxValue(type, { subject: reference, title: "Task" }, messages), messages);
|
assert.throws(() => encodeQxValue(type, { subject: reference }, messages), /Managed references/);
|
||||||
assert.ok(decoded.subject.equals(reference));
|
assert.throws(() => decodeQxValue(type, jsToProtoValue({ subject: reference }), messages), /Managed references/);
|
||||||
assert.equal(decoded.title, "Task");
|
|
||||||
assert.throws(() => opaqueReactPropsBinding.encode(null), /object/);
|
|
||||||
assert.throws(() => opaqueReactPropsBinding.encode([]), /object/);
|
|
||||||
assert.throws(
|
|
||||||
() =>
|
|
||||||
encodeQxValue(
|
|
||||||
{ kind: "message", descriptorId: "Ordinary" },
|
|
||||||
{ subject: reference },
|
|
||||||
{ Ordinary: opaqueReactPropsBinding },
|
|
||||||
),
|
|
||||||
/Managed references/,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
test("declared record inputs preserve opaque references without opening message codecs", async () => {
|
test("declared record inputs preserve opaque references without opening message codecs", async () => {
|
||||||
const target = referenceFromWire("obj:board");
|
const target = referenceFromWire("obj:board");
|
||||||
|
|||||||
Reference in New Issue
Block a user