@supa-media/tex-contract 0.3.0 → 0.4.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 +13 -14
- package/package.json +1 -1
- package/texContract/staffData.cjs +56 -0
- package/texContract/staffData.d.cts +72 -0
- package/texShared/displayText.cjs +139 -0
- package/texShared/githubOidc.ts +29 -11
- package/texShared/searchConfig.cjs +158 -0
- package/texShared/searchConfig.d.cts +11 -0
- package/texShared/searchConfig.json +645 -0
package/README.md
CHANGED
|
@@ -9,26 +9,25 @@ It is plain CommonJS with no dependencies, and it holds no secrets and no vault
|
|
|
9
9
|
|
|
10
10
|
## What 0.3.0 replaces
|
|
11
11
|
|
|
12
|
-
Since 0.3.0 the contract holds everything Context
|
|
12
|
+
Since 0.3.0 the contract holds everything Context needs from Tex's source, so no Context file imports Tex's code (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
13
|
|
|
14
|
-
|
|
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 |
|
|
14
|
+
Since 0.3.1:
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
- `texShared/searchConfig.cjs` (with its `.json` and types) is a copy of `apps/mcp/src/search/config/searchConfig.cjs`.
|
|
17
|
+
- `texShared/displayText.cjs` is a copy of `packages/shared/src/displayText.cjs`.
|
|
18
|
+
- `parity.test.mjs` keeps both copies equal to their sources, so a search config change in Context bumps the contract.
|
|
19
|
+
- `texShared/githubOidc.ts` lets each OIDC door take its workflow from Tex's repository's main as well as Context's. It still refuses a token whose repository and workflow disagree (`githubOidc.test.mjs`).
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
Since 0.4.0:
|
|
27
22
|
|
|
28
|
-
|
|
23
|
+
- `texContract/staffData.cjs` (with its types) holds the calls Context's staff console and Settings → Feedback make of Tex's Worker, through the gateway: `STAFF_DATA_PATH` (`stats`, `spend`, `review_scores`, on the person's own control-plane sign-in, which Tex checks is staff) and `FEEDBACK_SHARING_PATH` (on the console's grant). Tex's figures and each person's sharing yes are Tex's data and leave Context's control plane.
|
|
24
|
+
|
|
25
|
+
The contract carries facts, never Tex's wording, and Tex's titles, lines and judge questions stay in Tex.
|
|
26
|
+
|
|
27
|
+
The snapshots are written by `node scripts/tex-contract/snapshot.mjs [--tex <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.
|
|
29
28
|
|
|
30
29
|
## How each side reads it
|
|
31
30
|
|
|
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.
|
|
31
|
+
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.
|
|
33
32
|
|
|
34
33
|
MIT licensed.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supa-media/tex-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.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,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TEX'S STAFF FIGURES AND THE FEEDBACK SWITCH, ASKED OF TEX'S OWN WORKER (the Tex/Context split, 2026-11-30).
|
|
3
|
+
*
|
|
4
|
+
* Tex's figures (texts in and out, people and chats, notes made, spend, conversation scores) and each person's yes to
|
|
5
|
+
* sharing their finished conversations with the team used to be answered by Context's control plane. They are Tex's
|
|
6
|
+
* data, so Tex's Worker answers them, and Context's staff console and Settings → Feedback ask it through the gateway,
|
|
7
|
+
* which hands each call to Tex over its `TEXTING` binding:
|
|
8
|
+
*
|
|
9
|
+
* - `POST STAFF_DATA_PATH` `{ op, ...args }`, the bearer the person's own control-plane sign-in token (the console's
|
|
10
|
+
* session token). The gateway passes the token on untouched and decides nothing; Tex's Worker asks the control
|
|
11
|
+
* plane whether that sign-in is staff (`functions/admin:amIAdmin`, a public query, answered for its caller alone)
|
|
12
|
+
* and answers only when it is. Ops: `stats` `{ from?, to? }`, `spend` `{ days? }`, `review_scores` `{ days? }`.
|
|
13
|
+
* - `POST FEEDBACK_SHARING_PATH` `{ share? }` on the console's own grant (`context_console`, a personal workspace's
|
|
14
|
+
* owner). The gateway hands Tex the grant's person and nothing from the body but `share`; absent only asks.
|
|
15
|
+
*
|
|
16
|
+
* Answers are `{ status: "ok", data }`, `{ status: "refused" }` (not staff, or not the console's own grant) or
|
|
17
|
+
* `{ status: "unavailable" }` (Tex's Worker unreachable). Facts and numbers only, never a person, a chat or a word.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const STAFF_DATA_PATH = "/tex/staff-data";
|
|
21
|
+
const FEEDBACK_SHARING_PATH = "/tex/feedback-sharing";
|
|
22
|
+
const STAFF_DATA_OPS = Object.freeze(["stats", "spend", "review_scores"]);
|
|
23
|
+
/** The longest bearer passed on; a control-plane sign-in token is far shorter. */
|
|
24
|
+
const MAX_TOKEN_CHARS = 4096;
|
|
25
|
+
|
|
26
|
+
const finiteOrUndefined = (value) => (typeof value === "number" && Number.isFinite(value) ? value : undefined);
|
|
27
|
+
|
|
28
|
+
/** A staff call read strictly: `{ op, from?, to?, days? }` with only the fields its op takes, or null. */
|
|
29
|
+
function staffDataRequest(body) {
|
|
30
|
+
if (body === null || typeof body !== "object" || Array.isArray(body)) return null;
|
|
31
|
+
const op = body.op;
|
|
32
|
+
if (!STAFF_DATA_OPS.includes(op)) return null;
|
|
33
|
+
if (op === "stats") {
|
|
34
|
+
const from = finiteOrUndefined(body.from);
|
|
35
|
+
const to = finiteOrUndefined(body.to);
|
|
36
|
+
return { op, ...(from === undefined ? {} : { from }), ...(to === undefined ? {} : { to }) };
|
|
37
|
+
}
|
|
38
|
+
const days = finiteOrUndefined(body.days);
|
|
39
|
+
return { op, ...(days === undefined ? {} : { days }) };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The Feedback switch's call: `{ share? }`, or null for anything else. */
|
|
43
|
+
function sharingRequest(body) {
|
|
44
|
+
if (body === null || typeof body !== "object" || Array.isArray(body)) return null;
|
|
45
|
+
if (body.share === undefined) return {};
|
|
46
|
+
return typeof body.share === "boolean" ? { share: body.share } : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The bearer of an `Authorization` header, when it is one plausible token; otherwise null. */
|
|
50
|
+
function bearerOf(header) {
|
|
51
|
+
if (typeof header !== "string") return null;
|
|
52
|
+
const match = /^Bearer ([A-Za-z0-9._~+/=-]+)$/.exec(header.trim());
|
|
53
|
+
return match !== null && match[1].length <= MAX_TOKEN_CHARS ? match[1] : null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = { STAFF_DATA_PATH, FEEDBACK_SHARING_PATH, STAFF_DATA_OPS, MAX_TOKEN_CHARS, staffDataRequest, sharingRequest, bearerOf };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** Types for `staffData.cjs`; see that file for the reasons. The answer shapes are Tex's Worker's (`worker/stats`). */
|
|
2
|
+
|
|
3
|
+
export declare const STAFF_DATA_PATH: "/tex/staff-data";
|
|
4
|
+
export declare const FEEDBACK_SHARING_PATH: "/tex/feedback-sharing";
|
|
5
|
+
export declare const STAFF_DATA_OPS: readonly ["stats", "spend", "review_scores"];
|
|
6
|
+
export declare const MAX_TOKEN_CHARS: number;
|
|
7
|
+
|
|
8
|
+
export type StaffDataOp = (typeof STAFF_DATA_OPS)[number];
|
|
9
|
+
export type StaffDataRequest = { op: "stats"; from?: number; to?: number } | { op: "spend"; days?: number } | { op: "review_scores"; days?: number };
|
|
10
|
+
export declare function staffDataRequest(body: unknown): StaffDataRequest | null;
|
|
11
|
+
export declare function sharingRequest(body: unknown): { share?: boolean } | null;
|
|
12
|
+
export declare function bearerOf(header: unknown): string | null;
|
|
13
|
+
|
|
14
|
+
export type TexDataAnswer<T> = { status: "ok"; data: T } | { status: "refused" } | { status: "unavailable" };
|
|
15
|
+
|
|
16
|
+
export type TexStatsPoint = { at: number; people: number; textsIn: number; textsOut: number; usd: number; notesCreated: number; notesEdited: number };
|
|
17
|
+
|
|
18
|
+
/** `op: "stats"`: the staff console's basics for a window. */
|
|
19
|
+
export type TexStats =
|
|
20
|
+
| { configured: false }
|
|
21
|
+
| {
|
|
22
|
+
configured: true;
|
|
23
|
+
from: number;
|
|
24
|
+
to: number;
|
|
25
|
+
bucket: "hour" | "day";
|
|
26
|
+
errors: { texts: string | null; notes: string | null; cost: string | null };
|
|
27
|
+
people: { one: number; group: number; any: number };
|
|
28
|
+
dailyActive: number;
|
|
29
|
+
texts: { inOne: number; inGroup: number; heardGroup: number; outOne: number; outGroup: number };
|
|
30
|
+
chats?: { one: number; group: number; groupAsked: number; groupHeardOnly: number; any: number; countedSince: number };
|
|
31
|
+
notes: { created: number; edited: number; saves: number };
|
|
32
|
+
cost: { totalUsd: number; testsUsd: number };
|
|
33
|
+
costPerTextUsd: number | null;
|
|
34
|
+
countedSince: number;
|
|
35
|
+
series: TexStatsPoint[];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** `op: "spend"`: Tex's spend by day, model and job, as Cloudflare's AI gateway priced it. */
|
|
39
|
+
export type TexSpend =
|
|
40
|
+
| { configured: false }
|
|
41
|
+
| {
|
|
42
|
+
configured: true;
|
|
43
|
+
error: string | null;
|
|
44
|
+
totalUsd: number;
|
|
45
|
+
testsUsd: number;
|
|
46
|
+
keptFrom: string;
|
|
47
|
+
days: Array<{ day: string; usd: number; requests: number }>;
|
|
48
|
+
models: Array<{ model: string; requests: number; usd: number; freshInputTokens: number; cacheReadTokens: number; cacheWriteTokens: number; outputTokens: number }>;
|
|
49
|
+
jobs: Array<{ job: string; usd: number; requests: number }>;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** One finished conversation's scores (`op: "review_scores"`), naming nobody. */
|
|
53
|
+
export type TexReviewScore = {
|
|
54
|
+
at: number;
|
|
55
|
+
kind: "one" | "group";
|
|
56
|
+
reason: string;
|
|
57
|
+
goal: number;
|
|
58
|
+
independence: number;
|
|
59
|
+
turns: number;
|
|
60
|
+
friendly: number;
|
|
61
|
+
calm: number;
|
|
62
|
+
task: string | null;
|
|
63
|
+
signals: string[];
|
|
64
|
+
texts: number | null;
|
|
65
|
+
who: "staff" | "new" | "other" | null;
|
|
66
|
+
costMicroUsd: number | null;
|
|
67
|
+
thought: boolean | null;
|
|
68
|
+
};
|
|
69
|
+
export type TexReviewScores = { truncated: boolean; reviews: TexReviewScore[] };
|
|
70
|
+
|
|
71
|
+
/** The Feedback switch's answer: whether the person shares, and whether this call changed it. */
|
|
72
|
+
export type FeedbackSharing = { sharing: boolean; changed: boolean };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Containing a string somebody else chose, where the app speaks in its own
|
|
3
|
+
* voice.
|
|
4
|
+
*
|
|
5
|
+
* ## The property, and why it is containment rather than cleaning
|
|
6
|
+
*
|
|
7
|
+
* Three different inputs reach the console's own chrome: a note path out of a
|
|
8
|
+
* bucket we do not own, a display name out of a presence room, and text a
|
|
9
|
+
* plugin chose. All three are drawn beside Context's own words — the status
|
|
10
|
+
* bar, the breadcrumb, a card next to the Stop button — and a bidi override
|
|
11
|
+
* inside any of them reverses the rendering of *everything after it*, which
|
|
12
|
+
* includes the app's own labels.
|
|
13
|
+
*
|
|
14
|
+
* There are two ways to answer that and they are not equally strong:
|
|
15
|
+
*
|
|
16
|
+
* - **Stripping is a blocklist.** It works exactly as far as the list of
|
|
17
|
+
* hostile characters reaches, and every character nobody enumerated passes
|
|
18
|
+
* through. Two lists in this repository prove the point: one spells the
|
|
19
|
+
* class `[\p{Cc}\p{Cf}]` and misses U+2028 LINE SEPARATOR, which is `Zl`;
|
|
20
|
+
* the other spells it as hand-written ranges and misses U+061C ARABIC
|
|
21
|
+
* LETTER MARK — a character the bidi algorithm acts on — along with the
|
|
22
|
+
* U+FFF9–FFFB annotation set.
|
|
23
|
+
* - **Isolating is a whitelist of structure.** The value arrives inside a
|
|
24
|
+
* container the bidi algorithm cannot be talked out of: whatever is in
|
|
25
|
+
* there resolves its own direction and cannot reach the text around it.
|
|
26
|
+
* Characters nobody enumerated are contained too, because containment does
|
|
27
|
+
* not depend on recognising them.
|
|
28
|
+
*
|
|
29
|
+
* So this isolates. What it removes, it removes only where an isolate
|
|
30
|
+
* *cannot* do the job.
|
|
31
|
+
*
|
|
32
|
+
* ## What isolation does and does not buy, stated rather than implied
|
|
33
|
+
*
|
|
34
|
+
* **Buys:** a hostile value cannot reorder, reverse or relocate anything
|
|
35
|
+
* outside itself. The label beside it, the version, the word "Private", the
|
|
36
|
+
* Stop button's row — none of them can be made to render as something else by
|
|
37
|
+
* a character inside somebody's filename.
|
|
38
|
+
*
|
|
39
|
+
* **Does not buy:** a value can still misrender *itself*. `sei<RLO>fdp.md`
|
|
40
|
+
* inside an isolate is still a name that reads back to front. Making the value
|
|
41
|
+
* render truthfully means altering it, and for a path that is the wrong trade
|
|
42
|
+
* — the path in the status bar is also the path somebody copies out of it, so
|
|
43
|
+
* a displayed value that differs from the real key is its own defect. Where
|
|
44
|
+
* altering it IS right, because nothing downstream copies the value, the
|
|
45
|
+
* caller strips first and isolates after; `shareTitle.ts` is that case and
|
|
46
|
+
* keeps its strip.
|
|
47
|
+
*
|
|
48
|
+
* ## The two removals, and why each is not an exception to the rule
|
|
49
|
+
*
|
|
50
|
+
* 1. **`\p{Cc}`, U+2028 and U+2029 are removed.** A C0 control, DEL, a line
|
|
51
|
+
* separator and a paragraph separator have no rendering to contain — they
|
|
52
|
+
* break the line the label sits on, inside an isolate as readily as outside
|
|
53
|
+
* one. An isolate is the wrong instrument rather than a weaker one.
|
|
54
|
+
* 2. **U+2069 PDI and U+202C PDF are removed.** These are the *pops*: a PDI
|
|
55
|
+
* inside the value closes the container early and hands the rest of the
|
|
56
|
+
* string the reach this function exists to deny. A container that the
|
|
57
|
+
* contents can end is not a container. Nothing legitimate is lost, because
|
|
58
|
+
* a pop with nothing to pop has no effect in the first place — every
|
|
59
|
+
* embedding the value opens is closed by the PDI this appends.
|
|
60
|
+
*
|
|
61
|
+
* Both are what makes the isolate *hold*, which is why they live here and not
|
|
62
|
+
* in a list each caller keeps.
|
|
63
|
+
*
|
|
64
|
+
* ## Why this is a `.cjs` file in `packages/shared`
|
|
65
|
+
*
|
|
66
|
+
* Its callers include `packages/obsidian-runtime`, which has **no
|
|
67
|
+
* dependencies** by construction, and the gateway, which has none either.
|
|
68
|
+
* Neither can import this package's TypeScript. The same reasoning put
|
|
69
|
+
* `storageLayout.cjs` and `activity.cjs` here, and those are imported by
|
|
70
|
+
* relative path from the zero-dependency halves of the product. A second copy
|
|
71
|
+
* of this rule in each of them is the drift this file exists to end.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/** FIRST STRONG ISOLATE — opens a container whose direction is its own. */
|
|
75
|
+
const FIRST_STRONG_ISOLATE = "\u2068";
|
|
76
|
+
/** POP DIRECTIONAL ISOLATE — closes it. */
|
|
77
|
+
const POP_DIRECTIONAL_ISOLATE = "\u2069";
|
|
78
|
+
/** POP DIRECTIONAL FORMATTING — closes an *embedding*, and escapes ours. */
|
|
79
|
+
const POP_DIRECTIONAL_FORMATTING = "\u202c";
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Characters an isolate cannot contain, so they are removed instead.
|
|
83
|
+
*
|
|
84
|
+
* `\p{Cc}` is C0 and DEL. U+2028 and U+2029 are `Zl`/`Zp` — the reason they
|
|
85
|
+
* are named separately is that the `[\p{Cc}\p{Cf}]` spelling elsewhere in this
|
|
86
|
+
* repository does not cover them, and a line separator in a status bar label
|
|
87
|
+
* is a broken layout whichever category it belongs to.
|
|
88
|
+
*/
|
|
89
|
+
const UNCONTAINABLE = /[\p{Cc}\p{Zl}\p{Zp}]/gu;
|
|
90
|
+
|
|
91
|
+
/** The two pops, which would end the container from inside it. */
|
|
92
|
+
const POPS = /[\u2069\u202c]/gu;
|
|
93
|
+
|
|
94
|
+
/** Any format character. If one survives the removals, the value is contained. */
|
|
95
|
+
const FORMAT_CHARACTER = /\p{Cf}/u;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Remove what an isolate cannot contain.
|
|
99
|
+
*
|
|
100
|
+
* Exported on its own because a caller that has already decided to *alter* the
|
|
101
|
+
* value — a share card's title, where nothing downstream copies it — still
|
|
102
|
+
* wants this half, and wants it from here rather than from a regex of its own.
|
|
103
|
+
*
|
|
104
|
+
* @param {unknown} value
|
|
105
|
+
* @returns {string}
|
|
106
|
+
*/
|
|
107
|
+
function stripUncontainable(value) {
|
|
108
|
+
return typeof value === "string" ? value.replace(UNCONTAINABLE, "") : "";
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The value, contained, so nothing in it can reach the app's own words.
|
|
113
|
+
*
|
|
114
|
+
* **A string with nothing to contain comes back byte-identical**, deliberately:
|
|
115
|
+
* almost every path, name and label is ordinary text, and wrapping all of them
|
|
116
|
+
* would put two invisible characters into every comparison, every snapshot and
|
|
117
|
+
* everything somebody copies, to no end. The container appears exactly where
|
|
118
|
+
* there is something to hold.
|
|
119
|
+
*
|
|
120
|
+
* Call it at the point the value is known to be *display* — after any length
|
|
121
|
+
* cap the caller applies, so the cap measures the text rather than the
|
|
122
|
+
* container.
|
|
123
|
+
*
|
|
124
|
+
* @param {unknown} value
|
|
125
|
+
* @returns {string}
|
|
126
|
+
*/
|
|
127
|
+
function isolateForDisplay(value) {
|
|
128
|
+
const cleaned = stripUncontainable(value).replace(POPS, "");
|
|
129
|
+
if (cleaned === "" || !FORMAT_CHARACTER.test(cleaned)) return cleaned;
|
|
130
|
+
return `${FIRST_STRONG_ISOLATE}${cleaned}${POP_DIRECTIONAL_ISOLATE}`;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
module.exports = {
|
|
134
|
+
FIRST_STRONG_ISOLATE,
|
|
135
|
+
POP_DIRECTIONAL_ISOLATE,
|
|
136
|
+
POP_DIRECTIONAL_FORMATTING,
|
|
137
|
+
isolateForDisplay,
|
|
138
|
+
stripUncontainable,
|
|
139
|
+
};
|
package/texShared/githubOidc.ts
CHANGED
|
@@ -3,25 +3,40 @@
|
|
|
3
3
|
* (`infra/tex-runner`). A workflow job with `id-token: write` asks GitHub for a token naming the service as its
|
|
4
4
|
* audience; GitHub signs it, and its claims say which repository, which workflow file at which ref, and which run
|
|
5
5
|
* asked. Each service checks the signature against GitHub's published keys and then the claims, so only main's own
|
|
6
|
-
* workflow for that door gets in. There is no secret to keep: a branch can dispatch `tex-test-set.yml` on itself,
|
|
6
|
+
* workflow for that door, in Context's or Tex's repository, gets in. There is no secret to keep: a branch can dispatch `tex-test-set.yml` on itself,
|
|
7
7
|
* but then its token names `@refs/heads/<branch>`, and is refused.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
export const ISSUER = "https://token.actions.githubusercontent.com";
|
|
11
11
|
export const AUDIENCE = "context-tex-eval";
|
|
12
|
+
/** Context's repository, where these workflows have run until now. */
|
|
12
13
|
export const REPOSITORY = "Supa-Media/context";
|
|
14
|
+
/**
|
|
15
|
+
* Tex's own repository (the clean split, 2026-11-29): Tex's workflows move there, and while they move each door takes
|
|
16
|
+
* its workflow from either repository, always only from that repository's main. No other repository, fork included.
|
|
17
|
+
*/
|
|
18
|
+
export const TEX_REPOSITORY = "Supa-Media/tex";
|
|
19
|
+
export const REPOSITORIES = [REPOSITORY, TEX_REPOSITORY] as const;
|
|
13
20
|
const JWKS_URL = `${ISSUER}/.well-known/jwks`;
|
|
14
21
|
|
|
15
|
-
/** The
|
|
16
|
-
export const
|
|
17
|
-
run:
|
|
18
|
-
seed:
|
|
19
|
-
"search-run":
|
|
20
|
-
"search-seed":
|
|
22
|
+
/** The workflow file each door takes. */
|
|
23
|
+
export const WORKFLOW_FILES = {
|
|
24
|
+
run: "tex-test-set.yml",
|
|
25
|
+
seed: "tex-test-set-seed.yml",
|
|
26
|
+
"search-run": "search-test-set.yml",
|
|
27
|
+
"search-seed": "search-test-set-seed.yml",
|
|
21
28
|
// Not a door of this service: the Lab runner (infra/tex-runner) checks its own audience with this same code.
|
|
22
|
-
"lab-runner":
|
|
29
|
+
"lab-runner": "tex-lab-sandbox.yml",
|
|
23
30
|
} as const;
|
|
24
|
-
export type Door = keyof typeof
|
|
31
|
+
export type Door = keyof typeof WORKFLOW_FILES;
|
|
32
|
+
|
|
33
|
+
/** A door's workflow as GitHub writes `job_workflow_ref`: the file on that repository's main and nowhere else. */
|
|
34
|
+
export const workflowRef = (repository: string, door: Door) => `${repository}/.github/workflows/${WORKFLOW_FILES[door]}@refs/heads/main`;
|
|
35
|
+
|
|
36
|
+
/** Each door's workflow in Context's repository (as before the split). */
|
|
37
|
+
export const WORKFLOWS = Object.fromEntries(Object.keys(WORKFLOW_FILES).map((door) => [door, workflowRef(REPOSITORY, door as Door)])) as Record<Door, string>;
|
|
38
|
+
/** Each door's workflow in Tex's repository. */
|
|
39
|
+
export const TEX_WORKFLOWS = Object.fromEntries(Object.keys(WORKFLOW_FILES).map((door) => [door, workflowRef(TEX_REPOSITORY, door as Door)])) as Record<Door, string>;
|
|
25
40
|
|
|
26
41
|
export interface Claims {
|
|
27
42
|
iss: string;
|
|
@@ -91,8 +106,11 @@ export async function verify(authorization: string | null, door: Door, keys: Key
|
|
|
91
106
|
if (!aud.includes(audience)) throw new Refused("not meant for this service");
|
|
92
107
|
if (!(claims.exp > s)) throw new Refused("expired");
|
|
93
108
|
if (typeof claims.nbf === "number" && claims.nbf > s + 60) throw new Refused("not valid yet");
|
|
94
|
-
if (claims.repository
|
|
95
|
-
|
|
109
|
+
if (!(REPOSITORIES as readonly string[]).includes(claims.repository)) throw new Refused("not this repository");
|
|
110
|
+
// The workflow must be the door's file in the same repository the token names, on its main.
|
|
111
|
+
if (claims.job_workflow_ref !== workflowRef(claims.repository, door) || claims.ref !== "refs/heads/main") {
|
|
112
|
+
throw new Refused(`only ${WORKFLOWS[door]} or ${TEX_WORKFLOWS[door]} may use this door`);
|
|
113
|
+
}
|
|
96
114
|
if (!/^\d+$/.test(String(claims.run_id ?? ""))) throw new Refused("no run named");
|
|
97
115
|
return claims;
|
|
98
116
|
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SEARCH'S CONFIG, AS EVERY RUNTIME READS IT (Dev2, 2026-11-21: "we can have like a texting config, text nightly
|
|
3
|
+
* config, and then search config because not only text users search").
|
|
4
|
+
*
|
|
5
|
+
* `searchConfig.json` holds every step a search runs (a node), its settings, and the wires between them, in the
|
|
6
|
+
* Lab's graph shape (the one Tex's `texConfig.json` uses). The gateway's search (`config/nodes.js`, run by the shared
|
|
7
|
+
* graph runner) and the defaults every other caller of the search code ranks by (`../ranking.js`, `../settings.js`)
|
|
8
|
+
* read it through this file only, so a config that does not match the schema below fails loudly at start instead of
|
|
9
|
+
* being misread. The Lab draws it on its Search page and a Promote changes it in a pull request.
|
|
10
|
+
*
|
|
11
|
+
* The schema is this file's: `SEARCH_SETTINGS_BOUNDS` (what each setting may be), the node and wire fields, and
|
|
12
|
+
* `searchConfigProblems(config)`, everything wrong with a config as sentences. A draft from the Lab is checked by the
|
|
13
|
+
* same function before a search runs on it.
|
|
14
|
+
*/
|
|
15
|
+
"use strict";
|
|
16
|
+
|
|
17
|
+
const { PERSON_SEARCH_BOUNDS } = require("../texContract/searchSettings.cjs");
|
|
18
|
+
|
|
19
|
+
const SEARCH_SCHEMA_VERSION = 1;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Every setting a search step may have, and what it may be. The ranking knobs are `../ranking.js`'s; `minScore`,
|
|
23
|
+
* `extraNotes` and `snippetChars` are the person-facing search settings (`../settings.js`), whose defaults are here.
|
|
24
|
+
*/
|
|
25
|
+
const SEARCH_SETTINGS_BOUNDS = Object.freeze({
|
|
26
|
+
// The person-facing three are a contract Tex reads too (`packages/shared/src/texContract/searchSettings.cjs`).
|
|
27
|
+
...PERSON_SEARCH_BOUNDS,
|
|
28
|
+
rrfK: { min: 1, max: 1000, integer: false },
|
|
29
|
+
loosePenalty: { min: 0, max: 1000, integer: false },
|
|
30
|
+
titleWeight: { min: 0, max: 1, integer: false },
|
|
31
|
+
phraseBonus: { min: 0, max: 1, integer: false },
|
|
32
|
+
snippetPhraseBonus: { min: 0, max: 1, integer: false },
|
|
33
|
+
boostFactor: { min: 1, max: 10, integer: false },
|
|
34
|
+
meaningFloor: { min: 0, max: 1, integer: false },
|
|
35
|
+
looseReads: { min: 0, max: 20, integer: true },
|
|
36
|
+
hits: { min: 1, max: 50, integer: true },
|
|
37
|
+
logPrior: { min: 0, max: 1, integer: false },
|
|
38
|
+
inboxPrior: { min: 0, max: 1, integer: false },
|
|
39
|
+
rerankTop: { min: 2, max: 50, integer: true },
|
|
40
|
+
rerankWeight: { min: 0, max: 5, integer: false },
|
|
41
|
+
rerankChars: { min: 100, max: 2000, integer: true },
|
|
42
|
+
readLate: { min: 0, max: 1, integer: true },
|
|
43
|
+
waitAfterMeaning: { min: 0, max: 5000, integer: true },
|
|
44
|
+
sharedWords: { min: 0, max: 2, integer: true },
|
|
45
|
+
workspaceWeight: { min: 0, max: 1, integer: false },
|
|
46
|
+
openMine: { min: 0, max: 5, integer: false },
|
|
47
|
+
openPeople: { min: 0, max: 5, integer: false },
|
|
48
|
+
openAi: { min: 0, max: 5, integer: false },
|
|
49
|
+
contentWords: { min: 0, max: 1, integer: true },
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/** Which settings each step reads: a setting on a step that does not read it would be a knob that does nothing. */
|
|
53
|
+
const SETTINGS_OF = Object.freeze({
|
|
54
|
+
search: Object.freeze([]),
|
|
55
|
+
open: Object.freeze([]),
|
|
56
|
+
words: Object.freeze(["contentWords"]),
|
|
57
|
+
meaning: Object.freeze(["minScore"]),
|
|
58
|
+
visible: Object.freeze([]),
|
|
59
|
+
probes: Object.freeze([]),
|
|
60
|
+
floor: Object.freeze(["meaningFloor"]),
|
|
61
|
+
merge: Object.freeze(["rrfK"]),
|
|
62
|
+
title: Object.freeze(["titleWeight", "phraseBonus", "snippetPhraseBonus"]),
|
|
63
|
+
prior: Object.freeze(["logPrior", "inboxPrior"]),
|
|
64
|
+
opens: Object.freeze(["openMine", "openPeople", "openAi"]),
|
|
65
|
+
budget: Object.freeze(["extraNotes", "looseReads"]),
|
|
66
|
+
snippets: Object.freeze(["snippetChars"]),
|
|
67
|
+
rerankWords: Object.freeze(["rerankTop", "rerankChars", "waitAfterMeaning"]),
|
|
68
|
+
rerank: Object.freeze(["rerankTop", "rerankWeight", "rerankChars", "readLate"]),
|
|
69
|
+
code: Object.freeze([]),
|
|
70
|
+
answer: Object.freeze([]),
|
|
71
|
+
fuse: Object.freeze(["hits", "rrfK", "loosePenalty", "titleWeight", "phraseBonus", "snippetPhraseBonus", "meaningFloor", "looseReads", "boostFactor", "logPrior", "inboxPrior", "rerankWeight", "sharedWords", "workspaceWeight", "openMine", "openPeople", "openAi"]),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/** The steps every search needs, which a draft may not turn off: the others are passed over when off (`config/nodes.js`). */
|
|
75
|
+
const ALWAYS_ON = Object.freeze(["search", "open", "visible", "code", "fuse", "answer"]);
|
|
76
|
+
|
|
77
|
+
const NODE_KEYS = Object.freeze(["id", "label", "goal", "on", "model", "kind", "icon", "file", "note", "x", "y", "group", "settings", "inSchema", "outSchema", "log"]);
|
|
78
|
+
const EDGE_KEYS = Object.freeze(["from", "to", "mode", "when"]);
|
|
79
|
+
/**
|
|
80
|
+
* Search's wires wait (each step runs on the output of the ones before it, left to right), or a step uses another: it
|
|
81
|
+
* calls it for one part of its work, as Words hands each workspace's hits to "Rerank word hits" the moment that
|
|
82
|
+
* workspace answers (Dev2, 2026-11-21).
|
|
83
|
+
*/
|
|
84
|
+
const MODES = Object.freeze(["wait", "uses"]);
|
|
85
|
+
|
|
86
|
+
/** Why one setting's value is refused, or null when it may be used. */
|
|
87
|
+
function settingProblem(name, value) {
|
|
88
|
+
const bound = SEARCH_SETTINGS_BOUNDS[name];
|
|
89
|
+
if (!bound) return `"${name}" is not a search setting (one of ${Object.keys(SEARCH_SETTINGS_BOUNDS).join(", ")})`;
|
|
90
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return `${name} must be a number`;
|
|
91
|
+
if (value < bound.min || value > bound.max) return `${name} must be from ${bound.min} to ${bound.max}`;
|
|
92
|
+
if (bound.integer && !Number.isInteger(value)) return `${name} must be a whole number`;
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Everything wrong with a parsed search config, as sentences a person reads; [] when it is sound. */
|
|
97
|
+
function searchConfigProblems(config) {
|
|
98
|
+
const out = [];
|
|
99
|
+
if (!config || typeof config !== "object" || Array.isArray(config)) return ["the search config is not an object"];
|
|
100
|
+
if (config.searchConfig !== SEARCH_SCHEMA_VERSION) out.push(`it is search schema version ${JSON.stringify(config.searchConfig)}, not ${SEARCH_SCHEMA_VERSION}`);
|
|
101
|
+
if (!Array.isArray(config.nodes) || !Array.isArray(config.edges)) return [...out, "it has no nodes and edges lists"];
|
|
102
|
+
const ids = new Set();
|
|
103
|
+
for (const n of config.nodes) {
|
|
104
|
+
if (!n || typeof n.id !== "string") {
|
|
105
|
+
out.push("a step has no id");
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (ids.has(n.id)) out.push(`step "${n.id}" is there twice`);
|
|
109
|
+
ids.add(n.id);
|
|
110
|
+
const reads = SETTINGS_OF[n.id];
|
|
111
|
+
if (!reads) out.push(`step "${n.id}" is not a search step (one of ${Object.keys(SETTINGS_OF).join(", ")})`);
|
|
112
|
+
for (const k of Object.keys(n)) if (!NODE_KEYS.includes(k)) out.push(`step "${n.id}" has a field the search schema does not know: ${k}`);
|
|
113
|
+
if (typeof n.label !== "string") out.push(`step "${n.id}" has no label`);
|
|
114
|
+
if (typeof n.on !== "boolean") out.push(`step "${n.id}" on must be true or false`);
|
|
115
|
+
else if (!n.on && ALWAYS_ON.includes(n.id)) out.push(`step "${n.id}" is one every search needs, so it cannot be turned off`);
|
|
116
|
+
if (n.model !== "code") out.push(`step "${n.id}" runs as code (model "code")`);
|
|
117
|
+
const settings = n.settings ?? {};
|
|
118
|
+
if (typeof settings !== "object" || Array.isArray(settings)) {
|
|
119
|
+
out.push(`step "${n.id}" settings must be an object`);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
for (const [name, value] of Object.entries(settings)) {
|
|
123
|
+
const problem = settingProblem(name, value);
|
|
124
|
+
if (problem) out.push(`step "${n.id}": ${problem}`);
|
|
125
|
+
else if (reads && !reads.includes(name)) out.push(`step "${n.id}" does not read ${name}`);
|
|
126
|
+
}
|
|
127
|
+
for (const name of reads ?? []) if (!(name in settings)) out.push(`step "${n.id}" has no ${name} setting`);
|
|
128
|
+
}
|
|
129
|
+
for (const id of Object.keys(SETTINGS_OF)) if (!ids.has(id)) out.push(`there is no "${id}" step`);
|
|
130
|
+
for (const e of config.edges) {
|
|
131
|
+
const name = `${e?.from} → ${e?.to}`;
|
|
132
|
+
if (!e || !ids.has(e.from) || !ids.has(e.to)) {
|
|
133
|
+
out.push(`the wire ${name} joins a step that is not there`);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
for (const k of Object.keys(e)) if (!EDGE_KEYS.includes(k)) out.push(`the wire ${name} has a field the search schema does not know: ${k}`);
|
|
137
|
+
if (!MODES.includes(e.mode)) out.push(`the wire ${name} has mode "${e.mode}": search wires are ${MODES.join(" or ")}`);
|
|
138
|
+
if (!Array.isArray(e.when) || e.when.length === 0) out.push(`the wire ${name} needs a when list`);
|
|
139
|
+
}
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** A parsed config, checked: answered as it is, or an error naming every problem. */
|
|
144
|
+
function searchConfigOf(config) {
|
|
145
|
+
const problems = searchConfigProblems(config);
|
|
146
|
+
if (problems.length > 0) throw new Error(`searchConfig.json does not match its schema (searchConfig.cjs): ${problems.join("; ")}`);
|
|
147
|
+
return config;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const SEARCH_CONFIG = Object.freeze(searchConfigOf(require("./searchConfig.json")));
|
|
151
|
+
|
|
152
|
+
/** A step's settings in a config (main's when none is given), or {} when it has none. */
|
|
153
|
+
function settingsOf(id, config = SEARCH_CONFIG) {
|
|
154
|
+
const node = (config?.nodes ?? []).find((n) => n && n.id === id);
|
|
155
|
+
return node && node.settings && typeof node.settings === "object" ? node.settings : {};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
module.exports = { ALWAYS_ON, NODE_KEYS, EDGE_KEYS, SEARCH_SCHEMA_VERSION, SEARCH_SETTINGS_BOUNDS, SETTINGS_OF, SEARCH_CONFIG, searchConfigProblems, searchConfigOf, settingProblem, settingsOf };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Types for `searchConfig.cjs`: search's config as `searchConfig.json` has it, and its schema. */
|
|
2
|
+
export declare const NODE_KEYS: readonly string[];
|
|
3
|
+
export declare const EDGE_KEYS: readonly string[];
|
|
4
|
+
export declare const SEARCH_SCHEMA_VERSION: number;
|
|
5
|
+
export declare const SEARCH_SETTINGS_BOUNDS: Readonly<Record<string, { min: number; max: number; integer: boolean }>>;
|
|
6
|
+
export declare const SETTINGS_OF: Readonly<Record<string, readonly string[]>>;
|
|
7
|
+
export declare const SEARCH_CONFIG: typeof import("./searchConfig.json");
|
|
8
|
+
export declare function searchConfigProblems(config: unknown): string[];
|
|
9
|
+
export declare function searchConfigOf<T>(config: T): T;
|
|
10
|
+
export declare function settingProblem(name: string, value: unknown): string | null;
|
|
11
|
+
export declare function settingsOf(id: string, config?: unknown): Record<string, number>;
|
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
{
|
|
2
|
+
"searchConfig": 1,
|
|
3
|
+
"about": "Search's own config (Dev2, 2026-11-21: \"not only Tex uses search\"): every step a search runs, its settings and the wires between them. Read by the gateway's search for every caller (an AI client's search_notes, the app's search bar, Tex) through searchConfig.cjs, and edited in the Lab on the Search page. A Lab Promote changes this file in a pull request.",
|
|
4
|
+
"nodes": [
|
|
5
|
+
{
|
|
6
|
+
"id": "search",
|
|
7
|
+
"label": "Query",
|
|
8
|
+
"goal": "A search arrives (an AI client's search_notes, the app's search bar, Tex): pick the workspaces it asks, every one the person reaches unless a folder, a scope or the person's setting narrows it.",
|
|
9
|
+
"on": true,
|
|
10
|
+
"model": "code",
|
|
11
|
+
"kind": "input",
|
|
12
|
+
"icon": "door",
|
|
13
|
+
"file": "apps/mcp/src/search/config/nodes.js",
|
|
14
|
+
"x": 0,
|
|
15
|
+
"y": 0,
|
|
16
|
+
"settings": {},
|
|
17
|
+
"inSchema": [
|
|
18
|
+
{ "name": "query", "type": "text" },
|
|
19
|
+
{ "name": "prefix", "type": "text" },
|
|
20
|
+
{ "name": "only", "type": "list", "optional": true },
|
|
21
|
+
{ "name": "boost", "type": "text", "optional": true }
|
|
22
|
+
],
|
|
23
|
+
"outSchema": [
|
|
24
|
+
{ "name": "to", "type": "choice", "options": "open, none" },
|
|
25
|
+
{ "name": "query", "type": "text" },
|
|
26
|
+
{ "name": "prefix", "type": "text" },
|
|
27
|
+
{ "name": "names", "type": "ids" },
|
|
28
|
+
{ "name": "here", "type": "yesno" },
|
|
29
|
+
{ "name": "boost", "type": "text", "optional": true }
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "open",
|
|
34
|
+
"label": "Open as you",
|
|
35
|
+
"goal": "Open every workspace asked the way a tool call naming it does: the person's role there and its own privacy rules. One that cannot be opened now is left out and named unreached, never guessed at.",
|
|
36
|
+
"on": true,
|
|
37
|
+
"model": "code",
|
|
38
|
+
"icon": "shield",
|
|
39
|
+
"file": "apps/mcp/src/search/config/nodes.js · privacy/state.js",
|
|
40
|
+
"x": 240,
|
|
41
|
+
"y": 0,
|
|
42
|
+
"settings": {},
|
|
43
|
+
"inSchema": [
|
|
44
|
+
{ "name": "to", "type": "text", "optional": true },
|
|
45
|
+
{ "name": "query", "type": "text" },
|
|
46
|
+
{ "name": "prefix", "type": "text" },
|
|
47
|
+
{ "name": "names", "type": "ids" },
|
|
48
|
+
{ "name": "here", "type": "yesno" },
|
|
49
|
+
{ "name": "boost", "type": "text", "optional": true }
|
|
50
|
+
],
|
|
51
|
+
"outSchema": [
|
|
52
|
+
{ "name": "query", "type": "text" },
|
|
53
|
+
{ "name": "prefix", "type": "text" },
|
|
54
|
+
{ "name": "several", "type": "yesno" },
|
|
55
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
56
|
+
{ "name": "workspaces", "type": "list" },
|
|
57
|
+
{ "name": "unreached", "type": "ids" }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "words",
|
|
62
|
+
"label": "Words",
|
|
63
|
+
"goal": "Nominates: notes holding the query's words in every workspace at once, ranked by the word index (BM25, titles and headings weighted), retried with any word when no note holds them all (those are marked loose). contentWords 1: where some note holds every word, the notes holding every word that is not filler (\"what did we\") are the hits instead. Only notes the person may see.",
|
|
64
|
+
"on": true,
|
|
65
|
+
"model": "code",
|
|
66
|
+
"icon": "text",
|
|
67
|
+
"file": "apps/mcp/src/search/visibleNotes.js · objectSearch.js",
|
|
68
|
+
"x": 480,
|
|
69
|
+
"y": -110,
|
|
70
|
+
"settings": { "contentWords": 1 },
|
|
71
|
+
"inSchema": [
|
|
72
|
+
{ "name": "query", "type": "text" },
|
|
73
|
+
{ "name": "prefix", "type": "text" },
|
|
74
|
+
{ "name": "several", "type": "yesno" },
|
|
75
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
76
|
+
{ "name": "workspaces", "type": "list" },
|
|
77
|
+
{ "name": "unreached", "type": "ids" },
|
|
78
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
79
|
+
],
|
|
80
|
+
"outSchema": [
|
|
81
|
+
{ "name": "query", "type": "text" },
|
|
82
|
+
{ "name": "prefix", "type": "text" },
|
|
83
|
+
{ "name": "several", "type": "yesno" },
|
|
84
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
85
|
+
{ "name": "workspaces", "type": "list" },
|
|
86
|
+
{ "name": "unreached", "type": "ids" },
|
|
87
|
+
{ "name": "byWords", "type": "object" }
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "rerankWords",
|
|
92
|
+
"label": "Rerank word hits",
|
|
93
|
+
"goal": "Ranks: each workspace’s first word hits (rerankTop, rerankChars of each) read beside the query by the cross-encoder one call per workspace, sent by Words the moment that workspace answers, while the others and Meaning still run, so its time hides behind theirs; each hit keeps its score for Rerank, which then reads it no more. Never adds or drops a note.",
|
|
94
|
+
"on": true,
|
|
95
|
+
"model": "code",
|
|
96
|
+
"icon": "star",
|
|
97
|
+
"file": "apps/mcp/src/search/rerank.js",
|
|
98
|
+
"x": 480,
|
|
99
|
+
"y": -270,
|
|
100
|
+
"settings": { "rerankTop": 8, "rerankChars": 400, "waitAfterMeaning": 5000 },
|
|
101
|
+
"inSchema": [
|
|
102
|
+
{ "name": "query", "type": "text" },
|
|
103
|
+
{ "name": "workspace", "type": "text" },
|
|
104
|
+
{ "name": "found", "type": "object" }
|
|
105
|
+
],
|
|
106
|
+
"outSchema": [
|
|
107
|
+
{ "name": "found", "type": "object" }
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "meaning",
|
|
112
|
+
"label": "Meaning",
|
|
113
|
+
"goal": "Nominates: the nearest passages to the query's embedding (embedded once per search) in every workspace at once, at least minScore close. Only notes the person may see; never plumbing or a search probe.",
|
|
114
|
+
"on": true,
|
|
115
|
+
"model": "code",
|
|
116
|
+
"icon": "star",
|
|
117
|
+
"file": "apps/mcp/src/search/meaning/serve.js meaningMatches",
|
|
118
|
+
"x": 480,
|
|
119
|
+
"y": 110,
|
|
120
|
+
"settings": { "minScore": 0.4 },
|
|
121
|
+
"inSchema": [
|
|
122
|
+
{ "name": "query", "type": "text" },
|
|
123
|
+
{ "name": "prefix", "type": "text" },
|
|
124
|
+
{ "name": "several", "type": "yesno" },
|
|
125
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
126
|
+
{ "name": "workspaces", "type": "list" },
|
|
127
|
+
{ "name": "unreached", "type": "ids" },
|
|
128
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
129
|
+
],
|
|
130
|
+
"outSchema": [
|
|
131
|
+
{ "name": "query", "type": "text" },
|
|
132
|
+
{ "name": "prefix", "type": "text" },
|
|
133
|
+
{ "name": "several", "type": "yesno" },
|
|
134
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
135
|
+
{ "name": "workspaces", "type": "list" },
|
|
136
|
+
{ "name": "unreached", "type": "ids" },
|
|
137
|
+
{ "name": "byMeaning", "type": "object" }
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "visible",
|
|
142
|
+
"label": "Only what you may see",
|
|
143
|
+
"goal": "Filters: both lists side by side per workspace, every note checked once more against the person's access there. A workspace whose word search failed is left out and named unreached.",
|
|
144
|
+
"on": true,
|
|
145
|
+
"model": "code",
|
|
146
|
+
"icon": "shield",
|
|
147
|
+
"file": "apps/mcp/src/search/config/nodes.js visibleStep",
|
|
148
|
+
"x": 720,
|
|
149
|
+
"y": 0,
|
|
150
|
+
"settings": {},
|
|
151
|
+
"inSchema": [
|
|
152
|
+
{ "name": "query", "type": "text" },
|
|
153
|
+
{ "name": "prefix", "type": "text" },
|
|
154
|
+
{ "name": "several", "type": "yesno" },
|
|
155
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
156
|
+
{ "name": "workspaces", "type": "list" },
|
|
157
|
+
{ "name": "unreached", "type": "ids" },
|
|
158
|
+
{ "name": "to", "type": "text", "optional": true },
|
|
159
|
+
{ "name": "byWords", "type": "object", "optional": true },
|
|
160
|
+
{ "name": "byMeaning", "type": "object", "optional": true }
|
|
161
|
+
],
|
|
162
|
+
"outSchema": [
|
|
163
|
+
{ "name": "query", "type": "text" },
|
|
164
|
+
{ "name": "prefix", "type": "text" },
|
|
165
|
+
{ "name": "several", "type": "yesno" },
|
|
166
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
167
|
+
{ "name": "workspaces", "type": "list" },
|
|
168
|
+
{ "name": "unreached", "type": "ids" }
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "probes",
|
|
173
|
+
"label": "Drop search probes",
|
|
174
|
+
"goal": "Filters: a benchmark's search-probe note is never an answer.",
|
|
175
|
+
"on": true,
|
|
176
|
+
"model": "code",
|
|
177
|
+
"icon": "trash",
|
|
178
|
+
"file": "apps/mcp/src/search/stages.js dropProbes",
|
|
179
|
+
"x": 960,
|
|
180
|
+
"y": 0,
|
|
181
|
+
"settings": {},
|
|
182
|
+
"inSchema": [
|
|
183
|
+
{ "name": "query", "type": "text" },
|
|
184
|
+
{ "name": "prefix", "type": "text" },
|
|
185
|
+
{ "name": "several", "type": "yesno" },
|
|
186
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
187
|
+
{ "name": "workspaces", "type": "list" },
|
|
188
|
+
{ "name": "unreached", "type": "ids" },
|
|
189
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
190
|
+
],
|
|
191
|
+
"outSchema": [
|
|
192
|
+
{ "name": "query", "type": "text" },
|
|
193
|
+
{ "name": "prefix", "type": "text" },
|
|
194
|
+
{ "name": "several", "type": "yesno" },
|
|
195
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
196
|
+
{ "name": "workspaces", "type": "list" },
|
|
197
|
+
{ "name": "unreached", "type": "ids" }
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"id": "floor",
|
|
202
|
+
"label": "Close meaning only",
|
|
203
|
+
"goal": "Filters: once the words found a note with every word, a note only meaning found must be at least meaningFloor close.",
|
|
204
|
+
"on": true,
|
|
205
|
+
"model": "code",
|
|
206
|
+
"icon": "trash",
|
|
207
|
+
"file": "apps/mcp/src/search/stages.js closeMeaning",
|
|
208
|
+
"x": 1200,
|
|
209
|
+
"y": 0,
|
|
210
|
+
"settings": { "meaningFloor": 0.5 },
|
|
211
|
+
"inSchema": [
|
|
212
|
+
{ "name": "query", "type": "text" },
|
|
213
|
+
{ "name": "prefix", "type": "text" },
|
|
214
|
+
{ "name": "several", "type": "yesno" },
|
|
215
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
216
|
+
{ "name": "workspaces", "type": "list" },
|
|
217
|
+
{ "name": "unreached", "type": "ids" },
|
|
218
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
219
|
+
],
|
|
220
|
+
"outSchema": [
|
|
221
|
+
{ "name": "query", "type": "text" },
|
|
222
|
+
{ "name": "prefix", "type": "text" },
|
|
223
|
+
{ "name": "several", "type": "yesno" },
|
|
224
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
225
|
+
{ "name": "workspaces", "type": "list" },
|
|
226
|
+
{ "name": "unreached", "type": "ids" }
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"id": "merge",
|
|
231
|
+
"label": "Merge",
|
|
232
|
+
"goal": "Merges: one row per note from the word list and the meaning list, each adding 1 / (rrfK + rank + 1), so a note both find rises. A hit whose words sit only in a link counts as loose, and loose hits go last. No merge when meaning found nothing: the word hits stand as they are.",
|
|
233
|
+
"on": true,
|
|
234
|
+
"model": "code",
|
|
235
|
+
"icon": "wire",
|
|
236
|
+
"file": "apps/mcp/src/search/stages.js mergeLists",
|
|
237
|
+
"x": 1440,
|
|
238
|
+
"y": 0,
|
|
239
|
+
"settings": { "rrfK": 60 },
|
|
240
|
+
"inSchema": [
|
|
241
|
+
{ "name": "query", "type": "text" },
|
|
242
|
+
{ "name": "prefix", "type": "text" },
|
|
243
|
+
{ "name": "several", "type": "yesno" },
|
|
244
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
245
|
+
{ "name": "workspaces", "type": "list" },
|
|
246
|
+
{ "name": "unreached", "type": "ids" },
|
|
247
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
248
|
+
],
|
|
249
|
+
"outSchema": [
|
|
250
|
+
{ "name": "query", "type": "text" },
|
|
251
|
+
{ "name": "prefix", "type": "text" },
|
|
252
|
+
{ "name": "several", "type": "yesno" },
|
|
253
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
254
|
+
{ "name": "workspaces", "type": "list" },
|
|
255
|
+
{ "name": "unreached", "type": "ids" }
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"id": "title",
|
|
260
|
+
"label": "Title and phrase",
|
|
261
|
+
"goal": "Ranks: a word hit gains titleWeight for each share of the query's terms its title or file name holds, and phraseBonus when the whole query is a phrase in its title or file name (snippetPhraseBonus when only in its text). Only when one workspace is searched; across several, Merge across workspaces does it.",
|
|
262
|
+
"on": true,
|
|
263
|
+
"model": "code",
|
|
264
|
+
"icon": "queue",
|
|
265
|
+
"file": "apps/mcp/src/search/stages.js addEvidence · evidence.js",
|
|
266
|
+
"x": 1680,
|
|
267
|
+
"y": 0,
|
|
268
|
+
"settings": { "phraseBonus": 0.00819672131147541, "snippetPhraseBonus": 0, "titleWeight": 0.003278688524590164 },
|
|
269
|
+
"inSchema": [
|
|
270
|
+
{ "name": "query", "type": "text" },
|
|
271
|
+
{ "name": "prefix", "type": "text" },
|
|
272
|
+
{ "name": "several", "type": "yesno" },
|
|
273
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
274
|
+
{ "name": "workspaces", "type": "list" },
|
|
275
|
+
{ "name": "unreached", "type": "ids" },
|
|
276
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
277
|
+
],
|
|
278
|
+
"outSchema": [
|
|
279
|
+
{ "name": "query", "type": "text" },
|
|
280
|
+
{ "name": "prefix", "type": "text" },
|
|
281
|
+
{ "name": "several", "type": "yesno" },
|
|
282
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
283
|
+
{ "name": "workspaces", "type": "list" },
|
|
284
|
+
{ "name": "unreached", "type": "ids" }
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"id": "prior",
|
|
289
|
+
"label": "Lower logs and archive",
|
|
290
|
+
"goal": "Ranks: an archived note or a log (Inbox captures, Tex's own logs, review logs, retired setups) scores logPrior of a live note with the same evidence. A note still unfiled in the Inbox scores inboxPrior.",
|
|
291
|
+
"on": true,
|
|
292
|
+
"model": "code",
|
|
293
|
+
"icon": "queue",
|
|
294
|
+
"file": "apps/mcp/src/search/stages.js lowerByPath · priors.js",
|
|
295
|
+
"x": 1920,
|
|
296
|
+
"y": 0,
|
|
297
|
+
"settings": { "inboxPrior": 0.5, "logPrior": 0.5 },
|
|
298
|
+
"inSchema": [
|
|
299
|
+
{ "name": "query", "type": "text" },
|
|
300
|
+
{ "name": "prefix", "type": "text" },
|
|
301
|
+
{ "name": "several", "type": "yesno" },
|
|
302
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
303
|
+
{ "name": "workspaces", "type": "list" },
|
|
304
|
+
{ "name": "unreached", "type": "ids" },
|
|
305
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
306
|
+
],
|
|
307
|
+
"outSchema": [
|
|
308
|
+
{ "name": "query", "type": "text" },
|
|
309
|
+
{ "name": "prefix", "type": "text" },
|
|
310
|
+
{ "name": "several", "type": "yesno" },
|
|
311
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
312
|
+
{ "name": "workspaces", "type": "list" },
|
|
313
|
+
{ "name": "unreached", "type": "ids" }
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"id": "opens",
|
|
318
|
+
"label": "Opened before",
|
|
319
|
+
"goal": "Ranks: a note people open rises, counted in the note's own workspace: the searcher's own opens in the app (openMine), everyone else's (openPeople) and AI clients' reads (openAi), each apart and each as weight x log2(1 + opens), and only for a note holding every word, so opens order the notes a query is about and never lift one it merely brushes. Being listed by a search never counts, only an open.",
|
|
320
|
+
"on": true,
|
|
321
|
+
"model": "code",
|
|
322
|
+
"icon": "star",
|
|
323
|
+
"file": "apps/mcp/src/search/stages.js byOpens · opens.js · workspaceStore/opens.js",
|
|
324
|
+
"x": 2160,
|
|
325
|
+
"y": 0,
|
|
326
|
+
"settings": { "openMine": 0.3, "openPeople": 0.1, "openAi": 0.02 },
|
|
327
|
+
"inSchema": [
|
|
328
|
+
{ "name": "query", "type": "text" },
|
|
329
|
+
{ "name": "prefix", "type": "text" },
|
|
330
|
+
{ "name": "several", "type": "yesno" },
|
|
331
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
332
|
+
{ "name": "workspaces", "type": "list" },
|
|
333
|
+
{ "name": "unreached", "type": "ids" },
|
|
334
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
335
|
+
],
|
|
336
|
+
"outSchema": [
|
|
337
|
+
{ "name": "query", "type": "text" },
|
|
338
|
+
{ "name": "prefix", "type": "text" },
|
|
339
|
+
{ "name": "several", "type": "yesno" },
|
|
340
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
341
|
+
{ "name": "workspaces", "type": "list" },
|
|
342
|
+
{ "name": "unreached", "type": "ids" }
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"id": "budget",
|
|
347
|
+
"label": "Meaning-only budget",
|
|
348
|
+
"goal": "Filters: every word hit stays; of the notes only meaning found, the best extraNotes (looseReads when no note held every word).",
|
|
349
|
+
"on": true,
|
|
350
|
+
"model": "code",
|
|
351
|
+
"icon": "trash",
|
|
352
|
+
"file": "apps/mcp/src/search/stages.js meaningBudget",
|
|
353
|
+
"x": 2400,
|
|
354
|
+
"y": 0,
|
|
355
|
+
"settings": { "extraNotes": 3, "looseReads": 6 },
|
|
356
|
+
"inSchema": [
|
|
357
|
+
{ "name": "query", "type": "text" },
|
|
358
|
+
{ "name": "prefix", "type": "text" },
|
|
359
|
+
{ "name": "several", "type": "yesno" },
|
|
360
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
361
|
+
{ "name": "workspaces", "type": "list" },
|
|
362
|
+
{ "name": "unreached", "type": "ids" },
|
|
363
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
364
|
+
],
|
|
365
|
+
"outSchema": [
|
|
366
|
+
{ "name": "query", "type": "text" },
|
|
367
|
+
{ "name": "prefix", "type": "text" },
|
|
368
|
+
{ "name": "several", "type": "yesno" },
|
|
369
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
370
|
+
{ "name": "workspaces", "type": "list" },
|
|
371
|
+
{ "name": "unreached", "type": "ids" }
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"id": "snippets",
|
|
376
|
+
"label": "Read snippets",
|
|
377
|
+
"goal": "Each kept note only meaning found is read for its title and the passage that matched, snippetChars long, all at once.",
|
|
378
|
+
"on": true,
|
|
379
|
+
"model": "code",
|
|
380
|
+
"icon": "card",
|
|
381
|
+
"file": "apps/mcp/src/search/meaning/serve.js readMeaningOnly",
|
|
382
|
+
"x": 2640,
|
|
383
|
+
"y": 0,
|
|
384
|
+
"settings": { "snippetChars": 200 },
|
|
385
|
+
"inSchema": [
|
|
386
|
+
{ "name": "query", "type": "text" },
|
|
387
|
+
{ "name": "prefix", "type": "text" },
|
|
388
|
+
{ "name": "several", "type": "yesno" },
|
|
389
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
390
|
+
{ "name": "workspaces", "type": "list" },
|
|
391
|
+
{ "name": "unreached", "type": "ids" },
|
|
392
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
393
|
+
],
|
|
394
|
+
"outSchema": [
|
|
395
|
+
{ "name": "query", "type": "text" },
|
|
396
|
+
{ "name": "prefix", "type": "text" },
|
|
397
|
+
{ "name": "several", "type": "yesno" },
|
|
398
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
399
|
+
{ "name": "workspaces", "type": "list" },
|
|
400
|
+
{ "name": "unreached", "type": "ids" }
|
|
401
|
+
]
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"id": "rerank",
|
|
405
|
+
"label": "Rerank",
|
|
406
|
+
"goal": "Ranks: each workspace’s first rows (rerankTop, rerankChars of each) read beside the query by a cross-encoder, every workspace in one call; a row Rerank word hits already scored is not read again, and with readLate 0 the rest keep their places unread (no call here). Each adds a part for its place (rerankWeight, as one more reciprocal-rank list, under the path prior) and keeps the model’s score, which Rank across workspaces ranks together. Never adds or drops a note. Off on main until a Lab draft shows it helps.",
|
|
407
|
+
"on": true,
|
|
408
|
+
"model": "code",
|
|
409
|
+
"icon": "star",
|
|
410
|
+
"file": "apps/mcp/src/search/rerank.js",
|
|
411
|
+
"x": 2880,
|
|
412
|
+
"y": 0,
|
|
413
|
+
"settings": { "readLate": 0, "rerankChars": 400, "rerankTop": 8, "rerankWeight": 1 },
|
|
414
|
+
"inSchema": [
|
|
415
|
+
{ "name": "query", "type": "text" },
|
|
416
|
+
{ "name": "prefix", "type": "text" },
|
|
417
|
+
{ "name": "several", "type": "yesno" },
|
|
418
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
419
|
+
{ "name": "workspaces", "type": "list" },
|
|
420
|
+
{ "name": "unreached", "type": "ids" }
|
|
421
|
+
],
|
|
422
|
+
"outSchema": [
|
|
423
|
+
{ "name": "query", "type": "text" },
|
|
424
|
+
{ "name": "prefix", "type": "text" },
|
|
425
|
+
{ "name": "several", "type": "yesno" },
|
|
426
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
427
|
+
{ "name": "workspaces", "type": "list" },
|
|
428
|
+
{ "name": "unreached", "type": "ids" }
|
|
429
|
+
]
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"id": "code",
|
|
433
|
+
"label": "Drop code passages",
|
|
434
|
+
"goal": "Filters: a code passage found only by meaning is not offered for a question in prose (one workspace; across several, Merge across workspaces does it), and a note that could not be read is dropped.",
|
|
435
|
+
"on": true,
|
|
436
|
+
"model": "code",
|
|
437
|
+
"icon": "trash",
|
|
438
|
+
"file": "apps/mcp/src/search/stages.js answerHits",
|
|
439
|
+
"x": 3120,
|
|
440
|
+
"y": 0,
|
|
441
|
+
"settings": {},
|
|
442
|
+
"inSchema": [
|
|
443
|
+
{ "name": "query", "type": "text" },
|
|
444
|
+
{ "name": "prefix", "type": "text" },
|
|
445
|
+
{ "name": "several", "type": "yesno" },
|
|
446
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
447
|
+
{ "name": "workspaces", "type": "list" },
|
|
448
|
+
{ "name": "unreached", "type": "ids" },
|
|
449
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
450
|
+
],
|
|
451
|
+
"outSchema": [
|
|
452
|
+
{ "name": "query", "type": "text" },
|
|
453
|
+
{ "name": "prefix", "type": "text" },
|
|
454
|
+
{ "name": "several", "type": "yesno" },
|
|
455
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
456
|
+
{ "name": "workspaces", "type": "list" },
|
|
457
|
+
{ "name": "unreached", "type": "ids" },
|
|
458
|
+
{ "name": "to", "type": "choice", "options": "one, several" }
|
|
459
|
+
]
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"id": "fuse",
|
|
463
|
+
"label": "Merge across workspaces",
|
|
464
|
+
"goal": "Merges and ranks when several workspaces answered: one list ranked by evidence rather than by workspace: word rank (a loose hit counted lower), rank among every meaning match, title and phrase evidence, the path prior and a named workspace's boost; the meaning-only budget once for the whole answer; at most hits shown.",
|
|
465
|
+
"on": true,
|
|
466
|
+
"model": "code",
|
|
467
|
+
"icon": "wire",
|
|
468
|
+
"file": "apps/mcp/src/search/config/nodes.js · tools/search.js",
|
|
469
|
+
"x": 3360,
|
|
470
|
+
"y": 110,
|
|
471
|
+
"settings": {
|
|
472
|
+
"boostFactor": 1.2,
|
|
473
|
+
"hits": 12,
|
|
474
|
+
"inboxPrior": 0.5,
|
|
475
|
+
"logPrior": 0.5,
|
|
476
|
+
"loosePenalty": 10,
|
|
477
|
+
"looseReads": 6,
|
|
478
|
+
"meaningFloor": 0.5,
|
|
479
|
+
"phraseBonus": 0.00819672131147541,
|
|
480
|
+
"rrfK": 60,
|
|
481
|
+
"snippetPhraseBonus": 0,
|
|
482
|
+
"titleWeight": 0.003278688524590164,
|
|
483
|
+
"rerankWeight": 1,
|
|
484
|
+
"sharedWords": 2,
|
|
485
|
+
"workspaceWeight": 0,
|
|
486
|
+
"openMine": 0.3,
|
|
487
|
+
"openPeople": 0.1,
|
|
488
|
+
"openAi": 0.02
|
|
489
|
+
},
|
|
490
|
+
"inSchema": [
|
|
491
|
+
{ "name": "query", "type": "text" },
|
|
492
|
+
{ "name": "prefix", "type": "text" },
|
|
493
|
+
{ "name": "several", "type": "yesno" },
|
|
494
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
495
|
+
{ "name": "workspaces", "type": "list" },
|
|
496
|
+
{ "name": "unreached", "type": "ids" },
|
|
497
|
+
{ "name": "to", "type": "text", "optional": true }
|
|
498
|
+
],
|
|
499
|
+
"outSchema": [
|
|
500
|
+
{ "name": "answer", "type": "object" }
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"id": "answer",
|
|
505
|
+
"label": "Answer",
|
|
506
|
+
"goal": "The fused list across workspaces, or the one workspace's, with who answered and who could not be reached.",
|
|
507
|
+
"on": true,
|
|
508
|
+
"model": "code",
|
|
509
|
+
"icon": "send",
|
|
510
|
+
"file": "apps/mcp/src/search/config/nodes.js answerStep",
|
|
511
|
+
"x": 3600,
|
|
512
|
+
"y": 0,
|
|
513
|
+
"settings": {},
|
|
514
|
+
"inSchema": [
|
|
515
|
+
{ "name": "query", "type": "text", "optional": true },
|
|
516
|
+
{ "name": "prefix", "type": "text", "optional": true },
|
|
517
|
+
{ "name": "several", "type": "yesno", "optional": true },
|
|
518
|
+
{ "name": "boost", "type": "text", "optional": true },
|
|
519
|
+
{ "name": "workspaces", "type": "list", "optional": true },
|
|
520
|
+
{ "name": "unreached", "type": "ids", "optional": true },
|
|
521
|
+
{ "name": "to", "type": "text", "optional": true },
|
|
522
|
+
{ "name": "answer", "type": "object", "optional": true }
|
|
523
|
+
],
|
|
524
|
+
"outSchema": [
|
|
525
|
+
{ "name": "answer", "type": "object" }
|
|
526
|
+
]
|
|
527
|
+
}
|
|
528
|
+
],
|
|
529
|
+
"edges": [
|
|
530
|
+
{
|
|
531
|
+
"from": "search",
|
|
532
|
+
"to": "open",
|
|
533
|
+
"mode": "wait",
|
|
534
|
+
"when": ["open"]
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"from": "open",
|
|
538
|
+
"to": "words",
|
|
539
|
+
"mode": "wait",
|
|
540
|
+
"when": ["*"]
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
"from": "open",
|
|
544
|
+
"to": "meaning",
|
|
545
|
+
"mode": "wait",
|
|
546
|
+
"when": ["*"]
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"from": "words",
|
|
550
|
+
"to": "rerankWords",
|
|
551
|
+
"mode": "uses",
|
|
552
|
+
"when": ["*"]
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"from": "words",
|
|
556
|
+
"to": "visible",
|
|
557
|
+
"mode": "wait",
|
|
558
|
+
"when": ["*"]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"from": "meaning",
|
|
562
|
+
"to": "visible",
|
|
563
|
+
"mode": "wait",
|
|
564
|
+
"when": ["*"]
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"from": "visible",
|
|
568
|
+
"to": "probes",
|
|
569
|
+
"mode": "wait",
|
|
570
|
+
"when": ["*"]
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"from": "probes",
|
|
574
|
+
"to": "floor",
|
|
575
|
+
"mode": "wait",
|
|
576
|
+
"when": ["*"]
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
"from": "floor",
|
|
580
|
+
"to": "merge",
|
|
581
|
+
"mode": "wait",
|
|
582
|
+
"when": ["*"]
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"from": "merge",
|
|
586
|
+
"to": "title",
|
|
587
|
+
"mode": "wait",
|
|
588
|
+
"when": ["*"]
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"from": "title",
|
|
592
|
+
"to": "prior",
|
|
593
|
+
"mode": "wait",
|
|
594
|
+
"when": ["*"]
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"from": "prior",
|
|
598
|
+
"to": "opens",
|
|
599
|
+
"mode": "wait",
|
|
600
|
+
"when": ["*"]
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"from": "opens",
|
|
604
|
+
"to": "budget",
|
|
605
|
+
"mode": "wait",
|
|
606
|
+
"when": ["*"]
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"from": "budget",
|
|
610
|
+
"to": "snippets",
|
|
611
|
+
"mode": "wait",
|
|
612
|
+
"when": ["*"]
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"from": "snippets",
|
|
616
|
+
"to": "rerank",
|
|
617
|
+
"mode": "wait",
|
|
618
|
+
"when": ["*"]
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"from": "rerank",
|
|
622
|
+
"to": "code",
|
|
623
|
+
"mode": "wait",
|
|
624
|
+
"when": ["*"]
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
"from": "code",
|
|
628
|
+
"to": "fuse",
|
|
629
|
+
"mode": "wait",
|
|
630
|
+
"when": ["several"]
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"from": "code",
|
|
634
|
+
"to": "answer",
|
|
635
|
+
"mode": "wait",
|
|
636
|
+
"when": ["one"]
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"from": "fuse",
|
|
640
|
+
"to": "answer",
|
|
641
|
+
"mode": "wait",
|
|
642
|
+
"when": ["*"]
|
|
643
|
+
}
|
|
644
|
+
]
|
|
645
|
+
}
|