mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-11 05:31:46 +02:00
Settle published, successful Slack turns as Idle; resume the same conversation on an admitted message. Preserve unfinished work, delivery errors, and explicit dispositions. Verified through focused lifecycle/API/UI tests, full CI, and a real staging Slack conversation in the embedded browser. Co-Authored-By: Paperclip <noreply@paperclip.ing>
17 lines
664 B
TypeScript
17 lines
664 B
TypeScript
import { nonIdleSlackIssueCondition } from "./slack-conversation-state.js";
|
|
import { and, isNull, type SQL } from "drizzle-orm";
|
|
import { issues } from "@paperclipai/db";
|
|
|
|
export function visibleIssueCondition(): SQL {
|
|
return and(isNull(issues.hiddenAt), isNull(issues.harnessKind))!;
|
|
}
|
|
|
|
export function visibleIssueSql(alias = "issues") {
|
|
return `"${alias}"."hidden_at" IS NULL AND "${alias}"."harness_kind" IS NULL`;
|
|
}
|
|
|
|
/** Work queues and execution totals omit persistent conversation containers. */
|
|
export function executionIssueCondition(): SQL {
|
|
return and(visibleIssueCondition(), isNull(issues.conversationAgentId), nonIdleSlackIssueCondition())!;
|
|
}
|