send-to-paseo 1.3.0 → 1.4.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 CHANGED
@@ -112,13 +112,13 @@ before installing it.
112
112
  One command from npm. No clone or build step:
113
113
 
114
114
  ```sh
115
- paseo plugin install npm:send-to-paseo@1.3.0
115
+ paseo plugin install npm:send-to-paseo
116
116
  paseo plugin ls # expect: send-to-paseo running yes
117
117
  paseo plugin logs send-to-paseo
118
118
  ```
119
119
 
120
- The same release is available directly from Git with
121
- `paseo plugin add tomgrin10/send-to-paseo --path plugin --ref v1.3.0`.
120
+ The latest release is also available directly from Git with
121
+ `paseo plugin add tomgrin10/send-to-paseo --path plugin`.
122
122
  `pluginsEnabled` must already be `true` in the daemon's `config.json`.
123
123
 
124
124
  There is nothing to install because the plugin imports nothing at runtime that
@@ -483,12 +483,15 @@ curl -s -X POST http://127.0.0.1:7788/v1/send \
483
483
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
484
484
  -d '{"forge":"github","owner":"acmegizmos","repo":"gizmo-poc","number":942,
485
485
  "prompt":"Fix merge conflicts","target":{"kind":"create"},
486
- "modeId":"auto"}'
486
+ "agentDispatch":"new","modeId":"auto"}'
487
487
  ```
488
488
 
489
489
  For a new-agent send, `/v1/resolve` reports the mode it would actually use, so the popover can
490
- preselect what will happen rather than guess. In main-agent mode the popover hides model/mode
491
- controls because they cannot change an existing agent:
490
+ preselect what will happen rather than guess. The resolve response also supplies the saved
491
+ agent-destination preference and reusable-agent previews. The popover initializes its Agent
492
+ dropdown from that preference, then sends `agentDispatch` as a per-request override. When the
493
+ user chooses **Use main agent**, it hides model/mode controls because they cannot change an
494
+ existing agent:
492
495
 
493
496
  ```sh
494
497
  $ curl -s -X POST http://127.0.0.1:7788/v1/resolve \
@@ -695,9 +698,11 @@ When a send creates a new agent, it uses:
695
698
  `paseo://h/<serverId>/agent/<agentId>`.
696
699
  - `dryRun`: always present, `false` on a real send.
697
700
 
698
- If main-agent mode finds no eligible root, it follows that same creation path. A successful reuse
699
- instead returns `agentCreated: false`, `dispatch: "main"`, and the existing agent's title and deep
700
- link. New-agent and fallback paths return `agentCreated: true`, `dispatch: "new"`.
701
+ If a request asks for main-agent reuse but no eligible root exists, it follows that same creation
702
+ path. A successful reuse instead returns `agentCreated: false`, `dispatch: "main"`, and the
703
+ existing agent's title and deep link. New-agent and fallback paths return `agentCreated: true`,
704
+ `dispatch: "new"`. Omitting `agentDispatch` preserves the plugin's saved preference for older
705
+ clients.
701
706
 
702
707
  `prompt` is validated as 1..16000 **Unicode code points after trim**, so an emoji counts once.
703
708
  The 64 KiB byte cap on the body is independent and is applied first, so a prompt inside the
