@reticlehq/core 2.13.1 → 3.1.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 (147) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +20 -0
  2. package/dist/artifacts/artifacts-entry.js +20 -0
  3. package/dist/artifacts/flow-composition.d.ts +30 -0
  4. package/dist/artifacts/flow-composition.js +19 -0
  5. package/dist/{flow-constants.d.ts → artifacts/flow-constants.d.ts} +97 -3
  6. package/dist/{flow-constants.js → artifacts/flow-constants.js} +103 -4
  7. package/dist/artifacts/flow-mutation-target.d.ts +39 -0
  8. package/dist/artifacts/flow-mutation-target.js +89 -0
  9. package/dist/artifacts/flow-order.d.ts +30 -0
  10. package/dist/artifacts/flow-order.js +49 -0
  11. package/dist/artifacts/flow-select.d.ts +56 -0
  12. package/dist/artifacts/flow-select.js +56 -0
  13. package/dist/artifacts/flow-step-tool.d.ts +31 -0
  14. package/dist/artifacts/flow-step-tool.js +31 -0
  15. package/dist/artifacts/flow-types.d.ts +3736 -0
  16. package/dist/artifacts/flow-types.js +463 -0
  17. package/dist/artifacts/flow-unreached.d.ts +12 -0
  18. package/dist/artifacts/flow-unreached.js +24 -0
  19. package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +7 -3
  20. package/dist/{impact-savings.js → artifacts/impact-savings.js} +27 -4
  21. package/dist/{impact.d.ts → artifacts/impact.d.ts} +122 -54
  22. package/dist/{impact.js → artifacts/impact.js} +30 -0
  23. package/dist/{journal.d.ts → artifacts/journal.d.ts} +50 -6
  24. package/dist/{journal.js → artifacts/journal.js} +38 -2
  25. package/dist/artifacts/step-effect.d.ts +29 -0
  26. package/dist/artifacts/step-effect.js +28 -0
  27. package/dist/hooks/hook-events.d.ts +311 -0
  28. package/dist/hooks/hook-events.js +127 -0
  29. package/dist/hooks/hooks-entry.d.ts +9 -0
  30. package/dist/hooks/hooks-entry.js +9 -0
  31. package/dist/{brand.d.ts → identity/brand.d.ts} +7 -0
  32. package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
  33. package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
  34. package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
  35. package/dist/{document-identity.js → identity/document-identity.js} +4 -5
  36. package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
  37. package/dist/{source-constants.js → identity/source-constants.js} +4 -4
  38. package/dist/index.d.ts +69 -42
  39. package/dist/index.js +78 -44
  40. package/dist/onboarding.d.ts +114 -0
  41. package/dist/onboarding.js +141 -0
  42. package/dist/realm/registry.d.ts +212 -0
  43. package/dist/realm/registry.js +302 -0
  44. package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +4 -5
  45. package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
  46. package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
  47. package/dist/{project-registry.js → registry/project-registry.js} +5 -5
  48. package/dist/schema/command-name.json +31 -0
  49. package/dist/schema/event-message.json +1 -0
  50. package/dist/schema/event-payloads.json +791 -0
  51. package/dist/schema/event-type.json +1 -0
  52. package/dist/schema/hello-message.json +76 -2
  53. package/dist/schema/reticle-event.json +1 -0
  54. package/dist/schema/reticle-message.json +77 -2
  55. package/dist/telemetry-entry.d.ts +15 -0
  56. package/dist/telemetry-entry.js +15 -0
  57. package/dist/telemetry-feedback.d.ts +13 -14
  58. package/dist/telemetry-feedback.js +11 -12
  59. package/dist/telemetry-license.d.ts +1 -1
  60. package/dist/telemetry-license.js +1 -1
  61. package/dist/telemetry-refusal.d.ts +11 -11
  62. package/dist/telemetry-refusal.js +7 -8
  63. package/dist/telemetry-session.d.ts +49 -57
  64. package/dist/telemetry-session.js +47 -55
  65. package/dist/telemetry.d.ts +229 -198
  66. package/dist/telemetry.js +83 -98
  67. package/dist/tour-entry.d.ts +10 -0
  68. package/dist/tour-entry.js +10 -0
  69. package/dist/tour.d.ts +125 -0
  70. package/dist/tour.js +165 -0
  71. package/dist/{consequence.d.ts → verdict/consequence.d.ts} +35 -11
  72. package/dist/{consequence.js → verdict/consequence.js} +9 -22
  73. package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
  74. package/dist/{findings.d.ts → verdict/findings.d.ts} +149 -41
  75. package/dist/{findings.js → verdict/findings.js} +169 -48
  76. package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +22 -14
  77. package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +23 -15
  78. package/dist/{intent.d.ts → verdict/intent.d.ts} +41 -52
  79. package/dist/{intent.js → verdict/intent.js} +11 -22
  80. package/dist/verdict/revision.d.ts +44 -0
  81. package/dist/verdict/revision.js +53 -0
  82. package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
  83. package/dist/{run-context.js → verdict/run-context.js} +15 -36
  84. package/dist/{security.js → verdict/security.js} +12 -21
  85. package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +369 -93
  86. package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
  87. package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +36 -13
  88. package/dist/{verified-constants.js → verdict/verified-constants.js} +36 -13
  89. package/dist/verdict/verify-progress.d.ts +129 -0
  90. package/dist/verdict/verify-progress.js +74 -0
  91. package/dist/wire/channel.d.ts +46 -0
  92. package/dist/wire/channel.js +95 -0
  93. package/dist/{constants.d.ts → wire/constants/constants.d.ts} +124 -28
  94. package/dist/{constants.js → wire/constants/constants.js} +137 -28
  95. package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +9 -2
  96. package/dist/{session-constants.js → wire/constants/session-constants.js} +9 -2
  97. package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
  98. package/dist/{event-classification.js → wire/event-classification.js} +1 -1
  99. package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +229 -17
  100. package/dist/{event-payloads.js → wire/event-payloads.js} +61 -3
  101. package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
  102. package/dist/{event-priority.js → wire/event-priority.js} +2 -5
  103. package/dist/wire/global-press.d.ts +30 -0
  104. package/dist/wire/global-press.js +54 -0
  105. package/dist/{messages.d.ts → wire/messages.d.ts} +290 -38
  106. package/dist/{messages.js → wire/messages.js} +93 -5
  107. package/dist/wire/narrow.d.ts +39 -0
  108. package/dist/wire/narrow.js +45 -0
  109. package/dist/{net.d.ts → wire/net.d.ts} +49 -10
  110. package/dist/{net.js → wire/net.js} +49 -10
  111. package/dist/wire/platform.d.ts +37 -0
  112. package/dist/wire/platform.js +36 -0
  113. package/dist/{redaction.d.ts → wire/redaction.d.ts} +30 -0
  114. package/dist/wire/redaction.js +274 -0
  115. package/dist/wire/tool-names.d.ts +133 -0
  116. package/dist/wire/tool-names.js +142 -0
  117. package/dist/{toon.js → wire/toon.js} +1 -1
  118. package/dist/{types.d.ts → wire/types.d.ts} +106 -66
  119. package/dist/{types.js → wire/types.js} +24 -4
  120. package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
  121. package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
  122. package/dist/{notices.d.ts → words/notices.d.ts} +24 -12
  123. package/dist/{notices.js → words/notices.js} +27 -12
  124. package/package.json +22 -5
  125. package/dist/flow-types.d.ts +0 -1473
  126. package/dist/flow-types.js +0 -195
  127. package/dist/redaction.js +0 -149
  128. /package/dist/{brand.js → identity/brand.js} +0 -0
  129. /package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
  130. /package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
  131. /package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
  132. /package/dist/{project-id.js → identity/project-id.js} +0 -0
  133. /package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
  134. /package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
  135. /package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
  136. /package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
  137. /package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
  138. /package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
  139. /package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
  140. /package/dist/{state-select.js → wire/state-select.js} +0 -0
  141. /package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
  142. /package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
  143. /package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
  144. /package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
  145. /package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
  146. /package/dist/{upgrade.d.ts → words/upgrade.d.ts} +0 -0
  147. /package/dist/{upgrade.js → words/upgrade.js} +0 -0
