@firfi/huly-mcp 0.1.30 → 0.1.31

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/README.md CHANGED
@@ -149,7 +149,7 @@ MCP_TRANSPORT=http MCP_HTTP_PORT=8080 MCP_HTTP_HOST=0.0.0.0 npx -y @firfi/huly-m
149
149
  |------|-------------|
150
150
  | `list_issues` | 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). |
151
151
  | `get_issue` | Retrieve full details for a Huly issue including markdown description. Use this to view issue content, comments, or full metadata. |
152
- | `create_issue` | Create a new issue in a Huly project. Description supports markdown formatting. Returns the created issue identifier. |
152
+ | `create_issue` | Create a new issue in a Huly project. Optionally create as a sub-issue by specifying parentIssue. Description supports markdown formatting. Returns the created issue identifier. |
153
153
  | `update_issue` | Update fields on an existing Huly issue. Only provided fields are modified. Description updates support markdown. |
154
154
  | `add_issue_label` | Add a tag/label to a Huly issue. Creates the tag if it doesn't exist in the project. |
155
155
  | `delete_issue` | Permanently delete a Huly issue. This action cannot be undone. |
package/dist/index.cjs CHANGED
@@ -154203,11 +154203,10 @@ var parseIssueIdentifier = (identifier2, projectIdentifier) => {
154203
154203
  }
154204
154204
  return { fullIdentifier: idStr, number: null };
154205
154205
  };
