pierre-review 0.1.39 → 0.1.41
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/api/routes/activity.js +46 -0
- package/dist/api/routes/feed.js +3 -1
- package/dist/api/routes/prs.js +13 -1
- package/dist/api/routes/repos.js +1 -1
- package/dist/api/routes/timeline.js +1 -0
- package/dist/app.js +2 -2
- package/dist/db/queries.js +792 -34
- package/dist/github/queries.js +7 -6
- package/dist/pro/bind.js +1 -1
- package/dist/pro/contract.js +1 -1
- package/dist/sync/upsert.js +11 -8
- package/package.json +1 -1
- package/public/assets/index-B1A5MHB0.css +10 -0
- package/public/assets/index-DfPvFFUc.js +1378 -0
- package/public/index.html +2 -2
- package/dist/api/routes/inbox.js +0 -28
- package/public/assets/index-BLhZKzDf.css +0 -10
- package/public/assets/index-Duzg3Uet.js +0 -1373
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getActivity, getConsolidatedFeed, listClaudeReviewsByRepo } from '../../db/queries.js';
|
|
2
|
+
import { accountIdOf } from '../plugins/auth.js';
|
|
3
|
+
function parseIntList(raw) {
|
|
4
|
+
if (!raw)
|
|
5
|
+
return null;
|
|
6
|
+
const ids = raw
|
|
7
|
+
.split(',')
|
|
8
|
+
.map((s) => Number.parseInt(s.trim(), 10))
|
|
9
|
+
.filter((n) => Number.isFinite(n));
|
|
10
|
+
return ids.length > 0 ? ids : null;
|
|
11
|
+
}
|
|
12
|
+
export async function activityRoutes(app) {
|
|
13
|
+
// The Activity aggregate: per repo, current-state stats + thread totals +
|
|
14
|
+
// attention/unread flags + open PRs. Scoped to the account; `repoIds` + `userIds`
|
|
15
|
+
// narrow to the active FilterBar repo + member selection (across ALL the account's
|
|
16
|
+
// repos — watched-only was dropped). Pure DB read — no GitHub sync, no AI.
|
|
17
|
+
app.get('/api/activity', async (req) => {
|
|
18
|
+
const q = req.query;
|
|
19
|
+
return getActivity(accountIdOf(req), parseIntList(q.repoIds), parseIntList(q.userIds));
|
|
20
|
+
});
|
|
21
|
+
// The consolidated Feed (the Activity "Feed" entry): one flat, chronological stream
|
|
22
|
+
// merging My Turn actionables + the activity feed, deduped. Scoped by the FilterBar
|
|
23
|
+
// repo + member selection across ALL the account's repos (watched-only dropped).
|
|
24
|
+
// Pure DB read — no GitHub sync, no AI.
|
|
25
|
+
app.get('/api/activity/feed', async (req) => {
|
|
26
|
+
const q = req.query;
|
|
27
|
+
const limit = q.limit != null ? Number(q.limit) : null;
|
|
28
|
+
const offset = q.offset != null ? Number(q.offset) : 0;
|
|
29
|
+
return getConsolidatedFeed(accountIdOf(req), {
|
|
30
|
+
repoIds: parseIntList(q.repoIds),
|
|
31
|
+
userIds: parseIntList(q.userIds),
|
|
32
|
+
limit: Number.isFinite(limit) && limit != null && limit > 0 ? limit : null,
|
|
33
|
+
offset: Number.isFinite(offset) && offset > 0 ? offset : 0,
|
|
34
|
+
excludeBots: q.excludeBots === 'true',
|
|
35
|
+
allowBotIds: parseIntList(q.allowBotIds),
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
// Repo-scoped Claude-review history for the Activity single-repo console. Ownership +
|
|
39
|
+
// feature-gating are handled inside the query (an unowned repo / disabled feature
|
|
40
|
+
// both return an empty list), so the caller never leaks another account's data.
|
|
41
|
+
app.get('/api/repos/:id/claude-reviews', async (req) => {
|
|
42
|
+
const { id } = req.params;
|
|
43
|
+
return listClaudeReviewsByRepo(Number.parseInt(id, 10), accountIdOf(req));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=activity.js.map
|
package/dist/api/routes/feed.js
CHANGED
|
@@ -4,6 +4,8 @@ import { accountIdOf } from '../plugins/auth.js';
|
|
|
4
4
|
// has Watched, newest first, commit pushes excluded. The frontend mirrors these into an
|
|
5
5
|
// append-only IndexedDB store (see lib/feedStore.ts). Account-scoped.
|
|
6
6
|
export async function feedRoutes(app) {
|
|
7
|
-
|
|
7
|
+
// getFeed's default is now all-repos; preserve this legacy mirror's watched-repo-only
|
|
8
|
+
// semantics explicitly (the consolidated Activity Feed supersedes this endpoint).
|
|
9
|
+
app.get('/api/feed', async (req) => getFeed(accountIdOf(req), { daysBefore: 14, watchedOnly: true }));
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=feed.js.map
|
package/dist/api/routes/prs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { getAccessToken, getAccountUserId } from '../../auth/account.js';
|
|
3
3
|
import { ghRestGetText } from '../../github/client.js';
|
|
4
|
-
import { getPrDetail, getPrFilesContext, getPrWriteContext, markAllViewed, markPrViewed, upsertLocalPrComment, upsertLocalReview, } from '../../db/queries.js';
|
|
4
|
+
import { getMentionCandidates, getPrDetail, getPrFilesContext, getPrWriteContext, markAllViewed, markPrViewed, upsertLocalPrComment, upsertLocalReview, } from '../../db/queries.js';
|
|
5
5
|
import { buildFileAnchors, fallbackAnchor, isFindingAnchored, } from '../../github/diff-anchor.js';
|
|
6
6
|
import { addIssueComment, fetchHeadShaFor, fetchPrFilesWithPatch, postInlineComment, submitPrReview, } from '../../github/mutations.js';
|
|
7
7
|
import { hydratePrDetail } from '../../sync/hydrate-detail.js';
|
|
@@ -115,6 +115,18 @@ export async function prRoutes(app) {
|
|
|
115
115
|
// caches the result in IndexedDB keyed by updatedAt so unchanged PRs don't refetch.
|
|
116
116
|
return hydratePrDetail(pr, accountId);
|
|
117
117
|
});
|
|
118
|
+
// Candidates for an @mention autocomplete, ranked by proximity to this PR
|
|
119
|
+
// (participants first, then repo people), self + bots excluded. Account-scoped:
|
|
120
|
+
// 404 when the PR isn't the caller's.
|
|
121
|
+
app.get('/api/prs/:id/mention-candidates', { schema: idParamSchema }, async (req, reply) => {
|
|
122
|
+
const { id } = req.params;
|
|
123
|
+
const candidates = await getMentionCandidates(id, accountIdOf(req));
|
|
124
|
+
if (!candidates) {
|
|
125
|
+
reply.status(404);
|
|
126
|
+
return { error: 'NotFound', message: `PR ${id} not found` };
|
|
127
|
+
}
|
|
128
|
+
return candidates;
|
|
129
|
+
});
|
|
118
130
|
// Record that the local user has seen this PR up to `sha` (defaults to the
|
|
119
131
|
// current head). Clears "new since last viewed" badges.
|
|
120
132
|
app.post('/api/prs/:id/mark-viewed', { schema: markViewedSchema }, async (req, reply) => {
|
package/dist/api/routes/repos.js
CHANGED
|
@@ -230,7 +230,7 @@ export async function repoRoutes(app) {
|
|
|
230
230
|
reply.status(201);
|
|
231
231
|
return getRepo(repoId, accountId);
|
|
232
232
|
});
|
|
233
|
-
// Toggle "Watch for inbox" on a repo.
|
|
233
|
+
// Toggle "Watch for inbox" on a repo. Activity-only: it does not affect timeline
|
|
234
234
|
// visibility or syncing. Ownership-scoped → 404 for a repo this account doesn't own.
|
|
235
235
|
app.patch('/api/repos/:id', { schema: watchSchema }, async (req, reply) => {
|
|
236
236
|
const { id } = req.params;
|
|
@@ -86,6 +86,7 @@ export async function timelineRoutes(app) {
|
|
|
86
86
|
statuses: parseStatuses(q.statuses),
|
|
87
87
|
reviewStates: parseReviewStates(q.reviewStates),
|
|
88
88
|
excludeBots: q.excludeBots === 'true',
|
|
89
|
+
allowBotIds: parseIntList(q.allowBotIds),
|
|
89
90
|
excludeStale: q.excludeStale === 'true',
|
|
90
91
|
};
|
|
91
92
|
return getTimeline(filters);
|
package/dist/app.js
CHANGED
|
@@ -18,7 +18,7 @@ import { openPrsRoutes } from './api/routes/open-prs.js';
|
|
|
18
18
|
import { feedRoutes } from './api/routes/feed.js';
|
|
19
19
|
import { mergersRoutes } from './api/routes/mergers.js';
|
|
20
20
|
import { insightsRoutes } from './api/routes/insights.js';
|
|
21
|
-
import {
|
|
21
|
+
import { activityRoutes } from './api/routes/activity.js';
|
|
22
22
|
import { claudeReviewRoutes } from './api/routes/claude-review.js';
|
|
23
23
|
export async function buildApp() {
|
|
24
24
|
const app = Fastify({
|
|
@@ -131,7 +131,7 @@ export async function buildApp() {
|
|
|
131
131
|
await app.register(feedRoutes);
|
|
132
132
|
await app.register(mergersRoutes);
|
|
133
133
|
await app.register(insightsRoutes);
|
|
134
|
-
await app.register(
|
|
134
|
+
await app.register(activityRoutes);
|
|
135
135
|
// Claude Review is local-only + opt-in. Only register its routes when enabled,
|
|
136
136
|
// so the clone-manager / gh-CLI dependency is unreachable in cloud mode.
|
|
137
137
|
if (config.claudeReviewEnabled)
|