@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.
- package/dist/src/account-jev-savings.d.ts +4 -0
- package/dist/src/account-jev-savings.js +92 -0
- package/dist/src/acp-agent.js +2 -2
- package/dist/src/agent-execution.js +347 -45
- package/dist/src/agent-mcp.js +7 -1
- package/dist/src/agent-modifiers.js +5 -7
- package/dist/src/analytics.d.ts +19 -1
- package/dist/src/analytics.js +9 -1
- package/dist/src/andorra/entry.js +15 -6
- package/dist/src/andorra/hosted.d.ts +8 -0
- package/dist/src/andorra/hosted.js +22 -3
- package/dist/src/andorra/streams.d.ts +49 -0
- package/dist/src/andorra/streams.js +98 -0
- package/dist/src/antigravity-acp.d.ts +28 -0
- package/dist/src/antigravity-acp.js +150 -0
- package/dist/src/antigravity-terminal.d.ts +2 -0
- package/dist/src/antigravity-terminal.js +214 -0
- package/dist/src/app-server/adaptive-routing-settings.d.ts +37 -0
- package/dist/src/app-server/adaptive-routing-settings.js +69 -0
- package/dist/src/app-server/artifact.d.ts +14 -0
- package/dist/src/app-server/artifact.js +46 -0
- package/dist/src/app-server/legal-protocol.d.ts +33 -0
- package/dist/src/app-server/legal-protocol.js +16 -0
- package/dist/src/app-server/protocol.d.ts +23 -3
- package/dist/src/app-server/protocol.js +3 -1
- package/dist/src/app-server/telemetry-protocol.d.ts +53 -0
- package/dist/src/app-server/telemetry-protocol.js +2 -0
- package/dist/src/app-server/telemetry.d.ts +38 -0
- package/dist/src/app-server/telemetry.js +163 -0
- package/dist/src/app-server/workspace.d.ts +3 -1
- package/dist/src/app-server/workspace.js +39 -8
- package/dist/src/app-server.d.ts +50 -25
- package/dist/src/app-server.js +1008 -400
- package/dist/src/auth/AuthManager.d.ts +11 -2
- package/dist/src/auth/AuthManager.js +56 -13
- package/dist/src/auth/index.d.ts +5 -1
- package/dist/src/auth/index.js +8 -1
- package/dist/src/auth/lifecycle.d.ts +13 -0
- package/dist/src/auth/lifecycle.js +109 -0
- package/dist/src/auth/store.d.ts +1 -0
- package/dist/src/auth/store.js +12 -0
- package/dist/src/auth/types.d.ts +12 -0
- package/dist/src/automation-runner.js +2 -0
- package/dist/src/automation-service.js +7 -2
- package/dist/src/benchmark-scores.d.ts +88 -0
- package/dist/src/benchmark-scores.js +302 -0
- package/dist/src/bridge/command.js +4 -1
- package/dist/src/bridge/control.js +2 -1
- package/dist/src/bridge/engines.d.ts +2 -0
- package/dist/src/bridge/engines.js +9 -0
- package/dist/src/bridge/host-ops.d.ts +2 -2
- package/dist/src/bridge/host-ops.js +4 -2
- package/dist/src/bridge/host.d.ts +2 -0
- package/dist/src/bridge/host.js +63 -12
- package/dist/src/bridge/protocol.d.ts +1 -0
- package/dist/src/bridge/protocol.js +1 -0
- package/dist/src/browser-panel-tool.d.ts +12 -0
- package/dist/src/browser-panel-tool.js +30 -3
- package/dist/src/browser-runner.js +53 -62
- package/dist/src/browser-server.js +10 -4
- package/dist/src/browser-session.d.ts +14 -0
- package/dist/src/browser-session.js +57 -12
- package/dist/src/browser-view.d.ts +40 -1
- package/dist/src/browser-view.js +163 -9
- package/dist/src/browser-window-style.d.ts +27 -0
- package/dist/src/browser-window-style.js +244 -0
- package/dist/src/claude-provider.d.ts +1 -0
- package/dist/src/claude-provider.js +77 -36
- package/dist/src/cli.js +235 -58
- package/dist/src/codex-provider.d.ts +1 -0
- package/dist/src/codex-provider.js +43 -7
- package/dist/src/coding-tools.d.ts +1 -0
- package/dist/src/coding-tools.js +19 -5
- package/dist/src/command-screens.d.ts +1 -1
- package/dist/src/command-screens.js +2 -2
- package/dist/src/commands.d.ts +8 -1
- package/dist/src/commands.js +67 -63
- package/dist/src/completion.js +5 -3
- package/dist/src/config.d.ts +14 -3
- package/dist/src/config.js +54 -16
- package/dist/src/context-budget.d.ts +11 -2
- package/dist/src/context-budget.js +23 -2
- package/dist/src/context-compaction.d.ts +10 -8
- package/dist/src/context-compaction.js +23 -24
- package/dist/src/deadline.js +1 -1
- package/dist/src/decision/DecisionManager.d.ts +5 -0
- package/dist/src/decision/DecisionManager.js +39 -2
- package/dist/src/decision/applyToolMenu.js +6 -2
- package/dist/src/decision/hostedPolicy.js +6 -4
- package/dist/src/decision/optimizationPolicy.d.ts +10 -0
- package/dist/src/decision/optimizationPolicy.js +23 -3
- package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +2 -1
- package/dist/src/decision/providers/AndorraDecisionProvider.js +17 -7
- package/dist/src/decision/providers/index.js +1 -1
- package/dist/src/decision/toolFamilies.js +1 -1
- package/dist/src/decision/types.d.ts +2 -0
- package/dist/src/efficiency.d.ts +75 -1
- package/dist/src/efficiency.js +114 -3
- package/dist/src/extensions.d.ts +2 -0
- package/dist/src/extensions.js +30 -20
- package/dist/src/github-app/agent-writes.d.ts +1 -1
- package/dist/src/github-app/agent-writes.js +1 -1
- package/dist/src/github-app/event-source.d.ts +0 -5
- package/dist/src/github-app/event-source.js +1 -31
- package/dist/src/github-app/metrics.d.ts +2 -5
- package/dist/src/github-app/metrics.js +2 -14
- package/dist/src/github-app/review-loop.d.ts +5 -5
- package/dist/src/github-app/review-loop.js +1 -1
- package/dist/src/github-app/review-node.d.ts +2 -2
- package/dist/src/github-app/triggers.d.ts +3 -3
- package/dist/src/glob-search.d.ts +1 -0
- package/dist/src/glob-search.js +3 -0
- package/dist/src/google-provider.d.ts +5 -28
- package/dist/src/google-provider.js +6 -141
- package/dist/src/graph-editor-session.d.ts +1 -0
- package/dist/src/graph-editor-session.js +2 -0
- package/dist/src/graph-health.js +3 -1
- package/dist/src/graph-runner.js +19 -13
- package/dist/src/graph-selection.d.ts +3 -1
- package/dist/src/graph-selection.js +2 -2
- package/dist/src/graph-server.d.ts +8 -1
- package/dist/src/graph-server.js +45 -10
- package/dist/src/graph-sync.d.ts +2 -1
- package/dist/src/graph-sync.js +13 -0
- package/dist/src/graph-ui/app.js +19 -8
- package/dist/src/graph-ui/index.html +1 -1
- package/dist/src/graphs.d.ts +17 -1
- package/dist/src/graphs.js +51 -5
- package/dist/src/grok-provider.js +17 -14
- package/dist/src/hardened-runtime.js +7 -4
- package/dist/src/jev-savings.d.ts +4 -0
- package/dist/src/jev-savings.js +13 -0
- package/dist/src/legal/client.d.ts +25 -0
- package/dist/src/legal/client.js +47 -0
- package/dist/src/legal/command.d.ts +13 -0
- package/dist/src/legal/command.js +98 -0
- package/dist/src/legal/documents.d.ts +2 -0
- package/dist/src/legal/documents.js +14 -0
- package/dist/src/legal/gate.d.ts +13 -0
- package/dist/src/legal/gate.js +96 -0
- package/dist/src/legal/manifest.d.ts +21 -0
- package/dist/src/legal/manifest.js +23 -0
- package/dist/src/legal/receipt.d.ts +13 -0
- package/dist/src/legal/receipt.js +137 -0
- package/dist/src/legal/release.d.ts +27 -0
- package/dist/src/legal/release.js +28 -0
- package/dist/src/managed-sign-in.d.ts +0 -1
- package/dist/src/managed-sign-in.js +0 -13
- package/dist/src/membership.d.ts +27 -1
- package/dist/src/membership.js +139 -7
- package/dist/src/model-metadata.js +3 -7
- package/dist/src/model-pool.d.ts +99 -0
- package/dist/src/model-pool.js +136 -0
- package/dist/src/model-relay/local.js +5 -0
- package/dist/src/model-relay/remote.d.ts +2 -0
- package/dist/src/model-relay/remote.js +4 -0
- package/dist/src/model-tiers.d.ts +13 -1
- package/dist/src/model-tiers.js +28 -4
- package/dist/src/opencode-cli-provider.js +59 -56
- package/dist/src/opencode-provider.js +16 -13
- package/dist/src/permissions.d.ts +5 -0
- package/dist/src/permissions.js +7 -0
- package/dist/src/plan-pass.js +2 -1
- package/dist/src/pool-scores.d.ts +45 -0
- package/dist/src/pool-scores.js +40 -0
- package/dist/src/provider-connection.js +3 -17
- package/dist/src/provider-engine.js +42 -12
- package/dist/src/provider-request-error.d.ts +8 -0
- package/dist/src/provider-request-error.js +12 -0
- package/dist/src/provider-settings.d.ts +1 -1
- package/dist/src/provider-settings.js +36 -18
- package/dist/src/provider-turn-deadline.d.ts +39 -0
- package/dist/src/provider-turn-deadline.js +139 -0
- package/dist/src/providers.d.ts +3 -9
- package/dist/src/providers.js +181 -146
- package/dist/src/pull-request-merge.d.ts +1 -8
- package/dist/src/pull-request-merge.js +0 -4
- package/dist/src/pull-requests.d.ts +82 -66
- package/dist/src/pull-requests.js +266 -276
- package/dist/src/qa/runtime/ProcessManager.d.ts +5 -1
- package/dist/src/qa/runtime/ProcessManager.js +9 -3
- package/dist/src/react-runtime.js +147 -56
- package/dist/src/reasoning-probe-cloud.d.ts +10 -0
- package/dist/src/reasoning-probe-cloud.js +209 -0
- package/dist/src/remote/engine-pool.d.ts +3 -0
- package/dist/src/remote/engine-pool.js +85 -18
- package/dist/src/remote/recovery.d.ts +6 -0
- package/dist/src/remote/recovery.js +37 -0
- package/dist/src/run-records.d.ts +13 -3
- package/dist/src/run-records.js +59 -34
- package/dist/src/runtime.d.ts +18 -1
- package/dist/src/runtime.js +25 -7
- package/dist/src/session-summary.d.ts +8 -0
- package/dist/src/session-summary.js +34 -0
- package/dist/src/sessions.d.ts +8 -0
- package/dist/src/sessions.js +12 -3
- package/dist/src/shell.js +6 -0
- package/dist/src/side-panel.js +36 -2
- package/dist/src/sign-in-detection.d.ts +1 -1
- package/dist/src/sign-in-detection.js +4 -10
- package/dist/src/sign-in-offer.js +1 -1
- package/dist/src/skill-commands.js +1 -1
- package/dist/src/skills/bundled/graph-manager/SKILL.md +2 -2
- package/dist/src/skills/bundled/graph-manager/patterns.md +13 -19
- package/dist/src/skills/bundled/provenance.json +2 -2
- package/dist/src/subagent-run.js +50 -50
- package/dist/src/subscription-usage.d.ts +50 -0
- package/dist/src/subscription-usage.js +92 -0
- package/dist/src/task-checkout.d.ts +20 -4
- package/dist/src/task-checkout.js +78 -8
- package/dist/src/telemetry/access.d.ts +18 -0
- package/dist/src/telemetry/access.js +43 -0
- package/dist/src/telemetry/aggregate.d.ts +18 -2
- package/dist/src/telemetry/aggregate.js +22 -9
- package/dist/src/telemetry/capture-core.d.ts +33 -14
- package/dist/src/telemetry/capture-core.js +124 -25
- package/dist/src/telemetry/capture.d.ts +3 -2
- package/dist/src/telemetry/capture.js +21 -1
- package/dist/src/telemetry/decision-capture.js +4 -0
- package/dist/src/telemetry/emitter.d.ts +6 -7
- package/dist/src/telemetry/emitter.js +124 -29
- package/dist/src/telemetry/gate.d.ts +41 -2
- package/dist/src/telemetry/gate.js +89 -4
- package/dist/src/telemetry/home.d.ts +1 -0
- package/dist/src/telemetry/home.js +20 -0
- package/dist/src/telemetry/identity.d.ts +6 -3
- package/dist/src/telemetry/identity.js +19 -6
- package/dist/src/telemetry/lifecycle.d.ts +8 -0
- package/dist/src/telemetry/lifecycle.js +76 -0
- package/dist/src/telemetry/outbox.d.ts +13 -8
- package/dist/src/telemetry/outbox.js +68 -12
- package/dist/src/telemetry/permission-command.d.ts +38 -0
- package/dist/src/telemetry/permission-command.js +208 -0
- package/dist/src/telemetry/permission.d.ts +168 -0
- package/dist/src/telemetry/permission.js +662 -0
- package/dist/src/telemetry/record-installation.d.ts +1 -0
- package/dist/src/telemetry/record-installation.js +9 -0
- package/dist/src/telemetry/region-data.d.ts +12 -0
- package/dist/src/telemetry/region-data.js +1314 -0
- package/dist/src/telemetry/region.d.ts +34 -0
- package/dist/src/telemetry/region.js +87 -0
- package/dist/src/telemetry/run-privacy.d.ts +11 -0
- package/dist/src/telemetry/run-privacy.js +165 -0
- package/dist/src/telemetry/schema.d.ts +27 -6
- package/dist/src/telemetry/schema.js +109 -14
- package/dist/src/telemetry/state.d.ts +11 -7
- package/dist/src/telemetry/state.js +39 -6
- package/dist/src/telemetry/surface.d.ts +20 -3
- package/dist/src/telemetry/surface.js +71 -15
- package/dist/src/telemetry/uploader.d.ts +6 -11
- package/dist/src/telemetry/uploader.js +72 -46
- package/dist/src/telemetry/uploads.d.ts +5 -1
- package/dist/src/telemetry/uploads.js +25 -6
- package/dist/src/telemetry/version.d.ts +5 -0
- package/dist/src/telemetry/version.js +34 -0
- package/dist/src/telemetry/workspace.d.ts +4 -1
- package/dist/src/telemetry/workspace.js +18 -3
- package/dist/src/terminal-ui.d.ts +3 -0
- package/dist/src/terminal-ui.js +48 -6
- package/dist/src/thinking-level-detect.d.ts +3 -1
- package/dist/src/thinking-level-detect.js +8 -3
- package/dist/src/thinking-levels.d.ts +1 -1
- package/dist/src/thinking-levels.js +11 -4
- package/dist/src/timers.d.ts +2 -0
- package/dist/src/todos.d.ts +2 -1
- package/dist/src/todos.js +24 -4
- package/dist/src/tool-argument-coercion.d.ts +7 -0
- package/dist/src/tool-argument-coercion.js +49 -0
- package/dist/src/tool-catalog.d.ts +2 -2
- package/dist/src/tools.js +67 -22
- package/dist/src/transcript.js +2 -1
- package/dist/src/types.d.ts +14 -1
- package/dist/src/update.js +4 -0
- package/dist/src/usage-analytics.d.ts +7 -0
- package/dist/src/usage-analytics.js +85 -13
- package/dist/telemetry-consent-v1 +1 -0
- package/package.json +97 -96
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PullRequestChecksRollup } from './pull-request-checks.js';
|
|
2
|
-
import { botMention, noSelfMention
|
|
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
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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.
|
|
344
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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>;
|