feat: add GitHub issue picker and API endpoints

Add GitHubIssuePickerDialog UI for selecting issues
Enable new session from GitHub issue from session sidebar
Implement GitHub issues/list/get/comments APIs across desktop, web, and VS Code
This commit is contained in:
Bohdan Triapitsyn
2026-01-24 00:30:34 +02:00
parent da20c647e2
commit 57f00be773
15 changed files with 1614 additions and 9 deletions
+52
View File
@@ -560,6 +560,54 @@ export type GitHubPullRequestMergeResult = {
message?: string;
};
export type GitHubIssueLabel = {
name: string;
color?: string;
};
export type GitHubIssueSummary = {
number: number;
title: string;
url: string;
state: 'open' | 'closed';
author?: GitHubUserSummary | null;
labels?: GitHubIssueLabel[];
};
export type GitHubIssue = GitHubIssueSummary & {
body?: string;
assignees?: GitHubUserSummary[];
createdAt?: string;
updatedAt?: string;
};
export type GitHubIssueComment = {
id: number;
url: string;
body: string;
author?: GitHubUserSummary | null;
createdAt?: string;
updatedAt?: string;
};
export type GitHubIssuesListResult = {
connected: boolean;
repo?: GitHubRepoRef | null;
issues?: GitHubIssueSummary[];
};
export type GitHubIssueGetResult = {
connected: boolean;
repo?: GitHubRepoRef | null;
issue?: GitHubIssue | null;
};
export type GitHubIssueCommentsResult = {
connected: boolean;
repo?: GitHubRepoRef | null;
comments?: GitHubIssueComment[];
};
export type GitHubAuthStatus = {
connected: boolean;
user?: GitHubUserSummary | null;
@@ -591,6 +639,10 @@ export interface GitHubAPI {
prCreate(payload: GitHubPullRequestCreateInput): Promise<GitHubPullRequest>;
prMerge(payload: GitHubPullRequestMergeInput): Promise<GitHubPullRequestMergeResult>;
prReady(payload: GitHubPullRequestReadyInput): Promise<GitHubPullRequestReadyResult>;
issuesList(directory: string): Promise<GitHubIssuesListResult>;
issueGet(directory: string, number: number): Promise<GitHubIssueGetResult>;
issueComments(directory: string, number: number): Promise<GitHubIssueCommentsResult>;
}
export interface RuntimeAPIs {
+6 -2
View File
@@ -598,6 +598,7 @@ class OpencodeService {
modelID: string;
text: string;
prefaceText?: string;
prefaceTextSynthetic?: boolean;
agent?: string;
variant?: string;
files?: Array<{
@@ -609,6 +610,7 @@ class OpencodeService {
/** Additional text/file parts to include (for batch sending queued messages) */
additionalParts?: Array<{
text: string;
synthetic?: boolean;
files?: Array<{
type: 'file';
mime: string;
@@ -630,7 +632,8 @@ class OpencodeService {
if (params.prefaceText && params.prefaceText.trim()) {
parts.push({
type: 'text',
text: params.prefaceText
text: params.prefaceText,
synthetic: params.prefaceTextSynthetic !== false,
});
}
@@ -663,7 +666,8 @@ class OpencodeService {
if (additional.text && additional.text.trim()) {
parts.push({
type: 'text',
text: additional.text
text: additional.text,
...(additional.synthetic ? { synthetic: true } : {}),
});
}
if (additional.files && additional.files.length > 0) {