@lace-cloud/canvas 0.19.0 → 0.21.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.
Files changed (44) hide show
  1. package/README.md +3 -3
  2. package/dist/{AccordionSection-QHNIBNJT.css → AccordionSection-J3ALHB5M.css} +22 -12
  3. package/dist/{App-D7WF3TWZ.css → App-IFIOMNV7.css} +47 -33
  4. package/dist/Banner-4TSIKYLF.css +48 -0
  5. package/dist/{Canvas-J6F7YHEK.css → Canvas-JRY2HAY6.css} +0 -56
  6. package/dist/CanvasControls-L6Q2LX2P.css +47 -0
  7. package/dist/ContextMenu-C7SLX23S.css +74 -0
  8. package/dist/DiagnosticsPanel-T6VDHH4A.css +64 -0
  9. package/dist/Drawer-34ZYTEWE.css +62 -0
  10. package/dist/EdgeInspectorPanel-JD6CVUAT.css +45 -0
  11. package/dist/EmptyCanvas-QA2OV3T3.css +21 -0
  12. package/dist/GroupNode-QWSLBFCH.css +197 -0
  13. package/dist/Identifier-V6MZ37EG.css +4 -0
  14. package/dist/{ModuleConfigPanel-LZRL4F3Q.css → ModuleConfigPanel-LTPLEG2L.css} +29 -10
  15. package/dist/{ModuleNode-OJXMNOL3.css → ModuleNode-RRZ37SFM.css} +97 -27
  16. package/dist/PaperGrid-WFRL3N4P.css +25 -0
  17. package/dist/ToolbarAction-PQNWHJSU.css +36 -0
  18. package/dist/UpdateButton-TJKSFVBA.css +16 -0
  19. package/dist/{chunk-S2FFLFOT.mjs → chunk-W6U3TVQK.mjs} +106 -110
  20. package/dist/chunk-W6U3TVQK.mjs.map +1 -0
  21. package/dist/engine/index.cjs +83 -104
  22. package/dist/engine/index.cjs.map +1 -1
  23. package/dist/engine/index.d.mts +3 -5
  24. package/dist/engine/index.d.ts +3 -5
  25. package/dist/engine/index.mjs +1 -3
  26. package/dist/icons-SBZCWI5T.css +14 -0
  27. package/dist/index.cjs +10710 -10373
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.mts +35 -25
  30. package/dist/index.d.ts +35 -25
  31. package/dist/index.mjs +3026 -2641
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/{mapping-BzX6r87C.d.mts → mapping-CopjG8Ae.d.mts} +59 -47
  34. package/dist/{mapping-BzX6r87C.d.ts → mapping-CopjG8Ae.d.ts} +59 -47
  35. package/dist/{panels-shared-OFOUQSUT.css → panels-shared-5JFNYXQ7.css} +47 -66
  36. package/package.json +3 -3
  37. package/dist/ConflictBanner-4V5K2QNU.css +0 -44
  38. package/dist/ContextMenu-EAQFLI5L.css +0 -46
  39. package/dist/DiagnosticsPanel-HB3JQYSY.css +0 -39
  40. package/dist/EdgeInspectorPanel-D536U5MZ.css +0 -54
  41. package/dist/GroupNode-XSB4OKGK.css +0 -150
  42. package/dist/Markers-XLREDZNM.css +0 -16
  43. package/dist/SourceRefusedBanner-5PXHEDHT.css +0 -23
  44. package/dist/chunk-S2FFLFOT.mjs.map +0 -1
