send-to-paseo 2.1.0 → 2.3.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/README.md +26 -25
- package/assets/LICENSE.lucide +43 -0
- package/assets/icon.png +0 -0
- package/assets/icon.svg +1 -0
- package/client/chat.tsx +157 -0
- package/client/display.tsx +10 -11
- package/client/overview.tsx +147 -0
- package/client/settings.tsx +91 -131
- package/client/sidebar.tsx +33 -0
- package/client/theme.ts +45 -0
- package/docs/media/send-to-paseo-card-dark.png +0 -0
- package/docs/media/send-to-paseo-card-light.png +0 -0
- package/docs/media/send-to-paseo-hero-dark.png +0 -0
- package/docs/media/send-to-paseo-mobile.png +0 -0
- package/docs/media/send-to-paseo-overview-dark.png +0 -0
- package/docs/media/send-to-paseo-overview-light.png +0 -0
- package/docs/media/send-to-paseo-setup-dark.png +0 -0
- package/index.client.tsx +17 -12
- package/index.server.ts +20 -0
- package/package.json +5 -3
- package/paseo-plugin.json +12 -0
- package/server/bridge.ts +1 -1
- package/server/browser-bridge.ts +4 -3
- package/server/send.ts +1 -0
- package/shared/chat.ts +159 -0
- package/shared/contracts.ts +29 -1
- package/shared/overview.ts +76 -0
- package/shared/route.ts +33 -0
- package/shared/summary.ts +14 -0
- package/client/navigation.tsx +0 -14
package/README.md
CHANGED
|
@@ -9,18 +9,31 @@ A Paseo plugin that runs a small local HTTP bridge so a browser extension can
|
|
|
9
9
|
send work from a pull request to the right workspace and agent — creating a
|
|
10
10
|
worktree checked out to the PR if none exists.
|
|
11
11
|
|
|
12
|
-

