@supa-media/tex-contract 0.9.0 → 0.15.6

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
@@ -36,7 +36,7 @@ Since 0.8.0:
36
36
 
37
37
  Since 0.9.0:
38
38
 
39
- - `texContract/doorBatch.cjs` (with its types) names the door's batch: `BATCH_PATH` (`/tex-mcp/batch`), `BATCH_METHOD`, `MAX_BATCH_CALLS` (16) and `NOT_BATCHED`. Several calls of one turn go in one request, so the door resolves the token, opens the storage binding and opens and saves the turn once for all of them. Each entry answers `{ result }` or `{ error: { status, code } }`; a call to an outside service answers `not_batched` and goes alone, and a gateway without the path answers 404.
39
+ - `texContract/doorBatch.cjs` (with its types) names the door's batch: `BATCH_PATH` (`/tex-mcp/batch`), `BATCH_METHOD`, `MAX_BATCH_CALLS` (16) and `NOT_BATCHED`. Several calls of one turn go in one request, so the door resolves the token, opens the storage binding and opens and saves the turn once for all of them. Each entry answers `{ result }` or `{ error: { status, code } }`; a call to an outside service answers `not_batched` and goes alone, and a gateway without the path answers 404. Since 0.10.0, `params.stream: true` asks for `STREAM_CONTENT_TYPE` (NDJSON): each entry's `{ at, result }` or `{ at, error }` as soon as it has answered and its marks are kept, then `{ done: true }`. An older gateway answers JSON as before, so read the answer by its content type.
40
40
 
41
41
  The contract carries facts, never Tex's wording, and Tex's titles, lines and judge questions stay in Tex.
42
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supa-media/tex-contract",
3
- "version": "0.9.0",
3
+ "version": "0.15.6",
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": {
@@ -20,6 +20,7 @@
20
20
  {"name":"Forms","actions":["write.answer","write.update_answer","write.retract_answer","write.vote"],"cant":[]},
21
21
  {"name":"The note open in the app","actions":[],"cant":[]},
22
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":"Joining a workspace they were invited to","actions":["manage.join"],"cant":[]},
23
24
  {"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
25
  {"name":"Website","actions":["manage.website"],"cant":[]},
25
26
  {"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"}}]},
@@ -15,6 +15,13 @@
15
15
  * the status and code that entry's single request would have been refused with. `not_batched` (400) means send that
16
16
  * call alone (a call to an outside service). A refusal of the whole request (no token, no read scope, a bad body) is
17
17
  * an HTTP status as on the single paths; a gateway without this path answers 404, and the caller sends each call alone.
18
+ *
19
+ * STREAMED ANSWERS (since 0.10.0). With `params.stream: true` the answer is `STREAM_CONTENT_TYPE` instead: one JSON
20
+ * object per line, each entry's `{ at, result }` or `{ at, error: { status, code } }` as soon as that entry has
21
+ * answered and what it marked on the turn is kept, in the order they finish (`at` is its index in `calls`), then
22
+ * `{ done: true }` last. A fast call is never held back by a slow one beside it. A stream that ends without `done`
23
+ * broke: an entry it did not answer may have run, so it is not sent again. A gateway older than 0.10.0 ignores
24
+ * `stream` and answers the whole batch as JSON, so a caller reads the answer by its content type.
18
25
  */
19
26
 
20
27
  "use strict";
@@ -23,5 +30,6 @@ const BATCH_PATH = "/tex-mcp/batch";
23
30
  const BATCH_METHOD = "tools/batch";
24
31
  const MAX_BATCH_CALLS = 16;
25
32
  const NOT_BATCHED = "not_batched";
33
+ const STREAM_CONTENT_TYPE = "application/x-ndjson";
26
34
 
27
- module.exports = { BATCH_PATH, BATCH_METHOD, MAX_BATCH_CALLS, NOT_BATCHED };
35
+ module.exports = { BATCH_PATH, BATCH_METHOD, MAX_BATCH_CALLS, NOT_BATCHED, STREAM_CONTENT_TYPE };
@@ -4,3 +4,4 @@ export declare const BATCH_PATH: "/tex-mcp/batch";
4
4
  export declare const BATCH_METHOD: "tools/batch";
5
5
  export declare const MAX_BATCH_CALLS: number;
6
6
  export declare const NOT_BATCHED: "not_batched";
