@snagset/mcp 0.1.15 → 0.1.18
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/dist/bin.js +4 -4
- package/dist/client.js +3 -3
- package/dist/client.js.map +1 -1
- package/dist/server.js +3 -3
- package/dist/server.js.map +1 -1
- package/dist/source.js +13 -13
- package/dist/source.js.map +1 -1
- package/dist/vendor/adapters/outbound/fence.js +2 -2
- package/dist/vendor/adapters/outbound/sanitise.js +14 -14
- package/dist/vendor/types/brief.js +2 -2
- package/dist/vendor/types/index.js +1 -1
- package/dist/vendor/types/names.js +20 -18
- package/dist/view.js +15 -15
- package/dist/view.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import { createServer } from "./server.js";
|
|
4
4
|
/**
|
|
5
|
-
* The stdio entry point —
|
|
5
|
+
* The stdio entry point — the supported transport.
|
|
6
6
|
*
|
|
7
7
|
* | Transport | Where it runs | Default |
|
|
8
8
|
* |---|---|---|
|
|
9
9
|
* | **stdio** | the developer's own machine, spawned by their MCP client | **the supported path** |
|
|
10
|
-
* | streamable HTTP | our server, at `POST /mcp`
|
|
10
|
+
* | streamable HTTP | our server, at `POST /mcp` | **off** until the switch on Studio › Integrations › MCP, or `SNAGSET_MCP_HTTP_ENABLED` |
|
|
11
11
|
*
|
|
12
|
-
* This file is the first.
|
|
12
|
+
* This file is the first. Stdio is the default and the design is the reason, not
|
|
13
13
|
* a scheduling accident: source mapping needs the checkout, the checkout is
|
|
14
14
|
* on the developer's machine, and a remote server cannot offer `source:map`
|
|
15
15
|
* at all — the instance serves the second without it.
|
|
@@ -24,7 +24,7 @@ import { createServer } from "./server.js";
|
|
|
24
24
|
*/
|
|
25
25
|
const env = process.env;
|
|
26
26
|
/**
|
|
27
|
-
* Config comes from the MCP CLIENT's process env
|
|
27
|
+
* Config comes from the MCP CLIENT's process env, not ours — it is
|
|
28
28
|
* written into the client's config file:
|
|
29
29
|
*
|
|
30
30
|
* ```jsonc
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The HTTP client —
|
|
2
|
+
* The HTTP client — the load-bearing sentence made literal.
|
|
3
3
|
*
|
|
4
4
|
* > *"It is not a second API. Every read the MCP server performs goes through
|
|
5
5
|
* > the same `/api/v1` routes with the same authorisation as any other caller;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* That last clause is a claim about THIS FILE, and it is only true while this
|
|
11
11
|
* is the only way out of the package. There is no `postgres` dependency here
|
|
12
12
|
* and there must never be one: the day this package can reach the database, its
|
|
13
|
-
* scopes become advisory and every mitigation
|
|
13
|
+
* scopes become advisory and every mitigation .6 rests on the agent
|
|
14
14
|
* behaving.
|
|
15
15
|
*
|
|
16
16
|
* The whole surface is one method. `fetch` is the platform's, so the package
|
|
@@ -65,7 +65,7 @@ export class Client {
|
|
|
65
65
|
const parsed = safeJson(text);
|
|
66
66
|
const code = parsed?.error?.code;
|
|
67
67
|
const message = parsed?.error?.message ?? text.slice(0, 400);
|
|
68
|
-
//
|
|
68
|
+
// On 429 the tool layer must tell the agent to STOP and ask its
|
|
69
69
|
// user — *"never a silent retry, never a sleep-and-retry loop. An agent
|
|
70
70
|
// that has been talked into mass-resolving threads must hit a wall it has
|
|
71
71
|
// to report, because the wall is the only part of the mitigation a human
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAiBH,MAAM,OAAO,MAAM;IACR,KAAK,CAAS;IACd,MAAM,CAAS;IACf,MAAM,CAA0B;IAEzC,YAAY,GAAiB;QAC3B,wEAAwE;QACxE,yEAAyE;QACzE,yEAAyE;QACzE,eAAe;QACf,IAA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AK,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;YAC7C,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,qEAAqE;gBACrE,gEAAgE;gBAChE,sEAAsE;gBACtE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,aAAa,GAAG,CAAC,MAAM,uFAAuF;aACrI,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAU,EAAE,CAAC;IACzC,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -60,7 +60,7 @@ export function createServer(opts) {
|
|
|
60
60
|
return value;
|
|
61
61
|
let threads = value.data ?? [];
|
|
62
62
|
// Filtered HERE rather than on the wire because the API has no
|
|
63
|
-
// anchorState parameter —
|
|
63
|
+
// anchorState parameter — the design requires the tool to accept one, and
|
|
64
64
|
// "orphaned" is the whole point of it: an agent told to fix the orphaned
|
|
65
65
|
// pins needs to find them.
|
|
66
66
|
if (args.anchorState)
|
|
@@ -96,7 +96,7 @@ export function createServer(opts) {
|
|
|
96
96
|
return found;
|
|
97
97
|
if (args.format === "json")
|
|
98
98
|
return ok(envelope({ thread: detail(found) }));
|
|
99
|
-
//
|
|
99
|
+
// A fenced JSON envelope is the wrong first answer for a model.
|
|
100
100
|
return ok(brief(found, { name: project ?? "the site", dashboardOrigin: client.host }));
|
|
101
101
|
});
|
|
102
102
|
// ── context:read ────────────────────────────────────────────────────────
|
|
@@ -221,7 +221,7 @@ export function createServer(opts) {
|
|
|
221
221
|
* Resolve `SN-14` to a thread — by listing and matching, because the API is
|
|
222
222
|
* addressed by row id and the human-facing key is what an agent has.
|
|
223
223
|
*
|
|
224
|
-
*
|
|
224
|
+
* The design is explicit that a key or a uid is what appears in an address, *"never
|
|
225
225
|
* an internal uuid"*. This is the seam where that holds: the uuid exists inside
|
|
226
226
|
* this function and never reaches the model.
|
|
227
227
|
*/
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACL,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,WAAW,EACM,KAAK,EAAE,MAAM,WAAW,CAAC;AAwC5C,MAAM,EAAE,GAAG,CAAC,IAAY,EAAc,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AACjF,MAAM,GAAG,GAAG,CAAC,IAAY,EAAc,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhH,oFAAoF;AACpF,SAAS,MAAM,CAAI,CAAY;IAC7B,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC;AACD,MAAM,YAAY,GAAG,CAAC,CAAU,EAAmB,EAAE,CACnD,OAAO,CAAC,KAAK,QAA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,CAAC,CAAC;IAChF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,GAAG,CACR,aAAa,GAAG,OAAO,OAAO,8DAA8D;YAC1F,2DAA2D,CAC9D,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/source.js
CHANGED
|
@@ -3,26 +3,26 @@ import { existsSync, readdirSync, readFileSync, statSync, lstatSync } from "node
|
|
|
3
3
|
import { join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
/**
|
|
6
|
-
* Anchor → source mapping
|
|
6
|
+
* Anchor → source mapping, *"the reason this server is worth
|
|
7
7
|
* building"*, and the one place this package touches a filesystem.
|
|
8
8
|
*
|
|
9
9
|
* Three strategies descending in confidence. R1 (build plugin,
|
|
10
10
|
* `data-snag-src`) and R2 (React DevTools fibre) both read the LIVE PAGE, which
|
|
11
|
-
* this process does not have — they belong to the widget, and
|
|
11
|
+
* this process does not have — they belong to the widget, and does that
|
|
12
12
|
* reading. What is implementable here is **R3, the local heuristic search**,
|
|
13
13
|
* plus passing through an R1 attribute when the anchor already carries one.
|
|
14
14
|
*
|
|
15
15
|
* ── WHY STDIO IS THE SUPPORTED TRANSPORT ──
|
|
16
16
|
*
|
|
17
|
-
* This function is the answer.
|
|
17
|
+
* This function is the answer. The whole value is turning an anchor into
|
|
18
18
|
* `src/components/ProductCard.tsx:42`, and the repository is on the developer's
|
|
19
19
|
* machine, not on ours. That is also why `source:map` cannot exist on the HTTP
|
|
20
|
-
* transport at all —
|
|
20
|
+
* transport at all — the design requires that to be *"a configuration error surfaced
|
|
21
21
|
* at token creation, not a silent empty result"*.
|
|
22
22
|
*
|
|
23
23
|
* ── THE CONSTRAINTS ARE NORMATIVE ──
|
|
24
24
|
*
|
|
25
|
-
*
|
|
25
|
+
* The design states them as rules rather than suggestions, because this is the only
|
|
26
26
|
* code in the package that reads files an injected instruction might want:
|
|
27
27
|
*
|
|
28
28
|
* · **Path-confined to the resolved repo root.** Every candidate is resolved
|
|
@@ -34,17 +34,17 @@ import { promisify } from "node:util";
|
|
|
34
34
|
* surrounding file contents.
|
|
35
35
|
*
|
|
36
36
|
* That last clause is the one worth restating: this is a search tool, not a
|
|
37
|
-
* file-read tool.
|
|
37
|
+
* file-read tool. The design says there is no file-write tool and no
|
|
38
38
|
* arbitrary-fetch tool; returning the six lines around a match would quietly
|
|
39
39
|
* make this the file-READ tool nobody agreed to.
|
|
40
40
|
*/
|
|
41
41
|
const exec = promisify(execFile);
|
|
42
|
-
/**
|
|
42
|
+
/** At most 20 *(calibration)*. */
|
|
43
43
|
export const MAX_CANDIDATES = 20;
|
|
44
44
|
const SKIP = new Set([".git", "node_modules", "dist", "build", ".next", ".turbo", "coverage", "out"]);
|
|
45
45
|
const EXT = new Set([".ts", ".tsx", ".js", ".jsx", ".vue", ".svelte", ".astro", ".html", ".php", ".erb"]);
|
|
46
46
|
/**
|
|
47
|
-
* Confidence per strategy, descending —
|
|
47
|
+
* Confidence per strategy, descending — the *"ranked by strategy strength"*.
|
|
48
48
|
*
|
|
49
49
|
* All at or below 0.4, which is R3's ceiling. A `data-testid` is nearly unique
|
|
50
50
|
* in a codebase; an accessible name often appears in a translation file and a
|
|
@@ -63,7 +63,7 @@ export async function mapToSource(opts) {
|
|
|
63
63
|
throw new Error(`${opts.repoRoot} is not a directory. Pass repoRoot, or run the MCP server from your checkout.`);
|
|
64
64
|
}
|
|
65
65
|
// R1 passthrough: `data-snag-src="src/components/ProductCard.tsx:42:7"`, if
|
|
66
|
-
// the host runs one of the build plugins and
|
|
66
|
+
// the host runs one of the build plugins and already resolved it.
|
|
67
67
|
// Confidence 1.0, and it short-circuits — there is nothing to search for.
|
|
68
68
|
const r1 = fromSourceRef(opts.anchor.sourceRef, root);
|
|
69
69
|
if (r1)
|
|
@@ -91,7 +91,7 @@ export async function mapToSource(opts) {
|
|
|
91
91
|
* `src/components/ProductCard.tsx:42:7` → a candidate, IF it stays inside the
|
|
92
92
|
* root.
|
|
93
93
|
*
|
|
94
|
-
* The value is authored by the host application
|
|
94
|
+
* The value is authored by the host application — it arrives in an
|
|
95
95
|
* attribute on somebody else's page, so it is attacker-reachable and gets the
|
|
96
96
|
* same confinement check as everything else here. `../../../etc/passwd:1` is an
|
|
97
97
|
* entirely plausible thing to find in this field.
|
|
@@ -128,7 +128,7 @@ function confine(root, candidate) {
|
|
|
128
128
|
const full = resolve(root, candidate);
|
|
129
129
|
if (full !== root && !full.startsWith(root + sep))
|
|
130
130
|
return null;
|
|
131
|
-
// Symlinks are not followed
|
|
131
|
+
// Symlinks are not followed. A link inside the checkout pointing at
|
|
132
132
|
// `~/.ssh` resolves to a path that passes every check above.
|
|
133
133
|
try {
|
|
134
134
|
if (lstatSync(full).isSymbolicLink())
|
|
@@ -148,7 +148,7 @@ function lineAt(file, line) {
|
|
|
148
148
|
return "";
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
/** ripgrep where present, a bounded walker otherwise
|
|
151
|
+
/** ripgrep where present, a bounded walker otherwise. */
|
|
152
152
|
async function search(root, needle, tryRipgrep) {
|
|
153
153
|
if (tryRipgrep) {
|
|
154
154
|
const viaRg = await ripgrep(root, needle);
|
|
@@ -167,7 +167,7 @@ async function ripgrep(root, needle) {
|
|
|
167
167
|
"--no-heading",
|
|
168
168
|
"--max-count",
|
|
169
169
|
String(MAX_CANDIDATES),
|
|
170
|
-
//
|
|
170
|
+
// Skips .gitignore'd paths. Ripgrep does this by default, which
|
|
171
171
|
// is half the reason it is preferred over the walker below.
|
|
172
172
|
"--glob",
|
|
173
173
|
"!{.git,node_modules,dist,build}/**",
|
package/dist/source.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ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H,CAAC;QACH,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,IAAI,cAAc;YAAE,MAAM;IAC3C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+EAA+E;AAC/E,SAAS,UAAU,CAAC,IAAY,EAAE,IAAW;IAC3C,MAAM,GAAG,GAAU,EAAE,CAAC;IACtB,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -15,7 +15,7 @@ export function fence(kind, value) {
|
|
|
15
15
|
/**
|
|
16
16
|
* Sanitise then fence, which is what every call site actually wants.
|
|
17
17
|
*
|
|
18
|
-
* `author` goes through here too. The review found it emitted bare while
|
|
18
|
+
* `author` goes through here too. The review found it emitted bare while
|
|
19
19
|
* already listed `Reviewer.name` among the untrusted strings reaching the model
|
|
20
20
|
* — the kind of contradiction that survives because the two facts sat four
|
|
21
21
|
* pages apart.
|
|
@@ -30,7 +30,7 @@ export function fenced(kind, input, max) {
|
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* The preamble every tool result opens with
|
|
33
|
+
* The preamble every tool result opens with, *"emitted
|
|
34
34
|
* from the constants module because its first line is name-derived"*.
|
|
35
35
|
*
|
|
36
36
|
* Three sentences and no more. A longer warning is not a stronger one: it
|
|
@@ -14,7 +14,7 @@ const NEWLINES_TABS = /[\n\t\r]+/g;
|
|
|
14
14
|
// 5) while being invisible to a reader.
|
|
15
15
|
// · The Unicode TAG block encodes arbitrary ASCII invisibly, and is the
|
|
16
16
|
// current favourite for smuggling instructions past a human reviewer into
|
|
17
|
-
// an LLM — which matters directly here, because
|
|
17
|
+
// an LLM — which matters directly here, because routes the MCP
|
|
18
18
|
// server through this same pipeline.
|
|
19
19
|
const INVISIBLE = /[\u202A-\u202E\u2066-\u2069\u200B-\u200D\u2060\uFEFF]|[\u{E0000}-\u{E007F}]/gu;
|
|
20
20
|
/** Step 5's word joiner. Invisible in every provider's rendering, and enough
|
|
@@ -23,7 +23,7 @@ const WJ = "\u2060";
|
|
|
23
23
|
/**
|
|
24
24
|
* Steps 1–3 — normalise, strip control characters, strip invisibles.
|
|
25
25
|
*
|
|
26
|
-
* Split from steps 5–6 at exactly the seam
|
|
26
|
+
* Split from steps 5–6 at exactly the seam the numbering requires,
|
|
27
27
|
* because step 4 (the personal-data guard) goes BETWEEN them and the order is
|
|
28
28
|
* load-bearing in both directions:
|
|
29
29
|
*
|
|
@@ -54,7 +54,7 @@ function normalise(input, opts) {
|
|
|
54
54
|
function neutralise(input) {
|
|
55
55
|
let s = input;
|
|
56
56
|
// Step 5. All three literals derive from the constants module, so a product
|
|
57
|
-
// rename moves them in one place
|
|
57
|
+
// rename moves them in one place. The HTML-entity form stops a
|
|
58
58
|
// provider that renders HTML from parsing ours as a real comment; the word
|
|
59
59
|
// joiner stops `origin=` matching our own loop-prevention scanner.
|
|
60
60
|
for (const literal of MARKER_LITERALS) {
|
|
@@ -63,7 +63,7 @@ function neutralise(input) {
|
|
|
63
63
|
// Step 6 — mention rewriting. `@[Name](snag:user/rev_…)` becomes `@Name`.
|
|
64
64
|
// Our reviewer ids mean nothing in GitHub, Linear or Slack; emitting them as
|
|
65
65
|
// live links either 404s or leaks an id into a third party. Mapping to a
|
|
66
|
-
// provider identity happens only through an explicit assigneeMap
|
|
66
|
+
// provider identity happens only through an explicit assigneeMap.
|
|
67
67
|
s = s.replace(MENTION, (_m, name) => `@${name}`);
|
|
68
68
|
// Step 8 is deliberately NOT here. It has to run after step 7's escaping —
|
|
69
69
|
// clamping first then escaping can push the string back over the limit, one
|
|
@@ -71,12 +71,12 @@ function neutralise(input) {
|
|
|
71
71
|
return s;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
|
-
* The mention URI form
|
|
74
|
+
* The mention URI form. Non-greedy on the display name so two
|
|
75
75
|
* mentions in one line do not collapse into one.
|
|
76
76
|
*/
|
|
77
77
|
const MENTION = new RegExp(`@\\[([^\\]]*?)\\]\\(${MENTION_SCHEME}[^)]*\\)`, "g");
|
|
78
78
|
/**
|
|
79
|
-
* The fence tag
|
|
79
|
+
* The fence tag. Exported for `fence.ts`, which builds
|
|
80
80
|
* the wrapper.
|
|
81
81
|
*
|
|
82
82
|
* Declared ABOVE `MARKER_LITERALS` rather than beside `fence.ts` for two
|
|
@@ -90,7 +90,7 @@ export const FENCE_TAG = "untrusted-content";
|
|
|
90
90
|
* The literals step 5 neutralises — the first three DERIVED from the brand,
|
|
91
91
|
* never typed.
|
|
92
92
|
*
|
|
93
|
-
*
|
|
93
|
+
* "All three literals derive from the constants module, so a product
|
|
94
94
|
* rename changes them in one place." `BRAND` is that place, and building the
|
|
95
95
|
* markers from `long`/`short` here is what keeps `test/rename.test.ts`'s claim
|
|
96
96
|
* true — flip the brand and there are no survivors, including in this file.
|
|
@@ -106,12 +106,12 @@ const MARKER_LITERALS = [
|
|
|
106
106
|
{ from: `<!-- ${BRAND.pkg}:`, to: `<!-- ${BRAND.pkg}:` },
|
|
107
107
|
{ from: `<!-- ${BRAND.short}:`, to: `<!-- ${BRAND.short}:` },
|
|
108
108
|
{ from: `${BRAND.short}:origin=`, to: `${BRAND.short}${WJ}:origin=` },
|
|
109
|
-
//
|
|
109
|
+
// The fence, closed early. This is the ONLY marker whose
|
|
110
110
|
// literal is not brand-derived — the tag name is fixed by the spec, because
|
|
111
111
|
// it is read by a model rather than by our own scanner and renaming it would
|
|
112
112
|
// silently retrain nothing. It lives in this list rather than in `fence.ts`
|
|
113
113
|
// so "close the fence early" is a fixture in the shared hostile-string
|
|
114
|
-
// corpus
|
|
114
|
+
// corpus instead of a check one consumer remembers to run.
|
|
115
115
|
{ from: `</${FENCE_TAG}>`, to: `</${FENCE_TAG}>` },
|
|
116
116
|
];
|
|
117
117
|
// ── Step 7 — target-specific escaping ─────────────────────────────────────
|
|
@@ -137,7 +137,7 @@ const ESCAPE = {
|
|
|
137
137
|
* GFM documents and it survives the round trip.
|
|
138
138
|
*/
|
|
139
139
|
github: (s) => escapeMarkdown(s),
|
|
140
|
-
//
|
|
140
|
+
// Linear resolves `ENG-123` references the way GitHub resolves
|
|
141
141
|
// `#123`, so a key-like token becomes an inert code span after the shared
|
|
142
142
|
// Markdown escape (backticks are not escaped by it, so the span survives).
|
|
143
143
|
linear: (s) => escapeMarkdown(s).replace(/(^|[^\w`])([A-Z][A-Z0-9]{1,7}-\d{1,6})\b/g, "$1`$2`"),
|
|
@@ -148,7 +148,7 @@ const ESCAPE = {
|
|
|
148
148
|
* everybody in the workspace — the highest-impact thing a comment body can
|
|
149
149
|
* do to a third party.
|
|
150
150
|
*/
|
|
151
|
-
//
|
|
151
|
+
// Defence in depth: the bare forms are inert under
|
|
152
152
|
// `parse=none`, which the client sets, but `chat.update` defaults to
|
|
153
153
|
// `parse=client`, which expands them the way the Slack app would. A
|
|
154
154
|
// zero-width space after the `@` keeps the word readable and unexpandable.
|
|
@@ -197,14 +197,14 @@ export function sanitise(input, target, opts = {}) {
|
|
|
197
197
|
/**
|
|
198
198
|
* Sanitise a Class P string (may contain personal data) — step 4 included.
|
|
199
199
|
*
|
|
200
|
-
* The redactor is INJECTED rather than imported, and that is
|
|
200
|
+
* The redactor is INJECTED rather than imported, and that is the
|
|
201
201
|
* requirement rather than a testing convenience: 04 owns the redaction
|
|
202
202
|
* vocabulary and forbids forks, and a direct import from this package would
|
|
203
203
|
* make `@snagset/adapters` depend on `widget-core` — a browser bundle — for a
|
|
204
|
-
* server-side transport. The caller passes
|
|
204
|
+
* server-side transport. The caller passes the own exported function.
|
|
205
205
|
*/
|
|
206
206
|
export function sanitiseWithRedactor(input, target, redact, opts = {}) {
|
|
207
|
-
// Step 4 sits between step 3 and step 5,
|
|
207
|
+
// Step 4 sits between step 3 and step 5, .2's numbering: after
|
|
208
208
|
// the invisible characters are gone (so a zero-width space cannot hide an
|
|
209
209
|
// email address from the matcher) and before marker neutralisation (so the
|
|
210
210
|
// redactor never sees our own inserted word joiner).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A thread as a BRIEF — the markdown an agent, a ticket or a clipboard wants:
|
|
3
3
|
* Where to look · What's wrong · Environment · Breadcrumbs · Screenshot.
|
|
4
4
|
*
|
|
5
|
-
* ONE formatter in the shared package
|
|
5
|
+
* ONE formatter in the shared package, so the dashboard's
|
|
6
6
|
* Copy button, the MCP server's `get_thread` and the server's own markdown
|
|
7
7
|
* route cannot drift from one another. Pure: a thread in, a string out, no
|
|
8
8
|
* clock, so the same thread always produces the same brief.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* before it is written. The dashboard passes nothing (the clipboard is the
|
|
17
17
|
* studio's own), the MCP server passes `@snagset/adapters`' fence so a model
|
|
18
18
|
* reads `<untrusted-content kind="body">…</untrusted-content>` around the
|
|
19
|
-
* client's words
|
|
19
|
+
* client's words. Ids, keys, timestamps and enums we
|
|
20
20
|
* minted are written bare.
|
|
21
21
|
*/
|
|
22
22
|
import { param } from "./names.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @snagset/types — shared types and the executable Name Registry.
|
|
2
2
|
// The names module is generated from registry.json (see scripts/gen-names.mjs);
|
|
3
|
-
// domain types
|
|
3
|
+
// domain types land here as the packages that own them are built.
|
|
4
4
|
export * from "./names.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Source of truth: packages/types/registry.json
|
|
4
4
|
// Regenerate: pnpm gen:names (CI runs `pnpm gen:names:check`)
|
|
5
5
|
//
|
|
6
|
-
// The Name Registry
|
|
6
|
+
// The Name Registry made executable. Every token
|
|
7
7
|
// below is DERIVED from registry.json's `brand` block — the product name lives
|
|
8
8
|
// in exactly one place. test/rename.test.ts proves it: flip the brand, and no
|
|
9
9
|
// token of the old one survives. SCHEMA_VERSION is the one deliberate literal.
|
|
@@ -43,7 +43,7 @@ export const env = (name) => ENV_PREFIX + name;
|
|
|
43
43
|
export const pgType = (name) => PG_TYPE_PREFIX + name;
|
|
44
44
|
/** @returns e.g. `snagset_http_requests_total` */
|
|
45
45
|
export const metric = (name) => METRIC_PREFIX + name;
|
|
46
|
-
/** window.* names
|
|
46
|
+
/** window.* names. Dunders are internal/test affordances, not public API. */
|
|
47
47
|
export const GLOBALS = {
|
|
48
48
|
api: "Snagset",
|
|
49
49
|
config: "SnagsetConfig",
|
|
@@ -92,7 +92,7 @@ const cssClassToken = {
|
|
|
92
92
|
block: "snag-block",
|
|
93
93
|
};
|
|
94
94
|
export const cssClass = (name) => cssClassToken[name];
|
|
95
|
-
/** Custom properties (
|
|
95
|
+
/** Custom properties (the prefix, enumerated). The design makes every one of these public SemVer surface, so they are registered rather than minted at the point of use. Values are NOT here — the registry governs names, never design. */
|
|
96
96
|
export const CSS_VAR = {
|
|
97
97
|
font: "--snag-font",
|
|
98
98
|
accent: "--snag-accent",
|
|
@@ -133,7 +133,7 @@ export const CSS_VAR_GROUPS = {
|
|
|
133
133
|
export const cssVar = (name) => CSS_VAR[name];
|
|
134
134
|
/** @returns e.g. `var(--snag-bg)` — what stylesheets actually interpolate. */
|
|
135
135
|
export const cssRef = (name) => `var(${CSS_VAR[name]})`;
|
|
136
|
-
/** @returns e.g. `snag_t`. The review-link secret is a FRAGMENT param
|
|
136
|
+
/** @returns e.g. `snag_t`. The review-link secret is a FRAGMENT param. */
|
|
137
137
|
export const param = (name) => "snag_" + name;
|
|
138
138
|
export const RESERVED_URL_PARAMS = {
|
|
139
139
|
query: ["snag_t", "snag_off", "snag_debug", "snag_theme"],
|
|
@@ -141,13 +141,14 @@ export const RESERVED_URL_PARAMS = {
|
|
|
141
141
|
};
|
|
142
142
|
/** Point consts for hot paths: a chunk needing ONE key imports it and
|
|
143
143
|
* drops the whole table — object properties cannot tree-shake, and the
|
|
144
|
-
* panels chunk was carrying ten keys to read two
|
|
144
|
+
* panels chunk was carrying ten keys to read two. */
|
|
145
145
|
export const DISCLOSURE_KEY = "snag:disclosure:v1";
|
|
146
146
|
export const IDENTITY_KEY = "snag:identity";
|
|
147
147
|
export const THEME_ATTR = "data-snag-theme";
|
|
148
|
-
/** Web-storage keys
|
|
148
|
+
/** Web-storage keys. Parameterised keys are functions. */
|
|
149
149
|
export const storageKey = {
|
|
150
150
|
session: (uid) => `snag:session:${uid}`,
|
|
151
|
+
silent: (uid) => `snag:silent:${uid}`,
|
|
151
152
|
identity: IDENTITY_KEY,
|
|
152
153
|
threads: (uid, env) => `snag:threads:${uid}:${env}`,
|
|
153
154
|
seen: (uid, env) => `snag:seen:${uid}:${env}`,
|
|
@@ -159,15 +160,16 @@ export const storageKey = {
|
|
|
159
160
|
seenCoach: "snag:seen-coach",
|
|
160
161
|
disclosure: DISCLOSURE_KEY,
|
|
161
162
|
};
|
|
162
|
-
/** The v0.1 IndexedDB blob store
|
|
163
|
+
/** The v0.1 IndexedDB blob store — one database, one
|
|
163
164
|
* object store, shared by screenshots, reviewer images and the v2 outbox. */
|
|
164
165
|
export const IDB = {
|
|
165
166
|
database: "snag:blobs",
|
|
166
167
|
store: "blobs",
|
|
167
168
|
};
|
|
168
|
-
/** Anchored regex sources matching every registered key —
|
|
169
|
+
/** Anchored regex sources matching every registered key — the storage diff. */
|
|
169
170
|
export const STORAGE_KEY_PATTERNS = [
|
|
170
171
|
"^snag:session:.+$",
|
|
172
|
+
"^snag:silent:.+$",
|
|
171
173
|
"^snag:identity$",
|
|
172
174
|
"^snag:threads:.+:.+$",
|
|
173
175
|
"^snag:seen:.+:.+$",
|
|
@@ -179,20 +181,20 @@ export const STORAGE_KEY_PATTERNS = [
|
|
|
179
181
|
"^snag:seen-coach$",
|
|
180
182
|
"^snag:disclosure:v1$",
|
|
181
183
|
];
|
|
182
|
-
/** The WIDGET's two
|
|
184
|
+
/** The WIDGET's two. Neither carries a credential, and no cookie authenticates the widget API — it runs on somebody else's origin. */
|
|
183
185
|
export const COOKIE = {
|
|
184
186
|
off: "snag_off",
|
|
185
187
|
on: "snag_on",
|
|
186
188
|
};
|
|
187
|
-
/** The dashboard's session + CSRF pair
|
|
189
|
+
/** The dashboard's session + CSRF pair — first-party, on the server's own origin, owner audience. */
|
|
188
190
|
export const DASHBOARD_COOKIE = {
|
|
189
191
|
session: "snag_session",
|
|
190
192
|
csrf: "snag_csrf",
|
|
191
193
|
};
|
|
192
|
-
/**
|
|
194
|
+
/** The design names these two constants directly; both spellings resolve to the same string. */
|
|
193
195
|
export const DASHBOARD_SESSION_COOKIE = DASHBOARD_COOKIE.session;
|
|
194
196
|
export const DASHBOARD_CSRF_COOKIE = DASHBOARD_COOKIE.csrf;
|
|
195
|
-
/** Built widget chunks
|
|
197
|
+
/** Built widget chunks. Preact lives only in `panels`. */
|
|
196
198
|
export const ARTIFACT = {
|
|
197
199
|
stub: "snag.js",
|
|
198
200
|
runtime: "snag.runtime.js",
|
|
@@ -205,7 +207,7 @@ export const ARTIFACT = {
|
|
|
205
207
|
dock: "snag.dock.js",
|
|
206
208
|
text: "snag.text.js",
|
|
207
209
|
};
|
|
208
|
-
/** Wire-form entity id prefixes
|
|
210
|
+
/** Wire-form entity id prefixes. Not brand-derived. */
|
|
209
211
|
export const ID_PREFIX = {
|
|
210
212
|
project: "prj_",
|
|
211
213
|
thread: "thr_",
|
|
@@ -215,11 +217,11 @@ export const ID_PREFIX = {
|
|
|
215
217
|
link: "lnk_",
|
|
216
218
|
round: "rnd_",
|
|
217
219
|
};
|
|
218
|
-
/** Credential literals
|
|
220
|
+
/** Credential literals. Brand-DERIVED, and deliberately not the three-letter row shape: the literal is what gets registered with secret scanning, so a token pasted into a public repo is reported. */
|
|
219
221
|
export const CREDENTIAL_PREFIX = {
|
|
220
222
|
mcp: "snagmcp_",
|
|
221
223
|
};
|
|
222
|
-
/** CustomEvents dispatched on document
|
|
224
|
+
/** CustomEvents dispatched on document. */
|
|
223
225
|
export const DOM_EVENT = {
|
|
224
226
|
ready: "snagset:ready",
|
|
225
227
|
activate: "snagset:activate",
|
|
@@ -227,7 +229,7 @@ export const DOM_EVENT = {
|
|
|
227
229
|
threadCreated: "snagset:thread-created",
|
|
228
230
|
threadResolved: "snagset:thread-resolved",
|
|
229
231
|
};
|
|
230
|
-
/** Request/response header names inside
|
|
232
|
+
/** Request/response header names inside the prefix. */
|
|
231
233
|
export const HTTP_HEADER = {
|
|
232
234
|
client: "x-snagset-client",
|
|
233
235
|
schema: "x-snagset-schema",
|
|
@@ -245,11 +247,11 @@ export const HTTP_HEADER = {
|
|
|
245
247
|
requestId: "x-snagset-request-id",
|
|
246
248
|
mcpTransport: "x-snagset-mcp-transport",
|
|
247
249
|
};
|
|
248
|
-
/** Host-authored `<meta name>` keys we READ and never mint
|
|
250
|
+
/** Host-authored `<meta name>` keys we READ and never mint .: `route` is the only one. */
|
|
249
251
|
export const META_NAME = {
|
|
250
252
|
route: "snagset:route",
|
|
251
253
|
};
|
|
252
|
-
/** Keys for Symbol.for() patch bookkeeping
|
|
254
|
+
/** Keys for Symbol.for() patch bookkeeping. */
|
|
253
255
|
export const SYMBOL_KEY = {
|
|
254
256
|
original: "snagset.original",
|
|
255
257
|
wrapped: "snagset.wrapped",
|
package/dist/view.js
CHANGED
|
@@ -2,7 +2,7 @@ import { fenced, DATA_BOUNDARY } from "./vendor/adapters/outbound/fence.js";
|
|
|
2
2
|
import { sanitise, trusted } from "./vendor/adapters/outbound/sanitise.js";
|
|
3
3
|
import { briefMarkdown } from "./vendor/types/brief.js";
|
|
4
4
|
/**
|
|
5
|
-
* The view an agent sees
|
|
5
|
+
* The view an agent sees, and the four mitigations that live in
|
|
6
6
|
* a projection rather than in a policy.
|
|
7
7
|
*
|
|
8
8
|
* `ThreadSummary` and `ThreadDetail` are projections of
|
|
@@ -14,7 +14,7 @@ import { briefMarkdown } from "./vendor/types/brief.js";
|
|
|
14
14
|
*
|
|
15
15
|
* ── WHAT IS DELIBERATELY MISSING ──
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* On orphans, states the general rule this file follows everywhere:
|
|
18
18
|
* *"a payload that promises fields the release does not have is worse than a
|
|
19
19
|
* short one."* `OutboundThreadView` lists `branch`, `labels`, `assigneeName`,
|
|
20
20
|
* `viewport`, `browser`, `platform` and `prefersColorScheme`; the L1 API does
|
|
@@ -24,17 +24,17 @@ import { briefMarkdown } from "./vendor/types/brief.js";
|
|
|
24
24
|
* ── THE FENCE ──
|
|
25
25
|
*
|
|
26
26
|
* Every Class R and Class P string is WRAPPED, not merely escaped:
|
|
27
|
-
* `<untrusted-content kind="…">…</untrusted-content
|
|
28
|
-
* `author` is fenced too — the review found it emitted bare while
|
|
27
|
+
* `<untrusted-content kind="…">…</untrusted-content>`.
|
|
28
|
+
* `author` is fenced too — the review found it emitted bare while already
|
|
29
29
|
* listed `Reviewer.name` among the untrusted strings reaching the model, *"the
|
|
30
30
|
* kind of contradiction that survives because the two facts sat four pages
|
|
31
31
|
* apart."*
|
|
32
32
|
*/
|
|
33
|
-
/**
|
|
33
|
+
/** The third place the token becomes irreversible. */
|
|
34
34
|
export const SCHEMA_VERSION = "snagset.v1";
|
|
35
|
-
/**
|
|
35
|
+
/** The clamp: comments capped at 50, oldest first. */
|
|
36
36
|
export const MAX_COMMENTS = 50;
|
|
37
|
-
/**
|
|
37
|
+
/** `limit` ≤ 50 on `list_threads`. */
|
|
38
38
|
export const MAX_THREADS = 50;
|
|
39
39
|
/**
|
|
40
40
|
* Clamps on the fenced strings themselves.
|
|
@@ -42,13 +42,13 @@ export const MAX_THREADS = 50;
|
|
|
42
42
|
* A comment body is capped at 10 000 characters server-side, and fifty of them
|
|
43
43
|
* is half a megabyte of a model's context spent on one tool call. 4 000 is the
|
|
44
44
|
* length at which a snag's text stops being a snag and starts being a document
|
|
45
|
-
* somebody pasted *(calibration, like every number
|
|
45
|
+
* somebody pasted *(calibration, like every number)*.
|
|
46
46
|
*/
|
|
47
47
|
const CLAMP = { body: 4_000, name: 200, label: 400, selector: 600 };
|
|
48
48
|
/**
|
|
49
49
|
* The anchor's human-readable half, fenced.
|
|
50
50
|
*
|
|
51
|
-
* `sourceRef` is NOT read here and that is
|
|
51
|
+
* `sourceRef` is NOT read here and that is: source locations never leave
|
|
52
52
|
* the machine. It is the one field the local MCP server *may* read — but only
|
|
53
53
|
* in `map_thread_to_source`, where it never leaves either.
|
|
54
54
|
*/
|
|
@@ -85,7 +85,7 @@ export function summary(t) {
|
|
|
85
85
|
...(t.route ? { route: fenced("label", t.route, CLAMP.label) } : {}),
|
|
86
86
|
commentCount: t.commentCount ?? 0,
|
|
87
87
|
...(t.createdBy?.name ? { author: fenced("name", t.createdBy.name, CLAMP.name) } : {}),
|
|
88
|
-
// The first comment IS the snag (
|
|
88
|
+
// The first comment IS the snag (writes them in one transaction),
|
|
89
89
|
// so a summary without it is a list of keys. Clamped harder than the
|
|
90
90
|
// detail's: this one appears fifty times in a single result.
|
|
91
91
|
...(t.comments?.[0] ? { firstComment: fenced("body", t.comments[0].body, 500) } : {}),
|
|
@@ -109,7 +109,7 @@ export function detail(t) {
|
|
|
109
109
|
comments,
|
|
110
110
|
...(t.comments && t.comments.length > MAX_COMMENTS
|
|
111
111
|
? {
|
|
112
|
-
// Said out loud.
|
|
112
|
+
// Said out loud. The own rule about silent caps: an agent that reads
|
|
113
113
|
// 50 of 200 comments and is not told will answer as if it read them
|
|
114
114
|
// all.
|
|
115
115
|
commentsTruncated: `showing the oldest ${MAX_COMMENTS} of ${t.comments.length} comments`,
|
|
@@ -121,7 +121,7 @@ export function detail(t) {
|
|
|
121
121
|
id: a.id,
|
|
122
122
|
kind: a.kind,
|
|
123
123
|
// A path on the instance, never a bucket URL. There is no tool that
|
|
124
|
-
// fetches it:
|
|
124
|
+
// fetches it: — no arbitrary-fetch tool.
|
|
125
125
|
url: a.url,
|
|
126
126
|
...(a.width ? { width: a.width, height: a.height } : {}),
|
|
127
127
|
})),
|
|
@@ -132,7 +132,7 @@ export function detail(t) {
|
|
|
132
132
|
/**
|
|
133
133
|
* `get_thread_context` — `context:read`, the personal-data-bearing half.
|
|
134
134
|
*
|
|
135
|
-
*
|
|
135
|
+
* `CaptureContext` minus `sourceRef`, plus breadcrumbs and
|
|
136
136
|
* `capture.reasons[]` / `capture.blindSpots[]`. Breadcrumb messages are Class R
|
|
137
137
|
* — a console log on somebody else's site is text an attacker can write — so
|
|
138
138
|
* every one is fenced.
|
|
@@ -173,12 +173,12 @@ export function failure(message) {
|
|
|
173
173
|
return `${DATA_BOUNDARY}\n\n${sanitise(message, "plain", { max: 1_000 })}`;
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
176
|
-
* `get_thread`'s default answer
|
|
176
|
+
* `get_thread`'s default answer — the BRIEF, as markdown: where
|
|
177
177
|
* to look, what's wrong, the screenshot. The same formatter the dashboard's
|
|
178
178
|
* Copy button and the server's `…/threads/:id.md` use, with two differences
|
|
179
179
|
* that belong to this package:
|
|
180
180
|
*
|
|
181
|
-
* · every string a reviewer could have typed is FENCED
|
|
181
|
+
* · every string a reviewer could have typed is FENCED,
|
|
182
182
|
* through the same clamps the JSON view applies;
|
|
183
183
|
* · the capture CONTEXT is left out. It is the personal-data-bearing half
|
|
184
184
|
* (`context:read`, `get_thread_context`), and a token is not given that
|
package/dist/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAyC,MAAM,sBAAsB,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,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