@camerontaylor/paseo-cli 0.10.1-fork.1 → 0.11.0-beta.1.fork.1
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.
|
@@ -14,10 +14,17 @@ export function addOpenOptions(command) {
|
|
|
14
14
|
.argument("<agent-id>", "Existing agent ID")
|
|
15
15
|
.option("--server <server-id>", "Server ID (defaults to the local daemon)");
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
function toOpenError(err) {
|
|
18
|
+
if (err && typeof err === "object" && "code" in err) {
|
|
19
|
+
return err;
|
|
20
|
+
}
|
|
21
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
22
|
+
return { code: "OPEN_FAILED", message: `Failed to open agent: ${message}` };
|
|
23
|
+
}
|
|
24
|
+
async function resolveAgentTarget(agentId, options) {
|
|
18
25
|
const explicitServerId = typeof options.server === "string" ? options.server.trim() : "";
|
|
19
26
|
if (explicitServerId) {
|
|
20
|
-
return explicitServerId;
|
|
27
|
+
return { serverId: explicitServerId, agentId };
|
|
21
28
|
}
|
|
22
29
|
const client = await connectToDaemon({ target: options.daemonTarget });
|
|
23
30
|
try {
|
|
@@ -29,7 +36,19 @@ async function resolveServerId(options) {
|
|
|
29
36
|
};
|
|
30
37
|
throw error;
|
|
31
38
|
}
|
|
32
|
-
|
|
39
|
+
const fetchResult = await client.fetchAgent({ agentId });
|
|
40
|
+
if (!fetchResult) {
|
|
41
|
+
const error = {
|
|
42
|
+
code: "AGENT_NOT_FOUND",
|
|
43
|
+
message: `Agent not found: ${agentId}`,
|
|
44
|
+
details: 'Use "paseo ls" to list available agents',
|
|
45
|
+
};
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
return { serverId, agentId: fetchResult.agent.id };
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
throw toOpenError(err);
|
|
33
52
|
}
|
|
34
53
|
finally {
|
|
35
54
|
await client.close().catch(() => { });
|
|
@@ -44,11 +63,11 @@ export async function runOpenCommand(agentIdArg, options, _command) {
|
|
|
44
63
|
};
|
|
45
64
|
throw error;
|
|
46
65
|
}
|
|
47
|
-
const
|
|
48
|
-
await openDesktopWithAgent(
|
|
66
|
+
const target = await resolveAgentTarget(agentId, options);
|
|
67
|
+
await openDesktopWithAgent(target);
|
|
49
68
|
return {
|
|
50
69
|
type: "single",
|
|
51
|
-
data: {
|
|
70
|
+
data: { ...target, status: "opened" },
|
|
52
71
|
schema: openAgentSchema,
|
|
53
72
|
};
|
|
54
73
|
}
|
|
@@ -18,17 +18,23 @@ const TSCONFIG = {
|
|
|
18
18
|
},
|
|
19
19
|
include: ["**/*.ts", "**/*.tsx"],
|
|
20
20
|
};
|
|
21
|
-
const CLIENT_ENTRY = `import type { PluginClientContext } from "@camerontaylor/paseo-plugin/client";
|
|
22
|
-
import {
|
|
21
|
+
const CLIENT_ENTRY = `import type { PluginClientContext, PluginSidebarItemProps } from "@camerontaylor/paseo-plugin/client";
|
|
22
|
+
import { SidebarRow } from "@camerontaylor/paseo-plugin/client/ui";
|
|
23
|
+
import { GreetingScreen } from "./client/greeting";
|
|
24
|
+
|
|
25
|
+
function GreetingItem({ currentScreen, openScreen }: PluginSidebarItemProps) {
|
|
26
|
+
return (
|
|
27
|
+
<SidebarRow
|
|
28
|
+
icon="MessageCircle"
|
|
29
|
+
active={currentScreen?.screenId === "greeting"}
|
|
30
|
+
onPress={() => openScreen({ screenId: "greeting" })}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
23
34
|
|
|
24
35
|
export default function contribute(client: PluginClientContext) {
|
|
25
|
-
client.
|
|
26
|
-
client.
|
|
27
|
-
id: "greeting",
|
|
28
|
-
title: "Greeting",
|
|
29
|
-
icon: "MessageCircle",
|
|
30
|
-
surface: "greeting",
|
|
31
|
-
});
|
|
36
|
+
client.addScreen({ id: "greeting", title: "Greeting", Component: GreetingScreen });
|
|
37
|
+
client.addSidebarHeaderItem({ id: "greeting", title: "Greeting", Component: GreetingItem });
|
|
32
38
|
return () => {};
|
|
33
39
|
}
|
|
34
40
|
`;
|
|
@@ -57,7 +63,7 @@ export function createGreeting({ name }: RpcInput<typeof greetingRpc>) {
|
|
|
57
63
|
return { message: "Hello, " + name + "!" };
|
|
58
64
|
}
|
|
59
65
|
`;
|
|
60
|
-
const CLIENT_GREETING = `import type {
|
|
66
|
+
const CLIENT_GREETING = `import type { PluginScreenProps } from "@camerontaylor/paseo-plugin/client";
|
|
61
67
|
import { useRpc } from "@camerontaylor/paseo-plugin/client";
|
|
62
68
|
import { useMutation } from "@tanstack/react-query";
|
|
63
69
|
import { useMemo } from "react";
|
|
@@ -65,7 +71,7 @@ import { Pressable, Text, View } from "react-native";
|
|
|
65
71
|
import { greetingRpc } from "../shared/greeting";
|
|
66
72
|
import { openExternal } from "./web";
|
|
67
73
|
|
|
68
|
-
export function
|
|
74
|
+
export function GreetingScreen({ theme, layout }: PluginScreenProps) {
|
|
69
75
|
const createGreeting = useRpc(greetingRpc);
|
|
70
76
|
const greeting = useMutation({ mutationFn: createGreeting });
|
|
71
77
|
const styles = useMemo(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camerontaylor/paseo-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0-beta.1.fork.1",
|
|
4
4
|
"description": "Paseo CLI - control your AI coding agents from the command line",
|
|
5
5
|
"bin": {
|
|
6
6
|
"paseo": "bin/paseo"
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@clack/prompts": "^1.0.0",
|
|
31
|
-
"@camerontaylor/paseo-client": "0.
|
|
32
|
-
"@camerontaylor/paseo-protocol": "0.
|
|
33
|
-
"@camerontaylor/paseo-server": "0.
|
|
31
|
+
"@camerontaylor/paseo-client": "0.11.0-beta.1.fork.1",
|
|
32
|
+
"@camerontaylor/paseo-protocol": "0.11.0-beta.1.fork.1",
|
|
33
|
+
"@camerontaylor/paseo-server": "0.11.0-beta.1.fork.1",
|
|
34
34
|
"chalk": "^5.3.0",
|
|
35
35
|
"commander": "^12.0.0",
|
|
36
36
|
"mime-types": "^2.1.35",
|