@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,114 @@
|
|
|
1
|
+
import { oc } from '@orpc/contract';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { Ok } from './common.js';
|
|
4
|
+
import { AcpHarness, BuiltInHarness, HarnessId, Team, VendorModel } from './harness.js';
|
|
5
|
+
/** The agents offered on the Connections page: every built-in one that signs in with a vendor. */
|
|
6
|
+
export const ConnectableHarness = BuiltInHarness.exclude(['shuttle']);
|
|
7
|
+
/** An agent that runs in the sandbox under the developer's own subscription. */
|
|
8
|
+
export const VendorHarness = z.union([ConnectableHarness, AcpHarness]);
|
|
9
|
+
export const Connection = z.object({
|
|
10
|
+
harness: ConnectableHarness,
|
|
11
|
+
label: z.string(),
|
|
12
|
+
/** Signed in somewhere: in the cloud, on this machine, or both. */
|
|
13
|
+
connected: z.boolean(),
|
|
14
|
+
/** Signed in in the viewer's cloud sandbox. */
|
|
15
|
+
cloud: z.boolean(),
|
|
16
|
+
/** Signed in on this machine. Null outside the desktop app, where there is no machine. */
|
|
17
|
+
local: z.boolean().nullable(),
|
|
18
|
+
updatedAt: z.number().nullable(),
|
|
19
|
+
});
|
|
20
|
+
export const ConnectionsState = z.object({
|
|
21
|
+
/** Whether `local` was asked, which it is from the desktop app. */
|
|
22
|
+
machine: z.boolean(),
|
|
23
|
+
/** The harness new sessions start on. */
|
|
24
|
+
defaultHarness: HarnessId,
|
|
25
|
+
/** The team new Shuttle sessions start with. */
|
|
26
|
+
defaultTeam: Team,
|
|
27
|
+
/** Subscriptions need the container sandbox; `memory` cannot run the agents. */
|
|
28
|
+
mode: z.enum(['memory', 'container']),
|
|
29
|
+
/** False when the worker has no key to encrypt stored sign-ins with. */
|
|
30
|
+
canStore: z.boolean(),
|
|
31
|
+
connections: z.array(Connection).readonly(),
|
|
32
|
+
});
|
|
33
|
+
/** What new sessions start with. */
|
|
34
|
+
export const SessionDefaults = z.object({ defaultHarness: HarnessId, defaultTeam: Team });
|
|
35
|
+
/** Where an event sits in the sign-in's event file. `seq` starts at 1 and has no gaps. */
|
|
36
|
+
const LoginEventPosition = { seq: z.number(), at: z.number() };
|
|
37
|
+
/** What the vendor CLI said while signing in. */
|
|
38
|
+
export const LoginEvent = z.discriminatedUnion('type', [
|
|
39
|
+
z.object({
|
|
40
|
+
type: z.literal('login_prompt'),
|
|
41
|
+
url: z.string(),
|
|
42
|
+
/** A code to enter at `url`. Empty when the agent expects a code back instead. */
|
|
43
|
+
code: z.string(),
|
|
44
|
+
/** True when the user must paste a code from `url` back to the agent to finish. */
|
|
45
|
+
needsCode: z.boolean().optional(),
|
|
46
|
+
...LoginEventPosition,
|
|
47
|
+
}),
|
|
48
|
+
z.object({
|
|
49
|
+
type: z.literal('login_done'),
|
|
50
|
+
success: z.boolean(),
|
|
51
|
+
error: z.string().optional(),
|
|
52
|
+
...LoginEventPosition,
|
|
53
|
+
}),
|
|
54
|
+
]);
|
|
55
|
+
/** A sign-in's events from one offset on, and whether it has connected the agent. */
|
|
56
|
+
export const LoginProgress = z.object({
|
|
57
|
+
events: z.array(LoginEvent),
|
|
58
|
+
/** Pass this as `offset` on the next read. */
|
|
59
|
+
offset: z.number(),
|
|
60
|
+
/** True once the sign-in has ended. Nothing follows. */
|
|
61
|
+
done: z.boolean(),
|
|
62
|
+
connected: z.boolean(),
|
|
63
|
+
error: z.string().optional(),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* The agent a `/workspace/connections/{harness}/…` path names. Any text is accepted here so the
|
|
67
|
+
* Worker can answer 404 for an agent it does not know, as it does for any other missing thing.
|
|
68
|
+
*/
|
|
69
|
+
export const ConnectionParams = z.object({ harness: z.string().min(1) });
|
|
70
|
+
/** The sign-in a `/workspace/connections/{harness}/login/{loginId}/…` path names. */
|
|
71
|
+
export const LoginParams = ConnectionParams.extend({
|
|
72
|
+
loginId: z.string().regex(/^[A-Za-z0-9_-]{1,80}$/),
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Connecting a coding agent subscription. Sign-in is always the vendor CLI's own flow, run in a
|
|
76
|
+
* sandbox container: Shuttle shows the link or code the CLI prints and passes back what the CLI
|
|
77
|
+
* asks for.
|
|
78
|
+
*/
|
|
79
|
+
export const connectionsContract = {
|
|
80
|
+
list: oc.route({ method: 'GET', path: '/workspace/connections' }).output(ConnectionsState),
|
|
81
|
+
/** Sets the harness and team new sessions start with. Either may be left out to keep it. */
|
|
82
|
+
setDefault: oc
|
|
83
|
+
.route({ method: 'PUT', path: '/workspace/connections/default' })
|
|
84
|
+
.input(z.object({ harness: HarnessId.optional(), team: Team.optional() }))
|
|
85
|
+
.output(SessionDefaults),
|
|
86
|
+
disconnect: oc
|
|
87
|
+
.route({ method: 'DELETE', path: '/workspace/connections/{harness}' })
|
|
88
|
+
.input(ConnectionParams)
|
|
89
|
+
.output(z.object({ removed: z.boolean() })),
|
|
90
|
+
/** The models the agent offers. */
|
|
91
|
+
models: oc
|
|
92
|
+
.route({ method: 'GET', path: '/workspace/connections/{harness}/models' })
|
|
93
|
+
.input(ConnectionParams)
|
|
94
|
+
.output(z.object({ harness: VendorHarness, models: z.array(VendorModel).readonly() })),
|
|
95
|
+
login: {
|
|
96
|
+
start: oc
|
|
97
|
+
.route({ method: 'POST', path: '/workspace/connections/{harness}/login' })
|
|
98
|
+
.input(ConnectionParams)
|
|
99
|
+
.output(z.object({ loginId: z.string() })),
|
|
100
|
+
follow: oc
|
|
101
|
+
.route({ method: 'GET', path: '/workspace/connections/{harness}/login/{loginId}' })
|
|
102
|
+
.input(LoginParams.extend({ offset: z.coerce.number().int().min(0).optional() }))
|
|
103
|
+
.output(LoginProgress),
|
|
104
|
+
/** Passes back a code the vendor CLI asked for. */
|
|
105
|
+
sendCode: oc
|
|
106
|
+
.route({ method: 'POST', path: '/workspace/connections/{harness}/login/{loginId}/code' })
|
|
107
|
+
.input(LoginParams.extend({ code: z.string().trim().min(1) }))
|
|
108
|
+
.output(Ok),
|
|
109
|
+
cancel: oc
|
|
110
|
+
.route({ method: 'POST', path: '/workspace/connections/{harness}/login/{loginId}/cancel' })
|
|
111
|
+
.input(LoginParams)
|
|
112
|
+
.output(Ok),
|
|
113
|
+
},
|
|
114
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const githubContract: {
|
|
3
|
+
/**
|
|
4
|
+
* The repositories the organization's installations can reach, narrowed to those whose name or
|
|
5
|
+
* owner contains `q`. At most fifty are returned.
|
|
6
|
+
*/
|
|
7
|
+
repos: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
8
|
+
q: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
11
|
+
installationId: z.ZodNumber;
|
|
12
|
+
owner: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
fullName: z.ZodString;
|
|
15
|
+
defaultBranch: z.ZodString;
|
|
16
|
+
private: z.ZodBoolean;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
note: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { oc } from '@orpc/contract';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LinkedRepo } from './workspace.js';
|
|
4
|
+
export const githubContract = {
|
|
5
|
+
/**
|
|
6
|
+
* The repositories the organization's installations can reach, narrowed to those whose name or
|
|
7
|
+
* owner contains `q`. At most fifty are returned.
|
|
8
|
+
*/
|
|
9
|
+
repos: oc
|
|
10
|
+
.route({ method: 'GET', path: '/github/repos' })
|
|
11
|
+
.input(z.object({ q: z.string().optional() }))
|
|
12
|
+
.output(z.object({ repos: z.array(LinkedRepo), note: z.string().optional() })),
|
|
13
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BUILT_IN_HARNESSES: readonly ['shuttle', 'codex', 'claude-code', 'cursor'];
|
|
3
|
+
export declare const BuiltInHarness: z.ZodEnum<{
|
|
4
|
+
"claude-code": "claude-code";
|
|
5
|
+
codex: "codex";
|
|
6
|
+
cursor: "cursor";
|
|
7
|
+
shuttle: "shuttle";
|
|
8
|
+
}>;
|
|
9
|
+
export type BuiltInHarness = z.infer<typeof BuiltInHarness>;
|
|
10
|
+
/** An agent reached over the Agent Client Protocol, named by the deployment. */
|
|
11
|
+
export declare const AcpHarness: z.ZodTemplateLiteral<`acp:${string}`>;
|
|
12
|
+
export type AcpHarness = z.infer<typeof AcpHarness>;
|
|
13
|
+
/**
|
|
14
|
+
* Which agent runs a session. `shuttle` is the Looms loop on OpenRouter; every other harness is a
|
|
15
|
+
* vendor agent that runs in the sandbox under the developer's own subscription.
|
|
16
|
+
*/
|
|
17
|
+
export declare const HarnessId: z.ZodUnion<readonly [z.ZodEnum<{
|
|
18
|
+
"claude-code": "claude-code";
|
|
19
|
+
codex: "codex";
|
|
20
|
+
cursor: "cursor";
|
|
21
|
+
shuttle: "shuttle";
|
|
22
|
+
}>, z.ZodTemplateLiteral<`acp:${string}`>]>;
|
|
23
|
+
export type HarnessId = z.infer<typeof HarnessId>;
|
|
24
|
+
export type VendorHarnessId = Exclude<HarnessId, 'shuttle'>;
|
|
25
|
+
export declare const SessionHarness: z.ZodObject<{
|
|
26
|
+
harness: z.ZodUnion<readonly [z.ZodEnum<{
|
|
27
|
+
"claude-code": "claude-code";
|
|
28
|
+
codex: "codex";
|
|
29
|
+
cursor: "cursor";
|
|
30
|
+
shuttle: "shuttle";
|
|
31
|
+
}>, z.ZodTemplateLiteral<`acp:${string}`>]>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type SessionHarness = z.infer<typeof SessionHarness>;
|
|
34
|
+
export declare const TEAM_PRESETS: readonly ['none', 'codex-builds-claude-reviews', 'claude-builds-codex-reviews', 'claude-plans-codex-implements'];
|
|
35
|
+
export declare const TeamPreset: z.ZodEnum<{
|
|
36
|
+
"claude-builds-codex-reviews": "claude-builds-codex-reviews";
|
|
37
|
+
"claude-plans-codex-implements": "claude-plans-codex-implements";
|
|
38
|
+
"codex-builds-claude-reviews": "codex-builds-claude-reviews";
|
|
39
|
+
none: "none";
|
|
40
|
+
}>;
|
|
41
|
+
export type TeamPreset = z.infer<typeof TeamPreset>;
|
|
42
|
+
/** Who Shuttle's conductor may hand work to in a session. */
|
|
43
|
+
export declare const Team: z.ZodObject<{
|
|
44
|
+
workers: z.ZodBoolean;
|
|
45
|
+
codex: z.ZodBoolean;
|
|
46
|
+
claudeCode: z.ZodBoolean;
|
|
47
|
+
cursor: z.ZodBoolean;
|
|
48
|
+
preset: z.ZodEnum<{
|
|
49
|
+
"claude-builds-codex-reviews": "claude-builds-codex-reviews";
|
|
50
|
+
"claude-plans-codex-implements": "claude-plans-codex-implements";
|
|
51
|
+
"codex-builds-claude-reviews": "codex-builds-claude-reviews";
|
|
52
|
+
none: "none";
|
|
53
|
+
}>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type Team = z.infer<typeof Team>;
|
|
56
|
+
export declare const SessionTeam: z.ZodObject<{
|
|
57
|
+
team: z.ZodObject<{
|
|
58
|
+
workers: z.ZodBoolean;
|
|
59
|
+
codex: z.ZodBoolean;
|
|
60
|
+
claudeCode: z.ZodBoolean;
|
|
61
|
+
cursor: z.ZodBoolean;
|
|
62
|
+
preset: z.ZodEnum<{
|
|
63
|
+
"claude-builds-codex-reviews": "claude-builds-codex-reviews";
|
|
64
|
+
"claude-plans-codex-implements": "claude-plans-codex-implements";
|
|
65
|
+
"codex-builds-claude-reviews": "codex-builds-claude-reviews";
|
|
66
|
+
none: "none";
|
|
67
|
+
}>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export type SessionTeam = z.infer<typeof SessionTeam>;
|
|
71
|
+
/** A model a vendor agent offers under the developer's own subscription. */
|
|
72
|
+
export declare const VendorModel: z.ZodObject<{
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
label: z.ZodString;
|
|
75
|
+
description: z.ZodString;
|
|
76
|
+
efforts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
77
|
+
defaultEffort: z.ZodOptional<z.ZodString>;
|
|
78
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type VendorModel = z.infer<typeof VendorModel>;
|
|
81
|
+
/** Either part may be absent, which leaves that part to the agent's own default. */
|
|
82
|
+
export declare const VendorModelChoice: z.ZodObject<{
|
|
83
|
+
model: z.ZodOptional<z.ZodString>;
|
|
84
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type VendorModelChoice = z.infer<typeof VendorModelChoice>;
|
|
87
|
+
export declare const VendorModelChoices: z.ZodRecord<z.ZodString & z.core.$partial, z.ZodObject<{
|
|
88
|
+
model: z.ZodOptional<z.ZodString>;
|
|
89
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
export type VendorModelChoices = Partial<Record<VendorHarnessId, VendorModelChoice>>;
|
|
92
|
+
export declare const SessionVendorModels: z.ZodObject<{
|
|
93
|
+
choices: z.ZodRecord<z.ZodString & z.core.$partial, z.ZodObject<{
|
|
94
|
+
model: z.ZodOptional<z.ZodString>;
|
|
95
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>>;
|
|
97
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const BUILT_IN_HARNESSES = ['shuttle', 'codex', 'claude-code', 'cursor'];
|
|
3
|
+
export const BuiltInHarness = z.enum(BUILT_IN_HARNESSES);
|
|
4
|
+
/** An agent reached over the Agent Client Protocol, named by the deployment. */
|
|
5
|
+
export const AcpHarness = z.templateLiteral(['acp:', z.string().regex(/^[a-z0-9][a-z0-9-]{0,39}$/)]);
|
|
6
|
+
/**
|
|
7
|
+
* Which agent runs a session. `shuttle` is the Looms loop on OpenRouter; every other harness is a
|
|
8
|
+
* vendor agent that runs in the sandbox under the developer's own subscription.
|
|
9
|
+
*/
|
|
10
|
+
export const HarnessId = z.union([BuiltInHarness, AcpHarness]);
|
|
11
|
+
export const SessionHarness = z.object({ harness: HarnessId });
|
|
12
|
+
export const TEAM_PRESETS = [
|
|
13
|
+
'none',
|
|
14
|
+
'codex-builds-claude-reviews',
|
|
15
|
+
'claude-builds-codex-reviews',
|
|
16
|
+
'claude-plans-codex-implements',
|
|
17
|
+
];
|
|
18
|
+
export const TeamPreset = z.enum(TEAM_PRESETS);
|
|
19
|
+
/** Who Shuttle's conductor may hand work to in a session. */
|
|
20
|
+
export const Team = z.object({
|
|
21
|
+
/** Shuttle's own workers, on OpenRouter. */
|
|
22
|
+
workers: z.boolean(),
|
|
23
|
+
codex: z.boolean(),
|
|
24
|
+
claudeCode: z.boolean(),
|
|
25
|
+
cursor: z.boolean(),
|
|
26
|
+
/** Standing roles for the agents, or `none` to let the conductor decide. */
|
|
27
|
+
preset: TeamPreset,
|
|
28
|
+
});
|
|
29
|
+
export const SessionTeam = z.object({ team: Team });
|
|
30
|
+
/** A model a vendor agent offers under the developer's own subscription. */
|
|
31
|
+
export const VendorModel = z.object({
|
|
32
|
+
id: z.string(),
|
|
33
|
+
label: z.string(),
|
|
34
|
+
description: z.string(),
|
|
35
|
+
/** Reasoning efforts the model accepts, lowest first. Empty when it takes none. */
|
|
36
|
+
efforts: z.array(z.string()).readonly(),
|
|
37
|
+
defaultEffort: z.string().optional(),
|
|
38
|
+
/** True for the model the agent uses when none is chosen. */
|
|
39
|
+
isDefault: z.boolean().optional(),
|
|
40
|
+
});
|
|
41
|
+
/** Either part may be absent, which leaves that part to the agent's own default. */
|
|
42
|
+
export const VendorModelChoice = z.object({
|
|
43
|
+
model: z.string().optional(),
|
|
44
|
+
effort: z.string().optional(),
|
|
45
|
+
});
|
|
46
|
+
export const VendorModelChoices = z.partialRecord(z.string(), VendorModelChoice);
|
|
47
|
+
export const SessionVendorModels = z.object({ choices: VendorModelChoices });
|