@lace-cloud/canvas 0.24.0 → 0.25.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.
@@ -1,5 +1,5 @@
1
- import { A as ActionContribution, S as SourcePort } from '../mapping-Z-STJQRP.mjs';
2
- export { aR as Action, l as ActionRunner, n as ActionRunnerOptions, f as ActionTarget, o as ApplyResult, p as ApplyUnobservedError, q as ArgsOf, r as BindingRuntime, d as BoundPath, s as BridgeEngineCaller, t as COMMANDS, b as CanvasPorts, h as CanvasSource, v as CommandBinding, w as CommandDetachedError, x as CommandExitError, y as CommandFailure, z as CommandPath, g as CommandResult, F as CommandRun, G as CommandUnobservedError, H as CommandsPort, I as ConfirmSpec, K as ConnectCallerOptions, M as ConnectError, T as ContextPort, U as CreatedRef, V as DirectEngineCaller, W as EMPTY_REPORT_FOLD, _ as EditorPort, $ as EngineCaller, a0 as EngineMethodResponse, a1 as EngineSession, a2 as EngineSessionOptions, a3 as EngineTarget, a4 as ErasedCommand, a5 as FollowSlot, a6 as GateChangeRequest, a7 as GenerateEvent, a8 as GraphError, a9 as HostBinding, aS as InputMode, aa as Invocation, J as JsonOf, aT as LaceReason, aU as LiveSlots, aV as OnScreen, c as PendingForm, ad as PortName, ae as PresenterPort, af as PreviewSlot, ag as Reason, ah as ReportEntry, ai as ReportFold, aj as ReportPath, ak as ReportSlot, al as ResultKind, am as ResultSlots, R as ResultStore, j as RunCtx, an as RunOutcome, aW as RunPhase, aX as RunPhaseStatus, ao as RunSlot, ap as RunnerPorts, aq as SCHEMAS, ar as Sink, as as SinkInput, at as SlotContext, au as SlotKind, av as SourceConflict, i as SourceEnd, aw as StackRef, ax as ViewStatePort, ay as WiringCandidate, az as WiringQuery, aA as bridgeCaller, aB as carriesFailure, aC as connectCaller, aD as createActionRunner, aE as createResultStore, aF as currentReport, aG as defineCommand, aH as diagnosticsOf, aY as diagnosticsOfDocument, aI as foldReport, aJ as isBoundPath, aZ as liveSlots, aK as openEngineCommands, aL as openEngineSession, aM as parseBound, aN as parseCommandFailure, a_ as reasonWire, a$ as reduceFollow, b0 as reducePreview, b1 as reduceReport, b2 as reduceRun, aO as reportDiagnostics, b3 as settleRun, aP as toArgv, aQ as uniqueDiagnostics } from '../mapping-Z-STJQRP.mjs';
1
+ import { A as ActionContribution, S as SourcePort } from '../registry-CdHLt_qh.mjs';
2
+ export { aV as Action, k as ActionRunner, m as ActionRunnerOptions, f as ActionTarget, n as ApplyResult, o as ApplyUnobservedError, p as ArgsOf, q as BindingRuntime, d as BoundPath, r as BridgeEngineCaller, s as COMMANDS, b as CanvasPorts, h as CanvasSource, u as CommandBinding, v as CommandDetachedError, w as CommandExitError, x as CommandFailure, y as CommandPath, g as CommandResult, z as CommandRun, F as CommandUnobservedError, G as CommandsPort, H as ConfirmSpec, I as ConnectCallerOptions, K as ConnectError, Q as ContextPort, T as CreatedRef, U as DirectEngineCaller, V as EMPTY_REPORT_FOLD, Z as EditorPort, _ as EngineCaller, $ as EngineMethodResponse, a0 as EngineSession, a1 as EngineSessionOptions, a2 as EngineTarget, a3 as ErasedCommand, a4 as FollowSlot, a5 as GateChangeRequest, a6 as GenerateEvent, a7 as GraphError, a8 as HostBinding, aW as InputMode, a9 as Invocation, J as JsonOf, aX as LaceReason, aY as LiveSlots, aZ as OnScreen, c as PendingForm, ac as PortName, ad as PresenterPort, ae as PreviewSlot, af as Reason, ag as ReportEntry, ah as ReportFold, ai as ReportPath, aj as ReportSlot, ak as ResultKind, al as ResultSlots, R as ResultStore, am as RunCtx, an as RunOutcome, a_ as RunPhase, a$ as RunPhaseStatus, ao as RunSlot, ap as RunnerPorts, aq as SCHEMAS, ar as Sink, as as SinkInput, at as SlotContext, au as SlotKind, av as SourceConflict, i as SourceEnd, aw as StackRef, ax as ViewStatePort, ay as WiringCandidate, az as WiringQuery, aA as answering, aB as bridgeCaller, aC as carriesFailure, aD as connectCaller, aE as createActionRunner, aF as createResultStore, aG as currentReport, aH as defineCommand, aI as diagnosticsOf, b0 as diagnosticsOfDocument, aK as foldReport, aL as isBoundPath, b1 as liveSlots, aM as openEngineCommands, aN as openEngineSession, aO as parseBound, aP as parseCommandFailure, b2 as reasonWire, b3 as reduceFollow, b4 as reducePreview, b5 as reduceReport, b6 as reduceRun, aQ as reportDiagnostics, b7 as settleRun, aT as toArgv, aU as uniqueDiagnostics } from '../registry-CdHLt_qh.mjs';
3
3
  import '@lace-cloud/proto';
