@swirls/shuttle 0.0.0-stage → 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/CHANGELOG.md +10 -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 +64 -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,107 @@
|
|
|
1
|
+
import type { ArtifactTabKind, SessionTabsState, WorkspaceFolder, WorkspaceSession, WorkspaceTree } from '@swirls/shuttle/api';
|
|
2
|
+
import { type ShuttleHost } from '../../shuttle/index.js';
|
|
3
|
+
export type { ArtifactTab, ArtifactTabKind, GithubInstallation, LinkedRepo, SessionTabSet, SessionTabsState, WorkspaceFolder, WorkspaceSession, WorkspaceSnapshot, WorkspaceSnapshotResponse, WorkspaceTree, } from '@swirls/shuttle/api';
|
|
4
|
+
export declare const emptyWorkspaceTree: WorkspaceTree;
|
|
5
|
+
export declare const emptySessionTabs: SessionTabsState;
|
|
6
|
+
export declare const workspaceTree: import("@swirls/looms/core").ProjectionDefinition<{
|
|
7
|
+
folderOrder: readonly string[];
|
|
8
|
+
folders: Readonly<Record<string, {
|
|
9
|
+
folderId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
createdAt: number;
|
|
12
|
+
archived: boolean;
|
|
13
|
+
repos: readonly {
|
|
14
|
+
installationId: number;
|
|
15
|
+
owner: string;
|
|
16
|
+
name: string;
|
|
17
|
+
fullName: string;
|
|
18
|
+
defaultBranch: string;
|
|
19
|
+
private: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
autoReview?: "all" | "off" | "others" | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
sessions: Readonly<Record<string, {
|
|
24
|
+
runId: string;
|
|
25
|
+
folderId: string;
|
|
26
|
+
title: string;
|
|
27
|
+
goal: string;
|
|
28
|
+
status: string;
|
|
29
|
+
activity: string;
|
|
30
|
+
activitySeq?: number | undefined;
|
|
31
|
+
activityAt?: number | undefined;
|
|
32
|
+
lastCompletedAt?: number | undefined;
|
|
33
|
+
createdAt: number;
|
|
34
|
+
updatedAt: number;
|
|
35
|
+
archived: boolean;
|
|
36
|
+
ownerId?: string | null | undefined;
|
|
37
|
+
memberIds?: readonly string[] | undefined;
|
|
38
|
+
}>>;
|
|
39
|
+
installations: Readonly<Record<string, {
|
|
40
|
+
installationId: number;
|
|
41
|
+
account: {
|
|
42
|
+
login: string;
|
|
43
|
+
type: string;
|
|
44
|
+
avatarUrl: string;
|
|
45
|
+
};
|
|
46
|
+
}>>;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const sessionTabs: import("@swirls/looms/core").ProjectionDefinition<Readonly<Record<string, {
|
|
49
|
+
order: readonly string[];
|
|
50
|
+
tabs: Readonly<Record<string, {
|
|
51
|
+
tabId: string;
|
|
52
|
+
kind: "browser" | "changes" | "events" | "file" | "files" | "media" | "review" | "terminal" | `${string}:${string}`;
|
|
53
|
+
title: string;
|
|
54
|
+
target: string;
|
|
55
|
+
openedAt: number;
|
|
56
|
+
}>>;
|
|
57
|
+
}>>>;
|
|
58
|
+
/** Starts a session in a folder, on this machine when the desktop app has its sandbox up. */
|
|
59
|
+
export declare function startWorkspaceSession(host: ShuttleHost, input: {
|
|
60
|
+
folderId: string;
|
|
61
|
+
goal: string;
|
|
62
|
+
}): Promise<{
|
|
63
|
+
runId: string;
|
|
64
|
+
}>;
|
|
65
|
+
export declare function createWorkspaceFolder(host: ShuttleHost, runId: string, name: string): Promise<`${string}-${string}-${string}-${string}-${string}`>;
|
|
66
|
+
export declare function renameWorkspaceFolder(host: ShuttleHost, runId: string, folderId: string, name: string): Promise<void>;
|
|
67
|
+
export declare function archiveWorkspaceFolder(host: ShuttleHost, runId: string, folderId: string): Promise<void>;
|
|
68
|
+
export declare function openSessionTab(host: ShuttleHost, workspaceRunId: string, input: {
|
|
69
|
+
runId: string;
|
|
70
|
+
tabId: string;
|
|
71
|
+
kind: ArtifactTabKind;
|
|
72
|
+
title: string;
|
|
73
|
+
target: string;
|
|
74
|
+
at?: number;
|
|
75
|
+
}): Promise<void>;
|
|
76
|
+
export declare function closeSessionTab(host: ShuttleHost, workspaceRunId: string, input: {
|
|
77
|
+
runId: string;
|
|
78
|
+
tabId: string;
|
|
79
|
+
}): Promise<void>;
|
|
80
|
+
export declare function reorderSessionTabs(host: ShuttleHost, workspaceRunId: string, input: {
|
|
81
|
+
runId: string;
|
|
82
|
+
tabIds: string[];
|
|
83
|
+
}): Promise<void>;
|
|
84
|
+
export declare function retargetSessionTab(host: ShuttleHost, workspaceRunId: string, input: {
|
|
85
|
+
runId: string;
|
|
86
|
+
tabId: string;
|
|
87
|
+
title: string;
|
|
88
|
+
target: string;
|
|
89
|
+
}): Promise<void>;
|
|
90
|
+
/** Links repositories to a folder one after another, stopping at the first the Worker refuses. */
|
|
91
|
+
export declare function linkFolderRepos(host: ShuttleHost, folderId: string, repos: readonly {
|
|
92
|
+
installationId: number;
|
|
93
|
+
owner: string;
|
|
94
|
+
name: string;
|
|
95
|
+
}[]): Promise<void>;
|
|
96
|
+
export declare function sessionsForFolder(tree: WorkspaceTree, folderId: string, options?: {
|
|
97
|
+
includeArchived?: boolean;
|
|
98
|
+
}): WorkspaceSession[];
|
|
99
|
+
export declare function orderedFolders(tree: WorkspaceTree, options?: {
|
|
100
|
+
includeArchived?: boolean;
|
|
101
|
+
}): WorkspaceFolder[];
|
|
102
|
+
export declare function sessionStatusLabel(status: string): string;
|
|
103
|
+
export declare function repoCountLabel(count: number): string;
|
|
104
|
+
export declare function rememberLastFolder(folderId: string): void;
|
|
105
|
+
export declare function lastFolderId(): string | null;
|
|
106
|
+
/** The last folder the user worked in, else the first active one. */
|
|
107
|
+
export declare function preferredFolderId(tree: WorkspaceTree): string | null;
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import { defineProjection } from '@swirls/looms/core';
|
|
2
|
+
import {} from '../../shuttle/index.js';
|
|
3
|
+
import { mutateSessionTabs } from '../sessions/tab-set.js';
|
|
4
|
+
export const emptyWorkspaceTree = {
|
|
5
|
+
folderOrder: [],
|
|
6
|
+
folders: {},
|
|
7
|
+
sessions: {},
|
|
8
|
+
installations: {},
|
|
9
|
+
};
|
|
10
|
+
export const emptySessionTabs = {};
|
|
11
|
+
function activityEventSeq(payloadSeq, idempotencyKey) {
|
|
12
|
+
if (typeof payloadSeq === 'number' && Number.isFinite(payloadSeq)) {
|
|
13
|
+
return payloadSeq;
|
|
14
|
+
}
|
|
15
|
+
if (typeof idempotencyKey === 'string' && idempotencyKey.startsWith('activity:')) {
|
|
16
|
+
const tail = Number(idempotencyKey.slice(idempotencyKey.lastIndexOf(':') + 1));
|
|
17
|
+
if (Number.isFinite(tail)) {
|
|
18
|
+
return tail;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
function isStaleActivityEvent(session, seq, at) {
|
|
24
|
+
if (seq !== undefined && session.activitySeq !== undefined) {
|
|
25
|
+
return seq < session.activitySeq;
|
|
26
|
+
}
|
|
27
|
+
if (session.activityAt !== undefined) {
|
|
28
|
+
return at < session.activityAt;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
/** Reconcile corrections fix a stuck status; they are not new activity, so they never advance the clock. */
|
|
33
|
+
function activityEventAt(session, at, idempotencyKey) {
|
|
34
|
+
return typeof idempotencyKey === 'string' && idempotencyKey.startsWith('reconcile:')
|
|
35
|
+
? Math.min(at, session.updatedAt)
|
|
36
|
+
: at;
|
|
37
|
+
}
|
|
38
|
+
export const workspaceTree = defineProjection({
|
|
39
|
+
name: 'workspaceTree',
|
|
40
|
+
initialState: emptyWorkspaceTree,
|
|
41
|
+
reduce(state, event) {
|
|
42
|
+
switch (event.type) {
|
|
43
|
+
case 'workspace.folder.created': {
|
|
44
|
+
const payload = event.payload;
|
|
45
|
+
if (state.folders[payload.folderId]) {
|
|
46
|
+
return state;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
...state,
|
|
50
|
+
folderOrder: [...state.folderOrder, payload.folderId],
|
|
51
|
+
folders: {
|
|
52
|
+
...state.folders,
|
|
53
|
+
[payload.folderId]: {
|
|
54
|
+
folderId: payload.folderId,
|
|
55
|
+
name: payload.name,
|
|
56
|
+
createdAt: payload.createdAt,
|
|
57
|
+
archived: false,
|
|
58
|
+
repos: [],
|
|
59
|
+
autoReview: 'off',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
case 'workspace.folder.renamed': {
|
|
65
|
+
const payload = event.payload;
|
|
66
|
+
const folder = state.folders[payload.folderId];
|
|
67
|
+
if (!folder) {
|
|
68
|
+
return state;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
...state,
|
|
72
|
+
folders: {
|
|
73
|
+
...state.folders,
|
|
74
|
+
[payload.folderId]: { ...folder, name: payload.name },
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
case 'workspace.folder.auto_review.set': {
|
|
79
|
+
const payload = event.payload;
|
|
80
|
+
const folder = state.folders[payload.folderId];
|
|
81
|
+
if (!folder) {
|
|
82
|
+
return state;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
...state,
|
|
86
|
+
folders: {
|
|
87
|
+
...state.folders,
|
|
88
|
+
[payload.folderId]: { ...folder, autoReview: payload.autoReview },
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
case 'workspace.folder.archived': {
|
|
93
|
+
const payload = event.payload;
|
|
94
|
+
const folder = state.folders[payload.folderId];
|
|
95
|
+
if (!folder) {
|
|
96
|
+
return state;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
...state,
|
|
100
|
+
folders: {
|
|
101
|
+
...state.folders,
|
|
102
|
+
[payload.folderId]: { ...folder, archived: true },
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
case 'workspace.folder.reordered': {
|
|
107
|
+
const payload = event.payload;
|
|
108
|
+
const known = new Set(state.folderOrder);
|
|
109
|
+
const next = payload.folderIds.filter((id) => known.has(id));
|
|
110
|
+
const missing = state.folderOrder.filter((id) => !next.includes(id));
|
|
111
|
+
return { ...state, folderOrder: [...next, ...missing] };
|
|
112
|
+
}
|
|
113
|
+
case 'workspace.github.connected': {
|
|
114
|
+
const payload = event.payload;
|
|
115
|
+
return {
|
|
116
|
+
...state,
|
|
117
|
+
installations: {
|
|
118
|
+
...state.installations,
|
|
119
|
+
[String(payload.installationId)]: {
|
|
120
|
+
installationId: payload.installationId,
|
|
121
|
+
account: payload.account,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
case 'workspace.github.disconnected': {
|
|
127
|
+
const payload = event.payload;
|
|
128
|
+
const next = { ...state.installations };
|
|
129
|
+
delete next[String(payload.installationId)];
|
|
130
|
+
return { ...state, installations: next };
|
|
131
|
+
}
|
|
132
|
+
case 'workspace.repo.linked': {
|
|
133
|
+
const payload = event.payload;
|
|
134
|
+
const folder = state.folders[payload.folderId];
|
|
135
|
+
if (!folder) {
|
|
136
|
+
return state;
|
|
137
|
+
}
|
|
138
|
+
if (folder.repos.some((repo) => repo.fullName === payload.repo.fullName)) {
|
|
139
|
+
return state;
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
...state,
|
|
143
|
+
folders: {
|
|
144
|
+
...state.folders,
|
|
145
|
+
[payload.folderId]: {
|
|
146
|
+
...folder,
|
|
147
|
+
repos: [...folder.repos, payload.repo],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
case 'workspace.repo.unlinked': {
|
|
153
|
+
const payload = event.payload;
|
|
154
|
+
const folder = state.folders[payload.folderId];
|
|
155
|
+
if (!folder) {
|
|
156
|
+
return state;
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
...state,
|
|
160
|
+
folders: {
|
|
161
|
+
...state.folders,
|
|
162
|
+
[payload.folderId]: {
|
|
163
|
+
...folder,
|
|
164
|
+
repos: folder.repos.filter((repo) => repo.fullName !== payload.fullName),
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
case 'workspace.session.requested': {
|
|
170
|
+
const payload = event.payload;
|
|
171
|
+
if (state.sessions[payload.runId]) {
|
|
172
|
+
return state;
|
|
173
|
+
}
|
|
174
|
+
const now = typeof event.ts === 'number' && Number.isFinite(event.ts) ? event.ts : Date.now();
|
|
175
|
+
return {
|
|
176
|
+
...state,
|
|
177
|
+
sessions: {
|
|
178
|
+
...state.sessions,
|
|
179
|
+
[payload.runId]: {
|
|
180
|
+
runId: payload.runId,
|
|
181
|
+
folderId: payload.folderId,
|
|
182
|
+
title: payload.goal,
|
|
183
|
+
goal: payload.goal,
|
|
184
|
+
status: 'requested',
|
|
185
|
+
activity: 'idle',
|
|
186
|
+
createdAt: now,
|
|
187
|
+
updatedAt: now,
|
|
188
|
+
archived: false,
|
|
189
|
+
ownerId: payload.ownerId ?? null,
|
|
190
|
+
memberIds: [],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
case 'workspace.session.shared': {
|
|
196
|
+
const payload = event.payload;
|
|
197
|
+
const session = state.sessions[payload.runId];
|
|
198
|
+
if (!session) {
|
|
199
|
+
return state;
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
...state,
|
|
203
|
+
sessions: {
|
|
204
|
+
...state.sessions,
|
|
205
|
+
[payload.runId]: { ...session, memberIds: payload.memberIds },
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
case 'workspace.session.launched': {
|
|
210
|
+
const payload = event.payload;
|
|
211
|
+
const session = state.sessions[payload.runId];
|
|
212
|
+
if (!session) {
|
|
213
|
+
return state;
|
|
214
|
+
}
|
|
215
|
+
const at = typeof event.ts === 'number' && Number.isFinite(event.ts) ? event.ts : Date.now();
|
|
216
|
+
return {
|
|
217
|
+
...state,
|
|
218
|
+
sessions: {
|
|
219
|
+
...state.sessions,
|
|
220
|
+
[payload.runId]: {
|
|
221
|
+
...session,
|
|
222
|
+
status: 'running',
|
|
223
|
+
activity: 'working',
|
|
224
|
+
updatedAt: at,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
case 'workspace.session.renamed': {
|
|
230
|
+
const payload = event.payload;
|
|
231
|
+
const session = state.sessions[payload.runId];
|
|
232
|
+
if (!session) {
|
|
233
|
+
return state;
|
|
234
|
+
}
|
|
235
|
+
const at = typeof event.ts === 'number' && Number.isFinite(event.ts) ? event.ts : Date.now();
|
|
236
|
+
return {
|
|
237
|
+
...state,
|
|
238
|
+
sessions: {
|
|
239
|
+
...state.sessions,
|
|
240
|
+
[payload.runId]: {
|
|
241
|
+
...session,
|
|
242
|
+
title: payload.title,
|
|
243
|
+
updatedAt: at,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
case 'workspace.session.archived': {
|
|
249
|
+
const payload = event.payload;
|
|
250
|
+
const session = state.sessions[payload.runId];
|
|
251
|
+
if (!session) {
|
|
252
|
+
return state;
|
|
253
|
+
}
|
|
254
|
+
const at = typeof event.ts === 'number' && Number.isFinite(event.ts) ? event.ts : Date.now();
|
|
255
|
+
return {
|
|
256
|
+
...state,
|
|
257
|
+
sessions: {
|
|
258
|
+
...state.sessions,
|
|
259
|
+
[payload.runId]: {
|
|
260
|
+
...session,
|
|
261
|
+
archived: true,
|
|
262
|
+
updatedAt: at,
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
case 'workspace.session.activity': {
|
|
268
|
+
const payload = event.payload;
|
|
269
|
+
const session = state.sessions[payload.runId];
|
|
270
|
+
if (!session) {
|
|
271
|
+
return state;
|
|
272
|
+
}
|
|
273
|
+
const seq = activityEventSeq(payload.seq, event.idempotencyKey);
|
|
274
|
+
const at = activityEventAt(session, payload.at, event.idempotencyKey);
|
|
275
|
+
if (isStaleActivityEvent(session, seq, at)) {
|
|
276
|
+
return state;
|
|
277
|
+
}
|
|
278
|
+
const finishedWork = session.activity === 'working' && payload.activity === 'idle';
|
|
279
|
+
return {
|
|
280
|
+
...state,
|
|
281
|
+
sessions: {
|
|
282
|
+
...state.sessions,
|
|
283
|
+
[payload.runId]: {
|
|
284
|
+
...session,
|
|
285
|
+
activity: payload.activity,
|
|
286
|
+
activityAt: Math.max(session.activityAt ?? 0, at),
|
|
287
|
+
...(seq !== undefined
|
|
288
|
+
? { activitySeq: Math.max(session.activitySeq ?? 0, seq) }
|
|
289
|
+
: {}),
|
|
290
|
+
updatedAt: Math.max(session.updatedAt, at),
|
|
291
|
+
...(finishedWork ? { lastCompletedAt: at } : {}),
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
case 'runtime.child.settled': {
|
|
297
|
+
const payload = event.payload;
|
|
298
|
+
const runId = typeof payload.runId === 'string' ? payload.runId : null;
|
|
299
|
+
if (!runId) {
|
|
300
|
+
return state;
|
|
301
|
+
}
|
|
302
|
+
const session = state.sessions[runId];
|
|
303
|
+
if (!session) {
|
|
304
|
+
return state;
|
|
305
|
+
}
|
|
306
|
+
const nextStatus = payload.status ?? session.status;
|
|
307
|
+
const at = typeof event.ts === 'number' && Number.isFinite(event.ts) ? event.ts : Date.now();
|
|
308
|
+
return {
|
|
309
|
+
...state,
|
|
310
|
+
sessions: {
|
|
311
|
+
...state.sessions,
|
|
312
|
+
[runId]: {
|
|
313
|
+
...session,
|
|
314
|
+
status: nextStatus,
|
|
315
|
+
activity: nextStatus === 'failed' ? 'error' : 'idle',
|
|
316
|
+
updatedAt: at,
|
|
317
|
+
...(nextStatus === 'completed' ? { lastCompletedAt: at } : {}),
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
default:
|
|
323
|
+
return state;
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
export const sessionTabs = defineProjection({
|
|
328
|
+
name: 'sessionTabs',
|
|
329
|
+
initialState: emptySessionTabs,
|
|
330
|
+
reduce(state, event) {
|
|
331
|
+
switch (event.type) {
|
|
332
|
+
case 'workspace.tab.opened': {
|
|
333
|
+
const { runId, tabId, kind, title, target, at } = event.payload;
|
|
334
|
+
return mutateSessionTabs(state, runId, {
|
|
335
|
+
type: 'open',
|
|
336
|
+
tab: { tabId, kind, title, target, openedAt: at },
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
case 'workspace.tab.closed': {
|
|
340
|
+
return mutateSessionTabs(state, event.payload.runId, {
|
|
341
|
+
type: 'close',
|
|
342
|
+
tabId: event.payload.tabId,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
case 'workspace.tab.reordered': {
|
|
346
|
+
return mutateSessionTabs(state, event.payload.runId, {
|
|
347
|
+
type: 'reorder',
|
|
348
|
+
tabIds: event.payload.tabIds,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
case 'workspace.tab.retargeted': {
|
|
352
|
+
const { runId, tabId, title, target } = event.payload;
|
|
353
|
+
return mutateSessionTabs(state, runId, { type: 'retarget', tabId, title, target });
|
|
354
|
+
}
|
|
355
|
+
default:
|
|
356
|
+
return state;
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
/**
|
|
361
|
+
* On a host with a machine (the desktop app) a new session starts on this machine whenever its sandbox is up. It can be
|
|
362
|
+
* moved to the cloud from the session's title bar at any point after that.
|
|
363
|
+
*/
|
|
364
|
+
async function startsOnThisMachine(host) {
|
|
365
|
+
const app = host.device;
|
|
366
|
+
if (!app) {
|
|
367
|
+
return {};
|
|
368
|
+
}
|
|
369
|
+
const [runner, wanted] = await Promise.all([
|
|
370
|
+
app.runnerStatus().catch(() => null),
|
|
371
|
+
app.startsLocally().catch(() => true),
|
|
372
|
+
]);
|
|
373
|
+
return wanted && runner?.status === 'online' ? { deviceId: app.deviceId } : {};
|
|
374
|
+
}
|
|
375
|
+
/** Starts a session in a folder, on this machine when the desktop app has its sandbox up. */
|
|
376
|
+
export async function startWorkspaceSession(host, input) {
|
|
377
|
+
return host.client.workspace.createSession({ ...input, ...(await startsOnThisMachine(host)) });
|
|
378
|
+
}
|
|
379
|
+
export async function createWorkspaceFolder(host, runId, name) {
|
|
380
|
+
const folderId = crypto.randomUUID();
|
|
381
|
+
await host.signalRun(runId, 'workspace/createFolder', {
|
|
382
|
+
folderId,
|
|
383
|
+
name,
|
|
384
|
+
createdAt: Date.now(),
|
|
385
|
+
});
|
|
386
|
+
return folderId;
|
|
387
|
+
}
|
|
388
|
+
export async function renameWorkspaceFolder(host, runId, folderId, name) {
|
|
389
|
+
await host.signalRun(runId, 'workspace/renameFolder', { folderId, name });
|
|
390
|
+
}
|
|
391
|
+
export async function archiveWorkspaceFolder(host, runId, folderId) {
|
|
392
|
+
await host.signalRun(runId, 'workspace/archiveFolder', { folderId });
|
|
393
|
+
}
|
|
394
|
+
export async function openSessionTab(host, workspaceRunId, input) {
|
|
395
|
+
await host.signalRun(workspaceRunId, 'workspace/openTab', {
|
|
396
|
+
...input,
|
|
397
|
+
at: input.at ?? Date.now(),
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
export async function closeSessionTab(host, workspaceRunId, input) {
|
|
401
|
+
await host.signalRun(workspaceRunId, 'workspace/closeTab', input);
|
|
402
|
+
}
|
|
403
|
+
export async function reorderSessionTabs(host, workspaceRunId, input) {
|
|
404
|
+
await host.signalRun(workspaceRunId, 'workspace/reorderTabs', input);
|
|
405
|
+
}
|
|
406
|
+
export async function retargetSessionTab(host, workspaceRunId, input) {
|
|
407
|
+
await host.signalRun(workspaceRunId, 'workspace/retargetTab', input);
|
|
408
|
+
}
|
|
409
|
+
/** Links repositories to a folder one after another, stopping at the first the Worker refuses. */
|
|
410
|
+
export async function linkFolderRepos(host, folderId, repos) {
|
|
411
|
+
for (const repo of repos) {
|
|
412
|
+
await host.client.workspace.repos.link({
|
|
413
|
+
folderId,
|
|
414
|
+
installationId: repo.installationId,
|
|
415
|
+
owner: repo.owner,
|
|
416
|
+
name: repo.name,
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
export function sessionsForFolder(tree, folderId, options) {
|
|
421
|
+
return Object.values(tree.sessions)
|
|
422
|
+
.filter((session) => session.folderId === folderId && (options?.includeArchived || !session.archived))
|
|
423
|
+
.toSorted((left, right) => right.updatedAt - left.updatedAt);
|
|
424
|
+
}
|
|
425
|
+
export function orderedFolders(tree, options) {
|
|
426
|
+
return tree.folderOrder
|
|
427
|
+
.map((id) => tree.folders[id])
|
|
428
|
+
.filter((folder) => Boolean(folder))
|
|
429
|
+
.filter((folder) => options?.includeArchived || !folder.archived);
|
|
430
|
+
}
|
|
431
|
+
const SESSION_STATUS_LABELS = {
|
|
432
|
+
requested: 'Starting',
|
|
433
|
+
running: 'Running',
|
|
434
|
+
completed: 'Completed',
|
|
435
|
+
failed: 'Failed',
|
|
436
|
+
cancelled: 'Cancelled',
|
|
437
|
+
};
|
|
438
|
+
export function sessionStatusLabel(status) {
|
|
439
|
+
return SESSION_STATUS_LABELS[status] ?? status;
|
|
440
|
+
}
|
|
441
|
+
export function repoCountLabel(count) {
|
|
442
|
+
return count === 1 ? '1 linked repo' : `${count} linked repos`;
|
|
443
|
+
}
|
|
444
|
+
const LAST_FOLDER_KEY = 'shuttle.last-folder';
|
|
445
|
+
export function rememberLastFolder(folderId) {
|
|
446
|
+
localStorage.setItem(LAST_FOLDER_KEY, folderId);
|
|
447
|
+
}
|
|
448
|
+
export function lastFolderId() {
|
|
449
|
+
return localStorage.getItem(LAST_FOLDER_KEY);
|
|
450
|
+
}
|
|
451
|
+
/** The last folder the user worked in, else the first active one. */
|
|
452
|
+
export function preferredFolderId(tree) {
|
|
453
|
+
const remembered = lastFolderId();
|
|
454
|
+
if (remembered && tree.folders[remembered] && !tree.folders[remembered]?.archived) {
|
|
455
|
+
return remembered;
|
|
456
|
+
}
|
|
457
|
+
return orderedFolders(tree)[0]?.folderId ?? null;
|
|
458
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shuttle, as a library of React parts. A host makes a `ShuttleHost` for its backend, wraps
|
|
3
|
+
* its pages in `<Shuttle.Provider>`, and puts the parts together however it likes. Shuttle's
|
|
4
|
+
* own web app (`apps/web`) is one such host.
|
|
5
|
+
*
|
|
6
|
+
* `@swirls/shuttle/react/ui` has the plain controls the parts are drawn with, and
|
|
7
|
+
* `@swirls/shuttle/react/theme.css` the tokens and styles they need.
|
|
8
|
+
*/
|
|
9
|
+
export * from './parts/index.js';
|
|
10
|
+
export * from './shuttle/index.js';
|
|
11
|
+
export { SignInGate, useAgentGate, useStartPlace } from './features/connections/agent-sign-in.js';
|
|
12
|
+
export { ConnectionsPanel } from './features/connections/connections-panel.js';
|
|
13
|
+
export { connectionsQuery } from './features/connections/queries.js';
|
|
14
|
+
export { forgetEventCache } from './features/events/event-cache.js';
|
|
15
|
+
export { eventFamilies, eventMeta, familyColor } from './features/events/event-catalog.js';
|
|
16
|
+
export { EventInspector } from './features/events/event-inspector.js';
|
|
17
|
+
export { EventRow, type EventRowColumns } from './features/events/event-row.js';
|
|
18
|
+
export { type GlobalEventFrame, type GlobalRunKind, latestEventsQuery, useGlobalEvents, } from './features/events/global-events.js';
|
|
19
|
+
export { PlaybookPage } from './features/playbook/playbook-page.js';
|
|
20
|
+
export { playbookQuery } from './features/playbook/playbook-query.js';
|
|
21
|
+
export { PullInboxPanel, PullInboxSheetButton, usePullInbox } from './features/pulls/pull-inbox.js';
|
|
22
|
+
export { activitySnapshot, attentionChanges, attentionCount, attentionMessage, } from './features/sessions/attention.js';
|
|
23
|
+
export { HarnessSwitcher, useDefaultHarness } from './features/sessions/harness-switcher.js';
|
|
24
|
+
export { rememberSession } from './features/sessions/recent-sessions.js';
|
|
25
|
+
export { isSessionUnread, useSeenSessions } from './features/sessions/seen-sessions.js';
|
|
26
|
+
export { resolveSessionIndicator, sessionIndicatorLabel, } from './features/sessions/session-activity.js';
|
|
27
|
+
export { sessionQueries } from './features/sessions/session-queries.js';
|
|
28
|
+
export { ActivityDot } from './features/workspace/activity-dot.js';
|
|
29
|
+
export { AppSidebarShell } from './features/workspace/app-sidebar.js';
|
|
30
|
+
export { LinkRepoDialog } from './features/workspace/link-repo-dialog.js';
|
|
31
|
+
export { RepoChip } from './features/workspace/repo-chip.js';
|
|
32
|
+
export { createWorkspaceFolder, orderedFolders, preferredFolderId, rememberLastFolder, repoCountLabel, sessionsForFolder, startWorkspaceSession, type WorkspaceFolder, type WorkspaceTree, } from './features/workspace/workspace.js';
|
|
33
|
+
export { useWorkspace } from './features/workspace/workspace-context.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shuttle, as a library of React parts. A host makes a `ShuttleHost` for its backend, wraps
|
|
3
|
+
* its pages in `<Shuttle.Provider>`, and puts the parts together however it likes. Shuttle's
|
|
4
|
+
* own web app (`apps/web`) is one such host.
|
|
5
|
+
*
|
|
6
|
+
* `@swirls/shuttle/react/ui` has the plain controls the parts are drawn with, and
|
|
7
|
+
* `@swirls/shuttle/react/theme.css` the tokens and styles they need.
|
|
8
|
+
*/
|
|
9
|
+
export * from './parts/index.js';
|
|
10
|
+
export * from './shuttle/index.js';
|
|
11
|
+
// The pieces Shuttle's own pages are built from, beyond the session's parts. They are here
|
|
12
|
+
// because the app uses them, and stay until each becomes a part with a settled shape.
|
|
13
|
+
export { SignInGate, useAgentGate, useStartPlace } from './features/connections/agent-sign-in.js';
|
|
14
|
+
export { ConnectionsPanel } from './features/connections/connections-panel.js';
|
|
15
|
+
export { connectionsQuery } from './features/connections/queries.js';
|
|
16
|
+
export { forgetEventCache } from './features/events/event-cache.js';
|
|
17
|
+
export { eventFamilies, eventMeta, familyColor } from './features/events/event-catalog.js';
|
|
18
|
+
export { EventInspector } from './features/events/event-inspector.js';
|
|
19
|
+
export { EventRow } from './features/events/event-row.js';
|
|
20
|
+
export { latestEventsQuery, useGlobalEvents, } from './features/events/global-events.js';
|
|
21
|
+
export { PlaybookPage } from './features/playbook/playbook-page.js';
|
|
22
|
+
export { playbookQuery } from './features/playbook/playbook-query.js';
|
|
23
|
+
export { PullInboxPanel, PullInboxSheetButton, usePullInbox } from './features/pulls/pull-inbox.js';
|
|
24
|
+
export { activitySnapshot, attentionChanges, attentionCount, attentionMessage, } from './features/sessions/attention.js';
|
|
25
|
+
export { HarnessSwitcher, useDefaultHarness } from './features/sessions/harness-switcher.js';
|
|
26
|
+
export { rememberSession } from './features/sessions/recent-sessions.js';
|
|
27
|
+
export { isSessionUnread, useSeenSessions } from './features/sessions/seen-sessions.js';
|
|
28
|
+
export { resolveSessionIndicator, sessionIndicatorLabel, } from './features/sessions/session-activity.js';
|
|
29
|
+
export { sessionQueries } from './features/sessions/session-queries.js';
|
|
30
|
+
export { ActivityDot } from './features/workspace/activity-dot.js';
|
|
31
|
+
export { AppSidebarShell } from './features/workspace/app-sidebar.js';
|
|
32
|
+
export { LinkRepoDialog } from './features/workspace/link-repo-dialog.js';
|
|
33
|
+
export { RepoChip } from './features/workspace/repo-chip.js';
|
|
34
|
+
export { createWorkspaceFolder, orderedFolders, preferredFolderId, rememberLastFolder, repoCountLabel, sessionsForFolder, startWorkspaceSession, } from './features/workspace/workspace.js';
|
|
35
|
+
export { useWorkspace } from './features/workspace/workspace-context.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
|
+
import type { JsonValue } from '@swirls/looms/core';
|
|
3
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
+
export declare function shortId(id: string): string;
|
|
5
|
+
export declare function compactJson(value: JsonValue, limit?: number): string;
|
|
6
|
+
export declare function errorMessage(cause: unknown): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
export function cn(...inputs) {
|
|
4
|
+
return twMerge(clsx(inputs));
|
|
5
|
+
}
|
|
6
|
+
export function shortId(id) {
|
|
7
|
+
const cut = id.lastIndexOf('_');
|
|
8
|
+
const tail = cut >= 0 ? id.slice(cut + 1) : id;
|
|
9
|
+
return tail.length > 8 ? tail.slice(0, 8) : tail;
|
|
10
|
+
}
|
|
11
|
+
export function compactJson(value, limit = 96) {
|
|
12
|
+
const text = JSON.stringify(value);
|
|
13
|
+
if (text === undefined) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
return text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
|
|
17
|
+
}
|
|
18
|
+
export function errorMessage(cause) {
|
|
19
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Up to two initials for a person: the first and last word of their name, leaving out suffixes
|
|
3
|
+
* such as "III". A name that starts with an emoji is shown as that emoji alone, and a name that
|
|
4
|
+
* is only an email address uses the part before the `@`. Returns nothing when there is no name.
|
|
5
|
+
*/
|
|
6
|
+
export declare function initials(name: string | undefined): string;
|