@andorra-labs/code 0.1.18 → 0.1.19

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 (277) hide show
  1. package/dist/src/account-jev-savings.d.ts +4 -0
  2. package/dist/src/account-jev-savings.js +92 -0
  3. package/dist/src/acp-agent.js +2 -2
  4. package/dist/src/agent-execution.js +347 -45
  5. package/dist/src/agent-mcp.js +7 -1
  6. package/dist/src/agent-modifiers.js +5 -7
  7. package/dist/src/analytics.d.ts +19 -1
  8. package/dist/src/analytics.js +9 -1
  9. package/dist/src/andorra/entry.js +15 -6
  10. package/dist/src/andorra/hosted.d.ts +8 -0
  11. package/dist/src/andorra/hosted.js +22 -3
  12. package/dist/src/andorra/streams.d.ts +49 -0
  13. package/dist/src/andorra/streams.js +98 -0
  14. package/dist/src/antigravity-acp.d.ts +28 -0
  15. package/dist/src/antigravity-acp.js +150 -0
  16. package/dist/src/antigravity-terminal.d.ts +2 -0
  17. package/dist/src/antigravity-terminal.js +214 -0
  18. package/dist/src/app-server/adaptive-routing-settings.d.ts +37 -0
  19. package/dist/src/app-server/adaptive-routing-settings.js +69 -0
  20. package/dist/src/app-server/artifact.d.ts +14 -0
  21. package/dist/src/app-server/artifact.js +46 -0
  22. package/dist/src/app-server/legal-protocol.d.ts +33 -0
  23. package/dist/src/app-server/legal-protocol.js +16 -0
  24. package/dist/src/app-server/protocol.d.ts +23 -3
  25. package/dist/src/app-server/protocol.js +3 -1
  26. package/dist/src/app-server/telemetry-protocol.d.ts +53 -0
  27. package/dist/src/app-server/telemetry-protocol.js +2 -0
  28. package/dist/src/app-server/telemetry.d.ts +38 -0
  29. package/dist/src/app-server/telemetry.js +163 -0
  30. package/dist/src/app-server/workspace.d.ts +3 -1
  31. package/dist/src/app-server/workspace.js +39 -8
  32. package/dist/src/app-server.d.ts +50 -25
  33. package/dist/src/app-server.js +1008 -400
  34. package/dist/src/auth/AuthManager.d.ts +11 -2
  35. package/dist/src/auth/AuthManager.js +56 -13
  36. package/dist/src/auth/index.d.ts +5 -1
  37. package/dist/src/auth/index.js +8 -1
  38. package/dist/src/auth/lifecycle.d.ts +13 -0
  39. package/dist/src/auth/lifecycle.js +109 -0
  40. package/dist/src/auth/store.d.ts +1 -0
  41. package/dist/src/auth/store.js +12 -0
  42. package/dist/src/auth/types.d.ts +12 -0
  43. package/dist/src/automation-runner.js +2 -0
  44. package/dist/src/automation-service.js +7 -2
  45. package/dist/src/benchmark-scores.d.ts +88 -0
  46. package/dist/src/benchmark-scores.js +302 -0
  47. package/dist/src/bridge/command.js +4 -1
  48. package/dist/src/bridge/control.js +2 -1
  49. package/dist/src/bridge/engines.d.ts +2 -0
  50. package/dist/src/bridge/engines.js +9 -0
  51. package/dist/src/bridge/host-ops.d.ts +2 -2
  52. package/dist/src/bridge/host-ops.js +4 -2
  53. package/dist/src/bridge/host.d.ts +2 -0
  54. package/dist/src/bridge/host.js +63 -12
  55. package/dist/src/bridge/protocol.d.ts +1 -0
  56. package/dist/src/bridge/protocol.js +1 -0
  57. package/dist/src/browser-panel-tool.d.ts +12 -0
  58. package/dist/src/browser-panel-tool.js +30 -3
  59. package/dist/src/browser-runner.js +53 -62
  60. package/dist/src/browser-server.js +10 -4
  61. package/dist/src/browser-session.d.ts +14 -0
  62. package/dist/src/browser-session.js +57 -12
  63. package/dist/src/browser-view.d.ts +40 -1
  64. package/dist/src/browser-view.js +163 -9
  65. package/dist/src/browser-window-style.d.ts +27 -0
  66. package/dist/src/browser-window-style.js +244 -0
  67. package/dist/src/claude-provider.d.ts +1 -0
  68. package/dist/src/claude-provider.js +77 -36
  69. package/dist/src/cli.js +235 -58
  70. package/dist/src/codex-provider.d.ts +1 -0
  71. package/dist/src/codex-provider.js +43 -7
  72. package/dist/src/coding-tools.d.ts +1 -0
  73. package/dist/src/coding-tools.js +19 -5
  74. package/dist/src/command-screens.d.ts +1 -1
  75. package/dist/src/command-screens.js +2 -2
  76. package/dist/src/commands.d.ts +8 -1
  77. package/dist/src/commands.js +67 -63
  78. package/dist/src/completion.js +5 -3
  79. package/dist/src/config.d.ts +14 -3
  80. package/dist/src/config.js +54 -16
  81. package/dist/src/context-budget.d.ts +11 -2
  82. package/dist/src/context-budget.js +23 -2
  83. package/dist/src/context-compaction.d.ts +10 -8
  84. package/dist/src/context-compaction.js +23 -24
  85. package/dist/src/deadline.js +1 -1
  86. package/dist/src/decision/DecisionManager.d.ts +5 -0
  87. package/dist/src/decision/DecisionManager.js +39 -2
  88. package/dist/src/decision/applyToolMenu.js +6 -2
  89. package/dist/src/decision/hostedPolicy.js +6 -4
  90. package/dist/src/decision/optimizationPolicy.d.ts +10 -0
  91. package/dist/src/decision/optimizationPolicy.js +23 -3
  92. package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +2 -1
  93. package/dist/src/decision/providers/AndorraDecisionProvider.js +17 -7
  94. package/dist/src/decision/providers/index.js +1 -1
  95. package/dist/src/decision/toolFamilies.js +1 -1
  96. package/dist/src/decision/types.d.ts +2 -0
  97. package/dist/src/efficiency.d.ts +75 -1
  98. package/dist/src/efficiency.js +114 -3
  99. package/dist/src/extensions.d.ts +2 -0
  100. package/dist/src/extensions.js +30 -20
  101. package/dist/src/github-app/agent-writes.d.ts +1 -1
  102. package/dist/src/github-app/agent-writes.js +1 -1
  103. package/dist/src/github-app/event-source.d.ts +0 -5
  104. package/dist/src/github-app/event-source.js +1 -31
  105. package/dist/src/github-app/metrics.d.ts +2 -5
  106. package/dist/src/github-app/metrics.js +2 -14
  107. package/dist/src/github-app/review-loop.d.ts +5 -5
  108. package/dist/src/github-app/review-loop.js +1 -1
  109. package/dist/src/github-app/review-node.d.ts +2 -2
  110. package/dist/src/github-app/triggers.d.ts +3 -3
  111. package/dist/src/glob-search.d.ts +1 -0
  112. package/dist/src/glob-search.js +3 -0
  113. package/dist/src/google-provider.d.ts +5 -28
  114. package/dist/src/google-provider.js +6 -141
  115. package/dist/src/graph-editor-session.d.ts +1 -0
  116. package/dist/src/graph-editor-session.js +2 -0
  117. package/dist/src/graph-health.js +3 -1
  118. package/dist/src/graph-runner.js +19 -13
  119. package/dist/src/graph-selection.d.ts +3 -1
  120. package/dist/src/graph-selection.js +2 -2
  121. package/dist/src/graph-server.d.ts +8 -1
  122. package/dist/src/graph-server.js +45 -10
  123. package/dist/src/graph-sync.d.ts +2 -1
  124. package/dist/src/graph-sync.js +13 -0
  125. package/dist/src/graph-ui/app.js +19 -8
  126. package/dist/src/graph-ui/index.html +1 -1
  127. package/dist/src/graphs.d.ts +17 -1
  128. package/dist/src/graphs.js +51 -5
  129. package/dist/src/grok-provider.js +17 -14
  130. package/dist/src/hardened-runtime.js +7 -4
  131. package/dist/src/jev-savings.d.ts +4 -0
  132. package/dist/src/jev-savings.js +13 -0
  133. package/dist/src/legal/client.d.ts +25 -0
  134. package/dist/src/legal/client.js +47 -0
  135. package/dist/src/legal/command.d.ts +13 -0
  136. package/dist/src/legal/command.js +98 -0
  137. package/dist/src/legal/documents.d.ts +2 -0
  138. package/dist/src/legal/documents.js +14 -0
  139. package/dist/src/legal/gate.d.ts +13 -0
  140. package/dist/src/legal/gate.js +96 -0
  141. package/dist/src/legal/manifest.d.ts +21 -0
  142. package/dist/src/legal/manifest.js +23 -0
  143. package/dist/src/legal/receipt.d.ts +13 -0
  144. package/dist/src/legal/receipt.js +137 -0
  145. package/dist/src/legal/release.d.ts +27 -0
  146. package/dist/src/legal/release.js +28 -0
  147. package/dist/src/managed-sign-in.d.ts +0 -1
  148. package/dist/src/managed-sign-in.js +0 -13
  149. package/dist/src/membership.d.ts +27 -1
  150. package/dist/src/membership.js +139 -7
  151. package/dist/src/model-metadata.js +3 -7
  152. package/dist/src/model-pool.d.ts +99 -0
  153. package/dist/src/model-pool.js +136 -0
  154. package/dist/src/model-relay/local.js +5 -0
  155. package/dist/src/model-relay/remote.d.ts +2 -0
  156. package/dist/src/model-relay/remote.js +4 -0
  157. package/dist/src/model-tiers.d.ts +13 -1
  158. package/dist/src/model-tiers.js +28 -4
  159. package/dist/src/opencode-cli-provider.js +59 -56
  160. package/dist/src/opencode-provider.js +16 -13
  161. package/dist/src/permissions.d.ts +5 -0
  162. package/dist/src/permissions.js +7 -0
  163. package/dist/src/plan-pass.js +2 -1
  164. package/dist/src/pool-scores.d.ts +45 -0
  165. package/dist/src/pool-scores.js +40 -0
  166. package/dist/src/provider-connection.js +3 -17
  167. package/dist/src/provider-engine.js +42 -12
  168. package/dist/src/provider-request-error.d.ts +8 -0
  169. package/dist/src/provider-request-error.js +12 -0
  170. package/dist/src/provider-settings.d.ts +1 -1
  171. package/dist/src/provider-settings.js +36 -18
  172. package/dist/src/provider-turn-deadline.d.ts +39 -0
  173. package/dist/src/provider-turn-deadline.js +139 -0
  174. package/dist/src/providers.d.ts +3 -9
  175. package/dist/src/providers.js +181 -146
  176. package/dist/src/pull-request-merge.d.ts +1 -8
  177. package/dist/src/pull-request-merge.js +0 -4
  178. package/dist/src/pull-requests.d.ts +82 -66
  179. package/dist/src/pull-requests.js +266 -276
  180. package/dist/src/qa/runtime/ProcessManager.d.ts +5 -1
  181. package/dist/src/qa/runtime/ProcessManager.js +9 -3
  182. package/dist/src/react-runtime.js +147 -56
  183. package/dist/src/reasoning-probe-cloud.d.ts +10 -0
  184. package/dist/src/reasoning-probe-cloud.js +209 -0
  185. package/dist/src/remote/engine-pool.d.ts +3 -0
  186. package/dist/src/remote/engine-pool.js +85 -18
  187. package/dist/src/remote/recovery.d.ts +6 -0
  188. package/dist/src/remote/recovery.js +37 -0
  189. package/dist/src/run-records.d.ts +13 -3
  190. package/dist/src/run-records.js +59 -34
  191. package/dist/src/runtime.d.ts +18 -1
  192. package/dist/src/runtime.js +25 -7
  193. package/dist/src/session-summary.d.ts +8 -0
  194. package/dist/src/session-summary.js +34 -0
  195. package/dist/src/sessions.d.ts +8 -0
  196. package/dist/src/sessions.js +12 -3
  197. package/dist/src/shell.js +6 -0
  198. package/dist/src/side-panel.js +36 -2
  199. package/dist/src/sign-in-detection.d.ts +1 -1
  200. package/dist/src/sign-in-detection.js +4 -10
  201. package/dist/src/sign-in-offer.js +1 -1
  202. package/dist/src/skill-commands.js +1 -1
  203. package/dist/src/skills/bundled/graph-manager/SKILL.md +2 -2
  204. package/dist/src/skills/bundled/graph-manager/patterns.md +13 -19
  205. package/dist/src/skills/bundled/provenance.json +2 -2
  206. package/dist/src/subagent-run.js +50 -50
  207. package/dist/src/subscription-usage.d.ts +50 -0
  208. package/dist/src/subscription-usage.js +92 -0
  209. package/dist/src/task-checkout.d.ts +20 -4
  210. package/dist/src/task-checkout.js +78 -8
  211. package/dist/src/telemetry/access.d.ts +18 -0
  212. package/dist/src/telemetry/access.js +43 -0
  213. package/dist/src/telemetry/aggregate.d.ts +18 -2
  214. package/dist/src/telemetry/aggregate.js +22 -9
  215. package/dist/src/telemetry/capture-core.d.ts +33 -14
  216. package/dist/src/telemetry/capture-core.js +124 -25
  217. package/dist/src/telemetry/capture.d.ts +3 -2
  218. package/dist/src/telemetry/capture.js +21 -1
  219. package/dist/src/telemetry/decision-capture.js +4 -0
  220. package/dist/src/telemetry/emitter.d.ts +6 -7
  221. package/dist/src/telemetry/emitter.js +124 -29
  222. package/dist/src/telemetry/gate.d.ts +41 -2
  223. package/dist/src/telemetry/gate.js +89 -4
  224. package/dist/src/telemetry/home.d.ts +1 -0
  225. package/dist/src/telemetry/home.js +20 -0
  226. package/dist/src/telemetry/identity.d.ts +6 -3
  227. package/dist/src/telemetry/identity.js +19 -6
  228. package/dist/src/telemetry/lifecycle.d.ts +8 -0
  229. package/dist/src/telemetry/lifecycle.js +76 -0
  230. package/dist/src/telemetry/outbox.d.ts +13 -8
  231. package/dist/src/telemetry/outbox.js +68 -12
  232. package/dist/src/telemetry/permission-command.d.ts +38 -0
  233. package/dist/src/telemetry/permission-command.js +208 -0
  234. package/dist/src/telemetry/permission.d.ts +168 -0
  235. package/dist/src/telemetry/permission.js +662 -0
  236. package/dist/src/telemetry/record-installation.d.ts +1 -0
  237. package/dist/src/telemetry/record-installation.js +9 -0
  238. package/dist/src/telemetry/region-data.d.ts +12 -0
  239. package/dist/src/telemetry/region-data.js +1314 -0
  240. package/dist/src/telemetry/region.d.ts +34 -0
  241. package/dist/src/telemetry/region.js +87 -0
  242. package/dist/src/telemetry/run-privacy.d.ts +11 -0
  243. package/dist/src/telemetry/run-privacy.js +165 -0
  244. package/dist/src/telemetry/schema.d.ts +27 -6
  245. package/dist/src/telemetry/schema.js +109 -14
  246. package/dist/src/telemetry/state.d.ts +11 -7
  247. package/dist/src/telemetry/state.js +39 -6
  248. package/dist/src/telemetry/surface.d.ts +20 -3
  249. package/dist/src/telemetry/surface.js +71 -15
  250. package/dist/src/telemetry/uploader.d.ts +6 -11
  251. package/dist/src/telemetry/uploader.js +72 -46
  252. package/dist/src/telemetry/uploads.d.ts +5 -1
  253. package/dist/src/telemetry/uploads.js +25 -6
  254. package/dist/src/telemetry/version.d.ts +5 -0
  255. package/dist/src/telemetry/version.js +34 -0
  256. package/dist/src/telemetry/workspace.d.ts +4 -1
  257. package/dist/src/telemetry/workspace.js +18 -3
  258. package/dist/src/terminal-ui.d.ts +3 -0
  259. package/dist/src/terminal-ui.js +48 -6
  260. package/dist/src/thinking-level-detect.d.ts +3 -1
  261. package/dist/src/thinking-level-detect.js +8 -3
  262. package/dist/src/thinking-levels.d.ts +1 -1
  263. package/dist/src/thinking-levels.js +11 -4
  264. package/dist/src/timers.d.ts +2 -0
  265. package/dist/src/todos.d.ts +2 -1
  266. package/dist/src/todos.js +24 -4
  267. package/dist/src/tool-argument-coercion.d.ts +7 -0
  268. package/dist/src/tool-argument-coercion.js +49 -0
  269. package/dist/src/tool-catalog.d.ts +2 -2
  270. package/dist/src/tools.js +67 -22
  271. package/dist/src/transcript.js +2 -1
  272. package/dist/src/types.d.ts +14 -1
  273. package/dist/src/update.js +4 -0
  274. package/dist/src/usage-analytics.d.ts +7 -0
  275. package/dist/src/usage-analytics.js +85 -13
  276. package/dist/telemetry-consent-v1 +1 -0
  277. package/package.json +97 -96