4
4
  import 'zod';
5
5
  import '@bufbuild/protobuf/wire';
@@ -1,5 +1,5 @@
1
- import { A as ActionContribution, S as SourcePort } from '../mapping-Z-STJQRP.js';
2
- export { aR as Action, l as ActionRunner, n as ActionRunnerOptions, f as ActionTarget, o as ApplyResult, p as ApplyUnobservedError, q as ArgsOf, r as BindingRuntime, d as BoundPath, s as BridgeEngineCaller, t as COMMANDS, b as CanvasPorts, h as CanvasSource, v as CommandBinding, w as CommandDetachedError, x as CommandExitError, y as CommandFailure, z as CommandPath, g as CommandResult, F as CommandRun, G as CommandUnobservedError, H as CommandsPort, I as ConfirmSpec, K as ConnectCallerOptions, M as ConnectError, T as ContextPort, U as CreatedRef, V as DirectEngineCaller, W as EMPTY_REPORT_FOLD, _ as EditorPort, $ as EngineCaller, a0 as EngineMethodResponse, a1 as EngineSession, a2 as EngineSessionOptions, a3 as EngineTarget, a4 as ErasedCommand, a5 as FollowSlot, a6 as GateChangeRequest, a7 as GenerateEvent, a8 as GraphError, a9 as HostBinding, aS as InputMode, aa as Invocation, J as JsonOf, aT as LaceReason, aU as LiveSlots, aV as OnScreen, c as PendingForm, ad as PortName, ae as PresenterPort, af as PreviewSlot, ag as Reason, ah as ReportEntry, ai as ReportFold, aj as ReportPath, ak as ReportSlot, al as ResultKind, am as ResultSlots, R as ResultStore, j as RunCtx, an as RunOutcome, aW as RunPhase, aX as RunPhaseStatus, ao as RunSlot, ap as RunnerPorts, aq as SCHEMAS, ar as Sink, as as SinkInput, at as SlotContext, au as SlotKind, av as SourceConflict, i as SourceEnd, aw as StackRef, ax as ViewStatePort, ay as WiringCandidate, az as WiringQuery, aA as bridgeCaller, aB as carriesFailure, aC as connectCaller, aD as createActionRunner, aE as createResultStore, aF as currentReport, aG as defineCommand, aH as diagnosticsOf, aY as diagnosticsOfDocument, aI as foldReport, aJ as isBoundPath, aZ as liveSlots, aK as openEngineCommands, aL as openEngineSession, aM as parseBound, aN as parseCommandFailure, a_ as reasonWire, a$ as reduceFollow, b0 as reducePreview, b1 as reduceReport, b2 as reduceRun, aO as reportDiagnostics, b3 as settleRun, aP as toArgv, aQ as uniqueDiagnostics } from '../mapping-Z-STJQRP.js';
1
+ import { A as ActionContribution, S as SourcePort } from '../registry-CdHLt_qh.js';
2
+ export { aV as Action, k as ActionRunner, m as ActionRunnerOptions, f as ActionTarget, n as ApplyResult, o as ApplyUnobservedError, p as ArgsOf, q as BindingRuntime, d as BoundPath, r as BridgeEngineCaller, s as COMMANDS, b as CanvasPorts, h as CanvasSource, u as CommandBinding, v as CommandDetachedError, w as CommandExitError, x as CommandFailure, y as CommandPath, g as CommandResult, z as CommandRun, F as CommandUnobservedError, G as CommandsPort, H as ConfirmSpec, I as ConnectCallerOptions, K as ConnectError, Q as ContextPort, T as CreatedRef, U as DirectEngineCaller, V as EMPTY_REPORT_FOLD, Z as EditorPort, _ as EngineCaller, $ as EngineMethodResponse, a0 as EngineSession, a1 as EngineSessionOptions, a2 as EngineTarget, a3 as ErasedCommand, a4 as FollowSlot, a5 as GateChangeRequest, a6 as GenerateEvent, a7 as GraphError, a8 as HostBinding, aW as InputMode, a9 as Invocation, J as JsonOf, aX as LaceReason, aY as LiveSlots, aZ as OnScreen, c as PendingForm, ac as PortName, ad as PresenterPort, ae as PreviewSlot, af as Reason, ag as ReportEntry, ah as ReportFold, ai as ReportPath, aj as ReportSlot, ak as ResultKind, al as ResultSlots, R as ResultStore, am as RunCtx, an as RunOutcome, a_ as RunPhase, a$ as RunPhaseStatus, ao as RunSlot, ap as RunnerPorts, aq as SCHEMAS, ar as Sink, as as SinkInput, at as SlotContext, au as SlotKind, av as SourceConflict, i as SourceEnd, aw as StackRef, ax as ViewStatePort, ay as WiringCandidate, az as WiringQuery, aA as answering, aB as bridgeCaller, aC as carriesFailure, aD as connectCaller, aE as createActionRunner, aF as createResultStore, aG as currentReport, aH as defineCommand, aI as diagnosticsOf, b0 as diagnosticsOfDocument, aK as foldReport, aL as isBoundPath, b1 as liveSlots, aM as openEngineCommands, aN as openEngineSession, aO as parseBound, aP as parseCommandFailure, b2 as reasonWire, b3 as reduceFollow, b4 as reducePreview, b5 as reduceReport, b6 as reduceRun, aQ as reportDiagnostics, b7 as settleRun, aT as toArgv, aU as uniqueDiagnostics } from '../registry-CdHLt_qh.js';
3
3
  import '@lace-cloud/proto';
