@lace-cloud/canvas 0.34.0 → 0.36.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.
@@ -3779,7 +3779,7 @@ var InitializeRequest = {
3779
3779
  }
3780
3780
  };
3781
3781
  function createBaseInitializeResponse() {
3782
- return { server_version: "", protocol_version: "", supported_protocols: [], command_paths: [] };
3782
+ return { server_version: "", protocol_version: "", supported_protocols: [], command_paths: [], contract: "" };
3783
3783
  }
3784
3784
  var InitializeResponse = {
3785
3785
  encode(message, writer = new import_wire4.BinaryWriter()) {
@@ -3795,6 +3795,9 @@ var InitializeResponse = {
3795
3795
  for (const v of message.command_paths) {
3796
3796
  writer.uint32(42).string(v);
3797
3797
  }
3798
+ if (message.contract !== "") {
3799
+ writer.uint32(50).string(message.contract);
3800
+ }
3798
3801
  return writer;
3799
3802
  },
3800
3803
  decode(input, length) {
@@ -3832,6 +3835,13 @@ var InitializeResponse = {
3832
3835
  message.command_paths.push(reader.string());
3833
3836
  continue;
3834
3837
  }
3838
+ case 6: {
3839
+ if (tag !== 50) {
3840
+ break;
3841
+ }
3842
+ message.contract = reader.string();
3843
+ continue;
3844
+ }
3835
3845
  }
3836
3846
  if ((tag & 7) === 4 || tag === 0) {
3837
3847
  break;
@@ -3845,7 +3855,8 @@ var InitializeResponse = {
3845
3855
  server_version: isSet3(object.serverVersion) ? globalThis.String(object.serverVersion) : isSet3(object.server_version) ? globalThis.String(object.server_version) : "",
3846
3856
  protocol_version: isSet3(object.protocolVersion) ? globalThis.String(object.protocolVersion) : isSet3(object.protocol_version) ? globalThis.String(object.protocol_version) : "",
3847
3857
  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)) : []
3858
+ 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)) : [],
3859
+ contract: isSet3(object.contract) ? globalThis.String(object.contract) : ""
3849
3860
  };
3850
3861
  },
3851
3862
  toJSON(message) {
@@ -3862,6 +3873,9 @@ var InitializeResponse = {
3862
3873
  if (message.command_paths?.length) {
3863
3874
  obj.commandPaths = message.command_paths;
3864
3875
  }
3876
+ if (message.contract !== "") {
3877
+ obj.contract = message.contract;
3878
+ }
3865
3879
  return obj;
3866
3880
  },
3867
3881
  create(base) {
@@ -3873,6 +3887,7 @@ var InitializeResponse = {
3873
3887
  message.protocol_version = object.protocol_version ?? "";
3874
3888
  message.supported_protocols = object.supported_protocols?.map((e) => e) || [];
3875
3889
  message.command_paths = object.command_paths?.map((e) => e) || [];
3890
+ message.contract = object.contract ?? "";
3876
3891
  return message;
3877
3892
  }
3878
3893
  };
@@ -11747,6 +11762,13 @@ var COMMANDS = {
11747
11762
  },
11748
11763
  "readme": {
11749
11764
  "type": "string"
11765
+ },
11766
+ "visibility": {
11767
+ "type": "string",
11768
+ "values": [
11769
+ "public",
11770
+ "org_private"
11771
+ ]
11750
11772
  }
11751
11773
  },
11752
11774
  "effect": "read",
