@firfi/huly-mcp 0.1.45 → 0.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -174541,7 +174541,8 @@ var UPDATE_PREFIXES = [
174541
174541
  "stop_",
174542
174542
  "save_",
174543
174543
  "unsave_",
174544
- "remove_"
174544
+ "remove_",
174545
+ "move_"
174545
174546
  ];
174546
174547
  var DELETE_PREFIXES = ["delete_"];
174547
174548
  var matchesPrefix = (name, prefixes) => prefixes.some((p) => name.startsWith(p));
@@ -176430,6 +176431,8 @@ var IssueSummarySchema = Schema_exports.Struct({
176430
176431
  status: StatusName,
176431
176432
  priority: Schema_exports.optional(IssuePrioritySchema),
176432
176433
  assignee: Schema_exports.optional(PersonName),
176434
+ parentIssue: Schema_exports.optional(IssueIdentifier),
176435
+ subIssues: Schema_exports.optional(Schema_exports.Number),
176433
176436
  modifiedOn: Schema_exports.optional(Timestamp)
176434
176437
  }).annotations({
176435
176438
  title: "IssueSummary",
@@ -176445,6 +176448,8 @@ var IssueSchema = Schema_exports.Struct({
176445
176448
  assigneeRef: Schema_exports.optional(PersonRefSchema),
176446
176449
  labels: Schema_exports.optional(Schema_exports.Array(LabelSchema)),
176447
176450
  project: ProjectIdentifier,
176451
+ parentIssue: Schema_exports.optional(IssueIdentifier),
176452
+ subIssues: Schema_exports.optional(Schema_exports.Number),
176448
176453
  modifiedOn: Schema_exports.optional(Timestamp),
176449
176454
  createdOn: Schema_exports.optional(Timestamp),
176450
176455
  dueDate: Schema_exports.optional(Schema_exports.NullOr(Timestamp)),
@@ -176463,6 +176468,9 @@ var ListIssuesParamsSchema = Schema_exports.Struct({
176463
176468
  assignee: Schema_exports.optional(Email.annotations({
176464
176469
  description: "Filter by assignee email"
176465
176470
  })),
176471
+ parentIssue: Schema_exports.optional(IssueIdentifier.annotations({
176472
+ description: "Filter to children of this parent issue (e.g., 'HULY-42')"
176473
+ })),
176466
176474
  titleSearch: Schema_exports.optional(Schema_exports.String.annotations({
176467
176475
  description: "Search issues by title substring (case-insensitive)"
176468
176476
  })),
@@ -176590,6 +176598,20 @@ var RemoveLabelParamsSchema = Schema_exports.Struct({
176590
176598
  title: "RemoveLabelParams",
176591
176599
  description: "Parameters for removing a label from an issue"
176592
176600
  });
176601
+ var MoveIssueParamsSchema = Schema_exports.Struct({
176602
+ project: ProjectIdentifier.annotations({
176603
+ description: "Project identifier (e.g., 'HULY')"
176604
+ }),
176605
+ identifier: IssueIdentifier.annotations({
176606
+ description: "Issue to move (e.g., 'HULY-123')"
176607
+ }),
176608
+ newParent: Schema_exports.NullOr(IssueIdentifier).annotations({
176609
+ description: "New parent issue identifier, or null to make top-level"
176610
+ })
176611
+ }).annotations({
176612
+ title: "MoveIssueParams",
176613
+ description: "Parameters for moving an issue to a new parent or to top-level"
176614
+ });
176593
176615
  var listIssuesParamsJsonSchema = JSONSchema_exports.make(ListIssuesParamsSchema);
176594
176616
  var getIssueParamsJsonSchema = JSONSchema_exports.make(GetIssueParamsSchema);
176595
176617
  var createIssueParamsJsonSchema = JSONSchema_exports.make(CreateIssueParamsSchema);
@@ -176597,6 +176619,7 @@ var updateIssueParamsJsonSchema = JSONSchema_exports.make(UpdateIssueParamsSchem
176597
176619
  var addLabelParamsJsonSchema = JSONSchema_exports.make(AddLabelParamsSchema);
176598
176620
  var removeLabelParamsJsonSchema = JSONSchema_exports.make(RemoveLabelParamsSchema);
176599
176621
  var deleteIssueParamsJsonSchema = JSONSchema_exports.make(DeleteIssueParamsSchema);
176622
+ var moveIssueParamsJsonSchema = JSONSchema_exports.make(MoveIssueParamsSchema);
176600
176623
  var parseIssue = Schema_exports.decodeUnknown(IssueSchema);
176601
176624
  var parseIssueSummary = Schema_exports.decodeUnknown(IssueSummarySchema);
176602
176625
  var parseListIssuesParams = Schema_exports.decodeUnknown(ListIssuesParamsSchema);
@@ -176606,6 +176629,7 @@ var parseUpdateIssueParams = Schema_exports.decodeUnknown(UpdateIssueParamsSchem
176606
176629
  var parseAddLabelParams = Schema_exports.decodeUnknown(AddLabelParamsSchema);
176607
176630
  var parseRemoveLabelParams = Schema_exports.decodeUnknown(RemoveLabelParamsSchema);
176608
176631
  var parseDeleteIssueParams = Schema_exports.decodeUnknown(DeleteIssueParamsSchema);
176632
+ var parseMoveIssueParams = Schema_exports.decodeUnknown(MoveIssueParamsSchema);
176609
176633
 
176610
176634
  // src/domain/schemas/components.ts
176611
176635
  var ComponentSummarySchema = Schema_exports.Struct({
@@ -180658,6 +180682,10 @@ var listIssues = (params) => Effect_exports.gen(function* () {
180658
180682
  if (params.descriptionSearch !== void 0 && params.descriptionSearch.trim() !== "") {
180659
180683
  query.$search = params.descriptionSearch;
180660
180684
  }
180685
+ if (params.parentIssue !== void 0) {
180686
+ const parentIssue = yield* findIssueInProject(client, project3, params.parentIssue);
180687
+ query.attachedTo = parentIssue._id;
180688
+ }
180661
180689
  if (params.component !== void 0) {
180662
180690
  const component = yield* findComponentByIdOrLabel(client, project3._id, params.component);
180663
180691
  if (component !== void 0) {
@@ -180684,12 +180712,15 @@ var listIssues = (params) => Effect_exports.gen(function* () {
180684
180712
  for (const issue2 of issues) {
180685
180713
  const statusName = resolveStatusName(statuses, issue2.status);
180686
180714
  const assigneeName = issue2.$lookup?.assignee?.name;
180715
+ const directParent = issue2.parents.length > 0 ? issue2.parents[issue2.parents.length - 1] : void 0;
180687
180716
  summaries.push({
180688
180717
  identifier: IssueIdentifier.make(issue2.identifier),
180689
180718
  title: issue2.title,
180690
180719
  status: StatusName.make(statusName),
180691
180720
  priority: priorityToString(issue2.priority),
180692
180721
  assignee: assigneeName !== void 0 ? PersonName.make(assigneeName) : void 0,
180722
+ parentIssue: directParent !== void 0 ? IssueIdentifier.make(directParent.identifier) : void 0,
180723
+ subIssues: issue2.subIssues > 0 ? issue2.subIssues : void 0,
180693
180724
  modifiedOn: issue2.modifiedOn
180694
180725
  });
180695
180726
  }
@@ -180737,6 +180768,7 @@ var getIssue = (params) => Effect_exports.gen(function* () {
180737
180768
  "markdown"
180738
180769
  );
180739
180770
  }
180771
+ const directParent = issue2.parents.length > 0 ? issue2.parents[issue2.parents.length - 1] : void 0;
180740
180772
  const result = {
180741
180773
  identifier: IssueIdentifier.make(issue2.identifier),
180742
180774
  title: issue2.title,
@@ -180746,6 +180778,8 @@ var getIssue = (params) => Effect_exports.gen(function* () {
180746
180778
  assignee: assigneeName !== void 0 ? PersonName.make(assigneeName) : void 0,
180747
180779
  assigneeRef,
180748
180780
  project: params.project,
180781
+ parentIssue: directParent !== void 0 ? IssueIdentifier.make(directParent.identifier) : void 0,
180782
+ subIssues: issue2.subIssues > 0 ? issue2.subIssues : void 0,
180749
180783
  modifiedOn: issue2.modifiedOn,
180750
180784
  createdOn: issue2.createdOn,
180751
180785
  dueDate: issue2.dueDate ?? void 0,
@@ -180980,6 +181014,101 @@ var deleteIssue = (params) => Effect_exports.gen(function* () {
180980
181014
  );
180981
181015
  return { identifier: IssueIdentifier.make(issue2.identifier), deleted: true };
180982
181016
  });
181017
+ var moveIssue = (params) => Effect_exports.gen(function* () {
181018
+ const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
181019
+ const oldParentIsIssue = issue2.attachedToClass === tracker.class.Issue;
181020
+ let newAttachedTo;
181021
+ let newAttachedToClass;
181022
+ let newCollection;
181023
+ let newParents;
181024
+ let newParentIdentifier;
181025
+ if (params.newParent !== null) {
181026
+ const parentIssue = yield* findIssueInProject(client, project3, params.newParent);
181027
+ newAttachedTo = parentIssue._id;
181028
+ newAttachedToClass = tracker.class.Issue;
181029
+ newCollection = "subIssues";
181030
+ newParents = [
181031
+ ...parentIssue.parents,
181032
+ {
181033
+ parentId: parentIssue._id,
181034
+ identifier: parentIssue.identifier,
181035
+ parentTitle: parentIssue.title,
181036
+ space: project3._id
181037
+ }
181038
+ ];
181039
+ newParentIdentifier = parentIssue.identifier;
181040
+ } else {
181041
+ newAttachedTo = project3._id;
181042
+ newAttachedToClass = tracker.class.Project;
181043
+ newCollection = "issues";
181044
+ newParents = [];
181045
+ }
181046
+ const updateOps = {
181047
+ attachedTo: toRef(newAttachedTo),
181048
+ attachedToClass: newAttachedToClass,
181049
+ collection: newCollection,
181050
+ parents: newParents
181051
+ };
181052
+ yield* client.updateDoc(
181053
+ tracker.class.Issue,
181054
+ project3._id,
181055
+ issue2._id,
181056
+ updateOps
181057
+ );
181058
+ if (oldParentIsIssue) {
181059
+ yield* client.updateDoc(
181060
+ tracker.class.Issue,
181061
+ project3._id,
181062
+ // issue.attachedTo is Ref<Doc>; for sub-issues it points to the parent issue.
181063
+ // Cast needed because updateDoc expects Ref<HulyIssue> but attachedTo is Ref<Doc>.
181064
+ toRef(issue2.attachedTo),
181065
+ { $inc: { subIssues: -1 } }
181066
+ );
181067
+ }
181068
+ if (params.newParent !== null) {
181069
+ yield* client.updateDoc(
181070
+ tracker.class.Issue,
181071
+ project3._id,
181072
+ toRef(newAttachedTo),
181073
+ { $inc: { subIssues: 1 } }
181074
+ );
181075
+ }
181076
+ if (issue2.subIssues > 0) {
181077
+ yield* updateDescendantParents(client, project3._id, issue2, newParents);
181078
+ }
181079
+ const result = {
181080
+ identifier: IssueIdentifier.make(issue2.identifier),
181081
+ moved: true
181082
+ };
181083
+ if (newParentIdentifier !== void 0) {
181084
+ return { ...result, newParent: IssueIdentifier.make(newParentIdentifier) };
181085
+ }
181086
+ return result;
181087
+ });
181088
+ var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) => Effect_exports.gen(function* () {
181089
+ const thisParentInfo = {
181090
+ parentId: parentIssue._id,
181091
+ identifier: parentIssue.identifier,
181092
+ parentTitle: parentIssue.title,
181093
+ space: spaceId
181094
+ };
181095
+ const children = yield* client.findAll(
181096
+ tracker.class.Issue,
181097
+ { attachedTo: parentIssue._id, space: spaceId }
181098
+ );
181099
+ for (const child of children) {
181100
+ const childNewParents = [...parentNewParents, thisParentInfo];
181101
+ yield* client.updateDoc(
181102
+ tracker.class.Issue,
181103
+ spaceId,
181104
+ child._id,
181105
+ { parents: childNewParents }
181106
+ );
181107
+ if (child.subIssues > 0) {
181108
+ yield* updateDescendantParents(client, spaceId, child, childNewParents);
181109
+ }
181110
+ }
181111
+ });
180983
181112
 
180984
181113
  // src/huly/operations/issue-templates.ts
180985
181114
  var findTemplateByIdOrTitle = (client, projectId, templateIdOrTitle) => Effect_exports.gen(function* () {
@@ -181638,7 +181767,7 @@ var CATEGORY10 = "issues";
181638
181767
  var issueTools = [
181639
181768
  {
181640
181769
  name: "list_issues",
181641
- description: "Query Huly issues with optional filters. Returns issues sorted by modification date (newest first). Supports filtering by project, status, assignee, and milestone. Supports searching by title substring (titleSearch) and description content (descriptionSearch).",
181770
+ description: "Query Huly issues with optional filters. Returns issues sorted by modification date (newest first). Supports filtering by project, status, assignee, component, and parentIssue (to list children of a specific issue). Supports searching by title substring (titleSearch) and description content (descriptionSearch).",
181642
181771
  category: CATEGORY10,
181643
181772
  inputSchema: listIssuesParamsJsonSchema,
181644
181773
  handler: createToolHandler(
@@ -181713,6 +181842,17 @@ var issueTools = [
181713
181842
  deleteIssue
181714
181843
  )
181715
181844
  },
181845
+ {
181846
+ name: "move_issue",
181847
+ description: "Move an issue to a new parent (making it a sub-issue) or to top-level (null). Updates parent/child relationships and sub-issue counts.",
181848
+ category: CATEGORY10,
181849
+ inputSchema: moveIssueParamsJsonSchema,
181850
+ handler: createToolHandler(
181851
+ "move_issue",
181852
+ parseMoveIssueParams,
181853
+ moveIssue
181854
+ )
181855
+ },
181716
181856
  {
181717
181857
  name: "list_components",
181718
181858
  description: "List components in a Huly project. Components organize issues by area/feature. Returns components sorted by modification date (newest first).",