7
+ export declare const STREAM_CONTENT_TYPE: "application/x-ndjson";
@@ -0,0 +1,214 @@
1
+ /**
2
+ * How a person's own Tex talks to them, kept as a note in their Tex store: `tex/instructions.md` (the Tex/Context split,
3
+ * 2026-11-30; Architect: a note in the person's `tex/` folder, as `tex/heartbeat.md` and the other settings notes are,
4
+ * read and written through the Tex-store door with the note's etag as a compare-and-set).
5
+ *
6
+ * ---
7
+ * updates: planOnly
8
+ * before: |
9
+ * Be friendly. ...
10
+ * ---
11
+ * Answer in French.
12
+ * Use no emoji.
13
+ *
14
+ * The body is the instructions, in the person's own words. `updates` is the progress-updates level (absent: normal).
15
+ * `before` is the one undo copy: the text before the last change, set only when the body changes, kept as a block
16
+ * scalar so no line of it can end the front matter. Group chats keep theirs elsewhere; nobody's personal instructions
17
+ * reach a group.
18
+ *
19
+ * The parser never loses text: a note whose front matter does not close, or holds anything this file did not write, is
20
+ * read whole as instructions.
21
+ */
22
+ "use strict";
23
+
24
+ const { readNote, writeNote } = require("./settingsNotes.cjs");
25
+
26
+ /** Where a person's instructions live, in their own Tex store. */
27
+ const INSTRUCTIONS_PATH = "tex/instructions.md";
28
+ /** The most the instructions may hold, as one custom-instructions box does. */
29
+ const MAX_INSTRUCTIONS = 1_500;
30
+ /** Put after instructions cut to `MAX_INSTRUCTIONS` for a prompt, so the cut is visible. */
31
+ const TRUNCATED_MARK = "\n[cut: longer than 1,500 characters]";
32
+ const TEX_UPDATES = Object.freeze(["off", "planOnly", "normal"]);
33
+
34
+ /** Every quick pick: its id, a label, the family one line of which a text holds, and the line it writes. */
35
+ const QUICK_PICKS = Object.freeze(
36
+ [
37
+ ["professional", "Professional", "tone", "Be professional. Write with polish and precision, courteous and to the point, the way a trusted advisor texts a client. Skip small talk and slang."],
38
+ ["friendly", "Friendly", "tone", "Be friendly. Sound warm and relaxed, like a good friend who happens to know the answer. Keep it natural and kind."],
39
+ ["candid", "Candid", "tone", "Be candid. Say plainly what you think, including when it is not what they hoped to hear. Stay kind, and give your reasons briefly."],
40
+ ["quirky", "Quirky", "tone", "Be quirky. Let some playfulness and an odd turn of phrase show now and then. Never let it get in the way of the answer."],
41
+ ["efficient", "Efficient", "tone", "Be efficient. Give the answer and stop: no greeting, no recap, no sign-off, no filler. Stay polite, but keep every word working."],
42
+ ["nerdy", "Nerdy", "tone", "Be nerdy. Enjoy the details and share the interesting why behind things when it helps. Lead with the answer, then the fun part."],
43
+ ["cynical", "Cynical", "tone", "Be a little cynical. Keep a dry wit and a light touch of sarcasm. Still give the practical answer straight."],
44
+ ["warmth_more", "More warmth", "warmth", "Be warmer: show that you care."],
45
+ ["warmth_less", "Less warmth", "warmth", "Keep it neutral and skip the reassurance."],
46
+ ["enthusiasm_more", "More enthusiasm", "enthusiasm", "Be upbeat and energetic."],
47
+ ["enthusiasm_less", "Less enthusiasm", "enthusiasm", "Stay calm and matter-of-fact, with no exclamation marks."],
48
+ ["emoji_more", "More emoji", "emoji", "Use emoji freely where they fit."],
49
+ ["emoji_less", "Less emoji", "emoji", "Use emoji sparingly."],
50
+ ["emoji_none", "No emoji", "emoji", "Use no emoji."],
51
+ ["short", "Short answers", "length", "Keep answers short: the answer and nothing more."],
52
+ ["detailed", "Detailed answers", "length", "Give detailed answers: the reasons, the options and the next step."],
53
+ ["one_bubble", "One bubble", "bubbles", "Send each answer as one text, with no blank lines."],
54
+ ["humor_more", "More humor", "humor", "Joke more when it fits."],
55
+ ["humor_less", "Less humor", "humor", "Joke rarely."],
56
+ ["humor_none", "No humor", "humor", "No jokes."],
57
+ ].map(([id, label, family, line]) => Object.freeze({ id, label, family, line })),
58
+ );
59
+
60
+ const tidy = (text) =>
61
+ String(text ?? "")
62
+ .replace(/\r\n?/g, "\n")
63
+ .split("\n")
64
+ .map((line) => line.trim())
65
+ .filter((line) => line !== "")
66
+ .join("\n");
67
+
68
+ /** The whole note read as instructions, for a note this file cannot read as its own. */
69
+ const whole = (raw) => ({ instructions: tidy(raw), broken: true });
70
+
71
+ /**
72
+ * `{ instructions, updates?, before?, broken? }` from a note's text. `instructions` is "" for none. `broken` says the
73
+ * front matter could not be read, and the whole text was taken as the instructions.
74
+ */
75
+ function parseInstructionsNote(text) {
76
+ const raw = String(text ?? "").replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n");
77
+ const lines = raw.split("\n");
78
+ if (lines[0]?.trimEnd() !== "---") return { instructions: tidy(raw) };
79
+ // The closing fence starts its line: an indented "---" is a line of the undo copy.
80
+ const close = lines.findIndex((line, i) => i > 0 && line.trimEnd() === "---");
81
+ if (close === -1) return whole(raw);
82
+ const out = { instructions: tidy(lines.slice(close + 1).join("\n")) };
83
+ for (let i = 1; i < close; i++) {
84
+ const line = lines[i];
85
+ if (line.trim() === "") continue;
86
+ const updates = /^updates:\s*(\S+)\s*$/.exec(line);
87
+ if (updates && TEX_UPDATES.includes(updates[1])) {
88
+ out.updates = updates[1];
89
+ continue;
90
+ }
91
+ if (/^before:\s*\|\s*$/.test(line)) {
92
+ const kept = [];
93
+ while (i + 1 < close && (lines[i + 1].startsWith(" ") || lines[i + 1] === "")) kept.push(lines[++i].slice(2));
94
+ out.before = tidy(kept.join("\n"));
95
+ continue;
96
+ }
97
+ if (/^before:\s*""\s*$/.test(line)) {
98
+ out.before = "";
99
+ continue;
100
+ }
101
+ return whole(raw);
102
+ }
103
+ return out;
104
+ }
105
+
106
+ /** The note's text for `{ instructions, updates?, before? }`. A note with nothing set is "". */
107
+ function formatInstructionsNote({ instructions = "", updates, before } = {}) {
108
+ const body = tidy(instructions);
109
+ const front = [];
110
+ if (updates !== undefined && updates !== "normal" && TEX_UPDATES.includes(updates)) front.push(`updates: ${updates}`);
111
+ if (typeof before === "string") {
112
+ const kept = tidy(before);
113
+ if (kept === "") front.push('before: ""');
114
+ else front.push("before: |", ...kept.split("\n").map((line) => ` ${line}`));
115
+ }
116
+ // A body whose first line is "---" would read as front matter: an empty one goes first.
117
+ if (front.length === 0) return body === "" ? "" : body.split("\n")[0] === "---" ? `---\n---\n${body}\n` : `${body}\n`;
118
+ return `---\n${front.join("\n")}\n---\n${body === "" ? "" : `${body}\n`}`;
119
+ }
120
+
121
+ /**
122
+ * `kept` with `change` applied (`{ pick } | { add } | { remove } | { replace } | { clear: true } | { undo: true }`):
123
+ * the `{ instructions, before? }` to keep, or `{ refused }`. Text past `MAX_INSTRUCTIONS` and a pick nobody made are
124
+ * refused whole, never cut short. `before` changes only when the body does.
125
+ */
126
+ function applyInstructionsChange(kept, change) {
127
+ const now = tidy(kept?.instructions ?? "");
128
+ const before = kept?.before;
129
+ if (change?.undo === true) {
130
+ if (before === undefined) return { refused: "nothing_to_undo" };
131
+ return { instructions: tidy(before), before: now };
132
+ }
133
+ let next;
134
+ if (change?.pick !== undefined) {
135
+ const pick = QUICK_PICKS.find((entry) => entry.id === change.pick);
136
+ if (pick === undefined) return { refused: "bad_request" };
137
+ const family = new Set(QUICK_PICKS.filter((entry) => entry.family === pick.family).map((entry) => entry.line));
138
+ next = [...now.split("\n").filter((line) => !family.has(line.trim())), pick.line].join("\n");
139
+ } else if (typeof change?.add === "string") next = `${now}\n${change.add}`;
140
+ else if (typeof change?.remove === "string") {
141
+ const gone = tidy(change.remove);
142
+ next = now.split("\n").filter((line) => line.trim() !== gone).join("\n");
143
+ } else if (typeof change?.replace === "string") next = change.replace;
144
+ else if (change?.clear === true) next = "";
145
+ else return { refused: "bad_request" };
146
+ const text = tidy(next);
147
+ if (text.length > MAX_INSTRUCTIONS) return { refused: "too_long" };
148
+ if (text === now) return { instructions: now, ...(before !== undefined ? { before } : {}) };
149
+ return { instructions: text, before: now };
150
+ }
151
+
152
+ /** The instructions as a prompt carries them: at most `MAX_INSTRUCTIONS`, with `TRUNCATED_MARK` when cut. */
153
+ function instructionsForPrompt(instructions) {
154
+ const text = tidy(instructions);
155
+ return text.length <= MAX_INSTRUCTIONS ? text : `${text.slice(0, MAX_INSTRUCTIONS)}${TRUNCATED_MARK}`;
156
+ }
157
+
158
+ /**
159
+ * The person's instructions read through `call` (the tool door, as `settingsNotes.cjs` reads `tex/heartbeat.md`):
160
+ * `{ found: true, etag, instructions, updates?, before? }`, or `{ found: false }` when there is no note yet (or it could
161
+ * not be read), so a caller falls back to the copy it already holds and instructions never silently disappear.
162
+ */
163
+ async function readInstructions(call) {
164
+ const read = await readNote(call, INSTRUCTIONS_PATH);
165
+ if (read === null) return { found: false };
166
+ return { found: true, etag: read.etag, ...parseInstructionsNote(read.note) };
167
+ }
168
+
169
+ /**
170
+ * `change` applied to the note and written back with the etag it was read at, so a change made meanwhile (by a text
171
+ * to Tex, or another page) is refused as `changed` rather than overwritten. With no note yet, `fallback` (the copy
172
+ * the caller already holds) is the text the change applies to, and the note is created. Answers
173
+ * `{ ok: true, instructions }` or `{ ok: false, error }`.
174
+ */
175
+ async function setInstructions(call, change, fallback = "") {
176
+ const read = await readInstructions(call);
177
+ const kept = read.found ? read : { instructions: tidy(fallback) };
178
+ const next = applyInstructionsChange(kept, change);
179
+ if (next.refused) return { ok: false, error: next.refused };
180
+ if (read.found && next.instructions === kept.instructions && next.before === kept.before) return { ok: true, instructions: next.instructions };
181
+ const content = formatInstructionsNote({ instructions: next.instructions, updates: kept.updates, before: next.before });
182
+ const written = await writeNote(call, INSTRUCTIONS_PATH, content, read.found ? read.etag : null);
183
+ return written.ok ? { ok: true, instructions: next.instructions } : written;
184
+ }
185
+
186
+ /**
187
+ * The note made from a copy the caller holds (the control plane's, until the import is done), create-only: a note
188
+ * that is there already is never changed. Answers one outcome to count, never the text: `created`, `skipped` (a note
189
+ * is there), `empty` (no copy to make one from) or `error`.
190
+ */
191
+ async function importInstructions(call, copy) {
192
+ const text = tidy(copy);
193
+ if (text === "") return "empty";
194
+ if (text.length > MAX_INSTRUCTIONS) return "error";
195
+ if ((await readInstructions(call)).found) return "skipped";
196
+ // No etag: the gateway refuses a write over a note that is there, so a read that failed is never an overwrite.
197
+ const written = await writeNote(call, INSTRUCTIONS_PATH, formatInstructionsNote({ instructions: text }), null);
198
+ return written.ok ? "created" : "error";
199
+ }
200
+
201
+ module.exports = {
202
+ INSTRUCTIONS_PATH,
203
+ MAX_INSTRUCTIONS,
204
+ TRUNCATED_MARK,
205
+ TEX_UPDATES,
206
+ QUICK_PICKS,
207
+ parseInstructionsNote,
208
+ formatInstructionsNote,
209
+ applyInstructionsChange,
210
+ instructionsForPrompt,
211
+ readInstructions,
212
+ setInstructions,
213
+ importInstructions,
214
+ };
@@ -0,0 +1,22 @@
1
+ /** Types for `instructionsNote.cjs`; see that file for the reasons. */
2
+ export declare const INSTRUCTIONS_PATH: "tex/instructions.md";
3
+ export declare const MAX_INSTRUCTIONS: number;
4
+ export declare const TRUNCATED_MARK: string;
5
+ export type TexUpdates = "off" | "planOnly" | "normal";
6
+ export declare const TEX_UPDATES: readonly TexUpdates[];
7
+ export type QuickPick = { readonly id: string; readonly label: string; readonly family: string; readonly line: string };
8
+ export declare const QUICK_PICKS: readonly QuickPick[];
9
+ export type InstructionsNote = { instructions: string; updates?: TexUpdates; before?: string; broken?: true };
10
+ export declare function parseInstructionsNote(text: unknown): InstructionsNote;
11
+ export declare function formatInstructionsNote(note?: { instructions?: string; updates?: TexUpdates; before?: string }): string;
12
+ export type InstructionsChange = { pick?: string; add?: string; remove?: string; replace?: string; clear?: boolean; undo?: boolean };
13
+ export declare function applyInstructionsChange(
14
+ kept: { instructions?: string; before?: string } | null | undefined,
15
+ change: InstructionsChange,
16
+ ): { instructions: string; before?: string } | { refused: "bad_request" | "too_long" | "nothing_to_undo" };
17
+ export declare function instructionsForPrompt(instructions: unknown): string;
18
+
19
+ export type ToolCall = (name: string, args: Record<string, unknown>) => Promise<unknown>;
20
+ export declare function readInstructions(call: ToolCall): Promise<({ found: true; etag: string | null } & InstructionsNote) | { found: false }>;
21
+ export declare function setInstructions(call: ToolCall, change: InstructionsChange, fallback?: string): Promise<{ ok: true; instructions: string } | { ok: false; error: string }>;
22
+ export declare function importInstructions(call: ToolCall, copy: unknown): Promise<"created" | "skipped" | "empty" | "error">;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * STAFF SWITCHING ONE TEX CHAT BETWEEN PRODUCTION AND STAGING, FROM CONTEXT'S STAFF CONSOLE (Sayo, 2026-12-01).
3
+ *
4
+ * The route table, the roster of who may be on staging, the member check, the audit and the one-line notice a chat
5
+ * gets when it moves are Tex's (its Photon bridge and `tex_dev route`). The staff console's People page asks Tex's
6
+ * Worker through the gateway, which hands each call over its `TEXTING` binding as `lineRoutes({ token, ...call })`:
7
+ *
8
+ * - `POST LINE_ROUTES_PATH` `{ op, ... }`, the bearer the person's own control-plane sign-in token, exactly as
9
+ * `STAFF_DATA_PATH` (`staffData.cjs`). The gateway decides nothing; Tex's Worker asks the control plane who that
10
+ * sign-in is (`functions/texLineAdmin:myStaffHandle`, answered only for staff, about its caller alone) and records
11
+ * them in the audit.
12
+ * - Ops: `list` `{}`: the chats on staging now; `switch` `{ to, phone }` for a person's 1:1 with Tex, or
13
+ * `{ to, groupKey }` for a group chat named by its key (the control plane's `textGroups.groupKey`).
14
+ *
15
+ * Answers are `{ status: "ok", data }`, `{ status: "refused" }` (not staff) or `{ status: "unavailable" }`. `data` is
16
+ * `{ ok: true, ... }` or `{ ok: false, error }` with a sentence for staff when Tex said no (not on the roster, staging
17
+ * not answering, or a deployment with no line, such as a preview). Only production's Tex has the line.
18
+ */
19
+
20
+ const LINE_ROUTES_PATH = "/tex/line-routes";
21
+ const LINE_ROUTE_OPS = Object.freeze(["list", "switch"]);
22
+ const LINE_ROUTE_TARGETS = Object.freeze(["staging", "production"]);
23
+ const PHONE = /^\+[1-9][0-9]{6,14}$/;
24
+ const GROUP_KEY = /^[0-9a-f]{64}$/;
25
+
26
+ /** A switch call read strictly: `{ op: "list" }`, `{ op: "switch", to, phone }` or `{ op: "switch", to, groupKey }`; else null. */
27
+ function lineRouteRequest(body) {
28
+ if (body === null || typeof body !== "object" || Array.isArray(body)) return null;
29
+ if (body.op === "list") return { op: "list" };
30
+ if (body.op !== "switch" || !LINE_ROUTE_TARGETS.includes(body.to)) return null;
31
+ const phone = typeof body.phone === "string" && PHONE.test(body.phone) ? body.phone : null;
32
+ const groupKey = typeof body.groupKey === "string" && GROUP_KEY.test(body.groupKey) ? body.groupKey : null;
33
+ if ((phone === null) === (groupKey === null)) return null;
34
+ return phone !== null ? { op: "switch", to: body.to, phone } : { op: "switch", to: body.to, groupKey };
35
+ }
36
+
37
+ module.exports = { LINE_ROUTES_PATH, LINE_ROUTE_OPS, LINE_ROUTE_TARGETS, lineRouteRequest };
@@ -0,0 +1,17 @@
1
+ /** Types for `lineRoutes.cjs`; see that file for the reasons. The answers are Tex's Worker's. */
2
+
3
+ export declare const LINE_ROUTES_PATH: "/tex/line-routes";
4
+ export declare const LINE_ROUTE_OPS: readonly ["list", "switch"];
5
+ export declare const LINE_ROUTE_TARGETS: readonly ["staging", "production"];
6
+
7
+ export type LineRouteTarget = (typeof LINE_ROUTE_TARGETS)[number];
8
+ export type LineRouteRequest = { op: "list" } | { op: "switch"; to: LineRouteTarget; phone: string } | { op: "switch"; to: LineRouteTarget; groupKey: string };
9
+ export declare function lineRouteRequest(body: unknown): LineRouteRequest | null;
10
+
11
+ /** One chat on staging: a 1:1 by its person's phone, a group by its key. */
12
+ export type LineRoute = { kind: "dm" | "group"; phone?: string; groupKey?: string; to: LineRouteTarget; by: string | null; at: number };
13
+
14
+ /** `op: "list"`. */
15
+ export type LineRouteList = { ok: true; routes: LineRoute[] } | { ok: false; error: string };
16
+ /** `op: "switch"`: where the chat was, where it is, and whether it was told in one line. */
17
+ export type LineRouteSwitch = { ok: true; to: LineRouteTarget; was: LineRouteTarget; told: boolean; stagingCommit?: string | null } | { ok: false; error: string };
@@ -2,7 +2,7 @@
2
2
  * TEX RUNS ITS CONFIG'S GRAPH (Dev2, 2026-11-14: "it's fine for node to be code, but it's not fine for the connections
3
3
  * between node to be code. They should be predefined").
4
4
  *
5
- * `texConfig.json` names every step (a node) and every wire between them (an edge). This file is the one interpreter of
5
+ * Tex's config names every step (a node) and every wire between them (an edge). This file is the one interpreter of
6
6
  * the wires, shared by the gateway (where every node runs, Dev2 2026-11-14) and the Lab, so what runs, in what order, what waits for what and
7
7
  * what runs in the background is read from the config and never written as code. A node is code: one function, given its input
8
8
  * and a handle to only the nodes its wires reach, that returns its output.
@@ -158,6 +158,11 @@ const ACTIONS = {
158
158
  summary: "Invite people into a shared workspace the person owns; they are emailed once the person says yes.",
159
159
  take: plain,
160
160
  },
161
+ join: {
162
+ tool: "join_workspace",
163
+ summary: "List the workspaces the person was invited to, or join or decline one (workspace, answer) on their own yes or no.",
164
+ take: plain,
165
+ },
161
166
  layout: { tool: "apply_layout", summary: "Lay down a workspace's starting folders, or add one built-in folder.", take: plain },
162
167
  folder_job: {
163
168
  tool: "apply_layout",
@@ -200,6 +205,11 @@ const ACTIONS = {
200
205
  summary: "Save one email as a draft in the person's Gmail, for them to send; nothing is sent.",
201
206
  take: plain,
202
207
  },
208
+ answer_report: {
209
+ tool: "answer_report",
210
+ summary: "Staff only: Tex texts your reply to whoever filed a bug report (reference, message), after a person's yes; it marks the report answered.",
211
+ take: plain,
212
+ },
203
213
  notify: {
204
214
  tool: "notify_me",
205
215
  summary: "Have Tex text the person now: they asked to be told, or it is an emergency. Their settings may hold it.",