{ "format_version": 1, "id": "thought", "name": "Thought", "plural": "Thoughts", "builtin": true, "visibility": "owner", "date": "captured_at", "title": "raw_text", "columns": [ { "key": "raw_text", "name": "Words", "type": "longtext", "readonly": true, "placeholder": "Nothing written" }, { "key": "audio_url", "name": "Recording", "type": "file", "readonly": true }, { "key": "captured_at", "name": "Captured", "type": "date", "readonly": true }, { "key": "route_status", "name": "Status", "type": "choice", "choices": [ "pending", "routed", "corrected", "dismissed" ], "labels": { "pending": "Waiting to be filed", "routed": "Filed", "corrected": "Filed by you", "dismissed": "Dismissed" }, "readonly": true, "stamps": { "dismissed": "dropped" } }, { "key": "routed_kind", "name": "Became", "type": "text", "readonly": true }, { "key": "routed_id", "type": "text", "readonly": true }, { "key": "route_confidence", "type": "text", "readonly": true }, { "key": "correction_of", "type": "text", "readonly": true }, { "key": "transcript", "name": "What Cotton heard", "type": "longtext", "readonly": true }, { "key": "route_reason", "type": "text", "readonly": true }, { "key": "route_proposal", "type": "longtext", "readonly": true }, { "key": "routed_records", "type": "longtext", "readonly": true }, { "key": "route_plan", "type": "longtext", "readonly": true }, { "key": "route_plan_user_edited", "type": "bool", "readonly": true }, { "key": "swept_at", "type": "date", "format": "calendar-datetime", "readonly": true }, { "key": "sweep_note", "type": "text", "readonly": true }, { "key": "said_table", "name": "Said in", "type": "text", "readonly": true }, { "key": "said_record_id", "name": "Said on", "type": "text", "readonly": true }, { "key": "trashed_at", "type": "date", "format": "calendar-datetime", "readonly": true }, { "key": "became", "name": "What it became", "type": "text", "readonly": true }, { "key": "standing", "name": "Standing", "type": "choice", "choices": [ "open", "filed" ], "readonly": true, "labels": { "open": "Open", "filed": "Filed" } }, { "key": "story", "name": "Story", "type": "choice", "choices": [ "waiting", "thought", "one", "several", "dismissed" ], "readonly": true, "labels": { "waiting": "Waiting", "thought": "Thought", "one": "One", "several": "Several", "dismissed": "Dismissed" } }, { "key": "became_count", "name": "Records it became", "type": "number", "readonly": true, "units": { "one": "record", "other": "records", "zero": "0 records" } }, { "key": "why", "name": "Why it stopped", "type": "text", "readonly": true }, { "key": "filed_elsewhere", "name": "Filed into another table", "type": "bool", "readonly": true } ], "instructions": "A thought is a quick capture, typed or spoken, before it is filed. Pending thoughts have not been filed yet; routed ones became records such as a todo or a note, corrected ones were filed or re-filed by the owner — into any table, and dismissed ones became nothing. Keep the captured words verbatim; the records it became carry the meaning.", "tables": [ { "name": "cotton_thought_attachments", "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": "thought_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n thought_id TEXT NOT NULL", "position": 2 }, { "name": "record_kind", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n record_kind TEXT NOT NULL", "position": 3 }, { "name": "record_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n record_id TEXT NOT NULL", "position": 4 }, { "name": "position", "type": "INTEGER", "default": null, "nullable": false, "primary_key": false, "declaration": "\n position INTEGER NOT NULL", "position": 5 }, { "name": "caption", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n caption TEXT", "position": 6 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 7 }, { "name": "updated_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n updated_at TEXT NOT NULL", "position": 8 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 9 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 10 } ], "constraints": [ { "declaration": "\n UNIQUE (thought_id, record_kind, record_id)", "position": 11 }, { "declaration": "\n CHECK (record_kind IN ('photo', 'video', 'document'))", "position": 12 }, { "declaration": "\n CHECK (length(record_id) > 0)", "position": 13 }, { "declaration": "\n CHECK (position >= 0)", "position": 14 }, { "declaration": "\n CHECK (caption IS NULL OR length(caption) <= 500)", "position": 15 }, { "declaration": "\n FOREIGN KEY (thought_id) REFERENCES cotton_inbox_items(id)", "position": 16 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 17 } ], "prefix": "CREATE TABLE IF NOT EXISTS cotton_thought_attachments (", "suffix": ")", "indexes": [ "CREATE INDEX IF NOT EXISTS idx_cotton_thought_attachments_author ON cotton_thought_attachments (substr(_hlc, 20), _hlc)", "CREATE INDEX IF NOT EXISTS idx_cotton_thought_attachments_thought ON cotton_thought_attachments (thought_id, position)" ], "full_text": [], "triggers": [] }, { "name": "cotton_inbox_items", "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": "raw_text", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n raw_text TEXT", "position": 2 }, { "name": "audio_url", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n audio_url TEXT", "position": 3 }, { "name": "captured_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n captured_at TEXT NOT NULL", "position": 4 }, { "name": "route_status", "type": "TEXT", "default": "'pending'", "nullable": false, "primary_key": false, "declaration": "\n route_status TEXT NOT NULL DEFAULT 'pending'", "position": 5 }, { "name": "routed_kind", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n routed_kind TEXT", "position": 6 }, { "name": "routed_id", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n routed_id TEXT", "position": 7 }, { "name": "route_confidence", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n route_confidence TEXT", "position": 8 }, { "name": "correction_of", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n correction_of TEXT", "position": 9 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 10 }, { "name": "updated_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n updated_at TEXT NOT NULL", "position": 11 }, { "name": "transcript", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n transcript TEXT", "position": 12 }, { "name": "route_reason", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n route_reason TEXT", "position": 13 }, { "name": "route_proposal", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n route_proposal TEXT", "position": 14 }, { "name": "routed_records", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n routed_records TEXT", "position": 15 }, { "name": "route_plan", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n route_plan TEXT", "position": 16 }, { "name": "route_plan_user_edited", "type": "INTEGER", "default": null, "nullable": true, "primary_key": false, "declaration": "\n route_plan_user_edited INTEGER", "position": 17 }, { "name": "swept_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n -- v20: the chat sweep's two marks on a capture.\n swept_at TEXT", "position": 18 }, { "name": "sweep_note", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n sweep_note TEXT", "position": 19 }, { "name": "said_table", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n -- v75: where the thought was said (Spec 7): the tool's table when it\n -- was said inside one, and the record when it was said on a record's\n -- page. Both NULL for a thought said on the database's own page.\n -- capture.create refuses a record without its table; no constraint here, a\n -- synced row arrives column by column (tests/no_cross_column_checks.rs).\n said_table TEXT", "position": 20 }, { "name": "said_record_id", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n said_record_id TEXT", "position": 21 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 22 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 23 }, { "name": "trashed_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": " trashed_at TEXT", "position": 24 } ], "constraints": [ { "declaration": "\n CHECK ((raw_text IS NOT NULL) OR (audio_url IS NOT NULL))", "position": 25 }, { "declaration": "\n CHECK (route_status IN ('pending', 'routed', 'corrected', 'dismissed'))", "position": 26 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 27 } ], "prefix": "CREATE TABLE \"cotton_inbox_items\" (", "suffix": ")", "indexes": [ "CREATE INDEX idx_cotton_inbox_items_workspace ON cotton_inbox_items (workspace_id, route_status)", "CREATE INDEX idx_cotton_inbox_items_said ON cotton_inbox_items (said_table, said_record_id) WHERE said_table IS NOT NULL", "CREATE INDEX IF NOT EXISTS idx_cotton_inbox_items_author ON cotton_inbox_items (substr(_hlc, 20), _hlc)" ], "full_text": [ "CREATE VIRTUAL TABLE fts_thoughts USING fts5(\n raw_text, content = 'cotton_inbox_items', content_rowid = 'rowid',\n tokenize = 'unicode61 remove_diacritics 2'\n )" ], "triggers": [ "CREATE TRIGGER fts_thoughts_ai AFTER INSERT ON cotton_inbox_items WHEN new.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_thoughts'), 0) BEGIN\n INSERT INTO fts_thoughts (rowid, raw_text) VALUES (new.rowid, new.raw_text);\n END", "CREATE TRIGGER fts_thoughts_ad AFTER DELETE ON cotton_inbox_items WHEN old.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_thoughts'), 0) BEGIN\n INSERT INTO fts_thoughts (fts_thoughts, rowid, raw_text) VALUES ('delete', old.rowid, old.raw_text);\n END", "CREATE TRIGGER fts_thoughts_au AFTER UPDATE OF raw_text ON cotton_inbox_items\n FOR EACH ROW WHEN old.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_thoughts'), 0) AND (new.raw_text IS NOT old.raw_text) BEGIN\n INSERT INTO fts_thoughts (fts_thoughts, rowid, raw_text) VALUES ('delete', old.rowid, old.raw_text);\n INSERT INTO fts_thoughts (rowid, raw_text) VALUES (new.rowid, new.raw_text);\n END" ] } ], "picture": { "photo": "photo:5b1d4715a5305ceb5075a7eaad5557b3a1c34f264b23bbd97b56272a468deebd", "object": "tool-thoughts" }, "engine": "thoughts", "project": null, "order": null, "slip": { "title": "raw_text", "subtitle": "became", "trailing": "captured_at", "photo": null, "toggle": null, "title_fallback": "transcript", "links": { "except": [] } }, "tile": { "face": "slip-list", "current": { "column": "captured_at", "days": 2 } }, "page": [ { "heading": null, "columns": [], "when": { "column": "audio_url", "present": true }, "note": "Spoken" }, { "heading": null, "columns": [ "raw_text", "transcript", "audio_url", "captured_at" ] }, { "heading": null, "columns": [], "when": { "column": "route_status", "values": [ "pending" ] }, "note": "Not filed yet — your assistant files it when it next runs", "hand": "{why}" }, { "heading": null, "columns": [], "when": { "column": "story", "values": [ "several" ] }, "hand": "This one became {became_count} records." }, { "heading": null, "columns": [], "when": { "column": "story", "values": [ "thought" ] }, "note": "Stayed a thought — nothing was made of it, and nothing needs to be." }, { "heading": null, "columns": [], "when": { "column": "route_status", "values": [ "dismissed" ] }, "note": "Dismissed — it stays on the record, out of the way." }, { "heading": "What it became", "links": { "except": [] } } ], "page_parts": [ "content", "grid", "sections" ], "record_route": "/thoughts/thought/[id]", "linked_when": { "made": "captured {when}" }, "record_kind": "thought", "role": "thought", "empty": { "title": "No thoughts yet.", "message": "What you capture lands here." }, "create": { "label": "New thought", "path": "/capture" }, "delete": false, "filter": { "column": "standing", "all": "All", "words": { "open": "Open" }, "order": [ "open" ], "empty": { "open": { "title": "Nothing open.", "message": "Every thought you captured has been filed." } } }, "hidden": { "column": "route_status", "values": [ "dismissed" ] }, "voice": { "saved": "Saved as a thought", "undo": "Undo", "undone": "Undone", "opened": "Opened {name}", "back": "Went back", "ran": "Done", "nothing": "Nothing came through", "denied": "The microphone is off", "settings": "Open Settings" }, "commands": [ { "id": "todo", "label": "Make todo", "kind": "update", "verb": "file_thought", "data": { "as": "todo" }, "bindings": { "id": "$id" }, "when": { "story": "waiting" }, "receipt": "Made a todo", "undo": "untodo", "does": "moves", "object": "stamp" }, { "id": "note", "label": "Save note", "kind": "update", "verb": "file_thought", "data": { "as": "note" }, "bindings": { "id": "$id" }, "when": { "story": "waiting" }, "receipt": "Made a note", "undo": "unnote", "does": "moves", "object": "folder" }, { "id": "file", "label": "File", "kind": "update", "verb": "file_thought", "bindings": { "id": "$id" }, "when": { "story": "waiting" }, "receipt": "Filed", "pick_table": "as", "does": "moves", "object": "folder" }, { "id": "untodo", "label": "Undo todo", "kind": "update", "verb": "file_thought", "data": { "as": null }, "bindings": { "id": "$id" }, "when": { "route_status": "corrected", "story": "one", "routed_kind": "todo" }, "receipt": "Waiting to be filed again", "undo": "todo", "object": "folder" }, { "id": "unnote", "label": "Undo note", "kind": "update", "verb": "file_thought", "data": { "as": null }, "bindings": { "id": "$id" }, "when": { "route_status": "corrected", "story": "one", "routed_kind": "note" }, "receipt": "Waiting to be filed again", "undo": "note", "object": "folder" }, { "id": "dismiss", "label": "Dismiss", "kind": "update", "verb": "update_record", "data": { "table": "thought", "patch": { "route_status": "dismissed" } }, "bindings": { "id": "$id" }, "when": { "route_status": "pending" }, "receipt": "Thought dismissed", "does": "puts-away", "object": "folder" } ], "hand_over": { "when": { "column": "story", "values": [ "one" ] } }, "attachments": { "editable": true, "sources": [ "library", "camera" ] }, "tool": { "views": [ { "id": "all", "label": "All", "visibility": "owner", "is_default": true, "read": { "table": "thought" } } ], "name": "Thoughts", "purpose": "Capture something to file or turn into a task.", "key": "thoughts", "icon": "lightbulb", "card_stock": "cream", "route": "/thoughts" }, "parts": { "shape": "desk", "head": { "facts": [ "captured_at" ] }, "links": [], "body": "raw_text", "lists": [], "acts": { "more": [ "todo", "note", "file", "untodo", "unnote" ], "away": "dismiss" }, "strip": [ { "column": "transcript" }, { "column": "audio_url" }, { "column": "captured_at" } ] }, "groups": { "stack": "slips" } }