@reticlehq/test 2.0.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.
Files changed (74) hide show
  1. package/LICENSE +105 -0
  2. package/dist/boot.d.ts +25 -0
  3. package/dist/boot.d.ts.map +1 -0
  4. package/dist/boot.js +41 -0
  5. package/dist/boot.js.map +1 -0
  6. package/dist/clock.d.ts +10 -0
  7. package/dist/clock.d.ts.map +1 -0
  8. package/dist/clock.js +19 -0
  9. package/dist/clock.js.map +1 -0
  10. package/dist/constants.d.ts +87 -0
  11. package/dist/constants.d.ts.map +1 -0
  12. package/dist/constants.js +72 -0
  13. package/dist/constants.js.map +1 -0
  14. package/dist/flow-spec.d.ts +53 -0
  15. package/dist/flow-spec.d.ts.map +1 -0
  16. package/dist/flow-spec.js +79 -0
  17. package/dist/flow-spec.js.map +1 -0
  18. package/dist/index.d.ts +23 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +17 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/input-mode.d.ts +21 -0
  23. package/dist/input-mode.d.ts.map +1 -0
  24. package/dist/input-mode.js +64 -0
  25. package/dist/input-mode.js.map +1 -0
  26. package/dist/junit.d.ts +11 -0
  27. package/dist/junit.d.ts.map +1 -0
  28. package/dist/junit.js +43 -0
  29. package/dist/junit.js.map +1 -0
  30. package/dist/matchers.d.ts +26 -0
  31. package/dist/matchers.d.ts.map +1 -0
  32. package/dist/matchers.js +95 -0
  33. package/dist/matchers.js.map +1 -0
  34. package/dist/register.d.ts +31 -0
  35. package/dist/register.d.ts.map +1 -0
  36. package/dist/register.js +73 -0
  37. package/dist/register.js.map +1 -0
  38. package/dist/registry.d.ts +6 -0
  39. package/dist/registry.d.ts.map +1 -0
  40. package/dist/registry.js +13 -0
  41. package/dist/registry.js.map +1 -0
  42. package/dist/resolve.d.ts +8 -0
  43. package/dist/resolve.d.ts.map +1 -0
  44. package/dist/resolve.js +39 -0
  45. package/dist/resolve.js.map +1 -0
  46. package/dist/runner.d.ts +13 -0
  47. package/dist/runner.d.ts.map +1 -0
  48. package/dist/runner.js +52 -0
  49. package/dist/runner.js.map +1 -0
  50. package/dist/skip.d.ts +34 -0
  51. package/dist/skip.d.ts.map +1 -0
  52. package/dist/skip.js +44 -0
  53. package/dist/skip.js.map +1 -0
  54. package/dist/spec.d.ts +4 -0
  55. package/dist/spec.d.ts.map +1 -0
  56. package/dist/spec.js +6 -0
  57. package/dist/spec.js.map +1 -0
  58. package/dist/success-assert.d.ts +7 -0
  59. package/dist/success-assert.d.ts.map +1 -0
  60. package/dist/success-assert.js +7 -0
  61. package/dist/success-assert.js.map +1 -0
  62. package/dist/summary.d.ts +8 -0
  63. package/dist/summary.d.ts.map +1 -0
  64. package/dist/summary.js +34 -0
  65. package/dist/summary.js.map +1 -0
  66. package/dist/test-context.d.ts +34 -0
  67. package/dist/test-context.d.ts.map +1 -0
  68. package/dist/test-context.js +85 -0
  69. package/dist/test-context.js.map +1 -0
  70. package/dist/types.d.ts +45 -0
  71. package/dist/types.d.ts.map +1 -0
  72. package/dist/types.js +2 -0
  73. package/dist/types.js.map +1 -0
  74. package/package.json +54 -0
