@openforge-app/plugin-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend.d.ts +3 -0
- package/dist/backend.js +3 -0
- package/dist/context.d.ts +14 -0
- package/dist/context.js +30 -0
- package/dist/domain.d.ts +579 -0
- package/dist/domain.js +323 -0
- package/dist/frontend.d.ts +7 -0
- package/dist/frontend.js +9 -0
- package/dist/helpers.d.ts +4 -0
- package/dist/helpers.js +9 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +6 -0
- package/dist/manifest.d.ts +58 -0
- package/dist/manifest.js +93 -0
- package/dist/markdown.d.ts +5 -0
- package/dist/markdown.js +54 -0
- package/dist/numberParsing.d.ts +1 -0
- package/dist/numberParsing.js +8 -0
- package/dist/openforgePackageMetadataSchema.json +70 -0
- package/dist/prStatusPresentation.d.ts +30 -0
- package/dist/prStatusPresentation.js +151 -0
- package/dist/projectFileTree.d.ts +68 -0
- package/dist/projectFileTree.js +141 -0
- package/dist/sanitize.d.ts +6 -0
- package/dist/sanitize.js +13 -0
- package/dist/svelteHostRuntimeContract.d.mts +18 -0
- package/dist/svelteHostRuntimeContract.mjs +81 -0
- package/dist/testing.d.ts +223 -0
- package/dist/testing.js +625 -0
- package/dist/types.d.ts +350 -0
- package/dist/types.js +22 -0
- package/dist/ui/MarkdownContent.svelte +30 -0
- package/dist/ui/ResizablePanel.svelte +146 -0
- package/dist/vite.d.ts +15 -0
- package/dist/vite.js +78 -0
- package/package.json +81 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BackendMethodRegistration, BackendMethodRegistry, BackendOpenForgeAPI, BackendPlugin, BackendPluginContext, BackgroundServiceRegistration, BackgroundServiceRegistry, CommandDescriptor, CommandRegistry, CommandRegistration, CommandShortcutMetadata, Disposable, NavigationAPI, OpenForgeContextSnapshot, OpenForgeNavigationRequest, OpenForgeNavigationSnapshot } from './types';
|
|
2
|
+
export declare function defineBackendPlugin<const TPlugin extends BackendPlugin>(plugin: TPlugin): TPlugin;
|
|
3
|
+
export type { BackendMethodRegistration, BackendMethodRegistry, BackendOpenForgeAPI, BackendPlugin, BackendPluginContext, BackgroundServiceRegistration, BackgroundServiceRegistry, CommandDescriptor, CommandRegistry, CommandRegistration, CommandShortcutMetadata, Disposable, NavigationAPI, OpenForgeContextSnapshot, OpenForgeNavigationRequest, OpenForgeNavigationSnapshot, };
|
package/dist/backend.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Disposable, OpenForgePackageMetadata, OpenForgePluginContext, SubscriptionSink, SupportedOpenForgeApiVersion } from './types';
|
|
2
|
+
declare class SubscriptionSet implements SubscriptionSink {
|
|
3
|
+
private readonly subscriptions;
|
|
4
|
+
add(subscription: Disposable | (() => void)): void;
|
|
5
|
+
disposeAll(): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare class PluginContextImpl implements OpenForgePluginContext {
|
|
8
|
+
readonly pluginId: string;
|
|
9
|
+
readonly apiVersion: SupportedOpenForgeApiVersion;
|
|
10
|
+
readonly packageMetadata: OpenForgePackageMetadata;
|
|
11
|
+
readonly subscriptions: SubscriptionSet;
|
|
12
|
+
constructor(pluginId: string, apiVersion: SupportedOpenForgeApiVersion, packageMetadata: OpenForgePackageMetadata);
|
|
13
|
+
}
|
|
14
|
+
export {};
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
class SubscriptionSet {
|
|
2
|
+
subscriptions = new Set();
|
|
3
|
+
add(subscription) {
|
|
4
|
+
this.subscriptions.add(subscription);
|
|
5
|
+
}
|
|
6
|
+
async disposeAll() {
|
|
7
|
+
const subscriptions = [...this.subscriptions];
|
|
8
|
+
this.subscriptions.clear();
|
|
9
|
+
await Promise.all(subscriptions.map(async (subscription) => {
|
|
10
|
+
if (typeof subscription === 'function') {
|
|
11
|
+
subscription();
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
await subscription.dispose();
|
|
15
|
+
}
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class PluginContextImpl {
|
|
20
|
+
pluginId;
|
|
21
|
+
apiVersion;
|
|
22
|
+
packageMetadata;
|
|
23
|
+
subscriptions;
|
|
24
|
+
constructor(pluginId, apiVersion, packageMetadata) {
|
|
25
|
+
this.pluginId = pluginId;
|
|
26
|
+
this.apiVersion = apiVersion;
|
|
27
|
+
this.packageMetadata = packageMetadata;
|
|
28
|
+
this.subscriptions = new SubscriptionSet();
|
|
29
|
+
}
|
|
30
|
+
}
|
package/dist/domain.d.ts
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import type { PluginViewKey } from './types';
|
|
2
|
+
export type { PluginViewKey } from './types';
|
|
3
|
+
export type BoardStatus = 'backlog' | 'doing' | 'done';
|
|
4
|
+
/**
|
|
5
|
+
* The subset of {@link BoardStatus} a client may assign to a task.
|
|
6
|
+
*
|
|
7
|
+
* `'done'` is a legacy, recognized-but-unreachable status (AVIV-118 removed the
|
|
8
|
+
* Done lane and its reopen path). Assigning it hides the task from every board
|
|
9
|
+
* surface with no runtime cleanup, so it stays readable on existing rows but is
|
|
10
|
+
* never a valid write target. The backend rejects it regardless; this type gives
|
|
11
|
+
* plugin and renderer callers a compile-time signal.
|
|
12
|
+
*/
|
|
13
|
+
export type WritableBoardStatus = Exclude<BoardStatus, 'done'>;
|
|
14
|
+
export type WorktreeSource = 'newBranchFromMain' | 'existingBranch' | 'disabled';
|
|
15
|
+
export interface Task {
|
|
16
|
+
id: string;
|
|
17
|
+
initial_prompt: string;
|
|
18
|
+
status: BoardStatus;
|
|
19
|
+
prompt: string | null;
|
|
20
|
+
/** Explicit display title; null means fall back to the prompt-derived title. */
|
|
21
|
+
title: string | null;
|
|
22
|
+
/** Origin of the explicit display title; manual titles are never overwritten by automation. */
|
|
23
|
+
title_source: 'manual' | 'generated' | null;
|
|
24
|
+
/** Unix timestamp for the first generated title write; null means generation has not written yet. */
|
|
25
|
+
title_generated_at: number | null;
|
|
26
|
+
summary: string | null;
|
|
27
|
+
agent: string | null;
|
|
28
|
+
permission_mode: string | null;
|
|
29
|
+
worktree_source: WorktreeSource | null;
|
|
30
|
+
worktree_branch: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the task's start prompt includes the OpenForge handoff-notes
|
|
33
|
+
* (task management) block. Defaults to true; false opts the task out so the
|
|
34
|
+
* agent is not instructed to maintain Handoff Notes.
|
|
35
|
+
*/
|
|
36
|
+
handoff_notes_enabled: boolean;
|
|
37
|
+
depends_on: string[];
|
|
38
|
+
project_id: string | null;
|
|
39
|
+
created_at: number;
|
|
40
|
+
updated_at: number;
|
|
41
|
+
}
|
|
42
|
+
export interface GitBranchInfo {
|
|
43
|
+
name: string;
|
|
44
|
+
is_current: boolean;
|
|
45
|
+
is_remote: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* How an existing branch relates to its `origin/<branch>` remote-tracking ref,
|
|
49
|
+
* as reported by the read-only `inspectExistingBranch` pre-flight. Drives whether
|
|
50
|
+
* a task can start silently or must prompt the user to resolve divergence.
|
|
51
|
+
*/
|
|
52
|
+
export type ExistingBranchRelation = 'localOnly' | 'remoteOnly' | 'autoFastForward' | 'diverged';
|
|
53
|
+
/** How to resolve a diverged existing branch when creating its worktree. */
|
|
54
|
+
export type DivergenceResolution = 'auto' | 'keepLocal' | 'resetToRemote';
|
|
55
|
+
/** A compact, display-oriented description of a single commit. */
|
|
56
|
+
export interface CommitSummary {
|
|
57
|
+
shortSha: string;
|
|
58
|
+
subject: string;
|
|
59
|
+
author: string;
|
|
60
|
+
relativeDate: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Read-only plan describing how an existing branch relates to its origin remote
|
|
64
|
+
* at Start time. Produced without creating a worktree or mutating any branch.
|
|
65
|
+
*/
|
|
66
|
+
export interface ExistingBranchPlan {
|
|
67
|
+
relation: ExistingBranchRelation;
|
|
68
|
+
/** Local-only commits (`origin/foo..foo`), capped; lost by a reset-to-remote. */
|
|
69
|
+
ahead: CommitSummary[];
|
|
70
|
+
/** Remote-only commits (`foo..origin/foo`), capped; on the remote but not local. */
|
|
71
|
+
behind: CommitSummary[];
|
|
72
|
+
/** True when the ahead list was truncated to the cap (more commits exist). */
|
|
73
|
+
aheadTruncated: boolean;
|
|
74
|
+
/** True when the behind list was truncated to the cap (more commits exist). */
|
|
75
|
+
behindTruncated: boolean;
|
|
76
|
+
/** False when the origin fetch failed, so the comparison may be stale. */
|
|
77
|
+
remoteReachable: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface AgentSession {
|
|
80
|
+
id: string;
|
|
81
|
+
ticket_id: string;
|
|
82
|
+
opencode_session_id: string | null;
|
|
83
|
+
stage: string;
|
|
84
|
+
status: string;
|
|
85
|
+
checkpoint_data: string | null;
|
|
86
|
+
pty_instance_id: number | null;
|
|
87
|
+
error_message: string | null;
|
|
88
|
+
created_at: number;
|
|
89
|
+
updated_at: number;
|
|
90
|
+
provider: string;
|
|
91
|
+
claude_session_id: string | null;
|
|
92
|
+
pi_session_id: string | null;
|
|
93
|
+
}
|
|
94
|
+
export interface ClaudeInstallStatus {
|
|
95
|
+
installed: boolean;
|
|
96
|
+
path: string | null;
|
|
97
|
+
version: string | null;
|
|
98
|
+
authenticated: boolean;
|
|
99
|
+
}
|
|
100
|
+
export interface CheckpointNotification {
|
|
101
|
+
ticketId: string;
|
|
102
|
+
ticketKey: string | null;
|
|
103
|
+
sessionId: string;
|
|
104
|
+
stage: string;
|
|
105
|
+
message: string;
|
|
106
|
+
timestamp: number;
|
|
107
|
+
}
|
|
108
|
+
export interface PrComment {
|
|
109
|
+
id: number;
|
|
110
|
+
pr_id: number;
|
|
111
|
+
author: string;
|
|
112
|
+
body: string;
|
|
113
|
+
comment_type: string;
|
|
114
|
+
file_path: string | null;
|
|
115
|
+
line_number: number | null;
|
|
116
|
+
addressed: number;
|
|
117
|
+
created_at: number;
|
|
118
|
+
}
|
|
119
|
+
export interface PullRequestInfo {
|
|
120
|
+
id: number;
|
|
121
|
+
pr_number: number;
|
|
122
|
+
ticket_id: string;
|
|
123
|
+
repo_owner: string;
|
|
124
|
+
repo_name: string;
|
|
125
|
+
title: string;
|
|
126
|
+
url: string;
|
|
127
|
+
state: string;
|
|
128
|
+
head_sha: string;
|
|
129
|
+
ci_status: string | null;
|
|
130
|
+
ci_check_runs: string | null;
|
|
131
|
+
review_status: string | null;
|
|
132
|
+
mergeable: boolean | null;
|
|
133
|
+
mergeable_state: string | null;
|
|
134
|
+
merged_at: number | null;
|
|
135
|
+
created_at: number;
|
|
136
|
+
updated_at: number;
|
|
137
|
+
draft: boolean;
|
|
138
|
+
is_queued: boolean;
|
|
139
|
+
unaddressed_comment_count: number;
|
|
140
|
+
merge_readiness_status: MergeReadinessStatus | null;
|
|
141
|
+
merge_readiness_action: MergeReadinessAction | null;
|
|
142
|
+
merge_readiness_blockers: string | MergeReadinessDetail[] | null;
|
|
143
|
+
merge_readiness_warnings: string | MergeReadinessDetail[] | null;
|
|
144
|
+
readiness_source_head_sha: string | null;
|
|
145
|
+
merge_group_sha: string | null;
|
|
146
|
+
required_checks_policy_known: boolean | null;
|
|
147
|
+
required_reviews_policy_known: boolean | null;
|
|
148
|
+
merge_queue_required: boolean | null;
|
|
149
|
+
merge_queue_state: string | null;
|
|
150
|
+
readiness_updated_at: number | null;
|
|
151
|
+
}
|
|
152
|
+
export interface PollResult {
|
|
153
|
+
new_comments: number;
|
|
154
|
+
ci_changes: number;
|
|
155
|
+
review_changes: number;
|
|
156
|
+
pr_changes: number;
|
|
157
|
+
errors: number;
|
|
158
|
+
rate_limited: boolean;
|
|
159
|
+
rate_limit_reset_at: number | null;
|
|
160
|
+
}
|
|
161
|
+
export interface MergeStatusInfo {
|
|
162
|
+
state: string;
|
|
163
|
+
mergeable: boolean | null;
|
|
164
|
+
mergeable_state: string | null;
|
|
165
|
+
}
|
|
166
|
+
export interface PullRequestTerminalStateInfo {
|
|
167
|
+
state: string;
|
|
168
|
+
merged_at?: number | null;
|
|
169
|
+
}
|
|
170
|
+
export interface MergeReadinessInfo extends MergeStatusInfo {
|
|
171
|
+
ci_status?: string | null;
|
|
172
|
+
review_status?: string | null;
|
|
173
|
+
draft?: boolean;
|
|
174
|
+
is_queued?: boolean;
|
|
175
|
+
unaddressed_comment_count?: number;
|
|
176
|
+
head_sha?: string | null;
|
|
177
|
+
updated_at?: number | null;
|
|
178
|
+
merge_readiness_status?: MergeReadinessStatus | null;
|
|
179
|
+
merge_readiness_action?: MergeReadinessAction | null;
|
|
180
|
+
merge_readiness_blockers?: string | MergeReadinessDetail[] | null;
|
|
181
|
+
merge_readiness_warnings?: string | MergeReadinessDetail[] | null;
|
|
182
|
+
readiness_source_head_sha?: string | null;
|
|
183
|
+
readiness_updated_at?: number | null;
|
|
184
|
+
}
|
|
185
|
+
export interface MergeReadinessOptions {
|
|
186
|
+
requireBranchUpToDate?: boolean;
|
|
187
|
+
requireConversationResolution?: boolean;
|
|
188
|
+
requireMergeQueue?: boolean;
|
|
189
|
+
}
|
|
190
|
+
export type MergeReadinessStatus = 'ready_to_merge' | 'ready_to_enqueue' | 'queued_pull_request' | 'readiness_unknown' | 'blocked';
|
|
191
|
+
export type MergeReadinessAction = 'merge' | 'enqueue' | 'wait_for_queue' | 'wait_for_github' | 'resolve_blockers';
|
|
192
|
+
export interface MergeReadinessDetail {
|
|
193
|
+
code: string;
|
|
194
|
+
message: string;
|
|
195
|
+
}
|
|
196
|
+
export interface MergeReadinessFreshness {
|
|
197
|
+
sourceSha: string | null;
|
|
198
|
+
checkedAt: number | null;
|
|
199
|
+
}
|
|
200
|
+
export interface MergeReadinessResult {
|
|
201
|
+
status: MergeReadinessStatus;
|
|
202
|
+
action: MergeReadinessAction;
|
|
203
|
+
blockers: MergeReadinessDetail[];
|
|
204
|
+
warnings: MergeReadinessDetail[];
|
|
205
|
+
freshness: MergeReadinessFreshness;
|
|
206
|
+
}
|
|
207
|
+
export declare function isClosedOrMergedPullRequest(state: string): boolean;
|
|
208
|
+
export declare function isMergedPullRequest(pr: PullRequestTerminalStateInfo): boolean;
|
|
209
|
+
export declare function isClosedUnmergedPullRequest(pr: PullRequestTerminalStateInfo): boolean;
|
|
210
|
+
export declare function hasMergeConflicts(pr: MergeStatusInfo): boolean;
|
|
211
|
+
export declare function getPersistedMergeReadiness(pr: MergeReadinessInfo): MergeReadinessResult | null;
|
|
212
|
+
/**
|
|
213
|
+
* Explains whether a pull request is ready for a direct merge, queue enqueueing,
|
|
214
|
+
* waiting on GitHub/merge queue, or blocked by hard requirements.
|
|
215
|
+
*/
|
|
216
|
+
export declare function getMergeReadiness(pr: MergeReadinessInfo, options?: MergeReadinessOptions): MergeReadinessResult;
|
|
217
|
+
/** Check if a PR is ready for a direct merge action. */
|
|
218
|
+
export declare function isReadyToMerge(pr: MergeReadinessInfo, options?: MergeReadinessOptions): boolean;
|
|
219
|
+
/** Check if a user-initiated merge affordance may be shown/executed now. */
|
|
220
|
+
export declare function canMergePullRequest(pr: MergeReadinessInfo): boolean;
|
|
221
|
+
/** Check if a user-initiated merge-queue enqueue affordance may be shown/executed now. */
|
|
222
|
+
export declare function canEnqueuePullRequest(pr: MergeReadinessInfo): boolean;
|
|
223
|
+
export declare function getMostAttentionWorthyPullRequest<T extends MergeReadinessInfo>(prs: T[]): T | null;
|
|
224
|
+
export interface QueuedStatusInfo {
|
|
225
|
+
state: string;
|
|
226
|
+
is_queued: boolean;
|
|
227
|
+
}
|
|
228
|
+
/** Check if GitHub reports a PR as queued in a merge queue. */
|
|
229
|
+
export declare function isQueuedForMerge(pr: QueuedStatusInfo): boolean;
|
|
230
|
+
/** Preserves optimistic and definitive states across transient background syncs */
|
|
231
|
+
export declare function preservePullRequestState(oldPr: PullRequestInfo | undefined, newPr: PullRequestInfo): PullRequestInfo;
|
|
232
|
+
export interface CheckRunInfo {
|
|
233
|
+
id: number;
|
|
234
|
+
name: string;
|
|
235
|
+
status: string;
|
|
236
|
+
conclusion: string | null;
|
|
237
|
+
html_url: string;
|
|
238
|
+
}
|
|
239
|
+
export interface CiFailureNotification {
|
|
240
|
+
task_id: string;
|
|
241
|
+
pr_id: number;
|
|
242
|
+
pr_title: string;
|
|
243
|
+
ci_status: string;
|
|
244
|
+
timestamp: number;
|
|
245
|
+
}
|
|
246
|
+
export interface RateLimitNotification {
|
|
247
|
+
reset_at: number | null;
|
|
248
|
+
timestamp: number;
|
|
249
|
+
}
|
|
250
|
+
export interface AgentInfo {
|
|
251
|
+
name: string;
|
|
252
|
+
}
|
|
253
|
+
/** Command info from provider command endpoints — used for / autocomplete */
|
|
254
|
+
export interface CommandInfo {
|
|
255
|
+
name: string;
|
|
256
|
+
description: string | null;
|
|
257
|
+
source: string | null;
|
|
258
|
+
agent: string | null;
|
|
259
|
+
}
|
|
260
|
+
/** Extended agent info from provider agent endpoints — used for @ autocomplete */
|
|
261
|
+
export interface AutocompleteAgentInfo {
|
|
262
|
+
name: string;
|
|
263
|
+
hidden: boolean | null;
|
|
264
|
+
mode: string | null;
|
|
265
|
+
}
|
|
266
|
+
/** Model option from OpenCode GET /provider endpoint */
|
|
267
|
+
export interface ProviderModelInfo {
|
|
268
|
+
provider_id: string;
|
|
269
|
+
model_id: string;
|
|
270
|
+
name: string;
|
|
271
|
+
}
|
|
272
|
+
export interface AutocompleteItem {
|
|
273
|
+
label: string;
|
|
274
|
+
description: string | null;
|
|
275
|
+
type: 'file' | 'directory' | 'agent' | 'skill' | 'command';
|
|
276
|
+
source?: string | null;
|
|
277
|
+
}
|
|
278
|
+
export interface OpenCodeEvent {
|
|
279
|
+
event_type: string;
|
|
280
|
+
data: string;
|
|
281
|
+
}
|
|
282
|
+
export interface Project {
|
|
283
|
+
id: string;
|
|
284
|
+
name: string;
|
|
285
|
+
path: string;
|
|
286
|
+
created_at: number;
|
|
287
|
+
updated_at: number;
|
|
288
|
+
}
|
|
289
|
+
export interface ProjectAttention {
|
|
290
|
+
project_id: string;
|
|
291
|
+
needs_input: number;
|
|
292
|
+
running_agents: number;
|
|
293
|
+
ci_failures: number;
|
|
294
|
+
unaddressed_comments: number;
|
|
295
|
+
completed_agents: number;
|
|
296
|
+
}
|
|
297
|
+
export interface WorktreeInfo {
|
|
298
|
+
id: number;
|
|
299
|
+
task_id: string;
|
|
300
|
+
project_id: string;
|
|
301
|
+
repo_path: string;
|
|
302
|
+
worktree_path: string;
|
|
303
|
+
branch_name: string;
|
|
304
|
+
status: string;
|
|
305
|
+
created_at: number;
|
|
306
|
+
updated_at: number;
|
|
307
|
+
}
|
|
308
|
+
export interface TaskWorkspaceInfo {
|
|
309
|
+
id: number;
|
|
310
|
+
task_id: string;
|
|
311
|
+
project_id: string;
|
|
312
|
+
workspace_path: string;
|
|
313
|
+
repo_path: string;
|
|
314
|
+
kind: string;
|
|
315
|
+
branch_name: string | null;
|
|
316
|
+
provider_name: string;
|
|
317
|
+
status: string;
|
|
318
|
+
created_at: number;
|
|
319
|
+
updated_at: number;
|
|
320
|
+
}
|
|
321
|
+
export interface AgentEvent {
|
|
322
|
+
task_id: string;
|
|
323
|
+
event_type: string;
|
|
324
|
+
data: string;
|
|
325
|
+
timestamp: number;
|
|
326
|
+
}
|
|
327
|
+
export interface ImplementationStatus {
|
|
328
|
+
task_id: string;
|
|
329
|
+
workspace_path: string;
|
|
330
|
+
/** @deprecated Direct-TTY providers no longer expose or require an OpenCode server port. */
|
|
331
|
+
port: number;
|
|
332
|
+
session_id: string;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* A GitHub label attached to a pull request. `color` is a 6-digit hex string
|
|
336
|
+
* without a leading '#', exactly as GitHub returns it (e.g. "b60205").
|
|
337
|
+
*/
|
|
338
|
+
export interface PrLabel {
|
|
339
|
+
name: string;
|
|
340
|
+
color: string;
|
|
341
|
+
}
|
|
342
|
+
/** PR authored by the authenticated user — cached from GitHub Search API */
|
|
343
|
+
export interface AuthoredPullRequest {
|
|
344
|
+
id: number;
|
|
345
|
+
number: number;
|
|
346
|
+
title: string;
|
|
347
|
+
body: string | null;
|
|
348
|
+
state: string;
|
|
349
|
+
draft: boolean;
|
|
350
|
+
html_url: string;
|
|
351
|
+
user_login: string;
|
|
352
|
+
user_avatar_url: string | null;
|
|
353
|
+
repo_owner: string;
|
|
354
|
+
repo_name: string;
|
|
355
|
+
head_ref: string;
|
|
356
|
+
base_ref: string;
|
|
357
|
+
head_sha: string;
|
|
358
|
+
additions: number;
|
|
359
|
+
deletions: number;
|
|
360
|
+
changed_files: number;
|
|
361
|
+
ci_status: string | null;
|
|
362
|
+
ci_check_runs: string | null;
|
|
363
|
+
review_status: string | null;
|
|
364
|
+
mergeable: boolean | null;
|
|
365
|
+
mergeable_state: string | null;
|
|
366
|
+
merged_at: number | null;
|
|
367
|
+
is_queued: boolean;
|
|
368
|
+
task_id: string | null;
|
|
369
|
+
created_at: number;
|
|
370
|
+
updated_at: number;
|
|
371
|
+
/** GitHub labels on the PR. Empty when the PR has no labels. */
|
|
372
|
+
labels: PrLabel[];
|
|
373
|
+
}
|
|
374
|
+
/** PR from GitHub Search API — review requested for the authenticated user */
|
|
375
|
+
export interface ReviewPullRequest {
|
|
376
|
+
id: number;
|
|
377
|
+
number: number;
|
|
378
|
+
title: string;
|
|
379
|
+
body: string | null;
|
|
380
|
+
state: string;
|
|
381
|
+
draft: boolean;
|
|
382
|
+
html_url: string;
|
|
383
|
+
user_login: string;
|
|
384
|
+
user_avatar_url: string | null;
|
|
385
|
+
repo_owner: string;
|
|
386
|
+
repo_name: string;
|
|
387
|
+
head_ref: string;
|
|
388
|
+
base_ref: string;
|
|
389
|
+
head_sha: string;
|
|
390
|
+
additions: number;
|
|
391
|
+
deletions: number;
|
|
392
|
+
changed_files: number;
|
|
393
|
+
mergeable: boolean | null;
|
|
394
|
+
mergeable_state: string | null;
|
|
395
|
+
created_at: number;
|
|
396
|
+
updated_at: number;
|
|
397
|
+
viewed_at: number | null;
|
|
398
|
+
viewed_head_sha: string | null;
|
|
399
|
+
/** GitHub labels on the PR. Empty when the PR has no labels. */
|
|
400
|
+
labels: PrLabel[];
|
|
401
|
+
}
|
|
402
|
+
/** GitHub label that suppresses a PR from review counting and grays out its card. */
|
|
403
|
+
export declare const DO_NOT_REVIEW_LABEL = "DO NOT REVIEW";
|
|
404
|
+
/** True when the PR carries the "DO NOT REVIEW" label (case-insensitive, trimmed). */
|
|
405
|
+
export declare function hasDoNotReviewLabel(pr: {
|
|
406
|
+
labels: PrLabel[];
|
|
407
|
+
}): boolean;
|
|
408
|
+
/** File diff from PR files endpoint */
|
|
409
|
+
export interface PrFileDiff {
|
|
410
|
+
sha: string;
|
|
411
|
+
filename: string;
|
|
412
|
+
status: string;
|
|
413
|
+
additions: number;
|
|
414
|
+
deletions: number;
|
|
415
|
+
changes: number;
|
|
416
|
+
patch: string | null;
|
|
417
|
+
previous_filename: string | null;
|
|
418
|
+
is_truncated: boolean;
|
|
419
|
+
patch_line_count: number | null;
|
|
420
|
+
}
|
|
421
|
+
/** Commit info from git log for per-commit diff viewing */
|
|
422
|
+
export interface CommitInfo {
|
|
423
|
+
sha: string;
|
|
424
|
+
short_sha: string;
|
|
425
|
+
message: string;
|
|
426
|
+
author: string;
|
|
427
|
+
date: string;
|
|
428
|
+
}
|
|
429
|
+
/** PR overview comment (both review and general comments) */
|
|
430
|
+
export interface PrOverviewComment {
|
|
431
|
+
id: number;
|
|
432
|
+
body: string;
|
|
433
|
+
author: string;
|
|
434
|
+
avatar_url: string | null;
|
|
435
|
+
comment_type: string;
|
|
436
|
+
file_path: string | null;
|
|
437
|
+
line_number: number | null;
|
|
438
|
+
created_at: string;
|
|
439
|
+
}
|
|
440
|
+
/** Inline review comment from GitHub PR */
|
|
441
|
+
export interface ReviewComment {
|
|
442
|
+
id: number;
|
|
443
|
+
pr_number: number;
|
|
444
|
+
repo_owner: string;
|
|
445
|
+
repo_name: string;
|
|
446
|
+
path: string;
|
|
447
|
+
line: number | null;
|
|
448
|
+
side: string | null;
|
|
449
|
+
body: string;
|
|
450
|
+
author: string;
|
|
451
|
+
created_at: string;
|
|
452
|
+
in_reply_to_id: number | null;
|
|
453
|
+
}
|
|
454
|
+
/** Comment to include in a review submission */
|
|
455
|
+
export interface ReviewSubmissionComment {
|
|
456
|
+
path: string;
|
|
457
|
+
line: number;
|
|
458
|
+
side: string;
|
|
459
|
+
body: string;
|
|
460
|
+
}
|
|
461
|
+
/** Review submission payload */
|
|
462
|
+
export interface ReviewSubmission {
|
|
463
|
+
event: "APPROVE" | "REQUEST_CHANGES" | "COMMENT";
|
|
464
|
+
body: string;
|
|
465
|
+
comments: ReviewSubmissionComment[];
|
|
466
|
+
}
|
|
467
|
+
/** Self-review comment for task implementation review */
|
|
468
|
+
export interface SelfReviewComment {
|
|
469
|
+
id: number;
|
|
470
|
+
task_id: string;
|
|
471
|
+
round: number;
|
|
472
|
+
comment_type: string;
|
|
473
|
+
file_path: string | null;
|
|
474
|
+
line_number: number | null;
|
|
475
|
+
body: string;
|
|
476
|
+
created_at: number;
|
|
477
|
+
archived_at: number | null;
|
|
478
|
+
}
|
|
479
|
+
/** One file referenced by a walkthrough step. `hunk_indexes === null` means the entire file's diff belongs to the step. */
|
|
480
|
+
export interface PrWalkthroughStepFile {
|
|
481
|
+
filename: string;
|
|
482
|
+
hunk_indexes: number[] | null;
|
|
483
|
+
}
|
|
484
|
+
/** One concept-sized step in a PR walkthrough — as if the author had landed a small commit. */
|
|
485
|
+
export interface PrWalkthroughStep {
|
|
486
|
+
id: string;
|
|
487
|
+
title: string;
|
|
488
|
+
summary: string;
|
|
489
|
+
files: PrWalkthroughStepFile[];
|
|
490
|
+
}
|
|
491
|
+
/** A cached AI-generated walkthrough of a PR, keyed by (pr_id, head_sha).
|
|
492
|
+
* `steps_json` is the agent's raw structured response. Parse + validate it
|
|
493
|
+
* against the live PR diffs before rendering (see walkthroughParse). */
|
|
494
|
+
export interface PrWalkthrough {
|
|
495
|
+
pr_id: number;
|
|
496
|
+
head_sha: string;
|
|
497
|
+
walkthrough_session_key: string | null;
|
|
498
|
+
status: 'generating' | 'ready' | 'error';
|
|
499
|
+
steps_json: string | null;
|
|
500
|
+
error_message: string | null;
|
|
501
|
+
created_at: number;
|
|
502
|
+
updated_at: number;
|
|
503
|
+
}
|
|
504
|
+
/** Agent review comment for AI-powered PR review */
|
|
505
|
+
export interface AgentReviewComment {
|
|
506
|
+
id: number;
|
|
507
|
+
review_pr_id: number;
|
|
508
|
+
review_session_key: string;
|
|
509
|
+
comment_type: string;
|
|
510
|
+
file_path: string | null;
|
|
511
|
+
line_number: number | null;
|
|
512
|
+
side: string | null;
|
|
513
|
+
body: string;
|
|
514
|
+
status: string;
|
|
515
|
+
opencode_session_id: string | null;
|
|
516
|
+
created_at: number;
|
|
517
|
+
updated_at: number;
|
|
518
|
+
}
|
|
519
|
+
/** App-level view for top-bar navigation */
|
|
520
|
+
export type CoreAppView = 'board' | 'settings' | 'global_settings' | 'files';
|
|
521
|
+
/** App-level view for top-bar navigation */
|
|
522
|
+
export type AppView = CoreAppView | PluginViewKey;
|
|
523
|
+
export interface PtySpawnRequest {
|
|
524
|
+
task_id: string;
|
|
525
|
+
cols: number;
|
|
526
|
+
rows: number;
|
|
527
|
+
}
|
|
528
|
+
export interface PtyEvent {
|
|
529
|
+
task_id: string;
|
|
530
|
+
data: string;
|
|
531
|
+
instance_id?: number;
|
|
532
|
+
}
|
|
533
|
+
/** File entry metadata */
|
|
534
|
+
export interface FileEntry {
|
|
535
|
+
name: string;
|
|
536
|
+
path: string;
|
|
537
|
+
isDir: boolean;
|
|
538
|
+
size: number | null;
|
|
539
|
+
modifiedAt: number | null;
|
|
540
|
+
}
|
|
541
|
+
/** File content with type information */
|
|
542
|
+
export interface FileContent {
|
|
543
|
+
type: 'text' | 'image' | 'binary' | 'document' | 'large-file';
|
|
544
|
+
content: string;
|
|
545
|
+
mimeType: string | null;
|
|
546
|
+
size: number;
|
|
547
|
+
}
|
|
548
|
+
export declare function parseCheckRuns(json: string | null): CheckRunInfo[];
|
|
549
|
+
/** Split check runs into visible (non-passing) and a count of hidden passing checks. */
|
|
550
|
+
export declare function splitCheckRuns(checks: CheckRunInfo[]): {
|
|
551
|
+
visible: CheckRunInfo[];
|
|
552
|
+
passingCount: number;
|
|
553
|
+
};
|
|
554
|
+
export interface Action {
|
|
555
|
+
id: string;
|
|
556
|
+
name: string;
|
|
557
|
+
prompt: string;
|
|
558
|
+
builtin: boolean;
|
|
559
|
+
enabled: boolean;
|
|
560
|
+
}
|
|
561
|
+
export type VoiceInputState = 'idle' | 'recording' | 'transcribing' | 'error';
|
|
562
|
+
export interface TranscriptionResult {
|
|
563
|
+
text: string;
|
|
564
|
+
duration_ms: number;
|
|
565
|
+
}
|
|
566
|
+
export type WhisperModelSizeId = 'tiny' | 'base' | 'small' | 'medium' | 'large';
|
|
567
|
+
export interface WhisperModelStatus {
|
|
568
|
+
size: WhisperModelSizeId;
|
|
569
|
+
display_name: string;
|
|
570
|
+
downloaded: boolean;
|
|
571
|
+
model_path: string | null;
|
|
572
|
+
model_size_bytes: number | null;
|
|
573
|
+
model_name: string;
|
|
574
|
+
disk_size_mb: number;
|
|
575
|
+
ram_usage_mb: number;
|
|
576
|
+
is_active: boolean;
|
|
577
|
+
}
|
|
578
|
+
/** Permission mode for Claude Code sessions */
|
|
579
|
+
export type PermissionMode = 'default' | 'auto' | 'acceptEdits' | 'plan' | 'bypassPermissions' | 'dontAsk';
|