@supa-media/tex-contract 0.2.7 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,6 +7,28 @@ The contract between [Context](https://github.com/Supa-Media/context) and Tex, t
7
7
 
8
8
  It is plain CommonJS with no dependencies, and it holds no secrets and no vault code.
9
9
 
10
+ ## What 0.3.0 replaces
11
+
12
+ Since 0.3.0 the contract holds everything Context took from Tex's own source, so no Context file needs `packages/tex` or `packages/lab` (the clean split, 2026-11-29). In Context, import from `packages/shared/src/texContract/` (`@context/shared/src/texContract/...`); in Tex, from `@supa-media/tex-contract/texContract/...`.
13
+
14
+ | Was | Now |
15
+ | --- | --- |
16
+ | `packages/tex/src/texNumber.cjs` (`TEX_NUMBER`, `formatNumber`) | `texContract/texNumber.cjs`: `formatNumber`, and `readTexNumber(env.TEX_NUMBER)`; the number is each deployment's `TEX_NUMBER` setting, so this public repository holds no real line |
17
+ | `packages/tex/src/aiKeys.cjs` | `texShared/models/aiKeys.cjs` (it already re-exported it) |
18
+ | `packages/tex/src/texSteps.cjs` (`TEX_STEPS`, `texStepForModel`) | `texContract/texSteps.cjs`, from `texSteps.generated.json` |
19
+ | `packages/tex/src/texSettings.cjs` | `texContract/texSettings.cjs`, from `texSettings.generated.json`: the rows as data (key, section, where, byText, via, appPath), without their titles and lines |
20
+ | `packages/tex/src/toolRules.cjs` `TEX_STATE_FILES`, `stateFileOf` | `texContract/texStateFiles.cjs` (file and action) |
21
+ | `packages/tex/src/textDecide.cjs` `REACT_EMOJI` | `texContract/reactEmoji.cjs`: name to `{ emoji }`, without when each fits |
22
+ | `packages/tex/gateway/agent/capabilities.js` (the agent-first rule's list) | `texContract/capabilities.cjs`, from `capabilities.generated.json`: names, actions, app routes and can'ts, without the words Tex is told |
23
+
24
+ The contract carries facts, never Tex's wording: `scripts/tex-wording-check.mjs` reads `texContract/`, and Tex's titles, lines and judge questions stay in Tex.
25
+
26
+ Not carried, because their readers leave Context with Tex: `toolRules.cjs`'s size limits and `rateError` (the Lab's tool stats), the judge's questions and Training (`textDecide.cjs` `decideRequest` and `recheckRequest`, whose control-plane routes nothing calls), `texConfig.cjs`, `texConfigStamp.cjs`, `texExamples.cjs` and `texTraining.generated.json` (the Lab and its tables), `packages/lab/**` (the Lab, its sandbox, bench and `tex_dev`) and the finished migrations' `packages/tex/gateway/agent/*` helpers.
27
+
28
+ The snapshots are written by `node scripts/tex-contract/snapshot.mjs [--tex <Supa-Media/tex checkout>]`, and `--check` fails when they are stale. When Tex adds a model step or changes what a person can get it to do, it runs the snapshot against its checkout and a Context pull request bumps the contract. `scripts/tex-contract/parity.test.mjs` proves each copy reads as Tex's own while Tex's source is still in Context.
29
+
30
+ ## How each side reads it
31
+
10
32
  Context's gateway imports the same files from its own source (`packages/shared/src/`). Tex pins a version of this package. A contract change keeps working with the previous release, and Tex bumps the version when it is ready. See `docs/decisions/texting-assistant/tex-service.md` in the Context repository.
11
33
 
12
34
  MIT licensed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supa-media/tex-contract",
3
- "version": "0.2.7",
3
+ "version": "0.3.0",
4
4
  "description": "The contract Context's gateway and Tex both keep: tool names, the MCP catalog snapshot, wire formats and the shared readings Tex takes with it",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,47 @@
1
+ /**
2
+ * WHAT A PERSON CAN GET TEX TO DO, AS CONTEXT CHECKS IT (contract 0.3.0; Dev2, 2026-11-08, "One capability list
3
+ * everywhere", and the agent-first rule in Context's CLAUDE.md: no feature is buttons-only).
4
+ *
5
+ * Each capability names the actions and app routes it covers, and what Tex can't do yet with the way around it (an
6
+ * agent prompt, an app path, a vault entry, a link, or words). Context's CI checks every action and app route against
7
+ * this list, so a feature added to Context without a line here fails there. The words Tex is told about each
8
+ * capability are Tex's own (`packages/tex/gateway/agent/capabilities.js` in Supa-Media/tex) and are not in the
9
+ * contract.
10
+ *
11
+ * Data only, written by `scripts/tex-contract/snapshot.mjs` into `capabilities.generated.json`.
12
+ */
13
+ "use strict";
14
+
15
+ const SNAPSHOT = require("./capabilities.generated.json");
16
+
17
+ const deepFreeze = (value) => {
18
+ if (value && typeof value === "object") {
19
+ for (const inner of Object.values(value)) deepFreeze(inner);
20
+ Object.freeze(value);
21
+ }
22
+ return value;
23
+ };
24
+
25
+ /** Every capability, in the list's order. */
26
+ const CAPABILITIES = deepFreeze(SNAPSHOT.capabilities);
27
+ /** Where a can't holds. */
28
+ const CANT_WHERE = deepFreeze(SNAPSHOT.where);
29
+ /** The kinds of way around a can't. */
30
+ const WORKAROUND_KINDS = deepFreeze(SNAPSHOT.workaroundKinds);
31
+
32
+ /** Every action the list covers (`write.x`, `manage.x`, `send.x`, `command.x`, `words.x`). */
33
+ function coveredActions() {
34
+ return new Set(CAPABILITIES.flatMap((entry) => entry.actions));
35
+ }
36
+
37
+ /** Every app route the list covers, with the capability that covers it. */
38
+ function coveredAppRoutes() {
39
+ const covered = new Map();
40
+ for (const entry of CAPABILITIES) {
41
+ for (const route of entry.appRoutes ?? []) covered.set(route, entry.name);
42
+ for (const cant of entry.cant) for (const route of cant.appRoutes ?? []) covered.set(route, `${entry.name} (can't)`);
43
+ }
44
+ return covered;
45
+ }
46
+
47
+ module.exports = { CAPABILITIES, CANT_WHERE, WORKAROUND_KINDS, coveredActions, coveredAppRoutes };
@@ -0,0 +1,27 @@
1
+ /** Types for `capabilities.cjs`; see that file. */
2
+
3
+ export type CantWhere = "everywhere" | "1:1" | "group" | "guest";
4
+ export type WorkaroundKind = "agent_prompt" | "app_path" | "vault_env" | "link" | "words";
5
+
6
+ export interface TexCant {
7
+ where: CantWhere;
8
+ what: string;
9
+ appRoutes?: readonly string[];
10
+ workaround: { kind: WorkaroundKind; text: string };
11
+ }
12
+
13
+ export interface TexCapability {
14
+ name: string;
15
+ /** `write.x`, `manage.x`, `send.x`, `command.x` or `words.x`. */
16
+ actions: readonly string[];
17
+ appRoutes?: readonly string[];
18
+ /** Kept off the list Tex is told. */
19
+ shelf?: true;
20
+ cant: readonly TexCant[];
21
+ }
22
+
23
+ export declare const CAPABILITIES: readonly TexCapability[];
24
+ export declare const CANT_WHERE: Readonly<Record<CantWhere, string>>;
25
+ export declare const WORKAROUND_KINDS: readonly WorkaroundKind[];
26
+ export declare function coveredActions(): Set<string>;
27
+ export declare function coveredAppRoutes(): Map<string, string>;
@@ -0,0 +1,77 @@
1
+ {
2
+ "where": {"everywhere":"anywhere","1:1":"in a 1:1 text","group":"in a group chat","guest":"in a guest chat"},
3
+ "workaroundKinds": [
4
+ "agent_prompt",
5
+ "app_path",
6
+ "vault_env",
7
+ "link",
8
+ "words"
9
+ ],
10
+ "capabilities": [
11
+ {"name":"Who is in a chat","actions":["send.name_guest","send.who_can_open"],"cant":[{"where":"group","what":"see the account of someone whose number here isn't on Context","workaround":{"kind":"words","text":"they sign in to the Context app with the number they use in this chat, or text you once on their own from it; either puts it on their account"}},{"where":"everywhere","what":"read anyone's phone contacts to learn guests' names","workaround":{"kind":"app_path","text":"Context app on their phone → Tex → Settings → Names from my contacts"}}]},
12
+ {"name":"Who someone is, for a form","actions":[],"cant":[{"where":"group","what":"know the name, phone number or email of someone here for a form","workaround":{"kind":"words","text":"ask them in the chat for what the form needs"}}]},
13
+ {"name":"Ask Tex in another chat","actions":["send.ask_chat","send.post_in_chat"],"cant":[{"where":"group","what":"ask another chat, or anyone's personal Tex","workaround":{"kind":"words","text":"ask from your own 1:1 with Tex, which can ask any group you are in"}},{"where":"1:1","what":"ask a group you are not in","workaround":{"kind":"words","text":"ask someone in that group to tag Tex there"}}]},
14
+ {"name":"Following up on the side, both ways","actions":["send.text_privately"],"cant":[{"where":"group","what":"ask someone who isn't on Context, or never texted you on their own, for something sensitive","workaround":{"kind":"words","text":"they text you once on their own from their phone (which sets up an account if they have none), then ask again"}}]},
15
+ {"name":"Saying hello when added to a group","actions":[],"cant":[{"where":"group","what":"say hello when the person who added you isn't on Context","workaround":{"kind":"words","text":"the first time someone here tags you, answer them; they can sign in to the Context app with their number"}}]},
16
+ {"name":"Member cards: what each person's own Tex lets a group use","actions":[],"cant":[{"where":"group","what":"use what someone told their own Tex beyond their card","workaround":{"kind":"words","text":"they say it in the chat, or add it to their card (tex/group-card.md)"}}]},
17
+ {"name":"Notes","actions":["write.save","write.save_many","write.comment","write.upload","write.remember","manage.move","manage.move_many","manage.move_folder","manage.archive","manage.suggest_destination","manage.layout","manage.folder_job","manage.encrypt"],"cant":[{"where":"everywhere","what":"delete a note","workaround":{"kind":"words","text":"archive it (manage archive): it moves to the Archive folder, where it can be found or moved back"}},{"where":"group","what":"read anyone else's personal notes, or anyone's saved logins, or someone else's calendar they haven't shared with this chat","workaround":{"kind":"words","text":"the note's owner names their own workspace with @ in their text: that ask reads it"}},{"where":"everywhere","what":"delete a workspace or close their account","workaround":{"kind":"app_path","text":"Context app → Settings → General → Delete this workspace, or Settings → Profile → Delete account"}},{"where":"everywhere","what":"change their username (twice in a lifetime; the old name stays theirs and keeps working)","workaround":{"kind":"app_path","text":"Context app → Settings → Profile → Username → Change"}},{"where":"everywhere","what":"make or change a people group, or switch a plugin on or off","workaround":{"kind":"app_path","text":"Context app → Settings → People & sharing (groups), or Settings → Plugins (that row shows only to people already using plugins)"}}]},
18
+ {"name":"Sheets","actions":["write.rows"],"cant":[{"where":"everywhere","what":"make a key that lets a script, a CI job or another service add rows to a sheet by itself","workaround":{"kind":"app_path","text":"an editor opens the sheet in the Context app → Data sources → Make a key, and copies the key and the one call there; a key is shown once, there and never in a chat, and Data sources is also where it is revoked"}}]},
19
+ {"name":"Who sees a note","actions":["manage.visibility","manage.folder_visibility","manage.share_link","manage.revoke_link"],"cant":[]},
20
+ {"name":"Forms","actions":["write.answer","write.update_answer","write.retract_answer","write.vote"],"cant":[]},
21
+ {"name":"The note open in the app","actions":[],"cant":[]},
22
+ {"name":"Shared workspaces","actions":["manage.create_workspace"],"cant":[{"where":"everywhere","what":"open a shared workspace to everyone at an email domain","workaround":{"kind":"app_path","text":"the owner opens Context app → Settings → People & sharing → Your organization"}}]},
23
+ {"name":"Inviting people","actions":["manage.invite","words.invite","send.chat_add_everyone"],"cant":[{"where":"everywhere","what":"change a member's role, remove someone from a workspace, or cancel an invitation","workaround":{"kind":"app_path","text":"the owner opens Context app → Settings → People & sharing → Members"}}]},
24
+ {"name":"Website","actions":["manage.website"],"cant":[]},
25
+ {"name":"Data sources and metrics","actions":[],"cant":[{"where":"everywhere","what":"connect a data source or make the key that sends rows to one","workaround":{"kind":"app_path","text":"someone who can edit the shared workspace opens the Context app → the data folder → Connect a source (the sidebar's + → Data source… makes the data folder the first time)"}},{"where":"everywhere","what":"start or restart a Fetch from a URL source's hourly sync (you can write its about.md, but the sync runs on the standing of a person who edits the workspace)","workaround":{"kind":"app_path","text":"an owner or editor opens the Context app → the data folder → the source → Sync now; its page then says when it last synced or why it was refused"}}]},
26
+ {"name":"Saved logins, keys and cards (the vault)","actions":["manage.vault_add","manage.vault_share","manage.vault_view","send.fill_login","send.make_login","send.fill_card","send.api","send.vault_access"],"cant":[{"where":"everywhere","what":"see, say or take by text a password, key, env variable or card number","workaround":{"kind":"vault_env","text":"send manage vault_add's link (type secret with the field names, and perEnv for dev, staging and prod values; type card for a card) for them to save it; to let someone else in a shared workspace use it, send manage vault_share's link and they press Share"}},{"where":"everywhere","what":"use a login on a site other than the one it was saved for","workaround":{"kind":"vault_env","text":"send manage vault_add's link with that other site, so they save it there too"}},{"where":"everywhere","what":"share a login saved in a personal workspace","workaround":{"kind":"vault_env","text":"they save it in the shared workspace (manage vault_add with that context), then you give it with send vault_access"}},{"where":"everywhere","what":"change who has a login someone else saved","workaround":{"kind":"words","text":"whoever saved it asks you, or changes it in Context app → Vault, on the right rail (on a phone, in your account menu)"}},{"where":"everywhere","what":"delete a saved key, or cut off one particular AI (send vault_access cuts off every AI)","workaround":{"kind":"app_path","text":"Context app → Vault, on the right rail (on a phone, in your account menu)"}},{"where":"group","what":"use someone's own saved login or card","workaround":{"kind":"words","text":"they text you on their own for it, or save it in the workspace's vault and give it to everyone there"}},{"where":"guest","what":"pay with a card when whoever tagged you isn't on Context","workaround":{"kind":"words","text":"someone here who is on Context tags you to pay, and their own plain yes allows it"}},{"where":"everywhere","what":"type a code you weren't texted, solve a captcha you can't get past, pass a passkey only their own device holds, or pay without them","workaround":{"kind":"link","text":"add a handoff step in browse: they get a link to your browser (in a group chat, the chat's own Tex page, for anyone here signed in to Context) and do only that step, then press Done there and you carry on by yourself (texting \"done\" works too); with no link, or if they've said they won't take the browser, keep the browser where it got to and say the one step left, never the whole form again"}}]},
27
+ {"name":"The web","actions":["send.search_web","send.open_page","send.browse","send.travel_time"],"cant":[{"where":"everywhere","what":"show them your browser inside a text","workaround":{"kind":"link","text":"they watch or take over your browser live at context.lc/tex/@their-handle?view=computer&full=1 (a group chat's at context.lc/tex/group/<its words>/computer?full=1), or at the handoff link browse sends"}}]},
28
+ {"name":"Sending email","actions":["send.email"],"cant":[{"where":"everywhere","what":"read or send Outlook, Microsoft 365, iCloud or other mail that isn't Gmail","workaround":{"kind":"link","text":"browse to that web mail and do the step there, signing in with a saved login"}},{"where":"everywhere","what":"add or remove a Gmail \"Send mail as\" address","workaround":{"kind":"link","text":"https://mail.google.com/mail/u/0/#settings/accounts, \"Send mail as\" → Add another email address; Tex sends from it once Gmail shows it verified"}}]},
29
+ {"name":"Reading email","actions":[],"cant":[{"where":"group","what":"read someone's mail they haven't shared with this chat","workaround":{"kind":"words","text":"the mailbox's own person asks you here in any words to share it, or says yes when you offer (you call send action chat_share_mail), or texts you on their own to search it; never hand them a phrase to type"}}]},
30
+ {"name":"Sharing someone's mail with a group chat","actions":["command.chat_share_mail","command.chat_unshare_mail","words.share_mail","words.unshare_mail"],"cant":[{"where":"1:1","what":"share someone's mail with a group chat from a 1:1 text","workaround":{"kind":"words","text":"they type \"Tex, share my mail from <their address> here\" in that group chat"}}]},
31
+ {"name":"Sharing someone's calendar with a group chat","actions":["command.chat_share_calendar","command.chat_unshare_calendar"],"cant":[{"where":"1:1","what":"share someone's calendar with a group chat from a 1:1 text","workaround":{"kind":"words","text":"they ask you to share their calendar in that group chat"}}]},
32
+ {"name":"A group chat's own email address","actions":[],"cant":[{"where":"everywhere","what":"send or reply from a group chat's address","workaround":{"kind":"words","text":"reply from someone here's own Gmail (send action email with as), on that person's 👍"}}]},
33
+ {"name":"Gmail drafts, mail forwarding and Google Chat","actions":["send.email_draft","send.forward_rule","send.google_chat","manage.connect_google"],"cant":[{"where":"everywhere","what":"disconnect a Google account","workaround":{"kind":"app_path","text":"Context app → Settings → Connected apps"}}]},
34
+ {"name":"Calendar","actions":["send.calendar"],"cant":[]},
35
+ {"name":"Slack and other connected apps","actions":["send.slack","send.app","manage.connect"],"cant":[{"where":"everywhere","what":"disconnect an app you use","workaround":{"kind":"app_path","text":"Context app → Settings → Apps Tex uses → Disconnect"}}]},
36
+ {"name":"Meetings","actions":[],"cant":[{"where":"everywhere","what":"start, stop or join a meeting recording","workaround":{"kind":"app_path","text":"the Context Mac app records from its menu bar"}},{"where":"everywhere","what":"change the default meeting folder or how meetings are joined","workaround":{"kind":"app_path","text":"Context app → Settings → Meetings"}}]},
37
+ {"name":"People and their messages","actions":[],"cant":[]},
38
+ {"name":"Their texts from their Mac","actions":[],"cant":[{"where":"everywhere","what":"turn the Mac's Messages backup on or off, grant it Full Disk Access, or choose what it copies","workaround":{"kind":"app_path","text":"on the Mac, Context app → Settings → Messages"}}]},
39
+ {"name":"Texting them later","actions":["send.notify"],"cant":[{"where":"everywhere","what":"text or call anyone but the person or chat you are in","workaround":{"kind":"words","text":"write the exact words for them to send (\"I can't text Sam, but here's one you can send:\"), or send it as an email on their 👍"}}]},
40
+ {"name":"Reminders and routines","actions":[],"cant":[{"where":"everywhere","what":"run a routine more often than every 5 minutes, keep more than 200 in one workspace, or send a one-off reminder whose time has passed","workaround":{"kind":"words","text":"offer every 5 minutes or hourly, archive routines no longer needed, or set the reminder for the next time that works"}},{"where":"everywhere","what":"move check-in times or add more check-in texts","workaround":{"kind":"words","text":"set a routine at the time they want, or write in the body of tex/heartbeat.md what to leave alone (\"only text me about deadlines\")"}},{"where":"guest","what":"set a reminder or routine for someone here who isn't on Context","workaround":{"kind":"words","text":"someone here who is on Context sets it for the chat, or the person joins Context and texts you for their own"}}]},
41
+ {"name":"Housekeeping","actions":[],"cant":[]},
42
+ {"name":"Background jobs","actions":["send.background","send.steer_job","send.restart_job","send.job_status","send.mail_agent","send.plan","write.mail"],"cant":[]},
43
+ {"name":"Handing work to another agent","actions":["send.delegate"],"cant":[]},
44
+ {"name":"Tex's own computer","actions":["send.tex_computer"],"shelf":true,"cant":[]},
45
+ {"name":"Setting up their computers (community compute)","actions":["send.computers"],"appRoutes":["/machines/app/list","/machines/app/set","/machines/app/disconnect","/machines/app/lend","/machines/app/unlend","/machines/app/raise","/machines/app/chat-people","/machines/app/sign-in","/machines/app/install"],"cant":[{"where":"1:1","what":"answer a computer's \"Ask me first\" from a 1:1 text","appRoutes":["/machines/app/answer"],"workaround":{"kind":"app_path","text":"the owner taps 👍 on the ask in the group chat it came from, or answers it on the computer's page on their Tex page (context.lc/tex/@their-handle)"}},{"where":"everywhere","what":"change which of a computer's folders, coding tools, trusted repos or computer use Tex may use, or turn on \"Let Tex use this Mac\" in the Mac app","workaround":{"kind":"app_path","text":"they open the computer on their Tex page in the Context app (context.lc/tex/@their-handle), or, for the Mac app's switch and folders, Settings → Tex in the Mac app"}}]},
46
+ {"name":"Pairing a session's computer for mail","actions":["manage.pair_device"],"cant":[]},
47
+ {"name":"Pages","actions":[],"cant":[]},
48
+ {"name":"Pictures and cards","actions":["send.draw_visual","send.draw_picture","send.make_picture"],"cant":[{"where":"everywhere","what":"send tappable Context cards, swipeable picture sets or one-tap pick cards on WhatsApp","workaround":{"kind":"words","text":"the picture or words still arrive there as a picture, a document or a link preview"}}]},
49
+ {"name":"Files and voice memos they send","actions":[],"cant":[{"where":"everywhere","what":"watch a video, open other file types, or read a file over 25 MB (a PDF over 10 MB, a voice memo over 8 MB)","workaround":{"kind":"words","text":"ask for a screenshot of the part that matters, a shorter recording, or the file as a PDF"}}]},
50
+ {"name":"Tapbacks","actions":[],"cant":[]},
51
+ {"name":"Polls","actions":[],"cant":[{"where":"everywhere","what":"vote in a poll yourself","workaround":{"kind":"words","text":"say which option you would pick"}},{"where":"everywhere","what":"see a poll on the old Sendblue number or WhatsApp","workaround":{"kind":"words","text":"ask them to say which option they picked"}}]},
52
+ {"name":"Running the group","actions":[],"cant":[]},
53
+ {"name":"Tags, effects and other apps' cards","actions":[],"cant":[{"where":"everywhere","what":"send a card of another app yourself","workaround":{"kind":"words","text":"say it in words"}},{"where":"everywhere","what":"see tags, effects or other apps' cards on the old Sendblue number or WhatsApp","workaround":{"kind":"words","text":"ask them to say it in words"}}]},
54
+ {"name":"Threaded replies","actions":[],"cant":[{"where":"everywhere","what":"be sure a reply threads on the old Sendblue number or WhatsApp","workaround":{"kind":"words","text":"name the text you are answering in a few words"}}]},
55
+ {"name":"Edited and unsent texts","actions":[],"cant":[{"where":"everywhere","what":"see an edit or unsend on the old Sendblue number or WhatsApp, which don't send them","workaround":{"kind":"words","text":"ask them to send the corrected text again, or say which text to ignore"}}]},
56
+ {"name":"Texting while you work","actions":[],"cant":[]},
57
+ {"name":"This chat's history","actions":[],"cant":[{"where":"everywhere","what":"find a text by its meaning when it used other words","workaround":{"kind":"words","text":"search again with the plain words they would have used, or read the day summaries around when it likely was"}}]},
58
+ {"name":"Group chats","actions":[],"cant":[]},
59
+ {"name":"Your advisor","actions":["send.advisor"],"cant":[]},
60
+ {"name":"Progress lines and silence","actions":["send.progress","send.say_nothing","send.tapback","send.reply_under"],"cant":[]},
61
+ {"name":"Sending a chat's stickers","actions":["send.send_sticker"],"cant":[]},
62
+ {"name":"How you talk, and your settings","actions":["command.tex_settings","command.tex_instructions","send.setting"],"cant":[]},
63
+ {"name":"An answer held from a group","actions":["send.share_held"],"cant":[]},
64
+ {"name":"Their name on their account","actions":["send.account_name"],"cant":[]},
65
+ {"name":"When you speak up in a group","actions":["command.chat_mute","command.chat_status","words.stop","words.start","words.status"],"cant":[]},
66
+ {"name":"Sharing their conversations with the Context team","actions":["command.review_sharing","words.review_sharing"],"cant":[]},
67
+ {"name":"Bug reports","actions":["write.report_problem"],"cant":[]},
68
+ {"name":"Your memory of them","actions":["manage.dream_now","write.save_session"],"cant":[]},
69
+ {"name":"Areas and their bots","actions":["manage.area"],"cant":[{"where":"everywhere","what":"show a saved webhook's address or key","workaround":{"kind":"app_path","text":"Replace under the bot's Reach in the app's area panel"}},{"where":"everywhere","what":"send an area routine to its bot now, out of turn","workaround":{"kind":"app_path","text":"Run now on the routine's row under Routines in the app's area panel (an editor or owner; it waits like any run when the bot's share there is spent)"}}]},
70
+ {"name":"Date properties","actions":["manage.fill_dates"],"cant":[]},
71
+ {"name":"Their account","actions":[],"cant":[{"where":"everywhere","what":"change the phone or emails they sign in with, sign out their other devices, or pause phone sign-in","workaround":{"kind":"app_path","text":"Context app → Settings → Profile (each needs a code sent to them)"}},{"where":"everywhere","what":"block or unblock someone","workaround":{"kind":"app_path","text":"Report or block beside the note or invitation they sent, or Context app → Settings → Profile → Blocked people to unblock"}},{"where":"everywhere","what":"see or manage where their notes are stored","workaround":{"kind":"app_path","text":"Context app → Settings → Storage"}}]},
72
+ {"name":"Connecting AI apps to Context","actions":[],"cant":[{"where":"everywhere","what":"take away an AI app's access","workaround":{"kind":"app_path","text":"Context app → Settings → Connected apps → AI apps → Revoke"}}]},
73
+ {"name":"Chatting in the Context app","actions":[],"cant":[{"where":"everywhere","what":"send or receive files other than pictures, PDFs, text files and Word documents, or voice notes, in the app chat yet","workaround":{"kind":"words","text":"they text the file or voice note to you over iMessage, and you see it in the same history"}}]},
74
+ {"name":"Tex in a note's comments","actions":[],"cant":[]},
75
+ {"name":"Tex in a note's mail","actions":[],"cant":[]}
76
+ ]
77
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The 64 emoji Tex may react with, by the short name its judge picks (Dev2, 2026-10-27: a curated set, since one typed
3
+ * question offers at most 64 options). Never ✅ and never a gendered person. Context's control plane keeps them as an
4
+ * allowlist (`apps/convex/functions/lib/reactEmoji.ts`); Tex's own copy, with when each fits, is
5
+ * `packages/tex/src/textDecide.cjs` in Supa-Media/tex, and a test on each side pins the list.
6
+ */
7
+ "use strict";
8
+
9
+ const EMOJI = {
10
+ heart: "❤️",
11
+ thumbs_up: "👍",
12
+ thumbs_down: "👎",
13
+ laugh: "😂",
14
+ rofl: "🤣",
15
+ smile: "😊",
16
+ grin: "😁",
17
+ wink: "😉",
18
+ heart_eyes: "😍",
19
+ hug: "🤗",
20
+ thinking: "🤔",
21
+ eyes: "👀",
22
+ wow: "😮",
23
+ mind_blown: "🤯",
24
+ sad: "😢",
25
+ pensive: "😔",
26
+ frown: "☹️",
27
+ grimace: "😬",
28
+ sweat_smile: "😅",
29
+ facepalm: "🤦",
30
+ shrug: "🤷",
31
+ pray: "🙏",
32
+ clap: "👏",
33
+ raised_hands: "🙌",
34
+ muscle: "💪",
35
+ ok_hand: "👌",
36
+ wave: "👋",
37
+ salute: "🫡",
38
+ handshake: "🤝",
39
+ crossed_fingers: "🤞",
40
+ party: "🎉",
41
+ confetti: "🥳",
42
+ fire: "🔥",
43
+ star: "⭐",
44
+ sparkles: "✨",
45
+ hundred: "💯",
46
+ rocket: "🚀",
47
+ trophy: "🏆",
48
+ bulb: "💡",
49
+ exclamation: "‼️",
50
+ question: "❓",
51
+ check_later: "⏳",
52
+ calendar: "📅",
53
+ clock: "⏰",
54
+ memo: "📝",
55
+ books: "📚",
56
+ laptop: "💻",
57
+ phone: "📱",
58
+ mail: "📧",
59
+ money: "💰",
60
+ chart: "📈",
61
+ house: "🏠",
62
+ plane: "✈️",
63
+ car: "🚗",
64
+ coffee: "☕",
65
+ food: "🍕",
66
+ cheers: "🥂",
67
+ cake: "🎂",
68
+ gift: "🎁",
69
+ music: "🎵",
70
+ sun: "☀️",
71
+ moon: "🌙",
72
+ zipped: "🤐",
73
+ plant: "🌱",
74
+ };
75
+
76
+ /** Name to `{ emoji }`, the shape Tex's own list has. */
77
+ const REACT_EMOJI = Object.freeze(Object.fromEntries(Object.entries(EMOJI).map(([name, emoji]) => [name, Object.freeze({ emoji })])));
78
+
79
+ module.exports = { REACT_EMOJI };
@@ -0,0 +1,2 @@
1
+ /** Types for `reactEmoji.cjs`; see that file. */
2
+ export declare const REACT_EMOJI: Readonly<Record<string, { readonly emoji: string }>>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Tex's number: the one line people are told to text. It is configuration, not code: each deployment reads it from its
3
+ * own `TEX_NUMBER` setting (an E.164 number), so this public repository carries no real line and moving Tex to a new
4
+ * line changes no source. Tex's own copy is `packages/tex/src/texNumber.cjs` in Supa-Media/tex.
5
+ */
6
+ "use strict";
7
+
8
+ /** The configured number when it is one E.164 number, else null (unset, or anything that isn't a number). */
9
+ function readTexNumber(value) {
10
+ const number = typeof value === "string" ? value.trim() : "";
11
+ return /^\+[1-9]\d{6,14}$/.test(number) ? number : null;
12
+ }
13
+
14
+ /** "+1 (415) 555-0100" for a US number; any other number as given. */
15
+ function formatNumber(number) {
16
+ const us = /^\+1(\d{3})(\d{3})(\d{4})$/.exec(String(number));
17
+ return us ? `+1 (${us[1]}) ${us[2]}-${us[3]}` : String(number);
18
+ }
19
+
20
+ module.exports = { readTexNumber, formatNumber };
@@ -0,0 +1,3 @@
1
+ /** Types for `texNumber.cjs`; see that file. */
2
+ export declare function readTexNumber(value: unknown): string | null;
3
+ export declare function formatNumber(number: string): string;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Every setting that changes what Tex does, once (Dev2, 2026-11-12; `docs/decisions/texting-assistant/settings-by-text.md`),
3
+ * as data: where it applies, whether Tex changes it from a text and with which `send` action, or where in the app it
4
+ * changes. The app's settings page has a switch for each `setting` row. The rows are `texSettings.generated.json`,
5
+ * written by `scripts/tex-contract/snapshot.mjs`; Tex's own copy, with each row's title and line, is
6
+ * `packages/tex/src/texSettings.cjs` in Supa-Media/tex.
7
+ */
8
+ "use strict";
9
+
10
+ const SNAPSHOT = require("./texSettings.generated.json");
11
+
12
+ /** Where a setting applies: a person's own chat with Tex, and a group chat. */
13
+ const WHERE = Object.freeze([...SNAPSHOT.where]);
14
+
15
+ const TEX_SETTINGS = Object.freeze(SNAPSHOT.settings.map((row) => Object.freeze({ ...row, where: Object.freeze([...row.where]) })));
16
+
17
+ /** The row for a key, or null. */
18
+ function texSetting(key) {
19
+ return TEX_SETTINGS.find((row) => row.key === key) ?? null;
20
+ }
21
+
22
+ module.exports = { TEX_SETTINGS, WHERE, texSetting };
@@ -0,0 +1,20 @@
1
+ /** Types for `texSettings.cjs`; see that file. Data only: the titles and lines are Tex's. */
2
+
3
+ export type TexSettingWhere = "1:1" | "group";
4
+
5
+ export interface TexSetting {
6
+ key: string;
7
+ /** The settings page section it sits in. */
8
+ section: string;
9
+ where: readonly TexSettingWhere[];
10
+ /** Whether Tex changes it from a text. */
11
+ byText: boolean;
12
+ /** The `send` action that changes it, when `byText`. */
13
+ via?: string;
14
+ /** Where in the app it changes, when it doesn't by text. */
15
+ appPath?: string;
16
+ }
17
+
18
+ export declare const TEX_SETTINGS: readonly TexSetting[];
19
+ export declare const WHERE: readonly TexSettingWhere[];
20
+ export declare function texSetting(key: string): TexSetting | null;
@@ -0,0 +1,25 @@
1
+ {
2
+ "where": [
3
+ "1:1",
4
+ "group"
5
+ ],
6
+ "settings": [
7
+ {"key":"talk","section":"Tex","where":["1:1","group"],"byText":true,"via":"tex_instructions"},
8
+ {"key":"checkins","section":"Tex","where":["1:1"],"byText":true,"via":"setting"},
9
+ {"key":"quiet_hours","section":"Tex","where":["1:1"],"byText":true,"via":"setting"},
10
+ {"key":"pings","section":"Tex","where":["1:1"],"byText":true,"via":"setting"},
11
+ {"key":"overnight","section":"Tex","where":["1:1"],"byText":true,"via":"setting"},
12
+ {"key":"tidy","section":"Tex","where":["1:1"],"byText":true,"via":"setting"},
13
+ {"key":"name","section":"Profile","where":["1:1"],"byText":true,"via":"account_name"},
14
+ {"key":"review_sharing","section":"Tex","where":["1:1"],"byText":true,"via":"review_sharing"},
15
+ {"key":"vault","section":"Vault","where":["1:1","group"],"byText":true,"via":"vault_access"},
16
+ {"key":"vault_delete","section":"Vault","where":["1:1","group"],"byText":false,"appPath":"Context app → Vault, on the right rail (on a phone, in your account menu)"},
17
+ {"key":"computers","section":"Tex","where":["1:1","group"],"byText":true,"via":"computers"},
18
+ {"key":"mute","section":"Group chats","where":["group"],"byText":true,"via":"chat_mute"},
19
+ {"key":"chat_mail","section":"Group chats","where":["group"],"byText":true,"via":"chat_share_mail"},
20
+ {"key":"chat_calendar","section":"Group chats","where":["group"],"byText":true,"via":"chat_share_calendar"},
21
+ {"key":"workspaces","section":"Group chats","where":["1:1","group"],"byText":true,"via":"chat_add_everyone"},
22
+ {"key":"apps","section":"Tex","where":["1:1"],"byText":false,"appPath":"Context app → Settings → Apps Tex uses → Disconnect"},
23
+ {"key":"features","section":"Tex","where":["1:1"],"byText":false,"appPath":"Not changeable: the Context team turns these on"}
24
+ ]
25
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Tex's state files in a person's workspace, and the action that writes each (rule 3 of Tex's tool rules). The control
3
+ * plane keeps only these names on a turn's record (`apps/convex/functions/agentTurns.ts`). Data only: Tex's own copy,
4
+ * with what each holds, is `packages/tex/src/toolRules.cjs` in Supa-Media/tex.
5
+ */
6
+ "use strict";
7
+
8
+ const TEX_STATE_FILES = Object.freeze([
9
+ { file: "tex/heartbeat.md", action: "setting" },
10
+ { file: "tex/attention.md", action: "setting" },
11
+ { file: "tex/voice.md", action: "write" },
12
+ { file: "tex/routines/", action: "write" },
13
+ { file: "tex/about.md", action: "remember" },
14
+ ].map(Object.freeze));
15
+
16
+ /** The state file a note path is, or null: `tex/routines/daily/x.md` is `tex/routines/`. */
17
+ function stateFileOf(path) {
18
+ const clean = String(path ?? "").replace(/^\/+/, "");
19
+ return TEX_STATE_FILES.find((entry) => (entry.file.endsWith("/") ? clean.startsWith(entry.file) : clean === entry.file)) ?? null;
20
+ }
21
+
22
+ module.exports = { TEX_STATE_FILES, stateFileOf };
@@ -0,0 +1,9 @@
1
+ /** Types for `texStateFiles.cjs`; see that file. */
2
+ export interface TexStateFile {
3
+ /** A note path, or a folder ending in `/`. */
4
+ file: string;
5
+ /** The action that writes it. */
6
+ action: string;
7
+ }
8
+ export declare const TEX_STATE_FILES: readonly TexStateFile[];
9
+ export declare function stateFileOf(path: string): TexStateFile | null;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Tex's model steps, as the contract carries them (`texSteps.generated.json`, written by
3
+ * `scripts/tex-contract/snapshot.mjs` from Tex's config). The staff console's AI costs page groups spend by these ids.
4
+ * Same shape as Tex's own `texSteps.cjs`, which reads its config live.
5
+ */
6
+ "use strict";
7
+
8
+ const SNAPSHOT = require("./texSteps.generated.json");
9
+
10
+ const TEX_STEPS = Object.freeze(SNAPSHOT.steps.map((step) => Object.freeze({ ...step })));
11
+ /** Each step that is on and the model key it falls back to. */
12
+ const FALLBACKS = Object.freeze(SNAPSHOT.fallbacks.map((pair) => Object.freeze([...pair])));
13
+
14
+ /**
15
+ * The first step that is on and runs this model key, or else falls back to it, or else any step (off included) that
16
+ * runs it, so spend from before a step was turned off still lands on Tex; null when none does.
17
+ */
18
+ function texStepForModel(model) {
19
+ const step = TEX_STEPS.find((s) => s.on && s.model === model);
20
+ if (step) return step.id;
21
+ const falls = FALLBACKS.find(([, key]) => key === model);
22
+ if (falls) return falls[0];
23
+ const off = TEX_STEPS.find((s) => s.model === model);
24
+ return off ? off.id : null;
25
+ }
26
+
27
+ module.exports = { TEX_STEPS, FALLBACKS, texStepForModel };
@@ -0,0 +1,14 @@
1
+ /** Types for `texSteps.cjs`; see that file. */
2
+
3
+ export interface TexStepDef {
4
+ /** The Tex config node id. */
5
+ id: string;
6
+ label: string;
7
+ /** The Tex config model key. */
8
+ model: string;
9
+ on: boolean;
10
+ }
11
+
12
+ export declare const TEX_STEPS: readonly TexStepDef[];
13
+ export declare const FALLBACKS: readonly (readonly [step: string, model: string])[];
14
+ export declare function texStepForModel(model: string): string | null;
@@ -0,0 +1,41 @@
1
+ {
2
+ "steps": [
3
+ {"id":"decide","label":"Decide","model":"clef","on":true},
4
+ {"id":"decideWhy","label":"Decide's reason","model":"clef","on":true},
5
+ {"id":"fd","label":"Front door","model":"haiku-5-5","on":true},
6
+ {"id":"advisor","label":"Advisor","model":"sonnet-5-5","on":true},
7
+ {"id":"mail","label":"Mail checker","model":"haiku-5-5","on":true},
8
+ {"id":"card","label":"Card check","model":"haiku-5-5","on":true},
9
+ {"id":"job","label":"Background job","model":"haiku-5-5","on":true},
10
+ {"id":"handback","label":"Hand-back judge","model":"haiku-5-5","on":true},
11
+ {"id":"egress","label":"Egress judge","model":"haiku-5-5","on":true},
12
+ {"id":"picture","label":"Picture maker","model":"gemini","on":true},
13
+ {"id":"shapeGate","label":"Shape gate","model":"clef","on":false},
14
+ {"id":"jobadv","label":"Job advisor","model":"sonnet-5-5","on":true},
15
+ {"id":"learn","label":"Learn","model":"haiku-5-5","on":true},
16
+ {"id":"afterReply","label":"After the reply","model":"haiku-5-5","on":true},
17
+ {"id":"answerCheck","label":"Answer check","model":"haiku-5-5","on":true},
18
+ {"id":"reviewer","label":"Reply reviewer","model":"haiku-5-5","on":true},
19
+ {"id":"recheck","label":"Still answers them?","model":"clef","on":true},
20
+ {"id":"chatDays","label":"Chat day summaries","model":"haiku-5-5","on":true},
21
+ {"id":"moveJudge","label":"Move judge","model":"haiku-5-5","on":true},
22
+ {"id":"stickerLook","label":"Sticker look","model":"haiku-5-5","on":true},
23
+ {"id":"askGate","label":"Before asking","model":"clef-flash","on":true},
24
+ {"id":"connect","label":"Connect notes","model":"haiku-5-5","on":false},
25
+ {"id":"noteRun","label":"Tex in a note","model":"haiku-5-5","on":true},
26
+ {"id":"mailRun","label":"Tex in mail","model":"haiku-5-5","on":true},
27
+ {"id":"nudgeOffer","label":"Nudge","model":"haiku-5-5","on":false},
28
+ {"id":"quietCheck","label":"Quiet check","model":"haiku-5-5","on":true},
29
+ {"id":"checkinResearch","label":"Research","model":"haiku-5-5","on":true},
30
+ {"id":"groupCard","label":"Group card","model":"haiku-5-5","on":true},
31
+ {"id":"friendCheck","label":"Friend check","model":"haiku-5-5","on":true},
32
+ {"id":"guestNames","label":"Guest names","model":"haiku-5-5","on":true},
33
+ {"id":"dream","label":"Dream","model":"haiku-5-5","on":true},
34
+ {"id":"daysum","label":"Day summaries","model":"haiku-5-5","on":true},
35
+ {"id":"housekeep","label":"Housekeeping","model":"haiku-5-5","on":true},
36
+ {"id":"aboutCheck","label":"Recheck About me","model":"sonnet-5-5","on":true}
37
+ ],
38
+ "fallbacks": [
39
+
40
+ ]
41
+ }
@@ -17,6 +17,14 @@
17
17
  * (deletes both). Moving `expires` later is allowed only within the same
18
18
  * limit from `added`, so a flag cannot be kept forever by editing its date.
19
19
  *
20
+ * ## On for staff in code
21
+ *
22
+ * `staff: true` turns a flag on for staff (the verified `ADMIN_EMAILS`
23
+ * addresses) before anyone else, as a launch pull request, not a console
24
+ * press. The console's row still wins: `people` and `everyone` widen it as
25
+ * always, and a row set to `off` turns it off for staff too, which is the
26
+ * rollback short of a revert. Read by `apps/convex/functions/lib/featureFlags.ts`.
27
+ *
20
28
  * ## Ids
21
29
  *
22
30
  * `area.name`, lower case words joined by hyphens (`tex.conversation-threads`).
@@ -57,12 +65,26 @@ const FLAGS = Object.freeze({
57
65
  description: "The app saves whole notes through the gateway into the workspace object, not through Convex.",
58
66
  added: "2026-11-24",
59
67
  expires: "2027-02-21",
68
+ staff: true,
60
69
  },
61
70
  "files.app-reads-in-objects": {
62
71
  label: "App reads in objects",
63
72
  description: "The app's previews, peeks, mail and admin note reads go through the gateway to the workspace object, not through Convex.",
64
73
  added: "2026-11-29",
65
74
  expires: "2027-02-26",
75
+ staff: true,
76
+ },
77
+ "files.app-trash-list-in-objects": {
78
+ label: "Trash list in objects",
79
+ description: "The app's Trash page lists the trash from the workspace object through the gateway, not from Convex.",
80
+ added: "2026-11-29",
81
+ expires: "2027-02-26",
82
+ },
83
+ "notes.app-visibility-in-objects": {
84
+ label: "App visibility in objects",
85
+ description: "The app changes a note's visibility through the gateway in the workspace object, not through Convex.",
86
+ added: "2026-11-29",
87
+ expires: "2027-02-26",
66
88
  },
67
89
  "shares.shared-with-me-in-objects": {
68
90
  label: "Shared with me from objects",
@@ -70,6 +92,18 @@ const FLAGS = Object.freeze({
70
92
  added: "2026-11-29",
71
93
  expires: "2027-02-26",
72
94
  },
95
+ "files.share-cards-in-objects": {
96
+ label: "Share cards and access lists from objects",
97
+ description: "A share link finds its note, and the share dialog reads who has access, from the workspace object instead of Convex's tree copy.",
98
+ added: "2026-11-29",
99
+ expires: "2027-02-26",
100
+ },
101
+ "shares.granted-in-objects": {
102
+ label: "Granted notes judged in objects",
103
+ description: "A note or folder granted to somebody outside the workspace is judged and read in the workspace object, not from Convex's copy of the rows.",
104
+ added: "2026-11-29",
105
+ expires: "2027-02-26",
106
+ },
73
107
  });
74
108
 
75
109
  const FLAG_MODES = Object.freeze(["off", "people", "everyone"]);
@@ -109,6 +143,7 @@ function flagProblems(flags, today) {
109
143
  }
110
144
  if (typeof flag.label !== "string" || flag.label.trim() === "") problems.push(`${id}: needs a label.`);
111
145
  if (typeof flag.description !== "string" || flag.description.trim() === "") problems.push(`${id}: needs a description.`);
146
+ if (flag.staff !== undefined && typeof flag.staff !== "boolean") problems.push(`${id}: staff is true or left out.`);
112
147
  const added = dayMs(flag.added);
113
148
  const expires = dayMs(flag.expires);
114
149
  if (Number.isNaN(added)) problems.push(`${id}: added must be a YYYY-MM-DD day.`);
@@ -9,6 +9,8 @@ export interface FlagInfo {
9
9
  added: string;
10
10
  /** `YYYY-MM-DD`, at most `MAX_FLAG_DAYS` after `added`. */
11
11
  expires: string;
12
+ /** On for staff unless the console's row is set to `off`. */
13
+ staff?: boolean;
12
14
  }
13
15
 
14
16
  export declare const FLAGS: Readonly<Record<string, FlagInfo>>;