@reticlehq/core 2.2.1 → 2.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/dist/brand.d.ts +0 -1
- package/dist/brand.js +0 -1
- package/dist/consequence.d.ts +0 -1
- package/dist/consequence.js +0 -1
- package/dist/constants.d.ts +30 -33
- package/dist/constants.js +33 -31
- package/dist/daemon-registry.d.ts +0 -1
- package/dist/daemon-registry.js +0 -1
- package/dist/desktop-contract.cjs +11 -0
- package/dist/desktop-contract.d.cts +6 -0
- package/dist/desktop-contract.d.ts +58 -0
- package/dist/desktop-contract.js +59 -0
- package/dist/event-payloads.d.ts +62 -5
- package/dist/event-payloads.js +35 -4
- package/dist/event-priority.d.ts +25 -0
- package/dist/event-priority.js +45 -0
- package/dist/findings.d.ts +124 -0
- package/dist/findings.js +122 -0
- package/dist/flow-constants.d.ts +0 -1
- package/dist/flow-constants.js +0 -1
- package/dist/flow-types.d.ts +26 -2
- package/dist/flow-types.js +0 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +9 -2
- package/dist/journal.d.ts +0 -1
- package/dist/journal.js +0 -1
- package/dist/messages.d.ts +40 -11
- package/dist/messages.js +14 -1
- package/dist/net.d.ts +41 -0
- package/dist/net.js +40 -0
- package/dist/notices.d.ts +0 -1
- package/dist/notices.js +0 -1
- package/dist/redaction.d.ts +64 -1
- package/dist/redaction.js +119 -3
- package/dist/schema/event-message.json +3 -1
- package/dist/schema/event-type.json +3 -1
- package/dist/schema/hello-message.json +9 -0
- package/dist/schema/reticle-event.json +3 -1
- package/dist/schema/reticle-message.json +12 -1
- package/dist/security.d.ts +20 -1
- package/dist/security.js +45 -1
- package/dist/session-constants.d.ts +0 -1
- package/dist/session-constants.js +0 -1
- package/dist/source-constants.d.ts +26 -0
- package/dist/source-constants.js +26 -0
- package/dist/state-select.d.ts +10 -1
- package/dist/state-select.js +56 -8
- package/dist/telemetry-feedback.d.ts +265 -0
- package/dist/telemetry-feedback.js +163 -0
- package/dist/telemetry-session.d.ts +524 -0
- package/dist/telemetry-session.js +245 -0
- package/dist/telemetry.d.ts +1410 -37
- package/dist/telemetry.js +338 -18
- package/dist/toon.d.ts +0 -1
- package/dist/toon.js +0 -1
- package/dist/types.d.ts +15 -8
- package/dist/types.js +0 -1
- package/dist/upgrade.d.ts +0 -1
- package/dist/upgrade.js +0 -1
- package/dist/verification-run.d.ts +14 -15
- package/dist/verification-run.js +0 -1
- package/dist/verified-constants.d.ts +104 -0
- package/dist/verified-constants.js +102 -0
- package/package.json +7 -3
- package/dist/brand.d.ts.map +0 -1
- package/dist/brand.js.map +0 -1
- package/dist/consequence.d.ts.map +0 -1
- package/dist/consequence.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/daemon-registry.d.ts.map +0 -1
- package/dist/daemon-registry.js.map +0 -1
- package/dist/event-payloads.d.ts.map +0 -1
- package/dist/event-payloads.js.map +0 -1
- package/dist/flow-constants.d.ts.map +0 -1
- package/dist/flow-constants.js.map +0 -1
- package/dist/flow-types.d.ts.map +0 -1
- package/dist/flow-types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/journal.d.ts.map +0 -1
- package/dist/journal.js.map +0 -1
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js.map +0 -1
- package/dist/notices.d.ts.map +0 -1
- package/dist/notices.js.map +0 -1
- package/dist/redaction.d.ts.map +0 -1
- package/dist/redaction.js.map +0 -1
- package/dist/security.d.ts.map +0 -1
- package/dist/security.js.map +0 -1
- package/dist/session-constants.d.ts.map +0 -1
- package/dist/session-constants.js.map +0 -1
- package/dist/state-select.d.ts.map +0 -1
- package/dist/state-select.js.map +0 -1
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/telemetry.js.map +0 -1
- package/dist/toon.d.ts.map +0 -1
- package/dist/toon.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/upgrade.d.ts.map +0 -1
- package/dist/upgrade.js.map +0 -1
- package/dist/verification-run.d.ts.map +0 -1
- package/dist/verification-run.js.map +0 -1
package/dist/security.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
/** True only for literal loopback hosts, never lookalike DNS names such as 127.example.com. */
|
|
2
2
|
export declare function isLoopbackHostname(hostname: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* True when the page is local: an ordinary loopback document, or a desktop webview.
|
|
5
|
+
*
|
|
6
|
+
* This is what gates the SDK on the page side. The gate's purpose is to stop a REMOTE WEBSITE from
|
|
7
|
+
* driving a developer's local bridge — a desktop app's own webview is not that, and treating it as
|
|
8
|
+
* remote is what made Reticle refuse to start inside a packaged Electron or Tauri app.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isLocalPage(protocol: string, hostname: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* What `URL.origin` yields for a scheme that has no tuple origin — and what a browser puts in the
|
|
13
|
+
* `Origin` header for the same. Desktop webviews are the common case: `tauri://localhost` on
|
|
14
|
+
* macOS/Linux, `app://.` or `file://` in a packaged Electron renderer.
|
|
15
|
+
*/
|
|
16
|
+
export declare const OPAQUE_ORIGIN = "null";
|
|
17
|
+
/**
|
|
18
|
+
* True when an Origin carries no attributable host — a desktop webview or a `file://` document.
|
|
19
|
+
* Such an origin cannot be checked against `isLoopbackHostname`; callers must fall back to the
|
|
20
|
+
* pairing token, exactly as they do for a request that omits `Origin` entirely.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isOpaqueOrigin(origin: string): boolean;
|
|
3
23
|
/** Best-effort classifier for labels and tool names that can trigger irreversible effects. */
|
|
4
24
|
export declare function isDangerousActionText(text: string): boolean;
|
|
5
|
-
//# sourceMappingURL=security.d.ts.map
|
package/dist/security.js
CHANGED
|
@@ -15,8 +15,52 @@ export function isLoopbackHostname(hostname) {
|
|
|
15
15
|
return value >= 0 && value <= 255;
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Page protocols that mean "this document IS a local desktop app", not a website. A packaged
|
|
20
|
+
* Electron renderer loads over `file:` (or a registered `app:` protocol); a Tauri webview loads over
|
|
21
|
+
* `tauri:` on macOS/Linux. None of these can be reached by a remote attacker — there is no network
|
|
22
|
+
* origin to serve them from — so a page on one is as local as `http://localhost`.
|
|
23
|
+
*/
|
|
24
|
+
const LOCAL_APP_PROTOCOLS = ['file:', 'app:', 'tauri:'];
|
|
25
|
+
/**
|
|
26
|
+
* The hostname Tauri v2 uses on Windows (and Android), where the webview needs a real http origin.
|
|
27
|
+
* `.localhost` is reserved for loopback by RFC 6761, so this can never resolve to a remote host.
|
|
28
|
+
*/
|
|
29
|
+
const TAURI_HTTP_HOSTNAME = 'tauri.localhost';
|
|
30
|
+
/**
|
|
31
|
+
* True when the page is local: an ordinary loopback document, or a desktop webview.
|
|
32
|
+
*
|
|
33
|
+
* This is what gates the SDK on the page side. The gate's purpose is to stop a REMOTE WEBSITE from
|
|
34
|
+
* driving a developer's local bridge — a desktop app's own webview is not that, and treating it as
|
|
35
|
+
* remote is what made Reticle refuse to start inside a packaged Electron or Tauri app.
|
|
36
|
+
*/
|
|
37
|
+
export function isLocalPage(protocol, hostname) {
|
|
38
|
+
if (isLoopbackHostname(hostname))
|
|
39
|
+
return true;
|
|
40
|
+
if (LOCAL_APP_PROTOCOLS.includes(protocol.toLowerCase()))
|
|
41
|
+
return true;
|
|
42
|
+
return hostname.toLowerCase() === TAURI_HTTP_HOSTNAME;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* What `URL.origin` yields for a scheme that has no tuple origin — and what a browser puts in the
|
|
46
|
+
* `Origin` header for the same. Desktop webviews are the common case: `tauri://localhost` on
|
|
47
|
+
* macOS/Linux, `app://.` or `file://` in a packaged Electron renderer.
|
|
48
|
+
*/
|
|
49
|
+
export const OPAQUE_ORIGIN = 'null';
|
|
50
|
+
/**
|
|
51
|
+
* True when an Origin carries no attributable host — a desktop webview or a `file://` document.
|
|
52
|
+
* Such an origin cannot be checked against `isLoopbackHostname`; callers must fall back to the
|
|
53
|
+
* pairing token, exactly as they do for a request that omits `Origin` entirely.
|
|
54
|
+
*/
|
|
55
|
+
export function isOpaqueOrigin(origin) {
|
|
56
|
+
try {
|
|
57
|
+
return new URL(origin).origin === OPAQUE_ORIGIN;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
18
63
|
/** Best-effort classifier for labels and tool names that can trigger irreversible effects. */
|
|
19
64
|
export function isDangerousActionText(text) {
|
|
20
65
|
return DANGEROUS_ACTION.test(text.replace(/[_-]+/g, ' '));
|
|
21
66
|
}
|
|
22
|
-
//# sourceMappingURL=security.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source mapping: how a DOM node is traced back to the line of code that rendered it.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `constants.ts` — these two are read by the build plugins, the browser SDK and the
|
|
5
|
+
* React adapter together, and they change for one reason (the source-pointer feature) rather than
|
|
6
|
+
* for the dozen reasons the wire contract does.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The attribute the build plugin stamps on JSX host elements as `file:line:column`, so the browser SDK
|
|
10
|
+
* and the React adapter can map a DOM node back to its source file (the source-pointer feature, needed
|
|
11
|
+
* on React 19 which dropped _debugSource). Read here by both packages — it was duplicated as a local
|
|
12
|
+
* const in dom/source.ts AND dom/query.ts and inlined as a literal in the React adapter. The stamper
|
|
13
|
+
* (@reticlehq/babel-plugin, separate build tooling) stamps this same literal and MUST match it.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DATA_RETICLE_SOURCE_ATTR = "data-reticle-source";
|
|
16
|
+
/**
|
|
17
|
+
* Compile-time global carrying the project root, so the SDK can report source paths RELATIVE to the
|
|
18
|
+
* repo.
|
|
19
|
+
*
|
|
20
|
+
* React's `_debugSource.fileName` is ABSOLUTE (`/Users/you/app/src/Counter.tsx`), while the babel
|
|
21
|
+
* stamp is repo-relative (`src/Counter.tsx`). Both reach the agent as `source`, so the same product
|
|
22
|
+
* emitted two different path shapes depending on which React version an app happened to be on —
|
|
23
|
+
* and an absolute path from someone else's machine is noise in a report, not a pointer. Defined by
|
|
24
|
+
* the build plugins, which are the only place that knows the root.
|
|
25
|
+
*/
|
|
26
|
+
export declare const RETICLE_ROOT_GLOBAL = "__RETICLE_ROOT__";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source mapping: how a DOM node is traced back to the line of code that rendered it.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `constants.ts` — these two are read by the build plugins, the browser SDK and the
|
|
5
|
+
* React adapter together, and they change for one reason (the source-pointer feature) rather than
|
|
6
|
+
* for the dozen reasons the wire contract does.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The attribute the build plugin stamps on JSX host elements as `file:line:column`, so the browser SDK
|
|
10
|
+
* and the React adapter can map a DOM node back to its source file (the source-pointer feature, needed
|
|
11
|
+
* on React 19 which dropped _debugSource). Read here by both packages — it was duplicated as a local
|
|
12
|
+
* const in dom/source.ts AND dom/query.ts and inlined as a literal in the React adapter. The stamper
|
|
13
|
+
* (@reticlehq/babel-plugin, separate build tooling) stamps this same literal and MUST match it.
|
|
14
|
+
*/
|
|
15
|
+
export const DATA_RETICLE_SOURCE_ATTR = 'data-reticle-source';
|
|
16
|
+
/**
|
|
17
|
+
* Compile-time global carrying the project root, so the SDK can report source paths RELATIVE to the
|
|
18
|
+
* repo.
|
|
19
|
+
*
|
|
20
|
+
* React's `_debugSource.fileName` is ABSOLUTE (`/Users/you/app/src/Counter.tsx`), while the babel
|
|
21
|
+
* stamp is repo-relative (`src/Counter.tsx`). Both reach the agent as `source`, so the same product
|
|
22
|
+
* emitted two different path shapes depending on which React version an app happened to be on —
|
|
23
|
+
* and an absolute path from someone else's machine is noise in a report, not a pointer. Defined by
|
|
24
|
+
* the build plugins, which are the only place that knows the root.
|
|
25
|
+
*/
|
|
26
|
+
export const RETICLE_ROOT_GLOBAL = '__RETICLE_ROOT__';
|
package/dist/state-select.d.ts
CHANGED
|
@@ -11,6 +11,16 @@ export interface PathSelection {
|
|
|
11
11
|
value: unknown;
|
|
12
12
|
/** On a miss: the keys present at the deepest level reached (so the agent can correct the path). */
|
|
13
13
|
availableKeys?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* On a miss where `availableKeys` is a SAMPLE: how many keys were really there.
|
|
16
|
+
*
|
|
17
|
+
* Present only when the list was cut. `availableKeys` is capped, and without this a 10,000-key
|
|
18
|
+
* store answered a wrong path with 50 names and no sign there were more — so an agent reading it
|
|
19
|
+
* concludes the key it wants does not exist, when it is simply key 51. That reads as the strongest
|
|
20
|
+
* possible negative signal and it is a false one, which is the precise failure this near-miss
|
|
21
|
+
* payload was added to prevent.
|
|
22
|
+
*/
|
|
23
|
+
totalKeys?: number;
|
|
14
24
|
}
|
|
15
25
|
/** Walk `path` (e.g. "captionCache.v3.0.text") into `root`. Empty path returns root unchanged. */
|
|
16
26
|
export declare function selectPath(root: unknown, path: string): PathSelection;
|
|
@@ -20,4 +30,3 @@ export declare function selectPath(root: unknown, path: string): PathSelection;
|
|
|
20
30
|
* budget means "no cap".
|
|
21
31
|
*/
|
|
22
32
|
export declare function capDepth(value: unknown, maxDepth: number): unknown;
|
|
23
|
-
//# sourceMappingURL=state-select.d.ts.map
|
package/dist/state-select.js
CHANGED
|
@@ -8,12 +8,39 @@
|
|
|
8
8
|
/** Cap on how many near-miss keys travel in a failed selection — a 10k-key store must not return a
|
|
9
9
|
* 10k-entry array in the error payload (that was the token blowup the near-miss exists to avoid). */
|
|
10
10
|
const MAX_AVAILABLE_KEYS = 50;
|
|
11
|
+
/** The keys at a level, as a bounded sample plus the true count when the sample is short. */
|
|
11
12
|
function keysOf(value) {
|
|
12
|
-
if (Array.isArray(value))
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
if (Array.isArray(value)) {
|
|
14
|
+
return {
|
|
15
|
+
keys: value.slice(0, MAX_AVAILABLE_KEYS).map((_, i) => String(i)),
|
|
16
|
+
total: value.length,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
if (value instanceof Map) {
|
|
20
|
+
const keys = [];
|
|
21
|
+
let total = 0;
|
|
22
|
+
for (const k of value.keys()) {
|
|
23
|
+
total += 1;
|
|
24
|
+
if (typeof k === 'string' && keys.length < MAX_AVAILABLE_KEYS)
|
|
25
|
+
keys.push(k);
|
|
26
|
+
}
|
|
27
|
+
return { keys, total };
|
|
28
|
+
}
|
|
29
|
+
if (typeof value === 'object' && value !== null) {
|
|
30
|
+
const all = Object.keys(value);
|
|
31
|
+
return { keys: all.slice(0, MAX_AVAILABLE_KEYS), total: all.length };
|
|
32
|
+
}
|
|
33
|
+
return { keys: [], total: 0 };
|
|
34
|
+
}
|
|
35
|
+
/** A miss, with the sample of keys available where it stopped and the count when that sample is cut. */
|
|
36
|
+
function miss(value) {
|
|
37
|
+
const { keys, total } = keysOf(value);
|
|
38
|
+
return {
|
|
39
|
+
found: false,
|
|
40
|
+
value: null,
|
|
41
|
+
availableKeys: keys,
|
|
42
|
+
...(total > keys.length ? { totalKeys: total } : {}),
|
|
43
|
+
};
|
|
17
44
|
}
|
|
18
45
|
/** Walk `path` (e.g. "captionCache.v3.0.text") into `root`. Empty path returns root unchanged. */
|
|
19
46
|
export function selectPath(root, path) {
|
|
@@ -29,11 +56,18 @@ export function selectPath(root, path) {
|
|
|
29
56
|
index < 0 ||
|
|
30
57
|
String(index) !== segment ||
|
|
31
58
|
index >= current.length) {
|
|
32
|
-
return
|
|
59
|
+
return miss(current);
|
|
33
60
|
}
|
|
34
61
|
current = current[index];
|
|
35
62
|
continue;
|
|
36
63
|
}
|
|
64
|
+
if (current instanceof Map) {
|
|
65
|
+
if (current.has(segment)) {
|
|
66
|
+
current = current.get(segment);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
return miss(current);
|
|
70
|
+
}
|
|
37
71
|
// `Object.hasOwn`, not `in`: `in` walks the prototype, so a path segment of `constructor`,
|
|
38
72
|
// `__proto__`, or `toString` reported found:true and returned a function from Object.prototype —
|
|
39
73
|
// a state assertion on a typo'd path silently passed against a builtin instead of failing with
|
|
@@ -42,7 +76,7 @@ export function selectPath(root, path) {
|
|
|
42
76
|
current = current[segment];
|
|
43
77
|
continue;
|
|
44
78
|
}
|
|
45
|
-
return
|
|
79
|
+
return miss(current);
|
|
46
80
|
}
|
|
47
81
|
return { found: true, value: current };
|
|
48
82
|
}
|
|
@@ -54,6 +88,21 @@ export function selectPath(root, path) {
|
|
|
54
88
|
export function capDepth(value, maxDepth) {
|
|
55
89
|
if (maxDepth < 0)
|
|
56
90
|
return value;
|
|
91
|
+
if (value instanceof Date)
|
|
92
|
+
return Number.isNaN(value.getTime()) ? null : value.toISOString();
|
|
93
|
+
if (value instanceof Set) {
|
|
94
|
+
if (maxDepth === 0)
|
|
95
|
+
return `[Set(${String(value.size)})]`;
|
|
96
|
+
return [...value].map((v) => capDepth(v, maxDepth - 1));
|
|
97
|
+
}
|
|
98
|
+
if (value instanceof Map) {
|
|
99
|
+
if (maxDepth === 0)
|
|
100
|
+
return `{Map(${String(value.size)})}`;
|
|
101
|
+
const out = Object.create(null);
|
|
102
|
+
for (const [k, v] of value)
|
|
103
|
+
out[String(k)] = capDepth(v, maxDepth - 1);
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
57
106
|
if (Array.isArray(value)) {
|
|
58
107
|
if (maxDepth === 0)
|
|
59
108
|
return `[Array(${String(value.length)})]`;
|
|
@@ -73,4 +122,3 @@ export function capDepth(value, maxDepth) {
|
|
|
73
122
|
}
|
|
74
123
|
return value;
|
|
75
124
|
}
|
|
76
|
-
//# sourceMappingURL=state-select.js.map
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The FEEDBACK and IDENTITY contract — the only two things Reticle ever sends that a person wrote.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `telemetry.ts` because they are a different privacy class from everything else there.
|
|
5
|
+
* The rest of telemetry is counters and enums that cannot describe anyone; these two carry authored
|
|
6
|
+
* text and a self-declared identity, they are never emitted passively, and they each have their own
|
|
7
|
+
* consent story. Keeping them in one file makes that boundary something you can see rather than
|
|
8
|
+
* something you have to remember — and it keeps the event contract under the size cap.
|
|
9
|
+
*
|
|
10
|
+
* Neither is ever populated by inference. A `Feedback` exists because an agent called
|
|
11
|
+
* `reticle_feedback` or a human ran `reticle feedback`; an `Identity` exists because a human ran
|
|
12
|
+
* `reticle identify`. There is no code path to either that a person did not start.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
/** Who authored the feedback. Agents report failures; humans also rate the experience. */
|
|
16
|
+
export declare const FeedbackSource: {
|
|
17
|
+
readonly AGENT: "agent";
|
|
18
|
+
readonly HUMAN: "human";
|
|
19
|
+
};
|
|
20
|
+
export type FeedbackSource = (typeof FeedbackSource)[keyof typeof FeedbackSource];
|
|
21
|
+
/**
|
|
22
|
+
* What kind of report this is. The first three are the agent's vocabulary — they name the three ways
|
|
23
|
+
* Reticle fails an agent, and keeping them distinct is the whole point: a BUG is our defect, a GAP is
|
|
24
|
+
* a thing we cannot see at all, and an AMBIGUITY is a verdict the agent could not act on. Lumping
|
|
25
|
+
* them into "it didn't work" would destroy the only signal that says what to build next.
|
|
26
|
+
*/
|
|
27
|
+
export declare const FeedbackKind: {
|
|
28
|
+
/** A tool misbehaved: wrong result, crash, or a contract it did not honor. */
|
|
29
|
+
readonly BUG: "bug";
|
|
30
|
+
/** Reticle could not observe something the agent needed — a blind spot, not a defect. */
|
|
31
|
+
readonly GAP: "gap";
|
|
32
|
+
/** The verification ran but its verdict was not decidable — pass/fail could not be told apart. */
|
|
33
|
+
readonly AMBIGUITY: "ambiguity";
|
|
34
|
+
/**
|
|
35
|
+
* "I wish Reticle could do X." Something that does not exist and would have helped.
|
|
36
|
+
*
|
|
37
|
+
* Reticle is built FOR agents, so the agent is the user whose wishes matter most — and it is the
|
|
38
|
+
* one user who never gets asked. It hits a limitation, works around it, finishes the task, and the
|
|
39
|
+
* wish evaporates with the context window. This is the channel for it, and it is deliberately as
|
|
40
|
+
* easy to file as a bug: the friction that stops people reporting failures stops them twice as
|
|
41
|
+
* hard for something that is merely a nice-to-have.
|
|
42
|
+
*/
|
|
43
|
+
readonly FEATURE_REQUEST: "feature_request";
|
|
44
|
+
/**
|
|
45
|
+
* Something that EXISTS but is awkward — too many calls, a confusing shape, a slow path.
|
|
46
|
+
*
|
|
47
|
+
* Kept separate from a feature request because the responses differ completely: one is "build the
|
|
48
|
+
* missing thing", the other is "the thing is there and the ergonomics are wrong". Collapsing them
|
|
49
|
+
* would hide the second inside the first, and the second is usually cheaper and higher-impact.
|
|
50
|
+
*/
|
|
51
|
+
readonly IMPROVEMENT: "improvement";
|
|
52
|
+
/** A human's overall take on using Reticle (carries `rating`). */
|
|
53
|
+
readonly EXPERIENCE: "experience";
|
|
54
|
+
};
|
|
55
|
+
export type FeedbackKind = (typeof FeedbackKind)[keyof typeof FeedbackKind];
|
|
56
|
+
/** Which shell the verified app runs in. Mirrors the SDK's own `PAGE_HEALTH` runtime report. */
|
|
57
|
+
export declare const AppRuntime: {
|
|
58
|
+
readonly WEB: "web";
|
|
59
|
+
readonly ELECTRON: "electron";
|
|
60
|
+
readonly TAURI: "tauri";
|
|
61
|
+
};
|
|
62
|
+
export type AppRuntime = (typeof AppRuntime)[keyof typeof AppRuntime];
|
|
63
|
+
/** The rendering engine behind the connected page — coarse on purpose (three values, not a UA string). */
|
|
64
|
+
export declare const BrowserEngine: {
|
|
65
|
+
readonly BLINK: "blink";
|
|
66
|
+
readonly GECKO: "gecko";
|
|
67
|
+
readonly WEBKIT: "webkit";
|
|
68
|
+
};
|
|
69
|
+
export type BrowserEngine = (typeof BrowserEngine)[keyof typeof BrowserEngine];
|
|
70
|
+
/** How Reticle reaches the page: a driven CDP browser, or the SDK inside the human's own browser. */
|
|
71
|
+
export declare const PageDriver: {
|
|
72
|
+
readonly CDP: "cdp";
|
|
73
|
+
readonly SDK: "sdk";
|
|
74
|
+
};
|
|
75
|
+
export type PageDriver = (typeof PageDriver)[keyof typeof PageDriver];
|
|
76
|
+
/** Where the MCP server is registered — a user-level install serves every project, a project-level one doesn't. */
|
|
77
|
+
export declare const McpScope: {
|
|
78
|
+
readonly USER: "user";
|
|
79
|
+
readonly PROJECT: "project";
|
|
80
|
+
};
|
|
81
|
+
export type McpScope = (typeof McpScope)[keyof typeof McpScope];
|
|
82
|
+
export declare const FEEDBACK_TEXT_MAX = 4000;
|
|
83
|
+
export declare const FEEDBACK_TRACE_MAX = 8000;
|
|
84
|
+
export declare const FEEDBACK_RATING_MIN = 1;
|
|
85
|
+
export declare const FEEDBACK_RATING_MAX = 5;
|
|
86
|
+
/** Cap for the structured why/impact/workaround fields — prose, but bounded prose. */
|
|
87
|
+
export declare const FEEDBACK_FIELD_MAX = 1000;
|
|
88
|
+
/**
|
|
89
|
+
* The feedback body. Everything here is either author-written (`text`, `trace`, `rating`) or
|
|
90
|
+
* environment context detected locally (`stack`, `runtime`, `engine`, …) — the context is what turns
|
|
91
|
+
* "a tool broke" into "a tool breaks on Tauri + SvelteKit", which is the difference between a
|
|
92
|
+
* complaint and a work item.
|
|
93
|
+
*
|
|
94
|
+
* `text`/`trace` are the ONLY free-text fields Reticle ever sends. They are opt-in by action (nothing
|
|
95
|
+
* is scraped — someone typed or wrote them), capped, and redacted client-side before the wire.
|
|
96
|
+
*/
|
|
97
|
+
export declare const FeedbackSchema: z.ZodObject<{
|
|
98
|
+
source: z.ZodNativeEnum<{
|
|
99
|
+
readonly AGENT: "agent";
|
|
100
|
+
readonly HUMAN: "human";
|
|
101
|
+
}>;
|
|
102
|
+
kind: z.ZodNativeEnum<{
|
|
103
|
+
/** A tool misbehaved: wrong result, crash, or a contract it did not honor. */
|
|
104
|
+
readonly BUG: "bug";
|
|
105
|
+
/** Reticle could not observe something the agent needed — a blind spot, not a defect. */
|
|
106
|
+
readonly GAP: "gap";
|
|
107
|
+
/** The verification ran but its verdict was not decidable — pass/fail could not be told apart. */
|
|
108
|
+
readonly AMBIGUITY: "ambiguity";
|
|
109
|
+
/**
|
|
110
|
+
* "I wish Reticle could do X." Something that does not exist and would have helped.
|
|
111
|
+
*
|
|
112
|
+
* Reticle is built FOR agents, so the agent is the user whose wishes matter most — and it is the
|
|
113
|
+
* one user who never gets asked. It hits a limitation, works around it, finishes the task, and the
|
|
114
|
+
* wish evaporates with the context window. This is the channel for it, and it is deliberately as
|
|
115
|
+
* easy to file as a bug: the friction that stops people reporting failures stops them twice as
|
|
116
|
+
* hard for something that is merely a nice-to-have.
|
|
117
|
+
*/
|
|
118
|
+
readonly FEATURE_REQUEST: "feature_request";
|
|
119
|
+
/**
|
|
120
|
+
* Something that EXISTS but is awkward — too many calls, a confusing shape, a slow path.
|
|
121
|
+
*
|
|
122
|
+
* Kept separate from a feature request because the responses differ completely: one is "build the
|
|
123
|
+
* missing thing", the other is "the thing is there and the ergonomics are wrong". Collapsing them
|
|
124
|
+
* would hide the second inside the first, and the second is usually cheaper and higher-impact.
|
|
125
|
+
*/
|
|
126
|
+
readonly IMPROVEMENT: "improvement";
|
|
127
|
+
/** A human's overall take on using Reticle (carries `rating`). */
|
|
128
|
+
readonly EXPERIENCE: "experience";
|
|
129
|
+
}>;
|
|
130
|
+
/** The author's account. For an agent: what failed and why (its RCA). For a human: their words. */
|
|
131
|
+
text: z.ZodString;
|
|
132
|
+
/** Agent-side only: the call/response trail that led to the failure, so the RCA is reproducible. */
|
|
133
|
+
trace: z.ZodOptional<z.ZodString>;
|
|
134
|
+
/** Human-side only: 1–5. The single number that trends without reading a word. */
|
|
135
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
/**
|
|
137
|
+
* WHY it is wanted — the goal behind the request, not the request itself.
|
|
138
|
+
*
|
|
139
|
+
* The most common way a feature request wastes everyone's time is arriving as a solution with the
|
|
140
|
+
* problem stripped off. "Add a `waitForIdle` tool" is a guess about implementation; "I need to know
|
|
141
|
+
* the page stopped changing before I assert" is a requirement, and it may already have an answer.
|
|
142
|
+
*/
|
|
143
|
+
need: z.ZodOptional<z.ZodString>;
|
|
144
|
+
/** What measurably gets better — fewer calls, fewer retries, a verdict that stops being ambiguous. */
|
|
145
|
+
impact: z.ZodOptional<z.ZodString>;
|
|
146
|
+
/**
|
|
147
|
+
* How the author works around it TODAY. Usually the most valuable field in the whole report.
|
|
148
|
+
*
|
|
149
|
+
* A workaround is evidence rather than opinion: it shows what the agent actually did, proves the
|
|
150
|
+
* need is real enough to have cost it something, and frequently reveals that the missing feature is
|
|
151
|
+
* a worse fix than removing whatever forced the workaround.
|
|
152
|
+
*/
|
|
153
|
+
currentApproach: z.ZodOptional<z.ZodString>;
|
|
154
|
+
/**
|
|
155
|
+
* The MODEL the agent is running, self-reported.
|
|
156
|
+
*
|
|
157
|
+
* Not obtainable any other way: MCP's `clientInfo` carries a client name and version and has no
|
|
158
|
+
* concept of a model, so the transport cannot tell us. The agent knows, and this report is already
|
|
159
|
+
* something the agent authored — so asking is both the only mechanism and a reliable one.
|
|
160
|
+
*
|
|
161
|
+
* It matters more than it looks: a limitation that blocks a smaller model may be a docs problem
|
|
162
|
+
* rather than a missing feature, and a request from a frontier model is evidence the surface itself
|
|
163
|
+
* is short. Without it, every request looks the same.
|
|
164
|
+
*/
|
|
165
|
+
model: z.ZodOptional<z.ZodString>;
|
|
166
|
+
/** The MCP client's own version, alongside its name — so "cursor 0.42 specifically" is answerable. */
|
|
167
|
+
clientVersion: z.ZodOptional<z.ZodString>;
|
|
168
|
+
/** The framework detected in the project (`next`, `vite`, `sveltekit`, `vue`, `astro`, …). */
|
|
169
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
170
|
+
/**
|
|
171
|
+
* The MAJOR version of that framework ("15", "19"). Major only, deliberately: it is what actually
|
|
172
|
+
* segments a bug ("breaks on React 19" is a work item; "breaks on 19.0.0-rc.1-canary" is noise),
|
|
173
|
+
* and a full version string is high-cardinality enough to start narrowing down who sent it.
|
|
174
|
+
*/
|
|
175
|
+
stackMajor: z.ZodOptional<z.ZodNumber>;
|
|
176
|
+
runtime: z.ZodOptional<z.ZodNativeEnum<{
|
|
177
|
+
readonly WEB: "web";
|
|
178
|
+
readonly ELECTRON: "electron";
|
|
179
|
+
readonly TAURI: "tauri";
|
|
180
|
+
}>>;
|
|
181
|
+
engine: z.ZodOptional<z.ZodNativeEnum<{
|
|
182
|
+
readonly BLINK: "blink";
|
|
183
|
+
readonly GECKO: "gecko";
|
|
184
|
+
readonly WEBKIT: "webkit";
|
|
185
|
+
}>>;
|
|
186
|
+
driver: z.ZodOptional<z.ZodNativeEnum<{
|
|
187
|
+
readonly CDP: "cdp";
|
|
188
|
+
readonly SDK: "sdk";
|
|
189
|
+
}>>;
|
|
190
|
+
/** The MCP client on the other end (`claude-code`, `cursor`, …) — self-reported at initialize. */
|
|
191
|
+
client: z.ZodOptional<z.ZodString>;
|
|
192
|
+
mcpScope: z.ZodOptional<z.ZodNativeEnum<{
|
|
193
|
+
readonly USER: "user";
|
|
194
|
+
readonly PROJECT: "project";
|
|
195
|
+
}>>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
text: string;
|
|
198
|
+
kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
|
|
199
|
+
source: "human" | "agent";
|
|
200
|
+
model?: string | undefined;
|
|
201
|
+
stack?: string | undefined;
|
|
202
|
+
stackMajor?: number | undefined;
|
|
203
|
+
trace?: string | undefined;
|
|
204
|
+
rating?: number | undefined;
|
|
205
|
+
need?: string | undefined;
|
|
206
|
+
impact?: string | undefined;
|
|
207
|
+
currentApproach?: string | undefined;
|
|
208
|
+
clientVersion?: string | undefined;
|
|
209
|
+
runtime?: "web" | "electron" | "tauri" | undefined;
|
|
210
|
+
engine?: "blink" | "gecko" | "webkit" | undefined;
|
|
211
|
+
driver?: "cdp" | "sdk" | undefined;
|
|
212
|
+
client?: string | undefined;
|
|
213
|
+
mcpScope?: "project" | "user" | undefined;
|
|
214
|
+
}, {
|
|
215
|
+
text: string;
|
|
216
|
+
kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
|
|
217
|
+
source: "human" | "agent";
|
|
218
|
+
model?: string | undefined;
|
|
219
|
+
stack?: string | undefined;
|
|
220
|
+
stackMajor?: number | undefined;
|
|
221
|
+
trace?: string | undefined;
|
|
222
|
+
rating?: number | undefined;
|
|
223
|
+
need?: string | undefined;
|
|
224
|
+
impact?: string | undefined;
|
|
225
|
+
currentApproach?: string | undefined;
|
|
226
|
+
clientVersion?: string | undefined;
|
|
227
|
+
runtime?: "web" | "electron" | "tauri" | undefined;
|
|
228
|
+
engine?: "blink" | "gecko" | "webkit" | undefined;
|
|
229
|
+
driver?: "cdp" | "sdk" | undefined;
|
|
230
|
+
client?: string | undefined;
|
|
231
|
+
mcpScope?: "project" | "user" | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
export type Feedback = z.infer<typeof FeedbackSchema>;
|
|
234
|
+
/** What Reticle is being used for. Self-declared; never inferred. */
|
|
235
|
+
export declare const UsageContextKind: {
|
|
236
|
+
readonly COMPANY: "company";
|
|
237
|
+
readonly SIDE_PROJECT: "side_project";
|
|
238
|
+
readonly OPEN_SOURCE: "open_source";
|
|
239
|
+
readonly LEARNING: "learning";
|
|
240
|
+
};
|
|
241
|
+
export type UsageContextKind = (typeof UsageContextKind)[keyof typeof UsageContextKind];
|
|
242
|
+
/**
|
|
243
|
+
* A self-declared identity. The ONLY personal data Reticle ever transmits, and it transmits it only
|
|
244
|
+
* because someone typed `reticle identify`. Every field is optional except the context, so a user can
|
|
245
|
+
* say "this is a company" without saying which, or name the company without leaving an email.
|
|
246
|
+
*/
|
|
247
|
+
export declare const IdentitySchema: z.ZodObject<{
|
|
248
|
+
context: z.ZodNativeEnum<{
|
|
249
|
+
readonly COMPANY: "company";
|
|
250
|
+
readonly SIDE_PROJECT: "side_project";
|
|
251
|
+
readonly OPEN_SOURCE: "open_source";
|
|
252
|
+
readonly LEARNING: "learning";
|
|
253
|
+
}>;
|
|
254
|
+
company: z.ZodOptional<z.ZodString>;
|
|
255
|
+
email: z.ZodOptional<z.ZodString>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
context: "company" | "side_project" | "open_source" | "learning";
|
|
258
|
+
company?: string | undefined;
|
|
259
|
+
email?: string | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
context: "company" | "side_project" | "open_source" | "learning";
|
|
262
|
+
company?: string | undefined;
|
|
263
|
+
email?: string | undefined;
|
|
264
|
+
}>;
|
|
265
|
+
export type Identity = z.infer<typeof IdentitySchema>;
|