@reticlehq/core 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 -25
- package/dist/constants.js +33 -23
- 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 +60 -3
- 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 +9 -1
- package/dist/flow-types.js +0 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +8 -2
- package/dist/journal.d.ts +0 -1
- package/dist/journal.js +0 -1
- package/dist/messages.d.ts +16 -11
- package/dist/messages.js +0 -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 +0 -1
- package/dist/redaction.js +1 -2
- package/dist/schema/event-message.json +3 -1
- package/dist/schema/event-type.json +3 -1
- package/dist/schema/reticle-event.json +3 -1
- package/dist/schema/reticle-message.json +3 -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/state-select.d.ts +0 -1
- package/dist/state-select.js +32 -1
- 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 +9 -2
- 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 +4 -5
- 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/net.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network-call vocabulary shared by the browser SDK and the server. Split out of constants.ts to
|
|
3
|
+
* keep that file under the size cap.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* What issued a network-shaped call. Desktop apps (Electron, Tauri) reach their backend over IPC
|
|
7
|
+
* rather than HTTP, so an IPC call is recorded as a request with `initiator: 'ipc'` — that keeps
|
|
8
|
+
* `reticle_network`, settle-waiting and `assert { net }` working on desktop with no new wire shape.
|
|
9
|
+
*/
|
|
10
|
+
export const NetInitiator = {
|
|
11
|
+
FETCH: 'fetch',
|
|
12
|
+
XHR: 'xhr',
|
|
13
|
+
BEACON: 'beacon',
|
|
14
|
+
IPC: 'ipc',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Synthetic URL scheme for an IPC call, so a channel/command name occupies the `url` field the way a
|
|
18
|
+
* real endpoint does: `ipc://get_user`. Agents filter and assert on it with the ordinary net tools.
|
|
19
|
+
*/
|
|
20
|
+
export const IPC_URL_SCHEME = 'ipc://';
|
|
21
|
+
/**
|
|
22
|
+
* IPC has no status code, but every existing filter and assertion in Reticle keys on one
|
|
23
|
+
* (`reticle_network { status: 500 }`, "did POST /x return 200?"). Mapping a settled IPC call onto
|
|
24
|
+
* these two synthetic codes is what makes a FAILED main-process handler or Rust command visible to
|
|
25
|
+
* the tools an agent already uses — without it, an IPC failure is unqueryable and the desktop story
|
|
26
|
+
* is a false green by construction. `ok` is still emitted alongside and is the authoritative field.
|
|
27
|
+
*/
|
|
28
|
+
export const IpcStatus = {
|
|
29
|
+
OK: 200,
|
|
30
|
+
ERROR: 500,
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* `202 Accepted` — the server took the request and has NOT finished processing it.
|
|
34
|
+
*
|
|
35
|
+
* The only status in HTTP whose meaning is "no outcome yet". Folding it into the 2xx success band is
|
|
36
|
+
* how an asynchronous workflow gets verified at exactly the moment nothing has been decided:
|
|
37
|
+
* measured on a logistics console, a dispatch answered 202, the UI rendered success, the page
|
|
38
|
+
* settled, and the server reverted the shipment 1.2s later.
|
|
39
|
+
*/
|
|
40
|
+
export const HTTP_ACCEPTED = 202;
|
package/dist/notices.d.ts
CHANGED
|
@@ -57,4 +57,3 @@ export declare const AGENT_ASK_NOTICE = "Agent needs your input \u2014 answer in
|
|
|
57
57
|
* context). Reticle cannot bring such a tab to front or recover it, so it names the limit instead.
|
|
58
58
|
*/
|
|
59
59
|
export declare const UNSCRIPTABLE_TAB_RECOMMENDATION = "tab hidden/throttled and may be un-focusable from here; refocus it, or run `reticle drive <url>` for a guaranteed scriptable context";
|
|
60
|
-
//# sourceMappingURL=notices.d.ts.map
|
package/dist/notices.js
CHANGED
|
@@ -61,4 +61,3 @@ export const AGENT_ASK_NOTICE = 'Agent needs your input — answer in your termi
|
|
|
61
61
|
* context). Reticle cannot bring such a tab to front or recover it, so it names the limit instead.
|
|
62
62
|
*/
|
|
63
63
|
export const UNSCRIPTABLE_TAB_RECOMMENDATION = 'tab hidden/throttled and may be un-focusable from here; refocus it, or run `reticle drive <url>` for a guaranteed scriptable context';
|
|
64
|
-
//# sourceMappingURL=notices.js.map
|
package/dist/redaction.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export declare function isSensitiveKey(key: string): boolean;
|
|
2
2
|
/** Redact high-confidence secret shapes anywhere in a text/value, independent of any surrounding key. */
|
|
3
3
|
export declare function scrubKnownSecrets(text: string): string;
|
|
4
|
-
//# sourceMappingURL=redaction.d.ts.map
|
package/dist/redaction.js
CHANGED
|
@@ -17,7 +17,7 @@ import { REDACTED_VALUE } from './constants.js';
|
|
|
17
17
|
// bundle the session credential and were the one wire payload reaching the journal + the agent
|
|
18
18
|
// unredacted), NOT any key that merely contains the substring — `scopecookie`, `cookieConsent`,
|
|
19
19
|
// `cookiePolicy` are legitimate app values an agent may need to read, and stay visible.
|
|
20
|
-
const SENSITIVE_KEY = /password|passwd|passcode|secret|(?:(?:access|refresh|auth|bearer|api|id|session|csrf|client)[-_]?tokens?|(?:^|[-_])tokens?(?=$|[-_]))|session[-_]?id|(?:^|[-_])(?:sid|pwd|jwt)(?=$|[-_])|authorization|(?:^|[-_])(?:set[-_])?cookie(?=$|[-_])|api[-_]?key|access[-_]?key|private[-_]?key|client[-_]?secret|credit[-_]?card|card[-_]?number|cvv|cvc|ssn
|
|
20
|
+
const SENSITIVE_KEY = /password|passwd|passcode|secret|(?:(?:access|refresh|auth|bearer|api|id|session|csrf|client)[-_]?tokens?|(?:^|[-_])tokens?(?=$|[-_]))|session[-_]?id|(?:^|[-_])(?:sid|pwd|jwt)(?=$|[-_])|authorization|(?:^|[-_])(?:set[-_])?cookie(?=$|[-_])|api[-_]?key|access[-_]?key|private[-_]?key|client[-_]?secret|credit[-_]?card|card[-_]?number|cvv|cvc|ssn|(?:^|[-_])(?:signature|sig)$|(?:^|[-_])credential$|x-(?:amz|goog)-(?:signature|credential|security-token)$/i;
|
|
21
21
|
export function isSensitiveKey(key) {
|
|
22
22
|
return SENSITIVE_KEY.test(key);
|
|
23
23
|
}
|
|
@@ -30,4 +30,3 @@ const KNOWN_SECRET = /eyJ[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]{4,}
|
|
|
30
30
|
export function scrubKnownSecrets(text) {
|
|
31
31
|
return text.replace(KNOWN_SECRET, REDACTED_VALUE);
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=redaction.js.map
|
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
|
package/dist/state-select.d.ts
CHANGED
package/dist/state-select.js
CHANGED
|
@@ -11,6 +11,16 @@ const MAX_AVAILABLE_KEYS = 50;
|
|
|
11
11
|
function keysOf(value) {
|
|
12
12
|
if (Array.isArray(value))
|
|
13
13
|
return value.slice(0, MAX_AVAILABLE_KEYS).map((_, i) => String(i));
|
|
14
|
+
if (value instanceof Map) {
|
|
15
|
+
const out = [];
|
|
16
|
+
for (const k of value.keys()) {
|
|
17
|
+
if (typeof k === 'string')
|
|
18
|
+
out.push(k);
|
|
19
|
+
if (out.length >= MAX_AVAILABLE_KEYS)
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
14
24
|
if (typeof value === 'object' && value !== null)
|
|
15
25
|
return Object.keys(value).slice(0, MAX_AVAILABLE_KEYS);
|
|
16
26
|
return [];
|
|
@@ -34,6 +44,13 @@ export function selectPath(root, path) {
|
|
|
34
44
|
current = current[index];
|
|
35
45
|
continue;
|
|
36
46
|
}
|
|
47
|
+
if (current instanceof Map) {
|
|
48
|
+
if (current.has(segment)) {
|
|
49
|
+
current = current.get(segment);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
return { found: false, value: null, availableKeys: keysOf(current) };
|
|
53
|
+
}
|
|
37
54
|
// `Object.hasOwn`, not `in`: `in` walks the prototype, so a path segment of `constructor`,
|
|
38
55
|
// `__proto__`, or `toString` reported found:true and returned a function from Object.prototype —
|
|
39
56
|
// a state assertion on a typo'd path silently passed against a builtin instead of failing with
|
|
@@ -54,6 +71,21 @@ export function selectPath(root, path) {
|
|
|
54
71
|
export function capDepth(value, maxDepth) {
|
|
55
72
|
if (maxDepth < 0)
|
|
56
73
|
return value;
|
|
74
|
+
if (value instanceof Date)
|
|
75
|
+
return Number.isNaN(value.getTime()) ? null : value.toISOString();
|
|
76
|
+
if (value instanceof Set) {
|
|
77
|
+
if (maxDepth === 0)
|
|
78
|
+
return `[Set(${String(value.size)})]`;
|
|
79
|
+
return [...value].map((v) => capDepth(v, maxDepth - 1));
|
|
80
|
+
}
|
|
81
|
+
if (value instanceof Map) {
|
|
82
|
+
if (maxDepth === 0)
|
|
83
|
+
return `{Map(${String(value.size)})}`;
|
|
84
|
+
const out = Object.create(null);
|
|
85
|
+
for (const [k, v] of value)
|
|
86
|
+
out[String(k)] = capDepth(v, maxDepth - 1);
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
57
89
|
if (Array.isArray(value)) {
|
|
58
90
|
if (maxDepth === 0)
|
|
59
91
|
return `[Array(${String(value.length)})]`;
|
|
@@ -73,4 +105,3 @@ export function capDepth(value, maxDepth) {
|
|
|
73
105
|
}
|
|
74
106
|
return value;
|
|
75
107
|
}
|
|
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>;
|