@agentdock/wire 0.0.94 → 0.0.96
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/accountLanguage.d.ts +2 -8
- package/dist/activityPreferences.d.ts +0 -2
- package/dist/agentCapabilities.d.ts +16 -46
- package/dist/agentCommonEnv.d.ts +0 -9
- package/dist/agentInstallGuide.d.ts +0 -7
- package/dist/agentRuntimeSettings.d.ts +1 -2
- package/dist/bgTask.d.ts +13 -24
- package/dist/checkpointSchemas.d.ts +1 -2
- package/dist/controlLevel.d.ts +1 -9
- package/dist/edition.d.ts +0 -1
- package/dist/enterpriseCurrency.d.ts +120 -0
- package/dist/enterpriseCurrency.js +1 -0
- package/dist/enterpriseDirectory.d.ts +636 -0
- package/dist/enterpriseDirectory.js +1 -0
- package/dist/enterpriseGateway.d.ts +1 -2
- package/dist/enterpriseGatewayExports.d.ts +4 -0
- package/dist/enterpriseGatewayExports.js +1 -0
- package/dist/enterpriseOverview.d.ts +423 -0
- package/dist/enterpriseOverview.js +1 -0
- package/dist/enterprisePolicy.d.ts +1393 -0
- package/dist/enterprisePolicy.js +1 -0
- package/dist/enterprisePolicyExports.d.ts +2 -0
- package/dist/enterprisePolicyExports.js +1 -0
- package/dist/enterpriseRange.d.ts +19 -0
- package/dist/enterpriseRange.js +1 -0
- package/dist/enterpriseRuntime.d.ts +420 -0
- package/dist/enterpriseRuntime.js +1 -0
- package/dist/envelope.d.ts +18 -30
- package/dist/errorMessage.d.ts +0 -1
- package/dist/events.d.ts +55 -71
- package/dist/features.d.ts +14 -29
- package/dist/feedback.d.ts +3 -4
- package/dist/fileWhitelist.d.ts +7 -39
- package/dist/gateway.d.ts +1643 -328
- package/dist/gateway.js +1 -1
- package/dist/gatewayBodyRetention.d.ts +149 -0
- package/dist/gatewayBodyRetention.js +2 -0
- package/dist/gatewayUsage.d.ts +3232 -0
- package/dist/gatewayUsage.js +1 -0
- package/dist/goals.d.ts +0 -1
- package/dist/handoffBrief.d.ts +1 -2
- package/dist/inboundEvents.d.ts +32 -75
- package/dist/index.d.ts +11 -7
- package/dist/index.js +1 -1
- package/dist/interactionEvents.d.ts +49 -57
- package/dist/legacyProtocol.d.ts +0 -6
- package/dist/license.d.ts +36 -37
- package/dist/machine.d.ts +48 -56
- package/dist/messageMeta.d.ts +15 -17
- package/dist/messages.d.ts +13 -20
- package/dist/notification.d.ts +2 -3
- package/dist/ops.d.ts +9 -27
- package/dist/pairing.d.ts +9 -49
- package/dist/permissionSubject.d.ts +3 -26
- package/dist/protocol.d.ts +0 -6
- package/dist/rpc.d.ts +118 -162
- package/dist/rpc.js +1 -1
- package/dist/scheduledTasks.d.ts +9 -10
- package/dist/semver.d.ts +3 -22
- package/dist/sessionBtw.d.ts +6 -7
- package/dist/sessionBtw.js +1 -1
- package/dist/sessionResult.d.ts +21 -27
- package/dist/sessionTitle.d.ts +2 -9
- package/dist/socketEvents.d.ts +4 -5
- package/dist/sourceMetadata.d.ts +1 -14
- package/dist/spawnError.d.ts +7 -14
- package/dist/stats.d.ts +13 -20
- package/dist/sync.d.ts +75 -156
- package/dist/taskResult.d.ts +3 -20
- package/dist/telemetry.d.ts +1 -11
- package/dist/utils.d.ts +0 -1
- package/dist/workItems.d.ts +6 -30
- package/package.json +1 -1
package/dist/rpc.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const RpcMethod: z.ZodEnum<["spawn-session", "stop-session", "list-sessions", "abort", "switch-mode", "approve-permission", "deny-permission", "answer-question", "shutdown-daemon", "get-messages", "get-stats", "get-team-stats", "start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings", "get-labs-settings", "set-labs-settings", "set-auto-upgrade-daemon", "check-path", "backfill-history-session", "trigger-upgrade", "checkpoint-list", "checkpoint-diff", "checkpoint-rollback", "refresh-enterprise-models", "cancel-task", "file-relay-receive", "set-debug", "get-debug", "record-usage", "update-agent-models", "update-agent-modes", "dispatch-notification", "get-context-usage", "ai-helper"]>;
|
|
2
|
+
export declare const RpcMethod: z.ZodEnum<["spawn-session", "stop-session", "list-sessions", "abort", "switch-mode", "approve-permission", "deny-permission", "answer-question", "shutdown-daemon", "get-messages", "get-stats", "get-team-stats", "start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings", "get-labs-settings", "set-labs-settings", "set-auto-upgrade-daemon", "check-path", "backfill-history-session", "trigger-upgrade", "checkpoint-list", "checkpoint-diff", "checkpoint-rollback", "refresh-enterprise-models", "cancel-task", "file-relay-receive", "set-debug", "get-debug", "record-usage", "update-agent-models", "update-agent-modes", "dispatch-notification", "get-context-usage", "ai-helper", "ai-helper-cancel"]>;
|
|
3
3
|
export type RpcMethodType = z.infer<typeof RpcMethod>;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export declare const AiHelperCancelParamsSchema: z.ZodObject<{
|
|
5
|
+
machineId: z.ZodString;
|
|
6
|
+
sessionId: z.ZodString;
|
|
7
|
+
}, "strict", z.ZodTypeAny, {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
machineId: string;
|
|
10
|
+
}, {
|
|
11
|
+
sessionId: string;
|
|
12
|
+
machineId: string;
|
|
13
|
+
}>;
|
|
14
|
+
export type AiHelperCancelParams = z.infer<typeof AiHelperCancelParamsSchema>;
|
|
15
|
+
|
|
8
16
|
export declare const SESSION_RPC_METHODS: readonly ["answer-question", "approve-permission", "deny-permission", "abort", "stop-session", "cancel-task", "get-context-usage"];
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare const MACHINE_RPC_METHODS: readonly ["start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings", "get-labs-settings", "set-labs-settings", "set-auto-upgrade-daemon", "check-path", "backfill-history-session", "trigger-upgrade", "checkpoint-list", "checkpoint-diff", "checkpoint-rollback", "refresh-enterprise-models", "dispatch-notification", "ai-helper"];
|
|
14
|
-
/**
|
|
15
|
-
* All RPC methods that must be registered for Web UI to function.
|
|
16
|
-
* Daemon registers MACHINE_RPC_METHODS; CLI registers SESSION_RPC_METHODS.
|
|
17
|
-
*
|
|
18
|
-
* @deprecated Use SESSION_RPC_METHODS or MACHINE_RPC_METHODS directly.
|
|
19
|
-
*/
|
|
20
|
-
export declare const DAEMON_REQUIRED_RPC_METHODS: readonly ["answer-question", "approve-permission", "deny-permission", "abort", "stop-session", "cancel-task", "get-context-usage", "start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings", "get-labs-settings", "set-labs-settings", "set-auto-upgrade-daemon", "check-path", "backfill-history-session", "trigger-upgrade", "checkpoint-list", "checkpoint-diff", "checkpoint-rollback", "refresh-enterprise-models", "dispatch-notification", "ai-helper"];
|
|
17
|
+
|
|
18
|
+
export declare const MACHINE_RPC_METHODS: readonly ["start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings", "get-labs-settings", "set-labs-settings", "set-auto-upgrade-daemon", "check-path", "backfill-history-session", "trigger-upgrade", "checkpoint-list", "checkpoint-diff", "checkpoint-rollback", "refresh-enterprise-models", "dispatch-notification", "ai-helper", "ai-helper-cancel"];
|
|
19
|
+
|
|
20
|
+
export declare const DAEMON_REQUIRED_RPC_METHODS: readonly ["answer-question", "approve-permission", "deny-permission", "abort", "stop-session", "cancel-task", "get-context-usage", "start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings", "get-labs-settings", "set-labs-settings", "set-auto-upgrade-daemon", "check-path", "backfill-history-session", "trigger-upgrade", "checkpoint-list", "checkpoint-diff", "checkpoint-rollback", "refresh-enterprise-models", "dispatch-notification", "ai-helper", "ai-helper-cancel"];
|
|
21
21
|
export declare const RpcCallSchema: z.ZodObject<{
|
|
22
22
|
method: z.ZodString;
|
|
23
23
|
params: z.ZodUnknown;
|
|
@@ -55,44 +55,32 @@ export declare const SpawnSessionParamsSchema: z.ZodObject<{
|
|
|
55
55
|
cwd: z.ZodString;
|
|
56
56
|
prompt: z.ZodOptional<z.ZodString>;
|
|
57
57
|
permissionMode: z.ZodDefault<z.ZodString>;
|
|
58
|
-
|
|
59
|
-
* SECURITY (RFC-067): daemon MUST NOT consume this field. Forwarding env
|
|
60
|
-
* from an RPC payload = a remote env-injection channel (credentials/API
|
|
61
|
-
* keys). Env is resolved locally from agentSettings only. parseSpawnParams
|
|
62
|
-
* intentionally does not read it; see UNCONSUMED_SPAWN_FIELDS.
|
|
63
|
-
*/
|
|
58
|
+
|
|
64
59
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
65
60
|
model: z.ZodOptional<z.ZodString>;
|
|
66
|
-
|
|
61
|
+
|
|
67
62
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
68
|
-
|
|
63
|
+
|
|
69
64
|
appendSystemPrompt: z.ZodOptional<z.ZodString>;
|
|
70
|
-
|
|
65
|
+
|
|
71
66
|
responseLanguage: z.ZodOptional<z.ZodEnum<["en", "zh-Hans"]>>;
|
|
72
|
-
|
|
67
|
+
|
|
73
68
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
74
|
-
|
|
69
|
+
|
|
75
70
|
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
76
|
-
|
|
71
|
+
|
|
77
72
|
mcpConfig: z.ZodOptional<z.ZodString>;
|
|
78
|
-
|
|
73
|
+
|
|
79
74
|
resumeSessionId: z.ZodOptional<z.ZodString>;
|
|
80
|
-
|
|
75
|
+
|
|
81
76
|
serverSessionId: z.ZodOptional<z.ZodString>;
|
|
82
|
-
|
|
77
|
+
|
|
83
78
|
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
84
|
-
|
|
79
|
+
|
|
85
80
|
machineId: z.ZodOptional<z.ZodString>;
|
|
86
|
-
|
|
87
|
-
* Client-generated correlation id for matching the spawned session back to
|
|
88
|
-
* the originating spawn call. Written into session metadata and echoed in the
|
|
89
|
-
* update-session broadcast so the web client can identify which new session is
|
|
90
|
-
* its own (instead of guessing by cwd+machineId, which collides). New-session
|
|
91
|
-
* flow only — resume passes serverSessionId instead.
|
|
92
|
-
*/
|
|
81
|
+
|
|
93
82
|
spawnToken: z.ZodOptional<z.ZodString>;
|
|
94
|
-
|
|
95
|
-
* injection and carries user-selected inherited deliveries. Never a system prompt. */
|
|
83
|
+
|
|
96
84
|
handoffContext: z.ZodOptional<z.ZodObject<{
|
|
97
85
|
enabled: z.ZodBoolean;
|
|
98
86
|
inheritedDeliveries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -143,69 +131,69 @@ export declare const SpawnSessionParamsSchema: z.ZodObject<{
|
|
|
143
131
|
sourceReferences?: string[] | undefined;
|
|
144
132
|
}[] | undefined;
|
|
145
133
|
}>>;
|
|
146
|
-
|
|
134
|
+
|
|
147
135
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
148
|
-
|
|
136
|
+
|
|
149
137
|
systemPromptFile: z.ZodOptional<z.ZodString>;
|
|
150
|
-
|
|
138
|
+
|
|
151
139
|
appendSystemPromptFile: z.ZodOptional<z.ZodString>;
|
|
152
|
-
|
|
140
|
+
|
|
153
141
|
fallbackModel: z.ZodOptional<z.ZodString>;
|
|
154
|
-
|
|
142
|
+
|
|
155
143
|
maxBudgetUsd: z.ZodOptional<z.ZodNumber>;
|
|
156
|
-
|
|
144
|
+
|
|
157
145
|
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
158
|
-
|
|
146
|
+
|
|
159
147
|
effort: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>;
|
|
160
|
-
|
|
148
|
+
|
|
161
149
|
addDirs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
162
|
-
|
|
150
|
+
|
|
163
151
|
agent: z.ZodOptional<z.ZodString>;
|
|
164
|
-
|
|
152
|
+
|
|
165
153
|
agents: z.ZodOptional<z.ZodString>;
|
|
166
|
-
|
|
154
|
+
|
|
167
155
|
jsonSchema: z.ZodOptional<z.ZodString>;
|
|
168
|
-
|
|
156
|
+
|
|
169
157
|
strictMcpConfig: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
-
|
|
158
|
+
|
|
171
159
|
chrome: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
-
|
|
160
|
+
|
|
173
161
|
worktree: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
174
|
-
|
|
162
|
+
|
|
175
163
|
forkSession: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
-
|
|
164
|
+
|
|
177
165
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
178
|
-
|
|
166
|
+
|
|
179
167
|
settings: z.ZodOptional<z.ZodString>;
|
|
180
|
-
|
|
168
|
+
|
|
181
169
|
betas: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
182
|
-
|
|
170
|
+
|
|
183
171
|
brief: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
-
|
|
172
|
+
|
|
185
173
|
noSessionPersistence: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
-
|
|
174
|
+
|
|
187
175
|
includePartialMessages: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
-
|
|
176
|
+
|
|
189
177
|
replayUserMessages: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
-
|
|
178
|
+
|
|
191
179
|
settingSources: z.ZodOptional<z.ZodString>;
|
|
192
|
-
|
|
180
|
+
|
|
193
181
|
disableSlashCommands: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
-
|
|
182
|
+
|
|
195
183
|
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
196
|
-
|
|
184
|
+
|
|
197
185
|
pluginDirs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
198
|
-
|
|
186
|
+
|
|
199
187
|
dangerouslySkipPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
-
|
|
188
|
+
|
|
201
189
|
allowDangerouslySkipPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
-
|
|
190
|
+
|
|
203
191
|
startupScripts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
204
|
-
|
|
192
|
+
|
|
205
193
|
source: z.ZodDefault<z.ZodEnum<["managed", "history", "scheduled"]>>;
|
|
206
|
-
|
|
194
|
+
|
|
207
195
|
background: z.ZodDefault<z.ZodBoolean>;
|
|
208
|
-
|
|
196
|
+
|
|
209
197
|
useWindowsTerminal: z.ZodOptional<z.ZodBoolean>;
|
|
210
198
|
}, "strict", z.ZodTypeAny, {
|
|
211
199
|
permissionMode: string;
|
|
@@ -223,6 +211,7 @@ export declare const SpawnSessionParamsSchema: z.ZodObject<{
|
|
|
223
211
|
agents?: string | undefined;
|
|
224
212
|
agent?: string | undefined;
|
|
225
213
|
brief?: boolean | undefined;
|
|
214
|
+
machineId?: string | undefined;
|
|
226
215
|
prompt?: string | undefined;
|
|
227
216
|
baseUrl?: string | undefined;
|
|
228
217
|
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
@@ -230,7 +219,6 @@ export declare const SpawnSessionParamsSchema: z.ZodObject<{
|
|
|
230
219
|
resumeSessionId?: string | undefined;
|
|
231
220
|
serverSessionId?: string | undefined;
|
|
232
221
|
maxTurns?: number | undefined;
|
|
233
|
-
machineId?: string | undefined;
|
|
234
222
|
spawnToken?: string | undefined;
|
|
235
223
|
handoffContext?: {
|
|
236
224
|
enabled: boolean;
|
|
@@ -284,6 +272,7 @@ export declare const SpawnSessionParamsSchema: z.ZodObject<{
|
|
|
284
272
|
source?: "managed" | "history" | "scheduled" | undefined;
|
|
285
273
|
agent?: string | undefined;
|
|
286
274
|
brief?: boolean | undefined;
|
|
275
|
+
machineId?: string | undefined;
|
|
287
276
|
prompt?: string | undefined;
|
|
288
277
|
baseUrl?: string | undefined;
|
|
289
278
|
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
@@ -291,7 +280,6 @@ export declare const SpawnSessionParamsSchema: z.ZodObject<{
|
|
|
291
280
|
resumeSessionId?: string | undefined;
|
|
292
281
|
serverSessionId?: string | undefined;
|
|
293
282
|
maxTurns?: number | undefined;
|
|
294
|
-
machineId?: string | undefined;
|
|
295
283
|
spawnToken?: string | undefined;
|
|
296
284
|
handoffContext?: {
|
|
297
285
|
enabled: boolean;
|
|
@@ -552,29 +540,29 @@ export type CustomModel = z.infer<typeof CustomModelSchema>;
|
|
|
552
540
|
export declare const SkillDefinitionSchema: z.ZodObject<{
|
|
553
541
|
name: z.ZodString;
|
|
554
542
|
description: z.ZodString;
|
|
555
|
-
|
|
543
|
+
|
|
556
544
|
userInvocable: z.ZodDefault<z.ZodBoolean>;
|
|
557
|
-
|
|
545
|
+
|
|
558
546
|
source: z.ZodDefault<z.ZodEnum<["project", "user"]>>;
|
|
559
|
-
|
|
547
|
+
|
|
560
548
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
561
549
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
562
550
|
name: z.ZodString;
|
|
563
551
|
description: z.ZodString;
|
|
564
|
-
|
|
552
|
+
|
|
565
553
|
userInvocable: z.ZodDefault<z.ZodBoolean>;
|
|
566
|
-
|
|
554
|
+
|
|
567
555
|
source: z.ZodDefault<z.ZodEnum<["project", "user"]>>;
|
|
568
|
-
|
|
556
|
+
|
|
569
557
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
570
558
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
571
559
|
name: z.ZodString;
|
|
572
560
|
description: z.ZodString;
|
|
573
|
-
|
|
561
|
+
|
|
574
562
|
userInvocable: z.ZodDefault<z.ZodBoolean>;
|
|
575
|
-
|
|
563
|
+
|
|
576
564
|
source: z.ZodDefault<z.ZodEnum<["project", "user"]>>;
|
|
577
|
-
|
|
565
|
+
|
|
578
566
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
579
567
|
}, z.ZodTypeAny, "passthrough">>;
|
|
580
568
|
export type SkillDefinition = z.infer<typeof SkillDefinitionSchema>;
|
|
@@ -610,10 +598,7 @@ export declare const AgentEnvConfigSchema: z.ZodObject<{
|
|
|
610
598
|
id: string;
|
|
611
599
|
}[] | undefined;
|
|
612
600
|
}>;
|
|
613
|
-
|
|
614
|
-
* Agent env config for write operations — excludes customEnv.
|
|
615
|
-
* Sensitive fields must not be written via PWA/server (RFC-067).
|
|
616
|
-
*/
|
|
601
|
+
|
|
617
602
|
export declare const AgentEnvConfigSetSchema: z.ZodObject<{
|
|
618
603
|
httpProxy: z.ZodOptional<z.ZodString>;
|
|
619
604
|
httpsProxy: z.ZodOptional<z.ZodString>;
|
|
@@ -650,19 +635,14 @@ export declare const AiHelperConfigSchema: z.ZodObject<{
|
|
|
650
635
|
enabled: boolean;
|
|
651
636
|
}>;
|
|
652
637
|
export type AiHelperConfig = z.infer<typeof AiHelperConfigSchema>;
|
|
653
|
-
|
|
638
|
+
|
|
654
639
|
export declare const LocalAiHelperConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
655
640
|
enabled: z.ZodBoolean;
|
|
656
641
|
provider: z.ZodOptional<z.ZodEnum<["openai", "anthropic", "openai-compatible"]>>;
|
|
657
642
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
658
643
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
659
644
|
modelId: z.ZodOptional<z.ZodString>;
|
|
660
|
-
|
|
661
|
-
* Opt-in reasoning/thinking disabling. Off by default because the exact
|
|
662
|
-
* parameter varies by gateway and sending the wrong one (e.g.
|
|
663
|
-
* `reasoning_effort: "none"` to OpenAI) yields a 400. Enable only when the
|
|
664
|
-
* configured gateway is known to support the corresponding parameter.
|
|
665
|
-
*/
|
|
645
|
+
|
|
666
646
|
disableReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
667
647
|
}, "strict", z.ZodTypeAny, {
|
|
668
648
|
enabled: boolean;
|
|
@@ -694,17 +674,11 @@ export declare const LocalAiHelperConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
694
674
|
disableReasoning?: boolean | undefined;
|
|
695
675
|
}>;
|
|
696
676
|
export type LocalAiHelperConfig = z.infer<typeof LocalAiHelperConfigSchema>;
|
|
697
|
-
|
|
698
|
-
* Sealed ai-helper payload. Personal edition never ships session content to the
|
|
699
|
-
* server as plaintext: the whole { prompt, systemPrompt } value is AES-256-GCM
|
|
700
|
-
* sealed with the session DEK (which only the web client and the daemon share),
|
|
701
|
-
* and only that ciphertext crosses the server. The daemon re-opens it using the
|
|
702
|
-
* same session DEK, so the server stays zero-knowledge.
|
|
703
|
-
*/
|
|
677
|
+
|
|
704
678
|
export declare const AiHelperPayloadSchema: z.ZodObject<{
|
|
705
|
-
|
|
679
|
+
|
|
706
680
|
c: z.ZodString;
|
|
707
|
-
|
|
681
|
+
|
|
708
682
|
t: z.ZodString;
|
|
709
683
|
}, "strict", z.ZodTypeAny, {
|
|
710
684
|
t: string;
|
|
@@ -713,7 +687,7 @@ export declare const AiHelperPayloadSchema: z.ZodObject<{
|
|
|
713
687
|
t: string;
|
|
714
688
|
c: string;
|
|
715
689
|
}>;
|
|
716
|
-
|
|
690
|
+
|
|
717
691
|
export declare const AiHelperDecryptedPayloadSchema: z.ZodObject<{
|
|
718
692
|
prompt: z.ZodString;
|
|
719
693
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
@@ -727,9 +701,9 @@ export declare const AiHelperDecryptedPayloadSchema: z.ZodObject<{
|
|
|
727
701
|
export declare const AiHelperParamsSchema: z.ZodDiscriminatedUnion<"format", [z.ZodObject<{
|
|
728
702
|
format: z.ZodLiteral<"encrypted">;
|
|
729
703
|
payload: z.ZodObject<{
|
|
730
|
-
|
|
704
|
+
|
|
731
705
|
c: z.ZodString;
|
|
732
|
-
|
|
706
|
+
|
|
733
707
|
t: z.ZodString;
|
|
734
708
|
}, "strict", z.ZodTypeAny, {
|
|
735
709
|
t: string;
|
|
@@ -738,11 +712,11 @@ export declare const AiHelperParamsSchema: z.ZodDiscriminatedUnion<"format", [z.
|
|
|
738
712
|
t: string;
|
|
739
713
|
c: string;
|
|
740
714
|
}>;
|
|
741
|
-
|
|
715
|
+
|
|
742
716
|
sessionId: z.ZodString;
|
|
743
|
-
|
|
717
|
+
|
|
744
718
|
machineId: z.ZodOptional<z.ZodString>;
|
|
745
|
-
|
|
719
|
+
|
|
746
720
|
responseLanguage: z.ZodOptional<z.ZodEnum<["en", "zh-Hans"]>>;
|
|
747
721
|
}, "strict", z.ZodTypeAny, {
|
|
748
722
|
sessionId: string;
|
|
@@ -751,8 +725,8 @@ export declare const AiHelperParamsSchema: z.ZodDiscriminatedUnion<"format", [z.
|
|
|
751
725
|
t: string;
|
|
752
726
|
c: string;
|
|
753
727
|
};
|
|
754
|
-
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
755
728
|
machineId?: string | undefined;
|
|
729
|
+
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
756
730
|
}, {
|
|
757
731
|
sessionId: string;
|
|
758
732
|
format: "encrypted";
|
|
@@ -760,38 +734,35 @@ export declare const AiHelperParamsSchema: z.ZodDiscriminatedUnion<"format", [z.
|
|
|
760
734
|
t: string;
|
|
761
735
|
c: string;
|
|
762
736
|
};
|
|
763
|
-
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
764
737
|
machineId?: string | undefined;
|
|
738
|
+
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
765
739
|
}>, z.ZodObject<{
|
|
766
740
|
format: z.ZodLiteral<"plain">;
|
|
767
741
|
prompt: z.ZodString;
|
|
768
742
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
769
|
-
|
|
743
|
+
|
|
770
744
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
771
|
-
|
|
745
|
+
|
|
772
746
|
machineId: z.ZodOptional<z.ZodString>;
|
|
773
|
-
|
|
747
|
+
|
|
774
748
|
responseLanguage: z.ZodOptional<z.ZodEnum<["en", "zh-Hans"]>>;
|
|
775
749
|
}, "strict", z.ZodTypeAny, {
|
|
776
750
|
format: "plain";
|
|
777
751
|
prompt: string;
|
|
778
752
|
sessionId?: string | undefined;
|
|
779
|
-
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
780
753
|
machineId?: string | undefined;
|
|
754
|
+
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
781
755
|
systemPrompt?: string | undefined;
|
|
782
756
|
}, {
|
|
783
757
|
format: "plain";
|
|
784
758
|
prompt: string;
|
|
785
759
|
sessionId?: string | undefined;
|
|
786
|
-
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
787
760
|
machineId?: string | undefined;
|
|
761
|
+
responseLanguage?: "en" | "zh-Hans" | undefined;
|
|
788
762
|
systemPrompt?: string | undefined;
|
|
789
763
|
}>]>;
|
|
790
764
|
export type AiHelperParams = z.infer<typeof AiHelperParamsSchema>;
|
|
791
|
-
|
|
792
|
-
* Full agent settings schema — read-only, used by daemon to load/validate local file.
|
|
793
|
-
* Includes all fields including sensitive ones (notification, customEnv, startupScripts).
|
|
794
|
-
*/
|
|
765
|
+
|
|
795
766
|
export declare const AgentSettingsSchema: z.ZodObject<{
|
|
796
767
|
defaults: z.ZodOptional<z.ZodObject<{
|
|
797
768
|
httpProxy: z.ZodOptional<z.ZodString>;
|
|
@@ -1224,14 +1195,7 @@ export declare const AgentSettingsSchema: z.ZodObject<{
|
|
|
1224
1195
|
enabled: boolean;
|
|
1225
1196
|
} | undefined;
|
|
1226
1197
|
}>;
|
|
1227
|
-
|
|
1228
|
-
* Write-only agent settings schema — .strict() rejects unknown fields.
|
|
1229
|
-
* Sensitive fields managed via separate channels (per RFC-067):
|
|
1230
|
-
* - customEnv: credentials never leave daemon (not in schema)
|
|
1231
|
-
* - notification: webhook URL managed via dedicated pushPreferences route (not in schema)
|
|
1232
|
-
* - startupScripts: managed only by the local daemon configuration file (not in schema)
|
|
1233
|
-
* - machineId: routing key for multi-machine setups, always sent by web client
|
|
1234
|
-
*/
|
|
1198
|
+
|
|
1235
1199
|
export declare const SetAgentSettingsSchema: z.ZodObject<{
|
|
1236
1200
|
defaults: z.ZodOptional<z.ZodObject<{
|
|
1237
1201
|
httpProxy: z.ZodOptional<z.ZodString>;
|
|
@@ -1261,7 +1225,7 @@ export declare const SetAgentSettingsSchema: z.ZodObject<{
|
|
|
1261
1225
|
id: string;
|
|
1262
1226
|
}[] | undefined;
|
|
1263
1227
|
}>>;
|
|
1264
|
-
|
|
1228
|
+
|
|
1265
1229
|
machineId: z.ZodOptional<z.ZodString>;
|
|
1266
1230
|
} & {
|
|
1267
1231
|
hermes: z.ZodOptional<z.ZodObject<{
|
|
@@ -1612,7 +1576,7 @@ export declare const MachineInfoResponseSchema: z.ZodObject<{
|
|
|
1612
1576
|
homedir: z.ZodString;
|
|
1613
1577
|
defaultCwd: z.ZodOptional<z.ZodString>;
|
|
1614
1578
|
recentCwds: z.ZodArray<z.ZodString, "many">;
|
|
1615
|
-
|
|
1579
|
+
|
|
1616
1580
|
projectPaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1617
1581
|
availableAgents: z.ZodArray<z.ZodString, "many">;
|
|
1618
1582
|
agentModels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
@@ -1644,7 +1608,7 @@ export declare const MachineInfoResponseSchema: z.ZodObject<{
|
|
|
1644
1608
|
label: string;
|
|
1645
1609
|
id: string;
|
|
1646
1610
|
}>, "many">>>;
|
|
1647
|
-
|
|
1611
|
+
|
|
1648
1612
|
agentCliPaths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1649
1613
|
agentSettings: z.ZodOptional<z.ZodObject<{
|
|
1650
1614
|
defaults: z.ZodOptional<z.ZodObject<{
|
|
@@ -2078,38 +2042,36 @@ export declare const MachineInfoResponseSchema: z.ZodObject<{
|
|
|
2078
2042
|
enabled: boolean;
|
|
2079
2043
|
} | undefined;
|
|
2080
2044
|
}>>;
|
|
2081
|
-
|
|
2082
|
-
* Keyed by agent type (e.g. 'claude'). */
|
|
2045
|
+
|
|
2083
2046
|
agentSkills: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
2084
2047
|
name: z.ZodString;
|
|
2085
2048
|
description: z.ZodString;
|
|
2086
|
-
|
|
2049
|
+
|
|
2087
2050
|
userInvocable: z.ZodDefault<z.ZodBoolean>;
|
|
2088
|
-
|
|
2051
|
+
|
|
2089
2052
|
source: z.ZodDefault<z.ZodEnum<["project", "user"]>>;
|
|
2090
|
-
|
|
2053
|
+
|
|
2091
2054
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
2092
2055
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2093
2056
|
name: z.ZodString;
|
|
2094
2057
|
description: z.ZodString;
|
|
2095
|
-
|
|
2058
|
+
|
|
2096
2059
|
userInvocable: z.ZodDefault<z.ZodBoolean>;
|
|
2097
|
-
|
|
2060
|
+
|
|
2098
2061
|
source: z.ZodDefault<z.ZodEnum<["project", "user"]>>;
|
|
2099
|
-
|
|
2062
|
+
|
|
2100
2063
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
2101
2064
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2102
2065
|
name: z.ZodString;
|
|
2103
2066
|
description: z.ZodString;
|
|
2104
|
-
|
|
2067
|
+
|
|
2105
2068
|
userInvocable: z.ZodDefault<z.ZodBoolean>;
|
|
2106
|
-
|
|
2069
|
+
|
|
2107
2070
|
source: z.ZodDefault<z.ZodEnum<["project", "user"]>>;
|
|
2108
|
-
|
|
2071
|
+
|
|
2109
2072
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
2110
2073
|
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
2111
|
-
|
|
2112
|
-
* older daemons; web treats an absent value as "not supported". */
|
|
2074
|
+
|
|
2113
2075
|
capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2114
2076
|
}, "strip", z.ZodTypeAny, {
|
|
2115
2077
|
homedir: string;
|
|
@@ -2214,11 +2176,11 @@ export declare const MachineInfoResponseSchema: z.ZodObject<{
|
|
|
2214
2176
|
agentSkills?: Record<string, z.objectOutputType<{
|
|
2215
2177
|
name: z.ZodString;
|
|
2216
2178
|
description: z.ZodString;
|
|
2217
|
-
|
|
2179
|
+
|
|
2218
2180
|
userInvocable: z.ZodDefault<z.ZodBoolean>;
|
|
2219
|
-
|
|
2181
|
+
|
|
2220
2182
|
source: z.ZodDefault<z.ZodEnum<["project", "user"]>>;
|
|
2221
|
-
|
|
2183
|
+
|
|
2222
2184
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
2223
2185
|
}, z.ZodTypeAny, "passthrough">[]> | undefined;
|
|
2224
2186
|
capabilities?: string[] | undefined;
|
|
@@ -2325,18 +2287,18 @@ export declare const MachineInfoResponseSchema: z.ZodObject<{
|
|
|
2325
2287
|
agentSkills?: Record<string, z.objectInputType<{
|
|
2326
2288
|
name: z.ZodString;
|
|
2327
2289
|
description: z.ZodString;
|
|
2328
|
-
|
|
2290
|
+
|
|
2329
2291
|
userInvocable: z.ZodDefault<z.ZodBoolean>;
|
|
2330
|
-
|
|
2292
|
+
|
|
2331
2293
|
source: z.ZodDefault<z.ZodEnum<["project", "user"]>>;
|
|
2332
|
-
|
|
2294
|
+
|
|
2333
2295
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
2334
2296
|
}, z.ZodTypeAny, "passthrough">[]> | undefined;
|
|
2335
2297
|
capabilities?: string[] | undefined;
|
|
2336
2298
|
}>;
|
|
2337
2299
|
export declare const CheckPathParamsSchema: z.ZodObject<{
|
|
2338
2300
|
cwd: z.ZodString;
|
|
2339
|
-
|
|
2301
|
+
|
|
2340
2302
|
machineId: z.ZodOptional<z.ZodString>;
|
|
2341
2303
|
}, "strict", z.ZodTypeAny, {
|
|
2342
2304
|
cwd: string;
|
|
@@ -2346,7 +2308,7 @@ export declare const CheckPathParamsSchema: z.ZodObject<{
|
|
|
2346
2308
|
machineId?: string | undefined;
|
|
2347
2309
|
}>;
|
|
2348
2310
|
export declare const LabsSettingsSchema: z.ZodObject<{
|
|
2349
|
-
|
|
2311
|
+
|
|
2350
2312
|
historySessionSync: z.ZodDefault<z.ZodBoolean>;
|
|
2351
2313
|
}, "strict", z.ZodTypeAny, {
|
|
2352
2314
|
historySessionSync: boolean;
|
|
@@ -2362,7 +2324,7 @@ export type MachineInfoResponse = z.infer<typeof MachineInfoResponseSchema>;
|
|
|
2362
2324
|
export type CheckPathParams = z.infer<typeof CheckPathParamsSchema>;
|
|
2363
2325
|
export type AgentEnvConfig = z.infer<typeof AgentEnvConfigSchema>;
|
|
2364
2326
|
export type AgentSettings = z.infer<typeof AgentSettingsSchema>;
|
|
2365
|
-
|
|
2327
|
+
|
|
2366
2328
|
export declare const LocalAgentSettingsSchema: z.ZodObject<Omit<{
|
|
2367
2329
|
defaults: z.ZodOptional<z.ZodObject<{
|
|
2368
2330
|
httpProxy: z.ZodOptional<z.ZodString>;
|
|
@@ -2640,12 +2602,7 @@ export declare const LocalAgentSettingsSchema: z.ZodObject<Omit<{
|
|
|
2640
2602
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
2641
2603
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
2642
2604
|
modelId: z.ZodOptional<z.ZodString>;
|
|
2643
|
-
|
|
2644
|
-
* Opt-in reasoning/thinking disabling. Off by default because the exact
|
|
2645
|
-
* parameter varies by gateway and sending the wrong one (e.g.
|
|
2646
|
-
* `reasoning_effort: "none"` to OpenAI) yields a 400. Enable only when the
|
|
2647
|
-
* configured gateway is known to support the corresponding parameter.
|
|
2648
|
-
*/
|
|
2605
|
+
|
|
2649
2606
|
disableReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
2650
2607
|
}, "strict", z.ZodTypeAny, {
|
|
2651
2608
|
enabled: boolean;
|
|
@@ -2853,4 +2810,3 @@ export declare const LocalAgentSettingsSchema: z.ZodObject<Omit<{
|
|
|
2853
2810
|
}>;
|
|
2854
2811
|
export type LocalAgentSettings = z.infer<typeof LocalAgentSettingsSchema>;
|
|
2855
2812
|
export type LabsSettings = z.infer<typeof LabsSettingsSchema>;
|
|
2856
|
-
//# sourceMappingURL=rpc.d.ts.map
|
package/dist/rpc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{z as t}from"zod";import{SessionMessageSchema as s}from"./messages.js";import{CLI_AGENT_TYPES as a,SPAWNABLE_AGENTS as n}from"./messageMeta.js";import{SessionHandoffContextSchema as r}from"./workItems.js";import{AccountLanguageSchema as e}from"./accountLanguage.js";export const RpcMethod=t.enum(["spawn-session","stop-session","list-sessions","abort","switch-mode","approve-permission","deny-permission","answer-question","shutdown-daemon","get-messages","get-stats","get-team-stats","start-invite","get-machine-info","get-agent-settings","set-agent-settings","get-labs-settings","set-labs-settings","set-auto-upgrade-daemon","check-path","backfill-history-session","trigger-upgrade","checkpoint-list","checkpoint-diff","checkpoint-rollback","refresh-enterprise-models","cancel-task","file-relay-receive","set-debug","get-debug","record-usage","update-agent-models","update-agent-modes","dispatch-notification","get-context-usage","ai-helper"]),SESSION_RPC_METHODS=["answer-question","approve-permission","deny-permission","abort","stop-session","cancel-task","get-context-usage"],MACHINE_RPC_METHODS=["start-invite","get-machine-info","get-agent-settings","set-agent-settings","get-labs-settings","set-labs-settings","set-auto-upgrade-daemon","check-path","backfill-history-session","trigger-upgrade","checkpoint-list","checkpoint-diff","checkpoint-rollback","refresh-enterprise-models","dispatch-notification","ai-helper"],DAEMON_REQUIRED_RPC_METHODS=[...SESSION_RPC_METHODS,...MACHINE_RPC_METHODS],RpcCallSchema=t.object({method:t.string().min(1),params:t.unknown(),timeout:t.number().int().positive().default(3e4)}),RpcResultSchema=t.discriminatedUnion("ok",[t.object({ok:t.literal(!0),result:t.unknown()}),t.object({ok:t.literal(!1),error:t.string()})]),SpawnSessionParamsSchema=t.object({agentType:t.enum(a),cwd:t.string().min(1),prompt:t.string().optional(),permissionMode:t.string().default("default"),env:t.record(t.string()).optional(),model:t.string().optional(),baseUrl:t.string().url().optional(),appendSystemPrompt:t.string().optional(),responseLanguage:e.optional(),allowedTools:t.array(t.string()).optional(),disallowedTools:t.array(t.string()).optional(),mcpConfig:t.string().optional(),resumeSessionId:t.string().optional(),serverSessionId:t.string().optional(),maxTurns:t.number().int().positive().optional(),machineId:t.string().min(1).optional(),spawnToken:t.string().optional(),handoffContext:r.optional(),systemPrompt:t.string().optional(),systemPromptFile:t.string().optional(),appendSystemPromptFile:t.string().optional(),fallbackModel:t.string().optional(),maxBudgetUsd:t.number().positive().optional(),tools:t.array(t.string()).optional(),effort:t.enum(["low","medium","high","xhigh","max"]).optional(),addDirs:t.array(t.string()).optional(),agent:t.string().optional(),agents:t.string().optional(),jsonSchema:t.string().optional(),strictMcpConfig:t.boolean().optional(),chrome:t.boolean().optional(),worktree:t.union([t.boolean(),t.string()]).optional(),forkSession:t.boolean().optional(),sessionId:t.string().uuid().optional(),settings:t.string().optional(),betas:t.array(t.string()).optional(),brief:t.boolean().optional(),noSessionPersistence:t.boolean().optional(),includePartialMessages:t.boolean().optional(),replayUserMessages:t.boolean().optional(),settingSources:t.string().optional(),disableSlashCommands:t.boolean().optional(),files:t.array(t.string()).optional(),pluginDirs:t.array(t.string()).optional(),dangerouslySkipPermissions:t.boolean().optional(),allowDangerouslySkipPermissions:t.boolean().optional(),startupScripts:t.array(t.string()).optional(),source:t.enum(["managed","history","scheduled"]).default("managed"),background:t.boolean().default(!1),useWindowsTerminal:t.boolean().optional()}).strict(),GetMessagesParamsSchema=t.object({sessionId:t.string().min(1),fromSeq:t.number().int().nonnegative().optional(),limit:t.number().int().positive().default(100)}).strict(),GetMessagesResponseSchema=t.object({messages:t.array(s),total:t.number(),hasMore:t.boolean()}).passthrough(),CustomModelSchema=t.object({id:t.string().min(1),label:t.string().min(1)}),SkillDefinitionSchema=t.object({name:t.string().min(1),description:t.string(),userInvocable:t.boolean().default(!0),source:t.enum(["project","user"]).default("project"),projectPath:t.string().optional()}).passthrough(),AGENT_ENV_NONE="none",AgentEnvConfigSchema=t.object({httpProxy:t.string().optional(),httpsProxy:t.string().optional(),customEnv:t.record(t.string()).optional(),customModels:t.array(CustomModelSchema).optional()}).strict(),AgentEnvConfigSetSchema=t.object({httpProxy:t.string().optional(),httpsProxy:t.string().optional(),customModels:t.array(CustomModelSchema).optional()}).strict(),AiHelperConfigSchema=t.object({enabled:t.boolean()}).strict(),LocalAiHelperConfigSchema=t.object({enabled:t.boolean(),provider:t.enum(["openai","anthropic","openai-compatible"]).optional(),baseUrl:t.string().url().optional(),apiKey:t.string().min(1).optional(),modelId:t.string().min(1).optional(),disableReasoning:t.boolean().optional()}).strict().superRefine((o,i)=>{o.provider==="openai-compatible"&&!o.baseUrl&&i.addIssue({code:t.ZodIssueCode.custom,path:["baseUrl"],message:"baseUrl is required"})}),AiHelperPayloadSchema=t.object({c:t.string().min(1),t:t.string().min(1)}).strict(),AiHelperDecryptedPayloadSchema=t.object({prompt:t.string().min(1).max(16e3),systemPrompt:t.string().max(8e3).optional()}).strict(),AiHelperParamsSchema=t.discriminatedUnion("format",[t.object({format:t.literal("encrypted"),payload:AiHelperPayloadSchema,sessionId:t.string().min(1),machineId:t.string().min(1).optional(),responseLanguage:e.optional()}).strict(),t.object({format:t.literal("plain"),prompt:t.string().min(1).max(16e3),systemPrompt:t.string().max(8e3).optional(),sessionId:t.string().min(1).optional(),machineId:t.string().min(1).optional(),responseLanguage:e.optional()}).strict()]),AgentSettingsSchema=t.object({defaults:AgentEnvConfigSchema.optional(),startupScripts:t.array(t.string()).optional(),notification:t.object({feishu:t.string().optional(),dingtalk:t.string().optional()}).optional()}).merge(t.object(Object.fromEntries(n.map(o=>[o,AgentEnvConfigSchema.optional()])))).merge(t.object({aiHelper:AiHelperConfigSchema.optional()})),SetAgentSettingsSchema=t.object({defaults:AgentEnvConfigSetSchema.optional(),machineId:t.string().optional()}).merge(t.object(Object.fromEntries(n.map(o=>[o,AgentEnvConfigSetSchema.optional()])))).merge(t.object({aiHelper:AiHelperConfigSchema.optional()})).strict(),MachineInfoResponseSchema=t.object({homedir:t.string(),defaultCwd:t.string().optional(),recentCwds:t.array(t.string()),projectPaths:t.array(t.string()).optional().default([]),availableAgents:t.array(t.string()),agentModels:t.record(t.string(),t.array(t.object({id:t.string(),displayName:t.string(),isDefault:t.boolean(),hidden:t.boolean(),source:t.enum(["builtin","acp","env","custom"]).optional().default("acp")}))).optional(),agentModes:t.record(t.string(),t.array(t.object({id:t.string(),label:t.string()}))).optional(),agentCliPaths:t.record(t.string(),t.string()).optional(),agentSettings:AgentSettingsSchema.optional(),agentSkills:t.record(t.string(),t.array(SkillDefinitionSchema)).optional(),capabilities:t.array(t.string()).optional()}),CheckPathParamsSchema=t.object({cwd:t.string().min(1),machineId:t.string().min(1).optional()}).strict(),LabsSettingsSchema=t.object({historySessionSync:t.boolean().default(!1)}).strict(),LocalAgentSettingsSchema=AgentSettingsSchema.omit({aiHelper:!0}).extend({version:t.literal(1).optional(),aiHelper:LocalAiHelperConfigSchema.optional()});
|
|
1
|
+
"use strict";import{z as t}from"zod";import{SessionMessageSchema as s}from"./messages.js";import{CLI_AGENT_TYPES as a,SPAWNABLE_AGENTS as n}from"./messageMeta.js";import{SessionHandoffContextSchema as r}from"./workItems.js";import{AccountLanguageSchema as e}from"./accountLanguage.js";export const RpcMethod=t.enum(["spawn-session","stop-session","list-sessions","abort","switch-mode","approve-permission","deny-permission","answer-question","shutdown-daemon","get-messages","get-stats","get-team-stats","start-invite","get-machine-info","get-agent-settings","set-agent-settings","get-labs-settings","set-labs-settings","set-auto-upgrade-daemon","check-path","backfill-history-session","trigger-upgrade","checkpoint-list","checkpoint-diff","checkpoint-rollback","refresh-enterprise-models","cancel-task","file-relay-receive","set-debug","get-debug","record-usage","update-agent-models","update-agent-modes","dispatch-notification","get-context-usage","ai-helper","ai-helper-cancel"]),AiHelperCancelParamsSchema=t.object({machineId:t.string().min(1),sessionId:t.string().min(1)}).strict(),SESSION_RPC_METHODS=["answer-question","approve-permission","deny-permission","abort","stop-session","cancel-task","get-context-usage"],MACHINE_RPC_METHODS=["start-invite","get-machine-info","get-agent-settings","set-agent-settings","get-labs-settings","set-labs-settings","set-auto-upgrade-daemon","check-path","backfill-history-session","trigger-upgrade","checkpoint-list","checkpoint-diff","checkpoint-rollback","refresh-enterprise-models","dispatch-notification","ai-helper","ai-helper-cancel"],DAEMON_REQUIRED_RPC_METHODS=[...SESSION_RPC_METHODS,...MACHINE_RPC_METHODS],RpcCallSchema=t.object({method:t.string().min(1),params:t.unknown(),timeout:t.number().int().positive().default(3e4)}),RpcResultSchema=t.discriminatedUnion("ok",[t.object({ok:t.literal(!0),result:t.unknown()}),t.object({ok:t.literal(!1),error:t.string()})]),SpawnSessionParamsSchema=t.object({agentType:t.enum(a),cwd:t.string().min(1),prompt:t.string().optional(),permissionMode:t.string().default("default"),env:t.record(t.string()).optional(),model:t.string().optional(),baseUrl:t.string().url().optional(),appendSystemPrompt:t.string().optional(),responseLanguage:e.optional(),allowedTools:t.array(t.string()).optional(),disallowedTools:t.array(t.string()).optional(),mcpConfig:t.string().optional(),resumeSessionId:t.string().optional(),serverSessionId:t.string().optional(),maxTurns:t.number().int().positive().optional(),machineId:t.string().min(1).optional(),spawnToken:t.string().optional(),handoffContext:r.optional(),systemPrompt:t.string().optional(),systemPromptFile:t.string().optional(),appendSystemPromptFile:t.string().optional(),fallbackModel:t.string().optional(),maxBudgetUsd:t.number().positive().optional(),tools:t.array(t.string()).optional(),effort:t.enum(["low","medium","high","xhigh","max"]).optional(),addDirs:t.array(t.string()).optional(),agent:t.string().optional(),agents:t.string().optional(),jsonSchema:t.string().optional(),strictMcpConfig:t.boolean().optional(),chrome:t.boolean().optional(),worktree:t.union([t.boolean(),t.string()]).optional(),forkSession:t.boolean().optional(),sessionId:t.string().uuid().optional(),settings:t.string().optional(),betas:t.array(t.string()).optional(),brief:t.boolean().optional(),noSessionPersistence:t.boolean().optional(),includePartialMessages:t.boolean().optional(),replayUserMessages:t.boolean().optional(),settingSources:t.string().optional(),disableSlashCommands:t.boolean().optional(),files:t.array(t.string()).optional(),pluginDirs:t.array(t.string()).optional(),dangerouslySkipPermissions:t.boolean().optional(),allowDangerouslySkipPermissions:t.boolean().optional(),startupScripts:t.array(t.string()).optional(),source:t.enum(["managed","history","scheduled"]).default("managed"),background:t.boolean().default(!1),useWindowsTerminal:t.boolean().optional()}).strict(),GetMessagesParamsSchema=t.object({sessionId:t.string().min(1),fromSeq:t.number().int().nonnegative().optional(),limit:t.number().int().positive().default(100)}).strict(),GetMessagesResponseSchema=t.object({messages:t.array(s),total:t.number(),hasMore:t.boolean()}).passthrough(),CustomModelSchema=t.object({id:t.string().min(1),label:t.string().min(1)}),SkillDefinitionSchema=t.object({name:t.string().min(1),description:t.string(),userInvocable:t.boolean().default(!0),source:t.enum(["project","user"]).default("project"),projectPath:t.string().optional()}).passthrough(),AGENT_ENV_NONE="none",AgentEnvConfigSchema=t.object({httpProxy:t.string().optional(),httpsProxy:t.string().optional(),customEnv:t.record(t.string()).optional(),customModels:t.array(CustomModelSchema).optional()}).strict(),AgentEnvConfigSetSchema=t.object({httpProxy:t.string().optional(),httpsProxy:t.string().optional(),customModels:t.array(CustomModelSchema).optional()}).strict(),AiHelperConfigSchema=t.object({enabled:t.boolean()}).strict(),LocalAiHelperConfigSchema=t.object({enabled:t.boolean(),provider:t.enum(["openai","anthropic","openai-compatible"]).optional(),baseUrl:t.string().url().optional(),apiKey:t.string().min(1).optional(),modelId:t.string().min(1).optional(),disableReasoning:t.boolean().optional()}).strict().superRefine((o,i)=>{o.provider==="openai-compatible"&&!o.baseUrl&&i.addIssue({code:t.ZodIssueCode.custom,path:["baseUrl"],message:"baseUrl is required"})}),AiHelperPayloadSchema=t.object({c:t.string().min(1),t:t.string().min(1)}).strict(),AiHelperDecryptedPayloadSchema=t.object({prompt:t.string().min(1).max(16e3),systemPrompt:t.string().max(8e3).optional()}).strict(),AiHelperParamsSchema=t.discriminatedUnion("format",[t.object({format:t.literal("encrypted"),payload:AiHelperPayloadSchema,sessionId:t.string().min(1),machineId:t.string().min(1).optional(),responseLanguage:e.optional()}).strict(),t.object({format:t.literal("plain"),prompt:t.string().min(1).max(16e3),systemPrompt:t.string().max(8e3).optional(),sessionId:t.string().min(1).optional(),machineId:t.string().min(1).optional(),responseLanguage:e.optional()}).strict()]),AgentSettingsSchema=t.object({defaults:AgentEnvConfigSchema.optional(),startupScripts:t.array(t.string()).optional(),notification:t.object({feishu:t.string().optional(),dingtalk:t.string().optional()}).optional()}).merge(t.object(Object.fromEntries(n.map(o=>[o,AgentEnvConfigSchema.optional()])))).merge(t.object({aiHelper:AiHelperConfigSchema.optional()})),SetAgentSettingsSchema=t.object({defaults:AgentEnvConfigSetSchema.optional(),machineId:t.string().optional()}).merge(t.object(Object.fromEntries(n.map(o=>[o,AgentEnvConfigSetSchema.optional()])))).merge(t.object({aiHelper:AiHelperConfigSchema.optional()})).strict(),MachineInfoResponseSchema=t.object({homedir:t.string(),defaultCwd:t.string().optional(),recentCwds:t.array(t.string()),projectPaths:t.array(t.string()).optional().default([]),availableAgents:t.array(t.string()),agentModels:t.record(t.string(),t.array(t.object({id:t.string(),displayName:t.string(),isDefault:t.boolean(),hidden:t.boolean(),source:t.enum(["builtin","acp","env","custom"]).optional().default("acp")}))).optional(),agentModes:t.record(t.string(),t.array(t.object({id:t.string(),label:t.string()}))).optional(),agentCliPaths:t.record(t.string(),t.string()).optional(),agentSettings:AgentSettingsSchema.optional(),agentSkills:t.record(t.string(),t.array(SkillDefinitionSchema)).optional(),capabilities:t.array(t.string()).optional()}),CheckPathParamsSchema=t.object({cwd:t.string().min(1),machineId:t.string().min(1).optional()}).strict(),LabsSettingsSchema=t.object({historySessionSync:t.boolean().default(!1)}).strict(),LocalAgentSettingsSchema=AgentSettingsSchema.omit({aiHelper:!0}).extend({version:t.literal(1).optional(),aiHelper:LocalAiHelperConfigSchema.optional()});
|