@xpufx/paseo-forges 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 +109 -0
- package/client/active-forge.ts +47 -0
- package/client/board-alert.tsx +236 -0
- package/client/foreign-link.tsx +33 -0
- package/client/hook-queue-panel.tsx +412 -0
- package/client/issues-pill.tsx +1976 -0
- package/client/label-chip.tsx +116 -0
- package/client/linkifier.tsx +280 -0
- package/client/pill-label.ts +183 -0
- package/client/vendor/paseo-plugin-helper/command-center.ts +43 -0
- package/client/vendor/paseo-plugin-helper/components/AboutSection.tsx +493 -0
- package/client/vendor/paseo-plugin-helper/components/AttentionBeacon.tsx +250 -0
- package/client/vendor/paseo-plugin-helper/components/Badge.tsx +156 -0
- package/client/vendor/paseo-plugin-helper/components/Button.tsx +178 -0
- package/client/vendor/paseo-plugin-helper/components/Card.tsx +225 -0
- package/client/vendor/paseo-plugin-helper/components/CodeBlock.tsx +196 -0
- package/client/vendor/paseo-plugin-helper/components/Collapsible.tsx +277 -0
- package/client/vendor/paseo-plugin-helper/components/CommandBox.tsx +172 -0
- package/client/vendor/paseo-plugin-helper/components/CopyButton.tsx +180 -0
- package/client/vendor/paseo-plugin-helper/components/DataTable.tsx +200 -0
- package/client/vendor/paseo-plugin-helper/components/EmptyState.tsx +97 -0
- package/client/vendor/paseo-plugin-helper/components/HighlightedText.tsx +70 -0
- package/client/vendor/paseo-plugin-helper/components/InlineButton.tsx +73 -0
- package/client/vendor/paseo-plugin-helper/components/KeyValue.tsx +446 -0
- package/client/vendor/paseo-plugin-helper/components/MetricGauge.tsx +247 -0
- package/client/vendor/paseo-plugin-helper/components/ProgressBar.tsx +117 -0
- package/client/vendor/paseo-plugin-helper/components/Responsive.tsx +53 -0
- package/client/vendor/paseo-plugin-helper/components/SearchInput.tsx +118 -0
- package/client/vendor/paseo-plugin-helper/components/SectionHeader.tsx +80 -0
- package/client/vendor/paseo-plugin-helper/components/Select.tsx +215 -0
- package/client/vendor/paseo-plugin-helper/components/StatusDot.tsx +80 -0
- package/client/vendor/paseo-plugin-helper/components/Tabs.tsx +319 -0
- package/client/vendor/paseo-plugin-helper/components/TextInput.tsx +150 -0
- package/client/vendor/paseo-plugin-helper/components/Toggle.tsx +163 -0
- package/client/vendor/paseo-plugin-helper/components/TruncatedText.tsx +157 -0
- package/client/vendor/paseo-plugin-helper/components/index.ts +25 -0
- package/client/vendor/paseo-plugin-helper/custom-pills.tsx +224 -0
- package/client/vendor/paseo-plugin-helper/forge-icon.tsx +79 -0
- package/client/vendor/paseo-plugin-helper/host.ts +277 -0
- package/client/vendor/paseo-plugin-helper/icon.tsx +39 -0
- package/client/vendor/paseo-plugin-helper/index.ts +28 -0
- package/client/vendor/paseo-plugin-helper/layout/ActionBar.tsx +49 -0
- package/client/vendor/paseo-plugin-helper/layout/FormRow.tsx +103 -0
- package/client/vendor/paseo-plugin-helper/layout/Grid.tsx +65 -0
- package/client/vendor/paseo-plugin-helper/layout/ModalBody.tsx +378 -0
- package/client/vendor/paseo-plugin-helper/layout/ModalContent.tsx +49 -0
- package/client/vendor/paseo-plugin-helper/layout/Row.tsx +39 -0
- package/client/vendor/paseo-plugin-helper/layout/Stack.tsx +39 -0
- package/client/vendor/paseo-plugin-helper/layout/index.ts +7 -0
- package/client/vendor/paseo-plugin-helper/panel.tsx +81 -0
- package/client/vendor/paseo-plugin-helper/pill.tsx +884 -0
- package/client/vendor/paseo-plugin-helper/query-refresh.ts +79 -0
- package/client/vendor/paseo-plugin-helper/query.ts +66 -0
- package/client/vendor/paseo-plugin-helper/settings-screen.tsx +372 -0
- package/client/vendor/paseo-plugin-helper/settings.ts +181 -0
- package/client/vendor/paseo-plugin-helper/shared-settings.ts +46 -0
- package/client/vendor/paseo-plugin-helper/snapshot.ts +68 -0
- package/client/vendor/paseo-plugin-helper/surface.tsx +80 -0
- package/client/vendor/paseo-plugin-helper/theme/color-utils.ts +118 -0
- package/client/vendor/paseo-plugin-helper/theme/flair.ts +76 -0
- package/client/vendor/paseo-plugin-helper/theme/host-variables.ts +121 -0
- package/client/vendor/paseo-plugin-helper/theme/index.ts +7 -0
- package/client/vendor/paseo-plugin-helper/theme/provider.tsx +214 -0
- package/client/vendor/paseo-plugin-helper/theme/responsive.ts +213 -0
- package/client/vendor/paseo-plugin-helper/theme/tokens.ts +161 -0
- package/client/vendor/paseo-plugin-helper/theme/useResponsive.ts +57 -0
- package/client/vendor/paseo-plugin-helper/utils/clipboard.ts +149 -0
- package/client/vendor/paseo-plugin-helper/utils/haptics.ts +34 -0
- package/client/webhook-card.tsx +198 -0
- package/docs/specs/forge-workflow-gui.md +820 -0
- package/docs/workflow.md +339 -0
- package/examples/README.md +108 -0
- package/examples/hook-service/README.md +66 -0
- package/examples/hook-service/forge-hook.service +28 -0
- package/examples/hook-service/hook-server.mjs +265 -0
- package/examples/hook-service/hook.env.example +21 -0
- package/examples/labels/README.md +64 -0
- package/examples/labels/label-base.yaml +117 -0
- package/examples/skills/coding-agent/SKILL.md +262 -0
- package/examples/skills/coding-agent-fgjx/SKILL.md +271 -0
- package/examples/skills/orchestrator/SKILL.md +133 -0
- package/examples/skills/orchestrator-fgjx/SKILL.md +139 -0
- package/examples/tools/README.md +68 -0
- package/examples/tools/fgjx +464 -0
- package/package.json +38 -0
- package/paseo-plugin.json +4 -0
- package/server/forge-client.ts +484 -0
- package/server/forge-guard.ts +70 -0
- package/server/git-origin.ts +70 -0
- package/server/hook-queue.ts +127 -0
- package/server/issues.ts +542 -0
- package/server/settings.ts +52 -0
- package/server/vendor/paseo-plugin-helper/agent.ts +85 -0
- package/server/vendor/paseo-plugin-helper/custom-pills.ts +344 -0
- package/server/vendor/paseo-plugin-helper/index.ts +18 -0
- package/server/vendor/paseo-plugin-helper/jsonc.ts +78 -0
- package/server/vendor/paseo-plugin-helper/logger.ts +210 -0
- package/server/vendor/paseo-plugin-helper/mcp-config.ts +367 -0
- package/server/vendor/paseo-plugin-helper/mcp-injection.ts +85 -0
- package/server/vendor/paseo-plugin-helper/network.ts +91 -0
- package/server/vendor/paseo-plugin-helper/plugins.ts +160 -0
- package/server/vendor/paseo-plugin-helper/process.ts +186 -0
- package/server/vendor/paseo-plugin-helper/redact.ts +86 -0
- package/server/vendor/paseo-plugin-helper/rpc-guard.ts +77 -0
- package/server/vendor/paseo-plugin-helper/settings.ts +97 -0
- package/server/vendor/paseo-plugin-helper/shared-settings.ts +243 -0
- package/server/vendor/paseo-plugin-helper/storage.ts +244 -0
- package/server/vendor/paseo-plugin-helper/system.ts +128 -0
- package/server/vendor/paseo-plugin-helper/task.ts +116 -0
- package/server/vendor/paseo-plugin-helper/version.ts +153 -0
- package/server/vendor/paseo-plugin-helper/workspace-beacon.ts +418 -0
- package/shared/hook-queue.ts +140 -0
- package/shared/issues.ts +1750 -0
- package/shared/vendor/paseo-plugin-helper/README.md +11 -0
- package/shared/vendor/paseo-plugin-helper/async.ts +35 -0
- package/shared/vendor/paseo-plugin-helper/custom-pills.ts +169 -0
- package/shared/vendor/paseo-plugin-helper/forge.ts +110 -0
- package/shared/vendor/paseo-plugin-helper/formatters.ts +271 -0
- package/shared/vendor/paseo-plugin-helper/highlight.ts +184 -0
- package/shared/vendor/paseo-plugin-helper/index.ts +10 -0
- package/shared/vendor/paseo-plugin-helper/rpc.ts +72 -0
- package/shared/vendor/paseo-plugin-helper/settings.ts +138 -0
- package/shared/vendor/paseo-plugin-helper/suite-settings.ts +17 -0
- package/shared/vendor/paseo-plugin-helper/suppressed.ts +31 -0
- package/shared/vendor/paseo-plugin-helper/types.ts +36 -0
- package/shared/version.ts +2 -0
- package/shared/webhook.ts +223 -0
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import React, { useMemo, useState } from "react";
|
|
2
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
3
|
+
import { useToast } from "@getpaseo/plugin/client/react-native";
|
|
4
|
+
import {
|
|
5
|
+
ModalBody,
|
|
6
|
+
Card,
|
|
7
|
+
Button,
|
|
8
|
+
Badge,
|
|
9
|
+
EmptyState,
|
|
10
|
+
SearchInput,
|
|
11
|
+
KeyValue,
|
|
12
|
+
KeyValueGroup,
|
|
13
|
+
Collapsible,
|
|
14
|
+
Row,
|
|
15
|
+
Stack,
|
|
16
|
+
SectionHeader,
|
|
17
|
+
useRpcQuery,
|
|
18
|
+
useRpcMutation,
|
|
19
|
+
usePluginTheme,
|
|
20
|
+
copyToClipboard,
|
|
21
|
+
} from "paseo-plugin-helper/client";
|
|
22
|
+
import {
|
|
23
|
+
hookStatusContract,
|
|
24
|
+
hookQueuesContract,
|
|
25
|
+
hookPauseContract,
|
|
26
|
+
hookResumeContract,
|
|
27
|
+
hookDrainContract,
|
|
28
|
+
type HookQueueItem,
|
|
29
|
+
} from "../shared/hook-queue.js";
|
|
30
|
+
|
|
31
|
+
export function HookQueueView({
|
|
32
|
+
onClose,
|
|
33
|
+
embedded = false,
|
|
34
|
+
}: {
|
|
35
|
+
onClose?: () => void;
|
|
36
|
+
embedded?: boolean;
|
|
37
|
+
}) {
|
|
38
|
+
const { colors, padding, isCompact } = usePluginTheme();
|
|
39
|
+
const toast = useToast();
|
|
40
|
+
const [search, setSearch] = useState("");
|
|
41
|
+
const [filterState, setFilterState] = useState<"all" | "active" | "busy" | "paused">("all");
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
data: queuesData,
|
|
45
|
+
isLoading: queuesLoading,
|
|
46
|
+
refetch: refetchQueues,
|
|
47
|
+
} = useRpcQuery(hookQueuesContract, {}, { refetchInterval: 3000 });
|
|
48
|
+
|
|
49
|
+
const {
|
|
50
|
+
data: statusData,
|
|
51
|
+
refetch: refetchStatus,
|
|
52
|
+
} = useRpcQuery(hookStatusContract, {}, { refetchInterval: 3000 });
|
|
53
|
+
|
|
54
|
+
const pauseMutation = useRpcMutation(hookPauseContract);
|
|
55
|
+
const resumeMutation = useRpcMutation(hookResumeContract);
|
|
56
|
+
const drainMutation = useRpcMutation(hookDrainContract);
|
|
57
|
+
|
|
58
|
+
const refetchAll = () => {
|
|
59
|
+
void refetchQueues();
|
|
60
|
+
void refetchStatus();
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const handlePause = async (repo?: string) => {
|
|
64
|
+
try {
|
|
65
|
+
const res = await pauseMutation.mutateAsync({ repo });
|
|
66
|
+
if (res.ok) {
|
|
67
|
+
toast.show(repo ? `Paused queue for ${repo}` : "Paused all queues");
|
|
68
|
+
refetchAll();
|
|
69
|
+
} else {
|
|
70
|
+
toast.error(res.error || "Failed to pause");
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
toast.error(String(e));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const handleResume = async (repo?: string) => {
|
|
78
|
+
try {
|
|
79
|
+
const res = await resumeMutation.mutateAsync({ repo });
|
|
80
|
+
if (res.ok) {
|
|
81
|
+
toast.show(repo ? `Resumed queue for ${repo}` : "Resumed all queues");
|
|
82
|
+
refetchAll();
|
|
83
|
+
} else {
|
|
84
|
+
toast.error(res.error || "Failed to resume");
|
|
85
|
+
}
|
|
86
|
+
} catch (e) {
|
|
87
|
+
toast.error(String(e));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const handleDrain = async (repo?: string) => {
|
|
92
|
+
try {
|
|
93
|
+
const res = await drainMutation.mutateAsync({ repo });
|
|
94
|
+
if (res.ok) {
|
|
95
|
+
toast.show(repo ? `Draining queue for ${repo}` : "Draining all queues");
|
|
96
|
+
refetchAll();
|
|
97
|
+
} else {
|
|
98
|
+
toast.error(res.error || "Failed to drain");
|
|
99
|
+
}
|
|
100
|
+
} catch (e) {
|
|
101
|
+
toast.error(String(e));
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const copyAgentId = (agentId: string) => {
|
|
106
|
+
void copyToClipboard(agentId);
|
|
107
|
+
toast.show(`Copied ${agentId.slice(0, 8)}…`);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const queues = queuesData?.queues ?? [];
|
|
111
|
+
const frontDesk = queuesData?.frontDesk ?? statusData?.frontDesk;
|
|
112
|
+
const isAllPaused = statusData?.paused?.includes("all") || queuesData?.paused?.includes("all");
|
|
113
|
+
|
|
114
|
+
const filteredQueues = useMemo(() => {
|
|
115
|
+
const q = search.trim().toLowerCase();
|
|
116
|
+
return queues.filter((item) => {
|
|
117
|
+
if (q) {
|
|
118
|
+
const matchesKey = item.key.toLowerCase().includes(q);
|
|
119
|
+
const matchesOrch = item.orchestrator?.agentId?.toLowerCase().includes(q);
|
|
120
|
+
if (!matchesKey && !matchesOrch) return false;
|
|
121
|
+
}
|
|
122
|
+
if (filterState === "active") return item.depth > 0;
|
|
123
|
+
if (filterState === "busy") return item.isBusy;
|
|
124
|
+
if (filterState === "paused") return item.paused;
|
|
125
|
+
return true;
|
|
126
|
+
});
|
|
127
|
+
}, [queues, search, filterState]);
|
|
128
|
+
|
|
129
|
+
const totalDepth = queues.reduce((sum, item) => sum + item.depth, 0);
|
|
130
|
+
|
|
131
|
+
const content = (
|
|
132
|
+
<View style={{ gap: padding.gap }}>
|
|
133
|
+
{/* Front Desk & Daemon Status Header */}
|
|
134
|
+
<Card variant="elevated">
|
|
135
|
+
<Card.Header
|
|
136
|
+
title="Forge Webhook & Queues"
|
|
137
|
+
subtitle={`Uptime: ${Math.round((statusData?.uptime ?? 0) / 60)} min · ${queues.length} registered repos`}
|
|
138
|
+
badge={
|
|
139
|
+
statusData?.error ? (
|
|
140
|
+
<Badge label="Unreachable" variant="danger" size="sm" dot />
|
|
141
|
+
) : isAllPaused ? (
|
|
142
|
+
<Badge label="All Paused" variant="warning" size="sm" dot />
|
|
143
|
+
) : (
|
|
144
|
+
<Badge label="Hook Active" variant="success" size="sm" dot />
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
action={
|
|
148
|
+
<Row gap="xs" align="center" wrap>
|
|
149
|
+
<Button
|
|
150
|
+
label="Refresh"
|
|
151
|
+
size="sm"
|
|
152
|
+
variant="secondary"
|
|
153
|
+
loading={queuesLoading}
|
|
154
|
+
onPress={refetchAll}
|
|
155
|
+
/>
|
|
156
|
+
{isAllPaused ? (
|
|
157
|
+
<Button
|
|
158
|
+
label="Resume All"
|
|
159
|
+
size="sm"
|
|
160
|
+
variant="primary"
|
|
161
|
+
onPress={() => handleResume("all")}
|
|
162
|
+
/>
|
|
163
|
+
) : (
|
|
164
|
+
<Button
|
|
165
|
+
label="Pause All"
|
|
166
|
+
size="sm"
|
|
167
|
+
variant="danger"
|
|
168
|
+
onPress={() => handlePause("all")}
|
|
169
|
+
/>
|
|
170
|
+
)}
|
|
171
|
+
<Button
|
|
172
|
+
label="Drain All"
|
|
173
|
+
size="sm"
|
|
174
|
+
variant="secondary"
|
|
175
|
+
onPress={() => handleDrain()}
|
|
176
|
+
/>
|
|
177
|
+
{onClose ? <Button label="Close" size="sm" variant="ghost" onPress={onClose} /> : null}
|
|
178
|
+
</Row>
|
|
179
|
+
}
|
|
180
|
+
/>
|
|
181
|
+
|
|
182
|
+
<KeyValueGroup columns={isCompact ? 1 : 3} collapse="compact" gap={padding.gap}>
|
|
183
|
+
<KeyValue
|
|
184
|
+
layout="inline"
|
|
185
|
+
label="Front Desk"
|
|
186
|
+
value={frontDesk?.agentId ? `${frontDesk.agentId.slice(0, 8)}…` : "Not Registered"}
|
|
187
|
+
copyable={Boolean(frontDesk?.agentId)}
|
|
188
|
+
mono
|
|
189
|
+
/>
|
|
190
|
+
<KeyValue
|
|
191
|
+
layout="inline"
|
|
192
|
+
label="Total Queued"
|
|
193
|
+
value={String(totalDepth)}
|
|
194
|
+
valueStyle={totalDepth > 0 ? { color: colors.statusWarning } : undefined}
|
|
195
|
+
/>
|
|
196
|
+
<KeyValue
|
|
197
|
+
layout="inline"
|
|
198
|
+
label="Uptime"
|
|
199
|
+
value={`${Math.round((statusData?.uptime ?? 0) / 60)} min`}
|
|
200
|
+
/>
|
|
201
|
+
</KeyValueGroup>
|
|
202
|
+
</Card>
|
|
203
|
+
|
|
204
|
+
{/* Filter and Search Controls */}
|
|
205
|
+
<Row gap="xs" align="center" wrap>
|
|
206
|
+
<View style={{ flex: 1, minWidth: 180 }}>
|
|
207
|
+
<SearchInput
|
|
208
|
+
value={search}
|
|
209
|
+
onChangeText={setSearch}
|
|
210
|
+
placeholder="Filter by repository or agent ID…"
|
|
211
|
+
/>
|
|
212
|
+
</View>
|
|
213
|
+
<Row gap="xs" align="center" wrap>
|
|
214
|
+
{(["all", "active", "busy", "paused"] as const).map((mode) => {
|
|
215
|
+
const count =
|
|
216
|
+
mode === "all"
|
|
217
|
+
? queues.length
|
|
218
|
+
: mode === "active"
|
|
219
|
+
? queues.filter((q) => q.depth > 0).length
|
|
220
|
+
: mode === "busy"
|
|
221
|
+
? queues.filter((q) => q.isBusy).length
|
|
222
|
+
: queues.filter((q) => q.paused).length;
|
|
223
|
+
return (
|
|
224
|
+
<Button
|
|
225
|
+
key={mode}
|
|
226
|
+
size="sm"
|
|
227
|
+
label={
|
|
228
|
+
mode === "all"
|
|
229
|
+
? "All"
|
|
230
|
+
: `${mode.charAt(0).toUpperCase() + mode.slice(1)} (${count})`
|
|
231
|
+
}
|
|
232
|
+
variant={filterState === mode ? "primary" : "ghost"}
|
|
233
|
+
onPress={() => setFilterState(mode)}
|
|
234
|
+
/>
|
|
235
|
+
);
|
|
236
|
+
})}
|
|
237
|
+
</Row>
|
|
238
|
+
</Row>
|
|
239
|
+
|
|
240
|
+
<SectionHeader title="Queues" count={filteredQueues.length} />
|
|
241
|
+
|
|
242
|
+
{/* Queue Cards List */}
|
|
243
|
+
{filteredQueues.length === 0 ? (
|
|
244
|
+
<EmptyState
|
|
245
|
+
title="No queues match"
|
|
246
|
+
description={
|
|
247
|
+
queues.length === 0
|
|
248
|
+
? "No repository queues found on the daemon."
|
|
249
|
+
: "Try adjusting your search or filters."
|
|
250
|
+
}
|
|
251
|
+
/>
|
|
252
|
+
) : (
|
|
253
|
+
<Stack gap="sm">
|
|
254
|
+
{filteredQueues.map((item) => (
|
|
255
|
+
<QueueCard
|
|
256
|
+
key={item.key}
|
|
257
|
+
item={item}
|
|
258
|
+
onPause={() => handlePause(item.key)}
|
|
259
|
+
onResume={() => handleResume(item.key)}
|
|
260
|
+
onDrain={() => handleDrain(item.key)}
|
|
261
|
+
onCopyAgent={copyAgentId}
|
|
262
|
+
/>
|
|
263
|
+
))}
|
|
264
|
+
</Stack>
|
|
265
|
+
)}
|
|
266
|
+
</View>
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
if (embedded) {
|
|
270
|
+
return content;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<ModalBody size="large" refreshing={queuesLoading} onRefresh={refetchAll}>
|
|
275
|
+
{content}
|
|
276
|
+
</ModalBody>
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function QueueCard({
|
|
281
|
+
item,
|
|
282
|
+
onPause,
|
|
283
|
+
onResume,
|
|
284
|
+
onDrain,
|
|
285
|
+
onCopyAgent: _onCopyAgent,
|
|
286
|
+
}: {
|
|
287
|
+
item: HookQueueItem;
|
|
288
|
+
onPause: () => void;
|
|
289
|
+
onResume: () => void;
|
|
290
|
+
onDrain: () => void;
|
|
291
|
+
onCopyAgent: (id: string) => void;
|
|
292
|
+
}) {
|
|
293
|
+
const { colors, padding, typography, resolveRadius, isCompact } = usePluginTheme();
|
|
294
|
+
|
|
295
|
+
return (
|
|
296
|
+
<Card variant="elevated">
|
|
297
|
+
<Card.Header
|
|
298
|
+
title={item.key}
|
|
299
|
+
badge={
|
|
300
|
+
<Row gap="xs" align="center" wrap>
|
|
301
|
+
{item.paused ? (
|
|
302
|
+
<Badge label="Paused" variant="warning" size="sm" dot />
|
|
303
|
+
) : item.isBusy ? (
|
|
304
|
+
<Badge label={`Busy (${item.busyAttempts})`} variant="warning" size="sm" dot />
|
|
305
|
+
) : item.depth > 0 ? (
|
|
306
|
+
<Badge label={`${item.depth} queued`} variant="accent" size="sm" />
|
|
307
|
+
) : (
|
|
308
|
+
<Badge label="Idle" variant="neutral" size="sm" dot />
|
|
309
|
+
)}
|
|
310
|
+
{item.dropped > 0 ? (
|
|
311
|
+
<Badge label={`${item.dropped} dropped`} variant="danger" size="sm" />
|
|
312
|
+
) : null}
|
|
313
|
+
</Row>
|
|
314
|
+
}
|
|
315
|
+
action={
|
|
316
|
+
<Row gap="xs" align="center">
|
|
317
|
+
{item.paused ? (
|
|
318
|
+
<Button label="Resume" size="sm" variant="primary" onPress={onResume} />
|
|
319
|
+
) : (
|
|
320
|
+
<Button label="Pause" size="sm" variant="secondary" onPress={onPause} />
|
|
321
|
+
)}
|
|
322
|
+
<Button label="Drain" size="sm" variant="secondary" onPress={onDrain} />
|
|
323
|
+
</Row>
|
|
324
|
+
}
|
|
325
|
+
/>
|
|
326
|
+
|
|
327
|
+
<KeyValueGroup columns={isCompact ? 1 : 2} collapse="compact" gap={padding.gap}>
|
|
328
|
+
<KeyValue
|
|
329
|
+
layout="inline"
|
|
330
|
+
label="Orchestrator"
|
|
331
|
+
value={
|
|
332
|
+
item.orchestrator?.agentId
|
|
333
|
+
? `${item.orchestrator.agentId.slice(0, 8)}…`
|
|
334
|
+
: "None (holding)"
|
|
335
|
+
}
|
|
336
|
+
copyable={Boolean(item.orchestrator?.agentId)}
|
|
337
|
+
mono
|
|
338
|
+
/>
|
|
339
|
+
<KeyValue
|
|
340
|
+
layout="inline"
|
|
341
|
+
label="Queue Depth"
|
|
342
|
+
value={String(item.depth)}
|
|
343
|
+
valueStyle={item.depth > 0 ? { color: colors.statusWarning } : undefined}
|
|
344
|
+
/>
|
|
345
|
+
</KeyValueGroup>
|
|
346
|
+
|
|
347
|
+
{item.messages.length > 0 ? (
|
|
348
|
+
<View style={{ marginTop: padding.gap }}>
|
|
349
|
+
<Collapsible
|
|
350
|
+
title={`Queued Messages (${item.messages.length})`}
|
|
351
|
+
badge={<Badge label={String(item.messages.length)} size="sm" variant="neutral" />}
|
|
352
|
+
initiallyExpanded={false}
|
|
353
|
+
>
|
|
354
|
+
<Stack gap="xs" style={{ marginTop: padding.gap }}>
|
|
355
|
+
{item.messages.map((msg, idx) => (
|
|
356
|
+
<View
|
|
357
|
+
key={msg.id || idx}
|
|
358
|
+
style={[
|
|
359
|
+
styles.messageItem,
|
|
360
|
+
{
|
|
361
|
+
borderLeftColor: colors.accent,
|
|
362
|
+
backgroundColor: colors.surface0,
|
|
363
|
+
borderRadius: resolveRadius("sm"),
|
|
364
|
+
paddingHorizontal: padding.horizontal / 2,
|
|
365
|
+
paddingVertical: padding.vertical / 2,
|
|
366
|
+
},
|
|
367
|
+
]}
|
|
368
|
+
>
|
|
369
|
+
<Row justify="space-between" align="center" style={{ marginBottom: 2 }}>
|
|
370
|
+
<Text
|
|
371
|
+
style={[
|
|
372
|
+
typography.caption,
|
|
373
|
+
{ color: colors.foregroundMuted, fontFamily: "monospace" },
|
|
374
|
+
]}
|
|
375
|
+
>
|
|
376
|
+
{msg.id.slice(0, 10)}
|
|
377
|
+
</Text>
|
|
378
|
+
{msg.ts ? (
|
|
379
|
+
<Text style={[typography.caption, { color: colors.foregroundMuted }]}>
|
|
380
|
+
{new Date(msg.ts).toLocaleTimeString()}
|
|
381
|
+
</Text>
|
|
382
|
+
) : null}
|
|
383
|
+
</Row>
|
|
384
|
+
<Text
|
|
385
|
+
style={[typography.caption, { color: colors.foreground }]}
|
|
386
|
+
numberOfLines={3}
|
|
387
|
+
>
|
|
388
|
+
{msg.preview}
|
|
389
|
+
</Text>
|
|
390
|
+
</View>
|
|
391
|
+
))}
|
|
392
|
+
</Stack>
|
|
393
|
+
</Collapsible>
|
|
394
|
+
</View>
|
|
395
|
+
) : null}
|
|
396
|
+
</Card>
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export function ForgeHookQueuePanel({ workspaceId: _workspaceId }: { workspaceId?: string }) {
|
|
401
|
+
return <HookQueueView />;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export function ForgeHookQueueSurface() {
|
|
405
|
+
return <HookQueueView />;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const styles = StyleSheet.create({
|
|
409
|
+
messageItem: {
|
|
410
|
+
borderLeftWidth: 3,
|
|
411
|
+
},
|
|
412
|
+
});
|