@kmmao/happy-wire 0.2.4 → 0.2.5
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 +7 -2
- package/dist/index.d.cts +64 -1
- package/dist/index.d.mts +64 -1
- package/dist/index.mjs +7 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -145,6 +145,9 @@ const sessionPromptSuggestionEventSchema = z__namespace.object({
|
|
|
145
145
|
t: z__namespace.literal("prompt-suggestion"),
|
|
146
146
|
suggestion: z__namespace.string()
|
|
147
147
|
});
|
|
148
|
+
const sessionNeedsContinueEventSchema = z__namespace.object({
|
|
149
|
+
t: z__namespace.literal("needs-continue")
|
|
150
|
+
});
|
|
148
151
|
const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
149
152
|
sessionTextEventSchema,
|
|
150
153
|
sessionServiceMessageEventSchema,
|
|
@@ -160,7 +163,8 @@ const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
|
160
163
|
sessionTaskProgressEventSchema,
|
|
161
164
|
sessionTaskEndEventSchema,
|
|
162
165
|
sessionToolProgressEventSchema,
|
|
163
|
-
sessionPromptSuggestionEventSchema
|
|
166
|
+
sessionPromptSuggestionEventSchema,
|
|
167
|
+
sessionNeedsContinueEventSchema
|
|
164
168
|
]);
|
|
165
169
|
const sessionEnvelopeSchema = z__namespace.object({
|
|
166
170
|
id: z__namespace.string(),
|
|
@@ -179,7 +183,7 @@ const sessionEnvelopeSchema = z__namespace.object({
|
|
|
179
183
|
path: ["role"]
|
|
180
184
|
});
|
|
181
185
|
}
|
|
182
|
-
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") {
|
|
186
|
+
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") {
|
|
183
187
|
ctx.addIssue({
|
|
184
188
|
code: z__namespace.ZodIssueCode.custom,
|
|
185
189
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -326,6 +330,7 @@ exports.sessionEnvelopeSchema = sessionEnvelopeSchema;
|
|
|
326
330
|
exports.sessionEventSchema = sessionEventSchema;
|
|
327
331
|
exports.sessionFileEventSchema = sessionFileEventSchema;
|
|
328
332
|
exports.sessionModelUsageSchema = sessionModelUsageSchema;
|
|
333
|
+
exports.sessionNeedsContinueEventSchema = sessionNeedsContinueEventSchema;
|
|
329
334
|
exports.sessionPromptSuggestionEventSchema = sessionPromptSuggestionEventSchema;
|
|
330
335
|
exports.sessionRoleSchema = sessionRoleSchema;
|
|
331
336
|
exports.sessionServiceMessageEventSchema = sessionServiceMessageEventSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -454,6 +454,12 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
454
454
|
}, {
|
|
455
455
|
t: "prompt-suggestion";
|
|
456
456
|
suggestion: string;
|
|
457
|
+
}>, z.ZodObject<{
|
|
458
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
459
|
+
}, "strip", z.ZodTypeAny, {
|
|
460
|
+
t: "needs-continue";
|
|
461
|
+
}, {
|
|
462
|
+
t: "needs-continue";
|
|
457
463
|
}>]>;
|
|
458
464
|
}, "strip", z.ZodTypeAny, {
|
|
459
465
|
id: string;
|
|
@@ -560,6 +566,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
560
566
|
} | {
|
|
561
567
|
t: "prompt-suggestion";
|
|
562
568
|
suggestion: string;
|
|
569
|
+
} | {
|
|
570
|
+
t: "needs-continue";
|
|
563
571
|
};
|
|
564
572
|
turn?: string | undefined;
|
|
565
573
|
subagent?: string | undefined;
|
|
@@ -668,6 +676,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
668
676
|
} | {
|
|
669
677
|
t: "prompt-suggestion";
|
|
670
678
|
suggestion: string;
|
|
679
|
+
} | {
|
|
680
|
+
t: "needs-continue";
|
|
671
681
|
};
|
|
672
682
|
turn?: string | undefined;
|
|
673
683
|
subagent?: string | undefined;
|
|
@@ -776,6 +786,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
776
786
|
} | {
|
|
777
787
|
t: "prompt-suggestion";
|
|
778
788
|
suggestion: string;
|
|
789
|
+
} | {
|
|
790
|
+
t: "needs-continue";
|
|
779
791
|
};
|
|
780
792
|
turn?: string | undefined;
|
|
781
793
|
subagent?: string | undefined;
|
|
@@ -884,6 +896,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
884
896
|
} | {
|
|
885
897
|
t: "prompt-suggestion";
|
|
886
898
|
suggestion: string;
|
|
899
|
+
} | {
|
|
900
|
+
t: "needs-continue";
|
|
887
901
|
};
|
|
888
902
|
turn?: string | undefined;
|
|
889
903
|
subagent?: string | undefined;
|
|
@@ -1025,6 +1039,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
1025
1039
|
} | {
|
|
1026
1040
|
t: "prompt-suggestion";
|
|
1027
1041
|
suggestion: string;
|
|
1042
|
+
} | {
|
|
1043
|
+
t: "needs-continue";
|
|
1028
1044
|
};
|
|
1029
1045
|
turn?: string | undefined;
|
|
1030
1046
|
subagent?: string | undefined;
|
|
@@ -1147,6 +1163,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
1147
1163
|
} | {
|
|
1148
1164
|
t: "prompt-suggestion";
|
|
1149
1165
|
suggestion: string;
|
|
1166
|
+
} | {
|
|
1167
|
+
t: "needs-continue";
|
|
1150
1168
|
};
|
|
1151
1169
|
turn?: string | undefined;
|
|
1152
1170
|
subagent?: string | undefined;
|
|
@@ -1692,6 +1710,12 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1692
1710
|
}, {
|
|
1693
1711
|
t: "prompt-suggestion";
|
|
1694
1712
|
suggestion: string;
|
|
1713
|
+
}>, z.ZodObject<{
|
|
1714
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
1715
|
+
}, "strip", z.ZodTypeAny, {
|
|
1716
|
+
t: "needs-continue";
|
|
1717
|
+
}, {
|
|
1718
|
+
t: "needs-continue";
|
|
1695
1719
|
}>]>;
|
|
1696
1720
|
}, "strip", z.ZodTypeAny, {
|
|
1697
1721
|
id: string;
|
|
@@ -1798,6 +1822,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1798
1822
|
} | {
|
|
1799
1823
|
t: "prompt-suggestion";
|
|
1800
1824
|
suggestion: string;
|
|
1825
|
+
} | {
|
|
1826
|
+
t: "needs-continue";
|
|
1801
1827
|
};
|
|
1802
1828
|
turn?: string | undefined;
|
|
1803
1829
|
subagent?: string | undefined;
|
|
@@ -1906,6 +1932,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1906
1932
|
} | {
|
|
1907
1933
|
t: "prompt-suggestion";
|
|
1908
1934
|
suggestion: string;
|
|
1935
|
+
} | {
|
|
1936
|
+
t: "needs-continue";
|
|
1909
1937
|
};
|
|
1910
1938
|
turn?: string | undefined;
|
|
1911
1939
|
subagent?: string | undefined;
|
|
@@ -2014,6 +2042,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2014
2042
|
} | {
|
|
2015
2043
|
t: "prompt-suggestion";
|
|
2016
2044
|
suggestion: string;
|
|
2045
|
+
} | {
|
|
2046
|
+
t: "needs-continue";
|
|
2017
2047
|
};
|
|
2018
2048
|
turn?: string | undefined;
|
|
2019
2049
|
subagent?: string | undefined;
|
|
@@ -2122,6 +2152,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2122
2152
|
} | {
|
|
2123
2153
|
t: "prompt-suggestion";
|
|
2124
2154
|
suggestion: string;
|
|
2155
|
+
} | {
|
|
2156
|
+
t: "needs-continue";
|
|
2125
2157
|
};
|
|
2126
2158
|
turn?: string | undefined;
|
|
2127
2159
|
subagent?: string | undefined;
|
|
@@ -2263,6 +2295,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2263
2295
|
} | {
|
|
2264
2296
|
t: "prompt-suggestion";
|
|
2265
2297
|
suggestion: string;
|
|
2298
|
+
} | {
|
|
2299
|
+
t: "needs-continue";
|
|
2266
2300
|
};
|
|
2267
2301
|
turn?: string | undefined;
|
|
2268
2302
|
subagent?: string | undefined;
|
|
@@ -2385,6 +2419,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2385
2419
|
} | {
|
|
2386
2420
|
t: "prompt-suggestion";
|
|
2387
2421
|
suggestion: string;
|
|
2422
|
+
} | {
|
|
2423
|
+
t: "needs-continue";
|
|
2388
2424
|
};
|
|
2389
2425
|
turn?: string | undefined;
|
|
2390
2426
|
subagent?: string | undefined;
|
|
@@ -4292,6 +4328,13 @@ declare const sessionPromptSuggestionEventSchema: z.ZodObject<{
|
|
|
4292
4328
|
t: "prompt-suggestion";
|
|
4293
4329
|
suggestion: string;
|
|
4294
4330
|
}>;
|
|
4331
|
+
declare const sessionNeedsContinueEventSchema: z.ZodObject<{
|
|
4332
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
4333
|
+
}, "strip", z.ZodTypeAny, {
|
|
4334
|
+
t: "needs-continue";
|
|
4335
|
+
}, {
|
|
4336
|
+
t: "needs-continue";
|
|
4337
|
+
}>;
|
|
4295
4338
|
declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
4296
4339
|
t: z.ZodLiteral<"text">;
|
|
4297
4340
|
text: z.ZodString;
|
|
@@ -4655,6 +4698,12 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
4655
4698
|
}, {
|
|
4656
4699
|
t: "prompt-suggestion";
|
|
4657
4700
|
suggestion: string;
|
|
4701
|
+
}>, z.ZodObject<{
|
|
4702
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
4703
|
+
}, "strip", z.ZodTypeAny, {
|
|
4704
|
+
t: "needs-continue";
|
|
4705
|
+
}, {
|
|
4706
|
+
t: "needs-continue";
|
|
4658
4707
|
}>]>;
|
|
4659
4708
|
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
4660
4709
|
declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -5026,6 +5075,12 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5026
5075
|
}, {
|
|
5027
5076
|
t: "prompt-suggestion";
|
|
5028
5077
|
suggestion: string;
|
|
5078
|
+
}>, z.ZodObject<{
|
|
5079
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
5080
|
+
}, "strip", z.ZodTypeAny, {
|
|
5081
|
+
t: "needs-continue";
|
|
5082
|
+
}, {
|
|
5083
|
+
t: "needs-continue";
|
|
5029
5084
|
}>]>;
|
|
5030
5085
|
}, "strip", z.ZodTypeAny, {
|
|
5031
5086
|
id: string;
|
|
@@ -5132,6 +5187,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5132
5187
|
} | {
|
|
5133
5188
|
t: "prompt-suggestion";
|
|
5134
5189
|
suggestion: string;
|
|
5190
|
+
} | {
|
|
5191
|
+
t: "needs-continue";
|
|
5135
5192
|
};
|
|
5136
5193
|
turn?: string | undefined;
|
|
5137
5194
|
subagent?: string | undefined;
|
|
@@ -5240,6 +5297,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5240
5297
|
} | {
|
|
5241
5298
|
t: "prompt-suggestion";
|
|
5242
5299
|
suggestion: string;
|
|
5300
|
+
} | {
|
|
5301
|
+
t: "needs-continue";
|
|
5243
5302
|
};
|
|
5244
5303
|
turn?: string | undefined;
|
|
5245
5304
|
subagent?: string | undefined;
|
|
@@ -5348,6 +5407,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5348
5407
|
} | {
|
|
5349
5408
|
t: "prompt-suggestion";
|
|
5350
5409
|
suggestion: string;
|
|
5410
|
+
} | {
|
|
5411
|
+
t: "needs-continue";
|
|
5351
5412
|
};
|
|
5352
5413
|
turn?: string | undefined;
|
|
5353
5414
|
subagent?: string | undefined;
|
|
@@ -5456,6 +5517,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5456
5517
|
} | {
|
|
5457
5518
|
t: "prompt-suggestion";
|
|
5458
5519
|
suggestion: string;
|
|
5520
|
+
} | {
|
|
5521
|
+
t: "needs-continue";
|
|
5459
5522
|
};
|
|
5460
5523
|
turn?: string | undefined;
|
|
5461
5524
|
subagent?: string | undefined;
|
|
@@ -5469,5 +5532,5 @@ type CreateEnvelopeOptions = {
|
|
|
5469
5532
|
};
|
|
5470
5533
|
declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
|
|
5471
5534
|
|
|
5472
|
-
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 };
|
|
5535
|
+
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 };
|
|
5473
5536
|
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, LegacyMessageContent, MessageContent, MessageMeta, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };
|
package/dist/index.d.mts
CHANGED
|
@@ -454,6 +454,12 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
454
454
|
}, {
|
|
455
455
|
t: "prompt-suggestion";
|
|
456
456
|
suggestion: string;
|
|
457
|
+
}>, z.ZodObject<{
|
|
458
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
459
|
+
}, "strip", z.ZodTypeAny, {
|
|
460
|
+
t: "needs-continue";
|
|
461
|
+
}, {
|
|
462
|
+
t: "needs-continue";
|
|
457
463
|
}>]>;
|
|
458
464
|
}, "strip", z.ZodTypeAny, {
|
|
459
465
|
id: string;
|
|
@@ -560,6 +566,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
560
566
|
} | {
|
|
561
567
|
t: "prompt-suggestion";
|
|
562
568
|
suggestion: string;
|
|
569
|
+
} | {
|
|
570
|
+
t: "needs-continue";
|
|
563
571
|
};
|
|
564
572
|
turn?: string | undefined;
|
|
565
573
|
subagent?: string | undefined;
|
|
@@ -668,6 +676,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
668
676
|
} | {
|
|
669
677
|
t: "prompt-suggestion";
|
|
670
678
|
suggestion: string;
|
|
679
|
+
} | {
|
|
680
|
+
t: "needs-continue";
|
|
671
681
|
};
|
|
672
682
|
turn?: string | undefined;
|
|
673
683
|
subagent?: string | undefined;
|
|
@@ -776,6 +786,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
776
786
|
} | {
|
|
777
787
|
t: "prompt-suggestion";
|
|
778
788
|
suggestion: string;
|
|
789
|
+
} | {
|
|
790
|
+
t: "needs-continue";
|
|
779
791
|
};
|
|
780
792
|
turn?: string | undefined;
|
|
781
793
|
subagent?: string | undefined;
|
|
@@ -884,6 +896,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
884
896
|
} | {
|
|
885
897
|
t: "prompt-suggestion";
|
|
886
898
|
suggestion: string;
|
|
899
|
+
} | {
|
|
900
|
+
t: "needs-continue";
|
|
887
901
|
};
|
|
888
902
|
turn?: string | undefined;
|
|
889
903
|
subagent?: string | undefined;
|
|
@@ -1025,6 +1039,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
1025
1039
|
} | {
|
|
1026
1040
|
t: "prompt-suggestion";
|
|
1027
1041
|
suggestion: string;
|
|
1042
|
+
} | {
|
|
1043
|
+
t: "needs-continue";
|
|
1028
1044
|
};
|
|
1029
1045
|
turn?: string | undefined;
|
|
1030
1046
|
subagent?: string | undefined;
|
|
@@ -1147,6 +1163,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
1147
1163
|
} | {
|
|
1148
1164
|
t: "prompt-suggestion";
|
|
1149
1165
|
suggestion: string;
|
|
1166
|
+
} | {
|
|
1167
|
+
t: "needs-continue";
|
|
1150
1168
|
};
|
|
1151
1169
|
turn?: string | undefined;
|
|
1152
1170
|
subagent?: string | undefined;
|
|
@@ -1692,6 +1710,12 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1692
1710
|
}, {
|
|
1693
1711
|
t: "prompt-suggestion";
|
|
1694
1712
|
suggestion: string;
|
|
1713
|
+
}>, z.ZodObject<{
|
|
1714
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
1715
|
+
}, "strip", z.ZodTypeAny, {
|
|
1716
|
+
t: "needs-continue";
|
|
1717
|
+
}, {
|
|
1718
|
+
t: "needs-continue";
|
|
1695
1719
|
}>]>;
|
|
1696
1720
|
}, "strip", z.ZodTypeAny, {
|
|
1697
1721
|
id: string;
|
|
@@ -1798,6 +1822,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1798
1822
|
} | {
|
|
1799
1823
|
t: "prompt-suggestion";
|
|
1800
1824
|
suggestion: string;
|
|
1825
|
+
} | {
|
|
1826
|
+
t: "needs-continue";
|
|
1801
1827
|
};
|
|
1802
1828
|
turn?: string | undefined;
|
|
1803
1829
|
subagent?: string | undefined;
|
|
@@ -1906,6 +1932,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1906
1932
|
} | {
|
|
1907
1933
|
t: "prompt-suggestion";
|
|
1908
1934
|
suggestion: string;
|
|
1935
|
+
} | {
|
|
1936
|
+
t: "needs-continue";
|
|
1909
1937
|
};
|
|
1910
1938
|
turn?: string | undefined;
|
|
1911
1939
|
subagent?: string | undefined;
|
|
@@ -2014,6 +2042,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2014
2042
|
} | {
|
|
2015
2043
|
t: "prompt-suggestion";
|
|
2016
2044
|
suggestion: string;
|
|
2045
|
+
} | {
|
|
2046
|
+
t: "needs-continue";
|
|
2017
2047
|
};
|
|
2018
2048
|
turn?: string | undefined;
|
|
2019
2049
|
subagent?: string | undefined;
|
|
@@ -2122,6 +2152,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2122
2152
|
} | {
|
|
2123
2153
|
t: "prompt-suggestion";
|
|
2124
2154
|
suggestion: string;
|
|
2155
|
+
} | {
|
|
2156
|
+
t: "needs-continue";
|
|
2125
2157
|
};
|
|
2126
2158
|
turn?: string | undefined;
|
|
2127
2159
|
subagent?: string | undefined;
|
|
@@ -2263,6 +2295,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2263
2295
|
} | {
|
|
2264
2296
|
t: "prompt-suggestion";
|
|
2265
2297
|
suggestion: string;
|
|
2298
|
+
} | {
|
|
2299
|
+
t: "needs-continue";
|
|
2266
2300
|
};
|
|
2267
2301
|
turn?: string | undefined;
|
|
2268
2302
|
subagent?: string | undefined;
|
|
@@ -2385,6 +2419,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2385
2419
|
} | {
|
|
2386
2420
|
t: "prompt-suggestion";
|
|
2387
2421
|
suggestion: string;
|
|
2422
|
+
} | {
|
|
2423
|
+
t: "needs-continue";
|
|
2388
2424
|
};
|
|
2389
2425
|
turn?: string | undefined;
|
|
2390
2426
|
subagent?: string | undefined;
|
|
@@ -4292,6 +4328,13 @@ declare const sessionPromptSuggestionEventSchema: z.ZodObject<{
|
|
|
4292
4328
|
t: "prompt-suggestion";
|
|
4293
4329
|
suggestion: string;
|
|
4294
4330
|
}>;
|
|
4331
|
+
declare const sessionNeedsContinueEventSchema: z.ZodObject<{
|
|
4332
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
4333
|
+
}, "strip", z.ZodTypeAny, {
|
|
4334
|
+
t: "needs-continue";
|
|
4335
|
+
}, {
|
|
4336
|
+
t: "needs-continue";
|
|
4337
|
+
}>;
|
|
4295
4338
|
declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
4296
4339
|
t: z.ZodLiteral<"text">;
|
|
4297
4340
|
text: z.ZodString;
|
|
@@ -4655,6 +4698,12 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
4655
4698
|
}, {
|
|
4656
4699
|
t: "prompt-suggestion";
|
|
4657
4700
|
suggestion: string;
|
|
4701
|
+
}>, z.ZodObject<{
|
|
4702
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
4703
|
+
}, "strip", z.ZodTypeAny, {
|
|
4704
|
+
t: "needs-continue";
|
|
4705
|
+
}, {
|
|
4706
|
+
t: "needs-continue";
|
|
4658
4707
|
}>]>;
|
|
4659
4708
|
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
4660
4709
|
declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -5026,6 +5075,12 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5026
5075
|
}, {
|
|
5027
5076
|
t: "prompt-suggestion";
|
|
5028
5077
|
suggestion: string;
|
|
5078
|
+
}>, z.ZodObject<{
|
|
5079
|
+
t: z.ZodLiteral<"needs-continue">;
|
|
5080
|
+
}, "strip", z.ZodTypeAny, {
|
|
5081
|
+
t: "needs-continue";
|
|
5082
|
+
}, {
|
|
5083
|
+
t: "needs-continue";
|
|
5029
5084
|
}>]>;
|
|
5030
5085
|
}, "strip", z.ZodTypeAny, {
|
|
5031
5086
|
id: string;
|
|
@@ -5132,6 +5187,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5132
5187
|
} | {
|
|
5133
5188
|
t: "prompt-suggestion";
|
|
5134
5189
|
suggestion: string;
|
|
5190
|
+
} | {
|
|
5191
|
+
t: "needs-continue";
|
|
5135
5192
|
};
|
|
5136
5193
|
turn?: string | undefined;
|
|
5137
5194
|
subagent?: string | undefined;
|
|
@@ -5240,6 +5297,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5240
5297
|
} | {
|
|
5241
5298
|
t: "prompt-suggestion";
|
|
5242
5299
|
suggestion: string;
|
|
5300
|
+
} | {
|
|
5301
|
+
t: "needs-continue";
|
|
5243
5302
|
};
|
|
5244
5303
|
turn?: string | undefined;
|
|
5245
5304
|
subagent?: string | undefined;
|
|
@@ -5348,6 +5407,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5348
5407
|
} | {
|
|
5349
5408
|
t: "prompt-suggestion";
|
|
5350
5409
|
suggestion: string;
|
|
5410
|
+
} | {
|
|
5411
|
+
t: "needs-continue";
|
|
5351
5412
|
};
|
|
5352
5413
|
turn?: string | undefined;
|
|
5353
5414
|
subagent?: string | undefined;
|
|
@@ -5456,6 +5517,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5456
5517
|
} | {
|
|
5457
5518
|
t: "prompt-suggestion";
|
|
5458
5519
|
suggestion: string;
|
|
5520
|
+
} | {
|
|
5521
|
+
t: "needs-continue";
|
|
5459
5522
|
};
|
|
5460
5523
|
turn?: string | undefined;
|
|
5461
5524
|
subagent?: string | undefined;
|
|
@@ -5469,5 +5532,5 @@ type CreateEnvelopeOptions = {
|
|
|
5469
5532
|
};
|
|
5470
5533
|
declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
|
|
5471
5534
|
|
|
5472
|
-
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 };
|
|
5535
|
+
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 };
|
|
5473
5536
|
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, LegacyMessageContent, MessageContent, MessageMeta, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };
|
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"`,
|
|
@@ -278,4 +282,4 @@ const ApiUpdateMachineStateSchema = UpdateMachineBodySchema;
|
|
|
278
282
|
const UpdateBodySchema = UpdateNewMessageBodySchema;
|
|
279
283
|
const UpdateSchema = CoreUpdateContainerSchema;
|
|
280
284
|
|
|
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 };
|
|
285
|
+
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 };
|