@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
@@ -2,20 +2,16 @@ import { z } from 'zod';
2
2
  /**
3
3
  * The dev-server discovery registry — the return leg of `daemon-registry.ts`.
4
4
  *
5
- * A live daemon already drops `daemon-<port>.json` here so a build plugin can FIND it by projectId
6
- * rather than being told a port in two places. Nothing went the other way: the daemon, and `init`,
7
- * had no way to know a dev server existed at all.
5
+ * A live daemon drops `daemon-<port>.json` here so a build plugin can FIND it by projectId rather
6
+ * than being told a port in two places. This is the other leg: without it the daemon and `init`
7
+ * cannot know a dev server exists at all, and the commonest setup miss — a plugin added to a config
8
+ * the running dev server already read — is invisible from outside that process.
8
9
  *
9
- * That gap is why setup fails silently. Ten things must be true before a tool call can see anything,
10
- * and the commonest miss — a plugin added to a config the running dev server already read — is
11
- * invisible from outside the dev server's own process. So `init` wrote files, printed instructions,
12
- * and left; the person with an uninstrumented page was never told.
13
- *
14
- * The alternative was for `init` to run the dev command itself. It cannot: the command, the script
15
- * name, the package manager, the port and the framework are all things the user or their agent may
16
- * change, and a setup step that hardcodes any of them is a setup step that breaks on the project it
17
- * was most needed for. So nothing here starts anything or names a command. The plugin ALREADY runs
18
- * Node-side when the dev server boots; it announces there, and the reader waits.
10
+ * Nothing here starts anything or names a command. `init` cannot run the dev command itself: the
11
+ * command, the script name, the package manager, the port and the framework are all things the user
12
+ * or their agent may change, and hardcoding any of them breaks on the project it was most needed
13
+ * for. The plugin ALREADY runs Node-side when the dev server boots; it announces there, and the
14
+ * reader waits.
19
15
  *
20
16
  * With both legs present the diagnosis is three-way and every branch is an observed fact:
21
17
  *
@@ -81,11 +77,10 @@ export const DevServerEntrySchema = z.object({
81
77
  /**
82
78
  * The live entries that belong to THIS project.
83
79
  *
84
- * Scoping is not a refinement here, it is the difference between a diagnosis and a wrong answer. A
85
- * dev server registry is machine-wide — one directory holds every app on the box — so "a dev server
86
- * is running" is satisfied by somebody else's app, by another package in the same monorepo, by
87
- * yesterday's terminal. Reported unscoped, `init` for app A told the user their dev server was wired
88
- * and handed them app B's URL: confident, specific, and about a project they were not setting up.
80
+ * Scoping is the difference between a diagnosis and a wrong answer. The registry is machine-wide —
81
+ * one directory holds every app on the box — so unscoped, "a dev server is running" is satisfied by
82
+ * somebody else's app, another package in the same monorepo, or yesterday's terminal, and `init`
83
+ * for app A hands the user app B's URL: confident, specific, and about the wrong project.
89
84
  *
90
85
  * Two ways to belong, because both are true and neither covers the other:
91
86
  *
@@ -110,7 +105,21 @@ export function devServersForProject(entries, scope) {
110
105
  function isWithin(path, base) {
111
106
  if (base === undefined || 0 === base.length)
112
107
  return false;
113
- const norm = (p) => p.split('\\').join('/').replace(/\/+$/, '');
108
+ /*
109
+ * Trailing separators are trimmed with a loop rather than `/\/+$/`, which is a polynomial-ReDoS
110
+ * shape: on a run of slashes followed by anything else the engine retries `\/+` from every start
111
+ * position and rescans to the end each time, so the cost is quadratic in the length of the run.
112
+ * Flagged by CodeQL on this line. A registry root is not obviously hostile input, but this is
113
+ * `@reticlehq/core` — the package everything else depends on — and the loop is O(n), boring, and
114
+ * the same length as the regex it replaces.
115
+ */
116
+ const norm = (p) => {
117
+ const forward = p.split('\\').join('/');
118
+ let end = forward.length;
119
+ while (end > 0 && '/' === forward[end - 1])
120
+ end -= 1;
121
+ return forward.slice(0, end);
122
+ };
114
123
  const target = norm(path);
