send-to-paseo 1.4.1 → 2.0.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 +117 -90
- package/client/display.tsx +97 -0
- package/client/navigation.tsx +14 -0
- package/client/sidebar-visibility.ts +21 -0
- package/index.client.tsx +5 -3
- package/index.server.ts +6 -1
- package/package.json +6 -5
- package/paseo-plugin.json +1 -1
- package/server/agent-tools.ts +10 -0
- package/server/native-tools.ts +17 -0
- package/shared/contracts.ts +1 -1
- package/shared/display.ts +11 -0
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# send-to-paseo
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/send-to-paseo)
|
|
4
|
+
[](https://www.npmjs.com/package/send-to-paseo)
|
|
5
|
+
[](https://paseo.sh)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
3
8
|
A Paseo plugin that runs a small local HTTP bridge so a browser extension can
|
|
4
9
|
send work from a pull request to the right workspace and agent — creating a
|
|
5
10
|
worktree checked out to the PR if none exists.
|
|
@@ -18,6 +23,90 @@ Paseo through the supported SDK.
|
|
|
18
23
|
|
|
19
24
|
---
|
|
20
25
|
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
Plugins are trusted, unsandboxed code: this one runs an HTTP server that can
|
|
29
|
+
start agents which execute arbitrary code on the daemon machine. Read the source
|
|
30
|
+
before installing it.
|
|
31
|
+
|
|
32
|
+
One command from npm. No clone or build step:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
paseo plugin install send-to-paseo
|
|
36
|
+
paseo plugin ls # expect: send-to-paseo running yes
|
|
37
|
+
paseo plugin logs send-to-paseo
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`pluginsEnabled` must already be `true` in the daemon's `config.json`.
|
|
41
|
+
|
|
42
|
+
There is nothing to install because the plugin imports nothing at runtime that
|
|
43
|
+
the Paseo host does not already provide — see
|
|
44
|
+
[No runtime dependencies, ever](#no-runtime-dependencies-ever). To update an
|
|
45
|
+
installed plugin, run `paseo plugin update send-to-paseo`; for a checkout,
|
|
46
|
+
run `paseo plugin reload send-to-paseo`.
|
|
47
|
+
|
|
48
|
+
### From a checkout (contributors)
|
|
49
|
+
|
|
50
|
+
Installing from a directory is the loop to use while editing, because
|
|
51
|
+
`paseo plugin reload` picks up changes in place:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
git clone https://github.com/tomgrin10/send-to-paseo.git
|
|
55
|
+
cd send-to-paseo/plugin
|
|
56
|
+
npm install # devDependencies only — for `npm run typecheck`
|
|
57
|
+
npm run verify
|
|
58
|
+
paseo plugin add /absolute/path/to/send-to-paseo/plugin
|
|
59
|
+
paseo plugin ls # expect: send-to-paseo running yes
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
After editing the source:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npm run verify
|
|
66
|
+
paseo plugin reload send-to-paseo
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Never restart the daemon to pick up plugin changes — that kills running agents.
|
|
70
|
+
|
|
71
|
+
### No runtime dependencies, ever
|
|
72
|
+
|
|
73
|
+
`paseo plugin add` compiles the plugin **with no packages installed** — there is
|
|
74
|
+
no `npm install` step in that path, and the daemon's bundler can only resolve the
|
|
75
|
+
specifiers the host provides at runtime:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
@getpaseo/plugin @getpaseo/plugin/client @getpaseo/plugin/server
|
|
79
|
+
@getpaseo/plugin/client/react-native
|
|
80
|
+
zod react react/jsx-runtime react-native @tanstack/react-query
|
|
81
|
+
node:* (built-ins, in the server bundle)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Everything in `plugin/package.json` is therefore a **devDependency**, present only
|
|
85
|
+
so `npm run typecheck` works for contributors.
|
|
86
|
+
|
|
87
|
+
> **Nothing may be added to `dependencies`.** A runtime import of anything outside
|
|
88
|
+
> the list above fails `paseo plugin add` for every user with
|
|
89
|
+
> `Build failed: Could not resolve "<pkg>"`, while still working perfectly on any
|
|
90
|
+
> machine that has run `npm install` — so it will not be caught locally. Imports
|
|
91
|
+
> from `@getpaseo/client` and `@getpaseo/protocol` must stay `import type` (erased
|
|
92
|
+
> at build time) or be reimplemented locally; the one runtime use of the Paseo SDK
|
|
93
|
+
> goes through the assembled-specifier `require` in `server/daemon.ts`, precisely
|
|
94
|
+
> so the bundler cannot see it. Before changing an import, read
|
|
95
|
+
> [`VERIFICATION.md`](VERIFICATION.md) §18, which includes the exact
|
|
96
|
+
> no-`node_modules` build command that proves an install still works.
|
|
97
|
+
|
|
98
|
+
### Pairing
|
|
99
|
+
|
|
100
|
+
1. Open **Send to Paseo** in the Paseo sidebar.
|
|
101
|
+
2. Under **Pairing token**, press **Copy** (or **Reveal** and copy by hand).
|
|
102
|
+
3. Paste it into the extension's options page. Simple setup already uses the Primary Paseo
|
|
103
|
+
machine's loopback bridge URL.
|
|
104
|
+
|
|
105
|
+
**Regenerate** issues a new token and immediately invalidates the old one, so any
|
|
106
|
+
paired extension has to be re-paired.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
21
110
|
## Requirements
|
|
22
111
|
|
|
23
112
|
Two external commands, one required and one optional. **Nothing here is fatal
|
|
@@ -103,90 +192,6 @@ is the place to look first if you have never opened a log file.
|
|
|
103
192
|
|
|
104
193
|
---
|
|
105
194
|
|
|
106
|
-
## Install
|
|
107
|
-
|
|
108
|
-
Plugins are trusted, unsandboxed code: this one runs an HTTP server that can
|
|
109
|
-
start agents which execute arbitrary code on the daemon machine. Read the source
|
|
110
|
-
before installing it.
|
|
111
|
-
|
|
112
|
-
One command from npm. No clone or build step:
|
|
113
|
-
|
|
114
|
-
```sh
|
|
115
|
-
paseo plugin install send-to-paseo
|
|
116
|
-
paseo plugin ls # expect: send-to-paseo running yes
|
|
117
|
-
paseo plugin logs send-to-paseo
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
`pluginsEnabled` must already be `true` in the daemon's `config.json`.
|
|
121
|
-
|
|
122
|
-
There is nothing to install because the plugin imports nothing at runtime that
|
|
123
|
-
the Paseo host does not already provide — see
|
|
124
|
-
[No runtime dependencies, ever](#no-runtime-dependencies-ever). To update an
|
|
125
|
-
installed plugin, run `paseo plugin update send-to-paseo`; for a checkout,
|
|
126
|
-
run `paseo plugin reload send-to-paseo`.
|
|
127
|
-
|
|
128
|
-
### From a checkout (contributors)
|
|
129
|
-
|
|
130
|
-
Installing from a directory is the loop to use while editing, because
|
|
131
|
-
`paseo plugin reload` picks up changes in place:
|
|
132
|
-
|
|
133
|
-
```sh
|
|
134
|
-
git clone https://github.com/tomgrin10/send-to-paseo.git
|
|
135
|
-
cd send-to-paseo/plugin
|
|
136
|
-
npm install # devDependencies only — for `npm run typecheck`
|
|
137
|
-
npm run verify
|
|
138
|
-
paseo plugin add /absolute/path/to/send-to-paseo/plugin
|
|
139
|
-
paseo plugin ls # expect: send-to-paseo running yes
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
After editing the source:
|
|
143
|
-
|
|
144
|
-
```sh
|
|
145
|
-
npm run verify
|
|
146
|
-
paseo plugin reload send-to-paseo
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Never restart the daemon to pick up plugin changes — that kills running agents.
|
|
150
|
-
|
|
151
|
-
### No runtime dependencies, ever
|
|
152
|
-
|
|
153
|
-
`paseo plugin add` compiles the plugin **with no packages installed** — there is
|
|
154
|
-
no `npm install` step in that path, and the daemon's bundler can only resolve the
|
|
155
|
-
specifiers the host provides at runtime:
|
|
156
|
-
|
|
157
|
-
```
|
|
158
|
-
@getpaseo/plugin @getpaseo/plugin/client @getpaseo/plugin/server
|
|
159
|
-
@getpaseo/plugin/client/react-native
|
|
160
|
-
zod react react/jsx-runtime react-native @tanstack/react-query
|
|
161
|
-
node:* (built-ins, in the server bundle)
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Everything in `plugin/package.json` is therefore a **devDependency**, present only
|
|
165
|
-
so `npm run typecheck` works for contributors.
|
|
166
|
-
|
|
167
|
-
> **Nothing may be added to `dependencies`.** A runtime import of anything outside
|
|
168
|
-
> the list above fails `paseo plugin add` for every user with
|
|
169
|
-
> `Build failed: Could not resolve "<pkg>"`, while still working perfectly on any
|
|
170
|
-
> machine that has run `npm install` — so it will not be caught locally. Imports
|
|
171
|
-
> from `@getpaseo/client` and `@getpaseo/protocol` must stay `import type` (erased
|
|
172
|
-
> at build time) or be reimplemented locally; the one runtime use of the Paseo SDK
|
|
173
|
-
> goes through the assembled-specifier `require` in `server/daemon.ts`, precisely
|
|
174
|
-
> so the bundler cannot see it. Before changing an import, read
|
|
175
|
-
> [`VERIFICATION.md`](VERIFICATION.md) §18, which includes the exact
|
|
176
|
-
> no-`node_modules` build command that proves an install still works.
|
|
177
|
-
|
|
178
|
-
### Pairing
|
|
179
|
-
|
|
180
|
-
1. Open **Send to Paseo** in the Paseo sidebar.
|
|
181
|
-
2. Under **Pairing token**, press **Copy** (or **Reveal** and copy by hand).
|
|
182
|
-
3. Paste it into the extension's options page. Simple setup already uses the Primary Paseo
|
|
183
|
-
machine's loopback bridge URL.
|
|
184
|
-
|
|
185
|
-
**Regenerate** issues a new token and immediately invalidates the old one, so any
|
|
186
|
-
paired extension has to be re-paired.
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
195
|
## Configuration
|
|
191
196
|
|
|
192
197
|
All of it lives in the Paseo surface; there is no config file to hunt for.
|
|
@@ -881,11 +886,33 @@ assembled specifier.
|
|
|
881
886
|
The listener cleanup and no-runtime-dependency rules are demonstrated in
|
|
882
887
|
[`VERIFICATION.md`](VERIFICATION.md) §3, §10 and §18.
|
|
883
888
|
|
|
884
|
-
##
|
|
889
|
+
## License
|
|
890
|
+
|
|
891
|
+
[MIT](LICENSE) © 2026 Tom Gringauz.
|
|
892
|
+
|
|
893
|
+
## Navigation and display
|
|
894
|
+
|
|
895
|
+
Open this plugin from Command-K or its sidebar entry. **Overview** and **Display settings** link the main view and settings directly, without opening the Plugins settings page. Hiding a sidebar entry keeps Command-K available.
|
|
896
|
+
|
|
897
|
+
## Paseo 0.14 agent integration
|
|
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.
|
|
900
|
+
|
|
901
|
+
Requires Paseo **0.14.0 or newer**. Agent tools are scoped to interactive Claude
|
|
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.
|
|
906
|
+
|
|
907
|
+
## Other plugins
|
|
885
908
|
|
|
886
|
-
|
|
909
|
+
- [Defer](https://github.com/tomgrin10/paseo-defer) — Schedule messages for later delivery.
|
|
910
|
+
- [Graphite](https://github.com/tomgrin10/paseo-graphite) — Graphite stacks and PR status.
|
|
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
|
+
- [Session Guard](https://github.com/tomgrin10/paseo-session-guard) — Pause at session limits and continue after reset.
|
|
914
|
+
- [Transfer](https://github.com/tomgrin10/paseo-transfer) — Copy or move workspaces between hosts.
|
|
915
|
+
- [Transcript Search](https://github.com/tomgrin10/paseo-transcript-search) — Search conversations across connected hosts.
|
|
916
|
+
- [Dispatch](https://github.com/tomgrin10/paseo-dispatch) — Route tasks to existing workspaces (development preview).
|
|
887
917
|
|
|
888
|
-
- [
|
|
889
|
-
- [Graphite](https://github.com/tomgrin10/paseo-graphite) — Monitor Graphite stacks and PR action state.
|
|
890
|
-
- [Smart Session](https://github.com/tomgrin10/paseo-smart-session) — Context-aware compaction and usage insights for long-running agents.
|
|
891
|
-
- [Vitals](https://github.com/tomgrin10/paseo-vitals) — Host, Paseo, agent, and Docker health in one dashboard.
|
|
918
|
+
- [Follow-up](https://github.com/tomgrin10/paseo-follow-up) — Track workspace PRs, remaining tasks and completion.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { PluginClientContext, PluginSidebarContribution, PluginSurfaceProps } from "@getpaseo/plugin/client";
|
|
2
|
+
import { useSettings } from "@getpaseo/plugin/client";
|
|
3
|
+
import { SettingsAction, SettingsCard, SettingsSection, SettingsSwitch } from "@getpaseo/plugin/client/ui";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { ActivityIndicator, ScrollView, Text, View } from "react-native";
|
|
6
|
+
import { displayPreferences, displayRpc } from "../shared/display";
|
|
7
|
+
import { withNavigation } from "./navigation";
|
|
8
|
+
import { sidebarVisibility } from "./sidebar-visibility";
|
|
9
|
+
|
|
10
|
+
const listeners = new Set<(visible: boolean) => void>();
|
|
11
|
+
|
|
12
|
+
function DisplaySettings({ theme }: PluginSurfaceProps) {
|
|
13
|
+
const settings = useSettings(displayPreferences);
|
|
14
|
+
const visible = settings.status === "ready" ? settings.values.showSidebar : undefined;
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (visible !== undefined) for (const listener of listeners) listener(visible);
|
|
17
|
+
}, [visible]);
|
|
18
|
+
|
|
19
|
+
if (settings.status === "loading") return <ActivityIndicator accessibilityLabel="Loading display settings" color={theme.colors.foregroundMuted} />;
|
|
20
|
+
if (settings.status !== "ready") return (
|
|
21
|
+
<View style={{ gap: 12 }}>
|
|
22
|
+
<Text style={{ color: theme.colors.statusDanger }}>{settings.error}</Text>
|
|
23
|
+
<SettingsCard>
|
|
24
|
+
<SettingsAction label="Try loading the saved settings again" actionLabel="Retry" onPress={() => void settings.reload()} />
|
|
25
|
+
{settings.status === "invalid" && <SettingsAction label="Replace invalid display settings with defaults" actionLabel="Reset" disabled={settings.saving} onPress={() => void settings.reset()} />}
|
|
26
|
+
</SettingsCard>
|
|
27
|
+
{settings.saveError && <Text style={{ color: theme.colors.statusDanger }}>{settings.saveError}</Text>}
|
|
28
|
+
</View>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16, gap: 16 }}>
|
|
33
|
+
<SettingsSection title="Navigation">
|
|
34
|
+
<SettingsCard>
|
|
35
|
+
<SettingsSwitch
|
|
36
|
+
label="Show in sidebar"
|
|
37
|
+
hint="Open this plugin from Command-K (Ctrl-K on Windows and Linux) while viewing a workspace or plugin on this host."
|
|
38
|
+
value={settings.values.showSidebar}
|
|
39
|
+
disabled={settings.saving}
|
|
40
|
+
onValueChange={(showSidebar) => void settings.save({ ...settings.values, showSidebar }, settings.revision)}
|
|
41
|
+
/>
|
|
42
|
+
</SettingsCard>
|
|
43
|
+
{settings.saveError && <Text accessibilityRole="alert" style={{ color: theme.colors.statusDanger }}>{settings.saveError}</Text>}
|
|
44
|
+
</SettingsSection>
|
|
45
|
+
</ScrollView>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Settings notifications reach mounted screens; poll for changes made on other clients. */
|
|
50
|
+
export function contributeDisplay(client: PluginClientContext, item: PluginSidebarContribution) {
|
|
51
|
+
const sidebar = sidebarVisibility(() => client.addSidebarItem(item));
|
|
52
|
+
// Paseo 0.10.1 memoizes sidebar route resolution when an installation mounts.
|
|
53
|
+
// Register synchronously, then reconcile the saved preference, so that an
|
|
54
|
+
// already-open sidebar route can resolve its surface during that first render.
|
|
55
|
+
sidebar.set(true);
|
|
56
|
+
const Settings = withNavigation(DisplaySettings, client, item.surface, "display");
|
|
57
|
+
const removeSurface = client.addSurface("display-settings", Settings);
|
|
58
|
+
const removeSettings = client.addSettingsScreen({ id: "display", title: "Display", icon: "PanelLeft", Component: Settings });
|
|
59
|
+
const removeCommand = client.addCommandCenterItem({
|
|
60
|
+
id: "display-settings",
|
|
61
|
+
title: `${item.title}: display settings`,
|
|
62
|
+
icon: "PanelLeft",
|
|
63
|
+
keywords: [item.title, "sidebar", "show", "hide", "display", "settings"],
|
|
64
|
+
context: "global",
|
|
65
|
+
onSelect({ openSurface }) { openSurface("display-settings"); },
|
|
66
|
+
});
|
|
67
|
+
let disposed = false;
|
|
68
|
+
let pending = false;
|
|
69
|
+
let generation = 0;
|
|
70
|
+
const update = (visible: boolean) => { generation += 1; sidebar.set(visible); };
|
|
71
|
+
listeners.add(update);
|
|
72
|
+
const refresh = async () => {
|
|
73
|
+
if (disposed || pending) return;
|
|
74
|
+
pending = true;
|
|
75
|
+
const currentGeneration = generation;
|
|
76
|
+
try {
|
|
77
|
+
const result = await client.rpc(displayRpc.read, {});
|
|
78
|
+
if (!disposed && generation === currentGeneration && result.status === "ready") {
|
|
79
|
+
const parsed = displayPreferences.schema.safeParse(result.values);
|
|
80
|
+
if (parsed.success) sidebar.set(parsed.data.showSidebar);
|
|
81
|
+
}
|
|
82
|
+
} catch {
|
|
83
|
+
// Retain the last valid preference through temporary disconnects.
|
|
84
|
+
} finally { pending = false; }
|
|
85
|
+
};
|
|
86
|
+
void refresh();
|
|
87
|
+
const timer = setInterval(() => void refresh(), 5000);
|
|
88
|
+
return () => {
|
|
89
|
+
disposed = true;
|
|
90
|
+
clearInterval(timer);
|
|
91
|
+
listeners.delete(update);
|
|
92
|
+
sidebar.dispose();
|
|
93
|
+
removeSurface();
|
|
94
|
+
removeSettings();
|
|
95
|
+
removeCommand();
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import type { PluginClientContext, PluginSurfaceProps } from "@getpaseo/plugin/client";
|
|
3
|
+
import { Pressable, Text, View } from "react-native";
|
|
4
|
+
|
|
5
|
+
export function withNavigation<P extends PluginSurfaceProps>(Component: ComponentType<P>, client: PluginClientContext, home: string, active = "overview") {
|
|
6
|
+
return function PluginView(props: P) {
|
|
7
|
+
return <View style={{ flex: 1, backgroundColor: props.theme.colors.surface0 }}>
|
|
8
|
+
<View accessibilityRole="toolbar" style={{ flexDirection: "row", flexWrap: "wrap", gap: 4, padding: 8, borderBottomWidth: 1, borderColor: props.theme.colors.border }}>
|
|
9
|
+
{[{ id: "overview", title: "Overview", target: home }, { id: "display", title: "Display settings", target: "display-settings" }].map(item => <Pressable key={item.id} accessibilityRole="button" accessibilityState={{ selected: active === item.id }} onPress={() => client.openSurface(item.target)} style={({ pressed }) => ({ minHeight: 44, paddingHorizontal: 12, justifyContent: "center", borderRadius: 6, backgroundColor: pressed || active === item.id ? props.theme.colors.surface2 : "transparent" })}><Text style={{ color: active === item.id ? props.theme.colors.foreground : props.theme.colors.foregroundMuted, fontSize: 13, fontWeight: active === item.id ? "600" : "400" }}>{item.title}</Text></Pressable>)}
|
|
10
|
+
</View>
|
|
11
|
+
<Component {...props} />
|
|
12
|
+
</View>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Own one sidebar registration; late reads cannot register after teardown. */
|
|
2
|
+
export function sidebarVisibility(register: () => (() => void) | void) {
|
|
3
|
+
let disposed = false;
|
|
4
|
+
let remove: (() => void) | undefined;
|
|
5
|
+
return {
|
|
6
|
+
set(visible: boolean) {
|
|
7
|
+
if (disposed) return;
|
|
8
|
+
if (visible && !remove) remove = register() ?? (() => {});
|
|
9
|
+
if (!visible && remove) {
|
|
10
|
+
remove();
|
|
11
|
+
remove = undefined;
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
dispose() {
|
|
15
|
+
if (disposed) return;
|
|
16
|
+
disposed = true;
|
|
17
|
+
remove?.();
|
|
18
|
+
remove = undefined;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
package/index.client.tsx
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { contributeDisplay } from "./client/display";
|
|
2
|
+
import { withNavigation } from "./client/navigation";
|
|
1
3
|
import type { PluginClientContext } from "@getpaseo/plugin/client";
|
|
2
4
|
import { SendToPaseoSettings } from "./client/settings";
|
|
3
5
|
|
|
4
6
|
export default function contribute(client: PluginClientContext) {
|
|
5
|
-
client.addSurface("settings", SendToPaseoSettings);
|
|
6
|
-
client
|
|
7
|
+
client.addSurface("settings", withNavigation(SendToPaseoSettings, client, "settings"));
|
|
8
|
+
const removeDisplay = contributeDisplay(client, {
|
|
7
9
|
id: "send-to-paseo",
|
|
8
10
|
title: "Send to Paseo",
|
|
9
11
|
icon: "Send",
|
|
@@ -19,5 +21,5 @@ export default function contribute(client: PluginClientContext) {
|
|
|
19
21
|
openSurface("settings");
|
|
20
22
|
},
|
|
21
23
|
});
|
|
22
|
-
return () => {};
|
|
24
|
+
return () => { removeDisplay(); };
|
|
23
25
|
}
|
package/index.server.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { contributeAgentTools } from "./server/native-tools";
|
|
2
|
+
import { displayPreferences } from "./shared/display";
|
|
1
3
|
import type { PluginServerContext } from "@getpaseo/plugin/server";
|
|
2
4
|
import {
|
|
3
5
|
addAdditionalMachine,
|
|
@@ -31,6 +33,8 @@ import {
|
|
|
31
33
|
import { requireServerTarget } from "./server/target";
|
|
32
34
|
|
|
33
35
|
export default function contribute(server: PluginServerContext) {
|
|
36
|
+
const removeTools = contributeAgentTools(server);
|
|
37
|
+
server.registerSettings(displayPreferences);
|
|
34
38
|
server.handle(getStatus, async ({ serverId }, { paseo }) => {
|
|
35
39
|
await requireServerTarget(serverId);
|
|
36
40
|
const current = await settings.read();
|
|
@@ -153,5 +157,6 @@ export default function contribute(server: PluginServerContext) {
|
|
|
153
157
|
return enableMachinePrivateAccess();
|
|
154
158
|
});
|
|
155
159
|
|
|
156
|
-
|
|
160
|
+
const stopBridge = runBridge();
|
|
161
|
+
return async () => { removeTools(); await stopBridge(); };
|
|
157
162
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "send-to-paseo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Local HTTP bridge that dispatches PR work to the right Paseo workspace and agent.",
|
|
7
7
|
"repository": {
|
|
@@ -34,15 +34,16 @@
|
|
|
34
34
|
"scripts": {
|
|
35
35
|
"typecheck": "tsc --noEmit",
|
|
36
36
|
"test": "node check-deps.mjs && node --test client/hosts.test.mjs server/main-agent.test.mjs",
|
|
37
|
-
"verify": "npm run typecheck && npm test"
|
|
37
|
+
"verify": "npm run typecheck && npm test && node --test --experimental-strip-types agent-tools.test.mjs && node --test native-tools.test.mjs"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@getpaseo/client": "0.
|
|
41
|
-
"@getpaseo/plugin": "0.
|
|
42
|
-
"@getpaseo/protocol": "0.
|
|
40
|
+
"@getpaseo/client": "0.14.0",
|
|
41
|
+
"@getpaseo/plugin": "0.14.0",
|
|
42
|
+
"@getpaseo/protocol": "0.14.0",
|
|
43
43
|
"@tanstack/react-query": "^5.90.11",
|
|
44
44
|
"@types/node": "^22.10.2",
|
|
45
45
|
"@types/react": "~19.2.0",
|
|
46
|
+
"esbuild": "^0.28.2",
|
|
46
47
|
"react": "19.1.0",
|
|
47
48
|
"react-native": "0.81.5",
|
|
48
49
|
"typescript": "^5.9.3",
|
package/paseo-plugin.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AgentToolDefinition, PluginServerContext } from "@getpaseo/plugin/server";
|
|
2
|
+
|
|
3
|
+
/** 0.14's launch hook is re-evaluated on create, resume, import, and refresh. */
|
|
4
|
+
export function registerAgentTools(server: PluginServerContext, tools: AgentToolDefinition[], workspaceOnly = false) {
|
|
5
|
+
return server.before("agent.session_open", ({ request }) => {
|
|
6
|
+
if (request.purpose !== "interactive" || !["claude", "codex"].includes(request.provider)
|
|
7
|
+
|| request.labels["plugin-tools/enabled"] === "false" || (workspaceOnly && !request.workspaceId)) return;
|
|
8
|
+
return { ...request, tools: [...request.tools, ...tools] };
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineAgentTool, type PluginServerContext } from "@getpaseo/plugin/server";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getBridgeStatus } from "./bridge";
|
|
4
|
+
import { dependencySnapshot } from "./deps";
|
|
5
|
+
import { registerAgentTools } from "./agent-tools";
|
|
6
|
+
export function contributeAgentTools(server: PluginServerContext) {
|
|
7
|
+
return registerAgentTools(server, [defineAgentTool({
|
|
8
|
+
name: "send_to_paseo_bridge_status", description: "Diagnose the Send to Paseo browser bridge and required executables. Never returns pairing tokens, connection codes, credentials or recent prompt text. Does not start agents or change pairing.",
|
|
9
|
+
input: z.object({}).strict(),
|
|
10
|
+
async execute(_, { signal }) {
|
|
11
|
+
if (signal.aborted) throw new Error("Tool call cancelled.");
|
|
12
|
+
const [bridge, deps] = await Promise.all([getBridgeStatus(), dependencySnapshot()]);
|
|
13
|
+
const result = { state: bridge.state, port: bridge.port, paired: bridge.paired, dryRun: bridge.dryRun, defaultProvider: bridge.defaultProvider, agentDispatch: bridge.agentDispatch, dependencies: deps.dependencies.map(dep => ({ name: dep.name, state: dep.state })) };
|
|
14
|
+
return { text: JSON.stringify(result), structuredContent: result };
|
|
15
|
+
},
|
|
16
|
+
})]);
|
|
17
|
+
}
|
package/shared/contracts.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { z } from "zod";
|
|
|
9
9
|
|
|
10
10
|
/** Advertised in `GET /v1/ping`. Keep in step with `package.json`. */
|
|
11
11
|
export const PLUGIN_NAME = "send-to-paseo";
|
|
12
|
-
export const PLUGIN_VERSION = "
|
|
12
|
+
export const PLUGIN_VERSION = "2.0.0";
|
|
13
13
|
/** Bumped only for an incompatible bridge API; the paths stay `/v1`. */
|
|
14
14
|
export const CONTRACT_VERSION = 1;
|
|
15
15
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineSettings, settingsRpc } from "@getpaseo/plugin";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const displayPreferences = defineSettings({
|
|
5
|
+
id: "display",
|
|
6
|
+
scope: "host",
|
|
7
|
+
version: 1,
|
|
8
|
+
schema: z.object({ showSidebar: z.boolean().default(true) }),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const displayRpc = settingsRpc(displayPreferences.id);
|