@@ -1080,13 +1080,13 @@ export function SendToPaseoSettings({ theme, host, layout, navigation }: PluginS
1080
1080
  </View>
1081
1081
 
1082
1082
  <View style={styles.card}>
1083
- <Text style={styles.heading}>Agent destination</Text>
1083
+ <Text style={styles.heading}>Default agent destination</Text>
1084
1084
  <Text style={styles.muted}>
1085
- Choose whether each send starts fresh or continues the workspace&apos;s main agent.
1085
+ Sets the extension dropdown&apos;s initial choice. You can override it for each send.
1086
1086
  </Text>
1087
1087
  <Pressable
1088
1088
  accessibilityRole="button"
1089
- accessibilityLabel="Start a new agent for every send"
1089
+ accessibilityLabel="Default each send to a new agent"
1090
1090
  onPress={() => saveDispatch.mutate("new")}
1091
1091
  style={(status?.agentDispatch ?? "new") === "new" ? styles.selectedRow : undefined}
1092
1092
  >
@@ -1099,7 +1099,7 @@ export function SendToPaseoSettings({ theme, host, layout, navigation }: PluginS
1099
1099
  </Pressable>
1100
1100
  <Pressable
1101
1101
  accessibilityRole="button"
1102
- accessibilityLabel="Continue the main agent in the target workspace"
1102
+ accessibilityLabel="Default each send to the main agent in the target workspace"
1103
1103
  onPress={() => saveDispatch.mutate("main")}
1104
1104
  style={status?.agentDispatch === "main" ? styles.selectedRow : undefined}
1105
1105
  >
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "send-to-paseo",
3
3
  "type": "module",
4
- "version": "1.3.0",
4
+ "version": "1.4.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": {
package/server/resolve.ts CHANGED
@@ -228,7 +228,6 @@ export async function buildCandidates(input: {
228
228
  stackBranches: Map<string, StackMember>;
229
229
  /** Non-null when `gh` could not be consulted; carried into the create label. */
230
230
  outage?: GhOutage | null;
231
- agentDispatch?: "new" | "main";
232
231
  agents?: readonly ListedAgent[];
233
232
  }): Promise<{ candidates: Candidate[]; defaultCandidateIndex: number }> {
234
233
  const { counts, agents } = await workspaceAgents(
@@ -261,20 +260,18 @@ export async function buildCandidates(input: {
261
260
  cwd: workspace.workspaceDirectory,
262
261
  isolation: isolationOf(workspace),
263
262
  agentCount: counts.get(workspace.id) ?? 0,
264
- ...(input.agentDispatch === "main"
265
- ? (() => {
266
- const main = selectMainAgent(agents, workspace.id);
267
- return main === null
268
- ? {}
269
- : {
270
- mainAgent: {
271
- agentId: main.id,
272
- title: agentDisplayTitle(main),
273
- status: main.status,
274
- },
275
- };
276
- })()
277
- : {}),
263
+ ...(() => {
264
+ const main = selectMainAgent(agents, workspace.id);
265
+ return main === null
266
+ ? {}
267
+ : {
268
+ mainAgent: {
269
+ agentId: main.id,
270
+ title: agentDisplayTitle(main),
271
+ status: main.status,
272
+ },
273
+ };
274
+ })(),
278
275
  };
279
276
  if (branch !== null && branch === input.pr.headBranch) {
280
277
  existing.push({ ...base, rank: 1, reason: "exact" });
@@ -1018,7 +1015,6 @@ export async function handleResolve(request: ResolveRequest): Promise<ResolveRes
1018
1015
  workspaces,
1019
1016
  stackBranches,
1020
1017
  outage,
1021
- agentDispatch: currentSettings.agentDispatch,
1022
1018
  agents: await agentsPromise,
1023
1019
  });
1024
1020
  const { providers } = await providersPromise;
package/server/send.ts CHANGED
@@ -223,7 +223,9 @@ export async function handleSend(request: SendRequest): Promise<SendResponse> {
223
223
  // title, the branches and the stack note in the prompt, not the send.
224
224
  const { pr, outage } = prLookup;
225
225
  const title = buildAgentTitle(ref.number, prompt);
226
- const configuredDispatch = currentSettings.agentDispatch;
226
+ // The composer can override the saved preference for one send. Older
227
+ // extensions omit the field and keep the historical settings-driven path.
228
+ const agentDispatch = request.agentDispatch ?? currentSettings.agentDispatch;
227
229
 
228
230
  let workspaceId: string;
229
231
  let workspaceLabel: string;
@@ -302,7 +304,7 @@ export async function handleSend(request: SendRequest): Promise<SendResponse> {
302
304
  });
303
305
 
304
306
  let mainAgent: ListedAgent | null = null;
305
- if (configuredDispatch === "main" && request.target.kind === "existing") {
307
+ if (agentDispatch === "main" && request.target.kind === "existing") {
306
308
  try {
307
309
  mainAgent = selectMainAgent(
308
310
  await listProjectAgents(paseo, project.projectId),
@@ -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 = "1.3.0";
12
+ export const PLUGIN_VERSION = "1.4.0";
13
13
  /** Bumped only for an incompatible bridge API; the paths stay `/v1`. */
14
14
  export const CONTRACT_VERSION = 1;
15
15
 
@@ -131,6 +131,8 @@ export const SendRequestSchema = PrRefSchema.extend({
131
131
  */
132
132
  prompt: z.string(),
133
133
  target: SendTargetSchema,
134
+ /** Per-send override. Missing preserves the plugin's saved preference. */
135
+ agentDispatch: AgentDispatchSchema.optional(),
134
136
  provider: z.string().min(1).max(200).optional(),
135
137
  /**
136
138
  * Permission mode for the new agent, e.g. `auto` or `bypassPermissions`.