@@ -12520,7 +12542,6 @@ var commandFailureSchema = import_zod.z.strictObject({
12520
12542
  var moduleValidateDeviationSchema = import_zod.z.object({
12521
12543
  notCompositional: import_zod.z.boolean(),
12522
12544
  clusters: import_zod.z.array(import_zod.z.unknown()),
12523
- residuals: import_zod.z.array(import_zod.z.unknown()),
12524
12545
  hasManagedBackend: import_zod.z.boolean(),
12525
12546
  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
12547
  sharedLocalSource: import_zod.z.boolean(),
@@ -12616,7 +12637,8 @@ var registryListSchema = import_zod.z.object({
12616
12637
  })
12617
12638
  ),
12618
12639
  truncated: import_zod.z.boolean(),
12619
- publishingGuideUrl: import_zod.z.string()
12640
+ publishingGuideUrl: import_zod.z.string(),
12641
+ scopeNotice: import_zod.z.string().optional()
12620
12642
  });
12621
12643
  var registryManifestSchema = import_zod.z.object({
12622
12644
  id: import_zod.z.string(),
@@ -12634,7 +12656,7 @@ var registryManifestSchema = import_zod.z.object({
12634
12656
  readme: import_zod.z.string().nullable(),
12635
12657
  vendor: registryVendorSchema,
12636
12658
  status: import_zod.z.string(),
12637
- installCount: import_zod.z.number(),
12659
+ installCount: import_zod.z.number().optional(),
12638
12660
  publishedAt: import_zod.z.string().nullable(),
12639
12661
  publishedBy: import_zod.z.string().nullable(),
12640
12662
  createdAt: import_zod.z.string(),
@@ -12818,7 +12840,7 @@ var runSchema = reads()(
12818
12840
  planHumanLocation: import_zod.z.string().nullable(),
12819
12841
  applyLogLocation: import_zod.z.string().nullable(),
12820
12842
  policyResultsLocation: import_zod.z.string().nullable(),
12821
- policyPassed: import_zod.z.boolean().nullable(),
12843
+ policyEvaluatedWithoutBlock: import_zod.z.boolean().nullable(),
12822
12844
  policyResolution: import_zod.z.unknown().nullable(),
12823
12845
  changeRequestId: import_zod.z.string().nullable(),
12824
12846
  cancelReason: import_zod.z.string().nullable(),
@@ -13194,7 +13216,11 @@ async function initialize(caller) {
13194
13216
  client_version: "@lace-cloud/canvas",
13195
13217
  protocol_version: import_proto2.ENGINE_PROTOCOL_VERSION
13196
13218
  });
13197
- (0, import_proto2.checkEngineProtocol)(initialize2.server_version, initialize2.protocol_version);
13219
+ (0, import_proto2.checkEngineIdentity)({
13220
+ version: initialize2.server_version,
13221
+ protocol: initialize2.protocol_version,
13222
+ contract: initialize2.contract
13223
+ });
13198
13224
  return new Set(initialize2.command_paths);
13199
13225
  }
13200
13226
  async function openEngineCommands(caller, { cwd }) {
@@ -13636,7 +13662,11 @@ function diagnosticsOfDocument(document) {
13636
13662
  }));
13637
13663
  }
13638
13664
  function diagnosticsOfEntry(entry) {
13639
- return entry.kind === "failure" ? [{ severity: "error", message: entry.failure.message }] : diagnosticsOfDocument(entry.document);
13665
+ if (entry.kind === "failure") return [{ severity: "error", message: entry.failure.message }];
13666
+ const found = diagnosticsOfDocument(entry.document);
13667
+ if (entry.path !== "module validate") return found;
13668
+ const { failure } = entry.document;
13669
+ return failure && !found.some((d) => d.severity === "error") ? [...found, { severity: "error", message: failure.message }] : found;
13640
13670
  }
13641
13671
  function reportDiagnostics(fold) {
13642
13672
  return uniqueDiagnostics(
@@ -14120,6 +14150,13 @@ function validateNotice(v) {
14120
14150
  const why = whyNotValid(v);
14121
14151
  return ["warn", why === void 0 ? "Not valid for Lace" : `Not valid: ${why}`];
14122
14152
  }
14153
+ function generateNotice(e) {
14154
+ if (e.validate.exitClass === "ok") return void 0;
14155
+ const tree = generatedTree(e);
14156
+ const count = tree.changed.length + tree.unchanged;
14157
+ const generated2 = count === 0 ? "Generated \u2014 nothing to write" : `Generated \u2014 ${counted(count, "file")} written`;
14158
+ return ["warn", `${generated2}. ${didNotValidate(e.validate)}`, ...beside(e.validate)];
14159
+ }
14123
14160
  function convertNotice(e) {
14124
14161
  const locked = e.lock === null ? "" : `, locking ${lockedIn(e.lock)}`;
14125
14162
  const converted = e.changed ? `Converted \u2014 ${e.written.length} file(s) written${locked}` : "Already lace-style \u2014 nothing to write";
@@ -14696,6 +14733,10 @@ function createActionRunner(ports, store, options = {}) {
14696
14733
  if (binding.result === "generate") {
14697
14734
  for await (const event of binding.run(env)) {
14698
14735
  if (event.type === "error") ports.presenter.notify("error", event.message);
14736
+ if (event.type === "success") {
14737
+ const notice = generateNotice(event);
14738
+ if (notice) ports.presenter.notify(...notice);
14739
+ }
14699
14740
  }
14700
14741
  return;
14701
14742
  }