@codeam/shared 2.61.18 → 2.61.20
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/index.d.mts +135 -2
- package/dist/index.d.ts +135 -2
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -130,6 +130,15 @@ declare const UNKNOWN_MODEL_PRICING: ModelPricing;
|
|
|
130
130
|
*/
|
|
131
131
|
declare function getPricing(model: string): ModelPricing;
|
|
132
132
|
declare function getContextWindow(model: string | null): number;
|
|
133
|
+
/**
|
|
134
|
+
* Context window ONLY when it's a confident match — `undefined` otherwise (no
|
|
135
|
+
* default). Use where a wrong value is worse than none: the runtime model
|
|
136
|
+
* selector maps native ACP model ids, many of which are opaque aliases
|
|
137
|
+
* ("default", "opus") or proxied ids (a MiniMax-backed house agent) that aren't
|
|
138
|
+
* in the catalog. Falling back to 200K for those printed a fake "200K context"
|
|
139
|
+
* on every row; returning undefined lets the UI omit the sub-label instead.
|
|
140
|
+
*/
|
|
141
|
+
declare function tryGetContextWindow(model: string | null): number | undefined;
|
|
133
142
|
|
|
134
143
|
type AgentId = 'claude' | 'codex' | 'copilot' | 'coderabbit' | 'cursor' | 'aider' | 'gemini' | 'kimi';
|
|
135
144
|
type AgentAuthKind = 'oauth_token' | 'api_key' | 'setup_token';
|
|
@@ -149,7 +158,10 @@ interface AgentAuth {
|
|
|
149
158
|
interface AgentModel {
|
|
150
159
|
id: string;
|
|
151
160
|
label: string;
|
|
152
|
-
|
|
161
|
+
/** Optional — omitted when the model id isn't in the context-window catalog
|
|
162
|
+
* (opaque native aliases / proxied ids). The UI hides the sub-label rather
|
|
163
|
+
* than printing a misleading default. */
|
|
164
|
+
contextWindow?: number;
|
|
153
165
|
pricing?: {
|
|
154
166
|
inputPerM: number;
|
|
155
167
|
outputPerM: number;
|
|
@@ -477,6 +489,126 @@ declare const INTEGRATION_BRANDING: Record<string, IntegrationBranding>;
|
|
|
477
489
|
declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "posthog", "clickup", "figma", "trello", "resend", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude", "datadog"];
|
|
478
490
|
declare function getIntegrationBranding(id: string): IntegrationBranding | null;
|
|
479
491
|
|
|
492
|
+
/**
|
|
493
|
+
* PR / MR Command Center — pull-request wire types (canonical home).
|
|
494
|
+
*
|
|
495
|
+
* Spec: docs/superpowers/specs/2026-07-18-pr-mr-command-center-design.md (§5, §6, §9, §10).
|
|
496
|
+
*
|
|
497
|
+
* These are the frozen shapes the backend `vcs` engine, the mobile PR panel,
|
|
498
|
+
* and the CLI agent-review handler all agree on byte-for-byte. Pure data — no
|
|
499
|
+
* platform imports. v1 is GitHub-only, but every shape is vendor-neutral so a
|
|
500
|
+
* future GitLab/Bitbucket provider reuses them with ZERO panel/type change.
|
|
501
|
+
*/
|
|
502
|
+
/** A stable, cross-vendor reference to one pull/merge request. */
|
|
503
|
+
interface PrRef {
|
|
504
|
+
/** Repo owner / org (GitHub `owner`). */
|
|
505
|
+
owner: string;
|
|
506
|
+
/** Repo name (GitHub `repo`). */
|
|
507
|
+
repo: string;
|
|
508
|
+
/** PR number within the repo. */
|
|
509
|
+
number: number;
|
|
510
|
+
/** Canonical web URL, when known (e.g. `https://github.com/o/r/pull/12`). */
|
|
511
|
+
url?: string;
|
|
512
|
+
}
|
|
513
|
+
/** The three review actions a reviewer (human or agent) can submit. */
|
|
514
|
+
type PrReviewVerdict = 'approve' | 'request_changes' | 'comment';
|
|
515
|
+
/** One CI check / status on a PR head commit (GitHub Checks + commit statuses). */
|
|
516
|
+
interface PrCheck {
|
|
517
|
+
name: string;
|
|
518
|
+
/** GitHub check-run status. */
|
|
519
|
+
status: 'queued' | 'in_progress' | 'completed';
|
|
520
|
+
/** Conclusion once `status === 'completed'`; null/absent while running. */
|
|
521
|
+
conclusion?: 'success' | 'failure' | 'neutral' | 'cancelled' | 'skipped' | 'timed_out' | 'action_required' | null;
|
|
522
|
+
/** Deep link to the check's details page. */
|
|
523
|
+
detailsUrl?: string;
|
|
524
|
+
}
|
|
525
|
+
/** One existing review already on the PR (shown in the detail screen). */
|
|
526
|
+
interface PrReviewEntry {
|
|
527
|
+
/** Reviewer login. */
|
|
528
|
+
author: string;
|
|
529
|
+
state: 'approved' | 'changes_requested' | 'commented' | 'dismissed' | 'pending';
|
|
530
|
+
submittedAt?: string;
|
|
531
|
+
body?: string;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* A row in the PR Command Center panel (Review Requested / Your Open PRs).
|
|
535
|
+
* Pulled on-open via the GitHub Search API — never polled.
|
|
536
|
+
*/
|
|
537
|
+
interface PullRequestSummary {
|
|
538
|
+
ref: PrRef;
|
|
539
|
+
title: string;
|
|
540
|
+
number: number;
|
|
541
|
+
/** Author login. */
|
|
542
|
+
author: string;
|
|
543
|
+
state: 'open' | 'closed' | 'merged';
|
|
544
|
+
isDraft?: boolean;
|
|
545
|
+
/** Head → base branch names. */
|
|
546
|
+
headBranch: string;
|
|
547
|
+
baseBranch: string;
|
|
548
|
+
updatedAt: string;
|
|
549
|
+
/** `owner/repo`. */
|
|
550
|
+
repoFullName: string;
|
|
551
|
+
/** Aggregate review decision (GitHub `reviewDecision`). */
|
|
552
|
+
reviewDecision?: 'approved' | 'changes_requested' | 'review_required' | null;
|
|
553
|
+
additions?: number;
|
|
554
|
+
deletions?: number;
|
|
555
|
+
changedFiles?: number;
|
|
556
|
+
}
|
|
557
|
+
/** The full PR detail screen payload — summary + body + checks + reviews. */
|
|
558
|
+
interface PullRequestDetail extends PullRequestSummary {
|
|
559
|
+
body?: string;
|
|
560
|
+
checks?: PrCheck[];
|
|
561
|
+
reviews?: PrReviewEntry[];
|
|
562
|
+
/** GitHub mergeability; null while GitHub is still computing it. */
|
|
563
|
+
mergeable?: boolean | null;
|
|
564
|
+
/** Role flags the mobile UI uses to pick the action set (author vs reviewer). */
|
|
565
|
+
viewerIsAuthor?: boolean;
|
|
566
|
+
viewerIsRequestedReviewer?: boolean;
|
|
567
|
+
}
|
|
568
|
+
/** One finding an agent surfaced during a review (mirrors a CodeRabbit hunk). */
|
|
569
|
+
interface AgentReviewFinding {
|
|
570
|
+
/** Repo-relative file path. */
|
|
571
|
+
path: string;
|
|
572
|
+
/** 1-based line the finding anchors to, when locatable. */
|
|
573
|
+
line?: number;
|
|
574
|
+
severity?: 'info' | 'warn' | 'error';
|
|
575
|
+
message: string;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Phase-2 agent-review LAUNCH plan — what the backend composes when the user
|
|
579
|
+
* taps "Ask an agent to review PR #X". Delivered to the review session so the
|
|
580
|
+
* agent (ACP via initial prompt, or CodeRabbit via the CLI handler) knows what
|
|
581
|
+
* to review and which toolkits it has.
|
|
582
|
+
*/
|
|
583
|
+
interface AgentReviewPlan {
|
|
584
|
+
prRef: PrRef;
|
|
585
|
+
/** Which linked agent performs the review (`coderabbit`, `claude`, …). */
|
|
586
|
+
agentId: string;
|
|
587
|
+
/** The composed "review PR #X" initial prompt (ACP agents consume this). */
|
|
588
|
+
prompt: string;
|
|
589
|
+
/** `owner/repo` (or a provider-specific project identifier). */
|
|
590
|
+
repoIdentifier: string;
|
|
591
|
+
/** The PR head branch the deploy checks out and the review runs against. */
|
|
592
|
+
branch: string;
|
|
593
|
+
/** Toolkit integrations the review box is provisioned with (includes `github`). */
|
|
594
|
+
integrationIds: string[];
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Phase-2 agent-review RESULT — POSTed by the review session to
|
|
598
|
+
* `POST /api/vcs/agent-review/report` once the agent finishes posting to
|
|
599
|
+
* GitHub. Drives the completion push + Completion Result card.
|
|
600
|
+
*/
|
|
601
|
+
interface AgentReviewReport {
|
|
602
|
+
prRef: PrRef;
|
|
603
|
+
agentId: string;
|
|
604
|
+
/** The verdict the agent submitted to GitHub. */
|
|
605
|
+
verdict: PrReviewVerdict;
|
|
606
|
+
/** Number of inline comments the agent posted to GitHub. */
|
|
607
|
+
commentCount: number;
|
|
608
|
+
/** The findings behind the verdict (rendered in the Completion Result card). */
|
|
609
|
+
findings?: AgentReviewFinding[];
|
|
610
|
+
}
|
|
611
|
+
|
|
480
612
|
/**
|
|
481
613
|
* Wire-shape types for the CLI / IDE-plugin → backend producer endpoints
|
|
482
614
|
* that feed the mobile Files screen and the Pending Review Queue:
|
|
@@ -1287,6 +1419,7 @@ declare const USER_EVENTS: {
|
|
|
1287
1419
|
readonly CODERABBIT_PROGRESS: "coderabbit_progress";
|
|
1288
1420
|
readonly CODERABBIT_STATUS: "coderabbit_status";
|
|
1289
1421
|
readonly CODERABBIT_REVIEW: "coderabbit_review";
|
|
1422
|
+
readonly VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete";
|
|
1290
1423
|
};
|
|
1291
1424
|
type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
1292
1425
|
|
|
@@ -1302,4 +1435,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
|
1302
1435
|
*/
|
|
1303
1436
|
declare const PREVIEW_DETECT_PROMPT: string;
|
|
1304
1437
|
|
|
1305
|
-
export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type RemoteCommand, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, toRemoteCommand };
|
|
1438
|
+
export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, type RemoteCommand, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, toRemoteCommand, tryGetContextWindow };
|
package/dist/index.d.ts
CHANGED
|
@@ -130,6 +130,15 @@ declare const UNKNOWN_MODEL_PRICING: ModelPricing;
|
|
|
130
130
|
*/
|
|
131
131
|
declare function getPricing(model: string): ModelPricing;
|
|
132
132
|
declare function getContextWindow(model: string | null): number;
|
|
133
|
+
/**
|
|
134
|
+
* Context window ONLY when it's a confident match — `undefined` otherwise (no
|
|
135
|
+
* default). Use where a wrong value is worse than none: the runtime model
|
|
136
|
+
* selector maps native ACP model ids, many of which are opaque aliases
|
|
137
|
+
* ("default", "opus") or proxied ids (a MiniMax-backed house agent) that aren't
|
|
138
|
+
* in the catalog. Falling back to 200K for those printed a fake "200K context"
|
|
139
|
+
* on every row; returning undefined lets the UI omit the sub-label instead.
|
|
140
|
+
*/
|
|
141
|
+
declare function tryGetContextWindow(model: string | null): number | undefined;
|
|
133
142
|
|
|
134
143
|
type AgentId = 'claude' | 'codex' | 'copilot' | 'coderabbit' | 'cursor' | 'aider' | 'gemini' | 'kimi';
|
|
135
144
|
type AgentAuthKind = 'oauth_token' | 'api_key' | 'setup_token';
|
|
@@ -149,7 +158,10 @@ interface AgentAuth {
|
|
|
149
158
|
interface AgentModel {
|
|
150
159
|
id: string;
|
|
151
160
|
label: string;
|
|
152
|
-
|
|
161
|
+
/** Optional — omitted when the model id isn't in the context-window catalog
|
|
162
|
+
* (opaque native aliases / proxied ids). The UI hides the sub-label rather
|
|
163
|
+
* than printing a misleading default. */
|
|
164
|
+
contextWindow?: number;
|
|
153
165
|
pricing?: {
|
|
154
166
|
inputPerM: number;
|
|
155
167
|
outputPerM: number;
|
|
@@ -477,6 +489,126 @@ declare const INTEGRATION_BRANDING: Record<string, IntegrationBranding>;
|
|
|
477
489
|
declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "posthog", "clickup", "figma", "trello", "resend", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude", "datadog"];
|
|
478
490
|
declare function getIntegrationBranding(id: string): IntegrationBranding | null;
|
|
479
491
|
|
|
492
|
+
/**
|
|
493
|
+
* PR / MR Command Center — pull-request wire types (canonical home).
|
|
494
|
+
*
|
|
495
|
+
* Spec: docs/superpowers/specs/2026-07-18-pr-mr-command-center-design.md (§5, §6, §9, §10).
|
|
496
|
+
*
|
|
497
|
+
* These are the frozen shapes the backend `vcs` engine, the mobile PR panel,
|
|
498
|
+
* and the CLI agent-review handler all agree on byte-for-byte. Pure data — no
|
|
499
|
+
* platform imports. v1 is GitHub-only, but every shape is vendor-neutral so a
|
|
500
|
+
* future GitLab/Bitbucket provider reuses them with ZERO panel/type change.
|
|
501
|
+
*/
|
|
502
|
+
/** A stable, cross-vendor reference to one pull/merge request. */
|
|
503
|
+
interface PrRef {
|
|
504
|
+
/** Repo owner / org (GitHub `owner`). */
|
|
505
|
+
owner: string;
|
|
506
|
+
/** Repo name (GitHub `repo`). */
|
|
507
|
+
repo: string;
|
|
508
|
+
/** PR number within the repo. */
|
|
509
|
+
number: number;
|
|
510
|
+
/** Canonical web URL, when known (e.g. `https://github.com/o/r/pull/12`). */
|
|
511
|
+
url?: string;
|
|
512
|
+
}
|
|
513
|
+
/** The three review actions a reviewer (human or agent) can submit. */
|
|
514
|
+
type PrReviewVerdict = 'approve' | 'request_changes' | 'comment';
|
|
515
|
+
/** One CI check / status on a PR head commit (GitHub Checks + commit statuses). */
|
|
516
|
+
interface PrCheck {
|
|
517
|
+
name: string;
|
|
518
|
+
/** GitHub check-run status. */
|
|
519
|
+
status: 'queued' | 'in_progress' | 'completed';
|
|
520
|
+
/** Conclusion once `status === 'completed'`; null/absent while running. */
|
|
521
|
+
conclusion?: 'success' | 'failure' | 'neutral' | 'cancelled' | 'skipped' | 'timed_out' | 'action_required' | null;
|
|
522
|
+
/** Deep link to the check's details page. */
|
|
523
|
+
detailsUrl?: string;
|
|
524
|
+
}
|
|
525
|
+
/** One existing review already on the PR (shown in the detail screen). */
|
|
526
|
+
interface PrReviewEntry {
|
|
527
|
+
/** Reviewer login. */
|
|
528
|
+
author: string;
|
|
529
|
+
state: 'approved' | 'changes_requested' | 'commented' | 'dismissed' | 'pending';
|
|
530
|
+
submittedAt?: string;
|
|
531
|
+
body?: string;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* A row in the PR Command Center panel (Review Requested / Your Open PRs).
|
|
535
|
+
* Pulled on-open via the GitHub Search API — never polled.
|
|
536
|
+
*/
|
|
537
|
+
interface PullRequestSummary {
|
|
538
|
+
ref: PrRef;
|
|
539
|
+
title: string;
|
|
540
|
+
number: number;
|
|
541
|
+
/** Author login. */
|
|
542
|
+
author: string;
|
|
543
|
+
state: 'open' | 'closed' | 'merged';
|
|
544
|
+
isDraft?: boolean;
|
|
545
|
+
/** Head → base branch names. */
|
|
546
|
+
headBranch: string;
|
|
547
|
+
baseBranch: string;
|
|
548
|
+
updatedAt: string;
|
|
549
|
+
/** `owner/repo`. */
|
|
550
|
+
repoFullName: string;
|
|
551
|
+
/** Aggregate review decision (GitHub `reviewDecision`). */
|
|
552
|
+
reviewDecision?: 'approved' | 'changes_requested' | 'review_required' | null;
|
|
553
|
+
additions?: number;
|
|
554
|
+
deletions?: number;
|
|
555
|
+
changedFiles?: number;
|
|
556
|
+
}
|
|
557
|
+
/** The full PR detail screen payload — summary + body + checks + reviews. */
|
|
558
|
+
interface PullRequestDetail extends PullRequestSummary {
|
|
559
|
+
body?: string;
|
|
560
|
+
checks?: PrCheck[];
|
|
561
|
+
reviews?: PrReviewEntry[];
|
|
562
|
+
/** GitHub mergeability; null while GitHub is still computing it. */
|
|
563
|
+
mergeable?: boolean | null;
|
|
564
|
+
/** Role flags the mobile UI uses to pick the action set (author vs reviewer). */
|
|
565
|
+
viewerIsAuthor?: boolean;
|
|
566
|
+
viewerIsRequestedReviewer?: boolean;
|
|
567
|
+
}
|
|
568
|
+
/** One finding an agent surfaced during a review (mirrors a CodeRabbit hunk). */
|
|
569
|
+
interface AgentReviewFinding {
|
|
570
|
+
/** Repo-relative file path. */
|
|
571
|
+
path: string;
|
|
572
|
+
/** 1-based line the finding anchors to, when locatable. */
|
|
573
|
+
line?: number;
|
|
574
|
+
severity?: 'info' | 'warn' | 'error';
|
|
575
|
+
message: string;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Phase-2 agent-review LAUNCH plan — what the backend composes when the user
|
|
579
|
+
* taps "Ask an agent to review PR #X". Delivered to the review session so the
|
|
580
|
+
* agent (ACP via initial prompt, or CodeRabbit via the CLI handler) knows what
|
|
581
|
+
* to review and which toolkits it has.
|
|
582
|
+
*/
|
|
583
|
+
interface AgentReviewPlan {
|
|
584
|
+
prRef: PrRef;
|
|
585
|
+
/** Which linked agent performs the review (`coderabbit`, `claude`, …). */
|
|
586
|
+
agentId: string;
|
|
587
|
+
/** The composed "review PR #X" initial prompt (ACP agents consume this). */
|
|
588
|
+
prompt: string;
|
|
589
|
+
/** `owner/repo` (or a provider-specific project identifier). */
|
|
590
|
+
repoIdentifier: string;
|
|
591
|
+
/** The PR head branch the deploy checks out and the review runs against. */
|
|
592
|
+
branch: string;
|
|
593
|
+
/** Toolkit integrations the review box is provisioned with (includes `github`). */
|
|
594
|
+
integrationIds: string[];
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Phase-2 agent-review RESULT — POSTed by the review session to
|
|
598
|
+
* `POST /api/vcs/agent-review/report` once the agent finishes posting to
|
|
599
|
+
* GitHub. Drives the completion push + Completion Result card.
|
|
600
|
+
*/
|
|
601
|
+
interface AgentReviewReport {
|
|
602
|
+
prRef: PrRef;
|
|
603
|
+
agentId: string;
|
|
604
|
+
/** The verdict the agent submitted to GitHub. */
|
|
605
|
+
verdict: PrReviewVerdict;
|
|
606
|
+
/** Number of inline comments the agent posted to GitHub. */
|
|
607
|
+
commentCount: number;
|
|
608
|
+
/** The findings behind the verdict (rendered in the Completion Result card). */
|
|
609
|
+
findings?: AgentReviewFinding[];
|
|
610
|
+
}
|
|
611
|
+
|
|
480
612
|
/**
|
|
481
613
|
* Wire-shape types for the CLI / IDE-plugin → backend producer endpoints
|
|
482
614
|
* that feed the mobile Files screen and the Pending Review Queue:
|
|
@@ -1287,6 +1419,7 @@ declare const USER_EVENTS: {
|
|
|
1287
1419
|
readonly CODERABBIT_PROGRESS: "coderabbit_progress";
|
|
1288
1420
|
readonly CODERABBIT_STATUS: "coderabbit_status";
|
|
1289
1421
|
readonly CODERABBIT_REVIEW: "coderabbit_review";
|
|
1422
|
+
readonly VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete";
|
|
1290
1423
|
};
|
|
1291
1424
|
type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
1292
1425
|
|
|
@@ -1302,4 +1435,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
|
1302
1435
|
*/
|
|
1303
1436
|
declare const PREVIEW_DETECT_PROMPT: string;
|
|
1304
1437
|
|
|
1305
|
-
export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type RemoteCommand, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, toRemoteCommand };
|
|
1438
|
+
export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, type RemoteCommand, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, toRemoteCommand, tryGetContextWindow };
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,8 @@ __export(index_exports, {
|
|
|
71
71
|
publicToInternal: () => publicToInternal,
|
|
72
72
|
renderToLines: () => renderToLines,
|
|
73
73
|
resolveApiBaseUrl: () => resolveApiBaseUrl,
|
|
74
|
-
toRemoteCommand: () => toRemoteCommand
|
|
74
|
+
toRemoteCommand: () => toRemoteCommand,
|
|
75
|
+
tryGetContextWindow: () => tryGetContextWindow
|
|
75
76
|
});
|
|
76
77
|
module.exports = __toCommonJS(index_exports);
|
|
77
78
|
|
|
@@ -289,6 +290,10 @@ function getContextWindow(model) {
|
|
|
289
290
|
if (!model) return DEFAULT_CONTEXT_WINDOW;
|
|
290
291
|
return longestPrefixMatch(MODEL_CONTEXT_WINDOW, model) ?? DEFAULT_CONTEXT_WINDOW;
|
|
291
292
|
}
|
|
293
|
+
function tryGetContextWindow(model) {
|
|
294
|
+
if (!model) return void 0;
|
|
295
|
+
return longestPrefixMatch(MODEL_CONTEXT_WINDOW, model);
|
|
296
|
+
}
|
|
292
297
|
|
|
293
298
|
// src/agents/registry.ts
|
|
294
299
|
var AGENT_REGISTRY = {
|
|
@@ -1205,7 +1210,11 @@ var USER_EVENTS = {
|
|
|
1205
1210
|
// backend re-publishes them on the per-user SSE bus (mirrored in repo A).
|
|
1206
1211
|
CODERABBIT_PROGRESS: "coderabbit_progress",
|
|
1207
1212
|
CODERABBIT_STATUS: "coderabbit_status",
|
|
1208
|
-
CODERABBIT_REVIEW: "coderabbit_review"
|
|
1213
|
+
CODERABBIT_REVIEW: "coderabbit_review",
|
|
1214
|
+
// VCS / PR Command Center — the backend publishes this after an agent finishes
|
|
1215
|
+
// reviewing a PR (verdict + comment count + findings), driving the mobile
|
|
1216
|
+
// completion screen + push. Mirrored in repo A's app-shared events.ts.
|
|
1217
|
+
VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete"
|
|
1209
1218
|
};
|
|
1210
1219
|
|
|
1211
1220
|
// src/preview-prompts.ts
|
|
@@ -1307,6 +1316,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
1307
1316
|
publicToInternal,
|
|
1308
1317
|
renderToLines,
|
|
1309
1318
|
resolveApiBaseUrl,
|
|
1310
|
-
toRemoteCommand
|
|
1319
|
+
toRemoteCommand,
|
|
1320
|
+
tryGetContextWindow
|
|
1311
1321
|
});
|
|
1312
1322
|
//# sourceMappingURL=index.js.map
|