4
4
  import 'zod';
5
5
  import '@bufbuild/protobuf/wire';
@@ -11,6 +11,7 @@ import {
11
11
  InputMode,
12
12
  Reason,
13
13
  SCHEMAS,
14
+ answering,
14
15
  autosave,
15
16
  bridgeCaller,
16
17
  carriesFailure,
@@ -37,7 +38,7 @@ import {
37
38
  settleRun,
38
39
  toArgv,
39
40
  uniqueDiagnostics
40
- } from "../chunk-HZWABSPP.mjs";
41
+ } from "../chunk-YLJWYH7B.mjs";
41
42
  export {
42
43
  ApplyUnobservedError,
43
44
  AutosaveEndedError,
@@ -51,6 +52,7 @@ export {
51
52
  InputMode,
52
53
  Reason,
53
54
  SCHEMAS,
55
+ answering,
54
56
  autosave,
55
57
  bridgeCaller,
56
58
  carriesFailure,
package/dist/index.cjs CHANGED
@@ -66,6 +66,7 @@ __export(index_exports, {
66
66
  UngeneratedMarker: () => UngeneratedMarker,
67
67
  UnifiedSettingsPanel: () => UnifiedSettingsPanel,
68
68
  UnsavedMarker: () => UnsavedMarker,
69
+ answering: () => answering,
69
70
  bridgeCaller: () => bridgeCaller,
70
71
  carriesFailure: () => carriesFailure,
71
72
  conflictPanel: () => conflictPanel,
@@ -394,6 +395,16 @@ function asksConfirm(binding) {
394
395
  return binding.confirm !== void 0;
395
396
  }
396
397
  }
398
+ var FAILURE_ROW = "failure";
399
+ function placedOn(action, row) {
400
+ return typeof action.placement === "object" && action.placement.row === row;
401
+ }
402
+ function answersFailure(action, failure) {
403
+ return action.answers?.includes(failure.reason) === true;
404
+ }
405
+ function answering(actions, failure) {
406
+ return actions.filter((a) => placedOn(a, FAILURE_ROW) && answersFailure(a, failure));
407
+ }
397
408
  function unmetRequirement(action, ports, ctx, target) {
398
409
  const { label, binding } = action;
399
410
  const port = missingPort(ports, action.requiredPorts);
@@ -405,11 +416,9 @@ function unmetRequirement(action, ports, ctx, target) {
405
416
  if (key !== void 0) return `${label} needs ${CONTEXT_NEEDS[key]}`;
406
417
  const targetKey = (action.requiredTarget ?? []).find((k) => target[k] === void 0);
407
418
  if (targetKey !== void 0) return `${label} needs ${TARGET_NEEDS[targetKey]}`;
408
- if (action.answers !== void 0) {
419
+ if (placedOn(action, FAILURE_ROW) || action.answers !== void 0) {
409
420
  if (target.failure === void 0) return `${label} needs ${TARGET_NEEDS.failure}`;
410
- if (!action.answers.includes(target.failure.reason)) {
411
- return `${label} does not answer this failure`;
412
- }
421
+ if (!answersFailure(action, target.failure)) return `${label} does not answer this failure`;
413
422
  }
414
423
  if (binding.kind === "command" && !availableCommands(ports).has(binding.path)) {
415
424
  return `${label} runs lace ${binding.path}, which this host does not route`;
@@ -428,9 +437,7 @@ function resolveContributions(all, ports, ctx, target = NO_TARGET) {
428
437
  };
429
438
  }
430
439
  function rowActions(resolved, panelId) {
431
- return resolved.actions.filter(
432
- (a) => typeof a.placement === "object" && a.placement.row === panelId
433
- );
440
+ return resolved.actions.filter((a) => placedOn(a, panelId));
434
441
  }
435
442
 
436
443
  // src/core/sections.ts
@@ -15282,13 +15289,10 @@ var stackScanSchema = import_zod.z.object({
15282
15289
  drift: driftSchema
15283
15290
  }).nullable()
15284
15291
  });
15285
- var stackImportSchema = import_zod.z.object({
15292
+ var stackImportSchema = moduleConvertResultSchema.extend({
15286
15293
  stack: stackIdentSchema,
15287
- written: import_zod.z.array(import_zod.z.string()),
15288
- removed: import_zod.z.array(import_zod.z.string()),
15289
15294
  importBlocks: import_zod.z.number(),
15290
- importResiduals: import_zod.z.array(importResidualSchema),
15291
- validate: moduleValidateResultSchema
15295
+ importResiduals: import_zod.z.array(importResidualSchema)
15292
15296
  });
15293
15297
  var artifactRefSchema = import_zod.z.object({ url: import_zod.z.string(), key: import_zod.z.string() });
15294
15298
  var runPlanSchema = import_zod.z.object({
@@ -15596,13 +15600,12 @@ function treeChanges(e) {
15596
15600
  function importNotice(e) {
15597
15601
  const { slug } = e.stack;
15598
15602
  const changes = treeChanges(e);
15599
- const changed = changes.length > 0;
15600
- const files = changed ? `, ${changes.join(" and ")}` : "";
15603
+ const files = changes.length > 0 ? `, ${changes.join(" and ")}` : "";
15601
15604
  const imported = `Imported ${e.importBlocks} resource(s) into ${slug}${files}.`;
15602
15605
  if (e.validate.exitClass !== "ok") {
15603
15606
  return ["warn", `${imported} The tree did not validate: fix it before you commit it.`];
15604
15607
  }
15605
- const adopt = changed ? ` Review the change in git, commit it, then apply ${slug} to adopt them.` : "";
15608
+ const adopt = e.changed ? ` Review the change in git, commit it, then apply ${slug} to adopt them.` : "";
15606
15609
  if (e.importResiduals.length === 0) return ["info", `${imported}${adopt}`];
15607
15610
  return [
15608
15611
  "warn",
@@ -18515,10 +18518,10 @@ var CORE_CONTRIBUTIONS = {
18515
18518
 
18516
18519
  // src/core/report-fold.ts
18517
18520
  var REPORT_PATHS = ["module validate", "module convert", "module scan"];
18518
- var REPORT_PATH_SET = new Set(REPORT_PATHS);
18519
- function isReportPath(path) {
18520
- return REPORT_PATH_SET.has(path);
18521
- }
18521
+ var FOLDS_AS = new Map([
18522
+ ...REPORT_PATHS.map((path) => [path, path]),
18523
+ ["stack import", "module convert"]
18524
+ ]);
18522
18525
  var EMPTY_REPORT_FOLD = /* @__PURE__ */ new Map();
18523
18526
  function readEntry(path, exitCode, data) {
18524
18527
  if (carriesFailure(data)) {
@@ -18534,10 +18537,11 @@ function readEntry(path, exitCode, data) {
18534
18537
  }
18535
18538
  }
18536
18539
  function foldReport(prev, result) {
18537
- if (!isReportPath(result.path)) return prev;
18540
+ const path = FOLDS_AS.get(result.path);
18541
+ if (path === void 0) return prev;
18538
18542
  const next = new Map(prev);
18539
- if (result.document === "") next.delete(result.path);
18540
- else next.set(result.path, readEntry(result.path, result.exitCode, JSON.parse(result.document)));
18543
+ if (result.document === "") next.delete(path);
18544
+ else next.set(path, readEntry(path, result.exitCode, JSON.parse(result.document)));
18541
18545
  return next;
18542
18546
  }
18543
18547
  function treeHashOf(entry) {
@@ -18903,6 +18907,10 @@ function createActionRunner(ports, store, options = {}) {
18903
18907
  handles.delete(kind);
18904
18908
  tokens.delete(kind);
18905
18909
  }
18910
+ function tellFailure(error) {
18911
+ if (error instanceof CommandDetachedError) return;
18912
+ ports.presenter.notify("error", error instanceof Error ? error.message : String(error));
18913
+ }
18906
18914
  async function startCommand(action, ctx, target, formArgs) {
18907
18915
  const binding = action.binding;
18908
18916
  if (binding.kind !== "command") return;
@@ -18957,7 +18965,7 @@ function createActionRunner(ports, store, options = {}) {
18957
18965
  missing: completion.missing,
18958
18966
  submit: (values) => {
18959
18967
  options.onPendingFormChange?.(null);
18960
- void startCommand(action, ctx, target, values);
18968
+ void startCommand(action, ctx, target, values).catch(tellFailure);
18961
18969
  },
18962
18970
  cancel: () => options.onPendingFormChange?.(null)
18963
18971
  });
@@ -19031,8 +19039,7 @@ function createActionRunner(ports, store, options = {}) {
19031
19039
  return;
19032
19040
  }
19033
19041
  } catch (error) {
19034
- if (error instanceof CommandDetachedError) return;
19035
- ports.presenter.notify("error", error instanceof Error ? error.message : String(error));
19042
+ tellFailure(error);
19036
19043
  }
19037
19044
  },
19038
19045
  apply(actions) {
@@ -19870,6 +19877,7 @@ async function openEngineSession(caller, target, options = {}) {
19870
19877
  revisionWaiters.clear();
19871
19878
  }
19872
19879
  function publishCommandResult(result) {
19880
+ commandResults.delete(result.path);
19873
19881
  commandResults.set(result.path, result);
19874
19882
  for (const listener of commandResultListeners) deliver(listener, result);
19875
19883
  }
@@ -20146,6 +20154,7 @@ function convertCreatedRef(r) {
20146
20154
  UngeneratedMarker,
20147
20155
  UnifiedSettingsPanel,
20148
20156
  UnsavedMarker,
20157
+ answering,
20149
20158
  bridgeCaller,
20150
20159
  carriesFailure,
20151
20160
  conflictPanel,