@@ -1,5 +1,5 @@
1
1
  import { type PullRequestChecksRollup } from './pull-request-checks.js';
2
- import { botMention, noSelfMention, type FailedCheck } from './pull-request-logs.js';
2
+ import { botMention, noSelfMention } from './pull-request-logs.js';
3
3
  import type { WakeCarry, WakeOrigin } from './timers.js';
4
4
  import type { ReviewLoopEnd } from './github-app/review-post.js';
5
5
  /**
@@ -93,7 +93,7 @@ export interface ReviewLoopState {
93
93
  head: string;
94
94
  };
95
95
  /**
96
- * The fixer's wake, beside Auto-fix's `pendingFix`. `runId` is the turn that took it once it was delivered; `held` says
96
+ * The fixer's wake. `runId` is the turn that took it once it was delivered; `held` says
97
97
  * it went straight into a run waiting in await_review rather than starting a turn; `retried` that it was armed again
98
98
  * once because the turn that took it was interrupted.
99
99
  */
@@ -129,24 +129,18 @@ export interface SessionPullRequest {
129
129
  number: number;
130
130
  title?: string;
131
131
  state: PullRequestState;
132
+ /** Retained for older desktop clients. Automatic fixes are disabled. */
132
133
  autoFix: boolean;
134
+ /** GitHub auto-merge state, possibly configured outside Andorra Code. */
133
135
  mergeWhenReady: boolean;
134
136
  attachedAt: string;
137
+ /** The timestamp of the newest review comment already reported to this task. */
135
138
  handledThrough?: string;
136
- /**
137
- * An Auto-fix wake on its way. `through` is the newest review comment it hands over; `head` the head
138
- * commit whose failed checks it hands over; `approval` the head commit it tells the agent Codex signed off on.
139
- */
140
- pendingFix?: {
141
- wakeId: string;
142
- through?: string;
143
- head?: string;
144
- approval?: string;
145
- prompt?: string;
146
- };
147
- /** The head commit whose failed checks Auto-fix last handed to the agent; it is not woken for them again. */
148
- checksHandled?: string;
149
- /** The head commit whose Codex sign-off Auto-fix last told the agent about; it is not woken for it again. */
139
+ /** IDs reported at handledThrough, where several comments can have the same GitHub timestamp. */
140
+ handledCommentIds?: string[];
141
+ /** Last complete snapshot of reactions on the PR's main post, for await_review. */
142
+ reviewReactions?: ReviewReaction[];
143
+ /** The head commit whose Codex sign-off the wait last reported. */
150
144
  approvalHandled?: string;
151
145
  /** The head commit a review wait last asked Codex to review with an "@codex review" comment; it is not asked for that head again. */
152
146
  reviewBumped?: string;
@@ -158,14 +152,18 @@ export interface SessionPullRequest {
158
152
  checks?: PullRequestChecksRollup;
159
153
  /** The Andorra review loop: its settings, and the loop in progress or how the last one ended. */
160
154
  review?: ReviewLoopState;
155
+ /** Pull requests this task had before the current one, newest superseded first; at most ten. */
156
+ previous?: {
157
+ url: string;
158
+ number: number;
159
+ state: PullRequestState;
160
+ updatedAt: string;
161
+ }[];
161
162
  updatedAt: string;
162
163
  }
163
164
  export type PullRequestState = 'open' | 'draft' | 'merged' | 'closed';
164
165
  export declare const isFinishedPullRequest: (state: PullRequestState) => boolean;
165
- export declare function settleFinishedPullRequest(pullRequest: SessionPullRequest): SessionPullRequest;
166
166
  export interface PullRequestSettings {
167
- autoFix?: boolean;
168
- mergeWhenReady?: boolean;
169
167
  draft?: boolean;
170
168
  }
171
169
  export interface PullRequestRef {
@@ -176,6 +174,8 @@ export interface PullRequestRef {
176
174
  }
177
175
  export declare function parsePullRequestUrl(text: string): PullRequestRef | undefined;
178
176
  export declare const pullRequestsDirectory: (home: string) => string;
177
+ /** How many superseded pull requests a task's record keeps. */
178
+ export declare const PREVIOUS_PULL_REQUESTS_MAX = 10;
179
179
  /** The loop state as this engine writes it; anything else is read as no loop. */
180
180
  export declare function validReviewLoop(value: unknown): value is ReviewLoopState;
181
181
  /** A loop is running: switched on, not ended, with an id. */
@@ -243,17 +243,39 @@ export declare function ghFor(gh: GhRunner, pullRequest: {
243
243
  }): GhRunner;
244
244
  export declare const noAccountMessage: (url: string) => string;
245
245
  export declare function newPullRequest(ref: PullRequestRef, now?: Date): SessionPullRequest;
246
+ /**
247
+ * The record for a pull request that replaces a task's previous one: the replaced PR moves into
248
+ * `previous` (newest first, an entry it already had under the new URL goes — that PR is the current
249
+ * one again), at most ten kept. A fresh attach over nothing, or re-attaching the current PR, changes nothing.
250
+ */
251
+ export declare function withSupersededPullRequest(next: SessionPullRequest, replaced: SessionPullRequest | undefined): SessionPullRequest;
252
+ /**
253
+ * A superseded PR's recorded state is only as fresh as the moment it was replaced: the watcher follows
254
+ * the task's current PR, not the ones it replaced. When the current PR's state changes, re-read each
255
+ * remembered PR that is not merged or closed yet (a finished one never changes) and take its newest
256
+ * state. An entry whose state did not change keeps its timestamp, so the refresh cannot make it look
257
+ * more recently worked on than the current PR; a changed one takes the read time, one stamp shared by
258
+ * the whole refresh so read order cannot decide which is newest. A read that fails keeps the stale
259
+ * entry. Nothing to refresh changes nothing.
260
+ */
261
+ export declare function refreshPreviousStates(previous: SessionPullRequest['previous'], gh: GhRunner): Promise<SessionPullRequest['previous']>;
246
262
  export declare function applyPullRequestSettings(gh: GhRunner, current: SessionPullRequest, changes: PullRequestSettings, now?: Date): Promise<SessionPullRequest>;
247
263
  export declare function applyPullRequestSettingsAsReadableAccount(gh: GhRunner, current: SessionPullRequest, changes: PullRequestSettings, now?: Date): Promise<SessionPullRequest>;
248
264
  export type ReviewWait = {
249
265
  kind: 'comments';
250
266
  prompt: string;
267
+ } | {
268
+ kind: 'activity';
269
+ pullRequest: SessionPullRequest;
270
+ comments: ReviewCommentNotice[];
271
+ reactions: ReviewReactionChange[];
251
272
  }
252
273
  /** Codex signed off on the head commit: its thumbs-up on the PR, or a review of that commit with no findings. */
253
274
  | {
254
275
  kind: 'approved';
255
276
  pullRequest: SessionPullRequest;
256
277
  headSha?: string;
278
+ reactions?: ReviewReactionChange[];
257
279
  }
258
280
  /** The Andorra review loop posted its next round: the fixer's wake text. */
259
281
  | {
@@ -269,9 +291,6 @@ export type ReviewWait = {
269
291
  } | {
270
292
  kind: 'finished';
271
293
  pullRequest: SessionPullRequest;
272
- } | {
273
- kind: 'off';
274
- pullRequest: SessionPullRequest;
275
294
  } | {
276
295
  kind: 'none';
277
296
  } | {
@@ -291,6 +310,7 @@ export interface PullRequestControl {
291
310
  */
292
311
  awaitReview?(signal: AbortSignal, timeoutMs: number, origin?: WakeOrigin, options?: {
293
312
  approveBump?(detail: string): Promise<void>;
313
+ invocationId?: string;
294
314
  }): Promise<ReviewWait>;
295
315
  dismiss(): Promise<void>;
296
316
  /**
@@ -340,16 +360,37 @@ export declare const CODE_REVIEWER_LOGINS: readonly string[];
340
360
  export declare function testCodeReviewer(env?: NodeJS.ProcessEnv): string | undefined;
341
361
  /**
342
362
  * The Andorra Code GitHub App's own bots (production and the staging dev App), as REST and webhooks name them
343
- * without `[bot]` and as GraphQL names them. What the agent posts as the bot is never a review to wake Auto-fix
344
- * for, not even when the test-mode reviewer names one of them.
363
+ * without `[bot]` and as GraphQL names them. Their posts are excluded from external review activity even when
364
+ * a test-mode reviewer is set to one of these logins.
345
365
  */
346
366
  export declare const ANDORRA_BOT_LOGINS: readonly string[];
347
367
  export declare function isCodeReviewer(login: string | undefined, env?: NodeJS.ProcessEnv): boolean;
348
- export declare function newReviewComments(gh: GhRunner, pullRequest: SessionPullRequest): Promise<{
368
+ export interface ReviewCommentCandidate {
369
+ id: string;
370
+ source: 'thread' | 'conversation' | 'review';
371
+ author: string;
372
+ body: string;
373
+ url?: string;
374
+ threadId?: string;
375
+ createdAt: string;
376
+ }
377
+ export type ReviewCommentNotice = Pick<ReviewCommentCandidate, 'author' | 'source' | 'url' | 'threadId'> & {
378
+ kind: 'review' | 'approval' | 'unclassified';
379
+ };
380
+ interface ReviewComments {
349
381
  threads: number;
350
382
  comments: number;
351
383
  newest?: string;
352
- }>;
384
+ newestIds?: string[];
385
+ candidates?: ReviewCommentCandidate[];
386
+ }
387
+ /**
388
+ * Counts unread external review comments. Detailed reads also include comments on unresolved threads from
389
+ * human reviewers and submitted review summaries, and return the oldest unread batch with a cursor that preserves comments sharing a timestamp.
390
+ */
391
+ export declare function newReviewComments(gh: GhRunner, pullRequest: SessionPullRequest, options?: {
392
+ includeDetails?: boolean;
393
+ }): Promise<ReviewComments>;
353
394
  /** Codex's login, as GraphQL names it on comments and reviews; on a reaction it carries `[bot]`. */
354
395
  export declare const CODEX_REVIEWER_LOGIN = "chatgpt-codex-connector";
355
396
  /** The PR comment that asks Codex for a review of the current head. */
@@ -358,9 +399,21 @@ export declare const REVIEW_BUMP_COMMENT = "@codex review";
358
399
  export declare const REVIEW_BUMP_DELAY_MS = 30000;
359
400
  /** How often a review wait reads Codex's reactions: GitHub sends no notice for a reaction. */
360
401
  export declare const REVIEW_SIGNAL_INTERVAL_MS = 60000;
402
+ export interface ReviewReaction {
403
+ id: string;
404
+ actor?: string;
405
+ content: string;
406
+ createdAt: string;
407
+ }
408
+ export type ReviewReactionChange = ReviewReaction & {
409
+ kind: 'added' | 'removed';
410
+ };
361
411
  /** What Codex shows on a PR's head commit, as a review wait reads it. */
362
412
  export interface ReviewSignals {
363
413
  headSha?: string;
414
+ state?: PullRequestState;
415
+ /** Complete main-post snapshot. Unavailable on a failed, inconsistent or truncated read. */
416
+ reactions?: ReviewReaction[];
364
417
  /** Open and not a draft: Codex reviews nothing else. */
365
418
  open: boolean;
366
419
  /** Codex signed off on this head: a thumbs-up on the PR newer than the head commit, or a review of it with no findings. */
@@ -384,37 +437,14 @@ export declare function readReviewSignals(gh: GhRunner, pullRequest: SessionPull
384
437
  /** Whether Codex has shown up on any of the repository's 20 newest pull requests: where it never has, nobody asks it for a review. */
385
438
  export declare function codexReviewsRepository(gh: GhRunner, pullRequest: SessionPullRequest, env?: NodeJS.ProcessEnv): Promise<boolean>;
386
439
  /**
387
- * Who the agent's replies and resolves post as, for the Auto-fix prompt: `botWrites` when the PR is covered by
440
+ * Who the agent's replies and resolves post as, for review and mention prompts: `botWrites` when the PR is covered by
388
441
  * the GitHub App and agent writes are set to the bot; `bot` is the bot's login from `GET /v1/github`.
389
442
  */
390
- export interface AutoFixWrites {
443
+ export interface ReviewCommentWrites {
391
444
  botWrites: boolean;
392
445
  bot?: string;
393
446
  }
394
447
  export { botMention, noSelfMention };
395
- export declare function autoFixPrompt(pullRequest: SessionPullRequest, found: {
396
- threads: number;
397
- comments: number;
398
- }, checks?: {
399
- checks: readonly FailedCheck[];
400
- headSha: string;
401
- branch?: string;
402
- }, writes?: AutoFixWrites): string;
403
- /**
404
- * The wake for a sign-off the agent missed: it ended its turn and no review comment arrived to wake it, so
405
- * the watcher tells it what Codex decided, with the same policy the await_review approval answer states.
406
- */
407
- export declare function autoFixApprovalPrompt(pullRequest: SessionPullRequest, headSha: string): string;
408
- /**
409
- * The head commit's failed checks that Auto-fix hands to the agent: the failed **required** checks, or,
410
- * where the base branch requires none, every failed check (otherwise Auto-fix would never act on a
411
- * repository without branch protection). None while the head is one Auto-fix already handed over.
412
- */
413
- export declare function failedChecksToFix(gh: GhRunner, pullRequest: SessionPullRequest): Promise<{
414
- headSha: string;
415
- branch?: string;
416
- checks: FailedCheck[];
417
- } | undefined>;
418
448
  export declare class WatcherLease {
419
449
  private readonly home;
420
450
  private release?;
@@ -429,10 +459,6 @@ export interface PullRequestWatcherOptions {
429
459
  gh: GhRunner;
430
460
  intervalMs?: number;
431
461
  onUpdated: (sessionId: string, pullRequest: SessionPullRequest) => void;
432
- wake: (sessionId: string, prompt: string, carry: WakeCarry | undefined, origin: WakeOrigin | undefined) => string;
433
- wakePending: (id: string) => boolean;
434
- /** Whether the session is waiting in `await_review` now: its own signal read handles an approval, so the watcher stays out. */
435
- isWaiting?: (sessionId: string) => boolean;
436
462
  log?: (level: 'info' | 'warn', detail: string) => void;
437
463
  claim?: () => Promise<boolean>;
438
464
  /**
@@ -445,8 +471,6 @@ export interface PullRequestWatcherOptions {
445
471
  now?: () => number;
446
472
  /** How long `checkNow` waits, so a burst of notices for one PR costs one read. */
447
473
  checkNowDelayMs?: number;
448
- /** Who the agent's replies post as on this session's PR, for the Auto-fix prompt; without it, the gh form. */
449
- agentWrites?: (sessionId: string) => Promise<AutoFixWrites>;
450
474
  /** Each read that refreshed a session's record, for the Andorra review loop's round conditions. Must not throw. */
451
475
  onRead?: (sessionId: string, pullRequest: SessionPullRequest) => void;
452
476
  }
@@ -475,7 +499,7 @@ export declare class PullRequestWatcher {
475
499
  constructor(options: PullRequestWatcherOptions);
476
500
  start(): void;
477
501
  stop(): Promise<void>;
478
- /** Claims the `.watcher` lease: only the process that holds it reads PRs, wakes Auto-fix and pulls GitHub App notices. */
502
+ /** Claims the `.watcher` lease: only the process that holds it reads PR state and pulls GitHub App notices. */
479
503
  claim(): Promise<boolean>;
480
504
  holdsLease(): boolean;
481
505
  headSha(sessionId: string): string | undefined;
@@ -522,11 +546,3 @@ export declare class PullRequestWatcher {
522
546
  private read;
523
547
  private check;
524
548
  }
525
- export declare function confirmAutoFixWake(home: string, gh: GhRunner, sessionId: string, wakeId: string): Promise<{
526
- deliver: boolean;
527
- pullRequest?: SessionPullRequest;
528
- }>;
529
- /** The record once a pending Auto-fix wake reached the agent: what it handed over counts as handled. */
530
- export declare function handedOver(pullRequest: SessionPullRequest, pending: NonNullable<SessionPullRequest['pendingFix']>): SessionPullRequest;
531
- export declare function withoutPendingFix(pullRequest: SessionPullRequest): SessionPullRequest;
532
- export declare function markAutoFixDelivered(home: string, sessionId: string, wakeId: string): Promise<SessionPullRequest | undefined>;