@reticlehq/core 3.6.0 → 3.7.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 (90) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +2 -0
  2. package/dist/artifacts/artifacts-entry.js +2 -0
  3. package/dist/artifacts/drive-script.d.ts +158 -52
  4. package/dist/artifacts/drive-script.js +24 -1
  5. package/dist/artifacts/flow-constants.d.ts +18 -0
  6. package/dist/artifacts/flow-constants.js +20 -0
  7. package/dist/artifacts/flow-results.d.ts +450 -0
  8. package/dist/artifacts/flow-results.js +1 -0
  9. package/dist/artifacts/flow-types.d.ts +25 -437
  10. package/dist/artifacts/flow-types.js +5 -2
  11. package/dist/artifacts/harness-credits.d.ts +39 -0
  12. package/dist/artifacts/harness-credits.js +69 -0
  13. package/dist/artifacts/harness-map.d.ts +98 -0
  14. package/dist/artifacts/harness-map.js +36 -0
  15. package/dist/artifacts/impact.d.ts +354 -145
  16. package/dist/artifacts/impact.js +66 -48
  17. package/dist/artifacts/journal.d.ts +56 -5
  18. package/dist/artifacts/journal.js +26 -0
  19. package/dist/artifacts/screenshot-upload.d.ts +51 -0
  20. package/dist/artifacts/screenshot-upload.js +26 -0
  21. package/dist/hooks/hook-events.d.ts +4 -4
  22. package/dist/hud-entry.d.ts +1 -0
  23. package/dist/hud-entry.js +2 -0
  24. package/dist/index.d.ts +5 -0
  25. package/dist/index.js +5 -0
  26. package/dist/onboarding.d.ts +8 -0
  27. package/dist/onboarding.js +6 -0
  28. package/dist/realm/registry.js +19 -1
  29. package/dist/schema/command-message.json +30 -0
  30. package/dist/schema/command-name.json +3 -1
  31. package/dist/schema/event-payloads.json +40 -2
  32. package/dist/schema/reticle-message.json +30 -0
  33. package/dist/telemetry-bug.d.ts +169 -0
  34. package/dist/telemetry-bug.js +123 -0
  35. package/dist/telemetry-entry.d.ts +1 -0
  36. package/dist/telemetry-entry.js +1 -0
  37. package/dist/telemetry-feedback.d.ts +2 -2
  38. package/dist/telemetry-refusal.d.ts +2 -2
  39. package/dist/telemetry-session.d.ts +74 -0
  40. package/dist/telemetry-session.js +54 -0
  41. package/dist/telemetry-signals.d.ts +339 -0
  42. package/dist/telemetry-signals.js +138 -0
  43. package/dist/telemetry.d.ts +300 -254
  44. package/dist/telemetry.js +40 -115
  45. package/dist/verdict/disparity.d.ts +105 -0
  46. package/dist/verdict/disparity.js +40 -0
  47. package/dist/verdict/findings.d.ts +6 -0
  48. package/dist/verdict/findings.js +9 -0
  49. package/dist/verdict/instrumentation-coverage.d.ts +115 -0
  50. package/dist/verdict/instrumentation-coverage.js +226 -0
  51. package/dist/verdict/instrumentation-gap.js +1 -1
  52. package/dist/verdict/intent.d.ts +19 -5
  53. package/dist/verdict/intent.js +13 -1
  54. package/dist/verdict/predicate-tree.d.ts +15 -0
  55. package/dist/verdict/predicate-tree.js +21 -0
  56. package/dist/verdict/predicate.d.ts +14 -0
  57. package/dist/verdict/predicate.js +87 -3
  58. package/dist/verdict/security.d.ts +25 -0
  59. package/dist/verdict/security.js +82 -0
  60. package/dist/verdict/verification-run.d.ts +620 -32
  61. package/dist/verdict/verification-run.js +82 -0
  62. package/dist/wire/constants/constants.d.ts +15 -16
  63. package/dist/wire/constants/constants.js +16 -17
  64. package/dist/wire/constants/hud-controls.js +17 -5
  65. package/dist/wire/constants/hud-use.d.ts +29 -4
  66. package/dist/wire/constants/hud-use.js +26 -4
  67. package/dist/wire/constants/mcp-wire.d.ts +10 -0
  68. package/dist/wire/constants/mcp-wire.js +10 -0
  69. package/dist/wire/constants/reticle-chrome.d.ts +19 -0
  70. package/dist/wire/constants/reticle-chrome.js +19 -0
  71. package/dist/wire/constants/session-constants.d.ts +15 -2
  72. package/dist/wire/constants/session-constants.js +15 -2
  73. package/dist/wire/desktop-contract.d.ts +8 -0
  74. package/dist/wire/desktop-contract.js +11 -0
  75. package/dist/wire/event-payloads.d.ts +56 -4
  76. package/dist/wire/event-payloads.js +17 -0
  77. package/dist/wire/messages.d.ts +105 -32
  78. package/dist/wire/messages.js +9 -1
  79. package/dist/wire/platform-link.d.ts +77 -0
  80. package/dist/wire/platform-link.js +45 -0
  81. package/dist/wire/tool-names.d.ts +2 -0
  82. package/dist/wire/tool-names.js +2 -0
  83. package/dist/wire/types.d.ts +19 -6
  84. package/dist/wire/types.js +5 -0
  85. package/dist/words/notices.d.ts +1 -1
  86. package/dist/words/notices.js +1 -1
  87. package/dist/words/upgrade.js +1 -1
  88. package/dist/words/writing-rule.d.ts +14 -0
  89. package/dist/words/writing-rule.js +17 -0
  90. package/package.json +1 -1
