@reticlehq/core 1.3.0 → 1.3.1

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/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  <div align="center">
2
2
 
3
3
  <picture>
4
- <source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/reticlehq/reticle@main/assets/readme/lockup-on-dark.png" />
5
- <img alt="Reticle — the proof layer for AI agents" src="https://cdn.jsdelivr.net/gh/reticlehq/reticle@main/assets/readme/lockup-on-light.png" width="300" />
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/reticlehq/reticle@main/assets/readme/dark-logo.png" />
5
+ <img alt="Reticle" src="https://cdn.jsdelivr.net/gh/reticlehq/reticle@main/assets/readme/light-logo.png" width="80" />
6
6
  </picture>
7
7
 
8
+ # Reticle
9
+
8
10
  ### Your AI writes the code. Reticle tells it whether the code actually works — with evidence, not screenshots.
9
11
 
10
12
  <a href="https://github.com/reticlehq/reticle"><img src="https://cdn.jsdelivr.net/gh/reticlehq/reticle@main/assets/readme/hero.gif" alt="Reticle catches a 401 your agent said was 'done' — pass:false with evidence, then a one-line fix to pass:true" width="760" /></a>
package/dist/cli.js CHANGED
@@ -8287,20 +8287,29 @@ var TOOLS = [
8287
8287
  description: "List connected browser sessions (tab url/title, sessionId, last-seen, health: hidden/focused/throttled, and `realInputAvailable` \u2014 true when native CDP/launched real input is driving this tab), plus a `recommendation` pointing to `reticle drive` when a tab is hidden/throttled and may be un-scriptable from here.",
8288
8288
  inputSchema: {},
8289
8289
  outputSchema: {
8290
- sessions: z27.array(z27.object({
8291
- sessionId: z27.string(),
8292
- url: z27.string(),
8293
- projectId: z27.string().optional(),
8294
- title: z27.string().optional(),
8295
- lastSeenMs: z27.number(),
8296
- throttled: z27.boolean(),
8297
- focused: z27.boolean(),
8298
- hidden: z27.boolean(),
8299
- realInputAvailable: z27.boolean().optional(),
8300
- leased: z27.boolean().optional(),
8301
- stale: z27.boolean().optional(),
8302
- recommendation: z27.string().optional()
8303
- })).describe("Connected browser sessions with health state. `projectId` groups sessions by app (stable across port changes); `leased` marks a pool-managed headless context vs a human tab.")
8290
+ sessions: z27.array(
8291
+ // Keep in sync with SessionInfo (session.ts) plus the handler-added realInputAvailable/leased.
8292
+ // A strict MCP client validates this against the payload, so an undeclared field is a hard error.
8293
+ z27.object({
8294
+ sessionId: z27.string(),
8295
+ url: z27.string(),
8296
+ projectId: z27.string().optional(),
8297
+ title: z27.string().optional(),
8298
+ adapters: z27.array(z27.string()),
8299
+ hasCapabilities: z27.boolean(),
8300
+ lastSeenMs: z27.number(),
8301
+ throttled: z27.boolean(),
8302
+ focused: z27.boolean(),
8303
+ hidden: z27.boolean(),
8304
+ realInputAvailable: z27.boolean().optional(),
8305
+ leased: z27.boolean().optional(),
8306
+ stale: z27.boolean().optional(),
8307
+ cleanup_suggestion: z27.string().optional(),
8308
+ pendingMarks: z27.number().optional(),
8309
+ review_suggestion: z27.string().optional(),
8310
+ recommendation: z27.string().optional()
8311
+ })
8312
+ ).describe("Connected browser sessions with health state. `projectId` groups sessions by app (stable across port changes); `leased` marks a pool-managed headless context vs a human tab.")
8304
8313
  },
8305
8314
  handler: async (deps) => {
8306
8315
  const provider = deps.realInput;
package/dist/index.js CHANGED
@@ -1612,12 +1612,21 @@ function isOffViewport(el, rect) {
1612
1612
  const cy = rect.top + rect.height / 2;
1613
1613
  return cx < 0 || cy < 0 || cx > win.innerWidth || cy > win.innerHeight;
1614
1614
  }
1615
+ function isReticleUi(node) {
1616
+ for (let n = node; n !== null; n = n.parentElement) {
1617
+ for (const attr of Array.from(n.attributes)) {
1618
+ if (attr.name.startsWith("data-reticle"))
1619
+ return true;
1620
+ }
1621
+ }
1622
+ return false;
1623
+ }
1615
1624
  function hitTest(el, rect) {
1616
1625
  const doc = el.ownerDocument;
1617
1626
  if (typeof doc.elementFromPoint !== "function")
1618
1627
  return { occluded: false, occludedBy: null };
1619
1628
  const top = doc.elementFromPoint(rect.left + rect.width / 2, rect.top + rect.height / 2);
1620
- if (top === null)
1629
+ if (top === null || isReticleUi(top))
1621
1630
  return { occluded: false, occludedBy: null };
1622
1631
  const lands = top === el || el.contains(top) || top.contains(el);
1623
1632
  return lands ? { occluded: false, occludedBy: null } : { occluded: true, occludedBy: refs.refFor(top) };
@@ -2243,6 +2252,15 @@ function inspect(ref) {
2243
2252
  component
2244
2253
  };
2245
2254
  }
2255
+ function isReticleUi2(node) {
2256
+ for (let n = node; n !== null; n = n.parentElement) {
2257
+ for (const attr of Array.from(n.attributes)) {
2258
+ if (attr.name.startsWith("data-reticle"))
2259
+ return true;
2260
+ }
2261
+ }
2262
+ return false;
2263
+ }
2246
2264
  function isOccluded(el, rect) {
2247
2265
  if (rect.width === 0 || rect.height === 0)
2248
2266
  return false;
@@ -2250,7 +2268,9 @@ function isOccluded(el, rect) {
2250
2268
  if (typeof doc.elementFromPoint !== "function")
2251
2269
  return false;
2252
2270
  const top = doc.elementFromPoint(rect.x + rect.width / 2, rect.y + rect.height / 2);
2253
- return top !== null && top !== el && !el.contains(top);
2271
+ if (top === null || isReticleUi2(top))
2272
+ return false;
2273
+ return top !== el && !el.contains(top);
2254
2274
  }
2255
2275
  function isComponentStateResult(value) {
2256
2276
  return typeof value === "object" && value !== null && "ok" in value && typeof value.ok === "boolean";
@@ -2909,11 +2929,11 @@ function installOverlay() {
2909
2929
  const el = document.createElement("div");
2910
2930
  el.setAttribute("data-reticle-overlay", "");
2911
2931
  el.style.cssText = STYLE;
2912
- el.textContent = "reticle: connecting\u2026";
2932
+ el.textContent = "Reticle: connecting\u2026";
2913
2933
  document.body.appendChild(el);
2914
2934
  return {
2915
2935
  update: (stats) => {
2916
- el.textContent = `reticle ${stats.connected ? "\u25CF" : "\u25CB"} ${String(stats.events)} events`;
2936
+ el.textContent = `Reticle ${stats.connected ? "\u25CF" : "\u25CB"} ${String(stats.events)} events`;
2917
2937
  },
2918
2938
  destroy: () => {
2919
2939
  el.remove();
@@ -3777,7 +3797,7 @@ var Presenter = class {
3777
3797
  <div data-reticle-cursor></div>
3778
3798
  <div data-reticle-ring></div>
3779
3799
  <div data-reticle-hud>
3780
- <div class="reticle-hud-head"><span class="reticle-dot"></span><span class="reticle-brand">reticle</span><span class="reticle-chip" data-reticle-chip></span><span class="reticle-tally" data-reticle-tally hidden></span><span class="reticle-live"></span><span class="reticle-head-sp"></span><button type="button" data-reticle-min-btn title="Minimise" aria-label="Minimise the panel">\u2304</button>${CONTROLS_HEAD_HTML}<span class="reticle-maxhint" aria-hidden="true">\u2303</span></div>
3800
+ <div class="reticle-hud-head"><span class="reticle-dot"></span><span class="reticle-brand">Reticle</span><span class="reticle-chip" data-reticle-chip></span><span class="reticle-tally" data-reticle-tally hidden></span><span class="reticle-live"></span><span class="reticle-head-sp"></span><button type="button" data-reticle-min-btn title="Minimise" aria-label="Minimise the panel">\u2304</button>${CONTROLS_HEAD_HTML}<span class="reticle-maxhint" aria-hidden="true">\u2303</span></div>
3781
3801
  <div class="reticle-act-strip"><span class="reticle-act">idle</span></div>
3782
3802
  ${CONTROLS_BANNER_HTML}
3783
3803
  <div ${DATA_RETICLE_LOG}></div>
package/dist/server.js CHANGED
@@ -8284,20 +8284,29 @@ var TOOLS = [
8284
8284
  description: "List connected browser sessions (tab url/title, sessionId, last-seen, health: hidden/focused/throttled, and `realInputAvailable` \u2014 true when native CDP/launched real input is driving this tab), plus a `recommendation` pointing to `reticle drive` when a tab is hidden/throttled and may be un-scriptable from here.",
8285
8285
  inputSchema: {},
8286
8286
  outputSchema: {
8287
- sessions: z27.array(z27.object({
8288
- sessionId: z27.string(),
8289
- url: z27.string(),
8290
- projectId: z27.string().optional(),
8291
- title: z27.string().optional(),
8292
- lastSeenMs: z27.number(),
8293
- throttled: z27.boolean(),
8294
- focused: z27.boolean(),
8295
- hidden: z27.boolean(),
8296
- realInputAvailable: z27.boolean().optional(),
8297
- leased: z27.boolean().optional(),
8298
- stale: z27.boolean().optional(),
8299
- recommendation: z27.string().optional()
8300
- })).describe("Connected browser sessions with health state. `projectId` groups sessions by app (stable across port changes); `leased` marks a pool-managed headless context vs a human tab.")
8287
+ sessions: z27.array(
8288
+ // Keep in sync with SessionInfo (session.ts) plus the handler-added realInputAvailable/leased.
8289
+ // A strict MCP client validates this against the payload, so an undeclared field is a hard error.
8290
+ z27.object({
8291
+ sessionId: z27.string(),
8292
+ url: z27.string(),
8293
+ projectId: z27.string().optional(),
8294
+ title: z27.string().optional(),
8295
+ adapters: z27.array(z27.string()),
8296
+ hasCapabilities: z27.boolean(),
8297
+ lastSeenMs: z27.number(),
8298
+ throttled: z27.boolean(),
8299
+ focused: z27.boolean(),
8300
+ hidden: z27.boolean(),
8301
+ realInputAvailable: z27.boolean().optional(),
8302
+ leased: z27.boolean().optional(),
8303
+ stale: z27.boolean().optional(),
8304
+ cleanup_suggestion: z27.string().optional(),
8305
+ pendingMarks: z27.number().optional(),
8306
+ review_suggestion: z27.string().optional(),
8307
+ recommendation: z27.string().optional()
8308
+ })
8309
+ ).describe("Connected browser sessions with health state. `projectId` groups sessions by app (stable across port changes); `leased` marks a pool-managed headless context vs a human tab.")
8301
8310
  },
8302
8311
  handler: async (deps) => {
8303
8312
  const provider = deps.realInput;
package/dist/test.js CHANGED
@@ -8004,20 +8004,29 @@ var TOOLS = [
8004
8004
  description: "List connected browser sessions (tab url/title, sessionId, last-seen, health: hidden/focused/throttled, and `realInputAvailable` \u2014 true when native CDP/launched real input is driving this tab), plus a `recommendation` pointing to `reticle drive` when a tab is hidden/throttled and may be un-scriptable from here.",
8005
8005
  inputSchema: {},
8006
8006
  outputSchema: {
8007
- sessions: z27.array(z27.object({
8008
- sessionId: z27.string(),
8009
- url: z27.string(),
8010
- projectId: z27.string().optional(),
8011
- title: z27.string().optional(),
8012
- lastSeenMs: z27.number(),
8013
- throttled: z27.boolean(),
8014
- focused: z27.boolean(),
8015
- hidden: z27.boolean(),
8016
- realInputAvailable: z27.boolean().optional(),
8017
- leased: z27.boolean().optional(),
8018
- stale: z27.boolean().optional(),
8019
- recommendation: z27.string().optional()
8020
- })).describe("Connected browser sessions with health state. `projectId` groups sessions by app (stable across port changes); `leased` marks a pool-managed headless context vs a human tab.")
8007
+ sessions: z27.array(
8008
+ // Keep in sync with SessionInfo (session.ts) plus the handler-added realInputAvailable/leased.
8009
+ // A strict MCP client validates this against the payload, so an undeclared field is a hard error.
8010
+ z27.object({
8011
+ sessionId: z27.string(),
8012
+ url: z27.string(),
8013
+ projectId: z27.string().optional(),
8014
+ title: z27.string().optional(),
8015
+ adapters: z27.array(z27.string()),
8016
+ hasCapabilities: z27.boolean(),
8017
+ lastSeenMs: z27.number(),
8018
+ throttled: z27.boolean(),
8019
+ focused: z27.boolean(),
8020
+ hidden: z27.boolean(),
8021
+ realInputAvailable: z27.boolean().optional(),
8022
+ leased: z27.boolean().optional(),
8023
+ stale: z27.boolean().optional(),
8024
+ cleanup_suggestion: z27.string().optional(),
8025
+ pendingMarks: z27.number().optional(),
8026
+ review_suggestion: z27.string().optional(),
8027
+ recommendation: z27.string().optional()
8028
+ })
8029
+ ).describe("Connected browser sessions with health state. `projectId` groups sessions by app (stable across port changes); `leased` marks a pool-managed headless context vs a human tab.")
8021
8030
  },
8022
8031
  handler: async (deps) => {
8023
8032
  const provider = deps.realInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "One-install Reticle: the dev-only SDK (browser + React adapter) and the spec runner under one package, with subpaths for the source-mapping plugins and the MCP server.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -56,15 +56,15 @@
56
56
  "@types/ws": "^8.5.13",
57
57
  "tsup": "^8.3.5",
58
58
  "typescript": "^5.6.0",
59
- "@reticlehq/babel-plugin": "1.3.0",
60
- "@reticlehq/eslint-plugin": "1.3.0",
61
- "@reticlehq/next": "1.3.0",
62
- "@reticlehq/react": "1.3.0",
63
- "@reticlehq/browser": "1.3.0",
64
- "@reticlehq/protocol": "1.3.0",
65
- "@reticlehq/test": "1.3.0",
66
- "@reticlehq/server": "1.3.0",
67
- "@reticlehq/vite-plugin": "1.3.0"
59
+ "@reticlehq/babel-plugin": "1.3.1",
60
+ "@reticlehq/browser": "1.3.1",
61
+ "@reticlehq/eslint-plugin": "1.3.1",
62
+ "@reticlehq/next": "1.3.1",
63
+ "@reticlehq/protocol": "1.3.1",
64
+ "@reticlehq/react": "1.3.1",
65
+ "@reticlehq/test": "1.3.1",
66
+ "@reticlehq/vite-plugin": "1.3.1",
67
+ "@reticlehq/server": "1.3.1"
68
68
  },
69
69
  "optionalDependencies": {
70
70
  "pixelmatch": "^7.2.0",