heartbeads 0.6.1 → 0.6.2
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/beads/route.js.nft.json +1 -1
- package/.next/server/app/api/beads/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/docs.html +2 -2
- package/.next/server/app/api/docs.rsc +1 -1
- package/.next/server/app/api/docs.segments/_full.segment.rsc +1 -1
- package/.next/server/app/api/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/api/docs.segments/_index.segment.rsc +1 -1
- package/.next/server/app/api/docs.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/docs.segments/api/docs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/api/docs.segments/api/docs.segment.rsc +1 -1
- package/.next/server/app/api/docs.segments/api.segment.rsc +1 -1
- package/.next/server/app/api/v1/graph/route.js.nft.json +1 -1
- package/.next/server/app/api/v1/issues/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/v1/ready/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +1 -1
- package/.next/server/app/login.segments/_full.segment.rsc +1 -1
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/48cc8_next_dist_esm_build_templates_app-route_1d3b72ae.js +1 -1
- package/.next/server/chunks/48cc8_next_dist_esm_build_templates_app-route_1d3b72ae.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__2d60806f._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__2d60806f._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__3cb3ed30._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__3cb3ed30._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__6125c4e2._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__6125c4e2._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__67c802f8._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__67c802f8._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__77e35ba8._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__77e35ba8._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__8261fec1._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__8261fec1._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__04e6e565._.js +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__04e6e565._.js.map +1 -1
- package/.next/server/edge/chunks/48cc8_next_dist_5a0b8a90._.js +1 -1
- package/.next/server/edge/chunks/48cc8_next_dist_5a0b8a90._.js.map +1 -1
- package/.next/server/middleware/middleware-manifest.json +3 -3
- package/.next/server/middleware-manifest.json +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/static/chunks/7e4fcecd4ca504d5.js +24 -0
- package/.next/static/zq8Ew2hci2YIJ61-i832n/_clientMiddlewareManifest.json +6 -0
- package/app/api/login/route.ts +15 -0
- package/app/page.tsx +46 -35
- package/components/BeadsGraph.tsx +15 -1
- package/components/NodeDetail.tsx +15 -7
- package/lib/activity.ts +22 -2
- package/lib/parse-beads.ts +24 -10
- package/lib/types.ts +82 -1
- package/package.json +1 -1
- package/.next/static/bc2EgBqgYtYOdWusC2URO/_clientMiddlewareManifest.json +0 -6
- package/.next/static/chunks/6cdcba7fb18f6f79.js +0 -24
- /package/.next/static/{bc2EgBqgYtYOdWusC2URO → zq8Ew2hci2YIJ61-i832n}/_buildManifest.js +0 -0
- /package/.next/static/{bc2EgBqgYtYOdWusC2URO → zq8Ew2hci2YIJ61-i832n}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/parse-beads.ts","../../../lib/comments.ts","../../../lib/api-helpers.ts","../../../node_modules/.pnpm/next%4016.1.6_react-dom%4018.3.1_react%4018.3.1__react%4018.3.1/node_modules/next/dist/esm/build/templates/app-route.js","../../../app/api/v1/issues/%5Bid%5D/route.ts"],"sourcesContent":["import { readFileSync, existsSync } from \"fs\";\nimport { join, resolve } from \"path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { discoverBeadsDir } from \"./discover\";\nimport type {\n BeadIssue,\n BeadDependency,\n GraphNode,\n GraphLink,\n GraphData,\n BeadsApiResponse,\n} from \"./types\";\n\n/**\n * Extract the prefix from a bead ID (e.g. \"my-app-5gw\" -> \"my-app\")\n */\nexport function extractPrefix(id: string): string {\n const lastDash = id.lastIndexOf(\"-\");\n if (lastDash === -1) return id;\n return id.substring(0, lastDash);\n}\n\n/**\n * Read repos.additional paths from .beads/config.yaml\n */\nexport function getAdditionalRepoPaths(beadsDir: string): string[] {\n const configPath = join(beadsDir, \"config.yaml\");\n try {\n const content = readFileSync(configPath, \"utf-8\");\n const config = parseYaml(content);\n const additional = config?.repos?.additional;\n if (Array.isArray(additional)) {\n return additional\n .map((p: string) => resolve(beadsDir, \"..\", p))\n .filter((p: string) => existsSync(join(p, \".beads\", \"issues.jsonl\")));\n }\n } catch (err) {\n console.error(\"Failed to read config.yaml:\", err);\n }\n return [];\n}\n\n/**\n * Parse a single issues.jsonl file and return issues\n */\nfunction parseJsonlFile(filePath: string): BeadIssue[] {\n let content: string;\n try {\n content = readFileSync(filePath, \"utf-8\");\n } catch (err) {\n console.error(`Failed to read ${filePath}:`, err);\n return [];\n }\n\n const lines = content.split(\"\\n\").filter((line) => line.trim().length > 0);\n const issues: BeadIssue[] = [];\n\n for (let i = 0; i < lines.length; i++) {\n try {\n issues.push(JSON.parse(lines[i]) as BeadIssue);\n } catch (err) {\n console.warn(`Skipping malformed line ${i + 1} in ${filePath}:`, err);\n }\n }\n\n return issues;\n}\n\n/**\n * Parse issues.jsonl from the primary .beads directory and all additional repos\n */\nexport function parseIssuesJsonl(beadsDir?: string): BeadIssue[] {\n const dir = beadsDir || discoverBeadsDir().beadsDir;\n\n // Load primary repo issues\n const primaryPath = join(dir, \"issues.jsonl\");\n const issues = parseJsonlFile(primaryPath);\n\n // Load additional repo issues from config.yaml\n const additionalRepos = getAdditionalRepoPaths(dir);\n for (const repoPath of additionalRepos) {\n const repoJsonl = join(repoPath, \".beads\", \"issues.jsonl\");\n const repoIssues = parseJsonlFile(repoJsonl);\n issues.push(...repoIssues);\n }\n\n // Deduplicate by issue ID (primary repo wins) and filter out tombstones.\n // bd delete marks issues with status \"tombstone\" rather than removing them\n // from the JSONL file — we must exclude these from the graph.\n const seen = new Set<string>();\n return issues.filter((issue) => {\n if (seen.has(issue.id)) return false;\n seen.add(issue.id);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((issue as any).status === \"tombstone\") return false;\n return true;\n });\n}\n\n/**\n * Extract all dependencies from issues (they're embedded in each issue)\n */\nexport function extractDependencies(issues: BeadIssue[]): BeadDependency[] {\n const deps: BeadDependency[] = [];\n const seen = new Set<string>();\n\n for (const issue of issues) {\n if (issue.dependencies) {\n for (const dep of issue.dependencies) {\n const key = `${dep.issue_id}->${dep.depends_on_id}:${dep.type}`;\n if (!seen.has(key)) {\n seen.add(key);\n deps.push(dep);\n }\n }\n }\n }\n\n return deps;\n}\n\n/**\n * Build graph data from issues and dependencies\n */\nexport function buildGraphData(\n issues: BeadIssue[],\n dependencies: BeadDependency[]\n): GraphData {\n const issueMap = new Map(issues.map((i) => [i.id, i]));\n\n // Count blockers and dependents for each issue\n const blockerCounts = new Map<string, string[]>(); // issue -> issues it blocks\n const dependentCounts = new Map<string, string[]>(); // issue -> issues that block it\n\n for (const dep of dependencies) {\n if (dep.type === \"blocks\" || dep.type === \"parent-child\") {\n // For blocks: depends_on_id blocks issue_id\n // For parent-child: depends_on_id is parent of issue_id\n // Both count as connections for node sizing\n if (!blockerCounts.has(dep.depends_on_id)) {\n blockerCounts.set(dep.depends_on_id, []);\n }\n blockerCounts.get(dep.depends_on_id)!.push(dep.issue_id);\n\n if (!dependentCounts.has(dep.issue_id)) {\n dependentCounts.set(dep.issue_id, []);\n }\n dependentCounts.get(dep.issue_id)!.push(dep.depends_on_id);\n }\n }\n\n const nodes: GraphNode[] = issues.map((issue) => ({\n id: issue.id,\n title: issue.title,\n description: issue.description,\n status: issue.status,\n priority: issue.priority,\n issueType: issue.issue_type,\n owner: issue.owner,\n assignee: issue.assignee,\n createdBy: issue.created_by,\n createdAt: issue.created_at,\n updatedAt: issue.updated_at,\n closedAt: issue.closed_at,\n closeReason: issue.close_reason,\n acceptanceCriteria: issue.acceptance_criteria,\n estimatedMinutes: issue.estimated_minutes,\n prefix: extractPrefix(issue.id),\n labels: issue.labels || [],\n\n blockerCount: blockerCounts.get(issue.id)?.length || 0,\n dependentCount: dependentCounts.get(issue.id)?.length || 0,\n blockerIds: blockerCounts.get(issue.id) || [],\n dependentIds: dependentCounts.get(issue.id) || [],\n }));\n\n // Build links: include blocking AND parent-child dependencies where both nodes exist\n const links: GraphLink[] = dependencies\n .filter(\n (d) =>\n (d.type === \"blocks\" || d.type === \"parent-child\") &&\n issueMap.has(d.issue_id) &&\n issueMap.has(d.depends_on_id)\n )\n .map((d) => ({\n // For both types: depends_on_id is the \"upstream\" node (blocker or parent)\n // blocks: blocker -> blocked\n // parent-child: parent -> child\n source: d.depends_on_id,\n target: d.issue_id,\n type: d.type,\n createdAt: d.created_at,\n }));\n\n return { nodes, links };\n}\n\n/**\n * Compute stats from issues and dependencies\n */\nexport function computeStats(\n issues: BeadIssue[],\n dependencies: BeadDependency[],\n graphData: GraphData\n) {\n const prefixes = [...new Set(issues.map((i) => extractPrefix(i.id)))];\n\n // An issue is \"actionable\" if it's open and has no open blockers\n const openIssueIds = new Set(\n issues.filter((i) => i.status !== \"closed\").map((i) => i.id)\n );\n\n const blockedByOpen = new Set<string>();\n for (const dep of dependencies) {\n if (dep.type === \"blocks\" && openIssueIds.has(dep.depends_on_id)) {\n // issue_id is blocked by depends_on_id which is still open\n blockedByOpen.add(dep.issue_id);\n }\n }\n\n const actionable = issues.filter(\n (i) =>\n (i.status === \"open\" || i.status === \"in_progress\") &&\n !blockedByOpen.has(i.id)\n ).length;\n\n return {\n total: issues.length,\n open: issues.filter((i) => i.status === \"open\").length,\n inProgress: issues.filter((i) => i.status === \"in_progress\").length,\n blocked: issues.filter((i) => i.status === \"blocked\").length,\n closed: issues.filter((i) => i.status === \"closed\").length,\n actionable,\n edges: graphData.links.length,\n prefixes,\n };\n}\n\n/**\n * Full pipeline: parse, extract, build, compute\n */\nexport function loadBeadsData(beadsDir?: string): BeadsApiResponse {\n const issues = parseIssuesJsonl(beadsDir);\n const dependencies = extractDependencies(issues);\n const graphData = buildGraphData(issues, dependencies);\n const stats = computeStats(issues, dependencies, graphData);\n\n return { issues, dependencies, graphData, stats };\n}\n","/**\n * Shared comment-fetching logic for beads.\n *\n * Fetches comments and likes from the Hypergoat GraphQL indexer,\n * resolves Bluesky profiles, builds threaded comment trees, and\n * detects claim info. Used by both the React hook (useBeadsComments)\n * and the public API routes (/api/v1/*).\n */\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface BeadsLike {\n did: string;\n handle: string;\n displayName?: string;\n avatar?: string;\n createdAt: string;\n uri: string; // AT-URI of the like record\n rkey: string;\n}\n\nexport interface BeadsComment {\n did: string;\n handle: string;\n displayName?: string;\n avatar?: string;\n text: string;\n createdAt: string;\n uri: string; // AT-URI of the comment record\n rkey: string;\n nodeId: string; // The beads issue ID this comment targets\n replyTo?: string; // AT-URI of parent comment (for threading)\n likes: BeadsLike[]; // Likes on this comment\n replies: BeadsComment[]; // Nested child comments (built during assembly)\n}\n\nexport interface ClaimInfo {\n handle: string;\n did: string;\n displayName?: string;\n avatar?: string;\n claimedAt: string;\n}\n\nexport interface FetchCommentsResult {\n /** Map from node ID -> threaded comment trees (root comments with nested replies) */\n commentsByNode: Map<string, BeadsComment[]>;\n /** Map from node ID -> total comment count (including replies) */\n commentedNodeIds: Map<string, number>;\n /** Flat list of ALL comments (including replies), newest-first */\n allComments: BeadsComment[];\n}\n\n// ============================================================================\n// Profile resolution (cached, deduplicated)\n// ============================================================================\n\ninterface ResolvedProfile {\n did: string;\n handle: string;\n displayName?: string;\n avatar?: string;\n}\n\nconst profileCache = new Map<string, ResolvedProfile>();\nconst profileInflight = new Map<string, Promise<ResolvedProfile>>();\n\nasync function resolveProfile(did: string): Promise<ResolvedProfile> {\n const cached = profileCache.get(did);\n if (cached) return cached;\n\n const inflight = profileInflight.get(did);\n if (inflight) return inflight;\n\n const promise = (async () => {\n try {\n const res = await fetch(\n `https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(did)}`\n );\n if (!res.ok) throw new Error(`Profile fetch failed: ${res.status}`);\n const data = await res.json();\n const profile: ResolvedProfile = {\n did,\n handle: data.handle || did,\n displayName: data.displayName || undefined,\n avatar: data.avatar || undefined,\n };\n profileCache.set(did, profile);\n return profile;\n } catch {\n // Fallback: use DID as handle\n const fallback: ResolvedProfile = {\n did,\n handle: did.slice(0, 20) + \"...\",\n };\n profileCache.set(did, fallback);\n return fallback;\n } finally {\n profileInflight.delete(did);\n }\n })();\n\n profileInflight.set(did, promise);\n return promise;\n}\n\n// ============================================================================\n// Hypergoat GraphQL fetching\n// ============================================================================\n\nconst INDEXER_URL =\n process.env.INDEXER_URL ||\n \"https://hypergoat-app-production.up.railway.app/graphql\";\n\nconst FETCH_RECORDS_QUERY = `\n query FetchRecords($collection: String!, $first: Int, $after: String) {\n records(collection: $collection, first: $first, after: $after) {\n edges {\n node {\n cid\n collection\n did\n rkey\n uri\n value\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n`;\n\ninterface IndexerRecord {\n cid: string;\n collection: string;\n did: string;\n rkey: string;\n uri: string;\n value: Record<string, unknown>;\n}\n\ninterface IndexerResponse {\n data?: {\n records?: {\n edges: Array<{ node: IndexerRecord }>;\n pageInfo: { hasNextPage: boolean; endCursor?: string };\n };\n };\n errors?: Array<{ message: string }>;\n}\n\nasync function fetchRecordsByCollection(\n collection: string\n): Promise<IndexerRecord[]> {\n const allRecords: IndexerRecord[] = [];\n let cursor: string | undefined;\n let hasMore = true;\n let pages = 0;\n const MAX_PAGES = 5; // Safety limit\n\n while (hasMore && pages < MAX_PAGES) {\n const res = await fetch(INDEXER_URL, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n query: FETCH_RECORDS_QUERY,\n variables: {\n collection,\n first: 100,\n after: cursor,\n },\n }),\n });\n\n if (!res.ok) {\n throw new Error(`Indexer fetch failed: ${res.status}`);\n }\n\n const json: IndexerResponse = await res.json();\n\n if (json.errors?.length) {\n throw new Error(json.errors[0].message);\n }\n\n const records = json.data?.records;\n if (!records) break;\n\n for (const edge of records.edges) {\n allRecords.push(edge.node);\n }\n\n hasMore = records.pageInfo.hasNextPage;\n cursor = records.pageInfo.endCursor;\n pages++;\n }\n\n return allRecords;\n}\n\n// ============================================================================\n// Core: fetch and process comments\n// ============================================================================\n\n/**\n * Fetch all beads comments and likes from Hypergoat, resolve profiles,\n * build threaded trees, and group by node.\n *\n * This is the pure data-fetching function used by both:\n * - `hooks/useBeadsComments.ts` (client-side React hook)\n * - `app/api/v1/*` routes (server-side API)\n */\nexport async function fetchBeadsComments(): Promise<FetchCommentsResult> {\n // 1. Fetch comments and likes in parallel from Hypergoat\n const [commentRecords, likeRecords] = await Promise.all([\n fetchRecordsByCollection(\"org.impactindexer.review.comment\"),\n fetchRecordsByCollection(\"org.impactindexer.review.like\"),\n ]);\n\n // 2. Filter to only beads-targeted comments\n const beadsCommentRecords = commentRecords.filter((r) => {\n const value = r.value as Record<string, unknown>;\n const subject = value.subject as\n | { uri?: string; type?: string }\n | undefined;\n return (\n subject?.uri &&\n typeof subject.uri === \"string\" &&\n subject.uri.startsWith(\"beads:\")\n );\n });\n\n // 3. Build likes-by-comment-URI map\n const likesByCommentUri = new Map<string, IndexerRecord[]>();\n for (const likeRecord of likeRecords) {\n const value = likeRecord.value as Record<string, unknown>;\n const subject = value.subject as\n | { uri?: string; type?: string }\n | undefined;\n if (\n subject?.uri &&\n typeof subject.uri === \"string\" &&\n subject.uri.startsWith(\"at://\")\n ) {\n const existing = likesByCommentUri.get(subject.uri) || [];\n existing.push(likeRecord);\n likesByCommentUri.set(subject.uri, existing);\n }\n }\n\n // 4. Resolve profiles for all unique DIDs (commenters + likers)\n const allDids = new Set<string>();\n for (const r of beadsCommentRecords) allDids.add(r.did);\n for (const r of likeRecords) allDids.add(r.did);\n\n const profiles = await Promise.all(\n [...allDids].map((did) => resolveProfile(did))\n );\n const profileMap = new Map(profiles.map((p) => [p.did, p]));\n\n // 5. Build flat comment list with likes attached\n const allFlat: BeadsComment[] = [];\n\n for (const record of beadsCommentRecords) {\n const value = record.value as Record<string, unknown>;\n const subject = value.subject as { uri: string };\n const nodeId = subject.uri.replace(/^beads:/, \"\");\n const text = (value.text as string) || \"\";\n const createdAt = (value.createdAt as string) || \"\";\n const replyTo = (value.replyTo as string) || undefined;\n const profile = profileMap.get(record.did);\n\n // Build likes for this comment\n const likeRecordsForComment =\n likesByCommentUri.get(record.uri) || [];\n const likes: BeadsLike[] = likeRecordsForComment.map((lr) => {\n const lp = profileMap.get(lr.did);\n const lv = lr.value as Record<string, unknown>;\n return {\n did: lr.did,\n handle: lp?.handle || lr.did.slice(0, 20) + \"...\",\n displayName: lp?.displayName,\n avatar: lp?.avatar,\n createdAt: (lv.createdAt as string) || \"\",\n uri: lr.uri,\n rkey: lr.rkey,\n };\n });\n\n const comment: BeadsComment = {\n did: record.did,\n handle: profile?.handle || record.did.slice(0, 20) + \"...\",\n displayName: profile?.displayName,\n avatar: profile?.avatar,\n text,\n createdAt,\n uri: record.uri,\n rkey: record.rkey,\n nodeId,\n replyTo,\n likes,\n replies: [], // Will be filled during tree assembly\n };\n\n allFlat.push(comment);\n }\n\n // 6. Build thread trees grouped by node\n\n // Index all comments by URI for tree assembly\n const commentByUri = new Map<string, BeadsComment>();\n for (const comment of allFlat) {\n commentByUri.set(comment.uri, comment);\n }\n\n // Assemble threads: attach replies to parents\n const rootComments: BeadsComment[] = [];\n for (const comment of allFlat) {\n if (comment.replyTo) {\n const parent = commentByUri.get(comment.replyTo);\n if (parent) {\n parent.replies.push(comment);\n continue; // Don't add as root\n }\n // Parent not found — treat as root comment\n }\n rootComments.push(comment);\n }\n\n // Sort: root comments newest-first, replies oldest-first (chronological)\n rootComments.sort(\n (a, b) =>\n new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()\n );\n\n function sortRepliesRecursive(comments: BeadsComment[]) {\n for (const c of comments) {\n c.replies.sort(\n (a, b) =>\n new Date(a.createdAt).getTime() -\n new Date(b.createdAt).getTime()\n );\n sortRepliesRecursive(c.replies);\n }\n }\n sortRepliesRecursive(rootComments);\n\n // Group root comments by nodeId\n const commentsByNode = new Map<string, BeadsComment[]>();\n for (const comment of rootComments) {\n const existing = commentsByNode.get(comment.nodeId) || [];\n existing.push(comment);\n commentsByNode.set(comment.nodeId, existing);\n }\n\n // 7. Build counts (total comments including replies per node)\n const commentedNodeIds = new Map<string, number>();\n for (const comment of allFlat) {\n commentedNodeIds.set(\n comment.nodeId,\n (commentedNodeIds.get(comment.nodeId) || 0) + 1\n );\n }\n\n // 8. Build allComments flat list (newest-first)\n const allComments = [...allFlat].sort(\n (a, b) =>\n new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()\n );\n\n return { commentsByNode, commentedNodeIds, allComments };\n}\n\n// ============================================================================\n// Claim detection\n// ============================================================================\n\n/**\n * Extract claim info from comments.\n * A claim comment has text starting with \"@\" and no spaces (e.g. \"@alice.bsky.social\").\n * First claim per node wins.\n */\nexport function getClaimedNodes(\n allComments: BeadsComment[]\n): Map<string, ClaimInfo> {\n const claims = new Map<string, ClaimInfo>();\n\n // Sort oldest-first so the first claim wins\n const sorted = [...allComments].sort(\n (a, b) =>\n new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()\n );\n\n for (const comment of sorted) {\n if (claims.has(comment.nodeId)) continue;\n\n const text = comment.text.trim();\n if (text.startsWith(\"@\") && text.indexOf(\" \") === -1) {\n claims.set(comment.nodeId, {\n handle: comment.handle,\n did: comment.did,\n displayName: comment.displayName,\n avatar: comment.avatar,\n claimedAt: comment.createdAt,\n });\n }\n }\n\n return claims;\n}\n","/**\n * Shared helpers for /api/v1/* routes.\n * Provides CORS headers, JSON response builders, and OPTIONS handler.\n */\n\nimport { NextResponse } from \"next/server\";\n\nconst CORS_HEADERS = {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Access-Control-Allow-Methods\": \"GET, OPTIONS\",\n \"Access-Control-Allow-Headers\": \"Content-Type\",\n};\n\n/**\n * Build a JSON response with CORS and Cache-Control headers.\n */\nexport function jsonResponse(data: unknown, status = 200) {\n return NextResponse.json(data, {\n status,\n headers: {\n ...CORS_HEADERS,\n \"Cache-Control\": \"public, max-age=30\",\n },\n });\n}\n\n/**\n * Build an error JSON response with CORS headers (no caching).\n */\nexport function errorResponse(\n error: string,\n status: number,\n hint?: string\n) {\n return NextResponse.json(\n { error, ...(hint ? { hint } : {}) },\n { status, headers: CORS_HEADERS }\n );\n}\n\n/**\n * Preflight OPTIONS handler for CORS. Re-export from each route file.\n */\nexport function OPTIONS() {\n return new NextResponse(null, { status: 204, headers: CORS_HEADERS });\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/v1/issues/[id]/route\",\n pathname: \"/api/v1/issues/[id]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/app/api/v1/issues/[id]/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/v1/issues/[id]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","/**\n * GET /api/v1/issues/:id — Single issue detail for AI agents.\n *\n * Returns one issue with full description, threaded comments,\n * claim info, and enriched blockers/dependents (with title + status).\n * No auth required.\n */\n\nimport { loadBeadsData } from \"@/lib/parse-beads\";\nimport { discoverBeadsDir } from \"@/lib/discover\";\nimport { fetchBeadsComments, getClaimedNodes } from \"@/lib/comments\";\nimport type { BeadsComment, ClaimInfo } from \"@/lib/comments\";\nimport type { GraphNode } from \"@/lib/types\";\nimport { jsonResponse, errorResponse, OPTIONS } from \"@/lib/api-helpers\";\nimport { readFileSync } from \"fs\";\nimport { join } from \"path\";\n\nexport const dynamic = \"force-dynamic\";\nexport { OPTIONS };\n\nlet heartbeadsVersion = \"0.0.0\";\ntry {\n const pkg = JSON.parse(\n readFileSync(join(process.cwd(), \"package.json\"), \"utf-8\")\n );\n heartbeadsVersion = pkg.version || heartbeadsVersion;\n} catch {\n // ignore\n}\n\nfunction serializeComment(c: BeadsComment): Record<string, unknown> {\n return {\n author: {\n handle: c.handle,\n did: c.did,\n ...(c.displayName ? { displayName: c.displayName } : {}),\n },\n text: c.text,\n createdAt: c.createdAt,\n likes: c.likes.length,\n replies: c.replies.map(serializeComment),\n };\n}\n\nexport async function GET(\n request: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n try {\n const discovery = discoverBeadsDir();\n const { id: issueId } = await params;\n\n // Load beads data + comments in parallel\n const [beadsData, commentsResult] = await Promise.all([\n Promise.resolve(loadBeadsData(discovery.beadsDir)),\n fetchBeadsComments().catch((err) => {\n console.error(\"[api/v1/issues] Failed to fetch comments:\", err);\n return null;\n }),\n ]);\n\n // Find the issue\n const nodeMap = new Map<string, GraphNode>(\n beadsData.graphData.nodes.map((n) => [n.id, n])\n );\n const node = nodeMap.get(issueId);\n\n if (!node) {\n return errorResponse(\n \"Issue not found\",\n 404,\n `No issue with id \"${issueId}\". Use GET /api/v1/graph to list all issues.`\n );\n }\n\n // Build enriched blockers/dependents with title + status\n // dependentIds = issues that block this one (upstream)\n // blockerIds = issues this one blocks (downstream)\n const enrichedBlockers = node.dependentIds\n .map((id) => {\n const n = nodeMap.get(id);\n return n\n ? { id: n.id, title: n.title, status: n.status }\n : { id, title: null, status: null };\n });\n\n const enrichedDependents = node.blockerIds\n .map((id) => {\n const n = nodeMap.get(id);\n return n\n ? { id: n.id, title: n.title, status: n.status }\n : { id, title: null, status: null };\n });\n\n // Comments and claims\n const nodeComments =\n commentsResult?.commentsByNode.get(issueId) || [];\n const claims = commentsResult\n ? getClaimedNodes(commentsResult.allComments)\n : new Map<string, ClaimInfo>();\n const claim = claims.get(issueId) || null;\n\n const warnings: string[] = [];\n if (!commentsResult) {\n warnings.push(\"Failed to fetch comments from indexer\");\n }\n\n return jsonResponse({\n issue: {\n id: node.id,\n title: node.title,\n description: node.description || null,\n status: node.status,\n priority: node.priority,\n issue_type: node.issueType,\n owner: node.owner || null,\n assignee: node.assignee || null,\n labels: node.labels,\n created_at: node.createdAt,\n updated_at: node.updatedAt,\n closed_at: node.closedAt || null,\n close_reason: node.closeReason || null,\n prefix: node.prefix,\n blockers: enrichedBlockers,\n dependents: enrichedDependents,\n comments: nodeComments.map(serializeComment),\n claimed_by: claim\n ? {\n handle: claim.handle,\n did: claim.did,\n ...(claim.displayName\n ? { displayName: claim.displayName }\n : {}),\n claimed_at: claim.claimedAt,\n }\n : null,\n },\n _meta: {\n generated_at: new Date().toISOString(),\n api_version: \"v1\" as const,\n heartbeads_version: heartbeadsVersion,\n ...(warnings.length ? { warnings } : {}),\n },\n });\n } catch (error: unknown) {\n const message =\n error instanceof Error ? error.message : \"Unknown error\";\n if (message.includes(\"No .beads/ directory found\")) {\n return errorResponse(\n \"No .beads directory found\",\n 404,\n \"Run bd init in your project first, or set BEADS_DIR.\"\n );\n }\n console.error(\"[api/v1/issues] Error:\", error);\n return errorResponse(\"Internal server error\", 500);\n }\n}\n"],"names":[],"mappings":"8iCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAaO,SAAS,EAAc,CAAU,EACtC,IAAM,EAAW,EAAG,WAAW,CAAC,YAChC,AAAiB,CAAC,GAAG,CAAjB,EAAwB,EACrB,EAAG,SAAS,CAAC,EAAG,EACzB,CAKO,SAAS,EAAuB,CAAgB,EACrD,IAAM,EAAa,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,EAAU,eAClC,GAAI,CACF,IAAM,EAAU,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAY,SACnC,EAAS,CAAA,EAAA,EAAA,KAAS,AAAT,EAAU,GACnB,EAAa,GAAQ,OAAO,WAClC,GAAI,MAAM,OAAO,CAAC,GAChB,OAAO,EACJ,CAF0B,EAEvB,CAAC,AAAC,GAAc,CAAA,EAAA,EAAA,OAAA,AAAO,EAAC,EAAU,KAAM,IAC3C,MAAM,CAAC,AAAC,GAAc,CAAA,EAAA,EAAA,UAAA,AAAU,EAAC,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,EAAG,SAAU,iBAE1D,CAAE,MAAO,EAAK,CAC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,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
|
|
1
|
+
{"version":3,"sources":["../../../lib/parse-beads.ts","../../../lib/comments.ts","../../../lib/api-helpers.ts","../../../node_modules/.pnpm/next%4016.1.6_react-dom%4018.3.1_react%4018.3.1__react%4018.3.1/node_modules/next/dist/esm/build/templates/app-route.js","../../../app/api/v1/issues/%5Bid%5D/route.ts"],"sourcesContent":["import { readFileSync, existsSync } from \"fs\";\nimport { join, resolve } from \"path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { discoverBeadsDir } from \"./discover\";\nimport type {\n BeadIssue,\n BeadDependency,\n GraphNode,\n GraphLink,\n GraphData,\n BeadsApiResponse,\n} from \"./types\";\n\n/**\n * Extract the prefix from a bead ID (e.g. \"my-app-5gw\" -> \"my-app\")\n */\nexport function extractPrefix(id: string): string {\n const lastDash = id.lastIndexOf(\"-\");\n if (lastDash === -1) return id;\n return id.substring(0, lastDash);\n}\n\n/**\n * Read repos.additional paths from .beads/config.yaml\n */\nexport function getAdditionalRepoPaths(beadsDir: string): string[] {\n const configPath = join(beadsDir, \"config.yaml\");\n try {\n const content = readFileSync(configPath, \"utf-8\");\n const config = parseYaml(content);\n const additional = config?.repos?.additional;\n if (Array.isArray(additional)) {\n return additional\n .map((p: string) => resolve(beadsDir, \"..\", p))\n .filter((p: string) => existsSync(join(p, \".beads\", \"issues.jsonl\")));\n }\n } catch (err) {\n console.error(\"Failed to read config.yaml:\", err);\n }\n return [];\n}\n\n/**\n * Parse a single issues.jsonl file and return issues\n */\nfunction parseJsonlFile(filePath: string): BeadIssue[] {\n let content: string;\n try {\n content = readFileSync(filePath, \"utf-8\");\n } catch (err) {\n console.error(`Failed to read ${filePath}:`, err);\n return [];\n }\n\n const lines = content.split(\"\\n\").filter((line) => line.trim().length > 0);\n const issues: BeadIssue[] = [];\n\n for (let i = 0; i < lines.length; i++) {\n try {\n issues.push(JSON.parse(lines[i]) as BeadIssue);\n } catch (err) {\n console.warn(`Skipping malformed line ${i + 1} in ${filePath}:`, err);\n }\n }\n\n return issues;\n}\n\n/**\n * Parse issues.jsonl from the primary .beads directory and all additional repos\n */\nexport function parseIssuesJsonl(beadsDir?: string): BeadIssue[] {\n const dir = beadsDir || discoverBeadsDir().beadsDir;\n\n // Load primary repo issues\n const primaryPath = join(dir, \"issues.jsonl\");\n const issues = parseJsonlFile(primaryPath);\n\n // Load additional repo issues from config.yaml\n const additionalRepos = getAdditionalRepoPaths(dir);\n for (const repoPath of additionalRepos) {\n const repoJsonl = join(repoPath, \".beads\", \"issues.jsonl\");\n const repoIssues = parseJsonlFile(repoJsonl);\n issues.push(...repoIssues);\n }\n\n // Deduplicate by issue ID (primary repo wins for non-empty fields).\n // When a duplicate is found, merge any empty fields from the duplicate into the first copy.\n // This handles the case where the hub DB lost created_by/owner during import\n // but individual repos have them.\n const seen = new Map<string, BeadIssue>();\n const result: BeadIssue[] = [];\n for (const issue of issues) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((issue as any).status === \"tombstone\") continue;\n const existing = seen.get(issue.id);\n if (existing) {\n // Merge: fill empty fields from duplicate\n if (!existing.created_by && issue.created_by) existing.created_by = issue.created_by;\n if (!existing.owner && issue.owner) existing.owner = issue.owner;\n if (!existing.assignee && issue.assignee) existing.assignee = issue.assignee;\n if (!existing.close_reason && issue.close_reason) existing.close_reason = issue.close_reason;\n if (!existing.acceptance_criteria && issue.acceptance_criteria) existing.acceptance_criteria = issue.acceptance_criteria;\n if (existing.estimated_minutes == null && issue.estimated_minutes != null) existing.estimated_minutes = issue.estimated_minutes;\n if ((!existing.labels || existing.labels.length === 0) && issue.labels && issue.labels.length > 0) existing.labels = issue.labels;\n } else {\n seen.set(issue.id, issue);\n result.push(issue);\n }\n }\n return result;\n}\n\n/**\n * Extract all dependencies from issues (they're embedded in each issue)\n */\nexport function extractDependencies(issues: BeadIssue[]): BeadDependency[] {\n const deps: BeadDependency[] = [];\n const seen = new Set<string>();\n\n for (const issue of issues) {\n if (issue.dependencies) {\n for (const dep of issue.dependencies) {\n const key = `${dep.issue_id}->${dep.depends_on_id}:${dep.type}`;\n if (!seen.has(key)) {\n seen.add(key);\n deps.push(dep);\n }\n }\n }\n }\n\n return deps;\n}\n\n/**\n * Build graph data from issues and dependencies\n */\nexport function buildGraphData(\n issues: BeadIssue[],\n dependencies: BeadDependency[]\n): GraphData {\n const issueMap = new Map(issues.map((i) => [i.id, i]));\n\n // Count blockers and dependents for each issue\n const blockerCounts = new Map<string, string[]>(); // issue -> issues it blocks\n const dependentCounts = new Map<string, string[]>(); // issue -> issues that block it\n\n for (const dep of dependencies) {\n if (dep.type === \"blocks\" || dep.type === \"parent-child\") {\n // For blocks: depends_on_id blocks issue_id\n // For parent-child: depends_on_id is parent of issue_id\n // Both count as connections for node sizing\n if (!blockerCounts.has(dep.depends_on_id)) {\n blockerCounts.set(dep.depends_on_id, []);\n }\n blockerCounts.get(dep.depends_on_id)!.push(dep.issue_id);\n\n if (!dependentCounts.has(dep.issue_id)) {\n dependentCounts.set(dep.issue_id, []);\n }\n dependentCounts.get(dep.issue_id)!.push(dep.depends_on_id);\n }\n }\n\n const nodes: GraphNode[] = issues.map((issue) => ({\n id: issue.id,\n title: issue.title,\n description: issue.description,\n status: issue.status,\n priority: issue.priority,\n issueType: issue.issue_type,\n owner: issue.owner,\n assignee: issue.assignee,\n createdBy: issue.created_by,\n createdAt: issue.created_at,\n updatedAt: issue.updated_at,\n closedAt: issue.closed_at,\n closeReason: issue.close_reason,\n acceptanceCriteria: issue.acceptance_criteria,\n estimatedMinutes: issue.estimated_minutes,\n prefix: extractPrefix(issue.id),\n labels: issue.labels || [],\n\n blockerCount: blockerCounts.get(issue.id)?.length || 0,\n dependentCount: dependentCounts.get(issue.id)?.length || 0,\n blockerIds: blockerCounts.get(issue.id) || [],\n dependentIds: dependentCounts.get(issue.id) || [],\n }));\n\n // Build links: include blocking AND parent-child dependencies where both nodes exist\n const links: GraphLink[] = dependencies\n .filter(\n (d) =>\n (d.type === \"blocks\" || d.type === \"parent-child\") &&\n issueMap.has(d.issue_id) &&\n issueMap.has(d.depends_on_id)\n )\n .map((d) => ({\n // For both types: depends_on_id is the \"upstream\" node (blocker or parent)\n // blocks: blocker -> blocked\n // parent-child: parent -> child\n source: d.depends_on_id,\n target: d.issue_id,\n type: d.type,\n createdAt: d.created_at,\n }));\n\n return { nodes, links };\n}\n\n/**\n * Compute stats from issues and dependencies\n */\nexport function computeStats(\n issues: BeadIssue[],\n dependencies: BeadDependency[],\n graphData: GraphData\n) {\n const prefixes = [...new Set(issues.map((i) => extractPrefix(i.id)))];\n\n // An issue is \"actionable\" if it's open and has no open blockers\n const openIssueIds = new Set(\n issues.filter((i) => i.status !== \"closed\").map((i) => i.id)\n );\n\n const blockedByOpen = new Set<string>();\n for (const dep of dependencies) {\n if (dep.type === \"blocks\" && openIssueIds.has(dep.depends_on_id)) {\n // issue_id is blocked by depends_on_id which is still open\n blockedByOpen.add(dep.issue_id);\n }\n }\n\n const actionable = issues.filter(\n (i) =>\n (i.status === \"open\" || i.status === \"in_progress\") &&\n !blockedByOpen.has(i.id)\n ).length;\n\n return {\n total: issues.length,\n open: issues.filter((i) => i.status === \"open\").length,\n inProgress: issues.filter((i) => i.status === \"in_progress\").length,\n blocked: issues.filter((i) => i.status === \"blocked\").length,\n closed: issues.filter((i) => i.status === \"closed\").length,\n actionable,\n edges: graphData.links.length,\n prefixes,\n };\n}\n\n/**\n * Full pipeline: parse, extract, build, compute\n */\nexport function loadBeadsData(beadsDir?: string): BeadsApiResponse {\n const issues = parseIssuesJsonl(beadsDir);\n const dependencies = extractDependencies(issues);\n const graphData = buildGraphData(issues, dependencies);\n const stats = computeStats(issues, dependencies, graphData);\n\n return { issues, dependencies, graphData, stats };\n}\n","/**\n * Shared comment-fetching logic for beads.\n *\n * Fetches comments and likes from the Hypergoat GraphQL indexer,\n * resolves Bluesky profiles, builds threaded comment trees, and\n * detects claim info. Used by both the React hook (useBeadsComments)\n * and the public API routes (/api/v1/*).\n */\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface BeadsLike {\n did: string;\n handle: string;\n displayName?: string;\n avatar?: string;\n createdAt: string;\n uri: string; // AT-URI of the like record\n rkey: string;\n}\n\nexport interface BeadsComment {\n did: string;\n handle: string;\n displayName?: string;\n avatar?: string;\n text: string;\n createdAt: string;\n uri: string; // AT-URI of the comment record\n rkey: string;\n nodeId: string; // The beads issue ID this comment targets\n replyTo?: string; // AT-URI of parent comment (for threading)\n likes: BeadsLike[]; // Likes on this comment\n replies: BeadsComment[]; // Nested child comments (built during assembly)\n}\n\nexport interface ClaimInfo {\n handle: string;\n did: string;\n displayName?: string;\n avatar?: string;\n claimedAt: string;\n}\n\nexport interface FetchCommentsResult {\n /** Map from node ID -> threaded comment trees (root comments with nested replies) */\n commentsByNode: Map<string, BeadsComment[]>;\n /** Map from node ID -> total comment count (including replies) */\n commentedNodeIds: Map<string, number>;\n /** Flat list of ALL comments (including replies), newest-first */\n allComments: BeadsComment[];\n}\n\n// ============================================================================\n// Profile resolution (cached, deduplicated)\n// ============================================================================\n\ninterface ResolvedProfile {\n did: string;\n handle: string;\n displayName?: string;\n avatar?: string;\n}\n\nconst profileCache = new Map<string, ResolvedProfile>();\nconst profileInflight = new Map<string, Promise<ResolvedProfile>>();\n\nasync function resolveProfile(did: string): Promise<ResolvedProfile> {\n const cached = profileCache.get(did);\n if (cached) return cached;\n\n const inflight = profileInflight.get(did);\n if (inflight) return inflight;\n\n const promise = (async () => {\n try {\n const res = await fetch(\n `https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(did)}`\n );\n if (!res.ok) throw new Error(`Profile fetch failed: ${res.status}`);\n const data = await res.json();\n const profile: ResolvedProfile = {\n did,\n handle: data.handle || did,\n displayName: data.displayName || undefined,\n avatar: data.avatar || undefined,\n };\n profileCache.set(did, profile);\n return profile;\n } catch {\n // Fallback: use DID as handle\n const fallback: ResolvedProfile = {\n did,\n handle: did.slice(0, 20) + \"...\",\n };\n profileCache.set(did, fallback);\n return fallback;\n } finally {\n profileInflight.delete(did);\n }\n })();\n\n profileInflight.set(did, promise);\n return promise;\n}\n\n// ============================================================================\n// Hypergoat GraphQL fetching\n// ============================================================================\n\nconst INDEXER_URL =\n process.env.INDEXER_URL ||\n \"https://hypergoat-app-production.up.railway.app/graphql\";\n\nconst FETCH_RECORDS_QUERY = `\n query FetchRecords($collection: String!, $first: Int, $after: String) {\n records(collection: $collection, first: $first, after: $after) {\n edges {\n node {\n cid\n collection\n did\n rkey\n uri\n value\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n`;\n\ninterface IndexerRecord {\n cid: string;\n collection: string;\n did: string;\n rkey: string;\n uri: string;\n value: Record<string, unknown>;\n}\n\ninterface IndexerResponse {\n data?: {\n records?: {\n edges: Array<{ node: IndexerRecord }>;\n pageInfo: { hasNextPage: boolean; endCursor?: string };\n };\n };\n errors?: Array<{ message: string }>;\n}\n\nasync function fetchRecordsByCollection(\n collection: string\n): Promise<IndexerRecord[]> {\n const allRecords: IndexerRecord[] = [];\n let cursor: string | undefined;\n let hasMore = true;\n let pages = 0;\n const MAX_PAGES = 5; // Safety limit\n\n while (hasMore && pages < MAX_PAGES) {\n const res = await fetch(INDEXER_URL, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n query: FETCH_RECORDS_QUERY,\n variables: {\n collection,\n first: 100,\n after: cursor,\n },\n }),\n });\n\n if (!res.ok) {\n throw new Error(`Indexer fetch failed: ${res.status}`);\n }\n\n const json: IndexerResponse = await res.json();\n\n if (json.errors?.length) {\n throw new Error(json.errors[0].message);\n }\n\n const records = json.data?.records;\n if (!records) break;\n\n for (const edge of records.edges) {\n allRecords.push(edge.node);\n }\n\n hasMore = records.pageInfo.hasNextPage;\n cursor = records.pageInfo.endCursor;\n pages++;\n }\n\n return allRecords;\n}\n\n// ============================================================================\n// Core: fetch and process comments\n// ============================================================================\n\n/**\n * Fetch all beads comments and likes from Hypergoat, resolve profiles,\n * build threaded trees, and group by node.\n *\n * This is the pure data-fetching function used by both:\n * - `hooks/useBeadsComments.ts` (client-side React hook)\n * - `app/api/v1/*` routes (server-side API)\n */\nexport async function fetchBeadsComments(): Promise<FetchCommentsResult> {\n // 1. Fetch comments and likes in parallel from Hypergoat\n const [commentRecords, likeRecords] = await Promise.all([\n fetchRecordsByCollection(\"org.impactindexer.review.comment\"),\n fetchRecordsByCollection(\"org.impactindexer.review.like\"),\n ]);\n\n // 2. Filter to only beads-targeted comments\n const beadsCommentRecords = commentRecords.filter((r) => {\n const value = r.value as Record<string, unknown>;\n const subject = value.subject as\n | { uri?: string; type?: string }\n | undefined;\n return (\n subject?.uri &&\n typeof subject.uri === \"string\" &&\n subject.uri.startsWith(\"beads:\")\n );\n });\n\n // 3. Build likes-by-comment-URI map\n const likesByCommentUri = new Map<string, IndexerRecord[]>();\n for (const likeRecord of likeRecords) {\n const value = likeRecord.value as Record<string, unknown>;\n const subject = value.subject as\n | { uri?: string; type?: string }\n | undefined;\n if (\n subject?.uri &&\n typeof subject.uri === \"string\" &&\n subject.uri.startsWith(\"at://\")\n ) {\n const existing = likesByCommentUri.get(subject.uri) || [];\n existing.push(likeRecord);\n likesByCommentUri.set(subject.uri, existing);\n }\n }\n\n // 4. Resolve profiles for all unique DIDs (commenters + likers)\n const allDids = new Set<string>();\n for (const r of beadsCommentRecords) allDids.add(r.did);\n for (const r of likeRecords) allDids.add(r.did);\n\n const profiles = await Promise.all(\n [...allDids].map((did) => resolveProfile(did))\n );\n const profileMap = new Map(profiles.map((p) => [p.did, p]));\n\n // 5. Build flat comment list with likes attached\n const allFlat: BeadsComment[] = [];\n\n for (const record of beadsCommentRecords) {\n const value = record.value as Record<string, unknown>;\n const subject = value.subject as { uri: string };\n const nodeId = subject.uri.replace(/^beads:/, \"\");\n const text = (value.text as string) || \"\";\n const createdAt = (value.createdAt as string) || \"\";\n const replyTo = (value.replyTo as string) || undefined;\n const profile = profileMap.get(record.did);\n\n // Build likes for this comment\n const likeRecordsForComment =\n likesByCommentUri.get(record.uri) || [];\n const likes: BeadsLike[] = likeRecordsForComment.map((lr) => {\n const lp = profileMap.get(lr.did);\n const lv = lr.value as Record<string, unknown>;\n return {\n did: lr.did,\n handle: lp?.handle || lr.did.slice(0, 20) + \"...\",\n displayName: lp?.displayName,\n avatar: lp?.avatar,\n createdAt: (lv.createdAt as string) || \"\",\n uri: lr.uri,\n rkey: lr.rkey,\n };\n });\n\n const comment: BeadsComment = {\n did: record.did,\n handle: profile?.handle || record.did.slice(0, 20) + \"...\",\n displayName: profile?.displayName,\n avatar: profile?.avatar,\n text,\n createdAt,\n uri: record.uri,\n rkey: record.rkey,\n nodeId,\n replyTo,\n likes,\n replies: [], // Will be filled during tree assembly\n };\n\n allFlat.push(comment);\n }\n\n // 6. Build thread trees grouped by node\n\n // Index all comments by URI for tree assembly\n const commentByUri = new Map<string, BeadsComment>();\n for (const comment of allFlat) {\n commentByUri.set(comment.uri, comment);\n }\n\n // Assemble threads: attach replies to parents\n const rootComments: BeadsComment[] = [];\n for (const comment of allFlat) {\n if (comment.replyTo) {\n const parent = commentByUri.get(comment.replyTo);\n if (parent) {\n parent.replies.push(comment);\n continue; // Don't add as root\n }\n // Parent not found — treat as root comment\n }\n rootComments.push(comment);\n }\n\n // Sort: root comments newest-first, replies oldest-first (chronological)\n rootComments.sort(\n (a, b) =>\n new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()\n );\n\n function sortRepliesRecursive(comments: BeadsComment[]) {\n for (const c of comments) {\n c.replies.sort(\n (a, b) =>\n new Date(a.createdAt).getTime() -\n new Date(b.createdAt).getTime()\n );\n sortRepliesRecursive(c.replies);\n }\n }\n sortRepliesRecursive(rootComments);\n\n // Group root comments by nodeId\n const commentsByNode = new Map<string, BeadsComment[]>();\n for (const comment of rootComments) {\n const existing = commentsByNode.get(comment.nodeId) || [];\n existing.push(comment);\n commentsByNode.set(comment.nodeId, existing);\n }\n\n // 7. Build counts (total comments including replies per node)\n const commentedNodeIds = new Map<string, number>();\n for (const comment of allFlat) {\n commentedNodeIds.set(\n comment.nodeId,\n (commentedNodeIds.get(comment.nodeId) || 0) + 1\n );\n }\n\n // 8. Build allComments flat list (newest-first)\n const allComments = [...allFlat].sort(\n (a, b) =>\n new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()\n );\n\n return { commentsByNode, commentedNodeIds, allComments };\n}\n\n// ============================================================================\n// Claim detection\n// ============================================================================\n\n/**\n * Extract claim info from comments.\n * A claim comment has text starting with \"@\" and no spaces (e.g. \"@alice.bsky.social\").\n * First claim per node wins.\n */\nexport function getClaimedNodes(\n allComments: BeadsComment[]\n): Map<string, ClaimInfo> {\n const claims = new Map<string, ClaimInfo>();\n\n // Sort oldest-first so the first claim wins\n const sorted = [...allComments].sort(\n (a, b) =>\n new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()\n );\n\n for (const comment of sorted) {\n if (claims.has(comment.nodeId)) continue;\n\n const text = comment.text.trim();\n if (text.startsWith(\"@\") && text.indexOf(\" \") === -1) {\n claims.set(comment.nodeId, {\n handle: comment.handle,\n did: comment.did,\n displayName: comment.displayName,\n avatar: comment.avatar,\n claimedAt: comment.createdAt,\n });\n }\n }\n\n return claims;\n}\n","/**\n * Shared helpers for /api/v1/* routes.\n * Provides CORS headers, JSON response builders, and OPTIONS handler.\n */\n\nimport { NextResponse } from \"next/server\";\n\nconst CORS_HEADERS = {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Access-Control-Allow-Methods\": \"GET, OPTIONS\",\n \"Access-Control-Allow-Headers\": \"Content-Type\",\n};\n\n/**\n * Build a JSON response with CORS and Cache-Control headers.\n */\nexport function jsonResponse(data: unknown, status = 200) {\n return NextResponse.json(data, {\n status,\n headers: {\n ...CORS_HEADERS,\n \"Cache-Control\": \"public, max-age=30\",\n },\n });\n}\n\n/**\n * Build an error JSON response with CORS headers (no caching).\n */\nexport function errorResponse(\n error: string,\n status: number,\n hint?: string\n) {\n return NextResponse.json(\n { error, ...(hint ? { hint } : {}) },\n { status, headers: CORS_HEADERS }\n );\n}\n\n/**\n * Preflight OPTIONS handler for CORS. Re-export from each route file.\n */\nexport function OPTIONS() {\n return new NextResponse(null, { status: 204, headers: CORS_HEADERS });\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/v1/issues/[id]/route\",\n pathname: \"/api/v1/issues/[id]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/app/api/v1/issues/[id]/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/v1/issues/[id]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","/**\n * GET /api/v1/issues/:id — Single issue detail for AI agents.\n *\n * Returns one issue with full description, threaded comments,\n * claim info, and enriched blockers/dependents (with title + status).\n * No auth required.\n */\n\nimport { loadBeadsData } from \"@/lib/parse-beads\";\nimport { discoverBeadsDir } from \"@/lib/discover\";\nimport { fetchBeadsComments, getClaimedNodes } from \"@/lib/comments\";\nimport type { BeadsComment, ClaimInfo } from \"@/lib/comments\";\nimport type { GraphNode } from \"@/lib/types\";\nimport { jsonResponse, errorResponse, OPTIONS } from \"@/lib/api-helpers\";\nimport { readFileSync } from \"fs\";\nimport { join } from \"path\";\n\nexport const dynamic = \"force-dynamic\";\nexport { OPTIONS };\n\nlet heartbeadsVersion = \"0.0.0\";\ntry {\n const pkg = JSON.parse(\n readFileSync(join(process.cwd(), \"package.json\"), \"utf-8\")\n );\n heartbeadsVersion = pkg.version || heartbeadsVersion;\n} catch {\n // ignore\n}\n\nfunction serializeComment(c: BeadsComment): Record<string, unknown> {\n return {\n author: {\n handle: c.handle,\n did: c.did,\n ...(c.displayName ? { displayName: c.displayName } : {}),\n },\n text: c.text,\n createdAt: c.createdAt,\n likes: c.likes.length,\n replies: c.replies.map(serializeComment),\n };\n}\n\nexport async function GET(\n request: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n try {\n const discovery = discoverBeadsDir();\n const { id: issueId } = await params;\n\n // Load beads data + comments in parallel\n const [beadsData, commentsResult] = await Promise.all([\n Promise.resolve(loadBeadsData(discovery.beadsDir)),\n fetchBeadsComments().catch((err) => {\n console.error(\"[api/v1/issues] Failed to fetch comments:\", err);\n return null;\n }),\n ]);\n\n // Find the issue\n const nodeMap = new Map<string, GraphNode>(\n beadsData.graphData.nodes.map((n) => [n.id, n])\n );\n const node = nodeMap.get(issueId);\n\n if (!node) {\n return errorResponse(\n \"Issue not found\",\n 404,\n `No issue with id \"${issueId}\". Use GET /api/v1/graph to list all issues.`\n );\n }\n\n // Build enriched blockers/dependents with title + status\n // dependentIds = issues that block this one (upstream)\n // blockerIds = issues this one blocks (downstream)\n const enrichedBlockers = node.dependentIds\n .map((id) => {\n const n = nodeMap.get(id);\n return n\n ? { id: n.id, title: n.title, status: n.status }\n : { id, title: null, status: null };\n });\n\n const enrichedDependents = node.blockerIds\n .map((id) => {\n const n = nodeMap.get(id);\n return n\n ? { id: n.id, title: n.title, status: n.status }\n : { id, title: null, status: null };\n });\n\n // Comments and claims\n const nodeComments =\n commentsResult?.commentsByNode.get(issueId) || [];\n const claims = commentsResult\n ? getClaimedNodes(commentsResult.allComments)\n : new Map<string, ClaimInfo>();\n const claim = claims.get(issueId) || null;\n\n const warnings: string[] = [];\n if (!commentsResult) {\n warnings.push(\"Failed to fetch comments from indexer\");\n }\n\n return jsonResponse({\n issue: {\n id: node.id,\n title: node.title,\n description: node.description || null,\n status: node.status,\n priority: node.priority,\n issue_type: node.issueType,\n owner: node.owner || null,\n assignee: node.assignee || null,\n labels: node.labels,\n created_at: node.createdAt,\n updated_at: node.updatedAt,\n closed_at: node.closedAt || null,\n close_reason: node.closeReason || null,\n prefix: node.prefix,\n blockers: enrichedBlockers,\n dependents: enrichedDependents,\n comments: nodeComments.map(serializeComment),\n claimed_by: claim\n ? {\n handle: claim.handle,\n did: claim.did,\n ...(claim.displayName\n ? { displayName: claim.displayName }\n : {}),\n claimed_at: claim.claimedAt,\n }\n : null,\n },\n _meta: {\n generated_at: new Date().toISOString(),\n api_version: \"v1\" as const,\n heartbeads_version: heartbeadsVersion,\n ...(warnings.length ? { warnings } : {}),\n },\n });\n } catch (error: unknown) {\n const message =\n error instanceof Error ? error.message : \"Unknown error\";\n if (message.includes(\"No .beads/ directory found\")) {\n return errorResponse(\n \"No .beads directory found\",\n 404,\n \"Run bd init in your project first, or set BEADS_DIR.\"\n );\n }\n console.error(\"[api/v1/issues] Error:\", error);\n return errorResponse(\"Internal server error\", 500);\n }\n}\n"],"names":[],"mappings":"8iCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAaO,SAAS,EAAc,CAAU,EACtC,IAAM,EAAW,EAAG,WAAW,CAAC,YAChC,AAAiB,CAAC,GAAG,CAAjB,EAAwB,EACrB,EAAG,SAAS,CAAC,EAAG,EACzB,CAKO,SAAS,EAAuB,CAAgB,EACrD,IAAM,EAAa,CAAA,EAAA,EAAA,IAAI,AAAJ,EAAK,EAAU,eAClC,GAAI,CACF,IAAM,EAAU,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAY,SACnC,EAAS,CAAA,EAAA,EAAA,KAAS,AAAT,EAAU,GACnB,EAAa,GAAQ,OAAO,WAClC,GAAI,MAAM,OAAO,CAAC,GAChB,OAAO,EACJ,CAF0B,EAEvB,CAAC,AAAC,GAAc,CAAA,EAAA,EAAA,OAAA,AAAO,EAAC,EAAU,KAAM,IAC3C,MAAM,CAAC,AAAC,GAAc,CAAA,EAAA,EAAA,UAAA,AAAU,EAAC,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,EAAG,SAAU,iBAE1D,CAAE,MAAO,EAAK,CACZ,QAAQ,KAAK,CAAC,8BAA+B,EAC/C,CACA,MAAO,EAAE,AACX,CAKA,SAAS,EAAe,CAAgB,MAClC,EACJ,GAAI,CACF,EAAU,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAU,QACnC,CAAE,MAAO,EAAK,CAEZ,OADA,QAAQ,KAAK,CAAC,CAAC,eAAe,EAAE,EAAS,CAAC,CAAC,CAAE,GACtC,EAAE,AACX,CAEA,IAAM,EAAQ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e,EADT,CAGZ,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAEf,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},48676,e=>{"use strict";var t=e.i(22734),r=e.i(14747),n=e.i(24863),a=e.i(63846);function s(e){let t=e.lastIndexOf("-");return -1===t?e:e.substring(0,t)}function i(e){let a=(0,r.join)(e,"config.yaml");try{let s=(0,t.readFileSync)(a,"utf-8"),i=(0,n.parse)(s),o=i?.repos?.additional;if(Array.isArray(o))return o.map(t=>(0,r.resolve)(e,"..",t)).filter(e=>(0,t.existsSync)((0,r.join)(e,".beads","issues.jsonl")))}catch(e){console.error("Failed to read config.yaml:",e)}return[]}function o(e){let r;try{r=(0,t.readFileSync)(e,"utf-8")}catch(t){return console.error(`Failed to read ${e}:`,t),[]}let n=r.split("\n").filter(e=>e.trim().length>0),a=[];for(let t=0;t<n.length;t++)try{a.push(JSON.parse(n[t]))}catch(r){console.warn(`Skipping malformed line ${t+1} in ${e}:`,r)}return a}function l(e){let t=function(e){let t=e||(0,a.discoverBeadsDir)().beadsDir,n=o((0,r.join)(t,"issues.jsonl"));for(let e of i(t)){let t=o((0,r.join)(e,".beads","issues.jsonl"));n.push(...t)}let s=new
|
|
1
|
+
module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},48676,e=>{"use strict";var t=e.i(22734),r=e.i(14747),n=e.i(24863),a=e.i(63846);function s(e){let t=e.lastIndexOf("-");return -1===t?e:e.substring(0,t)}function i(e){let a=(0,r.join)(e,"config.yaml");try{let s=(0,t.readFileSync)(a,"utf-8"),i=(0,n.parse)(s),o=i?.repos?.additional;if(Array.isArray(o))return o.map(t=>(0,r.resolve)(e,"..",t)).filter(e=>(0,t.existsSync)((0,r.join)(e,".beads","issues.jsonl")))}catch(e){console.error("Failed to read config.yaml:",e)}return[]}function o(e){let r;try{r=(0,t.readFileSync)(e,"utf-8")}catch(t){return console.error(`Failed to read ${e}:`,t),[]}let n=r.split("\n").filter(e=>e.trim().length>0),a=[];for(let t=0;t<n.length;t++)try{a.push(JSON.parse(n[t]))}catch(r){console.warn(`Skipping malformed line ${t+1} in ${e}:`,r)}return a}function l(e){let t=function(e){let t=e||(0,a.discoverBeadsDir)().beadsDir,n=o((0,r.join)(t,"issues.jsonl"));for(let e of i(t)){let t=o((0,r.join)(e,".beads","issues.jsonl"));n.push(...t)}let s=new Map,l=[];for(let e of n){if("tombstone"===e.status)continue;let t=s.get(e.id);t?(!t.created_by&&e.created_by&&(t.created_by=e.created_by),!t.owner&&e.owner&&(t.owner=e.owner),!t.assignee&&e.assignee&&(t.assignee=e.assignee),!t.close_reason&&e.close_reason&&(t.close_reason=e.close_reason),!t.acceptance_criteria&&e.acceptance_criteria&&(t.acceptance_criteria=e.acceptance_criteria),null==t.estimated_minutes&&null!=e.estimated_minutes&&(t.estimated_minutes=e.estimated_minutes),(!t.labels||0===t.labels.length)&&e.labels&&e.labels.length>0&&(t.labels=e.labels)):(s.set(e.id,e),l.push(e))}return l}(e),n=function(e){let t=[],r=new Set;for(let n of e)if(n.dependencies)for(let e of n.dependencies){let n=`${e.issue_id}->${e.depends_on_id}:${e.type}`;r.has(n)||(r.add(n),t.push(e))}return t}(t),l=function(e,t){let r=new Map(e.map(e=>[e.id,e])),n=new Map,a=new Map;for(let e of t)("blocks"===e.type||"parent-child"===e.type)&&(n.has(e.depends_on_id)||n.set(e.depends_on_id,[]),n.get(e.depends_on_id).push(e.issue_id),a.has(e.issue_id)||a.set(e.issue_id,[]),a.get(e.issue_id).push(e.depends_on_id));return{nodes:e.map(e=>({id:e.id,title:e.title,description:e.description,status:e.status,priority:e.priority,issueType:e.issue_type,owner:e.owner,assignee:e.assignee,createdBy:e.created_by,createdAt:e.created_at,updatedAt:e.updated_at,closedAt:e.closed_at,closeReason:e.close_reason,acceptanceCriteria:e.acceptance_criteria,estimatedMinutes:e.estimated_minutes,prefix:s(e.id),labels:e.labels||[],blockerCount:n.get(e.id)?.length||0,dependentCount:a.get(e.id)?.length||0,blockerIds:n.get(e.id)||[],dependentIds:a.get(e.id)||[]})),links:t.filter(e=>("blocks"===e.type||"parent-child"===e.type)&&r.has(e.issue_id)&&r.has(e.depends_on_id)).map(e=>({source:e.depends_on_id,target:e.issue_id,type:e.type,createdAt:e.created_at}))}}(t,n),d=function(e,t,r){let n=[...new Set(e.map(e=>s(e.id)))],a=new Set(e.filter(e=>"closed"!==e.status).map(e=>e.id)),i=new Set;for(let e of t)"blocks"===e.type&&a.has(e.depends_on_id)&&i.add(e.issue_id);let o=e.filter(e=>("open"===e.status||"in_progress"===e.status)&&!i.has(e.id)).length;return{total:e.length,open:e.filter(e=>"open"===e.status).length,inProgress:e.filter(e=>"in_progress"===e.status).length,blocked:e.filter(e=>"blocked"===e.status).length,closed:e.filter(e=>"closed"===e.status).length,actionable:o,edges:r.links.length,prefixes:n}}(t,n,l);return{issues:t,dependencies:n,graphData:l,stats:d}}e.s(["getAdditionalRepoPaths",()=>i,"loadBeadsData",()=>l])},2371,e=>{"use strict";var t=e.i(39776),r=e.i(76160),n=e.i(74151),a=e.i(8392),s=e.i(27644),i=e.i(15766),o=e.i(18404),l=e.i(68924),d=e.i(9942),c=e.i(77753),u=e.i(45771),p=e.i(31838),h=e.i(89953),f=e.i(17045),g=e.i(21874),m=e.i(93695);e.i(86257);var y=e.i(87875),_=e.i(63846),b=e.i(48676),x=e.i(22734),w=e.i(14747);async function R(e){let t=null,r=new ReadableStream({start(r){let n=new TextEncoder;function a(e){try{r.enqueue(n.encode(`data: ${JSON.stringify(e)}
|
|
2
2
|
|
|
3
|
-
`))}catch{}}try{let{beadsDir:s}=(0,
|
|
3
|
+
`))}catch{}}try{let{beadsDir:s}=(0,_.discoverBeadsDir)(),i=(0,b.loadBeadsData)(s);a(i),t=function(e,t,r=300){let n=function(e){let t=[],r=(0,w.join)(e,"issues.jsonl");for(let n of((0,x.existsSync)(r)&&t.push(r),(0,b.getAdditionalRepoPaths)(e))){let e=(0,w.join)(n,".beads","issues.jsonl");(0,x.existsSync)(e)&&t.push(e)}return t}(e),a=null,s=[],i=new Map;for(let e of n){let t=(0,w.dirname)(e),r=(0,w.basename)(e);i.has(t)||i.set(t,new Set),i.get(t).add(r)}console.log(`[heartbeads] Watching ${n.length} file(s) in ${i.size} dir(s) for changes`);let o=()=>{a&&clearTimeout(a),a=setTimeout(()=>{console.log("[heartbeads] File change detected, pushing update"),t()},r)};for(let[e,t]of i)try{let r=(0,x.watch)(e,{persistent:!0},(e,r)=>{r&&t.has(r)&&o()});s.push(r),console.log(`[heartbeads] Watching dir: ${e} for [${[...t].join(", ")}]`)}catch(t){console.warn(`[heartbeads] Failed to watch ${e}:`,t)}return 0===n.length&&console.warn("[heartbeads] No issues.jsonl files found to watch"),()=>{for(let e of(a&&clearTimeout(a),s))e.close();console.log("[heartbeads] File watchers closed")}}(s,()=>{try{let e=(0,b.loadBeadsData)(s);a(e)}catch(e){console.error("Failed to reload beads data:",e)}});let o=setInterval(()=>{try{r.enqueue(n.encode(": heartbeat\n\n"))}catch{clearInterval(o)}},3e4);e.signal.addEventListener("abort",()=>{clearInterval(o),t&&t();try{r.close()}catch{}})}catch(e){a({error:e instanceof Error?e.message:"Unknown error"}),r.close()}},cancel(){t&&t()}});return new Response(r,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}e.s(["GET",()=>R,"dynamic",0,"force-dynamic"],88832);var v=e.i(88832);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/beads/stream/route",pathname:"/api/beads/stream",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/beads/stream/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:C,workUnitAsyncStorage:A,serverHooks:S}=E;function k(){return(0,n.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:A})}async function T(e,t,n){E.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let _="/api/beads/stream/route";_=_.replace(/\/index$/,"")||"/";let b=await E.prepare(e,t,{srcPage:_,multiZoneDraftMode:!1});if(!b)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:x,params:w,nextConfig:R,parsedUrl:v,isDraftMode:C,prerenderManifest:A,routerServerContext:S,isOnDemandRevalidate:k,revalidateOnlyGenerated:T,resolvedPathname:j,clientReferenceManifest:N,serverActionsManifest:P}=b,O=(0,o.normalizeAppPath)(_),q=!!(A.dynamicRoutes[O]||A.routes[j]),I=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,v,!1):t.end("This page could not be found"),null);if(q&&!C){let e=!!A.routes[j],t=A.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(R.experimental.adapterPath)return await I();throw new m.NoFallbackError}}let $=null;!q||E.isDev||C||($="/index"===($=j)?"/":$);let D=!0===E.isDev||!q,M=q&&!D;P&&N&&(0,i.setManifestsSingleton)({page:_,clientReferenceManifest:N,serverActionsManifest:P});let H=e.method||"GET",U=(0,s.getTracer)(),F=U.getActiveScopeSpan(),B={params:w,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:D,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:R.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>E.onRequestError(e,t,n,a,S)},sharedContext:{buildId:x}},K=new l.NodeNextRequest(e),L=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(K,(0,d.signalFromNodeResponse)(t));try{let i=async e=>E.handle(G,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=U.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${H} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${H} ${_}`)}),o=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var s,l;let d=async({previousCacheEntry:r})=>{try{if(!o&&k&&T&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(a);e.fetchMetrics=B.renderOpts.fetchMetrics;let l=B.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=B.renderOpts.collectedTags;if(!q)return await (0,p.sendResponse)(K,L,s,B.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);d&&(t[g.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,n=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:k})},!1,S),t}},c=await E.handleResponse({req:e,nextConfig:R,cacheKey:$,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:T,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:o});if(!q)return null;if((null==c||null==(s=c.value)?void 0:s.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",k?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,h.fromNodeOutgoingHttpHeaders)(c.value.headers);return o&&q||m.delete(g.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,f.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)(K,L,new Response(c.value.body,{headers:m,status:c.value.status||200})),null};F?await l(F):await U.withPropagatedContext(e.headers,()=>U.trace(c.BaseServerSpan.handleRequest,{spanName:`${H} ${_}`,kind:s.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},l))}catch(t){if(t instanceof m.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:k})},!1,S),q)throw t;return await (0,p.sendResponse)(K,L,new Response(null,{status:500})),null}}e.s(["handler",()=>T,"patchFetch",()=>k,"routeModule",()=>E,"serverHooks",()=>S,"workAsyncStorage",()=>C,"workUnitAsyncStorage",()=>A],2371)}];
|
|
4
4
|
|
|
5
5
|
//# sourceMappingURL=%5Broot-of-the-server%5D__67c802f8._.js.map
|