154206
- var findProjectAndIssue = (params) => Effect_exports.gen(function* () {
154207
- const { client, project: project3 } = yield* findProject(params.project);
154206
+ var findIssueInProject = (client, project3, identifierStr) => Effect_exports.gen(function* () {
154208
154207
  const { fullIdentifier, number: number8 } = parseIssueIdentifier(
154209
- params.identifier,
154210
- params.project
154208
+ identifierStr,
154209
+ project3.identifier
154211
154210
  );
154212
154211
  let issue2 = yield* client.findOne(
154213
154212
  tracker.class.Issue,
@@ -154227,10 +154226,15 @@ var findProjectAndIssue = (params) => Effect_exports.gen(function* () {
154227
154226
  }
154228
154227
  if (issue2 === void 0) {
154229
154228
  return yield* new IssueNotFoundError({
154230
- identifier: params.identifier,
154231
- project: params.project
154229
+ identifier: identifierStr,
154230
+ project: project3.identifier
154232
154231
  });
154233
154232
  }
154233
+ return issue2;
154234
+ });
154235
+ var findProjectAndIssue = (params) => Effect_exports.gen(function* () {
154236
+ const { client, project: project3 } = yield* findProject(params.project);
154237
+ const issue2 = yield* findIssueInProject(client, project3, params.identifier);
154234
154238
  return { client, project: project3, issue: issue2 };
154235
154239
  });
154236
154240
  var priorityToStringMap = {
@@ -173659,7 +173663,7 @@ var PostHog = class extends PostHogBackendClient {
173659
173663
  };
173660
173664
 
173661
173665
  // src/version.ts
173662
- var VERSION = true ? "0.1.29" : "0.0.0-dev";
173666
+ var VERSION = true ? "0.1.30" : "0.0.0-dev";
173663
173667
 
173664
173668
  // src/telemetry/posthog.ts
173665
173669
  var POSTHOG_API_KEY = "phc_TGfFqCGdnF0p68wuFzd5WSw1IsBvOJW0YgoMJDyZPjm";
@@ -173680,6 +173684,7 @@ var createPostHogTelemetry = (debug) => {
173680
173684
  properties: {
173681
173685
  session_id: sessionId,
173682
173686
  version: VERSION,
173687
+ $ip: null,
173683
173688
  ...properties
173684
173689
  }
173685
173690
  });
@@ -176005,11 +176010,30 @@ var listProjectsParamsJsonSchema = JSONSchema_exports.make(ListProjectsParamsSch
176005
176010
  var parseListProjectsParams = Schema_exports.decodeUnknown(ListProjectsParamsSchema);
176006
176011
  var parseProject = Schema_exports.decodeUnknown(ProjectSchema);
176007
176012
 
176013
+ // src/utils/normalize.ts
176014
+ var normalizeForComparison = (s) => s.replace(/[-_ ]/g, "").toLowerCase();
176015
+
176008
176016
  // src/domain/schemas/issues.ts
176009
176017
  var IssuePriorityValues = ["urgent", "high", "medium", "low", "no-priority"];
176010
- var IssuePrioritySchema = Schema_exports.Literal(...IssuePriorityValues).annotations({
176018
+ var IssuePriorityLiteral = Schema_exports.Literal(...IssuePriorityValues);
176019
+ var normalizedPriorityLookup = new Map(
176020
+ IssuePriorityValues.map((v) => [normalizeForComparison(v), v])
176021
+ );
176022
+ var IssuePrioritySchema = Schema_exports.transformOrFail(
176023
+ Schema_exports.String,
176024
+ IssuePriorityLiteral,
176025
+ {
176026
+ strict: true,
176027
+ decode: (input, _options, ast) => {
176028
+ const match16 = normalizedPriorityLookup.get(normalizeForComparison(input));
176029
+ return match16 !== void 0 ? ParseResult_exports.succeed(match16) : ParseResult_exports.fail(new ParseResult_exports.Type(ast, input, `Expected one of: ${IssuePriorityValues.join(", ")}`));
176030
+ },
176031
+ encode: ParseResult_exports.succeed
176032
+ }
176033
+ ).annotations({
176011
176034
  title: "IssuePriority",
176012
- description: "Issue priority level"
176035
+ description: "Issue priority level",
176036
+ jsonSchema: { type: "string", enum: [...IssuePriorityValues] }
176013
176037
  });
176014
176038
  var LabelSchema = Schema_exports.Struct({
176015
176039
  title: NonEmptyString2,
@@ -176112,6 +176136,9 @@ var CreateIssueParamsSchema = Schema_exports.Struct({
176112
176136
  })),
176113
176137
  status: Schema_exports.optional(StatusName.annotations({
176114
176138
  description: "Initial status (uses project default if not specified)"
176139
+ })),
176140
+ parentIssue: Schema_exports.optional(IssueIdentifier.annotations({
176141
+ description: "Parent issue identifier (e.g., 'HULY-42') to create as sub-issue"
176115
176142
  }))
176116
176143
  }).annotations({
176117
176144
  title: "CreateIssueParams",
@@ -179487,8 +179514,9 @@ var extractUpdatedSequence = (txResult) => {
179487
179514
  return decoded._tag === "Some" ? decoded.value.object.sequence : void 0;
179488
179515
  };
179489
179516
  var resolveStatusByName = (statuses, statusName, project3) => {
179517
+ const normalizedInput = normalizeForComparison(statusName);
179490
179518
  const matchingStatus = statuses.find(
179491
- (s) => s.name.toLowerCase() === statusName.toLowerCase()
179519
+ (s) => normalizeForComparison(s.name) === normalizedInput
179492
179520
  );
179493
179521
  if (matchingStatus === void 0) {
179494
179522
  return Effect_exports.fail(new InvalidStatusError({ status: statusName, project: project3 }));
@@ -179519,7 +179547,7 @@ var listIssues = (params) => Effect_exports.gen(function* () {
179519
179547
  space: project3._id
179520
179548
  };
179521
179549
  if (params.status !== void 0) {
179522
- const statusFilter = params.status.toLowerCase();
179550
+ const statusFilter = normalizeForComparison(params.status);
179523
179551
  if (statusFilter === "open") {
179524
179552
  const doneAndCanceledStatuses = statuses.filter((s) => s.isDone || s.isCanceled).map((s) => s._id);
179525
179553
  if (doneAndCanceledStatuses.length > 0) {
@@ -179696,6 +179724,25 @@ var createIssue = (params) => Effect_exports.gen(function* () {
179696
179724
  }
179697
179725
  const priority = stringToPriority(params.priority || "no-priority");
179698
179726
  const identifier2 = `${project3.identifier}-${sequence}`;
179727
+ let attachedTo = project3._id;
179728
+ let attachedToClass = tracker.class.Project;
179729
+ let collection = "issues";
179730
+ let parents = [];
179731
+ if (params.parentIssue !== void 0) {
179732
+ const parentIssue = yield* findIssueInProject(client, project3, params.parentIssue);
179733
+ attachedTo = parentIssue._id;
179734
+ attachedToClass = tracker.class.Issue;
179735
+ collection = "subIssues";
179736
+ parents = [
179737
+ ...parentIssue.parents,
179738
+ {
179739
+ parentId: parentIssue._id,
179740
+ identifier: parentIssue.identifier,
179741
+ parentTitle: parentIssue.title,
179742
+ space: project3._id
179743
+ }
179744
+ ];
179745
+ }
179699
179746
  const issueData = {
179700
179747
  title: params.title,
179701
179748
  description: descriptionMarkupRef,
@@ -179711,7 +179758,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
179711
179758
  reportedTime: 0,
179712
179759
  reports: 0,
179713
179760
  subIssues: 0,
179714
- parents: [],
179761
+ parents,
179715
179762
  childInfo: [],
179716
179763
  dueDate: null,
179717
179764
  rank
@@ -179719,9 +179766,9 @@ var createIssue = (params) => Effect_exports.gen(function* () {
179719
179766
  yield* client.addCollection(
179720
179767
  tracker.class.Issue,
179721
179768
  project3._id,
179722
- project3._id,
179723
- tracker.class.Project,
179724
- "issues",
179769
+ attachedTo,
179770
+ attachedToClass,
179771
+ collection,
179725
179772
  issueData,
179726
179773
  issueId
179727
179774
  );
@@ -180117,7 +180164,7 @@ var issueTools = [
180117
180164
  },
180118
180165
  {
180119
180166
  name: "create_issue",
180120
- description: "Create a new issue in a Huly project. Description supports markdown formatting. Returns the created issue identifier.",
180167
+ description: "Create a new issue in a Huly project. Optionally create as a sub-issue by specifying parentIssue. Description supports markdown formatting. Returns the created issue identifier.",
180121
180168
  category: CATEGORY8,
180122
180169
  inputSchema: createIssueParamsJsonSchema,
180123
180170
  handler: createToolHandler(