@firfi/huly-mcp 0.10.0 → 0.10.1

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/index.cjs CHANGED
@@ -31044,7 +31044,7 @@ var require_utils2 = __commonJS({
31044
31044
  escapeLikeForRegexp: () => escapeLikeForRegexp,
31045
31045
  fillConfiguration: () => fillConfiguration,
31046
31046
  fillDefaults: () => fillDefaults,
31047
- generateId: () => generateId23,
31047
+ generateId: () => generateId24,
31048
31048
  generateUuid: () => generateUuid,
31049
31049
  getBranding: () => getBranding,
31050
31050
  getCurrentAccount: () => getCurrentAccount,
@@ -31105,10 +31105,10 @@ var require_utils2 = __commonJS({
31105
31105
  return toHex(val, 6);
31106
31106
  }
31107
31107
  __name(count3, "count");
31108
- function generateId23(join4 = "") {
31108
+ function generateId24(join4 = "") {
31109
31109
  return timestamp() + join4 + random4 + join4 + count3();
31110
31110
  }
31111
- __name(generateId23, "generateId");
31111
+ __name(generateId24, "generateId");
31112
31112
  function generateUuid() {
31113
31113
  return crypto.randomUUID();
31114
31114
  }
@@ -34077,15 +34077,15 @@ var require_storage = __commonJS({
34077
34077
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
34078
34078
  var storage_exports = {};
34079
34079
  __export2(storage_exports, {
34080
- SortingOrder: () => SortingOrder29,
34080
+ SortingOrder: () => SortingOrder30,
34081
34081
  shouldShowArchived: () => shouldShowArchived
34082
34082
  });
34083
34083
  module2.exports = __toCommonJS2(storage_exports);
34084
- var SortingOrder29 = /* @__PURE__ */ ((SortingOrder210) => {
34084
+ var SortingOrder30 = /* @__PURE__ */ ((SortingOrder210) => {
34085
34085
  SortingOrder210[SortingOrder210["Ascending"] = 1] = "Ascending";
34086
34086
  SortingOrder210[SortingOrder210["Descending"] = -1] = "Descending";
34087
34087
  return SortingOrder210;
34088
- })(SortingOrder29 || {});
34088
+ })(SortingOrder30 || {});
34089
34089
  function shouldShowArchived(query, options) {
34090
34090
  if (options?.showArchived !== void 0) {
34091
34091
  return options.showArchived;
@@ -34588,7 +34588,7 @@ var require_client3 = __commonJS({
34588
34588
  getClient: () => getClient
34589
34589
  });
34590
34590
  module2.exports = __toCommonJS2(client_exports);
34591
- var import_core50 = require_lib4();
34591
+ var import_core51 = require_lib4();
34592
34592
  var import_platform3 = __toESM2(require_lib());
34593
34593
  var import_utils14 = require_utils3();
34594
34594
  function getClient(accountsUrl, token, retryTimeoutMs) {
@@ -34624,7 +34624,7 @@ var require_client3 = __commonJS({
34624
34624
  rpc;
34625
34625
  async getProviders() {
34626
34626
  return await withRetryUntilMaxAttempts(async () => {
34627
- const response = await fetch((0, import_core50.concatLink)(this.url, "/providers"));
34627
+ const response = await fetch((0, import_core51.concatLink)(this.url, "/providers"));
34628
34628
  return await response.json();
34629
34629
  })();
34630
34630
  }
@@ -35279,7 +35279,7 @@ var require_client3 = __commonJS({
35279
35279
  await this.rpc(request2);
35280
35280
  }
35281
35281
  async setCookie() {
35282
- const url4 = (0, import_core50.concatLink)(this.url, "/cookie");
35282
+ const url4 = (0, import_core51.concatLink)(this.url, "/cookie");
35283
35283
  const response = await fetch(url4, { ...this.request, method: "PUT" });
35284
35284
  if (!response.ok) {
35285
35285
  const result = await response.json();
@@ -35289,7 +35289,7 @@ var require_client3 = __commonJS({
35289
35289
  }
35290
35290
  }
35291
35291
  async deleteCookie() {
35292
- const url4 = (0, import_core50.concatLink)(this.url, "/cookie");
35292
+ const url4 = (0, import_core51.concatLink)(this.url, "/cookie");
35293
35293
  const response = await fetch(url4, { ...this.request, method: "DELETE" });
35294
35294
  if (!response.ok) {
35295
35295
  const result = await response.json();
@@ -35568,9 +35568,9 @@ var require_config = __commonJS({
35568
35568
  loadServerConfig: () => loadServerConfig2
35569
35569
  });
35570
35570
  module2.exports = __toCommonJS2(config_exports3);
35571
- var import_core50 = require_lib4();
35571
+ var import_core51 = require_lib4();
35572
35572
  async function loadServerConfig2(url4) {
35573
- const configUrl = (0, import_core50.concatLink)(url4, "/config.json");
35573
+ const configUrl = (0, import_core51.concatLink)(url4, "/config.json");
35574
35574
  const res = await fetch(configUrl, { keepalive: true });
35575
35575
  if (res.ok) {
35576
35576
  return await res.json();
@@ -35656,7 +35656,7 @@ var require_client4 = __commonJS({
35656
35656
  getClient: () => getClient
35657
35657
  });
35658
35658
  module2.exports = __toCommonJS2(client_exports);
35659
- var import_core50 = require_lib4();
35659
+ var import_core51 = require_lib4();
35660
35660
  var import_utils14 = require_utils4();
35661
35661
  function getClient(workspaceId, token, collaboratorUrl) {
35662
35662
  const url4 = collaboratorUrl.replaceAll("wss://", "https://").replace("ws://", "http://");
@@ -35675,7 +35675,7 @@ var require_client4 = __commonJS({
35675
35675
  async rpc(document2, method, payload) {
35676
35676
  const workspace = this.workspace;
35677
35677
  const documentId = (0, import_utils14.encodeDocumentId)(workspace, document2);
35678
- const url4 = (0, import_core50.concatLink)(this.collaboratorUrl, `/rpc/${encodeURIComponent(documentId)}`);
35678
+ const url4 = (0, import_core51.concatLink)(this.collaboratorUrl, `/rpc/${encodeURIComponent(documentId)}`);
35679
35679
  const res = await fetch(url4, {
35680
35680
  method: "POST",
35681
35681
  headers: {
@@ -53242,9 +53242,9 @@ var require_image = __commonJS({
53242
53242
  ImageNode: () => ImageNode
53243
53243
  });
53244
53244
  module2.exports = __toCommonJS2(image_exports);
53245
- var import_core50 = require_dist16();
53245
+ var import_core51 = require_dist16();
53246
53246
  var import_utils14 = require_utils5();
53247
- var ImageNode = import_core50.Node.create({
53247
+ var ImageNode = import_core51.Node.create({
53248
53248
  name: "image",
53249
53249
  addOptions() {
53250
53250
  return {
@@ -53303,7 +53303,7 @@ var require_image = __commonJS({
53303
53303
  "data-type": this.name,
53304
53304
  "data-align": node.attrs.align
53305
53305
  };
53306
- const imgAttributes = (0, import_core50.mergeAttributes)(
53306
+ const imgAttributes = (0, import_core51.mergeAttributes)(
53307
53307
  {
53308
53308
  "data-type": this.name
53309
53309
  },
@@ -53347,9 +53347,9 @@ var require_reference = __commonJS({
53347
53347
  ReferenceNode: () => ReferenceNode
53348
53348
  });
53349
53349
  module2.exports = __toCommonJS2(reference_exports);
53350
- var import_core50 = require_dist16();
53350
+ var import_core51 = require_dist16();
53351
53351
  var import_utils14 = require_utils5();
53352
- var ReferenceNode = import_core50.Node.create({
53352
+ var ReferenceNode = import_core51.Node.create({
53353
53353
  name: "reference",
53354
53354
  group: "inline",
53355
53355
  inline: true,
@@ -53384,7 +53384,7 @@ var require_reference = __commonJS({
53384
53384
  renderHTML({ node, HTMLAttributes }) {
53385
53385
  return [
53386
53386
  "span",
53387
- (0, import_core50.mergeAttributes)(
53387
+ (0, import_core51.mergeAttributes)(
53388
53388
  {
53389
53389
  "data-type": this.name,
53390
53390
  "data-id": node.attrs.id,
@@ -53443,8 +53443,8 @@ var require_emoji = __commonJS({
53443
53443
  EmojiNode: () => EmojiNode
53444
53444
  });
53445
53445
  module2.exports = __toCommonJS2(emoji_exports);
53446
- var import_core50 = require_dist16();
53447
- var EmojiNode = import_core50.Node.create({
53446
+ var import_core51 = require_dist16();
53447
+ var EmojiNode = import_core51.Node.create({
53448
53448
  name: "emoji",
53449
53449
  group: "inline",
53450
53450
  inline: true,
@@ -53484,7 +53484,7 @@ var require_emoji = __commonJS({
53484
53484
  addNodeView() {
53485
53485
  return ({ node, HTMLAttributes }) => {
53486
53486
  const container = document.createElement("span");
53487
- const containerAttributes = (0, import_core50.mergeAttributes)(
53487
+ const containerAttributes = (0, import_core51.mergeAttributes)(
53488
53488
  {
53489
53489
  "data-type": this.name,
53490
53490
  class: "emoji"
@@ -53517,7 +53517,7 @@ var require_emoji = __commonJS({
53517
53517
  if (node.attrs.kind === "image") {
53518
53518
  return [
53519
53519
  "span",
53520
- (0, import_core50.mergeAttributes)(
53520
+ (0, import_core51.mergeAttributes)(
53521
53521
  {
53522
53522
  "data-type": this.name,
53523
53523
  class: "emoji"
@@ -53526,7 +53526,7 @@ var require_emoji = __commonJS({
53526
53526
  ),
53527
53527
  [
53528
53528
  "img",
53529
- (0, import_core50.mergeAttributes)({
53529
+ (0, import_core51.mergeAttributes)({
53530
53530
  "data-type": this.name,
53531
53531
  src: node.attrs.image,
53532
53532
  alt: node.attrs.emoji
@@ -53536,7 +53536,7 @@ var require_emoji = __commonJS({
53536
53536
  }
53537
53537
  return [
53538
53538
  "span",
53539
- (0, import_core50.mergeAttributes)(
53539
+ (0, import_core51.mergeAttributes)(
53540
53540
  {
53541
53541
  "data-type": this.name,
53542
53542
  class: "emoji"
@@ -53844,8 +53844,8 @@ var require_file = __commonJS({
53844
53844
  FileNode: () => FileNode
53845
53845
  });
53846
53846
  module2.exports = __toCommonJS2(file_exports);
53847
- var import_core50 = require_dist16();
53848
- var FileNode = import_core50.Node.create({
53847
+ var import_core51 = require_dist16();
53848
+ var FileNode = import_core51.Node.create({
53849
53849
  name: "file",
53850
53850
  addOptions() {
53851
53851
  return {
@@ -54155,7 +54155,7 @@ var require_codeblock = __commonJS({
54155
54155
  tildeInputRegex: () => tildeInputRegex
54156
54156
  });
54157
54157
  module2.exports = __toCommonJS2(codeblock_exports);
54158
- var import_core50 = require_dist16();
54158
+ var import_core51 = require_dist16();
54159
54159
  var import_extension_code_block = __toESM2(require_dist19());
54160
54160
  var codeBlockOptions = {
54161
54161
  defaultLanguage: "plaintext",
@@ -54201,11 +54201,11 @@ var require_codeblock = __commonJS({
54201
54201
  },
54202
54202
  addInputRules() {
54203
54203
  return [
54204
- (0, import_core50.textblockTypeInputRule)({
54204
+ (0, import_core51.textblockTypeInputRule)({
54205
54205
  find: backtickInputRegex,
54206
54206
  type: this.type
54207
54207
  }),
54208
- (0, import_core50.textblockTypeInputRule)({
54208
+ (0, import_core51.textblockTypeInputRule)({
54209
54209
  find: tildeInputRegex,
54210
54210
  type: this.type
54211
54211
  })
@@ -54241,8 +54241,8 @@ var require_comment = __commonJS({
54241
54241
  CommentNode: () => CommentNode
54242
54242
  });
54243
54243
  module2.exports = __toCommonJS2(comment_exports);
54244
- var import_core50 = require_dist16();
54245
- var CommentNode = import_core50.Node.create({
54244
+ var import_core51 = require_dist16();
54245
+ var CommentNode = import_core51.Node.create({
54246
54246
  name: "comment",
54247
54247
  group: "inline",
54248
54248
  inline: true,
@@ -54288,8 +54288,8 @@ var require_markdown = __commonJS({
54288
54288
  MarkdownNode: () => MarkdownNode
54289
54289
  });
54290
54290
  module2.exports = __toCommonJS2(markdown_exports);
54291
- var import_core50 = require_dist16();
54292
- var MarkdownNode = import_core50.Node.create({
54291
+ var import_core51 = require_dist16();
54292
+ var MarkdownNode = import_core51.Node.create({
54293
54293
  name: "markdown",
54294
54294
  group: "block",
54295
54295
  content: "text*",
@@ -54307,7 +54307,7 @@ var require_markdown = __commonJS({
54307
54307
  renderHTML({ node, HTMLAttributes }) {
54308
54308
  return [
54309
54309
  "pre",
54310
- (0, import_core50.mergeAttributes)({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
54310
+ (0, import_core51.mergeAttributes)({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
54311
54311
  ["code", {}, 0]
54312
54312
  ];
54313
54313
  }
@@ -54341,8 +54341,8 @@ var require_embed = __commonJS({
54341
54341
  EmbedNode: () => EmbedNode
54342
54342
  });
54343
54343
  module2.exports = __toCommonJS2(embed_exports);
54344
- var import_core50 = require_dist16();
54345
- var EmbedNode = import_core50.Node.create({
54344
+ var import_core51 = require_dist16();
54345
+ var EmbedNode = import_core51.Node.create({
54346
54346
  name: "embed",
54347
54347
  addOptions() {
54348
54348
  return {};
@@ -54367,7 +54367,7 @@ var require_embed = __commonJS({
54367
54367
  ];
54368
54368
  },
54369
54369
  renderHTML({ HTMLAttributes }) {
54370
- return ["figure", { "data-type": this.name }, ["iframe", (0, import_core50.mergeAttributes)(HTMLAttributes)]];
54370
+ return ["figure", { "data-type": this.name }, ["iframe", (0, import_core51.mergeAttributes)(HTMLAttributes)]];
54371
54371
  }
54372
54372
  });
54373
54373
  }
@@ -54441,7 +54441,7 @@ var require_noteBase = __commonJS({
54441
54441
  name: () => name
54442
54442
  });
54443
54443
  module2.exports = __toCommonJS2(noteBase_exports);
54444
- var import_core50 = require_dist16();
54444
+ var import_core51 = require_dist16();
54445
54445
  var import_nodes = require_nodes();
54446
54446
  var name = "note";
54447
54447
  var NoteKind = /* @__PURE__ */ ((NoteKind2) => {
@@ -54456,7 +54456,7 @@ var require_noteBase = __commonJS({
54456
54456
  NoteKind2["PrimaryLight"] = "primary-light";
54457
54457
  return NoteKind2;
54458
54458
  })(NoteKind || {});
54459
- var NoteBaseExtension = import_core50.Mark.create({
54459
+ var NoteBaseExtension = import_core51.Mark.create({
54460
54460
  name,
54461
54461
  parseHTML() {
54462
54462
  return [
@@ -54513,9 +54513,9 @@ var require_qmsInlineCommentMark = __commonJS({
54513
54513
  QMSInlineCommentMark: () => QMSInlineCommentMark
54514
54514
  });
54515
54515
  module2.exports = __toCommonJS2(qmsInlineCommentMark_exports);
54516
- var import_core50 = require_dist16();
54516
+ var import_core51 = require_dist16();
54517
54517
  var NAME2 = "node-uuid";
54518
- var QMSInlineCommentMark = import_core50.Mark.create({
54518
+ var QMSInlineCommentMark = import_core51.Mark.create({
54519
54519
  name: NAME2,
54520
54520
  inline: true,
54521
54521
  parseHTML() {
@@ -54560,9 +54560,9 @@ var require_kit = __commonJS({
54560
54560
  mergeKitOptions: () => mergeKitOptions
54561
54561
  });
54562
54562
  module2.exports = __toCommonJS2(kit_exports);
54563
- var import_core50 = require_dist16();
54563
+ var import_core51 = require_dist16();
54564
54564
  function extensionKit(name, fn2) {
54565
- return import_core50.Extension.create({
54565
+ return import_core51.Extension.create({
54566
54566
  name,
54567
54567
  addExtensions() {
54568
54568
  const e = /* @__PURE__ */ __name((extension, options) => {
@@ -61591,9 +61591,9 @@ var require_colors = __commonJS({
61591
61591
  TextColor: () => TextColor
61592
61592
  });
61593
61593
  module2.exports = __toCommonJS2(colors_exports);
61594
- var import_core50 = require_dist16();
61594
+ var import_core51 = require_dist16();
61595
61595
  var import_extension_text_style = require_dist20();
61596
- var BackgroundColor = import_core50.Extension.create({
61596
+ var BackgroundColor = import_core51.Extension.create({
61597
61597
  name: "backgroundColor",
61598
61598
  addOptions() {
61599
61599
  return {
@@ -61634,7 +61634,7 @@ var require_colors = __commonJS({
61634
61634
  };
61635
61635
  }
61636
61636
  });
61637
- var TextColor = import_core50.Extension.create({
61637
+ var TextColor = import_core51.Extension.create({
61638
61638
  name: "textColor",
61639
61639
  addOptions() {
61640
61640
  return {
@@ -61706,10 +61706,10 @@ var require_inlineComment = __commonJS({
61706
61706
  InlineCommentPasteFixPlugin: () => InlineCommentPasteFixPlugin
61707
61707
  });
61708
61708
  module2.exports = __toCommonJS2(inlineComment_exports);
61709
- var import_core50 = require_dist16();
61709
+ var import_core51 = require_dist16();
61710
61710
  var import_model = require_dist10();
61711
61711
  var import_state = require_dist5();
61712
- var InlineCommentMark = import_core50.Mark.create({
61712
+ var InlineCommentMark = import_core51.Mark.create({
61713
61713
  name: "inline-comment",
61714
61714
  excludes: "",
61715
61715
  inclusive: false,
@@ -77233,7 +77233,7 @@ var require_client5 = __commonJS({
77233
77233
  createMarkupOperations: () => createMarkupOperations
77234
77234
  });
77235
77235
  module2.exports = __toCommonJS2(client_exports);
77236
- var import_core50 = require_lib4();
77236
+ var import_core51 = require_lib4();
77237
77237
  var import_collaborator_client2 = require_lib7();
77238
77238
  var import_text4 = require_lib9();
77239
77239
  var import_text_markdown3 = require_lib17();
@@ -77247,8 +77247,8 @@ var require_client5 = __commonJS({
77247
77247
  this.workspace = workspace;
77248
77248
  this.token = token;
77249
77249
  this.config = config3;
77250
- this.refUrl = (0, import_core50.concatLink)(this.url, `/browse?workspace=${workspace}`);
77251
- this.imageUrl = (0, import_core50.concatLink)(this.url, `/files?workspace=${workspace}&file=`);
77250
+ this.refUrl = (0, import_core51.concatLink)(this.url, `/browse?workspace=${workspace}`);
77251
+ this.imageUrl = (0, import_core51.concatLink)(this.url, `/files?workspace=${workspace}&file=`);
77252
77252
  this.collaborator = (0, import_collaborator_client2.getClient)(workspace, token, config3.COLLABORATOR_URL);
77253
77253
  }
77254
77254
  static {
@@ -77258,7 +77258,7 @@ var require_client5 = __commonJS({
77258
77258
  imageUrl;
77259
77259
  refUrl;
77260
77260
  async fetchMarkup(objectClass, objectId, objectAttr, doc, format7) {
77261
- const collabId = (0, import_core50.makeCollabId)(objectClass, objectId, objectAttr);
77261
+ const collabId = (0, import_core51.makeCollabId)(objectClass, objectId, objectAttr);
77262
77262
  const markup = await this.collaborator.getMarkup(collabId, doc);
77263
77263
  const json3 = (0, import_text4.markupToJSON)(markup);
77264
77264
  switch (format7) {
@@ -77287,7 +77287,7 @@ var require_client5 = __commonJS({
77287
77287
  default:
77288
77288
  throw new Error("Unknown content format");
77289
77289
  }
77290
- const collabId = (0, import_core50.makeCollabId)(objectClass, objectId, objectAttr);
77290
+ const collabId = (0, import_core51.makeCollabId)(objectClass, objectId, objectAttr);
77291
77291
  return await this.collaborator.createMarkup(collabId, markup);
77292
77292
  }
77293
77293
  };
@@ -81771,8 +81771,8 @@ var require_connection2 = __commonJS({
81771
81771
  });
81772
81772
  module2.exports = __toCommonJS2(connection_exports);
81773
81773
  var import_analytics = require_lib2();
81774
- var import_client29 = __toESM2(require_lib6());
81775
- var import_core50 = __toESM2(require_lib4());
81774
+ var import_client30 = __toESM2(require_lib6());
81775
+ var import_core51 = __toESM2(require_lib4());
81776
81776
  var import_platform3 = __toESM2(require_lib());
81777
81777
  var import_rpc = require_lib18();
81778
81778
  var import_snappyjs = require_snappyjs();
@@ -81816,7 +81816,7 @@ var require_connection2 = __commonJS({
81816
81816
  const sKey = "session.id." + this.url;
81817
81817
  let sessionId = sessionStorage.getItem(sKey) ?? void 0;
81818
81818
  if (sessionId === void 0) {
81819
- sessionId = (0, import_core50.generateId)();
81819
+ sessionId = (0, import_core51.generateId)();
81820
81820
  console.log("Generate new SessionId", sessionId);
81821
81821
  this.sessionId = sessionId;
81822
81822
  } else {
@@ -81827,7 +81827,7 @@ var require_connection2 = __commonJS({
81827
81827
  sessionStorage.setItem(sKey, sessionId);
81828
81828
  });
81829
81829
  } else {
81830
- this.sessionId = (0, import_core50.generateId)();
81830
+ this.sessionId = (0, import_core51.generateId)();
81831
81831
  }
81832
81832
  this.rpcHandler = opt?.useGlobalRPCHandler === true ? globalRPCHandler : new import_rpc.RPCHandler();
81833
81833
  this.pushHandler(handler);
@@ -81882,7 +81882,7 @@ var require_connection2 = __commonJS({
81882
81882
  }
81883
81883
  if (!this.closed) {
81884
81884
  void this.sendRequest({
81885
- method: import_client29.pingConst,
81885
+ method: import_client30.pingConst,
81886
81886
  params: [],
81887
81887
  once: true,
81888
81888
  handleResult: /* @__PURE__ */ __name(async (result) => {
@@ -81915,7 +81915,7 @@ var require_connection2 = __commonJS({
81915
81915
  }
81916
81916
  }
81917
81917
  isConnected() {
81918
- return this.websocket != null && this.websocket.readyState === import_client29.ClientSocketReadyState.OPEN && this.helloReceived;
81918
+ return this.websocket != null && this.websocket.readyState === import_client30.ClientSocketReadyState.OPEN && this.helloReceived;
81919
81919
  }
81920
81920
  delay = 0;
81921
81921
  onConnectHandlers = [];
@@ -82007,7 +82007,7 @@ var require_connection2 = __commonJS({
82007
82007
  if (resp.id === -1) {
82008
82008
  this.delay = 0;
82009
82009
  if (resp.result?.state === "upgrading") {
82010
- void this.onConnect?.(import_core50.ClientConnectEvent.Maintenance, void 0, resp.result.stats);
82010
+ void this.onConnect?.(import_core51.ClientConnectEvent.Maintenance, void 0, resp.result.stats);
82011
82011
  this.upgrading = true;
82012
82012
  this.delay = 3;
82013
82013
  return;
@@ -82042,7 +82042,7 @@ var require_connection2 = __commonJS({
82042
82042
  v.reconnect?.();
82043
82043
  }
82044
82044
  void this.onConnect?.(
82045
- helloResp.reconnect === true ? import_core50.ClientConnectEvent.Reconnected : import_core50.ClientConnectEvent.Connected,
82045
+ helloResp.reconnect === true ? import_core51.ClientConnectEvent.Reconnected : import_core51.ClientConnectEvent.Connected,
82046
82046
  helloResp.lastTx,
82047
82047
  this.sessionId
82048
82048
  )?.catch((err) => {
@@ -82055,8 +82055,8 @@ var require_connection2 = __commonJS({
82055
82055
  }
82056
82056
  return;
82057
82057
  }
82058
- if (resp.result === import_client29.pingConst) {
82059
- void this.sendRequest({ method: import_client29.pingConst, params: [] }).catch((err) => {
82058
+ if (resp.result === import_client30.pingConst) {
82059
+ void this.sendRequest({ method: import_client30.pingConst, params: [] }).catch((err) => {
82060
82060
  this.ctx.error("failed to send ping", { err });
82061
82061
  });
82062
82062
  return;
@@ -82092,7 +82092,7 @@ var require_connection2 = __commonJS({
82092
82092
  }
82093
82093
  result = result.concat(c.data);
82094
82094
  }
82095
- resp.result = (0, import_core50.toFindResult)(result, total, lookupMap);
82095
+ resp.result = (0, import_core51.toFindResult)(result, total, lookupMap);
82096
82096
  resp.chunk = void 0;
82097
82097
  } else {
82098
82098
  return;
@@ -82136,7 +82136,7 @@ var require_connection2 = __commonJS({
82136
82136
  } else {
82137
82137
  const txArr = Array.isArray(resp.result) ? resp.result : [resp.result];
82138
82138
  for (const tx of txArr) {
82139
- if (tx?._class === import_core50.default.class.TxModelUpgrade) {
82139
+ if (tx?._class === import_core51.default.class.TxModelUpgrade) {
82140
82140
  console.log("Processing upgrade", this.workspace, this.user);
82141
82141
  this.opt?.onUpgrade?.();
82142
82142
  return;
@@ -82148,15 +82148,15 @@ var require_connection2 = __commonJS({
82148
82148
  }
82149
82149
  }
82150
82150
  checkArrayBufferPing(data) {
82151
- if (data.byteLength === import_client29.pingConst.length || data.byteLength === import_client29.pongConst.length) {
82151
+ if (data.byteLength === import_client30.pingConst.length || data.byteLength === import_client30.pongConst.length) {
82152
82152
  const text = new TextDecoder().decode(data);
82153
- if (text === import_client29.pingConst) {
82154
- void this.sendRequest({ method: import_client29.pingConst, params: [] }).catch((err) => {
82153
+ if (text === import_client30.pingConst) {
82154
+ void this.sendRequest({ method: import_client30.pingConst, params: [] }).catch((err) => {
82155
82155
  this.ctx.error("failed to send ping", { err });
82156
82156
  });
82157
82157
  return true;
82158
82158
  }
82159
- if (text === import_client29.pongConst) {
82159
+ if (text === import_client30.pongConst) {
82160
82160
  this.pingResponse = Date.now();
82161
82161
  return true;
82162
82162
  }
@@ -82166,7 +82166,7 @@ var require_connection2 = __commonJS({
82166
82166
  openConnection(ctx, socketId) {
82167
82167
  this.binaryMode = false;
82168
82168
  this.helloReceived = false;
82169
- const clientSocketFactory = this.opt?.socketFactory ?? (0, import_platform3.getMetadata)(import_client29.default.metadata.ClientSocketFactory) ?? ((url4) => {
82169
+ const clientSocketFactory = this.opt?.socketFactory ?? (0, import_platform3.getMetadata)(import_client30.default.metadata.ClientSocketFactory) ?? ((url4) => {
82170
82170
  const s = new WebSocket(url4);
82171
82171
  return s;
82172
82172
  });
@@ -82201,12 +82201,12 @@ var require_connection2 = __commonJS({
82201
82201
  if (this.websocket !== wsocket) {
82202
82202
  return;
82203
82203
  }
82204
- if (event.data === import_client29.pongConst) {
82204
+ if (event.data === import_client30.pongConst) {
82205
82205
  this.pingResponse = Date.now();
82206
82206
  return;
82207
82207
  }
82208
- if (event.data === import_client29.pingConst) {
82209
- void this.sendRequest({ method: import_client29.pingConst, params: [] }).catch((err) => {
82208
+ if (event.data === import_client30.pingConst) {
82209
+ void this.sendRequest({ method: import_client30.pingConst, params: [] }).catch((err) => {
82210
82210
  this.ctx.error("failed to send ping", { err });
82211
82211
  });
82212
82212
  return;
@@ -82271,8 +82271,8 @@ var require_connection2 = __commonJS({
82271
82271
  if (this.websocket !== wsocket) {
82272
82272
  return;
82273
82273
  }
82274
- const useBinary = this.opt?.useBinaryProtocol ?? (0, import_platform3.getMetadata)(import_client29.default.metadata.UseBinaryProtocol) ?? true;
82275
- this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform3.getMetadata)(import_client29.default.metadata.UseProtocolCompression) ?? false;
82274
+ const useBinary = this.opt?.useBinaryProtocol ?? (0, import_platform3.getMetadata)(import_client30.default.metadata.UseBinaryProtocol) ?? true;
82275
+ this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform3.getMetadata)(import_client30.default.metadata.UseProtocolCompression) ?? false;
82276
82276
  const helloRequest = {
82277
82277
  method: "hello",
82278
82278
  params: [],
@@ -82318,13 +82318,13 @@ var require_connection2 = __commonJS({
82318
82318
  if (w instanceof Promise) {
82319
82319
  await w;
82320
82320
  }
82321
- if (data.method !== import_client29.pingConst) {
82321
+ if (data.method !== import_client30.pingConst) {
82322
82322
  this.requests.set(id, promise4);
82323
82323
  }
82324
82324
  promise4.sendData = () => {
82325
- if (this.websocket?.readyState === import_client29.ClientSocketReadyState.OPEN) {
82325
+ if (this.websocket?.readyState === import_client30.ClientSocketReadyState.OPEN) {
82326
82326
  promise4.startTime = Date.now();
82327
- if (data.method !== import_client29.pingConst) {
82327
+ if (data.method !== import_client30.pingConst) {
82328
82328
  const dta = this.rpcHandler.serialize(
82329
82329
  {
82330
82330
  method: data.method,
@@ -82337,7 +82337,7 @@ var require_connection2 = __commonJS({
82337
82337
  );
82338
82338
  this.websocket?.send(dta);
82339
82339
  } else {
82340
- this.websocket?.send(import_client29.pingConst);
82340
+ this.websocket?.send(import_client30.pingConst);
82341
82341
  }
82342
82342
  }
82343
82343
  };
@@ -82351,7 +82351,7 @@ var require_connection2 = __commonJS({
82351
82351
  };
82352
82352
  }
82353
82353
  promise4.sendData();
82354
- if (data.method !== import_client29.pingConst) {
82354
+ if (data.method !== import_client30.pingConst) {
82355
82355
  return await promise4.promise;
82356
82356
  }
82357
82357
  },
@@ -82366,7 +82366,7 @@ var require_connection2 = __commonJS({
82366
82366
  }
82367
82367
  getAccount() {
82368
82368
  if (this.account !== void 0) {
82369
- return Promise.resolve((0, import_core50.clone)(this.account));
82369
+ return Promise.resolve((0, import_core51.clone)(this.account));
82370
82370
  }
82371
82371
  return this.sendRequest({ method: "getAccount", params: [] });
82372
82372
  }
@@ -82424,10 +82424,10 @@ var require_connection2 = __commonJS({
82424
82424
  method: "tx",
82425
82425
  params: [tx],
82426
82426
  retry: /* @__PURE__ */ __name(async () => {
82427
- if (tx._class === import_core50.default.class.TxApplyIf) {
82428
- return (await this.findAll(import_core50.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
82427
+ if (tx._class === import_core51.default.class.TxApplyIf) {
82428
+ return (await this.findAll(import_core51.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
82429
82429
  }
82430
- return (await this.findAll(import_core50.default.class.Tx, { _id: tx._id }, { limit: 1 })).length === 0;
82430
+ return (await this.findAll(import_core51.default.class.Tx, { _id: tx._id }, { limit: 1 })).length === 0;
82431
82431
  }, "retry")
82432
82432
  });
82433
82433
  }
@@ -82467,7 +82467,7 @@ var require_connection2 = __commonJS({
82467
82467
  };
82468
82468
  function connect(url4, handler, workspace, user, opt) {
82469
82469
  return new Connection(
82470
- opt?.ctx?.newChild?.("connection", {}) ?? new import_core50.MeasureMetricsContext("connection", {}),
82470
+ opt?.ctx?.newChild?.("connection", {}) ?? new import_core51.MeasureMetricsContext("connection", {}),
82471
82471
  url4,
82472
82472
  handler,
82473
82473
  workspace,
@@ -82517,14 +82517,14 @@ var require_lib19 = __commonJS({
82517
82517
  default: () => index_default
82518
82518
  });
82519
82519
  module2.exports = __toCommonJS2(index_exports2);
82520
- var import_client29 = __toESM2(require_lib6());
82521
- var import_core50 = __toESM2(require_lib4());
82520
+ var import_client30 = __toESM2(require_lib6());
82521
+ var import_core51 = __toESM2(require_lib4());
82522
82522
  var import_platform3 = __toESM2(require_lib());
82523
82523
  var import_connection = require_connection2();
82524
82524
  var dbRequest;
82525
82525
  var dbPromise = Promise.resolve(void 0);
82526
82526
  if (typeof localStorage !== "undefined") {
82527
- const st = (0, import_core50.platformNow)();
82527
+ const st = (0, import_core51.platformNow)();
82528
82528
  dbPromise = new Promise((resolve2) => {
82529
82529
  dbRequest = indexedDB.open("model.db.persistence", 2);
82530
82530
  dbRequest.onupgradeneeded = function() {
@@ -82535,7 +82535,7 @@ var require_lib19 = __commonJS({
82535
82535
  };
82536
82536
  dbRequest.onsuccess = function() {
82537
82537
  const db = dbRequest.result;
82538
- console.log("init DB complete", (0, import_core50.platformNow)() - st);
82538
+ console.log("init DB complete", (0, import_core51.platformNow)() - st);
82539
82539
  resolve2(db);
82540
82540
  };
82541
82541
  });
@@ -82561,19 +82561,19 @@ var require_lib19 = __commonJS({
82561
82561
  return {
82562
82562
  function: {
82563
82563
  GetClient: /* @__PURE__ */ __name(async (token, endpoint, opt) => {
82564
- const filterModel = (0, import_platform3.getMetadata)(import_client29.default.metadata.FilterModel) ?? "none";
82565
- const extraFilter = (0, import_platform3.getMetadata)(import_client29.default.metadata.ExtraFilter) ?? [];
82564
+ const filterModel = (0, import_platform3.getMetadata)(import_client30.default.metadata.FilterModel) ?? "none";
82565
+ const extraFilter = (0, import_platform3.getMetadata)(import_client30.default.metadata.ExtraFilter) ?? [];
82566
82566
  const handler = /* @__PURE__ */ __name(async (handler2) => {
82567
- const url4 = (0, import_core50.concatLink)(endpoint, `/${token}`);
82567
+ const url4 = (0, import_core51.concatLink)(endpoint, `/${token}`);
82568
82568
  const upgradeHandler = /* @__PURE__ */ __name((...txes) => {
82569
82569
  for (const tx of txes) {
82570
- if (tx?._class === import_core50.default.class.TxModelUpgrade) {
82570
+ if (tx?._class === import_core51.default.class.TxModelUpgrade) {
82571
82571
  opt?.onUpgrade?.();
82572
82572
  return;
82573
82573
  }
82574
- if (tx?._class === import_core50.default.class.TxWorkspaceEvent) {
82574
+ if (tx?._class === import_core51.default.class.TxWorkspaceEvent) {
82575
82575
  const event = tx;
82576
- if (event.event === import_core50.WorkspaceEvent.MaintenanceNotification) {
82576
+ if (event.event === import_core51.WorkspaceEvent.MaintenanceNotification) {
82577
82577
  void (0, import_platform3.setPlatformStatus)(
82578
82578
  new import_platform3.Status(import_platform3.Severity.WARNING, import_platform3.default.status.MaintenanceWarning, {
82579
82579
  time: event.params.timeMinutes,
@@ -82590,7 +82590,7 @@ var require_lib19 = __commonJS({
82590
82590
  throw new Error("Workspace or account not found in token");
82591
82591
  }
82592
82592
  const newOpt = { ...opt };
82593
- const connectTimeout = opt?.connectionTimeout ?? (0, import_platform3.getMetadata)(import_client29.default.metadata.ConnectionTimeout);
82593
+ const connectTimeout = opt?.connectionTimeout ?? (0, import_platform3.getMetadata)(import_client30.default.metadata.ConnectionTimeout);
82594
82594
  let connectPromise;
82595
82595
  if ((connectTimeout ?? 0) > 0) {
82596
82596
  connectPromise = new Promise((resolve2, reject) => {
@@ -82611,7 +82611,7 @@ var require_lib19 = __commonJS({
82611
82611
  reject(error2);
82612
82612
  return;
82613
82613
  }
82614
- if (event !== import_core50.ClientConnectEvent.Maintenance) {
82614
+ if (event !== import_core51.ClientConnectEvent.Maintenance) {
82615
82615
  clearTimeout(connectTO);
82616
82616
  resolve2();
82617
82617
  }
@@ -82633,7 +82633,7 @@ var require_lib19 = __commonJS({
82633
82633
  }
82634
82634
  return txes;
82635
82635
  }, "modelFilter");
82636
- const client = (0, import_core50.createClient)(handler, modelFilter, createModelPersistence(getWSFromToken(token)), opt?.ctx);
82636
+ const client = (0, import_core51.createClient)(handler, modelFilter, createModelPersistence(getWSFromToken(token)), opt?.ctx);
82637
82637
  return await client;
82638
82638
  }, "GetClient")
82639
82639
  }
@@ -82641,17 +82641,17 @@ var require_lib19 = __commonJS({
82641
82641
  }, "default");
82642
82642
  function returnUITxes(txes, extraFilter) {
82643
82643
  const configs = /* @__PURE__ */ new Map();
82644
- (0, import_core50.fillConfiguration)(txes, configs);
82645
- const allowedPlugins = [...(0, import_platform3.getPlugins)(), ...(0, import_platform3.getMetadata)(import_client29.default.metadata.ExtraPlugins) ?? []];
82644
+ (0, import_core51.fillConfiguration)(txes, configs);
82645
+ const allowedPlugins = [...(0, import_platform3.getPlugins)(), ...(0, import_platform3.getMetadata)(import_client30.default.metadata.ExtraPlugins) ?? []];
82646
82646
  const excludedPlugins = Array.from(configs.values()).filter(
82647
82647
  (it) => !it.enabled || !allowedPlugins.includes(it.pluginId) || extraFilter.includes(it.pluginId)
82648
82648
  );
82649
- return (0, import_core50.pluginFilterTx)(excludedPlugins, configs, txes);
82649
+ return (0, import_core51.pluginFilterTx)(excludedPlugins, configs, txes);
82650
82650
  }
82651
82651
  __name(returnUITxes, "returnUITxes");
82652
82652
  function returnClientTxes(txes) {
82653
82653
  const configs = /* @__PURE__ */ new Map();
82654
- (0, import_core50.fillConfiguration)(txes, configs);
82654
+ (0, import_core51.fillConfiguration)(txes, configs);
82655
82655
  const excludedPlugins = Array.from(configs.values()).filter((it) => !it.enabled || it.pluginId.startsWith("server-"));
82656
82656
  const toExclude = /* @__PURE__ */ new Set([
82657
82657
  "workbench:class:Application",
@@ -82677,8 +82677,8 @@ var require_lib19 = __commonJS({
82677
82677
  "setting:class:WorkspaceSettingCategory",
82678
82678
  "notification:class:NotificationProvider"
82679
82679
  ]);
82680
- const result = (0, import_core50.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82681
- if (tx?._class === import_core50.default.class.TxCreateDoc || tx?._class === import_core50.default.class.TxUpdateDoc || tx?._class === import_core50.default.class.TxRemoveDoc) {
82680
+ const result = (0, import_core51.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82681
+ if (tx?._class === import_core51.default.class.TxCreateDoc || tx?._class === import_core51.default.class.TxUpdateDoc || tx?._class === import_core51.default.class.TxRemoveDoc) {
82682
82682
  const cud = tx;
82683
82683
  if (toExclude.has(cud.objectClass)) {
82684
82684
  return false;
@@ -82690,7 +82690,7 @@ var require_lib19 = __commonJS({
82690
82690
  }
82691
82691
  __name(returnClientTxes, "returnClientTxes");
82692
82692
  function createModelPersistence(workspace) {
82693
- const overrideStore = (0, import_platform3.getMetadata)(import_client29.default.metadata.OverridePersistenceStore);
82693
+ const overrideStore = (0, import_platform3.getMetadata)(import_client30.default.metadata.OverridePersistenceStore);
82694
82694
  if (overrideStore !== void 0) {
82695
82695
  return overrideStore;
82696
82696
  }
@@ -82787,11 +82787,11 @@ var require_client6 = __commonJS({
82787
82787
  });
82788
82788
  module2.exports = __toCommonJS2(client_exports);
82789
82789
  var import_account_client2 = require_lib5();
82790
- var import_client29 = __toESM2(require_lib6());
82791
- var import_core50 = require_lib4();
82790
+ var import_client30 = __toESM2(require_lib6());
82791
+ var import_core51 = require_lib4();
82792
82792
  var import_platform3 = require_lib();
82793
82793
  var import_config8 = require_config();
82794
- var import_markup10 = require_markup();
82794
+ var import_markup11 = require_markup();
82795
82795
  var import_utils14 = require_utils9();
82796
82796
  async function connect(url4, options) {
82797
82797
  const config3 = await (0, import_config8.loadServerConfig)(url4);
@@ -82805,7 +82805,7 @@ var require_client6 = __commonJS({
82805
82805
  const account = {
82806
82806
  uuid: wsLoginInfo.account,
82807
82807
  role: wsLoginInfo.role,
82808
- primarySocialId: (0, import_core50.pickPrimarySocialId)(socialIds)._id,
82808
+ primarySocialId: (0, import_core51.pickPrimarySocialId)(socialIds)._id,
82809
82809
  socialIds: socialIds.map((si) => si._id),
82810
82810
  fullSocialIds: socialIds
82811
82811
  };
@@ -82813,9 +82813,9 @@ var require_client6 = __commonJS({
82813
82813
  }
82814
82814
  __name(connect, "connect");
82815
82815
  async function createClient(url4, endpoint, token, workspaceUuid, account, config3, options) {
82816
- (0, import_platform3.addLocation)(import_client29.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
82816
+ (0, import_platform3.addLocation)(import_client30.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
82817
82817
  const { socketFactory, connectionTimeout } = options;
82818
- const clientFactory = await (0, import_platform3.getResource)(import_client29.default.function.GetClient);
82818
+ const clientFactory = await (0, import_platform3.getResource)(import_client30.default.function.GetClient);
82819
82819
  const connection = await clientFactory(token, endpoint, {
82820
82820
  socketFactory,
82821
82821
  connectionTimeout
@@ -82831,8 +82831,8 @@ var require_client6 = __commonJS({
82831
82831
  this.config = config3;
82832
82832
  this.connection = connection;
82833
82833
  this.account = account;
82834
- this.client = new import_core50.TxOperations(connection, account.primarySocialId);
82835
- this.markup = (0, import_markup10.createMarkupOperations)(url4, workspace, token, config3);
82834
+ this.client = new import_core51.TxOperations(connection, account.primarySocialId);
82835
+ this.markup = (0, import_markup11.createMarkupOperations)(url4, workspace, token, config3);
82836
82836
  }
82837
82837
  static {
82838
82838
  __name(this, "PlatformClientImpl");
@@ -82861,7 +82861,7 @@ var require_client6 = __commonJS({
82861
82861
  async processMarkup(_class, id, data) {
82862
82862
  const result = {};
82863
82863
  for (const [key, value3] of Object.entries(data)) {
82864
- if (value3 instanceof import_markup10.MarkupContent) {
82864
+ if (value3 instanceof import_markup11.MarkupContent) {
82865
82865
  result[key] = this.markup.uploadMarkup(_class, id, key, value3.content, value3.kind);
82866
82866
  } else {
82867
82867
  result[key] = value3;
@@ -82871,7 +82871,7 @@ var require_client6 = __commonJS({
82871
82871
  }
82872
82872
  // DocOperations
82873
82873
  async createDoc(_class, space, attributes, id) {
82874
- id ??= (0, import_core50.generateId)();
82874
+ id ??= (0, import_core51.generateId)();
82875
82875
  const data = await this.processMarkup(_class, id, attributes);
82876
82876
  return await this.client.createDoc(_class, space, data, id);
82877
82877
  }
@@ -82884,7 +82884,7 @@ var require_client6 = __commonJS({
82884
82884
  }
82885
82885
  // CollectionOperations
82886
82886
  async addCollection(_class, space, attachedTo, attachedToClass, collection, attributes, id) {
82887
- id ??= (0, import_core50.generateId)();
82887
+ id ??= (0, import_core51.generateId)();
82888
82888
  const data = await this.processMarkup(_class, id, attributes);
82889
82889
  return await this.client.addCollection(_class, space, attachedTo, attachedToClass, collection, data, id);
82890
82890
  }
@@ -83211,7 +83211,7 @@ var require_rest = __commonJS({
83211
83211
  createRestClient: () => createRestClient2
83212
83212
  });
83213
83213
  module2.exports = __toCommonJS2(rest_exports);
83214
- var import_core50 = require_lib4();
83214
+ var import_core51 = require_lib4();
83215
83215
  var import_platform3 = require_lib();
83216
83216
  var import_utils14 = require_utils9();
83217
83217
  var import_utils22 = require_utils10();
@@ -83266,7 +83266,7 @@ var require_rest = __commonJS({
83266
83266
  if (options !== void 0 && Object.keys(options).length > 0) {
83267
83267
  params.append("options", JSON.stringify(options));
83268
83268
  }
83269
- const requestUrl = (0, import_core50.concatLink)(this.endpoint, `/api/v1/find-all/${this.workspace}?${params.toString()}`);
83269
+ const requestUrl = (0, import_core51.concatLink)(this.endpoint, `/api/v1/find-all/${this.workspace}?${params.toString()}`);
83270
83270
  const result = await (0, import_utils22.withRetry)(async () => {
83271
83271
  const response = await fetch(requestUrl, this.requestInit());
83272
83272
  if (!response.ok) {
@@ -83340,7 +83340,7 @@ var require_rest = __commonJS({
83340
83340
  }
83341
83341
  }
83342
83342
  async getAccount() {
83343
- const requestUrl = (0, import_core50.concatLink)(this.endpoint, `/api/v1/account/${this.workspace}`);
83343
+ const requestUrl = (0, import_core51.concatLink)(this.endpoint, `/api/v1/account/${this.workspace}`);
83344
83344
  await this.checkRate();
83345
83345
  const result = await (0, import_utils22.withRetry)(async () => {
83346
83346
  const response = await fetch(requestUrl, this.requestInit());
@@ -83357,7 +83357,7 @@ var require_rest = __commonJS({
83357
83357
  return result;
83358
83358
  }
83359
83359
  async getModel(full = false) {
83360
- const requestUrl = new URL((0, import_core50.concatLink)(this.endpoint, `/api/v1/load-model/${this.workspace}`));
83360
+ const requestUrl = new URL((0, import_core51.concatLink)(this.endpoint, `/api/v1/load-model/${this.workspace}`));
83361
83361
  if (full) {
83362
83362
  requestUrl.searchParams.append("full", "true");
83363
83363
  }
@@ -83370,10 +83370,10 @@ var require_rest = __commonJS({
83370
83370
  }
83371
83371
  this.updateRateLimit(response);
83372
83372
  const modelResponse = await (0, import_utils22.extractJson)(response);
83373
- const hierarchy = new import_core50.Hierarchy();
83374
- const model = new import_core50.ModelDb(hierarchy);
83375
- const ctx = new import_core50.MeasureMetricsContext("loadModel", {});
83376
- (0, import_core50.buildModel)(ctx, modelResponse, void 0, hierarchy, model);
83373
+ const hierarchy = new import_core51.Hierarchy();
83374
+ const model = new import_core51.ModelDb(hierarchy);
83375
+ const ctx = new import_core51.MeasureMetricsContext("loadModel", {});
83376
+ (0, import_core51.buildModel)(ctx, modelResponse, void 0, hierarchy, model);
83377
83377
  return { hierarchy, model };
83378
83378
  }, isRLE);
83379
83379
  if (result.error !== void 0) {
@@ -83385,7 +83385,7 @@ var require_rest = __commonJS({
83385
83385
  return (await this.findAll(_class, query, { ...options, limit: 1 })).shift();
83386
83386
  }
83387
83387
  async tx(tx) {
83388
- const requestUrl = (0, import_core50.concatLink)(this.endpoint, `/api/v1/tx/${this.workspace}`);
83388
+ const requestUrl = (0, import_core51.concatLink)(this.endpoint, `/api/v1/tx/${this.workspace}`);
83389
83389
  await this.checkRate();
83390
83390
  const result = await (0, import_utils22.withRetry)(async () => {
83391
83391
  const response = await fetch(requestUrl, {
@@ -83419,7 +83419,7 @@ var require_rest = __commonJS({
83419
83419
  if (options.limit != null) {
83420
83420
  params.append("limit", `${options.limit}`);
83421
83421
  }
83422
- const requestUrl = (0, import_core50.concatLink)(this.endpoint, `/api/v1/search-fulltext/${this.workspace}?${params.toString()}`);
83422
+ const requestUrl = (0, import_core51.concatLink)(this.endpoint, `/api/v1/search-fulltext/${this.workspace}?${params.toString()}`);
83423
83423
  const response = await fetch(requestUrl, {
83424
83424
  method: "GET",
83425
83425
  headers: this.jsonHeaders(),
@@ -83438,7 +83438,7 @@ var require_rest = __commonJS({
83438
83438
  return result;
83439
83439
  }
83440
83440
  async domainRequest(domain3, params, options) {
83441
- const requestUrl = (0, import_core50.concatLink)(this.endpoint, `/api/v1/request/${domain3}/${this.workspace}`);
83441
+ const requestUrl = (0, import_core51.concatLink)(this.endpoint, `/api/v1/request/${domain3}/${this.workspace}`);
83442
83442
  await this.checkRate();
83443
83443
  return await (0, import_utils22.withRetry)(async () => {
83444
83444
  const response = await fetch(requestUrl, {
@@ -83457,7 +83457,7 @@ var require_rest = __commonJS({
83457
83457
  }, isRLE);
83458
83458
  }
83459
83459
  async ensurePerson(socialType, socialValue, firstName, lastName) {
83460
- const requestUrl = (0, import_core50.concatLink)(this.endpoint, `/api/v1/ensure-person/${this.workspace}`);
83460
+ const requestUrl = (0, import_core51.concatLink)(this.endpoint, `/api/v1/ensure-person/${this.workspace}`);
83461
83461
  await this.checkRate();
83462
83462
  const result = await (0, import_utils22.withRetry)(async () => {
83463
83463
  const response = await fetch(requestUrl, {
@@ -83514,13 +83514,13 @@ var require_tx2 = __commonJS({
83514
83514
  createRestTxOperations: () => createRestTxOperations2
83515
83515
  });
83516
83516
  module2.exports = __toCommonJS2(tx_exports);
83517
- var import_core50 = require_lib4();
83517
+ var import_core51 = require_lib4();
83518
83518
  var import_rest = require_rest();
83519
83519
  async function createRestTxOperations2(endpoint, workspaceId, token, fullModel = false) {
83520
83520
  const restClient = new import_rest.RestClientImpl(endpoint, workspaceId, token);
83521
83521
  const account = await restClient.getAccount();
83522
83522
  const { hierarchy, model } = await restClient.getModel(fullModel);
83523
- return new import_core50.TxOperations(new RestTxClient(restClient, hierarchy, model, account), account.socialIds[0]);
83523
+ return new import_core51.TxOperations(new RestTxClient(restClient, hierarchy, model, account), account.socialIds[0]);
83524
83524
  }
83525
83525
  __name(createRestTxOperations2, "createRestTxOperations");
83526
83526
  var RestTxClient = class {
@@ -83541,7 +83541,7 @@ var require_tx2 = __commonJS({
83541
83541
  const result = data.map((v) => {
83542
83542
  return this.hierarchy.updateLookupMixin(_class, v, options);
83543
83543
  });
83544
- return (0, import_core50.toFindResult)(result, data.total);
83544
+ return (0, import_core51.toFindResult)(result, data.total);
83545
83545
  }
83546
83546
  async domainRequest(domain3, params, options) {
83547
83547
  return await this.client.domainRequest(domain3, params, options);
@@ -83723,7 +83723,7 @@ var require_client7 = __commonJS({
83723
83723
  createStorageClient: () => createStorageClient2
83724
83724
  });
83725
83725
  module2.exports = __toCommonJS2(client_exports);
83726
- var import_core50 = __toESM2(require_lib4());
83726
+ var import_core51 = __toESM2(require_lib4());
83727
83727
  var import_stream2 = require("stream");
83728
83728
  var import_config8 = require_config();
83729
83729
  var import_error = require_error3();
@@ -83760,13 +83760,13 @@ var require_client7 = __commonJS({
83760
83760
  const size13 = parseInt(headers.get("Content-Length") ?? "0", 10);
83761
83761
  return {
83762
83762
  provider: "",
83763
- _class: import_core50.default.class.Blob,
83763
+ _class: import_core51.default.class.Blob,
83764
83764
  _id: objectName,
83765
83765
  contentType: headers.get("Content-Type") ?? "",
83766
83766
  size: isNaN(size13) ? 0 : size13 ?? 0,
83767
83767
  etag: headers.get("ETag") ?? "",
83768
- space: import_core50.default.space.Configuration,
83769
- modifiedBy: import_core50.default.account.System,
83768
+ space: import_core51.default.space.Configuration,
83769
+ modifiedBy: import_core51.default.account.System,
83770
83770
  modifiedOn: isNaN(lastModified) ? 0 : lastModified,
83771
83771
  version: null
83772
83772
  };
@@ -83801,11 +83801,11 @@ var require_client7 = __commonJS({
83801
83801
  if (Object.hasOwn(result[0], "id")) {
83802
83802
  const fileResult = result[0];
83803
83803
  return {
83804
- _class: import_core50.default.class.Blob,
83804
+ _class: import_core51.default.class.Blob,
83805
83805
  _id: fileResult.id,
83806
- space: import_core50.default.space.Configuration,
83806
+ space: import_core51.default.space.Configuration,
83807
83807
  modifiedOn: fileResult.metadata.lastModified,
83808
- modifiedBy: import_core50.default.account.System,
83808
+ modifiedBy: import_core51.default.account.System,
83809
83809
  provider: "",
83810
83810
  contentType: fileResult.metadata.contentType,
83811
83811
  etag: fileResult.metadata.etag,
@@ -83879,11 +83879,11 @@ var require_client7 = __commonJS({
83879
83879
  async function connectStorage(url4, options, config3) {
83880
83880
  config3 ??= await (0, import_config8.loadServerConfig)(url4);
83881
83881
  const token = await (0, import_utils14.getWorkspaceToken)(url4, options, config3);
83882
- const filesUrl = (config3.FILES_URL.startsWith("/") ? (0, import_core50.concatLink)(url4, config3.FILES_URL) : config3.FILES_URL).replace(
83882
+ const filesUrl = (config3.FILES_URL.startsWith("/") ? (0, import_core51.concatLink)(url4, config3.FILES_URL) : config3.FILES_URL).replace(
83883
83883
  ":workspace",
83884
83884
  token.workspaceId
83885
83885
  );
83886
- const uploadUrl = (config3.UPLOAD_URL.startsWith("/") ? (0, import_core50.concatLink)(url4, config3.UPLOAD_URL) : config3.UPLOAD_URL).replace(":workspace", token.workspaceId);
83886
+ const uploadUrl = (config3.UPLOAD_URL.startsWith("/") ? (0, import_core51.concatLink)(url4, config3.UPLOAD_URL) : config3.UPLOAD_URL).replace(":workspace", token.workspaceId);
83887
83887
  return new StorageClientImpl(filesUrl, uploadUrl, token.token, token.workspaceId);
83888
83888
  }
83889
83889
  __name(connectStorage, "connectStorage");
@@ -83936,11 +83936,11 @@ var require_storage2 = __commonJS({
83936
83936
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
83937
83937
  var storage_exports = {};
83938
83938
  __export2(storage_exports, {
83939
- connectStorage: () => import_client29.connectStorage,
83940
- createStorageClient: () => import_client29.createStorageClient
83939
+ connectStorage: () => import_client30.connectStorage,
83940
+ createStorageClient: () => import_client30.createStorageClient
83941
83941
  });
83942
83942
  module2.exports = __toCommonJS2(storage_exports);
83943
- var import_client29 = require_client7();
83943
+ var import_client30 = require_client7();
83944
83944
  __reExport2(storage_exports, require_error3(), module2.exports);
83945
83945
  __reExport2(storage_exports, require_types8(), module2.exports);
83946
83946
  }
@@ -114652,7 +114652,7 @@ var require_utils15 = __commonJS({
114652
114652
  getWeekday: () => getWeekday
114653
114653
  });
114654
114654
  module2.exports = __toCommonJS2(utils_exports);
114655
- var import_core50 = require_lib4();
114655
+ var import_core51 = require_lib4();
114656
114656
  var import__ = __toESM2(require_lib25());
114657
114657
  function getInstance(event, date7) {
114658
114658
  const diff8 = event.dueDate - event.date;
@@ -114664,7 +114664,7 @@ var require_utils15 = __commonJS({
114664
114664
  originalStartTime: date7,
114665
114665
  _class: import__.default.class.ReccuringInstance,
114666
114666
  eventId: generateEventId3(),
114667
- _id: (0, import_core50.generateId)(),
114667
+ _id: (0, import_core51.generateId)(),
114668
114668
  virtual: true
114669
114669
  };
114670
114670
  }
@@ -114977,7 +114977,7 @@ var require_utils15 = __commonJS({
114977
114977
  }
114978
114978
  __name(getAllEvents, "getAllEvents");
114979
114979
  function generateEventId3() {
114980
- const id = (0, import_core50.generateId)();
114980
+ const id = (0, import_core51.generateId)();
114981
114981
  return encodeToBase32Hex(id);
114982
114982
  }
114983
114983
  __name(generateEventId3, "generateEventId");
@@ -115391,7 +115391,7 @@ var require_utils16 = __commonJS({
115391
115391
  });
115392
115392
  module2.exports = __toCommonJS2(utils_exports);
115393
115393
  var import_fast_equals = require_cjs();
115394
- var import_core50 = __toESM2(require_lib4());
115394
+ var import_core51 = __toESM2(require_lib4());
115395
115395
  var import__ = __toESM2(require_lib27());
115396
115396
  async function getDirectChannel(client, me, employeeAccount) {
115397
115397
  const accIds = [me, employeeAccount].sort();
@@ -115401,7 +115401,7 @@ var require_utils16 = __commonJS({
115401
115401
  return dm._id;
115402
115402
  }
115403
115403
  }
115404
- return await client.createDoc(import__.default.class.DirectMessage, import_core50.default.space.Space, {
115404
+ return await client.createDoc(import__.default.class.DirectMessage, import_core51.default.space.Space, {
115405
115405
  name: "",
115406
115406
  description: "",
115407
115407
  private: true,
@@ -115705,18 +115705,18 @@ var require_cache4 = __commonJS({
115705
115705
  default: () => ContactCache
115706
115706
  });
115707
115707
  module2.exports = __toCommonJS2(cache_exports);
115708
- var import_core50 = __toESM2(require_lib4());
115708
+ var import_core51 = __toESM2(require_lib4());
115709
115709
  var import__ = __toESM2(require_lib28());
115710
115710
  function isCreateTx(tx) {
115711
- return tx._class === import_core50.default.class.TxCreateDoc;
115711
+ return tx._class === import_core51.default.class.TxCreateDoc;
115712
115712
  }
115713
115713
  __name(isCreateTx, "isCreateTx");
115714
115714
  function isUpdateTx(tx) {
115715
- return tx._class === import_core50.default.class.TxUpdateDoc;
115715
+ return tx._class === import_core51.default.class.TxUpdateDoc;
115716
115716
  }
115717
115717
  __name(isUpdateTx, "isUpdateTx");
115718
115718
  function isMixinTx(tx) {
115719
- return tx._class === import_core50.default.class.TxMixin;
115719
+ return tx._class === import_core51.default.class.TxMixin;
115720
115720
  }
115721
115721
  __name(isMixinTx, "isMixinTx");
115722
115722
  function isPersonTx(tx) {
@@ -115823,7 +115823,7 @@ var require_cache4 = __commonJS({
115823
115823
  const ref = tx.objectId;
115824
115824
  const person = this._personByRef.get(ref);
115825
115825
  if (person === void 0) return;
115826
- const createdPerson = import_core50.TxProcessor.createDoc2Doc(tx);
115826
+ const createdPerson = import_core51.TxProcessor.createDoc2Doc(tx);
115827
115827
  this._personByRef.set(ref, createdPerson);
115828
115828
  const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
115829
115829
  for (const personId of personIds) {
@@ -115841,7 +115841,7 @@ var require_cache4 = __commonJS({
115841
115841
  const newPersonRef = tx.attachedTo;
115842
115842
  this._personRefByPersonId.set(personId, newPersonRef);
115843
115843
  this.addPersonIdToPersonRef(newPersonRef, personId);
115844
- const createdSocialId = import_core50.TxProcessor.createDoc2Doc(tx);
115844
+ const createdSocialId = import_core51.TxProcessor.createDoc2Doc(tx);
115845
115845
  this._socialIdByPersonId.set(personId, createdSocialId);
115846
115846
  this.broadcastChange({
115847
115847
  personRef: newPersonRef,
@@ -115852,7 +115852,7 @@ var require_cache4 = __commonJS({
115852
115852
  const ref = tx.objectId;
115853
115853
  const person = this._personByRef.get(ref);
115854
115854
  if (person == null) return;
115855
- const updatedPerson = isUpdateTx(tx) ? import_core50.TxProcessor.updateDoc2Doc(person, tx) : import_core50.TxProcessor.updateMixin4Doc(person, tx);
115855
+ const updatedPerson = isUpdateTx(tx) ? import_core51.TxProcessor.updateDoc2Doc(person, tx) : import_core51.TxProcessor.updateMixin4Doc(person, tx);
115856
115856
  this._personByRef.set(ref, updatedPerson);
115857
115857
  const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
115858
115858
  for (const personId of personIds) {
@@ -115967,7 +115967,7 @@ var require_utils17 = __commonJS({
115967
115967
  setCurrentEmployeeSpace: () => setCurrentEmployeeSpace
115968
115968
  });
115969
115969
  module2.exports = __toCommonJS2(utils_exports);
115970
- var import_core50 = require_lib4();
115970
+ var import_core51 = require_lib4();
115971
115971
  var import_platform3 = require_lib();
115972
115972
  var import__ = __toESM2(require_lib28());
115973
115973
  var import_types12 = require_types10();
@@ -116171,7 +116171,7 @@ var require_utils17 = __commonJS({
116171
116171
  if (socialIds.length === 0) {
116172
116172
  return;
116173
116173
  }
116174
- return (0, import_core50.pickPrimarySocialId)(socialIds)._id;
116174
+ return (0, import_core51.pickPrimarySocialId)(socialIds)._id;
116175
116175
  }
116176
116176
  __name(getPrimarySocialId, "getPrimarySocialId");
116177
116177
  async function getAllSocialStringsByPersonId(client, personId) {
@@ -116210,12 +116210,12 @@ var require_utils17 = __commonJS({
116210
116210
  __name(getSocialStringsByEmployee, "getSocialStringsByEmployee");
116211
116211
  async function getAllAccounts(client) {
116212
116212
  const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
116213
- return employees.map((it) => it.personUuid).filter(import_core50.notEmpty);
116213
+ return employees.map((it) => it.personUuid).filter(import_core51.notEmpty);
116214
116214
  }
116215
116215
  __name(getAllAccounts, "getAllAccounts");
116216
116216
  async function getAllUserAccounts(client) {
116217
116217
  const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
116218
- return employees.map((it) => it.personUuid).filter(import_core50.notEmpty);
116218
+ return employees.map((it) => it.personUuid).filter(import_core51.notEmpty);
116219
116219
  }
116220
116220
  __name(getAllUserAccounts, "getAllUserAccounts");
116221
116221
  async function ensureEmployee(ctx, me, client, socialIds, getGlobalPerson) {
@@ -116224,7 +116224,7 @@ var require_utils17 = __commonJS({
116224
116224
  }
116225
116225
  __name(ensureEmployee, "ensureEmployee");
116226
116226
  async function ensureEmployeeForPerson(ctx, me, person, client, socialIds, globalPerson) {
116227
- const txFactory = new import_core50.TxFactory(me.primarySocialId);
116227
+ const txFactory = new import_core51.TxFactory(me.primarySocialId);
116228
116228
  const personByUuid = await client.findOne(import__.default.class.Person, { personUuid: person.uuid });
116229
116229
  let personRef = personByUuid?._id;
116230
116230
  if (personRef === void 0) {
@@ -116245,7 +116245,7 @@ var require_utils17 = __commonJS({
116245
116245
  city: globalPerson.city,
116246
116246
  avatarType: import__.AvatarType.COLOR
116247
116247
  };
116248
- personRef = (0, import_core50.generateId)();
116248
+ personRef = (0, import_core51.generateId)();
116249
116249
  const createPersonTx = txFactory.createTxCreateDoc(import__.default.class.Person, import__.default.space.Contacts, data, personRef);
116250
116250
  await client.tx(createPersonTx);
116251
116251
  });
@@ -116255,7 +116255,7 @@ var require_utils17 = __commonJS({
116255
116255
  });
116256
116256
  await client.tx(updatePersonTx);
116257
116257
  }
116258
- const existingIdentifiers = (0, import_core50.toIdMap)(
116258
+ const existingIdentifiers = (0, import_core51.toIdMap)(
116259
116259
  await client.findAll(import__.default.class.SocialIdentity, { _id: { $in: person.socialIds } })
116260
116260
  );
116261
116261
  for (const socialId of socialIds) {
@@ -116280,7 +116280,7 @@ var require_utils17 = __commonJS({
116280
116280
  collection: "socialIds",
116281
116281
  type: socialId.type,
116282
116282
  value: socialId.value,
116283
- key: (0, import_core50.buildSocialIdString)(socialId),
116283
+ key: (0, import_core51.buildSocialIdString)(socialId),
116284
116284
  // TODO: fill it in trigger or on DB level as stored calculated column or smth?
116285
116285
  verifiedOn: socialId.verifiedOn,
116286
116286
  isDeleted: socialId.isDeleted
@@ -116321,9 +116321,9 @@ var require_utils17 = __commonJS({
116321
116321
  }
116322
116322
  }
116323
116323
  }
116324
- const employeeRole = person.role === import_core50.AccountRole.Guest || person.role === import_core50.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
116324
+ const employeeRole = person.role === import_core51.AccountRole.Guest || person.role === import_core51.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
116325
116325
  const employee = await client.findOne(import__.default.mixin.Employee, { _id: personRef });
116326
- if (employee === void 0 || !import_core50.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
116326
+ if (employee === void 0 || !import_core51.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
116327
116327
  await ctx.with("create-employee", {}, async () => {
116328
116328
  if (personRef === void 0) {
116329
116329
  console.error("Person not found");
@@ -116363,7 +116363,7 @@ var require_utils17 = __commonJS({
116363
116363
  }
116364
116364
  __name(loadCachesForPersonId, "loadCachesForPersonId");
116365
116365
  async function loadCachesForPersonIds(client, personIds) {
116366
- const sidObjsMap = (0, import_core50.toIdMap)(
116366
+ const sidObjsMap = (0, import_core51.toIdMap)(
116367
116367
  await client.findAll(
116368
116368
  import__.default.class.SocialIdentity,
116369
116369
  {
@@ -116398,7 +116398,7 @@ var require_utils17 = __commonJS({
116398
116398
  }
116399
116399
  __name(loadCachesForPersonRef, "loadCachesForPersonRef");
116400
116400
  async function loadCachesForPersonRefs(client, personRefs) {
116401
- const persons = (0, import_core50.toIdMap)(
116401
+ const persons = (0, import_core51.toIdMap)(
116402
116402
  await client.findAll(
116403
116403
  import__.default.class.Person,
116404
116404
  {
@@ -116441,7 +116441,7 @@ var require_utils17 = __commonJS({
116441
116441
  personIds.map((pid) => {
116442
116442
  const ref = contactCache.personRefByPersonId.get(pid);
116443
116443
  return ref != null ? [pid, ref] : void 0;
116444
- }).filter(import_core50.notEmpty)
116444
+ }).filter(import_core51.notEmpty)
116445
116445
  );
116446
116446
  }
116447
116447
  __name(getPersonRefsByPersonIdsFromCache, "getPersonRefsByPersonIdsFromCache");
@@ -116488,7 +116488,7 @@ var require_utils17 = __commonJS({
116488
116488
  personIds.map((pid) => {
116489
116489
  const person = contactCache.personByPersonId.get(pid);
116490
116490
  return person != null ? [pid, person] : void 0;
116491
- }).filter(import_core50.notEmpty)
116491
+ }).filter(import_core51.notEmpty)
116492
116492
  );
116493
116493
  }
116494
116494
  __name(getPersonsByPersonIdsFromCache, "getPersonsByPersonIdsFromCache");
@@ -116535,7 +116535,7 @@ var require_utils17 = __commonJS({
116535
116535
  personRefs.map((personRef) => {
116536
116536
  const person = contactCache.personByRef.get(personRef);
116537
116537
  return person != null ? [personRef, person] : void 0;
116538
- }).filter(import_core50.notEmpty)
116538
+ }).filter(import_core51.notEmpty)
116539
116539
  );
116540
116540
  }
116541
116541
  __name(getPersonsByPersonRefsFromCache, "getPersonsByPersonRefsFromCache");
@@ -117140,9 +117140,9 @@ var require_utils18 = __commonJS({
117140
117140
  getFirstRank: () => getFirstRank
117141
117141
  });
117142
117142
  module2.exports = __toCommonJS2(utils_exports);
117143
- var import_core50 = require_lib4();
117143
+ var import_core51 = require_lib4();
117144
117144
  var import_plugin = __toESM2(require_plugin2());
117145
- async function getFirstRank(client, space, parent, sort3 = import_core50.SortingOrder.Descending, extra = {}) {
117145
+ async function getFirstRank(client, space, parent, sort3 = import_core51.SortingOrder.Descending, extra = {}) {
117146
117146
  const doc = await client.findOne(
117147
117147
  import_plugin.default.class.Document,
117148
117148
  { space, parent, ...extra },
@@ -118765,7 +118765,7 @@ var require_utils20 = __commonJS({
118765
118765
  updateProjectType: () => updateProjectType
118766
118766
  });
118767
118767
  module2.exports = __toCommonJS2(utils_exports);
118768
- var import_core50 = __toESM2(require_lib4());
118768
+ var import_core51 = __toESM2(require_lib4());
118769
118769
  var import_platform3 = require_lib();
118770
118770
  var import__ = __toESM2(require_lib34());
118771
118771
  var import_rank4 = require_lib33();
@@ -118801,7 +118801,7 @@ var require_utils20 = __commonJS({
118801
118801
  if (exists5 !== void 0) {
118802
118802
  return exists5._id;
118803
118803
  }
118804
- const res = await client.createDoc(_class, import_core50.default.space.Model, data);
118804
+ const res = await client.createDoc(_class, import_core51.default.space.Model, data);
118805
118805
  return res;
118806
118806
  }
118807
118807
  __name(createState, "createState");
@@ -118831,7 +118831,7 @@ var require_utils20 = __commonJS({
118831
118831
  function findStatusAttr(h, _class) {
118832
118832
  const attrs = h.getAllAttributes(_class);
118833
118833
  for (const it of attrs.values()) {
118834
- if (it.type._class === import_core50.default.class.RefTo && h.isDerived(it.type.to, import_core50.default.class.Status)) {
118834
+ if (it.type._class === import_core51.default.class.RefTo && h.isDerived(it.type.to, import_core51.default.class.Status)) {
118835
118835
  return it;
118836
118836
  }
118837
118837
  }
@@ -118863,7 +118863,7 @@ var require_utils20 = __commonJS({
118863
118863
  const targetProjectClassId = `${_id}:type:mixin`;
118864
118864
  const tmpl = await client.createDoc(
118865
118865
  import__.default.class.ProjectType,
118866
- import_core50.default.space.Model,
118866
+ import_core51.default.space.Model,
118867
118867
  {
118868
118868
  description: data.description,
118869
118869
  shortDescription: data.shortDescription,
@@ -118878,17 +118878,17 @@ var require_utils20 = __commonJS({
118878
118878
  _id
118879
118879
  );
118880
118880
  await client.createDoc(
118881
- import_core50.default.class.Mixin,
118882
- import_core50.default.space.Model,
118881
+ import_core51.default.class.Mixin,
118882
+ import_core51.default.space.Model,
118883
118883
  {
118884
118884
  extends: categoryObj.baseClass,
118885
- kind: import_core50.ClassifierKind.MIXIN,
118885
+ kind: import_core51.ClassifierKind.MIXIN,
118886
118886
  label: (0, import_platform3.getEmbeddedLabel)(data.name),
118887
118887
  icon: baseClassClass.icon
118888
118888
  },
118889
118889
  targetProjectClassId
118890
118890
  );
118891
- await client.createMixin(targetProjectClassId, import_core50.default.class.Mixin, import_core50.default.space.Model, import__.default.mixin.ProjectTypeClass, {
118891
+ await client.createMixin(targetProjectClassId, import_core51.default.class.Mixin, import_core51.default.space.Model, import__.default.mixin.ProjectTypeClass, {
118892
118892
  projectType: _id
118893
118893
  });
118894
118894
  return tmpl;
@@ -118947,22 +118947,22 @@ var require_utils20 = __commonJS({
118947
118947
  const targetClassId = `${taskId}:type:mixin`;
118948
118948
  tdata.targetClass = targetClassId;
118949
118949
  await client.createDoc(
118950
- import_core50.default.class.Mixin,
118951
- import_core50.default.space.Model,
118950
+ import_core51.default.class.Mixin,
118951
+ import_core51.default.space.Model,
118952
118952
  {
118953
118953
  extends: data.ofClass,
118954
- kind: import_core50.ClassifierKind.MIXIN,
118954
+ kind: import_core51.ClassifierKind.MIXIN,
118955
118955
  label: ofClassClass.label,
118956
118956
  icon: ofClassClass.icon
118957
118957
  },
118958
118958
  targetClassId
118959
118959
  );
118960
- await client.createMixin(targetClassId, import_core50.default.class.Mixin, import_core50.default.space.Model, import__.default.mixin.TaskTypeClass, {
118960
+ await client.createMixin(targetClassId, import_core51.default.class.Mixin, import_core51.default.space.Model, import__.default.mixin.TaskTypeClass, {
118961
118961
  taskType: taskId,
118962
118962
  projectType: _id
118963
118963
  });
118964
118964
  }
118965
- await client.createDoc(import__.default.class.TaskType, import_core50.default.space.Model, tdata, taskId);
118965
+ await client.createDoc(import__.default.class.TaskType, import_core51.default.space.Model, tdata, taskId);
118966
118966
  tasksData.set(taskId, tdata);
118967
118967
  _tasks.push(taskId);
118968
118968
  }
@@ -150636,6 +150636,7 @@ var ComponentIdentifier = NonEmptyString2.pipe(Schema_exports.brand("ComponentId
150636
150636
  var MilestoneIdentifier = NonEmptyString2.pipe(Schema_exports.brand("MilestoneIdentifier"));
150637
150637
  var TemplateIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TemplateIdentifier"));
150638
150638
  var ChannelIdentifier = NonEmptyString2.pipe(Schema_exports.brand("ChannelIdentifier"));
150639
+ var DirectMessageIdentifier = NonEmptyString2.pipe(Schema_exports.brand("DirectMessageIdentifier"));
150639
150640
  var TeamspaceIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TeamspaceIdentifier"));
150640
150641
  var CardIdentifier = NonEmptyString2.pipe(Schema_exports.brand("CardIdentifier"));
150641
150642
  var CardSpaceIdentifier = NonEmptyString2.pipe(Schema_exports.brand("CardSpaceIdentifier"));
@@ -150701,6 +150702,16 @@ var RecurringEventNotFoundError = class extends Schema_exports.TaggedError()(
150701
150702
  return `Recurring event '${this.eventId}' not found`;
150702
150703
  }
150703
150704
  };
150705
+ var CalendarNotAccessibleError = class extends Schema_exports.TaggedError()(
150706
+ "CalendarNotAccessibleError",
150707
+ {
150708
+ calendarId: Schema_exports.String
150709
+ }
150710
+ ) {
150711
+ get message() {
150712
+ return `Calendar '${this.calendarId}' not found or not accessible`;
150713
+ }
150714
+ };
150704
150715
 
150705
150716
  // src/huly/errors-cards.ts
150706
150717
  var CardSpaceNotFoundError = class extends Schema_exports.TaggedError()(
@@ -151104,6 +151115,7 @@ var LeadNotFoundError = class extends Schema_exports.TaggedError()(
151104
151115
  };
151105
151116
 
151106
151117
  // src/huly/errors-messaging.ts
151118
+ var MIN_AMBIGUOUS_DM_MATCHES = 2;
151107
151119
  var ChannelNotFoundError = class extends Schema_exports.TaggedError()(
151108
151120
  "ChannelNotFoundError",
151109
151121
  {
@@ -151114,6 +151126,27 @@ var ChannelNotFoundError = class extends Schema_exports.TaggedError()(
151114
151126
  return `Channel '${this.identifier}' not found`;
151115
151127
  }
151116
151128
  };
151129
+ var DirectMessageNotFoundError = class extends Schema_exports.TaggedError()(
151130
+ "DirectMessageNotFoundError",
151131
+ {
151132
+ identifier: Schema_exports.String
151133
+ }
151134
+ ) {
151135
+ get message() {
151136
+ return `Direct message '${this.identifier}' not found`;
151137
+ }
151138
+ };
151139
+ var DirectMessageIdentifierAmbiguousError = class extends Schema_exports.TaggedError()(
151140
+ "DirectMessageIdentifierAmbiguousError",
151141
+ {
151142
+ identifier: Schema_exports.String,
151143
+ matches: Schema_exports.Number.pipe(Schema_exports.int(), Schema_exports.greaterThanOrEqualTo(MIN_AMBIGUOUS_DM_MATCHES))
151144
+ }
151145
+ ) {
151146
+ get message() {
151147
+ return `Direct message '${this.identifier}' is ambiguous (${this.matches} matches); use the DM _id`;
151148
+ }
151149
+ };
151117
151150
  var MessageNotFoundError = class extends Schema_exports.TaggedError()(
151118
151151
  "MessageNotFoundError",
151119
151152
  {
@@ -151378,8 +151411,11 @@ var HulyDomainError = Schema_exports.Union(
151378
151411
  CommentNotFoundError,
151379
151412
  MilestoneNotFoundError,
151380
151413
  ChannelNotFoundError,
151414
+ DirectMessageIdentifierAmbiguousError,
151415
+ DirectMessageNotFoundError,
151381
151416
  MessageNotFoundError,
151382
151417
  ThreadReplyNotFoundError,
151418
+ CalendarNotAccessibleError,
151383
151419
  EventNotFoundError,
151384
151420
  RecurringEventNotFoundError,
151385
151421
  ActivityMessageNotFoundError,
@@ -171290,7 +171326,7 @@ var PostHog = class extends PostHogBackendClient {
171290
171326
  };
171291
171327
 
171292
171328
  // src/version.ts
171293
- var VERSION = true ? "0.10.0" : "0.0.0-dev";
171329
+ var VERSION = true ? "0.10.1" : "0.0.0-dev";
171294
171330
 
171295
171331
  // src/telemetry/posthog.ts
171296
171332
  var POSTHOG_API_KEY = "phc_TGfFqCGdnF0p68wuFzd5WSw1IsBvOJW0YgoMJDyZPjm";
@@ -171432,8 +171468,11 @@ var INVALID_PARAMS_TAGS = /* @__PURE__ */ new Set([
171432
171468
  "CommentNotFoundError",
171433
171469
  "MilestoneNotFoundError",
171434
171470
  "ChannelNotFoundError",
171471
+ "DirectMessageIdentifierAmbiguousError",
171472
+ "DirectMessageNotFoundError",
171435
171473
  "MessageNotFoundError",
171436
171474
  "ThreadReplyNotFoundError",
171475
+ "CalendarNotAccessibleError",
171437
171476
  "EventNotFoundError",
171438
171477
  "RecurringEventNotFoundError",
171439
171478
  "ActivityMessageNotFoundError",
@@ -172649,7 +172688,7 @@ var listDirectMessages = (params) => Effect_exports.gen(function* () {
172649
172688
  const limit = clampLimit(params.limit);
172650
172689
  const dms = yield* client.findAll(
172651
172690
  chunter.class.DirectMessage,
172652
- {},
172691
+ { members: client.getAccountUuid() },
172653
172692
  {
172654
172693
  limit,
172655
172694
  sort: {
@@ -173810,7 +173849,7 @@ var resolveCalendarRef = (client, calendarId) => Effect_exports.gen(function* ()
173810
173849
  }
173811
173850
  );
173812
173851
  if (cal === void 0) {
173813
- return yield* new HulyError({ message: `Calendar '${calendarId}' not found or not accessible` });
173852
+ return yield* new CalendarNotAccessibleError({ calendarId });
173814
173853
  }
173815
173854
  return cal._id;
173816
173855
  });
@@ -176568,6 +176607,65 @@ var parseAddThreadReplyParams = Schema_exports.decodeUnknown(AddThreadReplyParam
176568
176607
  var parseUpdateThreadReplyParams = Schema_exports.decodeUnknown(UpdateThreadReplyParamsSchema);
176569
176608
  var parseDeleteThreadReplyParams = Schema_exports.decodeUnknown(DeleteThreadReplyParamsSchema);
176570
176609
 
176610
+ // src/domain/schemas/direct-messages.ts
176611
+ var ListDmMessagesParamsSchema = Schema_exports.Struct({
176612
+ dm: DirectMessageIdentifier.annotations({
176613
+ description: "Direct-message conversation: either the DM `_id` or a participant display name (e.g. `Kerr,Shannon`). A participant name resolves only to a one-to-one DM with the authenticated account."
176614
+ }),
176615
+ limit: Schema_exports.optional(
176616
+ LimitParam.annotations({
176617
+ description: "Maximum number of messages to return (default: 50)"
176618
+ })
176619
+ )
176620
+ }).annotations({
176621
+ title: "ListDmMessagesParams",
176622
+ description: "Parameters for listing messages in a direct-message conversation"
176623
+ });
176624
+ var SendDmMessageParamsSchema = Schema_exports.Struct({
176625
+ dm: DirectMessageIdentifier.annotations({
176626
+ description: "Direct-message conversation: either the DM `_id` or a participant display name (e.g. `Kerr,Shannon`). A participant name resolves only to a one-to-one DM with the authenticated account."
176627
+ }),
176628
+ body: NonEmptyString2.annotations({
176629
+ description: "Message body (markdown supported)"
176630
+ })
176631
+ }).annotations({
176632
+ title: "SendDmMessageParams",
176633
+ description: "Parameters for sending a message to a direct-message conversation"
176634
+ });
176635
+ var UpdateDmMessageParamsSchema = Schema_exports.Struct({
176636
+ dm: DirectMessageIdentifier.annotations({
176637
+ description: "Direct-message conversation: either the DM `_id` or a participant display name. A participant name resolves only to a one-to-one DM with the authenticated account."
176638
+ }),
176639
+ messageId: MessageId.annotations({
176640
+ description: "Message ID to update"
176641
+ }),
176642
+ body: NonEmptyString2.annotations({
176643
+ description: "New message body (markdown supported)"
176644
+ })
176645
+ }).annotations({
176646
+ title: "UpdateDmMessageParams",
176647
+ description: "Parameters for updating a direct-message message"
176648
+ });
176649
+ var DeleteDmMessageParamsSchema = Schema_exports.Struct({
176650
+ dm: DirectMessageIdentifier.annotations({
176651
+ description: "Direct-message conversation: either the DM `_id` or a participant display name. A participant name resolves only to a one-to-one DM with the authenticated account."
176652
+ }),
176653
+ messageId: MessageId.annotations({
176654
+ description: "Message ID to delete"
176655
+ })
176656
+ }).annotations({
176657
+ title: "DeleteDmMessageParams",
176658
+ description: "Parameters for deleting a direct-message message"
176659
+ });
176660
+ var listDmMessagesParamsJsonSchema = JSONSchema_exports.make(ListDmMessagesParamsSchema);
176661
+ var sendDmMessageParamsJsonSchema = JSONSchema_exports.make(SendDmMessageParamsSchema);
176662
+ var updateDmMessageParamsJsonSchema = JSONSchema_exports.make(UpdateDmMessageParamsSchema);
176663
+ var deleteDmMessageParamsJsonSchema = JSONSchema_exports.make(DeleteDmMessageParamsSchema);
176664
+ var parseListDmMessagesParams = Schema_exports.decodeUnknown(ListDmMessagesParamsSchema);
176665
+ var parseSendDmMessageParams = Schema_exports.decodeUnknown(SendDmMessageParamsSchema);
176666
+ var parseUpdateDmMessageParams = Schema_exports.decodeUnknown(UpdateDmMessageParamsSchema);
176667
+ var parseDeleteDmMessageParams = Schema_exports.decodeUnknown(DeleteDmMessageParamsSchema);
176668
+
176571
176669
  // src/domain/schemas/time.ts
176572
176670
  var LogTimeParamsSchema = Schema_exports.Struct({
176573
176671
  project: ProjectIdentifier.annotations({
@@ -177990,8 +178088,147 @@ var cardTools = [
177990
178088
  }
177991
178089
  ];
177992
178090
 
177993
- // src/huly/operations/threads.ts
178091
+ // src/huly/operations/direct-messages.ts
177994
178092
  var import_core27 = __toESM(require_lib4(), 1);
178093
+ var ONE_TO_ONE_DM_MEMBER_COUNT = 2;
178094
+ var findDirectMessage = (identifier2) => Effect_exports.gen(function* () {
178095
+ const client = yield* HulyClient;
178096
+ const byId = yield* client.findOne(
178097
+ chunter.class.DirectMessage,
178098
+ { _id: toRef(identifier2) }
178099
+ );
178100
+ if (byId !== void 0) {
178101
+ if (!byId.members.includes(client.getAccountUuid())) {
178102
+ return yield* new DirectMessageNotFoundError({ identifier: identifier2 });
178103
+ }
178104
+ return { client, dm: byId };
178105
+ }
178106
+ const employees = yield* client.findAll(
178107
+ contact.mixin.Employee,
178108
+ { name: identifier2 }
178109
+ );
178110
+ const accountUuid = client.getAccountUuid();
178111
+ const accountUuids = [
178112
+ ...new Set(
178113
+ employees.map((e) => e.personUuid).filter((u) => u !== void 0 && u !== accountUuid)
178114
+ )
178115
+ ];
178116
+ if (accountUuids.length === 0) {
178117
+ return yield* new DirectMessageNotFoundError({ identifier: identifier2 });
178118
+ }
178119
+ const directMessages = yield* client.findAll(
178120
+ chunter.class.DirectMessage,
178121
+ { members: accountUuid }
178122
+ );
178123
+ const matches = directMessages.filter(
178124
+ (dm) => dm.members.length === ONE_TO_ONE_DM_MEMBER_COUNT && dm.members.includes(accountUuid) && accountUuids.some((candidate) => dm.members.includes(candidate))
178125
+ );
178126
+ if (matches.length === 0) {
178127
+ return yield* new DirectMessageNotFoundError({ identifier: identifier2 });
178128
+ }
178129
+ if (matches.length > 1) {
178130
+ return yield* new DirectMessageIdentifierAmbiguousError({ identifier: identifier2, matches: matches.length });
178131
+ }
178132
+ return { client, dm: matches[0] };
178133
+ });
178134
+ var findDirectMessageMessage = (params) => Effect_exports.gen(function* () {
178135
+ const { client, dm } = yield* findDirectMessage(params.dm);
178136
+ const message = yield* client.findOne(
178137
+ chunter.class.ChatMessage,
178138
+ {
178139
+ _id: toRef(params.messageId),
178140
+ space: dm._id
178141
+ }
178142
+ );
178143
+ if (message === void 0) {
178144
+ return yield* new MessageNotFoundError({
178145
+ messageId: params.messageId,
178146
+ channel: params.dm
178147
+ });
178148
+ }
178149
+ return { client, dm, message };
178150
+ });
178151
+ var listDirectMessageMessages = (params) => Effect_exports.gen(function* () {
178152
+ const { client, dm } = yield* findDirectMessage(params.dm);
178153
+ const markupUrlConfig = client.markupUrlConfig;
178154
+ const limit = clampLimit(params.limit);
178155
+ const messages = yield* client.findAll(
178156
+ chunter.class.ChatMessage,
178157
+ { space: dm._id },
178158
+ {
178159
+ limit,
178160
+ sort: { createdOn: import_core27.SortingOrder.Descending }
178161
+ }
178162
+ );
178163
+ const total = messages.total;
178164
+ const uniqueSocialIds = [
178165
+ ...new Set(messages.map((msg) => msg.modifiedBy))
178166
+ ];
178167
+ const socialIdToName = yield* buildSocialIdToPersonNameMap(client, uniqueSocialIds);
178168
+ const summaries = messages.map((msg) => {
178169
+ const senderName = socialIdToName.get(msg.modifiedBy);
178170
+ return {
178171
+ id: MessageId.make(msg._id),
178172
+ body: markupToMarkdownString(msg.message, markupUrlConfig),
178173
+ sender: senderName !== void 0 ? PersonName.make(senderName) : void 0,
178174
+ senderId: msg.modifiedBy,
178175
+ createdOn: msg.createdOn,
178176
+ modifiedOn: msg.modifiedOn,
178177
+ editedOn: msg.editedOn,
178178
+ replies: msg.replies
178179
+ };
178180
+ });
178181
+ return { messages: summaries, total };
178182
+ });
178183
+ var sendDirectMessage = (params) => Effect_exports.gen(function* () {
178184
+ const { client, dm } = yield* findDirectMessage(params.dm);
178185
+ const markupUrlConfig = client.markupUrlConfig;
178186
+ const messageId = (0, import_core27.generateId)();
178187
+ const markup = markdownToMarkupString(params.body, markupUrlConfig);
178188
+ const messageData = {
178189
+ message: markup,
178190
+ attachments: 0
178191
+ };
178192
+ yield* client.addCollection(
178193
+ chunter.class.ChatMessage,
178194
+ dm._id,
178195
+ dm._id,
178196
+ chunter.class.DirectMessage,
178197
+ "messages",
178198
+ messageData,
178199
+ messageId
178200
+ );
178201
+ return { id: MessageId.make(messageId), dmId: ChannelId.make(dm._id) };
178202
+ });
178203
+ var updateDirectMessage = (params) => Effect_exports.gen(function* () {
178204
+ const { client, dm, message } = yield* findDirectMessageMessage(params);
178205
+ const markupUrlConfig = client.markupUrlConfig;
178206
+ const markup = markdownToMarkupString(params.body, markupUrlConfig);
178207
+ const now2 = yield* Clock_exports.currentTimeMillis;
178208
+ const updateOps = {
178209
+ message: markup,
178210
+ editedOn: now2
178211
+ };
178212
+ yield* client.updateDoc(
178213
+ chunter.class.ChatMessage,
178214
+ dm._id,
178215
+ message._id,
178216
+ updateOps
178217
+ );
178218
+ return { id: MessageId.make(message._id), updated: true };
178219
+ });
178220
+ var deleteDirectMessage = (params) => Effect_exports.gen(function* () {
178221
+ const { client, dm, message } = yield* findDirectMessageMessage(params);
178222
+ yield* client.removeDoc(
178223
+ chunter.class.ChatMessage,
178224
+ dm._id,
178225
+ message._id
178226
+ );
178227
+ return { id: MessageId.make(message._id), deleted: true };
178228
+ });
178229
+
178230
+ // src/huly/operations/threads.ts
178231
+ var import_core28 = __toESM(require_lib4(), 1);
177995
178232
  var findReply = (client, channel, message, replyId) => Effect_exports.gen(function* () {
177996
178233
  const reply = yield* client.findOne(
177997
178234
  chunter.class.ThreadMessage,
@@ -178022,7 +178259,7 @@ var listThreadReplies = (params) => Effect_exports.gen(function* () {
178022
178259
  {
178023
178260
  limit,
178024
178261
  sort: {
178025
- createdOn: import_core27.SortingOrder.Ascending
178262
+ createdOn: import_core28.SortingOrder.Ascending
178026
178263
  }
178027
178264
  }
178028
178265
  );
@@ -178050,7 +178287,7 @@ var listThreadReplies = (params) => Effect_exports.gen(function* () {
178050
178287
  var addThreadReply = (params) => Effect_exports.gen(function* () {
178051
178288
  const { channel, client, message } = yield* findChannelMessage(params);
178052
178289
  const markupUrlConfig = client.markupUrlConfig;
178053
- const replyId = (0, import_core27.generateId)();
178290
+ const replyId = (0, import_core28.generateId)();
178054
178291
  const markup = markdownToMarkupString(params.body, markupUrlConfig);
178055
178292
  const replyData = {
178056
178293
  message: markup,
@@ -178215,6 +178452,50 @@ var channelTools = [
178215
178452
  listDirectMessages
178216
178453
  )
178217
178454
  },
178455
+ {
178456
+ name: "list_dm_messages",
178457
+ description: "List messages in a direct-message conversation, newest first. The `dm` argument accepts either the DM `_id` or a participant display name (e.g. `Kerr,Shannon`); a name resolves only to a one-to-one DM with the authenticated account.",
178458
+ category: CATEGORY5,
178459
+ inputSchema: listDmMessagesParamsJsonSchema,
178460
+ handler: createToolHandler(
178461
+ "list_dm_messages",
178462
+ parseListDmMessagesParams,
178463
+ listDirectMessageMessages
178464
+ )
178465
+ },
178466
+ {
178467
+ name: "send_dm_message",
178468
+ description: "Send a message to a direct-message conversation. The `dm` argument accepts either the DM `_id` or a participant display name; a name resolves only to a one-to-one DM with the authenticated account. Message body supports markdown formatting.",
178469
+ category: CATEGORY5,
178470
+ inputSchema: sendDmMessageParamsJsonSchema,
178471
+ handler: createToolHandler(
178472
+ "send_dm_message",
178473
+ parseSendDmMessageParams,
178474
+ sendDirectMessage
178475
+ )
178476
+ },
178477
+ {
178478
+ name: "update_dm_message",
178479
+ description: "Update a direct-message message. The `dm` argument accepts either the DM `_id` or a participant display name; a name resolves only to a one-to-one DM with the authenticated account. Only the body can be modified.",
178480
+ category: CATEGORY5,
178481
+ inputSchema: updateDmMessageParamsJsonSchema,
178482
+ handler: createToolHandler(
178483
+ "update_dm_message",
178484
+ parseUpdateDmMessageParams,
178485
+ updateDirectMessage
178486
+ )
178487
+ },
178488
+ {
178489
+ name: "delete_dm_message",
178490
+ description: "Permanently delete a direct-message message. The `dm` argument accepts either the DM `_id` or a participant display name; a name resolves only to a one-to-one DM with the authenticated account. This action cannot be undone.",
178491
+ category: CATEGORY5,
178492
+ inputSchema: deleteDmMessageParamsJsonSchema,
178493
+ handler: createToolHandler(
178494
+ "delete_dm_message",
178495
+ parseDeleteDmMessageParams,
178496
+ deleteDirectMessage
178497
+ )
178498
+ },
178218
178499
  {
178219
178500
  name: "list_thread_replies",
178220
178501
  description: "List replies in a message thread. Returns replies sorted by date (oldest first).",
@@ -178262,7 +178543,7 @@ var channelTools = [
178262
178543
  ];
178263
178544
 
178264
178545
  // src/huly/operations/comments.ts
178265
- var import_core28 = __toESM(require_lib4(), 1);
178546
+ var import_core29 = __toESM(require_lib4(), 1);
178266
178547
  var findProjectAndIssue2 = (params) => findProjectAndIssue({ project: params.project, identifier: params.issueIdentifier });
178267
178548
  var findComment = (params) => Effect_exports.gen(function* () {
178268
178549
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue2({
@@ -178301,7 +178582,7 @@ var listComments = (params) => Effect_exports.gen(function* () {
178301
178582
  {
178302
178583
  limit,
178303
178584
  sort: {
178304
- createdOn: import_core28.SortingOrder.Ascending
178585
+ createdOn: import_core29.SortingOrder.Ascending
178305
178586
  }
178306
178587
  }
178307
178588
  );
@@ -178330,7 +178611,7 @@ var addComment = (params) => Effect_exports.gen(function* () {
178330
178611
  issueIdentifier: params.issueIdentifier
178331
178612
  });
178332
178613
  const markupUrlConfig = client.markupUrlConfig;
178333
- const commentId = (0, import_core28.generateId)();
178614
+ const commentId = (0, import_core29.generateId)();
178334
178615
  const commentData = {
178335
178616
  message: markdownToMarkupString(params.body, markupUrlConfig)
178336
178617
  };
@@ -178441,7 +178722,7 @@ var commentTools = [
178441
178722
 
178442
178723
  // src/huly/operations/organizations.ts
178443
178724
  var import_contact = __toESM(require_lib28(), 1);
178444
- var import_core30 = __toESM(require_lib4(), 1);
178725
+ var import_core31 = __toESM(require_lib4(), 1);
178445
178726
 
178446
178727
  // src/huly/lead-plugin.ts
178447
178728
  var leadRef = (identifier2) => identifier2;
@@ -178457,7 +178738,7 @@ var leadClassIds = {
178457
178738
  };
178458
178739
 
178459
178740
  // src/huly/operations/contacts-shared.ts
178460
- var import_core29 = __toESM(require_lib4(), 1);
178741
+ var import_core30 = __toESM(require_lib4(), 1);
178461
178742
  var findPersonById = (client, personId) => client.findOne(
178462
178743
  contact.class.Person,
178463
178744
  { _id: toRef(personId) }
@@ -178502,7 +178783,7 @@ var findPersonBySocialIdentityEmail = (client, email3) => Effect_exports.gen(fun
178502
178783
  const identity5 = yield* client.findOne(
178503
178784
  contact.class.SocialIdentity,
178504
178785
  {
178505
- type: import_core29.SocialIdType.EMAIL,
178786
+ type: import_core30.SocialIdType.EMAIL,
178506
178787
  value: email3
178507
178788
  }
178508
178789
  );
@@ -178604,7 +178885,7 @@ var listOrganizations = (params) => Effect_exports.gen(function* () {
178604
178885
  {},
178605
178886
  {
178606
178887
  limit,
178607
- sort: { modifiedOn: import_core30.SortingOrder.Descending }
178888
+ sort: { modifiedOn: import_core31.SortingOrder.Descending }
178608
178889
  }
178609
178890
  );
178610
178891
  return orgs.map((org) => ({
@@ -178617,7 +178898,7 @@ var listOrganizations = (params) => Effect_exports.gen(function* () {
178617
178898
  });
178618
178899
  var createOrganization = (params) => Effect_exports.gen(function* () {
178619
178900
  const client = yield* HulyClient;
178620
- const orgId = (0, import_core30.generateId)();
178901
+ const orgId = (0, import_core31.generateId)();
178621
178902
  const memberPersonIds = params.members !== void 0 && params.members.length > 0 ? yield* resolvePersonIdentifiers(client, params.members) : [];
178622
178903
  const orgData = {
178623
178904
  name: params.name,
@@ -178850,7 +179131,7 @@ var removeOrganizationMember = (params) => Effect_exports.gen(function* () {
178850
179131
 
178851
179132
  // src/huly/operations/persons.ts
178852
179133
  var import_contact2 = __toESM(require_lib28(), 1);
178853
- var import_core31 = __toESM(require_lib4(), 1);
179134
+ var import_core32 = __toESM(require_lib4(), 1);
178854
179135
  var formatName = (firstName, lastName) => `${lastName},${firstName}`;
178855
179136
  var parseName = (name) => {
178856
179137
  const parts2 = name.split(",");
@@ -178911,7 +179192,7 @@ var listPersons = (params) => Effect_exports.gen(function* () {
178911
179192
  query,
178912
179193
  {
178913
179194
  limit,
178914
- sort: { modifiedOn: import_core31.SortingOrder.Descending }
179195
+ sort: { modifiedOn: import_core32.SortingOrder.Descending }
178915
179196
  }
178916
179197
  );
178917
179198
  const personIds = persons.map((p) => p._id);
@@ -178962,7 +179243,7 @@ var getPerson = (params) => Effect_exports.gen(function* () {
178962
179243
  });
178963
179244
  var createPerson = (params) => Effect_exports.gen(function* () {
178964
179245
  const client = yield* HulyClient;
178965
- const personId = (0, import_core31.generateId)();
179246
+ const personId = (0, import_core32.generateId)();
178966
179247
  const personData = {
178967
179248
  name: formatName(params.firstName, params.lastName),
178968
179249
  // Huly API requires city field to be set, even if empty
@@ -179038,7 +179319,7 @@ var listEmployees = (params) => Effect_exports.gen(function* () {
179038
179319
  {},
179039
179320
  {
179040
179321
  limit,
179041
- sort: { modifiedOn: import_core31.SortingOrder.Descending }
179322
+ sort: { modifiedOn: import_core32.SortingOrder.Descending }
179042
179323
  }
179043
179324
  );
179044
179325
  const employeeIds = employees.map((e) => e._id);
@@ -179262,7 +179543,7 @@ var contactTools = [
179262
179543
  ];
179263
179544
 
179264
179545
  // src/huly/operations/custom-fields.ts
179265
- var import_core32 = __toESM(require_lib4(), 1);
179546
+ var import_core33 = __toESM(require_lib4(), 1);
179266
179547
  var DEFAULT_LIMIT2 = 200;
179267
179548
  var classRef = core.class.Class;
179268
179549
  var extractLabel = (label) => {
@@ -179297,7 +179578,7 @@ var decodeCustomFieldAttribute = (attr) => ({
179297
179578
  });
179298
179579
  var decodeClassInfo = (value3) => {
179299
179580
  const record4 = decodeSdkRecord(value3);
179300
- const kind = typeof record4.kind === "number" ? record4.kind : import_core32.ClassifierKind.CLASS;
179581
+ const kind = typeof record4.kind === "number" ? record4.kind : import_core33.ClassifierKind.CLASS;
179301
179582
  return {
179302
179583
  label: extractLabel(record4.label),
179303
179584
  kind
@@ -179312,7 +179593,7 @@ var resolveClassInfo = (client, classId) => Effect_exports.gen(function* () {
179312
179593
  classRef,
179313
179594
  { _id: toRef(classId) }
179314
179595
  );
179315
- return cls !== void 0 ? decodeClassInfo(cls) : { label: classId, kind: import_core32.ClassifierKind.CLASS };
179596
+ return cls !== void 0 ? decodeClassInfo(cls) : { label: classId, kind: import_core33.ClassifierKind.CLASS };
179316
179597
  });
179317
179598
  var batchResolveClassLabels = (client, classIds) => Effect_exports.gen(function* () {
179318
179599
  if (classIds.length === 0) return /* @__PURE__ */ new Map();
@@ -179395,7 +179676,7 @@ var listCustomFields = (params) => Effect_exports.gen(function* () {
179395
179676
  const customAttrs = yield* client.findAll(
179396
179677
  core.class.Attribute,
179397
179678
  query,
179398
- { limit, sort: { modifiedOn: import_core32.SortingOrder.Descending } }
179679
+ { limit, sort: { modifiedOn: import_core33.SortingOrder.Descending } }
179399
179680
  );
179400
179681
  const decodedAttrs = customAttrs.map(decodeCustomFieldAttribute);
179401
179682
  const ownerLabels = yield* batchResolveClassLabels(
@@ -179451,7 +179732,7 @@ var setCustomField = (params) => Effect_exports.gen(function* () {
179451
179732
  const parsedValue = parseValueForType(params.value, decodedAttr.typeDescriptor.typeName);
179452
179733
  const decodedDoc = decodeCustomFieldDocument(doc);
179453
179734
  const ownerInfo = yield* resolveClassInfo(client, decodedAttr.ownerClassId);
179454
- if (ownerInfo.kind === import_core32.ClassifierKind.MIXIN) {
179735
+ if (ownerInfo.kind === import_core33.ClassifierKind.MIXIN) {
179455
179736
  const mixinRef = toRef(decodedAttr.ownerClassId);
179456
179737
  yield* client.updateMixin(
179457
179738
  objectRef,
@@ -179521,7 +179802,7 @@ var customFieldTools = [
179521
179802
  ];
179522
179803
 
179523
179804
  // src/huly/operations/components.ts
179524
- var import_core33 = __toESM(require_lib4(), 1);
179805
+ var import_core34 = __toESM(require_lib4(), 1);
179525
179806
 
179526
179807
  // src/utils/assertions.ts
179527
179808
  var AssertionError = class extends Error {
@@ -179575,7 +179856,7 @@ var listComponents = (params) => Effect_exports.gen(function* () {
179575
179856
  { space: project3._id },
179576
179857
  {
179577
179858
  limit,
179578
- sort: { modifiedOn: import_core33.SortingOrder.Descending }
179859
+ sort: { modifiedOn: import_core34.SortingOrder.Descending }
179579
179860
  }
179580
179861
  );
179581
179862
  const leadIds = [
@@ -179617,7 +179898,7 @@ var getComponent = (params) => Effect_exports.gen(function* () {
179617
179898
  var createComponent = (params) => Effect_exports.gen(function* () {
179618
179899
  const { client, project: project3 } = yield* findProject(params.project);
179619
179900
  const markupUrlConfig = client.markupUrlConfig;
179620
- const componentId = (0, import_core33.generateId)();
179901
+ const componentId = (0, import_core34.generateId)();
179621
179902
  const leadParam = params.lead;
179622
179903
  const leadRef2 = leadParam !== void 0 ? yield* Effect_exports.gen(function* () {
179623
179904
  const person = yield* findPersonByEmailOrName(client, leadParam);
@@ -180273,10 +180554,10 @@ var unlinkDocumentFromIssue = (params) => Effect_exports.gen(function* () {
180273
180554
  });
180274
180555
 
180275
180556
  // src/huly/operations/issue-templates.ts
180276
- var import_core37 = __toESM(require_lib4(), 1);
180557
+ var import_core38 = __toESM(require_lib4(), 1);
180277
180558
 
180278
180559
  // src/huly/operations/issues-move.ts
180279
- var import_core34 = __toESM(require_lib4(), 1);
180560
+ var import_core35 = __toESM(require_lib4(), 1);
180280
180561
  var import_tracker2 = __toESM(require_lib36(), 1);
180281
180562
  var addLabel = (params) => Effect_exports.gen(function* () {
180282
180563
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
@@ -180303,7 +180584,7 @@ var addLabel = (params) => Effect_exports.gen(function* () {
180303
180584
  }
180304
180585
  );
180305
180586
  if (tagElement === void 0) {
180306
- const tagElementId = (0, import_core34.generateId)();
180587
+ const tagElementId = (0, import_core35.generateId)();
180307
180588
  const tagElementData = {
180308
180589
  title: labelTitle,
180309
180590
  description: "",
@@ -180436,7 +180717,7 @@ var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) =
180436
180717
  });
180437
180718
 
180438
180719
  // src/huly/operations/issues-read.ts
180439
- var import_core35 = __toESM(require_lib4(), 1);
180720
+ var import_core36 = __toESM(require_lib4(), 1);
180440
180721
  var import_tracker3 = __toESM(require_lib36(), 1);
180441
180722
  var resolveStatusName = (statuses, statusId) => {
180442
180723
  const statusDoc = statuses.find((s) => s._id === statusId);
@@ -180527,7 +180808,7 @@ var listIssues = (params) => Effect_exports.gen(function* () {
180527
180808
  {
180528
180809
  limit,
180529
180810
  sort: {
180530
- modifiedOn: import_core35.SortingOrder.Descending
180811
+ modifiedOn: import_core36.SortingOrder.Descending
180531
180812
  }
180532
180813
  },
180533
180814
  { assignee: contact.class.Person }
@@ -180607,7 +180888,7 @@ var getIssue = (params) => Effect_exports.gen(function* () {
180607
180888
  });
180608
180889
 
180609
180890
  // src/huly/operations/issues-write.ts
180610
- var import_core36 = __toESM(require_lib4(), 1);
180891
+ var import_core37 = __toESM(require_lib4(), 1);
180611
180892
  var import_rank3 = __toESM(require_lib33(), 1);
180612
180893
  var import_tracker4 = __toESM(require_lib36(), 1);
180613
180894
  var TxIncResult = Schema_exports.Struct({
@@ -180628,7 +180909,7 @@ var resolveAssignee = (client, assigneeIdentifier) => Effect_exports.gen(functio
180628
180909
  });
180629
180910
  var createIssue = (params) => Effect_exports.gen(function* () {
180630
180911
  const { client, defaultStatusId, project: project3, statuses } = yield* findProjectWithStatuses(params.project);
180631
- const issueId = (0, import_core36.generateId)();
180912
+ const issueId = (0, import_core37.generateId)();
180632
180913
  const incOps = { $inc: { sequence: 1 } };
180633
180914
  const incResult = yield* client.updateDoc(
180634
180915
  tracker.class.Project,
@@ -180643,7 +180924,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
180643
180924
  const lastIssue = yield* client.findOne(
180644
180925
  tracker.class.Issue,
180645
180926
  { space: project3._id },
180646
- { sort: { rank: import_core36.SortingOrder.Descending } }
180927
+ { sort: { rank: import_core37.SortingOrder.Descending } }
180647
180928
  );
180648
180929
  const rank = (0, import_rank3.makeRank)(lastIssue?.rank, void 0);
180649
180930
  const descriptionMarkupRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
@@ -180847,7 +181128,7 @@ var buildTemplateChild = (client, markupUrlConfig, projectId, projectIdentifier,
180847
181128
  return component._id;
180848
181129
  }) : null;
180849
181130
  return {
180850
- id: (0, import_core37.generateId)(),
181131
+ id: (0, import_core38.generateId)(),
180851
181132
  title: input.title,
180852
181133
  description: optionalMarkdownToMarkup(input.description, markupUrlConfig, ""),
180853
181134
  priority: stringToPriority(input.priority || "no-priority"),
@@ -180864,7 +181145,7 @@ var listIssueTemplates = (params) => Effect_exports.gen(function* () {
180864
181145
  { space: project3._id },
180865
181146
  {
180866
181147
  limit,
180867
- sort: { modifiedOn: import_core37.SortingOrder.Descending }
181148
+ sort: { modifiedOn: import_core38.SortingOrder.Descending }
180868
181149
  }
180869
181150
  );
180870
181151
  const summaries = templates.map((t) => {
@@ -180910,7 +181191,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
180910
181191
  var createIssueTemplate = (params) => Effect_exports.gen(function* () {
180911
181192
  const { client, project: project3 } = yield* findProject(params.project);
180912
181193
  const markupUrlConfig = client.markupUrlConfig;
180913
- const templateId = (0, import_core37.generateId)();
181194
+ const templateId = (0, import_core38.generateId)();
180914
181195
  const assigneeParam = params.assignee;
180915
181196
  const assigneeRef = assigneeParam !== void 0 ? yield* Effect_exports.gen(function* () {
180916
181197
  const person = yield* findPersonByEmailOrName(client, assigneeParam);
@@ -181147,10 +181428,10 @@ var removeTemplateChild = (params) => Effect_exports.gen(function* () {
181147
181428
  });
181148
181429
 
181149
181430
  // src/huly/operations/labels.ts
181150
- var import_core39 = __toESM(require_lib4(), 1);
181431
+ var import_core40 = __toESM(require_lib4(), 1);
181151
181432
 
181152
181433
  // src/huly/operations/tag-categories.ts
181153
- var import_core38 = __toESM(require_lib4(), 1);
181434
+ var import_core39 = __toESM(require_lib4(), 1);
181154
181435
  var issueClassRef = toRef(tracker.class.Issue);
181155
181436
  var findCategoryByIdOrLabel = (client, idOrLabel) => Effect_exports.gen(function* () {
181156
181437
  const cat = (yield* client.findOne(
@@ -181188,7 +181469,7 @@ var listTagCategories = (params) => Effect_exports.gen(function* () {
181188
181469
  query,
181189
181470
  {
181190
181471
  limit,
181191
- sort: { modifiedOn: import_core38.SortingOrder.Descending }
181472
+ sort: { modifiedOn: import_core39.SortingOrder.Descending }
181192
181473
  }
181193
181474
  );
181194
181475
  return categories.map(toSummary);
@@ -181203,7 +181484,7 @@ var createTagCategory = (params) => Effect_exports.gen(function* () {
181203
181484
  if (existing !== void 0) {
181204
181485
  return { id: TagCategoryId.make(existing._id), label: existing.label, created: false };
181205
181486
  }
181206
- const catId = (0, import_core38.generateId)();
181487
+ const catId = (0, import_core39.generateId)();
181207
181488
  const catData = {
181208
181489
  // Asset is a branded string type (Metadata<URL>) with no runtime constructor.
181209
181490
  // Empty string is the "no icon" sentinel; Huly UI renders a default icon.
@@ -181305,7 +181586,7 @@ var listLabels = (params) => Effect_exports.gen(function* () {
181305
181586
  query,
181306
181587
  {
181307
181588
  limit,
181308
- sort: { modifiedOn: import_core39.SortingOrder.Descending }
181589
+ sort: { modifiedOn: import_core40.SortingOrder.Descending }
181309
181590
  }
181310
181591
  );
181311
181592
  return elements.map((e) => ({
@@ -181330,7 +181611,7 @@ var createLabel = (params) => Effect_exports.gen(function* () {
181330
181611
  return { id: TagElementId.make(existing._id), title: existing.title, created: false };
181331
181612
  }
181332
181613
  const categoryRef = yield* resolveCategoryRef(client, params.category);
181333
- const tagId = (0, import_core39.generateId)();
181614
+ const tagId = (0, import_core40.generateId)();
181334
181615
  const color = params.color ?? 0;
181335
181616
  const tagData = {
181336
181617
  title: params.title,
@@ -181760,7 +182041,7 @@ var labelTools = [
181760
182041
  ];
181761
182042
 
181762
182043
  // src/huly/operations/leads.ts
181763
- var import_core40 = __toESM(require_lib4(), 1);
182044
+ var import_core41 = __toESM(require_lib4(), 1);
181764
182045
  var funnelAsSpace = (funnel) => toRef(funnel._id);
181765
182046
  var markupBlobRefAsMarkupRef = (value3) => value3;
181766
182047
  var normalizeLeadIdentifier = (identifier2) => {
@@ -181862,7 +182143,7 @@ var listFunnels = (params) => Effect_exports.gen(function* () {
181862
182143
  query,
181863
182144
  {
181864
182145
  limit,
181865
- sort: { name: import_core40.SortingOrder.Ascending }
182146
+ sort: { name: import_core41.SortingOrder.Ascending }
181866
182147
  }
181867
182148
  );
181868
182149
  const summaries = funnels.map((funnel) => ({
@@ -181900,7 +182181,7 @@ var listLeads = (params) => Effect_exports.gen(function* () {
181900
182181
  query,
181901
182182
  {
181902
182183
  limit,
181903
- sort: { modifiedOn: import_core40.SortingOrder.Descending },
182184
+ sort: { modifiedOn: import_core41.SortingOrder.Descending },
181904
182185
  // Upstream lead views resolve attachedTo through the Customer mixin.
181905
182186
  // Reference:
181906
182187
  // https://github.com/hcengineering/platform/blob/b9657d53d130a2ed8034c1b71ab0cf8b7a0b4994/models/lead/src/index.ts#L357-L360
@@ -182018,7 +182299,7 @@ var leadTools = [
182018
182299
  ];
182019
182300
 
182020
182301
  // src/huly/operations/milestones.ts
182021
- var import_core41 = __toESM(require_lib4(), 1);
182302
+ var import_core42 = __toESM(require_lib4(), 1);
182022
182303
  var import_tracker5 = __toESM(require_lib36(), 1);
182023
182304
  var milestoneStatusToStringMap = {
182024
182305
  [import_tracker5.MilestoneStatus.Planned]: "planned",
@@ -182062,7 +182343,7 @@ var listMilestones = (params) => Effect_exports.gen(function* () {
182062
182343
  { space: project3._id },
182063
182344
  {
182064
182345
  limit,
182065
- sort: { modifiedOn: import_core41.SortingOrder.Descending }
182346
+ sort: { modifiedOn: import_core42.SortingOrder.Descending }
182066
182347
  }
182067
182348
  );
182068
182349
  const summaries = milestones.map((m) => ({
@@ -182092,7 +182373,7 @@ var getMilestone = (params) => Effect_exports.gen(function* () {
182092
182373
  var createMilestone = (params) => Effect_exports.gen(function* () {
182093
182374
  const { client, project: project3 } = yield* findProject(params.project);
182094
182375
  const markupUrlConfig = client.markupUrlConfig;
182095
- const milestoneId = (0, import_core41.generateId)();
182376
+ const milestoneId = (0, import_core42.generateId)();
182096
182377
  const milestoneData = {
182097
182378
  label: params.label,
182098
182379
  description: optionalMarkdownToMarkup(params.description, markupUrlConfig, ""),
@@ -182246,7 +182527,7 @@ var milestoneTools = [
182246
182527
  ];
182247
182528
 
182248
182529
  // src/huly/operations/notifications.ts
182249
- var import_core42 = __toESM(require_lib4(), 1);
182530
+ var import_core43 = __toESM(require_lib4(), 1);
182250
182531
  var toDocNotifyContextSummary = (ctx) => ({
182251
182532
  id: NotificationContextId.make(ctx._id),
182252
182533
  objectId: ctx.objectId,
@@ -182292,7 +182573,7 @@ var listNotifications = (params) => Effect_exports.gen(function* () {
182292
182573
  {
182293
182574
  limit,
182294
182575
  sort: {
182295
- modifiedOn: import_core42.SortingOrder.Descending
182576
+ modifiedOn: import_core43.SortingOrder.Descending
182296
182577
  }
182297
182578
  }
182298
182579
  );
@@ -182434,7 +182715,7 @@ var listNotificationContexts = (params) => Effect_exports.gen(function* () {
182434
182715
  {
182435
182716
  limit,
182436
182717
  sort: {
182437
- lastUpdateTimestamp: import_core42.SortingOrder.Descending
182718
+ lastUpdateTimestamp: import_core43.SortingOrder.Descending
182438
182719
  }
182439
182720
  }
182440
182721
  );
@@ -182651,7 +182932,7 @@ var notificationTools = [
182651
182932
  ];
182652
182933
 
182653
182934
  // src/huly/operations/projects.ts
182654
- var import_core43 = __toESM(require_lib4(), 1);
182935
+ var import_core44 = __toESM(require_lib4(), 1);
182655
182936
  var import_tracker6 = __toESM(require_lib36(), 1);
182656
182937
  var listProjects = (params) => Effect_exports.gen(function* () {
182657
182938
  const client = yield* HulyClient;
@@ -182666,7 +182947,7 @@ var listProjects = (params) => Effect_exports.gen(function* () {
182666
182947
  {
182667
182948
  limit,
182668
182949
  sort: {
182669
- name: import_core43.SortingOrder.Ascending
182950
+ name: import_core44.SortingOrder.Ascending
182670
182951
  }
182671
182952
  }
182672
182953
  );
@@ -182735,7 +183016,7 @@ var createProject = (params) => Effect_exports.gen(function* () {
182735
183016
  created: false
182736
183017
  };
182737
183018
  }
182738
- const projectId = (0, import_core43.generateId)();
183019
+ const projectId = (0, import_core44.generateId)();
182739
183020
  const projectData = {
182740
183021
  name: params.name,
182741
183022
  description: params.description ?? "",
@@ -182993,7 +183274,7 @@ var tagCategoryTools = [
182993
183274
  ];
182994
183275
 
182995
183276
  // src/huly/operations/task-management.ts
182996
- var import_core44 = __toESM(require_lib4(), 1);
183277
+ var import_core45 = __toESM(require_lib4(), 1);
182997
183278
  var import_platform2 = __toESM(require_lib(), 1);
182998
183279
  var CATEGORY_TO_REF = {
182999
183280
  backlog: task.statusCategory.UnStarted,
@@ -183096,7 +183377,7 @@ var projectTypeDetail = (data) => ({
183096
183377
  var listAllProjectTypes = (client) => client.findAll(
183097
183378
  task.class.ProjectType,
183098
183379
  {},
183099
- { sort: { name: import_core44.SortingOrder.Ascending } }
183380
+ { sort: { name: import_core45.SortingOrder.Ascending } }
183100
183381
  ).pipe(Effect_exports.map((result) => [...result]));
183101
183382
  var resolveProjectType = (client, projectTypeRef) => Effect_exports.gen(function* () {
183102
183383
  const projectTypes = yield* listAllProjectTypes(client);
@@ -183197,7 +183478,7 @@ var createTaskType = (params) => Effect_exports.gen(function* () {
183197
183478
  new HulyError({ message: `Project type '${projectType.name}' has no task type to copy.` })
183198
183479
  );
183199
183480
  }
183200
- const taskTypeId = (0, import_core44.generateId)();
183481
+ const taskTypeId = (0, import_core45.generateId)();
183201
183482
  const targetClassId = `${taskTypeId}:type:mixin`;
183202
183483
  const targetClassRef = toRef(targetClassId);
183203
183484
  yield* client.createDoc(
@@ -183205,7 +183486,7 @@ var createTaskType = (params) => Effect_exports.gen(function* () {
183205
183486
  core.space.Model,
183206
183487
  {
183207
183488
  extends: template.ofClass,
183208
- kind: import_core44.ClassifierKind.MIXIN,
183489
+ kind: import_core45.ClassifierKind.MIXIN,
183209
183490
  label: (0, import_platform2.getEmbeddedLabel)(params.name),
183210
183491
  ...template.icon === void 0 ? {} : { icon: template.icon }
183211
183492
  },
@@ -183287,7 +183568,7 @@ var createIssueStatus = (params) => Effect_exports.gen(function* () {
183287
183568
  [...workflowData.statuses, ...statusesByName],
183288
183569
  params.name
183289
183570
  );
183290
- const statusId = existingStatus?._id ?? (0, import_core44.generateId)();
183571
+ const statusId = existingStatus?._id ?? (0, import_core45.generateId)();
183291
183572
  if (existingStatus !== void 0) {
183292
183573
  yield* requireStatusCategoryMatch(existingStatus, params.category);
183293
183574
  }
@@ -183394,7 +183675,7 @@ var taskManagementTools = [
183394
183675
  ];
183395
183676
 
183396
183677
  // src/huly/operations/test-management-core.ts
183397
- var import_core45 = __toESM(require_lib4(), 1);
183678
+ var import_core46 = __toESM(require_lib4(), 1);
183398
183679
 
183399
183680
  // src/huly/test-management-classes.ts
183400
183681
  var testManagement = {
@@ -183548,7 +183829,7 @@ var listTestProjects = (params) => Effect_exports.gen(function* () {
183548
183829
  {},
183549
183830
  {
183550
183831
  limit,
183551
- sort: { name: import_core45.SortingOrder.Ascending }
183832
+ sort: { name: import_core46.SortingOrder.Ascending }
183552
183833
  }
183553
183834
  );
183554
183835
  return {
@@ -183570,7 +183851,7 @@ var listTestSuites = (params) => Effect_exports.gen(function* () {
183570
183851
  query,
183571
183852
  {
183572
183853
  limit,
183573
- sort: { modifiedOn: import_core45.SortingOrder.Descending }
183854
+ sort: { modifiedOn: import_core46.SortingOrder.Descending }
183574
183855
  }
183575
183856
  );
183576
183857
  return {
@@ -183603,7 +183884,7 @@ var createTestSuite = (params) => Effect_exports.gen(function* () {
183603
183884
  if (existing !== void 0) {
183604
183885
  return { id: TestSuiteId.make(existing._id), name: existing.name, created: false };
183605
183886
  }
183606
- const suiteId = (0, import_core45.generateId)();
183887
+ const suiteId = (0, import_core46.generateId)();
183607
183888
  const suiteData = {
183608
183889
  name: params.name,
183609
183890
  description: params.description ?? "",
@@ -183673,7 +183954,7 @@ var listTestCases = (params) => Effect_exports.gen(function* () {
183673
183954
  query,
183674
183955
  {
183675
183956
  limit,
183676
- sort: { modifiedOn: import_core45.SortingOrder.Descending }
183957
+ sort: { modifiedOn: import_core46.SortingOrder.Descending }
183677
183958
  }
183678
183959
  );
183679
183960
  return {
@@ -183701,7 +183982,7 @@ var createTestCase = (params) => Effect_exports.gen(function* () {
183701
183982
  const client = yield* HulyClient;
183702
183983
  const project3 = yield* findTestProject(client, params.project);
183703
183984
  const suite = yield* findTestSuite(client, project3, params.suite);
183704
- const caseId = (0, import_core45.generateId)();
183985
+ const caseId = (0, import_core46.generateId)();
183705
183986
  const assigneeRef = params.assignee !== void 0 ? toRef((yield* resolveAssignee2(params.assignee))._id) : null;
183706
183987
  const typeEnum = params.type !== void 0 ? stringToTestCaseType(params.type) ?? 0 /* Functional */ : 0 /* Functional */;
183707
183988
  const priorityEnum = params.priority !== void 0 ? stringToTestCasePriority(params.priority) ?? 1 /* Medium */ : 1 /* Medium */;
@@ -183931,7 +184212,7 @@ var testManagementCoreTools = [
183931
184212
  ];
183932
184213
 
183933
184214
  // src/huly/operations/test-management-plans.ts
183934
- var import_core46 = __toESM(require_lib4(), 1);
184215
+ var import_core47 = __toESM(require_lib4(), 1);
183935
184216
  var toPlanSummary = (p) => ({
183936
184217
  id: TestPlanId.make(p._id),
183937
184218
  name: p.name
@@ -183949,7 +184230,7 @@ var listTestPlans = (params) => Effect_exports.gen(function* () {
183949
184230
  const plans = yield* client.findAll(
183950
184231
  testManagement.class.TestPlan,
183951
184232
  { space: project3._id },
183952
- { limit, sort: { modifiedOn: import_core46.SortingOrder.Descending } }
184233
+ { limit, sort: { modifiedOn: import_core47.SortingOrder.Descending } }
183953
184234
  );
183954
184235
  return { plans: plans.map(toPlanSummary), total: plans.total };
183955
184236
  });
@@ -183984,7 +184265,7 @@ var createTestPlan = (params) => Effect_exports.gen(function* () {
183984
184265
  if (existing !== void 0) {
183985
184266
  return { id: TestPlanId.make(existing._id), name: existing.name, created: false };
183986
184267
  }
183987
- const planId = (0, import_core46.generateId)();
184268
+ const planId = (0, import_core47.generateId)();
183988
184269
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
183989
184270
  testManagement.class.TestPlan,
183990
184271
  planId,
@@ -184066,7 +184347,7 @@ var removeTestPlanItem = (params) => Effect_exports.gen(function* () {
184066
184347
  });
184067
184348
 
184068
184349
  // src/huly/operations/test-management-runs.ts
184069
- var import_core47 = __toESM(require_lib4(), 1);
184350
+ var import_core48 = __toESM(require_lib4(), 1);
184070
184351
  var BATCH_CONCURRENCY = 10;
184071
184352
  var toRunSummary = (r) => ({
184072
184353
  id: TestRunId.make(r._id),
@@ -184087,7 +184368,7 @@ var listTestRuns = (params) => Effect_exports.gen(function* () {
184087
184368
  const runs = yield* client.findAll(
184088
184369
  testManagement.class.TestRun,
184089
184370
  { space: project3._id },
184090
- { limit, sort: { modifiedOn: import_core47.SortingOrder.Descending } }
184371
+ { limit, sort: { modifiedOn: import_core48.SortingOrder.Descending } }
184091
184372
  );
184092
184373
  return { runs: runs.map(toRunSummary), total: runs.total };
184093
184374
  });
@@ -184116,7 +184397,7 @@ var getTestRun = (params) => Effect_exports.gen(function* () {
184116
184397
  var createTestRun = (params) => Effect_exports.gen(function* () {
184117
184398
  const client = yield* HulyClient;
184118
184399
  const project3 = yield* findTestProject(client, params.project);
184119
- const runId = (0, import_core47.generateId)();
184400
+ const runId = (0, import_core48.generateId)();
184120
184401
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
184121
184402
  testManagement.class.TestRun,
184122
184403
  runId,
@@ -184173,7 +184454,7 @@ var listTestResults = (params) => Effect_exports.gen(function* () {
184173
184454
  const results = yield* client.findAll(
184174
184455
  testManagement.class.TestResult,
184175
184456
  { attachedTo: run3._id },
184176
- { limit, sort: { modifiedOn: import_core47.SortingOrder.Descending } }
184457
+ { limit, sort: { modifiedOn: import_core48.SortingOrder.Descending } }
184177
184458
  );
184178
184459
  return { results: results.map(toResultSummary), total: results.total };
184179
184460
  });
@@ -184274,7 +184555,7 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
184274
184555
  }
184275
184556
  return { item, tc };
184276
184557
  }), { concurrency: BATCH_CONCURRENCY });
184277
- const runId = (0, import_core47.generateId)();
184558
+ const runId = (0, import_core48.generateId)();
184278
184559
  const runName = params.runName ?? `${plan.name} - Run`;
184279
184560
  yield* client.createDoc(testManagement.class.TestRun, project3._id, {
184280
184561
  name: runName,
@@ -184448,7 +184729,7 @@ var testManagementPlansTools = [
184448
184729
 
184449
184730
  // src/huly/operations/time.ts
184450
184731
  var import_calendar7 = __toESM(require_lib25(), 1);
184451
- var import_core48 = __toESM(require_lib4(), 1);
184732
+ var import_core49 = __toESM(require_lib4(), 1);
184452
184733
  var import_tracker7 = __toESM(require_lib36(), 1);
184453
184734
  var serverPopulatedCalendar = toRef("");
184454
184735
  var serverPopulatedPersonId = "";
@@ -184458,7 +184739,7 @@ var logTime = (params) => Effect_exports.gen(function* () {
184458
184739
  project: params.project,
184459
184740
  identifier: params.identifier
184460
184741
  });
184461
- const reportId = (0, import_core48.generateId)();
184742
+ const reportId = (0, import_core49.generateId)();
184462
184743
  const now2 = yield* Clock_exports.currentTimeMillis;
184463
184744
  const reportData = {
184464
184745
  employee: null,
@@ -184498,7 +184779,7 @@ var getTimeReport = (params) => Effect_exports.gen(function* () {
184498
184779
  const reports = yield* client.findAll(
184499
184780
  tracker.class.TimeSpendReport,
184500
184781
  { attachedTo: issue2._id },
184501
- { sort: { date: import_core48.SortingOrder.Descending } }
184782
+ { sort: { date: import_core49.SortingOrder.Descending } }
184502
184783
  );
184503
184784
  const employeeIds = [
184504
184785
  ...new Set(
@@ -184550,7 +184831,7 @@ var listTimeSpendReports = (params) => Effect_exports.gen(function* () {
184550
184831
  tracker.class.TimeSpendReport,
184551
184832
  query,
184552
184833
  withLookup(
184553
- { limit, sort: { date: import_core48.SortingOrder.Descending } },
184834
+ { limit, sort: { date: import_core49.SortingOrder.Descending } },
184554
184835
  {
184555
184836
  attachedTo: tracker.class.Issue,
184556
184837
  employee: contact.class.Person
@@ -184579,7 +184860,7 @@ var getDetailedTimeReport = (params) => Effect_exports.gen(function* () {
184579
184860
  tracker.class.TimeSpendReport,
184580
184861
  query,
184581
184862
  withLookup(
184582
- { sort: { date: import_core48.SortingOrder.Descending } },
184863
+ { sort: { date: import_core49.SortingOrder.Descending } },
184583
184864
  {
184584
184865
  attachedTo: tracker.class.Issue,
184585
184866
  employee: contact.class.Person
@@ -184657,7 +184938,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
184657
184938
  const slots = yield* client.findAll(
184658
184939
  time3.class.WorkSlot,
184659
184940
  query,
184660
- { limit, sort: { date: import_core48.SortingOrder.Descending } }
184941
+ { limit, sort: { date: import_core49.SortingOrder.Descending } }
184661
184942
  );
184662
184943
  return slots.map((s) => ({
184663
184944
  id: WorkSlotId.make(s._id),
@@ -184669,7 +184950,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
184669
184950
  });
184670
184951
  var createWorkSlot = (params) => Effect_exports.gen(function* () {
184671
184952
  const client = yield* HulyClient;
184672
- const slotId = (0, import_core48.generateId)();
184953
+ const slotId = (0, import_core49.generateId)();
184673
184954
  const slotData = {
184674
184955
  date: params.date,
184675
184956
  dueDate: params.dueDate,
@@ -184821,15 +185102,15 @@ var timeTools = [
184821
185102
  ];
184822
185103
 
184823
185104
  // src/huly/operations/workspace.ts
184824
- var import_core49 = __toESM(require_lib4(), 1);
185105
+ var import_core50 = __toESM(require_lib4(), 1);
184825
185106
  var accountRoleMap = {
184826
- READONLYGUEST: import_core49.AccountRole.ReadOnlyGuest,
184827
- DocGuest: import_core49.AccountRole.DocGuest,
184828
- GUEST: import_core49.AccountRole.Guest,
184829
- USER: import_core49.AccountRole.User,
184830
- MAINTAINER: import_core49.AccountRole.Maintainer,
184831
- OWNER: import_core49.AccountRole.Owner,
184832
- ADMIN: import_core49.AccountRole.Admin
185107
+ READONLYGUEST: import_core50.AccountRole.ReadOnlyGuest,
185108
+ DocGuest: import_core50.AccountRole.DocGuest,
185109
+ GUEST: import_core50.AccountRole.Guest,
185110
+ USER: import_core50.AccountRole.User,
185111
+ MAINTAINER: import_core50.AccountRole.Maintainer,
185112
+ OWNER: import_core50.AccountRole.Owner,
185113
+ ADMIN: import_core50.AccountRole.Admin
184833
185114
  };
184834
185115
  var toHulyAccountRole = (role) => accountRoleMap[role];
184835
185116
  var formatVersion = (info) => `${info.versionMajor}.${info.versionMinor}.${info.versionPatch}`;