@firfi/huly-mcp 0.4.0 → 0.5.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
@@ -28673,7 +28673,7 @@ var require_classes = __commonJS({
28673
28673
  var classes_exports = {};
28674
28674
  __export2(classes_exports, {
28675
28675
  AccountRole: () => AccountRole,
28676
- ClassifierKind: () => ClassifierKind,
28676
+ ClassifierKind: () => ClassifierKind2,
28677
28677
  DOMAIN_BLOB: () => DOMAIN_BLOB,
28678
28678
  DOMAIN_COLLABORATOR: () => DOMAIN_COLLABORATOR,
28679
28679
  DOMAIN_CONFIGURATION: () => DOMAIN_CONFIGURATION,
@@ -28705,12 +28705,12 @@ var require_classes = __commonJS({
28705
28705
  IndexKind2[IndexKind2["IndexedDsc"] = 2] = "IndexedDsc";
28706
28706
  return IndexKind2;
28707
28707
  })(IndexKind || {});
28708
- var ClassifierKind = /* @__PURE__ */ ((ClassifierKind2) => {
28709
- ClassifierKind2[ClassifierKind2["CLASS"] = 0] = "CLASS";
28710
- ClassifierKind2[ClassifierKind2["INTERFACE"] = 1] = "INTERFACE";
28711
- ClassifierKind2[ClassifierKind2["MIXIN"] = 2] = "MIXIN";
28712
- return ClassifierKind2;
28713
- })(ClassifierKind || {});
28708
+ var ClassifierKind2 = /* @__PURE__ */ ((ClassifierKind22) => {
28709
+ ClassifierKind22[ClassifierKind22["CLASS"] = 0] = "CLASS";
28710
+ ClassifierKind22[ClassifierKind22["INTERFACE"] = 1] = "INTERFACE";
28711
+ ClassifierKind22[ClassifierKind22["MIXIN"] = 2] = "MIXIN";
28712
+ return ClassifierKind22;
28713
+ })(ClassifierKind2 || {});
28714
28714
  var DateRangeMode = /* @__PURE__ */ ((DateRangeMode2) => {
28715
28715
  DateRangeMode2["DATE"] = "date";
28716
28716
  DateRangeMode2["TIME"] = "time";
@@ -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: () => SortingOrder25,
34080
+ SortingOrder: () => SortingOrder26,
34081
34081
  shouldShowArchived: () => shouldShowArchived
34082
34082
  });
34083
34083
  module2.exports = __toCommonJS2(storage_exports);
34084
- var SortingOrder25 = /* @__PURE__ */ ((SortingOrder26) => {
34085
- SortingOrder26[SortingOrder26["Ascending"] = 1] = "Ascending";
34086
- SortingOrder26[SortingOrder26["Descending"] = -1] = "Descending";
34087
- return SortingOrder26;
34088
- })(SortingOrder25 || {});
34084
+ var SortingOrder26 = /* @__PURE__ */ ((SortingOrder27) => {
34085
+ SortingOrder27[SortingOrder27["Ascending"] = 1] = "Ascending";
34086
+ SortingOrder27[SortingOrder27["Descending"] = -1] = "Descending";
34087
+ return SortingOrder27;
34088
+ })(SortingOrder26 || {});
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_core45 = require_lib4();
34591
+ var import_core46 = require_lib4();
34592
34592
  var import_platform2 = __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_core45.concatLink)(this.url, "/providers"));
34627
+ const response = await fetch((0, import_core46.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_core45.concatLink)(this.url, "/cookie");
35282
+ const url4 = (0, import_core46.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_core45.concatLink)(this.url, "/cookie");
35292
+ const url4 = (0, import_core46.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: () => loadServerConfig4
35569
35569
  });
35570
35570
  module2.exports = __toCommonJS2(config_exports3);
35571
- var import_core45 = require_lib4();
35571
+ var import_core46 = require_lib4();
35572
35572
  async function loadServerConfig4(url4) {
35573
- const configUrl = (0, import_core45.concatLink)(url4, "/config.json");
35573
+ const configUrl = (0, import_core46.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_core45 = require_lib4();
35659
+ var import_core46 = 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_core45.concatLink)(this.collaboratorUrl, `/rpc/${encodeURIComponent(documentId)}`);
35678
+ const url4 = (0, import_core46.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_core45 = require_dist16();
53245
+ var import_core46 = require_dist16();
53246
53246
  var import_utils14 = require_utils5();
53247
- var ImageNode = import_core45.Node.create({
53247
+ var ImageNode = import_core46.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_core45.mergeAttributes)(
53306
+ const imgAttributes = (0, import_core46.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_core45 = require_dist16();
53350
+ var import_core46 = require_dist16();
53351
53351
  var import_utils14 = require_utils5();
53352
- var ReferenceNode = import_core45.Node.create({
53352
+ var ReferenceNode = import_core46.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_core45.mergeAttributes)(
53387
+ (0, import_core46.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_core45 = require_dist16();
53447
- var EmojiNode = import_core45.Node.create({
53446
+ var import_core46 = require_dist16();
53447
+ var EmojiNode = import_core46.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_core45.mergeAttributes)(
53487
+ const containerAttributes = (0, import_core46.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_core45.mergeAttributes)(
53520
+ (0, import_core46.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_core45.mergeAttributes)({
53529
+ (0, import_core46.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_core45.mergeAttributes)(
53539
+ (0, import_core46.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_core45 = require_dist16();
53848
- var FileNode = import_core45.Node.create({
53847
+ var import_core46 = require_dist16();
53848
+ var FileNode = import_core46.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_core45 = require_dist16();
54158
+ var import_core46 = 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_core45.textblockTypeInputRule)({
54204
+ (0, import_core46.textblockTypeInputRule)({
54205
54205
  find: backtickInputRegex,
54206
54206
  type: this.type
54207
54207
  }),
54208
- (0, import_core45.textblockTypeInputRule)({
54208
+ (0, import_core46.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_core45 = require_dist16();
54245
- var CommentNode = import_core45.Node.create({
54244
+ var import_core46 = require_dist16();
54245
+ var CommentNode = import_core46.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_core45 = require_dist16();
54292
- var MarkdownNode = import_core45.Node.create({
54291
+ var import_core46 = require_dist16();
54292
+ var MarkdownNode = import_core46.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_core45.mergeAttributes)({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
54310
+ (0, import_core46.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_core45 = require_dist16();
54345
- var EmbedNode = import_core45.Node.create({
54344
+ var import_core46 = require_dist16();
54345
+ var EmbedNode = import_core46.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_core45.mergeAttributes)(HTMLAttributes)]];
54370
+ return ["figure", { "data-type": this.name }, ["iframe", (0, import_core46.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_core45 = require_dist16();
54444
+ var import_core46 = 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_core45.Mark.create({
54459
+ var NoteBaseExtension = import_core46.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_core45 = require_dist16();
54516
+ var import_core46 = require_dist16();
54517
54517
  var NAME2 = "node-uuid";
54518
- var QMSInlineCommentMark = import_core45.Mark.create({
54518
+ var QMSInlineCommentMark = import_core46.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_core45 = require_dist16();
54563
+ var import_core46 = require_dist16();
54564
54564
  function extensionKit(name, fn2) {
54565
- return import_core45.Extension.create({
54565
+ return import_core46.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_core45 = require_dist16();
61594
+ var import_core46 = require_dist16();
61595
61595
  var import_extension_text_style = require_dist20();
61596
- var BackgroundColor = import_core45.Extension.create({
61596
+ var BackgroundColor = import_core46.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_core45.Extension.create({
61637
+ var TextColor = import_core46.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_core45 = require_dist16();
61709
+ var import_core46 = require_dist16();
61710
61710
  var import_model = require_dist10();
61711
61711
  var import_state = require_dist5();
61712
- var InlineCommentMark = import_core45.Mark.create({
61712
+ var InlineCommentMark = import_core46.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_core45 = require_lib4();
77236
+ var import_core46 = 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_core45.concatLink)(this.url, `/browse?workspace=${workspace}`);
77251
- this.imageUrl = (0, import_core45.concatLink)(this.url, `/files?workspace=${workspace}&file=`);
77250
+ this.refUrl = (0, import_core46.concatLink)(this.url, `/browse?workspace=${workspace}`);
77251
+ this.imageUrl = (0, import_core46.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_core45.makeCollabId)(objectClass, objectId, objectAttr);
77261
+ const collabId = (0, import_core46.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_core45.makeCollabId)(objectClass, objectId, objectAttr);
77290
+ const collabId = (0, import_core46.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_client23 = __toESM2(require_lib6());
81775
- var import_core45 = __toESM2(require_lib4());
81774
+ var import_client24 = __toESM2(require_lib6());
81775
+ var import_core46 = __toESM2(require_lib4());
81776
81776
  var import_platform2 = __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_core45.generateId)();
81819
+ sessionId = (0, import_core46.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_core45.generateId)();
81830
+ this.sessionId = (0, import_core46.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_client23.pingConst,
81885
+ method: import_client24.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_client23.ClientSocketReadyState.OPEN && this.helloReceived;
81918
+ return this.websocket != null && this.websocket.readyState === import_client24.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_core45.ClientConnectEvent.Maintenance, void 0, resp.result.stats);
82010
+ void this.onConnect?.(import_core46.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_core45.ClientConnectEvent.Reconnected : import_core45.ClientConnectEvent.Connected,
82045
+ helloResp.reconnect === true ? import_core46.ClientConnectEvent.Reconnected : import_core46.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_client23.pingConst) {
82059
- void this.sendRequest({ method: import_client23.pingConst, params: [] }).catch((err) => {
82058
+ if (resp.result === import_client24.pingConst) {
82059
+ void this.sendRequest({ method: import_client24.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_core45.toFindResult)(result, total, lookupMap);
82095
+ resp.result = (0, import_core46.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_core45.default.class.TxModelUpgrade) {
82139
+ if (tx?._class === import_core46.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_client23.pingConst.length || data.byteLength === import_client23.pongConst.length) {
82151
+ if (data.byteLength === import_client24.pingConst.length || data.byteLength === import_client24.pongConst.length) {
82152
82152
  const text = new TextDecoder().decode(data);
82153
- if (text === import_client23.pingConst) {
82154
- void this.sendRequest({ method: import_client23.pingConst, params: [] }).catch((err) => {
82153
+ if (text === import_client24.pingConst) {
82154
+ void this.sendRequest({ method: import_client24.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_client23.pongConst) {
82159
+ if (text === import_client24.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_platform2.getMetadata)(import_client23.default.metadata.ClientSocketFactory) ?? ((url4) => {
82169
+ const clientSocketFactory = this.opt?.socketFactory ?? (0, import_platform2.getMetadata)(import_client24.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_client23.pongConst) {
82204
+ if (event.data === import_client24.pongConst) {
82205
82205
  this.pingResponse = Date.now();
82206
82206
  return;
82207
82207
  }
82208
- if (event.data === import_client23.pingConst) {
82209
- void this.sendRequest({ method: import_client23.pingConst, params: [] }).catch((err) => {
82208
+ if (event.data === import_client24.pingConst) {
82209
+ void this.sendRequest({ method: import_client24.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_platform2.getMetadata)(import_client23.default.metadata.UseBinaryProtocol) ?? true;
82275
- this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform2.getMetadata)(import_client23.default.metadata.UseProtocolCompression) ?? false;
82274
+ const useBinary = this.opt?.useBinaryProtocol ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.UseBinaryProtocol) ?? true;
82275
+ this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform2.getMetadata)(import_client24.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_client23.pingConst) {
82321
+ if (data.method !== import_client24.pingConst) {
82322
82322
  this.requests.set(id, promise4);
82323
82323
  }
82324
82324
  promise4.sendData = () => {
82325
- if (this.websocket?.readyState === import_client23.ClientSocketReadyState.OPEN) {
82325
+ if (this.websocket?.readyState === import_client24.ClientSocketReadyState.OPEN) {
82326
82326
  promise4.startTime = Date.now();
82327
- if (data.method !== import_client23.pingConst) {
82327
+ if (data.method !== import_client24.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_client23.pingConst);
82340
+ this.websocket?.send(import_client24.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_client23.pingConst) {
82354
+ if (data.method !== import_client24.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_core45.clone)(this.account));
82369
+ return Promise.resolve((0, import_core46.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_core45.default.class.TxApplyIf) {
82428
- return (await this.findAll(import_core45.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
82427
+ if (tx._class === import_core46.default.class.TxApplyIf) {
82428
+ return (await this.findAll(import_core46.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
82429
82429
  }
82430
- return (await this.findAll(import_core45.default.class.Tx, { _id: tx._id }, { limit: 1 })).length === 0;
82430
+ return (await this.findAll(import_core46.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_core45.MeasureMetricsContext("connection", {}),
82470
+ opt?.ctx?.newChild?.("connection", {}) ?? new import_core46.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_client23 = __toESM2(require_lib6());
82521
- var import_core45 = __toESM2(require_lib4());
82520
+ var import_client24 = __toESM2(require_lib6());
82521
+ var import_core46 = __toESM2(require_lib4());
82522
82522
  var import_platform2 = __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_core45.platformNow)();
82527
+ const st = (0, import_core46.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_core45.platformNow)() - st);
82538
+ console.log("init DB complete", (0, import_core46.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_platform2.getMetadata)(import_client23.default.metadata.FilterModel) ?? "none";
82565
- const extraFilter = (0, import_platform2.getMetadata)(import_client23.default.metadata.ExtraFilter) ?? [];
82564
+ const filterModel = (0, import_platform2.getMetadata)(import_client24.default.metadata.FilterModel) ?? "none";
82565
+ const extraFilter = (0, import_platform2.getMetadata)(import_client24.default.metadata.ExtraFilter) ?? [];
82566
82566
  const handler = /* @__PURE__ */ __name(async (handler2) => {
82567
- const url4 = (0, import_core45.concatLink)(endpoint, `/${token}`);
82567
+ const url4 = (0, import_core46.concatLink)(endpoint, `/${token}`);
82568
82568
  const upgradeHandler = /* @__PURE__ */ __name((...txes) => {
82569
82569
  for (const tx of txes) {
82570
- if (tx?._class === import_core45.default.class.TxModelUpgrade) {
82570
+ if (tx?._class === import_core46.default.class.TxModelUpgrade) {
82571
82571
  opt?.onUpgrade?.();
82572
82572
  return;
82573
82573
  }
82574
- if (tx?._class === import_core45.default.class.TxWorkspaceEvent) {
82574
+ if (tx?._class === import_core46.default.class.TxWorkspaceEvent) {
82575
82575
  const event = tx;
82576
- if (event.event === import_core45.WorkspaceEvent.MaintenanceNotification) {
82576
+ if (event.event === import_core46.WorkspaceEvent.MaintenanceNotification) {
82577
82577
  void (0, import_platform2.setPlatformStatus)(
82578
82578
  new import_platform2.Status(import_platform2.Severity.WARNING, import_platform2.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_platform2.getMetadata)(import_client23.default.metadata.ConnectionTimeout);
82593
+ const connectTimeout = opt?.connectionTimeout ?? (0, import_platform2.getMetadata)(import_client24.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_core45.ClientConnectEvent.Maintenance) {
82614
+ if (event !== import_core46.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_core45.createClient)(handler, modelFilter, createModelPersistence(getWSFromToken(token)), opt?.ctx);
82636
+ const client = (0, import_core46.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_core45.fillConfiguration)(txes, configs);
82645
- const allowedPlugins = [...(0, import_platform2.getPlugins)(), ...(0, import_platform2.getMetadata)(import_client23.default.metadata.ExtraPlugins) ?? []];
82644
+ (0, import_core46.fillConfiguration)(txes, configs);
82645
+ const allowedPlugins = [...(0, import_platform2.getPlugins)(), ...(0, import_platform2.getMetadata)(import_client24.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_core45.pluginFilterTx)(excludedPlugins, configs, txes);
82649
+ return (0, import_core46.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_core45.fillConfiguration)(txes, configs);
82654
+ (0, import_core46.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_core45.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82681
- if (tx?._class === import_core45.default.class.TxCreateDoc || tx?._class === import_core45.default.class.TxUpdateDoc || tx?._class === import_core45.default.class.TxRemoveDoc) {
82680
+ const result = (0, import_core46.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82681
+ if (tx?._class === import_core46.default.class.TxCreateDoc || tx?._class === import_core46.default.class.TxUpdateDoc || tx?._class === import_core46.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_platform2.getMetadata)(import_client23.default.metadata.OverridePersistenceStore);
82693
+ const overrideStore = (0, import_platform2.getMetadata)(import_client24.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_client23 = __toESM2(require_lib6());
82791
- var import_core45 = require_lib4();
82790
+ var import_client24 = __toESM2(require_lib6());
82791
+ var import_core46 = require_lib4();
82792
82792
  var import_platform2 = require_lib();
82793
82793
  var import_config8 = require_config();
82794
- var import_markup = require_markup();
82794
+ var import_markup9 = 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_core45.pickPrimarySocialId)(socialIds)._id,
82808
+ primarySocialId: (0, import_core46.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_platform2.addLocation)(import_client23.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
82816
+ (0, import_platform2.addLocation)(import_client24.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
82817
82817
  const { socketFactory, connectionTimeout } = options;
82818
- const clientFactory = await (0, import_platform2.getResource)(import_client23.default.function.GetClient);
82818
+ const clientFactory = await (0, import_platform2.getResource)(import_client24.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_core45.TxOperations(connection, account.primarySocialId);
82835
- this.markup = (0, import_markup.createMarkupOperations)(url4, workspace, token, config3);
82834
+ this.client = new import_core46.TxOperations(connection, account.primarySocialId);
82835
+ this.markup = (0, import_markup9.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_markup.MarkupContent) {
82864
+ if (value3 instanceof import_markup9.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_core45.generateId)();
82874
+ id ??= (0, import_core46.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_core45.generateId)();
82887
+ id ??= (0, import_core46.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_core45 = require_lib4();
83214
+ var import_core46 = require_lib4();
83215
83215
  var import_platform2 = 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_core45.concatLink)(this.endpoint, `/api/v1/find-all/${this.workspace}?${params.toString()}`);
83269
+ const requestUrl = (0, import_core46.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_core45.concatLink)(this.endpoint, `/api/v1/account/${this.workspace}`);
83343
+ const requestUrl = (0, import_core46.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_core45.concatLink)(this.endpoint, `/api/v1/load-model/${this.workspace}`));
83360
+ const requestUrl = new URL((0, import_core46.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_core45.Hierarchy();
83374
- const model = new import_core45.ModelDb(hierarchy);
83375
- const ctx = new import_core45.MeasureMetricsContext("loadModel", {});
83376
- (0, import_core45.buildModel)(ctx, modelResponse, void 0, hierarchy, model);
83373
+ const hierarchy = new import_core46.Hierarchy();
83374
+ const model = new import_core46.ModelDb(hierarchy);
83375
+ const ctx = new import_core46.MeasureMetricsContext("loadModel", {});
83376
+ (0, import_core46.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_core45.concatLink)(this.endpoint, `/api/v1/tx/${this.workspace}`);
83388
+ const requestUrl = (0, import_core46.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_core45.concatLink)(this.endpoint, `/api/v1/search-fulltext/${this.workspace}?${params.toString()}`);
83422
+ const requestUrl = (0, import_core46.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_core45.concatLink)(this.endpoint, `/api/v1/request/${domain3}/${this.workspace}`);
83441
+ const requestUrl = (0, import_core46.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_core45.concatLink)(this.endpoint, `/api/v1/ensure-person/${this.workspace}`);
83460
+ const requestUrl = (0, import_core46.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_core45 = require_lib4();
83517
+ var import_core46 = 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_core45.TxOperations(new RestTxClient(restClient, hierarchy, model, account), account.socialIds[0]);
83523
+ return new import_core46.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_core45.toFindResult)(result, data.total);
83544
+ return (0, import_core46.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_core45 = __toESM2(require_lib4());
83726
+ var import_core46 = __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_core45.default.class.Blob,
83763
+ _class: import_core46.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_core45.default.space.Configuration,
83769
- modifiedBy: import_core45.default.account.System,
83768
+ space: import_core46.default.space.Configuration,
83769
+ modifiedBy: import_core46.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_core45.default.class.Blob,
83804
+ _class: import_core46.default.class.Blob,
83805
83805
  _id: fileResult.id,
83806
- space: import_core45.default.space.Configuration,
83806
+ space: import_core46.default.space.Configuration,
83807
83807
  modifiedOn: fileResult.metadata.lastModified,
83808
- modifiedBy: import_core45.default.account.System,
83808
+ modifiedBy: import_core46.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_core45.concatLink)(url4, config3.FILES_URL) : config3.FILES_URL).replace(
83882
+ const filesUrl = (config3.FILES_URL.startsWith("/") ? (0, import_core46.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_core45.concatLink)(url4, config3.UPLOAD_URL) : config3.UPLOAD_URL).replace(":workspace", token.workspaceId);
83886
+ const uploadUrl = (config3.UPLOAD_URL.startsWith("/") ? (0, import_core46.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_client23.connectStorage,
83940
- createStorageClient: () => import_client23.createStorageClient
83939
+ connectStorage: () => import_client24.connectStorage,
83940
+ createStorageClient: () => import_client24.createStorageClient
83941
83941
  });
83942
83942
  module2.exports = __toCommonJS2(storage_exports);
83943
- var import_client23 = require_client7();
83943
+ var import_client24 = require_client7();
83944
83944
  __reExport2(storage_exports, require_error3(), module2.exports);
83945
83945
  __reExport2(storage_exports, require_types8(), module2.exports);
83946
83946
  }
@@ -84596,7 +84596,7 @@ var require_utils11 = __commonJS({
84596
84596
  getWeekday: () => getWeekday
84597
84597
  });
84598
84598
  module2.exports = __toCommonJS2(utils_exports);
84599
- var import_core45 = require_lib4();
84599
+ var import_core46 = require_lib4();
84600
84600
  var import__ = __toESM2(require_lib24());
84601
84601
  function getInstance(event, date7) {
84602
84602
  const diff8 = event.dueDate - event.date;
@@ -84608,7 +84608,7 @@ var require_utils11 = __commonJS({
84608
84608
  originalStartTime: date7,
84609
84609
  _class: import__.default.class.ReccuringInstance,
84610
84610
  eventId: generateEventId3(),
84611
- _id: (0, import_core45.generateId)(),
84611
+ _id: (0, import_core46.generateId)(),
84612
84612
  virtual: true
84613
84613
  };
84614
84614
  }
@@ -84921,7 +84921,7 @@ var require_utils11 = __commonJS({
84921
84921
  }
84922
84922
  __name(getAllEvents, "getAllEvents");
84923
84923
  function generateEventId3() {
84924
- const id = (0, import_core45.generateId)();
84924
+ const id = (0, import_core46.generateId)();
84925
84925
  return encodeToBase32Hex(id);
84926
84926
  }
84927
84927
  __name(generateEventId3, "generateEventId");
@@ -85335,7 +85335,7 @@ var require_utils12 = __commonJS({
85335
85335
  });
85336
85336
  module2.exports = __toCommonJS2(utils_exports);
85337
85337
  var import_fast_equals = require_cjs();
85338
- var import_core45 = __toESM2(require_lib4());
85338
+ var import_core46 = __toESM2(require_lib4());
85339
85339
  var import__ = __toESM2(require_lib26());
85340
85340
  async function getDirectChannel(client, me, employeeAccount) {
85341
85341
  const accIds = [me, employeeAccount].sort();
@@ -85345,7 +85345,7 @@ var require_utils12 = __commonJS({
85345
85345
  return dm._id;
85346
85346
  }
85347
85347
  }
85348
- return await client.createDoc(import__.default.class.DirectMessage, import_core45.default.space.Space, {
85348
+ return await client.createDoc(import__.default.class.DirectMessage, import_core46.default.space.Space, {
85349
85349
  name: "",
85350
85350
  description: "",
85351
85351
  private: true,
@@ -85649,18 +85649,18 @@ var require_cache4 = __commonJS({
85649
85649
  default: () => ContactCache
85650
85650
  });
85651
85651
  module2.exports = __toCommonJS2(cache_exports);
85652
- var import_core45 = __toESM2(require_lib4());
85652
+ var import_core46 = __toESM2(require_lib4());
85653
85653
  var import__ = __toESM2(require_lib27());
85654
85654
  function isCreateTx(tx) {
85655
- return tx._class === import_core45.default.class.TxCreateDoc;
85655
+ return tx._class === import_core46.default.class.TxCreateDoc;
85656
85656
  }
85657
85657
  __name(isCreateTx, "isCreateTx");
85658
85658
  function isUpdateTx(tx) {
85659
- return tx._class === import_core45.default.class.TxUpdateDoc;
85659
+ return tx._class === import_core46.default.class.TxUpdateDoc;
85660
85660
  }
85661
85661
  __name(isUpdateTx, "isUpdateTx");
85662
85662
  function isMixinTx(tx) {
85663
- return tx._class === import_core45.default.class.TxMixin;
85663
+ return tx._class === import_core46.default.class.TxMixin;
85664
85664
  }
85665
85665
  __name(isMixinTx, "isMixinTx");
85666
85666
  function isPersonTx(tx) {
@@ -85767,7 +85767,7 @@ var require_cache4 = __commonJS({
85767
85767
  const ref = tx.objectId;
85768
85768
  const person = this._personByRef.get(ref);
85769
85769
  if (person === void 0) return;
85770
- const createdPerson = import_core45.TxProcessor.createDoc2Doc(tx);
85770
+ const createdPerson = import_core46.TxProcessor.createDoc2Doc(tx);
85771
85771
  this._personByRef.set(ref, createdPerson);
85772
85772
  const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
85773
85773
  for (const personId of personIds) {
@@ -85785,7 +85785,7 @@ var require_cache4 = __commonJS({
85785
85785
  const newPersonRef = tx.attachedTo;
85786
85786
  this._personRefByPersonId.set(personId, newPersonRef);
85787
85787
  this.addPersonIdToPersonRef(newPersonRef, personId);
85788
- const createdSocialId = import_core45.TxProcessor.createDoc2Doc(tx);
85788
+ const createdSocialId = import_core46.TxProcessor.createDoc2Doc(tx);
85789
85789
  this._socialIdByPersonId.set(personId, createdSocialId);
85790
85790
  this.broadcastChange({
85791
85791
  personRef: newPersonRef,
@@ -85796,7 +85796,7 @@ var require_cache4 = __commonJS({
85796
85796
  const ref = tx.objectId;
85797
85797
  const person = this._personByRef.get(ref);
85798
85798
  if (person == null) return;
85799
- const updatedPerson = isUpdateTx(tx) ? import_core45.TxProcessor.updateDoc2Doc(person, tx) : import_core45.TxProcessor.updateMixin4Doc(person, tx);
85799
+ const updatedPerson = isUpdateTx(tx) ? import_core46.TxProcessor.updateDoc2Doc(person, tx) : import_core46.TxProcessor.updateMixin4Doc(person, tx);
85800
85800
  this._personByRef.set(ref, updatedPerson);
85801
85801
  const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
85802
85802
  for (const personId of personIds) {
@@ -85911,7 +85911,7 @@ var require_utils13 = __commonJS({
85911
85911
  setCurrentEmployeeSpace: () => setCurrentEmployeeSpace
85912
85912
  });
85913
85913
  module2.exports = __toCommonJS2(utils_exports);
85914
- var import_core45 = require_lib4();
85914
+ var import_core46 = require_lib4();
85915
85915
  var import_platform2 = require_lib();
85916
85916
  var import__ = __toESM2(require_lib27());
85917
85917
  var import_types12 = require_types9();
@@ -86115,7 +86115,7 @@ var require_utils13 = __commonJS({
86115
86115
  if (socialIds.length === 0) {
86116
86116
  return;
86117
86117
  }
86118
- return (0, import_core45.pickPrimarySocialId)(socialIds)._id;
86118
+ return (0, import_core46.pickPrimarySocialId)(socialIds)._id;
86119
86119
  }
86120
86120
  __name(getPrimarySocialId, "getPrimarySocialId");
86121
86121
  async function getAllSocialStringsByPersonId(client, personId) {
@@ -86154,12 +86154,12 @@ var require_utils13 = __commonJS({
86154
86154
  __name(getSocialStringsByEmployee, "getSocialStringsByEmployee");
86155
86155
  async function getAllAccounts(client) {
86156
86156
  const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
86157
- return employees.map((it) => it.personUuid).filter(import_core45.notEmpty);
86157
+ return employees.map((it) => it.personUuid).filter(import_core46.notEmpty);
86158
86158
  }
86159
86159
  __name(getAllAccounts, "getAllAccounts");
86160
86160
  async function getAllUserAccounts(client) {
86161
86161
  const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
86162
- return employees.map((it) => it.personUuid).filter(import_core45.notEmpty);
86162
+ return employees.map((it) => it.personUuid).filter(import_core46.notEmpty);
86163
86163
  }
86164
86164
  __name(getAllUserAccounts, "getAllUserAccounts");
86165
86165
  async function ensureEmployee(ctx, me, client, socialIds, getGlobalPerson) {
@@ -86168,7 +86168,7 @@ var require_utils13 = __commonJS({
86168
86168
  }
86169
86169
  __name(ensureEmployee, "ensureEmployee");
86170
86170
  async function ensureEmployeeForPerson(ctx, me, person, client, socialIds, globalPerson) {
86171
- const txFactory = new import_core45.TxFactory(me.primarySocialId);
86171
+ const txFactory = new import_core46.TxFactory(me.primarySocialId);
86172
86172
  const personByUuid = await client.findOne(import__.default.class.Person, { personUuid: person.uuid });
86173
86173
  let personRef = personByUuid?._id;
86174
86174
  if (personRef === void 0) {
@@ -86189,7 +86189,7 @@ var require_utils13 = __commonJS({
86189
86189
  city: globalPerson.city,
86190
86190
  avatarType: import__.AvatarType.COLOR
86191
86191
  };
86192
- personRef = (0, import_core45.generateId)();
86192
+ personRef = (0, import_core46.generateId)();
86193
86193
  const createPersonTx = txFactory.createTxCreateDoc(import__.default.class.Person, import__.default.space.Contacts, data, personRef);
86194
86194
  await client.tx(createPersonTx);
86195
86195
  });
@@ -86199,7 +86199,7 @@ var require_utils13 = __commonJS({
86199
86199
  });
86200
86200
  await client.tx(updatePersonTx);
86201
86201
  }
86202
- const existingIdentifiers = (0, import_core45.toIdMap)(
86202
+ const existingIdentifiers = (0, import_core46.toIdMap)(
86203
86203
  await client.findAll(import__.default.class.SocialIdentity, { _id: { $in: person.socialIds } })
86204
86204
  );
86205
86205
  for (const socialId of socialIds) {
@@ -86224,7 +86224,7 @@ var require_utils13 = __commonJS({
86224
86224
  collection: "socialIds",
86225
86225
  type: socialId.type,
86226
86226
  value: socialId.value,
86227
- key: (0, import_core45.buildSocialIdString)(socialId),
86227
+ key: (0, import_core46.buildSocialIdString)(socialId),
86228
86228
  // TODO: fill it in trigger or on DB level as stored calculated column or smth?
86229
86229
  verifiedOn: socialId.verifiedOn,
86230
86230
  isDeleted: socialId.isDeleted
@@ -86265,9 +86265,9 @@ var require_utils13 = __commonJS({
86265
86265
  }
86266
86266
  }
86267
86267
  }
86268
- const employeeRole = person.role === import_core45.AccountRole.Guest || person.role === import_core45.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
86268
+ const employeeRole = person.role === import_core46.AccountRole.Guest || person.role === import_core46.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
86269
86269
  const employee = await client.findOne(import__.default.mixin.Employee, { _id: personRef });
86270
- if (employee === void 0 || !import_core45.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
86270
+ if (employee === void 0 || !import_core46.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
86271
86271
  await ctx.with("create-employee", {}, async () => {
86272
86272
  if (personRef === void 0) {
86273
86273
  console.error("Person not found");
@@ -86307,7 +86307,7 @@ var require_utils13 = __commonJS({
86307
86307
  }
86308
86308
  __name(loadCachesForPersonId, "loadCachesForPersonId");
86309
86309
  async function loadCachesForPersonIds(client, personIds) {
86310
- const sidObjsMap = (0, import_core45.toIdMap)(
86310
+ const sidObjsMap = (0, import_core46.toIdMap)(
86311
86311
  await client.findAll(
86312
86312
  import__.default.class.SocialIdentity,
86313
86313
  {
@@ -86342,7 +86342,7 @@ var require_utils13 = __commonJS({
86342
86342
  }
86343
86343
  __name(loadCachesForPersonRef, "loadCachesForPersonRef");
86344
86344
  async function loadCachesForPersonRefs(client, personRefs) {
86345
- const persons = (0, import_core45.toIdMap)(
86345
+ const persons = (0, import_core46.toIdMap)(
86346
86346
  await client.findAll(
86347
86347
  import__.default.class.Person,
86348
86348
  {
@@ -86385,7 +86385,7 @@ var require_utils13 = __commonJS({
86385
86385
  personIds.map((pid) => {
86386
86386
  const ref = contactCache.personRefByPersonId.get(pid);
86387
86387
  return ref != null ? [pid, ref] : void 0;
86388
- }).filter(import_core45.notEmpty)
86388
+ }).filter(import_core46.notEmpty)
86389
86389
  );
86390
86390
  }
86391
86391
  __name(getPersonRefsByPersonIdsFromCache, "getPersonRefsByPersonIdsFromCache");
@@ -86432,7 +86432,7 @@ var require_utils13 = __commonJS({
86432
86432
  personIds.map((pid) => {
86433
86433
  const person = contactCache.personByPersonId.get(pid);
86434
86434
  return person != null ? [pid, person] : void 0;
86435
- }).filter(import_core45.notEmpty)
86435
+ }).filter(import_core46.notEmpty)
86436
86436
  );
86437
86437
  }
86438
86438
  __name(getPersonsByPersonIdsFromCache, "getPersonsByPersonIdsFromCache");
@@ -86479,7 +86479,7 @@ var require_utils13 = __commonJS({
86479
86479
  personRefs.map((personRef) => {
86480
86480
  const person = contactCache.personByRef.get(personRef);
86481
86481
  return person != null ? [personRef, person] : void 0;
86482
- }).filter(import_core45.notEmpty)
86482
+ }).filter(import_core46.notEmpty)
86483
86483
  );
86484
86484
  }
86485
86485
  __name(getPersonsByPersonRefsFromCache, "getPersonsByPersonRefsFromCache");
@@ -87084,9 +87084,9 @@ var require_utils14 = __commonJS({
87084
87084
  getFirstRank: () => getFirstRank
87085
87085
  });
87086
87086
  module2.exports = __toCommonJS2(utils_exports);
87087
- var import_core45 = require_lib4();
87087
+ var import_core46 = require_lib4();
87088
87088
  var import_plugin = __toESM2(require_plugin2());
87089
- async function getFirstRank(client, space, parent, sort3 = import_core45.SortingOrder.Descending, extra = {}) {
87089
+ async function getFirstRank(client, space, parent, sort3 = import_core46.SortingOrder.Descending, extra = {}) {
87090
87090
  const doc = await client.findOne(
87091
87091
  import_plugin.default.class.Document,
87092
87092
  { space, parent, ...extra },
@@ -88709,7 +88709,7 @@ var require_utils16 = __commonJS({
88709
88709
  updateProjectType: () => updateProjectType
88710
88710
  });
88711
88711
  module2.exports = __toCommonJS2(utils_exports);
88712
- var import_core45 = __toESM2(require_lib4());
88712
+ var import_core46 = __toESM2(require_lib4());
88713
88713
  var import_platform2 = require_lib();
88714
88714
  var import__ = __toESM2(require_lib33());
88715
88715
  var import_rank4 = require_lib32();
@@ -88745,7 +88745,7 @@ var require_utils16 = __commonJS({
88745
88745
  if (exists5 !== void 0) {
88746
88746
  return exists5._id;
88747
88747
  }
88748
- const res = await client.createDoc(_class, import_core45.default.space.Model, data);
88748
+ const res = await client.createDoc(_class, import_core46.default.space.Model, data);
88749
88749
  return res;
88750
88750
  }
88751
88751
  __name(createState, "createState");
@@ -88775,7 +88775,7 @@ var require_utils16 = __commonJS({
88775
88775
  function findStatusAttr(h, _class) {
88776
88776
  const attrs = h.getAllAttributes(_class);
88777
88777
  for (const it of attrs.values()) {
88778
- if (it.type._class === import_core45.default.class.RefTo && h.isDerived(it.type.to, import_core45.default.class.Status)) {
88778
+ if (it.type._class === import_core46.default.class.RefTo && h.isDerived(it.type.to, import_core46.default.class.Status)) {
88779
88779
  return it;
88780
88780
  }
88781
88781
  }
@@ -88807,7 +88807,7 @@ var require_utils16 = __commonJS({
88807
88807
  const targetProjectClassId = `${_id}:type:mixin`;
88808
88808
  const tmpl = await client.createDoc(
88809
88809
  import__.default.class.ProjectType,
88810
- import_core45.default.space.Model,
88810
+ import_core46.default.space.Model,
88811
88811
  {
88812
88812
  description: data.description,
88813
88813
  shortDescription: data.shortDescription,
@@ -88822,17 +88822,17 @@ var require_utils16 = __commonJS({
88822
88822
  _id
88823
88823
  );
88824
88824
  await client.createDoc(
88825
- import_core45.default.class.Mixin,
88826
- import_core45.default.space.Model,
88825
+ import_core46.default.class.Mixin,
88826
+ import_core46.default.space.Model,
88827
88827
  {
88828
88828
  extends: categoryObj.baseClass,
88829
- kind: import_core45.ClassifierKind.MIXIN,
88829
+ kind: import_core46.ClassifierKind.MIXIN,
88830
88830
  label: (0, import_platform2.getEmbeddedLabel)(data.name),
88831
88831
  icon: baseClassClass.icon
88832
88832
  },
88833
88833
  targetProjectClassId
88834
88834
  );
88835
- await client.createMixin(targetProjectClassId, import_core45.default.class.Mixin, import_core45.default.space.Model, import__.default.mixin.ProjectTypeClass, {
88835
+ await client.createMixin(targetProjectClassId, import_core46.default.class.Mixin, import_core46.default.space.Model, import__.default.mixin.ProjectTypeClass, {
88836
88836
  projectType: _id
88837
88837
  });
88838
88838
  return tmpl;
@@ -88891,22 +88891,22 @@ var require_utils16 = __commonJS({
88891
88891
  const targetClassId = `${taskId}:type:mixin`;
88892
88892
  tdata.targetClass = targetClassId;
88893
88893
  await client.createDoc(
88894
- import_core45.default.class.Mixin,
88895
- import_core45.default.space.Model,
88894
+ import_core46.default.class.Mixin,
88895
+ import_core46.default.space.Model,
88896
88896
  {
88897
88897
  extends: data.ofClass,
88898
- kind: import_core45.ClassifierKind.MIXIN,
88898
+ kind: import_core46.ClassifierKind.MIXIN,
88899
88899
  label: ofClassClass.label,
88900
88900
  icon: ofClassClass.icon
88901
88901
  },
88902
88902
  targetClassId
88903
88903
  );
88904
- await client.createMixin(targetClassId, import_core45.default.class.Mixin, import_core45.default.space.Model, import__.default.mixin.TaskTypeClass, {
88904
+ await client.createMixin(targetClassId, import_core46.default.class.Mixin, import_core46.default.space.Model, import__.default.mixin.TaskTypeClass, {
88905
88905
  taskType: taskId,
88906
88906
  projectType: _id
88907
88907
  });
88908
88908
  }
88909
- await client.createDoc(import__.default.class.TaskType, import_core45.default.space.Model, tdata, taskId);
88909
+ await client.createDoc(import__.default.class.TaskType, import_core46.default.space.Model, tdata, taskId);
88910
88910
  tasksData.set(taskId, tdata);
88911
88911
  _tasks.push(taskId);
88912
88912
  }
@@ -150644,6 +150644,29 @@ var InvalidPersonUuidError = class extends Schema_exports.TaggedError()(
150644
150644
  }
150645
150645
  };
150646
150646
 
150647
+ // src/huly/errors-custom-fields.ts
150648
+ var CustomFieldNotFoundError = class extends Schema_exports.TaggedError()(
150649
+ "CustomFieldNotFoundError",
150650
+ {
150651
+ identifier: Schema_exports.String
150652
+ }
150653
+ ) {
150654
+ get message() {
150655
+ return `Custom field '${this.identifier}' not found`;
150656
+ }
150657
+ };
150658
+ var CustomFieldObjectNotFoundError = class extends Schema_exports.TaggedError()(
150659
+ "CustomFieldObjectNotFoundError",
150660
+ {
150661
+ objectId: Schema_exports.String,
150662
+ objectClass: Schema_exports.String
150663
+ }
150664
+ ) {
150665
+ get message() {
150666
+ return `Object '${this.objectId}' of class '${this.objectClass}' not found`;
150667
+ }
150668
+ };
150669
+
150647
150670
  // src/huly/errors-documents.ts
150648
150671
  var TeamspaceNotFoundError = class extends Schema_exports.TaggedError()(
150649
150672
  "TeamspaceNotFoundError",
@@ -151090,6 +151113,8 @@ var HulyDomainError = Schema_exports.Union(
151090
151113
  TestResultNotFoundError,
151091
151114
  TestPlanItemNotFoundError,
151092
151115
  ComponentNotFoundError,
151116
+ CustomFieldNotFoundError,
151117
+ CustomFieldObjectNotFoundError,
151093
151118
  IssueTemplateNotFoundError,
151094
151119
  TemplateChildNotFoundError,
151095
151120
  NotificationNotFoundError,
@@ -151217,6 +151242,10 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
151217
151242
  (client2) => client2.removeDoc(_class, space, objectId),
151218
151243
  "removeDoc failed"
151219
151244
  ),
151245
+ updateMixin: (objectId, objectClass, objectSpace, mixin, attributes) => withClient(
151246
+ (client2) => client2.updateMixin(objectId, objectClass, objectSpace, mixin, attributes),
151247
+ "updateMixin failed"
151248
+ ),
151220
151249
  uploadMarkup: (objectClass, objectId, objectAttr, markup, format7) => Effect_exports.tryPromise({
151221
151250
  try: () => markupOps.uploadMarkup(objectClass, objectId, objectAttr, markup, format7),
151222
151251
  catch: (e) => new HulyConnectionError({
@@ -151263,6 +151292,7 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
151263
151292
  removeDoc: notImplemented("removeDoc"),
151264
151293
  uploadMarkup: notImplemented("uploadMarkup"),
151265
151294
  fetchMarkup: noopFetchMarkup,
151295
+ updateMixin: notImplemented("updateMixin"),
151266
151296
  updateMarkup: notImplemented("updateMarkup"),
151267
151297
  searchFulltext: notImplemented("searchFulltext")
151268
151298
  };
@@ -171196,7 +171226,7 @@ var PostHog = class extends PostHogBackendClient {
171196
171226
  };
171197
171227
 
171198
171228
  // src/version.ts
171199
- var VERSION = true ? "0.3.2" : "0.0.0-dev";
171229
+ var VERSION = true ? "0.5.0" : "0.0.0-dev";
171200
171230
 
171201
171231
  // src/telemetry/posthog.ts
171202
171232
  var POSTHOG_API_KEY = "phc_TGfFqCGdnF0p68wuFzd5WSw1IsBvOJW0YgoMJDyZPjm";
@@ -171351,6 +171381,8 @@ var INVALID_PARAMS_TAGS = /* @__PURE__ */ new Set([
171351
171381
  "TestResultNotFoundError",
171352
171382
  "TestPlanItemNotFoundError",
171353
171383
  "ComponentNotFoundError",
171384
+ "CustomFieldNotFoundError",
171385
+ "CustomFieldObjectNotFoundError",
171354
171386
  "IssueTemplateNotFoundError",
171355
171387
  "TemplateChildNotFoundError",
171356
171388
  "NotificationNotFoundError",
@@ -172122,10 +172154,24 @@ var import_text3 = __toESM(require_lib9(), 1);
172122
172154
 
172123
172155
  // src/huly/operations/channels.ts
172124
172156
  var import_core20 = __toESM(require_lib4(), 1);
172157
+
172158
+ // src/huly/operations/markup.ts
172125
172159
  var import_text2 = __toESM(require_lib9(), 1);
172126
172160
  var import_text_markdown2 = __toESM(require_lib17(), 1);
172127
- var personIdsAsSocialIdentityRefs = (ids3) => ids3;
172128
172161
  var jsonAsMarkup = import_text2.jsonToMarkup;
172162
+ var markupToMarkdownString = (markup) => {
172163
+ const json3 = (0, import_text2.markupToJSON)(markup);
172164
+ return (0, import_text_markdown2.markupToMarkdown)(json3, { refUrl: "", imageUrl: "" });
172165
+ };
172166
+ var markdownToMarkupString = (markdown) => {
172167
+ const json3 = (0, import_text_markdown2.markdownToMarkup)(markdown, { refUrl: "", imageUrl: "" });
172168
+ return jsonAsMarkup(json3);
172169
+ };
172170
+ var optionalMarkdownToMarkup = (md, fallback = "") => md && md.trim() !== "" ? markdownToMarkupString(md) : fallback;
172171
+ var optionalMarkupToMarkdown = (markup, fallback = "") => markup ? markupToMarkdownString(markup) : fallback;
172172
+
172173
+ // src/huly/operations/channels.ts
172174
+ var personIdsAsSocialIdentityRefs = (ids3) => ids3;
172129
172175
  var findChannel = (identifier2) => Effect_exports.gen(function* () {
172130
172176
  const client = yield* HulyClient;
172131
172177
  const channel = yield* findByNameOrId(
@@ -172139,14 +172185,6 @@ var findChannel = (identifier2) => Effect_exports.gen(function* () {
172139
172185
  }
172140
172186
  return { client, channel };
172141
172187
  });
172142
- var markupToMarkdownString = (markup) => {
172143
- const json3 = (0, import_text2.markupToJSON)(markup);
172144
- return (0, import_text_markdown2.markupToMarkdown)(json3, { refUrl: "", imageUrl: "" });
172145
- };
172146
- var markdownToMarkupString = (markdown) => {
172147
- const json3 = (0, import_text_markdown2.markdownToMarkup)(markdown, { refUrl: "", imageUrl: "" });
172148
- return jsonAsMarkup(json3);
172149
- };
172150
172188
  var buildSocialIdToPersonNameMap = (client, socialIds) => Effect_exports.gen(function* () {
172151
172189
  if (socialIds.length === 0) {
172152
172190
  return /* @__PURE__ */ new Map();
@@ -173984,6 +174022,57 @@ var parseCreateCardParams = Schema_exports.decodeUnknown(CreateCardParamsSchema)
173984
174022
  var parseUpdateCardParams = Schema_exports.decodeUnknown(UpdateCardParamsSchema);
173985
174023
  var parseDeleteCardParams = Schema_exports.decodeUnknown(DeleteCardParamsSchema);
173986
174024
 
174025
+ // src/domain/schemas/custom-fields.ts
174026
+ var ListCustomFieldsParamsSchema = Schema_exports.Struct({
174027
+ targetClass: Schema_exports.optional(
174028
+ NonEmptyString2.annotations({
174029
+ description: "Filter by owner class/mixin ID (e.g. 'tracker:mixin:IssueTypeData' or a dynamic class ID). Returns fields defined on that class only."
174030
+ })
174031
+ ),
174032
+ limit: Schema_exports.optional(
174033
+ LimitParam.annotations({
174034
+ description: "Maximum number of fields to return (default: 200)"
174035
+ })
174036
+ )
174037
+ }).annotations({
174038
+ title: "ListCustomFieldsParams",
174039
+ description: "Parameters for listing custom field definitions"
174040
+ });
174041
+ var GetCustomFieldValuesParamsSchema = Schema_exports.Struct({
174042
+ objectId: NonEmptyString2.annotations({
174043
+ description: "Document ID to read custom field values from"
174044
+ }),
174045
+ objectClass: NonEmptyString2.annotations({
174046
+ description: "Class of the document (e.g. 'tracker:class:Issue', 'card:class:Card', or a dynamic master tag class ID)"
174047
+ })
174048
+ }).annotations({
174049
+ title: "GetCustomFieldValuesParams",
174050
+ description: "Parameters for reading custom field values from a document"
174051
+ });
174052
+ var SetCustomFieldParamsSchema = Schema_exports.Struct({
174053
+ objectId: NonEmptyString2.annotations({
174054
+ description: "Document ID to set the custom field value on"
174055
+ }),
174056
+ objectClass: NonEmptyString2.annotations({
174057
+ description: "Class of the document (e.g. 'tracker:class:Issue', 'card:class:Card', or a dynamic master tag class ID)"
174058
+ }),
174059
+ fieldId: NonEmptyString2.annotations({
174060
+ description: "Custom field attribute ID (the _id from list_custom_fields)"
174061
+ }),
174062
+ value: Schema_exports.String.annotations({
174063
+ description: "Value to set. Strings are passed as-is. For numbers, pass a numeric string (e.g. '42'). For booleans, pass 'true' or 'false'. For enums, pass the enum value string."
174064
+ })
174065
+ }).annotations({
174066
+ title: "SetCustomFieldParams",
174067
+ description: "Parameters for setting a custom field value on a document"
174068
+ });
174069
+ var listCustomFieldsParamsJsonSchema = JSONSchema_exports.make(ListCustomFieldsParamsSchema);
174070
+ var getCustomFieldValuesParamsJsonSchema = JSONSchema_exports.make(GetCustomFieldValuesParamsSchema);
174071
+ var setCustomFieldParamsJsonSchema = JSONSchema_exports.make(SetCustomFieldParamsSchema);
174072
+ var parseListCustomFieldsParams = Schema_exports.decodeUnknown(ListCustomFieldsParamsSchema);
174073
+ var parseGetCustomFieldValuesParams = Schema_exports.decodeUnknown(GetCustomFieldValuesParamsSchema);
174074
+ var parseSetCustomFieldParams = Schema_exports.decodeUnknown(SetCustomFieldParamsSchema);
174075
+
173987
174076
  // src/domain/schemas/issues.ts
173988
174077
  var IssuePriorityValues = ["urgent", "high", "medium", "low", "no-priority"];
173989
174078
  var IssuePriorityLiteral = Schema_exports.Literal(...IssuePriorityValues);
@@ -177207,7 +177296,7 @@ var listComments = (params) => Effect_exports.gen(function* () {
177207
177296
  const validated = yield* Schema_exports.decodeUnknown(Schema_exports.Array(CommentSchema))(
177208
177297
  messages.map((msg) => ({
177209
177298
  id: msg._id,
177210
- body: msg.message,
177299
+ body: optionalMarkupToMarkdown(msg.message),
177211
177300
  authorId: msg.modifiedBy,
177212
177301
  createdOn: msg.createdOn,
177213
177302
  modifiedOn: msg.modifiedOn,
@@ -177230,7 +177319,7 @@ var addComment = (params) => Effect_exports.gen(function* () {
177230
177319
  });
177231
177320
  const commentId = (0, import_core28.generateId)();
177232
177321
  const commentData = {
177233
- message: params.body
177322
+ message: markdownToMarkupString(params.body)
177234
177323
  };
177235
177324
  yield* client.addCollection(
177236
177325
  chunter.class.ChatMessage,
@@ -177248,7 +177337,8 @@ var addComment = (params) => Effect_exports.gen(function* () {
177248
177337
  });
177249
177338
  var updateComment = (params) => Effect_exports.gen(function* () {
177250
177339
  const { client, comment, issue: issue2, project: project3 } = yield* findComment(params);
177251
- if (params.body === comment.message) {
177340
+ const newMarkup = markdownToMarkupString(params.body);
177341
+ if (newMarkup === comment.message) {
177252
177342
  return {
177253
177343
  commentId: CommentId.make(params.commentId),
177254
177344
  issueIdentifier: IssueIdentifier.make(issue2.identifier),
@@ -177257,7 +177347,7 @@ var updateComment = (params) => Effect_exports.gen(function* () {
177257
177347
  }
177258
177348
  const now2 = yield* Clock_exports.currentTimeMillis;
177259
177349
  const updateOps = {
177260
- message: params.body,
177350
+ message: newMarkup,
177261
177351
  editedOn: now2
177262
177352
  };
177263
177353
  yield* client.updateDoc(
@@ -177708,8 +177798,217 @@ var contactTools = [
177708
177798
  }
177709
177799
  ];
177710
177800
 
177711
- // src/huly/operations/components.ts
177801
+ // src/huly/operations/custom-fields.ts
177712
177802
  var import_core30 = __toESM(require_lib4(), 1);
177803
+ var DEFAULT_LIMIT2 = 200;
177804
+ var extractLabel = (label) => {
177805
+ if (typeof label === "string") {
177806
+ const parts2 = label.split(":");
177807
+ return parts2.length > 0 ? parts2[parts2.length - 1] : label;
177808
+ }
177809
+ return String(label ?? "");
177810
+ };
177811
+ var describeType = (type) => {
177812
+ const _class = String(type._class ?? "");
177813
+ if (_class.includes("TypeString")) return { typeName: "string", typeDetails: {} };
177814
+ if (_class.includes("TypeNumber")) return { typeName: "number", typeDetails: {} };
177815
+ if (_class.includes("TypeBoolean")) return { typeName: "boolean", typeDetails: {} };
177816
+ if (_class.includes("EnumOf")) return { typeName: "enum", typeDetails: { enumRef: type.of } };
177817
+ if (_class.includes("ArrOf")) return { typeName: "array", typeDetails: { of: type.of } };
177818
+ if (_class.includes("RefTo")) return { typeName: "ref", typeDetails: { to: type.to } };
177819
+ if (_class.includes("TypeDate")) return { typeName: "date", typeDetails: {} };
177820
+ if (_class.includes("TypeMarkup")) return { typeName: "markup", typeDetails: {} };
177821
+ return { typeName: _class, typeDetails: type };
177822
+ };
177823
+ var classRef = core.class.Class;
177824
+ var resolveClassInfo = (client, classId) => Effect_exports.gen(function* () {
177825
+ const cls = yield* client.findOne(
177826
+ classRef,
177827
+ { _id: toRef(classId) }
177828
+ );
177829
+ if (cls !== void 0) {
177830
+ const record4 = cls;
177831
+ return { label: extractLabel(record4.label), kind: record4.kind };
177832
+ }
177833
+ return { label: classId, kind: import_core30.ClassifierKind.CLASS };
177834
+ });
177835
+ var batchResolveClassLabels = (client, classIds) => Effect_exports.gen(function* () {
177836
+ if (classIds.length === 0) return /* @__PURE__ */ new Map();
177837
+ const classes = yield* client.findAll(
177838
+ classRef,
177839
+ { _id: { $in: classIds.map(toRef) } }
177840
+ );
177841
+ const result = /* @__PURE__ */ new Map();
177842
+ for (const cls of classes) {
177843
+ const record4 = cls;
177844
+ result.set(cls._id, extractLabel(record4.label));
177845
+ }
177846
+ for (const id of classIds) {
177847
+ if (!result.has(id)) {
177848
+ result.set(id, id);
177849
+ }
177850
+ }
177851
+ return result;
177852
+ });
177853
+ var listCustomFields = (params) => Effect_exports.gen(function* () {
177854
+ const client = yield* HulyClient;
177855
+ const limit = clampLimit(params.limit ?? DEFAULT_LIMIT2);
177856
+ const query = { isCustom: true };
177857
+ if (params.targetClass !== void 0) {
177858
+ query.attributeOf = params.targetClass;
177859
+ }
177860
+ const customAttrs = yield* client.findAll(
177861
+ core.class.Attribute,
177862
+ query,
177863
+ { limit, sort: { modifiedOn: import_core30.SortingOrder.Descending } }
177864
+ );
177865
+ const uniqueOwnerIds = [...new Set(customAttrs.map((a) => a.attributeOf))];
177866
+ const ownerLabels = yield* batchResolveClassLabels(client, uniqueOwnerIds);
177867
+ return customAttrs.map((attr) => {
177868
+ const ownerId = attr.attributeOf;
177869
+ const typeRecord = attr.type;
177870
+ const { typeDetails, typeName } = describeType(typeRecord);
177871
+ return {
177872
+ id: attr._id,
177873
+ name: attr.name,
177874
+ label: extractLabel(attr.label),
177875
+ ownerClassId: ownerId,
177876
+ ownerLabel: ownerLabels.get(ownerId) ?? ownerId,
177877
+ type: typeName,
177878
+ typeDetails
177879
+ };
177880
+ });
177881
+ });
177882
+ var getCustomFieldValues = (params) => Effect_exports.gen(function* () {
177883
+ const client = yield* HulyClient;
177884
+ const objectClassRef = toRef(params.objectClass);
177885
+ const objectRef = toRef(params.objectId);
177886
+ const [doc, customAttrs] = yield* Effect_exports.all([
177887
+ client.findOne(objectClassRef, { _id: objectRef }),
177888
+ client.findAll(core.class.Attribute, { isCustom: true })
177889
+ ]);
177890
+ if (doc === void 0) {
177891
+ return yield* new CustomFieldObjectNotFoundError({
177892
+ objectId: params.objectId,
177893
+ objectClass: params.objectClass
177894
+ });
177895
+ }
177896
+ const docRecord = doc;
177897
+ const docKeys = new Set(Object.keys(docRecord));
177898
+ return customAttrs.filter((attr) => docKeys.has(attr.name)).map((attr) => {
177899
+ const typeRecord = attr.type;
177900
+ const { typeName } = describeType(typeRecord);
177901
+ return {
177902
+ fieldId: attr._id,
177903
+ label: extractLabel(attr.label),
177904
+ value: docRecord[attr.name],
177905
+ type: typeName
177906
+ };
177907
+ });
177908
+ });
177909
+ var parseValueForType = (value3, typeName) => {
177910
+ switch (typeName) {
177911
+ case "number": {
177912
+ const num = Number(value3);
177913
+ if (Number.isNaN(num)) return value3;
177914
+ return num;
177915
+ }
177916
+ case "boolean":
177917
+ return value3.toLowerCase() === "true";
177918
+ default:
177919
+ return value3;
177920
+ }
177921
+ };
177922
+ var setCustomField = (params) => Effect_exports.gen(function* () {
177923
+ const client = yield* HulyClient;
177924
+ const objectClassRef = toRef(params.objectClass);
177925
+ const objectRef = toRef(params.objectId);
177926
+ const [attr, doc] = yield* Effect_exports.all([
177927
+ client.findOne(
177928
+ core.class.Attribute,
177929
+ { _id: toRef(params.fieldId), isCustom: true }
177930
+ ),
177931
+ client.findOne(objectClassRef, { _id: objectRef })
177932
+ ]);
177933
+ if (attr === void 0) {
177934
+ return yield* new CustomFieldNotFoundError({ identifier: params.fieldId });
177935
+ }
177936
+ if (doc === void 0) {
177937
+ return yield* new CustomFieldObjectNotFoundError({
177938
+ objectId: params.objectId,
177939
+ objectClass: params.objectClass
177940
+ });
177941
+ }
177942
+ const typeRecord = attr.type;
177943
+ const { typeName } = describeType(typeRecord);
177944
+ const parsedValue = parseValueForType(params.value, typeName);
177945
+ const ownerClassId = attr.attributeOf;
177946
+ const ownerInfo = yield* resolveClassInfo(client, ownerClassId);
177947
+ if (ownerInfo.kind === import_core30.ClassifierKind.MIXIN) {
177948
+ yield* client.updateMixin(
177949
+ objectRef,
177950
+ objectClassRef,
177951
+ doc.space,
177952
+ toRef(ownerClassId),
177953
+ { [attr.name]: parsedValue }
177954
+ );
177955
+ } else {
177956
+ yield* client.updateDoc(
177957
+ toRef(ownerClassId),
177958
+ doc.space,
177959
+ objectRef,
177960
+ { [attr.name]: parsedValue }
177961
+ );
177962
+ }
177963
+ return {
177964
+ objectId: params.objectId,
177965
+ fieldId: attr._id,
177966
+ label: extractLabel(attr.label),
177967
+ value: parsedValue,
177968
+ updated: true
177969
+ };
177970
+ });
177971
+
177972
+ // src/mcp/tools/custom-fields.ts
177973
+ var CATEGORY8 = "custom-fields";
177974
+ var customFieldTools = [
177975
+ {
177976
+ name: "list_custom_fields",
177977
+ description: "List custom field definitions in the workspace. Returns fields with their labels, types, and owner class info. Custom fields are created in the Huly UI on Card types, Issue types, or other classes. Use targetClass to filter fields for a specific class.",
177978
+ category: CATEGORY8,
177979
+ inputSchema: listCustomFieldsParamsJsonSchema,
177980
+ handler: createToolHandler(
177981
+ "list_custom_fields",
177982
+ parseListCustomFieldsParams,
177983
+ listCustomFields
177984
+ )
177985
+ },
177986
+ {
177987
+ name: "get_custom_field_values",
177988
+ description: "Read custom field values from a document. Pass the document's ID and class (from list_cards, list_issues, etc.). Returns all custom field values found on the document with their labels and types.",
177989
+ category: CATEGORY8,
177990
+ inputSchema: getCustomFieldValuesParamsJsonSchema,
177991
+ handler: createToolHandler(
177992
+ "get_custom_field_values",
177993
+ parseGetCustomFieldValuesParams,
177994
+ getCustomFieldValues
177995
+ )
177996
+ },
177997
+ {
177998
+ name: "set_custom_field",
177999
+ description: "Set a custom field value on a document. Requires the document ID, class, field ID (from list_custom_fields), and value. Values are auto-parsed: numbers from numeric strings, booleans from 'true'/'false', strings as-is.",
178000
+ category: CATEGORY8,
178001
+ inputSchema: setCustomFieldParamsJsonSchema,
178002
+ handler: createToolHandler(
178003
+ "set_custom_field",
178004
+ parseSetCustomFieldParams,
178005
+ setCustomField
178006
+ )
178007
+ }
178008
+ ];
178009
+
178010
+ // src/huly/operations/components.ts
178011
+ var import_core31 = __toESM(require_lib4(), 1);
177713
178012
 
177714
178013
  // src/utils/assertions.ts
177715
178014
  var AssertionError = class extends Error {
@@ -177763,7 +178062,7 @@ var listComponents = (params) => Effect_exports.gen(function* () {
177763
178062
  { space: project3._id },
177764
178063
  {
177765
178064
  limit,
177766
- sort: { modifiedOn: import_core30.SortingOrder.Descending }
178065
+ sort: { modifiedOn: import_core31.SortingOrder.Descending }
177767
178066
  }
177768
178067
  );
177769
178068
  const leadIds = [
@@ -177793,7 +178092,7 @@ var getComponent = (params) => Effect_exports.gen(function* () {
177793
178092
  const result = {
177794
178093
  id: ComponentId.make(component._id),
177795
178094
  label: ComponentLabel.make(component.label),
177796
- description: component.description,
178095
+ description: optionalMarkupToMarkdown(component.description, void 0),
177797
178096
  lead: leadName !== void 0 ? PersonName.make(leadName) : void 0,
177798
178097
  project: params.project,
177799
178098
  modifiedOn: component.modifiedOn,
@@ -177803,7 +178102,7 @@ var getComponent = (params) => Effect_exports.gen(function* () {
177803
178102
  });
177804
178103
  var createComponent = (params) => Effect_exports.gen(function* () {
177805
178104
  const { client, project: project3 } = yield* findProject(params.project);
177806
- const componentId = (0, import_core30.generateId)();
178105
+ const componentId = (0, import_core31.generateId)();
177807
178106
  const leadParam = params.lead;
177808
178107
  const leadRef = leadParam !== void 0 ? yield* Effect_exports.gen(function* () {
177809
178108
  const person = yield* findPersonByEmailOrName(client, leadParam);
@@ -177814,7 +178113,7 @@ var createComponent = (params) => Effect_exports.gen(function* () {
177814
178113
  }) : null;
177815
178114
  const componentData = {
177816
178115
  label: params.label,
177817
- description: params.description ?? "",
178116
+ description: optionalMarkdownToMarkup(params.description),
177818
178117
  lead: leadRef,
177819
178118
  comments: 0
177820
178119
  };
@@ -177833,7 +178132,7 @@ var updateComponent = (params) => Effect_exports.gen(function* () {
177833
178132
  updateOps.label = params.label;
177834
178133
  }
177835
178134
  if (params.description !== void 0) {
177836
- updateOps.description = params.description;
178135
+ updateOps.description = optionalMarkdownToMarkup(params.description);
177837
178136
  }
177838
178137
  if (params.lead !== void 0) {
177839
178138
  if (params.lead === null) {
@@ -178044,12 +178343,12 @@ var previewDeletion = (params) => {
178044
178343
  };
178045
178344
 
178046
178345
  // src/mcp/tools/deletion.ts
178047
- var CATEGORY8 = "issues";
178346
+ var CATEGORY9 = "issues";
178048
178347
  var deletionTools = [
178049
178348
  {
178050
178349
  name: "preview_deletion",
178051
178350
  description: "Preview the impact of deleting a Huly entity before actually deleting it. Shows affected sub-entities, relations, and warnings. Supports issues, projects, components, and milestones. Use this to understand cascade effects before calling a delete operation.",
178052
- category: CATEGORY8,
178351
+ category: CATEGORY9,
178053
178352
  inputSchema: previewDeletionParamsJsonSchema,
178054
178353
  handler: createToolHandler(
178055
178354
  "preview_deletion",
@@ -178060,12 +178359,12 @@ var deletionTools = [
178060
178359
  ];
178061
178360
 
178062
178361
  // src/mcp/tools/documents.ts
178063
- var CATEGORY9 = "documents";
178362
+ var CATEGORY10 = "documents";
178064
178363
  var documentTools = [
178065
178364
  {
178066
178365
  name: "list_teamspaces",
178067
178366
  description: "List all Huly document teamspaces. Returns teamspaces sorted by name. Supports filtering by archived status.",
178068
- category: CATEGORY9,
178367
+ category: CATEGORY10,
178069
178368
  inputSchema: listTeamspacesParamsJsonSchema,
178070
178369
  handler: createToolHandler(
178071
178370
  "list_teamspaces",
@@ -178076,7 +178375,7 @@ var documentTools = [
178076
178375
  {
178077
178376
  name: "get_teamspace",
178078
178377
  description: "Get details for a Huly document teamspace including document count. Finds by name or ID, including archived teamspaces.",
178079
- category: CATEGORY9,
178378
+ category: CATEGORY10,
178080
178379
  inputSchema: getTeamspaceParamsJsonSchema,
178081
178380
  handler: createToolHandler(
178082
178381
  "get_teamspace",
@@ -178087,7 +178386,7 @@ var documentTools = [
178087
178386
  {
178088
178387
  name: "create_teamspace",
178089
178388
  description: "Create a new Huly document teamspace. Idempotent: returns existing teamspace if one with the same name exists.",
178090
- category: CATEGORY9,
178389
+ category: CATEGORY10,
178091
178390
  inputSchema: createTeamspaceParamsJsonSchema,
178092
178391
  handler: createToolHandler(
178093
178392
  "create_teamspace",
@@ -178098,7 +178397,7 @@ var documentTools = [
178098
178397
  {
178099
178398
  name: "update_teamspace",
178100
178399
  description: "Update fields on an existing Huly document teamspace. Only provided fields are modified. Set description to null to clear it.",
178101
- category: CATEGORY9,
178400
+ category: CATEGORY10,
178102
178401
  inputSchema: updateTeamspaceParamsJsonSchema,
178103
178402
  handler: createToolHandler(
178104
178403
  "update_teamspace",
@@ -178109,7 +178408,7 @@ var documentTools = [
178109
178408
  {
178110
178409
  name: "delete_teamspace",
178111
178410
  description: "Permanently delete a Huly document teamspace. This action cannot be undone.",
178112
- category: CATEGORY9,
178411
+ category: CATEGORY10,
178113
178412
  inputSchema: deleteTeamspaceParamsJsonSchema,
178114
178413
  handler: createToolHandler(
178115
178414
  "delete_teamspace",
@@ -178120,7 +178419,7 @@ var documentTools = [
178120
178419
  {
178121
178420
  name: "list_documents",
178122
178421
  description: "List documents in a Huly teamspace. Returns documents sorted by modification date (newest first). Supports searching by title substring (titleSearch) and content (contentSearch).",
178123
- category: CATEGORY9,
178422
+ category: CATEGORY10,
178124
178423
  inputSchema: listDocumentsParamsJsonSchema,
178125
178424
  handler: createToolHandler(
178126
178425
  "list_documents",
@@ -178131,7 +178430,7 @@ var documentTools = [
178131
178430
  {
178132
178431
  name: "get_document",
178133
178432
  description: "Retrieve full details for a Huly document including markdown content. Use this to view document content and metadata.",
178134
- category: CATEGORY9,
178433
+ category: CATEGORY10,
178135
178434
  inputSchema: getDocumentParamsJsonSchema,
178136
178435
  handler: createToolHandler(
178137
178436
  "get_document",
@@ -178142,7 +178441,7 @@ var documentTools = [
178142
178441
  {
178143
178442
  name: "create_document",
178144
178443
  description: "Create a new document in a Huly teamspace. Content supports full markdown including native Mermaid diagrams (```mermaid blocks render interactively in Huly UI). Returns the created document id. Use link_document_to_issue to associate the document with a tracker issue.",
178145
- category: CATEGORY9,
178444
+ category: CATEGORY10,
178146
178445
  inputSchema: createDocumentParamsJsonSchema,
178147
178446
  handler: createToolHandler(
178148
178447
  "create_document",
@@ -178153,7 +178452,7 @@ var documentTools = [
178153
178452
  {
178154
178453
  name: "edit_document",
178155
178454
  description: "Edit an existing Huly document. Two content modes (mutually exclusive): (1) 'content' for full replace, (2) 'old_text' + 'new_text' for targeted search-and-replace. Multiple matches error unless replace_all is true. Empty new_text deletes matched text. Also supports renaming via 'title'. Content supports full markdown including native Mermaid diagrams.",
178156
- category: CATEGORY9,
178455
+ category: CATEGORY10,
178157
178456
  inputSchema: editDocumentParamsJsonSchema,
178158
178457
  handler: createToolHandler(
178159
178458
  "edit_document",
@@ -178164,7 +178463,7 @@ var documentTools = [
178164
178463
  {
178165
178464
  name: "list_inline_comments",
178166
178465
  description: "List inline comment threads from a Huly document. Extracts comments embedded in document content as ProseMirror marks. Each comment includes the highlighted text and thread ID. Set includeReplies=true to also fetch thread reply messages with sender names.",
178167
- category: CATEGORY9,
178466
+ category: CATEGORY10,
178168
178467
  inputSchema: listInlineCommentsParamsJsonSchema,
178169
178468
  handler: createToolHandler(
178170
178469
  "list_inline_comments",
@@ -178175,7 +178474,7 @@ var documentTools = [
178175
178474
  {
178176
178475
  name: "delete_document",
178177
178476
  description: "Permanently delete a Huly document. This action cannot be undone.",
178178
- category: CATEGORY9,
178477
+ category: CATEGORY10,
178179
178478
  inputSchema: deleteDocumentParamsJsonSchema,
178180
178479
  handler: createToolHandler(
178181
178480
  "delete_document",
@@ -178443,10 +178742,10 @@ var unlinkDocumentFromIssue = (params) => Effect_exports.gen(function* () {
178443
178742
  });
178444
178743
 
178445
178744
  // src/huly/operations/issue-templates.ts
178446
- var import_core34 = __toESM(require_lib4(), 1);
178745
+ var import_core35 = __toESM(require_lib4(), 1);
178447
178746
 
178448
178747
  // src/huly/operations/issues-move.ts
178449
- var import_core31 = __toESM(require_lib4(), 1);
178748
+ var import_core32 = __toESM(require_lib4(), 1);
178450
178749
  var import_tracker2 = __toESM(require_lib21(), 1);
178451
178750
  var addLabel = (params) => Effect_exports.gen(function* () {
178452
178751
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
@@ -178473,7 +178772,7 @@ var addLabel = (params) => Effect_exports.gen(function* () {
178473
178772
  }
178474
178773
  );
178475
178774
  if (tagElement === void 0) {
178476
- const tagElementId = (0, import_core31.generateId)();
178775
+ const tagElementId = (0, import_core32.generateId)();
178477
178776
  const tagElementData = {
178478
178777
  title: labelTitle,
178479
178778
  description: "",
@@ -178606,7 +178905,7 @@ var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) =
178606
178905
  });
178607
178906
 
178608
178907
  // src/huly/operations/issues-read.ts
178609
- var import_core32 = __toESM(require_lib4(), 1);
178908
+ var import_core33 = __toESM(require_lib4(), 1);
178610
178909
  var import_tracker3 = __toESM(require_lib21(), 1);
178611
178910
  var resolveStatusName = (statuses, statusId) => {
178612
178911
  const statusDoc = statuses.find((s) => s._id === statusId);
@@ -178697,7 +178996,7 @@ var listIssues = (params) => Effect_exports.gen(function* () {
178697
178996
  {
178698
178997
  limit,
178699
178998
  sort: {
178700
- modifiedOn: import_core32.SortingOrder.Descending
178999
+ modifiedOn: import_core33.SortingOrder.Descending
178701
179000
  }
178702
179001
  },
178703
179002
  { assignee: contact.class.Person }
@@ -178777,7 +179076,7 @@ var getIssue = (params) => Effect_exports.gen(function* () {
178777
179076
  });
178778
179077
 
178779
179078
  // src/huly/operations/issues-write.ts
178780
- var import_core33 = __toESM(require_lib4(), 1);
179079
+ var import_core34 = __toESM(require_lib4(), 1);
178781
179080
  var import_rank3 = __toESM(require_lib32(), 1);
178782
179081
  var import_tracker4 = __toESM(require_lib21(), 1);
178783
179082
  var TxIncResult = Schema_exports.Struct({
@@ -178798,7 +179097,7 @@ var resolveAssignee = (client, assigneeIdentifier) => Effect_exports.gen(functio
178798
179097
  });
178799
179098
  var createIssue = (params) => Effect_exports.gen(function* () {
178800
179099
  const { client, defaultStatusId, project: project3, statuses } = yield* findProjectWithStatuses(params.project);
178801
- const issueId = (0, import_core33.generateId)();
179100
+ const issueId = (0, import_core34.generateId)();
178802
179101
  const incOps = { $inc: { sequence: 1 } };
178803
179102
  const incResult = yield* client.updateDoc(
178804
179103
  tracker.class.Project,
@@ -178813,7 +179112,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
178813
179112
  const lastIssue = yield* client.findOne(
178814
179113
  tracker.class.Issue,
178815
179114
  { space: project3._id },
178816
- { sort: { rank: import_core33.SortingOrder.Descending } }
179115
+ { sort: { rank: import_core34.SortingOrder.Descending } }
178817
179116
  );
178818
179117
  const rank = (0, import_rank3.makeRank)(lastIssue?.rank, void 0);
178819
179118
  const descriptionMarkupRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
@@ -178989,7 +179288,7 @@ var resolveChild = (client, child) => Effect_exports.gen(function* () {
178989
179288
  title: child.title,
178990
179289
  priority: priorityToString(child.priority)
178991
179290
  };
178992
- const withDescription3 = child.description ? { ...base, description: child.description } : base;
179291
+ const withDescription3 = child.description ? { ...base, description: optionalMarkupToMarkdown(child.description) } : base;
178993
179292
  const withAssignee = assigneeName !== void 0 ? { ...withDescription3, assignee: PersonName.make(assigneeName) } : withDescription3;
178994
179293
  const withComponent = componentLabel !== void 0 ? { ...withAssignee, component: ComponentLabel.make(componentLabel) } : withAssignee;
178995
179294
  const estimation = zeroAsUnset(NonNegativeNumber.make(child.estimation));
@@ -179017,9 +179316,9 @@ var buildTemplateChild = (client, projectId, projectIdentifier, input) => Effect
179017
179316
  return component._id;
179018
179317
  }) : null;
179019
179318
  return {
179020
- id: (0, import_core34.generateId)(),
179319
+ id: (0, import_core35.generateId)(),
179021
179320
  title: input.title,
179022
- description: input.description ?? "",
179321
+ description: optionalMarkdownToMarkup(input.description),
179023
179322
  priority: stringToPriority(input.priority || "no-priority"),
179024
179323
  assignee: assigneeRef,
179025
179324
  component: componentRef,
@@ -179034,7 +179333,7 @@ var listIssueTemplates = (params) => Effect_exports.gen(function* () {
179034
179333
  { space: project3._id },
179035
179334
  {
179036
179335
  limit,
179037
- sort: { modifiedOn: import_core34.SortingOrder.Descending }
179336
+ sort: { modifiedOn: import_core35.SortingOrder.Descending }
179038
179337
  }
179039
179338
  );
179040
179339
  const summaries = templates.map((t) => {
@@ -179062,7 +179361,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
179062
179361
  const result = {
179063
179362
  id: IssueTemplateId.make(template._id),
179064
179363
  title: template.title,
179065
- description: template.description,
179364
+ description: optionalMarkupToMarkdown(template.description),
179066
179365
  priority: priorityToString(template.priority),
179067
179366
  assignee: assigneeName !== void 0 ? PersonName.make(assigneeName) : void 0,
179068
179367
  component: componentLabel !== void 0 ? ComponentLabel.make(componentLabel) : void 0,
@@ -179078,7 +179377,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
179078
179377
  });
179079
179378
  var createIssueTemplate = (params) => Effect_exports.gen(function* () {
179080
179379
  const { client, project: project3 } = yield* findProject(params.project);
179081
- const templateId = (0, import_core34.generateId)();
179380
+ const templateId = (0, import_core35.generateId)();
179082
179381
  const assigneeParam = params.assignee;
179083
179382
  const assigneeRef = assigneeParam !== void 0 ? yield* Effect_exports.gen(function* () {
179084
179383
  const person = yield* findPersonByEmailOrName(client, assigneeParam);
@@ -179107,7 +179406,7 @@ var createIssueTemplate = (params) => Effect_exports.gen(function* () {
179107
179406
  }
179108
179407
  const templateData = {
179109
179408
  title: params.title,
179110
- description: params.description ?? "",
179409
+ description: optionalMarkdownToMarkup(params.description),
179111
179410
  priority,
179112
179411
  assignee: assigneeRef,
179113
179412
  component: componentRef,
@@ -179126,7 +179425,7 @@ var createIssueTemplate = (params) => Effect_exports.gen(function* () {
179126
179425
  var createIssueFromTemplate = (params) => Effect_exports.gen(function* () {
179127
179426
  const { client, project: project3, template } = yield* findProjectAndTemplate(params);
179128
179427
  const title = params.title ?? template.title;
179129
- const description = params.description ?? template.description;
179428
+ const description = params.description ?? optionalMarkupToMarkdown(template.description, void 0);
179130
179429
  const priority = params.priority ?? priorityToString(template.priority);
179131
179430
  const templateAssigneeRef = template.assignee;
179132
179431
  const assignee = params.assignee !== void 0 ? params.assignee : templateAssigneeRef !== null ? yield* Effect_exports.gen(function* () {
@@ -179166,7 +179465,7 @@ var createIssueFromTemplate = (params) => Effect_exports.gen(function* () {
179166
179465
  const includeChildren = params.includeChildren !== false;
179167
179466
  if (includeChildren && template.children.length > 0) {
179168
179467
  for (const child of template.children) {
179169
- const childDescription = child.description !== "" ? child.description : void 0;
179468
+ const childDescription = child.description !== "" ? optionalMarkupToMarkdown(child.description) : void 0;
179170
179469
  const childResult = yield* createIssue({
179171
179470
  project: params.project,
179172
179471
  title: child.title,
@@ -179210,7 +179509,7 @@ var updateIssueTemplate = (params) => Effect_exports.gen(function* () {
179210
179509
  updateOps.title = params.title;
179211
179510
  }
179212
179511
  if (params.description !== void 0) {
179213
- updateOps.description = params.description;
179512
+ updateOps.description = optionalMarkdownToMarkup(params.description);
179214
179513
  }
179215
179514
  if (params.priority !== void 0) {
179216
179515
  updateOps.priority = stringToPriority(params.priority);
@@ -179312,10 +179611,10 @@ var removeTemplateChild = (params) => Effect_exports.gen(function* () {
179312
179611
  });
179313
179612
 
179314
179613
  // src/huly/operations/labels.ts
179315
- var import_core36 = __toESM(require_lib4(), 1);
179614
+ var import_core37 = __toESM(require_lib4(), 1);
179316
179615
 
179317
179616
  // src/huly/operations/tag-categories.ts
179318
- var import_core35 = __toESM(require_lib4(), 1);
179617
+ var import_core36 = __toESM(require_lib4(), 1);
179319
179618
  var issueClassRef = toRef(tracker.class.Issue);
179320
179619
  var findCategoryByIdOrLabel = (client, idOrLabel) => Effect_exports.gen(function* () {
179321
179620
  const cat = (yield* client.findOne(
@@ -179353,7 +179652,7 @@ var listTagCategories = (params) => Effect_exports.gen(function* () {
179353
179652
  query,
179354
179653
  {
179355
179654
  limit,
179356
- sort: { modifiedOn: import_core35.SortingOrder.Descending }
179655
+ sort: { modifiedOn: import_core36.SortingOrder.Descending }
179357
179656
  }
179358
179657
  );
179359
179658
  return categories.map(toSummary);
@@ -179368,7 +179667,7 @@ var createTagCategory = (params) => Effect_exports.gen(function* () {
179368
179667
  if (existing !== void 0) {
179369
179668
  return { id: TagCategoryId.make(existing._id), label: existing.label, created: false };
179370
179669
  }
179371
- const catId = (0, import_core35.generateId)();
179670
+ const catId = (0, import_core36.generateId)();
179372
179671
  const catData = {
179373
179672
  // Asset is a branded string type (Metadata<URL>) with no runtime constructor.
179374
179673
  // Empty string is the "no icon" sentinel; Huly UI renders a default icon.
@@ -179470,7 +179769,7 @@ var listLabels = (params) => Effect_exports.gen(function* () {
179470
179769
  query,
179471
179770
  {
179472
179771
  limit,
179473
- sort: { modifiedOn: import_core36.SortingOrder.Descending }
179772
+ sort: { modifiedOn: import_core37.SortingOrder.Descending }
179474
179773
  }
179475
179774
  );
179476
179775
  return elements.map((e) => ({
@@ -179495,7 +179794,7 @@ var createLabel = (params) => Effect_exports.gen(function* () {
179495
179794
  return { id: TagElementId.make(existing._id), title: existing.title, created: false };
179496
179795
  }
179497
179796
  const categoryRef = yield* resolveCategoryRef(client, params.category);
179498
- const tagId = (0, import_core36.generateId)();
179797
+ const tagId = (0, import_core37.generateId)();
179499
179798
  const color = params.color ?? 0;
179500
179799
  const tagData = {
179501
179800
  title: params.title,
@@ -179571,12 +179870,12 @@ var removeIssueLabel = (params) => Effect_exports.gen(function* () {
179571
179870
  });
179572
179871
 
179573
179872
  // src/mcp/tools/issues.ts
179574
- var CATEGORY10 = "issues";
179873
+ var CATEGORY11 = "issues";
179575
179874
  var issueTools = [
179576
179875
  {
179577
179876
  name: "list_issues",
179578
179877
  description: "Query Huly issues with optional filters. Returns issues sorted by modification date (newest first). Supports filtering by project, status, assignee, component, and parentIssue (to list children of a specific issue). Supports searching by title substring (titleSearch) and description content (descriptionSearch).",
179579
- category: CATEGORY10,
179878
+ category: CATEGORY11,
179580
179879
  inputSchema: listIssuesParamsJsonSchema,
179581
179880
  handler: createToolHandler(
179582
179881
  "list_issues",
@@ -179587,7 +179886,7 @@ var issueTools = [
179587
179886
  {
179588
179887
  name: "get_issue",
179589
179888
  description: "Retrieve full details for a Huly issue including markdown description. Use this to view issue content, comments, or full metadata.",
179590
- category: CATEGORY10,
179889
+ category: CATEGORY11,
179591
179890
  inputSchema: getIssueParamsJsonSchema,
179592
179891
  handler: createToolHandler(
179593
179892
  "get_issue",
@@ -179598,7 +179897,7 @@ var issueTools = [
179598
179897
  {
179599
179898
  name: "create_issue",
179600
179899
  description: "Create a new issue in a Huly project. Optionally create as a sub-issue by specifying parentIssue. Description supports markdown formatting. Returns the created issue identifier.",
179601
- category: CATEGORY10,
179900
+ category: CATEGORY11,
179602
179901
  inputSchema: createIssueParamsJsonSchema,
179603
179902
  handler: createToolHandler(
179604
179903
  "create_issue",
@@ -179609,7 +179908,7 @@ var issueTools = [
179609
179908
  {
179610
179909
  name: "update_issue",
179611
179910
  description: "Update fields on an existing Huly issue. Only provided fields are modified. Description updates support markdown.",
179612
- category: CATEGORY10,
179911
+ category: CATEGORY11,
179613
179912
  inputSchema: updateIssueParamsJsonSchema,
179614
179913
  handler: createToolHandler(
179615
179914
  "update_issue",
@@ -179620,7 +179919,7 @@ var issueTools = [
179620
179919
  {
179621
179920
  name: "add_issue_label",
179622
179921
  description: "Add a tag/label to a Huly issue. Creates the tag if it doesn't exist in the project.",
179623
- category: CATEGORY10,
179922
+ category: CATEGORY11,
179624
179923
  inputSchema: addLabelParamsJsonSchema,
179625
179924
  handler: createToolHandler(
179626
179925
  "add_issue_label",
@@ -179631,7 +179930,7 @@ var issueTools = [
179631
179930
  {
179632
179931
  name: "remove_issue_label",
179633
179932
  description: "Remove a tag/label from a Huly issue. Detaches the label reference; does not delete the label definition.",
179634
- category: CATEGORY10,
179933
+ category: CATEGORY11,
179635
179934
  inputSchema: removeLabelParamsJsonSchema,
179636
179935
  handler: createToolHandler(
179637
179936
  "remove_issue_label",
@@ -179642,7 +179941,7 @@ var issueTools = [
179642
179941
  {
179643
179942
  name: "delete_issue",
179644
179943
  description: "Permanently delete a Huly issue. This action cannot be undone.",
179645
- category: CATEGORY10,
179944
+ category: CATEGORY11,
179646
179945
  inputSchema: deleteIssueParamsJsonSchema,
179647
179946
  handler: createToolHandler(
179648
179947
  "delete_issue",
@@ -179653,7 +179952,7 @@ var issueTools = [
179653
179952
  {
179654
179953
  name: "move_issue",
179655
179954
  description: "Move an issue to a new parent (making it a sub-issue) or to top-level (null). Updates parent/child relationships and sub-issue counts.",
179656
- category: CATEGORY10,
179955
+ category: CATEGORY11,
179657
179956
  inputSchema: moveIssueParamsJsonSchema,
179658
179957
  handler: createToolHandler(
179659
179958
  "move_issue",
@@ -179664,7 +179963,7 @@ var issueTools = [
179664
179963
  {
179665
179964
  name: "list_components",
179666
179965
  description: "List components in a Huly project. Components organize issues by area/feature. Returns components sorted by modification date (newest first).",
179667
- category: CATEGORY10,
179966
+ category: CATEGORY11,
179668
179967
  inputSchema: listComponentsParamsJsonSchema,
179669
179968
  handler: createToolHandler(
179670
179969
  "list_components",
@@ -179675,7 +179974,7 @@ var issueTools = [
179675
179974
  {
179676
179975
  name: "get_component",
179677
179976
  description: "Retrieve full details for a Huly component. Use this to view component content and metadata.",
179678
- category: CATEGORY10,
179977
+ category: CATEGORY11,
179679
179978
  inputSchema: getComponentParamsJsonSchema,
179680
179979
  handler: createToolHandler(
179681
179980
  "get_component",
@@ -179686,7 +179985,7 @@ var issueTools = [
179686
179985
  {
179687
179986
  name: "create_component",
179688
179987
  description: "Create a new component in a Huly project. Components help organize issues by area/feature. Returns the created component ID and label.",
179689
- category: CATEGORY10,
179988
+ category: CATEGORY11,
179690
179989
  inputSchema: createComponentParamsJsonSchema,
179691
179990
  handler: createToolHandler(
179692
179991
  "create_component",
@@ -179697,7 +179996,7 @@ var issueTools = [
179697
179996
  {
179698
179997
  name: "update_component",
179699
179998
  description: "Update fields on an existing Huly component. Only provided fields are modified.",
179700
- category: CATEGORY10,
179999
+ category: CATEGORY11,
179701
180000
  inputSchema: updateComponentParamsJsonSchema,
179702
180001
  handler: createToolHandler(
179703
180002
  "update_component",
@@ -179708,7 +180007,7 @@ var issueTools = [
179708
180007
  {
179709
180008
  name: "set_issue_component",
179710
180009
  description: "Set or clear the component on a Huly issue. Pass null for component to clear it.",
179711
- category: CATEGORY10,
180010
+ category: CATEGORY11,
179712
180011
  inputSchema: setIssueComponentParamsJsonSchema,
179713
180012
  handler: createToolHandler(
179714
180013
  "set_issue_component",
@@ -179719,7 +180018,7 @@ var issueTools = [
179719
180018
  {
179720
180019
  name: "delete_component",
179721
180020
  description: "Permanently delete a Huly component. This action cannot be undone.",
179722
- category: CATEGORY10,
180021
+ category: CATEGORY11,
179723
180022
  inputSchema: deleteComponentParamsJsonSchema,
179724
180023
  handler: createToolHandler(
179725
180024
  "delete_component",
@@ -179730,7 +180029,7 @@ var issueTools = [
179730
180029
  {
179731
180030
  name: "list_issue_templates",
179732
180031
  description: "List issue templates in a Huly project. Templates define reusable issue configurations. Returns templates sorted by modification date (newest first).",
179733
- category: CATEGORY10,
180032
+ category: CATEGORY11,
179734
180033
  inputSchema: listIssueTemplatesParamsJsonSchema,
179735
180034
  handler: createToolHandler(
179736
180035
  "list_issue_templates",
@@ -179741,7 +180040,7 @@ var issueTools = [
179741
180040
  {
179742
180041
  name: "get_issue_template",
179743
180042
  description: "Retrieve full details for a Huly issue template including children (sub-task templates). Use this to view template content, default values, and child template IDs.",
179744
- category: CATEGORY10,
180043
+ category: CATEGORY11,
179745
180044
  inputSchema: getIssueTemplateParamsJsonSchema,
179746
180045
  handler: createToolHandler(
179747
180046
  "get_issue_template",
@@ -179752,7 +180051,7 @@ var issueTools = [
179752
180051
  {
179753
180052
  name: "create_issue_template",
179754
180053
  description: "Create a new issue template in a Huly project. Templates define default values for new issues. Optionally include children (sub-task templates) that will become sub-issues when creating issues from this template. Returns the created template ID and title.",
179755
- category: CATEGORY10,
180054
+ category: CATEGORY11,
179756
180055
  inputSchema: createIssueTemplateParamsJsonSchema,
179757
180056
  handler: createToolHandler(
179758
180057
  "create_issue_template",
@@ -179763,7 +180062,7 @@ var issueTools = [
179763
180062
  {
179764
180063
  name: "create_issue_from_template",
179765
180064
  description: "Create a new issue from a template. Applies template defaults, allowing overrides for specific fields. If the template has children (sub-task templates), sub-issues are created automatically unless includeChildren is set to false. Returns the created issue identifier and count of children created.",
179766
- category: CATEGORY10,
180065
+ category: CATEGORY11,
179767
180066
  inputSchema: createIssueFromTemplateParamsJsonSchema,
179768
180067
  handler: createToolHandler(
179769
180068
  "create_issue_from_template",
@@ -179774,7 +180073,7 @@ var issueTools = [
179774
180073
  {
179775
180074
  name: "update_issue_template",
179776
180075
  description: "Update fields on an existing Huly issue template. Only provided fields are modified.",
179777
- category: CATEGORY10,
180076
+ category: CATEGORY11,
179778
180077
  inputSchema: updateIssueTemplateParamsJsonSchema,
179779
180078
  handler: createToolHandler(
179780
180079
  "update_issue_template",
@@ -179785,7 +180084,7 @@ var issueTools = [
179785
180084
  {
179786
180085
  name: "delete_issue_template",
179787
180086
  description: "Permanently delete a Huly issue template. This action cannot be undone.",
179788
- category: CATEGORY10,
180087
+ category: CATEGORY11,
179789
180088
  inputSchema: deleteIssueTemplateParamsJsonSchema,
179790
180089
  handler: createToolHandler(
179791
180090
  "delete_issue_template",
@@ -179796,7 +180095,7 @@ var issueTools = [
179796
180095
  {
179797
180096
  name: "add_template_child",
179798
180097
  description: "Add a child (sub-task) template to an issue template. The child defines default values for sub-issues created when using create_issue_from_template. Returns the child template ID.",
179799
- category: CATEGORY10,
180098
+ category: CATEGORY11,
179800
180099
  inputSchema: addTemplateChildParamsJsonSchema,
179801
180100
  handler: createToolHandler(
179802
180101
  "add_template_child",
@@ -179807,7 +180106,7 @@ var issueTools = [
179807
180106
  {
179808
180107
  name: "remove_template_child",
179809
180108
  description: "Remove a child (sub-task) template from an issue template by its child ID. Get child IDs from get_issue_template response.",
179810
- category: CATEGORY10,
180109
+ category: CATEGORY11,
179811
180110
  inputSchema: removeTemplateChildParamsJsonSchema,
179812
180111
  handler: createToolHandler(
179813
180112
  "remove_template_child",
@@ -179818,7 +180117,7 @@ var issueTools = [
179818
180117
  {
179819
180118
  name: "add_issue_relation",
179820
180119
  description: "Add a relation between two issues. Relation types: 'blocks' (source blocks target \u2014 pushes into target's blockedBy), 'is-blocked-by' (source is blocked by target \u2014 pushes into source's blockedBy), 'relates-to' (bidirectional link \u2014 updates both sides). targetIssue accepts cross-project identifiers like 'OTHER-42'. No-op if the relation already exists.",
179821
- category: CATEGORY10,
180120
+ category: CATEGORY11,
179822
180121
  inputSchema: addIssueRelationParamsJsonSchema,
179823
180122
  handler: createToolHandler(
179824
180123
  "add_issue_relation",
@@ -179829,7 +180128,7 @@ var issueTools = [
179829
180128
  {
179830
180129
  name: "remove_issue_relation",
179831
180130
  description: "Remove a relation between two issues. Mirrors add_issue_relation: 'blocks' pulls from target's blockedBy, 'is-blocked-by' pulls from source's blockedBy, 'relates-to' pulls from both sides. No-op if the relation doesn't exist.",
179832
- category: CATEGORY10,
180131
+ category: CATEGORY11,
179833
180132
  inputSchema: removeIssueRelationParamsJsonSchema,
179834
180133
  handler: createToolHandler(
179835
180134
  "remove_issue_relation",
@@ -179840,7 +180139,7 @@ var issueTools = [
179840
180139
  {
179841
180140
  name: "list_issue_relations",
179842
180141
  description: "List all relations of an issue. Returns blockedBy (issues blocking this one), relations (bidirectional issue links), and documents (linked documents with title/teamspace). Does NOT return issues that this issue blocks \u2014 use list_issue_relations on the target issue to see that.",
179843
- category: CATEGORY10,
180142
+ category: CATEGORY11,
179844
180143
  inputSchema: listIssueRelationsParamsJsonSchema,
179845
180144
  handler: createToolHandler(
179846
180145
  "list_issue_relations",
@@ -179851,7 +180150,7 @@ var issueTools = [
179851
180150
  {
179852
180151
  name: "link_document_to_issue",
179853
180152
  description: "Link a Huly document to an issue. The link appears in the issue's Relations panel in the UI. Idempotent: no-op if the document is already linked. Use list_issue_relations to see linked documents.",
179854
- category: CATEGORY10,
180153
+ category: CATEGORY11,
179855
180154
  inputSchema: linkDocumentToIssueParamsJsonSchema,
179856
180155
  handler: createToolHandler(
179857
180156
  "link_document_to_issue",
@@ -179862,7 +180161,7 @@ var issueTools = [
179862
180161
  {
179863
180162
  name: "unlink_document_from_issue",
179864
180163
  description: "Remove a document link from an issue. Idempotent: no-op if the document is not linked.",
179865
- category: CATEGORY10,
180164
+ category: CATEGORY11,
179866
180165
  inputSchema: unlinkDocumentFromIssueParamsJsonSchema,
179867
180166
  handler: createToolHandler(
179868
180167
  "unlink_document_from_issue",
@@ -179873,12 +180172,12 @@ var issueTools = [
179873
180172
  ];
179874
180173
 
179875
180174
  // src/mcp/tools/labels.ts
179876
- var CATEGORY11 = "labels";
180175
+ var CATEGORY12 = "labels";
179877
180176
  var labelTools = [
179878
180177
  {
179879
180178
  name: "list_labels",
179880
180179
  description: "List label/tag definitions in the workspace. Labels are global (not project-scoped). Returns labels for tracker issues sorted by modification date (newest first).",
179881
- category: CATEGORY11,
180180
+ category: CATEGORY12,
179882
180181
  inputSchema: listLabelsParamsJsonSchema,
179883
180182
  handler: createToolHandler(
179884
180183
  "list_labels",
@@ -179889,7 +180188,7 @@ var labelTools = [
179889
180188
  {
179890
180189
  name: "create_label",
179891
180190
  description: "Create a new label/tag definition in the workspace. Labels are global and can be attached to any issue. Returns existing label if one with the same title already exists (created=false). Use add_issue_label to attach a label to a specific issue.",
179892
- category: CATEGORY11,
180191
+ category: CATEGORY12,
179893
180192
  inputSchema: createLabelParamsJsonSchema,
179894
180193
  handler: createToolHandler(
179895
180194
  "create_label",
@@ -179900,7 +180199,7 @@ var labelTools = [
179900
180199
  {
179901
180200
  name: "update_label",
179902
180201
  description: "Update a label/tag definition. Accepts label ID or title. Only provided fields are modified.",
179903
- category: CATEGORY11,
180202
+ category: CATEGORY12,
179904
180203
  inputSchema: updateLabelParamsJsonSchema,
179905
180204
  handler: createToolHandler(
179906
180205
  "update_label",
@@ -179911,7 +180210,7 @@ var labelTools = [
179911
180210
  {
179912
180211
  name: "delete_label",
179913
180212
  description: "Permanently delete a label/tag definition. Accepts label ID or title. This action cannot be undone.",
179914
- category: CATEGORY11,
180213
+ category: CATEGORY12,
179915
180214
  inputSchema: deleteLabelParamsJsonSchema,
179916
180215
  handler: createToolHandler(
179917
180216
  "delete_label",
@@ -179922,7 +180221,7 @@ var labelTools = [
179922
180221
  ];
179923
180222
 
179924
180223
  // src/huly/operations/milestones.ts
179925
- var import_core37 = __toESM(require_lib4(), 1);
180224
+ var import_core38 = __toESM(require_lib4(), 1);
179926
180225
  var import_tracker5 = __toESM(require_lib21(), 1);
179927
180226
  var milestoneStatusToStringMap = {
179928
180227
  [import_tracker5.MilestoneStatus.Planned]: "planned",
@@ -179966,7 +180265,7 @@ var listMilestones = (params) => Effect_exports.gen(function* () {
179966
180265
  { space: project3._id },
179967
180266
  {
179968
180267
  limit,
179969
- sort: { modifiedOn: import_core37.SortingOrder.Descending }
180268
+ sort: { modifiedOn: import_core38.SortingOrder.Descending }
179970
180269
  }
179971
180270
  );
179972
180271
  const summaries = milestones.map((m) => ({
@@ -179983,7 +180282,7 @@ var getMilestone = (params) => Effect_exports.gen(function* () {
179983
180282
  const result = {
179984
180283
  id: MilestoneId.make(milestone._id),
179985
180284
  label: MilestoneLabel.make(milestone.label),
179986
- description: milestone.description,
180285
+ description: optionalMarkupToMarkdown(milestone.description),
179987
180286
  status: milestoneStatusToString(milestone.status),
179988
180287
  targetDate: milestone.targetDate,
179989
180288
  project: params.project,
@@ -179994,10 +180293,10 @@ var getMilestone = (params) => Effect_exports.gen(function* () {
179994
180293
  });
179995
180294
  var createMilestone = (params) => Effect_exports.gen(function* () {
179996
180295
  const { client, project: project3 } = yield* findProject(params.project);
179997
- const milestoneId = (0, import_core37.generateId)();
180296
+ const milestoneId = (0, import_core38.generateId)();
179998
180297
  const milestoneData = {
179999
180298
  label: params.label,
180000
- description: params.description ?? "",
180299
+ description: optionalMarkdownToMarkup(params.description),
180001
180300
  status: import_tracker5.MilestoneStatus.Planned,
180002
180301
  targetDate: params.targetDate,
180003
180302
  comments: 0
@@ -180017,7 +180316,7 @@ var updateMilestone = (params) => Effect_exports.gen(function* () {
180017
180316
  updateOps.label = params.label;
180018
180317
  }
180019
180318
  if (params.description !== void 0) {
180020
- updateOps.description = params.description;
180319
+ updateOps.description = optionalMarkdownToMarkup(params.description);
180021
180320
  }
180022
180321
  if (params.targetDate !== void 0) {
180023
180322
  updateOps.targetDate = params.targetDate;
@@ -180058,12 +180357,12 @@ var deleteMilestone = (params) => Effect_exports.gen(function* () {
180058
180357
  });
180059
180358
 
180060
180359
  // src/mcp/tools/milestones.ts
180061
- var CATEGORY12 = "milestones";
180360
+ var CATEGORY13 = "milestones";
180062
180361
  var milestoneTools = [
180063
180362
  {
180064
180363
  name: "list_milestones",
180065
180364
  description: "List milestones in a Huly project. Returns milestones sorted by modification date (newest first).",
180066
- category: CATEGORY12,
180365
+ category: CATEGORY13,
180067
180366
  inputSchema: listMilestonesParamsJsonSchema,
180068
180367
  handler: createToolHandler(
180069
180368
  "list_milestones",
@@ -180074,7 +180373,7 @@ var milestoneTools = [
180074
180373
  {
180075
180374
  name: "get_milestone",
180076
180375
  description: "Retrieve full details for a Huly milestone. Use this to view milestone content and metadata.",
180077
- category: CATEGORY12,
180376
+ category: CATEGORY13,
180078
180377
  inputSchema: getMilestoneParamsJsonSchema,
180079
180378
  handler: createToolHandler(
180080
180379
  "get_milestone",
@@ -180085,7 +180384,7 @@ var milestoneTools = [
180085
180384
  {
180086
180385
  name: "create_milestone",
180087
180386
  description: "Create a new milestone in a Huly project. Returns the created milestone ID and label.",
180088
- category: CATEGORY12,
180387
+ category: CATEGORY13,
180089
180388
  inputSchema: createMilestoneParamsJsonSchema,
180090
180389
  handler: createToolHandler(
180091
180390
  "create_milestone",
@@ -180096,7 +180395,7 @@ var milestoneTools = [
180096
180395
  {
180097
180396
  name: "update_milestone",
180098
180397
  description: "Update fields on an existing Huly milestone. Only provided fields are modified.",
180099
- category: CATEGORY12,
180398
+ category: CATEGORY13,
180100
180399
  inputSchema: updateMilestoneParamsJsonSchema,
180101
180400
  handler: createToolHandler(
180102
180401
  "update_milestone",
@@ -180107,7 +180406,7 @@ var milestoneTools = [
180107
180406
  {
180108
180407
  name: "set_issue_milestone",
180109
180408
  description: "Set or clear the milestone on a Huly issue. Pass null for milestone to clear it.",
180110
- category: CATEGORY12,
180409
+ category: CATEGORY13,
180111
180410
  inputSchema: setIssueMilestoneParamsJsonSchema,
180112
180411
  handler: createToolHandler(
180113
180412
  "set_issue_milestone",
@@ -180118,7 +180417,7 @@ var milestoneTools = [
180118
180417
  {
180119
180418
  name: "delete_milestone",
180120
180419
  description: "Permanently delete a Huly milestone. This action cannot be undone.",
180121
- category: CATEGORY12,
180420
+ category: CATEGORY13,
180122
180421
  inputSchema: deleteMilestoneParamsJsonSchema,
180123
180422
  handler: createToolHandler(
180124
180423
  "delete_milestone",
@@ -180129,7 +180428,7 @@ var milestoneTools = [
180129
180428
  ];
180130
180429
 
180131
180430
  // src/huly/operations/notifications.ts
180132
- var import_core38 = __toESM(require_lib4(), 1);
180431
+ var import_core39 = __toESM(require_lib4(), 1);
180133
180432
  var toDocNotifyContextSummary = (ctx) => ({
180134
180433
  id: NotificationContextId.make(ctx._id),
180135
180434
  objectId: ctx.objectId,
@@ -180175,7 +180474,7 @@ var listNotifications = (params) => Effect_exports.gen(function* () {
180175
180474
  {
180176
180475
  limit,
180177
180476
  sort: {
180178
- modifiedOn: import_core38.SortingOrder.Descending
180477
+ modifiedOn: import_core39.SortingOrder.Descending
180179
180478
  }
180180
180479
  }
180181
180480
  );
@@ -180317,7 +180616,7 @@ var listNotificationContexts = (params) => Effect_exports.gen(function* () {
180317
180616
  {
180318
180617
  limit,
180319
180618
  sort: {
180320
- lastUpdateTimestamp: import_core38.SortingOrder.Descending
180619
+ lastUpdateTimestamp: import_core39.SortingOrder.Descending
180321
180620
  }
180322
180621
  }
180323
180622
  );
@@ -180386,12 +180685,12 @@ var getUnreadNotificationCount = () => Effect_exports.gen(function* () {
180386
180685
  });
180387
180686
 
180388
180687
  // src/mcp/tools/notifications.ts
180389
- var CATEGORY13 = "notifications";
180688
+ var CATEGORY14 = "notifications";
180390
180689
  var notificationTools = [
180391
180690
  {
180392
180691
  name: "list_notifications",
180393
180692
  description: "List inbox notifications. Returns notifications sorted by modification date (newest first). Supports filtering by read/archived status.",
180394
- category: CATEGORY13,
180693
+ category: CATEGORY14,
180395
180694
  inputSchema: listNotificationsParamsJsonSchema,
180396
180695
  handler: createToolHandler(
180397
180696
  "list_notifications",
@@ -180402,7 +180701,7 @@ var notificationTools = [
180402
180701
  {
180403
180702
  name: "get_notification",
180404
180703
  description: "Retrieve full details for a notification. Use this to view notification content and metadata.",
180405
- category: CATEGORY13,
180704
+ category: CATEGORY14,
180406
180705
  inputSchema: getNotificationParamsJsonSchema,
180407
180706
  handler: createToolHandler(
180408
180707
  "get_notification",
@@ -180413,7 +180712,7 @@ var notificationTools = [
180413
180712
  {
180414
180713
  name: "mark_notification_read",
180415
180714
  description: "Mark a notification as read.",
180416
- category: CATEGORY13,
180715
+ category: CATEGORY14,
180417
180716
  inputSchema: markNotificationReadParamsJsonSchema,
180418
180717
  handler: createToolHandler(
180419
180718
  "mark_notification_read",
@@ -180424,7 +180723,7 @@ var notificationTools = [
180424
180723
  {
180425
180724
  name: "mark_all_notifications_read",
180426
180725
  description: "Mark all unread notifications as read. Returns the count of notifications marked.",
180427
- category: CATEGORY13,
180726
+ category: CATEGORY14,
180428
180727
  inputSchema: emptyParamsJsonSchema,
180429
180728
  handler: createToolHandler(
180430
180729
  "mark_all_notifications_read",
@@ -180435,7 +180734,7 @@ var notificationTools = [
180435
180734
  {
180436
180735
  name: "archive_notification",
180437
180736
  description: "Archive a notification. Archived notifications are hidden from the main inbox view.",
180438
- category: CATEGORY13,
180737
+ category: CATEGORY14,
180439
180738
  inputSchema: archiveNotificationParamsJsonSchema,
180440
180739
  handler: createToolHandler(
180441
180740
  "archive_notification",
@@ -180446,7 +180745,7 @@ var notificationTools = [
180446
180745
  {
180447
180746
  name: "archive_all_notifications",
180448
180747
  description: "Archive all notifications. Returns the count of notifications archived.",
180449
- category: CATEGORY13,
180748
+ category: CATEGORY14,
180450
180749
  inputSchema: emptyParamsJsonSchema,
180451
180750
  handler: createToolHandler(
180452
180751
  "archive_all_notifications",
@@ -180457,7 +180756,7 @@ var notificationTools = [
180457
180756
  {
180458
180757
  name: "delete_notification",
180459
180758
  description: "Permanently delete a notification. This action cannot be undone.",
180460
- category: CATEGORY13,
180759
+ category: CATEGORY14,
180461
180760
  inputSchema: deleteNotificationParamsJsonSchema,
180462
180761
  handler: createToolHandler(
180463
180762
  "delete_notification",
@@ -180468,7 +180767,7 @@ var notificationTools = [
180468
180767
  {
180469
180768
  name: "get_notification_context",
180470
180769
  description: "Get notification context for an entity. Returns tracking information for a specific object.",
180471
- category: CATEGORY13,
180770
+ category: CATEGORY14,
180472
180771
  inputSchema: getNotificationContextParamsJsonSchema,
180473
180772
  handler: createToolHandler(
180474
180773
  "get_notification_context",
@@ -180479,7 +180778,7 @@ var notificationTools = [
180479
180778
  {
180480
180779
  name: "list_notification_contexts",
180481
180780
  description: "List notification contexts. Returns contexts sorted by last update timestamp (newest first). Supports filtering by pinned status.",
180482
- category: CATEGORY13,
180781
+ category: CATEGORY14,
180483
180782
  inputSchema: listNotificationContextsParamsJsonSchema,
180484
180783
  handler: createToolHandler(
180485
180784
  "list_notification_contexts",
@@ -180490,7 +180789,7 @@ var notificationTools = [
180490
180789
  {
180491
180790
  name: "pin_notification_context",
180492
180791
  description: "Pin or unpin a notification context. Pinned contexts are highlighted in the inbox.",
180493
- category: CATEGORY13,
180792
+ category: CATEGORY14,
180494
180793
  inputSchema: pinNotificationContextParamsJsonSchema,
180495
180794
  handler: createToolHandler(
180496
180795
  "pin_notification_context",
@@ -180501,7 +180800,7 @@ var notificationTools = [
180501
180800
  {
180502
180801
  name: "list_notification_settings",
180503
180802
  description: "List notification provider settings. Returns current notification preferences.",
180504
- category: CATEGORY13,
180803
+ category: CATEGORY14,
180505
180804
  inputSchema: listNotificationSettingsParamsJsonSchema,
180506
180805
  handler: createToolHandler(
180507
180806
  "list_notification_settings",
@@ -180512,7 +180811,7 @@ var notificationTools = [
180512
180811
  {
180513
180812
  name: "update_notification_provider_setting",
180514
180813
  description: "Update notification provider setting. Enable or disable notifications for a specific provider.",
180515
- category: CATEGORY13,
180814
+ category: CATEGORY14,
180516
180815
  inputSchema: updateNotificationProviderSettingParamsJsonSchema,
180517
180816
  handler: createToolHandler(
180518
180817
  "update_notification_provider_setting",
@@ -180523,7 +180822,7 @@ var notificationTools = [
180523
180822
  {
180524
180823
  name: "get_unread_notification_count",
180525
180824
  description: "Get the count of unread notifications.",
180526
- category: CATEGORY13,
180825
+ category: CATEGORY14,
180527
180826
  inputSchema: emptyParamsJsonSchema,
180528
180827
  handler: createToolHandler(
180529
180828
  "get_unread_notification_count",
@@ -180534,7 +180833,7 @@ var notificationTools = [
180534
180833
  ];
180535
180834
 
180536
180835
  // src/huly/operations/projects.ts
180537
- var import_core39 = __toESM(require_lib4(), 1);
180836
+ var import_core40 = __toESM(require_lib4(), 1);
180538
180837
  var import_tracker6 = __toESM(require_lib21(), 1);
180539
180838
  var listProjects = (params) => Effect_exports.gen(function* () {
180540
180839
  const client = yield* HulyClient;
@@ -180549,7 +180848,7 @@ var listProjects = (params) => Effect_exports.gen(function* () {
180549
180848
  {
180550
180849
  limit,
180551
180850
  sort: {
180552
- name: import_core39.SortingOrder.Ascending
180851
+ name: import_core40.SortingOrder.Ascending
180553
180852
  }
180554
180853
  }
180555
180854
  );
@@ -180618,7 +180917,7 @@ var createProject = (params) => Effect_exports.gen(function* () {
180618
180917
  created: false
180619
180918
  };
180620
180919
  }
180621
- const projectId = (0, import_core39.generateId)();
180920
+ const projectId = (0, import_core40.generateId)();
180622
180921
  const projectData = {
180623
180922
  name: params.name,
180624
180923
  description: params.description ?? "",
@@ -180680,12 +180979,12 @@ var deleteProject = (params) => Effect_exports.gen(function* () {
180680
180979
  });
180681
180980
 
180682
180981
  // src/mcp/tools/projects.ts
180683
- var CATEGORY14 = "projects";
180982
+ var CATEGORY15 = "projects";
180684
180983
  var projectTools = [
180685
180984
  {
180686
180985
  name: "list_projects",
180687
180986
  description: "List all Huly projects. Returns projects sorted by name. Supports filtering by archived status.",
180688
- category: CATEGORY14,
180987
+ category: CATEGORY15,
180689
180988
  inputSchema: listProjectsParamsJsonSchema,
180690
180989
  handler: createToolHandler(
180691
180990
  "list_projects",
@@ -180696,7 +180995,7 @@ var projectTools = [
180696
180995
  {
180697
180996
  name: "get_project",
180698
180997
  description: "Get full details of a Huly project including its statuses. Returns project name, description, archived flag, default status, and all available statuses.",
180699
- category: CATEGORY14,
180998
+ category: CATEGORY15,
180700
180999
  inputSchema: getProjectParamsJsonSchema,
180701
181000
  handler: createToolHandler(
180702
181001
  "get_project",
@@ -180707,7 +181006,7 @@ var projectTools = [
180707
181006
  {
180708
181007
  name: "list_statuses",
180709
181008
  description: "List all issue statuses for a Huly project with category info. Returns status name, isDone, isCanceled, and isDefault flags. Use this to discover valid statuses before creating or updating issues.",
180710
- category: CATEGORY14,
181009
+ category: CATEGORY15,
180711
181010
  inputSchema: listStatusesParamsJsonSchema,
180712
181011
  handler: createToolHandler(
180713
181012
  "list_statuses",
@@ -180718,7 +181017,7 @@ var projectTools = [
180718
181017
  {
180719
181018
  name: "create_project",
180720
181019
  description: "Create a new Huly tracker project. Idempotent: returns existing project if one with the same identifier already exists (created=false). Identifier must be 1-5 uppercase alphanumeric chars starting with a letter.",
180721
- category: CATEGORY14,
181020
+ category: CATEGORY15,
180722
181021
  inputSchema: createProjectParamsJsonSchema,
180723
181022
  handler: createToolHandler(
180724
181023
  "create_project",
@@ -180729,7 +181028,7 @@ var projectTools = [
180729
181028
  {
180730
181029
  name: "update_project",
180731
181030
  description: "Update a Huly project. Only provided fields are modified. Set description to null to clear it.",
180732
- category: CATEGORY14,
181031
+ category: CATEGORY15,
180733
181032
  inputSchema: updateProjectParamsJsonSchema,
180734
181033
  handler: createToolHandler(
180735
181034
  "update_project",
@@ -180740,7 +181039,7 @@ var projectTools = [
180740
181039
  {
180741
181040
  name: "delete_project",
180742
181041
  description: "Permanently delete a Huly project. All issues, milestones, and components in this project will be orphaned. This action cannot be undone.",
180743
- category: CATEGORY14,
181042
+ category: CATEGORY15,
180744
181043
  inputSchema: deleteProjectParamsJsonSchema,
180745
181044
  handler: createToolHandler(
180746
181045
  "delete_project",
@@ -180783,12 +181082,12 @@ var fulltextSearch = (params) => Effect_exports.gen(function* () {
180783
181082
  });
180784
181083
 
180785
181084
  // src/mcp/tools/search.ts
180786
- var CATEGORY15 = "search";
181085
+ var CATEGORY16 = "search";
180787
181086
  var searchTools = [
180788
181087
  {
180789
181088
  name: "fulltext_search",
180790
181089
  description: "Perform a global fulltext search across all Huly content. Searches issues, documents, messages, and other indexed content. Returns matching items sorted by relevance (newest first).",
180791
- category: CATEGORY15,
181090
+ category: CATEGORY16,
180792
181091
  inputSchema: fulltextSearchParamsJsonSchema,
180793
181092
  handler: createToolHandler(
180794
181093
  "fulltext_search",
@@ -180811,12 +181110,12 @@ var uploadFile = (params) => Effect_exports.gen(function* () {
180811
181110
  });
180812
181111
 
180813
181112
  // src/mcp/tools/storage.ts
180814
- var CATEGORY16 = "storage";
181113
+ var CATEGORY17 = "storage";
180815
181114
  var storageTools = [
180816
181115
  {
180817
181116
  name: "upload_file",
180818
181117
  description: "Upload a file to Huly storage. Provide ONE of: filePath (local file - preferred), fileUrl (fetch from URL), or data (base64 - for small files only). Returns blob ID and URL for referencing the file.",
180819
- category: CATEGORY16,
181118
+ category: CATEGORY17,
180820
181119
  inputSchema: uploadFileParamsJsonSchema,
180821
181120
  handler: createStorageToolHandler(
180822
181121
  "upload_file",
@@ -180827,12 +181126,12 @@ var storageTools = [
180827
181126
  ];
180828
181127
 
180829
181128
  // src/mcp/tools/tag-categories.ts
180830
- var CATEGORY17 = "tag-categories";
181129
+ var CATEGORY18 = "tag-categories";
180831
181130
  var tagCategoryTools = [
180832
181131
  {
180833
181132
  name: "list_tag_categories",
180834
181133
  description: "List tag/label categories in the workspace. Categories group labels (e.g., 'Priority Labels', 'Type Labels'). Optional targetClass filter (defaults to all).",
180835
- category: CATEGORY17,
181134
+ category: CATEGORY18,
180836
181135
  inputSchema: listTagCategoriesParamsJsonSchema,
180837
181136
  handler: createToolHandler(
180838
181137
  "list_tag_categories",
@@ -180843,7 +181142,7 @@ var tagCategoryTools = [
180843
181142
  {
180844
181143
  name: "create_tag_category",
180845
181144
  description: "Create a new tag/label category. Idempotent: returns existing category if one with the same label and targetClass already exists (created=false). Defaults targetClass to tracker issues.",
180846
- category: CATEGORY17,
181145
+ category: CATEGORY18,
180847
181146
  inputSchema: createTagCategoryParamsJsonSchema,
180848
181147
  handler: createToolHandler(
180849
181148
  "create_tag_category",
@@ -180854,7 +181153,7 @@ var tagCategoryTools = [
180854
181153
  {
180855
181154
  name: "update_tag_category",
180856
181155
  description: "Update a tag/label category. Accepts category ID or label name. Only provided fields are modified.",
180857
- category: CATEGORY17,
181156
+ category: CATEGORY18,
180858
181157
  inputSchema: updateTagCategoryParamsJsonSchema,
180859
181158
  handler: createToolHandler(
180860
181159
  "update_tag_category",
@@ -180865,7 +181164,7 @@ var tagCategoryTools = [
180865
181164
  {
180866
181165
  name: "delete_tag_category",
180867
181166
  description: "Permanently delete a tag/label category. Accepts category ID or label name. Labels in this category will be orphaned (not deleted). This action cannot be undone.",
180868
- category: CATEGORY17,
181167
+ category: CATEGORY18,
180869
181168
  inputSchema: deleteTagCategoryParamsJsonSchema,
180870
181169
  handler: createToolHandler(
180871
181170
  "delete_tag_category",
@@ -180876,7 +181175,7 @@ var tagCategoryTools = [
180876
181175
  ];
180877
181176
 
180878
181177
  // src/huly/operations/test-management-core.ts
180879
- var import_core40 = __toESM(require_lib4(), 1);
181178
+ var import_core41 = __toESM(require_lib4(), 1);
180880
181179
 
180881
181180
  // src/huly/test-management-classes.ts
180882
181181
  var testManagement = {
@@ -181084,7 +181383,7 @@ var listTestProjects = (params) => Effect_exports.gen(function* () {
181084
181383
  {},
181085
181384
  {
181086
181385
  limit,
181087
- sort: { name: import_core40.SortingOrder.Ascending }
181386
+ sort: { name: import_core41.SortingOrder.Ascending }
181088
181387
  }
181089
181388
  );
181090
181389
  return {
@@ -181106,7 +181405,7 @@ var listTestSuites = (params) => Effect_exports.gen(function* () {
181106
181405
  query,
181107
181406
  {
181108
181407
  limit,
181109
- sort: { modifiedOn: import_core40.SortingOrder.Descending }
181408
+ sort: { modifiedOn: import_core41.SortingOrder.Descending }
181110
181409
  }
181111
181410
  );
181112
181411
  return {
@@ -181139,7 +181438,7 @@ var createTestSuite = (params) => Effect_exports.gen(function* () {
181139
181438
  if (existing !== void 0) {
181140
181439
  return { id: TestSuiteId.make(existing._id), name: existing.name, created: false };
181141
181440
  }
181142
- const suiteId = (0, import_core40.generateId)();
181441
+ const suiteId = (0, import_core41.generateId)();
181143
181442
  const suiteData = {
181144
181443
  name: params.name,
181145
181444
  description: params.description ?? "",
@@ -181209,7 +181508,7 @@ var listTestCases = (params) => Effect_exports.gen(function* () {
181209
181508
  query,
181210
181509
  {
181211
181510
  limit,
181212
- sort: { modifiedOn: import_core40.SortingOrder.Descending }
181511
+ sort: { modifiedOn: import_core41.SortingOrder.Descending }
181213
181512
  }
181214
181513
  );
181215
181514
  return {
@@ -181237,7 +181536,7 @@ var createTestCase = (params) => Effect_exports.gen(function* () {
181237
181536
  const client = yield* HulyClient;
181238
181537
  const project3 = yield* findTestProject(client, params.project);
181239
181538
  const suite = yield* findTestSuite(client, project3, params.suite);
181240
- const caseId = (0, import_core40.generateId)();
181539
+ const caseId = (0, import_core41.generateId)();
181241
181540
  const assigneeRef = params.assignee !== void 0 ? toRef((yield* resolveAssignee2(params.assignee))._id) : null;
181242
181541
  const typeEnum = params.type !== void 0 ? stringToTestCaseType(params.type) ?? 0 /* Functional */ : 0 /* Functional */;
181243
181542
  const priorityEnum = params.priority !== void 0 ? stringToTestCasePriority(params.priority) ?? 1 /* Medium */ : 1 /* Medium */;
@@ -181341,12 +181640,12 @@ var deleteTestCase = (params) => Effect_exports.gen(function* () {
181341
181640
  });
181342
181641
 
181343
181642
  // src/mcp/tools/test-management-core.ts
181344
- var CATEGORY18 = "test-management";
181643
+ var CATEGORY19 = "test-management";
181345
181644
  var testManagementCoreTools = [
181346
181645
  {
181347
181646
  name: "list_test_projects",
181348
181647
  description: "List test management projects. Returns test projects sorted by name. These are separate from tracker projects.",
181349
- category: CATEGORY18,
181648
+ category: CATEGORY19,
181350
181649
  inputSchema: listTestProjectsParamsJsonSchema,
181351
181650
  handler: createToolHandler(
181352
181651
  "list_test_projects",
@@ -181357,7 +181656,7 @@ var testManagementCoreTools = [
181357
181656
  {
181358
181657
  name: "list_test_suites",
181359
181658
  description: "List test suites in a test project. Accepts project ID or name. Optional parent filter for nested suites.",
181360
- category: CATEGORY18,
181659
+ category: CATEGORY19,
181361
181660
  inputSchema: listTestSuitesParamsJsonSchema,
181362
181661
  handler: createToolHandler(
181363
181662
  "list_test_suites",
@@ -181368,7 +181667,7 @@ var testManagementCoreTools = [
181368
181667
  {
181369
181668
  name: "get_test_suite",
181370
181669
  description: "Get a single test suite by ID or name within a test project. Returns suite details and test case count.",
181371
- category: CATEGORY18,
181670
+ category: CATEGORY19,
181372
181671
  inputSchema: getTestSuiteParamsJsonSchema,
181373
181672
  handler: createToolHandler(
181374
181673
  "get_test_suite",
@@ -181379,7 +181678,7 @@ var testManagementCoreTools = [
181379
181678
  {
181380
181679
  name: "create_test_suite",
181381
181680
  description: "Create a test suite in a test project. Idempotent: returns existing suite if one with the same name exists (created=false). Optional parent for nesting.",
181382
- category: CATEGORY18,
181681
+ category: CATEGORY19,
181383
181682
  inputSchema: createTestSuiteParamsJsonSchema,
181384
181683
  handler: createToolHandler(
181385
181684
  "create_test_suite",
@@ -181390,7 +181689,7 @@ var testManagementCoreTools = [
181390
181689
  {
181391
181690
  name: "update_test_suite",
181392
181691
  description: "Update a test suite. Accepts suite ID or name. Only provided fields are modified.",
181393
- category: CATEGORY18,
181692
+ category: CATEGORY19,
181394
181693
  inputSchema: updateTestSuiteParamsJsonSchema,
181395
181694
  handler: createToolHandler(
181396
181695
  "update_test_suite",
@@ -181401,7 +181700,7 @@ var testManagementCoreTools = [
181401
181700
  {
181402
181701
  name: "delete_test_suite",
181403
181702
  description: "Permanently delete a test suite. Accepts suite ID or name. This action cannot be undone.",
181404
- category: CATEGORY18,
181703
+ category: CATEGORY19,
181405
181704
  inputSchema: deleteTestSuiteParamsJsonSchema,
181406
181705
  handler: createToolHandler(
181407
181706
  "delete_test_suite",
@@ -181412,7 +181711,7 @@ var testManagementCoreTools = [
181412
181711
  {
181413
181712
  name: "list_test_cases",
181414
181713
  description: "List test cases in a test project. Optional filters: suite (ID or name), assignee (name or email).",
181415
- category: CATEGORY18,
181714
+ category: CATEGORY19,
181416
181715
  inputSchema: listTestCasesParamsJsonSchema,
181417
181716
  handler: createToolHandler(
181418
181717
  "list_test_cases",
@@ -181423,7 +181722,7 @@ var testManagementCoreTools = [
181423
181722
  {
181424
181723
  name: "get_test_case",
181425
181724
  description: "Get a single test case by ID or name within a test project.",
181426
- category: CATEGORY18,
181725
+ category: CATEGORY19,
181427
181726
  inputSchema: getTestCaseParamsJsonSchema,
181428
181727
  handler: createToolHandler(
181429
181728
  "get_test_case",
@@ -181434,7 +181733,7 @@ var testManagementCoreTools = [
181434
181733
  {
181435
181734
  name: "create_test_case",
181436
181735
  description: "Create a test case attached to a suite. Requires project and suite. Defaults: type=functional, priority=medium, status=draft.",
181437
- category: CATEGORY18,
181736
+ category: CATEGORY19,
181438
181737
  inputSchema: createTestCaseParamsJsonSchema,
181439
181738
  handler: createToolHandler(
181440
181739
  "create_test_case",
@@ -181445,7 +181744,7 @@ var testManagementCoreTools = [
181445
181744
  {
181446
181745
  name: "update_test_case",
181447
181746
  description: "Update a test case. Accepts test case ID or name. Only provided fields are modified. Set assignee to null to unassign.",
181448
- category: CATEGORY18,
181747
+ category: CATEGORY19,
181449
181748
  inputSchema: updateTestCaseParamsJsonSchema,
181450
181749
  handler: createToolHandler(
181451
181750
  "update_test_case",
@@ -181456,7 +181755,7 @@ var testManagementCoreTools = [
181456
181755
  {
181457
181756
  name: "delete_test_case",
181458
181757
  description: "Permanently delete a test case. Accepts test case ID or name. This action cannot be undone.",
181459
- category: CATEGORY18,
181758
+ category: CATEGORY19,
181460
181759
  inputSchema: deleteTestCaseParamsJsonSchema,
181461
181760
  handler: createToolHandler(
181462
181761
  "delete_test_case",
@@ -181467,7 +181766,7 @@ var testManagementCoreTools = [
181467
181766
  ];
181468
181767
 
181469
181768
  // src/huly/operations/test-management-plans.ts
181470
- var import_core41 = __toESM(require_lib4(), 1);
181769
+ var import_core42 = __toESM(require_lib4(), 1);
181471
181770
  var toPlanSummary = (p) => ({
181472
181771
  id: TestPlanId.make(p._id),
181473
181772
  name: p.name
@@ -181485,7 +181784,7 @@ var listTestPlans = (params) => Effect_exports.gen(function* () {
181485
181784
  const plans = yield* client.findAll(
181486
181785
  testManagement.class.TestPlan,
181487
181786
  { space: project3._id },
181488
- { limit, sort: { modifiedOn: import_core41.SortingOrder.Descending } }
181787
+ { limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
181489
181788
  );
181490
181789
  return { plans: plans.map(toPlanSummary), total: plans.total };
181491
181790
  });
@@ -181520,7 +181819,7 @@ var createTestPlan = (params) => Effect_exports.gen(function* () {
181520
181819
  if (existing !== void 0) {
181521
181820
  return { id: TestPlanId.make(existing._id), name: existing.name, created: false };
181522
181821
  }
181523
- const planId = (0, import_core41.generateId)();
181822
+ const planId = (0, import_core42.generateId)();
181524
181823
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
181525
181824
  testManagement.class.TestPlan,
181526
181825
  planId,
@@ -181602,7 +181901,7 @@ var removeTestPlanItem = (params) => Effect_exports.gen(function* () {
181602
181901
  });
181603
181902
 
181604
181903
  // src/huly/operations/test-management-runs.ts
181605
- var import_core42 = __toESM(require_lib4(), 1);
181904
+ var import_core43 = __toESM(require_lib4(), 1);
181606
181905
  var BATCH_CONCURRENCY = 10;
181607
181906
  var toRunSummary = (r) => ({
181608
181907
  id: TestRunId.make(r._id),
@@ -181623,7 +181922,7 @@ var listTestRuns = (params) => Effect_exports.gen(function* () {
181623
181922
  const runs = yield* client.findAll(
181624
181923
  testManagement.class.TestRun,
181625
181924
  { space: project3._id },
181626
- { limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
181925
+ { limit, sort: { modifiedOn: import_core43.SortingOrder.Descending } }
181627
181926
  );
181628
181927
  return { runs: runs.map(toRunSummary), total: runs.total };
181629
181928
  });
@@ -181652,7 +181951,7 @@ var getTestRun = (params) => Effect_exports.gen(function* () {
181652
181951
  var createTestRun = (params) => Effect_exports.gen(function* () {
181653
181952
  const client = yield* HulyClient;
181654
181953
  const project3 = yield* findTestProject(client, params.project);
181655
- const runId = (0, import_core42.generateId)();
181954
+ const runId = (0, import_core43.generateId)();
181656
181955
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
181657
181956
  testManagement.class.TestRun,
181658
181957
  runId,
@@ -181709,7 +182008,7 @@ var listTestResults = (params) => Effect_exports.gen(function* () {
181709
182008
  const results = yield* client.findAll(
181710
182009
  testManagement.class.TestResult,
181711
182010
  { attachedTo: run3._id },
181712
- { limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
182011
+ { limit, sort: { modifiedOn: import_core43.SortingOrder.Descending } }
181713
182012
  );
181714
182013
  return { results: results.map(toResultSummary), total: results.total };
181715
182014
  });
@@ -181810,7 +182109,7 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
181810
182109
  }
181811
182110
  return { item, tc };
181812
182111
  }), { concurrency: BATCH_CONCURRENCY });
181813
- const runId = (0, import_core42.generateId)();
182112
+ const runId = (0, import_core43.generateId)();
181814
182113
  const runName = params.runName ?? `${plan.name} - Run`;
181815
182114
  yield* client.createDoc(testManagement.class.TestRun, project3._id, {
181816
182115
  name: runName,
@@ -181840,41 +182139,41 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
181840
182139
  });
181841
182140
 
181842
182141
  // src/mcp/tools/test-management-plans.ts
181843
- var CATEGORY19 = "test-management";
182142
+ var CATEGORY20 = "test-management";
181844
182143
  var testManagementPlansTools = [
181845
182144
  // --- Test Plans ---
181846
182145
  {
181847
182146
  name: "list_test_plans",
181848
182147
  description: "List test plans in a test management project. Returns plan names and IDs. Requires project ID or name.",
181849
- category: CATEGORY19,
182148
+ category: CATEGORY20,
181850
182149
  inputSchema: listTestPlansParamsJsonSchema,
181851
182150
  handler: createToolHandler("list_test_plans", parseListTestPlansParams, listTestPlans)
181852
182151
  },
181853
182152
  {
181854
182153
  name: "get_test_plan",
181855
182154
  description: "Get test plan details including its items (test cases). Accepts plan ID or name within a project.",
181856
- category: CATEGORY19,
182155
+ category: CATEGORY20,
181857
182156
  inputSchema: getTestPlanParamsJsonSchema,
181858
182157
  handler: createToolHandler("get_test_plan", parseGetTestPlanParams, getTestPlan)
181859
182158
  },
181860
182159
  {
181861
182160
  name: "create_test_plan",
181862
182161
  description: "Create a test plan in a project. Idempotent: returns existing plan if one with the same name exists (created=false).",
181863
- category: CATEGORY19,
182162
+ category: CATEGORY20,
181864
182163
  inputSchema: createTestPlanParamsJsonSchema,
181865
182164
  handler: createToolHandler("create_test_plan", parseCreateTestPlanParams, createTestPlan)
181866
182165
  },
181867
182166
  {
181868
182167
  name: "update_test_plan",
181869
182168
  description: "Update a test plan's name or description. Only provided fields are modified. Pass description=null to clear.",
181870
- category: CATEGORY19,
182169
+ category: CATEGORY20,
181871
182170
  inputSchema: updateTestPlanParamsJsonSchema,
181872
182171
  handler: createToolHandler("update_test_plan", parseUpdateTestPlanParams, updateTestPlan)
181873
182172
  },
181874
182173
  {
181875
182174
  name: "delete_test_plan",
181876
182175
  description: "Permanently delete a test plan. This does not delete associated test runs. Cannot be undone.",
181877
- category: CATEGORY19,
182176
+ category: CATEGORY20,
181878
182177
  inputSchema: deleteTestPlanParamsJsonSchema,
181879
182178
  handler: createToolHandler("delete_test_plan", parseDeleteTestPlanParams, deleteTestPlan)
181880
182179
  },
@@ -181882,14 +182181,14 @@ var testManagementPlansTools = [
181882
182181
  {
181883
182182
  name: "add_test_plan_item",
181884
182183
  description: "Add a test case to a test plan. Resolves test case by ID or name. Optionally assign a person by email or name.",
181885
- category: CATEGORY19,
182184
+ category: CATEGORY20,
181886
182185
  inputSchema: addTestPlanItemParamsJsonSchema,
181887
182186
  handler: createToolHandler("add_test_plan_item", parseAddTestPlanItemParams, addTestPlanItem)
181888
182187
  },
181889
182188
  {
181890
182189
  name: "remove_test_plan_item",
181891
182190
  description: "Remove a test case from a test plan by item ID. Get item IDs from get_test_plan.",
181892
- category: CATEGORY19,
182191
+ category: CATEGORY20,
181893
182192
  inputSchema: removeTestPlanItemParamsJsonSchema,
181894
182193
  handler: createToolHandler("remove_test_plan_item", parseRemoveTestPlanItemParams, removeTestPlanItem)
181895
182194
  },
@@ -181897,35 +182196,35 @@ var testManagementPlansTools = [
181897
182196
  {
181898
182197
  name: "list_test_runs",
181899
182198
  description: "List test runs in a test management project. Returns run names, IDs, and due dates.",
181900
- category: CATEGORY19,
182199
+ category: CATEGORY20,
181901
182200
  inputSchema: listTestRunsParamsJsonSchema,
181902
182201
  handler: createToolHandler("list_test_runs", parseListTestRunsParams, listTestRuns)
181903
182202
  },
181904
182203
  {
181905
182204
  name: "get_test_run",
181906
182205
  description: "Get test run details including all results. Accepts run ID or name within a project.",
181907
- category: CATEGORY19,
182206
+ category: CATEGORY20,
181908
182207
  inputSchema: getTestRunParamsJsonSchema,
181909
182208
  handler: createToolHandler("get_test_run", parseGetTestRunParams, getTestRun)
181910
182209
  },
181911
182210
  {
181912
182211
  name: "create_test_run",
181913
182212
  description: "Create a test run in a project. For bulk creation from a plan, use run_test_plan instead.",
181914
- category: CATEGORY19,
182213
+ category: CATEGORY20,
181915
182214
  inputSchema: createTestRunParamsJsonSchema,
181916
182215
  handler: createToolHandler("create_test_run", parseCreateTestRunParams, createTestRun)
181917
182216
  },
181918
182217
  {
181919
182218
  name: "update_test_run",
181920
182219
  description: "Update a test run's name, description, or due date. Only provided fields are modified. Pass null to clear optional fields.",
181921
- category: CATEGORY19,
182220
+ category: CATEGORY20,
181922
182221
  inputSchema: updateTestRunParamsJsonSchema,
181923
182222
  handler: createToolHandler("update_test_run", parseUpdateTestRunParams, updateTestRun)
181924
182223
  },
181925
182224
  {
181926
182225
  name: "delete_test_run",
181927
182226
  description: "Permanently delete a test run. This does not delete associated test results. Cannot be undone.",
181928
- category: CATEGORY19,
182227
+ category: CATEGORY20,
181929
182228
  inputSchema: deleteTestRunParamsJsonSchema,
181930
182229
  handler: createToolHandler("delete_test_run", parseDeleteTestRunParams, deleteTestRun)
181931
182230
  },
@@ -181933,35 +182232,35 @@ var testManagementPlansTools = [
181933
182232
  {
181934
182233
  name: "list_test_results",
181935
182234
  description: "List test results in a test run. Returns result names, statuses, and assignees.",
181936
- category: CATEGORY19,
182235
+ category: CATEGORY20,
181937
182236
  inputSchema: listTestResultsParamsJsonSchema,
181938
182237
  handler: createToolHandler("list_test_results", parseListTestResultsParams, listTestResults)
181939
182238
  },
181940
182239
  {
181941
182240
  name: "get_test_result",
181942
182241
  description: "Get test result details. Accepts result ID or name.",
181943
- category: CATEGORY19,
182242
+ category: CATEGORY20,
181944
182243
  inputSchema: getTestResultParamsJsonSchema,
181945
182244
  handler: createToolHandler("get_test_result", parseGetTestResultParams, getTestResult)
181946
182245
  },
181947
182246
  {
181948
182247
  name: "create_test_result",
181949
182248
  description: "Create a test result in a run. Resolves test case by ID or name. Status defaults to 'untested'.",
181950
- category: CATEGORY19,
182249
+ category: CATEGORY20,
181951
182250
  inputSchema: createTestResultParamsJsonSchema,
181952
182251
  handler: createToolHandler("create_test_result", parseCreateTestResultParams, createTestResult)
181953
182252
  },
181954
182253
  {
181955
182254
  name: "update_test_result",
181956
182255
  description: "Update a test result's status, assignee, or description. Status values: untested, blocked, passed, failed.",
181957
- category: CATEGORY19,
182256
+ category: CATEGORY20,
181958
182257
  inputSchema: updateTestResultParamsJsonSchema,
181959
182258
  handler: createToolHandler("update_test_result", parseUpdateTestResultParams, updateTestResult)
181960
182259
  },
181961
182260
  {
181962
182261
  name: "delete_test_result",
181963
182262
  description: "Permanently delete a test result. Cannot be undone.",
181964
- category: CATEGORY19,
182263
+ category: CATEGORY20,
181965
182264
  inputSchema: deleteTestResultParamsJsonSchema,
181966
182265
  handler: createToolHandler("delete_test_result", parseDeleteTestResultParams, deleteTestResult)
181967
182266
  },
@@ -181969,7 +182268,7 @@ var testManagementPlansTools = [
181969
182268
  {
181970
182269
  name: "run_test_plan",
181971
182270
  description: "Execute a test plan: creates a test run and one test result per plan item. Returns the run ID and count of results created. Optionally name the run and set a due date.",
181972
- category: CATEGORY19,
182271
+ category: CATEGORY20,
181973
182272
  inputSchema: runTestPlanParamsJsonSchema,
181974
182273
  annotations: {
181975
182274
  title: "Run Test Plan",
@@ -181984,7 +182283,7 @@ var testManagementPlansTools = [
181984
182283
 
181985
182284
  // src/huly/operations/time.ts
181986
182285
  var import_calendar6 = __toESM(require_lib24(), 1);
181987
- var import_core43 = __toESM(require_lib4(), 1);
182286
+ var import_core44 = __toESM(require_lib4(), 1);
181988
182287
  var import_tracker7 = __toESM(require_lib21(), 1);
181989
182288
  var serverPopulatedCalendar = toRef("");
181990
182289
  var serverPopulatedPersonId = "";
@@ -181994,7 +182293,7 @@ var logTime = (params) => Effect_exports.gen(function* () {
181994
182293
  project: params.project,
181995
182294
  identifier: params.identifier
181996
182295
  });
181997
- const reportId = (0, import_core43.generateId)();
182296
+ const reportId = (0, import_core44.generateId)();
181998
182297
  const now2 = yield* Clock_exports.currentTimeMillis;
181999
182298
  const reportData = {
182000
182299
  employee: null,
@@ -182034,7 +182333,7 @@ var getTimeReport = (params) => Effect_exports.gen(function* () {
182034
182333
  const reports = yield* client.findAll(
182035
182334
  tracker.class.TimeSpendReport,
182036
182335
  { attachedTo: issue2._id },
182037
- { sort: { date: import_core43.SortingOrder.Descending } }
182336
+ { sort: { date: import_core44.SortingOrder.Descending } }
182038
182337
  );
182039
182338
  const employeeIds = [
182040
182339
  ...new Set(
@@ -182086,7 +182385,7 @@ var listTimeSpendReports = (params) => Effect_exports.gen(function* () {
182086
182385
  tracker.class.TimeSpendReport,
182087
182386
  query,
182088
182387
  withLookup(
182089
- { limit, sort: { date: import_core43.SortingOrder.Descending } },
182388
+ { limit, sort: { date: import_core44.SortingOrder.Descending } },
182090
182389
  {
182091
182390
  attachedTo: tracker.class.Issue,
182092
182391
  employee: contact.class.Person
@@ -182115,7 +182414,7 @@ var getDetailedTimeReport = (params) => Effect_exports.gen(function* () {
182115
182414
  tracker.class.TimeSpendReport,
182116
182415
  query,
182117
182416
  withLookup(
182118
- { sort: { date: import_core43.SortingOrder.Descending } },
182417
+ { sort: { date: import_core44.SortingOrder.Descending } },
182119
182418
  {
182120
182419
  attachedTo: tracker.class.Issue,
182121
182420
  employee: contact.class.Person
@@ -182191,7 +182490,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
182191
182490
  const slots = yield* client.findAll(
182192
182491
  time.class.WorkSlot,
182193
182492
  query,
182194
- { limit, sort: { date: import_core43.SortingOrder.Descending } }
182493
+ { limit, sort: { date: import_core44.SortingOrder.Descending } }
182195
182494
  );
182196
182495
  return slots.map((s) => ({
182197
182496
  id: s._id,
@@ -182203,7 +182502,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
182203
182502
  });
182204
182503
  var createWorkSlot = (params) => Effect_exports.gen(function* () {
182205
182504
  const client = yield* HulyClient;
182206
- const slotId = (0, import_core43.generateId)();
182505
+ const slotId = (0, import_core44.generateId)();
182207
182506
  const slotData = {
182208
182507
  date: params.date,
182209
182508
  dueDate: params.dueDate,
@@ -182254,12 +182553,12 @@ var stopTimer = (params) => Effect_exports.gen(function* () {
182254
182553
  });
182255
182554
 
182256
182555
  // src/mcp/tools/time.ts
182257
- var CATEGORY20 = "time tracking";
182556
+ var CATEGORY21 = "time tracking";
182258
182557
  var timeTools = [
182259
182558
  {
182260
182559
  name: "log_time",
182261
182560
  description: "Log time spent on a Huly issue. Records a time entry with optional description. Time value is in minutes.",
182262
- category: CATEGORY20,
182561
+ category: CATEGORY21,
182263
182562
  inputSchema: logTimeParamsJsonSchema,
182264
182563
  handler: createToolHandler(
182265
182564
  "log_time",
@@ -182270,7 +182569,7 @@ var timeTools = [
182270
182569
  {
182271
182570
  name: "get_time_report",
182272
182571
  description: "Get time tracking report for a specific Huly issue. Shows total time, estimation, remaining time, and all time entries.",
182273
- category: CATEGORY20,
182572
+ category: CATEGORY21,
182274
182573
  inputSchema: getTimeReportParamsJsonSchema,
182275
182574
  handler: createToolHandler(
182276
182575
  "get_time_report",
@@ -182281,7 +182580,7 @@ var timeTools = [
182281
182580
  {
182282
182581
  name: "list_time_spend_reports",
182283
182582
  description: "List all time entries across issues. Supports filtering by project and date range. Returns entries sorted by date (newest first).",
182284
- category: CATEGORY20,
182583
+ category: CATEGORY21,
182285
182584
  inputSchema: listTimeSpendReportsParamsJsonSchema,
182286
182585
  handler: createToolHandler(
182287
182586
  "list_time_spend_reports",
@@ -182292,7 +182591,7 @@ var timeTools = [
182292
182591
  {
182293
182592
  name: "get_detailed_time_report",
182294
182593
  description: "Get detailed time breakdown for a project. Shows total time grouped by issue and by employee. Supports date range filtering.",
182295
- category: CATEGORY20,
182594
+ category: CATEGORY21,
182296
182595
  inputSchema: getDetailedTimeReportParamsJsonSchema,
182297
182596
  handler: createToolHandler(
182298
182597
  "get_detailed_time_report",
@@ -182303,7 +182602,7 @@ var timeTools = [
182303
182602
  {
182304
182603
  name: "list_work_slots",
182305
182604
  description: "List scheduled work slots. Shows planned time blocks attached to ToDos. Supports filtering by employee and date range.",
182306
- category: CATEGORY20,
182605
+ category: CATEGORY21,
182307
182606
  inputSchema: listWorkSlotsParamsJsonSchema,
182308
182607
  handler: createToolHandler(
182309
182608
  "list_work_slots",
@@ -182314,7 +182613,7 @@ var timeTools = [
182314
182613
  {
182315
182614
  name: "create_work_slot",
182316
182615
  description: "Create a scheduled work slot. Attaches a time block to a ToDo for planning purposes.",
182317
- category: CATEGORY20,
182616
+ category: CATEGORY21,
182318
182617
  inputSchema: createWorkSlotParamsJsonSchema,
182319
182618
  handler: createToolHandler(
182320
182619
  "create_work_slot",
@@ -182325,7 +182624,7 @@ var timeTools = [
182325
182624
  {
182326
182625
  name: "start_timer",
182327
182626
  description: "Start a client-side timer on a Huly issue. Validates the issue exists and returns a start timestamp. Use log_time to record the elapsed time when done.",
182328
- category: CATEGORY20,
182627
+ category: CATEGORY21,
182329
182628
  inputSchema: startTimerParamsJsonSchema,
182330
182629
  handler: createToolHandler(
182331
182630
  "start_timer",
@@ -182336,7 +182635,7 @@ var timeTools = [
182336
182635
  {
182337
182636
  name: "stop_timer",
182338
182637
  description: "Stop a client-side timer on a Huly issue. Returns the stop timestamp. Calculate elapsed time from start/stop timestamps and use log_time to record it.",
182339
- category: CATEGORY20,
182638
+ category: CATEGORY21,
182340
182639
  inputSchema: stopTimerParamsJsonSchema,
182341
182640
  handler: createToolHandler(
182342
182641
  "stop_timer",
@@ -182347,15 +182646,15 @@ var timeTools = [
182347
182646
  ];
182348
182647
 
182349
182648
  // src/huly/operations/workspace.ts
182350
- var import_core44 = __toESM(require_lib4(), 1);
182649
+ var import_core45 = __toESM(require_lib4(), 1);
182351
182650
  var accountRoleMap = {
182352
- READONLYGUEST: import_core44.AccountRole.ReadOnlyGuest,
182353
- DocGuest: import_core44.AccountRole.DocGuest,
182354
- GUEST: import_core44.AccountRole.Guest,
182355
- USER: import_core44.AccountRole.User,
182356
- MAINTAINER: import_core44.AccountRole.Maintainer,
182357
- OWNER: import_core44.AccountRole.Owner,
182358
- ADMIN: import_core44.AccountRole.Admin
182651
+ READONLYGUEST: import_core45.AccountRole.ReadOnlyGuest,
182652
+ DocGuest: import_core45.AccountRole.DocGuest,
182653
+ GUEST: import_core45.AccountRole.Guest,
182654
+ USER: import_core45.AccountRole.User,
182655
+ MAINTAINER: import_core45.AccountRole.Maintainer,
182656
+ OWNER: import_core45.AccountRole.Owner,
182657
+ ADMIN: import_core45.AccountRole.Admin
182359
182658
  };
182360
182659
  var toHulyAccountRole = (role) => accountRoleMap[role];
182361
182660
  var formatVersion = (info) => `${info.versionMajor}.${info.versionMinor}.${info.versionPatch}`;
@@ -182507,12 +182806,12 @@ var getRegions = () => Effect_exports.gen(function* () {
182507
182806
  });
182508
182807
 
182509
182808
  // src/mcp/tools/workspace.ts
182510
- var CATEGORY21 = "workspace";
182809
+ var CATEGORY22 = "workspace";
182511
182810
  var workspaceTools = [
182512
182811
  {
182513
182812
  name: "list_workspace_members",
182514
182813
  description: "List members in the current Huly workspace with their roles. Returns members with account IDs and roles.",
182515
- category: CATEGORY21,
182814
+ category: CATEGORY22,
182516
182815
  inputSchema: listWorkspaceMembersParamsJsonSchema,
182517
182816
  handler: createWorkspaceToolHandler(
182518
182817
  "list_workspace_members",
@@ -182523,7 +182822,7 @@ var workspaceTools = [
182523
182822
  {
182524
182823
  name: "update_member_role",
182525
182824
  description: "Update a workspace member's role. Requires appropriate permissions. Valid roles: READONLYGUEST, DocGuest, GUEST, USER, MAINTAINER, OWNER, ADMIN.",
182526
- category: CATEGORY21,
182825
+ category: CATEGORY22,
182527
182826
  inputSchema: updateMemberRoleParamsJsonSchema,
182528
182827
  handler: createWorkspaceToolHandler(
182529
182828
  "update_member_role",
@@ -182534,7 +182833,7 @@ var workspaceTools = [
182534
182833
  {
182535
182834
  name: "get_workspace_info",
182536
182835
  description: "Get information about the current workspace including name, URL, region, and settings.",
182537
- category: CATEGORY21,
182836
+ category: CATEGORY22,
182538
182837
  inputSchema: emptyParamsJsonSchema,
182539
182838
  handler: createNoParamsWorkspaceToolHandler(
182540
182839
  getWorkspaceInfo
@@ -182543,7 +182842,7 @@ var workspaceTools = [
182543
182842
  {
182544
182843
  name: "list_workspaces",
182545
182844
  description: "List all workspaces accessible to the current user. Returns workspace summaries sorted by last visit.",
182546
- category: CATEGORY21,
182845
+ category: CATEGORY22,
182547
182846
  inputSchema: listWorkspacesParamsJsonSchema,
182548
182847
  handler: createWorkspaceToolHandler(
182549
182848
  "list_workspaces",
@@ -182554,7 +182853,7 @@ var workspaceTools = [
182554
182853
  {
182555
182854
  name: "create_workspace",
182556
182855
  description: "Create a new Huly workspace. Returns the workspace UUID and URL. Optionally specify a region.",
182557
- category: CATEGORY21,
182856
+ category: CATEGORY22,
182558
182857
  inputSchema: createWorkspaceParamsJsonSchema,
182559
182858
  handler: createWorkspaceToolHandler(
182560
182859
  "create_workspace",
@@ -182565,7 +182864,7 @@ var workspaceTools = [
182565
182864
  {
182566
182865
  name: "delete_workspace",
182567
182866
  description: "Permanently delete the current workspace. This action cannot be undone. Use with extreme caution.",
182568
- category: CATEGORY21,
182867
+ category: CATEGORY22,
182569
182868
  inputSchema: emptyParamsJsonSchema,
182570
182869
  handler: createNoParamsWorkspaceToolHandler(
182571
182870
  deleteWorkspace
@@ -182574,7 +182873,7 @@ var workspaceTools = [
182574
182873
  {
182575
182874
  name: "get_user_profile",
182576
182875
  description: "Get the current user's profile information including bio, location, and social links.",
182577
- category: CATEGORY21,
182876
+ category: CATEGORY22,
182578
182877
  inputSchema: emptyParamsJsonSchema,
182579
182878
  handler: createNoParamsWorkspaceToolHandler(
182580
182879
  getUserProfile
@@ -182583,7 +182882,7 @@ var workspaceTools = [
182583
182882
  {
182584
182883
  name: "update_user_profile",
182585
182884
  description: "Update the current user's profile. Supports bio, city, country, website, social links, and public visibility.",
182586
- category: CATEGORY21,
182885
+ category: CATEGORY22,
182587
182886
  inputSchema: updateUserProfileParamsJsonSchema,
182588
182887
  handler: createWorkspaceToolHandler(
182589
182888
  "update_user_profile",
@@ -182594,7 +182893,7 @@ var workspaceTools = [
182594
182893
  {
182595
182894
  name: "update_guest_settings",
182596
182895
  description: "Update workspace guest settings. Control read-only guest access and guest sign-up permissions.",
182597
- category: CATEGORY21,
182896
+ category: CATEGORY22,
182598
182897
  inputSchema: updateGuestSettingsParamsJsonSchema,
182599
182898
  handler: createWorkspaceToolHandler(
182600
182899
  "update_guest_settings",
@@ -182605,7 +182904,7 @@ var workspaceTools = [
182605
182904
  {
182606
182905
  name: "get_regions",
182607
182906
  description: "Get available regions for workspace creation. Returns region codes and display names.",
182608
- category: CATEGORY21,
182907
+ category: CATEGORY22,
182609
182908
  inputSchema: getRegionsParamsJsonSchema,
182610
182909
  handler: createWorkspaceToolHandler(
182611
182910
  "get_regions",
@@ -182630,6 +182929,7 @@ var allTools = [
182630
182929
  ...contactTools,
182631
182930
  ...channelTools,
182632
182931
  ...cardTools,
182932
+ ...customFieldTools,
182633
182933
  ...calendarTools,
182634
182934
  ...timeTools,
182635
182935
  ...searchTools,