Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesPull RequestsActionsSecurityInsightsSettings
✨ AI
More
claude/adoring-hopper-5x74bqclaude/affectionate-feynman-ykrf1hclaude/architecture-audit-design-wxprenclaude/build-status-update-3MXsfclaude/charming-meitner-mllb5rclaude/compare-gate-gluecron-s4mFQclaude/confident-faraday-tikcwbclaude/continue-work-XMTlIclaude/crontech-gluecron-deploy-7MIECclaude/crontech-platform-setup-SeKfwclaude/design-2026claude/ecstatic-ptolemy-jMdigclaude/enhance-github-integration-QNHdGclaude/fix-aa-loop-issue-PonMQclaude/fix-actions-and-processclaude/fix-desktop-errors-XqoW8claude/fix-red-workflowsclaude/fix-website-access-6FKJNclaude/gatetest-integration-hardeningclaude/github-audit-improvements-bDFr9claude/gluecron-launch-status-FoMRlclaude/hopeful-lamport-olfCTclaude/issue-to-pr-and-protectionsclaude/jolly-heisenberg-2sg1Qclaude/launch-preparation-QmTb6claude/new-session-xk1l7claude/plan-platform-architecture-kkN4yclaude/platform-analysis-roadmap-1nUGLclaude/platform-launch-assessment-8dWV8claude/polish-platform-release-AeDrUclaude/resume-previous-work-KzyLwclaude/review-crontech-handoff-qYEVqclaude/review-project-completeness-lHhS2claude/review-readme-docs-ulqPKclaude/serene-edison-rj87weclaude/setup-multi-repo-dev-BCwNQclaude/ship-fixes-and-tests-Jvz1cclaude/site-audit-competitive-pctlwgclaude/site-migration-vercel-XstpKclaude/standalone-product-repos-XHFTDcopilot/feat-smart-empty-states-keyboard-first-enhancementcopilot/feat-smart-morning-digest-review-context-restorecopilot/fix-and-process-workflowscopilot/update-ai-powered-code-reviewfeat/debt-mapfeat/push-policy-codeowners-hardeningfeat/smart-digest-contextfeat/stage-impactfeat/t1-secret-migrationfeat/u-polishfeat/w-self-hostfeat/w2-claude-configfix/agent-journey-orphan-sweepgatetest/auto-fix-1776586424172gatetest/auto-fix-1776586534814gatetest/auto-fix-1776590685143gatetest/auto-fix-1776590808199mainops/redeploy-retriggerstyle/dxt-cta-themeworktree-agent-a3377aad30d55da26worktree-agent-a7ef607b7ee1d6c74
pulls.ts4.6 KB · 191 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
import { fetchJSON, postJSON } from './client';

export interface PullRequest {
  id: number;
  number: number;
  title: string;
  body: string | null;
  state: 'open' | 'closed' | 'merged';
  authorUsername: string;
  authorAvatarUrl: string | null;
  baseBranch: string;
  headBranch: string;
  baseRepo: string;
  headRepo: string;
  isDraft: boolean;
  commentCount: number;
  commitCount: number;
  additions: number;
  deletions: number;
  changedFiles: number;
  mergedAt: string | null;
  closedAt: string | null;
  createdAt: string;
  updatedAt: string;
  mergedByUsername: string | null;
  gateStatus: 'pending' | 'passed' | 'failed' | 'none';
}

export interface PrComment {
  id: number;
  body: string;
  authorUsername: string;
  authorAvatarUrl: string | null;
  isAiReview: boolean;
  filePath: string | null;
  lineNumber: number | null;
  diffHunk: string | null;
  createdAt: string;
  updatedAt: string;
}

export interface AiReviewSummary {
  summary: string;
  comments: PrComment[];
  severity: 'info' | 'warning' | 'error';
  createdAt: string;
}

export interface PrDiffFile {
  path: string;
  additions: number;
  deletions: number;
  patch: string;
}

export interface CreatePrInput {
  title: string;
  body?: string;
  baseBranch: string;
  headBranch: string;
  isDraft?: boolean;
}

export interface CreatePrCommentInput {
  body: string;
  filePath?: string;
  lineNumber?: number;
  diffHunk?: string;
}

/** List pull requests for a repository. */
export async function listPullRequests(
  owner: string,
  repo: string,
  state: 'open' | 'closed' | 'merged' | 'all' = 'open',
  page = 1,
): Promise<PullRequest[]> {
  return fetchJSON<PullRequest[]>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls?state=${state}&page=${page}&json=1`,
  );
}

/** Get a single pull request. */
export async function getPullRequest(
  owner: string,
  repo: string,
  number: number,
): Promise<PullRequest> {
  return fetchJSON<PullRequest>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}?json=1`,
  );
}

/** Get comments on a pull request (including AI review comments). */
export async function getPrComments(
  owner: string,
  repo: string,
  number: number,
): Promise<PrComment[]> {
  return fetchJSON<PrComment[]>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/comments?json=1`,
  );
}

/** Get the AI review summary for a pull request. */
export async function getAiReview(
  owner: string,
  repo: string,
  number: number,
): Promise<AiReviewSummary | null> {
  try {
    return await fetchJSON<AiReviewSummary>(
      `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/ai-review?json=1`,
    );
  } catch {
    return null;
  }
}

/** Get diff files for a pull request. */
export async function getPrDiff(
  owner: string,
  repo: string,
  number: number,
): Promise<PrDiffFile[]> {
  return fetchJSON<PrDiffFile[]>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/diff?json=1`,
  );
}

/** Create a new pull request. */
export async function createPullRequest(
  owner: string,
  repo: string,
  input: CreatePrInput,
): Promise<PullRequest> {
  return postJSON<PullRequest>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls`,
    input,
  );
}

/** Post a comment on a pull request. */
export async function createPrComment(
  owner: string,
  repo: string,
  number: number,
  input: CreatePrCommentInput,
): Promise<PrComment> {
  return postJSON<PrComment>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/comments`,
    input,
  );
}

/** Merge a pull request. */
export async function mergePullRequest(
  owner: string,
  repo: string,
  number: number,
  mergeMethod: 'merge' | 'squash' | 'rebase' = 'merge',
): Promise<{ merged: boolean; sha: string }> {
  return postJSON<{ merged: boolean; sha: string }>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/merge`,
    { mergeMethod },
  );
}

/** Close a pull request without merging. */
export async function closePullRequest(
  owner: string,
  repo: string,
  number: number,
): Promise<PullRequest> {
  return postJSON<PullRequest>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/close`,
    {},
  );
}

/** Trigger AI review on a pull request. */
export async function requestAiReview(
  owner: string,
  repo: string,
  number: number,
): Promise<{ queued: boolean }> {
  return postJSON<{ queued: boolean }>(
    `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/request-ai-review`,
    {},
  );
}