|
|
13
|
+
|
|
14
|
+
<sub>Screenshots use synthetic repositories and data.</sub>
|
|
13
15
|
|
|
14
16
|
The extension never talks to the Paseo daemon. It talks only to this bridge,
|
|
15
17
|
which speaks the frozen API in [the repository contract](https://github.com/tomgrin10/send-to-paseo/blob/main/CONTRACT.md) and reaches
|
|
16
18
|
Paseo through the supported SDK.
|
|
17
19
|
|
|
18
20
|
- Bridge: `http://127.0.0.1:7788`, loopback only, bearer token required.
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
+
- Screen: **Send to Paseo** in the Paseo sidebar. One line says whether sending works; on
|
|
22
|
+
first run it shows the three pairing steps, after that the recent sends (each opens its
|
|
23
|
+
agent), then the token, agent destination and new-agent defaults. The sidebar row shows an
|
|
24
|
+
amber dot until Chrome is paired and a red one when the bridge is down or a send failed.
|
|
25
|
+
- Chat: every send appears in the agent's chat as a card with the PR, the instruction, and why
|
|
26
|
+
it landed in this workspace (on the PR's branch, another branch of the stack, a new worktree);
|
|
27
|
+
"What the agent got" shows the exact message. The `send_to_paseo_bridge_status` agent tool
|
|
28
|
+
shows as a one-line row.
|
|
21
29
|
- Verified behaviour, with real command output, is recorded in the
|
|
22
30
|
[repository](https://github.com/tomgrin10/send-to-paseo/blob/main/plugin/VERIFICATION.md).
|
|
23
31
|
|
|
32
|
+
<picture>
|
|
33
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tomgrin10/send-to-paseo/main/plugin/docs/media/send-to-paseo-overview-light.png">
|
|
34
|
+
<img alt="The Send to Paseo screen: paired with Chrome, four sends today, and the recent sends list with one failed send that names the fix" src="https://raw.githubusercontent.com/tomgrin10/send-to-paseo/main/plugin/docs/media/send-to-paseo-overview-dark.png">
|
|
35
|
+
</picture>
|
|
36
|
+
|
|
24
37
|
---
|
|
25
38
|
|
|
26
39
|
## Install
|
|
@@ -408,7 +421,7 @@ The bridge does not start, the reason lands in the surface's status line and in
|
|
|
408
421
|
|
|
409
422
|
```
|
|
410
423
|
[send-to-paseo] Port 7788 is already in use, so the Send to Paseo bridge did not
|
|
411
|
-
start. Pick another port
|
|
424
|
+
start. Pick another port under Connection details on the Send to Paseo screen.
|
|
412
425
|
```
|
|
413
426
|
|
|
414
427
|
Note that `test/mock-bridge.mjs` in this repository uses port **7799**; don't
|
|
@@ -886,33 +899,21 @@ assembled specifier.
|
|
|
886
899
|
The listener cleanup and no-runtime-dependency rules are demonstrated in
|
|
887
900
|
[`VERIFICATION.md`](VERIFICATION.md) §3, §10 and §18.
|
|
888
901
|
|
|
889
|
-
##
|
|
890
|
-
|
|
891
|
-
[MIT](LICENSE) © 2026 Tom Gringauz.
|
|
892
|
-
|
|
893
|
-
## Navigation and display
|
|
902
|
+
## Agent tool
|
|
894
903
|
|
|
895
|
-
|
|
904
|
+
Agents can check bridge state and executable health with `send_to_paseo_bridge_status`. Pairing tokens, connection codes, daemon credentials and recent prompt text are never included.
|
|
896
905
|
|
|
897
|
-
##
|
|
898
|
-
|
|
899
|
-
`send_to_paseo_bridge_status` exposes bridge state and executable health. Pairing tokens, token previews, connection codes, daemon credentials and recent prompt text are excluded.
|
|
906
|
+
## License
|
|
900
907
|
|
|
901
|
-
|
|
902
|
-
and Codex sessions; history-only opens receive none. They become available on
|
|
903
|
-
the next idle session open after install or reload. The agent label
|
|
904
|
-
`plugin-tools/enabled: "false"` opts a session out. Existing plugin data and
|
|
905
|
-
settings are retained.
|
|
908
|
+
[MIT](LICENSE) © 2026 Tom Gringauz.
|
|
906
909
|
|
|
907
910
|
## Other plugins
|
|
908
911
|
|
|
909
912
|
- [Defer](https://github.com/tomgrin10/paseo-defer) — Schedule messages for later delivery.
|
|
910
|
-
- [
|
|
911
|
-
- [Smart Session](https://github.com/tomgrin10/paseo-smart-session) — Context compaction and usage insights.
|
|
912
|
-
- [Vitals](https://github.com/tomgrin10/paseo-vitals) — Host, agent, and Docker health.
|
|
913
|
+
- [Follow-up](https://github.com/tomgrin10/paseo-follow-up) — Track workspace PRs, remaining tasks and completion.
|
|
913
914
|
- [Session Guard](https://github.com/tomgrin10/paseo-session-guard) — Pause at session limits and continue after reset.
|
|
914
|
-
- [
|
|
915
|
+
- [Smart Session](https://github.com/tomgrin10/paseo-smart-session) — Context compaction and usage insights.
|
|
915
916
|
- [Transcript Search](https://github.com/tomgrin10/paseo-transcript-search) — Search conversations across connected hosts.
|
|
916
|
-
- [
|
|
917
|
-
|
|
918
|
-
- [
|
|
917
|
+
- [Transfer](https://github.com/tomgrin10/paseo-transfer) — Copy or move workspaces between hosts.
|
|
918
|
+
- [Vitals](https://github.com/tomgrin10/paseo-vitals) — Host, process, agent and Docker monitoring.
|
|
919
|
+
- [Workspace Switcher](https://github.com/tomgrin10/paseo-switcher) — Arc-style Ctrl+Tab between recent workspaces.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
The following Lucide icons are derived from the Feather project:
|
|
20
|
+
|
|
21
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
22
|
+
|
|
23
|
+
The MIT License (MIT) (for the icons listed above)
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2013-present Cole Bemis
|
|
26
|
+
|
|
27
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
28
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
29
|
+
in the Software without restriction, including without limitation the rights
|
|
30
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
31
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
32
|
+
furnished to do so, subject to the following conditions:
|
|
33
|
+
|
|
34
|
+
The above copyright notice and this permission notice shall be included in all
|
|
35
|
+
copies or substantial portions of the Software.
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
|
+
SOFTWARE.
|
package/assets/icon.png
ADDED
|
Binary file
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256"><title>Send to Paseo</title><rect width="256" height="256" rx="52" fill="#1c2229"/><svg x="52" y="52" xmlns="http://www.w3.org/2000/svg" width="152" height="152" viewBox="0 0 24 24" fill="none" stroke="#f3f0e8" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send" aria-hidden="true"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"></path><path d="m21.854 2.147-10.94 10.939"></path></svg></svg>
|
package/client/chat.tsx
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { Platform, Pressable, Text, View } from "react-native";
|
|
3
|
+
import type { PluginClientContext, PluginTimelineItemProps } from "@getpaseo/plugin/client";
|
|
4
|
+
import { ExternalLink, Icon, ScrollView } from "@getpaseo/plugin/client/ui";
|
|
5
|
+
|
|
6
|
+
import { dispatchesForAgent, type RecentSend } from "../shared/contracts";
|
|
7
|
+
import { PROVENANCE_CARD_KIND, ProvenanceSchema, TOOL_ROW_KIND, ToolRowSchema, bridgeToolRow, isBridgeStatusTool, provenance, type Provenance, type ToolRow } from "../shared/chat";
|
|
8
|
+
import { routeLine, siteLabel } from "../shared/route";
|
|
9
|
+
import { raised } from "./theme";
|
|
10
|
+
|
|
11
|
+
/** GitHub's mark (Octicons mark-github, MIT), drawn in the text colour. */
|
|
12
|
+
const GITHUB_MARK = { svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"/></svg>' };
|
|
13
|
+
|
|
14
|
+
const mono = () => (Platform.OS === "ios" ? "Menlo" : Platform.OS === "android" ? "monospace" : "ui-monospace, SFMono-Regular, Menlo, monospace");
|
|
15
|
+
|
|
16
|
+
type Rpc = PluginClientContext["rpc"];
|
|
17
|
+
|
|
18
|
+
/** One lookup per agent and host, shared by every card in that chat. */
|
|
19
|
+
const lookups = new Map<string, Promise<RecentSend[]>>();
|
|
20
|
+
function sendsFor(rpc: Rpc, serverId: string, agentId: string): Promise<RecentSend[]> {
|
|
21
|
+
const key = `${serverId}:${agentId}`;
|
|
22
|
+
let pending = lookups.get(key);
|
|
23
|
+
if (pending === undefined) {
|
|
24
|
+
pending = rpc(dispatchesForAgent, { serverId, agentId }).then((result) => result.sends, () => []);
|
|
25
|
+
lookups.set(key, pending);
|
|
26
|
+
// Fresh enough for a chat that stays open; a later send is a new card anyway.
|
|
27
|
+
setTimeout(() => lookups.delete(key), 60_000);
|
|
28
|
+
}
|
|
29
|
+
return pending;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The recorded send nearest this message, within a few minutes of it. */
|
|
33
|
+
function nearest(sends: RecentSend[], at: Date, number: number): RecentSend | null {
|
|
34
|
+
let best: RecentSend | null = null;
|
|
35
|
+
let gap = 5 * 60_000;
|
|
36
|
+
for (const send of sends) {
|
|
37
|
+
if (send.outcome !== "ok" || !send.prLabel.endsWith(`#${number}`)) continue;
|
|
38
|
+
const delta = Math.abs(Date.parse(send.at) - at.getTime());
|
|
39
|
+
if (delta <= gap) { gap = delta; best = send; }
|
|
40
|
+
}
|
|
41
|
+
return best;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ProvenanceCard({ item, theme, layout, host, agentId, timestamp, rpc }: PluginTimelineItemProps<Provenance> & { rpc: Rpc }) {
|
|
45
|
+
const c = theme.colors;
|
|
46
|
+
const card = item.data;
|
|
47
|
+
const [expanded, setExpanded] = useState(false);
|
|
48
|
+
const [send, setSend] = useState<RecentSend | null>(null);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
let live = true;
|
|
51
|
+
void sendsFor(rpc, host.id, agentId).then((sends) => { if (live) setSend(nearest(sends, timestamp, card.number)); });
|
|
52
|
+
return () => { live = false; };
|
|
53
|
+
}, [rpc, host.id, agentId, timestamp, card.number]);
|
|
54
|
+
|
|
55
|
+
const site = siteLabel(card.site);
|
|
56
|
+
const route = routeLine(card, send);
|
|
57
|
+
const tight = layout.compact;
|
|
58
|
+
return <View style={{ alignSelf: tight ? "stretch" : "flex-end", width: "100%", maxWidth: 600, marginVertical: 4 }}>
|
|
59
|
+
<View style={[{ borderRadius: 12, backgroundColor: c.surface1, overflow: "hidden" }, raised(c)]}>
|
|
60
|
+
<View style={{ paddingHorizontal: 14, paddingTop: 11, paddingBottom: 10, gap: 3 }}>
|
|
61
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
62
|
+
{card.forge === "github" ? <Icon icon={GITHUB_MARK} size={14} color={c.foreground} /> : <Icon name="GitPullRequest" size={14} color={c.foreground} />}
|
|
63
|
+
<Text numberOfLines={1} style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 17, fontVariant: ["tabular-nums"] }}>
|
|
64
|
+
<Text style={{ color: c.foreground, fontWeight: "600" }}>{card.repo} #{card.number}</Text>
|
|
65
|
+
{site === null || tight ? "" : ` · sent from ${site}`}
|
|
66
|
+
</Text>
|
|
67
|
+
<View style={{ flex: 1 }} />
|
|
68
|
+
<ExternalLink href={card.prUrl} accessibilityLabel={`Open ${card.repo} pull request ${card.number}`}>
|
|
69
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, paddingVertical: 2 }}>
|
|
70
|
+
<Text style={{ color: c.foregroundMuted, fontSize: 12 }}>Open PR</Text>
|
|
71
|
+
</View>
|
|
72
|
+
</ExternalLink>
|
|
73
|
+
</View>
|
|
74
|
+
<View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8, marginTop: 2, marginBottom: 4 }}>
|
|
75
|
+
<View style={{ paddingTop: 2 }}><Icon name={route.attention ? "TriangleAlert" : "Route"} size={13} color={route.attention ? c.statusWarning : c.foregroundMuted} /></View>
|
|
76
|
+
<Text style={{ flex: 1, color: route.attention ? c.statusWarning : c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>{tight && site !== null ? `From ${site} · ${route.text}` : route.text}</Text>
|
|
77
|
+
</View>
|
|
78
|
+
{card.title === null ? null : <Text numberOfLines={2} style={{ color: c.foreground, fontSize: 13, lineHeight: 18 }}>{card.title}</Text>}
|
|
79
|
+
{card.head === null ? null : (
|
|
80
|
+
<Text numberOfLines={1} style={{ color: c.foregroundMuted, fontFamily: mono(), fontSize: 12, lineHeight: 17 }}>{card.head} → {card.base}</Text>
|
|
81
|
+
)}
|
|
82
|
+
</View>
|
|
83
|
+
<View style={{ borderTopWidth: 1, borderTopColor: c.border, paddingHorizontal: 14, paddingVertical: 10 }}>
|
|
84
|
+
<Text selectable style={{ color: c.foreground, fontSize: 14, lineHeight: 21 }}>{card.instruction}</Text>
|
|
85
|
+
</View>
|
|
86
|
+
<View style={{ flexDirection: "row", justifyContent: "flex-end", paddingHorizontal: 10, paddingBottom: 8 }}>
|
|
87
|
+
<Pressable accessibilityRole="button" aria-expanded={expanded} accessibilityLabel={expanded ? "Hide what the agent received" : "Show what the agent received"} onPress={() => setExpanded((value) => !value)} hitSlop={6}
|
|
88
|
+
style={(state) => ({ flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 8, paddingVertical: 4, borderRadius: 6, borderWidth: 1, borderColor: c.border, backgroundColor: state.pressed ? c.surface2 : "transparent" })}>
|
|
89
|
+
<Text style={{ color: c.foregroundMuted, fontSize: 12 }}>{expanded ? "Hide" : "What the agent got"}</Text>
|
|
90
|
+
<View style={{ transform: [{ rotate: expanded ? "180deg" : "0deg" }] }}><Icon name="ChevronDown" size={12} color={c.foregroundMuted} /></View>
|
|
91
|
+
</Pressable>
|
|
92
|
+
</View>
|
|
93
|
+
{expanded ? <View style={{ borderTopWidth: 1, borderTopColor: c.border }}>
|
|
94
|
+
<ScrollView style={[{ maxHeight: 300 }, Platform.OS === "web" ? ({ overscrollBehavior: "contain" } as object) : null]} contentContainerStyle={{ padding: 14 }}>
|
|
95
|
+
<Text selectable style={{ color: c.foregroundMuted, fontFamily: mono(), fontSize: 12, lineHeight: 18 }}>{card.text}</Text>
|
|
96
|
+
</ScrollView>
|
|
97
|
+
</View> : null}
|
|
98
|
+
</View>
|
|
99
|
+
</View>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The bridge-status agent tool as one quiet line, sized like Paseo's own tool rows. */
|
|
103
|
+
function ToolRowView({ item, theme }: PluginTimelineItemProps<ToolRow>) {
|
|
104
|
+
const c = theme.colors;
|
|
105
|
+
const row = item.data;
|
|
106
|
+
const [expanded, setExpanded] = useState(false);
|
|
107
|
+
const [hovered, setHovered] = useState(false);
|
|
108
|
+
const openable = row.detail !== "";
|
|
109
|
+
const open = expanded && openable;
|
|
110
|
+
const active = openable && (hovered || expanded);
|
|
111
|
+
const alert = row.tone === "danger" ? c.statusDanger : row.tone === "warning" ? c.statusWarning : null;
|
|
112
|
+
return <View style={{ marginHorizontal: -13 }}>
|
|
113
|
+
<Pressable disabled={!openable} onPress={() => setExpanded((value) => !value)} onHoverIn={() => setHovered(true)} onHoverOut={() => setHovered(false)}
|
|
114
|
+
accessibilityRole={openable ? "button" : undefined} aria-expanded={openable ? expanded : undefined} aria-busy={row.state === "running"}
|
|
115
|
+
style={{ flexDirection: "row", alignItems: "center", borderRadius: 8, borderWidth: 1, borderColor: open ? c.border : "transparent", borderBottomLeftRadius: open ? 0 : 8, borderBottomRightRadius: open ? 0 : 8, backgroundColor: open ? c.surface1 : "transparent", paddingHorizontal: 8, paddingVertical: 4 }}>
|
|
116
|
+
<View style={{ width: 22, height: 22, marginRight: 4, alignItems: "center", justifyContent: "center" }}>
|
|
117
|
+
{active
|
|
118
|
+
? <View style={{ transform: [{ rotate: expanded ? "90deg" : "0deg" }] }}><Icon name="ChevronRight" size={14} color={c.foreground} /></View>
|
|
119
|
+
: <Icon name={alert ? "TriangleAlert" : "Send"} size={12} color={alert ?? c.foregroundMuted} />}
|
|
120
|
+
</View>
|
|
121
|
+
<Text numberOfLines={1} style={{ flexShrink: 1, fontSize: 14, fontVariant: ["tabular-nums"], color: alert ?? (active || row.state === "running" ? c.foreground : c.foregroundMuted), opacity: row.state === "running" ? 0.72 : 1 }}>{row.line}</Text>
|
|
122
|
+
</Pressable>
|
|
123
|
+
{open ? <View style={{ borderWidth: 1, borderTopWidth: 0, borderColor: c.border, borderBottomLeftRadius: 8, borderBottomRightRadius: 8, overflow: "hidden" }}>
|
|
124
|
+
<ScrollView style={[{ maxHeight: 240 }, Platform.OS === "web" ? ({ overscrollBehavior: "contain" } as object) : null]} contentContainerStyle={{ paddingHorizontal: 12, paddingVertical: 8 }}>
|
|
125
|
+
<Text selectable style={{ color: c.foreground, fontFamily: mono(), fontSize: 12, lineHeight: 18 }}>{row.detail}</Text>
|
|
126
|
+
</ScrollView>
|
|
127
|
+
</View> : null}
|
|
128
|
+
</View>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function contributeChat(client: PluginClientContext) {
|
|
132
|
+
const rpc: Rpc = client.rpc.bind(client);
|
|
133
|
+
const Card = (props: PluginTimelineItemProps<Provenance>) => <ProvenanceCard {...props} rpc={rpc} />;
|
|
134
|
+
const removers = [
|
|
135
|
+
client.addTimelineTransformer({
|
|
136
|
+
id: "send-to-paseo-provenance",
|
|
137
|
+
query: { itemType: "user_message" },
|
|
138
|
+
transform({ item }) {
|
|
139
|
+
const card = provenance(item.text);
|
|
140
|
+
return card === null ? undefined : { items: [{ type: "plugin" as const, kind: PROVENANCE_CARD_KIND, version: 1, data: card }] };
|
|
141
|
+
},
|
|
142
|
+
}),
|
|
143
|
+
client.addTimelineTransformer({
|
|
144
|
+
id: "send-to-paseo-tool-calls",
|
|
145
|
+
query: { itemType: "tool_call" },
|
|
146
|
+
transform({ item }) {
|
|
147
|
+
if (!isBridgeStatusTool(item.name)) return undefined;
|
|
148
|
+
const detail = item.detail as { output?: unknown; result?: unknown } | undefined;
|
|
149
|
+
const row = bridgeToolRow(item.status, detail?.output ?? detail?.result ?? detail, item.error);
|
|
150
|
+
return { items: [{ type: "plugin" as const, kind: TOOL_ROW_KIND, version: 1, data: row }] };
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
client.addTimelineRenderer({ kind: PROVENANCE_CARD_KIND, version: 1, schema: ProvenanceSchema, Component: Card }),
|
|
154
|
+
client.addTimelineRenderer({ kind: TOOL_ROW_KIND, version: 1, schema: ToolRowSchema, Component: ToolRowView }),
|
|
155
|
+
];
|
|
156
|
+
return () => { for (const remove of removers) if (typeof remove === "function") void remove(); };
|
|
157
|
+
}
|
package/client/display.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { PluginClientContext,
|
|
1
|
+
import type { PluginClientContext, PluginSurfaceProps } from "@getpaseo/plugin/client";
|
|
2
2
|
import { useSettings } from "@getpaseo/plugin/client";
|
|
3
3
|
import { SettingsAction, SettingsCard, SettingsSection, SettingsSwitch } from "@getpaseo/plugin/client/ui";
|
|
4
4
|
import { useEffect } from "react";
|
|
5
5
|
import { ActivityIndicator, ScrollView, Text, View } from "react-native";
|
|
6
6
|
import { displayPreferences, displayRpc } from "../shared/display";
|
|
7
|
-
import { withNavigation } from "./navigation";
|
|
8
7
|
import { sidebarVisibility } from "./sidebar-visibility";
|
|
9
8
|
|
|
10
9
|
const listeners = new Set<(visible: boolean) => void>();
|
|
@@ -29,12 +28,12 @@ function DisplaySettings({ theme }: PluginSurfaceProps) {
|
|
|
29
28
|
);
|
|
30
29
|
|
|
31
30
|
return (
|
|
32
|
-
<ScrollView style={{ flex: 1 }} contentContainerStyle={{
|
|
31
|
+
<ScrollView style={{ flex: 1 }} contentContainerStyle={{ paddingVertical: 16, gap: 16 }}>
|
|
33
32
|
<SettingsSection title="Navigation">
|
|
34
33
|
<SettingsCard>
|
|
35
34
|
<SettingsSwitch
|
|
36
35
|
label="Show in sidebar"
|
|
37
|
-
hint="
|
|
36
|
+
hint="When off, open it from Command-K (Ctrl-K on Windows and Linux) inside a workspace."
|
|
38
37
|
value={settings.values.showSidebar}
|
|
39
38
|
disabled={settings.saving}
|
|
40
39
|
onValueChange={(showSidebar) => void settings.save({ ...settings.values, showSidebar }, settings.revision)}
|
|
@@ -47,22 +46,22 @@ function DisplaySettings({ theme }: PluginSurfaceProps) {
|
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
/** Settings notifications reach mounted screens; poll for changes made on other clients. */
|
|
50
|
-
export function contributeDisplay(client: PluginClientContext, item:
|
|
51
|
-
const sidebar = sidebarVisibility(
|
|
49
|
+
export function contributeDisplay(client: PluginClientContext, item: { title: string; register: () => (() => void) | void }) {
|
|
50
|
+
const sidebar = sidebarVisibility(item.register);
|
|
52
51
|
// Paseo 0.10.1 memoizes sidebar route resolution when an installation mounts.
|
|
53
52
|
// Register synchronously, then reconcile the saved preference, so that an
|
|
54
|
-
// already-open sidebar route can resolve its
|
|
53
|
+
// already-open sidebar route can resolve its screen during that first render.
|
|
55
54
|
sidebar.set(true);
|
|
56
|
-
|
|
57
|
-
const removeSurface = client.
|
|
58
|
-
const removeSettings = client.addSettingsScreen({ id: "display", title: "Display", icon: "PanelLeft", Component:
|
|
55
|
+
// `display-settings` was a surface id before 2.3; kept as a screen so old links still open.
|
|
56
|
+
const removeSurface = client.addScreen({ id: "display-settings", title: `${item.title} display`, Component: DisplaySettings });
|
|
57
|
+
const removeSettings = client.addSettingsScreen({ id: "display", title: "Display", icon: "PanelLeft", Component: DisplaySettings });
|
|
59
58
|
const removeCommand = client.addCommandCenterItem({
|
|
60
59
|
id: "display-settings",
|
|
61
60
|
title: `${item.title}: display settings`,
|
|
62
61
|
icon: "PanelLeft",
|
|
63
62
|
keywords: [item.title, "sidebar", "show", "hide", "display", "settings"],
|
|
64
63
|
context: "global",
|
|
65
|
-
onSelect({
|
|
64
|
+
onSelect({ openSettings }) { openSettings("display"); },
|
|
66
65
|
});
|
|
67
66
|
let disposed = false;
|
|
68
67
|
let pending = false;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Platform, Pressable, Text, View } from "react-native";
|
|
2
|
+
import type { PluginTheme } from "@getpaseo/plugin";
|
|
3
|
+
import { ExternalLink, Icon } from "@getpaseo/plugin/client/ui";
|
|
4
|
+
|
|
5
|
+
import type { BridgeStatus, RecentSend } from "../shared/contracts";
|
|
6
|
+
import { CHROME_WEB_STORE_URL, ago, destination, lead, prLabel } from "../shared/overview";
|
|
7
|
+
import { raised, tabular, tint } from "./theme";
|
|
8
|
+
|
|
9
|
+
const mono = Platform.OS === "ios" ? "Menlo" : Platform.OS === "android" ? "monospace" : "ui-monospace, SFMono-Regular, Menlo, monospace";
|
|
10
|
+
|
|
11
|
+
type Colors = PluginTheme["colors"];
|
|
12
|
+
|
|
13
|
+
function GhostButton({ label, icon, onPress, colors, primary = false }: { label: string; icon?: string; onPress: () => void; colors: Colors; primary?: boolean }) {
|
|
14
|
+
return (
|
|
15
|
+
<Pressable accessibilityRole="button" accessibilityLabel={label} onPress={onPress} hitSlop={4}
|
|
16
|
+
style={({ pressed }) => ({
|
|
17
|
+
flexDirection: "row", alignItems: "center", gap: 6, minHeight: 32, paddingHorizontal: 12, borderRadius: 8,
|
|
18
|
+
borderWidth: 1, borderColor: primary ? colors.accent : colors.border,
|
|
19
|
+
backgroundColor: primary ? colors.accent : pressed ? colors.surface2 : "transparent",
|
|
20
|
+
transform: [{ scale: pressed ? 0.97 : 1 }],
|
|
21
|
+
})}>
|
|
22
|
+
{icon === undefined ? null : <Icon name={icon} size={14} color={primary ? colors.accentForeground : colors.foreground} />}
|
|
23
|
+
<Text style={{ color: primary ? colors.accentForeground : colors.foreground, fontSize: 13, fontWeight: primary ? "600" : "400" }}>{label}</Text>
|
|
24
|
+
</Pressable>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function Step({ n, done, title, children, colors }: { n: number; done: boolean; title: string; children?: React.ReactNode; colors: Colors }) {
|
|
29
|
+
return (
|
|
30
|
+
<View style={{ flexDirection: "row", gap: 12 }}>
|
|
31
|
+
<View style={{ width: 22, height: 22, borderRadius: 11, alignItems: "center", justifyContent: "center", backgroundColor: done ? tint(colors.statusSuccess, colors) : colors.surface2 }}>
|
|
32
|
+
{done ? <Icon name="Check" size={13} color={colors.statusSuccess} /> : <Text style={{ color: colors.foreground, fontSize: 12, fontWeight: "600", ...tabular }}>{n}</Text>}
|
|
33
|
+
</View>
|
|
34
|
+
<View style={{ flex: 1, gap: 8, paddingTop: 2 }}>
|
|
35
|
+
<Text style={{ color: colors.foreground, fontSize: 14, lineHeight: 19 }}>{title}</Text>
|
|
36
|
+
{children}
|
|
37
|
+
</View>
|
|
38
|
+
</View>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Status first: one sentence that says whether sending works and what comes
|
|
44
|
+
* next, then either the three pairing steps (first run) or the send history.
|
|
45
|
+
*/
|
|
46
|
+
export function Overview({ status, sends, colors, compact, onCopyToken, onToggleDetails, detailsOpen, onOpenAgent, onClear }: {
|
|
47
|
+
status: BridgeStatus;
|
|
48
|
+
sends: RecentSend[];
|
|
49
|
+
colors: Colors;
|
|
50
|
+
compact: boolean;
|
|
51
|
+
onCopyToken: () => void;
|
|
52
|
+
onToggleDetails: () => void;
|
|
53
|
+
detailsOpen: boolean;
|
|
54
|
+
onOpenAgent: ((agentId: string) => void) | null;
|
|
55
|
+
onClear: () => void;
|
|
56
|
+
}) {
|
|
57
|
+
const head = lead(status, sends);
|
|
58
|
+
const tone = head.kind === "down" ? colors.statusDanger : head.kind === "setup" ? colors.statusWarning : colors.foreground;
|
|
59
|
+
const facts = [
|
|
60
|
+
status.state === "running" ? `Bridge on 127.0.0.1:${status.port}` : `Port ${status.configuredPort}`,
|
|
61
|
+
status.daemon.version === null ? null : `Paseo ${status.daemon.version}`,
|
|
62
|
+
status.dryRun ? "dry run" : null,
|
|
63
|
+
].filter((part): part is string => part !== null);
|
|
64
|
+
return (
|
|
65
|
+
<View style={{ gap: compact ? 16 : 20 }}>
|
|
66
|
+
<View style={{ gap: 6 }}>
|
|
67
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
68
|
+
{head.kind === "ready" ? null : <Icon name={head.kind === "down" ? "CircleX" : "Link"} size={18} color={tone} />}
|
|
69
|
+
<Text accessibilityRole="header" style={{ flexShrink: 1, color: head.kind === "down" ? tone : colors.foreground, fontSize: compact ? 18 : 20, lineHeight: compact ? 24 : 27, fontWeight: "600", ...tabular }}>{head.text}</Text>
|
|
70
|
+
</View>
|
|
71
|
+
{head.detail === "" ? null : <Text style={{ color: colors.foregroundMuted, fontSize: 14, lineHeight: 20, maxWidth: 620 }}>{head.detail}</Text>}
|
|
72
|
+
<View style={{ flexDirection: "row", alignItems: "center", flexWrap: "wrap", columnGap: 12, rowGap: 6, marginTop: 4 }}>
|
|
73
|
+
<Text style={{ color: colors.foregroundMuted, fontSize: 12, ...tabular }}>{facts.join(compact ? ", " : " · ")}</Text>
|
|
74
|
+
<Pressable accessibilityRole="button" aria-expanded={detailsOpen} onPress={onToggleDetails} hitSlop={6} style={{ flexDirection: "row", alignItems: "center", gap: 4 }}>
|
|
75
|
+
<Text style={{ color: colors.foreground, fontSize: 12, textDecorationLine: "underline" }}>{detailsOpen ? "Hide connection details" : "Connection details"}</Text>
|
|
76
|
+
</Pressable>
|
|
77
|
+
</View>
|
|
78
|
+
</View>
|
|
79
|
+
|
|
80
|
+
{head.kind === "setup" ? (
|
|
81
|
+
<View style={[{ borderRadius: 12, backgroundColor: colors.surface1, padding: compact ? 14 : 18, gap: 16 }, raised(colors)]}>
|
|
82
|
+
<Step n={1} done={false} title="Add the Chrome extension" colors={colors}>
|
|
83
|
+
<View style={{ flexDirection: "row" }}>
|
|
84
|
+
<ExternalLink href={CHROME_WEB_STORE_URL} accessibilityLabel="Open Send to Paseo in the Chrome Web Store">
|
|
85
|
+
<Text style={{ color: colors.foreground, fontSize: 13, textDecorationLine: "underline" }}>Send to Paseo in the Chrome Web Store</Text>
|
|
86
|
+
</ExternalLink>
|
|
87
|
+
</View>
|
|
88
|
+
</Step>
|
|
89
|
+
<Step n={2} done={false} title="Copy the pairing token" colors={colors}>
|
|
90
|
+
<View style={{ flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: 10 }}>
|
|
91
|
+
<GhostButton label="Copy token" icon="Copy" primary onPress={onCopyToken} colors={colors} />
|
|
92
|
+
<Text style={{ color: colors.foregroundMuted, fontFamily: mono, fontSize: 12 }}>{status.tokenPreview}</Text>
|
|
93
|
+
</View>
|
|
94
|
+
</Step>
|
|
95
|
+
<Step n={3} done={false} title="Click the extension's icon in Chrome, paste the token, and press Test connection" colors={colors}>
|
|
96
|
+
<Text style={{ color: colors.foregroundMuted, fontSize: 13, lineHeight: 18 }}>This screen updates as soon as Chrome connects. Treat the token like a password.</Text>
|
|
97
|
+
</Step>
|
|
98
|
+
</View>
|
|
99
|
+
) : null}
|
|
100
|
+
|
|
101
|
+
{sends.length === 0 ? null : (
|
|
102
|
+
<View style={{ gap: 8 }}>
|
|
103
|
+
<View style={{ flexDirection: "row", alignItems: "center", justifyContent: "space-between" }}>
|
|
104
|
+
<Text accessibilityRole="header" style={{ color: colors.foreground, fontSize: 15, fontWeight: "600" }}>Recent sends</Text>
|
|
105
|
+
<Pressable accessibilityRole="button" accessibilityLabel="Clear recent sends" onPress={onClear} hitSlop={6}
|
|
106
|
+
style={({ pressed }) => ({ paddingHorizontal: 8, paddingVertical: 4, borderRadius: 6, backgroundColor: pressed ? colors.surface2 : "transparent" })}>
|
|
107
|
+
<Text style={{ color: colors.foregroundMuted, fontSize: 12 }}>Clear</Text>
|
|
108
|
+
</Pressable>
|
|
109
|
+
</View>
|
|
110
|
+
<View style={[{ borderRadius: 12, backgroundColor: colors.surface1, overflow: "hidden" }, raised(colors)]}>
|
|
111
|
+
{sends.map((send, index) => <SendRow key={send.id} send={send} first={index === 0} colors={colors} compact={compact} onOpen={onOpenAgent} />)}
|
|
112
|
+
</View>
|
|
113
|
+
</View>
|
|
114
|
+
)}
|
|
115
|
+
</View>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function SendRow({ send, first, colors, compact, onOpen }: { send: RecentSend; first: boolean; colors: Colors; compact: boolean; onOpen: ((agentId: string) => void) | null }) {
|
|
120
|
+
const failed = send.outcome === "failed";
|
|
121
|
+
const openable = !failed && send.agentId !== null && onOpen !== null;
|
|
122
|
+
const title = send.dispatch === "main" ? null : send.title.replace(/^PR #\d+ · /, "");
|
|
123
|
+
const body = (hovered: boolean) => (
|
|
124
|
+
<View style={{ flexDirection: "row", gap: 12, paddingHorizontal: compact ? 12 : 16, paddingVertical: 12, borderTopWidth: first ? 0 : 1, borderTopColor: colors.border, backgroundColor: hovered ? colors.surface2 : "transparent" }}>
|
|
125
|
+
<View style={{ paddingTop: 2 }}>
|
|
126
|
+
<Icon name={failed ? "TriangleAlert" : send.workspaceCreated ? "GitBranchPlus" : "GitPullRequest"} size={15} color={failed ? colors.statusDanger : colors.foregroundMuted} />
|
|
127
|
+
</View>
|
|
128
|
+
<View style={{ flex: 1, gap: 3 }}>
|
|
129
|
+
<View style={{ flexDirection: "row", alignItems: "baseline", gap: 8 }}>
|
|
130
|
+
<Text numberOfLines={1} style={{ flexShrink: 1, color: colors.foreground, fontSize: 14, fontWeight: "600", ...tabular }}>{prLabel(send.prLabel)}</Text>
|
|
131
|
+
<View style={{ flex: 1 }} />
|
|
132
|
+
<Text style={{ color: colors.foregroundMuted, fontSize: 12, ...tabular }}>{ago(send.at)}</Text>
|
|
133
|
+
</View>
|
|
134
|
+
{title === null || title === "" ? null : <Text numberOfLines={2} style={{ color: colors.foreground, fontSize: 13, lineHeight: 18 }}>{title}</Text>}
|
|
135
|
+
<Text numberOfLines={failed ? 3 : 1} style={{ color: failed ? colors.statusDanger : colors.foregroundMuted, fontSize: 12, lineHeight: 17 }}>{failed ? `Not sent. ${destination(send)}` : destination(send)}</Text>
|
|
136
|
+
</View>
|
|
137
|
+
<View style={{ width: 14, justifyContent: "center" }}>{openable ? <Icon name="ChevronRight" size={14} color={colors.foregroundMuted} /> : null}</View>
|
|
138
|
+
</View>
|
|
139
|
+
);
|
|
140
|
+
if (!openable) return body(false);
|
|
141
|
+
const agentId = send.agentId!;
|
|
142
|
+
return (
|
|
143
|
+
<Pressable accessibilityRole="button" accessibilityLabel={`Open the agent for ${prLabel(send.prLabel)}`} onPress={() => onOpen!(agentId)}>
|
|
144
|
+
{(state) => body((state as { hovered?: boolean }).hovered === true)}
|
|
145
|
+
</Pressable>
|
|
146
|
+
);
|
|
147
|
+
}
|