{ "format_version": 1, "id": "person", "name": "Person", "plural": "People", "builtin": true, "visibility": "owner", "title": "full_name", "columns": [ { "key": "full_name", "name": "Name", "type": "text", "required": true, "placeholder": "Their name" }, { "key": "org", "name": "Organisation", "type": "text", "fact": true, "reading": "{value}" }, { "key": "role_title", "name": "Role", "type": "text", "fact": true, "reading": "{value}" }, { "key": "city", "name": "City", "type": "place", "place": { "id": "city_place", "country": "country", "zone": "timezone", "lat": "city_lat", "lng": "city_lng", "version": "city_version" } }, { "key": "summary", "name": "Summary", "type": "longtext", "placeholder": "Add a summary — how you know {first}, and what they do.", "provenance": { "by": "summary_by", "at": "summary_updated_at", "since": "summary_since" } }, { "key": "summary_updated_at", "name": "Summary written", "type": "date", "readonly": true }, { "key": "summary_by", "name": "Summary by", "type": "text", "readonly": true }, { "key": "contact_source", "type": "text", "readonly": true }, { "key": "device_contact_id", "type": "text", "readonly": true }, { "key": "archived_at", "name": "Archived", "type": "date" }, { "key": "merged_into", "name": "Merged into", "type": "link", "link_to": "person", "readonly": true }, { "key": "birth_month", "name": "Birth month", "type": "number", "readonly": true }, { "key": "birth_day", "name": "Birthday", "type": "number", "readonly": true }, { "key": "birth_year", "name": "Birth year", "type": "number", "readonly": true }, { "key": "timezone", "name": "Time zone", "type": "text", "readonly": true, "zone": true }, { "key": "avatar_url", "type": "text", "readonly": true }, { "key": "avatar_key", "name": "Photo", "type": "photo", "opens": { "column": "avatar_photo_id", "table": "photo" } }, { "key": "device_contact_snapshot", "type": "longtext", "readonly": true }, { "key": "city_filled_at", "type": "date", "format": "calendar-datetime", "readonly": true }, { "key": "avatar_photo_id", "name": "Original", "type": "link", "link_to": "photo", "readonly": true, "media": true }, { "key": "trashed_at", "type": "date", "format": "calendar-datetime", "readonly": true }, { "key": "language", "name": "Language", "type": "choice", "choices": [ "en", "hi", "ta", "te", "bn", "mr", "gu", "kn", "ml", "pa", "ur", "ar", "fr", "de", "es", "pt", "it", "nl", "sv", "da", "no", "fi", "is", "pl", "cs", "sk", "hu", "ro", "bg", "el", "ru", "uk", "tr", "he", "fa", "zh", "ja", "ko", "vi", "th", "id", "ms", "fil", "sw", "af", "ca", "eu", "gl", "hr", "sr", "sl", "lt", "lv", "et", "km", "lo", "my", "ne", "si", "am", "az", "hy", "ka", "kk", "uz", "mn", "zu" ], "required": true, "choice_names": { "en": "English", "hi": "Hindi", "ta": "Tamil", "te": "Telugu", "bn": "Bengali", "mr": "Marathi", "gu": "Gujarati", "kn": "Kannada", "ml": "Malayalam", "pa": "Punjabi", "ur": "Urdu", "ar": "Arabic", "fr": "French", "de": "German", "es": "Spanish", "pt": "Portuguese", "it": "Italian", "nl": "Dutch", "sv": "Swedish", "da": "Danish", "no": "Norwegian", "fi": "Finnish", "is": "Icelandic", "pl": "Polish", "cs": "Czech", "sk": "Slovak", "hu": "Hungarian", "ro": "Romanian", "bg": "Bulgarian", "el": "Greek", "ru": "Russian", "uk": "Ukrainian", "tr": "Turkish", "he": "Hebrew", "fa": "Persian", "zh": "Chinese", "ja": "Japanese", "ko": "Korean", "vi": "Vietnamese", "th": "Thai", "id": "Indonesian", "ms": "Malay", "fil": "Filipino", "sw": "Swahili", "af": "Afrikaans", "ca": "Catalan", "eu": "Basque", "gl": "Galician", "hr": "Croatian", "sr": "Serbian", "sl": "Slovenian", "lt": "Lithuanian", "lv": "Latvian", "et": "Estonian", "km": "Khmer", "lo": "Lao", "my": "Burmese", "ne": "Nepali", "si": "Sinhala", "am": "Amharic", "az": "Azerbaijani", "hy": "Armenian", "ka": "Georgian", "kk": "Kazakh", "uz": "Uzbek", "mn": "Mongolian", "zu": "Zulu" }, "default": "en" }, { "key": "face_embedding", "type": "text", "readonly": true }, { "key": "face_embedding_model", "type": "text", "readonly": true }, { "key": "face_embedding_from", "type": "text", "readonly": true }, { "key": "city_place", "name": "Place", "type": "text", "readonly": true }, { "key": "city_lat", "name": "Place latitude", "type": "number", "readonly": true }, { "key": "city_lng", "name": "Place longitude", "type": "number", "readonly": true }, { "key": "city_version", "name": "Place version", "type": "text", "readonly": true }, { "key": "country", "name": "Country", "type": "text", "readonly": true }, { "key": "phones", "name": "Phone", "type": "text", "readonly": true, "multiple": true, "reach": { "kind": "phone", "channel": "thread_channel" } }, { "key": "emails", "name": "Email", "type": "text", "readonly": true, "multiple": true, "reach": "email" }, { "key": "instagrams", "name": "Instagram", "type": "text", "readonly": true, "multiple": true, "reach": "instagram" }, { "key": "birthday", "name": "Birthday", "type": "date", "yearly": true }, { "key": "summary_since", "name": "Since the summary", "type": "text", "readonly": true }, { "key": "thread_channel", "name": "Messages over", "type": "text", "readonly": true }, { "key": "reached_at", "name": "Last reached", "type": "date", "readonly": true, "computed": { "activity": { "handles": "person_handle", "link": "person_id", "op": "latest" } } }, { "key": "reach_90d", "name": "Reached in 90 days", "type": "number", "readonly": true, "computed": { "activity": { "handles": "person_handle", "link": "person_id", "op": "count", "within_days": 90 } } }, { "key": "own_birthdays__wish", "name": "Send wishes", "type": "bool", "hidden": true }, { "key": "own_birthdays__last_wished", "name": "Last wished", "type": "date", "hidden": true }, { "key": "sent_by", "name": "Sent by", "type": "text", "readonly": true }, { "key": "sent_by_number", "name": "Sent from", "type": "text", "readonly": true }, { "key": "sent_at", "name": "Sent", "type": "date", "format": "calendar-datetime", "readonly": true }, { "key": "send_id", "name": "Send", "type": "text", "readonly": true } ], "seal": { "clear": [ "contact_source", "archived_at", "merged_into", "avatar_key", "avatar_photo_id", "trashed_at", "language", "summary_updated_at", "city_filled_at", "own_birthdays__wish", "own_birthdays__last_wished", "sent_at", "send_id" ], "blind": [ "full_name" ] }, "instructions": "A person is someone the owner knows: name, how to reach them, where they work and live, and their birthday. Search for an existing person before adding one, because duplicates split their history. The summary is a short description of who they are to the owner; keep it factual and never invent contact details. A person is archived, never deleted. Never invent a photo; a person with no photo shows none.", "tables": [ { "name": "cotton_people", "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": "full_name", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n full_name TEXT NOT NULL", "position": 2 }, { "name": "org", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n org TEXT", "position": 3 }, { "name": "role_title", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n role_title TEXT", "position": 4 }, { "name": "city", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n city TEXT", "position": 5 }, { "name": "summary", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n summary TEXT", "position": 6 }, { "name": "summary_updated_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n summary_updated_at TEXT", "position": 7 }, { "name": "summary_by", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n summary_by TEXT", "position": 8 }, { "name": "contact_source", "type": "TEXT", "default": "'manual'", "nullable": false, "primary_key": false, "declaration": "\n contact_source TEXT NOT NULL DEFAULT 'manual'", "position": 9 }, { "name": "device_contact_id", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n device_contact_id TEXT", "position": 10 }, { "name": "archived_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n archived_at TEXT", "position": 11 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 12 }, { "name": "updated_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n updated_at TEXT NOT NULL", "position": 13 }, { "name": "birth_month", "type": "INTEGER", "default": null, "nullable": true, "primary_key": false, "declaration": "\n birth_month INTEGER", "position": 14 }, { "name": "birth_day", "type": "INTEGER", "default": null, "nullable": true, "primary_key": false, "declaration": "\n birth_day INTEGER", "position": 15 }, { "name": "birth_year", "type": "INTEGER", "default": null, "nullable": true, "primary_key": false, "declaration": "\n birth_year INTEGER", "position": 16 }, { "name": "timezone", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n timezone TEXT", "position": 17 }, { "name": "avatar_url", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n avatar_url TEXT", "position": 18 }, { "name": "avatar_key", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n avatar_key TEXT", "position": 19 }, { "name": "device_contact_snapshot", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n device_contact_snapshot TEXT", "position": 20 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 21 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 22 }, { "name": "city_filled_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n city_filled_at TEXT", "position": 23 }, { "name": "avatar_photo_id", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n avatar_photo_id TEXT", "position": 24 }, { "name": "trashed_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": " trashed_at TEXT", "position": 25 }, { "name": "language", "type": "TEXT", "default": "'en'", "nullable": false, "primary_key": false, "declaration": " language TEXT NOT NULL DEFAULT 'en' CHECK (length(language) BETWEEN 2 AND 3 AND language NOT GLOB '*[^a-z]*')", "position": 26 }, { "name": "face_embedding", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": " face_embedding TEXT CHECK (face_embedding IS NULL OR length(face_embedding) > 0)", "position": 27 }, { "name": "face_embedding_model", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": " face_embedding_model TEXT CHECK (face_embedding_model IS NULL OR length(face_embedding_model) > 0)", "position": 28 }, { "name": "face_embedding_from", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": " face_embedding_from TEXT CHECK (face_embedding_from IS NULL OR length(face_embedding_from) > 0)", "position": 29 }, { "name": "city_place", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": " city_place TEXT", "position": 30 }, { "name": "country", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": " country TEXT", "position": 31 } ], "constraints": [ { "declaration": "\n CHECK ((birth_day IS NULL) OR ((birth_day >= 1) AND (birth_day <= 31)))", "position": 32 }, { "declaration": "\n CHECK ((birth_month IS NULL) OR ((birth_month >= 1) AND (birth_month <= 12)))", "position": 33 }, { "declaration": "\n CHECK (((birth_month IS NOT NULL) + (birth_day IS NOT NULL)) IN (0, 2))", "position": 34 }, { "declaration": "\n CHECK (contact_source IN ('import', 'manual', 'apple_library'))", "position": 35 }, { "declaration": "\n CHECK ((summary IS NULL) OR (length(summary) <= 4000))", "position": 36 }, { "declaration": "\n CHECK ((summary_by IS NULL) OR (length(trim(summary_by)) > 0))", "position": 37 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 38 } ], "prefix": "CREATE TABLE \"cotton_people\" (", "suffix": ")", "indexes": [ "CREATE INDEX idx_cotton_people_workspace ON cotton_people (workspace_id)", "CREATE UNIQUE INDEX uq_cotton_people_device_contact ON cotton_people (workspace_id, device_contact_id) WHERE device_contact_id IS NOT NULL", "CREATE INDEX idx_cotton_people_city_filled ON cotton_people (workspace_id, city_filled_at) WHERE city_filled_at IS NOT NULL", "CREATE INDEX IF NOT EXISTS idx_cotton_people_author ON cotton_people (substr(_hlc, 20), _hlc)" ], "full_text": [ "CREATE VIRTUAL TABLE fts_people USING fts5(\n full_name, org, role_title, summary, content = 'cotton_people', content_rowid = 'rowid',\n tokenize = 'unicode61 remove_diacritics 2'\n )" ], "triggers": [ "CREATE TRIGGER fts_people_ai AFTER INSERT ON cotton_people WHEN new.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_people'), 0) BEGIN\n INSERT INTO fts_people (rowid, full_name, org, role_title, summary) VALUES (new.rowid, new.full_name, new.org, new.role_title, new.summary);\n END", "CREATE TRIGGER fts_people_ad AFTER DELETE ON cotton_people WHEN old.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_people'), 0) BEGIN\n INSERT INTO fts_people (fts_people, rowid, full_name, org, role_title, summary) VALUES ('delete', old.rowid, old.full_name, old.org, old.role_title, old.summary);\n END", "CREATE TRIGGER fts_people_au AFTER UPDATE OF full_name, org, role_title, summary ON cotton_people\n FOR EACH ROW WHEN old.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_people'), 0) AND (new.full_name IS NOT old.full_name OR new.org IS NOT old.org OR new.role_title IS NOT old.role_title OR new.summary IS NOT old.summary) BEGIN\n INSERT INTO fts_people (fts_people, rowid, full_name, org, role_title, summary) VALUES ('delete', old.rowid, old.full_name, old.org, old.role_title, old.summary);\n INSERT INTO fts_people (rowid, full_name, org, role_title, summary) VALUES (new.rowid, new.full_name, new.org, new.role_title, new.summary);\n END" ] } ], "picture": { "photo": "photo:7d85a3b839e062730add96ea91492c4753f8951d2e7157d7d94552a6a301ec24", "object": "tool-people", "link_object": "people" }, "engine": "people", "voice_words": [ "full_name", "org", "city" ], "date": null, "project": null, "order": null, "slip": { "title": "full_name", "subtitle": [ "org", "role_title", "city" ], "trailing": "timezone", "photo": "avatar_key", "toggle": null, "dye": "blue" }, "tile": { "face": "polaroid-grid" }, "page": [ { "heading": null, "columns": [ "avatar_key", "full_name", "role_title", "org", "city", "language", "birthday", "timezone" ] }, { "heading": "Handles", "list": { "table": "person_handle", "link": "person_id", "limit": 5, "add": "Add a handle" } }, { "heading": "Summary", "columns": [ "summary" ] }, { "heading": "Todos", "list": { "table": "todo", "link": "people", "limit": 4, "columns": 2 } }, { "heading": "Messages", "list": { "table": "thread", "link": "member_people", "limit": 3 } }, { "heading": "Calls", "list": { "table": "call", "link": "person_id", "limit": 3 } }, { "heading": "Notes", "list": { "table": "note", "link": "people", "limit": 3 } }, { "heading": "Events", "list": { "table": "event", "link": "people", "limit": 3 } }, { "heading": "Photos", "list": { "table": "photo", "link": "people", "limit": 6, "columns": 3, "with": [ { "table": "video", "link": "people" } ] } }, { "heading": "Social", "list": { "table": "story", "link": "person_id", "limit": 6, "columns": 3 } }, { "heading": "Is this {first}?", "list": { "table": "face", "link": "suggested_person_id" } }, { "heading": "Documents", "list": { "table": "document", "link": "people", "limit": 3, "columns": 2 } }, { "heading": "Also linked", "links": { "except": [ "todo", "note", "event", "photo", "video", "document", "call", "thread", "face", "owed", "person_handle", "story" ] } } ], "archived": "archived_at", "record_route": "/people/person/[id]", "record_kind": "person", "filing_rank": 4, "role": "person", "projects_read": { "kind": "person", "read": "person", "families": [ "people", "projects" ] }, "owner_sections": [ { "heading": "Voice words", "list": { "table": "voice_word", "limit": 5, "whole": "All voice words" }, "role": "side" }, { "heading": "Devices", "list": { "table": "device", "limit": 1, "whole": "All devices" }, "role": "side" } ], "sort": { "column": "full_name" }, "layout": "cards", "grid": { "columns": 4 }, "empty": { "title": "No people yet.", "message": "Add someone by name, or bring in the contacts that matter from this phone." }, "create": { "label": "Import from contacts", "path": "/people/import" }, "index": "full_name", "search": [ "full_name", "org", "city" ], "delete": false, "links": [ { "label": "Import contacts", "table": "import", "path": "/people/import" } ], "groups": { "stack": "polaroids" }, "tool": { "views": [ { "id": "all", "label": "All", "visibility": "owner", "is_default": true, "read": { "table": "person" }, "sort": { "column": "reached_at", "descending": true, "tie": "full_name", "tie_descending": false } }, { "id": "a_to_z", "label": "A to Z", "is_default": false, "visibility": "owner", "read": { "table": "person" } } ], "name": "People", "purpose": "People and how to reach them.", "key": "people", "icon": "users", "card_stock": "rose", "route": "/people", "figures": [ { "read": "people", "one": "1 person", "many": "{n} people" } ] }, "parts": { "shape": "sheet", "head": { "facts": [ "role_title" ] }, "links": [], "body": "summary", "lists": [ { "table": "person_handle", "relation": "person_id", "heading": "Handles", "main_act": "keep", "keeps": [ "phones", "emails", "instagrams" ] }, { "table": "todo", "relation": "people", "heading": "Todos" }, { "table": "thread", "relation": "member_people", "heading": "Messages" }, { "table": "call", "relation": "person_id", "heading": "Calls" }, { "table": "note", "relation": "people", "heading": "Notes" }, { "table": "event", "relation": "people", "heading": "Events" }, { "table": "photo", "relation": "people", "heading": "Photos", "face": "photos" }, { "table": "story", "relation": "person_id", "heading": "Social" }, { "table": "document", "relation": "people", "heading": "Documents" } ], "acts": { "main": "tel:phones", "more": [ "sms:phones", "mailto:emails" ], "away": "archive" }, "cards": [ { "column": "phones" }, { "column": "emails" }, { "column": "instagrams" }, { "column": "city" }, { "column": "timezone", "when": { "column": "city", "present": false } }, { "column": "birthday" }, { "column": "language", "object": "message" }, { "column": "org", "label": "Works at" }, { "column": "summary", "width": "full" } ], "strip": [] }, "card": { "face": "person.rolodex", "fields": [ { "slot": "photo", "column": "avatar_key" }, { "slot": "title", "column": "full_name" }, { "slot": "subtitle", "column": "role_title", "also": [ "org", "city" ] }, { "slot": "place", "column": "org" }, { "slot": "date", "column": "birthday" }, { "slot": "body", "column": "summary" }, { "slot": "reached", "column": "reached_at", "form": "relative", "line": "field.reached", "also": [ "thread_channel" ] }, { "slot": "phone", "column": "phones" } ], "corner": [ { "column": "birthday", "form": "next_occurrence", "within": 7, "line": "corner.birthday" }, { "column": "reached_at", "form": "since", "behind": 42, "line": "corner.not_reached" } ], "offers": [ "person.rolodex", "person.file", "person.passport" ] }, "related": [ { "label": "threads", "table": "thread", "column": "member_people" }, { "label": "photos", "table": "photo", "column": "people" }, { "label": "events", "table": "event", "column": "people" }, { "label": "todos", "table": "todo", "column": "people" } ], "actions": [ { "label": "Call", "column": "phones", "scheme": "tel", "object": "handset" }, { "label": "Message", "column": "phones", "scheme": "sms", "object": "slip" }, { "label": "Email", "column": "emails", "scheme": "mailto", "object": "envelope" } ], "commands": [ { "id": "archive", "label": "Archive", "object": "archive", "kind": "update", "verb": "archive_person", "bindings": { "id": "$id" }, "when": { "archived_at": false }, "receipt": "Archived", "does": "puts-away" } ], "send": { "columns": [ "full_name", "org", "role_title", "city", "birth_month", "birth_day", "birth_year", "timezone", "avatar_key", "city_place", "country", "phones", "emails", "instagrams", "birthday", "language" ], "files": [ "avatar_key" ], "with": [ { "table": "person_handle", "by": "person_id" } ] } }