@kmmao/happy-wire 0.2.4 → 0.2.6
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 +9 -3
- package/dist/index.d.cts +428 -259
- package/dist/index.d.mts +428 -259
- package/dist/index.mjs +9 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -124,6 +124,9 @@ const sessionPromptSuggestionEventSchema = z.object({
|
|
|
124
124
|
t: z.literal("prompt-suggestion"),
|
|
125
125
|
suggestion: z.string()
|
|
126
126
|
});
|
|
127
|
+
const sessionNeedsContinueEventSchema = z.object({
|
|
128
|
+
t: z.literal("needs-continue")
|
|
129
|
+
});
|
|
127
130
|
const sessionEventSchema = z.discriminatedUnion("t", [
|
|
128
131
|
sessionTextEventSchema,
|
|
129
132
|
sessionServiceMessageEventSchema,
|
|
@@ -139,7 +142,8 @@ const sessionEventSchema = z.discriminatedUnion("t", [
|
|
|
139
142
|
sessionTaskProgressEventSchema,
|
|
140
143
|
sessionTaskEndEventSchema,
|
|
141
144
|
sessionToolProgressEventSchema,
|
|
142
|
-
sessionPromptSuggestionEventSchema
|
|
145
|
+
sessionPromptSuggestionEventSchema,
|
|
146
|
+
sessionNeedsContinueEventSchema
|
|
143
147
|
]);
|
|
144
148
|
const sessionEnvelopeSchema = z.object({
|
|
145
149
|
id: z.string(),
|
|
@@ -158,7 +162,7 @@ const sessionEnvelopeSchema = z.object({
|
|
|
158
162
|
path: ["role"]
|
|
159
163
|
});
|
|
160
164
|
}
|
|
161
|
-
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") {
|
|
165
|
+
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.ev.t === "needs-continue") && envelope.role !== "agent") {
|
|
162
166
|
ctx.addIssue({
|
|
163
167
|
code: z.ZodIssueCode.custom,
|
|
164
168
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -246,7 +250,8 @@ const UpdateSessionBodySchema = z.object({
|
|
|
246
250
|
t: z.literal("update-session"),
|
|
247
251
|
id: z.string(),
|
|
248
252
|
metadata: VersionedEncryptedValueSchema.nullish(),
|
|
249
|
-
agentState: VersionedNullableEncryptedValueSchema.nullish()
|
|
253
|
+
agentState: VersionedNullableEncryptedValueSchema.nullish(),
|
|
254
|
+
preferences: VersionedNullableEncryptedValueSchema.nullish()
|
|
250
255
|
});
|
|
251
256
|
const VersionedMachineEncryptedValueSchema = z.object({
|
|
252
257
|
version: z.number(),
|
|
@@ -278,4 +283,4 @@ const ApiUpdateMachineStateSchema = UpdateMachineBodySchema;
|
|
|
278
283
|
const UpdateBodySchema = UpdateNewMessageBodySchema;
|
|
279
284
|
const UpdateSchema = CoreUpdateContainerSchema;
|
|
280
285
|
|
|
281
|
-
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, LegacyMessageContentSchema, MessageContentSchema, MessageMetaSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
286
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, LegacyMessageContentSchema, MessageContentSchema, MessageMetaSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, 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 };
|