Cotton code
345 lines · 7.0 KB · JSONRaw
{  "id": "quota",  "name": "Quota",  "plural": "Quotas",  "picture": null,  "builtin": false,  "visibility": "owner",  "engine": null,  "columns": [    {      "key": "name",      "name": "Account",      "type": "text",      "required": true,      "readonly": false,      "placeholder": "name@example.com"    },    {      "key": "provider",      "name": "Provider",      "type": "choice",      "choices": [        "claude",        "codex",        "api"      ],      "readonly": false,      "format": "words"    },    {      "key": "email",      "name": "Email",      "type": "text",      "readonly": false    },    {      "key": "plan",      "name": "Plan",      "type": "text",      "readonly": false,      "placeholder": "Max 20x"    },    {      "key": "macs",      "name": "Signed in on",      "type": "text",      "readonly": false,      "placeholder": "mac-c"    },    {      "key": "week",      "name": "This week",      "type": "text",      "readonly": false,      "placeholder": "20% used"    },    {      "key": "models",      "name": "By model",      "type": "text",      "readonly": false,      "placeholder": "Opus 30% used · Sonnet 10% used"    },    {      "key": "week_resets",      "name": "Week resets",      "type": "text",      "readonly": false,      "placeholder": "in 4d 8h"    },    {      "key": "resets_line",      "name": "Resets",      "type": "text",      "readonly": false,      "placeholder": "resets in 4d 8h"    },    {      "key": "week_pct",      "name": "Week used, %",      "type": "number",      "readonly": false    },    {      "key": "session",      "name": "5-hour window",      "type": "text",      "readonly": false,      "placeholder": "17% used"    },    {      "key": "session_pct",      "name": "Window used, %",      "type": "number",      "readonly": false    },    {      "key": "extra",      "name": "Extra usage",      "type": "text",      "readonly": false,      "placeholder": "$0 of $250 extra used"    },    {      "key": "status",      "name": "Status",      "type": "choice",      "choices": [        "active",        "idle",        "unreachable"      ],      "readonly": false,      "format": "words",      "tones": {        "active": "green",        "idle": "amber",        "unreachable": "red"      }    },    {      "key": "checked_at",      "name": "Checked",      "type": "date",      "readonly": false,      "format": "ago"    },    {      "key": "week_resets_at",      "name": "Week resets at",      "type": "date",      "readonly": false,      "units": {        "one": "resets in {n}",        "other": "resets in {n}",        "zero": "has reset"      },      "format": "countdown"    },    {      "key": "peak_week_pct",      "name": "Peak this month, %",      "type": "number",      "readonly": true,      "computed": {        "rollup": {          "table": "quota_reading",          "link": "quota",          "op": "max",          "column": "week_pct"        }      }    },    {      "key": "readings",      "name": "Readings kept",      "type": "number",      "readonly": true,      "computed": {        "rollup": {          "table": "quota_reading",          "link": "quota",          "op": "count"        }      }    },    {      "key": "notes",      "name": "Notes",      "type": "longtext",      "markdown": true,      "readonly": false    },    {      "key": "week_trend",      "name": "Week trend",      "type": "text",      "placeholder": "[24, 43, 62]",      "readonly": false    }  ],  "title": "name",  "date": null,  "project": null,  "order": null,  "slip": {    "title": "provider",    "subtitle": [      "email",      "week",      "week_resets_at"    ],    "trailing": "plan",    "photo": null,    "toggle": null,    "caption": {      "columns": [        "checked_at"      ],      "status": "status"    }  },  "tile": {    "face": "slip-list"  },  "page": [    {      "heading": null,      "columns": [        "provider",        "plan",        "macs",        "status"      ]    },    {      "heading": "This week",      "columns": [        "week",        "week_resets",        "week_resets_at",        "peak_week_pct"      ]    },    {      "heading": "Right now",      "columns": [        "session",        "extra",        "checked_at"      ]    },    {      "heading": "History",      "list": {        "table": "quota_reading",        "link": "quota",        "empty": {          "title": "No readings yet"        },        "limit": 24      },      "note": "One reading an hour, kept thirty days."    },    {      "heading": "Notes",      "columns": [        "notes"      ]    }  ],  "sort": {    "column": "provider",    "tie": "week_pct"  },  "group": {    "column": "status",    "sections": [      {        "heading": null,        "values": [          "active"        ]      },      {        "heading": "Idle",        "values": [          "idle"        ]      },      {        "heading": "Unreachable",        "values": [          "unreachable"        ],        "closed": true      }    ]  },  "empty": {    "title": "No accounts yet",    "message": "Each Mac writes the account it is signed in to, every hour."  },  "create": {    "label": "Add an account"  },  "instructions": "One row per AI account the household uses (Claude, Codex, API); the account's email is the row's name and key, and the Mac signed in to it writes the row every hour over MCP. week is the weekly allowance used ('24% used'), resets_line is the list's 'resets in 4d 8h', week_pct the number; models is the week per model where the provider meters one; week_resets is the time left as words and week_resets_at the instant; session is the 5-hour window (Claude only); extra is metered extra usage (Claude dollars, Codex credits); status is active when a reading landed, unreachable when the last read failed. Update a row in place by email, never add one named after a machine; each read also adds a quota_reading row, kept 30 days.",  "card": {    "face": "quota",    "fields": [      {        "slot": "title",        "column": "name"      },      {        "slot": "subtitle",        "column": "plan",        "also": [          "provider"        ]      },      {        "slot": "used",        "column": "week_pct"      },      {        "slot": "share",        "column": "week_pct",        "line": "field.percent_used"      },      {        "slot": "hours_left",        "column": "week_resets_at"      },      {        "slot": "resets_on",        "column": "week_resets_at"      },      {        "slot": "trend",        "column": "week_trend"      },      {        "slot": "period",        "column": "resets_line"      },      {        "slot": "body",        "column": "notes"      },      {        "slot": "date",        "column": "checked_at",        "form": "relative"      },      {        "slot": "state",        "column": "status",        "only": [          "unreachable"        ]      }    ]  }}