@kmmao/happy-wire 0.2.1 → 0.2.3
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 +52 -2
- package/dist/index.d.cts +1424 -254
- package/dist/index.d.mts +1424 -254
- package/dist/index.mjs +48 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -93,6 +93,46 @@ const sessionUsageUpdateEventSchema = z__namespace.object({
|
|
|
93
93
|
}),
|
|
94
94
|
durationMs: z__namespace.number().optional()
|
|
95
95
|
});
|
|
96
|
+
const sessionTaskStartEventSchema = z__namespace.object({
|
|
97
|
+
t: z__namespace.literal("task-start"),
|
|
98
|
+
taskId: z__namespace.string(),
|
|
99
|
+
toolUseId: z__namespace.string().optional(),
|
|
100
|
+
description: z__namespace.string(),
|
|
101
|
+
taskType: z__namespace.string().optional()
|
|
102
|
+
});
|
|
103
|
+
const sessionTaskProgressEventSchema = z__namespace.object({
|
|
104
|
+
t: z__namespace.literal("task-progress"),
|
|
105
|
+
taskId: z__namespace.string(),
|
|
106
|
+
description: z__namespace.string(),
|
|
107
|
+
usage: z__namespace.object({
|
|
108
|
+
totalTokens: z__namespace.number(),
|
|
109
|
+
toolUses: z__namespace.number(),
|
|
110
|
+
durationMs: z__namespace.number()
|
|
111
|
+
}),
|
|
112
|
+
lastToolName: z__namespace.string().optional()
|
|
113
|
+
});
|
|
114
|
+
const sessionTaskEndEventSchema = z__namespace.object({
|
|
115
|
+
t: z__namespace.literal("task-end"),
|
|
116
|
+
taskId: z__namespace.string(),
|
|
117
|
+
status: z__namespace.enum(["completed", "failed", "stopped"]),
|
|
118
|
+
summary: z__namespace.string(),
|
|
119
|
+
usage: z__namespace.object({
|
|
120
|
+
totalTokens: z__namespace.number(),
|
|
121
|
+
toolUses: z__namespace.number(),
|
|
122
|
+
durationMs: z__namespace.number()
|
|
123
|
+
}).optional()
|
|
124
|
+
});
|
|
125
|
+
const sessionToolProgressEventSchema = z__namespace.object({
|
|
126
|
+
t: z__namespace.literal("tool-progress"),
|
|
127
|
+
toolUseId: z__namespace.string(),
|
|
128
|
+
toolName: z__namespace.string(),
|
|
129
|
+
elapsedSeconds: z__namespace.number(),
|
|
130
|
+
taskId: z__namespace.string().optional()
|
|
131
|
+
});
|
|
132
|
+
const sessionPromptSuggestionEventSchema = z__namespace.object({
|
|
133
|
+
t: z__namespace.literal("prompt-suggestion"),
|
|
134
|
+
suggestion: z__namespace.string()
|
|
135
|
+
});
|
|
96
136
|
const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
97
137
|
sessionTextEventSchema,
|
|
98
138
|
sessionServiceMessageEventSchema,
|
|
@@ -103,7 +143,12 @@ const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
|
103
143
|
sessionStartEventSchema,
|
|
104
144
|
sessionTurnEndEventSchema,
|
|
105
145
|
sessionStopEventSchema,
|
|
106
|
-
sessionUsageUpdateEventSchema
|
|
146
|
+
sessionUsageUpdateEventSchema,
|
|
147
|
+
sessionTaskStartEventSchema,
|
|
148
|
+
sessionTaskProgressEventSchema,
|
|
149
|
+
sessionTaskEndEventSchema,
|
|
150
|
+
sessionToolProgressEventSchema,
|
|
151
|
+
sessionPromptSuggestionEventSchema
|
|
107
152
|
]);
|
|
108
153
|
const sessionEnvelopeSchema = z__namespace.object({
|
|
109
154
|
id: z__namespace.string(),
|
|
@@ -122,7 +167,7 @@ const sessionEnvelopeSchema = z__namespace.object({
|
|
|
122
167
|
path: ["role"]
|
|
123
168
|
});
|
|
124
169
|
}
|
|
125
|
-
if ((envelope.ev.t === "start" || envelope.ev.t === "stop" || envelope.ev.t === "usage-update") && envelope.role !== "agent") {
|
|
170
|
+
if ((envelope.ev.t === "start" || envelope.ev.t === "stop" || envelope.ev.t === "usage-update" || envelope.ev.t === "task-start" || envelope.ev.t === "task-progress" || envelope.ev.t === "task-end" || envelope.ev.t === "tool-progress" || envelope.ev.t === "prompt-suggestion") && envelope.role !== "agent") {
|
|
126
171
|
ctx.addIssue({
|
|
127
172
|
code: z__namespace.ZodIssueCode.custom,
|
|
128
173
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -268,13 +313,18 @@ exports.createEnvelope = createEnvelope;
|
|
|
268
313
|
exports.sessionEnvelopeSchema = sessionEnvelopeSchema;
|
|
269
314
|
exports.sessionEventSchema = sessionEventSchema;
|
|
270
315
|
exports.sessionFileEventSchema = sessionFileEventSchema;
|
|
316
|
+
exports.sessionPromptSuggestionEventSchema = sessionPromptSuggestionEventSchema;
|
|
271
317
|
exports.sessionRoleSchema = sessionRoleSchema;
|
|
272
318
|
exports.sessionServiceMessageEventSchema = sessionServiceMessageEventSchema;
|
|
273
319
|
exports.sessionStartEventSchema = sessionStartEventSchema;
|
|
274
320
|
exports.sessionStopEventSchema = sessionStopEventSchema;
|
|
321
|
+
exports.sessionTaskEndEventSchema = sessionTaskEndEventSchema;
|
|
322
|
+
exports.sessionTaskProgressEventSchema = sessionTaskProgressEventSchema;
|
|
323
|
+
exports.sessionTaskStartEventSchema = sessionTaskStartEventSchema;
|
|
275
324
|
exports.sessionTextEventSchema = sessionTextEventSchema;
|
|
276
325
|
exports.sessionToolCallEndEventSchema = sessionToolCallEndEventSchema;
|
|
277
326
|
exports.sessionToolCallStartEventSchema = sessionToolCallStartEventSchema;
|
|
327
|
+
exports.sessionToolProgressEventSchema = sessionToolProgressEventSchema;
|
|
278
328
|
exports.sessionTurnEndEventSchema = sessionTurnEndEventSchema;
|
|
279
329
|
exports.sessionTurnEndStatusSchema = sessionTurnEndStatusSchema;
|
|
280
330
|
exports.sessionTurnStartEventSchema = sessionTurnStartEventSchema;
|