@swirls/shuttle 0.0.0-stage → 0.1.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/CHANGELOG.md +18 -0
- package/LICENSE +190 -0
- package/NOTICE +5 -0
- package/README.md +42 -2
- package/dist/api/auth.d.ts +18 -0
- package/dist/api/auth.js +15 -0
- package/dist/api/common.d.ts +8 -0
- package/dist/api/common.js +4 -0
- package/dist/api/connections.d.ts +292 -0
- package/dist/api/connections.js +114 -0
- package/dist/api/github.d.ts +20 -0
- package/dist/api/github.js +13 -0
- package/dist/api/harness.d.ts +97 -0
- package/dist/api/harness.js +47 -0
- package/dist/api/index.d.ts +2059 -0
- package/dist/api/index.js +37 -0
- package/dist/api/runners.d.ts +93 -0
- package/dist/api/runners.js +45 -0
- package/dist/api/sandbox.d.ts +550 -0
- package/dist/api/sandbox.js +210 -0
- package/dist/api/sessions.d.ts +318 -0
- package/dist/api/sessions.js +154 -0
- package/dist/api/tenant.d.ts +54 -0
- package/dist/api/tenant.js +19 -0
- package/dist/api/timings.d.ts +36 -0
- package/dist/api/timings.js +48 -0
- package/dist/api/workspace.d.ts +738 -0
- package/dist/api/workspace.js +246 -0
- package/dist/core/pulls.d.ts +1001 -0
- package/dist/core/pulls.js +170 -0
- package/dist/core/workspace.d.ts +985 -0
- package/dist/core/workspace.js +174 -0
- package/dist/react/components/command-palette.d.ts +22 -0
- package/dist/react/components/command-palette.js +66 -0
- package/dist/react/components/follow-list.d.ts +20 -0
- package/dist/react/components/follow-list.js +98 -0
- package/dist/react/components/json-tree.d.ts +11 -0
- package/dist/react/components/json-tree.js +120 -0
- package/dist/react/components/markdown.d.ts +5 -0
- package/dist/react/components/markdown.js +29 -0
- package/dist/react/components/shuttle-mark.d.ts +7 -0
- package/dist/react/components/shuttle-mark.js +9 -0
- package/dist/react/components/status-dot.d.ts +9 -0
- package/dist/react/components/status-dot.js +27 -0
- package/dist/react/components/status.d.ts +6 -0
- package/dist/react/components/status.js +66 -0
- package/dist/react/components/ui/badge.d.ts +7 -0
- package/dist/react/components/ui/badge.js +19 -0
- package/dist/react/components/ui/button.d.ts +10 -0
- package/dist/react/components/ui/button.js +40 -0
- package/dist/react/components/ui/dialog.d.ts +19 -0
- package/dist/react/components/ui/dialog.js +34 -0
- package/dist/react/components/ui/dropdown-menu.d.ts +14 -0
- package/dist/react/components/ui/dropdown-menu.js +33 -0
- package/dist/react/components/ui/input.d.ts +3 -0
- package/dist/react/components/ui/input.js +6 -0
- package/dist/react/components/ui/panel.d.ts +18 -0
- package/dist/react/components/ui/panel.js +22 -0
- package/dist/react/components/ui/popover.d.ts +7 -0
- package/dist/react/components/ui/popover.js +16 -0
- package/dist/react/components/ui/resizable.d.ts +7 -0
- package/dist/react/components/ui/resizable.js +14 -0
- package/dist/react/components/ui/scroll-area.d.ts +14 -0
- package/dist/react/components/ui/scroll-area.js +12 -0
- package/dist/react/components/ui/select.d.ts +10 -0
- package/dist/react/components/ui/select.js +20 -0
- package/dist/react/components/ui/sheet.d.ts +8 -0
- package/dist/react/components/ui/sheet.js +20 -0
- package/dist/react/components/ui/tabs.d.ts +7 -0
- package/dist/react/components/ui/tabs.js +16 -0
- package/dist/react/components/ui/textarea.d.ts +3 -0
- package/dist/react/components/ui/textarea.js +6 -0
- package/dist/react/components/ui/tooltip.d.ts +8 -0
- package/dist/react/components/ui/tooltip.js +17 -0
- package/dist/react/features/artifacts/artifact-links.d.ts +9 -0
- package/dist/react/features/artifacts/artifact-links.js +38 -0
- package/dist/react/features/artifacts/artifact-pane.d.ts +19 -0
- package/dist/react/features/artifacts/artifact-pane.js +75 -0
- package/dist/react/features/artifacts/artifact-types.d.ts +59 -0
- package/dist/react/features/artifacts/artifact-types.js +69 -0
- package/dist/react/features/artifacts/browser-viewer.d.ts +5 -0
- package/dist/react/features/artifacts/browser-viewer.js +60 -0
- package/dist/react/features/artifacts/diff-style.d.ts +10 -0
- package/dist/react/features/artifacts/diff-style.js +21 -0
- package/dist/react/features/artifacts/file-pane.d.ts +13 -0
- package/dist/react/features/artifacts/file-pane.js +305 -0
- package/dist/react/features/artifacts/file-quick-open.d.ts +15 -0
- package/dist/react/features/artifacts/file-quick-open.js +74 -0
- package/dist/react/features/artifacts/file-search.d.ts +12 -0
- package/dist/react/features/artifacts/file-search.js +90 -0
- package/dist/react/features/artifacts/media-viewer.d.ts +8 -0
- package/dist/react/features/artifacts/media-viewer.js +41 -0
- package/dist/react/features/artifacts/review-diff.d.ts +19 -0
- package/dist/react/features/artifacts/review-diff.js +59 -0
- package/dist/react/features/artifacts/review-viewer.d.ts +4 -0
- package/dist/react/features/artifacts/review-viewer.js +337 -0
- package/dist/react/features/artifacts/sandbox.d.ts +43 -0
- package/dist/react/features/artifacts/sandbox.js +109 -0
- package/dist/react/features/artifacts/tab-strip.d.ts +11 -0
- package/dist/react/features/artifacts/tab-strip.js +55 -0
- package/dist/react/features/artifacts/terminal-theme.d.ts +34 -0
- package/dist/react/features/artifacts/terminal-theme.js +62 -0
- package/dist/react/features/artifacts/terminal-viewer.d.ts +5 -0
- package/dist/react/features/artifacts/terminal-viewer.js +209 -0
- package/dist/react/features/artifacts/unified-diff.d.ts +16 -0
- package/dist/react/features/artifacts/unified-diff.js +55 -0
- package/dist/react/features/artifacts/workspace-viewer.d.ts +16 -0
- package/dist/react/features/artifacts/workspace-viewer.js +275 -0
- package/dist/react/features/connections/agent-sign-in.d.ts +71 -0
- package/dist/react/features/connections/agent-sign-in.js +251 -0
- package/dist/react/features/connections/connections-panel.d.ts +8 -0
- package/dist/react/features/connections/connections-panel.js +42 -0
- package/dist/react/features/connections/login.d.ts +24 -0
- package/dist/react/features/connections/login.js +35 -0
- package/dist/react/features/connections/places.d.ts +20 -0
- package/dist/react/features/connections/places.js +27 -0
- package/dist/react/features/connections/queries.d.ts +28 -0
- package/dist/react/features/connections/queries.js +8 -0
- package/dist/react/features/events/event-cache.d.ts +4 -0
- package/dist/react/features/events/event-cache.js +29 -0
- package/dist/react/features/events/event-catalog.d.ts +17 -0
- package/dist/react/features/events/event-catalog.js +261 -0
- package/dist/react/features/events/event-inspector.d.ts +7 -0
- package/dist/react/features/events/event-inspector.js +29 -0
- package/dist/react/features/events/event-row.d.ts +21 -0
- package/dist/react/features/events/event-row.js +34 -0
- package/dist/react/features/events/event-stream.d.ts +18 -0
- package/dist/react/features/events/event-stream.js +58 -0
- package/dist/react/features/events/global-events.d.ts +122 -0
- package/dist/react/features/events/global-events.js +329 -0
- package/dist/react/features/events/shuttle-events.d.ts +7 -0
- package/dist/react/features/events/shuttle-events.js +1 -0
- package/dist/react/features/playbook/playbook-page.d.ts +2 -0
- package/dist/react/features/playbook/playbook-page.js +36 -0
- package/dist/react/features/playbook/playbook-query.d.ts +111 -0
- package/dist/react/features/playbook/playbook-query.js +17 -0
- package/dist/react/features/pulls/linked-session.d.ts +12 -0
- package/dist/react/features/pulls/linked-session.js +22 -0
- package/dist/react/features/pulls/pull-detail-sheet.d.ts +10 -0
- package/dist/react/features/pulls/pull-detail-sheet.js +41 -0
- package/dist/react/features/pulls/pull-fixtures.d.ts +8 -0
- package/dist/react/features/pulls/pull-fixtures.js +258 -0
- package/dist/react/features/pulls/pull-glyphs.d.ts +24 -0
- package/dist/react/features/pulls/pull-glyphs.js +89 -0
- package/dist/react/features/pulls/pull-inbox-list.d.ts +13 -0
- package/dist/react/features/pulls/pull-inbox-list.js +230 -0
- package/dist/react/features/pulls/pull-inbox-pref.d.ts +2 -0
- package/dist/react/features/pulls/pull-inbox-pref.js +19 -0
- package/dist/react/features/pulls/pull-inbox.d.ts +30 -0
- package/dist/react/features/pulls/pull-inbox.js +110 -0
- package/dist/react/features/pulls/pull-threads.d.ts +39 -0
- package/dist/react/features/pulls/pull-threads.js +145 -0
- package/dist/react/features/pulls/pulls.d.ts +120 -0
- package/dist/react/features/pulls/pulls.js +414 -0
- package/dist/react/features/pulls/session-pull-groups.d.ts +14 -0
- package/dist/react/features/pulls/session-pull-groups.js +29 -0
- package/dist/react/features/pulls/stack-ladder.d.ts +9 -0
- package/dist/react/features/pulls/stack-ladder.js +32 -0
- package/dist/react/features/sessions/agent-tree.d.ts +16 -0
- package/dist/react/features/sessions/agent-tree.js +100 -0
- package/dist/react/features/sessions/agents.d.ts +34 -0
- package/dist/react/features/sessions/agents.js +146 -0
- package/dist/react/features/sessions/attention.d.ts +32 -0
- package/dist/react/features/sessions/attention.js +42 -0
- package/dist/react/features/sessions/composer-attachments.d.ts +33 -0
- package/dist/react/features/sessions/composer-attachments.js +126 -0
- package/dist/react/features/sessions/composer.d.ts +15 -0
- package/dist/react/features/sessions/composer.js +327 -0
- package/dist/react/features/sessions/context-usage-meter.d.ts +5 -0
- package/dist/react/features/sessions/context-usage-meter.js +122 -0
- package/dist/react/features/sessions/context-usage.d.ts +54 -0
- package/dist/react/features/sessions/context-usage.js +206 -0
- package/dist/react/features/sessions/conversation.d.ts +21 -0
- package/dist/react/features/sessions/conversation.js +549 -0
- package/dist/react/features/sessions/harness-switcher.d.ts +26 -0
- package/dist/react/features/sessions/harness-switcher.js +118 -0
- package/dist/react/features/sessions/intake-heuristic.d.ts +5 -0
- package/dist/react/features/sessions/intake-heuristic.js +28 -0
- package/dist/react/features/sessions/interjection-routes.d.ts +13 -0
- package/dist/react/features/sessions/interjection-routes.js +72 -0
- package/dist/react/features/sessions/llm-models.d.ts +128 -0
- package/dist/react/features/sessions/llm-models.js +174 -0
- package/dist/react/features/sessions/media-strip.d.ts +25 -0
- package/dist/react/features/sessions/media-strip.js +56 -0
- package/dist/react/features/sessions/media.d.ts +43 -0
- package/dist/react/features/sessions/media.js +115 -0
- package/dist/react/features/sessions/model-search.d.ts +6 -0
- package/dist/react/features/sessions/model-search.js +16 -0
- package/dist/react/features/sessions/model-switcher.d.ts +16 -0
- package/dist/react/features/sessions/model-switcher.js +262 -0
- package/dist/react/features/sessions/open-pull-request.d.ts +20 -0
- package/dist/react/features/sessions/open-pull-request.js +92 -0
- package/dist/react/features/sessions/pull-publish-card.d.ts +14 -0
- package/dist/react/features/sessions/pull-publish-card.js +88 -0
- package/dist/react/features/sessions/recent-sessions.d.ts +11 -0
- package/dist/react/features/sessions/recent-sessions.js +29 -0
- package/dist/react/features/sessions/seen-sessions.d.ts +16 -0
- package/dist/react/features/sessions/seen-sessions.js +108 -0
- package/dist/react/features/sessions/session-activity.d.ts +95 -0
- package/dist/react/features/sessions/session-activity.js +785 -0
- package/dist/react/features/sessions/session-context.d.ts +8 -0
- package/dist/react/features/sessions/session-context.js +98 -0
- package/dist/react/features/sessions/session-feed.d.ts +243 -0
- package/dist/react/features/sessions/session-feed.js +883 -0
- package/dist/react/features/sessions/session-header.d.ts +24 -0
- package/dist/react/features/sessions/session-header.js +97 -0
- package/dist/react/features/sessions/session-layout.d.ts +7 -0
- package/dist/react/features/sessions/session-layout.js +87 -0
- package/dist/react/features/sessions/session-panes.d.ts +49 -0
- package/dist/react/features/sessions/session-panes.js +142 -0
- package/dist/react/features/sessions/session-parts.d.ts +35 -0
- package/dist/react/features/sessions/session-parts.js +74 -0
- package/dist/react/features/sessions/session-place.d.ts +9 -0
- package/dist/react/features/sessions/session-place.js +109 -0
- package/dist/react/features/sessions/session-pr-pills.d.ts +7 -0
- package/dist/react/features/sessions/session-pr-pills.js +28 -0
- package/dist/react/features/sessions/session-queries.d.ts +172 -0
- package/dist/react/features/sessions/session-queries.js +90 -0
- package/dist/react/features/sessions/session-repos.d.ts +8 -0
- package/dist/react/features/sessions/session-repos.js +15 -0
- package/dist/react/features/sessions/session-share.d.ts +8 -0
- package/dist/react/features/sessions/session-share.js +112 -0
- package/dist/react/features/sessions/session-tabs.d.ts +38 -0
- package/dist/react/features/sessions/session-tabs.js +191 -0
- package/dist/react/features/sessions/session.d.ts +103 -0
- package/dist/react/features/sessions/session.js +216 -0
- package/dist/react/features/sessions/signals.d.ts +13 -0
- package/dist/react/features/sessions/signals.js +34 -0
- package/dist/react/features/sessions/tab-set.d.ts +20 -0
- package/dist/react/features/sessions/tab-set.js +58 -0
- package/dist/react/features/sessions/team.d.ts +16 -0
- package/dist/react/features/sessions/team.js +35 -0
- package/dist/react/features/sessions/timeline.d.ts +53 -0
- package/dist/react/features/sessions/timeline.js +153 -0
- package/dist/react/features/sessions/use-session-tabs.d.ts +18 -0
- package/dist/react/features/sessions/use-session-tabs.js +119 -0
- package/dist/react/features/sessions/vendor-models.d.ts +23 -0
- package/dist/react/features/sessions/vendor-models.js +61 -0
- package/dist/react/features/workspace/activity-dot.d.ts +15 -0
- package/dist/react/features/workspace/activity-dot.js +36 -0
- package/dist/react/features/workspace/app-sidebar.d.ts +16 -0
- package/dist/react/features/workspace/app-sidebar.js +227 -0
- package/dist/react/features/workspace/fixture-toggle.d.ts +2 -0
- package/dist/react/features/workspace/fixture-toggle.js +72 -0
- package/dist/react/features/workspace/folder-group.d.ts +18 -0
- package/dist/react/features/workspace/folder-group.js +83 -0
- package/dist/react/features/workspace/inline-name-input.d.ts +10 -0
- package/dist/react/features/workspace/inline-name-input.js +33 -0
- package/dist/react/features/workspace/link-repo-dialog.d.ts +9 -0
- package/dist/react/features/workspace/link-repo-dialog.js +76 -0
- package/dist/react/features/workspace/repo-chip.d.ts +13 -0
- package/dist/react/features/workspace/repo-chip.js +15 -0
- package/dist/react/features/workspace/session-row.d.ts +20 -0
- package/dist/react/features/workspace/session-row.js +23 -0
- package/dist/react/features/workspace/use-debounced.d.ts +2 -0
- package/dist/react/features/workspace/use-debounced.js +10 -0
- package/dist/react/features/workspace/workspace-context.d.ts +45 -0
- package/dist/react/features/workspace/workspace-context.js +245 -0
- package/dist/react/features/workspace/workspace-fixtures.d.ts +16 -0
- package/dist/react/features/workspace/workspace-fixtures.js +175 -0
- package/dist/react/features/workspace/workspace-tree.d.ts +30 -0
- package/dist/react/features/workspace/workspace-tree.js +69 -0
- package/dist/react/features/workspace/workspace.d.ts +107 -0
- package/dist/react/features/workspace/workspace.js +458 -0
- package/dist/react/index.d.ts +33 -0
- package/dist/react/index.js +35 -0
- package/dist/react/lib/cn.d.ts +6 -0
- package/dist/react/lib/cn.js +20 -0
- package/dist/react/lib/initials.d.ts +6 -0
- package/dist/react/lib/initials.js +32 -0
- package/dist/react/lib/json.d.ts +33 -0
- package/dist/react/lib/json.js +101 -0
- package/dist/react/lib/time.d.ts +8 -0
- package/dist/react/lib/time.js +57 -0
- package/dist/react/lib/use-media-query.d.ts +1 -0
- package/dist/react/lib/use-media-query.js +9 -0
- package/dist/react/lib/use-now.d.ts +2 -0
- package/dist/react/lib/use-now.js +10 -0
- package/dist/react/lib/use-width-bucket.d.ts +6 -0
- package/dist/react/lib/use-width-bucket.js +28 -0
- package/dist/react/parts/index.d.ts +43 -0
- package/dist/react/parts/index.js +43 -0
- package/dist/react/shuttle/device.d.ts +42 -0
- package/dist/react/shuttle/device.js +10 -0
- package/dist/react/shuttle/host.d.ts +1126 -0
- package/dist/react/shuttle/host.js +93 -0
- package/dist/react/shuttle/identity.d.ts +31 -0
- package/dist/react/shuttle/identity.js +20 -0
- package/dist/react/shuttle/index.d.ts +14 -0
- package/dist/react/shuttle/index.js +13 -0
- package/dist/react/shuttle/provider.d.ts +41 -0
- package/dist/react/shuttle/provider.js +59 -0
- package/dist/react/shuttle/router.d.ts +43 -0
- package/dist/react/shuttle/router.js +1 -0
- package/dist/react/theme.css +456 -0
- package/dist/react/ui.d.ts +19 -0
- package/dist/react/ui.js +19 -0
- package/package.json +100 -4
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { ShuttleClient, ShuttleHost } from '../../shuttle/index.js';
|
|
2
|
+
/** What the backend answers when asked for the playbook. */
|
|
3
|
+
export type PlaybookAnswer = Awaited<ReturnType<ShuttleClient['playbook']['get']>>;
|
|
4
|
+
/**
|
|
5
|
+
* The organization's playbook: its approved lessons, and the ones waiting for review. The
|
|
6
|
+
* playbook is a run of its own, which nothing starts until someone asks for it, so every read
|
|
7
|
+
* makes sure it is started first.
|
|
8
|
+
*/
|
|
9
|
+
export declare function playbookQuery({ api, client }: ShuttleHost): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
10
|
+
runId: string;
|
|
11
|
+
playbook: {
|
|
12
|
+
version: number;
|
|
13
|
+
lessons: {
|
|
14
|
+
id: string;
|
|
15
|
+
text: string;
|
|
16
|
+
scope: string;
|
|
17
|
+
evidence: {
|
|
18
|
+
runId: string;
|
|
19
|
+
seq: number;
|
|
20
|
+
}[];
|
|
21
|
+
sourceRunId: string;
|
|
22
|
+
}[];
|
|
23
|
+
proposed?: Record<string, {
|
|
24
|
+
text: string;
|
|
25
|
+
scope: string;
|
|
26
|
+
evidence: {
|
|
27
|
+
runId: string;
|
|
28
|
+
seq: number;
|
|
29
|
+
}[];
|
|
30
|
+
sourceRunId: string;
|
|
31
|
+
}> | undefined;
|
|
32
|
+
};
|
|
33
|
+
note?: string | undefined;
|
|
34
|
+
}, Error, {
|
|
35
|
+
runId: string;
|
|
36
|
+
playbook: {
|
|
37
|
+
version: number;
|
|
38
|
+
lessons: {
|
|
39
|
+
id: string;
|
|
40
|
+
text: string;
|
|
41
|
+
scope: string;
|
|
42
|
+
evidence: {
|
|
43
|
+
runId: string;
|
|
44
|
+
seq: number;
|
|
45
|
+
}[];
|
|
46
|
+
sourceRunId: string;
|
|
47
|
+
}[];
|
|
48
|
+
proposed?: Record<string, {
|
|
49
|
+
text: string;
|
|
50
|
+
scope: string;
|
|
51
|
+
evidence: {
|
|
52
|
+
runId: string;
|
|
53
|
+
seq: number;
|
|
54
|
+
}[];
|
|
55
|
+
sourceRunId: string;
|
|
56
|
+
}> | undefined;
|
|
57
|
+
};
|
|
58
|
+
note?: string | undefined;
|
|
59
|
+
}, readonly unknown[]>, "queryFn"> & {
|
|
60
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
61
|
+
runId: string;
|
|
62
|
+
playbook: {
|
|
63
|
+
version: number;
|
|
64
|
+
lessons: {
|
|
65
|
+
id: string;
|
|
66
|
+
text: string;
|
|
67
|
+
scope: string;
|
|
68
|
+
evidence: {
|
|
69
|
+
runId: string;
|
|
70
|
+
seq: number;
|
|
71
|
+
}[];
|
|
72
|
+
sourceRunId: string;
|
|
73
|
+
}[];
|
|
74
|
+
proposed?: Record<string, {
|
|
75
|
+
text: string;
|
|
76
|
+
scope: string;
|
|
77
|
+
evidence: {
|
|
78
|
+
runId: string;
|
|
79
|
+
seq: number;
|
|
80
|
+
}[];
|
|
81
|
+
sourceRunId: string;
|
|
82
|
+
}> | undefined;
|
|
83
|
+
};
|
|
84
|
+
note?: string | undefined;
|
|
85
|
+
}, readonly unknown[], never> | undefined;
|
|
86
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly unknown[], {
|
|
87
|
+
runId: string;
|
|
88
|
+
playbook: {
|
|
89
|
+
version: number;
|
|
90
|
+
lessons: {
|
|
91
|
+
id: string;
|
|
92
|
+
text: string;
|
|
93
|
+
scope: string;
|
|
94
|
+
evidence: {
|
|
95
|
+
runId: string;
|
|
96
|
+
seq: number;
|
|
97
|
+
}[];
|
|
98
|
+
sourceRunId: string;
|
|
99
|
+
}[];
|
|
100
|
+
proposed?: Record<string, {
|
|
101
|
+
text: string;
|
|
102
|
+
scope: string;
|
|
103
|
+
evidence: {
|
|
104
|
+
runId: string;
|
|
105
|
+
seq: number;
|
|
106
|
+
}[];
|
|
107
|
+
sourceRunId: string;
|
|
108
|
+
}> | undefined;
|
|
109
|
+
};
|
|
110
|
+
note?: string | undefined;
|
|
111
|
+
}, Error>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
/**
|
|
3
|
+
* The organization's playbook: its approved lessons, and the ones waiting for review. The
|
|
4
|
+
* playbook is a run of its own, which nothing starts until someone asks for it, so every read
|
|
5
|
+
* makes sure it is started first.
|
|
6
|
+
*/
|
|
7
|
+
export function playbookQuery({ api, client }) {
|
|
8
|
+
// The key's type is given, not inferred: inferred, it carries a tag from the query library
|
|
9
|
+
// that a declaration file cannot name.
|
|
10
|
+
return queryOptions({
|
|
11
|
+
queryKey: api.playbook.get.queryKey(),
|
|
12
|
+
queryFn: async ({ signal }) => {
|
|
13
|
+
await client.playbook.ensure(undefined, { signal });
|
|
14
|
+
return client.playbook.get(undefined, { signal });
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { LinkedSession } from './pulls.js';
|
|
3
|
+
export declare function useSessionTitle(runId: string | undefined): string | undefined;
|
|
4
|
+
/** Opens the session focused on the agent thread that acted on the PR. */
|
|
5
|
+
export declare function LinkedSessionLink({ session, className, children, }: {
|
|
6
|
+
session: LinkedSession;
|
|
7
|
+
className?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function LinkedSessionRow({ session }: {
|
|
11
|
+
session: LinkedSession;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowRight } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../lib/cn.js';
|
|
4
|
+
import { Link } from '../../shuttle/index.js';
|
|
5
|
+
import { useWorkspaceSessions } from '../workspace/workspace-context.js';
|
|
6
|
+
export function useSessionTitle(runId) {
|
|
7
|
+
const sessions = useWorkspaceSessions();
|
|
8
|
+
return runId ? sessions[runId]?.title : undefined;
|
|
9
|
+
}
|
|
10
|
+
/** Opens the session focused on the agent thread that acted on the PR. */
|
|
11
|
+
export function LinkedSessionLink({ session, className, children, }) {
|
|
12
|
+
return (_jsxs(Link, { to: { page: 'session', sessionId: session.runId, thread: session.threadId }, className: cn('group inline-flex min-w-0 items-center gap-1', className), children: [children, _jsx(ArrowRight, { className: "size-3 shrink-0 transition-transform duration-150 group-hover:translate-x-0.5" })] }));
|
|
13
|
+
}
|
|
14
|
+
export function LinkedSessionRow({ session }) {
|
|
15
|
+
const title = useSessionTitle(session.runId);
|
|
16
|
+
const known = useWorkspaceSessions()[session.runId];
|
|
17
|
+
// Skip stale/corrupt links (e.g. a thread id recorded as the run id).
|
|
18
|
+
if (!known && !title) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return (_jsxs(LinkedSessionLink, { session: session, className: "text-brand hover:underline", children: [_jsx("span", { className: "shrink-0", children: session.role === 'author' ? 'Opened in' : 'Reviewed in' }), _jsx("span", { className: "text-foreground/90 min-w-0 truncate", dir: "auto", title: title, children: title ?? 'a session' })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PullInboxSummary, type PullStack } from './pulls.js';
|
|
2
|
+
export declare function PullDetailSheet({ folderId, pull, siblings, stack, onOpenPull, onOpenChange, }: {
|
|
3
|
+
folderId: string;
|
|
4
|
+
pull: PullInboxSummary | null;
|
|
5
|
+
/** Other open PRs the same session opened. */
|
|
6
|
+
siblings: readonly PullInboxSummary[];
|
|
7
|
+
stack: PullStack | null;
|
|
8
|
+
onOpenPull: (key: string) => void;
|
|
9
|
+
onOpenChange: (open: boolean) => void;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { ExternalLink, GitPullRequest, LoaderCircle, MessageSquareReply } from 'lucide-react';
|
|
4
|
+
import { Markdown } from '../../components/markdown.js';
|
|
5
|
+
import { Button } from '../../components/ui/button.js';
|
|
6
|
+
import { Sheet, SheetContent, SheetDescription, SheetTitle } from '../../components/ui/sheet.js';
|
|
7
|
+
import { compactRelativeTime, fullDateTime } from '../../lib/time.js';
|
|
8
|
+
import { useNow } from '../../lib/use-now.js';
|
|
9
|
+
import { Link, useApi, useNavigate } from '../../shuttle/index.js';
|
|
10
|
+
import { LinkedSessionRow } from './linked-session.js';
|
|
11
|
+
import { checkLabel, CheckGlyph, DiffCells, DiffStat, RepoDot, repoShortName, reviewLabel, } from './pull-glyphs.js';
|
|
12
|
+
import { authorRunId, pullKey } from './pulls.js';
|
|
13
|
+
import { StackLadder } from './stack-ladder.js';
|
|
14
|
+
export function PullDetailSheet({ folderId, pull, siblings, stack, onOpenPull, onOpenChange, }) {
|
|
15
|
+
return (_jsx(Sheet, { open: pull !== null, onOpenChange: onOpenChange, children: _jsx(SheetContent, { children: pull ? (_jsx(PullDetail, { folderId: folderId, pull: pull, siblings: siblings, stack: stack, onOpenPull: onOpenPull }, pullKey(pull.fullName, pull.number))) : null }) }));
|
|
16
|
+
}
|
|
17
|
+
function PullDetail({ folderId, pull, siblings, stack, onOpenPull, }) {
|
|
18
|
+
const api = useApi();
|
|
19
|
+
const navigate = useNavigate();
|
|
20
|
+
const now = useNow();
|
|
21
|
+
const review = reviewLabel(pull.reviewDecision);
|
|
22
|
+
const body = pull.body.trim();
|
|
23
|
+
// Feedback is addressed where the pull request was written: only that session has the branch
|
|
24
|
+
// and can push to it. A pull request Shuttle did not open has no such session.
|
|
25
|
+
const authoringRunId = authorRunId(pull);
|
|
26
|
+
// The review is a session of its own, so starting one goes straight to it.
|
|
27
|
+
const startReview = useMutation(api.workspace.pulls.review.mutationOptions({
|
|
28
|
+
onSuccess: ({ runId }) => navigate({ page: 'session', sessionId: runId }),
|
|
29
|
+
}));
|
|
30
|
+
function requestReview() {
|
|
31
|
+
startReview.mutate({
|
|
32
|
+
folderId,
|
|
33
|
+
fullName: pull.fullName,
|
|
34
|
+
number: pull.number,
|
|
35
|
+
headSha: pull.headSha,
|
|
36
|
+
baseSha: pull.baseSha,
|
|
37
|
+
title: `Review ${pull.fullName}#${pull.number}`,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsxs("header", { className: "border-b px-5 pt-5 pr-12 pb-4", children: [_jsxs("p", { className: "text-muted-foreground flex items-center gap-1.5 font-mono text-[11px]", children: [_jsx(RepoDot, { fullName: pull.fullName }), pull.fullName, _jsxs("span", { className: "text-muted-foreground/60", children: ["#", pull.number] }), pull.draft ? (_jsx("span", { className: "bg-muted ml-1 rounded-sm px-1 font-sans text-[10px]", children: "Draft" })) : null] }), _jsx(SheetTitle, { className: "mt-1.5 text-balance wrap-anywhere", dir: "auto", children: pull.title }), _jsxs(SheetDescription, { className: "mt-1.5", children: [_jsx("span", { className: "text-foreground/80", children: pull.author.login }), " wants to merge", ' ', _jsx("code", { className: "font-mono text-[11px]", children: pull.headRef }), " into", ' ', _jsx("code", { className: "font-mono text-[11px]", children: pull.baseRef }), " \u00B7", ' ', _jsx("time", { title: fullDateTime(pull.updatedAt), children: compactRelativeTime(pull.updatedAt, now) })] })] }), _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-5 py-4", children: [_jsxs("dl", { className: "grid grid-cols-[auto_1fr] items-center gap-x-6 gap-y-2.5 text-xs", children: [_jsx("dt", { className: "text-muted-foreground", children: "Checks" }), _jsxs("dd", { className: "flex items-center gap-1.5", children: [_jsx(CheckGlyph, { rollup: pull.checkRollup }), checkLabel(pull.checkRollup)] }), _jsx("dt", { className: "text-muted-foreground", children: "Review" }), _jsx("dd", { className: review ? undefined : 'text-muted-foreground', children: review ?? 'No reviews yet' }), _jsx("dt", { className: "text-muted-foreground", children: "Changes" }), _jsxs("dd", { className: "flex items-center gap-2", children: [_jsx(DiffStat, { additions: pull.additions, deletions: pull.deletions, className: "text-[11px]" }), _jsx(DiffCells, { additions: pull.additions, deletions: pull.deletions })] }), pull.linkedSessions.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground self-start pt-px", children: "Shuttle" }), _jsx("dd", { className: "flex min-w-0 flex-col gap-1", children: pull.linkedSessions.map((session) => (_jsx(LinkedSessionRow, { session: session }, `${session.runId}:${session.role}`))) })] })) : null, stack ? (_jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground self-start pt-1.5", children: "Stack" }), _jsx("dd", { className: "min-w-0", children: _jsx(StackLadder, { stack: stack, highlight: pull, onOpenPull: (layer) => onOpenPull(pullKey(layer.fullName, layer.number)) }) })] })) : siblings.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground self-start pt-1.5", children: "Also opened" }), _jsx("dd", { className: "-mx-1.5 flex min-w-0 flex-col", children: siblings.map((sibling) => (_jsxs("button", { type: "button", onClick: () => onOpenPull(pullKey(sibling.fullName, sibling.number)), title: sibling.title, className: "hover:bg-accent/50 focus-visible:bg-accent/60 flex h-7 min-w-0 items-center gap-1.5 rounded-md px-1.5 text-left transition-colors duration-100 outline-none", children: [_jsx(RepoDot, { fullName: sibling.fullName }), _jsx("span", { className: "text-muted-foreground shrink-0", children: repoShortName(sibling.fullName) }), _jsxs("span", { className: "text-muted-foreground/70 shrink-0 font-mono text-[10px]", children: ["#", sibling.number] }), _jsx("span", { className: "min-w-0 truncate", dir: "auto", children: sibling.title }), _jsx(CheckGlyph, { rollup: sibling.checkRollup, className: "ml-auto" })] }, pullKey(sibling.fullName, sibling.number)))) })] })) : null] }), _jsxs("section", { children: [_jsx("h3", { className: "text-muted-foreground mb-1.5 text-[11px] font-medium", children: "Description" }), body ? (_jsx("div", { dir: "auto", className: "bg-card/60 rounded-lg border px-3.5 py-3", children: _jsx(Markdown, { text: body, className: "text-[12.5px] leading-relaxed wrap-anywhere" }) })) : (_jsx("p", { className: "text-muted-foreground text-xs", children: "No description provided." }))] })] }), _jsxs("footer", { className: "flex flex-col gap-2 border-t px-5 py-3", children: [startReview.error ? (_jsx("p", { className: "text-status-failed text-xs wrap-anywhere", children: startReview.error.message })) : null, _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsxs("a", { href: pull.url, target: "_blank", rel: "noreferrer", children: [_jsx(ExternalLink, {}), "GitHub"] }) }), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [pull.reviewDecision === 'changes_requested' && authoringRunId ? (_jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsxs(Link, { to: { page: 'session', sessionId: authoringRunId }, children: [_jsx(MessageSquareReply, {}), "Address feedback"] }) })) : null, pull.reviewingRunId ? (_jsx(Button, { variant: "brand", size: "sm", asChild: true, children: _jsxs(Link, { to: { page: 'session', sessionId: pull.reviewingRunId }, children: [_jsx(GitPullRequest, {}), "Open review"] }) })) : (_jsxs(Button, { variant: "brand", size: "sm", disabled: startReview.isPending, onClick: requestReview, children: [startReview.isPending ? (_jsx(LoaderCircle, { className: "animate-spin" })) : (_jsx(GitPullRequest, {})), "Review with Shuttle"] }))] })] })] })] }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FolderSyncReport } from '@swirls/shuttle/api';
|
|
2
|
+
import type { PullInboxState } from './pulls.js';
|
|
3
|
+
/** Worst-case PR inbox for break-ui / fixture mode. */
|
|
4
|
+
export declare function worstCasePullInbox(now?: number): PullInboxState;
|
|
5
|
+
/** One repo the GitHub App cannot read, plus withheld check status, for the access banner. */
|
|
6
|
+
export declare function worstCaseSyncReport(folderId: string): FolderSyncReport;
|
|
7
|
+
export declare function emptyPullInboxFixture(): PullInboxState;
|
|
8
|
+
export declare function hugePullInbox(now?: number): PullInboxState;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
function pull(partial) {
|
|
2
|
+
return {
|
|
3
|
+
installationId: 1,
|
|
4
|
+
body: '',
|
|
5
|
+
url: `https://github.com/${partial.fullName}/pull/${partial.number}`,
|
|
6
|
+
state: 'open',
|
|
7
|
+
draft: false,
|
|
8
|
+
author: { login: 'octocat', avatarUrl: '' },
|
|
9
|
+
headRef: 'feature',
|
|
10
|
+
headSha: 'abc123',
|
|
11
|
+
baseRef: 'main',
|
|
12
|
+
baseSha: 'def456',
|
|
13
|
+
additions: 42,
|
|
14
|
+
deletions: 7,
|
|
15
|
+
reviewDecision: 'review_required',
|
|
16
|
+
checkRollup: 'pending',
|
|
17
|
+
updatedAt: Date.now(),
|
|
18
|
+
isFork: false,
|
|
19
|
+
stack: null,
|
|
20
|
+
linkedSessions: [],
|
|
21
|
+
reviewingRunId: null,
|
|
22
|
+
...partial,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Worst-case PR inbox for break-ui / fixture mode. */
|
|
26
|
+
export function worstCasePullInbox(now = Date.now()) {
|
|
27
|
+
// A fixture workspace session, so linked PRs resolve a real title in fixture mode.
|
|
28
|
+
const sessionA = 'fx-s1';
|
|
29
|
+
const sessionB = 'run_review_live';
|
|
30
|
+
return {
|
|
31
|
+
policies: {
|
|
32
|
+
'acme/api': {
|
|
33
|
+
installationId: 1,
|
|
34
|
+
folders: [{ folderId: 'fx-platform', autoReview: 'others' }],
|
|
35
|
+
},
|
|
36
|
+
'acme/web': {
|
|
37
|
+
installationId: 1,
|
|
38
|
+
folders: [{ folderId: 'fx-platform', autoReview: 'others' }],
|
|
39
|
+
},
|
|
40
|
+
'acme/infra': {
|
|
41
|
+
installationId: 1,
|
|
42
|
+
folders: [{ folderId: 'fx-platform', autoReview: 'all' }],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
pulls: Object.fromEntries([
|
|
46
|
+
pull({
|
|
47
|
+
fullName: 'acme/api',
|
|
48
|
+
number: 1201,
|
|
49
|
+
title: 'feat: add idempotent webhook delivery with outbox replay and poison-pill quarantine',
|
|
50
|
+
additions: 1840,
|
|
51
|
+
deletions: 220,
|
|
52
|
+
reviewDecision: 'review_required',
|
|
53
|
+
checkRollup: 'failing',
|
|
54
|
+
updatedAt: now - 3 * 60_000,
|
|
55
|
+
linkedSessions: [{ runId: sessionA, role: 'author', threadId: 'thr_conductor' }],
|
|
56
|
+
}),
|
|
57
|
+
pull({
|
|
58
|
+
fullName: 'acme/web',
|
|
59
|
+
number: 884,
|
|
60
|
+
title: 'feat(inbox): keyboard-first PR triage with smart lanes',
|
|
61
|
+
additions: 960,
|
|
62
|
+
deletions: 40,
|
|
63
|
+
reviewDecision: 'review_required',
|
|
64
|
+
checkRollup: 'passing',
|
|
65
|
+
updatedAt: now - 4 * 60_000,
|
|
66
|
+
linkedSessions: [{ runId: sessionA, role: 'author', threadId: 'thr_conductor' }],
|
|
67
|
+
}),
|
|
68
|
+
pull({
|
|
69
|
+
fullName: 'acme/infra',
|
|
70
|
+
number: 55,
|
|
71
|
+
title: 'chore: bump worker CPU for pulls run fan-in',
|
|
72
|
+
draft: true,
|
|
73
|
+
additions: 12,
|
|
74
|
+
deletions: 3,
|
|
75
|
+
reviewDecision: 'review_required',
|
|
76
|
+
checkRollup: 'pending',
|
|
77
|
+
updatedAt: now - 5 * 60_000,
|
|
78
|
+
linkedSessions: [{ runId: sessionA, role: 'author', threadId: 'thr_conductor' }],
|
|
79
|
+
}),
|
|
80
|
+
pull({
|
|
81
|
+
fullName: 'acme/api',
|
|
82
|
+
number: 1198,
|
|
83
|
+
title: 'fix: race when two syncRepo calls land on the same head SHA',
|
|
84
|
+
additions: 38,
|
|
85
|
+
deletions: 11,
|
|
86
|
+
reviewDecision: 'changes_requested',
|
|
87
|
+
checkRollup: 'passing',
|
|
88
|
+
updatedAt: now - 2 * 60 * 60_000,
|
|
89
|
+
author: { login: 'external-contributor-with-a-very-long-handle', avatarUrl: '' },
|
|
90
|
+
}),
|
|
91
|
+
pull({
|
|
92
|
+
fullName: 'acme/web',
|
|
93
|
+
number: 870,
|
|
94
|
+
title: 'Review: harden diff anchors for deleted-file LEFT side comments',
|
|
95
|
+
additions: 210,
|
|
96
|
+
deletions: 90,
|
|
97
|
+
reviewingRunId: sessionB,
|
|
98
|
+
reviewDecision: 'review_required',
|
|
99
|
+
checkRollup: 'pending',
|
|
100
|
+
updatedAt: now - 90_000,
|
|
101
|
+
linkedSessions: [{ runId: sessionB, role: 'reviewer', threadId: 'thr_reviewer' }],
|
|
102
|
+
}),
|
|
103
|
+
pull({
|
|
104
|
+
fullName: 'acme/api',
|
|
105
|
+
number: 1180,
|
|
106
|
+
title: 'draft: experimental GraphQL search batching',
|
|
107
|
+
draft: true,
|
|
108
|
+
additions: 400,
|
|
109
|
+
deletions: 0,
|
|
110
|
+
reviewDecision: 'none',
|
|
111
|
+
checkRollup: 'neutral',
|
|
112
|
+
updatedAt: now - 24 * 60 * 60_000,
|
|
113
|
+
linkedSessions: [{ runId: 'run_draft', role: 'author' }],
|
|
114
|
+
}),
|
|
115
|
+
pull({
|
|
116
|
+
fullName: 'acme/infra',
|
|
117
|
+
number: 40,
|
|
118
|
+
title: 'Approved and green — ready to ship the pulls module',
|
|
119
|
+
additions: 20,
|
|
120
|
+
deletions: 5,
|
|
121
|
+
reviewDecision: 'approved',
|
|
122
|
+
checkRollup: 'passing',
|
|
123
|
+
updatedAt: now - 10 * 60_000,
|
|
124
|
+
linkedSessions: [{ runId: 'run_ship', role: 'author' }],
|
|
125
|
+
}),
|
|
126
|
+
pull({
|
|
127
|
+
fullName: 'acme/web',
|
|
128
|
+
number: 1,
|
|
129
|
+
title: 'a',
|
|
130
|
+
additions: 1,
|
|
131
|
+
deletions: 0,
|
|
132
|
+
author: { login: 'x', avatarUrl: '' },
|
|
133
|
+
updatedAt: now - 7 * 24 * 60 * 60_000,
|
|
134
|
+
}),
|
|
135
|
+
// Native 3-layer stack split across drafts + needs_review.
|
|
136
|
+
pull({
|
|
137
|
+
fullName: 'acme/api',
|
|
138
|
+
number: 1301,
|
|
139
|
+
title: 'stack L1: schema for stacked publish',
|
|
140
|
+
headRef: 'shuttle/fx-stack/api',
|
|
141
|
+
baseRef: 'main',
|
|
142
|
+
draft: true,
|
|
143
|
+
stack: { number: 7, position: 1, size: 3 },
|
|
144
|
+
additions: 80,
|
|
145
|
+
deletions: 2,
|
|
146
|
+
updatedAt: now - 20 * 60_000,
|
|
147
|
+
linkedSessions: [{ runId: 'fx-stack', role: 'author', threadId: 'thr_conductor' }],
|
|
148
|
+
}),
|
|
149
|
+
pull({
|
|
150
|
+
fullName: 'acme/api',
|
|
151
|
+
number: 1302,
|
|
152
|
+
title: 'stack L2: wire GitHub Stacks API',
|
|
153
|
+
headRef: 'shuttle/fx-stack-stack/api/2',
|
|
154
|
+
baseRef: 'shuttle/fx-stack/api',
|
|
155
|
+
draft: true,
|
|
156
|
+
stack: { number: 7, position: 2, size: 3 },
|
|
157
|
+
additions: 120,
|
|
158
|
+
deletions: 10,
|
|
159
|
+
updatedAt: now - 18 * 60_000,
|
|
160
|
+
linkedSessions: [{ runId: 'fx-stack', role: 'author', threadId: 'thr_conductor' }],
|
|
161
|
+
}),
|
|
162
|
+
pull({
|
|
163
|
+
fullName: 'acme/api',
|
|
164
|
+
number: 1303,
|
|
165
|
+
title: 'stack L3: inbox ladder UI',
|
|
166
|
+
headRef: 'shuttle/fx-stack-stack/api/3',
|
|
167
|
+
baseRef: 'shuttle/fx-stack-stack/api/2',
|
|
168
|
+
stack: { number: 7, position: 3, size: 3 },
|
|
169
|
+
additions: 200,
|
|
170
|
+
deletions: 15,
|
|
171
|
+
reviewDecision: 'review_required',
|
|
172
|
+
checkRollup: 'passing',
|
|
173
|
+
updatedAt: now - 15 * 60_000,
|
|
174
|
+
linkedSessions: [{ runId: 'fx-stack', role: 'author', threadId: 'thr_conductor' }],
|
|
175
|
+
}),
|
|
176
|
+
// Chained but non-native stack (baseRef→headRef only).
|
|
177
|
+
pull({
|
|
178
|
+
fullName: 'acme/infra',
|
|
179
|
+
number: 90,
|
|
180
|
+
title: 'chain bottom: metrics scrape path',
|
|
181
|
+
headRef: 'feat/metrics-base',
|
|
182
|
+
baseRef: 'main',
|
|
183
|
+
additions: 60,
|
|
184
|
+
deletions: 4,
|
|
185
|
+
updatedAt: now - 40 * 60_000,
|
|
186
|
+
linkedSessions: [{ runId: 'fx-chain', role: 'author' }],
|
|
187
|
+
}),
|
|
188
|
+
pull({
|
|
189
|
+
fullName: 'acme/infra',
|
|
190
|
+
number: 91,
|
|
191
|
+
title: 'chain top: dashboard cards',
|
|
192
|
+
headRef: 'feat/metrics-ui',
|
|
193
|
+
baseRef: 'feat/metrics-base',
|
|
194
|
+
additions: 90,
|
|
195
|
+
deletions: 8,
|
|
196
|
+
updatedAt: now - 35 * 60_000,
|
|
197
|
+
linkedSessions: [{ runId: 'fx-chain', role: 'author' }],
|
|
198
|
+
}),
|
|
199
|
+
].map((entry) => [`${entry.fullName}#${entry.number}`, entry])),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/** One repo the GitHub App cannot read, plus withheld check status, for the access banner. */
|
|
203
|
+
export function worstCaseSyncReport(folderId) {
|
|
204
|
+
return {
|
|
205
|
+
folderId,
|
|
206
|
+
upserted: 9,
|
|
207
|
+
repos: [
|
|
208
|
+
{ fullName: 'acme/api', status: 'ok', open: 4, synced: 4, checksHidden: true, message: null },
|
|
209
|
+
{ fullName: 'acme/web', status: 'ok', open: 4, synced: 4, checksHidden: true, message: null },
|
|
210
|
+
{
|
|
211
|
+
fullName: 'acme/infra',
|
|
212
|
+
status: 'ok',
|
|
213
|
+
open: 2,
|
|
214
|
+
synced: 2,
|
|
215
|
+
checksHidden: true,
|
|
216
|
+
message: null,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
fullName: 'acme/private-billing-service-with-a-long-name',
|
|
220
|
+
status: 'forbidden',
|
|
221
|
+
open: 0,
|
|
222
|
+
synced: 0,
|
|
223
|
+
checksHidden: false,
|
|
224
|
+
message: 'The GitHub App cannot read pull requests in this repository.',
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
installations: [
|
|
228
|
+
{
|
|
229
|
+
installationId: 1,
|
|
230
|
+
account: 'acme',
|
|
231
|
+
missingPermissions: ['Pull requests', 'Checks', 'Commit statuses'],
|
|
232
|
+
settingsUrl: 'https://github.com/organizations/acme/settings/installations/1',
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
export function emptyPullInboxFixture() {
|
|
238
|
+
return { pulls: {}, policies: {} };
|
|
239
|
+
}
|
|
240
|
+
export function hugePullInbox(now = Date.now()) {
|
|
241
|
+
const pulls = {};
|
|
242
|
+
for (let index = 0; index < 120; index += 1) {
|
|
243
|
+
const repo = ['acme/api', 'acme/web', 'acme/infra', 'acme/docs'][index % 4];
|
|
244
|
+
const number = 10_000 + index;
|
|
245
|
+
pulls[`${repo}#${number}`] = pull({
|
|
246
|
+
fullName: repo,
|
|
247
|
+
number,
|
|
248
|
+
title: `Bulk fixture PR #${number} with a moderately long title for layout stress`,
|
|
249
|
+
additions: (index * 17) % 500,
|
|
250
|
+
deletions: (index * 3) % 80,
|
|
251
|
+
reviewDecision: index % 5 === 0 ? 'changes_requested' : index % 3 === 0 ? 'approved' : 'review_required',
|
|
252
|
+
checkRollup: index % 4 === 0 ? 'failing' : index % 2 === 0 ? 'passing' : 'pending',
|
|
253
|
+
draft: index % 11 === 0,
|
|
254
|
+
updatedAt: now - index * 60_000,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return { pulls, policies: {} };
|
|
258
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CheckRollup, PullLaneId, ReviewDecision } from './pulls.js';
|
|
2
|
+
export declare function repoShortName(fullName: string): string;
|
|
3
|
+
/** Stable per-repo hue so the same repo reads the same color across rows and sessions. */
|
|
4
|
+
export declare function RepoDot({ fullName, className }: {
|
|
5
|
+
fullName: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function checkLabel(rollup: CheckRollup): string;
|
|
9
|
+
export declare function CheckGlyph({ rollup, className }: {
|
|
10
|
+
rollup: CheckRollup;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
13
|
+
export declare function reviewLabel(decision: ReviewDecision): string | null;
|
|
14
|
+
export declare function DiffStat({ additions, deletions, className, }: {
|
|
15
|
+
additions: number;
|
|
16
|
+
deletions: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
/** Five cells split by the add/delete ratio, the way GitHub summarizes a diff. */
|
|
20
|
+
export declare function DiffCells({ additions, deletions }: {
|
|
21
|
+
additions: number;
|
|
22
|
+
deletions: number;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
export declare function laneTone(lane: PullLaneId): string;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CircleCheck, CircleDashed, CircleX } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../lib/cn.js';
|
|
4
|
+
export function repoShortName(fullName) {
|
|
5
|
+
return fullName.split('/')[1] ?? fullName;
|
|
6
|
+
}
|
|
7
|
+
/** Stable per-repo hue so the same repo reads the same color across rows and sessions. */
|
|
8
|
+
export function RepoDot({ fullName, className }) {
|
|
9
|
+
const hue = [...fullName].reduce((sum, char) => sum + char.charCodeAt(0), 0) % 360;
|
|
10
|
+
return (_jsx("span", { "aria-hidden": true, className: cn('size-1.5 shrink-0 rounded-full', className), style: { background: `oklch(0.72 0.12 ${hue})` } }));
|
|
11
|
+
}
|
|
12
|
+
export function checkLabel(rollup) {
|
|
13
|
+
switch (rollup) {
|
|
14
|
+
case 'passing':
|
|
15
|
+
return 'Checks passing';
|
|
16
|
+
case 'failing':
|
|
17
|
+
return 'Checks failing';
|
|
18
|
+
case 'pending':
|
|
19
|
+
return 'Checks running';
|
|
20
|
+
case 'neutral':
|
|
21
|
+
return 'No checks';
|
|
22
|
+
default: {
|
|
23
|
+
const exhaustive = rollup;
|
|
24
|
+
return exhaustive;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function CheckGlyph({ rollup, className }) {
|
|
29
|
+
const label = checkLabel(rollup);
|
|
30
|
+
const base = cn('size-3 shrink-0', className);
|
|
31
|
+
switch (rollup) {
|
|
32
|
+
case 'passing':
|
|
33
|
+
return _jsx(CircleCheck, { "aria-label": label, className: cn(base, 'text-status-completed') });
|
|
34
|
+
case 'failing':
|
|
35
|
+
return _jsx(CircleX, { "aria-label": label, className: cn(base, 'text-status-failed') });
|
|
36
|
+
case 'pending':
|
|
37
|
+
return _jsx(CircleDashed, { "aria-label": label, className: cn(base, 'text-status-waiting') });
|
|
38
|
+
case 'neutral':
|
|
39
|
+
return null;
|
|
40
|
+
default: {
|
|
41
|
+
const exhaustive = rollup;
|
|
42
|
+
return exhaustive;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function reviewLabel(decision) {
|
|
47
|
+
switch (decision) {
|
|
48
|
+
case 'approved':
|
|
49
|
+
return 'Approved';
|
|
50
|
+
case 'changes_requested':
|
|
51
|
+
return 'Changes requested';
|
|
52
|
+
case 'review_required':
|
|
53
|
+
return 'Review required';
|
|
54
|
+
case 'none':
|
|
55
|
+
return null;
|
|
56
|
+
default: {
|
|
57
|
+
const exhaustive = decision;
|
|
58
|
+
return exhaustive;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export function DiffStat({ additions, deletions, className, }) {
|
|
63
|
+
return (_jsxs("span", { className: cn('inline-flex shrink-0 gap-1 font-mono text-[10px] tabular-nums', className), "aria-label": `${additions} additions, ${deletions} deletions`, children: [_jsxs("span", { className: "text-status-completed", children: ["+", additions.toLocaleString()] }), _jsxs("span", { className: "text-status-failed", children: ["\u2212", deletions.toLocaleString()] })] }));
|
|
64
|
+
}
|
|
65
|
+
/** Five cells split by the add/delete ratio, the way GitHub summarizes a diff. */
|
|
66
|
+
export function DiffCells({ additions, deletions }) {
|
|
67
|
+
const total = additions + deletions;
|
|
68
|
+
const added = total === 0 ? 0 : Math.round((additions / total) * 5);
|
|
69
|
+
return (_jsx("span", { "aria-hidden": true, className: "inline-flex gap-0.5", children: Array.from({ length: 5 }, (_, index) => (_jsx("span", { className: cn('size-2 rounded-[2px]', total === 0 ? 'bg-muted' : index < added ? 'bg-status-completed' : 'bg-status-failed') }, index))) }));
|
|
70
|
+
}
|
|
71
|
+
export function laneTone(lane) {
|
|
72
|
+
switch (lane) {
|
|
73
|
+
case 'needs_review':
|
|
74
|
+
return 'bg-brand';
|
|
75
|
+
case 'reviewing':
|
|
76
|
+
return 'bg-status-running breathe';
|
|
77
|
+
case 'changes_requested':
|
|
78
|
+
return 'bg-status-waiting';
|
|
79
|
+
case 'ready':
|
|
80
|
+
return 'bg-status-completed';
|
|
81
|
+
case 'drafts':
|
|
82
|
+
case 'opened_by_shuttle':
|
|
83
|
+
return 'bg-muted-foreground/50';
|
|
84
|
+
default: {
|
|
85
|
+
const exhaustive = lane;
|
|
86
|
+
return exhaustive;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FolderSyncReport, RepoSyncReport } from '@swirls/shuttle/api';
|
|
2
|
+
import type { PullInboxData } from './pull-inbox.js';
|
|
3
|
+
export interface AccessSummary {
|
|
4
|
+
readonly blocked: readonly string[];
|
|
5
|
+
readonly failed: readonly RepoSyncReport[];
|
|
6
|
+
readonly missing: readonly string[];
|
|
7
|
+
readonly settingsUrl: string | null;
|
|
8
|
+
}
|
|
9
|
+
/** What the last sync could not see, or null when GitHub gave us everything. */
|
|
10
|
+
export declare function summarizeAccess(report: FolderSyncReport | null): AccessSummary | null;
|
|
11
|
+
export declare function PullInboxList({ data }: {
|
|
12
|
+
data: PullInboxData;
|
|
13
|
+
}): import("react").JSX.Element;
|