{ "format_version": 1, "id": "mood", "name": "Mood", "plural": "Mood", "picture": {"photo": "photo:19e5255f1cea97c055ac8ab9abbecbcdddd7c004eedd4720945ee7da0a6085d6", "object": "tool-mood"}, "builtin": true, "links": [ { "label": "Deleted", "table": "bin", "where": { "table": "mood" } } ], "deletion": { "bin": true }, "engine": "mood", "columns": [ { "key": "line", "name": "Words", "type": "text" }, { "key": "emotions", "name": "Emotions", "type": "choice", "multiple": true, "choices": [ "good", "okay", "low", "happy", "calm", "tired", "stressed", "anxious", "sad", "angry", "excited", "grateful", "afraid", "ashamed", "awful", "bored", "content", "energised", "focused", "frustrated", "great", "guilty", "hopeful", "hurt", "lonely", "loved", "numb", "overwhelmed", "proud", "relieved", "restless" ], "labels": { "good": "Good", "okay": "Okay", "low": "Low", "happy": "Happy", "calm": "Calm", "tired": "Tired", "stressed": "Stressed", "anxious": "Anxious", "sad": "Sad", "angry": "Angry", "excited": "Excited", "grateful": "Grateful", "afraid": "Afraid", "ashamed": "Ashamed", "awful": "Awful", "bored": "Bored", "content": "Content", "energised": "Energised", "focused": "Focused", "frustrated": "Frustrated", "great": "Great", "guilty": "Guilty", "hopeful": "Hopeful", "hurt": "Hurt", "lonely": "Lonely", "loved": "Loved", "numb": "Numb", "overwhelmed": "Overwhelmed", "proud": "Proud", "relieved": "Relieved", "restless": "Restless" } }, { "key": "emotions_by", "name": "Named by", "type": "choice", "choices": [ "user", "assistant" ], "readonly": true, "labels": { "assistant": "your assistant", "user": "You" }, "shown_when": { "column": "emotions_by", "values": [ "assistant" ] } }, { "key": "at", "name": "At", "type": "date", "fact": true, "reading": "{value}", "format": "calendar-datetime" }, { "key": "local_day", "name": "Day", "type": "date", "readonly": true } ], "title": "line", "date": "at", "project": null, "order": null, "slip": { "title": "line", "subtitle": "emotions", "trailing": "at", "photo": null, "toggle": null, "byline": { "column": "emotions_by", "words": { "assistant": "named by the assistant" } } }, "views": [{"face": "chart", "name": "Moments by day", "sizes": ["medium", "large"], "chart": {"kind": "bar", "x": "local_day", "y": "count", "by": "day", "periods": 14}}], "tile": { "face": "slip-list" }, "page": [ { "heading": "This moment", "columns": [ "line", "emotions", "emotions_by", "at" ] } ], "sort": { "column": "at", "descending": true }, "by_day": "local_day", "instructions": "A mood is one moment of how the owner felt: an optional line in their words and the emotion words that name it. There is no score. The day is the local day the writer stamped, never worked out again from the time. Only name emotions the owner expressed.", "chips": { "column": "emotions", "label": "Log a mood", "sends": { "emotions_by": "user" } }, "empty": {"title": "No mood yet"}, "parts": { "shape": "sheet", "head": { "facts": [ "at" ] }, "links": [], "lists": [], "acts": { "more": [], "away": "delete" }, "cards": [ { "column": "emotions" } ], "strip": [] }, "commands": [ { "id": "delete", "label": "Delete", "kind": "delete", "verb": "delete_record", "data": { "table": "mood" }, "bindings": { "id": "$id" }, "confirm": "Undo on the receipt brings it back.", "receipt": "Deleted", "does": "destroys" } ], "tool": { "name": "Mood", "key": "mood", "card_stock": "rose", "icon": "smile", "route": "/mood" ,"purpose":"How you feel over time."} , "tables": [ { "name": "cotton_moods", "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": "at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n at TEXT NOT NULL", "position": 2 }, { "name": "line", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n line TEXT", "position": 3 }, { "name": "emotions", "type": "TEXT", "default": "'[]'", "nullable": false, "primary_key": false, "declaration": "\n emotions TEXT NOT NULL DEFAULT '[]'", "position": 4 }, { "name": "emotions_by", "type": "TEXT", "default": "'assistant'", "nullable": false, "primary_key": false, "declaration": "\n emotions_by TEXT NOT NULL DEFAULT 'assistant'", "position": 5 }, { "name": "local_day", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n local_day TEXT NOT NULL", "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 }, { "name": "trashed_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n trashed_at TEXT", "position": 11 } ], "constraints": [ { "declaration": "\n CHECK (line IS NULL OR (length(trim(line)) > 0 AND length(line) <= 1000))", "position": 12 }, { "declaration": "\n CHECK (json_type(emotions) = 'array')", "position": 13 }, { "declaration": "\n CHECK (emotions_by IN ('user', 'assistant'))", "position": 14 }, { "declaration": "\n CHECK (local_day GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]')", "position": 15 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 16 } ], "prefix": "CREATE TABLE cotton_moods (", "suffix": ")", "indexes": [ "CREATE INDEX idx_cotton_moods_local_day ON cotton_moods (workspace_id, local_day)", "CREATE INDEX idx_cotton_moods_at ON cotton_moods (workspace_id, at DESC)", "CREATE INDEX IF NOT EXISTS idx_cotton_moods_author ON cotton_moods (substr(_hlc, 20), _hlc)" ], "full_text": [ "CREATE VIRTUAL TABLE fts_moods USING fts5(\n line, content = 'cotton_moods', content_rowid = 'rowid',\n tokenize = 'unicode61 remove_diacritics 2'\n )" ], "triggers": [ "CREATE TRIGGER fts_moods_ai AFTER INSERT ON cotton_moods WHEN new.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_moods'), 0) BEGIN\n INSERT INTO fts_moods (rowid, line) VALUES (new.rowid, new.line);\n END", "CREATE TRIGGER fts_moods_ad AFTER DELETE ON cotton_moods WHEN old.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_moods'), 0) BEGIN\n INSERT INTO fts_moods (fts_moods, rowid, line) VALUES ('delete', old.rowid, old.line);\n END", "CREATE TRIGGER fts_moods_au AFTER UPDATE OF line ON cotton_moods\n FOR EACH ROW WHEN old.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_moods'), 0) AND (new.line IS NOT old.line) BEGIN\n INSERT INTO fts_moods (fts_moods, rowid, line) VALUES ('delete', old.rowid, old.line);\n INSERT INTO fts_moods (rowid, line) VALUES (new.rowid, new.line);\n END" ] } ] }