mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-21 08:22:20 +02:00
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>
18 lines
676 B
TypeScript
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],
|
|
);
|
|
}
|