paseo-office 0.2.0 → 0.2.2
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/OVERVIEW.md +27 -0
- package/README.md +65 -134
- package/client/action-button.tsx +4 -1
- package/client/activity-panel.tsx +6 -4
- package/client/agent-appearance.tsx +257 -0
- package/client/agent-card.tsx +2 -1
- package/client/agent-picker-text.ts +23 -4
- package/client/agent-picker.tsx +5 -8
- package/client/board-sheet.tsx +48 -16
- package/client/board-text.ts +12 -2
- package/client/brand.ts +1 -0
- package/client/chat-chrome.tsx +318 -0
- package/client/chat-compose-tools.tsx +314 -0
- package/client/chat-dictation.tsx +133 -0
- package/client/chat-more.tsx +119 -0
- package/client/chat-panel.tsx +401 -146
- package/client/chat-quick.tsx +198 -0
- package/client/chat-text.ts +25 -6
- package/client/column-sheet.tsx +93 -23
- package/client/conversation-model.ts +19 -5
- package/client/duty-sheet.tsx +321 -0
- package/client/duty-text.ts +20 -0
- package/client/fullscreen-header.tsx +28 -13
- package/client/fullscreen-theme.ts +38 -0
- package/client/host-details.tsx +269 -0
- package/client/host-styles.ts +129 -0
- package/client/host-switches.tsx +212 -83
- package/client/incidents-card.tsx +2 -1
- package/client/janitor-card.tsx +1 -1
- package/client/library-card.tsx +2 -1
- package/client/list-text.ts +8 -6
- package/client/lobby-board.tsx +73 -53
- package/client/machine-card.tsx +225 -85
- package/client/messenger-styles.ts +216 -0
- package/client/new-agent-form.tsx +153 -61
- package/client/new-agent-model.ts +2 -0
- package/client/notes-card.tsx +111 -83
- package/client/notes-days.tsx +1 -1
- package/client/office-brand-context.ts +44 -0
- package/client/office-column.tsx +2 -1
- package/client/office-keyboard.ts +79 -0
- package/client/office-link.ts +7 -1
- package/client/office-mark.tsx +29 -0
- package/client/office-modal.tsx +440 -0
- package/client/office-settings.tsx +75 -30
- package/client/office-state.ts +12 -2
- package/client/office-surface.tsx +591 -81
- package/client/pixel/actors.ts +2 -1
- package/client/pixel/art.ts +33 -19
- package/client/pixel/pixel-office.tsx +2 -2
- package/client/prompt-coach.tsx +152 -0
- package/client/qa-card.tsx +2 -1
- package/client/review-card.tsx +2 -1
- package/client/room-board.tsx +26 -2
- package/client/scene-picker.tsx +158 -0
- package/client/scene-previews.ts +10 -0
- package/client/session-pane.tsx +25 -5
- package/client/session-panel-detail.tsx +238 -0
- package/client/session-panel.tsx +222 -137
- package/client/session-styles.ts +224 -1
- package/client/session-transcript.tsx +243 -0
- package/client/sessions-panel.tsx +181 -22
- package/client/sessions-text.ts +18 -0
- package/client/settings-sections.tsx +126 -0
- package/client/sidebar-launcher.ts +29 -0
- package/client/ssh-hosts.tsx +331 -0
- package/client/ssh-metrics.ts +76 -0
- package/client/standup-card.tsx +2 -1
- package/client/structure-view.tsx +20 -3
- package/client/styles.ts +170 -62
- package/client/team-chat-preview.tsx +96 -0
- package/client/tracker-connections.tsx +252 -0
- package/client/transcript-styles.ts +90 -0
- package/client/use-device-switch.ts +21 -12
- package/client/use-duty-actions.ts +43 -0
- package/client/use-group-photo.ts +48 -0
- package/client/use-new-agent.ts +4 -0
- package/client/use-street.ts +8 -0
- package/client/workspace-office-tools.tsx +102 -0
- package/client/workspace-overlay-route.web.ts +47 -0
- package/client/workspace-overlay.tsx +195 -0
- package/client/world/adapter.ts +37 -2
- package/client/world/escape.ts +58 -0
- package/client/world/use-world-feed.ts +6 -2
- package/client/world/workspace-dock.ts +6 -0
- package/client/world/world-api.ts +45 -4
- package/client/world/world-bridge-page.ts +14 -3
- package/client/world/world-bridge.ts +50 -5
- package/client/world/world-frame.web.ts +8 -0
- package/client/world/world-view-native.tsx +31 -10
- package/client/world/world-view-shared.ts +36 -7
- package/client/world/world-view.tsx +93 -21
- package/docs/office.md +165 -64
- package/index.client.tsx +13 -6
- package/index.server.ts +232 -16
- package/package.json +2 -1
- package/server/activity.ts +42 -19
- package/server/agent-tools.ts +11 -5
- package/server/board-service.ts +381 -10
- package/server/brand-logo.ts +34 -0
- package/server/chat-group.ts +83 -0
- package/server/chat-service.ts +406 -62
- package/server/chat-store.ts +1 -4
- package/server/directory.ts +22 -7
- package/server/duty-service.ts +230 -0
- package/server/group-photo.ts +39 -0
- package/server/home-departure.ts +47 -0
- package/server/hub.ts +43 -1
- package/server/incidents-jira.ts +19 -7
- package/server/incidents-schedule.ts +10 -10
- package/server/incidents-sentry.ts +34 -8
- package/server/live-ports.ts +114 -18
- package/server/lobby-pickup.ts +170 -0
- package/server/machine/details.ts +91 -0
- package/server/mention-queue.ts +14 -0
- package/server/office.ts +110 -6
- package/server/paths.ts +14 -0
- package/server/ssh/LICENSE.paseo +211 -0
- package/server/ssh/client.ts +401 -0
- package/server/ssh/discovery.ts +230 -0
- package/server/ssh/installed.ts +104 -0
- package/server/ssh/monitor.ts +104 -0
- package/server/ssh/pid-files.ts +194 -0
- package/server/ssh/read.ts +136 -0
- package/server/subagent-names.ts +4 -0
- package/server/tracker-credentials.ts +141 -0
- package/server/words.generated.ts +1 -1
- package/server/world.generated.ts +1 -1
- package/shared/appearance.ts +43 -0
- package/shared/branding.ts +53 -0
- package/shared/chat-words.ts +2 -2
- package/shared/contracts.ts +199 -5
- package/shared/duties.ts +100 -0
- package/shared/host-details.ts +25 -0
- package/shared/lobby-assignment.ts +34 -0
- package/shared/model.ts +9 -1
- package/shared/names.ts +2 -0
- package/shared/settings.ts +14 -3
- package/shared/ssh.ts +34 -0
- package/shared/upstream/README.md +1 -3
- package/shared/upstream/chat-engine.d.ts +4 -0
- package/shared/upstream/prompt-coach.d.ts +6 -0
- package/shared/upstream/prompt-coach.js +178 -0
package/client/session-pane.tsx
CHANGED
|
@@ -30,7 +30,7 @@ export interface SessionContext extends SessionPaneContext {
|
|
|
30
30
|
/** What a pane takes from the surface, the same for every session; never the office model. */
|
|
31
31
|
export interface SessionPaneContext {
|
|
32
32
|
actions: AgentActions;
|
|
33
|
-
|
|
33
|
+
showWorkspace?(agentId: string): void;
|
|
34
34
|
closeSession(agentId: string): void;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -46,8 +46,16 @@ export function sessionOf(
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
export function sessionChildren(model: OfficeModel, agentId: string): OfficeAgent[] {
|
|
50
|
+
return [...model.agents.values()].filter((agent) => agent.parentAgentId === agentId);
|
|
51
|
+
}
|
|
52
|
+
|
|
49
53
|
export interface SessionPaneProps {
|
|
50
54
|
agentId: string;
|
|
55
|
+
hideClose?: boolean;
|
|
56
|
+
inSheet?: boolean;
|
|
57
|
+
subagents?: readonly OfficeAgent[];
|
|
58
|
+
onOpenSubagent?(id: string): void;
|
|
51
59
|
/** The agent as the office lists it; null when it does not. */
|
|
52
60
|
agent: OfficeAgent | null;
|
|
53
61
|
room: string | null;
|
|
@@ -67,11 +75,15 @@ function samePane(before: SessionPaneProps, after: SessionPaneProps): boolean {
|
|
|
67
75
|
return (
|
|
68
76
|
before.agentId === after.agentId &&
|
|
69
77
|
before.room === after.room &&
|
|
78
|
+
before.inSheet === after.inSheet &&
|
|
79
|
+
before.hideClose === after.hideClose &&
|
|
70
80
|
before.reply === after.reply &&
|
|
71
81
|
before.setReply === after.setReply &&
|
|
72
82
|
before.context.actions === after.context.actions &&
|
|
73
|
-
before.context.
|
|
83
|
+
before.context.showWorkspace === after.context.showWorkspace &&
|
|
74
84
|
before.context.closeSession === after.context.closeSession &&
|
|
85
|
+
before.onOpenSubagent === after.onOpenSubagent &&
|
|
86
|
+
JSON.stringify(before.subagents) === JSON.stringify(after.subagents) &&
|
|
75
87
|
before.styles === after.styles &&
|
|
76
88
|
before.layout === after.layout &&
|
|
77
89
|
JSON.stringify(before.agent) === JSON.stringify(after.agent)
|
|
@@ -81,6 +93,10 @@ function samePane(before: SessionPaneProps, after: SessionPaneProps): boolean {
|
|
|
81
93
|
/** One open session as the column or the sheet shows it. */
|
|
82
94
|
export const SessionPane = memo(function SessionPane({
|
|
83
95
|
agentId,
|
|
96
|
+
hideClose,
|
|
97
|
+
inSheet,
|
|
98
|
+
subagents,
|
|
99
|
+
onOpenSubagent,
|
|
84
100
|
agent,
|
|
85
101
|
room,
|
|
86
102
|
reply,
|
|
@@ -89,14 +105,14 @@ export const SessionPane = memo(function SessionPane({
|
|
|
89
105
|
styles,
|
|
90
106
|
layout,
|
|
91
107
|
}: SessionPaneProps) {
|
|
92
|
-
const { actions,
|
|
108
|
+
const { actions, showWorkspace, closeSession } = context;
|
|
93
109
|
const draft = useMemo(
|
|
94
110
|
() => ({ text: reply, setText: (next: SetStateAction<string>) => setReply(agentId, next) }),
|
|
95
111
|
[reply, setReply, agentId],
|
|
96
112
|
);
|
|
97
113
|
const onOpenWorkspace = useMemo(
|
|
98
|
-
() => (
|
|
99
|
-
[
|
|
114
|
+
() => (showWorkspace ? () => showWorkspace(agentId) : undefined),
|
|
115
|
+
[showWorkspace, agentId],
|
|
100
116
|
);
|
|
101
117
|
const onClose = useCallback(() => closeSession(agentId), [closeSession, agentId]);
|
|
102
118
|
return (
|
|
@@ -105,11 +121,15 @@ export const SessionPane = memo(function SessionPane({
|
|
|
105
121
|
agent={agent}
|
|
106
122
|
agentId={agentId}
|
|
107
123
|
room={room}
|
|
124
|
+
subagents={subagents}
|
|
125
|
+
onOpenSubagent={onOpenSubagent}
|
|
108
126
|
draft={draft}
|
|
109
127
|
actions={actions}
|
|
110
128
|
styles={styles}
|
|
111
129
|
layout={layout}
|
|
112
130
|
onOpenWorkspace={onOpenWorkspace}
|
|
131
|
+
hideClose={hideClose}
|
|
132
|
+
inSheet={inSheet}
|
|
113
133
|
onClose={onClose}
|
|
114
134
|
/>
|
|
115
135
|
);
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { AVATARS, shirtColor } from "../shared/appearance.js";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { Pressable, Text, View, type PressableStateCallbackType } from "react-native";
|
|
4
|
+
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
5
|
+
import type { OfficeAgent } from "../shared/contracts.js";
|
|
6
|
+
import { agentTask, agentTitle, dotTone } from "../shared/model.js";
|
|
7
|
+
import { stateLabel } from "./agent-card.js";
|
|
8
|
+
import { contextLine, contextPercent } from "./context-text.js";
|
|
9
|
+
import { costText } from "./list-text.js";
|
|
10
|
+
import { avatarInitials } from "./sessions-text.js";
|
|
11
|
+
import { statusLine } from "./session-text.js";
|
|
12
|
+
import type { OfficeStyles } from "./styles.js";
|
|
13
|
+
|
|
14
|
+
export function SessionHeading({
|
|
15
|
+
agent,
|
|
16
|
+
room,
|
|
17
|
+
styles,
|
|
18
|
+
}: {
|
|
19
|
+
agent: OfficeAgent;
|
|
20
|
+
room: string | null;
|
|
21
|
+
styles: OfficeStyles;
|
|
22
|
+
}) {
|
|
23
|
+
const name = agentTitle(agent);
|
|
24
|
+
const borderColor = shirtColor(agent.appearance);
|
|
25
|
+
const avatarStyle = useMemo(
|
|
26
|
+
() => [styles.sessions.identityAvatar, borderColor && { borderColor, borderWidth: 2 }],
|
|
27
|
+
[styles.sessions.identityAvatar, borderColor],
|
|
28
|
+
);
|
|
29
|
+
return (
|
|
30
|
+
<View style={styles.sessions.identityLead}>
|
|
31
|
+
<View style={avatarStyle} aria-hidden>
|
|
32
|
+
<Text style={styles.sessions.initials}>
|
|
33
|
+
{agent.appearance?.avatar ? AVATARS[agent.appearance.avatar] : avatarInitials(name)}
|
|
34
|
+
</Text>
|
|
35
|
+
<View style={styles.sessions.badge}>
|
|
36
|
+
<View style={styles.dot[dotTone(agent)]} />
|
|
37
|
+
</View>
|
|
38
|
+
</View>
|
|
39
|
+
<View style={styles.sessions.identityText}>
|
|
40
|
+
<Text accessibilityRole="header" style={styles.sessions.identityName} numberOfLines={2}>
|
|
41
|
+
{name}
|
|
42
|
+
</Text>
|
|
43
|
+
<Text numberOfLines={2} style={styles.chatMeta}>
|
|
44
|
+
{statusLine(agent, room)}
|
|
45
|
+
</Text>
|
|
46
|
+
</View>
|
|
47
|
+
</View>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function SessionMetadata({ agent, styles }: { agent: OfficeAgent; styles: OfficeStyles }) {
|
|
52
|
+
const context = contextPercent(agent);
|
|
53
|
+
const cost = agent.costUsd === 0 ? "$0.00" : costText(agent.costUsd);
|
|
54
|
+
const fill = useMemo(
|
|
55
|
+
() => [styles.sessions.contextGauge, { width: `${context ?? 0}%` as const }],
|
|
56
|
+
[context, styles],
|
|
57
|
+
);
|
|
58
|
+
return (
|
|
59
|
+
<View style={styles.sessions.metadata}>
|
|
60
|
+
<View style={styles.sessions.metaChip}>
|
|
61
|
+
<Text style={styles.sessions.caption}>{agent.model ? "Model" : "Provider"}</Text>
|
|
62
|
+
<Text style={styles.sessions.metaValue} numberOfLines={2} selectable>
|
|
63
|
+
{agent.model || agent.provider}
|
|
64
|
+
</Text>
|
|
65
|
+
</View>
|
|
66
|
+
{context !== null && (
|
|
67
|
+
<View
|
|
68
|
+
style={styles.sessions.metaChip}
|
|
69
|
+
accessible
|
|
70
|
+
accessibilityLabel={contextLine(agent) ?? undefined}
|
|
71
|
+
>
|
|
72
|
+
<Text style={styles.sessions.caption}>Context</Text>
|
|
73
|
+
<View style={styles.sessions.contextTrack} aria-hidden>
|
|
74
|
+
<View style={fill} />
|
|
75
|
+
</View>
|
|
76
|
+
<Text style={styles.sessions.metaValue}>{context}%</Text>
|
|
77
|
+
</View>
|
|
78
|
+
)}
|
|
79
|
+
{cost !== null && (
|
|
80
|
+
<View style={styles.sessions.metaChip}>
|
|
81
|
+
<Text style={styles.sessions.caption}>Cost</Text>
|
|
82
|
+
<Text style={styles.sessions.metaValue}>{cost}</Text>
|
|
83
|
+
</View>
|
|
84
|
+
)}
|
|
85
|
+
</View>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function SessionButton({
|
|
90
|
+
icon,
|
|
91
|
+
label,
|
|
92
|
+
onPress,
|
|
93
|
+
styles,
|
|
94
|
+
primary = false,
|
|
95
|
+
caption,
|
|
96
|
+
expanded,
|
|
97
|
+
disabled = false,
|
|
98
|
+
}: {
|
|
99
|
+
icon: string;
|
|
100
|
+
label: string;
|
|
101
|
+
onPress(): void;
|
|
102
|
+
styles: OfficeStyles;
|
|
103
|
+
primary?: boolean;
|
|
104
|
+
caption?: "plain" | "button";
|
|
105
|
+
expanded?: boolean;
|
|
106
|
+
disabled?: boolean;
|
|
107
|
+
}) {
|
|
108
|
+
const buttonStyle = useCallback(
|
|
109
|
+
({ pressed }: PressableStateCallbackType) => {
|
|
110
|
+
const palette = styles.sessions;
|
|
111
|
+
if (caption === "button") return pressed ? palette.workspacePressed : palette.workspaceButton;
|
|
112
|
+
if (caption) return palette.deskLink;
|
|
113
|
+
if (!primary) return pressed ? palette.deskActionPressed : palette.deskAction;
|
|
114
|
+
if (disabled) return palette.sendDisabled;
|
|
115
|
+
return pressed ? palette.sendPressed : palette.send;
|
|
116
|
+
},
|
|
117
|
+
[primary, disabled, caption, styles],
|
|
118
|
+
);
|
|
119
|
+
const color = primary && !disabled ? String(styles.buttonPrimaryText.color) : styles.iconColor;
|
|
120
|
+
return (
|
|
121
|
+
<Pressable
|
|
122
|
+
accessibilityRole="button"
|
|
123
|
+
accessibilityLabel={label}
|
|
124
|
+
aria-expanded={expanded}
|
|
125
|
+
disabled={disabled}
|
|
126
|
+
onPress={onPress}
|
|
127
|
+
style={buttonStyle}
|
|
128
|
+
>
|
|
129
|
+
<Icon name={icon} size={caption ? 15 : 18} color={color} />
|
|
130
|
+
{caption && <Text style={styles.sessions.deskLinkLabel}>{label}</Text>}
|
|
131
|
+
</Pressable>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export type SessionDetailTab = "chat" | "steps" | "subagents";
|
|
136
|
+
const detailTabs = [
|
|
137
|
+
{ id: "chat", label: "Chat", icon: "MessageCircle" },
|
|
138
|
+
{ id: "steps", label: "Steps", icon: "ListChecks" },
|
|
139
|
+
{ id: "subagents", label: "Subagents", icon: "UsersRound" },
|
|
140
|
+
] as const;
|
|
141
|
+
|
|
142
|
+
export function SessionDetailTabs({
|
|
143
|
+
tab,
|
|
144
|
+
setTab,
|
|
145
|
+
childCount,
|
|
146
|
+
styles,
|
|
147
|
+
}: {
|
|
148
|
+
tab: SessionDetailTab;
|
|
149
|
+
setTab(tab: SessionDetailTab): void;
|
|
150
|
+
childCount?: number;
|
|
151
|
+
styles: OfficeStyles;
|
|
152
|
+
}) {
|
|
153
|
+
return (
|
|
154
|
+
<View style={styles.sessions.detailTabs} role="group" aria-label="Session details">
|
|
155
|
+
{detailTabs.map((item) =>
|
|
156
|
+
item.id === "subagents" && childCount === undefined ? null : (
|
|
157
|
+
<DetailTab
|
|
158
|
+
key={item.id}
|
|
159
|
+
item={item}
|
|
160
|
+
selected={tab === item.id}
|
|
161
|
+
onSelect={setTab}
|
|
162
|
+
count={item.id === "subagents" ? childCount : undefined}
|
|
163
|
+
styles={styles}
|
|
164
|
+
/>
|
|
165
|
+
),
|
|
166
|
+
)}
|
|
167
|
+
</View>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function DetailTab({
|
|
172
|
+
item,
|
|
173
|
+
selected,
|
|
174
|
+
onSelect,
|
|
175
|
+
count,
|
|
176
|
+
styles,
|
|
177
|
+
}: {
|
|
178
|
+
item: (typeof detailTabs)[number];
|
|
179
|
+
selected: boolean;
|
|
180
|
+
onSelect(tab: SessionDetailTab): void;
|
|
181
|
+
count?: number;
|
|
182
|
+
styles: OfficeStyles;
|
|
183
|
+
}) {
|
|
184
|
+
const press = useCallback(() => onSelect(item.id), [item.id, onSelect]);
|
|
185
|
+
const tabStyle = useMemo(
|
|
186
|
+
() => [styles.sessions.detailTab, selected && styles.sessions.detailTabActive],
|
|
187
|
+
[styles, selected],
|
|
188
|
+
);
|
|
189
|
+
const label = selected ? styles.sessions.detailLabelActive : styles.sessions.detailLabel;
|
|
190
|
+
return (
|
|
191
|
+
<Pressable
|
|
192
|
+
accessibilityRole="button"
|
|
193
|
+
accessibilityLabel={`Session ${item.id}`}
|
|
194
|
+
aria-pressed={selected}
|
|
195
|
+
onPress={press}
|
|
196
|
+
style={tabStyle}
|
|
197
|
+
>
|
|
198
|
+
<Icon name={item.icon} size={14} color={String(label.color)} />
|
|
199
|
+
<Text numberOfLines={1} style={label}>
|
|
200
|
+
{item.label}
|
|
201
|
+
{count ? ` · ${count}` : ""}
|
|
202
|
+
</Text>
|
|
203
|
+
</Pressable>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export function SubagentRow({
|
|
208
|
+
agent,
|
|
209
|
+
onOpen,
|
|
210
|
+
styles,
|
|
211
|
+
}: {
|
|
212
|
+
agent: OfficeAgent;
|
|
213
|
+
onOpen(id: string): void;
|
|
214
|
+
styles: OfficeStyles;
|
|
215
|
+
}) {
|
|
216
|
+
const title = agentTitle(agent);
|
|
217
|
+
const task = agentTask(agent);
|
|
218
|
+
const state = stateLabel(agent);
|
|
219
|
+
const open = useCallback(() => onOpen(agent.id), [agent.id, onOpen]);
|
|
220
|
+
return (
|
|
221
|
+
<Pressable
|
|
222
|
+
accessibilityRole="button"
|
|
223
|
+
accessibilityLabel={`Open ${title}, ${state}`}
|
|
224
|
+
onPress={open}
|
|
225
|
+
style={styles.sessions.row}
|
|
226
|
+
>
|
|
227
|
+
<View style={styles.dot[dotTone(agent)]} />
|
|
228
|
+
<View style={styles.columnBody}>
|
|
229
|
+
<Text numberOfLines={1} style={styles.sessions.name}>
|
|
230
|
+
{title}
|
|
231
|
+
</Text>
|
|
232
|
+
<Text numberOfLines={2} style={styles.chatMeta}>
|
|
233
|
+
{task ? `${state} · ${task}` : state}
|
|
234
|
+
</Text>
|
|
235
|
+
</View>
|
|
236
|
+
</Pressable>
|
|
237
|
+
);
|
|
238
|
+
}
|