@reticlehq/core 2.3.0 → 2.5.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/consequence.d.ts +27 -0
- package/dist/consequence.js +26 -0
- package/dist/constants.d.ts +52 -8
- package/dist/constants.js +49 -8
- package/dist/contract-fingerprint.d.ts +29 -0
- package/dist/contract-fingerprint.js +56 -0
- package/dist/daemon-registry.js +1 -1
- package/dist/event-payloads.d.ts +50 -2
- package/dist/event-payloads.js +12 -1
- package/dist/flow-constants.d.ts +8 -0
- package/dist/flow-constants.js +12 -0
- package/dist/flow-types.d.ts +40 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/journal.d.ts +2 -2
- package/dist/messages.d.ts +72 -0
- package/dist/messages.js +34 -0
- package/dist/net.d.ts +40 -0
- package/dist/net.js +44 -0
- package/dist/project-id.d.ts +28 -0
- package/dist/project-id.js +51 -0
- package/dist/redaction.d.ts +64 -0
- package/dist/redaction.js +118 -1
- package/dist/schema/hello-message.json +17 -0
- package/dist/schema/reticle-message.json +17 -0
- package/dist/security.js +10 -5
- package/dist/source-constants.d.ts +32 -0
- package/dist/source-constants.js +32 -0
- package/dist/state-select.d.ts +24 -2
- package/dist/state-select.js +102 -22
- package/dist/telemetry-feedback.d.ts +32 -10
- package/dist/telemetry-feedback.js +21 -0
- package/dist/telemetry-session.d.ts +30 -0
- package/dist/telemetry-session.js +24 -0
- package/dist/telemetry.d.ts +491 -81
- package/dist/telemetry.js +188 -2
- package/dist/toon.d.ts +2 -1
- package/dist/toon.js +37 -37
- package/dist/types.d.ts +54 -6
- package/dist/types.js +12 -0
- package/dist/upgrade.js +1 -1
- package/dist/verification-run.d.ts +38 -38
- package/dist/verified-constants.d.ts +37 -0
- package/dist/verified-constants.js +36 -0
- package/package.json +5 -3
|
@@ -378,12 +378,12 @@ export declare const VerificationEvidenceSchema: z.ZodObject<{
|
|
|
378
378
|
kind: z.ZodString;
|
|
379
379
|
summary: z.ZodString;
|
|
380
380
|
}, "strip", z.ZodTypeAny, {
|
|
381
|
-
kind: string;
|
|
382
381
|
at: number;
|
|
382
|
+
kind: string;
|
|
383
383
|
summary: string;
|
|
384
384
|
}, {
|
|
385
|
-
kind: string;
|
|
386
385
|
at: number;
|
|
386
|
+
kind: string;
|
|
387
387
|
summary: string;
|
|
388
388
|
}>, "many">>;
|
|
389
389
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -406,8 +406,8 @@ export declare const VerificationEvidenceSchema: z.ZodObject<{
|
|
|
406
406
|
actual?: unknown;
|
|
407
407
|
}[];
|
|
408
408
|
timeline: {
|
|
409
|
-
kind: string;
|
|
410
409
|
at: number;
|
|
410
|
+
kind: string;
|
|
411
411
|
summary: string;
|
|
412
412
|
}[];
|
|
413
413
|
}, {
|
|
@@ -430,8 +430,8 @@ export declare const VerificationEvidenceSchema: z.ZodObject<{
|
|
|
430
430
|
actual?: unknown;
|
|
431
431
|
}[] | undefined;
|
|
432
432
|
timeline?: {
|
|
433
|
-
kind: string;
|
|
434
433
|
at: number;
|
|
434
|
+
kind: string;
|
|
435
435
|
summary: string;
|
|
436
436
|
}[] | undefined;
|
|
437
437
|
}>;
|
|
@@ -550,13 +550,13 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
550
550
|
previewUrl: z.ZodOptional<z.ZodString>;
|
|
551
551
|
}, "strip", z.ZodTypeAny, {
|
|
552
552
|
name: string;
|
|
553
|
-
framework: "
|
|
553
|
+
framework: "other" | "react" | "next" | "vite";
|
|
554
554
|
commit?: string | undefined;
|
|
555
555
|
env?: "local" | "preview" | "ci" | undefined;
|
|
556
556
|
previewUrl?: string | undefined;
|
|
557
557
|
}, {
|
|
558
558
|
name: string;
|
|
559
|
-
framework: "
|
|
559
|
+
framework: "other" | "react" | "next" | "vite";
|
|
560
560
|
commit?: string | undefined;
|
|
561
561
|
env?: "local" | "preview" | "ci" | undefined;
|
|
562
562
|
previewUrl?: string | undefined;
|
|
@@ -570,11 +570,11 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
570
570
|
}>;
|
|
571
571
|
model: z.ZodOptional<z.ZodString>;
|
|
572
572
|
}, "strip", z.ZodTypeAny, {
|
|
573
|
-
kind: "coding-agent" | "oem-pipeline"
|
|
573
|
+
kind: "human" | "coding-agent" | "oem-pipeline";
|
|
574
574
|
id: string;
|
|
575
575
|
model?: string | undefined;
|
|
576
576
|
}, {
|
|
577
|
-
kind: "coding-agent" | "oem-pipeline"
|
|
577
|
+
kind: "human" | "coding-agent" | "oem-pipeline";
|
|
578
578
|
id: string;
|
|
579
579
|
model?: string | undefined;
|
|
580
580
|
}>;
|
|
@@ -808,12 +808,12 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
808
808
|
kind: z.ZodString;
|
|
809
809
|
summary: z.ZodString;
|
|
810
810
|
}, "strip", z.ZodTypeAny, {
|
|
811
|
-
kind: string;
|
|
812
811
|
at: number;
|
|
812
|
+
kind: string;
|
|
813
813
|
summary: string;
|
|
814
814
|
}, {
|
|
815
|
-
kind: string;
|
|
816
815
|
at: number;
|
|
816
|
+
kind: string;
|
|
817
817
|
summary: string;
|
|
818
818
|
}>, "many">>;
|
|
819
819
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -836,8 +836,8 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
836
836
|
actual?: unknown;
|
|
837
837
|
}[];
|
|
838
838
|
timeline: {
|
|
839
|
-
kind: string;
|
|
840
839
|
at: number;
|
|
840
|
+
kind: string;
|
|
841
841
|
summary: string;
|
|
842
842
|
}[];
|
|
843
843
|
}, {
|
|
@@ -860,8 +860,8 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
860
860
|
actual?: unknown;
|
|
861
861
|
}[] | undefined;
|
|
862
862
|
timeline?: {
|
|
863
|
-
kind: string;
|
|
864
863
|
at: number;
|
|
864
|
+
kind: string;
|
|
865
865
|
summary: string;
|
|
866
866
|
}[] | undefined;
|
|
867
867
|
}>;
|
|
@@ -987,6 +987,18 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
987
987
|
evidenceRef?: string | undefined;
|
|
988
988
|
failureReason?: string | undefined;
|
|
989
989
|
}[];
|
|
990
|
+
agent: {
|
|
991
|
+
kind: "human" | "coding-agent" | "oem-pipeline";
|
|
992
|
+
id: string;
|
|
993
|
+
model?: string | undefined;
|
|
994
|
+
};
|
|
995
|
+
project: {
|
|
996
|
+
name: string;
|
|
997
|
+
framework: "other" | "react" | "next" | "vite";
|
|
998
|
+
commit?: string | undefined;
|
|
999
|
+
env?: "local" | "preview" | "ci" | undefined;
|
|
1000
|
+
previewUrl?: string | undefined;
|
|
1001
|
+
};
|
|
990
1002
|
durationMs: number;
|
|
991
1003
|
createdAt: number;
|
|
992
1004
|
evidence: {
|
|
@@ -1009,26 +1021,14 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
1009
1021
|
actual?: unknown;
|
|
1010
1022
|
}[];
|
|
1011
1023
|
timeline: {
|
|
1012
|
-
kind: string;
|
|
1013
1024
|
at: number;
|
|
1025
|
+
kind: string;
|
|
1014
1026
|
summary: string;
|
|
1015
1027
|
}[];
|
|
1016
1028
|
};
|
|
1017
1029
|
schemaVersion: 1;
|
|
1018
1030
|
runId: string & z.BRAND<"RunId">;
|
|
1019
1031
|
profile: "dev" | "prod-preview";
|
|
1020
|
-
project: {
|
|
1021
|
-
name: string;
|
|
1022
|
-
framework: "react" | "next" | "vite" | "other";
|
|
1023
|
-
commit?: string | undefined;
|
|
1024
|
-
env?: "local" | "preview" | "ci" | undefined;
|
|
1025
|
-
previewUrl?: string | undefined;
|
|
1026
|
-
};
|
|
1027
|
-
agent: {
|
|
1028
|
-
kind: "coding-agent" | "oem-pipeline" | "human";
|
|
1029
|
-
id: string;
|
|
1030
|
-
model?: string | undefined;
|
|
1031
|
-
};
|
|
1032
1032
|
trigger: {
|
|
1033
1033
|
kind: "manual" | "edit" | "ci" | "oem";
|
|
1034
1034
|
note?: string | undefined;
|
|
@@ -1082,6 +1082,18 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
1082
1082
|
signedAt: number;
|
|
1083
1083
|
} | undefined;
|
|
1084
1084
|
}, {
|
|
1085
|
+
agent: {
|
|
1086
|
+
kind: "human" | "coding-agent" | "oem-pipeline";
|
|
1087
|
+
id: string;
|
|
1088
|
+
model?: string | undefined;
|
|
1089
|
+
};
|
|
1090
|
+
project: {
|
|
1091
|
+
name: string;
|
|
1092
|
+
framework: "other" | "react" | "next" | "vite";
|
|
1093
|
+
commit?: string | undefined;
|
|
1094
|
+
env?: "local" | "preview" | "ci" | undefined;
|
|
1095
|
+
previewUrl?: string | undefined;
|
|
1096
|
+
};
|
|
1085
1097
|
durationMs: number;
|
|
1086
1098
|
createdAt: number;
|
|
1087
1099
|
evidence: {
|
|
@@ -1104,26 +1116,14 @@ export declare const ReticleVerificationRunSchema: z.ZodObject<{
|
|
|
1104
1116
|
actual?: unknown;
|
|
1105
1117
|
}[] | undefined;
|
|
1106
1118
|
timeline?: {
|
|
1107
|
-
kind: string;
|
|
1108
1119
|
at: number;
|
|
1120
|
+
kind: string;
|
|
1109
1121
|
summary: string;
|
|
1110
1122
|
}[] | undefined;
|
|
1111
1123
|
};
|
|
1112
1124
|
schemaVersion: 1;
|
|
1113
1125
|
runId: string;
|
|
1114
1126
|
profile: "dev" | "prod-preview";
|
|
1115
|
-
project: {
|
|
1116
|
-
name: string;
|
|
1117
|
-
framework: "react" | "next" | "vite" | "other";
|
|
1118
|
-
commit?: string | undefined;
|
|
1119
|
-
env?: "local" | "preview" | "ci" | undefined;
|
|
1120
|
-
previewUrl?: string | undefined;
|
|
1121
|
-
};
|
|
1122
|
-
agent: {
|
|
1123
|
-
kind: "coding-agent" | "oem-pipeline" | "human";
|
|
1124
|
-
id: string;
|
|
1125
|
-
model?: string | undefined;
|
|
1126
|
-
};
|
|
1127
1127
|
trigger: {
|
|
1128
1128
|
kind: "manual" | "edit" | "ci" | "oem";
|
|
1129
1129
|
note?: string | undefined;
|
|
@@ -21,6 +21,43 @@ export declare const Verified: {
|
|
|
21
21
|
readonly UNKNOWN: "unknown";
|
|
22
22
|
};
|
|
23
23
|
export type Verified = (typeof Verified)[keyof typeof Verified];
|
|
24
|
+
/**
|
|
25
|
+
* WHY a verdict came out the way it did — the deciding clause of the rule, named.
|
|
26
|
+
*
|
|
27
|
+
* `Verified` has three values and the rule has ten clauses, so the wire collapsed opposite facts
|
|
28
|
+
* into one string. Measured over a real session: `unknown` covered "the agent malformed the call",
|
|
29
|
+
* "the app answered 202 and has not finished", and "Reticle could not see the capture" — three
|
|
30
|
+
* owners needing three opposite responses, one bar on a dashboard. `no` was no better: "channels
|
|
31
|
+
* disagree" (Reticle earning its keep) and "the agent's predicate failed" read identically.
|
|
32
|
+
*
|
|
33
|
+
* This is the SINGLE list. `decideVerified` returns a member from each clause, and the telemetry
|
|
34
|
+
* schema narrows to `z.nativeEnum` of this — so a new clause cannot ship without a member here, and
|
|
35
|
+
* a member cannot exist without a clause producing it (`verified.test.ts` asserts the two sets are
|
|
36
|
+
* equal). Nothing anywhere re-lists these.
|
|
37
|
+
*/
|
|
38
|
+
export declare const VerifiedReason: {
|
|
39
|
+
/** The assertion was never EVALUATED — under-specified call, or nothing instrumented to read. */
|
|
40
|
+
readonly INCONCLUSIVE: "inconclusive";
|
|
41
|
+
/** The declared consequence did not hold. */
|
|
42
|
+
readonly ASSERTION_FAILED: "assertion_failed";
|
|
43
|
+
/** Channels disagreed about the action — the false green this product exists to catch. */
|
|
44
|
+
readonly CONTRADICTED: "contradicted";
|
|
45
|
+
/** The consequence was already true beforehand, so it proves nothing about the action. */
|
|
46
|
+
readonly ALREADY_TRUE: "already_true";
|
|
47
|
+
/** The capture was not clean, so a green would only describe what happened to be observed. */
|
|
48
|
+
readonly UNCLEAN_CAPTURE: "unclean_capture";
|
|
49
|
+
/** Nothing was asserted at a real grade — the assertion could not have failed. */
|
|
50
|
+
readonly VACUOUS_GRADE: "vacuous_grade";
|
|
51
|
+
/** A write answered 202 Accepted: the outcome does not exist yet. */
|
|
52
|
+
readonly OUTCOME_PENDING: "outcome_pending";
|
|
53
|
+
/** A 2xx whose body was never recorded, so the one channel that could disagree was closed. */
|
|
54
|
+
readonly OUTCOME_UNREAD: "outcome_unread";
|
|
55
|
+
/** The page never settled, so the reaction window may have closed early. */
|
|
56
|
+
readonly UNSETTLED: "unsettled";
|
|
57
|
+
/** Held at a real grade over a clean capture with no channel disagreeing. */
|
|
58
|
+
readonly PROVED: "proved";
|
|
59
|
+
};
|
|
60
|
+
export type VerifiedReason = (typeof VerifiedReason)[keyof typeof VerifiedReason];
|
|
24
61
|
/**
|
|
25
62
|
* Actionable companion to NO_PROVIDER for the tools that genuinely intercept or capture through CDP
|
|
26
63
|
* — network mocking and viewport control — which is NOT "visual capture".
|
|
@@ -20,6 +20,42 @@ export const Verified = {
|
|
|
20
20
|
/** Not determinable from this evidence — vacuous grade, dirty capture, or never settled. */
|
|
21
21
|
UNKNOWN: 'unknown',
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* WHY a verdict came out the way it did — the deciding clause of the rule, named.
|
|
25
|
+
*
|
|
26
|
+
* `Verified` has three values and the rule has ten clauses, so the wire collapsed opposite facts
|
|
27
|
+
* into one string. Measured over a real session: `unknown` covered "the agent malformed the call",
|
|
28
|
+
* "the app answered 202 and has not finished", and "Reticle could not see the capture" — three
|
|
29
|
+
* owners needing three opposite responses, one bar on a dashboard. `no` was no better: "channels
|
|
30
|
+
* disagree" (Reticle earning its keep) and "the agent's predicate failed" read identically.
|
|
31
|
+
*
|
|
32
|
+
* This is the SINGLE list. `decideVerified` returns a member from each clause, and the telemetry
|
|
33
|
+
* schema narrows to `z.nativeEnum` of this — so a new clause cannot ship without a member here, and
|
|
34
|
+
* a member cannot exist without a clause producing it (`verified.test.ts` asserts the two sets are
|
|
35
|
+
* equal). Nothing anywhere re-lists these.
|
|
36
|
+
*/
|
|
37
|
+
export const VerifiedReason = {
|
|
38
|
+
/** The assertion was never EVALUATED — under-specified call, or nothing instrumented to read. */
|
|
39
|
+
INCONCLUSIVE: 'inconclusive',
|
|
40
|
+
/** The declared consequence did not hold. */
|
|
41
|
+
ASSERTION_FAILED: 'assertion_failed',
|
|
42
|
+
/** Channels disagreed about the action — the false green this product exists to catch. */
|
|
43
|
+
CONTRADICTED: 'contradicted',
|
|
44
|
+
/** The consequence was already true beforehand, so it proves nothing about the action. */
|
|
45
|
+
ALREADY_TRUE: 'already_true',
|
|
46
|
+
/** The capture was not clean, so a green would only describe what happened to be observed. */
|
|
47
|
+
UNCLEAN_CAPTURE: 'unclean_capture',
|
|
48
|
+
/** Nothing was asserted at a real grade — the assertion could not have failed. */
|
|
49
|
+
VACUOUS_GRADE: 'vacuous_grade',
|
|
50
|
+
/** A write answered 202 Accepted: the outcome does not exist yet. */
|
|
51
|
+
OUTCOME_PENDING: 'outcome_pending',
|
|
52
|
+
/** A 2xx whose body was never recorded, so the one channel that could disagree was closed. */
|
|
53
|
+
OUTCOME_UNREAD: 'outcome_unread',
|
|
54
|
+
/** The page never settled, so the reaction window may have closed early. */
|
|
55
|
+
UNSETTLED: 'unsettled',
|
|
56
|
+
/** Held at a real grade over a clean capture with no channel disagreeing. */
|
|
57
|
+
PROVED: 'proved',
|
|
58
|
+
};
|
|
23
59
|
/**
|
|
24
60
|
* Actionable companion to NO_PROVIDER for the tools that genuinely intercept or capture through CDP
|
|
25
61
|
* — network mocking and viewport control — which is NOT "visual capture".
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reticlehq/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "The Reticle foundation: the shared wire contract — types, zod schemas, constants, messages, and the isomorphic kernel that every Reticle package (browser SDK, server, kits, test harness) imports. Depends only on zod.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"./desktop-contract": {
|
|
15
15
|
"types": "./dist/desktop-contract.d.cts",
|
|
16
16
|
"default": "./dist/desktop-contract.cjs"
|
|
17
|
-
}
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"zod": "^3.24.1"
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"build": "tsc -b && node scripts/gen-schema.mjs && node scripts/gen-desktop-contract.mjs",
|
|
55
56
|
"typecheck": "tsc -b",
|
|
56
57
|
"lint": "eslint src",
|
|
57
|
-
"test:unit": "vitest run src --passWithNoTests"
|
|
58
|
+
"test:unit": "vitest run src --passWithNoTests",
|
|
59
|
+
"test:coverage": "vitest run src --passWithNoTests --coverage.enabled --coverage.provider=v8 --coverage.reporter=text-summary --coverage.include='src/**/*.ts' --coverage.exclude='src/**/*.test.ts'"
|
|
58
60
|
}
|
|
59
61
|
}
|