@lace-cloud/proto 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -849,6 +849,50 @@ type MessageBridge = {
849
849
  onMessage(f: (m: unknown) => void): () => void;
850
850
  };
851
851
 
852
+ declare const ENGINE_PROTOCOL_VERSION: string;
853
+ declare const ENGINE_CONTRACT: string;
854
+ /** What an engine names of itself, on its handshake or in its `Initialize` answer. */
855
+ type EngineIdentity = {
856
+ version: string;
857
+ protocol: string;
858
+ /** The contract's digest; '' for an engine that names none. */
859
+ contract: string;
860
+ };
861
+ /** What these libraries require of an engine. */
862
+ type RequiredEngine = {
863
+ protocol: string;
864
+ contract: string;
865
+ };
866
+ /**
867
+ * The engine names another protocol version or another contract than these
868
+ * libraries were built from. It carries the engine's own version, both
869
+ * protocol versions and both contracts. `behind` says which side is older
870
+ * when the protocol numbers differ, and is undefined when they are equal and
871
+ * only the contracts differ: two builds of one protocol from different
872
+ * trees, which the number does not order. What a host shows for it, and
873
+ * what it offers, is the host's.
874
+ */
875
+ declare class EngineIdentityMismatchError extends Error {
876
+ readonly engineVersion: string;
877
+ readonly engineProtocol: string;
878
+ readonly engineContract: string;
879
+ readonly requiredProtocol: string;
880
+ readonly requiredContract: string;
881
+ readonly behind: 'engine' | 'host' | undefined;
882
+ constructor(engine: EngineIdentity, required: RequiredEngine);
883
+ }
884
+ /**
885
+ * The one check of what an engine names of itself (on its handshake line,
886
+ * or in its `Initialize` answer) against `ENGINE_PROTOCOL_VERSION` and
887
+ * `ENGINE_CONTRACT`: another protocol version or another contract, or none,
888
+ * throws `EngineIdentityMismatchError`. The host's `ServerManager` checks
889
+ * the handshake before any RPC and the canvas's engine mapping checks
890
+ * `Initialize`'s answer before any other call, so an engine that serves
891
+ * other commands or other documents is refused once, clearly, instead of
892
+ * a command going missing or a document failing to parse later.
893
+ */
894
+ declare function checkEngineIdentity(engine: EngineIdentity): void;
895
+
852
896
  declare function deriveNodeConfig(bundle: Bundle, instanceId: string): NodeConfig | null;
853
897
  declare function deriveSettingsConfig(bundle: Bundle, moduleKey: string): SettingsConfig | null;
854
898
 
@@ -1018,34 +1062,5 @@ declare function resolveScopePath(bundle: Bundle, path: string): string | null;
1018
1062
 
1019
1063
  declare const CanvasViewProto: MessageFns<CanvasView>;
1020
1064
 