115
124
  const parent = norm(base);
116
125
  return target === parent || target.startsWith(`${parent}/`);
@@ -2,11 +2,11 @@ import { z } from 'zod';
2
2
  /**
3
3
  * Which directory a projectId lives in, on this machine.
4
4
  *
5
- * Config discovery answers the same question by walking out from the daemon's own working directory,
6
- * which is right whenever the daemon and the app share a tree. It cannot answer it at all when they
7
- * do not — a daemon started in one repo, driving an app in a sibling checkout, will never find that
8
- * app's `.reticle.json` however far it walks. That is not an edge case: an editor starts a
9
- * user-scoped MCP server wherever it likes, so it is the default arrangement.
5
+ * Config discovery answers the same question by walking out from the daemon's working directory,
6
+ * which works only when the daemon and the app share a tree. A daemon started in one repo, driving
7
+ * an app in a sibling checkout, never finds that app's `.reticle.json` however far it walks — and
8
+ * since an editor starts a user-scoped MCP server wherever it likes, that is the default
9
+ * arrangement.
10
10
  *
11
11
  * `init` holds both halves at the moment it runs — the directory it is initialising and the
12
12
  * projectId it has just written into that directory's `.reticle.json`. Recording the pair once makes
@@ -2,11 +2,11 @@ import { z } from 'zod';
2
2
  /**
3
3
  * Which directory a projectId lives in, on this machine.
4
4
  *
5
- * Config discovery answers the same question by walking out from the daemon's own working directory,
6
- * which is right whenever the daemon and the app share a tree. It cannot answer it at all when they
7
- * do not — a daemon started in one repo, driving an app in a sibling checkout, will never find that
8
- * app's `.reticle.json` however far it walks. That is not an edge case: an editor starts a
9
- * user-scoped MCP server wherever it likes, so it is the default arrangement.
5
+ * Config discovery answers the same question by walking out from the daemon's working directory,
6
+ * which works only when the daemon and the app share a tree. A daemon started in one repo, driving
7
+ * an app in a sibling checkout, never finds that app's `.reticle.json` however far it walks — and
8
+ * since an editor starts a user-scoped MCP server wherever it likes, that is the default
9
+ * arrangement.
10
10
  *
11
11
  * `init` holds both halves at the moment it runs — the directory it is initialising and the
12
12
  * projectId it has just written into that directory's `.reticle.json`. Recording the pair once makes
@@ -0,0 +1,31 @@
1
+ {
2
+ "$ref": "#/definitions/ReticleCommand",
3
+ "definitions": {
4
+ "ReticleCommand": {
5
+ "type": "string",
6
+ "enum": [
7
+ "snapshot",
8
+ "query",
9
+ "match",
10
+ "inspect",
11
+ "act",
12
+ "act_sequence",
13
+ "animations",
14
+ "narrate",
15
+ "clock",
16
+ "capabilities",
17
+ "state_read",
18
+ "storage_read",
19
+ "scroll",
20
+ "session_config",
21
+ "presenter",
22
+ "impact",
23
+ "capture",
24
+ "navigate",
25
+ "refresh",
26
+ "flows"
27
+ ]
28
+ }
29
+ },
30
+ "$schema": "http://json-schema.org/draft-07/schema#"
31
+ }
@@ -42,6 +42,7 @@
42
42
  "storage.change",
43
43
  "page.health",
44
44
  "context.opened",
45
+ "dialog.opened",
45
46
  "render.commit",
46
47
  "focus.change",
47
48
  "flow.recorded",