@firfi/huly-mcp 0.18.2 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +13 -1
  2. package/dist/index.cjs +1060 -549
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -31044,7 +31044,7 @@ var require_utils2 = __commonJS({
31044
31044
  escapeLikeForRegexp: () => escapeLikeForRegexp,
31045
31045
  fillConfiguration: () => fillConfiguration,
31046
31046
  fillDefaults: () => fillDefaults,
31047
- generateId: () => generateId25,
31047
+ generateId: () => generateId24,
31048
31048
  generateUuid: () => generateUuid,
31049
31049
  getBranding: () => getBranding,
31050
31050
  getCurrentAccount: () => getCurrentAccount,
@@ -31105,10 +31105,10 @@ var require_utils2 = __commonJS({
31105
31105
  return toHex(val, 6);
31106
31106
  }
31107
31107
  __name(count3, "count");
31108
- function generateId25(join4 = "") {
31108
+ function generateId24(join4 = "") {
31109
31109
  return timestamp() + join4 + random4 + join4 + count3();
31110
31110
  }
31111
- __name(generateId25, "generateId");
31111
+ __name(generateId24, "generateId");
31112
31112
  function generateUuid() {
31113
31113
  return crypto.randomUUID();
31114
31114
  }
@@ -34077,15 +34077,15 @@ var require_storage = __commonJS({
34077
34077
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
34078
34078
  var storage_exports = {};
34079
34079
  __export2(storage_exports, {
34080
- SortingOrder: () => SortingOrder33,
34080
+ SortingOrder: () => SortingOrder34,
34081
34081
  shouldShowArchived: () => shouldShowArchived
34082
34082
  });
34083
34083
  module2.exports = __toCommonJS2(storage_exports);
34084
- var SortingOrder33 = /* @__PURE__ */ ((SortingOrder210) => {
34084
+ var SortingOrder34 = /* @__PURE__ */ ((SortingOrder210) => {
34085
34085
  SortingOrder210[SortingOrder210["Ascending"] = 1] = "Ascending";
34086
34086
  SortingOrder210[SortingOrder210["Descending"] = -1] = "Descending";
34087
34087
  return SortingOrder210;
34088
- })(SortingOrder33 || {});
34088
+ })(SortingOrder34 || {});
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_core54 = require_lib4();
34591
+ var import_core55 = require_lib4();
34592
34592
  var import_platform4 = __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_core54.concatLink)(this.url, "/providers"));
34627
+ const response = await fetch((0, import_core55.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_core54.concatLink)(this.url, "/cookie");
35282
+ const url4 = (0, import_core55.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_core54.concatLink)(this.url, "/cookie");
35292
+ const url4 = (0, import_core55.concatLink)(this.url, "/cookie");
35293
35293
  const response = await fetch(url4, { ...this.request, method: "DELETE" });
35294
35294
  if (!response.ok) {
35295
35295
  const result = await response.json();
@@ -35568,9 +35568,9 @@ var require_config = __commonJS({
35568
35568
  loadServerConfig: () => loadServerConfig2
35569
35569
  });
35570
35570
  module2.exports = __toCommonJS2(config_exports3);
35571
- var import_core54 = require_lib4();
35571
+ var import_core55 = require_lib4();
35572
35572
  async function loadServerConfig2(url4) {
35573
- const configUrl = (0, import_core54.concatLink)(url4, "/config.json");
35573
+ const configUrl = (0, import_core55.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_core54 = require_lib4();
35659
+ var import_core55 = 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_core54.concatLink)(this.collaboratorUrl, `/rpc/${encodeURIComponent(documentId)}`);
35678
+ const url4 = (0, import_core55.concatLink)(this.collaboratorUrl, `/rpc/${encodeURIComponent(documentId)}`);
35679
35679
  const res = await fetch(url4, {
35680
35680
  method: "POST",
35681
35681
  headers: {
@@ -38227,7 +38227,7 @@ var require_dist2 = __commonJS({
38227
38227
  style: true,
38228
38228
  title: true
38229
38229
  };
38230
- var listTags = {
38230
+ var listTags2 = {
38231
38231
  ol: true,
38232
38232
  ul: true
38233
38233
  };
@@ -38361,7 +38361,7 @@ var require_dist2 = __commonJS({
38361
38361
  var outerWS = this.localPreserveWS, top = this.top;
38362
38362
  if (dom.tagName == "PRE" || /pre/.test(dom.style && dom.style.whiteSpace)) this.localPreserveWS = true;
38363
38363
  var name = dom.nodeName.toLowerCase(), ruleID;
38364
- if (listTags.hasOwnProperty(name) && this.parser.normalizeLists) normalizeList(dom);
38364
+ if (listTags2.hasOwnProperty(name) && this.parser.normalizeLists) normalizeList(dom);
38365
38365
  var rule = this.options.ruleFromNode && this.options.ruleFromNode(dom) || (ruleID = this.parser.matchTag(dom, this, matchAfter));
38366
38366
  out: if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {
38367
38367
  this.findInside(dom);
@@ -38687,7 +38687,7 @@ var require_dist2 = __commonJS({
38687
38687
  function normalizeList(dom) {
38688
38688
  for (var child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {
38689
38689
  var name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;
38690
- if (name && listTags.hasOwnProperty(name) && prevItem) {
38690
+ if (name && listTags2.hasOwnProperty(name) && prevItem) {
38691
38691
  prevItem.appendChild(child);
38692
38692
  child = prevItem;
38693
38693
  } else if (name == "li") {
@@ -53242,9 +53242,9 @@ var require_image = __commonJS({
53242
53242
  ImageNode: () => ImageNode
53243
53243
  });
53244
53244
  module2.exports = __toCommonJS2(image_exports);
53245
- var import_core54 = require_dist16();
53245
+ var import_core55 = require_dist16();
53246
53246
  var import_utils14 = require_utils5();
53247
- var ImageNode = import_core54.Node.create({
53247
+ var ImageNode = import_core55.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_core54.mergeAttributes)(
53306
+ const imgAttributes = (0, import_core55.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_core54 = require_dist16();
53350
+ var import_core55 = require_dist16();
53351
53351
  var import_utils14 = require_utils5();
53352
- var ReferenceNode = import_core54.Node.create({
53352
+ var ReferenceNode = import_core55.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_core54.mergeAttributes)(
53387
+ (0, import_core55.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_core54 = require_dist16();
53447
- var EmojiNode = import_core54.Node.create({
53446
+ var import_core55 = require_dist16();
53447
+ var EmojiNode = import_core55.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_core54.mergeAttributes)(
53487
+ const containerAttributes = (0, import_core55.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_core54.mergeAttributes)(
53520
+ (0, import_core55.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_core54.mergeAttributes)({
53529
+ (0, import_core55.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_core54.mergeAttributes)(
53539
+ (0, import_core55.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_core54 = require_dist16();
53848
- var FileNode = import_core54.Node.create({
53847
+ var import_core55 = require_dist16();
53848
+ var FileNode = import_core55.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_core54 = require_dist16();
54158
+ var import_core55 = 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_core54.textblockTypeInputRule)({
54204
+ (0, import_core55.textblockTypeInputRule)({
54205
54205
  find: backtickInputRegex,
54206
54206
  type: this.type
54207
54207
  }),
54208
- (0, import_core54.textblockTypeInputRule)({
54208
+ (0, import_core55.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_core54 = require_dist16();
54245
- var CommentNode = import_core54.Node.create({
54244
+ var import_core55 = require_dist16();
54245
+ var CommentNode = import_core55.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_core54 = require_dist16();
54292
- var MarkdownNode = import_core54.Node.create({
54291
+ var import_core55 = require_dist16();
54292
+ var MarkdownNode = import_core55.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_core54.mergeAttributes)({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
54310
+ (0, import_core55.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_core54 = require_dist16();
54345
- var EmbedNode = import_core54.Node.create({
54344
+ var import_core55 = require_dist16();
54345
+ var EmbedNode = import_core55.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_core54.mergeAttributes)(HTMLAttributes)]];
54370
+ return ["figure", { "data-type": this.name }, ["iframe", (0, import_core55.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_core54 = require_dist16();
54444
+ var import_core55 = 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_core54.Mark.create({
54459
+ var NoteBaseExtension = import_core55.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_core54 = require_dist16();
54516
+ var import_core55 = require_dist16();
54517
54517
  var NAME2 = "node-uuid";
54518
- var QMSInlineCommentMark = import_core54.Mark.create({
54518
+ var QMSInlineCommentMark = import_core55.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_core54 = require_dist16();
54563
+ var import_core55 = require_dist16();
54564
54564
  function extensionKit(name, fn2) {
54565
- return import_core54.Extension.create({
54565
+ return import_core55.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_core54 = require_dist16();
61594
+ var import_core55 = require_dist16();
61595
61595
  var import_extension_text_style = require_dist20();
61596
- var BackgroundColor = import_core54.Extension.create({
61596
+ var BackgroundColor = import_core55.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_core54.Extension.create({
61637
+ var TextColor = import_core55.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_core54 = require_dist16();
61709
+ var import_core55 = require_dist16();
61710
61710
  var import_model = require_dist10();
61711
61711
  var import_state = require_dist5();
61712
- var InlineCommentMark = import_core54.Mark.create({
61712
+ var InlineCommentMark = import_core55.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_core54 = require_lib4();
77236
+ var import_core55 = require_lib4();
77237
77237
  var import_collaborator_client2 = require_lib7();
77238
77238
  var import_text5 = 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_core54.concatLink)(this.url, `/browse?workspace=${workspace}`);
77251
- this.imageUrl = (0, import_core54.concatLink)(this.url, `/files?workspace=${workspace}&file=`);
77250
+ this.refUrl = (0, import_core55.concatLink)(this.url, `/browse?workspace=${workspace}`);
77251
+ this.imageUrl = (0, import_core55.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_core54.makeCollabId)(objectClass, objectId, objectAttr);
77261
+ const collabId = (0, import_core55.makeCollabId)(objectClass, objectId, objectAttr);
77262
77262
  const markup = await this.collaborator.getMarkup(collabId, doc);
77263
77263
  const json3 = (0, import_text5.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_core54.makeCollabId)(objectClass, objectId, objectAttr);
77290
+ const collabId = (0, import_core55.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_client34 = __toESM2(require_lib6());
81775
- var import_core54 = __toESM2(require_lib4());
81774
+ var import_client35 = __toESM2(require_lib6());
81775
+ var import_core55 = __toESM2(require_lib4());
81776
81776
  var import_platform4 = __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_core54.generateId)();
81819
+ sessionId = (0, import_core55.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_core54.generateId)();
81830
+ this.sessionId = (0, import_core55.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_client34.pingConst,
81885
+ method: import_client35.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_client34.ClientSocketReadyState.OPEN && this.helloReceived;
81918
+ return this.websocket != null && this.websocket.readyState === import_client35.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_core54.ClientConnectEvent.Maintenance, void 0, resp.result.stats);
82010
+ void this.onConnect?.(import_core55.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_core54.ClientConnectEvent.Reconnected : import_core54.ClientConnectEvent.Connected,
82045
+ helloResp.reconnect === true ? import_core55.ClientConnectEvent.Reconnected : import_core55.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_client34.pingConst) {
82059
- void this.sendRequest({ method: import_client34.pingConst, params: [] }).catch((err) => {
82058
+ if (resp.result === import_client35.pingConst) {
82059
+ void this.sendRequest({ method: import_client35.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_core54.toFindResult)(result, total, lookupMap);
82095
+ resp.result = (0, import_core55.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_core54.default.class.TxModelUpgrade) {
82139
+ if (tx?._class === import_core55.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_client34.pingConst.length || data.byteLength === import_client34.pongConst.length) {
82151
+ if (data.byteLength === import_client35.pingConst.length || data.byteLength === import_client35.pongConst.length) {
82152
82152
  const text = new TextDecoder().decode(data);
82153
- if (text === import_client34.pingConst) {
82154
- void this.sendRequest({ method: import_client34.pingConst, params: [] }).catch((err) => {
82153
+ if (text === import_client35.pingConst) {
82154
+ void this.sendRequest({ method: import_client35.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_client34.pongConst) {
82159
+ if (text === import_client35.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_platform4.getMetadata)(import_client34.default.metadata.ClientSocketFactory) ?? ((url4) => {
82169
+ const clientSocketFactory = this.opt?.socketFactory ?? (0, import_platform4.getMetadata)(import_client35.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_client34.pongConst) {
82204
+ if (event.data === import_client35.pongConst) {
82205
82205
  this.pingResponse = Date.now();
82206
82206
  return;
82207
82207
  }
82208
- if (event.data === import_client34.pingConst) {
82209
- void this.sendRequest({ method: import_client34.pingConst, params: [] }).catch((err) => {
82208
+ if (event.data === import_client35.pingConst) {
82209
+ void this.sendRequest({ method: import_client35.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_platform4.getMetadata)(import_client34.default.metadata.UseBinaryProtocol) ?? true;
82275
- this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform4.getMetadata)(import_client34.default.metadata.UseProtocolCompression) ?? false;
82274
+ const useBinary = this.opt?.useBinaryProtocol ?? (0, import_platform4.getMetadata)(import_client35.default.metadata.UseBinaryProtocol) ?? true;
82275
+ this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform4.getMetadata)(import_client35.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_client34.pingConst) {
82321
+ if (data.method !== import_client35.pingConst) {
82322
82322
  this.requests.set(id, promise4);
82323
82323
  }
82324
82324
  promise4.sendData = () => {
82325
- if (this.websocket?.readyState === import_client34.ClientSocketReadyState.OPEN) {
82325
+ if (this.websocket?.readyState === import_client35.ClientSocketReadyState.OPEN) {
82326
82326
  promise4.startTime = Date.now();
82327
- if (data.method !== import_client34.pingConst) {
82327
+ if (data.method !== import_client35.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_client34.pingConst);
82340
+ this.websocket?.send(import_client35.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_client34.pingConst) {
82354
+ if (data.method !== import_client35.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_core54.clone)(this.account));
82369
+ return Promise.resolve((0, import_core55.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_core54.default.class.TxApplyIf) {
82428
- return (await this.findAll(import_core54.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
82427
+ if (tx._class === import_core55.default.class.TxApplyIf) {
82428
+ return (await this.findAll(import_core55.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
82429
82429
  }
82430
- return (await this.findAll(import_core54.default.class.Tx, { _id: tx._id }, { limit: 1 })).length === 0;
82430
+ return (await this.findAll(import_core55.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_core54.MeasureMetricsContext("connection", {}),
82470
+ opt?.ctx?.newChild?.("connection", {}) ?? new import_core55.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_client34 = __toESM2(require_lib6());
82521
- var import_core54 = __toESM2(require_lib4());
82520
+ var import_client35 = __toESM2(require_lib6());
82521
+ var import_core55 = __toESM2(require_lib4());
82522
82522
  var import_platform4 = __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_core54.platformNow)();
82527
+ const st = (0, import_core55.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_core54.platformNow)() - st);
82538
+ console.log("init DB complete", (0, import_core55.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_platform4.getMetadata)(import_client34.default.metadata.FilterModel) ?? "none";
82565
- const extraFilter = (0, import_platform4.getMetadata)(import_client34.default.metadata.ExtraFilter) ?? [];
82564
+ const filterModel = (0, import_platform4.getMetadata)(import_client35.default.metadata.FilterModel) ?? "none";
82565
+ const extraFilter = (0, import_platform4.getMetadata)(import_client35.default.metadata.ExtraFilter) ?? [];
82566
82566
  const handler = /* @__PURE__ */ __name(async (handler2) => {
82567
- const url4 = (0, import_core54.concatLink)(endpoint, `/${token}`);
82567
+ const url4 = (0, import_core55.concatLink)(endpoint, `/${token}`);
82568
82568
  const upgradeHandler = /* @__PURE__ */ __name((...txes) => {
82569
82569
  for (const tx of txes) {
82570
- if (tx?._class === import_core54.default.class.TxModelUpgrade) {
82570
+ if (tx?._class === import_core55.default.class.TxModelUpgrade) {
82571
82571
  opt?.onUpgrade?.();
82572
82572
  return;
82573
82573
  }
82574
- if (tx?._class === import_core54.default.class.TxWorkspaceEvent) {
82574
+ if (tx?._class === import_core55.default.class.TxWorkspaceEvent) {
82575
82575
  const event = tx;
82576
- if (event.event === import_core54.WorkspaceEvent.MaintenanceNotification) {
82576
+ if (event.event === import_core55.WorkspaceEvent.MaintenanceNotification) {
82577
82577
  void (0, import_platform4.setPlatformStatus)(
82578
82578
  new import_platform4.Status(import_platform4.Severity.WARNING, import_platform4.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_platform4.getMetadata)(import_client34.default.metadata.ConnectionTimeout);
82593
+ const connectTimeout = opt?.connectionTimeout ?? (0, import_platform4.getMetadata)(import_client35.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_core54.ClientConnectEvent.Maintenance) {
82614
+ if (event !== import_core55.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_core54.createClient)(handler, modelFilter, createModelPersistence(getWSFromToken(token)), opt?.ctx);
82636
+ const client = (0, import_core55.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_core54.fillConfiguration)(txes, configs);
82645
- const allowedPlugins = [...(0, import_platform4.getPlugins)(), ...(0, import_platform4.getMetadata)(import_client34.default.metadata.ExtraPlugins) ?? []];
82644
+ (0, import_core55.fillConfiguration)(txes, configs);
82645
+ const allowedPlugins = [...(0, import_platform4.getPlugins)(), ...(0, import_platform4.getMetadata)(import_client35.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_core54.pluginFilterTx)(excludedPlugins, configs, txes);
82649
+ return (0, import_core55.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_core54.fillConfiguration)(txes, configs);
82654
+ (0, import_core55.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_core54.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82681
- if (tx?._class === import_core54.default.class.TxCreateDoc || tx?._class === import_core54.default.class.TxUpdateDoc || tx?._class === import_core54.default.class.TxRemoveDoc) {
82680
+ const result = (0, import_core55.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82681
+ if (tx?._class === import_core55.default.class.TxCreateDoc || tx?._class === import_core55.default.class.TxUpdateDoc || tx?._class === import_core55.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_platform4.getMetadata)(import_client34.default.metadata.OverridePersistenceStore);
82693
+ const overrideStore = (0, import_platform4.getMetadata)(import_client35.default.metadata.OverridePersistenceStore);
82694
82694
  if (overrideStore !== void 0) {
82695
82695
  return overrideStore;
82696
82696
  }
@@ -82787,8 +82787,8 @@ var require_client6 = __commonJS({
82787
82787
  });
82788
82788
  module2.exports = __toCommonJS2(client_exports);
82789
82789
  var import_account_client2 = require_lib5();
82790
- var import_client34 = __toESM2(require_lib6());
82791
- var import_core54 = require_lib4();
82790
+ var import_client35 = __toESM2(require_lib6());
82791
+ var import_core55 = require_lib4();
82792
82792
  var import_platform4 = require_lib();
82793
82793
  var import_config9 = require_config();
82794
82794
  var import_markup11 = require_markup();
@@ -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_core54.pickPrimarySocialId)(socialIds)._id,
82808
+ primarySocialId: (0, import_core55.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_platform4.addLocation)(import_client34.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
82816
+ (0, import_platform4.addLocation)(import_client35.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
82817
82817
  const { socketFactory, connectionTimeout } = options;
82818
- const clientFactory = await (0, import_platform4.getResource)(import_client34.default.function.GetClient);
82818
+ const clientFactory = await (0, import_platform4.getResource)(import_client35.default.function.GetClient);
82819
82819
  const connection = await clientFactory(token, endpoint, {
82820
82820
  socketFactory,
82821
82821
  connectionTimeout
@@ -82831,7 +82831,7 @@ var require_client6 = __commonJS({
82831
82831
  this.config = config3;
82832
82832
  this.connection = connection;
82833
82833
  this.account = account;
82834
- this.client = new import_core54.TxOperations(connection, account.primarySocialId);
82834
+ this.client = new import_core55.TxOperations(connection, account.primarySocialId);
82835
82835
  this.markup = (0, import_markup11.createMarkupOperations)(url4, workspace, token, config3);
82836
82836
  }
82837
82837
  static {
@@ -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_core54.generateId)();
82874
+ id ??= (0, import_core55.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_core54.generateId)();
82887
+ id ??= (0, import_core55.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_core54 = require_lib4();
83214
+ var import_core55 = require_lib4();
83215
83215
  var import_platform4 = 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_core54.concatLink)(this.endpoint, `/api/v1/find-all/${this.workspace}?${params.toString()}`);
83269
+ const requestUrl = (0, import_core55.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_core54.concatLink)(this.endpoint, `/api/v1/account/${this.workspace}`);
83343
+ const requestUrl = (0, import_core55.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_core54.concatLink)(this.endpoint, `/api/v1/load-model/${this.workspace}`));
83360
+ const requestUrl = new URL((0, import_core55.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_core54.Hierarchy();
83374
- const model = new import_core54.ModelDb(hierarchy);
83375
- const ctx = new import_core54.MeasureMetricsContext("loadModel", {});
83376
- (0, import_core54.buildModel)(ctx, modelResponse, void 0, hierarchy, model);
83373
+ const hierarchy = new import_core55.Hierarchy();
83374
+ const model = new import_core55.ModelDb(hierarchy);
83375
+ const ctx = new import_core55.MeasureMetricsContext("loadModel", {});
83376
+ (0, import_core55.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_core54.concatLink)(this.endpoint, `/api/v1/tx/${this.workspace}`);
83388
+ const requestUrl = (0, import_core55.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_core54.concatLink)(this.endpoint, `/api/v1/search-fulltext/${this.workspace}?${params.toString()}`);
83422
+ const requestUrl = (0, import_core55.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_core54.concatLink)(this.endpoint, `/api/v1/request/${domain3}/${this.workspace}`);
83441
+ const requestUrl = (0, import_core55.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_core54.concatLink)(this.endpoint, `/api/v1/ensure-person/${this.workspace}`);
83460
+ const requestUrl = (0, import_core55.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_core54 = require_lib4();
83517
+ var import_core55 = 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_core54.TxOperations(new RestTxClient(restClient, hierarchy, model, account), account.socialIds[0]);
83523
+ return new import_core55.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_core54.toFindResult)(result, data.total);
83544
+ return (0, import_core55.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_core54 = __toESM2(require_lib4());
83726
+ var import_core55 = __toESM2(require_lib4());
83727
83727
  var import_stream2 = require("stream");
83728
83728
  var import_config9 = 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_core54.default.class.Blob,
83763
+ _class: import_core55.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_core54.default.space.Configuration,
83769
- modifiedBy: import_core54.default.account.System,
83768
+ space: import_core55.default.space.Configuration,
83769
+ modifiedBy: import_core55.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_core54.default.class.Blob,
83804
+ _class: import_core55.default.class.Blob,
83805
83805
  _id: fileResult.id,
83806
- space: import_core54.default.space.Configuration,
83806
+ space: import_core55.default.space.Configuration,
83807
83807
  modifiedOn: fileResult.metadata.lastModified,
83808
- modifiedBy: import_core54.default.account.System,
83808
+ modifiedBy: import_core55.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_config9.loadServerConfig)(url4);
83881
83881
  const token = await (0, import_utils14.getWorkspaceToken)(url4, options, config3);
83882
- const filesUrl = (config3.FILES_URL.startsWith("/") ? (0, import_core54.concatLink)(url4, config3.FILES_URL) : config3.FILES_URL).replace(
83882
+ const filesUrl = (config3.FILES_URL.startsWith("/") ? (0, import_core55.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_core54.concatLink)(url4, config3.UPLOAD_URL) : config3.UPLOAD_URL).replace(":workspace", token.workspaceId);
83886
+ const uploadUrl = (config3.UPLOAD_URL.startsWith("/") ? (0, import_core55.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_client34.connectStorage,
83940
- createStorageClient: () => import_client34.createStorageClient
83939
+ connectStorage: () => import_client35.connectStorage,
83940
+ createStorageClient: () => import_client35.createStorageClient
83941
83941
  });
83942
83942
  module2.exports = __toCommonJS2(storage_exports);
83943
- var import_client34 = require_client7();
83943
+ var import_client35 = require_client7();
83944
83944
  __reExport2(storage_exports, require_error3(), module2.exports);
83945
83945
  __reExport2(storage_exports, require_types8(), module2.exports);
83946
83946
  }
@@ -107892,7 +107892,7 @@ var require_utils14 = __commonJS({
107892
107892
  getWeekday: () => getWeekday
107893
107893
  });
107894
107894
  module2.exports = __toCommonJS2(utils_exports);
107895
- var import_core54 = require_lib4();
107895
+ var import_core55 = require_lib4();
107896
107896
  var import__ = __toESM2(require_lib25());
107897
107897
  function getInstance(event, date7) {
107898
107898
  const diff8 = event.dueDate - event.date;
@@ -107904,7 +107904,7 @@ var require_utils14 = __commonJS({
107904
107904
  originalStartTime: date7,
107905
107905
  _class: import__.default.class.ReccuringInstance,
107906
107906
  eventId: generateEventId3(),
107907
- _id: (0, import_core54.generateId)(),
107907
+ _id: (0, import_core55.generateId)(),
107908
107908
  virtual: true
107909
107909
  };
107910
107910
  }
@@ -108217,7 +108217,7 @@ var require_utils14 = __commonJS({
108217
108217
  }
108218
108218
  __name(getAllEvents, "getAllEvents");
108219
108219
  function generateEventId3() {
108220
- const id = (0, import_core54.generateId)();
108220
+ const id = (0, import_core55.generateId)();
108221
108221
  return encodeToBase32Hex(id);
108222
108222
  }
108223
108223
  __name(generateEventId3, "generateEventId");
@@ -108631,7 +108631,7 @@ var require_utils15 = __commonJS({
108631
108631
  });
108632
108632
  module2.exports = __toCommonJS2(utils_exports);
108633
108633
  var import_fast_equals = require_cjs();
108634
- var import_core54 = __toESM2(require_lib4());
108634
+ var import_core55 = __toESM2(require_lib4());
108635
108635
  var import__ = __toESM2(require_lib27());
108636
108636
  async function getDirectChannel(client, me, employeeAccount) {
108637
108637
  const accIds = [me, employeeAccount].sort();
@@ -108641,7 +108641,7 @@ var require_utils15 = __commonJS({
108641
108641
  return dm._id;
108642
108642
  }
108643
108643
  }
108644
- return await client.createDoc(import__.default.class.DirectMessage, import_core54.default.space.Space, {
108644
+ return await client.createDoc(import__.default.class.DirectMessage, import_core55.default.space.Space, {
108645
108645
  name: "",
108646
108646
  description: "",
108647
108647
  private: true,
@@ -108945,18 +108945,18 @@ var require_cache4 = __commonJS({
108945
108945
  default: () => ContactCache
108946
108946
  });
108947
108947
  module2.exports = __toCommonJS2(cache_exports);
108948
- var import_core54 = __toESM2(require_lib4());
108948
+ var import_core55 = __toESM2(require_lib4());
108949
108949
  var import__ = __toESM2(require_lib28());
108950
108950
  function isCreateTx(tx) {
108951
- return tx._class === import_core54.default.class.TxCreateDoc;
108951
+ return tx._class === import_core55.default.class.TxCreateDoc;
108952
108952
  }
108953
108953
  __name(isCreateTx, "isCreateTx");
108954
108954
  function isUpdateTx(tx) {
108955
- return tx._class === import_core54.default.class.TxUpdateDoc;
108955
+ return tx._class === import_core55.default.class.TxUpdateDoc;
108956
108956
  }
108957
108957
  __name(isUpdateTx, "isUpdateTx");
108958
108958
  function isMixinTx(tx) {
108959
- return tx._class === import_core54.default.class.TxMixin;
108959
+ return tx._class === import_core55.default.class.TxMixin;
108960
108960
  }
108961
108961
  __name(isMixinTx, "isMixinTx");
108962
108962
  function isPersonTx(tx) {
@@ -109063,7 +109063,7 @@ var require_cache4 = __commonJS({
109063
109063
  const ref = tx.objectId;
109064
109064
  const person = this._personByRef.get(ref);
109065
109065
  if (person === void 0) return;
109066
- const createdPerson = import_core54.TxProcessor.createDoc2Doc(tx);
109066
+ const createdPerson = import_core55.TxProcessor.createDoc2Doc(tx);
109067
109067
  this._personByRef.set(ref, createdPerson);
109068
109068
  const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
109069
109069
  for (const personId of personIds) {
@@ -109081,7 +109081,7 @@ var require_cache4 = __commonJS({
109081
109081
  const newPersonRef = tx.attachedTo;
109082
109082
  this._personRefByPersonId.set(personId, newPersonRef);
109083
109083
  this.addPersonIdToPersonRef(newPersonRef, personId);
109084
- const createdSocialId = import_core54.TxProcessor.createDoc2Doc(tx);
109084
+ const createdSocialId = import_core55.TxProcessor.createDoc2Doc(tx);
109085
109085
  this._socialIdByPersonId.set(personId, createdSocialId);
109086
109086
  this.broadcastChange({
109087
109087
  personRef: newPersonRef,
@@ -109092,7 +109092,7 @@ var require_cache4 = __commonJS({
109092
109092
  const ref = tx.objectId;
109093
109093
  const person = this._personByRef.get(ref);
109094
109094
  if (person == null) return;
109095
- const updatedPerson = isUpdateTx(tx) ? import_core54.TxProcessor.updateDoc2Doc(person, tx) : import_core54.TxProcessor.updateMixin4Doc(person, tx);
109095
+ const updatedPerson = isUpdateTx(tx) ? import_core55.TxProcessor.updateDoc2Doc(person, tx) : import_core55.TxProcessor.updateMixin4Doc(person, tx);
109096
109096
  this._personByRef.set(ref, updatedPerson);
109097
109097
  const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
109098
109098
  for (const personId of personIds) {
@@ -109207,7 +109207,7 @@ var require_utils16 = __commonJS({
109207
109207
  setCurrentEmployeeSpace: () => setCurrentEmployeeSpace
109208
109208
  });
109209
109209
  module2.exports = __toCommonJS2(utils_exports);
109210
- var import_core54 = require_lib4();
109210
+ var import_core55 = require_lib4();
109211
109211
  var import_platform4 = require_lib();
109212
109212
  var import__ = __toESM2(require_lib28());
109213
109213
  var import_types13 = require_types9();
@@ -109411,7 +109411,7 @@ var require_utils16 = __commonJS({
109411
109411
  if (socialIds.length === 0) {
109412
109412
  return;
109413
109413
  }
109414
- return (0, import_core54.pickPrimarySocialId)(socialIds)._id;
109414
+ return (0, import_core55.pickPrimarySocialId)(socialIds)._id;
109415
109415
  }
109416
109416
  __name(getPrimarySocialId, "getPrimarySocialId");
109417
109417
  async function getAllSocialStringsByPersonId(client, personId) {
@@ -109450,12 +109450,12 @@ var require_utils16 = __commonJS({
109450
109450
  __name(getSocialStringsByEmployee, "getSocialStringsByEmployee");
109451
109451
  async function getAllAccounts(client) {
109452
109452
  const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
109453
- return employees.map((it) => it.personUuid).filter(import_core54.notEmpty);
109453
+ return employees.map((it) => it.personUuid).filter(import_core55.notEmpty);
109454
109454
  }
109455
109455
  __name(getAllAccounts, "getAllAccounts");
109456
109456
  async function getAllUserAccounts(client) {
109457
109457
  const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
109458
- return employees.map((it) => it.personUuid).filter(import_core54.notEmpty);
109458
+ return employees.map((it) => it.personUuid).filter(import_core55.notEmpty);
109459
109459
  }
109460
109460
  __name(getAllUserAccounts, "getAllUserAccounts");
109461
109461
  async function ensureEmployee(ctx, me, client, socialIds, getGlobalPerson) {
@@ -109464,7 +109464,7 @@ var require_utils16 = __commonJS({
109464
109464
  }
109465
109465
  __name(ensureEmployee, "ensureEmployee");
109466
109466
  async function ensureEmployeeForPerson(ctx, me, person, client, socialIds, globalPerson) {
109467
- const txFactory = new import_core54.TxFactory(me.primarySocialId);
109467
+ const txFactory = new import_core55.TxFactory(me.primarySocialId);
109468
109468
  const personByUuid = await client.findOne(import__.default.class.Person, { personUuid: person.uuid });
109469
109469
  let personRef = personByUuid?._id;
109470
109470
  if (personRef === void 0) {
@@ -109485,7 +109485,7 @@ var require_utils16 = __commonJS({
109485
109485
  city: globalPerson.city,
109486
109486
  avatarType: import__.AvatarType.COLOR
109487
109487
  };
109488
- personRef = (0, import_core54.generateId)();
109488
+ personRef = (0, import_core55.generateId)();
109489
109489
  const createPersonTx = txFactory.createTxCreateDoc(import__.default.class.Person, import__.default.space.Contacts, data, personRef);
109490
109490
  await client.tx(createPersonTx);
109491
109491
  });
@@ -109495,7 +109495,7 @@ var require_utils16 = __commonJS({
109495
109495
  });
109496
109496
  await client.tx(updatePersonTx);
109497
109497
  }
109498
- const existingIdentifiers = (0, import_core54.toIdMap)(
109498
+ const existingIdentifiers = (0, import_core55.toIdMap)(
109499
109499
  await client.findAll(import__.default.class.SocialIdentity, { _id: { $in: person.socialIds } })
109500
109500
  );
109501
109501
  for (const socialId of socialIds) {
@@ -109520,7 +109520,7 @@ var require_utils16 = __commonJS({
109520
109520
  collection: "socialIds",
109521
109521
  type: socialId.type,
109522
109522
  value: socialId.value,
109523
- key: (0, import_core54.buildSocialIdString)(socialId),
109523
+ key: (0, import_core55.buildSocialIdString)(socialId),
109524
109524
  // TODO: fill it in trigger or on DB level as stored calculated column or smth?
109525
109525
  verifiedOn: socialId.verifiedOn,
109526
109526
  isDeleted: socialId.isDeleted
@@ -109561,9 +109561,9 @@ var require_utils16 = __commonJS({
109561
109561
  }
109562
109562
  }
109563
109563
  }
109564
- const employeeRole = person.role === import_core54.AccountRole.Guest || person.role === import_core54.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
109564
+ const employeeRole = person.role === import_core55.AccountRole.Guest || person.role === import_core55.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
109565
109565
  const employee = await client.findOne(import__.default.mixin.Employee, { _id: personRef });
109566
- if (employee === void 0 || !import_core54.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
109566
+ if (employee === void 0 || !import_core55.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
109567
109567
  await ctx.with("create-employee", {}, async () => {
109568
109568
  if (personRef === void 0) {
109569
109569
  console.error("Person not found");
@@ -109603,7 +109603,7 @@ var require_utils16 = __commonJS({
109603
109603
  }
109604
109604
  __name(loadCachesForPersonId, "loadCachesForPersonId");
109605
109605
  async function loadCachesForPersonIds(client, personIds) {
109606
- const sidObjsMap = (0, import_core54.toIdMap)(
109606
+ const sidObjsMap = (0, import_core55.toIdMap)(
109607
109607
  await client.findAll(
109608
109608
  import__.default.class.SocialIdentity,
109609
109609
  {
@@ -109638,7 +109638,7 @@ var require_utils16 = __commonJS({
109638
109638
  }
109639
109639
  __name(loadCachesForPersonRef, "loadCachesForPersonRef");
109640
109640
  async function loadCachesForPersonRefs(client, personRefs) {
109641
- const persons = (0, import_core54.toIdMap)(
109641
+ const persons = (0, import_core55.toIdMap)(
109642
109642
  await client.findAll(
109643
109643
  import__.default.class.Person,
109644
109644
  {
@@ -109681,7 +109681,7 @@ var require_utils16 = __commonJS({
109681
109681
  personIds.map((pid) => {
109682
109682
  const ref = contactCache.personRefByPersonId.get(pid);
109683
109683
  return ref != null ? [pid, ref] : void 0;
109684
- }).filter(import_core54.notEmpty)
109684
+ }).filter(import_core55.notEmpty)
109685
109685
  );
109686
109686
  }
109687
109687
  __name(getPersonRefsByPersonIdsFromCache, "getPersonRefsByPersonIdsFromCache");
@@ -109728,7 +109728,7 @@ var require_utils16 = __commonJS({
109728
109728
  personIds.map((pid) => {
109729
109729
  const person = contactCache.personByPersonId.get(pid);
109730
109730
  return person != null ? [pid, person] : void 0;
109731
- }).filter(import_core54.notEmpty)
109731
+ }).filter(import_core55.notEmpty)
109732
109732
  );
109733
109733
  }
109734
109734
  __name(getPersonsByPersonIdsFromCache, "getPersonsByPersonIdsFromCache");
@@ -109775,7 +109775,7 @@ var require_utils16 = __commonJS({
109775
109775
  personRefs.map((personRef) => {
109776
109776
  const person = contactCache.personByRef.get(personRef);
109777
109777
  return person != null ? [personRef, person] : void 0;
109778
- }).filter(import_core54.notEmpty)
109778
+ }).filter(import_core55.notEmpty)
109779
109779
  );
109780
109780
  }
109781
109781
  __name(getPersonsByPersonRefsFromCache, "getPersonsByPersonRefsFromCache");
@@ -110380,9 +110380,9 @@ var require_utils17 = __commonJS({
110380
110380
  getFirstRank: () => getFirstRank
110381
110381
  });
110382
110382
  module2.exports = __toCommonJS2(utils_exports);
110383
- var import_core54 = require_lib4();
110383
+ var import_core55 = require_lib4();
110384
110384
  var import_plugin = __toESM2(require_plugin2());
110385
- async function getFirstRank(client, space, parent, sort3 = import_core54.SortingOrder.Descending, extra = {}) {
110385
+ async function getFirstRank(client, space, parent, sort3 = import_core55.SortingOrder.Descending, extra = {}) {
110386
110386
  const doc = await client.findOne(
110387
110387
  import_plugin.default.class.Document,
110388
110388
  { space, parent, ...extra },
@@ -112005,7 +112005,7 @@ var require_utils19 = __commonJS({
112005
112005
  updateProjectType: () => updateProjectType
112006
112006
  });
112007
112007
  module2.exports = __toCommonJS2(utils_exports);
112008
- var import_core54 = __toESM2(require_lib4());
112008
+ var import_core55 = __toESM2(require_lib4());
112009
112009
  var import_platform4 = require_lib();
112010
112010
  var import__ = __toESM2(require_lib34());
112011
112011
  var import_rank4 = require_lib33();
@@ -112041,7 +112041,7 @@ var require_utils19 = __commonJS({
112041
112041
  if (exists5 !== void 0) {
112042
112042
  return exists5._id;
112043
112043
  }
112044
- const res = await client.createDoc(_class, import_core54.default.space.Model, data);
112044
+ const res = await client.createDoc(_class, import_core55.default.space.Model, data);
112045
112045
  return res;
112046
112046
  }
112047
112047
  __name(createState, "createState");
@@ -112071,7 +112071,7 @@ var require_utils19 = __commonJS({
112071
112071
  function findStatusAttr(h, _class) {
112072
112072
  const attrs = h.getAllAttributes(_class);
112073
112073
  for (const it of attrs.values()) {
112074
- if (it.type._class === import_core54.default.class.RefTo && h.isDerived(it.type.to, import_core54.default.class.Status)) {
112074
+ if (it.type._class === import_core55.default.class.RefTo && h.isDerived(it.type.to, import_core55.default.class.Status)) {
112075
112075
  return it;
112076
112076
  }
112077
112077
  }
@@ -112103,7 +112103,7 @@ var require_utils19 = __commonJS({
112103
112103
  const targetProjectClassId = `${_id}:type:mixin`;
112104
112104
  const tmpl = await client.createDoc(
112105
112105
  import__.default.class.ProjectType,
112106
- import_core54.default.space.Model,
112106
+ import_core55.default.space.Model,
112107
112107
  {
112108
112108
  description: data.description,
112109
112109
  shortDescription: data.shortDescription,
@@ -112118,17 +112118,17 @@ var require_utils19 = __commonJS({
112118
112118
  _id
112119
112119
  );
112120
112120
  await client.createDoc(
112121
- import_core54.default.class.Mixin,
112122
- import_core54.default.space.Model,
112121
+ import_core55.default.class.Mixin,
112122
+ import_core55.default.space.Model,
112123
112123
  {
112124
112124
  extends: categoryObj.baseClass,
112125
- kind: import_core54.ClassifierKind.MIXIN,
112125
+ kind: import_core55.ClassifierKind.MIXIN,
112126
112126
  label: (0, import_platform4.getEmbeddedLabel)(data.name),
112127
112127
  icon: baseClassClass.icon
112128
112128
  },
112129
112129
  targetProjectClassId
112130
112130
  );
112131
- await client.createMixin(targetProjectClassId, import_core54.default.class.Mixin, import_core54.default.space.Model, import__.default.mixin.ProjectTypeClass, {
112131
+ await client.createMixin(targetProjectClassId, import_core55.default.class.Mixin, import_core55.default.space.Model, import__.default.mixin.ProjectTypeClass, {
112132
112132
  projectType: _id
112133
112133
  });
112134
112134
  return tmpl;
@@ -112187,22 +112187,22 @@ var require_utils19 = __commonJS({
112187
112187
  const targetClassId = `${taskId}:type:mixin`;
112188
112188
  tdata.targetClass = targetClassId;
112189
112189
  await client.createDoc(
112190
- import_core54.default.class.Mixin,
112191
- import_core54.default.space.Model,
112190
+ import_core55.default.class.Mixin,
112191
+ import_core55.default.space.Model,
112192
112192
  {
112193
112193
  extends: data.ofClass,
112194
- kind: import_core54.ClassifierKind.MIXIN,
112194
+ kind: import_core55.ClassifierKind.MIXIN,
112195
112195
  label: ofClassClass.label,
112196
112196
  icon: ofClassClass.icon
112197
112197
  },
112198
112198
  targetClassId
112199
112199
  );
112200
- await client.createMixin(targetClassId, import_core54.default.class.Mixin, import_core54.default.space.Model, import__.default.mixin.TaskTypeClass, {
112200
+ await client.createMixin(targetClassId, import_core55.default.class.Mixin, import_core55.default.space.Model, import__.default.mixin.TaskTypeClass, {
112201
112201
  taskType: taskId,
112202
112202
  projectType: _id
112203
112203
  });
112204
112204
  }
112205
- await client.createDoc(import__.default.class.TaskType, import_core54.default.space.Model, tdata, taskId);
112205
+ await client.createDoc(import__.default.class.TaskType, import_core55.default.space.Model, tdata, taskId);
112206
112206
  tasksData.set(taskId, tdata);
112207
112207
  _tasks.push(taskId);
112208
112208
  }
@@ -151252,6 +151252,7 @@ var SpaceId = HulyRef("SpaceId");
151252
151252
  var CommentId = HulyRef("CommentId");
151253
151253
  var TimeSpendReportId = HulyRef("TimeSpendReportId");
151254
151254
  var TagElementId = HulyRef("TagElementId");
151255
+ var TagReferenceId = HulyRef("TagReferenceId");
151255
151256
  var TagCategoryId = HulyRef("TagCategoryId");
151256
151257
  var WorkSlotId = HulyRef("WorkSlotId");
151257
151258
  var CustomFieldId = HulyRef("CustomFieldId");
@@ -151299,10 +151300,11 @@ var PositiveNumber = NonNegativeNumber.pipe(Schema_exports.positive(), Schema_ex
151299
151300
  var ColorCode = Schema_exports.Number.pipe(
151300
151301
  Schema_exports.int(),
151301
151302
  Schema_exports.greaterThanOrEqualTo(0),
151302
- Schema_exports.lessThanOrEqualTo(9),
151303
- // eslint-disable-line no-magic-numbers -- Huly color palette has 10 colors (0-9)
151304
151303
  Schema_exports.brand("ColorCode")
151305
- );
151304
+ ).annotations({
151305
+ title: "ColorCode",
151306
+ description: "Non-negative Huly platform color index. Huly SDK stores tag colors as numbers."
151307
+ });
151306
151308
  var ComponentIdentifier = NonEmptyString2.pipe(Schema_exports.brand("ComponentIdentifier"));
151307
151309
  var MilestoneIdentifier = NonEmptyString2.pipe(Schema_exports.brand("MilestoneIdentifier"));
151308
151310
  var TemplateIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TemplateIdentifier"));
@@ -164448,7 +164450,7 @@ var AddLabelParamsSchema = Schema_exports.Struct({
164448
164450
  }),
164449
164451
  color: Schema_exports.optional(
164450
164452
  ColorCode.annotations({
164451
- description: "Color code (0-9, default: 0)"
164453
+ description: "Non-negative Huly platform color index (default: 0)"
164452
164454
  })
164453
164455
  )
164454
164456
  }).annotations({
@@ -164649,6 +164651,229 @@ var parseUpdateComponentParams = Schema_exports.decodeUnknown(UpdateComponentPar
164649
164651
  var parseSetIssueComponentParams = Schema_exports.decodeUnknown(SetIssueComponentParamsSchema);
164650
164652
  var parseDeleteComponentParams = Schema_exports.decodeUnknown(DeleteComponentParamsSchema);
164651
164653
 
164654
+ // src/domain/schemas/tags.ts
164655
+ var TAG_WEIGHT_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8];
164656
+ var TagWeight = Schema_exports.Literal(...TAG_WEIGHT_VALUES).annotations({
164657
+ title: "TagWeight",
164658
+ description: "Optional tag reference weight/knowledge level. Kept in exact type-level parity with @hcengineering/tags TagReference.weight."
164659
+ });
164660
+ var TagTargetClass = ObjectClassName.annotations({
164661
+ title: "TagTargetClass",
164662
+ description: "Huly class or mixin this tag definition applies to, for example 'tracker:class:Issue' or 'recruit:mixin:Candidate'."
164663
+ });
164664
+ var TagObjectLocatorSchema = Schema_exports.Struct({
164665
+ objectId: DocId.annotations({
164666
+ description: "Raw Huly object ID that owns the tag reference."
164667
+ }),
164668
+ objectClass: ObjectClassName.annotations({
164669
+ description: "Raw Huly class/mixin of the object receiving the tag reference."
164670
+ }),
164671
+ space: SpaceId.annotations({
164672
+ description: "Huly space ID where the tag reference should be stored."
164673
+ }),
164674
+ collection: NonEmptyString2.annotations({
164675
+ description: "Collection field on the object that stores tag references, for example 'labels' for tracker issues or 'skills' for recruiting candidates."
164676
+ })
164677
+ }).annotations({
164678
+ title: "TagObjectLocator",
164679
+ description: "Raw SDK object locator for tag references. Use module-specific wrapper tools when available; this locator is for SDK parity."
164680
+ });
164681
+ var TagSummarySchema = Schema_exports.Struct({
164682
+ id: TagElementId,
164683
+ title: NonEmptyString2,
164684
+ targetClass: TagTargetClass,
164685
+ description: Schema_exports.String,
164686
+ color: ColorCode,
164687
+ category: NonEmptyString2,
164688
+ refCount: Schema_exports.optional(Schema_exports.Number)
164689
+ }).annotations({
164690
+ title: "TagSummary",
164691
+ description: "Generic Huly tag definition summary."
164692
+ });
164693
+ var AttachedTagSummarySchema = Schema_exports.Struct({
164694
+ id: TagReferenceId,
164695
+ tag: TagElementId,
164696
+ title: NonEmptyString2,
164697
+ color: ColorCode,
164698
+ weight: Schema_exports.optional(TagWeight)
164699
+ }).annotations({
164700
+ title: "AttachedTagSummary",
164701
+ description: "Generic Huly tag reference attached to one object."
164702
+ });
164703
+ var ListTagsParamsSchema = Schema_exports.Struct({
164704
+ targetClass: TagTargetClass,
164705
+ category: Schema_exports.optional(
164706
+ TagCategoryIdentifier.annotations({
164707
+ description: "Filter by tag category ID or label within the targetClass."
164708
+ })
164709
+ ),
164710
+ titleSearch: Schema_exports.optional(Schema_exports.String.annotations({
164711
+ description: "Search tag titles by substring (case-insensitive where supported by Huly backend)."
164712
+ })),
164713
+ limit: Schema_exports.optional(
164714
+ LimitParam.annotations({
164715
+ description: "Maximum number of tags to return (default: 50)."
164716
+ })
164717
+ )
164718
+ }).annotations({
164719
+ title: "ListTagsParams",
164720
+ description: "List generic Huly tag definitions for one target class."
164721
+ });
164722
+ var CreateTagParamsSchema = Schema_exports.Struct({
164723
+ targetClass: TagTargetClass,
164724
+ title: NonEmptyString2.annotations({
164725
+ description: "Tag title."
164726
+ }),
164727
+ color: Schema_exports.optional(
164728
+ ColorCode.annotations({
164729
+ description: "Non-negative Huly platform color index (default: 0)."
164730
+ })
164731
+ ),
164732
+ description: Schema_exports.optional(Schema_exports.String.annotations({
164733
+ description: "Tag description."
164734
+ })),
164735
+ category: Schema_exports.optional(
164736
+ TagCategoryIdentifier.annotations({
164737
+ description: "Category ID or label within targetClass. If omitted, uses that targetClass default category when available, otherwise Huly's generic no-category bucket."
164738
+ })
164739
+ )
164740
+ }).annotations({
164741
+ title: "CreateTagParams",
164742
+ description: "Create a generic Huly tag definition. Idempotent by targetClass + title."
164743
+ });
164744
+ var updateTagFields = {
164745
+ title: Schema_exports.optional(NonEmptyString2.annotations({
164746
+ description: "New tag title."
164747
+ })),
164748
+ color: Schema_exports.optional(
164749
+ ColorCode.annotations({
164750
+ description: "New non-negative Huly platform color index."
164751
+ })
164752
+ ),
164753
+ description: Schema_exports.optional(Schema_exports.String.annotations({
164754
+ description: "New tag description."
164755
+ })),
164756
+ category: Schema_exports.optional(
164757
+ TagCategoryIdentifier.annotations({
164758
+ description: "New category ID or label within targetClass."
164759
+ })
164760
+ )
164761
+ };
164762
+ var UpdateTagFieldSchema = Schema_exports.Struct(updateTagFields);
164763
+ var UPDATE_TAG_FIELDS = Object.keys(updateTagFields);
164764
+ var UpdateTagParamsSchema = Schema_exports.Struct({
164765
+ targetClass: TagTargetClass,
164766
+ tag: TagIdentifier.annotations({
164767
+ description: "Tag ID or exact title. Title lookup is scoped to targetClass."
164768
+ }),
164769
+ ...UpdateTagFieldSchema.fields
164770
+ }).annotations({
164771
+ title: "UpdateTagParams",
164772
+ description: `Update a generic Huly tag definition. ${atLeastOneUpdateFieldMessage(UPDATE_TAG_FIELDS)}`
164773
+ });
164774
+ var DeleteTagParamsSchema = Schema_exports.Struct({
164775
+ targetClass: TagTargetClass,
164776
+ tag: TagIdentifier.annotations({
164777
+ description: "Tag ID or exact title. Title lookup is scoped to targetClass."
164778
+ })
164779
+ }).annotations({
164780
+ title: "DeleteTagParams",
164781
+ description: "Delete a generic Huly tag definition."
164782
+ });
164783
+ var ListAttachedTagsParamsSchema = TagObjectLocatorSchema.annotations({
164784
+ title: "ListAttachedTagsParams",
164785
+ description: "List generic tag references attached to one raw Huly object."
164786
+ });
164787
+ var AttachTagParamsSchema = Schema_exports.Struct({
164788
+ targetClass: TagTargetClass,
164789
+ tag: TagIdentifier.annotations({
164790
+ description: "Tag ID or exact title within targetClass. If the title does not exist, attach_tag creates the tag definition first."
164791
+ }),
164792
+ object: TagObjectLocatorSchema,
164793
+ color: Schema_exports.optional(
164794
+ ColorCode.annotations({
164795
+ description: "Non-negative Huly platform color index for a newly created tag definition (default: 0). Ignored when the tag already exists."
164796
+ })
164797
+ ),
164798
+ category: Schema_exports.optional(
164799
+ TagCategoryIdentifier.annotations({
164800
+ description: "Category for a newly created tag definition. Ignored when the tag already exists."
164801
+ })
164802
+ ),
164803
+ weight: Schema_exports.optional(TagWeight.annotations({
164804
+ description: "Optional weight/knowledge level to store on the TagReference."
164805
+ }))
164806
+ }).annotations({
164807
+ title: "AttachTagParams",
164808
+ description: "Attach a generic Huly tag to a raw object collection. Idempotent for the same object, collection, and tag."
164809
+ });
164810
+ var DetachTagParamsSchema = Schema_exports.Struct({
164811
+ targetClass: TagTargetClass,
164812
+ tag: TagIdentifier.annotations({
164813
+ description: "Tag ID or exact title within targetClass."
164814
+ }),
164815
+ object: TagObjectLocatorSchema
164816
+ }).annotations({
164817
+ title: "DetachTagParams",
164818
+ description: "Detach a generic Huly tag from a raw object collection. Idempotent when the tag is not attached."
164819
+ });
164820
+ var CreateTagResultSchema = Schema_exports.Struct({
164821
+ id: TagElementId,
164822
+ title: NonEmptyString2,
164823
+ targetClass: TagTargetClass,
164824
+ created: Schema_exports.Boolean
164825
+ }).annotations({
164826
+ title: "CreateTagResult",
164827
+ description: "Result of creating a generic Huly tag definition."
164828
+ });
164829
+ var UpdateTagResultSchema = Schema_exports.Struct({
164830
+ id: TagElementId,
164831
+ updated: Schema_exports.Boolean
164832
+ }).annotations({
164833
+ title: "UpdateTagResult",
164834
+ description: "Result of updating a generic Huly tag definition."
164835
+ });
164836
+ var DeleteTagResultSchema = Schema_exports.Struct({
164837
+ id: TagElementId,
164838
+ deleted: Schema_exports.Boolean
164839
+ }).annotations({
164840
+ title: "DeleteTagResult",
164841
+ description: "Result of deleting a generic Huly tag definition."
164842
+ });
164843
+ var AttachTagResultSchema = Schema_exports.Struct({
164844
+ id: TagReferenceId,
164845
+ tag: TagElementId,
164846
+ title: NonEmptyString2,
164847
+ attached: Schema_exports.Boolean
164848
+ }).annotations({
164849
+ title: "AttachTagResult",
164850
+ description: "Result of attaching a tag reference."
164851
+ });
164852
+ var DetachTagResultSchema = Schema_exports.Struct({
164853
+ detached: Schema_exports.Boolean,
164854
+ detachedCount: Schema_exports.Number
164855
+ }).annotations({
164856
+ title: "DetachTagResult",
164857
+ description: "Result of detaching tag references."
164858
+ });
164859
+ var listTagsParamsJsonSchema = JSONSchema_exports.make(ListTagsParamsSchema);
164860
+ var createTagParamsJsonSchema = JSONSchema_exports.make(CreateTagParamsSchema);
164861
+ var updateTagParamsJsonSchema = withAtLeastOneRequired(
164862
+ JSONSchema_exports.make(UpdateTagParamsSchema),
164863
+ UPDATE_TAG_FIELDS
164864
+ );
164865
+ var deleteTagParamsJsonSchema = JSONSchema_exports.make(DeleteTagParamsSchema);
164866
+ var listAttachedTagsParamsJsonSchema = JSONSchema_exports.make(ListAttachedTagsParamsSchema);
164867
+ var attachTagParamsJsonSchema = JSONSchema_exports.make(AttachTagParamsSchema);
164868
+ var detachTagParamsJsonSchema = JSONSchema_exports.make(DetachTagParamsSchema);
164869
+ var parseListTagsParams = Schema_exports.decodeUnknown(ListTagsParamsSchema);
164870
+ var parseCreateTagParams = Schema_exports.decodeUnknown(CreateTagParamsSchema);
164871
+ var parseUpdateTagParams = Schema_exports.decodeUnknown(UpdateTagParamsSchema);
164872
+ var parseDeleteTagParams = Schema_exports.decodeUnknown(DeleteTagParamsSchema);
164873
+ var parseListAttachedTagsParams = Schema_exports.decodeUnknown(ListAttachedTagsParamsSchema);
164874
+ var parseAttachTagParams = Schema_exports.decodeUnknown(AttachTagParamsSchema);
164875
+ var parseDetachTagParams = Schema_exports.decodeUnknown(DetachTagParamsSchema);
164876
+
164652
164877
  // src/domain/schemas/tag-categories.ts
164653
164878
  var TagCategorySummarySchema = Schema_exports.Struct({
164654
164879
  id: TagCategoryId,
@@ -164761,7 +164986,7 @@ var CreateLabelParamsSchema = Schema_exports.Struct({
164761
164986
  }),
164762
164987
  color: Schema_exports.optional(
164763
164988
  ColorCode.annotations({
164764
- description: "Color code (0-9, default: 0)"
164989
+ description: "Non-negative Huly platform color index (default: 0)"
164765
164990
  })
164766
164991
  ),
164767
164992
  description: Schema_exports.optional(Schema_exports.String.annotations({
@@ -164786,7 +165011,7 @@ var UpdateLabelParamsSchema = Schema_exports.Struct({
164786
165011
  })),
164787
165012
  color: Schema_exports.optional(
164788
165013
  ColorCode.annotations({
164789
- description: "New color code (0-9)"
165014
+ description: "New non-negative Huly platform color index"
164790
165015
  })
164791
165016
  ),
164792
165017
  description: Schema_exports.optional(Schema_exports.String.annotations({
@@ -168098,7 +168323,7 @@ var parseDeleteTestResultParams = Schema_exports.decodeUnknown(DeleteTestResultP
168098
168323
  var parseRunTestPlanParams = Schema_exports.decodeUnknown(RunTestPlanParamsSchema);
168099
168324
 
168100
168325
  // src/version.ts
168101
- var VERSION = true ? "0.18.2" : "0.0.0-dev";
168326
+ var VERSION = true ? "0.19.0" : "0.0.0-dev";
168102
168327
 
168103
168328
  // src/mcp/error-mapping.ts
168104
168329
  var McpErrorCode = {
@@ -174608,10 +174833,10 @@ var listIssueRelations = (params) => Effect_exports.gen(function* () {
174608
174833
  const blocks = blockingIssueCandidates.filter((candidate) => candidate._id !== issue2._id && hasRelationById(candidate.blockedBy, issue2._id)).map(toIssueEntry);
174609
174834
  const documents = [];
174610
174835
  if (docRelationsRefs.length > 0) {
174611
- const toDocRef = toRef;
174836
+ const toDocRef2 = toRef;
174612
174837
  const docs = yield* client.findAll(
174613
174838
  documentPlugin.class.Document,
174614
- hulyQuery({ _id: { $in: docRelationsRefs.map((r) => toDocRef(r._id)) } })
174839
+ hulyQuery({ _id: { $in: docRelationsRefs.map((r) => toDocRef2(r._id)) } })
174615
174840
  );
174616
174841
  const docMap = new Map(docs.map((d) => [String(d._id), d]));
174617
174842
  const spaceIds = [...new Set(docs.map((d) => d.space))];
@@ -174702,72 +174927,234 @@ var unlinkDocumentFromIssue = (params) => Effect_exports.gen(function* () {
174702
174927
  });
174703
174928
 
174704
174929
  // src/huly/operations/issue-templates.ts
174705
- var import_core30 = __toESM(require_lib4(), 1);
174930
+ var import_core31 = __toESM(require_lib4(), 1);
174706
174931
 
174707
174932
  // src/huly/operations/issues-move.ts
174708
- var import_core27 = __toESM(require_lib4(), 1);
174933
+ var import_core28 = __toESM(require_lib4(), 1);
174709
174934
  var import_tracker2 = __toESM(require_lib36(), 1);
174710
- var addLabel = (params) => Effect_exports.gen(function* () {
174711
- const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
174712
- const existingLabels = yield* client.findAll(
174713
- tags.class.TagReference,
174714
- {
174715
- attachedTo: issue2._id,
174716
- attachedToClass: tracker.class.Issue
174717
- }
174935
+
174936
+ // src/huly/operations/tags-shared.ts
174937
+ var import_core27 = __toESM(require_lib4(), 1);
174938
+ var toTargetClassRef = toRef;
174939
+ var toTagElementRef = toRef;
174940
+ var toTagCategoryRef = toRef;
174941
+ var toTagReferenceRef = toRef;
174942
+ var toSpaceRef = toRef;
174943
+ var toDocRef = toRef;
174944
+ var normalizeColorCode = (color) => ColorCode.make(Number.isFinite(color) ? Math.max(0, Math.trunc(color)) : 0);
174945
+ var toResolvedTagElement = (tag2, created) => ({
174946
+ id: tag2._id,
174947
+ title: tag2.title,
174948
+ targetClass: tag2.targetClass,
174949
+ description: tag2.description,
174950
+ color: tag2.color,
174951
+ category: tag2.category,
174952
+ refCount: tag2.refCount,
174953
+ created
174954
+ });
174955
+ var createdResolvedTagElement = (id, data) => ({
174956
+ id,
174957
+ title: data.title,
174958
+ targetClass: data.targetClass,
174959
+ description: data.description,
174960
+ color: data.color,
174961
+ category: data.category,
174962
+ created: true
174963
+ });
174964
+ var toAttachedTagSummary = (tagRef) => {
174965
+ const summary5 = {
174966
+ id: TagReferenceId.make(tagRef._id),
174967
+ tag: TagElementId.make(tagRef.tag),
174968
+ title: tagRef.title,
174969
+ color: normalizeColorCode(tagRef.color)
174970
+ };
174971
+ return tagRef.weight === void 0 ? summary5 : { ...summary5, weight: tagRef.weight };
174972
+ };
174973
+ var findTagElementByIdOrTitle = (client, targetClass, idOrTitle) => Effect_exports.gen(function* () {
174974
+ const targetClassRef = toTargetClassRef(targetClass);
174975
+ const byId = yield* client.findOne(
174976
+ tags.class.TagElement,
174977
+ hulyQuery({
174978
+ _id: toTagElementRef(idOrTitle),
174979
+ targetClass: targetClassRef
174980
+ })
174718
174981
  );
174719
- const labelTitle = params.label.trim();
174720
- const labelExists = existingLabels.some(
174721
- (l) => l.title.toLowerCase() === labelTitle.toLowerCase()
174982
+ if (byId !== void 0) return byId;
174983
+ return yield* client.findOne(
174984
+ tags.class.TagElement,
174985
+ hulyQuery({
174986
+ title: idOrTitle,
174987
+ targetClass: targetClassRef
174988
+ })
174722
174989
  );
174723
- if (labelExists) {
174724
- return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: false };
174990
+ });
174991
+ var findTagElementOrFail = (client, targetClass, idOrTitle) => Effect_exports.gen(function* () {
174992
+ const tag2 = yield* findTagElementByIdOrTitle(client, targetClass, idOrTitle);
174993
+ if (tag2 === void 0) {
174994
+ return yield* new TagNotFoundError({ identifier: idOrTitle });
174725
174995
  }
174726
- const color = params.color ?? 0;
174727
- let tagElement = yield* client.findOne(
174728
- tags.class.TagElement,
174729
- {
174730
- title: labelTitle,
174731
- targetClass: toRef(tracker.class.Issue)
174732
- }
174996
+ return tag2;
174997
+ });
174998
+ var findDefaultCategory = (client, targetClass) => client.findOne(
174999
+ tags.class.TagCategory,
175000
+ hulyQuery({
175001
+ targetClass: toTargetClassRef(targetClass),
175002
+ default: true
175003
+ })
175004
+ );
175005
+ var findTagCategoryByIdOrLabelForTarget = (client, targetClass, idOrLabel) => Effect_exports.gen(function* () {
175006
+ const targetClassRef = toTargetClassRef(targetClass);
175007
+ const byId = yield* client.findOne(
175008
+ tags.class.TagCategory,
175009
+ hulyQuery({
175010
+ _id: toTagCategoryRef(idOrLabel),
175011
+ targetClass: targetClassRef
175012
+ })
174733
175013
  );
174734
- if (tagElement === void 0) {
174735
- const tagElementId = (0, import_core27.generateId)();
174736
- const tagElementData = {
174737
- title: labelTitle,
174738
- description: "",
174739
- targetClass: toRef(tracker.class.Issue),
174740
- color,
174741
- category: tracker.category.Other
174742
- };
174743
- yield* client.createDoc(
174744
- tags.class.TagElement,
174745
- toRef(core.space.Workspace),
174746
- tagElementData,
174747
- tagElementId
174748
- );
174749
- tagElement = yield* client.findOne(
174750
- tags.class.TagElement,
174751
- { _id: tagElementId }
174752
- );
175014
+ if (byId !== void 0) return byId;
175015
+ return yield* client.findOne(
175016
+ tags.class.TagCategory,
175017
+ hulyQuery({
175018
+ label: idOrLabel,
175019
+ targetClass: targetClassRef
175020
+ })
175021
+ );
175022
+ });
175023
+ var resolveTagCategoryRef = (client, targetClass, category, fallbackCategory) => Effect_exports.gen(function* () {
175024
+ if (category !== void 0) {
175025
+ const resolved = yield* findTagCategoryByIdOrLabelForTarget(client, targetClass, category);
175026
+ if (resolved === void 0) {
175027
+ return yield* new TagCategoryNotFoundError({ identifier: category });
175028
+ }
175029
+ return resolved._id;
174753
175030
  }
174754
- if (tagElement === void 0) {
174755
- return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: false };
175031
+ const defaultCategory = yield* findDefaultCategory(client, targetClass);
175032
+ return defaultCategory?._id ?? fallbackCategory ?? tags.category.NoCategory;
175033
+ });
175034
+ var ensureTagElement = (params) => Effect_exports.gen(function* () {
175035
+ const client = yield* HulyClient;
175036
+ const targetClassRef = toTargetClassRef(params.targetClass);
175037
+ const existing = yield* findTagElementByIdOrTitle(client, params.targetClass, params.titleOrId);
175038
+ if (existing !== void 0) {
175039
+ return toResolvedTagElement(existing, false);
174756
175040
  }
174757
- const tagRefData = {
174758
- title: tagElement.title,
174759
- color: tagElement.color,
174760
- tag: tagElement._id
175041
+ const category = yield* resolveTagCategoryRef(client, params.targetClass, params.category, params.fallbackCategory);
175042
+ const tagId = (0, import_core27.generateId)();
175043
+ const tagData = {
175044
+ title: params.titleOrId,
175045
+ description: params.description ?? "",
175046
+ targetClass: targetClassRef,
175047
+ color: params.color ?? 0,
175048
+ category
174761
175049
  };
174762
- yield* client.addCollection(
175050
+ yield* client.createDoc(
175051
+ tags.class.TagElement,
175052
+ toRef(core.space.Workspace),
175053
+ tagData,
175054
+ tagId
175055
+ );
175056
+ return createdResolvedTagElement(tagId, tagData);
175057
+ });
175058
+ var listTagReferencesForObject = (client, params) => Effect_exports.gen(function* () {
175059
+ const query = {
175060
+ attachedTo: toDocRef(params.objectId),
175061
+ attachedToClass: toTargetClassRef(params.objectClass),
175062
+ space: toSpaceRef(params.space),
175063
+ collection: params.collection
175064
+ };
175065
+ return yield* client.findAll(
174763
175066
  tags.class.TagReference,
174764
- project3._id,
174765
- issue2._id,
174766
- tracker.class.Issue,
174767
- "labels",
174768
- tagRefData
175067
+ hulyQuery(query),
175068
+ { sort: { modifiedOn: import_core27.SortingOrder.Descending } }
174769
175069
  );
174770
- return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: true };
175070
+ });
175071
+ var attachTagReference = (params) => Effect_exports.gen(function* () {
175072
+ const client = yield* HulyClient;
175073
+ const existingRefs = yield* listTagReferencesForObject(client, {
175074
+ objectId: params.objectId,
175075
+ objectClass: params.objectClass,
175076
+ space: params.space,
175077
+ collection: params.collection
175078
+ });
175079
+ const tagTitle = params.tag.title.trim().toLowerCase();
175080
+ const existing = existingRefs.find(
175081
+ (tagRef) => tagRef.tag === params.tag.id || params.matchTitleCaseInsensitive === true && tagRef.title.trim().toLowerCase() === tagTitle
175082
+ );
175083
+ if (existing !== void 0) {
175084
+ return {
175085
+ id: TagReferenceId.make(existing._id),
175086
+ tag: TagElementId.make(params.tag.id),
175087
+ title: existing.title,
175088
+ attached: false
175089
+ };
175090
+ }
175091
+ const attributes = params.weight === void 0 ? {
175092
+ title: params.tag.title,
175093
+ color: params.tag.color,
175094
+ tag: params.tag.id
175095
+ } : {
175096
+ title: params.tag.title,
175097
+ color: params.tag.color,
175098
+ tag: params.tag.id,
175099
+ weight: params.weight
175100
+ };
175101
+ const tagReferenceId = yield* client.addCollection(
175102
+ tags.class.TagReference,
175103
+ toSpaceRef(params.space),
175104
+ toDocRef(params.objectId),
175105
+ toTargetClassRef(params.objectClass),
175106
+ params.collection,
175107
+ attributes
175108
+ );
175109
+ return {
175110
+ id: TagReferenceId.make(tagReferenceId),
175111
+ tag: TagElementId.make(params.tag.id),
175112
+ title: params.tag.title,
175113
+ attached: true
175114
+ };
175115
+ });
175116
+ var detachTagReference = (params) => Effect_exports.gen(function* () {
175117
+ const client = yield* HulyClient;
175118
+ const existingRefs = yield* listTagReferencesForObject(client, {
175119
+ objectId: params.objectId,
175120
+ objectClass: params.objectClass,
175121
+ space: params.space,
175122
+ collection: params.collection
175123
+ });
175124
+ const matchingRefs = existingRefs.filter((tagRef) => tagRef.tag === params.tag.id);
175125
+ for (const tagRef of matchingRefs) {
175126
+ yield* client.removeDoc(
175127
+ tags.class.TagReference,
175128
+ toSpaceRef(params.space),
175129
+ toTagReferenceRef(tagRef._id)
175130
+ );
175131
+ }
175132
+ return {
175133
+ detached: matchingRefs.length > 0,
175134
+ detachedCount: matchingRefs.length
175135
+ };
175136
+ });
175137
+
175138
+ // src/huly/operations/issues-move.ts
175139
+ var issueTargetClass = TagTargetClass.make(String(tracker.class.Issue));
175140
+ var addLabel = (params) => Effect_exports.gen(function* () {
175141
+ const { issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
175142
+ const labelTitle = params.label.trim();
175143
+ const tag2 = yield* ensureTagElement({
175144
+ targetClass: issueTargetClass,
175145
+ titleOrId: labelTitle,
175146
+ color: params.color,
175147
+ fallbackCategory: tracker.category.Other
175148
+ });
175149
+ const result = yield* attachTagReference({
175150
+ tag: tag2,
175151
+ objectId: issue2._id,
175152
+ objectClass: tracker.class.Issue,
175153
+ space: project3._id,
175154
+ collection: "labels",
175155
+ matchTitleCaseInsensitive: true
175156
+ });
175157
+ return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: result.attached };
174771
175158
  });
174772
175159
  var moveIssue = (params) => Effect_exports.gen(function* () {
174773
175160
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
@@ -174865,7 +175252,7 @@ var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) =
174865
175252
  });
174866
175253
 
174867
175254
  // src/huly/operations/issues-read.ts
174868
- var import_core28 = __toESM(require_lib4(), 1);
175255
+ var import_core29 = __toESM(require_lib4(), 1);
174869
175256
  var import_tracker3 = __toESM(require_lib36(), 1);
174870
175257
  var resolveStatusName = (statuses, statusId) => {
174871
175258
  const statusDoc = statuses.find((s) => s._id === statusId);
@@ -174950,7 +175337,7 @@ var listIssues = (params) => Effect_exports.gen(function* () {
174950
175337
  {
174951
175338
  limit,
174952
175339
  sort: {
174953
- modifiedOn: import_core28.SortingOrder.Descending
175340
+ modifiedOn: import_core29.SortingOrder.Descending
174954
175341
  }
174955
175342
  },
174956
175343
  { assignee: contact.class.Person }
@@ -175032,7 +175419,7 @@ var getIssue = (params) => Effect_exports.gen(function* () {
175032
175419
  });
175033
175420
 
175034
175421
  // src/huly/operations/issues-write.ts
175035
- var import_core29 = __toESM(require_lib4(), 1);
175422
+ var import_core30 = __toESM(require_lib4(), 1);
175036
175423
  var import_rank3 = __toESM(require_lib33(), 1);
175037
175424
  var import_tracker4 = __toESM(require_lib36(), 1);
175038
175425
  var TxIncResult = Schema_exports.Struct({
@@ -175129,7 +175516,7 @@ var chooseStatusForTaskType = (workflow, requestedStatus, currentStatus, project
175129
175516
  };
175130
175517
  var createIssue = (params) => Effect_exports.gen(function* () {
175131
175518
  const { client, defaultStatusId, project: project3, projectType, statuses } = yield* findProjectWithStatuses(params.project);
175132
- const issueId = (0, import_core29.generateId)();
175519
+ const issueId = (0, import_core30.generateId)();
175133
175520
  const taskTypeWorkflow = params.taskType === void 0 ? void 0 : yield* resolveTaskTypeWorkflow(client, project3, projectType, statuses, params.taskType, params.project);
175134
175521
  const taskTypeStatusRef = taskTypeWorkflow === void 0 ? void 0 : yield* chooseStatusForTaskType(taskTypeWorkflow, params.status, void 0, params.project);
175135
175522
  const statusRef = taskTypeStatusRef !== void 0 ? taskTypeStatusRef : params.status !== void 0 ? yield* resolveStatusByName(statuses, params.status, params.project) : defaultStatusId !== void 0 ? defaultStatusId : yield* Effect_exports.fail(new InvalidStatusError({ status: "(default)", project: params.project }));
@@ -175169,7 +175556,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
175169
175556
  const lastIssue = yield* client.findOne(
175170
175557
  tracker.class.Issue,
175171
175558
  hulyQuery({ space: project3._id }),
175172
- { sort: { rank: import_core29.SortingOrder.Descending } }
175559
+ { sort: { rank: import_core30.SortingOrder.Descending } }
175173
175560
  );
175174
175561
  const rank = (0, import_rank3.makeRank)(lastIssue?.rank, void 0);
175175
175562
  const descriptionMarkupRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
@@ -175367,7 +175754,7 @@ var buildTemplateChild = (client, markupUrlConfig, projectId, projectIdentifier,
175367
175754
  return component._id;
175368
175755
  }) : null;
175369
175756
  return {
175370
- id: (0, import_core30.generateId)(),
175757
+ id: (0, import_core31.generateId)(),
175371
175758
  title: input.title,
175372
175759
  description: optionalMarkdownToMarkup(input.description, markupUrlConfig, ""),
175373
175760
  priority: stringToPriority(input.priority || "no-priority"),
@@ -175384,7 +175771,7 @@ var listIssueTemplates = (params) => Effect_exports.gen(function* () {
175384
175771
  { space: project3._id },
175385
175772
  {
175386
175773
  limit,
175387
- sort: { modifiedOn: import_core30.SortingOrder.Descending }
175774
+ sort: { modifiedOn: import_core31.SortingOrder.Descending }
175388
175775
  }
175389
175776
  );
175390
175777
  const summaries = templates.map((t) => {
@@ -175430,7 +175817,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
175430
175817
  var createIssueTemplate = (params) => Effect_exports.gen(function* () {
175431
175818
  const { client, project: project3 } = yield* findProject(params.project);
175432
175819
  const markupUrlConfig = client.markupUrlConfig;
175433
- const templateId = (0, import_core30.generateId)();
175820
+ const templateId = (0, import_core31.generateId)();
175434
175821
  const assigneeParam = params.assignee;
175435
175822
  const assigneeRef = assigneeParam !== void 0 ? yield* Effect_exports.gen(function* () {
175436
175823
  const person = yield* findPersonByEmailOrName(client, assigneeParam);
@@ -175664,236 +176051,164 @@ var removeTemplateChild = (params) => Effect_exports.gen(function* () {
175664
176051
  };
175665
176052
  });
175666
176053
 
175667
- // src/huly/operations/labels.ts
176054
+ // src/huly/operations/tags.ts
175668
176055
  var import_core32 = __toESM(require_lib4(), 1);
175669
-
175670
- // src/huly/operations/tag-categories.ts
175671
- var import_core31 = __toESM(require_lib4(), 1);
175672
- var issueClassRef = toRef(tracker.class.Issue);
175673
- var findCategoryByIdOrLabel = (client, idOrLabel) => Effect_exports.gen(function* () {
175674
- const cat = (yield* client.findOne(
175675
- tags.class.TagCategory,
175676
- { _id: toRef(idOrLabel) }
175677
- )) ?? (yield* client.findOne(
175678
- tags.class.TagCategory,
175679
- { label: idOrLabel }
175680
- ));
175681
- return cat;
175682
- });
175683
- var findCategoryOrFail = (client, idOrLabel) => Effect_exports.gen(function* () {
175684
- const cat = yield* findCategoryByIdOrLabel(client, idOrLabel);
175685
- if (cat === void 0) {
175686
- return yield* new TagCategoryNotFoundError({ identifier: idOrLabel });
175687
- }
175688
- return cat;
175689
- });
175690
- var toSummary = (c) => ({
175691
- id: TagCategoryId.make(c._id),
175692
- label: c.label,
175693
- targetClass: c.targetClass,
175694
- default: c.default,
175695
- tags: c.tags
176056
+ var toTagSummary = (tag2) => {
176057
+ const summary5 = {
176058
+ id: TagElementId.make(tag2._id),
176059
+ title: tag2.title,
176060
+ targetClass: TagTargetClass.make(String(tag2.targetClass)),
176061
+ description: tag2.description,
176062
+ color: normalizeColorCode(tag2.color),
176063
+ category: tag2.category
176064
+ };
176065
+ return tag2.refCount === void 0 ? summary5 : { ...summary5, refCount: tag2.refCount };
176066
+ };
176067
+ var buildUpdateTagOperations = (client, params) => Effect_exports.gen(function* () {
176068
+ const updateEntries = {
176069
+ category: params.category === void 0 ? {} : { category: yield* resolveTagCategoryRef(client, params.targetClass, params.category) },
176070
+ color: params.color === void 0 ? {} : { color: params.color },
176071
+ description: params.description === void 0 ? {} : { description: params.description },
176072
+ title: params.title === void 0 ? {} : { title: params.title }
176073
+ };
176074
+ return Object.assign({}, ...Object.values(updateEntries));
175696
176075
  });
175697
- var listTagCategories = (params) => Effect_exports.gen(function* () {
176076
+ var listTags = (params) => Effect_exports.gen(function* () {
175698
176077
  const client = yield* HulyClient;
175699
176078
  const limit = clampLimit(params.limit);
175700
- const query = {};
175701
- if (params.targetClass !== void 0) {
175702
- query.targetClass = toRef(params.targetClass);
175703
- }
175704
- const categories = yield* client.findAll(
175705
- tags.class.TagCategory,
175706
- query,
176079
+ const categoryFilter = params.category === void 0 ? {} : { category: yield* resolveTagCategoryRef(client, params.targetClass, params.category) };
176080
+ const titleSearch = params.titleSearch?.trim() ?? "";
176081
+ const titleFilter = titleSearch === "" ? {} : { title: { $like: `%${escapeLikeWildcards(titleSearch)}%` } };
176082
+ const query = {
176083
+ targetClass: toTargetClassRef(params.targetClass),
176084
+ ...categoryFilter,
176085
+ ...titleFilter
176086
+ };
176087
+ const elements = yield* client.findAll(
176088
+ tags.class.TagElement,
176089
+ hulyQuery(query),
175707
176090
  {
175708
176091
  limit,
175709
- sort: { modifiedOn: import_core31.SortingOrder.Descending }
176092
+ sort: { modifiedOn: import_core32.SortingOrder.Descending }
175710
176093
  }
175711
176094
  );
175712
- return categories.map(toSummary);
176095
+ return elements.map(toTagSummary);
175713
176096
  });
175714
- var createTagCategory = (params) => Effect_exports.gen(function* () {
175715
- const client = yield* HulyClient;
175716
- const targetClass = params.targetClass !== void 0 ? toRef(params.targetClass) : issueClassRef;
175717
- const existing = yield* client.findOne(
175718
- tags.class.TagCategory,
175719
- { label: params.label, targetClass }
175720
- );
175721
- if (existing !== void 0) {
175722
- return { id: TagCategoryId.make(existing._id), label: existing.label, created: false };
175723
- }
175724
- const catId = (0, import_core31.generateId)();
175725
- const catData = {
175726
- // Asset is a branded string type (Metadata<URL>) with no runtime constructor.
175727
- // Empty string is the "no icon" sentinel; Huly UI renders a default icon.
175728
- // Verified: Huly accepts "" without error (tested against v0.7.353).
175729
- // eslint-disable-next-line no-restricted-syntax -- see above
175730
- icon: "",
175731
- label: params.label,
175732
- targetClass,
175733
- // Huly does NOT auto-populate tags[] when TagElements reference this category.
175734
- // To find labels in a category, query TagElements by their `category` field instead.
175735
- tags: [],
175736
- default: params.default ?? false
176097
+ var createTag = (params) => Effect_exports.gen(function* () {
176098
+ const tag2 = yield* ensureTagElement({
176099
+ targetClass: params.targetClass,
176100
+ titleOrId: params.title,
176101
+ color: params.color,
176102
+ description: params.description,
176103
+ category: params.category
176104
+ });
176105
+ return {
176106
+ id: TagElementId.make(tag2.id),
176107
+ title: tag2.title,
176108
+ targetClass: TagTargetClass.make(String(tag2.targetClass)),
176109
+ created: tag2.created
175737
176110
  };
175738
- yield* client.createDoc(
175739
- tags.class.TagCategory,
175740
- toRef(core.space.Workspace),
175741
- catData,
175742
- catId
175743
- );
175744
- return { id: TagCategoryId.make(catId), label: params.label, created: true };
175745
176111
  });
175746
- var updateTagCategory = (params) => Effect_exports.gen(function* () {
175747
- yield* requireUpdateFields("update_tag_category", params, UPDATE_TAG_CATEGORY_FIELDS);
176112
+ var updateTag = (params) => Effect_exports.gen(function* () {
176113
+ yield* requireUpdateFields("update_tag", params, UPDATE_TAG_FIELDS);
175748
176114
  const client = yield* HulyClient;
175749
- const cat = yield* findCategoryOrFail(client, params.category);
175750
- const updateOps = {};
175751
- if (params.label !== void 0) {
175752
- updateOps.label = params.label;
175753
- }
175754
- if (params.default !== void 0) {
175755
- updateOps.default = params.default;
175756
- }
176115
+ const tag2 = yield* findTagElementOrFail(client, params.targetClass, params.tag);
176116
+ const updateOps = yield* buildUpdateTagOperations(client, params);
175757
176117
  yield* client.updateDoc(
175758
- tags.class.TagCategory,
176118
+ tags.class.TagElement,
175759
176119
  toRef(core.space.Workspace),
175760
- cat._id,
176120
+ tag2._id,
175761
176121
  updateOps
175762
176122
  );
175763
- return { id: TagCategoryId.make(cat._id), updated: true };
176123
+ return { id: TagElementId.make(tag2._id), updated: true };
175764
176124
  });
175765
- var deleteTagCategory = (params) => Effect_exports.gen(function* () {
176125
+ var deleteTag = (params) => Effect_exports.gen(function* () {
175766
176126
  const client = yield* HulyClient;
175767
- const cat = yield* findCategoryOrFail(client, params.category);
176127
+ const tag2 = yield* findTagElementOrFail(client, params.targetClass, params.tag);
175768
176128
  yield* client.removeDoc(
175769
- tags.class.TagCategory,
176129
+ tags.class.TagElement,
175770
176130
  toRef(core.space.Workspace),
175771
- cat._id
176131
+ tag2._id
175772
176132
  );
175773
- return { id: TagCategoryId.make(cat._id), deleted: true };
175774
- });
175775
-
175776
- // src/huly/operations/labels.ts
175777
- var issueClassRef2 = toRef(tracker.class.Issue);
175778
- var findTagByIdOrTitle = (client, idOrTitle) => Effect_exports.gen(function* () {
175779
- const tag2 = (yield* client.findOne(
175780
- tags.class.TagElement,
175781
- hulyQuery({
175782
- _id: toRef(idOrTitle),
175783
- targetClass: issueClassRef2
175784
- })
175785
- )) ?? (yield* client.findOne(
175786
- tags.class.TagElement,
175787
- hulyQuery({
175788
- title: idOrTitle,
175789
- targetClass: issueClassRef2
175790
- })
175791
- ));
175792
- return tag2;
176133
+ return { id: TagElementId.make(tag2._id), deleted: true };
175793
176134
  });
175794
- var findTagOrFail = (client, idOrTitle) => Effect_exports.gen(function* () {
175795
- const tag2 = yield* findTagByIdOrTitle(client, idOrTitle);
175796
- if (tag2 === void 0) {
175797
- return yield* new TagNotFoundError({ identifier: idOrTitle });
175798
- }
175799
- return tag2;
176135
+ var listAttachedTags = (params) => Effect_exports.gen(function* () {
176136
+ const client = yield* HulyClient;
176137
+ const tagRefs = yield* listTagReferencesForObject(client, params);
176138
+ return tagRefs.map(toAttachedTagSummary);
176139
+ });
176140
+ var attachTag = (params) => Effect_exports.gen(function* () {
176141
+ const tag2 = yield* ensureTagElement({
176142
+ targetClass: params.targetClass,
176143
+ titleOrId: params.tag,
176144
+ color: params.color,
176145
+ category: params.category
176146
+ });
176147
+ return yield* attachTagReference({
176148
+ tag: tag2,
176149
+ objectId: params.object.objectId,
176150
+ objectClass: params.object.objectClass,
176151
+ space: params.object.space,
176152
+ collection: params.object.collection,
176153
+ weight: params.weight
176154
+ });
175800
176155
  });
175801
- var resolveCategoryRef = (client, categoryIdOrLabel) => Effect_exports.gen(function* () {
175802
- if (categoryIdOrLabel === void 0) return void 0;
175803
- const cat = yield* findCategoryByIdOrLabel(client, categoryIdOrLabel);
175804
- if (cat === void 0) {
175805
- return yield* new TagCategoryNotFoundError({ identifier: categoryIdOrLabel });
175806
- }
175807
- return cat._id;
176156
+ var detachTag = (params) => Effect_exports.gen(function* () {
176157
+ const client = yield* HulyClient;
176158
+ const tag2 = toResolvedTagElement(yield* findTagElementOrFail(client, params.targetClass, params.tag), false);
176159
+ return yield* detachTagReference({
176160
+ tag: tag2,
176161
+ objectId: params.object.objectId,
176162
+ objectClass: params.object.objectClass,
176163
+ space: params.object.space,
176164
+ collection: params.object.collection
176165
+ });
175808
176166
  });
176167
+
176168
+ // src/huly/operations/labels.ts
176169
+ var issueClassRef = toRef(tracker.class.Issue);
176170
+ var issueTargetClass2 = TagTargetClass.make(String(issueClassRef));
175809
176171
  var listLabels = (params) => Effect_exports.gen(function* () {
175810
- const client = yield* HulyClient;
175811
- const limit = clampLimit(params.limit);
175812
- const query = { targetClass: issueClassRef2 };
175813
- if (params.category !== void 0) {
175814
- const catRef = yield* resolveCategoryRef(client, params.category);
175815
- if (catRef !== void 0) {
175816
- query.category = catRef;
175817
- }
175818
- }
175819
- const elements = yield* client.findAll(
175820
- tags.class.TagElement,
175821
- hulyQuery(query),
175822
- {
175823
- limit,
175824
- sort: { modifiedOn: import_core32.SortingOrder.Descending }
175825
- }
175826
- );
175827
- return elements.map((e) => ({
175828
- id: TagElementId.make(e._id),
176172
+ const result = yield* listTags({
176173
+ targetClass: issueTargetClass2,
176174
+ category: params.category,
176175
+ limit: params.limit
176176
+ });
176177
+ return result.map((e) => ({
176178
+ id: e.id,
175829
176179
  title: e.title,
175830
- // Clamp to valid range — Huly API may return out-of-range color values
175831
- color: ColorCode.make(Math.max(0, Math.min(9, Math.trunc(e.color)))),
175832
- // eslint-disable-line no-magic-numbers
176180
+ color: e.color,
175833
176181
  category: e.category
175834
176182
  }));
175835
176183
  });
175836
176184
  var createLabel = (params) => Effect_exports.gen(function* () {
175837
- const client = yield* HulyClient;
175838
- const existing = yield* client.findOne(
175839
- tags.class.TagElement,
175840
- hulyQuery({
175841
- title: params.title,
175842
- targetClass: issueClassRef2
175843
- })
175844
- );
175845
- if (existing !== void 0) {
175846
- return { id: TagElementId.make(existing._id), title: existing.title, created: false };
175847
- }
175848
- const categoryRef = yield* resolveCategoryRef(client, params.category);
175849
- const tagId = (0, import_core32.generateId)();
175850
- const color = params.color ?? 0;
175851
- const tagData = {
175852
- title: params.title,
175853
- description: params.description ?? "",
175854
- targetClass: issueClassRef2,
175855
- color,
175856
- category: categoryRef ?? tracker.category.Other
175857
- };
175858
- yield* client.createDoc(
175859
- tags.class.TagElement,
175860
- toRef(core.space.Workspace),
175861
- tagData,
175862
- tagId
175863
- );
175864
- return { id: TagElementId.make(tagId), title: params.title, created: true };
176185
+ const result = yield* ensureTagElement({
176186
+ targetClass: issueTargetClass2,
176187
+ titleOrId: params.title,
176188
+ color: params.color,
176189
+ description: params.description,
176190
+ category: params.category,
176191
+ fallbackCategory: tracker.category.Other
176192
+ });
176193
+ return { id: TagElementId.make(result.id), title: result.title, created: result.created };
175865
176194
  });
175866
176195
  var updateLabel = (params) => Effect_exports.gen(function* () {
175867
176196
  yield* requireUpdateFields("update_label", params, UPDATE_LABEL_FIELDS);
175868
- const client = yield* HulyClient;
175869
- const tag2 = yield* findTagOrFail(client, params.label);
175870
- const updateOps = {};
175871
- if (params.title !== void 0) {
175872
- updateOps.title = params.title;
175873
- }
175874
- if (params.color !== void 0) {
175875
- updateOps.color = params.color;
175876
- }
175877
- if (params.description !== void 0) {
175878
- updateOps.description = params.description;
175879
- }
175880
- yield* client.updateDoc(
175881
- tags.class.TagElement,
175882
- toRef(core.space.Workspace),
175883
- tag2._id,
175884
- updateOps
175885
- );
175886
- return { id: TagElementId.make(tag2._id), updated: true };
176197
+ const result = yield* updateTag({
176198
+ targetClass: issueTargetClass2,
176199
+ tag: params.label,
176200
+ title: params.title,
176201
+ color: params.color,
176202
+ description: params.description
176203
+ });
176204
+ return { id: result.id, updated: result.updated };
175887
176205
  });
175888
176206
  var deleteLabel = (params) => Effect_exports.gen(function* () {
175889
- const client = yield* HulyClient;
175890
- const tag2 = yield* findTagOrFail(client, params.label);
175891
- yield* client.removeDoc(
175892
- tags.class.TagElement,
175893
- toRef(core.space.Workspace),
175894
- tag2._id
175895
- );
175896
- return { id: TagElementId.make(tag2._id), deleted: true };
176207
+ const result = yield* deleteTag({
176208
+ targetClass: issueTargetClass2,
176209
+ tag: params.label
176210
+ });
176211
+ return { id: result.id, deleted: result.deleted };
175897
176212
  });
175898
176213
  var removeIssueLabel = (params) => Effect_exports.gen(function* () {
175899
176214
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
@@ -177910,6 +178225,112 @@ var storageTools = [
177910
178225
  }
177911
178226
  ];
177912
178227
 
178228
+ // src/huly/operations/tag-categories.ts
178229
+ var import_core38 = __toESM(require_lib4(), 1);
178230
+ var issueClassRef2 = toRef(tracker.class.Issue);
178231
+ var findCategoryByIdOrLabel = (client, idOrLabel) => Effect_exports.gen(function* () {
178232
+ const cat = (yield* client.findOne(
178233
+ tags.class.TagCategory,
178234
+ { _id: toRef(idOrLabel) }
178235
+ )) ?? (yield* client.findOne(
178236
+ tags.class.TagCategory,
178237
+ { label: idOrLabel }
178238
+ ));
178239
+ return cat;
178240
+ });
178241
+ var findCategoryOrFail = (client, idOrLabel) => Effect_exports.gen(function* () {
178242
+ const cat = yield* findCategoryByIdOrLabel(client, idOrLabel);
178243
+ if (cat === void 0) {
178244
+ return yield* new TagCategoryNotFoundError({ identifier: idOrLabel });
178245
+ }
178246
+ return cat;
178247
+ });
178248
+ var toSummary = (c) => ({
178249
+ id: TagCategoryId.make(c._id),
178250
+ label: c.label,
178251
+ targetClass: c.targetClass,
178252
+ default: c.default,
178253
+ tags: c.tags
178254
+ });
178255
+ var listTagCategories = (params) => Effect_exports.gen(function* () {
178256
+ const client = yield* HulyClient;
178257
+ const limit = clampLimit(params.limit);
178258
+ const query = {};
178259
+ if (params.targetClass !== void 0) {
178260
+ query.targetClass = toRef(params.targetClass);
178261
+ }
178262
+ const categories = yield* client.findAll(
178263
+ tags.class.TagCategory,
178264
+ query,
178265
+ {
178266
+ limit,
178267
+ sort: { modifiedOn: import_core38.SortingOrder.Descending }
178268
+ }
178269
+ );
178270
+ return categories.map(toSummary);
178271
+ });
178272
+ var createTagCategory = (params) => Effect_exports.gen(function* () {
178273
+ const client = yield* HulyClient;
178274
+ const targetClass = params.targetClass !== void 0 ? toRef(params.targetClass) : issueClassRef2;
178275
+ const existing = yield* client.findOne(
178276
+ tags.class.TagCategory,
178277
+ { label: params.label, targetClass }
178278
+ );
178279
+ if (existing !== void 0) {
178280
+ return { id: TagCategoryId.make(existing._id), label: existing.label, created: false };
178281
+ }
178282
+ const catId = (0, import_core38.generateId)();
178283
+ const catData = {
178284
+ // Asset is a branded string type (Metadata<URL>) with no runtime constructor.
178285
+ // Empty string is the "no icon" sentinel; Huly UI renders a default icon.
178286
+ // Verified: Huly accepts "" without error (tested against v0.7.353).
178287
+ // eslint-disable-next-line no-restricted-syntax -- see above
178288
+ icon: "",
178289
+ label: params.label,
178290
+ targetClass,
178291
+ // Huly does NOT auto-populate tags[] when TagElements reference this category.
178292
+ // To find labels in a category, query TagElements by their `category` field instead.
178293
+ tags: [],
178294
+ default: params.default ?? false
178295
+ };
178296
+ yield* client.createDoc(
178297
+ tags.class.TagCategory,
178298
+ toRef(core.space.Workspace),
178299
+ catData,
178300
+ catId
178301
+ );
178302
+ return { id: TagCategoryId.make(catId), label: params.label, created: true };
178303
+ });
178304
+ var updateTagCategory = (params) => Effect_exports.gen(function* () {
178305
+ yield* requireUpdateFields("update_tag_category", params, UPDATE_TAG_CATEGORY_FIELDS);
178306
+ const client = yield* HulyClient;
178307
+ const cat = yield* findCategoryOrFail(client, params.category);
178308
+ const updateOps = {};
178309
+ if (params.label !== void 0) {
178310
+ updateOps.label = params.label;
178311
+ }
178312
+ if (params.default !== void 0) {
178313
+ updateOps.default = params.default;
178314
+ }
178315
+ yield* client.updateDoc(
178316
+ tags.class.TagCategory,
178317
+ toRef(core.space.Workspace),
178318
+ cat._id,
178319
+ updateOps
178320
+ );
178321
+ return { id: TagCategoryId.make(cat._id), updated: true };
178322
+ });
178323
+ var deleteTagCategory = (params) => Effect_exports.gen(function* () {
178324
+ const client = yield* HulyClient;
178325
+ const cat = yield* findCategoryOrFail(client, params.category);
178326
+ yield* client.removeDoc(
178327
+ tags.class.TagCategory,
178328
+ toRef(core.space.Workspace),
178329
+ cat._id
178330
+ );
178331
+ return { id: TagCategoryId.make(cat._id), deleted: true };
178332
+ });
178333
+
177913
178334
  // src/mcp/tools/tag-categories.ts
177914
178335
  var CATEGORY21 = "tag-categories";
177915
178336
  var tagCategoryTools = [
@@ -177959,8 +178380,97 @@ var tagCategoryTools = [
177959
178380
  }
177960
178381
  ];
177961
178382
 
178383
+ // src/mcp/tools/tags.ts
178384
+ var CATEGORY22 = "tags";
178385
+ var tagTools = [
178386
+ {
178387
+ name: "list_tags",
178388
+ description: "List generic Huly tag definitions for one SDK target class. Use this for SDK-level tags such as recruiting skills or document labels. For Tracker issue labels, prefer list_labels.",
178389
+ category: CATEGORY22,
178390
+ inputSchema: listTagsParamsJsonSchema,
178391
+ handler: createToolHandler(
178392
+ "list_tags",
178393
+ parseListTagsParams,
178394
+ listTags
178395
+ )
178396
+ },
178397
+ {
178398
+ name: "create_tag",
178399
+ description: "Create a generic Huly tag definition for one targetClass. Idempotent by targetClass + title. This exposes the SDK tags model; for Tracker issue labels, prefer create_label.",
178400
+ category: CATEGORY22,
178401
+ inputSchema: createTagParamsJsonSchema,
178402
+ handler: createToolHandler(
178403
+ "create_tag",
178404
+ parseCreateTagParams,
178405
+ createTag
178406
+ )
178407
+ },
178408
+ {
178409
+ name: "update_tag",
178410
+ description: "Update a generic Huly tag definition. The tag argument accepts a tag ID or exact title, resolved within targetClass.",
178411
+ category: CATEGORY22,
178412
+ inputSchema: updateTagParamsJsonSchema,
178413
+ handler: createToolHandler(
178414
+ "update_tag",
178415
+ parseUpdateTagParams,
178416
+ updateTag
178417
+ )
178418
+ },
178419
+ {
178420
+ name: "delete_tag",
178421
+ description: "Delete a generic Huly tag definition by ID or exact title, resolved within targetClass. This deletes the tag definition, not only one object's tag reference.",
178422
+ category: CATEGORY22,
178423
+ inputSchema: deleteTagParamsJsonSchema,
178424
+ annotations: {
178425
+ destructiveHint: true,
178426
+ idempotentHint: false
178427
+ },
178428
+ handler: createToolHandler(
178429
+ "delete_tag",
178430
+ parseDeleteTagParams,
178431
+ deleteTag
178432
+ )
178433
+ },
178434
+ {
178435
+ name: "list_attached_tags",
178436
+ description: "List generic Huly TagReference rows attached to one raw object collection. Requires objectId, objectClass, space, and collection because this is an SDK-level tool.",
178437
+ category: CATEGORY22,
178438
+ inputSchema: listAttachedTagsParamsJsonSchema,
178439
+ handler: createToolHandler(
178440
+ "list_attached_tags",
178441
+ parseListAttachedTagsParams,
178442
+ listAttachedTags
178443
+ )
178444
+ },
178445
+ {
178446
+ name: "attach_tag",
178447
+ description: "Attach a generic Huly tag to one raw object collection. Requires targetClass for the tag definition and objectId/objectClass/space/collection for the TagReference. Idempotent for the same object, collection, and tag.",
178448
+ category: CATEGORY22,
178449
+ inputSchema: attachTagParamsJsonSchema,
178450
+ annotations: {
178451
+ idempotentHint: true
178452
+ },
178453
+ handler: createToolHandler(
178454
+ "attach_tag",
178455
+ parseAttachTagParams,
178456
+ attachTag
178457
+ )
178458
+ },
178459
+ {
178460
+ name: "detach_tag",
178461
+ description: "Detach a generic Huly tag from one raw object collection. Requires targetClass and objectId/objectClass/space/collection. Returns detached=false when the tag is not attached.",
178462
+ category: CATEGORY22,
178463
+ inputSchema: detachTagParamsJsonSchema,
178464
+ handler: createToolHandler(
178465
+ "detach_tag",
178466
+ parseDetachTagParams,
178467
+ detachTag
178468
+ )
178469
+ }
178470
+ ];
178471
+
177962
178472
  // src/huly/operations/task-management.ts
177963
- var import_core38 = __toESM(require_lib4(), 1);
178473
+ var import_core39 = __toESM(require_lib4(), 1);
177964
178474
  var import_platform3 = __toESM(require_lib(), 1);
177965
178475
  var STATUS_CATEGORY_BY_SDK_KEY = {
177966
178476
  UnStarted: { value: "UnStarted", ref: StatusCategoryBySdkKey.UnStarted, name: "UnStarted" },
@@ -178073,7 +178583,7 @@ var projectTypeDetail = (data) => ({
178073
178583
  var listAllProjectTypes = (client) => client.findAll(
178074
178584
  task.class.ProjectType,
178075
178585
  hulyQuery({}),
178076
- { sort: { name: import_core38.SortingOrder.Ascending } }
178586
+ { sort: { name: import_core39.SortingOrder.Ascending } }
178077
178587
  ).pipe(Effect_exports.map((result) => [...result]));
178078
178588
  var resolveProjectType = (client, projectTypeRef) => Effect_exports.gen(function* () {
178079
178589
  const projectTypes = yield* listAllProjectTypes(client);
@@ -178192,7 +178702,7 @@ var createTaskType = (params) => Effect_exports.gen(function* () {
178192
178702
  new HulyError({ message: `Project type '${projectType.name}' has no task type to copy.` })
178193
178703
  );
178194
178704
  }
178195
- const taskTypeId = (0, import_core38.generateId)();
178705
+ const taskTypeId = (0, import_core39.generateId)();
178196
178706
  const targetClassId = `${taskTypeId}:type:mixin`;
178197
178707
  const targetClassRef = toRef(targetClassId);
178198
178708
  const templateStatusIds = uniqueStatusRefs(template.statuses);
@@ -178201,7 +178711,7 @@ var createTaskType = (params) => Effect_exports.gen(function* () {
178201
178711
  core.space.Model,
178202
178712
  {
178203
178713
  extends: template.ofClass,
178204
- kind: import_core38.ClassifierKind.MIXIN,
178714
+ kind: import_core39.ClassifierKind.MIXIN,
178205
178715
  label: (0, import_platform3.getEmbeddedLabel)(params.name),
178206
178716
  ...template.icon === void 0 ? {} : { icon: template.icon }
178207
178717
  },
@@ -178286,7 +178796,7 @@ var createIssueStatus = (params) => Effect_exports.gen(function* () {
178286
178796
  [...workflowData.statuses, ...statusesByName],
178287
178797
  params.name
178288
178798
  );
178289
- const statusId = existingStatus?._id ?? (0, import_core38.generateId)();
178799
+ const statusId = existingStatus?._id ?? (0, import_core39.generateId)();
178290
178800
  if (existingStatus !== void 0) {
178291
178801
  yield* requireStatusCategoryMatch(existingStatus, params.category);
178292
178802
  }
@@ -178356,33 +178866,33 @@ var createIssueStatus = (params) => Effect_exports.gen(function* () {
178356
178866
  });
178357
178867
 
178358
178868
  // src/mcp/tools/task-management.ts
178359
- var CATEGORY22 = "task-management";
178869
+ var CATEGORY23 = "task-management";
178360
178870
  var taskManagementTools = [
178361
178871
  {
178362
178872
  name: "list_project_types",
178363
178873
  description: "List Huly tracker project types/workflow templates. Returns ID, display name, descriptor, task type count, status count, and whether the type appears to be the default Classic tracker type.",
178364
- category: CATEGORY22,
178874
+ category: CATEGORY23,
178365
178875
  inputSchema: listProjectTypesParamsJsonSchema,
178366
178876
  handler: createToolHandler("list_project_types", parseListProjectTypesParams, listProjectTypes)
178367
178877
  },
178368
178878
  {
178369
178879
  name: "get_project_type",
178370
178880
  description: "Inspect one Huly tracker project type in a single call. Accepts projectType as ID or display name; when omitted, uses the unambiguous Classic tracker type. Returns task types, statuses, categories, and task-type-to-status mappings.",
178371
- category: CATEGORY22,
178881
+ category: CATEGORY23,
178372
178882
  inputSchema: getProjectTypeParamsJsonSchema,
178373
178883
  handler: createToolHandler("get_project_type", parseGetProjectTypeParams, getProjectType)
178374
178884
  },
178375
178885
  {
178376
178886
  name: "list_task_types",
178377
178887
  description: "List Huly issue/task types. Optionally filter by projectType ID or display name. Returns task type identity, parent project type, kind, issue class, and available status count.",
178378
- category: CATEGORY22,
178888
+ category: CATEGORY23,
178379
178889
  inputSchema: listTaskTypesParamsJsonSchema,
178380
178890
  handler: createToolHandler("list_task_types", parseListTaskTypesParams, listTaskTypes)
178381
178891
  },
178382
178892
  {
178383
178893
  name: "create_task_type",
178384
178894
  description: "Add a Huly issue/task type to a project type idempotently by normalized name. Copies required workflow configuration from an existing template task type unless templateTaskType is supplied. Returns created, IDs, affected task type IDs, and a workspace-level workflow warning.",
178385
- category: CATEGORY22,
178895
+ category: CATEGORY23,
178386
178896
  inputSchema: createTaskTypeParamsJsonSchema,
178387
178897
  annotations: { idempotentHint: true },
178388
178898
  handler: createToolHandler("create_task_type", parseCreateTaskTypeParams, createTaskType)
@@ -178390,7 +178900,7 @@ var taskManagementTools = [
178390
178900
  {
178391
178901
  name: "create_issue_status",
178392
178902
  description: `Add a Huly issue workflow status idempotently by normalized name within a project type and task type scope. Accepts category as a Huly SDK task.statusCategory key: ${enumValuesDescription(StatusCategoryValues)}; taskType may be ID or display name, and omission applies the status to every task type in the project type.`,
178393
- category: CATEGORY22,
178903
+ category: CATEGORY23,
178394
178904
  inputSchema: createIssueStatusParamsJsonSchema,
178395
178905
  annotations: { idempotentHint: true },
178396
178906
  handler: createToolHandler("create_issue_status", parseCreateIssueStatusParams, createIssueStatus)
@@ -178398,7 +178908,7 @@ var taskManagementTools = [
178398
178908
  ];
178399
178909
 
178400
178910
  // src/huly/operations/test-management-core.ts
178401
- var import_core39 = __toESM(require_lib4(), 1);
178911
+ var import_core40 = __toESM(require_lib4(), 1);
178402
178912
 
178403
178913
  // src/huly/test-management-classes.ts
178404
178914
  var testManagement = {
@@ -178571,7 +179081,7 @@ var listTestProjects = (params) => Effect_exports.gen(function* () {
178571
179081
  {},
178572
179082
  {
178573
179083
  limit,
178574
- sort: { name: import_core39.SortingOrder.Ascending }
179084
+ sort: { name: import_core40.SortingOrder.Ascending }
178575
179085
  }
178576
179086
  );
178577
179087
  return {
@@ -178593,7 +179103,7 @@ var listTestSuites = (params) => Effect_exports.gen(function* () {
178593
179103
  query,
178594
179104
  {
178595
179105
  limit,
178596
- sort: { modifiedOn: import_core39.SortingOrder.Descending }
179106
+ sort: { modifiedOn: import_core40.SortingOrder.Descending }
178597
179107
  }
178598
179108
  );
178599
179109
  return {
@@ -178626,7 +179136,7 @@ var createTestSuite = (params) => Effect_exports.gen(function* () {
178626
179136
  if (existing !== void 0) {
178627
179137
  return { id: TestSuiteId.make(existing._id), name: existing.name, created: false };
178628
179138
  }
178629
- const suiteId = (0, import_core39.generateId)();
179139
+ const suiteId = (0, import_core40.generateId)();
178630
179140
  const suiteData = {
178631
179141
  name: params.name,
178632
179142
  description: params.description ?? "",
@@ -178694,7 +179204,7 @@ var listTestCases = (params) => Effect_exports.gen(function* () {
178694
179204
  query,
178695
179205
  {
178696
179206
  limit,
178697
- sort: { modifiedOn: import_core39.SortingOrder.Descending }
179207
+ sort: { modifiedOn: import_core40.SortingOrder.Descending }
178698
179208
  }
178699
179209
  );
178700
179210
  return {
@@ -178722,7 +179232,7 @@ var createTestCase = (params) => Effect_exports.gen(function* () {
178722
179232
  const client = yield* HulyClient;
178723
179233
  const project3 = yield* findTestProject(client, params.project);
178724
179234
  const suite = yield* findTestSuite(client, project3, params.suite);
178725
- const caseId = (0, import_core39.generateId)();
179235
+ const caseId = (0, import_core40.generateId)();
178726
179236
  const assigneeRef = params.assignee !== void 0 ? toRef((yield* resolveAssignee2(params.assignee))._id) : null;
178727
179237
  const typeEnum = params.type !== void 0 ? stringToTestCaseType(params.type) ?? 0 /* Functional */ : 0 /* Functional */;
178728
179238
  const priorityEnum = params.priority !== void 0 ? stringToTestCasePriority(params.priority) ?? 1 /* Medium */ : 1 /* Medium */;
@@ -178824,12 +179334,12 @@ var deleteTestCase = (params) => Effect_exports.gen(function* () {
178824
179334
  });
178825
179335
 
178826
179336
  // src/mcp/tools/test-management-core.ts
178827
- var CATEGORY23 = "test-management";
179337
+ var CATEGORY24 = "test-management";
178828
179338
  var testManagementCoreTools = [
178829
179339
  {
178830
179340
  name: "list_test_projects",
178831
179341
  description: "List test management projects. Returns test projects sorted by name. These are separate from tracker projects.",
178832
- category: CATEGORY23,
179342
+ category: CATEGORY24,
178833
179343
  inputSchema: listTestProjectsParamsJsonSchema,
178834
179344
  handler: createToolHandler(
178835
179345
  "list_test_projects",
@@ -178840,7 +179350,7 @@ var testManagementCoreTools = [
178840
179350
  {
178841
179351
  name: "list_test_suites",
178842
179352
  description: "List test suites in a test project. Accepts project ID or name. Optional parent filter for nested suites.",
178843
- category: CATEGORY23,
179353
+ category: CATEGORY24,
178844
179354
  inputSchema: listTestSuitesParamsJsonSchema,
178845
179355
  handler: createToolHandler(
178846
179356
  "list_test_suites",
@@ -178851,7 +179361,7 @@ var testManagementCoreTools = [
178851
179361
  {
178852
179362
  name: "get_test_suite",
178853
179363
  description: "Get a single test suite by ID or name within a test project. Returns suite details and test case count.",
178854
- category: CATEGORY23,
179364
+ category: CATEGORY24,
178855
179365
  inputSchema: getTestSuiteParamsJsonSchema,
178856
179366
  handler: createToolHandler(
178857
179367
  "get_test_suite",
@@ -178862,7 +179372,7 @@ var testManagementCoreTools = [
178862
179372
  {
178863
179373
  name: "create_test_suite",
178864
179374
  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.",
178865
- category: CATEGORY23,
179375
+ category: CATEGORY24,
178866
179376
  inputSchema: createTestSuiteParamsJsonSchema,
178867
179377
  handler: createToolHandler(
178868
179378
  "create_test_suite",
@@ -178873,7 +179383,7 @@ var testManagementCoreTools = [
178873
179383
  {
178874
179384
  name: "update_test_suite",
178875
179385
  description: "Update a test suite. Accepts suite ID or name. Only provided fields are modified.",
178876
- category: CATEGORY23,
179386
+ category: CATEGORY24,
178877
179387
  inputSchema: updateTestSuiteParamsJsonSchema,
178878
179388
  handler: createToolHandler(
178879
179389
  "update_test_suite",
@@ -178884,7 +179394,7 @@ var testManagementCoreTools = [
178884
179394
  {
178885
179395
  name: "delete_test_suite",
178886
179396
  description: "Permanently delete a test suite. Accepts suite ID or name. This action cannot be undone.",
178887
- category: CATEGORY23,
179397
+ category: CATEGORY24,
178888
179398
  inputSchema: deleteTestSuiteParamsJsonSchema,
178889
179399
  handler: createToolHandler(
178890
179400
  "delete_test_suite",
@@ -178895,7 +179405,7 @@ var testManagementCoreTools = [
178895
179405
  {
178896
179406
  name: "list_test_cases",
178897
179407
  description: "List test cases in a test project. Optional filters: suite (ID or name), assignee (name or email).",
178898
- category: CATEGORY23,
179408
+ category: CATEGORY24,
178899
179409
  inputSchema: listTestCasesParamsJsonSchema,
178900
179410
  handler: createToolHandler(
178901
179411
  "list_test_cases",
@@ -178906,7 +179416,7 @@ var testManagementCoreTools = [
178906
179416
  {
178907
179417
  name: "get_test_case",
178908
179418
  description: "Get a single test case by ID or name within a test project.",
178909
- category: CATEGORY23,
179419
+ category: CATEGORY24,
178910
179420
  inputSchema: getTestCaseParamsJsonSchema,
178911
179421
  handler: createToolHandler(
178912
179422
  "get_test_case",
@@ -178917,7 +179427,7 @@ var testManagementCoreTools = [
178917
179427
  {
178918
179428
  name: "create_test_case",
178919
179429
  description: "Create a test case attached to a suite. Requires project and suite. Defaults: type=functional, priority=medium, status=draft.",
178920
- category: CATEGORY23,
179430
+ category: CATEGORY24,
178921
179431
  inputSchema: createTestCaseParamsJsonSchema,
178922
179432
  handler: createToolHandler(
178923
179433
  "create_test_case",
@@ -178928,7 +179438,7 @@ var testManagementCoreTools = [
178928
179438
  {
178929
179439
  name: "update_test_case",
178930
179440
  description: "Update a test case. Accepts test case ID or name. Only provided fields are modified. Set assignee to null to unassign.",
178931
- category: CATEGORY23,
179441
+ category: CATEGORY24,
178932
179442
  inputSchema: updateTestCaseParamsJsonSchema,
178933
179443
  handler: createToolHandler(
178934
179444
  "update_test_case",
@@ -178939,7 +179449,7 @@ var testManagementCoreTools = [
178939
179449
  {
178940
179450
  name: "delete_test_case",
178941
179451
  description: "Permanently delete a test case. Accepts test case ID or name. This action cannot be undone.",
178942
- category: CATEGORY23,
179452
+ category: CATEGORY24,
178943
179453
  inputSchema: deleteTestCaseParamsJsonSchema,
178944
179454
  handler: createToolHandler(
178945
179455
  "delete_test_case",
@@ -178950,7 +179460,7 @@ var testManagementCoreTools = [
178950
179460
  ];
178951
179461
 
178952
179462
  // src/huly/operations/test-management-plans.ts
178953
- var import_core40 = __toESM(require_lib4(), 1);
179463
+ var import_core41 = __toESM(require_lib4(), 1);
178954
179464
  var toPlanSummary = (p) => ({
178955
179465
  id: TestPlanId.make(p._id),
178956
179466
  name: p.name
@@ -178968,7 +179478,7 @@ var listTestPlans = (params) => Effect_exports.gen(function* () {
178968
179478
  const plans = yield* client.findAll(
178969
179479
  testManagement.class.TestPlan,
178970
179480
  { space: project3._id },
178971
- { limit, sort: { modifiedOn: import_core40.SortingOrder.Descending } }
179481
+ { limit, sort: { modifiedOn: import_core41.SortingOrder.Descending } }
178972
179482
  );
178973
179483
  return { plans: plans.map(toPlanSummary), total: plans.total };
178974
179484
  });
@@ -179003,7 +179513,7 @@ var createTestPlan = (params) => Effect_exports.gen(function* () {
179003
179513
  if (existing !== void 0) {
179004
179514
  return { id: TestPlanId.make(existing._id), name: existing.name, created: false };
179005
179515
  }
179006
- const planId = (0, import_core40.generateId)();
179516
+ const planId = (0, import_core41.generateId)();
179007
179517
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
179008
179518
  testManagement.class.TestPlan,
179009
179519
  planId,
@@ -179085,7 +179595,7 @@ var removeTestPlanItem = (params) => Effect_exports.gen(function* () {
179085
179595
  });
179086
179596
 
179087
179597
  // src/huly/operations/test-management-runs.ts
179088
- var import_core41 = __toESM(require_lib4(), 1);
179598
+ var import_core42 = __toESM(require_lib4(), 1);
179089
179599
  var BATCH_CONCURRENCY = 10;
179090
179600
  var toRunSummary = (r) => ({
179091
179601
  id: TestRunId.make(r._id),
@@ -179106,7 +179616,7 @@ var listTestRuns = (params) => Effect_exports.gen(function* () {
179106
179616
  const runs = yield* client.findAll(
179107
179617
  testManagement.class.TestRun,
179108
179618
  { space: project3._id },
179109
- { limit, sort: { modifiedOn: import_core41.SortingOrder.Descending } }
179619
+ { limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
179110
179620
  );
179111
179621
  return { runs: runs.map(toRunSummary), total: runs.total };
179112
179622
  });
@@ -179135,7 +179645,7 @@ var getTestRun = (params) => Effect_exports.gen(function* () {
179135
179645
  var createTestRun = (params) => Effect_exports.gen(function* () {
179136
179646
  const client = yield* HulyClient;
179137
179647
  const project3 = yield* findTestProject(client, params.project);
179138
- const runId = (0, import_core41.generateId)();
179648
+ const runId = (0, import_core42.generateId)();
179139
179649
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
179140
179650
  testManagement.class.TestRun,
179141
179651
  runId,
@@ -179192,7 +179702,7 @@ var listTestResults = (params) => Effect_exports.gen(function* () {
179192
179702
  const results = yield* client.findAll(
179193
179703
  testManagement.class.TestResult,
179194
179704
  { attachedTo: run3._id },
179195
- { limit, sort: { modifiedOn: import_core41.SortingOrder.Descending } }
179705
+ { limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
179196
179706
  );
179197
179707
  return { results: results.map(toResultSummary), total: results.total };
179198
179708
  });
@@ -179293,7 +179803,7 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
179293
179803
  }
179294
179804
  return { item, tc };
179295
179805
  }), { concurrency: BATCH_CONCURRENCY });
179296
- const runId = (0, import_core41.generateId)();
179806
+ const runId = (0, import_core42.generateId)();
179297
179807
  const runName = params.runName ?? `${plan.name} - Run`;
179298
179808
  yield* client.createDoc(testManagement.class.TestRun, project3._id, {
179299
179809
  name: runName,
@@ -179323,41 +179833,41 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
179323
179833
  });
179324
179834
 
179325
179835
  // src/mcp/tools/test-management-plans.ts
179326
- var CATEGORY24 = "test-management";
179836
+ var CATEGORY25 = "test-management";
179327
179837
  var testManagementPlansTools = [
179328
179838
  // --- Test Plans ---
179329
179839
  {
179330
179840
  name: "list_test_plans",
179331
179841
  description: "List test plans in a test management project. Returns plan names and IDs. Requires project ID or name.",
179332
- category: CATEGORY24,
179842
+ category: CATEGORY25,
179333
179843
  inputSchema: listTestPlansParamsJsonSchema,
179334
179844
  handler: createToolHandler("list_test_plans", parseListTestPlansParams, listTestPlans)
179335
179845
  },
179336
179846
  {
179337
179847
  name: "get_test_plan",
179338
179848
  description: "Get test plan details including its items (test cases). Accepts plan ID or name within a project.",
179339
- category: CATEGORY24,
179849
+ category: CATEGORY25,
179340
179850
  inputSchema: getTestPlanParamsJsonSchema,
179341
179851
  handler: createToolHandler("get_test_plan", parseGetTestPlanParams, getTestPlan)
179342
179852
  },
179343
179853
  {
179344
179854
  name: "create_test_plan",
179345
179855
  description: "Create a test plan in a project. Idempotent: returns existing plan if one with the same name exists (created=false).",
179346
- category: CATEGORY24,
179856
+ category: CATEGORY25,
179347
179857
  inputSchema: createTestPlanParamsJsonSchema,
179348
179858
  handler: createToolHandler("create_test_plan", parseCreateTestPlanParams, createTestPlan)
179349
179859
  },
179350
179860
  {
179351
179861
  name: "update_test_plan",
179352
179862
  description: "Update a test plan's name or description. Only provided fields are modified. Pass description=null to clear.",
179353
- category: CATEGORY24,
179863
+ category: CATEGORY25,
179354
179864
  inputSchema: updateTestPlanParamsJsonSchema,
179355
179865
  handler: createToolHandler("update_test_plan", parseUpdateTestPlanParams, updateTestPlan)
179356
179866
  },
179357
179867
  {
179358
179868
  name: "delete_test_plan",
179359
179869
  description: "Permanently delete a test plan. This does not delete associated test runs. Cannot be undone.",
179360
- category: CATEGORY24,
179870
+ category: CATEGORY25,
179361
179871
  inputSchema: deleteTestPlanParamsJsonSchema,
179362
179872
  handler: createToolHandler("delete_test_plan", parseDeleteTestPlanParams, deleteTestPlan)
179363
179873
  },
@@ -179365,14 +179875,14 @@ var testManagementPlansTools = [
179365
179875
  {
179366
179876
  name: "add_test_plan_item",
179367
179877
  description: "Add a test case to a test plan. Resolves test case by ID or name. Optionally assign a person by email or name.",
179368
- category: CATEGORY24,
179878
+ category: CATEGORY25,
179369
179879
  inputSchema: addTestPlanItemParamsJsonSchema,
179370
179880
  handler: createToolHandler("add_test_plan_item", parseAddTestPlanItemParams, addTestPlanItem)
179371
179881
  },
179372
179882
  {
179373
179883
  name: "remove_test_plan_item",
179374
179884
  description: "Remove a test case from a test plan by item ID. Get item IDs from get_test_plan.",
179375
- category: CATEGORY24,
179885
+ category: CATEGORY25,
179376
179886
  inputSchema: removeTestPlanItemParamsJsonSchema,
179377
179887
  handler: createToolHandler("remove_test_plan_item", parseRemoveTestPlanItemParams, removeTestPlanItem)
179378
179888
  },
@@ -179380,35 +179890,35 @@ var testManagementPlansTools = [
179380
179890
  {
179381
179891
  name: "list_test_runs",
179382
179892
  description: "List test runs in a test management project. Returns run names, IDs, and due dates.",
179383
- category: CATEGORY24,
179893
+ category: CATEGORY25,
179384
179894
  inputSchema: listTestRunsParamsJsonSchema,
179385
179895
  handler: createToolHandler("list_test_runs", parseListTestRunsParams, listTestRuns)
179386
179896
  },
179387
179897
  {
179388
179898
  name: "get_test_run",
179389
179899
  description: "Get test run details including all results. Accepts run ID or name within a project.",
179390
- category: CATEGORY24,
179900
+ category: CATEGORY25,
179391
179901
  inputSchema: getTestRunParamsJsonSchema,
179392
179902
  handler: createToolHandler("get_test_run", parseGetTestRunParams, getTestRun)
179393
179903
  },
179394
179904
  {
179395
179905
  name: "create_test_run",
179396
179906
  description: "Create a test run in a project. For bulk creation from a plan, use run_test_plan instead.",
179397
- category: CATEGORY24,
179907
+ category: CATEGORY25,
179398
179908
  inputSchema: createTestRunParamsJsonSchema,
179399
179909
  handler: createToolHandler("create_test_run", parseCreateTestRunParams, createTestRun)
179400
179910
  },
179401
179911
  {
179402
179912
  name: "update_test_run",
179403
179913
  description: "Update a test run's name, description, or due date. Only provided fields are modified. Pass null to clear optional fields.",
179404
- category: CATEGORY24,
179914
+ category: CATEGORY25,
179405
179915
  inputSchema: updateTestRunParamsJsonSchema,
179406
179916
  handler: createToolHandler("update_test_run", parseUpdateTestRunParams, updateTestRun)
179407
179917
  },
179408
179918
  {
179409
179919
  name: "delete_test_run",
179410
179920
  description: "Permanently delete a test run. This does not delete associated test results. Cannot be undone.",
179411
- category: CATEGORY24,
179921
+ category: CATEGORY25,
179412
179922
  inputSchema: deleteTestRunParamsJsonSchema,
179413
179923
  handler: createToolHandler("delete_test_run", parseDeleteTestRunParams, deleteTestRun)
179414
179924
  },
@@ -179416,35 +179926,35 @@ var testManagementPlansTools = [
179416
179926
  {
179417
179927
  name: "list_test_results",
179418
179928
  description: "List test results in a test run. Returns result names, statuses, and assignees.",
179419
- category: CATEGORY24,
179929
+ category: CATEGORY25,
179420
179930
  inputSchema: listTestResultsParamsJsonSchema,
179421
179931
  handler: createToolHandler("list_test_results", parseListTestResultsParams, listTestResults)
179422
179932
  },
179423
179933
  {
179424
179934
  name: "get_test_result",
179425
179935
  description: "Get test result details. Accepts result ID or name.",
179426
- category: CATEGORY24,
179936
+ category: CATEGORY25,
179427
179937
  inputSchema: getTestResultParamsJsonSchema,
179428
179938
  handler: createToolHandler("get_test_result", parseGetTestResultParams, getTestResult)
179429
179939
  },
179430
179940
  {
179431
179941
  name: "create_test_result",
179432
179942
  description: "Create a test result in a run. Resolves test case by ID or name. Status defaults to 'untested'.",
179433
- category: CATEGORY24,
179943
+ category: CATEGORY25,
179434
179944
  inputSchema: createTestResultParamsJsonSchema,
179435
179945
  handler: createToolHandler("create_test_result", parseCreateTestResultParams, createTestResult)
179436
179946
  },
179437
179947
  {
179438
179948
  name: "update_test_result",
179439
179949
  description: "Update a test result's status, assignee, or description. Status values: untested, blocked, passed, failed.",
179440
- category: CATEGORY24,
179950
+ category: CATEGORY25,
179441
179951
  inputSchema: updateTestResultParamsJsonSchema,
179442
179952
  handler: createToolHandler("update_test_result", parseUpdateTestResultParams, updateTestResult)
179443
179953
  },
179444
179954
  {
179445
179955
  name: "delete_test_result",
179446
179956
  description: "Permanently delete a test result. Cannot be undone.",
179447
- category: CATEGORY24,
179957
+ category: CATEGORY25,
179448
179958
  inputSchema: deleteTestResultParamsJsonSchema,
179449
179959
  handler: createToolHandler("delete_test_result", parseDeleteTestResultParams, deleteTestResult)
179450
179960
  },
@@ -179452,7 +179962,7 @@ var testManagementPlansTools = [
179452
179962
  {
179453
179963
  name: "run_test_plan",
179454
179964
  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.",
179455
- category: CATEGORY24,
179965
+ category: CATEGORY25,
179456
179966
  inputSchema: runTestPlanParamsJsonSchema,
179457
179967
  annotations: {
179458
179968
  title: "Run Test Plan",
@@ -179467,7 +179977,7 @@ var testManagementPlansTools = [
179467
179977
 
179468
179978
  // src/huly/operations/time.ts
179469
179979
  var import_calendar8 = __toESM(require_lib25(), 1);
179470
- var import_core42 = __toESM(require_lib4(), 1);
179980
+ var import_core43 = __toESM(require_lib4(), 1);
179471
179981
  var import_tracker7 = __toESM(require_lib36(), 1);
179472
179982
  var serverPopulatedCalendar = toRef("");
179473
179983
  var serverPopulatedPersonId = "";
@@ -179477,7 +179987,7 @@ var logTime = (params) => Effect_exports.gen(function* () {
179477
179987
  project: params.project,
179478
179988
  identifier: params.identifier
179479
179989
  });
179480
- const reportId = (0, import_core42.generateId)();
179990
+ const reportId = (0, import_core43.generateId)();
179481
179991
  const now2 = yield* Clock_exports.currentTimeMillis;
179482
179992
  const reportData = {
179483
179993
  employee: null,
@@ -179517,7 +180027,7 @@ var getTimeReport = (params) => Effect_exports.gen(function* () {
179517
180027
  const reports = yield* client.findAll(
179518
180028
  tracker.class.TimeSpendReport,
179519
180029
  { attachedTo: issue2._id },
179520
- { sort: { date: import_core42.SortingOrder.Descending } }
180030
+ { sort: { date: import_core43.SortingOrder.Descending } }
179521
180031
  );
179522
180032
  const employeeIds = [
179523
180033
  ...new Set(
@@ -179569,7 +180079,7 @@ var listTimeSpendReports = (params) => Effect_exports.gen(function* () {
179569
180079
  tracker.class.TimeSpendReport,
179570
180080
  query,
179571
180081
  withLookup(
179572
- { limit, sort: { date: import_core42.SortingOrder.Descending } },
180082
+ { limit, sort: { date: import_core43.SortingOrder.Descending } },
179573
180083
  {
179574
180084
  attachedTo: tracker.class.Issue,
179575
180085
  employee: contact.class.Person
@@ -179598,7 +180108,7 @@ var getDetailedTimeReport = (params) => Effect_exports.gen(function* () {
179598
180108
  tracker.class.TimeSpendReport,
179599
180109
  query,
179600
180110
  withLookup(
179601
- { sort: { date: import_core42.SortingOrder.Descending } },
180111
+ { sort: { date: import_core43.SortingOrder.Descending } },
179602
180112
  {
179603
180113
  attachedTo: tracker.class.Issue,
179604
180114
  employee: contact.class.Person
@@ -179676,7 +180186,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
179676
180186
  const slots = yield* client.findAll(
179677
180187
  time3.class.WorkSlot,
179678
180188
  query,
179679
- { limit, sort: { date: import_core42.SortingOrder.Descending } }
180189
+ { limit, sort: { date: import_core43.SortingOrder.Descending } }
179680
180190
  );
179681
180191
  return slots.map((s) => ({
179682
180192
  id: WorkSlotId.make(s._id),
@@ -179688,7 +180198,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
179688
180198
  });
179689
180199
  var createWorkSlot = (params) => Effect_exports.gen(function* () {
179690
180200
  const client = yield* HulyClient;
179691
- const slotId = (0, import_core42.generateId)();
180201
+ const slotId = (0, import_core43.generateId)();
179692
180202
  const slotData = {
179693
180203
  date: params.date,
179694
180204
  dueDate: params.dueDate,
@@ -179739,12 +180249,12 @@ var stopTimer = (params) => Effect_exports.gen(function* () {
179739
180249
  });
179740
180250
 
179741
180251
  // src/mcp/tools/time.ts
179742
- var CATEGORY25 = "time tracking";
180252
+ var CATEGORY26 = "time tracking";
179743
180253
  var timeTools = [
179744
180254
  {
179745
180255
  name: "log_time",
179746
180256
  description: "Log time spent on a Huly issue. Records a time entry with optional description. Time value is in minutes.",
179747
- category: CATEGORY25,
180257
+ category: CATEGORY26,
179748
180258
  inputSchema: logTimeParamsJsonSchema,
179749
180259
  handler: createEncodedToolHandler(
179750
180260
  "log_time",
@@ -179756,7 +180266,7 @@ var timeTools = [
179756
180266
  {
179757
180267
  name: "get_time_report",
179758
180268
  description: "Get time tracking report for a specific Huly issue. Shows total time, estimation, remaining time, and all time entries.",
179759
- category: CATEGORY25,
180269
+ category: CATEGORY26,
179760
180270
  inputSchema: getTimeReportParamsJsonSchema,
179761
180271
  handler: createEncodedToolHandler(
179762
180272
  "get_time_report",
@@ -179768,7 +180278,7 @@ var timeTools = [
179768
180278
  {
179769
180279
  name: "list_time_spend_reports",
179770
180280
  description: "List all time entries across issues. Supports filtering by project and date range. Returns entries sorted by date (newest first).",
179771
- category: CATEGORY25,
180281
+ category: CATEGORY26,
179772
180282
  inputSchema: listTimeSpendReportsParamsJsonSchema,
179773
180283
  handler: createEncodedToolHandler(
179774
180284
  "list_time_spend_reports",
@@ -179780,7 +180290,7 @@ var timeTools = [
179780
180290
  {
179781
180291
  name: "get_detailed_time_report",
179782
180292
  description: "Get detailed time breakdown for a project. Shows total time grouped by issue and by employee. Supports date range filtering.",
179783
- category: CATEGORY25,
180293
+ category: CATEGORY26,
179784
180294
  inputSchema: getDetailedTimeReportParamsJsonSchema,
179785
180295
  handler: createEncodedToolHandler(
179786
180296
  "get_detailed_time_report",
@@ -179792,7 +180302,7 @@ var timeTools = [
179792
180302
  {
179793
180303
  name: "list_work_slots",
179794
180304
  description: "List scheduled work slots. Shows planned time blocks attached to ToDos. Supports filtering by employee and date range.",
179795
- category: CATEGORY25,
180305
+ category: CATEGORY26,
179796
180306
  inputSchema: listWorkSlotsParamsJsonSchema,
179797
180307
  handler: createEncodedToolHandler(
179798
180308
  "list_work_slots",
@@ -179804,7 +180314,7 @@ var timeTools = [
179804
180314
  {
179805
180315
  name: "create_work_slot",
179806
180316
  description: "Create a scheduled work slot. Attaches a time block to a ToDo for planning purposes.",
179807
- category: CATEGORY25,
180317
+ category: CATEGORY26,
179808
180318
  inputSchema: createWorkSlotParamsJsonSchema,
179809
180319
  handler: createEncodedToolHandler(
179810
180320
  "create_work_slot",
@@ -179816,7 +180326,7 @@ var timeTools = [
179816
180326
  {
179817
180327
  name: "start_timer",
179818
180328
  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.",
179819
- category: CATEGORY25,
180329
+ category: CATEGORY26,
179820
180330
  inputSchema: startTimerParamsJsonSchema,
179821
180331
  handler: createEncodedToolHandler(
179822
180332
  "start_timer",
@@ -179828,7 +180338,7 @@ var timeTools = [
179828
180338
  {
179829
180339
  name: "stop_timer",
179830
180340
  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.",
179831
- category: CATEGORY25,
180341
+ category: CATEGORY26,
179832
180342
  inputSchema: stopTimerParamsJsonSchema,
179833
180343
  handler: createEncodedToolHandler(
179834
180344
  "stop_timer",
@@ -179840,7 +180350,7 @@ var timeTools = [
179840
180350
  ];
179841
180351
 
179842
180352
  // src/huly/operations/user-statuses.ts
179843
- var import_core43 = __toESM(require_lib4(), 1);
180353
+ var import_core44 = __toESM(require_lib4(), 1);
179844
180354
  var userStatusSummary = (status) => ({
179845
180355
  id: UserStatusId.make(status._id),
179846
180356
  user: UserStatusAccountUuid.make(status.user),
@@ -179857,7 +180367,7 @@ var listUserStatuses = (params) => Effect_exports.gen(function* () {
179857
180367
  hulyQuery(query),
179858
180368
  {
179859
180369
  limit: clampLimit(params.limit),
179860
- sort: { modifiedOn: import_core43.SortingOrder.Descending }
180370
+ sort: { modifiedOn: import_core44.SortingOrder.Descending }
179861
180371
  }
179862
180372
  );
179863
180373
  return ListUserStatusesResultSchema.make({
@@ -179867,12 +180377,12 @@ var listUserStatuses = (params) => Effect_exports.gen(function* () {
179867
180377
  });
179868
180378
 
179869
180379
  // src/mcp/tools/user-statuses.ts
179870
- var CATEGORY26 = "user-statuses";
180380
+ var CATEGORY27 = "user-statuses";
179871
180381
  var userStatusTools = [
179872
180382
  {
179873
180383
  name: "list_user_statuses",
179874
180384
  description: "List Huly user presence records. Returns account UUIDs, online status, and last modified timestamp. Use this to check who is currently connected; presence is maintained by Huly server sessions. Filter by online or account UUID.",
179875
- category: CATEGORY26,
180385
+ category: CATEGORY27,
179876
180386
  inputSchema: listUserStatusesParamsJsonSchema,
179877
180387
  handler: createEncodedToolHandler(
179878
180388
  "list_user_statuses",
@@ -179884,15 +180394,15 @@ var userStatusTools = [
179884
180394
  ];
179885
180395
 
179886
180396
  // src/huly/operations/workspace.ts
179887
- var import_core44 = __toESM(require_lib4(), 1);
180397
+ var import_core45 = __toESM(require_lib4(), 1);
179888
180398
  var accountRoleMap = {
179889
- READONLYGUEST: import_core44.AccountRole.ReadOnlyGuest,
179890
- DocGuest: import_core44.AccountRole.DocGuest,
179891
- GUEST: import_core44.AccountRole.Guest,
179892
- USER: import_core44.AccountRole.User,
179893
- MAINTAINER: import_core44.AccountRole.Maintainer,
179894
- OWNER: import_core44.AccountRole.Owner,
179895
- ADMIN: import_core44.AccountRole.Admin
180399
+ READONLYGUEST: import_core45.AccountRole.ReadOnlyGuest,
180400
+ DocGuest: import_core45.AccountRole.DocGuest,
180401
+ GUEST: import_core45.AccountRole.Guest,
180402
+ USER: import_core45.AccountRole.User,
180403
+ MAINTAINER: import_core45.AccountRole.Maintainer,
180404
+ OWNER: import_core45.AccountRole.Owner,
180405
+ ADMIN: import_core45.AccountRole.Admin
179896
180406
  };
179897
180407
  var exactAccountRoleMapping = (value3) => value3;
179898
180408
  exactAccountRoleMapping(true);
@@ -180065,12 +180575,12 @@ var getRegions = () => Effect_exports.gen(function* () {
180065
180575
  });
180066
180576
 
180067
180577
  // src/mcp/tools/workspace.ts
180068
- var CATEGORY27 = "workspace";
180578
+ var CATEGORY28 = "workspace";
180069
180579
  var workspaceTools = [
180070
180580
  {
180071
180581
  name: "list_workspace_members",
180072
180582
  description: "List members in the current Huly workspace with their roles. Returns members with account IDs and roles.",
180073
- category: CATEGORY27,
180583
+ category: CATEGORY28,
180074
180584
  inputSchema: listWorkspaceMembersParamsJsonSchema,
180075
180585
  handler: createEncodedWorkspaceToolHandler(
180076
180586
  "list_workspace_members",
@@ -180082,7 +180592,7 @@ var workspaceTools = [
180082
180592
  {
180083
180593
  name: "update_member_role",
180084
180594
  description: "Update a workspace member's role. Requires appropriate permissions. Valid roles: READONLYGUEST, DocGuest, GUEST, USER, MAINTAINER, OWNER, ADMIN.",
180085
- category: CATEGORY27,
180595
+ category: CATEGORY28,
180086
180596
  inputSchema: updateMemberRoleParamsJsonSchema,
180087
180597
  handler: createEncodedWorkspaceToolHandler(
180088
180598
  "update_member_role",
@@ -180094,7 +180604,7 @@ var workspaceTools = [
180094
180604
  {
180095
180605
  name: "get_workspace_info",
180096
180606
  description: "Get information about the current workspace including name, URL, region, and settings.",
180097
- category: CATEGORY27,
180607
+ category: CATEGORY28,
180098
180608
  inputSchema: emptyParamsJsonSchema,
180099
180609
  handler: createEncodedNoParamsWorkspaceToolHandler(
180100
180610
  "get_workspace_info",
@@ -180105,7 +180615,7 @@ var workspaceTools = [
180105
180615
  {
180106
180616
  name: "list_workspaces",
180107
180617
  description: "List all workspaces accessible to the current user. Returns workspace summaries sorted by last visit.",
180108
- category: CATEGORY27,
180618
+ category: CATEGORY28,
180109
180619
  inputSchema: listWorkspacesParamsJsonSchema,
180110
180620
  handler: createEncodedWorkspaceToolHandler(
180111
180621
  "list_workspaces",
@@ -180117,7 +180627,7 @@ var workspaceTools = [
180117
180627
  {
180118
180628
  name: "create_workspace",
180119
180629
  description: "Create a new Huly workspace. Returns the workspace UUID and URL. Optionally specify a region.",
180120
- category: CATEGORY27,
180630
+ category: CATEGORY28,
180121
180631
  inputSchema: createWorkspaceParamsJsonSchema,
180122
180632
  handler: createEncodedWorkspaceToolHandler(
180123
180633
  "create_workspace",
@@ -180129,7 +180639,7 @@ var workspaceTools = [
180129
180639
  {
180130
180640
  name: "delete_workspace",
180131
180641
  description: "Permanently delete the current workspace. This action cannot be undone. Use with extreme caution.",
180132
- category: CATEGORY27,
180642
+ category: CATEGORY28,
180133
180643
  inputSchema: emptyParamsJsonSchema,
180134
180644
  handler: createEncodedNoParamsWorkspaceToolHandler(
180135
180645
  "delete_workspace",
@@ -180140,7 +180650,7 @@ var workspaceTools = [
180140
180650
  {
180141
180651
  name: "get_user_profile",
180142
180652
  description: "Get the current user's profile information including bio, location, and social links.",
180143
- category: CATEGORY27,
180653
+ category: CATEGORY28,
180144
180654
  inputSchema: emptyParamsJsonSchema,
180145
180655
  handler: createEncodedNoParamsWorkspaceToolHandler(
180146
180656
  "get_user_profile",
@@ -180151,7 +180661,7 @@ var workspaceTools = [
180151
180661
  {
180152
180662
  name: "update_user_profile",
180153
180663
  description: "Update the current user's profile. Supports bio, city, country, website, social links, and public visibility.",
180154
- category: CATEGORY27,
180664
+ category: CATEGORY28,
180155
180665
  inputSchema: updateUserProfileParamsJsonSchema,
180156
180666
  handler: createEncodedWorkspaceToolHandler(
180157
180667
  "update_user_profile",
@@ -180163,7 +180673,7 @@ var workspaceTools = [
180163
180673
  {
180164
180674
  name: "update_guest_settings",
180165
180675
  description: "Update workspace guest settings. Control read-only guest access and guest sign-up permissions.",
180166
- category: CATEGORY27,
180676
+ category: CATEGORY28,
180167
180677
  inputSchema: updateGuestSettingsParamsJsonSchema,
180168
180678
  handler: createEncodedWorkspaceToolHandler(
180169
180679
  "update_guest_settings",
@@ -180175,7 +180685,7 @@ var workspaceTools = [
180175
180685
  {
180176
180686
  name: "create_access_link",
180177
180687
  description: "Create a Huly workspace access link. Defaults to role GUEST. Supports anonymous reusable guest links by setting personalized=false with notBefore and expiration, and can restrict access to specific Huly space IDs via spaces.",
180178
- category: CATEGORY27,
180688
+ category: CATEGORY28,
180179
180689
  inputSchema: createAccessLinkParamsJsonSchema,
180180
180690
  handler: createEncodedWorkspaceToolHandler(
180181
180691
  "create_access_link",
@@ -180187,7 +180697,7 @@ var workspaceTools = [
180187
180697
  {
180188
180698
  name: "get_regions",
180189
180699
  description: "Get available regions for workspace creation. Returns region codes and display names.",
180190
- category: CATEGORY27,
180700
+ category: CATEGORY28,
180191
180701
  inputSchema: getRegionsParamsJsonSchema,
180192
180702
  handler: createEncodedWorkspaceToolHandler(
180193
180703
  "get_regions",
@@ -180203,6 +180713,7 @@ var allTools = [
180203
180713
  ...projectTools,
180204
180714
  ...issueTools,
180205
180715
  ...labelTools,
180716
+ ...tagTools,
180206
180717
  ...tagCategoryTools,
180207
180718
  ...commentTools,
180208
180719
  ...deletionTools,