paseo-beads 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +171 -0
- package/client/board-view.tsx +290 -0
- package/client/board.ts +160 -0
- package/client/focus.ts +51 -0
- package/client/format.ts +227 -0
- package/client/markdown-view.tsx +156 -0
- package/client/markdown.ts +435 -0
- package/client/overview-view.tsx +462 -0
- package/client/panel.tsx +961 -0
- package/client/project.ts +603 -0
- package/client/rows.tsx +666 -0
- package/client/styles.ts +557 -0
- package/images/board.png +0 -0
- package/images/overview.png +0 -0
- package/images/plan.png +0 -0
- package/images/risks.png +0 -0
- package/index.client.tsx +68 -0
- package/index.server.ts +21 -0
- package/package.json +53 -0
- package/paseo-plugin.json +6 -0
- package/server/attachments.ts +166 -0
- package/server/bv.ts +213 -0
- package/server/cache.ts +51 -0
- package/server/command.ts +343 -0
- package/server/dashboard.ts +244 -0
- package/server/issue.ts +59 -0
- package/server/normalize.ts +687 -0
- package/server/search.ts +40 -0
- package/server/tracker.ts +122 -0
- package/server/workspace.ts +153 -0
- package/shared/beads.ts +325 -0
- package/shared/rpc.ts +129 -0
package/shared/rpc.ts
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { defineAttachmentSource, defineRpc } from "@getpaseo/plugin";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import {
|
|
4
|
+
AlertSchema,
|
|
5
|
+
AlertSummarySchema,
|
|
6
|
+
ATTACHMENT_RESULT_LIMIT,
|
|
7
|
+
BlockerSchema,
|
|
8
|
+
BoardSnapshotSchema,
|
|
9
|
+
CommandErrorSchema,
|
|
10
|
+
IssueDetailSchema,
|
|
11
|
+
IssueIdSchema,
|
|
12
|
+
PlanSummarySchema,
|
|
13
|
+
ProjectCountsSchema,
|
|
14
|
+
ProjectHealthSchema,
|
|
15
|
+
RecommendationSchema,
|
|
16
|
+
SearchLimitSchema,
|
|
17
|
+
SearchQuerySchema,
|
|
18
|
+
SearchResultSchema,
|
|
19
|
+
SectionStateSchema,
|
|
20
|
+
SourceSnapshotSchema,
|
|
21
|
+
ToolStateSchema,
|
|
22
|
+
TrackSchema,
|
|
23
|
+
TrackerStateSchema,
|
|
24
|
+
} from "./beads";
|
|
25
|
+
|
|
26
|
+
const WorkspaceInputSchema = z.object({ workspaceId: z.string().min(1) });
|
|
27
|
+
|
|
28
|
+
const DashboardInputSchema = WorkspaceInputSchema.extend({
|
|
29
|
+
/** Set by an explicit user refresh so the short-lived cache is bypassed. */
|
|
30
|
+
refresh: z.boolean().optional(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The dashboard always resolves: an unreachable `bv`, a workspace without Beads,
|
|
35
|
+
* and an empty-but-healthy project are three distinct, representable states.
|
|
36
|
+
*/
|
|
37
|
+
export const dashboardRpc = defineRpc({
|
|
38
|
+
name: "beads.dashboard",
|
|
39
|
+
input: DashboardInputSchema,
|
|
40
|
+
output: z.object({
|
|
41
|
+
workspaceId: z.string(),
|
|
42
|
+
directory: z.string().nullable(),
|
|
43
|
+
tool: ToolStateSchema,
|
|
44
|
+
tracker: TrackerStateSchema,
|
|
45
|
+
/** `ready` = bv analysed a project here (possibly empty), `missing` = no Beads source, `error` = the read failed. */
|
|
46
|
+
projectState: z.enum(["ready", "missing", "error"]),
|
|
47
|
+
source: SourceSnapshotSchema.nullable(),
|
|
48
|
+
counts: ProjectCountsSchema.nullable(),
|
|
49
|
+
health: ProjectHealthSchema.nullable(),
|
|
50
|
+
recommendations: z.array(RecommendationSchema),
|
|
51
|
+
blockers: z.array(BlockerSchema),
|
|
52
|
+
/** Every issue `bv --robot-graph` reported, which is what the board lays out. */
|
|
53
|
+
board: BoardSnapshotSchema,
|
|
54
|
+
tracks: z.array(TrackSchema),
|
|
55
|
+
planSummary: PlanSummarySchema.nullable(),
|
|
56
|
+
alerts: z.array(AlertSchema),
|
|
57
|
+
alertSummary: AlertSummarySchema.nullable(),
|
|
58
|
+
sections: z.object({
|
|
59
|
+
triage: SectionStateSchema,
|
|
60
|
+
plan: SectionStateSchema,
|
|
61
|
+
alerts: SectionStateSchema,
|
|
62
|
+
graph: SectionStateSchema,
|
|
63
|
+
}),
|
|
64
|
+
fetchedAt: z.string(),
|
|
65
|
+
cached: z.boolean(),
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const searchRpc = defineRpc({
|
|
70
|
+
name: "beads.search",
|
|
71
|
+
input: z.object({
|
|
72
|
+
workspaceId: z.string().min(1),
|
|
73
|
+
query: SearchQuerySchema,
|
|
74
|
+
limit: SearchLimitSchema.optional(),
|
|
75
|
+
}),
|
|
76
|
+
output: z.object({
|
|
77
|
+
query: z.string(),
|
|
78
|
+
limit: z.number(),
|
|
79
|
+
results: z.array(SearchResultSchema),
|
|
80
|
+
error: CommandErrorSchema.nullable(),
|
|
81
|
+
}),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const issueRpc = defineRpc({
|
|
85
|
+
name: "beads.issue",
|
|
86
|
+
input: z.object({ workspaceId: z.string().min(1), issueId: IssueIdSchema }),
|
|
87
|
+
output: z.object({
|
|
88
|
+
issueId: z.string(),
|
|
89
|
+
tracker: TrackerStateSchema,
|
|
90
|
+
issue: IssueDetailSchema.nullable(),
|
|
91
|
+
error: CommandErrorSchema.nullable(),
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Attachment search has no workspace context, so the handler discovers Beads-enabled
|
|
97
|
+
* workspaces itself and returns at most {@link ATTACHMENT_RESULT_LIMIT} items.
|
|
98
|
+
*/
|
|
99
|
+
export const attachmentSearchRpc = defineRpc({
|
|
100
|
+
name: "beads.attachments.search",
|
|
101
|
+
input: z.object({ query: z.string() }),
|
|
102
|
+
output: z.object({
|
|
103
|
+
items: z
|
|
104
|
+
.array(
|
|
105
|
+
z.object({
|
|
106
|
+
id: z.string(),
|
|
107
|
+
identifier: z.string(),
|
|
108
|
+
title: z.string(),
|
|
109
|
+
subtitle: z.string().optional(),
|
|
110
|
+
url: z.url(),
|
|
111
|
+
text: z.string(),
|
|
112
|
+
resourceType: z.string(),
|
|
113
|
+
}),
|
|
114
|
+
)
|
|
115
|
+
.max(ATTACHMENT_RESULT_LIMIT),
|
|
116
|
+
}),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export const beadsAttachmentSource = defineAttachmentSource({
|
|
120
|
+
id: "beads-issue",
|
|
121
|
+
title: "Beads issue",
|
|
122
|
+
icon: "CircleDot",
|
|
123
|
+
pickerTitle: "Attach Beads issue",
|
|
124
|
+
searchPlaceholder: "Search Beads issues by id or keyword",
|
|
125
|
+
search: attachmentSearchRpc,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/** Client-facing dashboard shape: what the panel receives after output validation. */
|
|
129
|
+
export type DashboardResult = z.output<typeof dashboardRpc.output>;
|