@gricha/perry 0.2.5 → 0.2.6
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/dist/agent/router.js +29 -0
- package/dist/agent/run.js +4 -0
- package/dist/agent/web/assets/{index-0UMxrAK_.js → index-DhU_amC3.js} +34 -34
- package/dist/agent/web/index.html +1 -1
- package/dist/perry-worker +0 -0
- package/dist/terminal/handler.js +17 -1
- package/dist/terminal/host-handler.js +19 -1
- package/dist/terminal/websocket.js +5 -0
- package/package.json +1 -1
package/dist/agent/router.js
CHANGED
|
@@ -71,6 +71,9 @@ const SSHKeyInfoSchema = z.object({
|
|
|
71
71
|
fingerprint: z.string(),
|
|
72
72
|
hasPrivateKey: z.boolean(),
|
|
73
73
|
});
|
|
74
|
+
const TerminalSettingsSchema = z.object({
|
|
75
|
+
preferredShell: z.string().optional(),
|
|
76
|
+
});
|
|
74
77
|
function mapErrorToORPC(err, defaultMessage) {
|
|
75
78
|
const message = err instanceof Error ? err.message : defaultMessage;
|
|
76
79
|
if (message.includes('not found')) {
|
|
@@ -314,6 +317,28 @@ export function createRouter(ctx) {
|
|
|
314
317
|
const listSSHKeys = os.output(z.array(SSHKeyInfoSchema)).handler(async () => {
|
|
315
318
|
return discoverSSHKeys();
|
|
316
319
|
});
|
|
320
|
+
const getTerminalSettings = os
|
|
321
|
+
.output(z.object({
|
|
322
|
+
preferredShell: z.string().optional(),
|
|
323
|
+
detectedShell: z.string().optional(),
|
|
324
|
+
}))
|
|
325
|
+
.handler(async () => {
|
|
326
|
+
const config = ctx.config.get();
|
|
327
|
+
return {
|
|
328
|
+
preferredShell: config.terminal?.preferredShell,
|
|
329
|
+
detectedShell: process.env.SHELL,
|
|
330
|
+
};
|
|
331
|
+
});
|
|
332
|
+
const updateTerminalSettings = os
|
|
333
|
+
.input(TerminalSettingsSchema)
|
|
334
|
+
.output(TerminalSettingsSchema)
|
|
335
|
+
.handler(async ({ input }) => {
|
|
336
|
+
const currentConfig = ctx.config.get();
|
|
337
|
+
const newConfig = { ...currentConfig, terminal: input };
|
|
338
|
+
ctx.config.set(newConfig);
|
|
339
|
+
await saveAgentConfig(newConfig, ctx.configDir);
|
|
340
|
+
return input;
|
|
341
|
+
});
|
|
317
342
|
const GitHubRepoSchema = z.object({
|
|
318
343
|
name: z.string(),
|
|
319
344
|
fullName: z.string(),
|
|
@@ -994,6 +1019,10 @@ export function createRouter(ctx) {
|
|
|
994
1019
|
update: updateSSHSettings,
|
|
995
1020
|
listKeys: listSSHKeys,
|
|
996
1021
|
},
|
|
1022
|
+
terminal: {
|
|
1023
|
+
get: getTerminalSettings,
|
|
1024
|
+
update: updateTerminalSettings,
|
|
1025
|
+
},
|
|
997
1026
|
},
|
|
998
1027
|
};
|
|
999
1028
|
}
|
package/dist/agent/run.js
CHANGED
|
@@ -49,10 +49,14 @@ function createAgentServer(configDir, config, tailscale) {
|
|
|
49
49
|
}
|
|
50
50
|
return containerRunning(getContainerName(name));
|
|
51
51
|
};
|
|
52
|
+
const getPreferredShell = () => {
|
|
53
|
+
return currentConfig.terminal?.preferredShell || process.env.SHELL;
|
|
54
|
+
};
|
|
52
55
|
const terminalServer = new TerminalWebSocketServer({
|
|
53
56
|
getContainerName,
|
|
54
57
|
isWorkspaceRunning,
|
|
55
58
|
isHostAccessAllowed: () => currentConfig.allowHostAccess === true,
|
|
59
|
+
getPreferredShell,
|
|
56
60
|
});
|
|
57
61
|
const chatServer = new ChatWebSocketServer({
|
|
58
62
|
isWorkspaceRunning,
|