@andorra-labs/code 0.1.17 → 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 +441 -53
- 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/errors.js +3 -0
- 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 +34 -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 +21 -0
- package/dist/src/app-server/workspace.js +192 -10
- package/dist/src/app-server.d.ts +82 -26
- package/dist/src/app-server.js +1573 -417
- package/dist/src/attachments.d.ts +10 -0
- package/dist/src/attachments.js +102 -7
- 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/automation-tool.js +2 -1
- package/dist/src/benchmark-scores.d.ts +88 -0
- package/dist/src/benchmark-scores.js +302 -0
- package/dist/src/bridge/command.js +16 -1
- package/dist/src/bridge/control.d.ts +3 -1
- package/dist/src/bridge/control.js +9 -3
- package/dist/src/bridge/engines.d.ts +2 -0
- package/dist/src/bridge/engines.js +9 -0
- package/dist/src/bridge/github.d.ts +108 -0
- package/dist/src/bridge/github.js +378 -0
- package/dist/src/bridge/host-ops.d.ts +3 -3
- package/dist/src/bridge/host-ops.js +14 -2
- package/dist/src/bridge/host.d.ts +2 -0
- package/dist/src/bridge/host.js +70 -16
- 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/bug-report-attachments.d.ts +48 -0
- package/dist/src/bug-report-attachments.js +327 -0
- package/dist/src/bug-report.d.ts +23 -3
- package/dist/src/bug-report.js +72 -9
- package/dist/src/claude-provider.d.ts +1 -0
- package/dist/src/claude-provider.js +77 -36
- package/dist/src/cli.d.ts +1 -3
- package/dist/src/cli.js +245 -62
- package/dist/src/codex-provider.d.ts +1 -0
- package/dist/src/codex-provider.js +44 -8
- package/dist/src/coding-tools.d.ts +1 -0
- package/dist/src/coding-tools.js +28 -7
- package/dist/src/command-screens.d.ts +1 -1
- package/dist/src/command-screens.js +2 -2
- package/dist/src/commands.d.ts +9 -2
- package/dist/src/commands.js +69 -64
- package/dist/src/completion.js +13 -7
- package/dist/src/config.d.ts +14 -3
- package/dist/src/config.js +57 -17
- package/dist/src/context-budget.d.ts +11 -2
- package/dist/src/context-budget.js +38 -4
- 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/DecisionEngine.d.ts +2 -0
- package/dist/src/decision/DecisionManager.d.ts +16 -0
- package/dist/src/decision/DecisionManager.js +75 -2
- package/dist/src/decision/applyTaskKind.d.ts +8 -0
- package/dist/src/decision/applyTaskKind.js +53 -0
- package/dist/src/decision/applyToolMenu.js +6 -2
- package/dist/src/decision/hostedPolicy.js +6 -3
- 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 +4 -1
- package/dist/src/decision/providers/AndorraDecisionProvider.js +29 -7
- package/dist/src/decision/providers/index.js +1 -1
- package/dist/src/decision/taskKind.d.ts +52 -0
- package/dist/src/decision/taskKind.js +76 -0
- package/dist/src/decision/toolFamilies.js +1 -1
- package/dist/src/decision/types.d.ts +3 -1
- package/dist/src/default-graph.js +1 -1
- package/dist/src/efficiency.d.ts +80 -1
- package/dist/src/efficiency.js +119 -4
- package/dist/src/effort-routing.d.ts +27 -0
- package/dist/src/effort-routing.js +34 -0
- package/dist/src/evidence.d.ts +110 -0
- package/dist/src/evidence.js +195 -0
- 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/client.d.ts +19 -0
- package/dist/src/github-app/client.js +21 -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/github-names.d.ts +7 -0
- package/dist/src/github-names.js +7 -0
- 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-preview.d.ts +2 -0
- package/dist/src/graph-preview.js +1 -0
- package/dist/src/graph-runner.js +20 -14
- 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 +49 -12
- package/dist/src/graph-sync.d.ts +2 -1
- package/dist/src/graph-sync.js +13 -0
- package/dist/src/graph-ui/app.js +49 -8
- package/dist/src/graph-ui/index.html +1 -1
- package/dist/src/graphs.d.ts +23 -1
- package/dist/src/graphs.js +58 -7
- package/dist/src/grok-provider.js +17 -14
- package/dist/src/hardened-runtime.js +39 -25
- 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-health-cache.js +1 -1
- package/dist/src/model-metadata.js +3 -7
- package/dist/src/model-override.d.ts +2 -1
- package/dist/src/model-override.js +9 -0
- 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 +16 -1
- package/dist/src/model-tiers.js +31 -7
- 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.d.ts +13 -1
- package/dist/src/provider-engine.js +116 -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 +8 -9
- package/dist/src/providers.js +211 -150
- 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 +83 -57
- package/dist/src/pull-requests.js +266 -225
- 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 +245 -71
- 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 +88 -21
- 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 +47 -2
- package/dist/src/runtime.js +33 -7
- package/dist/src/session-summary.d.ts +8 -0
- package/dist/src/session-summary.js +34 -0
- package/dist/src/sessions.d.ts +32 -0
- package/dist/src/sessions.js +65 -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/bug-report/SKILL.md +51 -7
- 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 +3 -3
- 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 +157 -0
- package/dist/src/task-checkout.js +628 -0
- 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/test-edit-guard.d.ts +30 -0
- package/dist/src/test-edit-guard.js +167 -2
- package/dist/src/thinking-level-detect.d.ts +13 -0
- package/dist/src/thinking-level-detect.js +52 -0
- package/dist/src/thinking-levels.d.ts +30 -0
- package/dist/src/thinking-levels.js +131 -0
- package/dist/src/timers.d.ts +3 -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/tool-catalog.js +1 -1
- package/dist/src/tools.js +67 -22
- package/dist/src/transcript.js +3 -2
- package/dist/src/types.d.ts +48 -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
|
@@ -41,7 +41,7 @@ export interface PullRequestMergeContext {
|
|
|
41
41
|
canDeleteBranch: boolean;
|
|
42
42
|
/** The repository deletes head branches itself once they merge. */
|
|
43
43
|
deletesBranch: boolean;
|
|
44
|
-
/** The repository allows auto-merge
|
|
44
|
+
/** The repository allows GitHub auto-merge. */
|
|
45
45
|
autoMergeAllowed: boolean;
|
|
46
46
|
/** Auto-merge already set up on this PR. */
|
|
47
47
|
autoMerge?: {
|
|
@@ -82,13 +82,6 @@ export declare function mergePullRequest(gh: GhRunner, pullRequestId: string, me
|
|
|
82
82
|
}): Promise<{
|
|
83
83
|
mergeCommit?: string;
|
|
84
84
|
}>;
|
|
85
|
-
/** Sets the PR to merge by itself once its requirements pass (GitHub's auto-merge), with the chosen method and message. */
|
|
86
|
-
export declare function enableAutoMerge(gh: GhRunner, pullRequestId: string, merge: {
|
|
87
|
-
method: PullRequestMergeMethod;
|
|
88
|
-
headSha: string;
|
|
89
|
-
title?: string;
|
|
90
|
-
body?: string;
|
|
91
|
-
}): Promise<void>;
|
|
92
85
|
/** Adds the PR to its base's merge queue at `headSha`, the head the person read; GitHub refuses one that moved. */
|
|
93
86
|
export declare function enqueue(gh: GhRunner, pullRequestId: string, headSha: string): Promise<{
|
|
94
87
|
position?: number;
|
|
@@ -189,10 +189,6 @@ export async function mergePullRequest(gh, pullRequestId, merge) {
|
|
|
189
189
|
const oid = text(record(record(record(data.mergePullRequest).pullRequest).mergeCommit).oid);
|
|
190
190
|
return oid === undefined ? {} : { mergeCommit: oid };
|
|
191
191
|
}
|
|
192
|
-
/** Sets the PR to merge by itself once its requirements pass (GitHub's auto-merge), with the chosen method and message. */
|
|
193
|
-
export async function enableAutoMerge(gh, pullRequestId, merge) {
|
|
194
|
-
await mutate(gh, 'mutation($pr: ID!, $method: PullRequestMergeMethod!, $head: GitObjectID, $title: String, $body: String) { enablePullRequestAutoMerge(input: { pullRequestId: $pr, mergeMethod: $method, expectedHeadOid: $head, commitHeadline: $title, commitBody: $body }) { pullRequest { autoMergeRequest { mergeMethod } } } }', { pr: pullRequestId, method: GITHUB_METHOD[merge.method], head: merge.headSha, ...message(merge.method, merge) });
|
|
195
|
-
}
|
|
196
192
|
/** Adds the PR to its base's merge queue at `headSha`, the head the person read; GitHub refuses one that moved. */
|
|
197
193
|
export async function enqueue(gh, pullRequestId, headSha) {
|
|
198
194
|
const data = await mutate(gh, 'mutation($pr: ID!, $head: GitObjectID) { enqueuePullRequest(input: { pullRequestId: $pr, expectedHeadOid: $head }) { mergeQueueEntry { position state } } }', { pr: pullRequestId, head: headSha });
|
|
@@ -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,22 +129,19 @@ 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
|
-
|
|
142
|
-
through?: string;
|
|
143
|
-
head?: string;
|
|
144
|
-
prompt?: string;
|
|
145
|
-
};
|
|
146
|
-
/** The head commit whose failed checks Auto-fix last handed to the agent; it is not woken for them again. */
|
|
147
|
-
checksHandled?: string;
|
|
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. */
|
|
144
|
+
approvalHandled?: string;
|
|
148
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. */
|
|
149
146
|
reviewBumped?: string;
|
|
150
147
|
carry?: WakeCarry;
|
|
@@ -155,14 +152,18 @@ export interface SessionPullRequest {
|
|
|
155
152
|
checks?: PullRequestChecksRollup;
|
|
156
153
|
/** The Andorra review loop: its settings, and the loop in progress or how the last one ended. */
|
|
157
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
|
+
}[];
|
|
158
162
|
updatedAt: string;
|
|
159
163
|
}
|
|
160
164
|
export type PullRequestState = 'open' | 'draft' | 'merged' | 'closed';
|
|
161
165
|
export declare const isFinishedPullRequest: (state: PullRequestState) => boolean;
|
|
162
|
-
export declare function settleFinishedPullRequest(pullRequest: SessionPullRequest): SessionPullRequest;
|
|
163
166
|
export interface PullRequestSettings {
|
|
164
|
-
autoFix?: boolean;
|
|
165
|
-
mergeWhenReady?: boolean;
|
|
166
167
|
draft?: boolean;
|
|
167
168
|
}
|
|
168
169
|
export interface PullRequestRef {
|
|
@@ -173,6 +174,8 @@ export interface PullRequestRef {
|
|
|
173
174
|
}
|
|
174
175
|
export declare function parsePullRequestUrl(text: string): PullRequestRef | undefined;
|
|
175
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;
|
|
176
179
|
/** The loop state as this engine writes it; anything else is read as no loop. */
|
|
177
180
|
export declare function validReviewLoop(value: unknown): value is ReviewLoopState;
|
|
178
181
|
/** A loop is running: switched on, not ended, with an id. */
|
|
@@ -240,17 +243,39 @@ export declare function ghFor(gh: GhRunner, pullRequest: {
|
|
|
240
243
|
}): GhRunner;
|
|
241
244
|
export declare const noAccountMessage: (url: string) => string;
|
|
242
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']>;
|
|
243
262
|
export declare function applyPullRequestSettings(gh: GhRunner, current: SessionPullRequest, changes: PullRequestSettings, now?: Date): Promise<SessionPullRequest>;
|
|
244
263
|
export declare function applyPullRequestSettingsAsReadableAccount(gh: GhRunner, current: SessionPullRequest, changes: PullRequestSettings, now?: Date): Promise<SessionPullRequest>;
|
|
245
264
|
export type ReviewWait = {
|
|
246
265
|
kind: 'comments';
|
|
247
266
|
prompt: string;
|
|
267
|
+
} | {
|
|
268
|
+
kind: 'activity';
|
|
269
|
+
pullRequest: SessionPullRequest;
|
|
270
|
+
comments: ReviewCommentNotice[];
|
|
271
|
+
reactions: ReviewReactionChange[];
|
|
248
272
|
}
|
|
249
273
|
/** Codex signed off on the head commit: its thumbs-up on the PR, or a review of that commit with no findings. */
|
|
250
274
|
| {
|
|
251
275
|
kind: 'approved';
|
|
252
276
|
pullRequest: SessionPullRequest;
|
|
253
277
|
headSha?: string;
|
|
278
|
+
reactions?: ReviewReactionChange[];
|
|
254
279
|
}
|
|
255
280
|
/** The Andorra review loop posted its next round: the fixer's wake text. */
|
|
256
281
|
| {
|
|
@@ -266,9 +291,6 @@ export type ReviewWait = {
|
|
|
266
291
|
} | {
|
|
267
292
|
kind: 'finished';
|
|
268
293
|
pullRequest: SessionPullRequest;
|
|
269
|
-
} | {
|
|
270
|
-
kind: 'off';
|
|
271
|
-
pullRequest: SessionPullRequest;
|
|
272
294
|
} | {
|
|
273
295
|
kind: 'none';
|
|
274
296
|
} | {
|
|
@@ -288,6 +310,7 @@ export interface PullRequestControl {
|
|
|
288
310
|
*/
|
|
289
311
|
awaitReview?(signal: AbortSignal, timeoutMs: number, origin?: WakeOrigin, options?: {
|
|
290
312
|
approveBump?(detail: string): Promise<void>;
|
|
313
|
+
invocationId?: string;
|
|
291
314
|
}): Promise<ReviewWait>;
|
|
292
315
|
dismiss(): Promise<void>;
|
|
293
316
|
/**
|
|
@@ -337,16 +360,37 @@ export declare const CODE_REVIEWER_LOGINS: readonly string[];
|
|
|
337
360
|
export declare function testCodeReviewer(env?: NodeJS.ProcessEnv): string | undefined;
|
|
338
361
|
/**
|
|
339
362
|
* The Andorra Code GitHub App's own bots (production and the staging dev App), as REST and webhooks name them
|
|
340
|
-
* without `[bot]` and as GraphQL names them.
|
|
341
|
-
*
|
|
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.
|
|
342
365
|
*/
|
|
343
366
|
export declare const ANDORRA_BOT_LOGINS: readonly string[];
|
|
344
367
|
export declare function isCodeReviewer(login: string | undefined, env?: NodeJS.ProcessEnv): boolean;
|
|
345
|
-
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 {
|
|
346
381
|
threads: number;
|
|
347
382
|
comments: number;
|
|
348
383
|
newest?: string;
|
|
349
|
-
|
|
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>;
|
|
350
394
|
/** Codex's login, as GraphQL names it on comments and reviews; on a reaction it carries `[bot]`. */
|
|
351
395
|
export declare const CODEX_REVIEWER_LOGIN = "chatgpt-codex-connector";
|
|
352
396
|
/** The PR comment that asks Codex for a review of the current head. */
|
|
@@ -355,9 +399,21 @@ export declare const REVIEW_BUMP_COMMENT = "@codex review";
|
|
|
355
399
|
export declare const REVIEW_BUMP_DELAY_MS = 30000;
|
|
356
400
|
/** How often a review wait reads Codex's reactions: GitHub sends no notice for a reaction. */
|
|
357
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
|
+
};
|
|
358
411
|
/** What Codex shows on a PR's head commit, as a review wait reads it. */
|
|
359
412
|
export interface ReviewSignals {
|
|
360
413
|
headSha?: string;
|
|
414
|
+
state?: PullRequestState;
|
|
415
|
+
/** Complete main-post snapshot. Unavailable on a failed, inconsistent or truncated read. */
|
|
416
|
+
reactions?: ReviewReaction[];
|
|
361
417
|
/** Open and not a draft: Codex reviews nothing else. */
|
|
362
418
|
open: boolean;
|
|
363
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. */
|
|
@@ -381,32 +437,14 @@ export declare function readReviewSignals(gh: GhRunner, pullRequest: SessionPull
|
|
|
381
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. */
|
|
382
438
|
export declare function codexReviewsRepository(gh: GhRunner, pullRequest: SessionPullRequest, env?: NodeJS.ProcessEnv): Promise<boolean>;
|
|
383
439
|
/**
|
|
384
|
-
* 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
|
|
385
441
|
* the GitHub App and agent writes are set to the bot; `bot` is the bot's login from `GET /v1/github`.
|
|
386
442
|
*/
|
|
387
|
-
export interface
|
|
443
|
+
export interface ReviewCommentWrites {
|
|
388
444
|
botWrites: boolean;
|
|
389
445
|
bot?: string;
|
|
390
446
|
}
|
|
391
447
|
export { botMention, noSelfMention };
|
|
392
|
-
export declare function autoFixPrompt(pullRequest: SessionPullRequest, found: {
|
|
393
|
-
threads: number;
|
|
394
|
-
comments: number;
|
|
395
|
-
}, checks?: {
|
|
396
|
-
checks: readonly FailedCheck[];
|
|
397
|
-
headSha: string;
|
|
398
|
-
branch?: string;
|
|
399
|
-
}, writes?: AutoFixWrites): string;
|
|
400
|
-
/**
|
|
401
|
-
* The head commit's failed checks that Auto-fix hands to the agent: the failed **required** checks, or,
|
|
402
|
-
* where the base branch requires none, every failed check (otherwise Auto-fix would never act on a
|
|
403
|
-
* repository without branch protection). None while the head is one Auto-fix already handed over.
|
|
404
|
-
*/
|
|
405
|
-
export declare function failedChecksToFix(gh: GhRunner, pullRequest: SessionPullRequest): Promise<{
|
|
406
|
-
headSha: string;
|
|
407
|
-
branch?: string;
|
|
408
|
-
checks: FailedCheck[];
|
|
409
|
-
} | undefined>;
|
|
410
448
|
export declare class WatcherLease {
|
|
411
449
|
private readonly home;
|
|
412
450
|
private release?;
|
|
@@ -421,8 +459,6 @@ export interface PullRequestWatcherOptions {
|
|
|
421
459
|
gh: GhRunner;
|
|
422
460
|
intervalMs?: number;
|
|
423
461
|
onUpdated: (sessionId: string, pullRequest: SessionPullRequest) => void;
|
|
424
|
-
wake: (sessionId: string, prompt: string, carry: WakeCarry | undefined, origin: WakeOrigin | undefined) => string;
|
|
425
|
-
wakePending: (id: string) => boolean;
|
|
426
462
|
log?: (level: 'info' | 'warn', detail: string) => void;
|
|
427
463
|
claim?: () => Promise<boolean>;
|
|
428
464
|
/**
|
|
@@ -435,8 +471,6 @@ export interface PullRequestWatcherOptions {
|
|
|
435
471
|
now?: () => number;
|
|
436
472
|
/** How long `checkNow` waits, so a burst of notices for one PR costs one read. */
|
|
437
473
|
checkNowDelayMs?: number;
|
|
438
|
-
/** Who the agent's replies post as on this session's PR, for the Auto-fix prompt; without it, the gh form. */
|
|
439
|
-
agentWrites?: (sessionId: string) => Promise<AutoFixWrites>;
|
|
440
474
|
/** Each read that refreshed a session's record, for the Andorra review loop's round conditions. Must not throw. */
|
|
441
475
|
onRead?: (sessionId: string, pullRequest: SessionPullRequest) => void;
|
|
442
476
|
}
|
|
@@ -465,7 +499,7 @@ export declare class PullRequestWatcher {
|
|
|
465
499
|
constructor(options: PullRequestWatcherOptions);
|
|
466
500
|
start(): void;
|
|
467
501
|
stop(): Promise<void>;
|
|
468
|
-
/** 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. */
|
|
469
503
|
claim(): Promise<boolean>;
|
|
470
504
|
holdsLease(): boolean;
|
|
471
505
|
headSha(sessionId: string): string | undefined;
|
|
@@ -512,11 +546,3 @@ export declare class PullRequestWatcher {
|
|
|
512
546
|
private read;
|
|
513
547
|
private check;
|
|
514
548
|
}
|
|
515
|
-
export declare function confirmAutoFixWake(home: string, gh: GhRunner, sessionId: string, wakeId: string): Promise<{
|
|
516
|
-
deliver: boolean;
|
|
517
|
-
pullRequest?: SessionPullRequest;
|
|
518
|
-
}>;
|
|
519
|
-
/** The record once a pending Auto-fix wake reached the agent: what it handed over counts as handled. */
|
|
520
|
-
export declare function handedOver(pullRequest: SessionPullRequest, pending: NonNullable<SessionPullRequest['pendingFix']>): SessionPullRequest;
|
|
521
|
-
export declare function withoutPendingFix(pullRequest: SessionPullRequest): SessionPullRequest;
|
|
522
|
-
export declare function markAutoFixDelivered(home: string, sessionId: string, wakeId: string): Promise<SessionPullRequest | undefined>;
|