@@ -57,6 +57,25 @@ export const THROTTLED_WARNING = 'tab throttled; timer/rAF/pointer gestures may
57
57
  export const THROTTLED_STARVED_NOTE = 'this tab is throttled and has not rendered; a miss here is not evidence the UI is absent. ' +
58
58
  'acquire a scriptable context with reticle_run { tool: "reticle_lease", action: "acquire", url } ' +
59
59
  '(the human can run `reticle drive <url>` if they have a shell)';
60
+ /**
61
+ * Carried by a `console absent` pass whose window starts where the SDK attached.
62
+ *
63
+ * The console channel does not exist until `installConsole` patches `console`, and the documented
64
+ * Next.js install connects through a dynamic import inside a `useEffect` — so a `console.error`
65
+ * fired during first render is never captured. Not evicted, permanently invisible: a reporter
66
+ * proved it with a control, and the same error fired from a click seconds later IS captured.
67
+ * Meanwhile the response said the observation "ran and found none, which is a result, not a missing
68
+ * reading", which is the opposite of true for that stretch of the page's life.
69
+ *
70
+ * Same shape and same argument as PRE_ATTACH_CAVEAT one channel over, and the same deliberate
71
+ * restraint: the grade is NOT downgraded. A clean console is the finding this oracle exists to
72
+ * make, and turning every startup window into `unknown` would retire the check rather than fix it.
73
+ * What changes is only what the pass CLAIMS.
74
+ */
75
+ export const CONSOLE_ATTACH_NOTE = 'this window starts where the SDK attached, and the console channel does not exist until then — ' +
76
+ 'anything logged during first render (or before a dynamically-imported connect ran) was never ' +
77
+ 'captured, so a clean read here cannot tell a silent page apart from one that logged before ' +
78
+ 'anything was watching; drive the page and re-check, or assert on what the error produces';
60
79
  /**
61
80
  * Pushed to the panel when the last agent's MCP connection drops — the agent (any of
62
81
  * Codex/OpenCode/Claude/Hermes) has stopped or is waiting on you. Tells the human, who is
@@ -113,13 +132,11 @@ export const LEASE_IS_INVISIBLE_NOTE = 'note that a lease is a SEPARATE context:
113
132
  /**
114
133
  * A DESKTOP window that has gone to the background, which is a different problem with a different fix.
115
134
  *
116
- * The web answer — acquire a lease, or run `reticle drive <url>` — is unavailable here and saying it
117
- * is worse than saying nothing. A lease opens a headless BROWSER context; an Electron or Tauri app's
118
- * window IS the client, and a browser pointed at the same dev-server URL is a different program with
119
- * no main process, no preload and no Rust commands. Driven on MarkText, a shipped Electron editor:
120
- * its window went behind, the session reported hidden+throttled, and the only advice offered was the
121
- * one thing that could not be done — while the thing that works, bringing the window forward, went
122
- * unsaid.
135
+ * The web answer — acquire a lease, or run `reticle drive <url>` — is unavailable here, and saying
136
+ * it is worse than saying nothing: a lease opens a headless BROWSER context, while an Electron or
137
+ * Tauri app's window IS the client, so a browser pointed at the same dev-server URL is a different
138
+ * program with no main process, no preload and no Rust commands. The thing that works is bringing
139
+ * the window forward.
123
140
  *
124
141
  * No `reticle_lease` and no `reticle drive` in this sentence, deliberately. Both are checked by test.
125
142
  */
