@defend-tech/opencode-optima 0.1.24 → 0.1.25
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.js +5 -2
- package/dist/sanitize_cli.js +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9235,12 +9235,15 @@ function clickUpCommentAuthorId(comment = {}) {
|
|
|
9235
9235
|
return String(comment.user?.id || comment.user?.userid || comment.author?.id || comment.author_id || comment.user_id || "").trim();
|
|
9236
9236
|
}
|
|
9237
9237
|
function clickUpCommentText(comment = {}) {
|
|
9238
|
-
|
|
9238
|
+
if (Array.isArray(comment.comment)) return comment.comment.map((part) => String(part?.text || "")).join("");
|
|
9239
|
+
return String(comment.comment_text || comment.text || comment.comment || comment.plain_text || comment.text_content || "");
|
|
9239
9240
|
}
|
|
9240
9241
|
function clickUpCommentMentionsProductManager(comment = {}, routing = {}) {
|
|
9241
9242
|
const mentionUserId = String(routing.productManagerMentionUserId || "").trim();
|
|
9242
9243
|
const mentions = Array.isArray(comment.mentions) ? comment.mentions : [];
|
|
9243
9244
|
if (mentionUserId && mentions.some((mention) => String(mention?.id || mention?.userid || mention?.user?.id || mention).trim() === mentionUserId)) return true;
|
|
9245
|
+
const richText = Array.isArray(comment.comment) ? comment.comment : [];
|
|
9246
|
+
if (mentionUserId && richText.some((part) => part?.type === "tag" && String(part?.user?.id || part?.user?.userid || "").trim() === mentionUserId)) return true;
|
|
9244
9247
|
const fallback = String(routing.productManagerMentionName || CLICKUP_PM_MENTION_NAME).trim().toLowerCase();
|
|
9245
9248
|
return fallback ? clickUpCommentText(comment).toLowerCase().includes(`@${fallback}`) : false;
|
|
9246
9249
|
}
|
|
@@ -9584,7 +9587,7 @@ async function routeClickUpWebhookEventUnlocked({ payload, config, state = {}, w
|
|
|
9584
9587
|
if (authorId && authorId === config.routing.ignoredCommentAuthorId) return finish({ ok: true, action: "ignored", reason: "self_authored_comment", taskId });
|
|
9585
9588
|
if (!clickUpCommentMentionsProductManager(comment, config.routing)) return finish({ ok: true, action: "ignored", reason: "missing_product_manager_mention", taskId });
|
|
9586
9589
|
}
|
|
9587
|
-
if (!isClickUpTaskAssignedToProductManager(task, config.routing.productManagerAssigneeId)) return finish({ ok: true, action: "ignored", reason: "not_assigned_to_product_manager", taskId });
|
|
9590
|
+
if (!isCommentEvent && !isClickUpTaskAssignedToProductManager(task, config.routing.productManagerAssigneeId)) return finish({ ok: true, action: "ignored", reason: "not_assigned_to_product_manager", taskId });
|
|
9588
9591
|
if (isClickUpTaskTerminal(task, payload, config.routing.ignoredStatuses)) return finish({ ok: true, action: "ignored", reason: "terminal_status", taskId });
|
|
9589
9592
|
if (clickupClient?.getTask) {
|
|
9590
9593
|
const latestTask = await clickupClient.getTask(taskId);
|
package/dist/sanitize_cli.js
CHANGED
|
@@ -9242,12 +9242,15 @@ function clickUpCommentAuthorId(comment = {}) {
|
|
|
9242
9242
|
return String(comment.user?.id || comment.user?.userid || comment.author?.id || comment.author_id || comment.user_id || "").trim();
|
|
9243
9243
|
}
|
|
9244
9244
|
function clickUpCommentText(comment = {}) {
|
|
9245
|
-
|
|
9245
|
+
if (Array.isArray(comment.comment)) return comment.comment.map((part) => String(part?.text || "")).join("");
|
|
9246
|
+
return String(comment.comment_text || comment.text || comment.comment || comment.plain_text || comment.text_content || "");
|
|
9246
9247
|
}
|
|
9247
9248
|
function clickUpCommentMentionsProductManager(comment = {}, routing = {}) {
|
|
9248
9249
|
const mentionUserId = String(routing.productManagerMentionUserId || "").trim();
|
|
9249
9250
|
const mentions = Array.isArray(comment.mentions) ? comment.mentions : [];
|
|
9250
9251
|
if (mentionUserId && mentions.some((mention) => String(mention?.id || mention?.userid || mention?.user?.id || mention).trim() === mentionUserId)) return true;
|
|
9252
|
+
const richText = Array.isArray(comment.comment) ? comment.comment : [];
|
|
9253
|
+
if (mentionUserId && richText.some((part) => part?.type === "tag" && String(part?.user?.id || part?.user?.userid || "").trim() === mentionUserId)) return true;
|
|
9251
9254
|
const fallback = String(routing.productManagerMentionName || CLICKUP_PM_MENTION_NAME).trim().toLowerCase();
|
|
9252
9255
|
return fallback ? clickUpCommentText(comment).toLowerCase().includes(`@${fallback}`) : false;
|
|
9253
9256
|
}
|
|
@@ -9591,7 +9594,7 @@ async function routeClickUpWebhookEventUnlocked({ payload, config, state = {}, w
|
|
|
9591
9594
|
if (authorId && authorId === config.routing.ignoredCommentAuthorId) return finish({ ok: true, action: "ignored", reason: "self_authored_comment", taskId });
|
|
9592
9595
|
if (!clickUpCommentMentionsProductManager(comment, config.routing)) return finish({ ok: true, action: "ignored", reason: "missing_product_manager_mention", taskId });
|
|
9593
9596
|
}
|
|
9594
|
-
if (!isClickUpTaskAssignedToProductManager(task, config.routing.productManagerAssigneeId)) return finish({ ok: true, action: "ignored", reason: "not_assigned_to_product_manager", taskId });
|
|
9597
|
+
if (!isCommentEvent && !isClickUpTaskAssignedToProductManager(task, config.routing.productManagerAssigneeId)) return finish({ ok: true, action: "ignored", reason: "not_assigned_to_product_manager", taskId });
|
|
9595
9598
|
if (isClickUpTaskTerminal(task, payload, config.routing.ignoredStatuses)) return finish({ ok: true, action: "ignored", reason: "terminal_status", taskId });
|
|
9596
9599
|
if (clickupClient?.getTask) {
|
|
9597
9600
|
const latestTask = await clickupClient.getTask(taskId);
|