{ "format_version": 1, "id": "call", "name": "Call", "plural": "Calls", "record_route": "/calls/call/[id]", "picture": { "photo": "photo:2eadfa7a8a8468dd21d7ffcff0f4efe44a9c5a4d1d4866f5ef9f6ab8bcf61e31", "object": "tool-calls" }, "builtin": true, "delete": false, "engine": "calls", "columns": [ { "key": "handle", "name": "Number", "type": "text", "readonly": true }, { "key": "person_id", "name": "Person", "type": "link", "link_to": "person", "readonly": true }, { "key": "direction", "type": "choice", "choices": [ "in", "out" ], "readonly": true }, { "key": "outcome", "type": "choice", "choices": [ "answered", "missed", "cancelled", "failed" ], "readonly": true }, { "key": "started_at", "name": "When", "type": "date", "readonly": true, "fact": true, "reading": "{value}", "format": "calendar-datetime" }, { "key": "duration_s", "name": "Length", "type": "number", "readonly": true, "format": "duration", "fact": true, "reading": "{value}", "units": { "one": "second", "other": "seconds", "zero": "" } }, { "key": "provider", "name": "How", "type": "text", "readonly": true, "format": "app-name", "fact": true, "reading": "{value}", "labels": { "cellular": "Phone call", "facetime_audio": "FaceTime audio", "facetime_video": "FaceTime video", "whatsapp": "WhatsApp", "com.apple.telephony": "Phone call", "com.apple.facetime": "FaceTime", "com.skype.skype": "Skype", "com.skype.skypeforiphone": "Skype", "com.microsoft.skype.teams": "Microsoft Teams", "us.zoom.videomeetings": "Zoom", "com.google.meetings": "Google Meet", "com.google.gvdialer": "Google Voice", "ph.telegra.telegraph": "Telegram", "org.whispersystems.signal": "Signal", "com.viber": "Viber", "com.facebook.messenger": "Messenger", "com.burbn.instagram": "Instagram", "jp.naver.line": "LINE", "com.tencent.xin": "WeChat", "com.hammerandchisel.discord": "Discord", "com.tinyspeck.chatlyio": "Slack", "com.cisco.webex.meetings": "Webex", "net.whatsapp.whatsapp": "WhatsApp", "net.whatsapp.whatsappsmb": "WhatsApp Business" } }, { "key": "device", "name": "Read by", "type": "text", "readonly": true }, { "key": "title", "type": "text", "readonly": true }, { "key": "photo", "type": "photo", "readonly": true }, { "key": "outcome_label", "name": "What happened", "type": "choice", "readonly": true, "choices": [ "incoming", "outgoing", "missed", "no answer", "cancelled", "failed" ], "labels": { "incoming": "Incoming call", "outgoing": "Outgoing call", "missed": "Missed call", "no answer": "No answer", "cancelled": "Cancelled call", "failed": "Failed call" }, "red_when": [ "missed" ] }, { "key": "live", "name": "Called here", "type": "bool", "readonly": true }, { "key": "kind", "name": "Kind", "type": "choice", "choices": [ "audio", "video" ], "readonly": true, "fact": true, "reading": "{value}", "labels": { "audio": "Audio call", "video": "Video call" } }, { "key": "ended_at", "name": "Ended", "type": "date", "readonly": true }, { "key": "who", "name": "People", "type": "text", "readonly": true }, { "key": "link", "name": "Meeting link", "type": "text", "readonly": true }, { "key": "recording", "name": "Recording", "type": "file", "readonly": true }, { "key": "meeting", "name": "Recording and transcript", "type": "link", "link_to": "meeting", "readonly": true }, { "key": "recording_phase", "name": "Recording state", "type": "choice", "choices": [ "asked", "on", "off" ], "readonly": true } ], "title": "title", "date": "started_at", "project": null, "order": null, "slip": { "title": "title", "subtitle": [ "outcome_label", "duration_s" ], "trailing": "started_at", "photo": "photo", "toggle": null, "caption": { "dates": [], "fields": [ "started_at" ] } }, "tile": { "face": "slip-list", "current": { "column": "started_at", "days": 2 } }, "page": [ { "heading": null, "columns": [ "title", "photo", "outcome_label" ] }, { "heading": null, "columns": [ "started_at", "duration_s" ] }, { "heading": null, "columns": [ "kind", "who", "ended_at", "meeting" ] }, { "heading": "Details", "columns": [ "handle", "provider" ] } ], "readonly_when": "started_at", "sort": { "column": "started_at", "descending": true }, "day_grouping": "started_at", "actions": [ { "label": "Call back", "column": "handle", "scheme": "tel", "scheme_column": "provider", "schemes": { "facetime_video": "facetime", "facetime_audio": "facetime-audio" } }, { "label": "Message", "column": "handle", "scheme": "sms" } ], "instructions": "Calls made here appear beside imported phone history. Imported history is read-only. A call shows who joined, when it happened and how long it lasted, with its meeting link, recording and transcript when present. Recording starts after everyone has seen its notice and heard its tone.", "empty": { "title": "No calls yet", "message": "Calls placed here and imported phone history appear here." }, "commands": [ { "id": "person", "label": "Open person", "object": "person", "kind": "open", "opens": "person_id" }, { "id": "end", "label": "End call", "kind": "update", "method": "calls.end", "data": { "whole": true }, "bindings": { "call": "$id" }, "when": { "live": true, "ended_at": false }, "destructive": true, "confirm": "End this call for everyone?", "receipt": "Call ended", "does": "destroys" }, { "id": "record", "label": "Record", "kind": "update", "method": "calls.recording", "data": { "action": "start" }, "bindings": { "call": "$id" }, "when": { "live": true, "ended_at": false, "started_at": { "not": false }, "recording_phase": { "not": [ "asked", "on" ] } }, "receipt": "Asking everyone to agree to recording", "does": "moves" }, { "id": "revoke_link", "label": "Revoke link", "object": "link", "kind": "update", "method": "calls.revokeLink", "bindings": { "call": "$id" }, "when": { "live": true, "ended_at": false, "link": { "not": false } }, "destructive": true, "confirm": "Anyone with this link can no longer join.", "receipt": "Call link revoked", "does": "destroys" }, { "id": "meeting", "label": "Open recording", "object": "file", "kind": "open", "opens": "meeting", "when": { "live": true } } ], "parts": { "shape": "sheet", "head": { "facts": [ "started_at", "duration_s", "provider", "kind" ] }, "links": [], "lists": [], "acts": { "more": [ "record", "end", "revoke_link", "meeting" ] }, "cards": [ { "column": "person_id" }, { "column": "outcome_label", "object": "phone" } ], "strip": [] }, "tool": { "name": "Calls", "key": "calls", "icon": "phone", "card_stock": "rose", "route": "/calls/history" ,"purpose":"Your calls and when they happened."}, "tables": [ { "name": "cotton_call_log", "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": "source", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n source TEXT NOT NULL", "position": 2 }, { "name": "external_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n external_id TEXT NOT NULL", "position": 3 }, { "name": "provider", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n provider TEXT NOT NULL", "position": 4 }, { "name": "direction", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n direction TEXT NOT NULL", "position": 5 }, { "name": "outcome", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n outcome TEXT NOT NULL", "position": 6 }, { "name": "started_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n started_at TEXT NOT NULL", "position": 7 }, { "name": "duration_s", "type": "INTEGER", "default": "0", "nullable": false, "primary_key": false, "declaration": "\n duration_s INTEGER NOT NULL DEFAULT 0", "position": 8 }, { "name": "handle", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n handle TEXT", "position": 9 }, { "name": "contact_id", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n contact_id TEXT", "position": 10 }, { "name": "person_id", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n person_id TEXT", "position": 11 }, { "name": "device", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n device TEXT", "position": 12 }, { "name": "meta", "type": "TEXT", "default": "'{}'", "nullable": false, "primary_key": false, "declaration": "\n meta TEXT NOT NULL DEFAULT '{}'", "position": 13 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 14 }, { "name": "updated_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n updated_at TEXT NOT NULL", "position": 15 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 16 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 17 } ], "constraints": [ { "declaration": "\n UNIQUE (workspace_id, source, external_id)", "position": 18 }, { "declaration": "\n CHECK (source IN ('ios_call_history', 'android_call_log'))", "position": 19 }, { "declaration": "\n CHECK (direction IN ('in', 'out'))", "position": 20 }, { "declaration": "\n CHECK (outcome IN ('answered', 'missed', 'cancelled', 'failed'))", "position": 21 }, { "declaration": "\n CHECK (length(trim(external_id)) > 0)", "position": 22 }, { "declaration": "\n CHECK (length(trim(provider)) > 0)", "position": 23 }, { "declaration": "\n CHECK (duration_s >= 0)", "position": 24 }, { "declaration": "\n CHECK (json_type(meta) = 'object')", "position": 25 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 26 } ], "prefix": "CREATE TABLE cotton_call_log (", "suffix": ")", "indexes": [ "CREATE INDEX idx_cotton_call_log_started ON cotton_call_log (workspace_id, started_at DESC)", "CREATE INDEX idx_cotton_call_log_person ON cotton_call_log (person_id)", "CREATE INDEX idx_cotton_call_log_contact ON cotton_call_log (contact_id)", "CREATE INDEX IF NOT EXISTS idx_cotton_call_log_author ON cotton_call_log (substr(_hlc, 20), _hlc)" ], "full_text": [], "triggers": [] } ], "create": { "label": "Make a call link", "path": "/calls/link" } }