Cotton code
500 lines · 11.1 KB · JSONRaw
{  "format_version": 1,  "id": "meetings_meeting",  "name": "Meeting",  "plural": "Meetings",  "builtin": false,  "visibility": "owner",  "engine": null,  "row_key": "take",  "columns": [    {      "key": "take",      "name": "Take",      "type": "text",      "required": true,      "hidden": true    },    {      "key": "title",      "name": "Title",      "type": "text",      "placeholder": "What was this about?"    },    {      "key": "kind",      "name": "Kind",      "type": "choice",      "default": "meeting",      "choices": [        "meeting",        "memo"      ],      "labels": {        "meeting": "Meeting",        "memo": "Voice memo"      }    },    {      "key": "status",      "name": "State",      "type": "choice",      "default": "recording",      "choices": [        "recording",        "waiting",        "transcribing",        "ready",        "failed"      ],      "labels": {        "recording": "Recording",        "waiting": "Waiting to be turned into text",        "transcribing": "Turning it into text",        "ready": "Ready",        "failed": "Did not work"      },      "readonly": true    },    {      "key": "status_why",      "name": "Why",      "type": "text",      "readonly": true    },    {      "key": "started_at",      "name": "Started",      "type": "date",      "format": "calendar-datetime",      "readonly": true    },    {      "key": "ended_at",      "name": "Ended",      "type": "date",      "format": "calendar-datetime",      "readonly": true    },    {      "key": "duration_ms",      "name": "Length",      "type": "number",      "readonly": true    },    {      "key": "audio",      "name": "Recording",      "type": "file",      "readonly": true    },    {      "key": "audio_bytes",      "name": "Size",      "type": "number",      "readonly": true    },    {      "key": "languages",      "name": "Languages",      "type": "text",      "readonly": true    },    {      "key": "speakers",      "name": "Speakers",      "type": "number",      "readonly": true    },    {      "key": "lines",      "name": "Lines",      "type": "number",      "readonly": true    },    {      "key": "transcribed_by",      "name": "Transcribed by",      "type": "text",      "readonly": true    },    {      "key": "transcribed_at",      "name": "Transcribed",      "type": "date",      "format": "calendar-datetime",      "readonly": true    },    {      "key": "transcribe_on",      "name": "Turned into text on",      "type": "choice",      "default": "any",      "choices": [        "any",        "mac",        "phone",        "service"      ],      "labels": {        "any": "Whichever is free first",        "mac": "The Mac",        "phone": "This phone, while charging",        "service": "An outside service"      }    },    {      "key": "asked_at",      "name": "Asked",      "type": "date",      "format": "calendar-datetime",      "readonly": true    },    {      "key": "attempts",      "name": "Tries",      "type": "number",      "readonly": true    },    {      "key": "summary",      "name": "Summary",      "type": "longtext",      "markdown": true    },    {      "key": "actions",      "name": "To do",      "type": "longtext"    },    {      "key": "summarised_by",      "name": "Summary by",      "type": "text"    },    {      "key": "summarised_at",      "name": "Summarised",      "type": "date",      "format": "calendar-datetime"    },    {      "key": "summary_why",      "name": "Why no summary",      "type": "choice",      "choices": [        "no_mac",        "model_missing",        "failed",        "off"      ],      "labels": {        "no_mac": "No Mac has written it yet",        "model_missing": "The Mac has not fetched the summary model",        "failed": "The summary could not be written",        "off": "Summaries are off for this meeting"      },      "readonly": true    },    {      "key": "summarise_on",      "name": "Summarised on",      "type": "choice",      "default": "mac",      "choices": [        "mac",        "off"      ],      "labels": {        "mac": "The Mac, by a model on it",        "off": "Nowhere: no summary"      }    },    {      "key": "summary_asked_at",      "name": "Summary asked",      "type": "date",      "format": "calendar-datetime",      "readonly": true    },    {      "key": "recorded_on",      "name": "Recorded on",      "type": "text",      "readonly": true    },    {      "key": "on_phone",      "name": "On this phone",      "type": "choice",      "choices": [        "absent",        "kept"      ],      "labels": {        "absent": "Not on this phone",        "kept": "On this phone"      },      "readonly": true    },    {      "key": "marks",      "name": "Marked moments",      "type": "longtext",      "readonly": true    },    {      "key": "silenced",      "name": "Silenced stretches",      "type": "longtext",      "readonly": true    },    {      "key": "source",      "name": "Came from",      "type": "choice",      "default": "room",      "choices": [        "room",        "import",        "call"      ],      "labels": {        "room": "Recorded in a room",        "import": "Brought in from a file",        "call": "Notes taken on a call"      },      "readonly": true    },    {      "key": "call",      "name": "Call",      "type": "text",      "readonly": true    },    {      "key": "tracks",      "name": "Tracks",      "type": "longtext",      "readonly": true    },    {      "key": "languages_chosen",      "name": "Languages you chose",      "type": "text"    },    {      "key": "note",      "name": "Saved as note",      "type": "link",      "link_to": "note",      "readonly": true    },    {      "key": "transcribing_on",      "name": "Being turned into words on",      "type": "choice",      "choices": [        "mac",        "phone",        "service"      ],      "labels": {        "mac": "The Mac",        "phone": "A phone",        "service": "An outside service"      },      "readonly": true    }  ],  "seal": {    "clear": [      "take",      "kind",      "status",      "status_why",      "started_at",      "ended_at",      "duration_ms",      "audio",      "audio_bytes",      "lines",      "transcribed_by",      "transcribed_at",      "transcribe_on",      "asked_at",      "attempts",      "summarised_by",      "summarised_at",      "on_phone",      "summary_why",      "summarise_on",      "summary_asked_at",      "source",      "note",      "transcribing_on"    ],    "blind": [      "title",      "summary"    ],    "blind_bytes": {      "summary": 2048    }  },  "title": "title",  "date": "started_at",  "project": null,  "order": null,  "slip": {    "title": "title",    "subtitle": "status",    "trailing": "duration_ms",    "photo": null,    "toggle": null,    "player": "audio"  },  "tile": {    "face": "slip-list"  },  "page": [    {      "heading": null,      "columns": [        "title",        "kind",        "status",        "status_why"      ]    },    {      "heading": null,      "columns": [        "started_at",        "duration_ms",        "languages",        "speakers"      ],      "role": "facts"    },    {      "heading": "Recording",      "columns": [        "audio"      ]    },    {      "heading": "Summary",      "columns": [        "summary",        "summary_why",        "actions"      ]    },    {      "heading": "Details",      "columns": [        "transcribe_on",        "transcribed_by",        "transcribed_at",        "summarised_by",        "summarise_on",        "recorded_on",        "ended_at",        "lines",        "attempts"      ],      "role": "side"    }  ],  "sort": {    "column": "started_at",    "descending": true  },  "day_grouping": "started_at",  "create": {    "label": "Record",    "method": "meetings.record.start"  },  "empty": {    "title": "Nothing recorded yet",    "message": "Tap record to keep a meeting or a voice memo. The words and who said them follow."  },  "deletion": {    "bin": true  },  "links": [    {      "label": "Deleted",      "table": "bin",      "where": {        "table": "meetings_meeting"      }    },    {      "label": "Actions",      "table": "meetings_action",      "where": {        "meeting": "$id"      }    }  ],  "commands": [    {      "id": "transcribe",      "label": "Turn into text again",      "kind": "update",      "method": "meetings.transcribe",      "bindings": {        "id": "$id"      },      "when": {        "status": [          "ready",          "failed"        ]      },      "object": "cycle"    },    {      "id": "summarise",      "label": "Summarise",      "kind": "update",      "method": "meetings.summarise",      "bindings": {        "id": "$id"      },      "when": {        "status": "ready"      },      "object": "slip"    },    {      "id": "export",      "label": "Export",      "kind": "update",      "method": "meetings.export",      "bindings": {        "id": "$id"      },      "object": "parcel"    },    {      "id": "delete",      "label": "Delete",      "kind": "delete",      "verb": "delete_record",      "data": {        "table": "meetings_meeting"      },      "confirm": "It can come back from Deleted, and Undo brings it back now.",      "bindings": {        "id": "$id"      },      "receipt": "Deleted",      "does": "destroys",      "object": "bin"    }  ],  "instructions": "A meeting is one recording made in Cotton Meetings: a meeting (kind meeting) or a voice memo (kind memo). It is a row from the first second: status recording while the phone records, waiting once it stopped and the audio waits to be turned into text, transcribing while a Mac, the phone or (only when the owner turned it on) an outside service does that, then ready, or failed with status_why saying why. The audio is always kept, sealed like every file, so the text can be redone with Turn into text again. Its words are meetings_line rows and who spoke them meetings_speaker rows; languages, speakers, lines and the summary columns are written by the core, never by hand. summary and actions (one to do a line) come only from what was said: quote it and never add a decision or a task nobody spoke. Nothing of a meeting leaves the owner's devices unless the owner turned on an outside service. take is the recording's own id, the same as the row's: a start sent twice is one recording. marks are the moments the person marked while recording, in milliseconds. The summary is made on the person's Mac by a local model (summarised_by mac:llama:<model>) once the meeting is ready, unless summarise_on is off; no cloud model is called by Cotton. An assistant asked to summarise a meeting reads its meetings_line rows and writes summary (markdown points), actions (one to do a line), summarised_by (its own name) and summarised_at, and one meetings_action row per action. summary_why says why there is none yet; summary_asked_at is when the person asked for it again."}