@@ -65,6 +65,7 @@ export const SpecIgnoredReason = {
65
65
  UNAVAILABLE: 'unavailable',
66
66
  };
67
67
  const PERSONA_MAX = 2_000;
68
+ const PLAN_ID_MAX = 128;
68
69
  const STEPS_MAX = 500;
69
70
  /** Each field of a spec, validated on its own so one bad field never costs the others. */
70
71
  const SPEC_FIELDS = {
@@ -78,6 +79,8 @@ const SPEC_FIELDS = {
78
79
  persona: z.string().min(1).max(PERSONA_MAX),
79
80
  maxSteps: z.number().int().min(1).max(STEPS_MAX),
80
81
  record: z.boolean(),
82
+ plan: z.string().min(1).max(PLAN_ID_MAX),
83
+ confirmDangerous: z.boolean(),
81
84
  };
82
85
  /**
83
86
  * Read a spec as far as it can be read. Never throws: a field that does not validate, or that this
@@ -187,3 +190,45 @@ export const LinkPath = {
187
190
  /** One turn of a tool session: results in, next calls out. */
188
191
  driveSession: (id) => `/v1/harness/local-drives/${encodeURIComponent(id)}/session`,
189
192
  };
193
+ /**
194
+ * What a daemon adds to each local-apps report so the platform can say what an app is missing and
195
+ * why a page never connected. Every key is additive: a platform that predates one ignores it.
196
+ */
197
+ export const LinkReportKey = {
198
+ /** Per app: the channels its page announced in its HELLO. */
199
+ CHANNELS: 'channels',
200
+ /** Per app: instrumentation gaps its verdicts recorded, deduped by kind + missing, newest first. */
201
+ GAPS: 'gaps',
202
+ /** Per app: the framework adapters its page announced. */
203
+ ADAPTERS: 'adapters',
204
+ /**
205
+ * Per app: coverage capabilities that do not apply to it (`CoverageCapability` values, see
206
+ * `NotApplicableSchema`), excluded from both sides of the coverage score. Always sent, empty when
207
+ * every capability applies.
208
+ */
209
+ NOT_APPLICABLE: 'notApplicable',
210
+ /** Top level: dev servers listening on this machine that no Reticle page has connected from. */
211
+ DEV_SERVERS: 'devServers',
212
+ /** Top level: the last page handshake this daemon refused, and why. */
213
+ HELLO_FAILURE: 'helloFailure',
214
+ /** Top level: `.reticle` folders holding runs that never reached the platform. */
215
+ UNSYNCED: 'unsynced',
216
+ };
217
+ /** How many recorded gaps one app reports. */
218
+ export const LINK_APP_GAPS_MAX = 20;
219
+ /**
220
+ * Markers a daemon adds to an app's `channels` beside the protocol channel ids, for the two
221
+ * capabilities no channel names. Sent only on evidence, never while the gap that names the same
222
+ * capability is recorded: absence of both reads as "not seen yet", never as covered.
223
+ */
224
+ export const CoverageMarker = {
225
+ /** The page carries `data-reticle-source` (the build plugin is active). */
226
+ SOURCE: 'source',
227
+ /** The app's snapshots show `data-testid` on its controls. */
228
+ TESTID: 'testid',
229
+ };
230
+ /**
231
+ * The file:line capability's name (`CoverageCapability.SOURCE_MAPPING` is this). Here, beside the
232
+ * markers, so a page can say it does not apply without loading the coverage rules into first load.
233
+ */
234
+ export const SOURCE_MAPPING_CAPABILITY = 'file:line source mapping';
@@ -75,6 +75,8 @@ export declare const ReticleTool: {
75
75
  readonly VERIFY: "reticle_verify";
76
76
  /** read cross-run history (.reticle/project.json) + diff-vs-last for a name. */
77
77
  readonly PROJECT: "reticle_project";
78
+ /** Where the user stands: sign-in, project link, plan, credits, Harness. */
79
+ readonly ACCOUNT: "reticle_account";
78
80
  /** The team's shared memory, read on demand — see memory/memory-tools.ts. */
79
81
  readonly MEMORY: "reticle_memory";
80
82
  /** explicitly record a run outcome (the manual companion to auto-recording). */
@@ -85,6 +85,8 @@ export const ReticleTool = {
85
85
  VERIFY: 'reticle_verify',
86
86
  /** read cross-run history (.reticle/project.json) + diff-vs-last for a name. */
87
87
  PROJECT: 'reticle_project',
88
+ /** Where the user stands: sign-in, project link, plan, credits, Harness. */
89
+ ACCOUNT: 'reticle_account',
88
90
  /** The team's shared memory, read on demand — see memory/memory-tools.ts. */
89
91
  MEMORY: 'reticle_memory',
90
92
  /** explicitly record a run outcome (the manual companion to auto-recording). */
@@ -82,6 +82,11 @@ export declare const ElementQuerySchema: z.ZodObject<{
82
82
  * verification was handed back to the human. Requires `scope`.
83
83
  */
84
84
  self: z.ZodOptional<z.ZodBoolean>;
85
+ /**
86
+ * Compare `text` with its case intact. A search is forgiving about case; a CHECK is not — the
87
+ * text predicate sends this, so "Saved Priya" can fail against a page reading "Saved priya".
88
+ */
89
+ matchCase: z.ZodOptional<z.ZodBoolean>;
85
90
  }, "strict", z.ZodTypeAny, {
86
91
  text?: string | undefined;
87
92
  testid?: string | undefined;
@@ -91,16 +96,17 @@ export declare const ElementQuerySchema: z.ZodObject<{
91
96
  placeholder?: string | undefined;
92
97
  alt?: string | undefined;
93
98
  value?: string | undefined;
94
- name?: string | undefined;
95
- by?: "text" | "testid" | "role" | "component" | "label" | "placeholder" | "alt" | undefined;
96
- attrs?: string[] | undefined;
97
99
  source?: {
98
100
  file: string;
99
101
  line: number;
100
102
  column?: number | undefined;
101
103
  } | undefined;
104
+ name?: string | undefined;
105
+ by?: "text" | "testid" | "role" | "component" | "label" | "placeholder" | "alt" | undefined;
106
+ attrs?: string[] | undefined;
102
107
  scope?: string | undefined;
103
108
  self?: boolean | undefined;
109
+ matchCase?: boolean | undefined;
104
110
  }, {
105
111
  text?: string | undefined;
106
112
  testid?: string | undefined;
@@ -110,16 +116,17 @@ export declare const ElementQuerySchema: z.ZodObject<{
110
116
  placeholder?: string | undefined;
111
117
  alt?: string | undefined;
112
118
  value?: string | undefined;
113
- name?: string | undefined;
114
- by?: "text" | "testid" | "role" | "component" | "label" | "placeholder" | "alt" | undefined;
115
- attrs?: string[] | undefined;
116
119
  source?: {
117
120
  file: string;
118
121
  line: number;
119
122
  column?: number | undefined;
120
123
  } | undefined;
124
+ name?: string | undefined;
125
+ by?: "text" | "testid" | "role" | "component" | "label" | "placeholder" | "alt" | undefined;
126
+ attrs?: string[] | undefined;
121
127
  scope?: string | undefined;
122
128
  self?: boolean | undefined;
129
+ matchCase?: boolean | undefined;
123
130
  }>;
124
131
  export type ElementQuery = z.infer<typeof ElementQuerySchema>;
125
132
  /** Compact semantic descriptor of one element surfaced to the agent. */
@@ -224,6 +231,12 @@ export interface QueryEmptyHint {
224
231
  * the recovery is `{ scope: <ref>, self: true }` rather than another guess at the text.
225
232
  */
226
233
  splitText?: ElementDescriptor;
234
+ /**
235
+ * Present only when a case-exact TEXT check missed and the page shows the text in another case:
236
+ * what it shows. Reported as "split across children" before, with the same failing check as the
237
+ * recovery; the recovery is `ignoreCase: true`.
238
+ */
239
+ caseMiss?: string;
227
240
  /**
228
241
  * Present only when a ROLE+NAME search missed and that role DOES carry a nearly-matching name.
229
242
  *
@@ -71,6 +71,11 @@ export const ElementQuerySchema = z
71
71
  * verification was handed back to the human. Requires `scope`.
72
72
  */
73
73
  self: z.boolean().optional(),
74
+ /**
75
+ * Compare `text` with its case intact. A search is forgiving about case; a CHECK is not — the
76
+ * text predicate sends this, so "Saved Priya" can fail against a page reading "Saved priya".
77
+ */
78
+ matchCase: z.boolean().optional(),
74
79
  })
75
80
  .strict();
76
81
  /** One named flow advertised by the app (mirrors the browser CapabilityFlow). */
@@ -41,7 +41,7 @@ export declare const BUFFER_EVICTION_WARNING = "event buffer evicted older event
41
41
  * blocking and telling you nothing. It is the same tool `#unknownSessionError` already points at,
42
42
  * so the two no-session paths now agree.
43
43
  */
44
- export declare const NO_SESSION_CONNECTED_ERROR = "no browser session connected. Two things to check: (1) your app is running with @reticlehq/browser enabled, and (2) it points at THIS daemon's port \u2014 a mismatch between the app's reticle({ port }) / VITE_RETICLE_WS_URL and the daemon's RETICLE_PORT is the usual cause. Call reticle_sessions for the diagnosis \u2014 it names which of these it is, and what to do next \u2014 rather than retrying this call.";
44
+ export declare const NO_SESSION_CONNECTED_ERROR = "no browser session connected. Two things to check: (1) your app is running with @reticlehq/browser enabled, and (2) it points at THIS daemon's port \u2014 a mismatch between the port the app dials (the build plugin's reticle({ port }), or RETICLE_PORT when the dev server started) and the daemon's port is the usual cause. Call reticle_session { action: \"list\" } for the diagnosis \u2014 it names which of these it is, and what to do next \u2014 rather than retrying this call.";
45
45
  /**
46
46
  * Explains an unconfirmed navigation that did reconnect, but at a different URL.
47
47
  *
@@ -45,7 +45,7 @@ export const BUFFER_EVICTION_WARNING = 'event buffer evicted older events (age/s
45
45
  * blocking and telling you nothing. It is the same tool `#unknownSessionError` already points at,
46
46
  * so the two no-session paths now agree.
47
47
  */
48
- export const NO_SESSION_CONNECTED_ERROR = "no browser session connected. Two things to check: (1) your app is running with @reticlehq/browser enabled, and (2) it points at THIS daemon's port — a mismatch between the app's reticle({ port }) / VITE_RETICLE_WS_URL and the daemon's RETICLE_PORT is the usual cause. Call reticle_sessions for the diagnosis — it names which of these it is, and what to do next — rather than retrying this call.";
48
+ export const NO_SESSION_CONNECTED_ERROR = "no browser session connected. Two things to check: (1) your app is running with @reticlehq/browser enabled, and (2) it points at THIS daemon's port — a mismatch between the port the app dials (the build plugin's reticle({ port }), or RETICLE_PORT when the dev server started) and the daemon's port is the usual cause. Call reticle_session { action: \"list\" } for the diagnosis — it names which of these it is, and what to do next — rather than retrying this call.";
49
49
  /**
50
50
  * Explains an unconfirmed navigation that did reconnect, but at a different URL.
51
51
  *
@@ -62,7 +62,7 @@ export function isCloudCapability(value) {
62
62
  const COPY_BY_CAPABILITY = {
63
63
  [CloudCapability.SHARE_PROOF]: {
64
64
  reason: 'Sharing a verification result with a teammate needs a hosted, linkable proof page.',
65
- unlockedBy: 'Link a free Reticle Cloud account (reticle login), then share the run.',
65
+ unlockedBy: 'Link a free Reticle Cloud account (reticle connect), then share the run.',
66
66
  },
67
67
  [CloudCapability.RUN_HISTORY]: {
68
68
  reason: 'Run history beyond this session lives in the hosted dashboard; local keeps only a buffer.',
@@ -0,0 +1,14 @@
1
+ /**
2
+ * How an agent must write the text that Reticle keeps: flow names, notes, feedback, reports and plans.
3
+ *
4
+ * The standard is ASD-STE100 (Simplified Technical English), followed about 80% of the way. Other
5
+ * agents, other models and people who do not speak English as a first language read this text later.
6
+ * A short, literal sentence keeps one meaning for all of them.
7
+ *
8
+ * One source for every prompt. The open-source harness, the MCP briefing and the platform harness
9
+ * all import these words, so the rule cannot drift between them.
10
+ */
11
+ /** The full rule, for a model prompt that has room for it. */
12
+ export declare const WRITING_RULE: string;
13
+ /** The same rule in one line, for the MCP briefing, which has a hard byte cap. */
14
+ export declare const WRITING_RULE_SHORT = "Write saved text (flows, notes, feedback) in ASD-STE100 Simplified English: short, active, literal.";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * How an agent must write the text that Reticle keeps: flow names, notes, feedback, reports and plans.
3
+ *
4
+ * The standard is ASD-STE100 (Simplified Technical English), followed about 80% of the way. Other
5
+ * agents, other models and people who do not speak English as a first language read this text later.
6
+ * A short, literal sentence keeps one meaning for all of them.
7
+ *
8
+ * One source for every prompt. The open-source harness, the MCP briefing and the platform harness
9
+ * all import these words, so the rule cannot drift between them.
10
+ */
11
+ /** The full rule, for a model prompt that has room for it. */
12
+ export const WRITING_RULE = 'Write all text that you save or report (flow names, notes, feedback, summaries, plans) in Simplified ' +
13
+ 'Technical English (ASD-STE100): short sentences (about 20 words), one topic per sentence, active voice, ' +
14
+ 'simple tenses, commands for instructions, and one meaning for each word. Do not use idioms or slang. ' +
15
+ 'Keep product names, tool names and code identifiers as they are.';
16
+ /** The same rule in one line, for the MCP briefing, which has a hard byte cap. */
17
+ export const WRITING_RULE_SHORT = 'Write saved text (flows, notes, feedback) in ASD-STE100 Simplified English: short, active, literal.';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "3.6.0",
3
+ "version": "3.7.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 and open-verification.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",