@firfi/huly-mcp 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +36 -29
- package/dist/index.js +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -30
package/dist/index.cjs
CHANGED
|
@@ -82791,7 +82791,7 @@ var require_client6 = __commonJS({
|
|
|
82791
82791
|
var import_core46 = require_lib4();
|
|
82792
82792
|
var import_platform2 = require_lib();
|
|
82793
82793
|
var import_config8 = require_config();
|
|
82794
|
-
var
|
|
82794
|
+
var import_markup9 = require_markup();
|
|
82795
82795
|
var import_utils14 = require_utils9();
|
|
82796
82796
|
async function connect(url4, options) {
|
|
82797
82797
|
const config3 = await (0, import_config8.loadServerConfig)(url4);
|
|
@@ -82832,7 +82832,7 @@ var require_client6 = __commonJS({
|
|
|
82832
82832
|
this.connection = connection;
|
|
82833
82833
|
this.account = account;
|
|
82834
82834
|
this.client = new import_core46.TxOperations(connection, account.primarySocialId);
|
|
82835
|
-
this.markup = (0,
|
|
82835
|
+
this.markup = (0, import_markup9.createMarkupOperations)(url4, workspace, token, config3);
|
|
82836
82836
|
}
|
|
82837
82837
|
static {
|
|
82838
82838
|
__name(this, "PlatformClientImpl");
|
|
@@ -82861,7 +82861,7 @@ var require_client6 = __commonJS({
|
|
|
82861
82861
|
async processMarkup(_class, id, data) {
|
|
82862
82862
|
const result = {};
|
|
82863
82863
|
for (const [key, value3] of Object.entries(data)) {
|
|
82864
|
-
if (value3 instanceof
|
|
82864
|
+
if (value3 instanceof import_markup9.MarkupContent) {
|
|
82865
82865
|
result[key] = this.markup.uploadMarkup(_class, id, key, value3.content, value3.kind);
|
|
82866
82866
|
} else {
|
|
82867
82867
|
result[key] = value3;
|
|
@@ -172154,10 +172154,24 @@ var import_text3 = __toESM(require_lib9(), 1);
|
|
|
172154
172154
|
|
|
172155
172155
|
// src/huly/operations/channels.ts
|
|
172156
172156
|
var import_core20 = __toESM(require_lib4(), 1);
|
|
172157
|
+
|
|
172158
|
+
// src/huly/operations/markup.ts
|
|
172157
172159
|
var import_text2 = __toESM(require_lib9(), 1);
|
|
172158
172160
|
var import_text_markdown2 = __toESM(require_lib17(), 1);
|
|
172159
|
-
var personIdsAsSocialIdentityRefs = (ids3) => ids3;
|
|
172160
172161
|
var jsonAsMarkup = import_text2.jsonToMarkup;
|
|
172162
|
+
var markupToMarkdownString = (markup) => {
|
|
172163
|
+
const json3 = (0, import_text2.markupToJSON)(markup);
|
|
172164
|
+
return (0, import_text_markdown2.markupToMarkdown)(json3, { refUrl: "", imageUrl: "" });
|
|
172165
|
+
};
|
|
172166
|
+
var markdownToMarkupString = (markdown) => {
|
|
172167
|
+
const json3 = (0, import_text_markdown2.markdownToMarkup)(markdown, { refUrl: "", imageUrl: "" });
|
|
172168
|
+
return jsonAsMarkup(json3);
|
|
172169
|
+
};
|
|
172170
|
+
var optionalMarkdownToMarkup = (md, fallback = "") => md && md.trim() !== "" ? markdownToMarkupString(md) : fallback;
|
|
172171
|
+
var optionalMarkupToMarkdown = (markup, fallback = "") => markup ? markupToMarkdownString(markup) : fallback;
|
|
172172
|
+
|
|
172173
|
+
// src/huly/operations/channels.ts
|
|
172174
|
+
var personIdsAsSocialIdentityRefs = (ids3) => ids3;
|
|
172161
172175
|
var findChannel = (identifier2) => Effect_exports.gen(function* () {
|
|
172162
172176
|
const client = yield* HulyClient;
|
|
172163
172177
|
const channel = yield* findByNameOrId(
|
|
@@ -172171,14 +172185,6 @@ var findChannel = (identifier2) => Effect_exports.gen(function* () {
|
|
|
172171
172185
|
}
|
|
172172
172186
|
return { client, channel };
|
|
172173
172187
|
});
|
|
172174
|
-
var markupToMarkdownString = (markup) => {
|
|
172175
|
-
const json3 = (0, import_text2.markupToJSON)(markup);
|
|
172176
|
-
return (0, import_text_markdown2.markupToMarkdown)(json3, { refUrl: "", imageUrl: "" });
|
|
172177
|
-
};
|
|
172178
|
-
var markdownToMarkupString = (markdown) => {
|
|
172179
|
-
const json3 = (0, import_text_markdown2.markdownToMarkup)(markdown, { refUrl: "", imageUrl: "" });
|
|
172180
|
-
return jsonAsMarkup(json3);
|
|
172181
|
-
};
|
|
172182
172188
|
var buildSocialIdToPersonNameMap = (client, socialIds) => Effect_exports.gen(function* () {
|
|
172183
172189
|
if (socialIds.length === 0) {
|
|
172184
172190
|
return /* @__PURE__ */ new Map();
|
|
@@ -177290,7 +177296,7 @@ var listComments = (params) => Effect_exports.gen(function* () {
|
|
|
177290
177296
|
const validated = yield* Schema_exports.decodeUnknown(Schema_exports.Array(CommentSchema))(
|
|
177291
177297
|
messages.map((msg) => ({
|
|
177292
177298
|
id: msg._id,
|
|
177293
|
-
body: msg.message,
|
|
177299
|
+
body: optionalMarkupToMarkdown(msg.message),
|
|
177294
177300
|
authorId: msg.modifiedBy,
|
|
177295
177301
|
createdOn: msg.createdOn,
|
|
177296
177302
|
modifiedOn: msg.modifiedOn,
|
|
@@ -177313,7 +177319,7 @@ var addComment = (params) => Effect_exports.gen(function* () {
|
|
|
177313
177319
|
});
|
|
177314
177320
|
const commentId = (0, import_core28.generateId)();
|
|
177315
177321
|
const commentData = {
|
|
177316
|
-
message: params.body
|
|
177322
|
+
message: markdownToMarkupString(params.body)
|
|
177317
177323
|
};
|
|
177318
177324
|
yield* client.addCollection(
|
|
177319
177325
|
chunter.class.ChatMessage,
|
|
@@ -177331,7 +177337,8 @@ var addComment = (params) => Effect_exports.gen(function* () {
|
|
|
177331
177337
|
});
|
|
177332
177338
|
var updateComment = (params) => Effect_exports.gen(function* () {
|
|
177333
177339
|
const { client, comment, issue: issue2, project: project3 } = yield* findComment(params);
|
|
177334
|
-
|
|
177340
|
+
const newMarkup = markdownToMarkupString(params.body);
|
|
177341
|
+
if (newMarkup === comment.message) {
|
|
177335
177342
|
return {
|
|
177336
177343
|
commentId: CommentId.make(params.commentId),
|
|
177337
177344
|
issueIdentifier: IssueIdentifier.make(issue2.identifier),
|
|
@@ -177340,7 +177347,7 @@ var updateComment = (params) => Effect_exports.gen(function* () {
|
|
|
177340
177347
|
}
|
|
177341
177348
|
const now2 = yield* Clock_exports.currentTimeMillis;
|
|
177342
177349
|
const updateOps = {
|
|
177343
|
-
message:
|
|
177350
|
+
message: newMarkup,
|
|
177344
177351
|
editedOn: now2
|
|
177345
177352
|
};
|
|
177346
177353
|
yield* client.updateDoc(
|
|
@@ -178085,7 +178092,7 @@ var getComponent = (params) => Effect_exports.gen(function* () {
|
|
|
178085
178092
|
const result = {
|
|
178086
178093
|
id: ComponentId.make(component._id),
|
|
178087
178094
|
label: ComponentLabel.make(component.label),
|
|
178088
|
-
description: component.description,
|
|
178095
|
+
description: optionalMarkupToMarkdown(component.description, void 0),
|
|
178089
178096
|
lead: leadName !== void 0 ? PersonName.make(leadName) : void 0,
|
|
178090
178097
|
project: params.project,
|
|
178091
178098
|
modifiedOn: component.modifiedOn,
|
|
@@ -178106,7 +178113,7 @@ var createComponent = (params) => Effect_exports.gen(function* () {
|
|
|
178106
178113
|
}) : null;
|
|
178107
178114
|
const componentData = {
|
|
178108
178115
|
label: params.label,
|
|
178109
|
-
description: params.description
|
|
178116
|
+
description: optionalMarkdownToMarkup(params.description),
|
|
178110
178117
|
lead: leadRef,
|
|
178111
178118
|
comments: 0
|
|
178112
178119
|
};
|
|
@@ -178125,7 +178132,7 @@ var updateComponent = (params) => Effect_exports.gen(function* () {
|
|
|
178125
178132
|
updateOps.label = params.label;
|
|
178126
178133
|
}
|
|
178127
178134
|
if (params.description !== void 0) {
|
|
178128
|
-
updateOps.description = params.description;
|
|
178135
|
+
updateOps.description = optionalMarkdownToMarkup(params.description);
|
|
178129
178136
|
}
|
|
178130
178137
|
if (params.lead !== void 0) {
|
|
178131
178138
|
if (params.lead === null) {
|
|
@@ -179281,7 +179288,7 @@ var resolveChild = (client, child) => Effect_exports.gen(function* () {
|
|
|
179281
179288
|
title: child.title,
|
|
179282
179289
|
priority: priorityToString(child.priority)
|
|
179283
179290
|
};
|
|
179284
|
-
const withDescription3 = child.description ? { ...base, description: child.description } : base;
|
|
179291
|
+
const withDescription3 = child.description ? { ...base, description: optionalMarkupToMarkdown(child.description) } : base;
|
|
179285
179292
|
const withAssignee = assigneeName !== void 0 ? { ...withDescription3, assignee: PersonName.make(assigneeName) } : withDescription3;
|
|
179286
179293
|
const withComponent = componentLabel !== void 0 ? { ...withAssignee, component: ComponentLabel.make(componentLabel) } : withAssignee;
|
|
179287
179294
|
const estimation = zeroAsUnset(NonNegativeNumber.make(child.estimation));
|
|
@@ -179311,7 +179318,7 @@ var buildTemplateChild = (client, projectId, projectIdentifier, input) => Effect
|
|
|
179311
179318
|
return {
|
|
179312
179319
|
id: (0, import_core35.generateId)(),
|
|
179313
179320
|
title: input.title,
|
|
179314
|
-
description: input.description
|
|
179321
|
+
description: optionalMarkdownToMarkup(input.description),
|
|
179315
179322
|
priority: stringToPriority(input.priority || "no-priority"),
|
|
179316
179323
|
assignee: assigneeRef,
|
|
179317
179324
|
component: componentRef,
|
|
@@ -179354,7 +179361,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
|
|
|
179354
179361
|
const result = {
|
|
179355
179362
|
id: IssueTemplateId.make(template._id),
|
|
179356
179363
|
title: template.title,
|
|
179357
|
-
description: template.description,
|
|
179364
|
+
description: optionalMarkupToMarkdown(template.description),
|
|
179358
179365
|
priority: priorityToString(template.priority),
|
|
179359
179366
|
assignee: assigneeName !== void 0 ? PersonName.make(assigneeName) : void 0,
|
|
179360
179367
|
component: componentLabel !== void 0 ? ComponentLabel.make(componentLabel) : void 0,
|
|
@@ -179399,7 +179406,7 @@ var createIssueTemplate = (params) => Effect_exports.gen(function* () {
|
|
|
179399
179406
|
}
|
|
179400
179407
|
const templateData = {
|
|
179401
179408
|
title: params.title,
|
|
179402
|
-
description: params.description
|
|
179409
|
+
description: optionalMarkdownToMarkup(params.description),
|
|
179403
179410
|
priority,
|
|
179404
179411
|
assignee: assigneeRef,
|
|
179405
179412
|
component: componentRef,
|
|
@@ -179418,7 +179425,7 @@ var createIssueTemplate = (params) => Effect_exports.gen(function* () {
|
|
|
179418
179425
|
var createIssueFromTemplate = (params) => Effect_exports.gen(function* () {
|
|
179419
179426
|
const { client, project: project3, template } = yield* findProjectAndTemplate(params);
|
|
179420
179427
|
const title = params.title ?? template.title;
|
|
179421
|
-
const description = params.description ?? template.description;
|
|
179428
|
+
const description = params.description ?? optionalMarkupToMarkdown(template.description, void 0);
|
|
179422
179429
|
const priority = params.priority ?? priorityToString(template.priority);
|
|
179423
179430
|
const templateAssigneeRef = template.assignee;
|
|
179424
179431
|
const assignee = params.assignee !== void 0 ? params.assignee : templateAssigneeRef !== null ? yield* Effect_exports.gen(function* () {
|
|
@@ -179458,7 +179465,7 @@ var createIssueFromTemplate = (params) => Effect_exports.gen(function* () {
|
|
|
179458
179465
|
const includeChildren = params.includeChildren !== false;
|
|
179459
179466
|
if (includeChildren && template.children.length > 0) {
|
|
179460
179467
|
for (const child of template.children) {
|
|
179461
|
-
const childDescription = child.description !== "" ? child.description : void 0;
|
|
179468
|
+
const childDescription = child.description !== "" ? optionalMarkupToMarkdown(child.description) : void 0;
|
|
179462
179469
|
const childResult = yield* createIssue({
|
|
179463
179470
|
project: params.project,
|
|
179464
179471
|
title: child.title,
|
|
@@ -179502,7 +179509,7 @@ var updateIssueTemplate = (params) => Effect_exports.gen(function* () {
|
|
|
179502
179509
|
updateOps.title = params.title;
|
|
179503
179510
|
}
|
|
179504
179511
|
if (params.description !== void 0) {
|
|
179505
|
-
updateOps.description = params.description;
|
|
179512
|
+
updateOps.description = optionalMarkdownToMarkup(params.description);
|
|
179506
179513
|
}
|
|
179507
179514
|
if (params.priority !== void 0) {
|
|
179508
179515
|
updateOps.priority = stringToPriority(params.priority);
|
|
@@ -180275,7 +180282,7 @@ var getMilestone = (params) => Effect_exports.gen(function* () {
|
|
|
180275
180282
|
const result = {
|
|
180276
180283
|
id: MilestoneId.make(milestone._id),
|
|
180277
180284
|
label: MilestoneLabel.make(milestone.label),
|
|
180278
|
-
description: milestone.description,
|
|
180285
|
+
description: optionalMarkupToMarkdown(milestone.description),
|
|
180279
180286
|
status: milestoneStatusToString(milestone.status),
|
|
180280
180287
|
targetDate: milestone.targetDate,
|
|
180281
180288
|
project: params.project,
|
|
@@ -180289,7 +180296,7 @@ var createMilestone = (params) => Effect_exports.gen(function* () {
|
|
|
180289
180296
|
const milestoneId = (0, import_core38.generateId)();
|
|
180290
180297
|
const milestoneData = {
|
|
180291
180298
|
label: params.label,
|
|
180292
|
-
description: params.description
|
|
180299
|
+
description: optionalMarkdownToMarkup(params.description),
|
|
180293
180300
|
status: import_tracker5.MilestoneStatus.Planned,
|
|
180294
180301
|
targetDate: params.targetDate,
|
|
180295
180302
|
comments: 0
|
|
@@ -180309,7 +180316,7 @@ var updateMilestone = (params) => Effect_exports.gen(function* () {
|
|
|
180309
180316
|
updateOps.label = params.label;
|
|
180310
180317
|
}
|
|
180311
180318
|
if (params.description !== void 0) {
|
|
180312
|
-
updateOps.description = params.description;
|
|
180319
|
+
updateOps.description = optionalMarkdownToMarkup(params.description);
|
|
180313
180320
|
}
|
|
180314
180321
|
if (params.targetDate !== void 0) {
|
|
180315
180322
|
updateOps.targetDate = params.targetDate;
|
package/dist/index.js
CHANGED
|
File without changes
|