@lace-cloud/canvas 0.24.0 → 0.26.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.
@@ -1520,11 +1520,15 @@ declare enum ConflictChoice {
1520
1520
  * failure Lace decided sets `reason`; one the API decided sets `api_code`
1521
1521
  * to the API's own closed code, passed through unchanged, with the status
1522
1522
  * code that HTTP status maps to, and `reason` where that code has one
1523
- * (`REASON_UNAUTHENTICATED` for the API's `unauthenticated`).
1523
+ * (`REASON_UNAUTHENTICATED` for the API's `unauthenticated`), and
1524
+ * `request_id` to the id the API answered the refused request with, when
1525
+ * it named one: the id a person quotes to Lace's support. The status
1526
+ * message is the sentence the API wrote; neither field is spelled into it.
1524
1527
  */
1525
1528
  interface ReasonDetail {
1526
1529
  reason: Reason;
1527
1530
  api_code: string;
1531
+ request_id: string;
1528
1532
  }
1529
1533
  declare const ReasonDetail: MessageFns<ReasonDetail>;
1530
1534
  interface InitializeRequest {
@@ -2019,8 +2023,22 @@ declare const InvokeRequest: MessageFns<InvokeRequest>;
2019
2023
  interface InvokeEvent {
2020
2024
  json?: string | undefined;
2021
2025
  exit?: InvokeExit | undefined;
2026
+ /**
2027
+ * The engine accepted the request and runs the command: sent exactly
2028
+ * once, before any `json` or `exit`. A stream that fails before it
2029
+ * never ran the command; one that fails after it and before `exit` ran
2030
+ * the command to an outcome its client never received.
2031
+ */
2032
+ started?: InvokeStarted | undefined;
2022
2033
  }
2023
2034
  declare const InvokeEvent: MessageFns<InvokeEvent>;
2035
+ /**
2036
+ * An Invoke's command is running. It carries nothing: its arrival is the
2037
+ * fact.
2038
+ */
2039
+ interface InvokeStarted {
2040
+ }
2041
+ declare const InvokeStarted: MessageFns<InvokeStarted>;
2024
2042
  interface InvokeExit {
2025
2043
  code: number;
2026
2044
  /** tail ≤ 8 KiB */
@@ -2479,8 +2497,9 @@ declare const LaceEngineDefinition: {
2479
2497
  readonly options: {};
2480
2498
  };
2481
2499
  /**
2482
- * Runs one CLI command in-process against a fresh command tree. The command's `-o json` output is the stream:
2483
- * each top-level JSON value on stdout is one `json` event; `exit` is always last.
2500
+ * Runs one CLI command in-process against a fresh command tree. `started` is first, once the engine has accepted
2501
+ * the request and before the command runs; the command's `-o json` output follows: each top-level JSON value on
2502
+ * stdout is one `json` event; `exit` is always last.
2484
2503
  */
2485
2504
  readonly invoke: {
2486
2505
  readonly name: "Invoke";
@@ -2557,6 +2576,7 @@ declare const commandFailureSchema: z.ZodObject<{
2557
2576
  }, z.core.$strip>>>;
2558
2577
  addresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
2559
2578
  apiCode: z.ZodOptional<z.ZodString>;
2579
+ requestId: z.ZodOptional<z.ZodString>;
2560
2580
  }, z.core.$strict>;
2561
2581
  type CommandFailure = z.infer<typeof commandFailureSchema>;
2562
2582
  declare const gateChangeRequestSchema: z.ZodObject<{
@@ -2650,6 +2670,7 @@ declare const SCHEMAS: {
2650
2670
  }, z.core.$strip>>>;
2651
2671
  addresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
2652
2672
  apiCode: z.ZodOptional<z.ZodString>;
2673
+ requestId: z.ZodOptional<z.ZodString>;
2653
2674
  }, z.core.$strict>>;
2654
2675
  diagnostics: z.ZodArray<z.ZodObject<{
2655
2676
  severity: z.ZodEnum<{
@@ -2731,6 +2752,7 @@ declare const SCHEMAS: {
2731
2752
  }, z.core.$strip>>>;
2732
2753
  addresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
2733
2754
  apiCode: z.ZodOptional<z.ZodString>;
2755
+ requestId: z.ZodOptional<z.ZodString>;
2734
2756
  }, z.core.$strict>>;
2735
2757
  diagnostics: z.ZodArray<z.ZodObject<{
2736
2758
  severity: z.ZodEnum<{
@@ -3344,6 +3366,7 @@ declare const SCHEMAS: {
3344
3366
  driftCount: z.ZodNumber;
3345
3367
  scannedAt: z.ZodString;
3346
3368
  undeterminedReason: z.ZodNullable<z.ZodString>;
3369
+ undeterminedMessage: z.ZodNullable<z.ZodString>;
3347
3370
  standingDriftFindings: z.ZodNumber;
3348
3371
  footprintDestroyed: z.ZodBoolean;
3349
3372
  drift: z.ZodNullable<z.ZodObject<{
@@ -3412,18 +3435,9 @@ declare const SCHEMAS: {
3412
3435
  }, z.core.$strip>>;
3413
3436
  }, z.core.$strip>;
3414
3437
  'stack import': z.ZodObject<{
3415
- stack: z.ZodObject<{
3416
- id: z.ZodString;
3417
- slug: z.ZodString;
3418
- }, z.core.$strip>;
3438
+ changed: z.ZodBoolean;
3419
3439
  written: z.ZodArray<z.ZodString>;
3420
3440
  removed: z.ZodArray<z.ZodString>;
3421
- importBlocks: z.ZodNumber;
3422
- importResiduals: z.ZodArray<z.ZodObject<{
3423
- address: z.ZodString;
3424
- type: z.ZodString;
3425
- reason: z.ZodString;
3426
- }, z.core.$strip>>;
3427
3441
  validate: z.ZodObject<{
3428
3442
  root: z.ZodOptional<z.ZodString>;
3429
3443
  treeHash: z.ZodOptional<z.ZodString>;
@@ -3484,6 +3498,7 @@ declare const SCHEMAS: {
3484
3498
  }, z.core.$strip>>>;
3485
3499
  addresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
3486
3500
  apiCode: z.ZodOptional<z.ZodString>;
3501
+ requestId: z.ZodOptional<z.ZodString>;
3487
3502
  }, z.core.$strict>>;
3488
3503
  diagnostics: z.ZodArray<z.ZodObject<{
3489
3504
  severity: z.ZodEnum<{
@@ -3501,6 +3516,31 @@ declare const SCHEMAS: {
3501
3516
  column: z.ZodOptional<z.ZodNumber>;
3502
3517
  }, z.core.$strip>>;
3503
3518
  }, z.core.$strip>;
3519
+ diagnostics: z.ZodArray<z.ZodObject<{
3520
+ severity: z.ZodEnum<{
3521
+ error: "error";
3522
+ warning: "warning";
3523
+ info: "info";
3524
+ }>;
3525
+ code: z.ZodOptional<z.ZodString>;
3526
+ message: z.ZodString;
3527
+ moduleKey: z.ZodOptional<z.ZodString>;
3528
+ instanceId: z.ZodOptional<z.ZodString>;
3529
+ inputName: z.ZodOptional<z.ZodString>;
3530
+ file: z.ZodOptional<z.ZodString>;
3531
+ line: z.ZodOptional<z.ZodNumber>;
3532
+ column: z.ZodOptional<z.ZodNumber>;
3533
+ }, z.core.$strip>>;
3534
+ stack: z.ZodObject<{
3535
+ id: z.ZodString;
3536
+ slug: z.ZodString;
3537
+ }, z.core.$strip>;
3538
+ importBlocks: z.ZodNumber;
3539
+ importResiduals: z.ZodArray<z.ZodObject<{
3540
+ address: z.ZodString;
3541
+ type: z.ZodString;
3542
+ reason: z.ZodString;
3543
+ }, z.core.$strip>>;
3504
3544
  }, z.core.$strip>;
3505
3545
  'run get': z.ZodObject<{
3506
3546
  id: z.ZodString;
@@ -3832,6 +3872,7 @@ declare class ConnectError extends Error {
3832
3872
  readonly code: string;
3833
3873
  readonly reason: Reason;
3834
3874
  readonly apiCode: string | undefined;
3875
+ readonly requestId: string | undefined;
3835
3876
  constructor(code: string, message: string, detail?: ReasonDetail);
3836
3877
  }
3837
3878
  declare class CommandDetachedError extends Error {
@@ -4181,8 +4222,27 @@ type SlotValues = {
4181
4222
  type ReadOver<S> = (NonNullable<S> & {
4182
4223
  readOver: SlotContext;
4183
4224
  }) | null;
4225
+ type RunningMark = {
4226
+ token: object;
4227
+ path: BoundPath;
4228
+ label: string;
4229
+ };
4184
4230
  type ResultSlots = {
4185
4231
  [K in SlotKind]: ReadOver<SlotValues[K]>;
4232
+ } & {
4233
+ running: ReadonlyMap<string, RunningMark>;
4234
+ };
4235
+ type Started = {
4236
+ target: ActionTarget;
4237
+ on: string;
4238
+ path: BoundPath;
4239
+ label: string;
4240
+ };
4241
+ type Busy = {
4242
+ kind: 'run';
4243
+ } | {
4244
+ kind: 'notify';
4245
+ running: RunningMark;
4186
4246
  };
4187
4247
  type LiveSlots = Omit<ResultSlots, 'report'> & {
4188
4248
  report: ReportFold | null;
@@ -4190,6 +4250,16 @@ type LiveSlots = Omit<ResultSlots, 'report'> & {
4190
4250
 
4191
4251
  declare function liveSlots(slots: ResultSlots, current: OnScreen): LiveSlots;
4192
4252
  declare function reduceRun(prev: RunSlot, token: object, event: JsonOf<'stack apply'>): RunSlot;
4253
+ type FailedCommand = {
4254
+ kind: 'read';
4255
+ path: BoundPath;
4256
+ } | {
4257
+ kind: 'write';
4258
+ };
4259
+ declare function failureSays(error: unknown, command: FailedCommand): {
4260
+ message: string;
4261
+ failure?: CommandFailure;
4262
+ };
4193
4263
  declare function settleRun(prev: RunSlot, token: object, error: unknown): RunSlot;
4194
4264
  declare function reducePreview(_prev: PreviewSlot, token: object, event: JsonOf<'stack preview'>): PreviewSlot;
4195
4265
  declare function reduceReport(prev: ReportSlot, session: object, result: CommandResult): ReportSlot;
@@ -4200,9 +4270,9 @@ type ResultStore = {
4200
4270
  subscribe(listener: () => void): () => void;
4201
4271
  write<K extends SlotKind>(kind: K, token: object, value: SinkInput[K], readOver: SlotContext): void;
4202
4272
  fail(kind: ResultKind, token: object, error: unknown): boolean;
4203
- begin(kind: ResultKind, token: object, readOver: SlotContext, target: ActionTarget): void;
4273
+ begin(kind: ResultKind, token: object, readOver: SlotContext, started: Started): void;
4204
4274
  detach<K extends ResultKind>(kind: K, token: object): void;
4205
- isBusy(kind: ResultKind): boolean;
4275
+ busy(kind: ResultKind, on: string): Busy | undefined;
4206
4276
  bumpTick(): void;
4207
4277
  };
4208
4278
  declare function createResultStore(): ResultStore;
@@ -4225,6 +4295,9 @@ type ActionRunner = {
4225
4295
  run(action: ActionContribution, ctx: CanvasCtx, target: ActionTarget, envExtras: EditorEnvExtras): Promise<ApplyResult | undefined>;
4226
4296
  run(action: ActionContribution, ctx: RunCtx, target: ActionTarget): Promise<ApplyResult | undefined>;
4227
4297
  apply(actions: readonly Action[]): Promise<ApplyResult | undefined>;
4298
+ editing(): boolean;
4299
+ onEditingChange(listener: (editing: boolean) => void): () => void;
4300
+ busy(action: ActionContribution, ctx: RunCtx, target: ActionTarget): Busy | undefined;
4228
4301
  cancel(kind: ResultKind): Promise<void>;
4229
4302
  detach(kind: ResultKind): void;
4230
4303
  dispose(): void;
@@ -4333,4 +4406,11 @@ declare function openEngineCommands(caller: EngineCaller, { cwd }: {
4333
4406
  declare function openEngineSession(caller: DirectEngineCaller, target: EngineTarget, options?: EngineSessionOptions): Promise<EngineSession>;
4334
4407
  declare function openEngineSession(caller: BridgeEngineCaller, target: NonFixtureTarget, options?: EngineSessionOptions): Promise<EngineSession>;
4335
4408
 
4336
- export { type EngineCaller 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, CommandUnobservedError as G, type CommandsPort as H, type ConfirmSpec as I, type JsonOf as J, type ConnectCallerOptions as K, type LayoutHandle as L, ConnectError as M, type NodeDecoration as N, type OverlayContribution as O, type PanelSpec as P, type ContextKey as Q, type ResultStore as R, type SourcePort as S, type ContextPort as T, type CreatedRef as U, type DirectEngineCaller as V, EMPTY_REPORT_FOLD as W, type EditorBinding as X, type EditorEnv as Y, type EditorEnvExtras as Z, type EditorPort as _, type CanvasCtx as a, reduceFollow as a$, type EngineMethodResponse as a0, type EngineSession as a1, type EngineSessionOptions as a2, type EngineTarget as a3, type ErasedCommand as a4, type FollowSlot as a5, type GateChangeRequest as a6, type GenerateEvent as a7, type GraphError as a8, type HostBinding as a9, bridgeCaller as aA, carriesFailure as aB, connectCaller as aC, createActionRunner as aD, createResultStore as aE, currentReport as aF, defineCommand as aG, diagnosticsOf as aH, foldReport as aI, isBoundPath as aJ, openEngineCommands as aK, openEngineSession as aL, parseBound as aM, parseCommandFailure as aN, reportDiagnostics as aO, toArgv as aP, uniqueDiagnostics as aQ, Action as aR, InputMode as aS, type LaceReason as aT, type LiveSlots as aU, type OnScreen as aV, type RunPhase as aW, type RunPhaseStatus as aX, diagnosticsOfDocument as aY, liveSlots as aZ, reasonWire as a_, type Invocation as aa, type KeySpec as ab, type Placement as ac, type PortName as ad, type PresenterPort as ae, type PreviewSlot as af, Reason as ag, type ReportEntry as ah, type ReportFold as ai, type ReportPath as aj, type ReportSlot as ak, type ResultKind as al, type ResultSlots as am, type RunOutcome as an, type RunSlot as ao, type RunnerPorts as ap, SCHEMAS as aq, type Sink as ar, type SinkInput as as, type SlotContext as at, type SlotKind as au, type SourceConflict as av, type StackRef as aw, type ViewStatePort as ax, type WiringCandidate as ay, type WiringQuery as az, type CanvasPorts as b, reducePreview as b0, reduceReport as b1, reduceRun as b2, settleRun as b3, 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 };
4409
+ type ResolveCtx = RunCtx & Partial<Pick<CanvasCtx, 'editable' | 'generating' | 'sourceRefused' | 'view' | 'selection' | 'diagnostics' | 'settingsOpen'>>;
4410
+ declare function disabledReason(action: ActionContribution, ctx: ResolveCtx, busy: Busy | undefined): string | undefined;
4411
+ declare function answering(actions: readonly ActionContribution[], failure: CommandFailure): readonly ActionContribution[];
4412
+ declare function resolveContributions<P extends PanelSpec>(all: ContributionSet<P>, ports: CanvasPorts, ctx: ResolveCtx, target?: ActionTarget): ContributionSet<P>;
4413
+ /** Every resolved action placed in a given panel's row (a `row:<panel>` placement). */
4414
+ declare function rowActions(resolved: ContributionSet, panelId: string): readonly ActionContribution[];
4415
+
4416
+ export { type EngineCaller 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, CommandUnobservedError as G, type CommandsPort as H, type ConfirmSpec as I, type JsonOf as J, type ConnectCallerOptions as K, type LayoutHandle as L, ConnectError as M, type NodeDecoration as N, type OverlayContribution as O, type PanelSpec as P, type ContextKey as Q, type ResultStore as R, type SourcePort as S, type ContextPort as T, type CreatedRef as U, type DirectEngineCaller as V, EMPTY_REPORT_FOLD as W, type EditorBinding as X, type EditorEnv as Y, type EditorEnvExtras as Z, type EditorPort as _, type CanvasCtx as a, type LaceReason as a$, type EngineMethodResponse as a0, type EngineSession as a1, type EngineSessionOptions as a2, type EngineTarget as a3, type ErasedCommand as a4, type FollowSlot as a5, type GateChangeRequest as a6, type GenerateEvent as a7, type GraphError as a8, type HostBinding as a9, type ViewStatePort as aA, type WiringCandidate as aB, type WiringQuery as aC, answering as aD, bridgeCaller as aE, carriesFailure as aF, connectCaller as aG, createActionRunner as aH, createResultStore as aI, currentReport as aJ, defineCommand as aK, diagnosticsOf as aL, disabledReason as aM, foldReport as aN, isBoundPath as aO, openEngineCommands as aP, openEngineSession as aQ, parseBound as aR, parseCommandFailure as aS, reportDiagnostics as aT, resolveContributions as aU, rowActions as aV, toArgv as aW, uniqueDiagnostics as aX, Action as aY, type FailedCommand as aZ, InputMode as a_, type Invocation as aa, type KeySpec as ab, type Placement as ac, type PortName as ad, type PresenterPort as ae, type PreviewSlot as af, Reason as ag, type ReportEntry as ah, type ReportFold as ai, type ReportPath as aj, type ReportSlot as ak, type ResultKind as al, type ResultSlots as am, type RunCtx as an, type RunOutcome as ao, type RunSlot as ap, type RunnerPorts as aq, type RunningMark as ar, SCHEMAS as as, type Sink as at, type SinkInput as au, type SlotContext as av, type SlotKind as aw, type SourceConflict as ax, type StackRef as ay, type Started as az, type CanvasPorts as b, type LiveSlots as b0, type OnScreen as b1, type RunPhase as b2, type RunPhaseStatus as b3, diagnosticsOfDocument as b4, failureSays as b5, liveSlots as b6, reasonWire as b7, reduceFollow as b8, reducePreview as b9, reduceReport as ba, reduceRun as bb, settleRun as bc, 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, Bundle as j, type ActionRunner as k, type ActionIcon 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, type Busy 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 };
@@ -1520,11 +1520,15 @@ declare enum ConflictChoice {
1520
1520
  * failure Lace decided sets `reason`; one the API decided sets `api_code`
1521
1521
  * to the API's own closed code, passed through unchanged, with the status
1522
1522
  * code that HTTP status maps to, and `reason` where that code has one
1523
- * (`REASON_UNAUTHENTICATED` for the API's `unauthenticated`).
1523
+ * (`REASON_UNAUTHENTICATED` for the API's `unauthenticated`), and
1524
+ * `request_id` to the id the API answered the refused request with, when
1525
+ * it named one: the id a person quotes to Lace's support. The status
1526
+ * message is the sentence the API wrote; neither field is spelled into it.
1524
1527
  */
1525
1528
  interface ReasonDetail {
1526
1529
  reason: Reason;
1527
1530
  api_code: string;
1531
+ request_id: string;
1528
1532
  }
1529
1533
  declare const ReasonDetail: MessageFns<ReasonDetail>;
1530
1534
  interface InitializeRequest {
@@ -2019,8 +2023,22 @@ declare const InvokeRequest: MessageFns<InvokeRequest>;
2019
2023
  interface InvokeEvent {
2020
2024
  json?: string | undefined;
2021
2025
  exit?: InvokeExit | undefined;
2026
+ /**
2027
+ * The engine accepted the request and runs the command: sent exactly
2028
+ * once, before any `json` or `exit`. A stream that fails before it
2029
+ * never ran the command; one that fails after it and before `exit` ran
2030
+ * the command to an outcome its client never received.
2031
+ */
2032
+ started?: InvokeStarted | undefined;
2022
2033
  }
2023
2034
  declare const InvokeEvent: MessageFns<InvokeEvent>;
2035
+ /**
2036
+ * An Invoke's command is running. It carries nothing: its arrival is the
2037
+ * fact.
2038
+ */
2039
+ interface InvokeStarted {
2040
+ }
2041
+ declare const InvokeStarted: MessageFns<InvokeStarted>;
2024
2042
  interface InvokeExit {
2025
2043
  code: number;
2026
2044
  /** tail ≤ 8 KiB */
@@ -2479,8 +2497,9 @@ declare const LaceEngineDefinition: {
2479
2497
  readonly options: {};
2480
2498
  };
2481
2499
  /**
2482
- * Runs one CLI command in-process against a fresh command tree. The command's `-o json` output is the stream:
2483
- * each top-level JSON value on stdout is one `json` event; `exit` is always last.
2500
+ * Runs one CLI command in-process against a fresh command tree. `started` is first, once the engine has accepted
2501
+ * the request and before the command runs; the command's `-o json` output follows: each top-level JSON value on
2502
+ * stdout is one `json` event; `exit` is always last.
2484
2503
  */
2485
2504
  readonly invoke: {
2486
2505
  readonly name: "Invoke";
@@ -2557,6 +2576,7 @@ declare const commandFailureSchema: z.ZodObject<{
2557
2576
  }, z.core.$strip>>>;
2558
2577
  addresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
2559
2578
  apiCode: z.ZodOptional<z.ZodString>;
2579
+ requestId: z.ZodOptional<z.ZodString>;
2560
2580
  }, z.core.$strict>;
2561
2581
  type CommandFailure = z.infer<typeof commandFailureSchema>;
2562
2582
  declare const gateChangeRequestSchema: z.ZodObject<{
@@ -2650,6 +2670,7 @@ declare const SCHEMAS: {
2650
2670
  }, z.core.$strip>>>;
2651
2671
  addresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
2652
2672
  apiCode: z.ZodOptional<z.ZodString>;
2673
+ requestId: z.ZodOptional<z.ZodString>;
2653
2674
  }, z.core.$strict>>;
2654
2675
  diagnostics: z.ZodArray<z.ZodObject<{
2655
2676
  severity: z.ZodEnum<{
@@ -2731,6 +2752,7 @@ declare const SCHEMAS: {
2731
2752
  }, z.core.$strip>>>;
2732
2753
  addresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
2733
2754
  apiCode: z.ZodOptional<z.ZodString>;
2755
+ requestId: z.ZodOptional<z.ZodString>;
2734
2756
  }, z.core.$strict>>;
2735
2757
  diagnostics: z.ZodArray<z.ZodObject<{
2736
2758
  severity: z.ZodEnum<{
@@ -3344,6 +3366,7 @@ declare const SCHEMAS: {
3344
3366
  driftCount: z.ZodNumber;
3345
3367
  scannedAt: z.ZodString;
3346
3368
  undeterminedReason: z.ZodNullable<z.ZodString>;
3369
+ undeterminedMessage: z.ZodNullable<z.ZodString>;
3347
3370
  standingDriftFindings: z.ZodNumber;
3348
3371
  footprintDestroyed: z.ZodBoolean;
3349
3372
  drift: z.ZodNullable<z.ZodObject<{
@@ -3412,18 +3435,9 @@ declare const SCHEMAS: {
3412
3435
  }, z.core.$strip>>;
3413
3436
  }, z.core.$strip>;
3414
3437
  'stack import': z.ZodObject<{
3415
- stack: z.ZodObject<{
3416
- id: z.ZodString;
3417
- slug: z.ZodString;
3418
- }, z.core.$strip>;
3438
+ changed: z.ZodBoolean;
3419
3439
  written: z.ZodArray<z.ZodString>;
3420
3440
  removed: z.ZodArray<z.ZodString>;
3421
- importBlocks: z.ZodNumber;
3422
- importResiduals: z.ZodArray<z.ZodObject<{
3423
- address: z.ZodString;
3424
- type: z.ZodString;
3425
- reason: z.ZodString;
3426
- }, z.core.$strip>>;
3427
3441
  validate: z.ZodObject<{
3428
3442
  root: z.ZodOptional<z.ZodString>;
3429
3443
  treeHash: z.ZodOptional<z.ZodString>;
@@ -3484,6 +3498,7 @@ declare const SCHEMAS: {
3484
3498
  }, z.core.$strip>>>;
3485
3499
  addresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
3486
3500
  apiCode: z.ZodOptional<z.ZodString>;
3501
+ requestId: z.ZodOptional<z.ZodString>;
3487
3502
  }, z.core.$strict>>;
3488
3503
  diagnostics: z.ZodArray<z.ZodObject<{
3489
3504
  severity: z.ZodEnum<{
@@ -3501,6 +3516,31 @@ declare const SCHEMAS: {
3501
3516
  column: z.ZodOptional<z.ZodNumber>;
3502
3517
  }, z.core.$strip>>;
3503
3518
  }, z.core.$strip>;
3519
+ diagnostics: z.ZodArray<z.ZodObject<{
3520
+ severity: z.ZodEnum<{
3521
+ error: "error";
3522
+ warning: "warning";
3523
+ info: "info";
3524
+ }>;
3525
+ code: z.ZodOptional<z.ZodString>;
3526
+ message: z.ZodString;
3527
+ moduleKey: z.ZodOptional<z.ZodString>;
3528
+ instanceId: z.ZodOptional<z.ZodString>;
3529
+ inputName: z.ZodOptional<z.ZodString>;
3530
+ file: z.ZodOptional<z.ZodString>;
3531
+ line: z.ZodOptional<z.ZodNumber>;
3532
+ column: z.ZodOptional<z.ZodNumber>;
3533
+ }, z.core.$strip>>;
3534
+ stack: z.ZodObject<{
3535
+ id: z.ZodString;
3536
+ slug: z.ZodString;
3537
+ }, z.core.$strip>;
3538
+ importBlocks: z.ZodNumber;
3539
+ importResiduals: z.ZodArray<z.ZodObject<{
3540
+ address: z.ZodString;
3541
+ type: z.ZodString;
3542
+ reason: z.ZodString;
3543
+ }, z.core.$strip>>;
3504
3544
  }, z.core.$strip>;
3505
3545
  'run get': z.ZodObject<{
3506
3546
  id: z.ZodString;
@@ -3832,6 +3872,7 @@ declare class ConnectError extends Error {
3832
3872
  readonly code: string;
3833
3873
  readonly reason: Reason;
3834
3874
  readonly apiCode: string | undefined;
3875
+ readonly requestId: string | undefined;
3835
3876
  constructor(code: string, message: string, detail?: ReasonDetail);
3836
3877
  }
3837
3878
  declare class CommandDetachedError extends Error {
@@ -4181,8 +4222,27 @@ type SlotValues = {
4181
4222
  type ReadOver<S> = (NonNullable<S> & {
4182
4223
  readOver: SlotContext;
4183
4224
  }) | null;
4225
+ type RunningMark = {
4226
+ token: object;
4227
+ path: BoundPath;
4228
+ label: string;
4229
+ };
4184
4230
  type ResultSlots = {
4185
4231
  [K in SlotKind]: ReadOver<SlotValues[K]>;
4232
+ } & {
4233
+ running: ReadonlyMap<string, RunningMark>;
4234
+ };
4235
+ type Started = {
4236
+ target: ActionTarget;
4237
+ on: string;
4238
+ path: BoundPath;
4239
+ label: string;
4240
+ };
4241
+ type Busy = {
4242
+ kind: 'run';
4243
+ } | {
4244
+ kind: 'notify';
4245
+ running: RunningMark;
4186
4246
  };
4187
4247
  type LiveSlots = Omit<ResultSlots, 'report'> & {
4188
4248
  report: ReportFold | null;
@@ -4190,6 +4250,16 @@ type LiveSlots = Omit<ResultSlots, 'report'> & {
4190
4250
 
4191
4251
  declare function liveSlots(slots: ResultSlots, current: OnScreen): LiveSlots;
4192
4252
  declare function reduceRun(prev: RunSlot, token: object, event: JsonOf<'stack apply'>): RunSlot;
4253
+ type FailedCommand = {
4254
+ kind: 'read';
4255
+ path: BoundPath;
4256
+ } | {
4257
+ kind: 'write';
4258
+ };
4259
+ declare function failureSays(error: unknown, command: FailedCommand): {
4260
+ message: string;
4261
+ failure?: CommandFailure;
4262
+ };
4193
4263
  declare function settleRun(prev: RunSlot, token: object, error: unknown): RunSlot;
4194
4264
  declare function reducePreview(_prev: PreviewSlot, token: object, event: JsonOf<'stack preview'>): PreviewSlot;
4195
4265
  declare function reduceReport(prev: ReportSlot, session: object, result: CommandResult): ReportSlot;
@@ -4200,9 +4270,9 @@ type ResultStore = {
4200
4270
  subscribe(listener: () => void): () => void;
4201
4271
  write<K extends SlotKind>(kind: K, token: object, value: SinkInput[K], readOver: SlotContext): void;
4202
4272
  fail(kind: ResultKind, token: object, error: unknown): boolean;
4203
- begin(kind: ResultKind, token: object, readOver: SlotContext, target: ActionTarget): void;
4273
+ begin(kind: ResultKind, token: object, readOver: SlotContext, started: Started): void;
4204
4274
  detach<K extends ResultKind>(kind: K, token: object): void;
4205
- isBusy(kind: ResultKind): boolean;
4275
+ busy(kind: ResultKind, on: string): Busy | undefined;
4206
4276
  bumpTick(): void;
4207
4277
  };
4208
4278
  declare function createResultStore(): ResultStore;
@@ -4225,6 +4295,9 @@ type ActionRunner = {
4225
4295
  run(action: ActionContribution, ctx: CanvasCtx, target: ActionTarget, envExtras: EditorEnvExtras): Promise<ApplyResult | undefined>;
4226
4296
  run(action: ActionContribution, ctx: RunCtx, target: ActionTarget): Promise<ApplyResult | undefined>;
4227
4297
  apply(actions: readonly Action[]): Promise<ApplyResult | undefined>;
4298
+ editing(): boolean;
4299
+ onEditingChange(listener: (editing: boolean) => void): () => void;
4300
+ busy(action: ActionContribution, ctx: RunCtx, target: ActionTarget): Busy | undefined;
4228
4301
  cancel(kind: ResultKind): Promise<void>;
4229
4302
  detach(kind: ResultKind): void;
4230
4303
  dispose(): void;
@@ -4333,4 +4406,11 @@ declare function openEngineCommands(caller: EngineCaller, { cwd }: {
4333
4406
  declare function openEngineSession(caller: DirectEngineCaller, target: EngineTarget, options?: EngineSessionOptions): Promise<EngineSession>;
4334
4407
  declare function openEngineSession(caller: BridgeEngineCaller, target: NonFixtureTarget, options?: EngineSessionOptions): Promise<EngineSession>;
4335
4408
 
4336
- export { type EngineCaller 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, CommandUnobservedError as G, type CommandsPort as H, type ConfirmSpec as I, type JsonOf as J, type ConnectCallerOptions as K, type LayoutHandle as L, ConnectError as M, type NodeDecoration as N, type OverlayContribution as O, type PanelSpec as P, type ContextKey as Q, type ResultStore as R, type SourcePort as S, type ContextPort as T, type CreatedRef as U, type DirectEngineCaller as V, EMPTY_REPORT_FOLD as W, type EditorBinding as X, type EditorEnv as Y, type EditorEnvExtras as Z, type EditorPort as _, type CanvasCtx as a, reduceFollow as a$, type EngineMethodResponse as a0, type EngineSession as a1, type EngineSessionOptions as a2, type EngineTarget as a3, type ErasedCommand as a4, type FollowSlot as a5, type GateChangeRequest as a6, type GenerateEvent as a7, type GraphError as a8, type HostBinding as a9, bridgeCaller as aA, carriesFailure as aB, connectCaller as aC, createActionRunner as aD, createResultStore as aE, currentReport as aF, defineCommand as aG, diagnosticsOf as aH, foldReport as aI, isBoundPath as aJ, openEngineCommands as aK, openEngineSession as aL, parseBound as aM, parseCommandFailure as aN, reportDiagnostics as aO, toArgv as aP, uniqueDiagnostics as aQ, Action as aR, InputMode as aS, type LaceReason as aT, type LiveSlots as aU, type OnScreen as aV, type RunPhase as aW, type RunPhaseStatus as aX, diagnosticsOfDocument as aY, liveSlots as aZ, reasonWire as a_, type Invocation as aa, type KeySpec as ab, type Placement as ac, type PortName as ad, type PresenterPort as ae, type PreviewSlot as af, Reason as ag, type ReportEntry as ah, type ReportFold as ai, type ReportPath as aj, type ReportSlot as ak, type ResultKind as al, type ResultSlots as am, type RunOutcome as an, type RunSlot as ao, type RunnerPorts as ap, SCHEMAS as aq, type Sink as ar, type SinkInput as as, type SlotContext as at, type SlotKind as au, type SourceConflict as av, type StackRef as aw, type ViewStatePort as ax, type WiringCandidate as ay, type WiringQuery as az, type CanvasPorts as b, reducePreview as b0, reduceReport as b1, reduceRun as b2, settleRun as b3, 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 };
4409
+ type ResolveCtx = RunCtx & Partial<Pick<CanvasCtx, 'editable' | 'generating' | 'sourceRefused' | 'view' | 'selection' | 'diagnostics' | 'settingsOpen'>>;
4410
+ declare function disabledReason(action: ActionContribution, ctx: ResolveCtx, busy: Busy | undefined): string | undefined;
4411
+ declare function answering(actions: readonly ActionContribution[], failure: CommandFailure): readonly ActionContribution[];
4412
+ declare function resolveContributions<P extends PanelSpec>(all: ContributionSet<P>, ports: CanvasPorts, ctx: ResolveCtx, target?: ActionTarget): ContributionSet<P>;
4413
+ /** Every resolved action placed in a given panel's row (a `row:<panel>` placement). */
4414
+ declare function rowActions(resolved: ContributionSet, panelId: string): readonly ActionContribution[];
4415
+
4416
+ export { type EngineCaller 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, CommandUnobservedError as G, type CommandsPort as H, type ConfirmSpec as I, type JsonOf as J, type ConnectCallerOptions as K, type LayoutHandle as L, ConnectError as M, type NodeDecoration as N, type OverlayContribution as O, type PanelSpec as P, type ContextKey as Q, type ResultStore as R, type SourcePort as S, type ContextPort as T, type CreatedRef as U, type DirectEngineCaller as V, EMPTY_REPORT_FOLD as W, type EditorBinding as X, type EditorEnv as Y, type EditorEnvExtras as Z, type EditorPort as _, type CanvasCtx as a, type LaceReason as a$, type EngineMethodResponse as a0, type EngineSession as a1, type EngineSessionOptions as a2, type EngineTarget as a3, type ErasedCommand as a4, type FollowSlot as a5, type GateChangeRequest as a6, type GenerateEvent as a7, type GraphError as a8, type HostBinding as a9, type ViewStatePort as aA, type WiringCandidate as aB, type WiringQuery as aC, answering as aD, bridgeCaller as aE, carriesFailure as aF, connectCaller as aG, createActionRunner as aH, createResultStore as aI, currentReport as aJ, defineCommand as aK, diagnosticsOf as aL, disabledReason as aM, foldReport as aN, isBoundPath as aO, openEngineCommands as aP, openEngineSession as aQ, parseBound as aR, parseCommandFailure as aS, reportDiagnostics as aT, resolveContributions as aU, rowActions as aV, toArgv as aW, uniqueDiagnostics as aX, Action as aY, type FailedCommand as aZ, InputMode as a_, type Invocation as aa, type KeySpec as ab, type Placement as ac, type PortName as ad, type PresenterPort as ae, type PreviewSlot as af, Reason as ag, type ReportEntry as ah, type ReportFold as ai, type ReportPath as aj, type ReportSlot as ak, type ResultKind as al, type ResultSlots as am, type RunCtx as an, type RunOutcome as ao, type RunSlot as ap, type RunnerPorts as aq, type RunningMark as ar, SCHEMAS as as, type Sink as at, type SinkInput as au, type SlotContext as av, type SlotKind as aw, type SourceConflict as ax, type StackRef as ay, type Started as az, type CanvasPorts as b, type LiveSlots as b0, type OnScreen as b1, type RunPhase as b2, type RunPhaseStatus as b3, diagnosticsOfDocument as b4, failureSays as b5, liveSlots as b6, reasonWire as b7, reduceFollow as b8, reducePreview as b9, reduceReport as ba, reduceRun as bb, settleRun as bc, 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, Bundle as j, type ActionRunner as k, type ActionIcon 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, type Busy 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lace-cloud/canvas",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "license": "BUSL-1.1",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "react": "^18.3.1",
24
24
  "react-dom": "^18.3.1",
25
25
  "zod": "^4.1.11",
26
- "@lace-cloud/proto": "0.24.0",
27
- "@lace-cloud/ui": "0.24.0"
26
+ "@lace-cloud/proto": "0.26.0",
27
+ "@lace-cloud/ui": "0.26.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/react": "^18.3.12",