@agentdock/wire 0.0.90 → 0.0.92
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/activityPreferences.js +1 -2
- package/dist/agentCapabilities.d.ts +2 -0
- package/dist/agentCapabilities.js +1 -199
- package/dist/agentCommonEnv.js +1 -20
- package/dist/agentInstallGuide.js +1 -81
- package/dist/bgTask.js +1 -128
- package/dist/checkpointSchemas.d.ts +142 -98
- package/dist/checkpointSchemas.js +1 -46
- package/dist/controlLevel.js +1 -11
- package/dist/edition.js +1 -13
- package/dist/envelope.d.ts +5668 -563
- package/dist/envelope.js +1 -77
- package/dist/errorMessage.js +1 -6
- package/dist/events.d.ts +2053 -324
- package/dist/events.js +1 -107
- package/dist/features.d.ts +3 -1
- package/dist/features.js +1 -123
- package/dist/feedback.d.ts +2 -2
- package/dist/feedback.js +1 -61
- package/dist/fileWhitelist.js +1 -189
- package/dist/inboundEvents.d.ts +531 -0
- package/dist/inboundEvents.js +1 -0
- package/dist/index.d.ts +11 -5
- package/dist/index.js +1 -73
- package/dist/interactionEvents.d.ts +153 -106
- package/dist/interactionEvents.js +1 -111
- package/dist/legacyProtocol.d.ts +512 -272
- package/dist/legacyProtocol.js +1 -30
- package/dist/license.js +1 -28
- package/dist/machine.d.ts +108 -62
- package/dist/machine.js +1 -66
- package/dist/messageMeta.d.ts +34 -28
- package/dist/messageMeta.js +1 -60
- package/dist/messages.d.ts +34900 -1862
- package/dist/messages.js +1 -35
- package/dist/notification.d.ts +48 -0
- package/dist/notification.js +1 -0
- package/dist/ops.d.ts +165 -122
- package/dist/ops.js +1 -74
- package/dist/pairing.d.ts +4 -4
- package/dist/pairing.js +1 -150
- package/dist/permissionSubject.js +1 -68
- package/dist/protocol.js +1 -7
- package/dist/rpc.d.ts +749 -189
- package/dist/rpc.js +1 -269
- package/dist/scheduledTasks.d.ts +619 -304
- package/dist/scheduledTasks.js +1 -188
- package/dist/semver.js +1 -60
- package/dist/sessionResult.d.ts +31 -17
- package/dist/sessionResult.js +1 -23
- package/dist/socketEvents.d.ts +7 -0
- package/dist/socketEvents.js +1 -55
- package/dist/sourceMetadata.d.ts +44 -0
- package/dist/sourceMetadata.js +1 -0
- package/dist/spawnError.d.ts +21 -17
- package/dist/spawnError.js +1 -31
- package/dist/stats.d.ts +73 -73
- package/dist/stats.js +1 -117
- package/dist/sync.d.ts +2165 -819
- package/dist/sync.js +1 -99
- package/dist/taskResult.js +1 -113
- package/dist/telemetry.d.ts +120 -64
- package/dist/telemetry.js +1 -115
- package/dist/utils.js +1 -2
- package/package.json +1 -1
- package/dist/activityPreferences.d.ts.map +0 -1
- package/dist/activityPreferences.js.map +0 -1
- package/dist/agentCapabilities.d.ts.map +0 -1
- package/dist/agentCapabilities.js.map +0 -1
- package/dist/agentCommonEnv.d.ts.map +0 -1
- package/dist/agentCommonEnv.js.map +0 -1
- package/dist/agentInstallGuide.d.ts.map +0 -1
- package/dist/agentInstallGuide.js.map +0 -1
- package/dist/bgTask.d.ts.map +0 -1
- package/dist/bgTask.js.map +0 -1
- package/dist/checkpointSchemas.d.ts.map +0 -1
- package/dist/checkpointSchemas.js.map +0 -1
- package/dist/controlLevel.d.ts.map +0 -1
- package/dist/controlLevel.js.map +0 -1
- package/dist/edition.d.ts.map +0 -1
- package/dist/edition.js.map +0 -1
- package/dist/envelope.d.ts.map +0 -1
- package/dist/envelope.js.map +0 -1
- package/dist/errorMessage.d.ts.map +0 -1
- package/dist/errorMessage.js.map +0 -1
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/features.d.ts.map +0 -1
- package/dist/features.js.map +0 -1
- package/dist/feedback.d.ts.map +0 -1
- package/dist/feedback.js.map +0 -1
- package/dist/fileWhitelist.d.ts.map +0 -1
- package/dist/fileWhitelist.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/interactionEvents.d.ts.map +0 -1
- package/dist/interactionEvents.js.map +0 -1
- package/dist/legacyProtocol.d.ts.map +0 -1
- package/dist/legacyProtocol.js.map +0 -1
- package/dist/license.d.ts.map +0 -1
- package/dist/license.js.map +0 -1
- package/dist/machine.d.ts.map +0 -1
- package/dist/machine.js.map +0 -1
- package/dist/messageMeta.d.ts.map +0 -1
- package/dist/messageMeta.js.map +0 -1
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js.map +0 -1
- package/dist/ops.d.ts.map +0 -1
- package/dist/ops.js.map +0 -1
- package/dist/pairing.d.ts.map +0 -1
- package/dist/pairing.js.map +0 -1
- package/dist/permissionSubject.d.ts.map +0 -1
- package/dist/permissionSubject.js.map +0 -1
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js.map +0 -1
- package/dist/rpc.d.ts.map +0 -1
- package/dist/rpc.js.map +0 -1
- package/dist/scheduledTasks.d.ts.map +0 -1
- package/dist/scheduledTasks.js.map +0 -1
- package/dist/semver.d.ts.map +0 -1
- package/dist/semver.js.map +0 -1
- package/dist/sessionResult.d.ts.map +0 -1
- package/dist/sessionResult.js.map +0 -1
- package/dist/socketEvents.d.ts.map +0 -1
- package/dist/socketEvents.js.map +0 -1
- package/dist/spawnError.d.ts.map +0 -1
- package/dist/spawnError.js.map +0 -1
- package/dist/stats.d.ts.map +0 -1
- package/dist/stats.js.map +0 -1
- package/dist/sync.d.ts.map +0 -1
- package/dist/sync.js.map +0 -1
- package/dist/taskResult.d.ts.map +0 -1
- package/dist/taskResult.js.map +0 -1
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/telemetry.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inbound Socket.IO event payload schemas (daemon/web → server).
|
|
3
|
+
*
|
|
4
|
+
* These validate the HIGHEST-FREQUENCY channel in the system: every session
|
|
5
|
+
* create / state change / message / machine register flows through here. Unlike
|
|
6
|
+
* REST bodies (validated by `.strict()` schemas in their own modules), these
|
|
7
|
+
* events were historically validated by hand-written `is*` type predicates in
|
|
8
|
+
* server's `sessionPayloads.ts` — which drift from the wire contract silently.
|
|
9
|
+
*
|
|
10
|
+
* Mode choice — `.passthrough()`, NOT `.strict()`:
|
|
11
|
+
* The daemon runs on the user's machine and upgrades lag the server. A newer
|
|
12
|
+
* daemon may add fields an older server hasn't learned yet; strict rejection
|
|
13
|
+
* would fail the whole session-create over an additive field. Passthrough lets
|
|
14
|
+
* additive fields ride along while still enforcing that REQUIRED fields exist
|
|
15
|
+
* with the right type — which is the actual defense against silent drops.
|
|
16
|
+
* Same principle already applied in envelope.ts / machine.ts.
|
|
17
|
+
*
|
|
18
|
+
* When a field is intentionally NOT consumed by the server (daemon-only
|
|
19
|
+
* bookkeeping), that's fine — passthrough carries it. Required fields the server
|
|
20
|
+
* relies on are listed explicitly below.
|
|
21
|
+
*/
|
|
22
|
+
import { z } from 'zod';
|
|
23
|
+
/** session-create — createSession() in daemon serverClient. */
|
|
24
|
+
export declare const SessionCreatePayloadSchema: z.ZodObject<{
|
|
25
|
+
tag: z.ZodString;
|
|
26
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
27
|
+
dataEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
28
|
+
source: z.ZodOptional<z.ZodString>;
|
|
29
|
+
claudeSessionId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
projectPath: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
32
|
+
tag: z.ZodString;
|
|
33
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
34
|
+
dataEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
35
|
+
source: z.ZodOptional<z.ZodString>;
|
|
36
|
+
claudeSessionId: z.ZodOptional<z.ZodString>;
|
|
37
|
+
projectPath: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
39
|
+
tag: z.ZodString;
|
|
40
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
41
|
+
dataEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
42
|
+
source: z.ZodOptional<z.ZodString>;
|
|
43
|
+
claudeSessionId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
projectPath: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
46
|
+
export type SessionCreatePayload = z.infer<typeof SessionCreatePayloadSchema>;
|
|
47
|
+
/** update-metadata — optimistic-concurrency metadata write. */
|
|
48
|
+
export declare const UpdateMetadataPayloadSchema: z.ZodObject<{
|
|
49
|
+
sessionId: z.ZodString;
|
|
50
|
+
metadata: z.ZodString;
|
|
51
|
+
expectedVersion: z.ZodNumber;
|
|
52
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
53
|
+
sessionId: z.ZodString;
|
|
54
|
+
metadata: z.ZodString;
|
|
55
|
+
expectedVersion: z.ZodNumber;
|
|
56
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
57
|
+
sessionId: z.ZodString;
|
|
58
|
+
metadata: z.ZodString;
|
|
59
|
+
expectedVersion: z.ZodNumber;
|
|
60
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
61
|
+
export type UpdateMetadataPayload = z.infer<typeof UpdateMetadataPayloadSchema>;
|
|
62
|
+
/** context-usage-update — best-effort context-usage snapshot write (no CAS). */
|
|
63
|
+
export declare const ContextUsageUpdatePayloadSchema: z.ZodObject<{
|
|
64
|
+
sessionId: z.ZodString;
|
|
65
|
+
contextUsage: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
66
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
67
|
+
sessionId: z.ZodString;
|
|
68
|
+
contextUsage: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
69
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
70
|
+
sessionId: z.ZodString;
|
|
71
|
+
contextUsage: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
72
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
73
|
+
export type ContextUsageUpdatePayload = z.infer<typeof ContextUsageUpdatePayloadSchema>;
|
|
74
|
+
/** update-state — optimistic-concurrency agent-state write. */
|
|
75
|
+
export declare const UpdateStatePayloadSchema: z.ZodObject<{
|
|
76
|
+
sessionId: z.ZodString;
|
|
77
|
+
agentState: z.ZodString;
|
|
78
|
+
expectedVersion: z.ZodNumber;
|
|
79
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
80
|
+
sessionId: z.ZodString;
|
|
81
|
+
agentState: z.ZodString;
|
|
82
|
+
expectedVersion: z.ZodNumber;
|
|
83
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
84
|
+
sessionId: z.ZodString;
|
|
85
|
+
agentState: z.ZodString;
|
|
86
|
+
expectedVersion: z.ZodNumber;
|
|
87
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
88
|
+
export type UpdateStatePayload = z.infer<typeof UpdateStatePayloadSchema>;
|
|
89
|
+
/** session-alive optionally consumes a server-issued resume takeover reservation. */
|
|
90
|
+
export declare const SessionAlivePayloadSchema: z.ZodObject<{
|
|
91
|
+
sessionId: z.ZodString;
|
|
92
|
+
takeoverToken: z.ZodOptional<z.ZodString>;
|
|
93
|
+
runtimeStatus: z.ZodOptional<z.ZodEnum<["idle", "thinking", "tool_running", "permission_required", "disconnected"]>>;
|
|
94
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
95
|
+
sessionId: z.ZodString;
|
|
96
|
+
takeoverToken: z.ZodOptional<z.ZodString>;
|
|
97
|
+
runtimeStatus: z.ZodOptional<z.ZodEnum<["idle", "thinking", "tool_running", "permission_required", "disconnected"]>>;
|
|
98
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
99
|
+
sessionId: z.ZodString;
|
|
100
|
+
takeoverToken: z.ZodOptional<z.ZodString>;
|
|
101
|
+
runtimeStatus: z.ZodOptional<z.ZodEnum<["idle", "thinking", "tool_running", "permission_required", "disconnected"]>>;
|
|
102
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
103
|
+
export type SessionAlivePayload = z.infer<typeof SessionAlivePayloadSchema>;
|
|
104
|
+
/** Read-only web query for the server's short-lived daemon runtime snapshot. */
|
|
105
|
+
export declare const GetSessionRuntimeStatusPayloadSchema: z.ZodObject<{
|
|
106
|
+
sessionId: z.ZodString;
|
|
107
|
+
}, "strict", z.ZodTypeAny, {
|
|
108
|
+
sessionId: string;
|
|
109
|
+
}, {
|
|
110
|
+
sessionId: string;
|
|
111
|
+
}>;
|
|
112
|
+
export type GetSessionRuntimeStatusPayload = z.infer<typeof GetSessionRuntimeStatusPayloadSchema>;
|
|
113
|
+
export declare const SessionDeletePayloadSchema: z.ZodObject<{
|
|
114
|
+
sessionId: z.ZodString;
|
|
115
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
116
|
+
sessionId: z.ZodString;
|
|
117
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
118
|
+
sessionId: z.ZodString;
|
|
119
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
120
|
+
export type SessionDeletePayload = z.infer<typeof SessionDeletePayloadSchema>;
|
|
121
|
+
/** session-end — carries optional summary (was silently dropped by old predicate). */
|
|
122
|
+
export declare const SessionEndPayloadSchema: z.ZodObject<{
|
|
123
|
+
sessionId: z.ZodString;
|
|
124
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
125
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
126
|
+
sessionId: z.ZodString;
|
|
127
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
129
|
+
sessionId: z.ZodString;
|
|
130
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
132
|
+
export type SessionEndPayload = z.infer<typeof SessionEndPayloadSchema>;
|
|
133
|
+
/** rename-session. */
|
|
134
|
+
export declare const RenameSessionPayloadSchema: z.ZodObject<{
|
|
135
|
+
sessionId: z.ZodString;
|
|
136
|
+
displayName: z.ZodEffects<z.ZodString, string, string>;
|
|
137
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
138
|
+
sessionId: z.ZodString;
|
|
139
|
+
displayName: z.ZodEffects<z.ZodString, string, string>;
|
|
140
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
141
|
+
sessionId: z.ZodString;
|
|
142
|
+
displayName: z.ZodEffects<z.ZodString, string, string>;
|
|
143
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
144
|
+
export type RenameSessionPayload = z.infer<typeof RenameSessionPayloadSchema>;
|
|
145
|
+
/** message — single message insert. `content` shape validated downstream. */
|
|
146
|
+
export declare const MessagePayloadSchema: z.ZodEffects<z.ZodObject<{
|
|
147
|
+
sessionId: z.ZodString;
|
|
148
|
+
localId: z.ZodString;
|
|
149
|
+
content: z.ZodUnknown;
|
|
150
|
+
skipBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
153
|
+
sessionId: z.ZodString;
|
|
154
|
+
localId: z.ZodString;
|
|
155
|
+
content: z.ZodUnknown;
|
|
156
|
+
skipBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
159
|
+
sessionId: z.ZodString;
|
|
160
|
+
localId: z.ZodString;
|
|
161
|
+
content: z.ZodUnknown;
|
|
162
|
+
skipBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
164
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
165
|
+
sessionId: z.ZodString;
|
|
166
|
+
localId: z.ZodString;
|
|
167
|
+
content: z.ZodUnknown;
|
|
168
|
+
skipBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
171
|
+
sessionId: z.ZodString;
|
|
172
|
+
localId: z.ZodString;
|
|
173
|
+
content: z.ZodUnknown;
|
|
174
|
+
skipBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
177
|
+
export type MessagePayload = z.infer<typeof MessagePayloadSchema>;
|
|
178
|
+
export declare const BatchMessagePayloadSchema: z.ZodObject<{
|
|
179
|
+
sessionId: z.ZodString;
|
|
180
|
+
messages: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
181
|
+
localId: z.ZodString;
|
|
182
|
+
content: z.ZodUnknown;
|
|
183
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
184
|
+
localId: z.ZodString;
|
|
185
|
+
content: z.ZodUnknown;
|
|
186
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
187
|
+
localId: z.ZodString;
|
|
188
|
+
content: z.ZodUnknown;
|
|
189
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
190
|
+
localId: z.ZodString;
|
|
191
|
+
content: z.ZodUnknown;
|
|
192
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
193
|
+
localId: z.ZodString;
|
|
194
|
+
content: z.ZodUnknown;
|
|
195
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
196
|
+
skipBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
198
|
+
sessionId: z.ZodString;
|
|
199
|
+
messages: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
200
|
+
localId: z.ZodString;
|
|
201
|
+
content: z.ZodUnknown;
|
|
202
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
203
|
+
localId: z.ZodString;
|
|
204
|
+
content: z.ZodUnknown;
|
|
205
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
206
|
+
localId: z.ZodString;
|
|
207
|
+
content: z.ZodUnknown;
|
|
208
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
209
|
+
localId: z.ZodString;
|
|
210
|
+
content: z.ZodUnknown;
|
|
211
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
212
|
+
localId: z.ZodString;
|
|
213
|
+
content: z.ZodUnknown;
|
|
214
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
215
|
+
skipBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
216
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
217
|
+
sessionId: z.ZodString;
|
|
218
|
+
messages: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
219
|
+
localId: z.ZodString;
|
|
220
|
+
content: z.ZodUnknown;
|
|
221
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
222
|
+
localId: z.ZodString;
|
|
223
|
+
content: z.ZodUnknown;
|
|
224
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
225
|
+
localId: z.ZodString;
|
|
226
|
+
content: z.ZodUnknown;
|
|
227
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
228
|
+
localId: z.ZodString;
|
|
229
|
+
content: z.ZodUnknown;
|
|
230
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
231
|
+
localId: z.ZodString;
|
|
232
|
+
content: z.ZodUnknown;
|
|
233
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
234
|
+
skipBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
235
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
236
|
+
export type BatchMessagePayload = z.infer<typeof BatchMessagePayloadSchema>;
|
|
237
|
+
/** get-messages — paginated read. */
|
|
238
|
+
export declare const GetMessagesPayloadSchema: z.ZodObject<{
|
|
239
|
+
sessionId: z.ZodString;
|
|
240
|
+
fromSeq: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
beforeSeq: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
243
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
244
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
245
|
+
sessionId: z.ZodString;
|
|
246
|
+
fromSeq: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
beforeSeq: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
249
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
251
|
+
sessionId: z.ZodString;
|
|
252
|
+
fromSeq: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
beforeSeq: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
255
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
257
|
+
export type GetMessagesPayload = z.infer<typeof GetMessagesPayloadSchema>;
|
|
258
|
+
/**
|
|
259
|
+
* session-status — daemon's fire-and-forget status ping.
|
|
260
|
+
*
|
|
261
|
+
* NOTE: `status` here is a free string, NOT the `SessionStatusSchema` enum in
|
|
262
|
+
* machine.ts — that enum omits `turn-completed`, which the daemon DOES send.
|
|
263
|
+
* The set below is the daemon's actual vocabulary.
|
|
264
|
+
*
|
|
265
|
+
* SECURITY — this schema is `.strict()` ON PURPOSE (the only inbound schema that
|
|
266
|
+
* is). IM notifications derived from this event are delivered to third-party
|
|
267
|
+
* webhooks (Feishu/DingTalk). This channel must carry NOTHING but the two fields
|
|
268
|
+
* below — no conversation content, no summary, no message text, no future field
|
|
269
|
+
* that might smuggle sensitive data out. `.strict()` REJECTS any extra field
|
|
270
|
+
* (loudly, not silently), so the day someone tries to attach `summary` /
|
|
271
|
+
* `context` / `lastMessage` / anything else, their code fails here and they are
|
|
272
|
+
* forced to ask "can this field leave the machine?". Default-deny, then allow.
|
|
273
|
+
* Do NOT relax this to `.passthrough()`. See docs/spec/notification-im.md.
|
|
274
|
+
*/
|
|
275
|
+
export declare const INBOUND_SESSION_STATUSES: readonly ["idle", "thinking", "tool_running", "permission_required", "disconnected", "turn-completed"];
|
|
276
|
+
export declare const SessionStatusPayloadSchema: z.ZodObject<{
|
|
277
|
+
sessionId: z.ZodString;
|
|
278
|
+
status: z.ZodEnum<["idle", "thinking", "tool_running", "permission_required", "disconnected", "turn-completed"]>;
|
|
279
|
+
}, "strict", z.ZodTypeAny, {
|
|
280
|
+
status: "idle" | "thinking" | "tool_running" | "permission_required" | "disconnected" | "turn-completed";
|
|
281
|
+
sessionId: string;
|
|
282
|
+
}, {
|
|
283
|
+
status: "idle" | "thinking" | "tool_running" | "permission_required" | "disconnected" | "turn-completed";
|
|
284
|
+
sessionId: string;
|
|
285
|
+
}>;
|
|
286
|
+
export type SessionStatusPayload = z.infer<typeof SessionStatusPayloadSchema>;
|
|
287
|
+
/**
|
|
288
|
+
* machine-register — daemon reports its identity + capabilities on connect.
|
|
289
|
+
* Mirrors daemon's MachineRegisterInfo; only hostname/platform are required.
|
|
290
|
+
* All capability fields are optional and additive (passthrough tolerates new
|
|
291
|
+
* ones a newer daemon may add).
|
|
292
|
+
*/
|
|
293
|
+
export declare const MachineRegisterPayloadSchema: z.ZodObject<{
|
|
294
|
+
hostname: z.ZodString;
|
|
295
|
+
platform: z.ZodString;
|
|
296
|
+
arch: z.ZodOptional<z.ZodString>;
|
|
297
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
298
|
+
daemonVersion: z.ZodOptional<z.ZodString>;
|
|
299
|
+
availableAgents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
300
|
+
agentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
301
|
+
terminalHost: z.ZodOptional<z.ZodString>;
|
|
302
|
+
terminalPort: z.ZodOptional<z.ZodNumber>;
|
|
303
|
+
upgradeStatus: z.ZodOptional<z.ZodString>;
|
|
304
|
+
upgradeError: z.ZodOptional<z.ZodString>;
|
|
305
|
+
lastUpgradeError: z.ZodOptional<z.ZodString>;
|
|
306
|
+
derivationVersion: z.ZodOptional<z.ZodNumber>;
|
|
307
|
+
autoUpgradeDaemon: z.ZodOptional<z.ZodBoolean>;
|
|
308
|
+
notifyFeishu: z.ZodOptional<z.ZodBoolean>;
|
|
309
|
+
notifyDingtalk: z.ZodOptional<z.ZodBoolean>;
|
|
310
|
+
agentModels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
311
|
+
id: z.ZodString;
|
|
312
|
+
displayName: z.ZodString;
|
|
313
|
+
isDefault: z.ZodBoolean;
|
|
314
|
+
hidden: z.ZodBoolean;
|
|
315
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
316
|
+
id: z.ZodString;
|
|
317
|
+
displayName: z.ZodString;
|
|
318
|
+
isDefault: z.ZodBoolean;
|
|
319
|
+
hidden: z.ZodBoolean;
|
|
320
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
321
|
+
id: z.ZodString;
|
|
322
|
+
displayName: z.ZodString;
|
|
323
|
+
isDefault: z.ZodBoolean;
|
|
324
|
+
hidden: z.ZodBoolean;
|
|
325
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
326
|
+
agentModes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
327
|
+
id: z.ZodString;
|
|
328
|
+
label: z.ZodString;
|
|
329
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
330
|
+
id: z.ZodString;
|
|
331
|
+
label: z.ZodString;
|
|
332
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
333
|
+
id: z.ZodString;
|
|
334
|
+
label: z.ZodString;
|
|
335
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
336
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
337
|
+
hostname: z.ZodString;
|
|
338
|
+
platform: z.ZodString;
|
|
339
|
+
arch: z.ZodOptional<z.ZodString>;
|
|
340
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
341
|
+
daemonVersion: z.ZodOptional<z.ZodString>;
|
|
342
|
+
availableAgents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
343
|
+
agentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
344
|
+
terminalHost: z.ZodOptional<z.ZodString>;
|
|
345
|
+
terminalPort: z.ZodOptional<z.ZodNumber>;
|
|
346
|
+
upgradeStatus: z.ZodOptional<z.ZodString>;
|
|
347
|
+
upgradeError: z.ZodOptional<z.ZodString>;
|
|
348
|
+
lastUpgradeError: z.ZodOptional<z.ZodString>;
|
|
349
|
+
derivationVersion: z.ZodOptional<z.ZodNumber>;
|
|
350
|
+
autoUpgradeDaemon: z.ZodOptional<z.ZodBoolean>;
|
|
351
|
+
notifyFeishu: z.ZodOptional<z.ZodBoolean>;
|
|
352
|
+
notifyDingtalk: z.ZodOptional<z.ZodBoolean>;
|
|
353
|
+
agentModels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
354
|
+
id: z.ZodString;
|
|
355
|
+
displayName: z.ZodString;
|
|
356
|
+
isDefault: z.ZodBoolean;
|
|
357
|
+
hidden: z.ZodBoolean;
|
|
358
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
359
|
+
id: z.ZodString;
|
|
360
|
+
displayName: z.ZodString;
|
|
361
|
+
isDefault: z.ZodBoolean;
|
|
362
|
+
hidden: z.ZodBoolean;
|
|
363
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
364
|
+
id: z.ZodString;
|
|
365
|
+
displayName: z.ZodString;
|
|
366
|
+
isDefault: z.ZodBoolean;
|
|
367
|
+
hidden: z.ZodBoolean;
|
|
368
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
369
|
+
agentModes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
370
|
+
id: z.ZodString;
|
|
371
|
+
label: z.ZodString;
|
|
372
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
373
|
+
id: z.ZodString;
|
|
374
|
+
label: z.ZodString;
|
|
375
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
376
|
+
id: z.ZodString;
|
|
377
|
+
label: z.ZodString;
|
|
378
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
379
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
380
|
+
hostname: z.ZodString;
|
|
381
|
+
platform: z.ZodString;
|
|
382
|
+
arch: z.ZodOptional<z.ZodString>;
|
|
383
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
384
|
+
daemonVersion: z.ZodOptional<z.ZodString>;
|
|
385
|
+
availableAgents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
386
|
+
agentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
387
|
+
terminalHost: z.ZodOptional<z.ZodString>;
|
|
388
|
+
terminalPort: z.ZodOptional<z.ZodNumber>;
|
|
389
|
+
upgradeStatus: z.ZodOptional<z.ZodString>;
|
|
390
|
+
upgradeError: z.ZodOptional<z.ZodString>;
|
|
391
|
+
lastUpgradeError: z.ZodOptional<z.ZodString>;
|
|
392
|
+
derivationVersion: z.ZodOptional<z.ZodNumber>;
|
|
393
|
+
autoUpgradeDaemon: z.ZodOptional<z.ZodBoolean>;
|
|
394
|
+
notifyFeishu: z.ZodOptional<z.ZodBoolean>;
|
|
395
|
+
notifyDingtalk: z.ZodOptional<z.ZodBoolean>;
|
|
396
|
+
agentModels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
397
|
+
id: z.ZodString;
|
|
398
|
+
displayName: z.ZodString;
|
|
399
|
+
isDefault: z.ZodBoolean;
|
|
400
|
+
hidden: z.ZodBoolean;
|
|
401
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
402
|
+
id: z.ZodString;
|
|
403
|
+
displayName: z.ZodString;
|
|
404
|
+
isDefault: z.ZodBoolean;
|
|
405
|
+
hidden: z.ZodBoolean;
|
|
406
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
407
|
+
id: z.ZodString;
|
|
408
|
+
displayName: z.ZodString;
|
|
409
|
+
isDefault: z.ZodBoolean;
|
|
410
|
+
hidden: z.ZodBoolean;
|
|
411
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
412
|
+
agentModes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
413
|
+
id: z.ZodString;
|
|
414
|
+
label: z.ZodString;
|
|
415
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
416
|
+
id: z.ZodString;
|
|
417
|
+
label: z.ZodString;
|
|
418
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
419
|
+
id: z.ZodString;
|
|
420
|
+
label: z.ZodString;
|
|
421
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
422
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
423
|
+
export type MachineRegisterPayload = z.infer<typeof MachineRegisterPayloadSchema>;
|
|
424
|
+
/** register-history-sessions — RFC-016 history sync batch. */
|
|
425
|
+
export declare const HistorySessionEntrySchema: z.ZodObject<{
|
|
426
|
+
claudeSessionId: z.ZodString;
|
|
427
|
+
projectPath: z.ZodString;
|
|
428
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
429
|
+
messageCount: z.ZodNumber;
|
|
430
|
+
createdAt: z.ZodString;
|
|
431
|
+
agentType: z.ZodString;
|
|
432
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
433
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
434
|
+
claudeSessionId: z.ZodString;
|
|
435
|
+
projectPath: z.ZodString;
|
|
436
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
437
|
+
messageCount: z.ZodNumber;
|
|
438
|
+
createdAt: z.ZodString;
|
|
439
|
+
agentType: z.ZodString;
|
|
440
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
441
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
442
|
+
claudeSessionId: z.ZodString;
|
|
443
|
+
projectPath: z.ZodString;
|
|
444
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
445
|
+
messageCount: z.ZodNumber;
|
|
446
|
+
createdAt: z.ZodString;
|
|
447
|
+
agentType: z.ZodString;
|
|
448
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
449
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
450
|
+
export type HistorySessionEntry = z.infer<typeof HistorySessionEntrySchema>;
|
|
451
|
+
export declare const RegisterHistorySessionsPayloadSchema: z.ZodObject<{
|
|
452
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
453
|
+
claudeSessionId: z.ZodString;
|
|
454
|
+
projectPath: z.ZodString;
|
|
455
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
456
|
+
messageCount: z.ZodNumber;
|
|
457
|
+
createdAt: z.ZodString;
|
|
458
|
+
agentType: z.ZodString;
|
|
459
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
460
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
461
|
+
claudeSessionId: z.ZodString;
|
|
462
|
+
projectPath: z.ZodString;
|
|
463
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
464
|
+
messageCount: z.ZodNumber;
|
|
465
|
+
createdAt: z.ZodString;
|
|
466
|
+
agentType: z.ZodString;
|
|
467
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
468
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
469
|
+
claudeSessionId: z.ZodString;
|
|
470
|
+
projectPath: z.ZodString;
|
|
471
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
472
|
+
messageCount: z.ZodNumber;
|
|
473
|
+
createdAt: z.ZodString;
|
|
474
|
+
agentType: z.ZodString;
|
|
475
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
476
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
477
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
478
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
479
|
+
claudeSessionId: z.ZodString;
|
|
480
|
+
projectPath: z.ZodString;
|
|
481
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
482
|
+
messageCount: z.ZodNumber;
|
|
483
|
+
createdAt: z.ZodString;
|
|
484
|
+
agentType: z.ZodString;
|
|
485
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
486
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
487
|
+
claudeSessionId: z.ZodString;
|
|
488
|
+
projectPath: z.ZodString;
|
|
489
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
490
|
+
messageCount: z.ZodNumber;
|
|
491
|
+
createdAt: z.ZodString;
|
|
492
|
+
agentType: z.ZodString;
|
|
493
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
494
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
495
|
+
claudeSessionId: z.ZodString;
|
|
496
|
+
projectPath: z.ZodString;
|
|
497
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
498
|
+
messageCount: z.ZodNumber;
|
|
499
|
+
createdAt: z.ZodString;
|
|
500
|
+
agentType: z.ZodString;
|
|
501
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
502
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
503
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
504
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
505
|
+
claudeSessionId: z.ZodString;
|
|
506
|
+
projectPath: z.ZodString;
|
|
507
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
508
|
+
messageCount: z.ZodNumber;
|
|
509
|
+
createdAt: z.ZodString;
|
|
510
|
+
agentType: z.ZodString;
|
|
511
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
512
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
513
|
+
claudeSessionId: z.ZodString;
|
|
514
|
+
projectPath: z.ZodString;
|
|
515
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
516
|
+
messageCount: z.ZodNumber;
|
|
517
|
+
createdAt: z.ZodString;
|
|
518
|
+
agentType: z.ZodString;
|
|
519
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
520
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
521
|
+
claudeSessionId: z.ZodString;
|
|
522
|
+
projectPath: z.ZodString;
|
|
523
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
524
|
+
messageCount: z.ZodNumber;
|
|
525
|
+
createdAt: z.ZodString;
|
|
526
|
+
agentType: z.ZodString;
|
|
527
|
+
isSubagent: z.ZodOptional<z.ZodBoolean>;
|
|
528
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
529
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
530
|
+
export type RegisterHistorySessionsPayload = z.infer<typeof RegisterHistorySessionsPayloadSchema>;
|
|
531
|
+
//# sourceMappingURL=inboundEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as o}from"zod";const t=o.string().min(1);export const SessionCreatePayloadSchema=o.object({tag:t,metadata:o.string().optional(),dataEncryptionKey:o.string().optional(),source:o.string().optional(),claudeSessionId:o.string().optional(),projectPath:o.string().optional()}).passthrough(),UpdateMetadataPayloadSchema=o.object({sessionId:t,metadata:o.string(),expectedVersion:o.number().int().min(0)}).passthrough(),ContextUsageUpdatePayloadSchema=o.object({sessionId:t,contextUsage:o.record(o.unknown())}).passthrough(),UpdateStatePayloadSchema=o.object({sessionId:t,agentState:o.string(),expectedVersion:o.number().int().min(0)}).passthrough(),SessionAlivePayloadSchema=o.object({sessionId:t,takeoverToken:t.optional(),runtimeStatus:o.enum(["idle","thinking","tool_running","permission_required","disconnected"]).optional()}).passthrough(),GetSessionRuntimeStatusPayloadSchema=o.object({sessionId:t}).strict(),SessionDeletePayloadSchema=o.object({sessionId:t}).passthrough(),SessionEndPayloadSchema=o.object({sessionId:t,summary:o.string().optional()}).passthrough(),RenameSessionPayloadSchema=o.object({sessionId:t,displayName:o.string().refine(e=>e.trim()!=="","displayName must not be blank")}).passthrough(),MessagePayloadSchema=o.object({sessionId:t,localId:t,content:o.unknown(),skipBroadcast:o.boolean().optional(),ephemeral:o.boolean().optional()}).passthrough().refine(e=>"content"in e,{message:"content is required",path:["content"]});const n=o.object({localId:t,content:o.unknown()}).passthrough().refine(e=>"content"in e,{message:"content is required",path:["content"]});export const BatchMessagePayloadSchema=o.object({sessionId:t,messages:o.array(n).min(1).max(100),skipBroadcast:o.boolean().optional()}).passthrough(),GetMessagesPayloadSchema=o.object({sessionId:t,fromSeq:o.number().int().min(0).optional(),beforeSeq:o.number().int().min(1).optional(),order:o.enum(["asc","desc"]).optional(),limit:o.number().int().min(1).optional()}).passthrough(),INBOUND_SESSION_STATUSES=["idle","thinking","tool_running","permission_required","disconnected","turn-completed"],SessionStatusPayloadSchema=o.object({sessionId:t,status:o.enum(INBOUND_SESSION_STATUSES)}).strict(),MachineRegisterPayloadSchema=o.object({hostname:t,platform:t,arch:o.string().optional(),displayName:o.string().optional(),daemonVersion:o.string().optional(),availableAgents:o.array(o.string()).optional(),agentVersions:o.record(o.string()).optional(),terminalHost:o.string().optional(),terminalPort:o.number().optional(),upgradeStatus:o.string().optional(),upgradeError:o.string().optional(),lastUpgradeError:o.string().optional(),derivationVersion:o.number().optional(),autoUpgradeDaemon:o.boolean().optional(),notifyFeishu:o.boolean().optional(),notifyDingtalk:o.boolean().optional(),agentModels:o.record(o.array(o.object({id:o.string(),displayName:o.string(),isDefault:o.boolean(),hidden:o.boolean()}).passthrough())).optional(),agentModes:o.record(o.array(o.object({id:o.string(),label:o.string()}).passthrough())).optional()}).passthrough(),HistorySessionEntrySchema=o.object({claudeSessionId:t,projectPath:o.string(),title:o.string().nullable().optional(),messageCount:o.number(),createdAt:o.string(),agentType:o.string(),isSubagent:o.boolean().optional()}).passthrough(),RegisterHistorySessionsPayloadSchema=o.object({entries:o.array(HistorySessionEntrySchema)}).passthrough();
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export { SessionTextEventSchema, SessionServiceEventSchema, SessionToolCallStartEventSchema, SessionToolCallEndEventSchema, SessionFileEventSchema, SessionTurnStartEventSchema, SessionTurnEndEventSchema, SessionTurnEndStatusSchema, TurnUsageSchema, SessionStartEventSchema, SessionStopEventSchema, SessionEventSchema, SessionPermissionResolvedEventSchema, PermissionActionSchema, SessionImageEventSchema, ImageAttachmentSchema, } from './events.js';
|
|
2
|
-
export type { SessionEvent, SessionTurnEndStatus, TurnUsage, SessionQuestionEvent, SessionPermissionRequestEvent, SessionAnswerEvent, SessionPermissionResolvedEvent, PermissionAction, ImageAttachment, } from './events.js';
|
|
1
|
+
export { SessionTextEventSchema, SessionServiceEventSchema, SessionToolCallStartEventSchema, SessionToolCallEndEventSchema, SessionFileEventSchema, SessionTurnStartEventSchema, SessionTurnEndEventSchema, SessionTurnEndStatusSchema, TurnUsageSchema, SessionStartEventSchema, SessionStopEventSchema, SessionEventSchema, SessionPermissionResolvedEventSchema, PermissionActionSchema, SessionImageEventSchema, ImageAttachmentSchema, SessionContextUsageEventSchema, SessionCompactBoundaryEventSchema, emptyContextUsageSnapshot, } from './events.js';
|
|
2
|
+
export type { SessionEvent, SessionTurnEndStatus, TurnUsage, SessionQuestionEvent, SessionPermissionRequestEvent, SessionAnswerEvent, SessionPermissionResolvedEvent, PermissionAction, ImageAttachment, SessionContextUsageEvent, SessionCompactBoundaryEvent, } from './events.js';
|
|
3
3
|
export { QuestionOptionSchema, SessionQuestionEventSchema, SessionPermissionRequestEventSchema, SessionAnswerEventSchema, AnswerQuestionParamsSchema, ApprovePermissionParamsSchema, DenyPermissionParamsSchema, PermissionModeSchema, } from './interactionEvents.js';
|
|
4
4
|
export type { QuestionOption, AnswerQuestionParams, ApprovePermissionParams, DenyPermissionParams, PermissionModeValue, } from './interactionEvents.js';
|
|
5
5
|
export { SessionRoleSchema, SessionEnvelopeSchema, createEnvelope } from './envelope.js';
|
|
6
6
|
export type { SessionRole, SessionEnvelope, CreateEnvelopeOptions } from './envelope.js';
|
|
7
|
+
export { NotificationEventTypeSchema, DispatchNotificationParamsSchema } from './notification.js';
|
|
8
|
+
export type { NotificationEventType, DispatchNotificationParams } from './notification.js';
|
|
7
9
|
export { AgentTypeSchema, MessageMetaSchema, AGENT_TYPES, SPAWNABLE_AGENTS, CLI_AGENT_TYPES, } from './messageMeta.js';
|
|
8
10
|
export { AGENT_SUPPORTS_IMAGES } from './messageMeta.js';
|
|
9
11
|
export type { AgentType, MessageMeta, CliAgentType } from './messageMeta.js';
|
|
@@ -13,7 +15,7 @@ export { UserMessageSchema, AgentMessageSchema, LegacyMessageContentSchema, } fr
|
|
|
13
15
|
export type { UserMessage, AgentMessage, LegacyMessageContent } from './legacyProtocol.js';
|
|
14
16
|
export { VersionedEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VersionedMachineEncryptedValueSchema, UpdateNewMessageBodySchema, UpdateSessionBodySchema, UpdateMachineBodySchema, UpdateSessionResetBodySchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, } from './sync.js';
|
|
15
17
|
export type { VersionedEncryptedValue, VersionedNullableEncryptedValue, VersionedMachineEncryptedValue, UpdateNewMessageBody, UpdateSessionBody, UpdateMachineBody, UpdateSessionResetBody, CoreUpdateBody, CoreUpdateContainer, } from './sync.js';
|
|
16
|
-
export { RpcMethod, type RpcMethodType, SESSION_RPC_METHODS, MACHINE_RPC_METHODS, DAEMON_REQUIRED_RPC_METHODS, RpcCallSchema, RpcResultSchema, SpawnSessionParamsSchema, GetMessagesParamsSchema, GetMessagesResponseSchema, MachineInfoResponseSchema, CheckPathParamsSchema, AGENT_ENV_NONE, AgentEnvConfigSchema, AgentSettingsSchema, LabsSettingsSchema, CustomModelSchema, SkillDefinitionSchema, } from './rpc.js';
|
|
18
|
+
export { RpcMethod, type RpcMethodType, SESSION_RPC_METHODS, MACHINE_RPC_METHODS, DAEMON_REQUIRED_RPC_METHODS, RpcCallSchema, RpcResultSchema, SpawnSessionParamsSchema, GetMessagesParamsSchema, GetMessagesResponseSchema, MachineInfoResponseSchema, CheckPathParamsSchema, AGENT_ENV_NONE, AgentEnvConfigSchema, AgentEnvConfigSetSchema, AgentSettingsSchema, SetAgentSettingsSchema, LabsSettingsSchema, CustomModelSchema, SkillDefinitionSchema, } from './rpc.js';
|
|
17
19
|
export type { RpcCall, RpcResult, SpawnSessionParams, CheckPathParams, GetMessagesParams, GetMessagesResponse, MachineInfoResponse, AgentEnvConfig, AgentSettings, LabsSettings, CustomModel, SkillDefinition, } from './rpc.js';
|
|
18
20
|
export { AGENT_CAPABILITIES, getAgentCapability, updateDynamicModes, getDynamicModes, normalizeModelId, } from './agentCapabilities.js';
|
|
19
21
|
export type { AgentCapability, AgentPermissionMode, AgentModelOption, ModelSource, } from './agentCapabilities.js';
|
|
@@ -30,6 +32,8 @@ export { PairingState, PairingRequestSchema, PairingResponseSchema, PairingExcha
|
|
|
30
32
|
export type { PairingRequest, PairingResponse, PairingExchange, PairingDeliver, PairingStatus, } from './pairing.js';
|
|
31
33
|
export { PlatformSchema, SessionStatusSchema, MachineSummarySchema, MachineRegisterResultSchema, } from './machine.js';
|
|
32
34
|
export type { Platform, SessionStatus, MachineSummary, MachineRegisterResult } from './machine.js';
|
|
35
|
+
export { SessionCreatePayloadSchema, UpdateMetadataPayloadSchema, UpdateStatePayloadSchema, ContextUsageUpdatePayloadSchema, SessionAlivePayloadSchema, GetSessionRuntimeStatusPayloadSchema, SessionDeletePayloadSchema, SessionEndPayloadSchema, RenameSessionPayloadSchema, MessagePayloadSchema, BatchMessagePayloadSchema, GetMessagesPayloadSchema, SessionStatusPayloadSchema, MachineRegisterPayloadSchema, RegisterHistorySessionsPayloadSchema, HistorySessionEntrySchema, INBOUND_SESSION_STATUSES, } from './inboundEvents.js';
|
|
36
|
+
export type { SessionCreatePayload, UpdateMetadataPayload, UpdateStatePayload, ContextUsageUpdatePayload, SessionAlivePayload, GetSessionRuntimeStatusPayload, SessionDeletePayload, SessionEndPayload, RenameSessionPayload, MessagePayload, BatchMessagePayload, GetMessagesPayload, SessionStatusPayload, MachineRegisterPayload, RegisterHistorySessionsPayload, HistorySessionEntry, } from './inboundEvents.js';
|
|
33
37
|
export { FEATURE_REGISTRY, isFeatureAvailable, getUnavailableFeatures, isSubFeatureAvailable, getSubFeatureMinVersion, } from './features.js';
|
|
34
38
|
export type { FeatureDefinition, SubFeatureDefinition } from './features.js';
|
|
35
39
|
export { SessionResultSchema } from './sessionResult.js';
|
|
@@ -53,9 +57,11 @@ export type { BgTaskAction, ParsedBgTask, EncodeBgTaskInput } from './bgTask.js'
|
|
|
53
57
|
export { BASH_TOOL_NAMES, isBashToolName, extractCommandSubject, MIN_SUBJECT_LENGTH, } from './permissionSubject.js';
|
|
54
58
|
export { SOCKET_EVENTS, type SocketEventName } from './socketEvents.js';
|
|
55
59
|
export { TelemetryEventTypeSchema, TelemetryEventSchema, TelemetryReportPayloadSchema, sanitizeContext, } from './telemetry.js';
|
|
56
|
-
export type { TelemetryEventType, TelemetryEvent, TelemetryReportPayload } from './telemetry.js';
|
|
60
|
+
export type { TelemetryEventType, TelemetryEvent, TelemetryEventStrict, TelemetryReportPayload, } from './telemetry.js';
|
|
57
61
|
export * from './checkpointSchemas.js';
|
|
58
|
-
export {
|
|
62
|
+
export { SourceMetadataSchema } from './sourceMetadata.js';
|
|
63
|
+
export type { SourceMetadata } from './sourceMetadata.js';
|
|
64
|
+
export { OpsRpcMessageSchema, OpsMethodSchema, OpsRpcTypeSchema, DockerImageRefSchema, FileEntrySchema, FileStatSchema, StorageUsageSchema, SyncUserSchema, SyncFullPayloadSchema, SyncUserCreatedPayloadSchema, SyncContainerStatusPayloadSchema, SyncUserPairedPayloadSchema, type OpsRpcMessage, type OpsMethod, type OpsRpcType, type DockerImageRef, type OpsTunnelMetrics, type FileEntry, type FileStat, type StorageUsage, type SyncUser, type SyncFullPayload, type SyncUserCreatedPayload, type SyncContainerStatusPayload, type SyncUserPairedPayload, } from './ops.js';
|
|
59
65
|
export * from './edition.js';
|
|
60
66
|
export { LicensePayloadSchema, LicenseFileSchema, EnterpriseLicenseSchema, PrivateLicenseSchema, } from './license.js';
|
|
61
67
|
export type { LicensePayload, LicenseFile, EnterpriseLicensePayload, PrivateLicensePayload, } from './license.js';
|