package/LICENSE ADDED
@@ -0,0 +1,105 @@
1
+ # Functional Source License, Version 1.1, ALv2 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-ALv2
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Reticle Labs
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
package/dist/boot.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import type { RunningServer, ToolDeps, ToolInvoker } from '@reticlehq/server';
2
+ export interface BootedRun {
3
+ invoke: ToolInvoker;
4
+ close: () => Promise<void>;
5
+ }
6
+ export interface BootOptions {
7
+ /** URL the headless real-input browser navigates to (sets inputMode:'real' for pointer acts). */
8
+ driveUrl: string;
9
+ /** Launch headless (default true). */
10
+ headless?: boolean;
11
+ port?: number;
12
+ /** Absolute .reticle root. Defaults to cwd()/.reticle. Injectable for tests. */
13
+ reticleRoot?: string;
14
+ /** Injected clock; defaults to Date.now. */
15
+ now?: () => number;
16
+ /** Injectable ToolDeps builder so tests can wire a fake server without real IO. */
17
+ buildDeps?: (server: RunningServer) => ToolDeps;
18
+ }
19
+ /**
20
+ * Production wiring: launch a headless real-input browser against `driveUrl`, then expose a
21
+ * programmatic ToolInvoker over it (no MCP/stdio). Tests inject a fake invoker into runSpecs
22
+ * directly and never reach this path.
23
+ */
24
+ export declare function bootSession(opts: BootOptions): Promise<BootedRun>;
25
+ //# sourceMappingURL=boot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,iGAAiG;IACjG,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,mFAAmF;IACnF,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,QAAQ,CAAC;CACjD;AAwBD;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAUvE"}
package/dist/boot.js ADDED
@@ -0,0 +1,41 @@
1
+ import { join } from 'node:path';
2
+ import { ReticleDir } from '@reticlehq/core';
3
+ import { AnnotationStore, BaselineStore, FlowStore, ProjectStore, RecordingStore, createNodeFileSystem, createToolInvoker, start, } from '@reticlehq/server';
4
+ /**
5
+ * Build ToolDeps from a started server (Option b: zero further server changes). The only place
6
+ * in @reticlehq/test that touches real IO — and it does so only by delegating to @reticlehq/server's start.
7
+ */
8
+ function defaultBuildDeps(server, opts) {
9
+ const fs = createNodeFileSystem();
10
+ const reticleRoot = opts.reticleRoot ?? join(process.cwd(), ReticleDir.ROOT);
11
+ const now = opts.now ?? (() => Date.now());
12
+ const base = {
13
+ sessions: server.bridge.sessions,
14
+ baselines: new BaselineStore(),
15
+ recordings: new RecordingStore(),
16
+ flows: new FlowStore(fs, reticleRoot, { now }),
17
+ project: new ProjectStore(fs, reticleRoot, { now }),
18
+ annotations: new AnnotationStore(),
19
+ fs,
20
+ reticleRoot,
21
+ now,
22
+ };
23
+ return server.realInput !== undefined ? { ...base, realInput: server.realInput } : base;
24
+ }
25
+ /**
26
+ * Production wiring: launch a headless real-input browser against `driveUrl`, then expose a
27
+ * programmatic ToolInvoker over it (no MCP/stdio). Tests inject a fake invoker into runSpecs
28
+ * directly and never reach this path.
29
+ */
30
+ export async function bootSession(opts) {
31
+ const startOptions = {
32
+ mcp: false,
33
+ driveUrl: opts.driveUrl,
34
+ headless: opts.headless ?? true,
35
+ ...(opts.port !== undefined ? { port: opts.port } : {}),
36
+ };
37
+ const server = await start(startOptions);
38
+ const deps = (opts.buildDeps ?? ((s) => defaultBuildDeps(s, opts)))(server);
39
+ return { invoke: createToolInvoker(deps), close: server.close };
40
+ }
41
+ //# sourceMappingURL=boot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAsB3B;;;GAGG;AACH,SAAS,gBAAgB,CAAC,MAAqB,EAAE,IAAiB;IAChE,MAAM,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAClC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7E,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAW,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG;QACX,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ;QAChC,SAAS,EAAE,IAAI,aAAa,EAAE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each call maps to one reticle_clock knob. */
3
+ export interface TestClock {
4
+ freeze(): Promise<void>;
5
+ advance(ms: number): Promise<void>;
6
+ reset(): Promise<void>;
7
+ }
8
+ /** Build a TestClock bound to one invoker + session. Each method calls reticle_clock with one knob. */
9
+ export declare function buildClock(invoke: ToolInvoker, sessionId?: string): TestClock;
10
+ //# sourceMappingURL=clock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../src/clock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElE,oGAAoG;AACpG,MAAM,WAAW,SAAS;IACxB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAMD,uGAAuG;AACvG,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAY7E"}
package/dist/clock.js ADDED
@@ -0,0 +1,19 @@
1
+ import { ReticleTool } from '@reticlehq/server';
2
+ function clockArgs(knob, sessionId) {
3
+ return { ...knob, ...(sessionId !== undefined ? { sessionId } : {}) };
4
+ }
5
+ /** Build a TestClock bound to one invoker + session. Each method calls reticle_clock with one knob. */
6
+ export function buildClock(invoke, sessionId) {
7
+ return {
8
+ async freeze() {
9
+ await invoke(ReticleTool.CLOCK, clockArgs({ freeze: true }, sessionId));
10
+ },
11
+ async advance(ms) {
12
+ await invoke(ReticleTool.CLOCK, clockArgs({ advanceMs: ms }, sessionId));
13
+ },
14
+ async reset() {
15
+ await invoke(ReticleTool.CLOCK, clockArgs({ reset: true }, sessionId));
16
+ },
17
+ };
18
+ }
19
+ //# sourceMappingURL=clock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock.js","sourceRoot":"","sources":["../src/clock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AASlE,SAAS,SAAS,CAAC,IAA6B,EAAE,SAAkB;IAClE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACxE,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,UAAU,CAAC,MAAmB,EAAE,SAAkB;IAChE,OAAO;QACL,KAAK,CAAC,MAAM;YACV,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;QAC1E,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,EAAU;YACtB,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;QAC3E,CAAC;QACD,KAAK,CAAC,KAAK;YACT,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;QACzE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,87 @@
1
+ /** Outcome of a single spec. No free strings — every status crosses the result boundary. */
2
+ export declare const TestStatus: {
3
+ readonly PASS: "pass";
4
+ readonly FAIL: "fail";
5
+ readonly SKIP: "skip";
6
+ };
7
+ export type TestStatus = (typeof TestStatus)[keyof typeof TestStatus];
8
+ /** Per-status glyph the printer prepends to each result line. */
9
+ export declare const STATUS_GLYPH: {
10
+ readonly pass: "PASS";
11
+ readonly fail: "FAIL";
12
+ readonly skip: "SKIP";
13
+ };
14
+ /** The footer prefix on the summary totals line: "reticle test: N passed, M failed, K skipped". */
15
+ export declare const SUMMARY_FOOTER_PREFIX = "reticle test:";
16
+ /** JUnit XML tag + attribute names (no free strings in the emitter). */
17
+ export declare const JUnit: {
18
+ readonly SUITE: "testsuite";
19
+ readonly CASE: "testcase";
20
+ readonly FAILURE: "failure";
21
+ readonly SKIPPED: "skipped";
22
+ readonly ATTR_NAME: "name";
23
+ readonly ATTR_TESTS: "tests";
24
+ readonly ATTR_FAILURES: "failures";
25
+ readonly ATTR_SKIPPED: "skipped";
26
+ readonly ATTR_TIME: "time";
27
+ readonly ATTR_MESSAGE: "message";
28
+ };
29
+ /** Default JUnit <testsuite name=...> when the caller does not supply one. */
30
+ export declare const DEFAULT_JUNIT_SUITE_NAME = "reticle";
31
+ /**
32
+ * Skip reason `t.expectInputModeReal()` raises when the active input mode is 'synthetic'.
33
+ * The runner turns the ReticleSkip carrying this into status:'skip' (never a silent pass).
34
+ */
35
+ export declare const SKIP_REASON_REAL_INPUT = "real input not active \u2014 run via reticle drive";
36
+ /** Default wait window for assertion matchers (reticle_assert timeout_ms). */
37
+ export declare const DEFAULT_ASSERT_TIMEOUT_MS = 4000;
38
+ /** Predicate `kind` discriminants the matchers build. Mirrors @reticlehq/server's Predicate union. */
39
+ export declare const PredicateKind: {
40
+ readonly SIGNAL: "signal";
41
+ readonly NET: "net";
42
+ readonly ELEMENT: "element";
43
+ readonly TEXT: "text";
44
+ readonly CONSOLE: "console";
45
+ };
46
+ export type PredicateKind = (typeof PredicateKind)[keyof typeof PredicateKind];
47
+ /** Console level the expectNoConsoleErrors matcher asserts is absent. */
48
+ export declare const CONSOLE_LEVEL_ERROR = "error";
49
+ /** Prefix of the ReticleQueryEmptyError message when a testid resolves to nothing. */
50
+ export declare const NO_ELEMENT_FOR_TESTID = "no element for testid";
51
+ /**
52
+ * Default testid the input-mode probe resolves to when no act has run yet. Apps that opt into
53
+ * `expectInputModeReal()` before any act should tag a stable benign element with this testid;
54
+ * the probe runs a non-mutating SCROLL_INTO_VIEW against it purely to read the reported inputMode.
55
+ */
56
+ export declare const PROBE_TESTID = "reticle-root";
57
+ /**
58
+ * a flow under .reticle/flows becomes a runnable spec. A flow either loads to a
59
+ * RUNNABLE spec (replay its anchored steps + assert flow.success) or, when the file is
60
+ * missing/malformed/badly-named, surfaces as an ERROR spec that fails loudly (never a silent skip).
61
+ */
62
+ export declare const SpecKind: {
63
+ readonly RUNNABLE: "runnable";
64
+ readonly ERROR: "error";
65
+ };
66
+ export type SpecKind = (typeof SpecKind)[keyof typeof SpecKind];
67
+ /** FLOW2SPEC: the binary outcome of running one RUNNABLE flow spec. */
68
+ export declare const SpecOutcome: {
69
+ readonly PASS: "pass";
70
+ readonly FAIL: "fail";
71
+ };
72
+ export type SpecOutcome = (typeof SpecOutcome)[keyof typeof SpecOutcome];
73
+ /**
74
+ * FLOW2SPEC: the named failure/diagnostic messages a flow spec can carry — never a free string.
75
+ * SUCCESS_NOT_MET: replay was clean but flow.success did not hold. STEP_DRIFT: a step anchor
76
+ * drifted or its expect did not hold (replay stopped). EMPTY_DIR: documentation-only note that an
77
+ * empty .reticle/flows yields zero specs.
78
+ */
79
+ export declare const SpecMessage: {
80
+ readonly SUCCESS_NOT_MET: "flow.success predicate did not hold after replay";
81
+ readonly STEP_DRIFT: "a step anchor drifted or its expect did not hold";
82
+ readonly EMPTY_DIR: "no flows under .reticle/flows — zero specs registered";
83
+ };
84
+ export type SpecMessage = (typeof SpecMessage)[keyof typeof SpecMessage];
85
+ /** FLOW2SPEC: prefix of the Error a malformed/missing flow file raises when its spec runs. */
86
+ export declare const FLOW_LOAD_ERROR_PREFIX = "flow could not be loaded";
87
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,eAAO,MAAM,UAAU;;;;CAAwD,CAAC;AAChF,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,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const TestStatus = { PASS: 'pass', FAIL: 'fail', SKIP: 'skip' };
3
+ /** Per-status glyph the printer prepends to each result line. */
4
+ export const STATUS_GLYPH = {
5
+ pass: 'PASS',
6
+ fail: 'FAIL',
7
+ skip: 'SKIP',
8
+ };
9
+ /** The footer prefix on the summary totals line: "reticle test: N passed, M failed, K skipped". */
10
+ export const SUMMARY_FOOTER_PREFIX = 'reticle test:';
11
+ /** JUnit XML tag + attribute names (no free strings in the emitter). */
12
+ export const JUnit = {
13
+ SUITE: 'testsuite',
14
+ CASE: 'testcase',
15
+ FAILURE: 'failure',
16
+ SKIPPED: 'skipped',
17
+ ATTR_NAME: 'name',
18
+ ATTR_TESTS: 'tests',
19
+ ATTR_FAILURES: 'failures',
20
+ ATTR_SKIPPED: 'skipped',
21
+ ATTR_TIME: 'time',
22
+ ATTR_MESSAGE: 'message',
23
+ };
24
+ /** Default JUnit <testsuite name=...> when the caller does not supply one. */
25
+ export const DEFAULT_JUNIT_SUITE_NAME = 'reticle';
26
+ /**
27
+ * Skip reason `t.expectInputModeReal()` raises when the active input mode is 'synthetic'.
28
+ * The runner turns the ReticleSkip carrying this into status:'skip' (never a silent pass).
29
+ */
30
+ export const SKIP_REASON_REAL_INPUT = 'real input not active — run via reticle drive';
31
+ /** Default wait window for assertion matchers (reticle_assert timeout_ms). */
32
+ export const DEFAULT_ASSERT_TIMEOUT_MS = 4000;
33
+ /** Predicate `kind` discriminants the matchers build. Mirrors @reticlehq/server's Predicate union. */
34
+ export const PredicateKind = {
35
+ SIGNAL: 'signal',
36
+ NET: 'net',
37
+ ELEMENT: 'element',
38
+ TEXT: 'text',
39
+ CONSOLE: 'console',
40
+ };
41
+ /** Console level the expectNoConsoleErrors matcher asserts is absent. */
42
+ export const CONSOLE_LEVEL_ERROR = 'error';
43
+ /** Prefix of the ReticleQueryEmptyError message when a testid resolves to nothing. */
44
+ export const NO_ELEMENT_FOR_TESTID = 'no element for testid';
45
+ /**
46
+ * Default testid the input-mode probe resolves to when no act has run yet. Apps that opt into
47
+ * `expectInputModeReal()` before any act should tag a stable benign element with this testid;
48
+ * the probe runs a non-mutating SCROLL_INTO_VIEW against it purely to read the reported inputMode.
49
+ */
50
+ export const PROBE_TESTID = 'reticle-root';
51
+ /**
52
+ * a flow under .reticle/flows becomes a runnable spec. A flow either loads to a
53
+ * RUNNABLE spec (replay its anchored steps + assert flow.success) or, when the file is
54
+ * missing/malformed/badly-named, surfaces as an ERROR spec that fails loudly (never a silent skip).
55
+ */
56
+ export const SpecKind = { RUNNABLE: 'runnable', ERROR: 'error' };
57
+ /** FLOW2SPEC: the binary outcome of running one RUNNABLE flow spec. */
58
+ export const SpecOutcome = { PASS: 'pass', FAIL: 'fail' };
59
+ /**
60
+ * FLOW2SPEC: the named failure/diagnostic messages a flow spec can carry — never a free string.
61
+ * SUCCESS_NOT_MET: replay was clean but flow.success did not hold. STEP_DRIFT: a step anchor
62
+ * drifted or its expect did not hold (replay stopped). EMPTY_DIR: documentation-only note that an
63
+ * empty .reticle/flows yields zero specs.
64
+ */
65
+ export const SpecMessage = {
66
+ SUCCESS_NOT_MET: 'flow.success predicate did not hold after replay',
67
+ STEP_DRIFT: 'a step anchor drifted or its expect did not hold',
68
+ EMPTY_DIR: 'no flows under .reticle/flows — zero specs registered',
69
+ };
70
+ /** FLOW2SPEC: prefix of the Error a malformed/missing flow file raises when its spec runs. */
71
+ export const FLOW_LOAD_ERROR_PREFIX = 'flow could not be loaded';
72
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAW,CAAC;AAGhF,iEAAiE;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE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AKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,eAAe,EAAE,kDAAkD;IACnE,UAAU,EAAE,kDAAkD;IAC9D,SAAS,EAAE,uDAAuD;CAC1D,CAAC;AAGX,8FAA8F;AAC9F,MAAM,CAAC,MAAM,sBAAsB,GAAG,0BAA0B,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { type FlowErrorCode, type FlowFile, type FlowStepResult } from '@reticlehq/core';
2
+ import { FlowStore } from '@reticlehq/server';
3
+ import type { Clock, EvalResult, FileSystemPort, FlowReplaySession, WaitForSignal } from '@reticlehq/server';
4
+ import { SpecKind, SpecMessage, SpecOutcome } from './constants.js';
5
+ /** FLOW2SPEC — the result of running one RUNNABLE flow spec, evidence-bearing on a FAIL. */
6
+ export interface SpecRunResult {
7
+ outcome: SpecOutcome;
8
+ /** Verbatim from replayFlow — carries each step's drift/nearest evidence. */
9
+ steps: FlowStepResult[];
10
+ /** From assertSuccess — carries the predicate failureReason + near-miss on a FAIL. */
11
+ successResult: EvalResult;
12
+ /** A named SpecMessage explaining a FAIL (never set on a PASS). */
13
+ message?: SpecMessage;
14
+ }
15
+ /**
16
+ * FLOW2SPEC — one flow rendered as a runnable spec. Every spec carries `run`. A RUNNABLE spec
17
+ * replays + asserts success; an ERROR spec (file missing/malformed/badly-named) carries `loadError`
18
+ * and a `run` whose returned SpecRunResult is FAIL, so a corrupted flow fails loudly in the suite
19
+ * rather than vanishing. The vitest binding (register.ts) turns the load error into a thrown Error.
20
+ */
21
+ export interface FlowSpec {
22
+ name: string;
23
+ kind: SpecKind;
24
+ loadError?: {
25
+ code: FlowErrorCode;
26
+ };
27
+ run: (session: FlowReplaySession) => Promise<SpecRunResult>;
28
+ }
29
+ export interface FlowSpecOptions {
30
+ /** Defaults to waitForPredicate from @reticlehq/server (the real engine). */
31
+ waitForSignal?: WaitForSignal;
32
+ /** Defaults to FLOW_SIGNAL_TIMEOUT_MS. Injected so a spec never reads the wall clock. */
33
+ signalTimeoutMs?: number;
34
+ }
35
+ /**
36
+ * Build one RUNNABLE FlowSpec from an already-loaded FlowFile. Composition only — replay (anchored
37
+ * steps + per-step expect + dynamic skip) comes from @reticlehq/server's replayFlow; the sole new
38
+ * assertion is flow.success via the same predicate engine.
39
+ */
40
+ export declare function flowToSpec(flow: FlowFile, opts?: FlowSpecOptions): FlowSpec;
41
+ export interface FlowsAsSpecsOptions extends FlowSpecOptions {
42
+ /** Injected fs port when `source` is a dir string (defaults to the node fs). */
43
+ fs?: FileSystemPort;
44
+ /** Injected clock for the FlowStore createdAt (rule 7) when `source` is a dir string. */
45
+ clock?: Clock;
46
+ }
47
+ /**
48
+ * FLOW2SPEC — enumerate a flows dir (or a live FlowStore) into FlowSpec[]. The map (.reticle/flows)
49
+ * IS the suite. An empty/absent dir yields [] (no throw). A malformed/badly-named file becomes an
50
+ * ERROR spec; enumeration of its siblings is never aborted.
51
+ */
52
+ export declare function flowsAsSpecs(source: string | FlowStore, opts?: FlowsAsSpecsOptions): Promise<FlowSpec[]>;
53
+ //# sourceMappingURL=flow-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-spec.d.ts","sourceRoot":"","sources":["../src/flow-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAsD,MAAM,mBAAmB,CAAC;AAClG,OAAO,KAAK,EACV,KAAK,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGpE,4FAA4F;AAC5F,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,sFAAsF;IACtF,aAAa,EAAE,UAAU,CAAC;IAC1B,mEAAmE;IACnE,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,aAAa,CAAA;KAAE,CAAC;IACpC,GAAG,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CAC7D;AAED,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,yFAAyF;IACzF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAWD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,QAAQ,CA+B3E;AAkBD,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,gFAAgF;IAChF,EAAE,CAAC,EAAE,cAAc,CAAC;IACpB,yFAAyF;IACzF,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,IAAI,CAAC,EAAE,mBAAmB,GACzB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAiBrB"}
@@ -0,0 +1,79 @@
1
+ import { AnchorKind, FLOW_SIGNAL_TIMEOUT_MS, } from '@reticlehq/core';
2
+ import { FlowStore, createNodeFileSystem, replayFlow, waitForPredicate } from '@reticlehq/server';
3
+ import { SpecKind, SpecMessage, SpecOutcome } from './constants.js';
4
+ import { assertSuccess } from './success-assert.js';
5
+ /** Derive the dynamic testid skip-set exactly as replayFlow does (testid anchors only). */
6
+ function toDynamicSet(flow) {
7
+ return new Set((flow.dynamic ?? [])
8
+ .filter((a) => a.kind === AnchorKind.TESTID)
9
+ .map((a) => (a.kind === AnchorKind.TESTID ? a.value : '')));
10
+ }
11
+ /**
12
+ * Build one RUNNABLE FlowSpec from an already-loaded FlowFile. Composition only — replay (anchored
13
+ * steps + per-step expect + dynamic skip) comes from @reticlehq/server's replayFlow; the sole new
14
+ * assertion is flow.success via the same predicate engine.
15
+ */
16
+ export function flowToSpec(flow, opts) {
17
+ const waitForSignal = opts?.waitForSignal ?? waitForPredicate;
18
+ const timeoutMs = opts?.signalTimeoutMs ?? FLOW_SIGNAL_TIMEOUT_MS;
19
+ return {
20
+ name: flow.name,
21
+ kind: SpecKind.RUNNABLE,
22
+ run: async (session) => {
23
+ const steps = await replayFlow(session, flow, waitForSignal, timeoutMs);
24
+ const stepsOk = steps.every((s) => s.ok);
25
+ const dynamic = toDynamicSet(flow);
26
+ const successResult = await assertSuccess(session, flow.success, dynamic, waitForSignal, timeoutMs);
27
+ if (!stepsOk) {
28
+ return { outcome: SpecOutcome.FAIL, steps, successResult, message: SpecMessage.STEP_DRIFT };
29
+ }
30
+ if (!successResult.pass) {
31
+ return {
32
+ outcome: SpecOutcome.FAIL,
33
+ steps,
34
+ successResult,
35
+ message: SpecMessage.SUCCESS_NOT_MET,
36
+ };
37
+ }
38
+ return { outcome: SpecOutcome.PASS, steps, successResult };
39
+ },
40
+ };
41
+ }
42
+ /** An ERROR spec for a flow file that failed to load. Its run() returns a FAIL with no steps. */
43
+ function errorSpec(name, code) {
44
+ const result = {
45
+ outcome: SpecOutcome.FAIL,
46
+ steps: [],
47
+ successResult: { pass: false, failureReason: code },
48
+ message: SpecMessage.STEP_DRIFT,
49
+ };
50
+ return {
51
+ name,
52
+ kind: SpecKind.ERROR,
53
+ loadError: { code },
54
+ run: () => Promise.resolve(result),
55
+ };
56
+ }
57
+ /**
58
+ * FLOW2SPEC — enumerate a flows dir (or a live FlowStore) into FlowSpec[]. The map (.reticle/flows)
59
+ * IS the suite. An empty/absent dir yields [] (no throw). A malformed/badly-named file becomes an
60
+ * ERROR spec; enumeration of its siblings is never aborted.
61
+ */
62
+ export async function flowsAsSpecs(source, opts) {
63
+ const store = typeof source === 'string'
64
+ ? new FlowStore(opts?.fs ?? createNodeFileSystem(), source, opts?.clock ?? { now: () => 0 })
65
+ : source;
66
+ const names = await store.list();
67
+ const specs = [];
68
+ for (const name of names) {
69
+ const loaded = await store.load(name);
70
+ if (loaded.ok) {
71
+ specs.push(flowToSpec(loaded.value, opts));
72
+ }
73
+ else {
74
+ specs.push(errorSpec(name, loaded.code));
75
+ }
76
+ }
77
+ return specs;
78
+ }
79
+ //# sourceMappingURL=flow-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-spec.js","sourceRoot":"","sources":["../src/flow-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,sBAAsB,GAIvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQlG,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAiCpD,2FAA2F;AAC3F,SAAS,YAAY,CAAC,IAAc;IAClC,OAAO,IAAI,GAAG,CACZ,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;SACjB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,MAAM,CAAC;SAC3C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAC7D,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,IAAsB;IAC/D,MAAM,aAAa,GAAG,IAAI,EAAE,aAA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s, runOne } from './runner.js';
4
+ export { summarize, printSummary } from './summary.js';
5
+ export { toJUnitXml, writeJUnit } from './junit.js';
6
+ export { bootSession } from './boot.js';
7
+ export type { BootedRun, BootOptions } from './boot.js';
8
+ export { ReticleSkip, ReticleAssertionError, ReticleQueryEmptyError, isSkip } from './skip.js';
9
+ export type { AssertionDetail } from './skip.js';
10
+ export { createTestContext } from './test-context.js';
11
+ export type { TestContext, TestContextOptions, Predicate } from './test-context.js';
12
+ export type { TestClock } from './clock.js';
13
+ export { resolveTestid } from './resolve.js';
14
+ export { expectInputModeReal, InputModeTracker, readInputMode } from './input-mode.js';
15
+ export { TestStatus, STATUS_GLYPH, SUMMARY_FOOTER_PREFIX, JUnit, DEFAULT_JUNIT_SUITE_NAME, SKIP_REASON_REAL_INPUT, DEFAULT_ASSERT_TIMEOUT_MS, PredicateKind, PROBE_TESTID, } from './constants.js';
16
+ export type { SpecContext, SpecFn, ReticleSpec, SpecResult, RunSummary, ContextFactory, RunnerOptions, } from './types.js';
17
+ export { flowToSpec, flowsAsSpecs } from './flow-spec.js';
18
+ export type { FlowSpec, FlowSpecOptions, FlowsAsSpecsOptions, SpecRunResult } from './flow-spec.js';
19
+ export { assertSuccess, successToPredicate } from './success-assert.js';
20
+ export { registerFlowSpecs, reticleFlowsAsSpecs, FlowMalformedError, SpecFailure, } from './register.js';
21
+ export type { RegisterFn, RegisterFlowSpecsOptions } from './register.js';
22
+ export { SpecKind, SpecOutcome, SpecMessage, FLOW_LOAD_ERROR_PREFIX } from './constants.js';
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAA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GACZ,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ export { reticleTest } from './spec.js';
2
+ export { register, getRegistered, clearRegistry } from './registry.js';
3
+ export { runSpecs, runOne } from './runner.js';
4
+ export { summarize, printSummary } from './summary.js';
5
+ export { toJUnitXml, writeJUnit } from './junit.js';
6
+ export { bootSession } from './boot.js';
7
+ export { ReticleSkip, ReticleAssertionError, ReticleQueryEmptyError, isSkip } from './skip.js';
8
+ export { createTestContext } from './test-context.js';
9
+ export { resolveTestid } from './resolve.js';
10
+ export { expectInputModeReal, InputModeTracker, readInputMode } from './input-mode.js';
11
+ export { TestStatus, STATUS_GLYPH, SUMMARY_FOOTER_PREFIX, JUnit, DEFAULT_JUNIT_SUITE_NAME, SKIP_REASON_REAL_INPUT, DEFAULT_ASSERT_TIMEOUT_MS, PredicateKind, PROBE_TESTID, } from './constants.js';
12
+ // flows under .reticle/flows become the runnable suite.
13
+ export { flowToSpec, flowsAsSpecs } from './flow-spec.js';
14
+ export { assertSuccess, successToPredicate } from './success-assert.js';
15
+ export { registerFlowSpecs, reticleFlowsAsSpecs, FlowMalformedError, SpecFailure, } from './register.js';
16
+ export { SpecKind, SpecOutcome, SpecMessage, FLOW_LOAD_ERROR_PREFIX } from './constants.js';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EACL,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,KAAK,EACL,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,EACzB,aAAa,EACb,YAAY,GACb,MAAM,gBAAgB,CAAC;AAWxB,wDAAwD;AACxD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type ToolInvoker } from '@reticlehq/server';
2
+ import { InputMode } from '@reticlehq/core';
3
+ /** The act envelope's inputMode field, narrowed from the raw tool result. */
4
+ export declare function readInputMode(actResult: unknown): InputMode | undefined;
5
+ /**
6
+ * Tracks the most recent act's inputMode across a spec so `expectInputModeReal()` can read it
7
+ * without re-touching the page. The context records every act through `record`.
8
+ */
9
+ export declare class InputModeTracker {
10
+ private last;
11
+ record(actResult: unknown): void;
12
+ get(): InputMode | undefined;
13
+ }
14
+ /**
15
+ * Assert real native input is active. Prefers the last act's reported mode (zero extra page
16
+ * mutation); if no act has run, issues a non-mutating SCROLL_INTO_VIEW probe and reads its mode.
17
+ * On 'synthetic' throws ReticleSkip(SKIP_REASON_REAL_INPUT) — the runner turns this into status:'skip'.
18
+ * It NEVER silently passes on synthetic.
19
+ */
20
+ export declare function expectInputModeReal(invoke: ToolInvoker, tracker: InputModeTracker, sessionId?: string): Promise<void>;
21
+ //# sourceMappingURL=input-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-mode.d.ts","sourceRoot":"","sources":["../src/input-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAKvE;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAwB;IAEpC,MAAM,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;IAKhC,GAAG,IAAI,SAAS,GAAG,SAAS;CAG7B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,gBAAgB,EACzB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAQf"}