@kmmao/happy-wire 0.2.10 → 0.3.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/dist/index.cjs +51 -1
- package/dist/index.d.cts +93 -2
- package/dist/index.d.mts +93 -2
- package/dist/index.mjs +48 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -42,7 +42,11 @@ const sessionToolCallStartEventSchema = z__namespace.object({
|
|
|
42
42
|
});
|
|
43
43
|
const sessionToolCallEndEventSchema = z__namespace.object({
|
|
44
44
|
t: z__namespace.literal("tool-call-end"),
|
|
45
|
-
call: z__namespace.string()
|
|
45
|
+
call: z__namespace.string(),
|
|
46
|
+
/** Background task ID when Bash command runs with run_in_background */
|
|
47
|
+
backgroundTaskId: z__namespace.string().optional(),
|
|
48
|
+
/** Path to the task output file on the CLI machine */
|
|
49
|
+
outputFile: z__namespace.string().optional()
|
|
46
50
|
});
|
|
47
51
|
const sessionFileEventSchema = z__namespace.object({
|
|
48
52
|
t: z__namespace.literal("file"),
|
|
@@ -306,6 +310,48 @@ const ApiUpdateMachineStateSchema = UpdateMachineBodySchema;
|
|
|
306
310
|
const UpdateBodySchema = UpdateNewMessageBodySchema;
|
|
307
311
|
const UpdateSchema = CoreUpdateContainerSchema;
|
|
308
312
|
|
|
313
|
+
const MachineMetadataSchema = z__namespace.object({
|
|
314
|
+
host: z__namespace.string(),
|
|
315
|
+
platform: z__namespace.string(),
|
|
316
|
+
happyCliVersion: z__namespace.string(),
|
|
317
|
+
homeDir: z__namespace.string(),
|
|
318
|
+
happyHomeDir: z__namespace.string(),
|
|
319
|
+
happyLibDir: z__namespace.string()
|
|
320
|
+
});
|
|
321
|
+
const TailscaleServeEntrySchema = z__namespace.object({
|
|
322
|
+
port: z__namespace.number(),
|
|
323
|
+
protocol: z__namespace.string(),
|
|
324
|
+
target: z__namespace.string(),
|
|
325
|
+
funnel: z__namespace.boolean(),
|
|
326
|
+
hostname: z__namespace.string()
|
|
327
|
+
});
|
|
328
|
+
const TailscaleInfoSchema = z__namespace.object({
|
|
329
|
+
status: z__namespace.enum(["connected", "disconnected", "not-installed"]),
|
|
330
|
+
ipv4: z__namespace.string().optional(),
|
|
331
|
+
ipv6: z__namespace.string().optional(),
|
|
332
|
+
hostname: z__namespace.string().optional(),
|
|
333
|
+
tailnetName: z__namespace.string().optional(),
|
|
334
|
+
version: z__namespace.string().optional(),
|
|
335
|
+
serves: z__namespace.array(TailscaleServeEntrySchema).optional()
|
|
336
|
+
});
|
|
337
|
+
const DaemonStateSchema = z__namespace.object({
|
|
338
|
+
status: z__namespace.union([
|
|
339
|
+
z__namespace.enum(["running", "shutting-down"]),
|
|
340
|
+
z__namespace.string()
|
|
341
|
+
// Forward compatibility
|
|
342
|
+
]),
|
|
343
|
+
pid: z__namespace.number().optional(),
|
|
344
|
+
httpPort: z__namespace.number().optional(),
|
|
345
|
+
startedAt: z__namespace.number().optional(),
|
|
346
|
+
shutdownRequestedAt: z__namespace.number().optional(),
|
|
347
|
+
shutdownSource: z__namespace.union([
|
|
348
|
+
z__namespace.enum(["mobile-app", "cli", "os-signal", "unknown"]),
|
|
349
|
+
z__namespace.string()
|
|
350
|
+
// Forward compatibility
|
|
351
|
+
]).optional(),
|
|
352
|
+
tailscale: TailscaleInfoSchema.optional()
|
|
353
|
+
});
|
|
354
|
+
|
|
309
355
|
exports.AgentMessageSchema = AgentMessageSchema;
|
|
310
356
|
exports.ApiMessageSchema = ApiMessageSchema;
|
|
311
357
|
exports.ApiUpdateMachineStateSchema = ApiUpdateMachineStateSchema;
|
|
@@ -313,12 +359,16 @@ exports.ApiUpdateNewMessageSchema = ApiUpdateNewMessageSchema;
|
|
|
313
359
|
exports.ApiUpdateSessionStateSchema = ApiUpdateSessionStateSchema;
|
|
314
360
|
exports.CoreUpdateBodySchema = CoreUpdateBodySchema;
|
|
315
361
|
exports.CoreUpdateContainerSchema = CoreUpdateContainerSchema;
|
|
362
|
+
exports.DaemonStateSchema = DaemonStateSchema;
|
|
316
363
|
exports.LegacyMessageContentSchema = LegacyMessageContentSchema;
|
|
364
|
+
exports.MachineMetadataSchema = MachineMetadataSchema;
|
|
317
365
|
exports.MessageContentSchema = MessageContentSchema;
|
|
318
366
|
exports.MessageMetaSchema = MessageMetaSchema;
|
|
319
367
|
exports.SessionMessageContentSchema = SessionMessageContentSchema;
|
|
320
368
|
exports.SessionMessageSchema = SessionMessageSchema;
|
|
321
369
|
exports.SessionProtocolMessageSchema = SessionProtocolMessageSchema;
|
|
370
|
+
exports.TailscaleInfoSchema = TailscaleInfoSchema;
|
|
371
|
+
exports.TailscaleServeEntrySchema = TailscaleServeEntrySchema;
|
|
322
372
|
exports.UpdateBodySchema = UpdateBodySchema;
|
|
323
373
|
exports.UpdateMachineBodySchema = UpdateMachineBodySchema;
|
|
324
374
|
exports.UpdateNewMessageBodySchema = UpdateNewMessageBodySchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -67,6 +67,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
67
67
|
}, z.core.$strip>, z.ZodObject<{
|
|
68
68
|
t: z.ZodLiteral<"tool-call-end">;
|
|
69
69
|
call: z.ZodString;
|
|
70
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
70
72
|
}, z.core.$strip>, z.ZodObject<{
|
|
71
73
|
t: z.ZodLiteral<"file">;
|
|
72
74
|
ref: z.ZodString;
|
|
@@ -263,6 +265,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
263
265
|
}, z.core.$strip>, z.ZodObject<{
|
|
264
266
|
t: z.ZodLiteral<"tool-call-end">;
|
|
265
267
|
call: z.ZodString;
|
|
268
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
269
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
266
270
|
}, z.core.$strip>, z.ZodObject<{
|
|
267
271
|
t: z.ZodLiteral<"file">;
|
|
268
272
|
ref: z.ZodString;
|
|
@@ -795,6 +799,8 @@ declare const sessionToolCallStartEventSchema: z.ZodObject<{
|
|
|
795
799
|
declare const sessionToolCallEndEventSchema: z.ZodObject<{
|
|
796
800
|
t: z.ZodLiteral<"tool-call-end">;
|
|
797
801
|
call: z.ZodString;
|
|
802
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
803
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
798
804
|
}, z.core.$strip>;
|
|
799
805
|
declare const sessionFileEventSchema: z.ZodObject<{
|
|
800
806
|
t: z.ZodLiteral<"file">;
|
|
@@ -936,6 +942,8 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
936
942
|
}, z.core.$strip>, z.ZodObject<{
|
|
937
943
|
t: z.ZodLiteral<"tool-call-end">;
|
|
938
944
|
call: z.ZodString;
|
|
945
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
946
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
939
947
|
}, z.core.$strip>, z.ZodObject<{
|
|
940
948
|
t: z.ZodLiteral<"file">;
|
|
941
949
|
ref: z.ZodString;
|
|
@@ -1059,6 +1067,8 @@ declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
|
1059
1067
|
}, z.core.$strip>, z.ZodObject<{
|
|
1060
1068
|
t: z.ZodLiteral<"tool-call-end">;
|
|
1061
1069
|
call: z.ZodString;
|
|
1070
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
1071
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
1062
1072
|
}, z.core.$strip>, z.ZodObject<{
|
|
1063
1073
|
t: z.ZodLiteral<"file">;
|
|
1064
1074
|
ref: z.ZodString;
|
|
@@ -1165,5 +1175,86 @@ type CreateEnvelopeOptions = {
|
|
|
1165
1175
|
};
|
|
1166
1176
|
declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
|
|
1167
1177
|
|
|
1168
|
-
|
|
1169
|
-
|
|
1178
|
+
/**
|
|
1179
|
+
* Machine-related Zod schemas shared across CLI, Agent, and Server.
|
|
1180
|
+
*
|
|
1181
|
+
* Single source of truth for MachineMetadata, DaemonState,
|
|
1182
|
+
* and Tailscale types. All packages import from here.
|
|
1183
|
+
*/
|
|
1184
|
+
|
|
1185
|
+
declare const MachineMetadataSchema: z.ZodObject<{
|
|
1186
|
+
host: z.ZodString;
|
|
1187
|
+
platform: z.ZodString;
|
|
1188
|
+
happyCliVersion: z.ZodString;
|
|
1189
|
+
homeDir: z.ZodString;
|
|
1190
|
+
happyHomeDir: z.ZodString;
|
|
1191
|
+
happyLibDir: z.ZodString;
|
|
1192
|
+
}, z.core.$strip>;
|
|
1193
|
+
type MachineMetadata = z.infer<typeof MachineMetadataSchema>;
|
|
1194
|
+
declare const TailscaleServeEntrySchema: z.ZodObject<{
|
|
1195
|
+
port: z.ZodNumber;
|
|
1196
|
+
protocol: z.ZodString;
|
|
1197
|
+
target: z.ZodString;
|
|
1198
|
+
funnel: z.ZodBoolean;
|
|
1199
|
+
hostname: z.ZodString;
|
|
1200
|
+
}, z.core.$strip>;
|
|
1201
|
+
type TailscaleServeEntry = z.infer<typeof TailscaleServeEntrySchema>;
|
|
1202
|
+
declare const TailscaleInfoSchema: z.ZodObject<{
|
|
1203
|
+
status: z.ZodEnum<{
|
|
1204
|
+
connected: "connected";
|
|
1205
|
+
disconnected: "disconnected";
|
|
1206
|
+
"not-installed": "not-installed";
|
|
1207
|
+
}>;
|
|
1208
|
+
ipv4: z.ZodOptional<z.ZodString>;
|
|
1209
|
+
ipv6: z.ZodOptional<z.ZodString>;
|
|
1210
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
1211
|
+
tailnetName: z.ZodOptional<z.ZodString>;
|
|
1212
|
+
version: z.ZodOptional<z.ZodString>;
|
|
1213
|
+
serves: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1214
|
+
port: z.ZodNumber;
|
|
1215
|
+
protocol: z.ZodString;
|
|
1216
|
+
target: z.ZodString;
|
|
1217
|
+
funnel: z.ZodBoolean;
|
|
1218
|
+
hostname: z.ZodString;
|
|
1219
|
+
}, z.core.$strip>>>;
|
|
1220
|
+
}, z.core.$strip>;
|
|
1221
|
+
type TailscaleInfo = z.infer<typeof TailscaleInfoSchema>;
|
|
1222
|
+
declare const DaemonStateSchema: z.ZodObject<{
|
|
1223
|
+
status: z.ZodUnion<readonly [z.ZodEnum<{
|
|
1224
|
+
running: "running";
|
|
1225
|
+
"shutting-down": "shutting-down";
|
|
1226
|
+
}>, z.ZodString]>;
|
|
1227
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
1228
|
+
httpPort: z.ZodOptional<z.ZodNumber>;
|
|
1229
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
1230
|
+
shutdownRequestedAt: z.ZodOptional<z.ZodNumber>;
|
|
1231
|
+
shutdownSource: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1232
|
+
unknown: "unknown";
|
|
1233
|
+
"mobile-app": "mobile-app";
|
|
1234
|
+
cli: "cli";
|
|
1235
|
+
"os-signal": "os-signal";
|
|
1236
|
+
}>, z.ZodString]>>;
|
|
1237
|
+
tailscale: z.ZodOptional<z.ZodObject<{
|
|
1238
|
+
status: z.ZodEnum<{
|
|
1239
|
+
connected: "connected";
|
|
1240
|
+
disconnected: "disconnected";
|
|
1241
|
+
"not-installed": "not-installed";
|
|
1242
|
+
}>;
|
|
1243
|
+
ipv4: z.ZodOptional<z.ZodString>;
|
|
1244
|
+
ipv6: z.ZodOptional<z.ZodString>;
|
|
1245
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
1246
|
+
tailnetName: z.ZodOptional<z.ZodString>;
|
|
1247
|
+
version: z.ZodOptional<z.ZodString>;
|
|
1248
|
+
serves: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1249
|
+
port: z.ZodNumber;
|
|
1250
|
+
protocol: z.ZodString;
|
|
1251
|
+
target: z.ZodString;
|
|
1252
|
+
funnel: z.ZodBoolean;
|
|
1253
|
+
hostname: z.ZodString;
|
|
1254
|
+
}, z.core.$strip>>>;
|
|
1255
|
+
}, z.core.$strip>>;
|
|
1256
|
+
}, z.core.$strip>;
|
|
1257
|
+
type DaemonState = z.infer<typeof DaemonStateSchema>;
|
|
1258
|
+
|
|
1259
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, DaemonStateSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
1260
|
+
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, DaemonState, LegacyMessageContent, MachineMetadata, MessageContent, MessageMeta, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, TailscaleInfo, TailscaleServeEntry, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };
|
package/dist/index.d.mts
CHANGED
|
@@ -67,6 +67,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
67
67
|
}, z.core.$strip>, z.ZodObject<{
|
|
68
68
|
t: z.ZodLiteral<"tool-call-end">;
|
|
69
69
|
call: z.ZodString;
|
|
70
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
70
72
|
}, z.core.$strip>, z.ZodObject<{
|
|
71
73
|
t: z.ZodLiteral<"file">;
|
|
72
74
|
ref: z.ZodString;
|
|
@@ -263,6 +265,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
263
265
|
}, z.core.$strip>, z.ZodObject<{
|
|
264
266
|
t: z.ZodLiteral<"tool-call-end">;
|
|
265
267
|
call: z.ZodString;
|
|
268
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
269
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
266
270
|
}, z.core.$strip>, z.ZodObject<{
|
|
267
271
|
t: z.ZodLiteral<"file">;
|
|
268
272
|
ref: z.ZodString;
|
|
@@ -795,6 +799,8 @@ declare const sessionToolCallStartEventSchema: z.ZodObject<{
|
|
|
795
799
|
declare const sessionToolCallEndEventSchema: z.ZodObject<{
|
|
796
800
|
t: z.ZodLiteral<"tool-call-end">;
|
|
797
801
|
call: z.ZodString;
|
|
802
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
803
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
798
804
|
}, z.core.$strip>;
|
|
799
805
|
declare const sessionFileEventSchema: z.ZodObject<{
|
|
800
806
|
t: z.ZodLiteral<"file">;
|
|
@@ -936,6 +942,8 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
936
942
|
}, z.core.$strip>, z.ZodObject<{
|
|
937
943
|
t: z.ZodLiteral<"tool-call-end">;
|
|
938
944
|
call: z.ZodString;
|
|
945
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
946
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
939
947
|
}, z.core.$strip>, z.ZodObject<{
|
|
940
948
|
t: z.ZodLiteral<"file">;
|
|
941
949
|
ref: z.ZodString;
|
|
@@ -1059,6 +1067,8 @@ declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
|
1059
1067
|
}, z.core.$strip>, z.ZodObject<{
|
|
1060
1068
|
t: z.ZodLiteral<"tool-call-end">;
|
|
1061
1069
|
call: z.ZodString;
|
|
1070
|
+
backgroundTaskId: z.ZodOptional<z.ZodString>;
|
|
1071
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
1062
1072
|
}, z.core.$strip>, z.ZodObject<{
|
|
1063
1073
|
t: z.ZodLiteral<"file">;
|
|
1064
1074
|
ref: z.ZodString;
|
|
@@ -1165,5 +1175,86 @@ type CreateEnvelopeOptions = {
|
|
|
1165
1175
|
};
|
|
1166
1176
|
declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
|
|
1167
1177
|
|
|
1168
|
-
|
|
1169
|
-
|
|
1178
|
+
/**
|
|
1179
|
+
* Machine-related Zod schemas shared across CLI, Agent, and Server.
|
|
1180
|
+
*
|
|
1181
|
+
* Single source of truth for MachineMetadata, DaemonState,
|
|
1182
|
+
* and Tailscale types. All packages import from here.
|
|
1183
|
+
*/
|
|
1184
|
+
|
|
1185
|
+
declare const MachineMetadataSchema: z.ZodObject<{
|
|
1186
|
+
host: z.ZodString;
|
|
1187
|
+
platform: z.ZodString;
|
|
1188
|
+
happyCliVersion: z.ZodString;
|
|
1189
|
+
homeDir: z.ZodString;
|
|
1190
|
+
happyHomeDir: z.ZodString;
|
|
1191
|
+
happyLibDir: z.ZodString;
|
|
1192
|
+
}, z.core.$strip>;
|
|
1193
|
+
type MachineMetadata = z.infer<typeof MachineMetadataSchema>;
|
|
1194
|
+
declare const TailscaleServeEntrySchema: z.ZodObject<{
|
|
1195
|
+
port: z.ZodNumber;
|
|
1196
|
+
protocol: z.ZodString;
|
|
1197
|
+
target: z.ZodString;
|
|
1198
|
+
funnel: z.ZodBoolean;
|
|
1199
|
+
hostname: z.ZodString;
|
|
1200
|
+
}, z.core.$strip>;
|
|
1201
|
+
type TailscaleServeEntry = z.infer<typeof TailscaleServeEntrySchema>;
|
|
1202
|
+
declare const TailscaleInfoSchema: z.ZodObject<{
|
|
1203
|
+
status: z.ZodEnum<{
|
|
1204
|
+
connected: "connected";
|
|
1205
|
+
disconnected: "disconnected";
|
|
1206
|
+
"not-installed": "not-installed";
|
|
1207
|
+
}>;
|
|
1208
|
+
ipv4: z.ZodOptional<z.ZodString>;
|
|
1209
|
+
ipv6: z.ZodOptional<z.ZodString>;
|
|
1210
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
1211
|
+
tailnetName: z.ZodOptional<z.ZodString>;
|
|
1212
|
+
version: z.ZodOptional<z.ZodString>;
|
|
1213
|
+
serves: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1214
|
+
port: z.ZodNumber;
|
|
1215
|
+
protocol: z.ZodString;
|
|
1216
|
+
target: z.ZodString;
|
|
1217
|
+
funnel: z.ZodBoolean;
|
|
1218
|
+
hostname: z.ZodString;
|
|
1219
|
+
}, z.core.$strip>>>;
|
|
1220
|
+
}, z.core.$strip>;
|
|
1221
|
+
type TailscaleInfo = z.infer<typeof TailscaleInfoSchema>;
|
|
1222
|
+
declare const DaemonStateSchema: z.ZodObject<{
|
|
1223
|
+
status: z.ZodUnion<readonly [z.ZodEnum<{
|
|
1224
|
+
running: "running";
|
|
1225
|
+
"shutting-down": "shutting-down";
|
|
1226
|
+
}>, z.ZodString]>;
|
|
1227
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
1228
|
+
httpPort: z.ZodOptional<z.ZodNumber>;
|
|
1229
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
1230
|
+
shutdownRequestedAt: z.ZodOptional<z.ZodNumber>;
|
|
1231
|
+
shutdownSource: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1232
|
+
unknown: "unknown";
|
|
1233
|
+
"mobile-app": "mobile-app";
|
|
1234
|
+
cli: "cli";
|
|
1235
|
+
"os-signal": "os-signal";
|
|
1236
|
+
}>, z.ZodString]>>;
|
|
1237
|
+
tailscale: z.ZodOptional<z.ZodObject<{
|
|
1238
|
+
status: z.ZodEnum<{
|
|
1239
|
+
connected: "connected";
|
|
1240
|
+
disconnected: "disconnected";
|
|
1241
|
+
"not-installed": "not-installed";
|
|
1242
|
+
}>;
|
|
1243
|
+
ipv4: z.ZodOptional<z.ZodString>;
|
|
1244
|
+
ipv6: z.ZodOptional<z.ZodString>;
|
|
1245
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
1246
|
+
tailnetName: z.ZodOptional<z.ZodString>;
|
|
1247
|
+
version: z.ZodOptional<z.ZodString>;
|
|
1248
|
+
serves: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1249
|
+
port: z.ZodNumber;
|
|
1250
|
+
protocol: z.ZodString;
|
|
1251
|
+
target: z.ZodString;
|
|
1252
|
+
funnel: z.ZodBoolean;
|
|
1253
|
+
hostname: z.ZodString;
|
|
1254
|
+
}, z.core.$strip>>>;
|
|
1255
|
+
}, z.core.$strip>>;
|
|
1256
|
+
}, z.core.$strip>;
|
|
1257
|
+
type DaemonState = z.infer<typeof DaemonStateSchema>;
|
|
1258
|
+
|
|
1259
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, DaemonStateSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
1260
|
+
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, DaemonState, LegacyMessageContent, MachineMetadata, MessageContent, MessageMeta, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, TailscaleInfo, TailscaleServeEntry, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };
|
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,11 @@ const sessionToolCallStartEventSchema = z.object({
|
|
|
21
21
|
});
|
|
22
22
|
const sessionToolCallEndEventSchema = z.object({
|
|
23
23
|
t: z.literal("tool-call-end"),
|
|
24
|
-
call: z.string()
|
|
24
|
+
call: z.string(),
|
|
25
|
+
/** Background task ID when Bash command runs with run_in_background */
|
|
26
|
+
backgroundTaskId: z.string().optional(),
|
|
27
|
+
/** Path to the task output file on the CLI machine */
|
|
28
|
+
outputFile: z.string().optional()
|
|
25
29
|
});
|
|
26
30
|
const sessionFileEventSchema = z.object({
|
|
27
31
|
t: z.literal("file"),
|
|
@@ -285,4 +289,46 @@ const ApiUpdateMachineStateSchema = UpdateMachineBodySchema;
|
|
|
285
289
|
const UpdateBodySchema = UpdateNewMessageBodySchema;
|
|
286
290
|
const UpdateSchema = CoreUpdateContainerSchema;
|
|
287
291
|
|
|
288
|
-
|
|
292
|
+
const MachineMetadataSchema = z.object({
|
|
293
|
+
host: z.string(),
|
|
294
|
+
platform: z.string(),
|
|
295
|
+
happyCliVersion: z.string(),
|
|
296
|
+
homeDir: z.string(),
|
|
297
|
+
happyHomeDir: z.string(),
|
|
298
|
+
happyLibDir: z.string()
|
|
299
|
+
});
|
|
300
|
+
const TailscaleServeEntrySchema = z.object({
|
|
301
|
+
port: z.number(),
|
|
302
|
+
protocol: z.string(),
|
|
303
|
+
target: z.string(),
|
|
304
|
+
funnel: z.boolean(),
|
|
305
|
+
hostname: z.string()
|
|
306
|
+
});
|
|
307
|
+
const TailscaleInfoSchema = z.object({
|
|
308
|
+
status: z.enum(["connected", "disconnected", "not-installed"]),
|
|
309
|
+
ipv4: z.string().optional(),
|
|
310
|
+
ipv6: z.string().optional(),
|
|
311
|
+
hostname: z.string().optional(),
|
|
312
|
+
tailnetName: z.string().optional(),
|
|
313
|
+
version: z.string().optional(),
|
|
314
|
+
serves: z.array(TailscaleServeEntrySchema).optional()
|
|
315
|
+
});
|
|
316
|
+
const DaemonStateSchema = z.object({
|
|
317
|
+
status: z.union([
|
|
318
|
+
z.enum(["running", "shutting-down"]),
|
|
319
|
+
z.string()
|
|
320
|
+
// Forward compatibility
|
|
321
|
+
]),
|
|
322
|
+
pid: z.number().optional(),
|
|
323
|
+
httpPort: z.number().optional(),
|
|
324
|
+
startedAt: z.number().optional(),
|
|
325
|
+
shutdownRequestedAt: z.number().optional(),
|
|
326
|
+
shutdownSource: z.union([
|
|
327
|
+
z.enum(["mobile-app", "cli", "os-signal", "unknown"]),
|
|
328
|
+
z.string()
|
|
329
|
+
// Forward compatibility
|
|
330
|
+
]).optional(),
|
|
331
|
+
tailscale: TailscaleInfoSchema.optional()
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, DaemonStateSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|