Files
PaperClipAI/packages/shared/src/issue-creation-source.ts
T
DottaandPaperclip be380ba155 fix(ui): hide agent-created tasks by default (#16157)
Hide agent-created, system-created, and chat-channel tasks from independent collections by default. Preserve task hierarchy context and existing inbox participation. Add a saved opt-in checkbox without helper text.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-13 09:26:37 -05:00

18 lines
676 B
TypeScript

/** Origins that represent a person's ordinary task or onboarding request. */
export const HUMAN_TASK_ORIGIN_KINDS = ["manual", "onboarding_first_task"] as const;
export interface IssueCreationSourceFields {
createdByAgentId?: string | null;
createdByUserId?: string | null;
originKind?: string | null;
}
/** Creation is independent of who is assigned or responsible for execution. */
export function isAgentCreatedIssue(issue: IssueCreationSourceFields): boolean {
return Boolean(issue.createdByAgentId)
|| !issue.createdByUserId
|| !HUMAN_TASK_ORIGIN_KINDS.includes(
(issue.originKind ?? "manual") as typeof HUMAN_TASK_ORIGIN_KINDS[number],
);
}