@saadnvd1/agent-os 0.3.778 → 0.3.780
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/app/api/live-shares/[id]/route.ts +21 -3
- package/app/api/live-shares/route.test.ts +36 -0
- package/app/api/live-shares/route.ts +14 -3
- package/components/Chat/Approval.tsx +13 -2
- package/components/Chat/EventRow.tsx +5 -0
- package/components/Chat/Queue.tsx +27 -15
- package/components/Live/DriveBanner.tsx +42 -0
- package/components/Live/InviteDialog.tsx +44 -13
- package/components/Live/LiveChip.tsx +34 -13
- package/components/Live/LivePanel.tsx +26 -9
- package/components/Live/LobbyCard.tsx +18 -21
- package/components/ui/segmented.tsx +2 -1
- package/data/live/queries.ts +25 -5
- package/lib/chat/driver.ts +4 -0
- package/lib/chat/drivers/claude-approvals.ts +93 -25
- package/lib/chat/drivers/claude.ts +2 -1
- package/lib/chat/events.ts +21 -1
- package/lib/chat/queued.ts +57 -10
- package/lib/chat/registry.ts +2 -0
- package/lib/chat/runner.ts +65 -2
- package/lib/chat/socket.ts +12 -9
- package/lib/chat/worker/gate-testing.ts +131 -0
- package/lib/chat/worker/guest-gate.ts +511 -0
- package/lib/chat/worker/host.ts +50 -6
- package/lib/chat/worker/main.ts +16 -2
- package/lib/chat/worker/protocol.ts +11 -0
- package/lib/connect/control-api.ts +6 -2
- package/lib/db/migrations/20261030T1200_live_share_level.ts +19 -0
- package/lib/db/migrations/20261030T1300_chat_guest_steers.ts +20 -0
- package/lib/db/migrations/20261030T1400_chat_guest_steers_ended.ts +14 -0
- package/lib/live/clean.ts +6 -0
- package/lib/live/drive.ts +398 -0
- package/lib/live/frames.ts +9 -2
- package/lib/live/inbox.ts +47 -1
- package/lib/live/levels.ts +74 -0
- package/lib/live/publisher.ts +10 -0
- package/lib/live/runtime.ts +20 -0
- package/lib/live/service.ts +133 -10
- package/lib/live/store.ts +54 -3
- package/lib/live/testing.ts +281 -0
- package/lib/live/types.ts +52 -0
- package/lib/share/connect.ts +1 -0
- package/package.json +1 -1
package/lib/live/types.ts
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
export type LiveLevel = "watch" | "suggest" | "drive";
|
|
2
|
+
|
|
3
|
+
/** The single source for what each level is called and what it lets a guest do. */
|
|
4
|
+
export const LEVELS: Record<LiveLevel, { label: string; hint: string }> = {
|
|
5
|
+
watch: {
|
|
6
|
+
label: "Watch",
|
|
7
|
+
hint: "Guests only watch. They can't send you anything.",
|
|
8
|
+
},
|
|
9
|
+
suggest: {
|
|
10
|
+
label: "Suggest",
|
|
11
|
+
hint: "Guests can suggest a prompt. Nothing reaches the agent unless you tap Send.",
|
|
12
|
+
},
|
|
13
|
+
drive: {
|
|
14
|
+
label: "Drive",
|
|
15
|
+
hint: "Guests can make the agent read this task's files. Everything else waits for you.",
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export interface LevelOption {
|
|
20
|
+
value: LiveLevel;
|
|
21
|
+
label: string;
|
|
22
|
+
hint: string;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
reason?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface GuestAction {
|
|
28
|
+
kind: "kick" | "admit" | "admit_drive" | "deny" | "give_wheel" | "take_back";
|
|
29
|
+
label: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type DriverState = "idle" | "queued" | "working" | "waiting_on_host";
|
|
33
|
+
|
|
1
34
|
// What the host's screens show of a live share (served by /api/live-shares).
|
|
2
35
|
export interface LiveView {
|
|
3
36
|
id: string;
|
|
@@ -9,6 +42,17 @@ export interface LiveView {
|
|
|
9
42
|
maxGuests: number;
|
|
10
43
|
connected: boolean;
|
|
11
44
|
notice: string | null;
|
|
45
|
+
level: LiveLevel;
|
|
46
|
+
levels: LevelOption[];
|
|
47
|
+
/** Whether the guests got the chat from before the link was made. */
|
|
48
|
+
history: boolean;
|
|
49
|
+
/** The guest holding the wheel on a Drive share. */
|
|
50
|
+
driver: { guestId: string; name: string; state: DriverState } | null;
|
|
51
|
+
/** Shown above the composer while a guest drives. */
|
|
52
|
+
banner: {
|
|
53
|
+
text: string;
|
|
54
|
+
action?: { kind: "take_back"; label: string };
|
|
55
|
+
} | null;
|
|
12
56
|
guests: {
|
|
13
57
|
id: string;
|
|
14
58
|
name: string;
|
|
@@ -16,6 +60,7 @@ export interface LiveView {
|
|
|
16
60
|
online: boolean;
|
|
17
61
|
/** Another guest here has the same name. */
|
|
18
62
|
duplicateName: boolean;
|
|
63
|
+
actions: GuestAction[];
|
|
19
64
|
}[];
|
|
20
65
|
suggestions: {
|
|
21
66
|
id: string;
|
|
@@ -33,7 +78,14 @@ export const EXPIRY_LABEL: Record<LiveExpiry, string> = {
|
|
|
33
78
|
session: "Until the session ends",
|
|
34
79
|
};
|
|
35
80
|
|
|
81
|
+
export interface LiveInvite {
|
|
82
|
+
levels: LevelOption[];
|
|
83
|
+
history: { label: string; default: boolean; count: number };
|
|
84
|
+
}
|
|
85
|
+
|
|
36
86
|
export interface LiveResponse {
|
|
37
87
|
linked: boolean;
|
|
38
88
|
shares: LiveView[];
|
|
89
|
+
/** Only when the request named a session. */
|
|
90
|
+
invite?: LiveInvite;
|
|
39
91
|
}
|
package/lib/share/connect.ts
CHANGED