@lace-cloud/canvas 0.26.0 → 0.27.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/{chunk-ID563WHD.mjs → chunk-F3X6TTZ6.mjs} +44 -35
- package/dist/{chunk-ID563WHD.mjs.map → chunk-F3X6TTZ6.mjs.map} +1 -1
- package/dist/engine/index.cjs +43 -34
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.mts +2 -2
- package/dist/engine/index.d.ts +2 -2
- package/dist/engine/index.mjs +1 -1
- package/dist/index.cjs +43 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{registry-BhFAgvlq.d.mts → registry-D7G7pqU4.d.mts} +8 -2
- package/dist/{registry-BhFAgvlq.d.ts → registry-D7G7pqU4.d.ts} +8 -2
- package/package.json +3 -3
package/dist/engine/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ActionContribution, S as SourcePort } from '../registry-
|
|
2
|
-
export {
|
|
1
|
+
import { A as ActionContribution, S as SourcePort } from '../registry-D7G7pqU4.mjs';
|
|
2
|
+
export { aZ 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 Busy, 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, a_ as FailedCommand, a5 as FollowSlot, a6 as GateChangeRequest, a7 as GenerateEvent, a8 as GraphError, a9 as HostBinding, a$ as InputMode, aa as Invocation, J as JsonOf, b0 as LaceReason, b1 as LiveSlots, b2 as OnScreen, c as PendingForm, ad as PortName, ae as PresenterPort, af as PreviewOutcome, ag as PreviewSlot, ah as Reason, ai as ReportEntry, aj as ReportFold, ak as ReportPath, al as ReportSlot, am as ResultKind, an as ResultSlots, R as ResultStore, ao as RunCtx, ap as RunOutcome, b3 as RunPhase, b4 as RunPhaseStatus, aq as RunSlot, ar as RunnerPorts, as as RunningMark, at as SCHEMAS, au as Sink, av as SinkInput, aw as SlotContext, ax as SlotKind, ay as SourceConflict, i as SourceEnd, az as StackRef, aA as Started, aB as ViewStatePort, aC as WiringCandidate, aD as WiringQuery, aE as answering, aF as bridgeCaller, aG as carriesFailure, aH as connectCaller, aI as createActionRunner, aJ as createResultStore, aK as currentReport, aL as defineCommand, aM as diagnosticsOf, b5 as diagnosticsOfDocument, b6 as failureSays, aO as foldReport, aP as isBoundPath, b7 as liveSlots, aQ as openEngineCommands, aR as openEngineSession, aS as parseBound, aT as parseCommandFailure, b8 as reasonWire, b9 as reduceFollow, ba as reducePreview, bb as reduceReport, bc as reduceRun, aU as reportDiagnostics, bd as settleRun, aX as toArgv, aY as uniqueDiagnostics } from '../registry-D7G7pqU4.mjs';
|
|
3
3
|
import '@lace-cloud/proto';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@bufbuild/protobuf/wire';
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ActionContribution, S as SourcePort } from '../registry-
|
|
2
|
-
export {
|
|
1
|
+
import { A as ActionContribution, S as SourcePort } from '../registry-D7G7pqU4.js';
|
|
2
|
+
export { aZ 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 Busy, 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, a_ as FailedCommand, a5 as FollowSlot, a6 as GateChangeRequest, a7 as GenerateEvent, a8 as GraphError, a9 as HostBinding, a$ as InputMode, aa as Invocation, J as JsonOf, b0 as LaceReason, b1 as LiveSlots, b2 as OnScreen, c as PendingForm, ad as PortName, ae as PresenterPort, af as PreviewOutcome, ag as PreviewSlot, ah as Reason, ai as ReportEntry, aj as ReportFold, ak as ReportPath, al as ReportSlot, am as ResultKind, an as ResultSlots, R as ResultStore, ao as RunCtx, ap as RunOutcome, b3 as RunPhase, b4 as RunPhaseStatus, aq as RunSlot, ar as RunnerPorts, as as RunningMark, at as SCHEMAS, au as Sink, av as SinkInput, aw as SlotContext, ax as SlotKind, ay as SourceConflict, i as SourceEnd, az as StackRef, aA as Started, aB as ViewStatePort, aC as WiringCandidate, aD as WiringQuery, aE as answering, aF as bridgeCaller, aG as carriesFailure, aH as connectCaller, aI as createActionRunner, aJ as createResultStore, aK as currentReport, aL as defineCommand, aM as diagnosticsOf, b5 as diagnosticsOfDocument, b6 as failureSays, aO as foldReport, aP as isBoundPath, b7 as liveSlots, aQ as openEngineCommands, aR as openEngineSession, aS as parseBound, aT as parseCommandFailure, b8 as reasonWire, b9 as reduceFollow, ba as reducePreview, bb as reduceReport, bc as reduceRun, aU as reportDiagnostics, bd as settleRun, aX as toArgv, aY as uniqueDiagnostics } from '../registry-D7G7pqU4.js';
|
|
3
3
|
import '@lace-cloud/proto';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@bufbuild/protobuf/wire';
|
package/dist/engine/index.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -15764,27 +15764,26 @@ function reduceRun(prev, token, event) {
|
|
|
15764
15764
|
phases
|
|
15765
15765
|
};
|
|
15766
15766
|
}
|
|
15767
|
-
if (event.error)
|
|
15767
|
+
if (!event.error)
|
|
15768
15768
|
return {
|
|
15769
15769
|
token,
|
|
15770
|
-
outcome: { kind: "
|
|
15770
|
+
outcome: { kind: "succeeded" },
|
|
15771
15771
|
lastLog,
|
|
15772
15772
|
submitted,
|
|
15773
15773
|
phases: closePhases(phases)
|
|
15774
15774
|
};
|
|
15775
|
-
return {
|
|
15776
|
-
token,
|
|
15777
|
-
outcome: { kind: "succeeded" },
|
|
15778
|
-
lastLog,
|
|
15779
|
-
submitted,
|
|
15780
|
-
phases: closePhases(phases)
|
|
15781
|
-
};
|
|
15782
15775
|
}
|
|
15783
15776
|
return { token, outcome: { kind: "running" }, lastLog, submitted, phases };
|
|
15784
15777
|
}
|
|
15778
|
+
function runningFor(slot, token) {
|
|
15779
|
+
if (slot?.token !== token) return false;
|
|
15780
|
+
return "done" in slot ? !slot.done : slot.outcome.kind === "running";
|
|
15781
|
+
}
|
|
15785
15782
|
function failureSays(error, command) {
|
|
15786
15783
|
if (error instanceof CommandExitError) {
|
|
15787
|
-
|
|
15784
|
+
if (error.failure) return { message: error.failure.message, failure: error.failure };
|
|
15785
|
+
const stderr = error.stderrTail.trim();
|
|
15786
|
+
return { message: stderr || `the command exited with code ${error.code} and wrote nothing` };
|
|
15788
15787
|
}
|
|
15789
15788
|
if (error instanceof CommandUnobservedError && command.kind === "read") {
|
|
15790
15789
|
return { message: `the stream ended before \`lace ${command.path}\` finished; run it again` };
|
|
@@ -15822,7 +15821,7 @@ function settleRun(prev, token, error) {
|
|
|
15822
15821
|
};
|
|
15823
15822
|
}
|
|
15824
15823
|
function reducePreview(_prev, token, event) {
|
|
15825
|
-
return { token, data: event };
|
|
15824
|
+
return { token, outcome: { kind: "succeeded", data: event } };
|
|
15826
15825
|
}
|
|
15827
15826
|
function reduceReport(prev, session, result) {
|
|
15828
15827
|
const fold = foldReport(prev?.sessions.get(session) ?? EMPTY_REPORT_FOLD, result);
|
|
@@ -15835,6 +15834,15 @@ function reduceFollow(prev, token, event) {
|
|
|
15835
15834
|
if (event.type === "log") return { token, runId, lines: [...lines, event.text], done: false };
|
|
15836
15835
|
return { token, runId, lines, done: true };
|
|
15837
15836
|
}
|
|
15837
|
+
function endStream(current, kind, token, error) {
|
|
15838
|
+
const { run, preview: preview2, follow } = current;
|
|
15839
|
+
if (kind === "run" && runningFor(run, token))
|
|
15840
|
+
return { ...current, run: stamp(settleRun(run, token, error), run.readOver) };
|
|
15841
|
+
if (kind === "preview" && runningFor(preview2, token)) return { ...current, preview: null };
|
|
15842
|
+
if (kind === "follow" && runningFor(follow, token))
|
|
15843
|
+
return { ...current, follow: { ...follow, done: true } };
|
|
15844
|
+
return current;
|
|
15845
|
+
}
|
|
15838
15846
|
function createResultStore() {
|
|
15839
15847
|
let slots = {
|
|
15840
15848
|
run: null,
|
|
@@ -15866,11 +15874,14 @@ function createResultStore() {
|
|
|
15866
15874
|
notify();
|
|
15867
15875
|
},
|
|
15868
15876
|
fail(kind, token, error) {
|
|
15869
|
-
|
|
15870
|
-
if (retiredTokens.has(token)
|
|
15871
|
-
|
|
15872
|
-
|
|
15873
|
-
|
|
15877
|
+
const rendered = kind === "run";
|
|
15878
|
+
if (retiredTokens.has(token)) return rendered;
|
|
15879
|
+
const next = endStream(slots, kind, token, error);
|
|
15880
|
+
if (next !== slots) {
|
|
15881
|
+
slots = next;
|
|
15882
|
+
notify();
|
|
15883
|
+
}
|
|
15884
|
+
return rendered;
|
|
15874
15885
|
},
|
|
15875
15886
|
begin(kind, token, readOver, started) {
|
|
15876
15887
|
if (kind === "run") {
|
|
@@ -15885,6 +15896,8 @@ function createResultStore() {
|
|
|
15885
15896
|
readOver
|
|
15886
15897
|
}
|
|
15887
15898
|
};
|
|
15899
|
+
} else if (kind === "preview") {
|
|
15900
|
+
slots = { ...slots, preview: { token, outcome: { kind: "running" }, readOver } };
|
|
15888
15901
|
} else if (kind === "follow") {
|
|
15889
15902
|
slots = {
|
|
15890
15903
|
...slots,
|
|
@@ -15899,27 +15912,23 @@ function createResultStore() {
|
|
|
15899
15912
|
notify();
|
|
15900
15913
|
},
|
|
15901
15914
|
detach(kind, token) {
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
} else if (kind === "report" &&
|
|
15906
|
-
const sessions = new Map(
|
|
15915
|
+
let next = endStream(slots, kind, token, new CommandDetachedError());
|
|
15916
|
+
if (kind === "follow" && next.follow?.token === token) {
|
|
15917
|
+
next = { ...next, follow: null };
|
|
15918
|
+
} else if (kind === "report" && next.report?.sessions.has(token)) {
|
|
15919
|
+
const sessions = new Map(next.report.sessions);
|
|
15907
15920
|
sessions.delete(token);
|
|
15908
|
-
|
|
15909
|
-
...
|
|
15910
|
-
report: sessions.size > 0 ? { sessions, readOver:
|
|
15921
|
+
next = {
|
|
15922
|
+
...next,
|
|
15923
|
+
report: sessions.size > 0 ? { sessions, readOver: next.report.readOver } : null
|
|
15911
15924
|
};
|
|
15912
|
-
notify();
|
|
15913
|
-
} else if (kind === "run" && slots.run?.token === token) {
|
|
15914
|
-
const settled = settleRun(slots.run, token, new CommandDetachedError());
|
|
15915
|
-
slots = { ...slots, run: stamp(settled, slots.run.readOver) };
|
|
15916
|
-
notify();
|
|
15917
15925
|
} else if (kind === "notify") {
|
|
15918
|
-
const running = new Map([...
|
|
15919
|
-
if (running.size !==
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15926
|
+
const running = new Map([...next.running].filter(([, mark]) => mark.token !== token));
|
|
15927
|
+
if (running.size !== next.running.size) next = { ...next, running };
|
|
15928
|
+
}
|
|
15929
|
+
if (next !== slots) {
|
|
15930
|
+
slots = next;
|
|
15931
|
+
notify();
|
|
15923
15932
|
}
|
|
15924
15933
|
retiredTokens.add(token);
|
|
15925
15934
|
},
|