@reticlehq/core 2.14.0 → 3.2.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/{artifacts-entry.d.ts → artifacts/artifacts-entry.d.ts} +7 -7
- package/dist/{artifacts-entry.js → artifacts/artifacts-entry.js} +7 -7
- package/dist/artifacts/flow-composition.d.ts +30 -0
- package/dist/artifacts/flow-composition.js +19 -0
- package/dist/{flow-constants.d.ts → artifacts/flow-constants.d.ts} +99 -3
- package/dist/{flow-constants.js → artifacts/flow-constants.js} +108 -4
- package/dist/artifacts/flow-mutation-target.d.ts +39 -0
- package/dist/artifacts/flow-mutation-target.js +89 -0
- package/dist/artifacts/flow-order.d.ts +30 -0
- package/dist/artifacts/flow-order.js +49 -0
- package/dist/artifacts/flow-select.d.ts +56 -0
- package/dist/artifacts/flow-select.js +56 -0
- package/dist/artifacts/flow-step-tool.d.ts +31 -0
- package/dist/artifacts/flow-step-tool.js +31 -0
- package/dist/artifacts/flow-types.d.ts +3736 -0
- package/dist/artifacts/flow-types.js +463 -0
- package/dist/artifacts/flow-unreached.d.ts +12 -0
- package/dist/artifacts/flow-unreached.js +24 -0
- package/dist/{impact.d.ts → artifacts/impact.d.ts} +271 -103
- package/dist/{impact.js → artifacts/impact.js} +75 -5
- package/dist/artifacts/journal.d.ts +218 -0
- package/dist/artifacts/journal.js +130 -0
- package/dist/artifacts/step-effect.d.ts +29 -0
- package/dist/artifacts/step-effect.js +28 -0
- package/dist/hooks/hook-events.d.ts +311 -0
- package/dist/hooks/hook-events.js +127 -0
- package/dist/hooks/hooks-entry.d.ts +9 -0
- package/dist/hooks/hooks-entry.js +9 -0
- package/dist/identity/brand.d.ts +102 -0
- package/dist/{brand.js → identity/brand.js} +7 -0
- package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
- package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
- package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
- package/dist/{document-identity.js → identity/document-identity.js} +4 -5
- package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
- package/dist/{source-constants.js → identity/source-constants.js} +4 -4
- package/dist/index.d.ts +57 -43
- package/dist/index.js +66 -45
- package/dist/onboarding.d.ts +114 -0
- package/dist/onboarding.js +141 -0
- package/dist/realm/registry.d.ts +212 -0
- package/dist/realm/registry.js +302 -0
- package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +6 -7
- package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
- package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
- package/dist/{project-registry.js → registry/project-registry.js} +5 -5
- package/dist/schema/command-name.json +31 -0
- package/dist/schema/event-payloads.json +795 -0
- package/dist/schema/hello-message.json +70 -2
- package/dist/schema/reticle-message.json +70 -2
- package/dist/telemetry-entry.d.ts +1 -1
- package/dist/telemetry-entry.js +1 -1
- package/dist/telemetry-feedback.d.ts +15 -16
- package/dist/telemetry-feedback.js +11 -12
- package/dist/telemetry-license.d.ts +1 -1
- package/dist/telemetry-license.js +1 -1
- package/dist/telemetry-refusal.d.ts +11 -11
- package/dist/telemetry-refusal.js +7 -8
- package/dist/telemetry-session.d.ts +51 -59
- package/dist/telemetry-session.js +47 -55
- package/dist/telemetry.d.ts +306 -222
- package/dist/telemetry.js +112 -99
- package/dist/tour-entry.d.ts +10 -0
- package/dist/tour-entry.js +10 -0
- package/dist/tour.d.ts +125 -0
- package/dist/tour.js +165 -0
- package/dist/{consequence.d.ts → verdict/consequence.d.ts} +32 -15
- package/dist/{consequence.js → verdict/consequence.js} +9 -31
- package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
- package/dist/{findings.d.ts → verdict/findings.d.ts} +86 -39
- package/dist/{findings.js → verdict/findings.js} +103 -49
- package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +7 -14
- package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +7 -15
- package/dist/{intent.d.ts → verdict/intent.d.ts} +35 -46
- package/dist/{intent.js → verdict/intent.js} +11 -22
- package/dist/verdict/revision.d.ts +44 -0
- package/dist/verdict/revision.js +53 -0
- package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
- package/dist/{run-context.js → verdict/run-context.js} +15 -36
- package/dist/{security.js → verdict/security.js} +12 -21
- package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +381 -105
- package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
- package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +34 -13
- package/dist/{verified-constants.js → verdict/verified-constants.js} +34 -13
- package/dist/{verify-progress.d.ts → verdict/verify-progress.d.ts} +18 -22
- package/dist/{verify-progress.js → verdict/verify-progress.js} +6 -10
- package/dist/wire/channel.d.ts +46 -0
- package/dist/wire/channel.js +95 -0
- package/dist/{constants.d.ts → wire/constants/constants.d.ts} +179 -28
- package/dist/{constants.js → wire/constants/constants.js} +199 -28
- package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +23 -2
- package/dist/{session-constants.js → wire/constants/session-constants.js} +23 -2
- package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
- package/dist/{event-classification.js → wire/event-classification.js} +1 -1
- package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +72 -13
- package/dist/{event-payloads.js → wire/event-payloads.js} +23 -3
- package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
- package/dist/{event-priority.js → wire/event-priority.js} +2 -5
- package/dist/{global-press.js → wire/global-press.js} +1 -1
- package/dist/{messages.d.ts → wire/messages.d.ts} +240 -48
- package/dist/{messages.js → wire/messages.js} +68 -5
- package/dist/wire/narrow.d.ts +39 -0
- package/dist/wire/narrow.js +45 -0
- package/dist/{net.d.ts → wire/net.d.ts} +36 -13
- package/dist/{net.js → wire/net.js} +36 -13
- package/dist/wire/platform.d.ts +37 -0
- package/dist/wire/platform.js +36 -0
- package/dist/{redaction.js → wire/redaction.js} +12 -12
- package/dist/wire/snapshot-tree.d.ts +33 -0
- package/dist/wire/snapshot-tree.js +43 -0
- package/dist/wire/tool-names.d.ts +133 -0
- package/dist/wire/tool-names.js +142 -0
- package/dist/{toon.js → wire/toon.js} +1 -1
- package/dist/{types.d.ts → wire/types.d.ts} +77 -76
- package/dist/{types.js → wire/types.js} +4 -3
- package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
- package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
- package/dist/{notices.d.ts → words/notices.d.ts} +8 -12
- package/dist/{notices.js → words/notices.js} +8 -12
- package/package.json +16 -7
- package/dist/brand.d.ts +0 -49
- package/dist/flow-types.d.ts +0 -1711
- package/dist/flow-types.js +0 -247
- package/dist/journal.d.ts +0 -122
- package/dist/journal.js +0 -57
- package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +0 -0
- package/dist/{impact-savings.js → artifacts/impact-savings.js} +0 -0
- package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
- package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
- package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
- package/dist/{project-id.js → identity/project-id.js} +0 -0
- package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
- package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
- package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
- package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
- package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
- package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
- package/dist/{global-press.d.ts → wire/global-press.d.ts} +0 -0
- package/dist/{redaction.d.ts → wire/redaction.d.ts} +0 -0
- package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
- package/dist/{state-select.js → wire/state-select.js} +0 -0
- package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
- package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
- package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
- package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
- package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
- package/dist/{upgrade.d.ts → words/upgrade.d.ts} +2 -2
- /package/dist/{upgrade.js → words/upgrade.js} +0 -0
package/dist/flow-types.js
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { ActionType, AnchorKind, FLOW_FILE_VERSION, } from './constants.js';
|
|
3
|
-
/**
|
|
4
|
-
* The MCP tool names that can appear as a recorded flow step's `tool`. These are the ONLY tool names
|
|
5
|
-
* that cross the wire into a persisted flow file — the browser recorder stamps them, the server replays
|
|
6
|
-
* them, and FlowStep types them — so they live in core, the wire contract. The full agent-facing tool
|
|
7
|
-
* surface stays server-side (ReticleTool); ReticleTool references THESE for the flow-persisted three, so
|
|
8
|
-
* there is one source of truth and a rename cannot silently desync the recorder from the replayer (a
|
|
9
|
-
* tool rename once killed four e2e specs — this closes the browser/server half of that drift).
|
|
10
|
-
*/
|
|
11
|
-
export const FlowStepTool = {
|
|
12
|
-
ACT: 'reticle_act',
|
|
13
|
-
ACT_SEQUENCE: 'reticle_act_sequence',
|
|
14
|
-
ACT_AND_WAIT: 'reticle_act_and_wait',
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* A semantic anchor: how a step re-finds its element/event at replay
|
|
18
|
-
* time. Never a volatile eXX ref. testid/role+name bind a DOM element; signal binds an event.
|
|
19
|
-
*/
|
|
20
|
-
export const FlowAnchorSchema = z.discriminatedUnion('kind', [
|
|
21
|
-
// `source` is provenance, not part of how the step re-finds its element — the testid does that.
|
|
22
|
-
// It rides along so a failure can say which file to open; optional, so existing flow files parse
|
|
23
|
-
// unchanged and FLOW_FILE_VERSION does not move.
|
|
24
|
-
z.object({
|
|
25
|
-
kind: z.literal(AnchorKind.TESTID),
|
|
26
|
-
value: z.string().min(1),
|
|
27
|
-
source: z
|
|
28
|
-
.object({ file: z.string(), line: z.number(), column: z.number().optional() })
|
|
29
|
-
.optional(),
|
|
30
|
-
}),
|
|
31
|
-
z.object({
|
|
32
|
-
kind: z.literal(AnchorKind.ROLE),
|
|
33
|
-
role: z.string().min(1),
|
|
34
|
-
name: z.string().optional(),
|
|
35
|
-
}),
|
|
36
|
-
z.object({ kind: z.literal(AnchorKind.SIGNAL), name: z.string().min(1) }),
|
|
37
|
-
// Auto-anchor: re-find an element by component identity / source location when it has no testid.
|
|
38
|
-
// component or source carries the durable signal; role/name are disambiguating extras.
|
|
39
|
-
z.object({
|
|
40
|
-
kind: z.literal(AnchorKind.COMPONENT),
|
|
41
|
-
component: z.string().optional(),
|
|
42
|
-
source: z
|
|
43
|
-
.object({ file: z.string(), line: z.number(), column: z.number().optional() })
|
|
44
|
-
.optional(),
|
|
45
|
-
role: z.string().optional(),
|
|
46
|
-
name: z.string().optional(),
|
|
47
|
-
}),
|
|
48
|
-
]);
|
|
49
|
-
/**
|
|
50
|
-
* A post-condition a step asserts (compiled from a structured annotation; optional).
|
|
51
|
-
*
|
|
52
|
-
* Strict, at every nesting level: an unrecognized key (a typo, or a predicate kind this schema
|
|
53
|
-
* doesn't model, e.g. `allOf`, or a typo'd `net`/`console`/`element`/`state` sub-field) must fail
|
|
54
|
-
* to parse instead of being silently dropped. A loose z.object() here would quietly discard the
|
|
55
|
-
* extra key and leave the step with a weaker (or empty) assertion than its author wrote — the
|
|
56
|
-
* flow then replays green against nothing, having proved no real regression.
|
|
57
|
-
*/
|
|
58
|
-
export const FlowExpectSchema = z
|
|
59
|
-
.object({
|
|
60
|
-
signal: z.string().optional(),
|
|
61
|
-
/**
|
|
62
|
-
* Optional payload shape an `assert-signal` annotation requires the signal
|
|
63
|
-
* to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
|
|
64
|
-
* bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
65
|
-
*/
|
|
66
|
-
signalData: z.record(z.unknown()).optional(),
|
|
67
|
-
/**
|
|
68
|
-
* Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
|
|
69
|
-
* only way a saved flow can keep a cardinality the agent actually asserted. Without it a
|
|
70
|
-
* `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
|
|
71
|
-
* one made: the replayed flow then goes green on the double-fire it was recorded to catch.
|
|
72
|
-
* Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
|
|
73
|
-
*/
|
|
74
|
-
signalCount: z.number().int().nonnegative().optional(),
|
|
75
|
-
net: z
|
|
76
|
-
.object({
|
|
77
|
-
method: z.string().optional(),
|
|
78
|
-
urlContains: z.string().optional(),
|
|
79
|
-
status: z.number().optional(),
|
|
80
|
-
/**
|
|
81
|
-
* Exact number of matching requests since the action — turns presence into a cardinality
|
|
82
|
-
* assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
|
|
83
|
-
* the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
|
|
84
|
-
*/
|
|
85
|
-
count: z.number().int().nonnegative().optional(),
|
|
86
|
-
})
|
|
87
|
-
.strict()
|
|
88
|
-
.optional(),
|
|
89
|
-
/**
|
|
90
|
-
* Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
|
|
91
|
-
* console message at `level` (default 'error'). `absent:true` is the common case — "the action
|
|
92
|
-
* completed with a clean console" — catching the regression where an action throws a caught error
|
|
93
|
-
* / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
|
|
94
|
-
*/
|
|
95
|
-
console: z
|
|
96
|
-
.object({
|
|
97
|
-
level: z.string().optional(),
|
|
98
|
-
absent: z.boolean().optional(),
|
|
99
|
-
})
|
|
100
|
-
.strict()
|
|
101
|
-
.optional(),
|
|
102
|
-
element: z
|
|
103
|
-
.object({
|
|
104
|
-
testid: z.string().optional(),
|
|
105
|
-
role: z.string().optional(),
|
|
106
|
-
name: z.string().optional(),
|
|
107
|
-
})
|
|
108
|
-
.strict()
|
|
109
|
-
.optional(),
|
|
110
|
-
/**
|
|
111
|
-
* Rendered text as an end-condition, using the shapes the assert surface already accepts.
|
|
112
|
-
*
|
|
113
|
-
* The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
|
|
114
|
-
* network call on the interaction under test -- a discount price computed and rendered, a
|
|
115
|
-
* formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
|
|
116
|
-
* vocabulary offered needed a channel that app does not have, so the only honest outcome was
|
|
117
|
-
* `assertion-free`, which is a permanent green (#811).
|
|
118
|
-
*
|
|
119
|
-
* Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
|
|
120
|
-
* that could not be pinned.
|
|
121
|
-
*
|
|
122
|
-
* Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
|
|
123
|
-
* DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
|
|
124
|
-
* which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
|
|
125
|
-
*/
|
|
126
|
-
text: z
|
|
127
|
-
.object({
|
|
128
|
-
contains: z.string().min(1),
|
|
129
|
-
/** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
|
|
130
|
-
scope: z.string().optional(),
|
|
131
|
-
/** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
|
|
132
|
-
absent: z.boolean().optional(),
|
|
133
|
-
/** Require the match to be visible, not merely present in the DOM. */
|
|
134
|
-
visible: z.boolean().optional(),
|
|
135
|
-
})
|
|
136
|
-
.strict()
|
|
137
|
-
.optional(),
|
|
138
|
-
/**
|
|
139
|
-
* Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
|
|
140
|
-
* to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
|
|
141
|
-
* and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
|
|
142
|
-
* or a `{ $gte | $contains | $length }` operator pattern.
|
|
143
|
-
*/
|
|
144
|
-
state: z
|
|
145
|
-
.object({
|
|
146
|
-
store: z.string().optional(),
|
|
147
|
-
path: z.string(),
|
|
148
|
-
equals: z.unknown().optional(),
|
|
149
|
-
/**
|
|
150
|
-
* Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
|
|
151
|
-
* condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
|
|
152
|
-
* moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
|
|
153
|
-
*/
|
|
154
|
-
hold: z.boolean().optional(),
|
|
155
|
-
})
|
|
156
|
-
.strict()
|
|
157
|
-
.optional(),
|
|
158
|
-
})
|
|
159
|
-
.strict();
|
|
160
|
-
const baseFlowStep = z.object({
|
|
161
|
-
tool: z.string(),
|
|
162
|
-
anchor: FlowAnchorSchema,
|
|
163
|
-
action: z.nativeEnum(ActionType).optional(),
|
|
164
|
-
args: z.record(z.unknown()).optional(),
|
|
165
|
-
expect: FlowExpectSchema.optional(),
|
|
166
|
-
degraded: z.boolean().optional(),
|
|
167
|
-
timeoutMs: z.number().int().positive().optional(),
|
|
168
|
-
});
|
|
169
|
-
export const FlowStepSchema = baseFlowStep.extend({
|
|
170
|
-
steps: z.lazy(() => z.array(FlowStepSchema).optional()),
|
|
171
|
-
});
|
|
172
|
-
/**
|
|
173
|
-
* The on-disk flow file: diffable, git-tracked, anchor-resolved.
|
|
174
|
-
* The optional `dynamic` field (both `dynamic` + `success` are optional, so a
|
|
175
|
-
* file with neither still parses — back-compat is locked by a test).
|
|
176
|
-
*/
|
|
177
|
-
export const FlowFileSchema = z.object({
|
|
178
|
-
version: z.literal(FLOW_FILE_VERSION),
|
|
179
|
-
name: z.string(),
|
|
180
|
-
/**
|
|
181
|
-
* The business goal this flow exists to verify, one line (e.g. "ship a deploy to production").
|
|
182
|
-
* Optional + back-compat (a flow without it still parses). Set via an `intent` annotation. The
|
|
183
|
-
* point of "intent + outcome oracle": a flow that declares an intent should also assert an
|
|
184
|
-
* observable business OUTCOME (a consequence success-state), or it claims to verify a goal it
|
|
185
|
-
* cannot actually check — flow-classify flags that gap.
|
|
186
|
-
*/
|
|
187
|
-
intent: z.string().optional(),
|
|
188
|
-
/**
|
|
189
|
-
* The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
|
|
190
|
-
*
|
|
191
|
-
* `intent` above is the prose a recorder captured; this is the LINK to the ledger that already
|
|
192
|
-
* models declared → bound → proved and records which verdict discharged what. Without it there
|
|
193
|
-
* would be two ways to say what a change is for, which is the defect this codebase keeps paying
|
|
194
|
-
* for: a flow's goal and an intent's statement would drift apart with nothing to reconcile them.
|
|
195
|
-
*
|
|
196
|
-
* Set at save time from the flow's own prose, or written by hand to point a flow at an intent
|
|
197
|
-
* declared earlier via `reticle_intent` — a flow can prove something somebody else declared.
|
|
198
|
-
* Optional + back-compat: a flow without it replays exactly as before, and the on-disk version
|
|
199
|
-
* stays FLOW_FILE_VERSION 1.
|
|
200
|
-
*/
|
|
201
|
-
intentId: z.string().optional(),
|
|
202
|
-
/**
|
|
203
|
-
* The project the flow was recorded against (the connecting session's HELLO `projectId`), stamped at
|
|
204
|
-
* save time. Scopes a flow to its app so a shared daemon's HUD lists only the current project's flows
|
|
205
|
-
* instead of every project that ever saved to that daemon. Optional + back-compat: a flow with no
|
|
206
|
-
* projectId is treated as global (visible everywhere), so pre-existing files parse and still show.
|
|
207
|
-
*/
|
|
208
|
-
projectId: z.string().optional(),
|
|
209
|
-
/**
|
|
210
|
-
* The route (pathname) the journey started on, captured at record time. Replay navigates here
|
|
211
|
-
* before step 1 so a flow whose first anchor lives on another page doesn't drift on step 1 ("a
|
|
212
|
-
* step no longer matches") just because replay began on the wrong page. Optional + back-compat: a
|
|
213
|
-
* flow without it (or recorded before this shipped) replays from the current page as before, and
|
|
214
|
-
* the on-disk version stays FLOW_FILE_VERSION 1.
|
|
215
|
-
*/
|
|
216
|
-
startPath: z.string().optional(),
|
|
217
|
-
// FUTURE: fixtures/preconditions — schema slot reserved, unpopulated this cut. The recorder
|
|
218
|
-
// never writes it and no fixture runner exists.
|
|
219
|
-
fixture: z.string().optional(),
|
|
220
|
-
/** From the injected clock (ms) — deterministic in tests, byte-stable on disk. */
|
|
221
|
-
createdAt: z.number(),
|
|
222
|
-
steps: z.array(FlowStepSchema),
|
|
223
|
-
/**
|
|
224
|
-
* How long every step of this flow waits for its declared consequence, in ms. A step's own
|
|
225
|
-
* `timeoutMs` wins over it; absent both, FLOW_SIGNAL_TIMEOUT_MS applies.
|
|
226
|
-
*
|
|
227
|
-
* Flow-level because slowness is usually a property of the APP, not of one control — a remote
|
|
228
|
-
* database, a model-backed endpoint, a cold container. Optional + back-compat: a flow without it
|
|
229
|
-
* replays exactly as before and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
230
|
-
*/
|
|
231
|
-
signalTimeoutMs: z.number().int().positive().optional(),
|
|
232
|
-
success: FlowExpectSchema.optional(),
|
|
233
|
-
/**
|
|
234
|
-
* Anchors whose CONTENT must not be asserted (e.g. LLM output). Replay asserts
|
|
235
|
-
* presence, not words. Compiled from a `mark-dynamic` annotation.
|
|
236
|
-
*/
|
|
237
|
-
dynamic: z.array(FlowAnchorSchema).optional(),
|
|
238
|
-
});
|
|
239
|
-
/**
|
|
240
|
-
* The in-page → wire payload for a finished human recording. The browser
|
|
241
|
-
* compiles captured interactions into a FlowFile-shaped object (resolving semantic anchors at
|
|
242
|
-
* capture time) and emits it as ONE EventType.FLOW_RECORDED event; the server persists it.
|
|
243
|
-
*/
|
|
244
|
-
export const RecordedFlowSchema = z.object({
|
|
245
|
-
name: z.string(),
|
|
246
|
-
flow: FlowFileSchema,
|
|
247
|
-
});
|
package/dist/journal.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* The durable causal journal. Each session gets an append-only pair on disk:
|
|
4
|
-
* `.reticle/sessions/<id>/events.jsonl` (one `ReticleEvent` per line — already seq/actionId-stamped
|
|
5
|
-
* and browser-edge-redacted) and `actions.jsonl` (one JournalAction per line). The ring buffer becomes
|
|
6
|
-
* a hot cache over this ledger, so evidence survives eviction. Local-only; JSONL is versioned per line
|
|
7
|
-
* so a schema bump never orphans an old file.
|
|
8
|
-
*/
|
|
9
|
-
/** Per-record schema version. JSONL is line-addressable, so versioning rides each record, not a header. */
|
|
10
|
-
export declare const JOURNAL_FILE_VERSION = 1;
|
|
11
|
-
/**
|
|
12
|
-
* An action entity — every act/navigate the server dispatches. `seqRange`/`tRange` are the window used
|
|
13
|
-
* to attribute events to this action (`attribution:"window"`); `effect` is a bounded summary of what
|
|
14
|
-
* the tool returned. Args are already edge-redacted by the browser before they reach here.
|
|
15
|
-
*/
|
|
16
|
-
export declare const JournalActionSchema: z.ZodObject<{
|
|
17
|
-
v: z.ZodLiteral<1>;
|
|
18
|
-
/** The command correlation id (`c<n>`) — the natural, cross-side-stable action identity. */
|
|
19
|
-
actionId: z.ZodString;
|
|
20
|
-
/** The MCP tool / command name that drove it (e.g. "reticle_act"). */
|
|
21
|
-
tool: z.ZodString;
|
|
22
|
-
/** Redacted invocation args. */
|
|
23
|
-
args: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
24
|
-
/** Bounded effect summary (settle glyph, target, etc.). Kept open; narrowed by the writer. */
|
|
25
|
-
effect: z.ZodOptional<z.ZodUnknown>;
|
|
26
|
-
/** Whether the page settled within budget after the action, when known. */
|
|
27
|
-
settled: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
-
/** Time from dispatch to settle in ms, when known. */
|
|
29
|
-
settledInMs: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
/** Inclusive seq range of events attributed to this action, when any were observed. */
|
|
31
|
-
seqRange: z.ZodOptional<z.ZodObject<{
|
|
32
|
-
from: z.ZodNumber;
|
|
33
|
-
to: z.ZodNumber;
|
|
34
|
-
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
from: number;
|
|
36
|
-
to: number;
|
|
37
|
-
}, {
|
|
38
|
-
from: number;
|
|
39
|
-
to: number;
|
|
40
|
-
}>>;
|
|
41
|
-
/** Elapsed-ms window [dispatch, resolve] used for window attribution. */
|
|
42
|
-
tRange: z.ZodObject<{
|
|
43
|
-
from: z.ZodNumber;
|
|
44
|
-
to: z.ZodNumber;
|
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
from: number;
|
|
47
|
-
to: number;
|
|
48
|
-
}, {
|
|
49
|
-
from: number;
|
|
50
|
-
to: number;
|
|
51
|
-
}>;
|
|
52
|
-
/** Elapsed-ms timestamp the action was recorded at (clock injected by the writer). */
|
|
53
|
-
at: z.ZodNumber;
|
|
54
|
-
}, "strip", z.ZodTypeAny, {
|
|
55
|
-
at: number;
|
|
56
|
-
v: 1;
|
|
57
|
-
actionId: string;
|
|
58
|
-
tool: string;
|
|
59
|
-
args: Record<string, unknown>;
|
|
60
|
-
tRange: {
|
|
61
|
-
from: number;
|
|
62
|
-
to: number;
|
|
63
|
-
};
|
|
64
|
-
effect?: unknown;
|
|
65
|
-
settled?: boolean | undefined;
|
|
66
|
-
settledInMs?: number | undefined;
|
|
67
|
-
seqRange?: {
|
|
68
|
-
from: number;
|
|
69
|
-
to: number;
|
|
70
|
-
} | undefined;
|
|
71
|
-
}, {
|
|
72
|
-
at: number;
|
|
73
|
-
v: 1;
|
|
74
|
-
actionId: string;
|
|
75
|
-
tool: string;
|
|
76
|
-
tRange: {
|
|
77
|
-
from: number;
|
|
78
|
-
to: number;
|
|
79
|
-
};
|
|
80
|
-
args?: Record<string, unknown> | undefined;
|
|
81
|
-
effect?: unknown;
|
|
82
|
-
settled?: boolean | undefined;
|
|
83
|
-
settledInMs?: number | undefined;
|
|
84
|
-
seqRange?: {
|
|
85
|
-
from: number;
|
|
86
|
-
to: number;
|
|
87
|
-
} | undefined;
|
|
88
|
-
}>;
|
|
89
|
-
export type JournalAction = z.infer<typeof JournalActionSchema>;
|
|
90
|
-
/**
|
|
91
|
-
* The bounded verdict summary a verification tool writes into a journal action's `effect`.
|
|
92
|
-
*
|
|
93
|
-
* `effect` is deliberately open (`unknown`) and narrowed by its writer; this is that narrowing for
|
|
94
|
-
* the one writer whose record has to be READ back later. Without it a verdict lives only in the tool
|
|
95
|
-
* response, which is exactly the place that disappears when an agent compacts, so "what did this run
|
|
96
|
-
* already prove" would have no ledger to fold and the answer would be silently empty.
|
|
97
|
-
*
|
|
98
|
-
* Three fields and no more: the claim the verdict was about, how it came out, and where in the
|
|
99
|
-
* source it pointed. A transcript here would grow the journal without making the answer better.
|
|
100
|
-
*/
|
|
101
|
-
export declare const JournalVerdictEffectSchema: z.ZodObject<{
|
|
102
|
-
/** What was claimed, in the caller's own words — the subject a later proof supersedes. */
|
|
103
|
-
claim: z.ZodString;
|
|
104
|
-
/** The verdict, as the one field an agent reads. The enum, never a re-typed copy of it. */
|
|
105
|
-
verified: z.ZodNativeEnum<{
|
|
106
|
-
readonly YES: "yes";
|
|
107
|
-
readonly NO: "no";
|
|
108
|
-
readonly UNKNOWN: "unknown";
|
|
109
|
-
readonly NO_FAULT: "no-fault";
|
|
110
|
-
}>;
|
|
111
|
-
/** `file:line` for the element driven, when the page told us one. */
|
|
112
|
-
source: z.ZodOptional<z.ZodString>;
|
|
113
|
-
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
claim: string;
|
|
115
|
-
verified: "unknown" | "yes" | "no" | "no-fault";
|
|
116
|
-
source?: string | undefined;
|
|
117
|
-
}, {
|
|
118
|
-
claim: string;
|
|
119
|
-
verified: "unknown" | "yes" | "no" | "no-fault";
|
|
120
|
-
source?: string | undefined;
|
|
121
|
-
}>;
|
|
122
|
-
export type JournalVerdictEffect = z.infer<typeof JournalVerdictEffectSchema>;
|
package/dist/journal.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { TRANSPORT_LIMITS } from './constants.js';
|
|
3
|
-
import { Verified } from './verified-constants.js';
|
|
4
|
-
/**
|
|
5
|
-
* The durable causal journal. Each session gets an append-only pair on disk:
|
|
6
|
-
* `.reticle/sessions/<id>/events.jsonl` (one `ReticleEvent` per line — already seq/actionId-stamped
|
|
7
|
-
* and browser-edge-redacted) and `actions.jsonl` (one JournalAction per line). The ring buffer becomes
|
|
8
|
-
* a hot cache over this ledger, so evidence survives eviction. Local-only; JSONL is versioned per line
|
|
9
|
-
* so a schema bump never orphans an old file.
|
|
10
|
-
*/
|
|
11
|
-
/** Per-record schema version. JSONL is line-addressable, so versioning rides each record, not a header. */
|
|
12
|
-
export const JOURNAL_FILE_VERSION = 1;
|
|
13
|
-
/**
|
|
14
|
-
* An action entity — every act/navigate the server dispatches. `seqRange`/`tRange` are the window used
|
|
15
|
-
* to attribute events to this action (`attribution:"window"`); `effect` is a bounded summary of what
|
|
16
|
-
* the tool returned. Args are already edge-redacted by the browser before they reach here.
|
|
17
|
-
*/
|
|
18
|
-
export const JournalActionSchema = z.object({
|
|
19
|
-
v: z.literal(JOURNAL_FILE_VERSION),
|
|
20
|
-
/** The command correlation id (`c<n>`) — the natural, cross-side-stable action identity. */
|
|
21
|
-
actionId: z.string().min(1).max(TRANSPORT_LIMITS.MAX_REF_LENGTH),
|
|
22
|
-
/** The MCP tool / command name that drove it (e.g. "reticle_act"). */
|
|
23
|
-
tool: z.string().min(1).max(TRANSPORT_LIMITS.MAX_COMMAND_NAME_LENGTH),
|
|
24
|
-
/** Redacted invocation args. */
|
|
25
|
-
args: z.record(z.unknown()).default({}),
|
|
26
|
-
/** Bounded effect summary (settle glyph, target, etc.). Kept open; narrowed by the writer. */
|
|
27
|
-
effect: z.unknown().optional(),
|
|
28
|
-
/** Whether the page settled within budget after the action, when known. */
|
|
29
|
-
settled: z.boolean().optional(),
|
|
30
|
-
/** Time from dispatch to settle in ms, when known. */
|
|
31
|
-
settledInMs: z.number().int().min(0).optional(),
|
|
32
|
-
/** Inclusive seq range of events attributed to this action, when any were observed. */
|
|
33
|
-
seqRange: z.object({ from: z.number().int().min(0), to: z.number().int().min(0) }).optional(),
|
|
34
|
-
/** Elapsed-ms window [dispatch, resolve] used for window attribution. */
|
|
35
|
-
tRange: z.object({ from: z.number().int().min(0), to: z.number().int().min(0) }),
|
|
36
|
-
/** Elapsed-ms timestamp the action was recorded at (clock injected by the writer). */
|
|
37
|
-
at: z.number().int().min(0),
|
|
38
|
-
});
|
|
39
|
-
/**
|
|
40
|
-
* The bounded verdict summary a verification tool writes into a journal action's `effect`.
|
|
41
|
-
*
|
|
42
|
-
* `effect` is deliberately open (`unknown`) and narrowed by its writer; this is that narrowing for
|
|
43
|
-
* the one writer whose record has to be READ back later. Without it a verdict lives only in the tool
|
|
44
|
-
* response, which is exactly the place that disappears when an agent compacts, so "what did this run
|
|
45
|
-
* already prove" would have no ledger to fold and the answer would be silently empty.
|
|
46
|
-
*
|
|
47
|
-
* Three fields and no more: the claim the verdict was about, how it came out, and where in the
|
|
48
|
-
* source it pointed. A transcript here would grow the journal without making the answer better.
|
|
49
|
-
*/
|
|
50
|
-
export const JournalVerdictEffectSchema = z.object({
|
|
51
|
-
/** What was claimed, in the caller's own words — the subject a later proof supersedes. */
|
|
52
|
-
claim: z.string().min(1).max(TRANSPORT_LIMITS.MAX_STRING_LENGTH),
|
|
53
|
-
/** The verdict, as the one field an agent reads. The enum, never a re-typed copy of it. */
|
|
54
|
-
verified: z.nativeEnum(Verified),
|
|
55
|
-
/** `file:line` for the element driven, when the page told us one. */
|
|
56
|
-
source: z.string().max(TRANSPORT_LIMITS.MAX_URL_LENGTH).optional(),
|
|
57
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -70,13 +70,13 @@ export declare const UpgradeHintSchema: z.ZodObject<{
|
|
|
70
70
|
unlockedBy: z.ZodString;
|
|
71
71
|
learnMoreUrl: z.ZodString;
|
|
72
72
|
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
capability: "share_proof" | "run_history" | "team_review" | "corpus_heal" | "ci_gate" | "hosted_runner";
|
|
74
73
|
reason: string;
|
|
74
|
+
capability: "share_proof" | "run_history" | "team_review" | "corpus_heal" | "ci_gate" | "hosted_runner";
|
|
75
75
|
unlockedBy: string;
|
|
76
76
|
learnMoreUrl: string;
|
|
77
77
|
}, {
|
|
78
|
-
capability: "share_proof" | "run_history" | "team_review" | "corpus_heal" | "ci_gate" | "hosted_runner";
|
|
79
78
|
reason: string;
|
|
79
|
+
capability: "share_proof" | "run_history" | "team_review" | "corpus_heal" | "ci_gate" | "hosted_runner";
|
|
80
80
|
unlockedBy: string;
|
|
81
81
|
learnMoreUrl: string;
|
|
82
82
|
}>;
|
|
File without changes
|