1021
- declare const ENGINE_PROTOCOL_VERSION: string;
1022
- /**
1023
- * The engine names another protocol version than these libraries speak. It
1024
- * carries the engine's own version and both protocol versions;
1025
- * `engineTooOld` says which side is behind. What a host shows for it, and
1026
- * what it offers, is the host's.
1027
- */
1028
- declare class EngineProtocolMismatchError extends Error {
1029
- readonly engineVersion: string;
1030
- readonly engineProtocol: string;
1031
- readonly requiredProtocol: string;
1032
- constructor(engineVersion: string, engineProtocol: string, requiredProtocol: string);
1033
- /**
1034
- * The engine is the side that is behind: a newer Lace CLI speaks this
1035
- * host's protocol. False when the engine is ahead of the host.
1036
- */
1037
- get engineTooOld(): boolean;
1038
- }
1039
- /**
1040
- * The one check of the protocol version an engine names — on its handshake
1041
- * line, or in its `Initialize` answer — against `ENGINE_PROTOCOL_VERSION`:
1042
- * another version, or none, throws `EngineProtocolMismatchError`. The
1043
- * host's `ServerManager` checks the handshake before any RPC and the
1044
- * canvas's engine mapping checks `Initialize`'s answer before any other
1045
- * call, so an engine speaking another protocol is refused once, clearly,
1046
- * instead of misreading every later message.
1047
- */
1048
- declare function checkEngineProtocol(engineVersion: string, engineProtocol: string): void;
1049
-
1050
- export { BRIDGE_METHODS, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, CanvasViewProto, EMPTY_BUNDLE, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, EngineProtocolMismatchError, GROUP_HEADER_HEIGHT, GROUP_PADDING, HOST_ONLY_METHODS, META_ARGUMENTS, NODE_HEADER_HEIGHT, NODE_ROW_HEIGHT, NODE_WIDTH, apiFields, boxAt, callText, checkEngineProtocol, collapsedGroupSize, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, drawnAt, drawnRect, extentOf, frameOf, freeSlot, groupBoxSize, groupFootprint, groupInputPinY, groupPinY, groupPins, groupReach, inputPinY, instanceAddress, joinPath, keepOrder, layoutByDepth, localIn, nodeIdForAddress, nodeIdForDiagnostic, nodeRows, nodeSize, originAt, parseModuleKey, projectCanvasView, reachRect, resolveInstance, resolveScopePath, resolveScopePositionsByDepth, splitPath, stepDown, visibleInputs };
1051
- export type { BlockConfig, BridgeMethod, BridgeRequest, BridgeResponse, CanvasArrangement, CanvasView$1 as CanvasView, Conflict, DeepPartial$1 as DeepPartial, Diagnostic, EngineMethod, EngineStreamMethod, HostOnlyMethod, InstanceAddress, InstanceChild, KeepKey, LayoutEdge, LayoutItem, MessageBridge, MetaArgument, NodeConfig, NodePin$1 as NodePin, ParsedModuleKey, ProjectionMeta, ProtoDiagnosticLike, Rect, RenderEdge$1 as RenderEdge, RenderGroup$1 as RenderGroup, RenderInput, RenderNode$1 as RenderNode, RenderOutput, ResourceConfig, ScopedInstance, SettingsConfig, Size, ViewportIntent, XY };
1065
+ export { BRIDGE_METHODS, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, CanvasViewProto, EMPTY_BUNDLE, ENGINE_CONTRACT, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, EngineIdentityMismatchError, GROUP_HEADER_HEIGHT, GROUP_PADDING, HOST_ONLY_METHODS, META_ARGUMENTS, NODE_HEADER_HEIGHT, NODE_ROW_HEIGHT, NODE_WIDTH, apiFields, boxAt, callText, checkEngineIdentity, collapsedGroupSize, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, drawnAt, drawnRect, extentOf, frameOf, freeSlot, groupBoxSize, groupFootprint, groupInputPinY, groupPinY, groupPins, groupReach, inputPinY, instanceAddress, joinPath, keepOrder, layoutByDepth, localIn, nodeIdForAddress, nodeIdForDiagnostic, nodeRows, nodeSize, originAt, parseModuleKey, projectCanvasView, reachRect, resolveInstance, resolveScopePath, resolveScopePositionsByDepth, splitPath, stepDown, visibleInputs };
1066
+ export type { BlockConfig, BridgeMethod, BridgeRequest, BridgeResponse, CanvasArrangement, CanvasView$1 as CanvasView, Conflict, DeepPartial$1 as DeepPartial, Diagnostic, EngineIdentity, EngineMethod, EngineStreamMethod, HostOnlyMethod, InstanceAddress, InstanceChild, KeepKey, LayoutEdge, LayoutItem, MessageBridge, MetaArgument, NodeConfig, NodePin$1 as NodePin, ParsedModuleKey, ProjectionMeta, ProtoDiagnosticLike, Rect, RenderEdge$1 as RenderEdge, RenderGroup$1 as RenderGroup, RenderInput, RenderNode$1 as RenderNode, RenderOutput, ResourceConfig, ScopedInstance, SettingsConfig, Size, ViewportIntent, XY };
package/dist/index.d.ts CHANGED
@@ -849,6 +849,50 @@ type MessageBridge = {
849
849
  onMessage(f: (m: unknown) => void): () => void;
850
850
  };