@@ -133,11 +150,9 @@ export const HIDDEN_TAB_RECOMMENDATION = 'tab hidden and may be un-focusable fro
133
150
  * stale only means no health heartbeat arrived inside the window. For a tab that is not hidden that
134
151
  * usually means nothing worse than a quiet page, and such a tab is very often driveable.
135
152
  *
136
- * Split out because the old single message treated this as equivalent to hidden and it is not.
137
- * Measured in the field: a session flagged throttled took a sign-in and two clean net-grade verdicts
138
- * with no retries, while the recommendation had already sent the agent into a lease the watching
139
- * human could not see. One flag produced advice that cost the product's main trust surface and
140
- * bought nothing.
153
+ * Treating it as equivalent to hidden costs the drive for nothing: a throttled tab routinely takes
154
+ * a sign-in and grades clean net verdicts with no retries, while advice to lease sends the agent
155
+ * into a context the watching human cannot see.
141
156
  *
142
157
  * So this reports the uncertainty honestly — it MAY be slow, timing-sensitive work is what suffers —
143
158
  * and offers the precise instrument for that (`refuseWhenThrottled`) rather than a different
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "2.13.1",
3
+ "version": "3.1.0",
4
4
  "description": "The Reticle foundation: the shared wire contract — types, zod schemas, constants, messages, and the isomorphic kernel that every Reticle package (browser SDK, server, kits, test harness) imports. Depends only on zod.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -10,6 +10,18 @@
