The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | // SQLite's trim needs the characters JavaScript's String.prototype.trim removes spelled out. |
| 2 | export const JAVASCRIPT_TRIM_WHITESPACE = |
| 3 | " \t\n\r\v\f\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff"; |
| 4 | |
| 5 | const text = `json_extract(payload_json, '$.text')`; |
| 6 | const whitespace = `'${JAVASCRIPT_TRIM_WHITESPACE}'`; |
| 7 | |
| 8 | /** |
| 9 | * A user message that is a `/compact` or `/goal` command, whose turns defer context to the next |
| 10 | * one. The partial index on it is only used when the read spells this text the same way. |
| 11 | */ |
| 12 | export const DEFERRED_COMMAND_MESSAGE_CONDITION = `role = 'user' AND ( |
| 13 | lower(trim(${text}, ${whitespace})) = '/compact' |
| 14 | OR trim(${text}, ${whitespace}) GLOB '/goal*' |
| 15 | )`; |