851
851
 
852
+ declare const ENGINE_PROTOCOL_VERSION: string;
853
+ declare const ENGINE_CONTRACT: string;
854
+ /** What an engine names of itself, on its handshake or in its `Initialize` answer. */
855
+ type EngineIdentity = {
856
+ version: string;
857
+ protocol: string;
858
+ /** The contract's digest; '' for an engine that names none. */
859
+ contract: string;
860
+ };
861
+ /** What these libraries require of an engine. */
862
+ type RequiredEngine = {
863
+ protocol: string;
864
+ contract: string;
865
+ };
866
+ /**
867
+ * The engine names another protocol version or another contract than these
868
+ * libraries were built from. It carries the engine's own version, both
869
+ * protocol versions and both contracts. `behind` says which side is older
870
+ * when the protocol numbers differ, and is undefined when they are equal and
871
+ * only the contracts differ: two builds of one protocol from different
872
+ * trees, which the number does not order. What a host shows for it, and
873
+ * what it offers, is the host's.
874
+ */
875
+ declare class EngineIdentityMismatchError extends Error {
876
+ readonly engineVersion: string;
877
+ readonly engineProtocol: string;
878
+ readonly engineContract: string;
879
+ readonly requiredProtocol: string;
880
+ readonly requiredContract: string;
881
+ readonly behind: 'engine' | 'host' | undefined;
882
+ constructor(engine: EngineIdentity, required: RequiredEngine);
883
+ }
884
+ /**
885
+ * The one check of what an engine names of itself (on its handshake line,
886
+ * or in its `Initialize` answer) against `ENGINE_PROTOCOL_VERSION` and
887
+ * `ENGINE_CONTRACT`: another protocol version or another contract, or none,
888
+ * throws `EngineIdentityMismatchError`. The host's `ServerManager` checks
889
+ * the handshake before any RPC and the canvas's engine mapping checks
890
+ * `Initialize`'s answer before any other call, so an engine that serves
891
+ * other commands or other documents is refused once, clearly, instead of
892
+ * a command going missing or a document failing to parse later.
893
+ */
894
+ declare function checkEngineIdentity(engine: EngineIdentity): void;
895
+
852
896
  declare function deriveNodeConfig(bundle: Bundle, instanceId: string): NodeConfig | null;
853
897
  declare function deriveSettingsConfig(bundle: Bundle, moduleKey: string): SettingsConfig | null;
854
898
 
@@ -1018,34 +1062,5 @@ declare function resolveScopePath(bundle: Bundle, path: string): string | null;
1018
1062
 
1019
1063
  declare const CanvasViewProto: MessageFns<CanvasView>;
1020
1064
 