@@ -1455,6 +1455,8 @@ declare enum Reason {
1455
1455
  * REASON_CROSS_SCOPE - ApplyAction: a wire whose source and target are owned by different
1456
1456
  * modules crosses a group's boundary, which no single-scope edit makes.
1457
1457
  * It is a refusal of the batch's content, carried on its GraphError.
1458
+ * ReadWiringCandidates: a read whose two scopes differ, refused
1459
+ * (FailedPrecondition) as such a wire is.
1458
1460
  */
1459
1461
  REASON_CROSS_SCOPE = 15,
1460
1462
  /**
@@ -1509,13 +1511,6 @@ interface ShutdownResponse {
1509
1511
  status: string;
1510
1512
  }
1511
1513
  declare const ShutdownResponse: MessageFns<ShutdownResponse>;
1512
- interface ReadCredentialResponse {
1513
- /** empty when signed out */
1514
- api_key: string;
1515
- /** the API the engine's own commands call */
1516
- api_base_url: string;
1517
- }
1518
- declare const ReadCredentialResponse: MessageFns<ReadCredentialResponse>;
1519
1514
  interface SessionOpenRequest {
1520
1515
  ephemeral?: EphemeralSession | undefined;
1521
1516
  root?: RootSession | undefined;
@@ -1696,10 +1691,11 @@ interface CopyInstancesAction {
1696
1691
  }
1697
1692
  declare const CopyInstancesAction: MessageFns<CopyInstancesAction>;
1698
1693
  /**
1699
- * CreateGroupAction creates a new visual group from selected nodes. The
1700
- * group's display label is consumer-owned arrangement state (written from
1701
- * `BundleApplyResult.created` after this action lands); the wire payload
1702
- * carries only membership.
1694
+ * CreateGroupAction creates a new group from selected nodes. The wire
1695
+ * payload carries only membership: the engine names the group (the
1696
+ * scope's next free group_<n>, its one name) and reports it in
1697
+ * `BundleApplyResult.created`, and where the group is drawn and whether
1698
+ * it is collapsed are consumer-owned arrangement state.
1703
1699
  */
1704
1700
  interface CreateGroupAction {
1705
1701
  node_ids: string[];
@@ -1843,6 +1839,12 @@ interface WiringCandidate$1 {
1843
1839
  score: number;
1844
1840
  }
1845
1841
  declare const WiringCandidate$1: MessageFns<WiringCandidate$1>;
1842
+ /**
1843
+ * A read names its two ends as a connect does: `scope` owns the targets and
1844
+ * `source_scope` the sources, both required. A read whose two scopes
1845
+ * differ is refused (FailedPrecondition, `REASON_CROSS_SCOPE`) as a wire
1846
+ * across them is: the matcher pairs the instances of one module only.
1847
+ */
1846
1848
  interface ReadWiringCandidatesRequest {
1847
1849
  session_id: string;
1848
1850
  /** The key of the module whose instances are matched (an action's `scope`). */
@@ -1857,6 +1859,8 @@ interface ReadWiringCandidatesRequest {
1857
1859
  * every instance of the scope is a target.
1858
1860
  */
1859
1861
  target_instance?: string | undefined;
1862
+ /** The key of the module that owns the sources (a wire's `source_scope`). */
1863
+ source_scope: string;
1860
1864
  }
1861
1865
  declare const ReadWiringCandidatesRequest: MessageFns<ReadWiringCandidatesRequest>;
1862
1866
  interface ReadWiringCandidatesResponse {
@@ -1999,7 +2003,7 @@ declare const BundleStateEvent: MessageFns<BundleStateEvent>;
1999
2003
  * tree. Consumers (VS Code extension, portal, tests) project this
2000
2004
  * locally via the proto package's `projectCanvasView(bundle,
2001
2005
  * arrangement?, meta)` to produce a renderable CanvasView —
2002
- * `arrangement` (node positions, group collapse/label) is
2006
+ * `arrangement` (node positions, group collapse) is
2003
2007
  * consumer-owned view state and never travels here.
2004
2008
  *
2005
2009
  * Not to be confused with the `bundle_snapshot` API entity, which is
@@ -2053,6 +2057,15 @@ interface BundleState {
2053
2057
  * holds already shows a batch it applied.
2054
2058
  */
2055
2059
  revision: number;
2060
+ /**
2061
+ * True while a Generate holds the session's one Generate: from the moment
2062
+ * SessionGenerate takes it until the call answers — the tree's write and
2063
+ * the module validate that certifies it. The session publishes a frame
2064
+ * when it is taken and when it is released, so a subscriber that joins
2065
+ * mid-Generate starts with it set, and a second SessionGenerate in that
2066
+ * window is refused (FailedPrecondition).
2067
+ */
2068
+ generating: boolean;
2056
2069
  }
2057
2070
  declare const BundleState: MessageFns<BundleState>;
2058
2071
  /**
@@ -2091,7 +2104,7 @@ declare const BundleApplyResult: MessageFns<BundleApplyResult>;
2091
2104
  /**
2092
2105
  * CreatedRef names one child created by an action (PlaceModule,
2093
2106
  * CreateGroup, CopyInstances, ...). Clients key pending arrangement
2094
- * writes (position, group label/collapse) off these IDs instead of
2107
+ * writes (position, group collapse) off these IDs instead of
2095
2108
  * diffing BundleState frames.
2096
2109
  */
2097
2110
  interface CreatedRef$1 {
@@ -2215,27 +2228,6 @@ declare const LaceEngineDefinition: {
2215
2228
  readonly responseStream: false;
2216
2229
  readonly options: {};
2217
2230
  };
2218
- /**
2219
- * Answers the credential this engine holds: the API key `lace login`
2220
- * saved or `LACE_TOKEN` supplies, read fresh on every call so a `lace
2221
- * login` or `lace logout` takes effect at once (empty when signed out),
2222
- * beside the base URL of the API that key is for, the one the engine's
2223
- * own commands call (the CLI's `config.ResolveBaseURL`). The host
2224
- * that spawned the engine builds its own authenticated transport to
2225
- * Lace's API from the two, for the chat package, and never restates
2226
- * which API; the engine knows nothing of what the host does with them. Served, like every RPC,
2227
- * only to the bearer of the handshake's session token, and never
2228
- * forwarded across the webview bridge (`BRIDGE_METHODS`,
2229
- * @lace-cloud/proto's engine-bridge.ts).
2230
- */
2231
- readonly readCredential: {
2232
- readonly name: "ReadCredential";
2233
- readonly requestType: typeof Empty;
2234
- readonly requestStream: false;
2235
- readonly responseType: typeof ReadCredentialResponse;
2236
- readonly responseStream: false;
2237
- readonly options: {};
2238
- };
2239
2231
  /**
2240
2232
  * Session lifecycle. Never fails on a refused source tf — a refused tf
2241
2233
  * opens the session source-refused (`BundleState.source_refused`) with
@@ -2332,8 +2324,9 @@ declare const LaceEngineDefinition: {
2332
2324
  * Reads the output → input pairs the engine's matcher scores between the
2333
2325
  * instances of one module of a session's working IR: the pairs an
2334
2326
  * `auto_connect` chooses among, with the scores it chooses by. The
2335
- * matching rules have this one home; a client that picks a wire for a
2336
- * request in words ranks these and sends the pair as a `connect`.
2327
+ * matching rules have this one home; a client lists these pairs, best
2328
+ * first, for a connect whose pins it does not settle, and sends the pair
2329
+ * it is given as a `connect`.
2337
2330
  */
2338
2331
  readonly readWiringCandidates: {
2339
2332
  readonly name: "ReadWiringCandidates";
@@ -2374,7 +2367,7 @@ declare const LaceEngineDefinition: {
2374
2367
  *
2375
2368
  * Consumers (portal + extension canvas engines) project locally via
2376
2369
  * `@lace-cloud/proto`'s `projectCanvasView(bundle, arrangement?, meta)`.
2377
- * `arrangement` (node positions, group collapse/label) is consumer-owned
2370
+ * `arrangement` (node positions, group collapse) is consumer-owned
2378
2371
  * view state — it never travels over this RPC.
2379
2372
  */
2380
2373
  readonly subscribe: {
@@ -3462,9 +3455,9 @@ type CanvasSource = {
3462
3455
  ungenerated: boolean;
3463
3456
  conflict: SourceConflict | null;
3464
3457
  sourceRefused: boolean;
3458
+ generating: boolean;
3465
3459
  diagnostics: readonly Diagnostic$1[];
3466
3460
  treeHash: string;
3467
- revision: number;
3468
3461
  };
3469
3462
  type CommandResult = {
3470
3463
  path: string;
@@ -3511,7 +3504,7 @@ type GraphError = {
3511
3504
  /**
3512
3505
  * Names one child created by a mutation (placement, group creation, copy).
3513
3506
  * Mirrors the wire `CreatedRef` — clients key pending arrangement writes
3514
- * (position, group label/collapse) off these ids instead of diffing
3507
+ * (position, group collapse) off these ids instead of diffing
3515
3508
  * successive CanvasView frames to guess what changed.
3516
3509
  */
3517
3510
  type CreatedRef = {
@@ -3535,6 +3528,7 @@ type WiringCandidate = {
3535
3528
  };
3536
3529
  type WiringQuery = {
3537
3530
  scope: string;
3531
+ sourceScope: string;
3538
3532
  source?: string;
3539
3533
  target?: string;
3540
3534
  };
@@ -3543,7 +3537,6 @@ type ApplyResult = {
3543
3537
  errors: GraphError[];
3544
3538
  created: CreatedRef[];
3545
3539
  ties: WiringCandidate[];
3546
- revision?: number;
3547
3540
  };
3548
3541
  type EditorPort = {
3549
3542
  apply: (actions: readonly Action[]) => Promise<ApplyResult>;
@@ -3616,6 +3609,11 @@ type CanvasPorts = RunnerPorts & {
3616
3609
  };
3617
3610
  type PortName = keyof CanvasPorts;
3618
3611
 
3612
+ /** The type an action's `keys` hold: a key that starts with `Mod+`. It is the
3613
+ * grammar's prefix check alone — the type cannot spell an optional `Shift`
3614
+ * then one key — and `parseChord` refuses the rest at runtime. */
3615
+ type KeySpec = `Mod+${string}`;
3616
+
3619
3617
  type EdgeRef = {
3620
3618
  id: string;
3621
3619
  source: string;
@@ -3623,7 +3621,7 @@ type EdgeRef = {
3623
3621
  sourceOutput: string;
3624
3622
  targetInput: string;
3625
3623
  };
3626
- type ContextKey = 'root' | 'sessionId' | 'stack' | 'editable' | 'saved' | 'resolved' | 'selection.node' | 'selection.edge' | 'diagnostics';
3624
+ type ContextKey = 'root' | 'sessionId' | 'stack' | 'editable' | 'saved' | 'unsaved' | 'resolved' | 'conflict' | 'sourceRefused' | 'selection.node' | 'selection.edge' | 'diagnostics' | 'settingsOpen' | 'generateIdle' | 'generating' | 'ungenerated' | 'undoable' | 'redoable';
3627
3625
  type RunCtx = {
3628
3626
  root?: string;
3629
3627
  sessionId?: string;
@@ -3632,11 +3630,14 @@ type RunCtx = {
3632
3630
  type CanvasCtx = RunCtx & {
3633
3631
  ports: CanvasPorts;
3634
3632
  editable: boolean;
3633
+ generating: boolean;
3634
+ sourceRefused: boolean;
3635
3635
  view: CanvasView;
3636
3636
  selection: {
3637
3637
  nodes: readonly string[];
3638
3638
  edge: EdgeRef | null;
3639
3639
  };
3640
+ settingsOpen: boolean;
3640
3641
  diagnostics: readonly Diagnostic$1[];
3641
3642
  contributions: ContributionSet;
3642
3643
  };
@@ -3664,19 +3665,21 @@ type CommandRead<P extends BoundPath> = {
3664
3665
  type PanelSpec = {
3665
3666
  id: string;
3666
3667
  title: string;
3667
- slot: 'banner' | 'toolbar' | 'sidebar' | 'bottom' | 'inspector';
3668
+ slot: 'banner' | 'toolbar' | 'drawer' | 'bottom';
3668
3669
  requiredPorts: readonly PortName[];
3669
3670
  reads?: readonly {
3670
3671
  path: BoundPath;
3671
3672
  }[];
3672
3673
  requiredContext?: readonly ContextKey[];
3674
+ section?: string;
3673
3675
  };
3674
3676
  type ActionTarget = {
3675
3677
  nodeId?: string;
3678
+ groupId?: string;
3676
3679
  diagnostic?: Diagnostic$1;
3677
3680
  runId?: string;
3678
3681
  };
3679
- type Placement = 'toolbar' | 'node-menu' | {
3682
+ type Placement = 'toolbar' | 'node-menu' | 'pane-menu' | {
3680
3683
  row: string;
3681
3684
  };
3682
3685
  type ResultKind = 'run' | 'preview' | 'report' | 'notify' | 'follow';
@@ -3725,7 +3728,6 @@ type ClipboardStore = {
3725
3728
  clear: () => void;
3726
3729
  };
3727
3730
  type LayoutHandle = {
3728
- forcePositions: () => void;
3729
3731
  panIntoView: (rect: {
3730
3732
  x: number;
3731
3733
  y: number;
@@ -3779,11 +3781,21 @@ type ErasedCommand = {
3779
3781
  };
3780
3782
  declare const KEY_SCOPES: readonly ["surface", "app"];
3781
3783
  type KeyScope = (typeof KEY_SCOPES)[number];
3784
+ type ActionIcon = 'validate' | 'convert' | 'save' | 'generate' | 'undo' | 'redo' | 'clear';
3782
3785
  type ActionContribution = {
3783
3786
  id: string;
3784
3787
  label: string;
3785
- icon?: string;
3786
- keys?: readonly string[];
3788
+ icon?: ActionIcon;
3789
+ primary?: {
3790
+ when?: ContextKey;
3791
+ };
3792
+ busy?: {
3793
+ when: ContextKey;
3794
+ label: string;
3795
+ };
3796
+ section?: string;
3797
+ tone?: 'danger';
3798
+ keys?: readonly KeySpec[];
3787
3799
  /** Defaults to `surface`. */
3788
3800
  keyScope?: KeyScope;
3789
3801
  placement: Placement;
@@ -4042,4 +4054,4 @@ declare function openEngineCommands(caller: EngineCaller, { cwd }: {
4042
4054
  declare function openEngineSession(caller: DirectEngineCaller, target: EngineTarget, options?: EngineSessionOptions): Promise<EngineSession>;
4043
4055
  declare function openEngineSession(caller: BridgeEngineCaller, target: NonFixtureTarget, options?: EngineSessionOptions): Promise<EngineSession>;
4044
4056
 
4045
- export { type EngineSessionOptions as $, type ActionContribution as A, type Badge as B, type ContributionSet as C, type Decorations as D, type EdgeRef as E, type CommandsPort as F, type ConfirmSpec as G, type ConnectCallerOptions as H, ConnectError as I, type JsonOf as J, type ContextKey as K, type LayoutHandle as L, type ContextPort as M, type CreatedRef as N, type OverlayContribution as O, type PanelSpec as P, type DirectEngineCaller as Q, type ResultStore as R, type SourcePort as S, EMPTY_REPORT_FOLD as T, type EditorBinding as U, type EditorEnv as V, type EditorEnvExtras as W, type EditorPort as X, type EngineCaller as Y, type EngineMethodResponse as Z, type EngineSession as _, type CanvasCtx as a, settleRun as a$, type EngineTarget as a0, type ErasedCommand as a1, type FollowSlot as a2, type GenerateEvent as a3, type GraphError as a4, type HostBinding as a5, type Invocation as a6, type NodeDecoration as a7, type Placement as a8, type PortName as a9, createResultStore as aA, currentReport as aB, defineCommand as aC, diagnosticsOf as aD, foldReport as aE, isBoundPath as aF, openEngineCommands as aG, openEngineSession as aH, parseBound as aI, parseCommandFailure as aJ, reportDiagnostics as aK, toArgv as aL, uniqueDiagnostics as aM, Action as aN, InputMode as aO, type LaceReason as aP, type LiveSlots as aQ, type OnScreen as aR, type RunPhase as aS, type RunPhaseStatus as aT, diagnosticsOfDocument as aU, liveSlots as aV, reasonWire as aW, reduceFollow as aX, reducePreview as aY, reduceReport as aZ, reduceRun as a_, type PresenterPort as aa, type PreviewSlot as ab, Reason as ac, type ReportEntry as ad, type ReportFold as ae, type ReportPath as af, type ReportSlot as ag, type ResultKind as ah, type ResultSlots as ai, type RunOutcome as aj, type RunSlot as ak, type RunnerPorts as al, SCHEMAS as am, type Sink as an, type SinkInput as ao, type SlotContext as ap, type SlotKind as aq, type SourceConflict as ar, type StackRef as as, type ViewStatePort as at, type WiringCandidate as au, type WiringQuery as av, bridgeCaller as aw, carriesFailure as ax, connectCaller as ay, createActionRunner as az, type CanvasPorts as b, type PendingForm as c, type BoundPath as d, type CommandRead as e, type ActionTarget as f, type CommandResult as g, type CanvasSource as h, type SourceEnd as i, type RunCtx as j, Bundle as k, type ActionRunner as l, type ActionRunnerOptions as m, type ApplyResult as n, ApplyUnobservedError as o, type ArgsOf as p, type BindingRuntime as q, type BridgeEngineCaller as r, COMMANDS as s, type ClipboardStore as t, type CommandBinding as u, CommandDetachedError as v, CommandExitError as w, type CommandFailure as x, type CommandPath as y, type CommandRun as z };
4057
+ export { type EngineMethodResponse as $, type ActionContribution as A, type Badge as B, type ContributionSet as C, type Decorations as D, type EdgeRef as E, type CommandRun as F, type CommandsPort as G, type ConfirmSpec as H, type ConnectCallerOptions as I, type JsonOf as J, ConnectError as K, type LayoutHandle as L, type ContextKey as M, type NodeDecoration as N, type OverlayContribution as O, type PanelSpec as P, type ContextPort as Q, type ResultStore as R, type SourcePort as S, type CreatedRef as T, type DirectEngineCaller as U, EMPTY_REPORT_FOLD as V, type EditorBinding as W, type EditorEnv as X, type EditorEnvExtras as Y, type EditorPort as Z, type EngineCaller as _, type CanvasCtx as a, reduceReport as a$, type EngineSession as a0, type EngineSessionOptions as a1, type EngineTarget as a2, type ErasedCommand as a3, type FollowSlot as a4, type GenerateEvent as a5, type GraphError as a6, type HostBinding as a7, type Invocation as a8, type KeySpec as a9, connectCaller as aA, createActionRunner as aB, createResultStore as aC, currentReport as aD, defineCommand as aE, diagnosticsOf as aF, foldReport as aG, isBoundPath as aH, openEngineCommands as aI, openEngineSession as aJ, parseBound as aK, parseCommandFailure as aL, reportDiagnostics as aM, toArgv as aN, uniqueDiagnostics as aO, Action as aP, InputMode as aQ, type LaceReason as aR, type LiveSlots as aS, type OnScreen as aT, type RunPhase as aU, type RunPhaseStatus as aV, diagnosticsOfDocument as aW, liveSlots as aX, reasonWire as aY, reduceFollow as aZ, reducePreview as a_, type Placement as aa, type PortName as ab, type PresenterPort as ac, type PreviewSlot as ad, Reason as ae, type ReportEntry as af, type ReportFold as ag, type ReportPath as ah, type ReportSlot as ai, type ResultKind as aj, type ResultSlots as ak, type RunOutcome as al, type RunSlot as am, type RunnerPorts as an, SCHEMAS as ao, type Sink as ap, type SinkInput as aq, type SlotContext as ar, type SlotKind as as, type SourceConflict as at, type StackRef as au, type ViewStatePort as av, type WiringCandidate as aw, type WiringQuery as ax, bridgeCaller as ay, carriesFailure as az, type CanvasPorts as b, reduceRun as b0, settleRun as b1, type PendingForm as c, type BoundPath as d, type CommandRead as e, type ActionTarget as f, type CommandResult as g, type CanvasSource as h, type SourceEnd as i, type RunCtx as j, Bundle as k, type ActionRunner as l, type ActionIcon as m, type ActionRunnerOptions as n, type ApplyResult as o, ApplyUnobservedError as p, type ArgsOf as q, type BindingRuntime as r, type BridgeEngineCaller as s, COMMANDS as t, type ClipboardStore as u, type CommandBinding as v, CommandDetachedError as w, CommandExitError as x, type CommandFailure as y, type CommandPath as z };
@@ -1455,6 +1455,8 @@ declare enum Reason {
1455
1455
  * REASON_CROSS_SCOPE - ApplyAction: a wire whose source and target are owned by different
1456
1456
  * modules crosses a group's boundary, which no single-scope edit makes.
1457
1457
  * It is a refusal of the batch's content, carried on its GraphError.
1458
+ * ReadWiringCandidates: a read whose two scopes differ, refused
1459
+ * (FailedPrecondition) as such a wire is.
1458
1460
  */
1459
1461
  REASON_CROSS_SCOPE = 15,
1460
1462
  /**
@@ -1509,13 +1511,6 @@ interface ShutdownResponse {
1509
1511
  status: string;
1510
1512
  }
1511
1513
  declare const ShutdownResponse: MessageFns<ShutdownResponse>;
1512
- interface ReadCredentialResponse {
1513
- /** empty when signed out */
1514
- api_key: string;
1515
- /** the API the engine's own commands call */
1516
- api_base_url: string;
1517
- }
1518
- declare const ReadCredentialResponse: MessageFns<ReadCredentialResponse>;
1519
1514
  interface SessionOpenRequest {
1520
1515
  ephemeral?: EphemeralSession | undefined;
1521
1516
  root?: RootSession | undefined;
@@ -1696,10 +1691,11 @@ interface CopyInstancesAction {
1696
1691
  }
1697
1692
  declare const CopyInstancesAction: MessageFns<CopyInstancesAction>;
1698
1693
  /**
1699
- * CreateGroupAction creates a new visual group from selected nodes. The
1700
- * group's display label is consumer-owned arrangement state (written from
1701
- * `BundleApplyResult.created` after this action lands); the wire payload
1702
- * carries only membership.
1694
+ * CreateGroupAction creates a new group from selected nodes. The wire
1695
+ * payload carries only membership: the engine names the group (the
1696
+ * scope's next free group_<n>, its one name) and reports it in
1697
+ * `BundleApplyResult.created`, and where the group is drawn and whether
1698
+ * it is collapsed are consumer-owned arrangement state.
1703
1699
  */
1704
1700
  interface CreateGroupAction {
1705
1701
  node_ids: string[];
@@ -1843,6 +1839,12 @@ interface WiringCandidate$1 {
1843
1839
  score: number;
1844
1840
  }
1845
1841
  declare const WiringCandidate$1: MessageFns<WiringCandidate$1>;
1842
+ /**
1843
+ * A read names its two ends as a connect does: `scope` owns the targets and
1844
+ * `source_scope` the sources, both required. A read whose two scopes
1845
+ * differ is refused (FailedPrecondition, `REASON_CROSS_SCOPE`) as a wire
1846
+ * across them is: the matcher pairs the instances of one module only.
1847
+ */
1846
1848
  interface ReadWiringCandidatesRequest {
1847
1849
  session_id: string;
1848
1850
  /** The key of the module whose instances are matched (an action's `scope`). */
@@ -1857,6 +1859,8 @@ interface ReadWiringCandidatesRequest {
1857
1859
  * every instance of the scope is a target.
1858
1860
  */
1859
1861
  target_instance?: string | undefined;
1862
+ /** The key of the module that owns the sources (a wire's `source_scope`). */
1863
+ source_scope: string;
1860
1864
  }
1861
1865
  declare const ReadWiringCandidatesRequest: MessageFns<ReadWiringCandidatesRequest>;
1862
1866
  interface ReadWiringCandidatesResponse {
@@ -1999,7 +2003,7 @@ declare const BundleStateEvent: MessageFns<BundleStateEvent>;
1999
2003
  * tree. Consumers (VS Code extension, portal, tests) project this
2000
2004
  * locally via the proto package's `projectCanvasView(bundle,
2001
2005
  * arrangement?, meta)` to produce a renderable CanvasView —
2002
- * `arrangement` (node positions, group collapse/label) is
2006
+ * `arrangement` (node positions, group collapse) is
2003
2007
  * consumer-owned view state and never travels here.
2004
2008
  *
2005
2009
  * Not to be confused with the `bundle_snapshot` API entity, which is
@@ -2053,6 +2057,15 @@ interface BundleState {
2053
2057
  * holds already shows a batch it applied.
2054
2058
  */
2055
2059
  revision: number;
2060
+ /**
2061
+ * True while a Generate holds the session's one Generate: from the moment
2062
+ * SessionGenerate takes it until the call answers — the tree's write and
2063
+ * the module validate that certifies it. The session publishes a frame
2064
+ * when it is taken and when it is released, so a subscriber that joins
2065
+ * mid-Generate starts with it set, and a second SessionGenerate in that
2066
+ * window is refused (FailedPrecondition).
2067
+ */
2068
+ generating: boolean;
2056
2069
  }
2057
2070
  declare const BundleState: MessageFns<BundleState>;
2058
2071
  /**
@@ -2091,7 +2104,7 @@ declare const BundleApplyResult: MessageFns<BundleApplyResult>;
2091
2104
  /**
2092
2105
  * CreatedRef names one child created by an action (PlaceModule,
2093
2106
  * CreateGroup, CopyInstances, ...). Clients key pending arrangement
2094
- * writes (position, group label/collapse) off these IDs instead of
2107
+ * writes (position, group collapse) off these IDs instead of
2095
2108
  * diffing BundleState frames.
2096
2109
  */
2097
2110
  interface CreatedRef$1 {
@@ -2215,27 +2228,6 @@ declare const LaceEngineDefinition: {
2215
2228
  readonly responseStream: false;
2216
2229
  readonly options: {};
2217
2230
  };
2218
- /**
2219
- * Answers the credential this engine holds: the API key `lace login`
2220
- * saved or `LACE_TOKEN` supplies, read fresh on every call so a `lace
2221
- * login` or `lace logout` takes effect at once (empty when signed out),
2222
- * beside the base URL of the API that key is for, the one the engine's
2223
- * own commands call (the CLI's `config.ResolveBaseURL`). The host
2224
- * that spawned the engine builds its own authenticated transport to
2225
- * Lace's API from the two, for the chat package, and never restates
2226
- * which API; the engine knows nothing of what the host does with them. Served, like every RPC,
2227
- * only to the bearer of the handshake's session token, and never
2228
- * forwarded across the webview bridge (`BRIDGE_METHODS`,
2229
- * @lace-cloud/proto's engine-bridge.ts).
2230
- */
2231
- readonly readCredential: {
2232
- readonly name: "ReadCredential";
2233
- readonly requestType: typeof Empty;
2234
- readonly requestStream: false;
2235
- readonly responseType: typeof ReadCredentialResponse;
2236
- readonly responseStream: false;
2237
- readonly options: {};
2238
- };
2239
2231
  /**
2240
2232
  * Session lifecycle. Never fails on a refused source tf — a refused tf
2241
2233
  * opens the session source-refused (`BundleState.source_refused`) with
@@ -2332,8 +2324,9 @@ declare const LaceEngineDefinition: {
2332
2324
  * Reads the output → input pairs the engine's matcher scores between the
2333
2325
  * instances of one module of a session's working IR: the pairs an
2334
2326
  * `auto_connect` chooses among, with the scores it chooses by. The
2335
- * matching rules have this one home; a client that picks a wire for a
2336
- * request in words ranks these and sends the pair as a `connect`.
2327
+ * matching rules have this one home; a client lists these pairs, best
2328
+ * first, for a connect whose pins it does not settle, and sends the pair
2329
+ * it is given as a `connect`.
2337
2330
  */
2338
2331
  readonly readWiringCandidates: {
2339
2332
  readonly name: "ReadWiringCandidates";
@@ -2374,7 +2367,7 @@ declare const LaceEngineDefinition: {
2374
2367
  *
2375
2368
  * Consumers (portal + extension canvas engines) project locally via
2376
2369
  * `@lace-cloud/proto`'s `projectCanvasView(bundle, arrangement?, meta)`.
2377
- * `arrangement` (node positions, group collapse/label) is consumer-owned
2370
+ * `arrangement` (node positions, group collapse) is consumer-owned
2378
2371
  * view state — it never travels over this RPC.
2379
2372
  */
2380
2373
  readonly subscribe: {
@@ -3462,9 +3455,9 @@ type CanvasSource = {
3462
3455
  ungenerated: boolean;
3463
3456
  conflict: SourceConflict | null;
3464
3457
  sourceRefused: boolean;
3458
+ generating: boolean;
3465
3459
  diagnostics: readonly Diagnostic$1[];
3466
3460
  treeHash: string;
3467
- revision: number;
3468
3461
  };
3469
3462
  type CommandResult = {
3470
3463
  path: string;
@@ -3511,7 +3504,7 @@ type GraphError = {
3511
3504
  /**
3512
3505
  * Names one child created by a mutation (placement, group creation, copy).
3513
3506
  * Mirrors the wire `CreatedRef` — clients key pending arrangement writes
3514
- * (position, group label/collapse) off these ids instead of diffing
3507
+ * (position, group collapse) off these ids instead of diffing
3515
3508
  * successive CanvasView frames to guess what changed.
3516
3509
  */
3517
3510
  type CreatedRef = {
@@ -3535,6 +3528,7 @@ type WiringCandidate = {
3535
3528
  };
3536
3529
  type WiringQuery = {
3537
3530
  scope: string;
3531
+ sourceScope: string;
3538
3532
  source?: string;
3539
3533
  target?: string;
3540
3534
  };
@@ -3543,7 +3537,6 @@ type ApplyResult = {
3543
3537
  errors: GraphError[];
3544
3538
  created: CreatedRef[];
3545
3539
  ties: WiringCandidate[];
3546
- revision?: number;
3547
3540
  };
3548
3541
  type EditorPort = {
3549
3542
  apply: (actions: readonly Action[]) => Promise<ApplyResult>;
@@ -3616,6 +3609,11 @@ type CanvasPorts = RunnerPorts & {
3616
3609
  };
3617
3610
  type PortName = keyof CanvasPorts;
3618
3611
 
3612
+ /** The type an action's `keys` hold: a key that starts with `Mod+`. It is the
3613
+ * grammar's prefix check alone — the type cannot spell an optional `Shift`
3614
+ * then one key — and `parseChord` refuses the rest at runtime. */
3615
+ type KeySpec = `Mod+${string}`;
3616
+
3619
3617
  type EdgeRef = {
3620
3618
  id: string;
3621
3619
  source: string;
@@ -3623,7 +3621,7 @@ type EdgeRef = {
3623
3621
  sourceOutput: string;
3624
3622
  targetInput: string;
3625
3623
  };
3626
- type ContextKey = 'root' | 'sessionId' | 'stack' | 'editable' | 'saved' | 'resolved' | 'selection.node' | 'selection.edge' | 'diagnostics';
3624
+ type ContextKey = 'root' | 'sessionId' | 'stack' | 'editable' | 'saved' | 'unsaved' | 'resolved' | 'conflict' | 'sourceRefused' | 'selection.node' | 'selection.edge' | 'diagnostics' | 'settingsOpen' | 'generateIdle' | 'generating' | 'ungenerated' | 'undoable' | 'redoable';
3627
3625
  type RunCtx = {
3628
3626
  root?: string;
3629
3627
  sessionId?: string;
@@ -3632,11 +3630,14 @@ type RunCtx = {
3632
3630
  type CanvasCtx = RunCtx & {
3633
3631
  ports: CanvasPorts;
3634
3632
  editable: boolean;
3633
+ generating: boolean;
3634
+ sourceRefused: boolean;
3635
3635
  view: CanvasView;
3636
3636
  selection: {
3637
3637
  nodes: readonly string[];
3638
3638
  edge: EdgeRef | null;
3639
3639
  };
3640
+ settingsOpen: boolean;
3640
3641
  diagnostics: readonly Diagnostic$1[];
3641
3642
  contributions: ContributionSet;
3642
3643
  };
@@ -3664,19 +3665,21 @@ type CommandRead<P extends BoundPath> = {
3664
3665
  type PanelSpec = {
3665
3666
  id: string;
3666
3667
  title: string;
3667
- slot: 'banner' | 'toolbar' | 'sidebar' | 'bottom' | 'inspector';
3668
+ slot: 'banner' | 'toolbar' | 'drawer' | 'bottom';
3668
3669
  requiredPorts: readonly PortName[];
3669
3670
  reads?: readonly {
3670
3671
  path: BoundPath;
3671
3672
  }[];
3672
3673
  requiredContext?: readonly ContextKey[];
3674
+ section?: string;
3673
3675
  };
3674
3676
  type ActionTarget = {
3675
3677
  nodeId?: string;
3678
+ groupId?: string;
3676
3679
  diagnostic?: Diagnostic$1;
3677
3680
  runId?: string;
3678
3681
  };
3679
- type Placement = 'toolbar' | 'node-menu' | {
3682
+ type Placement = 'toolbar' | 'node-menu' | 'pane-menu' | {
3680
3683
  row: string;
3681
3684
  };
3682
3685
  type ResultKind = 'run' | 'preview' | 'report' | 'notify' | 'follow';
@@ -3725,7 +3728,6 @@ type ClipboardStore = {
3725
3728
  clear: () => void;
3726
3729
  };
3727
3730
  type LayoutHandle = {
3728
- forcePositions: () => void;
3729
3731
  panIntoView: (rect: {
3730
3732
  x: number;
3731
3733
  y: number;
@@ -3779,11 +3781,21 @@ type ErasedCommand = {
3779
3781
  };
3780
3782
  declare const KEY_SCOPES: readonly ["surface", "app"];
3781
3783
  type KeyScope = (typeof KEY_SCOPES)[number];
3784
+ type ActionIcon = 'validate' | 'convert' | 'save' | 'generate' | 'undo' | 'redo' | 'clear';
3782
3785
  type ActionContribution = {
3783
3786
  id: string;
3784
3787
  label: string;
3785
- icon?: string;
3786
- keys?: readonly string[];
3788
+ icon?: ActionIcon;
3789
+ primary?: {
3790
+ when?: ContextKey;
3791
+ };
3792
+ busy?: {
3793
+ when: ContextKey;
3794
+ label: string;
3795
+ };
3796
+ section?: string;
3797
+ tone?: 'danger';
3798
+ keys?: readonly KeySpec[];
3787
3799
  /** Defaults to `surface`. */
3788
3800
  keyScope?: KeyScope;
3789
3801
  placement: Placement;
@@ -4042,4 +4054,4 @@ declare function openEngineCommands(caller: EngineCaller, { cwd }: {
4042
4054
  declare function openEngineSession(caller: DirectEngineCaller, target: EngineTarget, options?: EngineSessionOptions): Promise<EngineSession>;
4043
4055
  declare function openEngineSession(caller: BridgeEngineCaller, target: NonFixtureTarget, options?: EngineSessionOptions): Promise<EngineSession>;
4044
4056
 
4045
- export { type EngineSessionOptions as $, type ActionContribution as A, type Badge as B, type ContributionSet as C, type Decorations as D, type EdgeRef as E, type CommandsPort as F, type ConfirmSpec as G, type ConnectCallerOptions as H, ConnectError as I, type JsonOf as J, type ContextKey as K, type LayoutHandle as L, type ContextPort as M, type CreatedRef as N, type OverlayContribution as O, type PanelSpec as P, type DirectEngineCaller as Q, type ResultStore as R, type SourcePort as S, EMPTY_REPORT_FOLD as T, type EditorBinding as U, type EditorEnv as V, type EditorEnvExtras as W, type EditorPort as X, type EngineCaller as Y, type EngineMethodResponse as Z, type EngineSession as _, type CanvasCtx as a, settleRun as a$, type EngineTarget as a0, type ErasedCommand as a1, type FollowSlot as a2, type GenerateEvent as a3, type GraphError as a4, type HostBinding as a5, type Invocation as a6, type NodeDecoration as a7, type Placement as a8, type PortName as a9, createResultStore as aA, currentReport as aB, defineCommand as aC, diagnosticsOf as aD, foldReport as aE, isBoundPath as aF, openEngineCommands as aG, openEngineSession as aH, parseBound as aI, parseCommandFailure as aJ, reportDiagnostics as aK, toArgv as aL, uniqueDiagnostics as aM, Action as aN, InputMode as aO, type LaceReason as aP, type LiveSlots as aQ, type OnScreen as aR, type RunPhase as aS, type RunPhaseStatus as aT, diagnosticsOfDocument as aU, liveSlots as aV, reasonWire as aW, reduceFollow as aX, reducePreview as aY, reduceReport as aZ, reduceRun as a_, type PresenterPort as aa, type PreviewSlot as ab, Reason as ac, type ReportEntry as ad, type ReportFold as ae, type ReportPath as af, type ReportSlot as ag, type ResultKind as ah, type ResultSlots as ai, type RunOutcome as aj, type RunSlot as ak, type RunnerPorts as al, SCHEMAS as am, type Sink as an, type SinkInput as ao, type SlotContext as ap, type SlotKind as aq, type SourceConflict as ar, type StackRef as as, type ViewStatePort as at, type WiringCandidate as au, type WiringQuery as av, bridgeCaller as aw, carriesFailure as ax, connectCaller as ay, createActionRunner as az, type CanvasPorts as b, type PendingForm as c, type BoundPath as d, type CommandRead as e, type ActionTarget as f, type CommandResult as g, type CanvasSource as h, type SourceEnd as i, type RunCtx as j, Bundle as k, type ActionRunner as l, type ActionRunnerOptions as m, type ApplyResult as n, ApplyUnobservedError as o, type ArgsOf as p, type BindingRuntime as q, type BridgeEngineCaller as r, COMMANDS as s, type ClipboardStore as t, type CommandBinding as u, CommandDetachedError as v, CommandExitError as w, type CommandFailure as x, type CommandPath as y, type CommandRun as z };
4057
+ export { type EngineMethodResponse as $, type ActionContribution as A, type Badge as B, type ContributionSet as C, type Decorations as D, type EdgeRef as E, type CommandRun as F, type CommandsPort as G, type ConfirmSpec as H, type ConnectCallerOptions as I, type JsonOf as J, ConnectError as K, type LayoutHandle as L, type ContextKey as M, type NodeDecoration as N, type OverlayContribution as O, type PanelSpec as P, type ContextPort as Q, type ResultStore as R, type SourcePort as S, type CreatedRef as T, type DirectEngineCaller as U, EMPTY_REPORT_FOLD as V, type EditorBinding as W, type EditorEnv as X, type EditorEnvExtras as Y, type EditorPort as Z, type EngineCaller as _, type CanvasCtx as a, reduceReport as a$, type EngineSession as a0, type EngineSessionOptions as a1, type EngineTarget as a2, type ErasedCommand as a3, type FollowSlot as a4, type GenerateEvent as a5, type GraphError as a6, type HostBinding as a7, type Invocation as a8, type KeySpec as a9, connectCaller as aA, createActionRunner as aB, createResultStore as aC, currentReport as aD, defineCommand as aE, diagnosticsOf as aF, foldReport as aG, isBoundPath as aH, openEngineCommands as aI, openEngineSession as aJ, parseBound as aK, parseCommandFailure as aL, reportDiagnostics as aM, toArgv as aN, uniqueDiagnostics as aO, Action as aP, InputMode as aQ, type LaceReason as aR, type LiveSlots as aS, type OnScreen as aT, type RunPhase as aU, type RunPhaseStatus as aV, diagnosticsOfDocument as aW, liveSlots as aX, reasonWire as aY, reduceFollow as aZ, reducePreview as a_, type Placement as aa, type PortName as ab, type PresenterPort as ac, type PreviewSlot as ad, Reason as ae, type ReportEntry as af, type ReportFold as ag, type ReportPath as ah, type ReportSlot as ai, type ResultKind as aj, type ResultSlots as ak, type RunOutcome as al, type RunSlot as am, type RunnerPorts as an, SCHEMAS as ao, type Sink as ap, type SinkInput as aq, type SlotContext as ar, type SlotKind as as, type SourceConflict as at, type StackRef as au, type ViewStatePort as av, type WiringCandidate as aw, type WiringQuery as ax, bridgeCaller as ay, carriesFailure as az, type CanvasPorts as b, reduceRun as b0, settleRun as b1, type PendingForm as c, type BoundPath as d, type CommandRead as e, type ActionTarget as f, type CommandResult as g, type CanvasSource as h, type SourceEnd as i, type RunCtx as j, Bundle as k, type ActionRunner as l, type ActionIcon as m, type ActionRunnerOptions as n, type ApplyResult as o, ApplyUnobservedError as p, type ArgsOf as q, type BindingRuntime as r, type BridgeEngineCaller as s, COMMANDS as t, type ClipboardStore as u, type CommandBinding as v, CommandDetachedError as w, CommandExitError as x, type CommandFailure as y, type CommandPath as z };