@omercnet/paseo-pr-radar 3.2.3 → 3.3.0-next.529.1
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/README.md +13 -3
- package/client/agent-launch-options.tsx +416 -0
- package/client/directory-observation.ts +53 -9
- package/client/highlight.ts +24 -0
- package/client/highlighted-text.tsx +27 -0
- package/client/pr-radar.tsx +609 -167
- package/client/radar.ts +326 -5
- package/client/screen-state.ts +20 -0
- package/client/settings-screen.tsx +290 -0
- package/client/start-agent-modal.tsx +691 -0
- package/client/use-radar.ts +6 -2
- package/examples/pr-radar-route.py +55 -0
- package/index.client.tsx +13 -2
- package/index.server.ts +26 -1
- package/package.json +6 -5
- package/paseo-plugin.json +1 -1
- package/server/viewer-scope.ts +164 -6
- package/server/workspace-ops.ts +1464 -0
- package/shared/settings.ts +68 -0
- package/shared/viewer-scope.ts +87 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { defineSettings } from "@getpaseo/plugin";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const CWD_MODES = ["CWD-WORKTREE", "CWD-BASE"] as const;
|
|
5
|
+
export type CwdMode = (typeof CWD_MODES)[number];
|
|
6
|
+
|
|
7
|
+
export const AUTO_LAUNCH_MODES = ["prompt", "existing_only", "existing_or_clone"] as const;
|
|
8
|
+
export type AutoLaunchMode = (typeof AUTO_LAUNCH_MODES)[number];
|
|
9
|
+
|
|
10
|
+
export const DEFAULT_PR_RADAR_SETTINGS = {
|
|
11
|
+
sourceCodeDir: "~/src",
|
|
12
|
+
defaultCwdMode: "CWD-WORKTREE",
|
|
13
|
+
autoLaunchMode: "prompt",
|
|
14
|
+
defaultProfile: "Model Router",
|
|
15
|
+
defaultProvider: "",
|
|
16
|
+
defaultModel: "",
|
|
17
|
+
defaultEffort: "",
|
|
18
|
+
defaultModeId: "",
|
|
19
|
+
defaultContextMode: "",
|
|
20
|
+
routingScriptPath: "",
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
export const PrRadarSettingsSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
/** Base directory for local repositories and auto-clones. */
|
|
26
|
+
sourceCodeDir: z
|
|
27
|
+
.string()
|
|
28
|
+
.trim()
|
|
29
|
+
.min(1)
|
|
30
|
+
.max(4_096)
|
|
31
|
+
.default(DEFAULT_PR_RADAR_SETTINGS.sourceCodeDir),
|
|
32
|
+
/** Whether new agents open in a dedicated PR worktree or the base checkout. */
|
|
33
|
+
defaultCwdMode: z.enum(CWD_MODES).default(DEFAULT_PR_RADAR_SETTINGS.defaultCwdMode),
|
|
34
|
+
/** When Start New Agent should prompt vs. launch immediately. */
|
|
35
|
+
autoLaunchMode: z.enum(AUTO_LAUNCH_MODES).default(DEFAULT_PR_RADAR_SETTINGS.autoLaunchMode),
|
|
36
|
+
/** Preferred Paseo agent profile name when starting a new agent. */
|
|
37
|
+
defaultProfile: z.string().trim().max(256).default(DEFAULT_PR_RADAR_SETTINGS.defaultProfile),
|
|
38
|
+
/** Optional TUI vendor/provider override (e.g. claude, codex, omp, pi). */
|
|
39
|
+
defaultProvider: z.string().trim().max(256).default(DEFAULT_PR_RADAR_SETTINGS.defaultProvider),
|
|
40
|
+
/** Optional model ID/version override. */
|
|
41
|
+
defaultModel: z.string().trim().max(256).default(DEFAULT_PR_RADAR_SETTINGS.defaultModel),
|
|
42
|
+
/** Optional reasoning effort / thinkingOptionId override (e.g. low, medium, high, xhigh). */
|
|
43
|
+
defaultEffort: z.string().trim().max(128).default(DEFAULT_PR_RADAR_SETTINGS.defaultEffort),
|
|
44
|
+
/** Optional permission/context modeId override (e.g. default, bypassPermissions, plan). */
|
|
45
|
+
defaultModeId: z.string().trim().max(128).default(DEFAULT_PR_RADAR_SETTINGS.defaultModeId),
|
|
46
|
+
/** Optional provider context mode option (passed as options.contextMode when set). */
|
|
47
|
+
defaultContextMode: z
|
|
48
|
+
.string()
|
|
49
|
+
.trim()
|
|
50
|
+
.max(128)
|
|
51
|
+
.default(DEFAULT_PR_RADAR_SETTINGS.defaultContextMode),
|
|
52
|
+
/** Optional path to an executable routing script that reads PR JSON on stdin. */
|
|
53
|
+
routingScriptPath: z
|
|
54
|
+
.string()
|
|
55
|
+
.trim()
|
|
56
|
+
.max(4_096)
|
|
57
|
+
.default(DEFAULT_PR_RADAR_SETTINGS.routingScriptPath),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
60
|
+
|
|
61
|
+
export type PrRadarSettings = z.infer<typeof PrRadarSettingsSchema>;
|
|
62
|
+
|
|
63
|
+
export const prRadarSettings = defineSettings({
|
|
64
|
+
id: "pr-radar",
|
|
65
|
+
scope: "host",
|
|
66
|
+
version: 1,
|
|
67
|
+
schema: PrRadarSettingsSchema,
|
|
68
|
+
});
|
package/shared/viewer-scope.ts
CHANGED
|
@@ -25,10 +25,29 @@ export const GitHubInboxItemSchema = z.object({
|
|
|
25
25
|
reviewDecision: z.enum(["pending", "approved", "changes_requested"]).nullable(),
|
|
26
26
|
role: z.enum(["author", "reviewer"]),
|
|
27
27
|
changes: z.array(z.string()),
|
|
28
|
+
linkedIssues: z.array(HttpsUrlSchema).default([]),
|
|
28
29
|
});
|
|
29
30
|
|
|
30
31
|
export type GitHubInboxItem = z.infer<typeof GitHubInboxItemSchema>;
|
|
31
32
|
|
|
33
|
+
export const GitHubIssueItemSchema = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
number: z.number().int().positive(),
|
|
36
|
+
url: HttpsUrlSchema,
|
|
37
|
+
title: z.string(),
|
|
38
|
+
repository: z.string(),
|
|
39
|
+
author: z.string().nullable(),
|
|
40
|
+
authorKind: z.enum(["human", "bot"]),
|
|
41
|
+
createdAt: z.string(),
|
|
42
|
+
updatedAt: z.string(),
|
|
43
|
+
isSecurity: z.boolean(),
|
|
44
|
+
comments: z.number().int().nonnegative(),
|
|
45
|
+
labels: z.array(z.string()),
|
|
46
|
+
role: z.enum(["author", "assignee", "owner"]),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export type GitHubIssueItem = z.infer<typeof GitHubIssueItemSchema>;
|
|
50
|
+
|
|
32
51
|
export const viewerScope = defineRpc({
|
|
33
52
|
name: "pr-radar.viewer-scope",
|
|
34
53
|
input: z.object({
|
|
@@ -40,6 +59,7 @@ export const viewerScope = defineRpc({
|
|
|
40
59
|
authoredUrls: z.array(HttpsUrlSchema),
|
|
41
60
|
reviewRequestedUrls: z.array(HttpsUrlSchema),
|
|
42
61
|
inboxItems: z.array(GitHubInboxItemSchema),
|
|
62
|
+
issueItems: z.array(GitHubIssueItemSchema).default([]),
|
|
43
63
|
truncated: z.boolean(),
|
|
44
64
|
coverageNote: z.string(),
|
|
45
65
|
updates: z.number().int().nonnegative(),
|
|
@@ -53,3 +73,70 @@ export const acknowledgeViewerScope = defineRpc({
|
|
|
53
73
|
input: z.object({ windowDays: z.number().int().min(1).max(365) }),
|
|
54
74
|
output: z.object({ acknowledgedAt: z.string() }),
|
|
55
75
|
});
|
|
76
|
+
|
|
77
|
+
export const LocalDirEntrySchema = z.object({
|
|
78
|
+
path: z.string(),
|
|
79
|
+
label: z.string(),
|
|
80
|
+
kind: z.enum(["repo", "worktree", "dir"]),
|
|
81
|
+
branch: z.string().nullable().default(null),
|
|
82
|
+
isMatch: z.boolean().default(false),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export type LocalDirEntry = z.infer<typeof LocalDirEntrySchema>;
|
|
86
|
+
|
|
87
|
+
export const listLocalDirs = defineRpc({
|
|
88
|
+
name: "pr-radar.list-local-dirs",
|
|
89
|
+
input: z.object({
|
|
90
|
+
query: z.string().default(""),
|
|
91
|
+
repository: z.string().default(""),
|
|
92
|
+
}),
|
|
93
|
+
output: z.object({
|
|
94
|
+
expandedSourceDir: z.string(),
|
|
95
|
+
entries: z.array(LocalDirEntrySchema),
|
|
96
|
+
suggestedClonePath: z.string(),
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export const prepareWorkspaceCwd = defineRpc({
|
|
101
|
+
name: "pr-radar.prepare-workspace-cwd",
|
|
102
|
+
input: z.object({
|
|
103
|
+
itemKind: z.enum(["pr", "issue"]).default("pr"),
|
|
104
|
+
repository: z.string().trim().min(1),
|
|
105
|
+
prNumber: z.number().int().positive(),
|
|
106
|
+
headRefName: z.string().default(""),
|
|
107
|
+
baseRefName: z.string().default(""),
|
|
108
|
+
targetDir: z.string().trim().nullable().default(null),
|
|
109
|
+
allowClone: z.boolean().default(false),
|
|
110
|
+
cwdMode: z.enum(["CWD-WORKTREE", "CWD-BASE"]).default("CWD-WORKTREE"),
|
|
111
|
+
worktreeName: z.string().trim().nullable().default(null),
|
|
112
|
+
}),
|
|
113
|
+
output: z.object({
|
|
114
|
+
cwd: z.string(),
|
|
115
|
+
baseRoot: z.string(),
|
|
116
|
+
cwdTag: z.enum(["CWD-WORKTREE", "CWD-BASE"]),
|
|
117
|
+
cloned: z.boolean(),
|
|
118
|
+
worktreeCreated: z.boolean(),
|
|
119
|
+
warning: z.string().optional(),
|
|
120
|
+
}),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export const RoutingScriptResultSchema = z.object({
|
|
124
|
+
profile: z.string().optional(),
|
|
125
|
+
provider: z.string().optional(),
|
|
126
|
+
model: z.string().optional(),
|
|
127
|
+
thinkingOptionId: z.string().optional(),
|
|
128
|
+
modeId: z.string().optional(),
|
|
129
|
+
contextMode: z.string().optional(),
|
|
130
|
+
options: z.record(z.string(), z.unknown()).optional(),
|
|
131
|
+
reason: z.string().optional(),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export type RoutingScriptResult = z.infer<typeof RoutingScriptResultSchema>;
|
|
135
|
+
|
|
136
|
+
export const runRoutingScript = defineRpc({
|
|
137
|
+
name: "pr-radar.run-routing-script",
|
|
138
|
+
input: z.object({
|
|
139
|
+
payload: z.record(z.string(), z.unknown()),
|
|
140
|
+
}),
|
|
141
|
+
output: RoutingScriptResultSchema,
|
|
142
|
+
});
|