1021
- declare const ENGINE_PROTOCOL_VERSION: string;
1022
- /**
1023
- * The engine names another protocol version than these libraries speak. It
1024
- * carries the engine's own version and both protocol versions;
1025
- * `engineTooOld` says which side is behind. What a host shows for it, and
1026
- * what it offers, is the host's.
1027
- */
1028
- declare class EngineProtocolMismatchError extends Error {
1029
- readonly engineVersion: string;
1030
- readonly engineProtocol: string;
1031
- readonly requiredProtocol: string;
1032
- constructor(engineVersion: string, engineProtocol: string, requiredProtocol: string);
1033
- /**
1034
- * The engine is the side that is behind: a newer Lace CLI speaks this
1035
- * host's protocol. False when the engine is ahead of the host.
1036
- */
1037
- get engineTooOld(): boolean;
1038
- }
1039
- /**
1040
- * The one check of the protocol version an engine names — on its handshake
1041
- * line, or in its `Initialize` answer — against `ENGINE_PROTOCOL_VERSION`:
1042
- * another version, or none, throws `EngineProtocolMismatchError`. The
1043
- * host's `ServerManager` checks the handshake before any RPC and the
1044
- * canvas's engine mapping checks `Initialize`'s answer before any other
1045
- * call, so an engine speaking another protocol is refused once, clearly,
1046
- * instead of misreading every later message.
1047
- */
1048
- declare function checkEngineProtocol(engineVersion: string, engineProtocol: string): void;
1049
-
1050
- export { BRIDGE_METHODS, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, CanvasViewProto, EMPTY_BUNDLE, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, EngineProtocolMismatchError, GROUP_HEADER_HEIGHT, GROUP_PADDING, HOST_ONLY_METHODS, META_ARGUMENTS, NODE_HEADER_HEIGHT, NODE_ROW_HEIGHT, NODE_WIDTH, apiFields, boxAt, callText, checkEngineProtocol, collapsedGroupSize, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, drawnAt, drawnRect, extentOf, frameOf, freeSlot, groupBoxSize, groupFootprint, groupInputPinY, groupPinY, groupPins, groupReach, inputPinY, instanceAddress, joinPath, keepOrder, layoutByDepth, localIn, nodeIdForAddress, nodeIdForDiagnostic, nodeRows, nodeSize, originAt, parseModuleKey, projectCanvasView, reachRect, resolveInstance, resolveScopePath, resolveScopePositionsByDepth, splitPath, stepDown, visibleInputs };
1051
- export type { BlockConfig, BridgeMethod, BridgeRequest, BridgeResponse, CanvasArrangement, CanvasView$1 as CanvasView, Conflict, DeepPartial$1 as DeepPartial, Diagnostic, EngineMethod, EngineStreamMethod, HostOnlyMethod, InstanceAddress, InstanceChild, KeepKey, LayoutEdge, LayoutItem, MessageBridge, MetaArgument, NodeConfig, NodePin$1 as NodePin, ParsedModuleKey, ProjectionMeta, ProtoDiagnosticLike, Rect, RenderEdge$1 as RenderEdge, RenderGroup$1 as RenderGroup, RenderInput, RenderNode$1 as RenderNode, RenderOutput, ResourceConfig, ScopedInstance, SettingsConfig, Size, ViewportIntent, XY };
1065
+ export { BRIDGE_METHODS, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, CanvasViewProto, EMPTY_BUNDLE, ENGINE_CONTRACT, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, EngineIdentityMismatchError, GROUP_HEADER_HEIGHT, GROUP_PADDING, HOST_ONLY_METHODS, META_ARGUMENTS, NODE_HEADER_HEIGHT, NODE_ROW_HEIGHT, NODE_WIDTH, apiFields, boxAt, callText, checkEngineIdentity, collapsedGroupSize, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, drawnAt, drawnRect, extentOf, frameOf, freeSlot, groupBoxSize, groupFootprint, groupInputPinY, groupPinY, groupPins, groupReach, inputPinY, instanceAddress, joinPath, keepOrder, layoutByDepth, localIn, nodeIdForAddress, nodeIdForDiagnostic, nodeRows, nodeSize, originAt, parseModuleKey, projectCanvasView, reachRect, resolveInstance, resolveScopePath, resolveScopePositionsByDepth, splitPath, stepDown, visibleInputs };
1066
+ export type { BlockConfig, BridgeMethod, BridgeRequest, BridgeResponse, CanvasArrangement, CanvasView$1 as CanvasView, Conflict, DeepPartial$1 as DeepPartial, Diagnostic, EngineIdentity, EngineMethod, EngineStreamMethod, HostOnlyMethod, InstanceAddress, InstanceChild, KeepKey, LayoutEdge, LayoutItem, MessageBridge, MetaArgument, NodeConfig, NodePin$1 as NodePin, ParsedModuleKey, ProjectionMeta, ProtoDiagnosticLike, Rect, RenderEdge$1 as RenderEdge, RenderGroup$1 as RenderGroup, RenderInput, RenderNode$1 as RenderNode, RenderOutput, ResourceConfig, ScopedInstance, SettingsConfig, Size, ViewportIntent, XY };