@bytetrue/byspace 0.11.2 → 0.12.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/node_modules/@getpaseo/client/dist/daemon-client.d.ts +8 -3
- package/node_modules/@getpaseo/client/dist/daemon-client.js +21 -2
- package/node_modules/@getpaseo/client/package.json +3 -3
- package/node_modules/@getpaseo/highlight/package.json +1 -1
- package/node_modules/@getpaseo/plugin/package.json +5 -5
- package/node_modules/@getpaseo/protocol/dist/generated/validation/ws-outbound.aot.js +3610 -3533
- package/node_modules/@getpaseo/protocol/dist/messages.d.ts +89 -0
- package/node_modules/@getpaseo/protocol/dist/messages.js +35 -0
- package/node_modules/@getpaseo/protocol/dist/validation/ws-outbound-schema-metadata.d.ts +14 -0
- package/node_modules/@getpaseo/protocol/package.json +1 -1
- package/node_modules/@getpaseo/relay/package.json +1 -1
- package/node_modules/@getpaseo/server/dist/server/server/agent/agent-manager.d.ts +2 -0
- package/node_modules/@getpaseo/server/dist/server/server/agent/agent-manager.js +26 -0
- package/node_modules/@getpaseo/server/dist/server/server/agent/providers/pi/agent.d.ts +14 -0
- package/node_modules/@getpaseo/server/dist/server/server/agent/providers/pi/agent.js +79 -4
- package/node_modules/@getpaseo/server/dist/server/server/authorization/operation-permissions.js +2 -0
- package/node_modules/@getpaseo/server/dist/server/server/bootstrap.d.ts +1 -0
- package/node_modules/@getpaseo/server/dist/server/server/bootstrap.js +31 -8
- package/node_modules/@getpaseo/server/dist/server/server/config.js +5 -1
- package/node_modules/@getpaseo/server/dist/server/server/daemon-config-store.js +8 -0
- package/node_modules/@getpaseo/server/dist/server/server/persisted-config.d.ts +3 -0
- package/node_modules/@getpaseo/server/dist/server/server/persisted-config.js +3 -0
- package/node_modules/@getpaseo/server/dist/server/server/session.js +1 -0
- package/node_modules/@getpaseo/server/dist/server/server/websocket-server.js +4 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/shell-detect.d.ts +51 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/shell-detect.js +196 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-manager-factory.d.ts +2 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-manager.d.ts +1 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-manager.js +1 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-persistence.d.ts +15 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-persistence.js +127 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-session-controller.d.ts +4 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-session-controller.js +35 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-session-store.d.ts +19 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-session-store.js +59 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/terminal-worker-protocol.d.ts +1 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/worker-terminal-manager.d.ts +2 -0
- package/node_modules/@getpaseo/server/dist/server/terminal/worker-terminal-manager.js +2 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-bridge-8569047c23404e68f926a8a0f411b731.js → desktop-attachment-bridge-d6e29a06a5bfb4d50647dcdf2dfc2edc.js} +1 -1
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-bridge-8569047c23404e68f926a8a0f411b731.js.br → desktop-attachment-bridge-d6e29a06a5bfb4d50647dcdf2dfc2edc.js.br} +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-d6e29a06a5bfb4d50647dcdf2dfc2edc.js.gz +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-store-49a16787c67d7db16d4dfbaebda6f27b.js → desktop-attachment-store-9917f2388804e462b0df3cf5f1b5df19.js} +1 -1
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-store-49a16787c67d7db16d4dfbaebda6f27b.js.br → desktop-attachment-store-9917f2388804e462b0df3cf5f1b5df19.js.br} +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-store-49a16787c67d7db16d4dfbaebda6f27b.js.gz → desktop-attachment-store-9917f2388804e462b0df3cf5f1b5df19.js.gz} +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-b212198c3637c3d62c7f576170b813d4.js → index-d66590127d71cde67bbb3776075bb688.js} +67 -66
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-d66590127d71cde67bbb3776075bb688.js.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-d66590127d71cde67bbb3776075bb688.js.gz +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{indexeddb-attachment-store-b87d428d16d555a6e2a897903a24bc52.js → indexeddb-attachment-store-35cbb0fd3d120aac9caca241e4dedf6c.js} +1 -1
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{indexeddb-attachment-store-b87d428d16d555a6e2a897903a24bc52.js.br → indexeddb-attachment-store-35cbb0fd3d120aac9caca241e4dedf6c.js.br} +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-35cbb0fd3d120aac9caca241e4dedf6c.js.gz +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{native-file-attachment-store-44c208843bd97caf1582f78c04c2fa76.js → native-file-attachment-store-278a4b844d28852fc6ef5dfde6d70583.js} +3 -3
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-278a4b844d28852fc6ef5dfde6d70583.js.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-278a4b844d28852fc6ef5dfde6d70583.js.gz +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html +1 -1
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.gz +0 -0
- package/node_modules/@getpaseo/server/dist/src/server/persisted-config.js +3 -0
- package/node_modules/@getpaseo/server/package.json +6 -6
- package/package.json +8 -8
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-8569047c23404e68f926a8a0f411b731.js.gz +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-b212198c3637c3d62c7f576170b813d4.js.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-b212198c3637c3d62c7f576170b813d4.js.gz +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-b87d428d16d555a6e2a897903a24bc52.js.gz +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-44c208843bd97caf1582f78c04c2fa76.js.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-44c208843bd97caf1582f78c04c2fa76.js.gz +0 -0
|
@@ -128,6 +128,7 @@ export declare const MutableDaemonConfigSchema: z.ZodObject<{
|
|
|
128
128
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
129
|
icon: z.ZodOptional<z.ZodString>;
|
|
130
130
|
}, z.core.$loose>>>;
|
|
131
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
132
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
132
133
|
id: z.ZodString;
|
|
133
134
|
name: z.ZodString;
|
|
@@ -193,6 +194,7 @@ export declare const MutableDaemonConfigPatchSchema: z.ZodObject<{
|
|
|
193
194
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
194
195
|
icon: z.ZodOptional<z.ZodString>;
|
|
195
196
|
}, z.core.$loose>>>>;
|
|
197
|
+
terminalDefaultShell: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
196
198
|
agentProfiles: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
197
199
|
id: z.ZodString;
|
|
198
200
|
name: z.ZodString;
|
|
@@ -1713,6 +1715,7 @@ export declare const SetDaemonConfigRequestMessageSchema: z.ZodObject<{
|
|
|
1713
1715
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1714
1716
|
icon: z.ZodOptional<z.ZodString>;
|
|
1715
1717
|
}, z.core.$loose>>>>;
|
|
1718
|
+
terminalDefaultShell: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1716
1719
|
agentProfiles: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1717
1720
|
id: z.ZodString;
|
|
1718
1721
|
name: z.ZodString;
|
|
@@ -3514,6 +3517,29 @@ export declare const RenameTerminalRequestSchema: z.ZodObject<{
|
|
|
3514
3517
|
title: z.ZodString;
|
|
3515
3518
|
requestId: z.ZodString;
|
|
3516
3519
|
}, z.core.$strip>;
|
|
3520
|
+
export declare const TerminalShellDetectRequestSchema: z.ZodObject<{
|
|
3521
|
+
type: z.ZodLiteral<"terminal.shell.detect.request">;
|
|
3522
|
+
requestId: z.ZodString;
|
|
3523
|
+
}, z.core.$strip>;
|
|
3524
|
+
/** A shell executable the daemon found installed on the host machine. */
|
|
3525
|
+
export declare const DetectedShellSchema: z.ZodObject<{
|
|
3526
|
+
path: z.ZodString;
|
|
3527
|
+
name: z.ZodString;
|
|
3528
|
+
}, z.core.$strip>;
|
|
3529
|
+
export type DetectedShell = z.infer<typeof DetectedShellSchema>;
|
|
3530
|
+
export declare const TerminalShellDetectResponseSchema: z.ZodObject<{
|
|
3531
|
+
type: z.ZodLiteral<"terminal.shell.detect.response">;
|
|
3532
|
+
payload: z.ZodObject<{
|
|
3533
|
+
shells: z.ZodArray<z.ZodObject<{
|
|
3534
|
+
path: z.ZodString;
|
|
3535
|
+
name: z.ZodString;
|
|
3536
|
+
}, z.core.$strip>>;
|
|
3537
|
+
resolvedDefault: z.ZodString;
|
|
3538
|
+
configured: z.ZodOptional<z.ZodString>;
|
|
3539
|
+
error: z.ZodNullable<z.ZodString>;
|
|
3540
|
+
requestId: z.ZodString;
|
|
3541
|
+
}, z.core.$strip>;
|
|
3542
|
+
}, z.core.$strip>;
|
|
3517
3543
|
export declare const StartWorkspaceScriptRequestSchema: z.ZodObject<{
|
|
3518
3544
|
type: z.ZodLiteral<"start_workspace_script_request">;
|
|
3519
3545
|
workspaceId: z.ZodString;
|
|
@@ -4507,6 +4533,7 @@ export declare const SessionInboundMessageSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
4507
4533
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4508
4534
|
icon: z.ZodOptional<z.ZodString>;
|
|
4509
4535
|
}, z.core.$loose>>>>;
|
|
4536
|
+
terminalDefaultShell: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
4510
4537
|
agentProfiles: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4511
4538
|
id: z.ZodString;
|
|
4512
4539
|
name: z.ZodString;
|
|
@@ -5697,6 +5724,9 @@ export declare const SessionInboundMessageSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
5697
5724
|
terminalId: z.ZodString;
|
|
5698
5725
|
title: z.ZodString;
|
|
5699
5726
|
requestId: z.ZodString;
|
|
5727
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5728
|
+
type: z.ZodLiteral<"terminal.shell.detect.request">;
|
|
5729
|
+
requestId: z.ZodString;
|
|
5700
5730
|
}, z.core.$strip>, z.ZodObject<{
|
|
5701
5731
|
type: z.ZodLiteral<"start_workspace_script_request">;
|
|
5702
5732
|
workspaceId: z.ZodString;
|
|
@@ -6130,6 +6160,7 @@ export declare const ServerInfoStatusPayloadSchema: z.ZodPipe<z.ZodObject<{
|
|
|
6130
6160
|
skillManagement: z.ZodOptional<z.ZodBoolean>;
|
|
6131
6161
|
projectSetupSkill: z.ZodOptional<z.ZodBoolean>;
|
|
6132
6162
|
terminalAgentHookProviders: z.ZodOptional<z.ZodBoolean>;
|
|
6163
|
+
terminalShellConfig: z.ZodOptional<z.ZodBoolean>;
|
|
6133
6164
|
"terminal-restore-modes": z.ZodOptional<z.ZodBoolean>;
|
|
6134
6165
|
"terminal-input-mode-replay": z.ZodOptional<z.ZodBoolean>;
|
|
6135
6166
|
"terminal-size-ownership": z.ZodOptional<z.ZodBoolean>;
|
|
@@ -6217,6 +6248,7 @@ export declare const ServerInfoStatusPayloadSchema: z.ZodPipe<z.ZodObject<{
|
|
|
6217
6248
|
skillManagement?: boolean | undefined;
|
|
6218
6249
|
projectSetupSkill?: boolean | undefined;
|
|
6219
6250
|
terminalAgentHookProviders?: boolean | undefined;
|
|
6251
|
+
terminalShellConfig?: boolean | undefined;
|
|
6220
6252
|
"terminal-restore-modes"?: boolean | undefined;
|
|
6221
6253
|
"terminal-input-mode-replay"?: boolean | undefined;
|
|
6222
6254
|
"terminal-size-ownership"?: boolean | undefined;
|
|
@@ -6305,6 +6337,7 @@ export declare const ServerInfoStatusPayloadSchema: z.ZodPipe<z.ZodObject<{
|
|
|
6305
6337
|
skillManagement?: boolean | undefined;
|
|
6306
6338
|
projectSetupSkill?: boolean | undefined;
|
|
6307
6339
|
terminalAgentHookProviders?: boolean | undefined;
|
|
6340
|
+
terminalShellConfig?: boolean | undefined;
|
|
6308
6341
|
"terminal-restore-modes"?: boolean | undefined;
|
|
6309
6342
|
"terminal-input-mode-replay"?: boolean | undefined;
|
|
6310
6343
|
"terminal-size-ownership"?: boolean | undefined;
|
|
@@ -6594,6 +6627,7 @@ export declare const DaemonConfigChangedStatusPayloadSchema: z.ZodObject<{
|
|
|
6594
6627
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6595
6628
|
icon: z.ZodOptional<z.ZodString>;
|
|
6596
6629
|
}, z.core.$loose>>>;
|
|
6630
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6597
6631
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6598
6632
|
id: z.ZodString;
|
|
6599
6633
|
name: z.ZodString;
|
|
@@ -6839,6 +6873,7 @@ export declare const KnownStatusPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObj
|
|
|
6839
6873
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6840
6874
|
icon: z.ZodOptional<z.ZodString>;
|
|
6841
6875
|
}, z.core.$loose>>>;
|
|
6876
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6842
6877
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6843
6878
|
id: z.ZodString;
|
|
6844
6879
|
name: z.ZodString;
|
|
@@ -11684,6 +11719,7 @@ export declare const GetDaemonConfigResponseMessageSchema: z.ZodObject<{
|
|
|
11684
11719
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11685
11720
|
icon: z.ZodOptional<z.ZodString>;
|
|
11686
11721
|
}, z.core.$loose>>>;
|
|
11722
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11687
11723
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11688
11724
|
id: z.ZodString;
|
|
11689
11725
|
name: z.ZodString;
|
|
@@ -11973,6 +12009,7 @@ export declare const SetDaemonConfigResponseMessageSchema: z.ZodObject<{
|
|
|
11973
12009
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11974
12010
|
icon: z.ZodOptional<z.ZodString>;
|
|
11975
12011
|
}, z.core.$loose>>>;
|
|
12012
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11976
12013
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11977
12014
|
id: z.ZodString;
|
|
11978
12015
|
name: z.ZodString;
|
|
@@ -20654,6 +20691,7 @@ export declare const SessionOutboundMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
20654
20691
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20655
20692
|
icon: z.ZodOptional<z.ZodString>;
|
|
20656
20693
|
}, z.core.$loose>>>;
|
|
20694
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20657
20695
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
20658
20696
|
id: z.ZodString;
|
|
20659
20697
|
name: z.ZodString;
|
|
@@ -20737,6 +20775,7 @@ export declare const SessionOutboundMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
20737
20775
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20738
20776
|
icon: z.ZodOptional<z.ZodString>;
|
|
20739
20777
|
}, z.core.$loose>>>;
|
|
20778
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20740
20779
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
20741
20780
|
id: z.ZodString;
|
|
20742
20781
|
name: z.ZodString;
|
|
@@ -23254,6 +23293,18 @@ export declare const SessionOutboundMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
23254
23293
|
success: z.ZodBoolean;
|
|
23255
23294
|
error: z.ZodNullable<z.ZodString>;
|
|
23256
23295
|
}, z.core.$strip>;
|
|
23296
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23297
|
+
type: z.ZodLiteral<"terminal.shell.detect.response">;
|
|
23298
|
+
payload: z.ZodObject<{
|
|
23299
|
+
shells: z.ZodArray<z.ZodObject<{
|
|
23300
|
+
path: z.ZodString;
|
|
23301
|
+
name: z.ZodString;
|
|
23302
|
+
}, z.core.$strip>>;
|
|
23303
|
+
resolvedDefault: z.ZodString;
|
|
23304
|
+
configured: z.ZodOptional<z.ZodString>;
|
|
23305
|
+
error: z.ZodNullable<z.ZodString>;
|
|
23306
|
+
requestId: z.ZodString;
|
|
23307
|
+
}, z.core.$strip>;
|
|
23257
23308
|
}, z.core.$strip>, z.ZodObject<{
|
|
23258
23309
|
type: z.ZodLiteral<"subscribe_terminal_response">;
|
|
23259
23310
|
payload: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -24615,6 +24666,8 @@ export type CreateTerminalRequest = z.infer<typeof CreateTerminalRequestSchema>;
|
|
|
24615
24666
|
export type CreateTerminalResponse = z.infer<typeof CreateTerminalResponseSchema>;
|
|
24616
24667
|
export type RenameTerminalRequest = z.infer<typeof RenameTerminalRequestSchema>;
|
|
24617
24668
|
export type RenameTerminalResponse = z.infer<typeof RenameTerminalResponseSchema>;
|
|
24669
|
+
export type TerminalShellDetectRequest = z.infer<typeof TerminalShellDetectRequestSchema>;
|
|
24670
|
+
export type TerminalShellDetectResponse = z.infer<typeof TerminalShellDetectResponseSchema>;
|
|
24618
24671
|
export type StartWorkspaceScriptRequest = z.infer<typeof StartWorkspaceScriptRequestSchema>;
|
|
24619
24672
|
export type StartWorkspaceScriptResponse = z.infer<typeof StartWorkspaceScriptResponseMessageSchema>;
|
|
24620
24673
|
export type SubscribeTerminalRequest = z.infer<typeof SubscribeTerminalRequestSchema>;
|
|
@@ -25489,6 +25542,7 @@ export declare const WSSessionInboundSchema: z.ZodObject<{
|
|
|
25489
25542
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25490
25543
|
icon: z.ZodOptional<z.ZodString>;
|
|
25491
25544
|
}, z.core.$loose>>>>;
|
|
25545
|
+
terminalDefaultShell: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
25492
25546
|
agentProfiles: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
25493
25547
|
id: z.ZodString;
|
|
25494
25548
|
name: z.ZodString;
|
|
@@ -26679,6 +26733,9 @@ export declare const WSSessionInboundSchema: z.ZodObject<{
|
|
|
26679
26733
|
terminalId: z.ZodString;
|
|
26680
26734
|
title: z.ZodString;
|
|
26681
26735
|
requestId: z.ZodString;
|
|
26736
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26737
|
+
type: z.ZodLiteral<"terminal.shell.detect.request">;
|
|
26738
|
+
requestId: z.ZodString;
|
|
26682
26739
|
}, z.core.$strip>, z.ZodObject<{
|
|
26683
26740
|
type: z.ZodLiteral<"start_workspace_script_request">;
|
|
26684
26741
|
workspaceId: z.ZodString;
|
|
@@ -31745,6 +31802,7 @@ export declare const WSSessionOutboundSchema: z.ZodObject<{
|
|
|
31745
31802
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31746
31803
|
icon: z.ZodOptional<z.ZodString>;
|
|
31747
31804
|
}, z.core.$loose>>>;
|
|
31805
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31748
31806
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31749
31807
|
id: z.ZodString;
|
|
31750
31808
|
name: z.ZodString;
|
|
@@ -31828,6 +31886,7 @@ export declare const WSSessionOutboundSchema: z.ZodObject<{
|
|
|
31828
31886
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31829
31887
|
icon: z.ZodOptional<z.ZodString>;
|
|
31830
31888
|
}, z.core.$loose>>>;
|
|
31889
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31831
31890
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31832
31891
|
id: z.ZodString;
|
|
31833
31892
|
name: z.ZodString;
|
|
@@ -34345,6 +34404,18 @@ export declare const WSSessionOutboundSchema: z.ZodObject<{
|
|
|
34345
34404
|
success: z.ZodBoolean;
|
|
34346
34405
|
error: z.ZodNullable<z.ZodString>;
|
|
34347
34406
|
}, z.core.$strip>;
|
|
34407
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34408
|
+
type: z.ZodLiteral<"terminal.shell.detect.response">;
|
|
34409
|
+
payload: z.ZodObject<{
|
|
34410
|
+
shells: z.ZodArray<z.ZodObject<{
|
|
34411
|
+
path: z.ZodString;
|
|
34412
|
+
name: z.ZodString;
|
|
34413
|
+
}, z.core.$strip>>;
|
|
34414
|
+
resolvedDefault: z.ZodString;
|
|
34415
|
+
configured: z.ZodOptional<z.ZodString>;
|
|
34416
|
+
error: z.ZodNullable<z.ZodString>;
|
|
34417
|
+
requestId: z.ZodString;
|
|
34418
|
+
}, z.core.$strip>;
|
|
34348
34419
|
}, z.core.$strip>, z.ZodObject<{
|
|
34349
34420
|
type: z.ZodLiteral<"subscribe_terminal_response">;
|
|
34350
34421
|
payload: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -36227,6 +36298,7 @@ export declare const WSInboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
36227
36298
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36228
36299
|
icon: z.ZodOptional<z.ZodString>;
|
|
36229
36300
|
}, z.core.$loose>>>>;
|
|
36301
|
+
terminalDefaultShell: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
36230
36302
|
agentProfiles: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
36231
36303
|
id: z.ZodString;
|
|
36232
36304
|
name: z.ZodString;
|
|
@@ -37417,6 +37489,9 @@ export declare const WSInboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
37417
37489
|
terminalId: z.ZodString;
|
|
37418
37490
|
title: z.ZodString;
|
|
37419
37491
|
requestId: z.ZodString;
|
|
37492
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37493
|
+
type: z.ZodLiteral<"terminal.shell.detect.request">;
|
|
37494
|
+
requestId: z.ZodString;
|
|
37420
37495
|
}, z.core.$strip>, z.ZodObject<{
|
|
37421
37496
|
type: z.ZodLiteral<"start_workspace_script_request">;
|
|
37422
37497
|
workspaceId: z.ZodString;
|
|
@@ -42485,6 +42560,7 @@ export declare const WSOutboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
42485
42560
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42486
42561
|
icon: z.ZodOptional<z.ZodString>;
|
|
42487
42562
|
}, z.core.$loose>>>;
|
|
42563
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42488
42564
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42489
42565
|
id: z.ZodString;
|
|
42490
42566
|
name: z.ZodString;
|
|
@@ -42568,6 +42644,7 @@ export declare const WSOutboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
42568
42644
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42569
42645
|
icon: z.ZodOptional<z.ZodString>;
|
|
42570
42646
|
}, z.core.$loose>>>;
|
|
42647
|
+
terminalDefaultShell: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42571
42648
|
agentProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42572
42649
|
id: z.ZodString;
|
|
42573
42650
|
name: z.ZodString;
|
|
@@ -45085,6 +45162,18 @@ export declare const WSOutboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
45085
45162
|
success: z.ZodBoolean;
|
|
45086
45163
|
error: z.ZodNullable<z.ZodString>;
|
|
45087
45164
|
}, z.core.$strip>;
|
|
45165
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45166
|
+
type: z.ZodLiteral<"terminal.shell.detect.response">;
|
|
45167
|
+
payload: z.ZodObject<{
|
|
45168
|
+
shells: z.ZodArray<z.ZodObject<{
|
|
45169
|
+
path: z.ZodString;
|
|
45170
|
+
name: z.ZodString;
|
|
45171
|
+
}, z.core.$strip>>;
|
|
45172
|
+
resolvedDefault: z.ZodString;
|
|
45173
|
+
configured: z.ZodOptional<z.ZodString>;
|
|
45174
|
+
error: z.ZodNullable<z.ZodString>;
|
|
45175
|
+
requestId: z.ZodString;
|
|
45176
|
+
}, z.core.$strip>;
|
|
45088
45177
|
}, z.core.$strip>, z.ZodObject<{
|
|
45089
45178
|
type: z.ZodLiteral<"subscribe_terminal_response">;
|
|
45090
45179
|
payload: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -157,6 +157,10 @@ export const MutableDaemonConfigSchema = z
|
|
|
157
157
|
terminalAgentHooks: TerminalAgentHookSettingsSchema.optional(),
|
|
158
158
|
appendSystemPrompt: z.string().default(""),
|
|
159
159
|
terminalProfiles: z.array(TerminalProfileSchema).optional(),
|
|
160
|
+
// Path of the shell the daemon spawns for new terminals. Absent (or null,
|
|
161
|
+
// after a client patch clears it) means auto: $SHELL / ComSpec, the
|
|
162
|
+
// pre-config behavior.
|
|
163
|
+
terminalDefaultShell: z.string().min(1).nullish(),
|
|
160
164
|
agentProfiles: z.array(AgentProfileSchema).optional(),
|
|
161
165
|
skills: z.object({ selection: AgentSkillSelectionSchema.optional() }).strict().optional(),
|
|
162
166
|
pluginsEnabled: z.boolean().optional(),
|
|
@@ -179,6 +183,9 @@ export const MutableDaemonConfigPatchSchema = z
|
|
|
179
183
|
terminalAgentHooks: TerminalAgentHookSettingsSchema.optional(),
|
|
180
184
|
appendSystemPrompt: z.string().optional(),
|
|
181
185
|
terminalProfiles: z.array(TerminalProfileSchema).optional(),
|
|
186
|
+
// COMPAT(terminalShellConfig): added in v0.7.x alongside the
|
|
187
|
+
// terminal.shell.detect RPC and the terminalShellConfig feature gate.
|
|
188
|
+
terminalDefaultShell: z.string().min(1).nullish(),
|
|
182
189
|
agentProfiles: z.array(AgentProfileSchema).optional(),
|
|
183
190
|
pluginsEnabled: z.boolean().optional(),
|
|
184
191
|
plugins: z.record(PluginIdSchema, PluginSourceSchema).optional(),
|
|
@@ -2407,6 +2414,28 @@ export const RenameTerminalRequestSchema = z.object({
|
|
|
2407
2414
|
title: z.string(),
|
|
2408
2415
|
requestId: z.string(),
|
|
2409
2416
|
});
|
|
2417
|
+
export const TerminalShellDetectRequestSchema = z.object({
|
|
2418
|
+
type: z.literal("terminal.shell.detect.request"),
|
|
2419
|
+
requestId: z.string(),
|
|
2420
|
+
});
|
|
2421
|
+
/** A shell executable the daemon found installed on the host machine. */
|
|
2422
|
+
export const DetectedShellSchema = z.object({
|
|
2423
|
+
path: z.string(),
|
|
2424
|
+
name: z.string(),
|
|
2425
|
+
});
|
|
2426
|
+
export const TerminalShellDetectResponseSchema = z.object({
|
|
2427
|
+
type: z.literal("terminal.shell.detect.response"),
|
|
2428
|
+
payload: z.object({
|
|
2429
|
+
/** Installed shells on the host, deduped by path. */
|
|
2430
|
+
shells: z.array(DetectedShellSchema),
|
|
2431
|
+
/** What the daemon would use right now with no configured shell. */
|
|
2432
|
+
resolvedDefault: z.string(),
|
|
2433
|
+
/** The configured `daemon.terminalDefaultShell`, absent in auto mode. */
|
|
2434
|
+
configured: z.string().optional(),
|
|
2435
|
+
error: z.string().nullable(),
|
|
2436
|
+
requestId: z.string(),
|
|
2437
|
+
}),
|
|
2438
|
+
});
|
|
2410
2439
|
export const StartWorkspaceScriptRequestSchema = z.object({
|
|
2411
2440
|
type: z.literal("start_workspace_script_request"),
|
|
2412
2441
|
workspaceId: z.string(),
|
|
@@ -2707,6 +2736,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
2707
2736
|
UnsubscribeTerminalsRequestSchema,
|
|
2708
2737
|
CreateTerminalRequestSchema,
|
|
2709
2738
|
RenameTerminalRequestSchema,
|
|
2739
|
+
TerminalShellDetectRequestSchema,
|
|
2710
2740
|
StartWorkspaceScriptRequestSchema,
|
|
2711
2741
|
WorkspaceScriptListRequestSchema,
|
|
2712
2742
|
WorkspaceScriptStartRequestSchema,
|
|
@@ -2937,6 +2967,10 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
2937
2967
|
projectSetupSkill: z.boolean().optional(),
|
|
2938
2968
|
// COMPAT(terminalAgentHookProviders): added in v0.7.1, remove gate after 2027-09-01.
|
|
2939
2969
|
terminalAgentHookProviders: z.boolean().optional(),
|
|
2970
|
+
// COMPAT(terminalShellConfig): added in v0.7.x, remove gate after 2027-09-01.
|
|
2971
|
+
// Gates terminal.shell.detect plus the terminalDefaultShell config field;
|
|
2972
|
+
// clients without the gate never send either.
|
|
2973
|
+
terminalShellConfig: z.boolean().optional(),
|
|
2940
2974
|
// COMPAT(terminalRestoreModes): added in v0.1.81, remove gate after 2026-11-23.
|
|
2941
2975
|
"terminal-restore-modes": z.boolean().optional(),
|
|
2942
2976
|
// COMPAT(terminalInputModeReplay): added in v0.2.6, remove gate after 2027-02-02.
|
|
@@ -5705,6 +5739,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
5705
5739
|
TerminalsChangedSchema,
|
|
5706
5740
|
CreateTerminalResponseSchema,
|
|
5707
5741
|
RenameTerminalResponseSchema,
|
|
5742
|
+
TerminalShellDetectResponseSchema,
|
|
5708
5743
|
SubscribeTerminalResponseSchema,
|
|
5709
5744
|
KillTerminalResponseSchema,
|
|
5710
5745
|
CaptureTerminalResponseSchema,
|
|
@@ -4821,6 +4821,7 @@ export declare const WSOutboundMessageSchema: {
|
|
|
4821
4821
|
args: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
4822
4822
|
icon: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4823
4823
|
}, import("zod/v4/core").$loose>>>;
|
|
4824
|
+
terminalDefaultShell: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
4824
4825
|
agentProfiles: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
4825
4826
|
id: import("zod").ZodString;
|
|
4826
4827
|
name: import("zod").ZodString;
|
|
@@ -4904,6 +4905,7 @@ export declare const WSOutboundMessageSchema: {
|
|
|
4904
4905
|
args: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
4905
4906
|
icon: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4906
4907
|
}, import("zod/v4/core").$loose>>>;
|
|
4908
|
+
terminalDefaultShell: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
4907
4909
|
agentProfiles: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
4908
4910
|
id: import("zod").ZodString;
|
|
4909
4911
|
name: import("zod").ZodString;
|
|
@@ -7421,6 +7423,18 @@ export declare const WSOutboundMessageSchema: {
|
|
|
7421
7423
|
success: import("zod").ZodBoolean;
|
|
7422
7424
|
error: import("zod").ZodNullable<import("zod").ZodString>;
|
|
7423
7425
|
}, import("zod/v4/core").$strip>;
|
|
7426
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
7427
|
+
type: import("zod").ZodLiteral<"terminal.shell.detect.response">;
|
|
7428
|
+
payload: import("zod").ZodObject<{
|
|
7429
|
+
shells: import("zod").ZodArray<import("zod").ZodObject<{
|
|
7430
|
+
path: import("zod").ZodString;
|
|
7431
|
+
name: import("zod").ZodString;
|
|
7432
|
+
}, import("zod/v4/core").$strip>>;
|
|
7433
|
+
resolvedDefault: import("zod").ZodString;
|
|
7434
|
+
configured: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7435
|
+
error: import("zod").ZodNullable<import("zod").ZodString>;
|
|
7436
|
+
requestId: import("zod").ZodString;
|
|
7437
|
+
}, import("zod/v4/core").$strip>;
|
|
7424
7438
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
7425
7439
|
type: import("zod").ZodLiteral<"subscribe_terminal_response">;
|
|
7426
7440
|
payload: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
@@ -248,6 +248,7 @@ export declare class AgentManager {
|
|
|
248
248
|
private readonly agentRegistrationTasks;
|
|
249
249
|
private readonly inFlightAgentCloses;
|
|
250
250
|
private readonly lifecycleMutationTails;
|
|
251
|
+
private readonly draftCommandsCache;
|
|
251
252
|
private readonly agentStreamCoalescer;
|
|
252
253
|
private mcpBaseUrl;
|
|
253
254
|
private readonly mcpAuthToken;
|
|
@@ -295,6 +296,7 @@ export declare class AgentManager {
|
|
|
295
296
|
listProviderAvailability(): Promise<ProviderAvailability[]>;
|
|
296
297
|
getProviderAvailability(provider: AgentProvider): Promise<ProviderAvailability>;
|
|
297
298
|
listDraftCommands(config: AgentSessionConfig): Promise<AgentSlashCommand[]>;
|
|
299
|
+
private uncachedListDraftCommands;
|
|
298
300
|
listDraftFeatures(config: AgentSessionConfig): Promise<AgentFeature[]>;
|
|
299
301
|
getAgent(id: string): ManagedAgent | null;
|
|
300
302
|
waitForAgentClose(agentId: string): Promise<void>;
|
|
@@ -17,6 +17,7 @@ import { resolveCreateAgentTitles } from "./create-agent-title.js";
|
|
|
17
17
|
import { ProviderSubagentStore, } from "./provider-subagents/store.js";
|
|
18
18
|
const RELOAD_SESSION_CLOSE_TIMEOUT_MS = 3000;
|
|
19
19
|
const INTERRUPT_SESSION_TIMEOUT_MS = 2000;
|
|
20
|
+
const DRAFT_COMMANDS_CACHE_TTL_MS = 30000;
|
|
20
21
|
const STORED_AGENT_CAPABILITIES = {
|
|
21
22
|
supportsStreaming: false,
|
|
22
23
|
supportsSessionPersistence: true,
|
|
@@ -269,6 +270,7 @@ export class AgentManager {
|
|
|
269
270
|
this.agentRegistrationTasks = new Set();
|
|
270
271
|
this.inFlightAgentCloses = new Map();
|
|
271
272
|
this.lifecycleMutationTails = new Map();
|
|
273
|
+
this.draftCommandsCache = new Map();
|
|
272
274
|
this.paseoToolsEnabled = true;
|
|
273
275
|
this.paseoToolCatalogFactory = null;
|
|
274
276
|
this.acceptingAgentRegistrations = true;
|
|
@@ -518,6 +520,30 @@ export class AgentManager {
|
|
|
518
520
|
if (!normalizedConfig.model) {
|
|
519
521
|
return [];
|
|
520
522
|
}
|
|
523
|
+
// Draft listings spawn a throwaway provider process (pi boots a full RPC session),
|
|
524
|
+
// so reuse a recent result for the same config. Short TTL: commands rarely change,
|
|
525
|
+
// but freshly installed skills should appear without a daemon restart.
|
|
526
|
+
const cacheKey = JSON.stringify([
|
|
527
|
+
normalizedConfig.provider,
|
|
528
|
+
normalizedConfig.cwd,
|
|
529
|
+
normalizedConfig.model,
|
|
530
|
+
normalizedConfig.thinkingOptionId ?? null,
|
|
531
|
+
normalizedConfig.modeId ?? null,
|
|
532
|
+
]);
|
|
533
|
+
const cached = this.draftCommandsCache.get(cacheKey);
|
|
534
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
535
|
+
return cached.promise;
|
|
536
|
+
}
|
|
537
|
+
const promise = this.uncachedListDraftCommands(client, normalizedConfig);
|
|
538
|
+
this.draftCommandsCache.set(cacheKey, {
|
|
539
|
+
expiresAt: Date.now() + DRAFT_COMMANDS_CACHE_TTL_MS,
|
|
540
|
+
promise,
|
|
541
|
+
});
|
|
542
|
+
// Do not keep failed listings cached; a retry should hit the provider again.
|
|
543
|
+
promise.catch(() => this.draftCommandsCache.delete(cacheKey));
|
|
544
|
+
return promise;
|
|
545
|
+
}
|
|
546
|
+
async uncachedListDraftCommands(client, normalizedConfig) {
|
|
521
547
|
const available = await client.isAvailable();
|
|
522
548
|
if (!available) {
|
|
523
549
|
throw new Error(`Provider '${normalizedConfig.provider}' is not available. Please ensure the CLI is installed.`);
|
|
@@ -148,6 +148,7 @@ export declare class PiRpcAgentClient implements AgentClient {
|
|
|
148
148
|
private readonly providerParams;
|
|
149
149
|
private readonly runtime;
|
|
150
150
|
private readonly usagePollScheduler?;
|
|
151
|
+
private availableProvidersCache;
|
|
151
152
|
constructor(options: PiRpcAgentClientOptions);
|
|
152
153
|
createSession(config: AgentSessionConfig, launchContext?: AgentLaunchContext): Promise<AgentSession>;
|
|
153
154
|
resumeSession(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>, launchContext?: AgentLaunchContext): Promise<AgentSession>;
|
|
@@ -159,6 +160,19 @@ export declare class PiRpcAgentClient implements AgentClient {
|
|
|
159
160
|
getDiagnostic(): Promise<{
|
|
160
161
|
diagnostic: string;
|
|
161
162
|
}>;
|
|
163
|
+
/**
|
|
164
|
+
* Pi exits with an error when --model references a provider that no longer
|
|
165
|
+
* exists in models.json (e.g. a stale model recorded in a session file or
|
|
166
|
+
* persistence metadata). Probe the authoritative provider list and drop the
|
|
167
|
+
* model when its provider is unavailable so Pi's own session-restore
|
|
168
|
+
* fallback can pick a usable model instead of refusing to start. Pi only
|
|
169
|
+
* hard-fails on unknown providers — unknown model ids under a known provider
|
|
170
|
+
* go through its custom-model fallback — so only the provider is validated.
|
|
171
|
+
* Internal sessions resolve their model from the current provider snapshot,
|
|
172
|
+
* so they never carry stale references and skip the probe.
|
|
173
|
+
*/
|
|
174
|
+
private resolveLaunchModel;
|
|
175
|
+
private fetchAvailableProviders;
|
|
162
176
|
private prepareMcpConfig;
|
|
163
177
|
private detectMcpAdapter;
|
|
164
178
|
private resolvePiLaunch;
|
|
@@ -20,6 +20,7 @@ import { PiUsagePoller } from "./usage-poller.js";
|
|
|
20
20
|
import { mapToolDetail, parseToolArgs, parseToolResult, resolveToolCallName, } from "./tool-call-mapper.js";
|
|
21
21
|
const PI_PROVIDER = "pi";
|
|
22
22
|
const DEFAULT_PI_THINKING_LEVEL = "medium";
|
|
23
|
+
const PI_MODEL_PROBE_CACHE_MS = 30000;
|
|
23
24
|
const PI_BINARY_COMMAND = process.env.PI_COMMAND ?? process.env.PI_ACP_PI_COMMAND ?? "pi";
|
|
24
25
|
const PASEO_PI_TREE_EXTENSION_COMMAND = "paseo_tree";
|
|
25
26
|
const PASEO_PI_CAPTURE_EXTENSION_COMMAND = "paseo_capture_entries";
|
|
@@ -2038,6 +2039,7 @@ export class PiRpcAgentSession {
|
|
|
2038
2039
|
}
|
|
2039
2040
|
export class PiRpcAgentClient {
|
|
2040
2041
|
constructor(options) {
|
|
2042
|
+
this.availableProvidersCache = null;
|
|
2041
2043
|
this.provider = PI_PROVIDER;
|
|
2042
2044
|
this.capabilities = capabilitiesForClient();
|
|
2043
2045
|
this.logger = options.logger;
|
|
@@ -2055,11 +2057,14 @@ export class PiRpcAgentClient {
|
|
|
2055
2057
|
};
|
|
2056
2058
|
const mcpConfig = await this.prepareMcpConfig(config.cwd, config.mcpServers, mcpEnv);
|
|
2057
2059
|
const paseoExtension = createPiPaseoExtensionFile(composeSystemPromptParts(config.systemPrompt, config.daemonAppendSystemPrompt));
|
|
2060
|
+
const launchModel = await this.resolveLaunchModel(config.cwd, launchContext?.env, config.model, {
|
|
2061
|
+
skipProbe: config.internal === true,
|
|
2062
|
+
});
|
|
2058
2063
|
let runtimeSession;
|
|
2059
2064
|
try {
|
|
2060
2065
|
runtimeSession = await this.runtime.startSession({
|
|
2061
2066
|
cwd: config.cwd,
|
|
2062
|
-
model:
|
|
2067
|
+
model: launchModel,
|
|
2063
2068
|
thinkingOptionId: normalizePiThinkingOption(config.thinkingOptionId) ?? DEFAULT_PI_THINKING_LEVEL,
|
|
2064
2069
|
noSession: config.internal === true,
|
|
2065
2070
|
env: launchContext?.env,
|
|
@@ -2075,7 +2080,7 @@ export class PiRpcAgentClient {
|
|
|
2075
2080
|
try {
|
|
2076
2081
|
return new PiRpcAgentSession({
|
|
2077
2082
|
runtimeSession,
|
|
2078
|
-
config,
|
|
2083
|
+
config: launchModel === config.model ? config : { ...config, model: launchModel },
|
|
2079
2084
|
initialState: await runtimeSession.getState(),
|
|
2080
2085
|
capabilities: capabilitiesForSession(mcpConfig !== null),
|
|
2081
2086
|
cleanup: combineCleanup([mcpConfig?.cleanup, paseoExtension?.cleanup]),
|
|
@@ -2104,10 +2109,18 @@ export class PiRpcAgentClient {
|
|
|
2104
2109
|
};
|
|
2105
2110
|
const mcpConfig = await this.prepareMcpConfig(resumeConfig.cwd, resumeConfig.config.mcpServers, mcpEnv);
|
|
2106
2111
|
const paseoExtension = createPiPaseoExtensionFile(composeSystemPromptParts(resumeConfig.config.systemPrompt, resumeConfig.config.daemonAppendSystemPrompt));
|
|
2112
|
+
const launchModel = await this.resolveLaunchModel(resumeConfig.cwd, launchContext?.env, resumeConfig.model);
|
|
2113
|
+
const resumedConfig = launchModel === resumeConfig.model
|
|
2114
|
+
? resumeConfig
|
|
2115
|
+
: {
|
|
2116
|
+
...resumeConfig,
|
|
2117
|
+
model: launchModel,
|
|
2118
|
+
config: { ...resumeConfig.config, model: launchModel },
|
|
2119
|
+
};
|
|
2107
2120
|
let runtimeSession;
|
|
2108
2121
|
try {
|
|
2109
2122
|
runtimeSession = await this.runtime.startSession(buildResumeStartInput({
|
|
2110
|
-
resumeConfig,
|
|
2123
|
+
resumeConfig: resumedConfig,
|
|
2111
2124
|
sessionFile,
|
|
2112
2125
|
launchContext,
|
|
2113
2126
|
mcpConfig,
|
|
@@ -2122,7 +2135,7 @@ export class PiRpcAgentClient {
|
|
|
2122
2135
|
try {
|
|
2123
2136
|
return new PiRpcAgentSession({
|
|
2124
2137
|
runtimeSession,
|
|
2125
|
-
config:
|
|
2138
|
+
config: resumedConfig.config,
|
|
2126
2139
|
initialState: await runtimeSession.getState(),
|
|
2127
2140
|
capabilities: capabilitiesForSession(mcpConfig !== null),
|
|
2128
2141
|
cleanup: combineCleanup([mcpConfig?.cleanup, paseoExtension?.cleanup]),
|
|
@@ -2224,6 +2237,68 @@ export class PiRpcAgentClient {
|
|
|
2224
2237
|
};
|
|
2225
2238
|
}
|
|
2226
2239
|
}
|
|
2240
|
+
/**
|
|
2241
|
+
* Pi exits with an error when --model references a provider that no longer
|
|
2242
|
+
* exists in models.json (e.g. a stale model recorded in a session file or
|
|
2243
|
+
* persistence metadata). Probe the authoritative provider list and drop the
|
|
2244
|
+
* model when its provider is unavailable so Pi's own session-restore
|
|
2245
|
+
* fallback can pick a usable model instead of refusing to start. Pi only
|
|
2246
|
+
* hard-fails on unknown providers — unknown model ids under a known provider
|
|
2247
|
+
* go through its custom-model fallback — so only the provider is validated.
|
|
2248
|
+
* Internal sessions resolve their model from the current provider snapshot,
|
|
2249
|
+
* so they never carry stale references and skip the probe.
|
|
2250
|
+
*/
|
|
2251
|
+
async resolveLaunchModel(cwd, env, model, options) {
|
|
2252
|
+
if (!model || options?.skipProbe) {
|
|
2253
|
+
return model;
|
|
2254
|
+
}
|
|
2255
|
+
const provider = model.split("/")[0];
|
|
2256
|
+
if (!provider || !model.includes("/")) {
|
|
2257
|
+
this.logger.debug({ model }, "Pi launch model has no provider prefix; keeping it for Pi to resolve");
|
|
2258
|
+
return model;
|
|
2259
|
+
}
|
|
2260
|
+
const availableProviders = await this.fetchAvailableProviders(cwd, env);
|
|
2261
|
+
if (availableProviders === null) {
|
|
2262
|
+
// Probe failure is not evidence the model is dead; keep the requested
|
|
2263
|
+
// model and let the real session surface the definitive error.
|
|
2264
|
+
this.logger.warn({ model }, "Pi model probe failed; keeping --model and letting the session report");
|
|
2265
|
+
return model;
|
|
2266
|
+
}
|
|
2267
|
+
const isAvailable = availableProviders.some((candidate) => candidate.toLowerCase() === provider.toLowerCase());
|
|
2268
|
+
if (!isAvailable) {
|
|
2269
|
+
this.logger.info({ model, provider }, "Pi launch model's provider is not available; omitting --model so Pi falls back");
|
|
2270
|
+
return undefined;
|
|
2271
|
+
}
|
|
2272
|
+
return model;
|
|
2273
|
+
}
|
|
2274
|
+
async fetchAvailableProviders(cwd, env) {
|
|
2275
|
+
const cacheEntry = this.availableProvidersCache;
|
|
2276
|
+
if (cacheEntry && Date.now() - cacheEntry.cachedAt < PI_MODEL_PROBE_CACHE_MS) {
|
|
2277
|
+
return cacheEntry.providers;
|
|
2278
|
+
}
|
|
2279
|
+
const probeSession = await this.runtime
|
|
2280
|
+
.startSession({ cwd, env, noSession: true })
|
|
2281
|
+
.catch((error) => {
|
|
2282
|
+
this.logger.debug({ err: error, cwd }, "Pi model probe failed to start");
|
|
2283
|
+
return null;
|
|
2284
|
+
});
|
|
2285
|
+
if (!probeSession) {
|
|
2286
|
+
return null;
|
|
2287
|
+
}
|
|
2288
|
+
try {
|
|
2289
|
+
const availableModels = await probeSession.getAvailableModels();
|
|
2290
|
+
const providers = [...new Set(availableModels.map((model) => model.provider))];
|
|
2291
|
+
this.availableProvidersCache = { providers, cachedAt: Date.now() };
|
|
2292
|
+
return providers;
|
|
2293
|
+
}
|
|
2294
|
+
catch (error) {
|
|
2295
|
+
this.logger.debug({ err: error }, "Pi model probe RPC failed");
|
|
2296
|
+
return null;
|
|
2297
|
+
}
|
|
2298
|
+
finally {
|
|
2299
|
+
await probeSession.close().catch(() => undefined);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2227
2302
|
async prepareMcpConfig(cwd, servers, env) {
|
|
2228
2303
|
if (!servers || Object.keys(servers).length === 0) {
|
|
2229
2304
|
return null;
|
package/node_modules/@getpaseo/server/dist/server/server/authorization/operation-permissions.js
CHANGED
|
@@ -53,6 +53,7 @@ const INBOUND_PERMISSION = {
|
|
|
53
53
|
create_agent_request: "workspace.write",
|
|
54
54
|
create_paseo_worktree_request: "workspace.manage",
|
|
55
55
|
create_terminal_request: "workspace.write",
|
|
56
|
+
"terminal.shell.detect.request": "daemon.read",
|
|
56
57
|
"daemon.config.reload.request": "daemon.manage",
|
|
57
58
|
"daemon.get_pairing_offer.request": "access.manage",
|
|
58
59
|
"daemon.get_status.request": "daemon.read",
|
|
@@ -374,6 +375,7 @@ const OUTBOUND_PERMISSION = {
|
|
|
374
375
|
subscribe_checkout_diff_response: "workspace.read",
|
|
375
376
|
subscribe_terminal_response: "workspace.read",
|
|
376
377
|
"terminal.rename.response": "workspace.write",
|
|
378
|
+
"terminal.shell.detect.response": "daemon.read",
|
|
377
379
|
terminal_attention_required: "workspace.read",
|
|
378
380
|
terminal_stream_exit: "workspace.read",
|
|
379
381
|
terminals_changed: "workspace.read",
|
|
@@ -85,6 +85,7 @@ export interface PaseoDaemonConfig {
|
|
|
85
85
|
terminalAgentHooks?: TerminalAgentHookSettings;
|
|
86
86
|
appendSystemPrompt?: string;
|
|
87
87
|
terminalProfiles?: TerminalProfile[];
|
|
88
|
+
terminalDefaultShell?: string;
|
|
88
89
|
agentProfiles?: AgentProfile[];
|
|
89
90
|
skillSelection?: AgentSkillSelection;
|
|
90
91
|
pluginsEnabled?: boolean;
|