10
10
  "types": "./dist/index.d.ts",
11
11
  "default": "./dist/index.js"
12
12
  },
13
+ "./telemetry": {
14
+ "types": "./dist/telemetry-entry.d.ts",
15
+ "default": "./dist/telemetry-entry.js"
16
+ },
17
+ "./artifacts": {
18
+ "types": "./dist/artifacts/artifacts-entry.d.ts",
19
+ "default": "./dist/artifacts/artifacts-entry.js"
20
+ },
21
+ "./hooks": {
22
+ "types": "./dist/hooks/hooks-entry.d.ts",
23
+ "default": "./dist/hooks/hooks-entry.js"
24
+ },
13
25
  "./schema/*.json": "./dist/schema/*.json",
14
26
  "./desktop-contract": {
15
27
  "types": "./dist/desktop-contract.d.cts",
@@ -19,10 +31,15 @@
19
31
  "types": "./dist/source-constants.d.cts",
20
32
  "default": "./dist/source-constants.cjs"
21
33
  },
22
- "./package.json": "./package.json"
34
+ "./package.json": "./package.json",
35
+ "./tour": {
36
+ "types": "./dist/tour-entry.d.ts",
37
+ "default": "./dist/tour-entry.js"
38
+ }
23
39
  },
24
40
  "dependencies": {
25
- "zod": "^3.24.1"
41
+ "zod": "^3.24.1",
42
+ "open-verification": "1.0.0"
26
43
  },
27
44
  "devDependencies": {
28
45
  "zod-to-json-schema": "^3.24.0"
@@ -32,7 +49,7 @@
32
49
  "repository": {
33
50
  "type": "git",
34
51
  "url": "git+https://github.com/reticlehq/reticle.git",
35
- "directory": "packages/core"
52
+ "directory": "core"
36
53
  },
37
54
  "homepage": "https://github.com/reticlehq/reticle#readme",
38
55
  "bugs": "https://github.com/reticlehq/reticle/issues",
@@ -56,7 +73,7 @@
56
73
  "node": ">=20.0.0"
57
74
  },
58
75
  "scripts": {
59
- "build": "tsc -b && node scripts/gen-schema.mjs && node scripts/gen-desktop-contract.mjs && node scripts/gen-source-constants.mjs",
76
+ "build": "tsc -b && node ../scripts/alias-dist.mjs && node scripts/gen-schema.mjs && node scripts/gen-desktop-contract.mjs && node scripts/gen-source-constants.mjs",
60
77
  "typecheck": "tsc -b",
61
78
  "lint": "eslint src",
62
79
  "test:unit": "vitest run src --passWithNoTests",