Compare commits

...
Author SHA1 Message Date
Quixos Subtree Publisher 19215d7ebf Publish camino-package-runtime from ca5b05584b89e90cb259b4596b1bc01d3d692136 2026-10-25 21:28:36 +00:00
Timothy J. Aveni fee8fa523a Restore current public toolchain exports and CI publication (#420) 2026-10-25 14:28:36 -07:00
Quixos Subtree Publisher 647264d4a5 Publish camino-package-runtime from be30143a326d5d7d7b0cbabea5bc5ac0301ef5b9 2026-10-06 06:59:27 +00:00
Timothy J. Aveni 2fe585ab69 Restore hosted workspace templates and refresh published runtime dependencies 2026-10-05 23:59:27 -07:00
Timothy J. Aveni 8859cf440b Add explicit CRDT edit contracts and structured query values 2026-09-19 22:33:20 -07:00
Timothy J. Aveni 06aca3d2c3 Add local-first execution contracts to the capability language 2026-09-19 22:09:40 -07:00
Timothy J. Aveni d0f9454532 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.
2026-09-19 10:18:47 -07:00
Timothy J. Aveni 696009f6fd Add native literal substring query predicates
Implement checked containsInsensitive string predicates in GraphQL, protobuf,
native SQL and bounded residual evaluation. ASCII folding is deterministic;
SQL pattern characters remain literal. Retain deferred full-text index design.

Studio migration awaits a decision on checked native getter forwarding across
conformances; do not duplicate titles or bypass private state ownership.
Compiler and local full-stack substring-query acceptance pass.
2026-09-19 10:18:47 -07:00
Timothy J. Aveni 6a17cd1ae0 Add checked workspace-interface query roots
Implement scoped interface extents across QX, generated bindings, SDK,
Orch, Camino and browser queries. Preserve native projection, aggregation,
pagination and watch invalidation without synthetic persisted objects.
Validate exact query grants and scope freshness on execution and replay.
Add local PostgreSQL, transport, browser and code-generation coverage.

C1 implementation slice only: full-text indexes and Studio search adoption
(C2/C3) remain tracked in the implementation handoff. No publication or deployment.
2026-09-19 10:18:47 -07:00
Timothy J. Aveni e69fe1b29e Publish live-field tracker template and dependency pins 2026-09-18 10:09:30 -07:00
Quixos Subtree Publisher 86933aa97f Publish camino-package-runtime from 7efe88cdfc5244727d80239c79845b44d1e79ccb 2026-09-18 17:08:27 +00:00
Timothy J. Aveni 437dbbc850 Publish live-field tracker template and dependency pins 2026-09-18 10:08:27 -07:00
Timothy J. Aveni 45477f3b07 Implement shared live fields and checked query hydration
Add native register acknowledgments and idempotent mutation replay, shared optimistic field controllers, overlapping custom setters, non-suspending hooks and explicit Suspense. Carry checked @live provenance through batched queries and hydrate shared browser fields with coverage leases. Update tracker/scaffolds/guides and verify compiler, PostgreSQL, browser and immutable workspace paths.
2026-09-18 02:19:49 -07:00
Quixos Subtree Publisher 446fd4e36e Publish camino-package-runtime from 8e42108f9ac903cca5f613fefbff3c147c775b81 2026-09-18 02:55:23 +00:00
Timothy J. Aveni dac9c48856 Publish final aggregation diagnostics and select toolchain pins 2026-09-17 19:55:23 -07:00
Timothy J. Aveni d0dca13ff9 Enforce aggregation contract budgets and expose residual timing 2026-09-17 19:52:55 -07:00
Quixos Subtree Publisher f42d70a4fe Publish camino-package-runtime from 460335e4e892a682e68b10f25abd81e65829538f 2026-09-18 02:47:38 +00:00
Timothy J. Aveni 424ebec92e Publish aggregation toolchain and update scaffold pins 2026-09-17 19:47:38 -07:00
Timothy J. Aveni b86dbe2dfa Implement checked aggregation plans, native SQL, and bounded RPC capture 2026-09-17 19:43:46 -07:00
Quixos Subtree Publisher 1982c6fff1 Publish camino-package-runtime from cbf03106e69d3e2867d7f96859741991e04402b7 2026-09-17 23:51:19 +00:00
Timothy J. Aveni 13d2d0b1ee Pin package SDK to the checked-query protocol release 2026-09-17 16:51:19 -07:00
Timothy J. Aveni c1330ae8e3 Implement query execution, scoped RPC enrichment, live collections, and scaffold integration 2026-09-17 16:49:44 -07:00
Timothy J. Aveni 7e69e675ba Add exact runtime conformance lookup and agent-visible language limits
Add authorized exact-contract lookup, revision-fenced views, generated typed package/browser descriptors, and lifecycle-safe React discovery. Preserve closed generic contracts without competing-conformance policies or new authority grants. Document supported workarounds and privacy boundaries for agent feedback. Publish matching protocol/SDK exports and update scaffold/starter pins; leave the deployed template unchanged.
2026-09-17 12:04:06 -07:00
37 changed files with 6481 additions and 240 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
{
"version": 1,
"sourceRepo": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos",
"sourceCommit": "db6d7990a4ffec273258ac313b7d2aeac57b261a",
"sourceRepo": "https://gitea.internal.quixos.org/quixos/quixos.git",
"sourceCommit": "ca5b05584b89e90cb259b4596b1bc01d3d692136",
"sourcePath": "quixos-instance/packages/camino-package-runtime",
"exportName": "camino-package-runtime",
"mirrorRemote": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git"
"mirrorRemote": "https://repos.quixos.org/quixos-toolchain/camino-package-runtime.git"
}
+11
View File
@@ -63,6 +63,17 @@ export type QxOperationSpec = {
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;
+1 -1
View File
@@ -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;AAEnD,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AACxC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IAAE,QAA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ClD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,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"}
+34
View File
@@ -2,6 +2,7 @@ import { create } from "@bufbuild/protobuf";
import { ValueSchema, ObjectValueSchema } from "./camino/api_pb.js";
import { derived, jsToProtoValue, liveValue, protoValueToJs, } from "./index.js";
import { assertReferenceFree, referenceToWire } from "./references.js";
import { decodeQuerySnapshot } from "./queries.js";
export const defineQxInterfaceContract = (interfaceRevisionId, operations) => Object.freeze({ interfaceRevisionId, operations });
export const qxDerived = (get) => ({ kind: "derived", get });
const bindInterfaceView = (target, contract, messages) => ({
@@ -170,6 +171,39 @@ 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) => {
const value = encodeQxValue(port.variables, variables, messages);
if (value.kind.case !== "objectValue")
throw new Error("QUERY_VARIABLE_INVALID");
return value.kind.value.fields;
};
return [
name,
{
async execute(variables) {
const response = await query.execute(variablesToWire(variables), port.definitionDigest);
if (response.pending.length || response.errors.length)
throw new Error("QUERY_INCOMPLETE");
return decodeQxValue(port.output, response.value, messages);
},
...(port.watch
? {
async *watch(variables, signal) {
for await (const event of query.watch(variablesToWire(variables), signal, port.definitionDigest)) {
if (!event.snapshot)
throw new Error("QUERY_SNAPSHOT_MISSING");
yield decodeQuerySnapshot(event.snapshot, port.output, event.runId, event.sequence);
}
},
}
: {}),
},
];
}
case "constructor":
return [
name,
+618 -1
View File
@@ -1,5 +1,6 @@
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
import type { PersistencePlan } from "./schema_pb.js";
import type { PersistencePlan, QueryRelationalPlan, QuerySelection } from "./schema_pb.js";
import type { CapabilityRef, FieldEditing, WorkspaceQueryScope } from "../quixos/refs_pb.js";
import type { Message } from "@bufbuild/protobuf";
/**
* Describes the file camino/api.proto.
@@ -207,12 +208,91 @@ export type Value = Message<"camino.Value"> & {
* @generated from field: camino.ValueSource source = 11;
*/
source?: ValueSource | undefined;
/**
* Trusted query coordinator annotation. Travels with values through residual
* row selection, then is removed in favor of final-path hydration metadata.
*
* @generated from field: camino.QueryFieldOrigin query_origin = 12;
*/
queryOrigin?: QueryFieldOrigin | undefined;
};
/**
* Describes the message camino.Value.
* Use `create(ValueSchema)` to create a new message.
*/
export declare const ValueSchema: GenMessage<Value>;
/**
* @generated from message camino.QueryFieldOrigin
*/
export type QueryFieldOrigin = Message<"camino.QueryFieldOrigin"> & {
/**
* @generated from field: string selection_id = 1;
*/
selectionId: string;
/**
* @generated from field: string atom_id = 2;
*/
atomId: string;
/**
* @generated from field: string interface_revision_id = 3;
*/
interfaceRevisionId: string;
/**
* @generated from field: string member_id = 4;
*/
memberId: string;
/**
* @generated from field: camino.StateValueSource source = 5;
*/
source?: StateValueSource | undefined;
};
/**
* Describes the message camino.QueryFieldOrigin.
* Use `create(QueryFieldOriginSchema)` to create a new message.
*/
export declare const QueryFieldOriginSchema: GenMessage<QueryFieldOrigin>;
/**
* @generated from message camino.QueryLiveField
*/
export type QueryLiveField = Message<"camino.QueryLiveField"> & {
/**
* @generated from field: repeated camino.QueryPathPart path = 1;
*/
path: QueryPathPart[];
/**
* @generated from field: string selection_id = 2;
*/
selectionId: string;
/**
* @generated from field: string object_id = 3;
*/
objectId: string;
/**
* @generated from field: quixos.CapabilityRef capability = 4;
*/
capability?: CapabilityRef | undefined;
/**
* @generated from field: string watch_operation_id = 5;
*/
watchOperationId: string;
/**
* @generated from field: string setter_operation_id = 6;
*/
setterOperationId: string;
/**
* @generated from field: quixos.FieldEditing editing = 7;
*/
editing?: FieldEditing | undefined;
/**
* @generated from field: camino.StateValueSource source = 8;
*/
source?: StateValueSource | undefined;
};
/**
* Describes the message camino.QueryLiveField.
* Use `create(QueryLiveFieldSchema)` to create a new message.
*/
export declare const QueryLiveFieldSchema: GenMessage<QueryLiveField>;
/**
* @generated from message camino.InstallPersistencePlanRequest
*/
@@ -826,10 +906,547 @@ export type CaminoOp = Message<"camino.CaminoOp"> & {
* Use `create(CaminoOpSchema)` to create a new message.
*/
export declare const CaminoOpSchema: GenMessage<CaminoOp>;
/**
* @generated from message camino.QueryRequest
*/
export type QueryRequest = Message<"camino.QueryRequest"> & {
/**
* @generated from field: string query_id = 1;
*/
queryId: string;
/**
* @generated from oneof camino.QueryRequest.root
*/
root: {
/**
* @generated from field: string object_id = 2;
*/
value: string;
case: "objectId";
} | {
/**
* @generated from field: quixos.WorkspaceQueryScope workspace_scope = 5;
*/
value: WorkspaceQueryScope;
case: "workspaceScope";
} | {
case: undefined;
value?: undefined;
};
/**
* @generated from field: map<string, camino.Value> variables = 3;
*/
variables: {
[key: string]: Value;
};
/**
* Typed callers require this exact checked definition. Administrative/raw
* callers may omit it to explicitly select the currently installed definition.
*
* @generated from field: string expected_definition_digest = 4;
*/
expectedDefinitionDigest: string;
};
/**
* Describes the message camino.QueryRequest.
* Use `create(QueryRequestSchema)` to create a new message.
*/
export declare const QueryRequestSchema: GenMessage<QueryRequest>;
/**
* @generated from message camino.QueryPathPart
*/
export type QueryPathPart = Message<"camino.QueryPathPart"> & {
/**
* @generated from oneof camino.QueryPathPart.part
*/
part: {
/**
* @generated from field: string field = 1;
*/
value: string;
case: "field";
} | {
/**
* @generated from field: uint32 index = 2;
*/
value: number;
case: "index";
} | {
case: undefined;
value?: undefined;
};
};
/**
* Describes the message camino.QueryPathPart.
* Use `create(QueryPathPartSchema)` to create a new message.
*/
export declare const QueryPathPartSchema: GenMessage<QueryPathPart>;
/**
* @generated from message camino.QueryPendingField
*/
export type QueryPendingField = Message<"camino.QueryPendingField"> & {
/**
* @generated from field: repeated camino.QueryPathPart path = 1;
*/
path: QueryPathPart[];
/**
* @generated from field: string object_id = 2;
*/
objectId: string;
/**
* @generated from field: string interface_revision_id = 3;
*/
interfaceRevisionId: string;
/**
* @generated from field: string member_id = 4;
*/
memberId: string;
/**
* @generated from field: string operation_id = 5;
*/
operationId: string;
/**
* @generated from field: string value_type_json = 6;
*/
valueTypeJson: string;
/**
* Internal residual facts are separate from the authored result projection.
*
* @generated from field: optional uint32 residual_window = 7;
*/
residualWindow?: number | undefined;
/**
* @generated from field: uint32 residual_row = 8;
*/
residualRow: number;
/**
* @generated from field: string residual_field = 9;
*/
residualField: string;
/**
* @generated from field: optional uint32 relational_capture = 10;
*/
relationalCapture?: number | undefined;
/**
* @generated from field: uint32 captured_object = 11;
*/
capturedObject: number;
};
/**
* Describes the message camino.QueryPendingField.
* Use `create(QueryPendingFieldSchema)` to create a new message.
*/
export declare const QueryPendingFieldSchema: GenMessage<QueryPendingField>;
/**
* @generated from message camino.QueryStats
*/
export type QueryStats = Message<"camino.QueryStats"> & {
/**
* @generated from field: uint32 sql_count = 1;
*/
sqlCount: number;
/**
* @generated from field: double sql_ms = 2;
*/
sqlMs: number;
/**
* @generated from field: uint32 rpc_count = 3;
*/
rpcCount: number;
/**
* @generated from field: double rpc_ms = 4;
*/
rpcMs: number;
/**
* @generated from field: uint32 result_bytes = 5;
*/
resultBytes: number;
/**
* @generated from field: double preparation_ms = 6;
*/
preparationMs: number;
/**
* @generated from field: double total_ms = 7;
*/
totalMs: number;
/**
* @generated from field: uint32 relational_stages = 8;
*/
relationalStages: number;
/**
* @generated from field: uint32 captured_candidates = 9;
*/
capturedCandidates: number;
/**
* @generated from field: double relational_ms = 10;
*/
relationalMs: number;
/**
* @generated from field: double residual_ms = 11;
*/
residualMs: number;
};
/**
* Describes the message camino.QueryStats.
* Use `create(QueryStatsSchema)` to create a new message.
*/
export declare const QueryStatsSchema: GenMessage<QueryStats>;
/**
* @generated from message camino.QueryResponse
*/
export type QueryResponse = Message<"camino.QueryResponse"> & {
/**
* @generated from field: camino.Value value = 1;
*/
value?: Value | undefined;
/**
* @generated from field: string data_version = 2;
*/
dataVersion: string;
/**
* @generated from field: string binding_digest = 3;
*/
bindingDigest: string;
/**
* @generated from field: repeated camino.QueryPendingField pending = 4;
*/
pending: QueryPendingField[];
/**
* @generated from field: camino.QueryStats stats = 5;
*/
stats?: QueryStats | undefined;
/**
* Redeemable only through the host's private control socket, not an RPC grant.
*
* @generated from field: string preparation_token = 6;
*/
preparationToken: string;
/**
* @generated from field: repeated camino.QueryFieldFailure errors = 7;
*/
errors: QueryFieldFailure[];
/**
* @generated from field: repeated camino.QueryResidualWindow residual_windows = 8;
*/
residualWindows: QueryResidualWindow[];
/**
* Native reads share one database snapshot; package enrichment does not.
*
* native-snapshot | mixed
*
* @generated from field: string consistency = 9;
*/
consistency: string;
/**
* @generated from field: repeated camino.QueryRelationalCapture relational_captures = 10;
*/
relationalCaptures: QueryRelationalCapture[];
/**
* @generated from field: repeated camino.QueryLiveField live_fields = 11;
*/
liveFields: QueryLiveField[];
};
/**
* Describes the message camino.QueryResponse.
* Use `create(QueryResponseSchema)` to create a new message.
*/
export declare const QueryResponseSchema: GenMessage<QueryResponse>;
/**
* Private coordinator input, removed before publishing a result. Memberships
* and native facts share one snapshot; package reads are sampled afterwards.
*
* @generated from message camino.QueryCapturedMember
*/
export type QueryCapturedMember = Message<"camino.QueryCapturedMember"> & {
/**
* @generated from field: string object_id = 1;
*/
objectId: string;
/**
* @generated from field: string entry_id = 2;
*/
entryId: string;
/**
* @generated from field: camino.Value map_key = 3;
*/
mapKey?: Value | undefined;
};
/**
* Describes the message camino.QueryCapturedMember.
* Use `create(QueryCapturedMemberSchema)` to create a new message.
*/
export declare const QueryCapturedMemberSchema: GenMessage<QueryCapturedMember>;
/**
* @generated from message camino.QueryCapturedMembers
*/
export type QueryCapturedMembers = Message<"camino.QueryCapturedMembers"> & {
/**
* @generated from field: repeated camino.QueryCapturedMember entries = 1;
*/
entries: QueryCapturedMember[];
};
/**
* Describes the message camino.QueryCapturedMembers.
* Use `create(QueryCapturedMembersSchema)` to create a new message.
*/
export declare const QueryCapturedMembersSchema: GenMessage<QueryCapturedMembers>;
/**
* @generated from message camino.QueryCapturedObject
*/
export type QueryCapturedObject = Message<"camino.QueryCapturedObject"> & {
/**
* @generated from field: string object_id = 1;
*/
objectId: string;
/**
* @generated from field: map<string, camino.Value> fields = 2;
*/
fields: {
[key: string]: Value;
};
/**
* @generated from field: map<string, string> field_types = 3;
*/
fieldTypes: {
[key: string]: string;
};
/**
* @generated from field: map<string, camino.QueryCapturedMembers> relationships = 4;
*/
relationships: {
[key: string]: QueryCapturedMembers;
};
};
/**
* Describes the message camino.QueryCapturedObject.
* Use `create(QueryCapturedObjectSchema)` to create a new message.
*/
export declare const QueryCapturedObjectSchema: GenMessage<QueryCapturedObject>;
/**
* @generated from message camino.QueryRelationalCapture
*/
export type QueryRelationalCapture = Message<"camino.QueryRelationalCapture"> & {
/**
* @generated from field: repeated camino.QueryPathPart path = 1;
*/
path: QueryPathPart[];
/**
* @generated from field: camino.QueryRelationalPlan plan = 2;
*/
plan?: QueryRelationalPlan | undefined;
/**
* @generated from field: string root_object_id = 3;
*/
rootObjectId: string;
/**
* @generated from field: repeated camino.QueryCapturedObject objects = 4;
*/
objects: QueryCapturedObject[];
/**
* @generated from field: string variables_json = 5;
*/
variablesJson: string;
/**
* @generated from field: uint32 row_limit = 6;
*/
rowLimit: number;
/**
* @generated from field: uint32 candidate_limit = 7;
*/
candidateLimit: number;
/**
* @generated from field: optional uint32 residual_window = 8;
*/
residualWindow?: number | undefined;
/**
* @generated from field: repeated string result_path = 9;
*/
resultPath: string[];
};
/**
* Describes the message camino.QueryRelationalCapture.
* Use `create(QueryRelationalCaptureSchema)` to create a new message.
*/
export declare const QueryRelationalCaptureSchema: GenMessage<QueryRelationalCapture>;
/**
* @generated from message camino.QueryResidualRow
*/
export type QueryResidualRow = Message<"camino.QueryResidualRow"> & {
/**
* @generated from field: string entry_id = 1;
*/
entryId: string;
/**
* @generated from field: map<string, camino.Value> fields = 2;
*/
fields: {
[key: string]: Value;
};
};
/**
* Describes the message camino.QueryResidualRow.
* Use `create(QueryResidualRowSchema)` to create a new message.
*/
export declare const QueryResidualRowSchema: GenMessage<QueryResidualRow>;
/**
* @generated from message camino.QueryResidualOrder
*/
export type QueryResidualOrder = Message<"camino.QueryResidualOrder"> & {
/**
* @generated from field: string field = 1;
*/
field: string;
/**
* @generated from field: bool descending = 2;
*/
descending: boolean;
};
/**
* Describes the message camino.QueryResidualOrder.
* Use `create(QueryResidualOrderSchema)` to create a new message.
*/
export declare const QueryResidualOrderSchema: GenMessage<QueryResidualOrder>;
/**
* @generated from message camino.QueryResidualWindow
*/
export type QueryResidualWindow = Message<"camino.QueryResidualWindow"> & {
/**
* @generated from field: repeated camino.QueryPathPart path = 1;
*/
path: QueryPathPart[];
/**
* @generated from field: repeated camino.QueryResidualRow rows = 2;
*/
rows: QueryResidualRow[];
/**
* @generated from field: string predicate_json = 3;
*/
predicateJson: string;
/**
* @generated from field: repeated camino.QueryResidualOrder order = 4;
*/
order: QueryResidualOrder[];
/**
* @generated from field: uint32 limit = 5;
*/
limit: number;
/**
* @generated from field: bool bounded_all = 6;
*/
boundedAll: boolean;
/**
* @generated from field: repeated camino.QuerySelection selection = 7;
*/
selection: QuerySelection[];
/**
* @generated from field: map<string, string> field_types = 8;
*/
fieldTypes: {
[key: string]: string;
};
/**
* @generated from field: bool relational = 9;
*/
relational: boolean;
/**
* @generated from field: repeated string matched_entries = 10;
*/
matchedEntries: string[];
};
/**
* Describes the message camino.QueryResidualWindow.
* Use `create(QueryResidualWindowSchema)` to create a new message.
*/
export declare const QueryResidualWindowSchema: GenMessage<QueryResidualWindow>;
/**
* @generated from message camino.QueryFieldFailure
*/
export type QueryFieldFailure = Message<"camino.QueryFieldFailure"> & {
/**
* @generated from field: repeated camino.QueryPathPart path = 1;
*/
path: QueryPathPart[];
/**
* @generated from field: string error = 2;
*/
error: string;
};
/**
* Describes the message camino.QueryFieldFailure.
* Use `create(QueryFieldFailureSchema)` to create a new message.
*/
export declare const QueryFieldFailureSchema: GenMessage<QueryFieldFailure>;
/**
* @generated from message camino.QueryChangesRequest
*/
export type QueryChangesRequest = Message<"camino.QueryChangesRequest"> & {
/**
* @generated from field: string query_id = 1;
*/
queryId: string;
/**
* @generated from oneof camino.QueryChangesRequest.root
*/
root: {
/**
* @generated from field: string object_id = 2;
*/
value: string;
case: "objectId";
} | {
/**
* @generated from field: quixos.WorkspaceQueryScope workspace_scope = 4;
*/
value: WorkspaceQueryScope;
case: "workspaceScope";
} | {
case: undefined;
value?: undefined;
};
/**
* @generated from field: string data_version = 3;
*/
dataVersion: string;
};
/**
* Describes the message camino.QueryChangesRequest.
* Use `create(QueryChangesRequestSchema)` to create a new message.
*/
export declare const QueryChangesRequestSchema: GenMessage<QueryChangesRequest>;
/**
* @generated from message camino.QueryChangesResponse
*/
export type QueryChangesResponse = Message<"camino.QueryChangesResponse"> & {
/**
* @generated from field: bool changed = 1;
*/
changed: boolean;
};
/**
* Describes the message camino.QueryChangesResponse.
* Use `create(QueryChangesResponseSchema)` to create a new message.
*/
export declare const QueryChangesResponseSchema: GenMessage<QueryChangesResponse>;
/**
* @generated from service camino.CaminoService
*/
export declare const CaminoService: GenService<{
/**
* @generated from rpc camino.CaminoService.ExecuteQuery
*/
executeQuery: {
methodKind: "unary";
input: typeof QueryRequestSchema;
output: typeof QueryResponseSchema;
};
/**
* @generated from rpc camino.CaminoService.QueryChanges
*/
queryChanges: {
methodKind: "unary";
input: typeof QueryChangesRequestSchema;
output: typeof QueryChangesResponseSchema;
};
/**
* @generated from rpc camino.CaminoService.InstallPersistencePlan
*/
+1 -1
View File
File diff suppressed because one or more lines are too long
+117 -31
View File
File diff suppressed because one or more lines are too long
+1174
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+280 -1
View File
File diff suppressed because one or more lines are too long
+15 -2
View File
@@ -1,10 +1,13 @@
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";
import { CaminoService, type Value } from "./camino/api_pb.js";
import { CaminoService, type Value, type QueryResponse } from "./camino/api_pb.js";
import { OrchestratorRuntime } from "./quixos/orch_pb.js";
export type CaminoClient = Client<typeof CaminoService>;
export type OrchClient = Client<typeof OrchestratorRuntime>;
@@ -61,7 +64,15 @@ export type ConstructorPort = {
atomId: string;
construct(input?: Record<string, unknown>): Promise<QxObjectRef>;
};
export type RuntimePort = StatePort | EdgePort | InterfacePort | ConstructorPort;
export type QueryPort = {
queryId: string;
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 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. */
@@ -75,6 +86,8 @@ export type RuntimeContext = {
edge(portId: string): EdgePort;
interface(portId: string): InterfacePort;
constructor(portId: string): ConstructorPort;
query(portId: string): QueryPort;
reflection(portId: string): ReflectionPort;
};
export type RuntimeSession = {
id: string;
+1 -1
View File
File diff suppressed because one or more lines are too long
+33
View File
@@ -3,6 +3,8 @@ import { readFileSync } from "node:fs";
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";
@@ -155,6 +157,35 @@ 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)
throw new Error(`Workspace query port ${dependency.portId} has no scope`);
const queryId = dependency.binding.case === "queryId" ? dependency.binding.value : dependency.binding.value.queryId;
const root = dependency.binding.case === "queryId"
? { case: "objectId", value: dependency.objectId || request.objectId }
: { case: "workspaceScope", value: dependency.binding.value.scope };
ports.set(dependency.portId, {
queryId,
execute: (variables, expectedDefinitionDigest) => orch.executeQuery({ queryId, root, variables, expectedDefinitionDigest }),
watch: (variables, signal, expectedDefinitionDigest) => orch.watchQuery({ queryId, root, variables, expectedDefinitionDigest }, { signal }),
});
break;
}
case "stateSlotId": {
const slotId = dependency.binding.value;
const dependencyObjectId = dependency.objectId || request.objectId;
@@ -298,6 +329,8 @@ export const createRuntimeContext = (camino, orch, request) => {
edge: (portId) => requirePort(portId, "edgeTypeId"),
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 });
+44
View File
@@ -0,0 +1,44 @@
import { type QxValueType } from "./bindings.js";
import type { QueryResponse } from "./camino/api_pb.js";
import type { QxObjectRef } from "./references.js";
export type QxQueryPartial<T> = T extends QxObjectRef ? T : T extends readonly (infer Item)[] ? QxQueryPartial<Item>[] : T extends object ? {
[Key in keyof T]?: QxQueryPartial<T[Key]>;
} : T;
export type QxQuerySnapshot<T> = {
runId: string;
sequence: bigint;
dataVersion: string;
bindingDigest: string;
consistency: string;
fields: {
path: readonly (string | number)[];
status: "pending" | "error";
error?: string;
}[];
} & ({
status: "ready";
data: T;
} | {
status: "partial";
data: QxQueryPartial<T>;
});
declare const queryTypes: unique symbol;
/** Generated shape evidence, not permission to run a query. */
export interface QxQueryDescriptor<Variables, Result, Root extends {
kind: "object" | "workspace-interface";
interface: string;
} = {
kind: "object" | "workspace-interface";
interface: string;
}> {
readonly id: string;
readonly definitionDigest: string;
readonly root: Root;
readonly variables: QxValueType;
readonly output: QxValueType;
readonly watch: boolean;
readonly [queryTypes]?: (variables: Variables, result: Result) => [Variables, Result];
}
export declare function decodeQuerySnapshot<T>(response: QueryResponse, output: QxValueType, runId: string, sequence: bigint): QxQuerySnapshot<T>;
export {};
//# sourceMappingURL=queries.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,WAAW,GACjD,CAAC,GACD,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAC/B,cAAc,CAAC,IAAI,CAAC,EAAE,GACtB,CAAC,SAAS,MAAM,GACd;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,GAC7C,CAAC,CAAC;AACV,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;QAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/F,GAAG,CAAC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAAC;AACpF,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AACxC,+DAA+D;AAC/D,MAAM,WAAW,iBAAiB,CAChC,SAAS,EACT,MAAM,EACN,IAAI,SAAS;IAAE,IAAI,EAAE,QAAQ,GAAG,qBAAqB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAC3E,IAAI,EAAE,QAAQ,GAAG,qBAAqB,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB;IAED,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CACvF;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,eAAe,CAAC,CAAC,CAAC,CA6CpB"}
+57
View File
@@ -0,0 +1,57 @@
import { decodeQxValue } from "./bindings.js";
export function decodeQuerySnapshot(response, output, runId, sequence) {
if (response.preparationToken || response.residualWindows.length || response.relationalCaptures.length)
throw new Error("QUERY_RESULT_UNFINISHED: private preparation is not a query result");
const fields = [
...response.pending.map((field) => ({ path: field.path, status: "pending" })),
...response.errors.map((field) => ({ path: field.path, status: "error", error: field.error })),
].map((field) => ({
...field,
path: field.path.map((part) => {
if (part.part.case !== "field" && part.part.case !== "index")
throw new Error("QUERY_PATCH_INVALID");
return part.part.value;
}),
}));
// Pending/error values are absent, not successful nulls of a scalar type.
const shape = structuredClone(output);
for (const field of fields) {
let cursor = shape;
for (const [index, part] of field.path.entries()) {
while (cursor.kind === "optional")
cursor = cursor.value;
const last = index === field.path.length - 1;
if (typeof part === "string" && cursor.kind === "record" && cursor.fields[part]) {
if (last)
cursor.fields[part] = { kind: "optional", value: cursor.fields[part] };
else
cursor = cursor.fields[part];
}
else if (typeof part === "number" && cursor.kind === "list")
cursor = cursor.value;
else
throw new Error("QUERY_PATCH_INVALID");
}
}
const data = decodeQxValue(shape, response.value, {});
for (const field of fields) {
let cursor = data;
for (const [index, part] of field.path.entries()) {
if (!cursor || typeof cursor !== "object")
throw new Error("QUERY_PATCH_INVALID");
if (index === field.path.length - 1)
delete cursor[part];
else
cursor = cursor[part];
}
}
return {
runId,
sequence,
dataVersion: response.dataVersion,
bindingDigest: response.bindingDigest,
consistency: response.consistency,
fields,
...(fields.length ? { status: "partial", data } : { status: "ready", data }),
};
}
+490 -34
View File
@@ -1,13 +1,392 @@
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
import type { CaminoObject, CrdtValue, Value } from "../camino/api_pb.js";
import type { CaminoObject, CrdtValue, QueryPathPart, QueryRequestSchema, QueryResponse, QueryResponseSchema, Value } from "../camino/api_pb.js";
import type { InstalledQuery } from "../camino/schema_pb.js";
import type { PackageDescriptor } from "./package_pb.js";
import type { CapabilityRef, ConformanceWitness, PackageExportRef } from "./refs_pb.js";
import type { CapabilityRef, ConformanceWitness, FieldEditing, PackageExportRef, WorkspaceQueryScope } from "./refs_pb.js";
import type { DerivedDependency } from "./runtime_pb.js";
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
*/
export type QueryEvent = Message<"quixos.orch.QueryEvent"> & {
/**
* @generated from field: string run_id = 1;
*/
runId: string;
/**
* @generated from field: uint64 sequence = 2;
*/
sequence: bigint;
/**
* @generated from field: string kind = 3;
*/
kind: string;
/**
* @generated from field: camino.QueryResponse snapshot = 4;
*/
snapshot?: QueryResponse | undefined;
/**
* @generated from field: repeated camino.QueryPathPart path = 5;
*/
path: QueryPathPart[];
/**
* @generated from field: camino.Value value = 6;
*/
value?: Value | undefined;
/**
* @generated from field: string error = 7;
*/
error: string;
};
/**
* Describes the message quixos.orch.QueryEvent.
* Use `create(QueryEventSchema)` to create a new message.
*/
export declare const QueryEventSchema: GenMessage<QueryEvent>;
/**
* Exact closed interface lookup; no policy selection or competing conformances.
*
@@ -202,7 +581,7 @@ export type InvokeCapabilityResponse = Message<"quixos.orch.InvokeCapabilityResp
*/
dependencies: DerivedDependency[];
/**
* @generated from field: quixos.orch.FieldEditing field_editing = 7;
* @generated from field: quixos.FieldEditing field_editing = 7;
*/
fieldEditing?: FieldEditing | undefined;
};
@@ -211,34 +590,6 @@ export type InvokeCapabilityResponse = Message<"quixos.orch.InvokeCapabilityResp
* Use `create(InvokeCapabilityResponseSchema)` to create a new message.
*/
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
*/
@@ -262,9 +613,24 @@ export type EditCapabilityFieldRequest = Message<"quixos.orch.EditCapabilityFiel
*/
bindingDigest: string;
/**
* @generated from field: camino.CrdtValue update = 5;
* @generated from oneof quixos.orch.EditCapabilityFieldRequest.edit
*/
update?: CrdtValue | undefined;
edit: {
/**
* @generated from field: camino.CrdtValue update = 5;
*/
value: CrdtValue;
case: "update";
} | {
/**
* @generated from field: camino.Value replacement = 7;
*/
value: Value;
case: "replacement";
} | {
case: undefined;
value?: undefined;
};
/**
* @generated from field: string client_mutation_id = 6;
*/
@@ -332,7 +698,7 @@ export type WatchCapabilityEvent = Message<"quixos.orch.WatchCapabilityEvent"> &
*/
initial: boolean;
/**
* @generated from field: quixos.orch.FieldEditing field_editing = 8;
* @generated from field: quixos.FieldEditing field_editing = 8;
*/
fieldEditing?: FieldEditing | undefined;
};
@@ -351,6 +717,10 @@ export type GetWorkspaceRequest = Message<"quixos.orch.GetWorkspaceRequest"> & {
* @generated from field: bool include_interface_contracts = 1;
*/
includeInterfaceContracts: boolean;
/**
* @generated from field: bool include_query_contracts = 2;
*/
includeQueryContracts: boolean;
};
/**
* Describes the message quixos.orch.GetWorkspaceRequest.
@@ -398,12 +768,66 @@ export type GetWorkspaceResponse = Message<"quixos.orch.GetWorkspaceResponse"> &
* @generated from field: repeated quixos.orch.ClassCapability class_capabilities = 8;
*/
classCapabilities: ClassCapability[];
/**
* @generated from field: repeated quixos.orch.QueryDescription queries = 9;
*/
queries: QueryDescription[];
/**
* @generated from field: uint32 active_query_executions = 10;
*/
activeQueryExecutions: number;
};
/**
* Describes the message quixos.orch.GetWorkspaceResponse.
* Use `create(GetWorkspaceResponseSchema)` to create a new message.
*/
export declare const GetWorkspaceResponseSchema: GenMessage<GetWorkspaceResponse>;
/**
* @generated from message quixos.orch.QueryDescription
*/
export type QueryDescription = Message<"quixos.orch.QueryDescription"> & {
/**
* @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 document = 4;
*/
document: string;
/**
* @generated from field: string schema = 5;
*/
schema: string;
/**
* @generated from field: repeated string source_files = 6;
*/
sourceFiles: string[];
/**
* @generated from field: string effects_json = 7;
*/
effectsJson: string;
/**
* @generated from field: camino.InstalledQuery plan = 8;
*/
plan?: InstalledQuery | undefined;
/**
* @generated from field: quixos.WorkspaceQueryScope workspace_scope = 9;
*/
workspaceScope?: WorkspaceQueryScope | undefined;
};
/**
* Describes the message quixos.orch.QueryDescription.
* Use `create(QueryDescriptionSchema)` to create a new message.
*/
export declare const QueryDescriptionSchema: GenMessage<QueryDescription>;
/**
* @generated from message quixos.orch.ClassCapability
*/
@@ -695,6 +1119,38 @@ 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
*/
executeQuery: {
methodKind: "unary";
input: typeof QueryRequestSchema;
output: typeof QueryResponseSchema;
};
/**
* @generated from rpc quixos.orch.OrchestratorRuntime.WatchQuery
*/
watchQuery: {
methodKind: "server_streaming";
input: typeof QueryRequestSchema;
output: typeof QueryEventSchema;
};
/**
* @generated from rpc quixos.orch.OrchestratorRuntime.TryConform
*/
+1 -1
View File
File diff suppressed because one or more lines are too long
+89 -33
View File
File diff suppressed because one or more lines are too long
+145 -1
View File
@@ -1,4 +1,4 @@
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import type { Message } from "@bufbuild/protobuf";
/**
* Describes the file quixos/refs.proto.
@@ -28,6 +28,59 @@ export type CapabilityRef = Message<"quixos.CapabilityRef"> & {
* Use `create(CapabilityRefSchema)` to create a new message.
*/
export declare const CapabilityRefSchema: GenMessage<CapabilityRef>;
/**
* Resolved native editing semantics. A source snapshot alone grants no writer.
*
* @generated from message quixos.FieldEditing
*/
export type FieldEditing = Message<"quixos.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;
/**
* @generated from field: quixos.FieldEditing.Mode mode = 5;
*/
mode: FieldEditing_Mode;
};
/**
* Describes the message quixos.FieldEditing.
* Use `create(FieldEditingSchema)` to create a new message.
*/
export declare const FieldEditingSchema: GenMessage<FieldEditing>;
/**
* @generated from enum quixos.FieldEditing.Mode
*/
export declare enum FieldEditing_Mode {
/**
* @generated from enum value: UNSPECIFIED = 0;
*/
UNSPECIFIED = 0,
/**
* @generated from enum value: REGISTER = 1;
*/
REGISTER = 1,
/**
* @generated from enum value: CRDT = 2;
*/
CRDT = 2
}
/**
* Describes the enum quixos.FieldEditing.Mode.
*/
export declare const FieldEditing_ModeSchema: GenEnum<FieldEditing_Mode>;
/**
* @generated from message quixos.ConformanceWitness
*/
@@ -111,6 +164,24 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
*/
value: string;
case: "constructorAtomId";
} | {
/**
* @generated from field: string query_id = 7;
*/
value: string;
case: "queryId";
} | {
/**
* @generated from field: quixos.WorkspaceQueryDependency workspace_query = 8;
*/
value: WorkspaceQueryDependency;
case: "workspaceQuery";
} | {
/**
* @generated from field: quixos.ReflectionDependency reflection = 9;
*/
value: ReflectionDependency;
case: "reflection";
} | {
case: undefined;
value?: undefined;
@@ -128,6 +199,79 @@ 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).
*
* @generated from message quixos.WorkspaceQueryScope
*/
export type WorkspaceQueryScope = Message<"quixos.WorkspaceQueryScope"> & {
/**
* @generated from field: string workspace_id = 1;
*/
workspaceId: string;
/**
* @generated from field: string workspace_revision_id = 2;
*/
workspaceRevisionId: string;
/**
* @generated from field: string workspace_epoch = 3;
*/
workspaceEpoch: string;
/**
* @generated from field: string interface_revision_id = 4;
*/
interfaceRevisionId: string;
/**
* @generated from field: string binding_digest = 5;
*/
bindingDigest: string;
};
/**
* Describes the message quixos.WorkspaceQueryScope.
* Use `create(WorkspaceQueryScopeSchema)` to create a new message.
*/
export declare const WorkspaceQueryScopeSchema: GenMessage<WorkspaceQueryScope>;
/**
* @generated from message quixos.WorkspaceQueryDependency
*/
export type WorkspaceQueryDependency = Message<"quixos.WorkspaceQueryDependency"> & {
/**
* @generated from field: string query_id = 1;
*/
queryId: string;
/**
* @generated from field: quixos.WorkspaceQueryScope scope = 2;
*/
scope?: WorkspaceQueryScope | undefined;
};
/**
* Describes the message quixos.WorkspaceQueryDependency.
* Use `create(WorkspaceQueryDependencySchema)` to create a new message.
*/
export declare const WorkspaceQueryDependencySchema: GenMessage<WorkspaceQueryDependency>;
/**
* @generated from message quixos.EdgeDependency
*/
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"refs_pb.d.ts","sourceRoot":"","sources":["../../src/quixos/refs_pb.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,OACi0B,CAAC;AAEj2B;;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;AA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AmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;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"}
+48 -6
View File
@@ -1,33 +1,75 @@
// @generated by protoc-gen-es v2.12.1 with parameter "target=ts,import_extension=js"
// @generated from file quixos/refs.proto (package quixos, syntax proto3)
/* eslint-disable */
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
/**
* Describes the file quixos/refs.proto.
*/
export const file_quixos_refs = /*@__PURE__*/ fileDesc("ChFxdWl4b3MvcmVmcy5wcm90bxIGcXVpeG9zInUKDUNhcGFiaWxpdHlSZWYSHQoVaW50ZXJmYWNlX3JldmlzaW9uX2lkGAEgASgJEhQKDG9wZXJhdGlvbl9pZBgCIAEoCRIvCgtjb25mb3JtYW5jZRgDIAEo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XZpc2lvbl9pZBgCIAEoCRIXCg93b3Jrc3BhY2VfZXBvY2gYAyABKAkSHQoVaW50ZXJmYWNlX3JldmlzaW9uX2lkGAQgASgJEhYKDmJpbmRpbmdfZGlnZXN0GAUgASgJIlgKGFdvcmtzcGFjZVF1ZXJ5RGVwZW5kZW5jeRIQCghxdWVyeV9pZBgBIAEoCRIqCgVzY29wZRgCIAEoCzIbLnF1aXhvcy5Xb3Jrc3BhY2VRdWVyeVNjb3BlIj0KDkVkZ2VEZXBlbmRlbmN5EhQKDGVkZ2VfdHlwZV9pZBgBIAEoCRIVCg1wcm9qZWN0aW9uX2lkGAIgASgJYgZwcm90bzM");
/**
* Describes the message quixos.CapabilityRef.
* Use `create(CapabilityRefSchema)` to create a new message.
*/
export const CapabilityRefSchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 0);
/**
* Describes the message quixos.FieldEditing.
* Use `create(FieldEditingSchema)` to create a new message.
*/
export const FieldEditingSchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 1);
/**
* @generated from enum quixos.FieldEditing.Mode
*/
export var FieldEditing_Mode;
(function (FieldEditing_Mode) {
/**
* @generated from enum value: UNSPECIFIED = 0;
*/
FieldEditing_Mode[FieldEditing_Mode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
/**
* @generated from enum value: REGISTER = 1;
*/
FieldEditing_Mode[FieldEditing_Mode["REGISTER"] = 1] = "REGISTER";
/**
* @generated from enum value: CRDT = 2;
*/
FieldEditing_Mode[FieldEditing_Mode["CRDT"] = 2] = "CRDT";
})(FieldEditing_Mode || (FieldEditing_Mode = {}));
/**
* Describes the enum quixos.FieldEditing.Mode.
*/
export const FieldEditing_ModeSchema = /*@__PURE__*/ enumDesc(file_quixos_refs, 1, 0);
/**
* Describes the message quixos.ConformanceWitness.
* Use `create(ConformanceWitnessSchema)` to create a new message.
*/
export const ConformanceWitnessSchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 1);
export const ConformanceWitnessSchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 2);
/**
* Describes the message quixos.PackageExportRef.
* Use `create(PackageExportRefSchema)` to create a new message.
*/
export const PackageExportRefSchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 2);
export const PackageExportRefSchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 3);
/**
* Describes the message quixos.InjectedDependency.
* Use `create(InjectedDependencySchema)` to create a new message.
*/
export const InjectedDependencySchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 3);
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, 6);
/**
* Describes the message quixos.WorkspaceQueryDependency.
* Use `create(WorkspaceQueryDependencySchema)` to create a new message.
*/
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, 4);
export const EdgeDependencySchema = /*@__PURE__*/ messageDesc(file_quixos_refs, 8);
+35
View File
@@ -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
+1
View File
@@ -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"}
+1
View File
@@ -0,0 +1 @@
export {};
Generated
+11 -11
View File
@@ -74,19 +74,19 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1789670978,
"narHash": "sha256-7eKHXjv5ghEUqJ/DxhrvFnMIwI7BLfqsGOT1A/7w94E=",
"ref": "refs/tags/quixos-reachability/c3fe7c86b8e88b1bef1ef5dc2fdc5992bbd3bc89",
"rev": "c3fe7c86b8e88b1bef1ef5dc2fdc5992bbd3bc89",
"revCount": 78,
"lastModified": 1791261504,
"narHash": "sha256-QSk9DWR7n5KL6cMHzmSKKXNIyaFA0s8Nu+wXjhhlENI=",
"ref": "refs/tags/quixos-reachability/5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87",
"rev": "5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87",
"revCount": 184,
"type": "git",
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-protocol.git"
"url": "https://repos.quixos.org/quixos-toolchain/quixos-protocol.git"
},
"original": {
"ref": "refs/tags/quixos-reachability/c3fe7c86b8e88b1bef1ef5dc2fdc5992bbd3bc89",
"rev": "c3fe7c86b8e88b1bef1ef5dc2fdc5992bbd3bc89",
"ref": "refs/tags/quixos-reachability/5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87",
"rev": "5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87",
"type": "git",
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-protocol.git"
"url": "https://repos.quixos.org/quixos-toolchain/quixos-protocol.git"
}
},
"quixosNixHelpers": {
@@ -98,13 +98,13 @@
"rev": "7177130c0365f2fa58ea4877366e1c5d17db4c01",
"revCount": 4,
"type": "git",
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
"url": "https://repos.quixos.org/quixos-toolchain/quixos-nix-helpers.git"
},
"original": {
"ref": "refs/tags/quixos-reachability/7177130c0365f2fa58ea4877366e1c5d17db4c01",
"rev": "7177130c0365f2fa58ea4877366e1c5d17db4c01",
"type": "git",
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
"url": "https://repos.quixos.org/quixos-toolchain/quixos-nix-helpers.git"
}
},
"root": {
+2 -2
View File
@@ -4,9 +4,9 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
quixos-protocol.url = "git+https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-protocol.git?ref=refs/tags/quixos-reachability/c3fe7c86b8e88b1bef1ef5dc2fdc5992bbd3bc89&rev=c3fe7c86b8e88b1bef1ef5dc2fdc5992bbd3bc89";
quixos-protocol.url = "git+https://repos.quixos.org/quixos-toolchain/quixos-protocol.git?ref=refs/tags/quixos-reachability/5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87&rev=5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87";
quixosNixHelpers = {
url = "git+https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git?ref=refs/tags/quixos-reachability/7177130c0365f2fa58ea4877366e1c5d17db4c01&rev=7177130c0365f2fa58ea4877366e1c5d17db4c01";
url = "git+https://repos.quixos.org/quixos-toolchain/quixos-nix-helpers.git?ref=refs/tags/quixos-reachability/7177130c0365f2fa58ea4877366e1c5d17db4c01&rev=7177130c0365f2fa58ea4877366e1c5d17db4c01";
flake = false;
};
};
+37
View File
@@ -12,6 +12,7 @@ import {
export type { QxObjectRef } from "./references.js";
import { assertReferenceFree, referenceToWire } from "./references.js";
import { decodeQuerySnapshot } from "./queries.js";
declare const watchBrand: unique symbol;
export type QxWatchHandle = string & { readonly [watchBrand]: true };
export type MessageBinding<T> = { encode(value: T): Value; decode(value: Value): T };
@@ -50,6 +51,8 @@ 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[] }
| { kind: "interface"; id: string; interfaceRevisionId: string; operations: Record<string, QxOperationSpec> }
@@ -244,6 +247,40 @@ 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) => {
const value = encodeQxValue(port.variables, variables, messages);
if (value.kind.case !== "objectValue") throw new Error("QUERY_VARIABLE_INVALID");
return value.kind.value.fields;
};
return [
name,
{
async execute(variables: unknown) {
const response = await query.execute(variablesToWire(variables), port.definitionDigest);
if (response.pending.length || response.errors.length) throw new Error("QUERY_INCOMPLETE");
return decodeQxValue(port.output, response.value, messages);
},
...(port.watch
? {
async *watch(variables: unknown, signal: AbortSignal) {
for await (const event of query.watch(
variablesToWire(variables),
signal,
port.definitionDigest,
)) {
if (!event.snapshot) throw new Error("QUERY_SNAPSHOT_MISSING");
yield decodeQuerySnapshot(event.snapshot, port.output, event.runId, event.sequence);
}
},
}
: {}),
},
];
}
case "constructor":
return [
name,
+752 -32
View File
File diff suppressed because one or more lines are too long
+1362 -1
View File
File diff suppressed because one or more lines are too long
+51 -1
View File
@@ -9,6 +9,9 @@ import {
type QxObjectRef,
} 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";
@@ -33,6 +36,7 @@ import {
RefValueSchema,
ValueSchema,
type Value,
type QueryResponse,
} from "./camino/api_pb.js";
import { OrchestratorRuntime } from "./quixos/orch_pb.js";
import {
@@ -197,7 +201,17 @@ export type ConstructorPort = {
atomId: string;
construct(input?: Record<string, unknown>): Promise<QxObjectRef>;
};
export type RuntimePort = StatePort | EdgePort | InterfacePort | ConstructorPort;
export type QueryPort = {
queryId: string;
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 ReflectionPort = QxReflectionPort & { reflection: true };
export type RuntimePort = StatePort | EdgePort | InterfacePort | ConstructorPort | QueryPort | ReflectionPort;
export type RuntimeContext = {
tryConform(object: QxObjectRef, interfaceRevisionId: string): Promise<InterfacePort | undefined>;
@@ -212,6 +226,8 @@ export type RuntimeContext = {
edge(portId: string): EdgePort;
interface(portId: string): InterfacePort;
constructor(portId: string): ConstructorPort;
query(portId: string): QueryPort;
reflection(portId: string): ReflectionPort;
};
export type RuntimeSession = {
@@ -273,6 +289,38 @@ 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)
throw new Error(`Workspace query port ${dependency.portId} has no scope`);
const queryId =
dependency.binding.case === "queryId" ? dependency.binding.value : dependency.binding.value.queryId;
const root =
dependency.binding.case === "queryId"
? { case: "objectId" as const, value: dependency.objectId || request.objectId }
: { case: "workspaceScope" as const, value: dependency.binding.value.scope! };
ports.set(dependency.portId, {
queryId,
execute: (variables, expectedDefinitionDigest) =>
orch.executeQuery({ queryId, root, variables, expectedDefinitionDigest }),
watch: (variables, signal, expectedDefinitionDigest) =>
orch.watchQuery({ queryId, root, variables, expectedDefinitionDigest }, { signal }),
});
break;
}
case "stateSlotId": {
const slotId = dependency.binding.value;
const dependencyObjectId = dependency.objectId || request.objectId;
@@ -421,6 +469,8 @@ export const createRuntimeContext = (
edge: (portId: string) => requirePort<EdgePort>(portId, "edgeTypeId"),
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"),
};
};
+89
View File
@@ -0,0 +1,89 @@
import { decodeQxValue, type QxValueType } from "./bindings.js";
import type { QueryResponse } from "./camino/api_pb.js";
import type { QxObjectRef } from "./references.js";
export type QxQueryPartial<T> = T extends QxObjectRef
? T
: T extends readonly (infer Item)[]
? QxQueryPartial<Item>[]
: T extends object
? { [Key in keyof T]?: QxQueryPartial<T[Key]> }
: T;
export type QxQuerySnapshot<T> = {
runId: string;
sequence: bigint;
dataVersion: string;
bindingDigest: string;
consistency: string;
fields: { path: readonly (string | number)[]; status: "pending" | "error"; error?: string }[];
} & ({ status: "ready"; data: T } | { status: "partial"; data: QxQueryPartial<T> });
declare const queryTypes: unique symbol;
/** Generated shape evidence, not permission to run a query. */
export interface QxQueryDescriptor<
Variables,
Result,
Root extends { kind: "object" | "workspace-interface"; interface: string } = {
kind: "object" | "workspace-interface";
interface: string;
},
> {
readonly id: string;
readonly definitionDigest: string;
readonly root: Root;
readonly variables: QxValueType;
readonly output: QxValueType;
readonly watch: boolean;
readonly [queryTypes]?: (variables: Variables, result: Result) => [Variables, Result];
}
export function decodeQuerySnapshot<T>(
response: QueryResponse,
output: QxValueType,
runId: string,
sequence: bigint,
): QxQuerySnapshot<T> {
if (response.preparationToken || response.residualWindows.length || response.relationalCaptures.length)
throw new Error("QUERY_RESULT_UNFINISHED: private preparation is not a query result");
const fields = [
...response.pending.map((field) => ({ path: field.path, status: "pending" as const })),
...response.errors.map((field) => ({ path: field.path, status: "error" as const, error: field.error })),
].map((field) => ({
...field,
path: field.path.map((part) => {
if (part.part.case !== "field" && part.part.case !== "index") throw new Error("QUERY_PATCH_INVALID");
return part.part.value;
}),
}));
// Pending/error values are absent, not successful nulls of a scalar type.
const shape = structuredClone(output);
for (const field of fields) {
let cursor = shape;
for (const [index, part] of field.path.entries()) {
while (cursor.kind === "optional") cursor = cursor.value;
const last = index === field.path.length - 1;
if (typeof part === "string" && cursor.kind === "record" && cursor.fields[part]) {
if (last) cursor.fields[part] = { kind: "optional", value: cursor.fields[part]! };
else cursor = cursor.fields[part]!;
} else if (typeof part === "number" && cursor.kind === "list") cursor = cursor.value;
else throw new Error("QUERY_PATCH_INVALID");
}
}
const data = decodeQxValue(shape, response.value, {}) as Record<string, unknown>;
for (const field of fields) {
let cursor: unknown = data;
for (const [index, part] of field.path.entries()) {
if (!cursor || typeof cursor !== "object") throw new Error("QUERY_PATCH_INVALID");
if (index === field.path.length - 1) delete (cursor as Record<string | number, unknown>)[part];
else cursor = (cursor as Record<string | number, unknown>)[part];
}
}
return {
runId,
sequence,
dataVersion: response.dataVersion,
bindingDigest: response.bindingDigest,
consistency: response.consistency,
fields,
...(fields.length ? { status: "partial", data } : { status: "ready", data }),
} as QxQuerySnapshot<T>;
}
+604 -68
View File
File diff suppressed because one or more lines are too long
+179 -7
View File
@@ -2,15 +2,15 @@
// @generated from file quixos/refs.proto (package quixos, syntax proto3)
/* eslint-disable */
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
import type { Message } from "@bufbuild/protobuf";
/**
* Describes the file quixos/refs.proto.
*/
export const file_quixos_refs: GenFile = /*@__PURE__*/
fileDesc("ChFxdWl4b3MvcmVmcy5wcm90bxIGcXVpeG9zInUKDUNhcGFiaWxpdHlSZWYSHQoVaW50ZXJmYWNlX3JldmlzaW9uX2lkGAEgASgJEhQKDG9wZXJhdGlvbl9pZBgCIAEoCRIvCgtjb25mb3JtYW5jZRgDIAEoCzIaLnF1aXhvcy5Db25mb3JtYW5jZVdpdG5lc3MilgEKEkNvbmZvcm1hbmNlV2l0bmVzcxIRCglvYmplY3RfaWQYASABKAkSH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XN0GAUgASgJIlgKGFdvcmtzcGFjZVF1ZXJ5RGVwZW5kZW5jeRIQCghxdWVyeV9pZBgBIAEoCRIqCgVzY29wZRgCIAEoCzIbLnF1aXhvcy5Xb3Jrc3BhY2VRdWVyeVNjb3BlIj0KDkVkZ2VEZXBlbmRlbmN5EhQKDGVkZ2VfdHlwZV9pZBgBIAEoCRIVCg1wcm9qZWN0aW9uX2lkGAIgASgJYgZwcm90bzM");
/**
* @generated from message quixos.CapabilityRef
@@ -41,6 +41,71 @@ export type CapabilityRef = Message<"quixos.CapabilityRef"> & {
export const CapabilityRefSchema: GenMessage<CapabilityRef> = /*@__PURE__*/
messageDesc(file_quixos_refs, 0);
/**
* Resolved native editing semantics. A source snapshot alone grants no writer.
*
* @generated from message quixos.FieldEditing
*/
export type FieldEditing = Message<"quixos.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;
/**
* @generated from field: quixos.FieldEditing.Mode mode = 5;
*/
mode: FieldEditing_Mode;
};
/**
* Describes the message quixos.FieldEditing.
* Use `create(FieldEditingSchema)` to create a new message.
*/
export const FieldEditingSchema: GenMessage<FieldEditing> = /*@__PURE__*/
messageDesc(file_quixos_refs, 1);
/**
* @generated from enum quixos.FieldEditing.Mode
*/
export enum FieldEditing_Mode {
/**
* @generated from enum value: UNSPECIFIED = 0;
*/
UNSPECIFIED = 0,
/**
* @generated from enum value: REGISTER = 1;
*/
REGISTER = 1,
/**
* @generated from enum value: CRDT = 2;
*/
CRDT = 2,
}
/**
* Describes the enum quixos.FieldEditing.Mode.
*/
export const FieldEditing_ModeSchema: GenEnum<FieldEditing_Mode> = /*@__PURE__*/
enumDesc(file_quixos_refs, 1, 0);
/**
* @generated from message quixos.ConformanceWitness
*/
@@ -76,7 +141,7 @@ export type ConformanceWitness = Message<"quixos.ConformanceWitness"> & {
* Use `create(ConformanceWitnessSchema)` to create a new message.
*/
export const ConformanceWitnessSchema: GenMessage<ConformanceWitness> = /*@__PURE__*/
messageDesc(file_quixos_refs, 1);
messageDesc(file_quixos_refs, 2);
/**
* @generated from message quixos.PackageExportRef
@@ -98,7 +163,7 @@ export type PackageExportRef = Message<"quixos.PackageExportRef"> & {
* Use `create(PackageExportRefSchema)` to create a new message.
*/
export const PackageExportRefSchema: GenMessage<PackageExportRef> = /*@__PURE__*/
messageDesc(file_quixos_refs, 2);
messageDesc(file_quixos_refs, 3);
/**
* @generated from message quixos.InjectedDependency
@@ -136,6 +201,24 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
*/
value: string;
case: "constructorAtomId";
} | {
/**
* @generated from field: string query_id = 7;
*/
value: string;
case: "queryId";
} | {
/**
* @generated from field: quixos.WorkspaceQueryDependency workspace_query = 8;
*/
value: WorkspaceQueryDependency;
case: "workspaceQuery";
} | {
/**
* @generated from field: quixos.ReflectionDependency reflection = 9;
*/
value: ReflectionDependency;
case: "reflection";
} | { case: undefined; value?: undefined };
/**
@@ -152,7 +235,96 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
* Use `create(InjectedDependencySchema)` to create a new message.
*/
export const InjectedDependencySchema: GenMessage<InjectedDependency> = /*@__PURE__*/
messageDesc(file_quixos_refs, 3);
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).
*
* @generated from message quixos.WorkspaceQueryScope
*/
export type WorkspaceQueryScope = Message<"quixos.WorkspaceQueryScope"> & {
/**
* @generated from field: string workspace_id = 1;
*/
workspaceId: string;
/**
* @generated from field: string workspace_revision_id = 2;
*/
workspaceRevisionId: string;
/**
* @generated from field: string workspace_epoch = 3;
*/
workspaceEpoch: string;
/**
* @generated from field: string interface_revision_id = 4;
*/
interfaceRevisionId: string;
/**
* @generated from field: string binding_digest = 5;
*/
bindingDigest: string;
};
/**
* Describes the message quixos.WorkspaceQueryScope.
* Use `create(WorkspaceQueryScopeSchema)` to create a new message.
*/
export const WorkspaceQueryScopeSchema: GenMessage<WorkspaceQueryScope> = /*@__PURE__*/
messageDesc(file_quixos_refs, 6);
/**
* @generated from message quixos.WorkspaceQueryDependency
*/
export type WorkspaceQueryDependency = Message<"quixos.WorkspaceQueryDependency"> & {
/**
* @generated from field: string query_id = 1;
*/
queryId: string;
/**
* @generated from field: quixos.WorkspaceQueryScope scope = 2;
*/
scope?: WorkspaceQueryScope | undefined;
};
/**
* Describes the message quixos.WorkspaceQueryDependency.
* Use `create(WorkspaceQueryDependencySchema)` to create a new message.
*/
export const WorkspaceQueryDependencySchema: GenMessage<WorkspaceQueryDependency> = /*@__PURE__*/
messageDesc(file_quixos_refs, 7);
/**
* @generated from message quixos.EdgeDependency
@@ -174,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, 4);
messageDesc(file_quixos_refs, 8);
+32
View File
@@ -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>;
};
+102
View File
@@ -0,0 +1,102 @@
import assert from "node:assert/strict";
import test from "node:test";
import { create } from "@bufbuild/protobuf";
import { QueryResponseSchema } from "../dist/camino/api_pb.js";
import { InjectedDependencySchema } from "../dist/quixos/refs_pb.js";
import { createRuntimeContext, decodeQuerySnapshot, jsToProtoValue, protoValueToJs } from "../dist/index.js";
test("private relational captures cannot be decoded as a completed public query", () => {
const response = create(QueryResponseSchema, { relationalCaptures: [{ rootObjectId: "obj:private" }] });
assert.throws(
() => decodeQuerySnapshot(response, { kind: "record", fields: {} }, "run", 1n),
/QUERY_RESULT_UNFINISHED/,
);
});
test("query ports carry only an injected query identity and root", async () => {
let seen;
const context = createRuntimeContext(
{},
{
executeQuery: async (request) => {
seen = request;
return create(QueryResponseSchema);
},
},
{
objectId: "obj:receiver",
input: {},
dependencies: [
create(InjectedDependencySchema, {
portId: "list",
objectId: "obj:collection",
binding: { case: "queryId", value: "pkg@1:upcoming" },
}),
],
},
);
await context.query("list").execute({ first: jsToProtoValue(30) }, "checked-definition");
assert.equal(seen.expectedDefinitionDigest, "checked-definition");
assert.deepEqual(seen.root, { case: "objectId", value: "obj:collection" });
assert.equal(seen.queryId, "pkg@1:upcoming");
assert.equal(protoValueToJs(seen.variables.first), 30);
assert.throws(() => context.query("not-injected"), /Missing/);
});
test("workspace query ports carry explicit scoped evidence, never their receiver", async () => {
let seen;
const dependency = create(InjectedDependencySchema, {
portId: "search",
binding: {
case: "workspaceQuery",
value: {
queryId: "pkg@1:search",
scope: {
workspaceId: "ws",
workspaceRevisionId: "ws@1",
workspaceEpoch: "1",
interfaceRevisionId: "searchable",
bindingDigest: "digest",
},
},
},
});
const context = createRuntimeContext(
{},
{
executeQuery: async (request) => {
seen = request;
return create(QueryResponseSchema);
},
},
{ objectId: "obj:receiver", input: {}, dependencies: [dependency] },
);
await context.query("search").execute({});
assert.equal(seen.root.case, "workspaceScope");
assert.equal(seen.root.value.workspaceId, "ws");
assert.equal(seen.objectId, undefined);
dependency.binding.value.scope = undefined;
assert.throws(
() => createRuntimeContext({}, {}, { objectId: "obj:receiver", input: {}, dependencies: [dependency] }),
/has no scope/,
);
});
test("query snapshots distinguish an unavailable scalar from a successful null", () => {
const output = {
kind: "record",
fields: { title: { kind: "scalar", name: "string" }, score: { kind: "scalar", name: "int64" } },
};
const response = create(QueryResponseSchema, {
value: jsToProtoValue({ title: "Native title", score: null }),
pending: [{ path: [{ part: { case: "field", value: "score" } }] }],
});
const snapshot = decodeQuerySnapshot(response, output, "run1", 1n);
assert.equal(snapshot.status, "partial");
assert.deepEqual(snapshot.data, { title: "Native title" });
assert.deepEqual(snapshot.fields, [{ path: ["score"], status: "pending" }]);
assert.equal(output.fields.score.kind, "scalar");
response.pending = [];
response.value = jsToProtoValue({ title: "Native title", score: 9007199254740993n });
assert.equal(decodeQuerySnapshot(response, output, "run1", 2n).data.score, 9007199254740993n);
});
+58
View File
@@ -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/);
});