@lace-cloud/canvas 0.35.0 → 0.37.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/README.md +6 -1
- package/dist/{Canvas-VQQEZSPA.css → Canvas-UTKLP6WI.css} +32 -1
- package/dist/{CardActions-QLTNQUVW.css → CardActions-ORDC2L5Y.css} +4 -0
- package/dist/{ContextMenu-S3JIZMET.css → ContextMenu-P457V6QE.css} +1 -1
- package/dist/{GroupNode-NJOGOGQM.css → GroupNode-2IGAUA6V.css} +14 -5
- package/dist/{ModuleNode-LPPBJZCD.css → ModuleNode-3GTXKKVQ.css} +20 -20
- package/dist/NodeDropTarget-H5L3NZS6.css +15 -0
- package/dist/{chunk-O3I4KLND.mjs → chunk-45ZS7XCZ.mjs} +238 -31
- package/dist/chunk-45ZS7XCZ.mjs.map +1 -0
- package/dist/engine/index.cjs +211 -29
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.mts +21 -5
- package/dist/engine/index.d.ts +21 -5
- package/dist/engine/index.mjs +7 -3
- package/dist/index.cjs +1468 -896
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +51 -19
- package/dist/index.d.ts +51 -19
- package/dist/index.mjs +864 -490
- package/dist/index.mjs.map +1 -1
- package/dist/{registry-ynSG1hCz.d.mts → registry-4-XX1MRe.d.mts} +75 -9
- package/dist/{registry-ynSG1hCz.d.ts → registry-4-XX1MRe.d.ts} +75 -9
- package/package.json +5 -5
- package/dist/chunk-O3I4KLND.mjs.map +0 -1
package/dist/engine/index.cjs
CHANGED
|
@@ -71,7 +71,9 @@ __export(engine_exports, {
|
|
|
71
71
|
settleRun: () => settleRun,
|
|
72
72
|
stackSlugRule: () => stackSlugRule,
|
|
73
73
|
toArgv: () => toArgv,
|
|
74
|
-
uniqueDiagnostics: () => uniqueDiagnostics
|
|
74
|
+
uniqueDiagnostics: () => uniqueDiagnostics,
|
|
75
|
+
wireEnd: () => wireEnd,
|
|
76
|
+
wireEndText: () => wireEndText
|
|
75
77
|
});
|
|
76
78
|
module.exports = __toCommonJS(engine_exports);
|
|
77
79
|
|
|
@@ -569,6 +571,7 @@ var Reason = /* @__PURE__ */ ((Reason3) => {
|
|
|
569
571
|
Reason3[Reason3["REASON_IMPORT_UNDECLARED"] = 20] = "REASON_IMPORT_UNDECLARED";
|
|
570
572
|
Reason3[Reason3["REASON_ALREADY_IMPORTED"] = 21] = "REASON_ALREADY_IMPORTED";
|
|
571
573
|
Reason3[Reason3["REASON_NO_LOCKFILE"] = 22] = "REASON_NO_LOCKFILE";
|
|
574
|
+
Reason3[Reason3["REASON_NO_COMMIT"] = 23] = "REASON_NO_COMMIT";
|
|
572
575
|
Reason3[Reason3["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
573
576
|
return Reason3;
|
|
574
577
|
})(Reason || {});
|
|
@@ -643,6 +646,9 @@ function reasonFromJSON(object) {
|
|
|
643
646
|
case 22:
|
|
644
647
|
case "REASON_NO_LOCKFILE":
|
|
645
648
|
return 22 /* REASON_NO_LOCKFILE */;
|
|
649
|
+
case 23:
|
|
650
|
+
case "REASON_NO_COMMIT":
|
|
651
|
+
return 23 /* REASON_NO_COMMIT */;
|
|
646
652
|
case -1:
|
|
647
653
|
case "UNRECOGNIZED":
|
|
648
654
|
default:
|
|
@@ -697,6 +703,8 @@ function reasonToJSON(object) {
|
|
|
697
703
|
return "REASON_ALREADY_IMPORTED";
|
|
698
704
|
case 22 /* REASON_NO_LOCKFILE */:
|
|
699
705
|
return "REASON_NO_LOCKFILE";
|
|
706
|
+
case 23 /* REASON_NO_COMMIT */:
|
|
707
|
+
return "REASON_NO_COMMIT";
|
|
700
708
|
case -1 /* UNRECOGNIZED */:
|
|
701
709
|
default:
|
|
702
710
|
return "UNRECOGNIZED";
|
|
@@ -3779,7 +3787,7 @@ var InitializeRequest = {
|
|
|
3779
3787
|
}
|
|
3780
3788
|
};
|
|
3781
3789
|
function createBaseInitializeResponse() {
|
|
3782
|
-
return { server_version: "", protocol_version: "", supported_protocols: [], command_paths: [] };
|
|
3790
|
+
return { server_version: "", protocol_version: "", supported_protocols: [], command_paths: [], contract: "" };
|
|
3783
3791
|
}
|
|
3784
3792
|
var InitializeResponse = {
|
|
3785
3793
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
@@ -3795,6 +3803,9 @@ var InitializeResponse = {
|
|
|
3795
3803
|
for (const v of message.command_paths) {
|
|
3796
3804
|
writer.uint32(42).string(v);
|
|
3797
3805
|
}
|
|
3806
|
+
if (message.contract !== "") {
|
|
3807
|
+
writer.uint32(50).string(message.contract);
|
|
3808
|
+
}
|
|
3798
3809
|
return writer;
|
|
3799
3810
|
},
|
|
3800
3811
|
decode(input, length) {
|
|
@@ -3832,6 +3843,13 @@ var InitializeResponse = {
|
|
|
3832
3843
|
message.command_paths.push(reader.string());
|
|
3833
3844
|
continue;
|
|
3834
3845
|
}
|
|
3846
|
+
case 6: {
|
|
3847
|
+
if (tag !== 50) {
|
|
3848
|
+
break;
|
|
3849
|
+
}
|
|
3850
|
+
message.contract = reader.string();
|
|
3851
|
+
continue;
|
|
3852
|
+
}
|
|
3835
3853
|
}
|
|
3836
3854
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3837
3855
|
break;
|
|
@@ -3845,7 +3863,8 @@ var InitializeResponse = {
|
|
|
3845
3863
|
server_version: isSet3(object.serverVersion) ? globalThis.String(object.serverVersion) : isSet3(object.server_version) ? globalThis.String(object.server_version) : "",
|
|
3846
3864
|
protocol_version: isSet3(object.protocolVersion) ? globalThis.String(object.protocolVersion) : isSet3(object.protocol_version) ? globalThis.String(object.protocol_version) : "",
|
|
3847
3865
|
supported_protocols: globalThis.Array.isArray(object?.supportedProtocols) ? object.supportedProtocols.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.supported_protocols) ? object.supported_protocols.map((e) => globalThis.String(e)) : [],
|
|
3848
|
-
command_paths: globalThis.Array.isArray(object?.commandPaths) ? object.commandPaths.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.command_paths) ? object.command_paths.map((e) => globalThis.String(e)) : []
|
|
3866
|
+
command_paths: globalThis.Array.isArray(object?.commandPaths) ? object.commandPaths.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.command_paths) ? object.command_paths.map((e) => globalThis.String(e)) : [],
|
|
3867
|
+
contract: isSet3(object.contract) ? globalThis.String(object.contract) : ""
|
|
3849
3868
|
};
|
|
3850
3869
|
},
|
|
3851
3870
|
toJSON(message) {
|
|
@@ -3862,6 +3881,9 @@ var InitializeResponse = {
|
|
|
3862
3881
|
if (message.command_paths?.length) {
|
|
3863
3882
|
obj.commandPaths = message.command_paths;
|
|
3864
3883
|
}
|
|
3884
|
+
if (message.contract !== "") {
|
|
3885
|
+
obj.contract = message.contract;
|
|
3886
|
+
}
|
|
3865
3887
|
return obj;
|
|
3866
3888
|
},
|
|
3867
3889
|
create(base) {
|
|
@@ -3873,6 +3895,7 @@ var InitializeResponse = {
|
|
|
3873
3895
|
message.protocol_version = object.protocol_version ?? "";
|
|
3874
3896
|
message.supported_protocols = object.supported_protocols?.map((e) => e) || [];
|
|
3875
3897
|
message.command_paths = object.command_paths?.map((e) => e) || [];
|
|
3898
|
+
message.contract = object.contract ?? "";
|
|
3876
3899
|
return message;
|
|
3877
3900
|
}
|
|
3878
3901
|
};
|
|
@@ -9362,7 +9385,7 @@ var BundleApplyResult = {
|
|
|
9362
9385
|
}
|
|
9363
9386
|
};
|
|
9364
9387
|
function createBaseCreatedRef() {
|
|
9365
|
-
return { scope: "", id: "", module_key: "", source_id: "" };
|
|
9388
|
+
return { scope: "", id: "", module_key: "", source_id: "", group_id: "" };
|
|
9366
9389
|
}
|
|
9367
9390
|
var CreatedRef = {
|
|
9368
9391
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
@@ -9378,6 +9401,9 @@ var CreatedRef = {
|
|
|
9378
9401
|
if (message.source_id !== "") {
|
|
9379
9402
|
writer.uint32(34).string(message.source_id);
|
|
9380
9403
|
}
|
|
9404
|
+
if (message.group_id !== "") {
|
|
9405
|
+
writer.uint32(42).string(message.group_id);
|
|
9406
|
+
}
|
|
9381
9407
|
return writer;
|
|
9382
9408
|
},
|
|
9383
9409
|
decode(input, length) {
|
|
@@ -9415,6 +9441,13 @@ var CreatedRef = {
|
|
|
9415
9441
|
message.source_id = reader.string();
|
|
9416
9442
|
continue;
|
|
9417
9443
|
}
|
|
9444
|
+
case 5: {
|
|
9445
|
+
if (tag !== 42) {
|
|
9446
|
+
break;
|
|
9447
|
+
}
|
|
9448
|
+
message.group_id = reader.string();
|
|
9449
|
+
continue;
|
|
9450
|
+
}
|
|
9418
9451
|
}
|
|
9419
9452
|
if ((tag & 7) === 4 || tag === 0) {
|
|
9420
9453
|
break;
|
|
@@ -9428,7 +9461,8 @@ var CreatedRef = {
|
|
|
9428
9461
|
scope: isSet3(object.scope) ? globalThis.String(object.scope) : "",
|
|
9429
9462
|
id: isSet3(object.id) ? globalThis.String(object.id) : "",
|
|
9430
9463
|
module_key: isSet3(object.moduleKey) ? globalThis.String(object.moduleKey) : isSet3(object.module_key) ? globalThis.String(object.module_key) : "",
|
|
9431
|
-
source_id: isSet3(object.sourceId) ? globalThis.String(object.sourceId) : isSet3(object.source_id) ? globalThis.String(object.source_id) : ""
|
|
9464
|
+
source_id: isSet3(object.sourceId) ? globalThis.String(object.sourceId) : isSet3(object.source_id) ? globalThis.String(object.source_id) : "",
|
|
9465
|
+
group_id: isSet3(object.groupId) ? globalThis.String(object.groupId) : isSet3(object.group_id) ? globalThis.String(object.group_id) : ""
|
|
9432
9466
|
};
|
|
9433
9467
|
},
|
|
9434
9468
|
toJSON(message) {
|
|
@@ -9445,6 +9479,9 @@ var CreatedRef = {
|
|
|
9445
9479
|
if (message.source_id !== "") {
|
|
9446
9480
|
obj.sourceId = message.source_id;
|
|
9447
9481
|
}
|
|
9482
|
+
if (message.group_id !== "") {
|
|
9483
|
+
obj.groupId = message.group_id;
|
|
9484
|
+
}
|
|
9448
9485
|
return obj;
|
|
9449
9486
|
},
|
|
9450
9487
|
create(base) {
|
|
@@ -9456,6 +9493,7 @@ var CreatedRef = {
|
|
|
9456
9493
|
message.id = object.id ?? "";
|
|
9457
9494
|
message.module_key = object.module_key ?? "";
|
|
9458
9495
|
message.source_id = object.source_id ?? "";
|
|
9496
|
+
message.group_id = object.group_id ?? "";
|
|
9459
9497
|
return message;
|
|
9460
9498
|
}
|
|
9461
9499
|
};
|
|
@@ -11747,6 +11785,13 @@ var COMMANDS = {
|
|
|
11747
11785
|
},
|
|
11748
11786
|
"readme": {
|
|
11749
11787
|
"type": "string"
|
|
11788
|
+
},
|
|
11789
|
+
"visibility": {
|
|
11790
|
+
"type": "string",
|
|
11791
|
+
"values": [
|
|
11792
|
+
"public",
|
|
11793
|
+
"org_private"
|
|
11794
|
+
]
|
|
11750
11795
|
}
|
|
11751
11796
|
},
|
|
11752
11797
|
"effect": "read",
|
|
@@ -12310,6 +12355,27 @@ var COMMANDS = {
|
|
|
12310
12355
|
"hidden": false,
|
|
12311
12356
|
"yes": false
|
|
12312
12357
|
},
|
|
12358
|
+
"stack validate": {
|
|
12359
|
+
"path": "stack validate",
|
|
12360
|
+
"positionals": [],
|
|
12361
|
+
"flags": {
|
|
12362
|
+
"output": {
|
|
12363
|
+
"type": "string",
|
|
12364
|
+
"values": [
|
|
12365
|
+
"table",
|
|
12366
|
+
"json"
|
|
12367
|
+
],
|
|
12368
|
+
"short": "o"
|
|
12369
|
+
},
|
|
12370
|
+
"source": {
|
|
12371
|
+
"type": "string",
|
|
12372
|
+
"required": true
|
|
12373
|
+
}
|
|
12374
|
+
},
|
|
12375
|
+
"effect": "read",
|
|
12376
|
+
"hidden": false,
|
|
12377
|
+
"yes": false
|
|
12378
|
+
},
|
|
12313
12379
|
"team current": {
|
|
12314
12380
|
"path": "team current",
|
|
12315
12381
|
"positionals": [],
|
|
@@ -12520,7 +12586,6 @@ var commandFailureSchema = import_zod.z.strictObject({
|
|
|
12520
12586
|
var moduleValidateDeviationSchema = import_zod.z.object({
|
|
12521
12587
|
notCompositional: import_zod.z.boolean(),
|
|
12522
12588
|
clusters: import_zod.z.array(import_zod.z.unknown()),
|
|
12523
|
-
residuals: import_zod.z.array(import_zod.z.unknown()),
|
|
12524
12589
|
hasManagedBackend: import_zod.z.boolean(),
|
|
12525
12590
|
backendFindings: import_zod.z.array(import_zod.z.object({ file: import_zod.z.string(), line: import_zod.z.number(), kind: import_zod.z.string() })),
|
|
12526
12591
|
sharedLocalSource: import_zod.z.boolean(),
|
|
@@ -12616,7 +12681,8 @@ var registryListSchema = import_zod.z.object({
|
|
|
12616
12681
|
})
|
|
12617
12682
|
),
|
|
12618
12683
|
truncated: import_zod.z.boolean(),
|
|
12619
|
-
publishingGuideUrl: import_zod.z.string()
|
|
12684
|
+
publishingGuideUrl: import_zod.z.string(),
|
|
12685
|
+
scopeNotice: import_zod.z.string().optional()
|
|
12620
12686
|
});
|
|
12621
12687
|
var registryManifestSchema = import_zod.z.object({
|
|
12622
12688
|
id: import_zod.z.string(),
|
|
@@ -13118,6 +13184,7 @@ var SCHEMAS = {
|
|
|
13118
13184
|
"stack destroy": runEventSchema,
|
|
13119
13185
|
"drift scan": driftScanSchema,
|
|
13120
13186
|
"stack create": stackSchema,
|
|
13187
|
+
"stack validate": stackSourceSchema,
|
|
13121
13188
|
"module import": moduleImportSchema,
|
|
13122
13189
|
"run get": runSchema,
|
|
13123
13190
|
"run plan": runPlanSchema,
|
|
@@ -13194,7 +13261,11 @@ async function initialize(caller) {
|
|
|
13194
13261
|
client_version: "@lace-cloud/canvas",
|
|
13195
13262
|
protocol_version: import_proto2.ENGINE_PROTOCOL_VERSION
|
|
13196
13263
|
});
|
|
13197
|
-
(0, import_proto2.
|
|
13264
|
+
(0, import_proto2.checkEngineIdentity)({
|
|
13265
|
+
version: initialize2.server_version,
|
|
13266
|
+
protocol: initialize2.protocol_version,
|
|
13267
|
+
contract: initialize2.contract
|
|
13268
|
+
});
|
|
13198
13269
|
return new Set(initialize2.command_paths);
|
|
13199
13270
|
}
|
|
13200
13271
|
async function openEngineCommands(caller, { cwd }) {
|
|
@@ -13539,7 +13610,13 @@ function convertGraphError(e) {
|
|
|
13539
13610
|
};
|
|
13540
13611
|
}
|
|
13541
13612
|
function convertCreatedRef(r) {
|
|
13542
|
-
return {
|
|
13613
|
+
return {
|
|
13614
|
+
scope: r.scope,
|
|
13615
|
+
id: r.id,
|
|
13616
|
+
moduleKey: r.module_key,
|
|
13617
|
+
sourceId: r.source_id,
|
|
13618
|
+
groupId: r.group_id
|
|
13619
|
+
};
|
|
13543
13620
|
}
|
|
13544
13621
|
|
|
13545
13622
|
// src/utils/counted.ts
|
|
@@ -13636,7 +13713,11 @@ function diagnosticsOfDocument(document) {
|
|
|
13636
13713
|
}));
|
|
13637
13714
|
}
|
|
13638
13715
|
function diagnosticsOfEntry(entry) {
|
|
13639
|
-
|
|
13716
|
+
if (entry.kind === "failure") return [{ severity: "error", message: entry.failure.message }];
|
|
13717
|
+
const found = diagnosticsOfDocument(entry.document);
|
|
13718
|
+
if (entry.path !== "module validate") return found;
|
|
13719
|
+
const { failure } = entry.document;
|
|
13720
|
+
return failure && !found.some((d) => d.severity === "error") ? [...found, { severity: "error", message: failure.message }] : found;
|
|
13640
13721
|
}
|
|
13641
13722
|
function reportDiagnostics(fold) {
|
|
13642
13723
|
return uniqueDiagnostics(
|
|
@@ -13776,6 +13857,14 @@ function failureSays(error) {
|
|
|
13776
13857
|
}
|
|
13777
13858
|
return { message: error instanceof Error ? error.message : String(error) };
|
|
13778
13859
|
}
|
|
13860
|
+
function notifyFailure(presenter, error, label) {
|
|
13861
|
+
const { message, failure } = failureSays(error);
|
|
13862
|
+
presenter.notify(
|
|
13863
|
+
"error",
|
|
13864
|
+
label ? `${label}: ${message}` : message,
|
|
13865
|
+
...failure ? [failure] : []
|
|
13866
|
+
);
|
|
13867
|
+
}
|
|
13779
13868
|
function settleRun(prev, token, error) {
|
|
13780
13869
|
const carried = prev && prev.token === token ? prev : null;
|
|
13781
13870
|
const run = carried?.run ?? null;
|
|
@@ -13920,6 +14009,7 @@ function defineCommand(binding) {
|
|
|
13920
14009
|
kind: "command",
|
|
13921
14010
|
path: binding.path,
|
|
13922
14011
|
confirms: binding.confirm !== void 0,
|
|
14012
|
+
preflightPath: binding.preflight?.path,
|
|
13923
14013
|
resultKind: binding.result.kind,
|
|
13924
14014
|
invalidates: binding.invalidates,
|
|
13925
14015
|
partialArgs(ctx, target) {
|
|
@@ -13931,6 +14021,24 @@ function defineCommand(binding) {
|
|
|
13931
14021
|
if (!merged.ok) return void 0;
|
|
13932
14022
|
return binding.confirm(ctx, merged.args, target);
|
|
13933
14023
|
},
|
|
14024
|
+
async preflight(rt, ctx, target, signal) {
|
|
14025
|
+
const commands = rt.ports.commands;
|
|
14026
|
+
if (!binding.preflight || !commands) return true;
|
|
14027
|
+
const { path, args } = binding.preflight;
|
|
14028
|
+
const merged = completeArgs(path, args(ctx, target));
|
|
14029
|
+
if (!merged.ok) return true;
|
|
14030
|
+
try {
|
|
14031
|
+
const events = commands.invoke(path, merged.args, signal, rt.cwd).events;
|
|
14032
|
+
const read = events[Symbol.asyncIterator]();
|
|
14033
|
+
let step = await read.next();
|
|
14034
|
+
while (!step.done) step = await read.next();
|
|
14035
|
+
return true;
|
|
14036
|
+
} catch (err) {
|
|
14037
|
+
if (err instanceof CommandDetachedError) return false;
|
|
14038
|
+
notifyFailure(rt.ports.presenter, err);
|
|
14039
|
+
return false;
|
|
14040
|
+
}
|
|
14041
|
+
},
|
|
13934
14042
|
async start(rt, ctx, target, formArgs, signal) {
|
|
13935
14043
|
const merged = completeArgs(binding.path, { ...binding.args(ctx, target), ...formArgs });
|
|
13936
14044
|
if (!merged.ok) return null;
|
|
@@ -13950,8 +14058,7 @@ function defineCommand(binding) {
|
|
|
13950
14058
|
} catch (err) {
|
|
13951
14059
|
const settledByDocument = rendered && binding.result.kind === "notify" && (err instanceof CommandExitError || err instanceof CommandUnobservedError);
|
|
13952
14060
|
if (!rt.fail(err) && !(err instanceof CommandDetachedError) && !settledByDocument) {
|
|
13953
|
-
|
|
13954
|
-
rt.ports.presenter.notify("error", message, ...failure ? [failure] : []);
|
|
14061
|
+
notifyFailure(rt.ports.presenter, err);
|
|
13955
14062
|
}
|
|
13956
14063
|
if (binding.invalidates) rt.tick();
|
|
13957
14064
|
} finally {
|
|
@@ -14058,6 +14165,7 @@ var create = defineCommand({
|
|
|
14058
14165
|
kind: "command",
|
|
14059
14166
|
path: "stack create",
|
|
14060
14167
|
args: (ctx) => ({ source: ctx.root }),
|
|
14168
|
+
preflight: { path: "stack validate", args: (ctx) => ({ source: ctx.root }) },
|
|
14061
14169
|
invalidates: true,
|
|
14062
14170
|
result: {
|
|
14063
14171
|
kind: "notify",
|
|
@@ -14120,6 +14228,13 @@ function validateNotice(v) {
|
|
|
14120
14228
|
const why = whyNotValid(v);
|
|
14121
14229
|
return ["warn", why === void 0 ? "Not valid for Lace" : `Not valid: ${why}`];
|
|
14122
14230
|
}
|
|
14231
|
+
function generateNotice(e) {
|
|
14232
|
+
if (e.validate.exitClass === "ok") return void 0;
|
|
14233
|
+
const tree = generatedTree(e);
|
|
14234
|
+
const count = tree.changed.length + tree.unchanged;
|
|
14235
|
+
const generated2 = count === 0 ? "Generated \u2014 nothing to write" : `Generated \u2014 ${counted(count, "file")} written`;
|
|
14236
|
+
return ["warn", `${generated2}. ${didNotValidate(e.validate)}`, ...beside(e.validate)];
|
|
14237
|
+
}
|
|
14123
14238
|
function convertNotice(e) {
|
|
14124
14239
|
const locked = e.lock === null ? "" : `, locking ${lockedIn(e.lock)}`;
|
|
14125
14240
|
const converted = e.changed ? `Converted \u2014 ${e.written.length} file(s) written${locked}` : "Already lace-style \u2014 nothing to write";
|
|
@@ -14334,6 +14449,11 @@ function inEntryScope(view, ids) {
|
|
|
14334
14449
|
return ids.filter((id) => entry.has(id));
|
|
14335
14450
|
}
|
|
14336
14451
|
|
|
14452
|
+
// src/utils/handleId.ts
|
|
14453
|
+
function isDisconnectable(e) {
|
|
14454
|
+
return !e.target_pin;
|
|
14455
|
+
}
|
|
14456
|
+
|
|
14337
14457
|
// src/registry.ts
|
|
14338
14458
|
var CONTEXT_NEEDS = {
|
|
14339
14459
|
root: "an authoring root",
|
|
@@ -14352,6 +14472,7 @@ var CONTEXT_NEEDS = {
|
|
|
14352
14472
|
"selection.oneScope": "selected nodes that share one scope",
|
|
14353
14473
|
"selection.edge": "one selected connection",
|
|
14354
14474
|
"selection.edges": "selected connections",
|
|
14475
|
+
"selection.disconnectable": "a selected connection that feeds an input",
|
|
14355
14476
|
diagnostics: "diagnostics to show",
|
|
14356
14477
|
settingsOpen: "the settings panel open",
|
|
14357
14478
|
generateIdle: "no Generate running",
|
|
@@ -14405,6 +14526,10 @@ function keySatisfied(ctx, key) {
|
|
|
14405
14526
|
return ctx.view !== void 0 && ctx.selection !== void 0 && inOneScope(ctx.view, ctx.selection.nodes);
|
|
14406
14527
|
if (key === "selection.edge") return wiresAlone(ctx) === 1;
|
|
14407
14528
|
if (key === "selection.edges") return wiresAlone(ctx) > 0;
|
|
14529
|
+
if (key === "selection.disconnectable")
|
|
14530
|
+
return wiresAlone(ctx) > 0 && (ctx.view?.edges ?? []).some(
|
|
14531
|
+
(e) => ctx.selection?.edges.includes(e.id) && isDisconnectable(e)
|
|
14532
|
+
);
|
|
14408
14533
|
if (key === "diagnostics") return ctx.diagnostics !== void 0 && ctx.diagnostics.length > 0;
|
|
14409
14534
|
if (key === "settingsOpen") return ctx.settingsOpen === true;
|
|
14410
14535
|
if (key === "generateIdle") return ctx.generating === false;
|
|
@@ -14461,8 +14586,13 @@ function unmetRequirement(action, ports, ctx, target) {
|
|
|
14461
14586
|
if (target.failure === void 0) return `${label} needs ${TARGET_NEEDS.failure}`;
|
|
14462
14587
|
if (!answersFailure(action, target.failure)) return `${label} does not answer this failure`;
|
|
14463
14588
|
}
|
|
14464
|
-
if (binding.kind === "command"
|
|
14465
|
-
|
|
14589
|
+
if (binding.kind === "command") {
|
|
14590
|
+
const available = availableCommands(ports);
|
|
14591
|
+
for (const path of [binding.path, binding.preflightPath]) {
|
|
14592
|
+
if (path !== void 0 && !available.has(path)) {
|
|
14593
|
+
return `${label} runs lace ${path}, which this host does not route`;
|
|
14594
|
+
}
|
|
14595
|
+
}
|
|
14466
14596
|
}
|
|
14467
14597
|
return void 0;
|
|
14468
14598
|
}
|
|
@@ -14500,6 +14630,8 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14500
14630
|
const tokens = /* @__PURE__ */ new Map();
|
|
14501
14631
|
const clipboard = createClipboardStore();
|
|
14502
14632
|
const notifyControllers = /* @__PURE__ */ new Map();
|
|
14633
|
+
const preflighting = /* @__PURE__ */ new Set();
|
|
14634
|
+
const preflightControllers = /* @__PURE__ */ new Set();
|
|
14503
14635
|
let edits = 0;
|
|
14504
14636
|
const editingListeners = /* @__PURE__ */ new Set();
|
|
14505
14637
|
const tickListeners = /* @__PURE__ */ new Set();
|
|
@@ -14574,6 +14706,15 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14574
14706
|
settled: onSettle
|
|
14575
14707
|
};
|
|
14576
14708
|
}
|
|
14709
|
+
function invocationOf(action, binding, ctx, target, on) {
|
|
14710
|
+
const token = {};
|
|
14711
|
+
const run = { token, path: binding.path, resultKind: binding.resultKind, ctx, target };
|
|
14712
|
+
const started = { target, on, path: binding.path, label: action.label };
|
|
14713
|
+
return {
|
|
14714
|
+
token,
|
|
14715
|
+
runtime: (onSettle) => runtimeFor(token, readOverOf(ctx), cwdOf(action, ctx), { run, started }, onSettle)
|
|
14716
|
+
};
|
|
14717
|
+
}
|
|
14577
14718
|
function readOverOf(ctx) {
|
|
14578
14719
|
return { stack: ctx.stack?.id };
|
|
14579
14720
|
}
|
|
@@ -14606,7 +14747,7 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14606
14747
|
}
|
|
14607
14748
|
function tellFailure(error) {
|
|
14608
14749
|
if (error instanceof CommandDetachedError) return;
|
|
14609
|
-
ports.presenter
|
|
14750
|
+
notifyFailure(ports.presenter, error);
|
|
14610
14751
|
}
|
|
14611
14752
|
async function startCommand(action, ctx, target, formArgs) {
|
|
14612
14753
|
const binding = action.binding;
|
|
@@ -14618,16 +14759,12 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14618
14759
|
ports.presenter.notify("warn", busyReason(busy));
|
|
14619
14760
|
return;
|
|
14620
14761
|
}
|
|
14621
|
-
const
|
|
14622
|
-
const cwd = cwdOf(action, ctx);
|
|
14623
|
-
const token = {};
|
|
14624
|
-
const run = { token, path: binding.path, resultKind: binding.resultKind, ctx, target };
|
|
14625
|
-
const started = { target, on, path: binding.path, label: action.label };
|
|
14762
|
+
const { token, runtime } = invocationOf(action, binding, ctx, target, on);
|
|
14626
14763
|
const controller = new AbortController();
|
|
14627
14764
|
if (binding.resultKind === "notify") {
|
|
14628
14765
|
notifyControllers.set(controller, token);
|
|
14629
14766
|
await binding.start(
|
|
14630
|
-
|
|
14767
|
+
runtime(() => {
|
|
14631
14768
|
notifyControllers.delete(controller);
|
|
14632
14769
|
store.detach("notify", token);
|
|
14633
14770
|
}),
|
|
@@ -14641,18 +14778,33 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14641
14778
|
detachSlot(binding.resultKind);
|
|
14642
14779
|
controllers.set(binding.resultKind, controller);
|
|
14643
14780
|
tokens.set(binding.resultKind, token);
|
|
14644
|
-
const handle = await binding.start(
|
|
14645
|
-
runtimeFor(token, readOver, cwd, { run, started }),
|
|
14646
|
-
ctx,
|
|
14647
|
-
target,
|
|
14648
|
-
formArgs,
|
|
14649
|
-
controller.signal
|
|
14650
|
-
);
|
|
14781
|
+
const handle = await binding.start(runtime(), ctx, target, formArgs, controller.signal);
|
|
14651
14782
|
if (handle) handles.set(binding.resultKind, handle);
|
|
14652
14783
|
}
|
|
14653
14784
|
async function runCommand(action, ctx, target) {
|
|
14654
14785
|
const binding = action.binding;
|
|
14655
14786
|
if (binding.kind !== "command") return;
|
|
14787
|
+
if (binding.preflightPath !== void 0) {
|
|
14788
|
+
if (preflighting.has(action.id)) return;
|
|
14789
|
+
preflighting.add(action.id);
|
|
14790
|
+
const { token, runtime } = invocationOf(
|
|
14791
|
+
action,
|
|
14792
|
+
binding,
|
|
14793
|
+
ctx,
|
|
14794
|
+
target,
|
|
14795
|
+
runsOn(action, ctx, target)
|
|
14796
|
+
);
|
|
14797
|
+
const rt = runtime(() => store.detach("notify", token));
|
|
14798
|
+
const controller = new AbortController();
|
|
14799
|
+
preflightControllers.add(controller);
|
|
14800
|
+
if (binding.resultKind === "notify") rt.begin();
|
|
14801
|
+
const proceed = await binding.preflight(rt, ctx, target, controller.signal).finally(() => {
|
|
14802
|
+
if (binding.resultKind === "notify") rt.settled?.();
|
|
14803
|
+
preflighting.delete(action.id);
|
|
14804
|
+
preflightControllers.delete(controller);
|
|
14805
|
+
});
|
|
14806
|
+
if (!proceed) return;
|
|
14807
|
+
}
|
|
14656
14808
|
const completion = completeArgs(binding.path, binding.partialArgs(ctx, target));
|
|
14657
14809
|
if (!completion.ok) {
|
|
14658
14810
|
if (!options.onPendingFormChange) {
|
|
@@ -14688,6 +14840,7 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14688
14840
|
ctx,
|
|
14689
14841
|
target,
|
|
14690
14842
|
clipboard,
|
|
14843
|
+
dissolved: options.onDissolved,
|
|
14691
14844
|
...envExtras
|
|
14692
14845
|
};
|
|
14693
14846
|
if (binding.result === "apply") {
|
|
@@ -14696,6 +14849,10 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14696
14849
|
if (binding.result === "generate") {
|
|
14697
14850
|
for await (const event of binding.run(env)) {
|
|
14698
14851
|
if (event.type === "error") ports.presenter.notify("error", event.message);
|
|
14852
|
+
if (event.type === "success") {
|
|
14853
|
+
const notice = generateNotice(event);
|
|
14854
|
+
if (notice) ports.presenter.notify(...notice);
|
|
14855
|
+
}
|
|
14699
14856
|
}
|
|
14700
14857
|
return;
|
|
14701
14858
|
}
|
|
@@ -14781,6 +14938,7 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14781
14938
|
store.detach("notify", token);
|
|
14782
14939
|
}
|
|
14783
14940
|
notifyControllers.clear();
|
|
14941
|
+
for (const controller of preflightControllers) controller.abort();
|
|
14784
14942
|
tickListeners.clear();
|
|
14785
14943
|
}
|
|
14786
14944
|
};
|
|
@@ -14804,6 +14962,28 @@ function proposeStackSlug(folder) {
|
|
|
14804
14962
|
return "";
|
|
14805
14963
|
}
|
|
14806
14964
|
|
|
14965
|
+
// src/utils/wire-end.ts
|
|
14966
|
+
var import_proto3 = require("@lace-cloud/proto");
|
|
14967
|
+
function wireEnd(wire, end) {
|
|
14968
|
+
const source = end === "source";
|
|
14969
|
+
const node = source ? wire.source : wire.target;
|
|
14970
|
+
const pin = source ? wire.source_output : wire.target_input;
|
|
14971
|
+
if (source ? wire.source_pin : wire.target_pin) return { kind: "group-pin", node, pin };
|
|
14972
|
+
if (source && !pin) return { kind: "call", node };
|
|
14973
|
+
return { kind: "pin", node, pin };
|
|
14974
|
+
}
|
|
14975
|
+
function wireEndText(wire, end, pinText) {
|
|
14976
|
+
const part = wireEnd(wire, end);
|
|
14977
|
+
switch (part.kind) {
|
|
14978
|
+
case "group-pin":
|
|
14979
|
+
return (0, import_proto3.groupPinText)(part.node, end, part.pin);
|
|
14980
|
+
case "call":
|
|
14981
|
+
return (0, import_proto3.callText)(part.node);
|
|
14982
|
+
case "pin":
|
|
14983
|
+
return pinText(part.node, part.pin, end);
|
|
14984
|
+
}
|
|
14985
|
+
}
|
|
14986
|
+
|
|
14807
14987
|
// src/engine/autosave.ts
|
|
14808
14988
|
var AutosaveEndedError = class extends Error {
|
|
14809
14989
|
constructor(reason) {
|
|
@@ -14943,6 +15123,8 @@ function autosave(source, save, policy, report) {
|
|
|
14943
15123
|
settleRun,
|
|
14944
15124
|
stackSlugRule,
|
|
14945
15125
|
toArgv,
|
|
14946
|
-
uniqueDiagnostics
|
|
15126
|
+
uniqueDiagnostics,
|
|
15127
|
+
wireEnd,
|
|
15128
|
+
wireEndText
|
|
14947
15129
|
});
|
|
14948
15130
|
//# sourceMappingURL=index.cjs.map
|