{ "format_version": 1, "id": "email_sender", "name": "Email sender", "plural": "Email senders", "picture": null, "builtin": true, "engine": "email", "columns": [ { "key": "name", "type": "text", "readonly": true }, { "key": "address", "type": "text", "readonly": true, "fact": true, "reading": "{value}" }, { "key": "last_at", "type": "date", "readonly": true, "name": "Latest email" }, { "key": "email_count", "type": "number", "readonly": true, "name": "Emails", "units": { "one": "email", "other": "emails", "zero": "0 emails" } }, { "key": "unread_count", "type": "number", "readonly": true, "name": "Unread", "units": { "one": "unread email", "other": "unread emails", "zero": "0 unread emails" } }, { "key": "blocked", "type": "bool", "readonly": true, "name": "Blocked" }, { "key": "kind", "name": "Is", "type": "choice", "readonly": true, "choices": [ "person", "service", "junk" ], "labels": { "person": "Person", "service": "Service", "junk": "Junk" } }, { "key": "in_people", "name": "In People", "type": "bool", "readonly": true }, { "key": "reason", "name": "Why", "type": "text", "readonly": true } ], "title": "name", "date": "last_at", "project": null, "order": null, "slip": { "title": "name", "subtitle": "address", "trailing": "last_at", "photo": null, "toggle": null, "caption": { "columns": [ "email_count" ] } }, "tile": { "face": "slip-list" }, "page": [ { "heading": null, "columns": [ "name", "address", "email_count", "unread_count", "last_at", "blocked", "kind", "reason" ] } ], "parts": { "shape": "sheet", "head": { "facts": [ "address" ] }, "links": [], "lists": [ { "table": "email_thread", "match": { "column": "sender_address", "parent": "address" }, "heading": "Mail" } ], "acts": { "more": [ "keep", "junk", "add_to_people" ] }, "cards": [ { "column": "kind" }, { "column": "last_at" }, { "column": "unread_count" }, { "column": "blocked" } ], "strip": [] }, "commands": [ { "id": "junk", "label": "Block sender", "object": "block", "kind": "update", "verb": "block_sender", "bindings": { "address": "$id" }, "when": { "blocked": false }, "receipt": "Moved {name} to Junk", "destructive": true, "confirm": "Mail from this sender goes to Junk from now on. Keep brings it back.", "does": "destroys" }, { "id": "keep", "label": "Keep", "kind": "update", "verb": "unblock_sender", "bindings": { "address": "$id" }, "when": { "blocked": true }, "receipt": "Kept {name}", "does": "completes" }, { "id": "add_to_people", "label": "Add person", "kind": "create", "verb": "add_sender_to_people", "bindings": { "address": "$id" }, "when": { "in_people": false, "blocked": false }, "receipt": "Added to People", "does": "moves" } ], "instructions": "Imported email archive. Ingest and Gmail sync run in Rust. Cotton has no send or reply verb. Never create imported mail as a substitute for delivery.", "delete": false, "empty": {"title": "No senders in this view", "message": "Senders appear here as email arrives from connected accounts."} , "tables": [ { "name": "cotton_blocked_senders", "columns": [ { "name": "id", "type": "TEXT", "default": null, "nullable": true, "primary_key": true, "declaration": "\n id TEXT PRIMARY KEY", "position": 0 }, { "name": "workspace_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n workspace_id TEXT NOT NULL", "position": 1 }, { "name": "address", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n address TEXT NOT NULL", "position": 2 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 3 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 4 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 5 } ], "constraints": [ { "declaration": "\n UNIQUE (workspace_id, address)", "position": 6 }, { "declaration": "\n CHECK (length(address) > 0)", "position": 7 }, { "declaration": "\n CHECK (address = lower(address))", "position": 8 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 9 } ], "prefix": "CREATE TABLE cotton_blocked_senders (", "suffix": ")", "indexes": [ "CREATE INDEX idx_cotton_blocked_senders_address ON cotton_blocked_senders (workspace_id, address)", "CREATE INDEX IF NOT EXISTS idx_cotton_blocked_senders_author ON cotton_blocked_senders (substr(_hlc, 20), _hlc)" ], "full_text": [], "triggers": [] }, { "name": "cotton_email_senders", "columns": [ { "name": "id", "type": "TEXT", "default": null, "nullable": true, "primary_key": true, "declaration": "\n id TEXT PRIMARY KEY", "position": 0 }, { "name": "workspace_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n workspace_id TEXT NOT NULL", "position": 1 }, { "name": "address", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n address TEXT NOT NULL", "position": 2 }, { "name": "kind", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n kind TEXT NOT NULL", "position": 3 }, { "name": "written_to", "type": "INTEGER", "default": "0", "nullable": false, "primary_key": false, "declaration": "\n written_to INTEGER NOT NULL DEFAULT 0", "position": 4 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 5 }, { "name": "updated_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n updated_at TEXT NOT NULL", "position": 6 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 7 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 8 }, { "name": "decided_by", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n decided_by TEXT CHECK (decided_by IS NULL OR decided_by IN ('owner', 'assistant'))", "position": 9 }, { "name": "verdict", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n verdict TEXT CHECK (verdict IS NULL OR verdict IN ('person', 'service', 'junk'))", "position": 10 }, { "name": "reason", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n reason TEXT", "position": 11 }, { "name": "decided_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n decided_at TEXT", "position": 12 } ], "constraints": [ { "declaration": "\n UNIQUE (workspace_id, address)", "position": 13 }, { "declaration": "\n CHECK (length(address) > 0)", "position": 14 }, { "declaration": "\n CHECK (address = lower(address))", "position": 15 }, { "declaration": "\n CHECK (kind IN ('person', 'service', 'junk'))", "position": 16 }, { "declaration": "\n CHECK (written_to IN (0, 1))", "position": 17 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 18 } ], "prefix": "CREATE TABLE cotton_email_senders (", "suffix": ")", "indexes": [ "CREATE INDEX IF NOT EXISTS idx_cotton_email_senders_author ON cotton_email_senders (substr(_hlc, 20), _hlc)" ], "full_text": [], "triggers": [] } ] }