Inbox Item Helpers (lib/inbox.ts)

omnigent · web/src/lib/inbox.ts · typescript · Apache-2.0
ui, email, chat, automation, lang:typescript, tag:grouping, tag:pure-functions

Pure TypeScript helpers that assemble session rows, pending elicitations, comments, and read-state into grouped inbox items for the Inbox page. Reuse for testable inbox/notification aggregation logic.

// Source: https://github.com/omnigent-ai/omnigent | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Pure helpers for the Inbox page (`/inbox`): turn session rows,
// their snapshot `pending_elicitations` payloads, and their read-state
// into render-ready items. Kept free of React/store imports so the
// assembly logic is unit-testable in isolation.

import type { Comment } from "@/hooks/useComments";
import type { Conversation } from "@/hooks/useConversations";
import type { ElicitationRequest } from "./events";
import { parseEvent } from "./sse";

/** One pending approval prompt, paired with the session that owns it. */
export interface InboxItem {
  /**
   * Sidebar row of th

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key