@kmmao/happy-wire 0.2.2 → 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 +8 -2
- package/dist/index.d.cts +95 -1
- package/dist/index.d.mts +95 -1
- package/dist/index.mjs +8 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -129,6 +129,10 @@ const sessionToolProgressEventSchema = z__namespace.object({
|
|
|
129
129
|
elapsedSeconds: z__namespace.number(),
|
|
130
130
|
taskId: z__namespace.string().optional()
|
|
131
131
|
});
|
|
132
|
+
const sessionPromptSuggestionEventSchema = z__namespace.object({
|
|
133
|
+
t: z__namespace.literal("prompt-suggestion"),
|
|
134
|
+
suggestion: z__namespace.string()
|
|
135
|
+
});
|
|
132
136
|
const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
133
137
|
sessionTextEventSchema,
|
|
134
138
|
sessionServiceMessageEventSchema,
|
|
@@ -143,7 +147,8 @@ const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
|
143
147
|
sessionTaskStartEventSchema,
|
|
144
148
|
sessionTaskProgressEventSchema,
|
|
145
149
|
sessionTaskEndEventSchema,
|
|
146
|
-
sessionToolProgressEventSchema
|
|
150
|
+
sessionToolProgressEventSchema,
|
|
151
|
+
sessionPromptSuggestionEventSchema
|
|
147
152
|
]);
|
|
148
153
|
const sessionEnvelopeSchema = z__namespace.object({
|
|
149
154
|
id: z__namespace.string(),
|
|
@@ -162,7 +167,7 @@ const sessionEnvelopeSchema = z__namespace.object({
|
|
|
162
167
|
path: ["role"]
|
|
163
168
|
});
|
|
164
169
|
}
|
|
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.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") {
|
|
166
171
|
ctx.addIssue({
|
|
167
172
|
code: z__namespace.ZodIssueCode.custom,
|
|
168
173
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -308,6 +313,7 @@ exports.createEnvelope = createEnvelope;
|
|
|
308
313
|
exports.sessionEnvelopeSchema = sessionEnvelopeSchema;
|
|
309
314
|
exports.sessionEventSchema = sessionEventSchema;
|
|
310
315
|
exports.sessionFileEventSchema = sessionFileEventSchema;
|
|
316
|
+
exports.sessionPromptSuggestionEventSchema = sessionPromptSuggestionEventSchema;
|
|
311
317
|
exports.sessionRoleSchema = sessionRoleSchema;
|
|
312
318
|
exports.sessionServiceMessageEventSchema = sessionServiceMessageEventSchema;
|
|
313
319
|
exports.sessionStartEventSchema = sessionStartEventSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -396,6 +396,15 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
396
396
|
toolName: string;
|
|
397
397
|
elapsedSeconds: number;
|
|
398
398
|
taskId?: string | undefined;
|
|
399
|
+
}>, z.ZodObject<{
|
|
400
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
401
|
+
suggestion: z.ZodString;
|
|
402
|
+
}, "strip", z.ZodTypeAny, {
|
|
403
|
+
t: "prompt-suggestion";
|
|
404
|
+
suggestion: string;
|
|
405
|
+
}, {
|
|
406
|
+
t: "prompt-suggestion";
|
|
407
|
+
suggestion: string;
|
|
399
408
|
}>]>;
|
|
400
409
|
}, "strip", z.ZodTypeAny, {
|
|
401
410
|
id: string;
|
|
@@ -488,6 +497,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
488
497
|
toolName: string;
|
|
489
498
|
elapsedSeconds: number;
|
|
490
499
|
taskId?: string | undefined;
|
|
500
|
+
} | {
|
|
501
|
+
t: "prompt-suggestion";
|
|
502
|
+
suggestion: string;
|
|
491
503
|
};
|
|
492
504
|
turn?: string | undefined;
|
|
493
505
|
subagent?: string | undefined;
|
|
@@ -582,6 +594,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
582
594
|
toolName: string;
|
|
583
595
|
elapsedSeconds: number;
|
|
584
596
|
taskId?: string | undefined;
|
|
597
|
+
} | {
|
|
598
|
+
t: "prompt-suggestion";
|
|
599
|
+
suggestion: string;
|
|
585
600
|
};
|
|
586
601
|
turn?: string | undefined;
|
|
587
602
|
subagent?: string | undefined;
|
|
@@ -676,6 +691,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
676
691
|
toolName: string;
|
|
677
692
|
elapsedSeconds: number;
|
|
678
693
|
taskId?: string | undefined;
|
|
694
|
+
} | {
|
|
695
|
+
t: "prompt-suggestion";
|
|
696
|
+
suggestion: string;
|
|
679
697
|
};
|
|
680
698
|
turn?: string | undefined;
|
|
681
699
|
subagent?: string | undefined;
|
|
@@ -770,6 +788,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
770
788
|
toolName: string;
|
|
771
789
|
elapsedSeconds: number;
|
|
772
790
|
taskId?: string | undefined;
|
|
791
|
+
} | {
|
|
792
|
+
t: "prompt-suggestion";
|
|
793
|
+
suggestion: string;
|
|
773
794
|
};
|
|
774
795
|
turn?: string | undefined;
|
|
775
796
|
subagent?: string | undefined;
|
|
@@ -897,6 +918,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
897
918
|
toolName: string;
|
|
898
919
|
elapsedSeconds: number;
|
|
899
920
|
taskId?: string | undefined;
|
|
921
|
+
} | {
|
|
922
|
+
t: "prompt-suggestion";
|
|
923
|
+
suggestion: string;
|
|
900
924
|
};
|
|
901
925
|
turn?: string | undefined;
|
|
902
926
|
subagent?: string | undefined;
|
|
@@ -1005,6 +1029,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
1005
1029
|
toolName: string;
|
|
1006
1030
|
elapsedSeconds: number;
|
|
1007
1031
|
taskId?: string | undefined;
|
|
1032
|
+
} | {
|
|
1033
|
+
t: "prompt-suggestion";
|
|
1034
|
+
suggestion: string;
|
|
1008
1035
|
};
|
|
1009
1036
|
turn?: string | undefined;
|
|
1010
1037
|
subagent?: string | undefined;
|
|
@@ -1492,6 +1519,15 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1492
1519
|
toolName: string;
|
|
1493
1520
|
elapsedSeconds: number;
|
|
1494
1521
|
taskId?: string | undefined;
|
|
1522
|
+
}>, z.ZodObject<{
|
|
1523
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
1524
|
+
suggestion: z.ZodString;
|
|
1525
|
+
}, "strip", z.ZodTypeAny, {
|
|
1526
|
+
t: "prompt-suggestion";
|
|
1527
|
+
suggestion: string;
|
|
1528
|
+
}, {
|
|
1529
|
+
t: "prompt-suggestion";
|
|
1530
|
+
suggestion: string;
|
|
1495
1531
|
}>]>;
|
|
1496
1532
|
}, "strip", z.ZodTypeAny, {
|
|
1497
1533
|
id: string;
|
|
@@ -1584,6 +1620,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1584
1620
|
toolName: string;
|
|
1585
1621
|
elapsedSeconds: number;
|
|
1586
1622
|
taskId?: string | undefined;
|
|
1623
|
+
} | {
|
|
1624
|
+
t: "prompt-suggestion";
|
|
1625
|
+
suggestion: string;
|
|
1587
1626
|
};
|
|
1588
1627
|
turn?: string | undefined;
|
|
1589
1628
|
subagent?: string | undefined;
|
|
@@ -1678,6 +1717,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1678
1717
|
toolName: string;
|
|
1679
1718
|
elapsedSeconds: number;
|
|
1680
1719
|
taskId?: string | undefined;
|
|
1720
|
+
} | {
|
|
1721
|
+
t: "prompt-suggestion";
|
|
1722
|
+
suggestion: string;
|
|
1681
1723
|
};
|
|
1682
1724
|
turn?: string | undefined;
|
|
1683
1725
|
subagent?: string | undefined;
|
|
@@ -1772,6 +1814,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1772
1814
|
toolName: string;
|
|
1773
1815
|
elapsedSeconds: number;
|
|
1774
1816
|
taskId?: string | undefined;
|
|
1817
|
+
} | {
|
|
1818
|
+
t: "prompt-suggestion";
|
|
1819
|
+
suggestion: string;
|
|
1775
1820
|
};
|
|
1776
1821
|
turn?: string | undefined;
|
|
1777
1822
|
subagent?: string | undefined;
|
|
@@ -1866,6 +1911,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1866
1911
|
toolName: string;
|
|
1867
1912
|
elapsedSeconds: number;
|
|
1868
1913
|
taskId?: string | undefined;
|
|
1914
|
+
} | {
|
|
1915
|
+
t: "prompt-suggestion";
|
|
1916
|
+
suggestion: string;
|
|
1869
1917
|
};
|
|
1870
1918
|
turn?: string | undefined;
|
|
1871
1919
|
subagent?: string | undefined;
|
|
@@ -1993,6 +2041,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1993
2041
|
toolName: string;
|
|
1994
2042
|
elapsedSeconds: number;
|
|
1995
2043
|
taskId?: string | undefined;
|
|
2044
|
+
} | {
|
|
2045
|
+
t: "prompt-suggestion";
|
|
2046
|
+
suggestion: string;
|
|
1996
2047
|
};
|
|
1997
2048
|
turn?: string | undefined;
|
|
1998
2049
|
subagent?: string | undefined;
|
|
@@ -2101,6 +2152,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2101
2152
|
toolName: string;
|
|
2102
2153
|
elapsedSeconds: number;
|
|
2103
2154
|
taskId?: string | undefined;
|
|
2155
|
+
} | {
|
|
2156
|
+
t: "prompt-suggestion";
|
|
2157
|
+
suggestion: string;
|
|
2104
2158
|
};
|
|
2105
2159
|
turn?: string | undefined;
|
|
2106
2160
|
subagent?: string | undefined;
|
|
@@ -3923,6 +3977,16 @@ declare const sessionToolProgressEventSchema: z.ZodObject<{
|
|
|
3923
3977
|
elapsedSeconds: number;
|
|
3924
3978
|
taskId?: string | undefined;
|
|
3925
3979
|
}>;
|
|
3980
|
+
declare const sessionPromptSuggestionEventSchema: z.ZodObject<{
|
|
3981
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
3982
|
+
suggestion: z.ZodString;
|
|
3983
|
+
}, "strip", z.ZodTypeAny, {
|
|
3984
|
+
t: "prompt-suggestion";
|
|
3985
|
+
suggestion: string;
|
|
3986
|
+
}, {
|
|
3987
|
+
t: "prompt-suggestion";
|
|
3988
|
+
suggestion: string;
|
|
3989
|
+
}>;
|
|
3926
3990
|
declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
3927
3991
|
t: z.ZodLiteral<"text">;
|
|
3928
3992
|
text: z.ZodString;
|
|
@@ -4228,6 +4292,15 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
4228
4292
|
toolName: string;
|
|
4229
4293
|
elapsedSeconds: number;
|
|
4230
4294
|
taskId?: string | undefined;
|
|
4295
|
+
}>, z.ZodObject<{
|
|
4296
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
4297
|
+
suggestion: z.ZodString;
|
|
4298
|
+
}, "strip", z.ZodTypeAny, {
|
|
4299
|
+
t: "prompt-suggestion";
|
|
4300
|
+
suggestion: string;
|
|
4301
|
+
}, {
|
|
4302
|
+
t: "prompt-suggestion";
|
|
4303
|
+
suggestion: string;
|
|
4231
4304
|
}>]>;
|
|
4232
4305
|
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
4233
4306
|
declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -4541,6 +4614,15 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4541
4614
|
toolName: string;
|
|
4542
4615
|
elapsedSeconds: number;
|
|
4543
4616
|
taskId?: string | undefined;
|
|
4617
|
+
}>, z.ZodObject<{
|
|
4618
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
4619
|
+
suggestion: z.ZodString;
|
|
4620
|
+
}, "strip", z.ZodTypeAny, {
|
|
4621
|
+
t: "prompt-suggestion";
|
|
4622
|
+
suggestion: string;
|
|
4623
|
+
}, {
|
|
4624
|
+
t: "prompt-suggestion";
|
|
4625
|
+
suggestion: string;
|
|
4544
4626
|
}>]>;
|
|
4545
4627
|
}, "strip", z.ZodTypeAny, {
|
|
4546
4628
|
id: string;
|
|
@@ -4633,6 +4715,9 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4633
4715
|
toolName: string;
|
|
4634
4716
|
elapsedSeconds: number;
|
|
4635
4717
|
taskId?: string | undefined;
|
|
4718
|
+
} | {
|
|
4719
|
+
t: "prompt-suggestion";
|
|
4720
|
+
suggestion: string;
|
|
4636
4721
|
};
|
|
4637
4722
|
turn?: string | undefined;
|
|
4638
4723
|
subagent?: string | undefined;
|
|
@@ -4727,6 +4812,9 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4727
4812
|
toolName: string;
|
|
4728
4813
|
elapsedSeconds: number;
|
|
4729
4814
|
taskId?: string | undefined;
|
|
4815
|
+
} | {
|
|
4816
|
+
t: "prompt-suggestion";
|
|
4817
|
+
suggestion: string;
|
|
4730
4818
|
};
|
|
4731
4819
|
turn?: string | undefined;
|
|
4732
4820
|
subagent?: string | undefined;
|
|
@@ -4821,6 +4909,9 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4821
4909
|
toolName: string;
|
|
4822
4910
|
elapsedSeconds: number;
|
|
4823
4911
|
taskId?: string | undefined;
|
|
4912
|
+
} | {
|
|
4913
|
+
t: "prompt-suggestion";
|
|
4914
|
+
suggestion: string;
|
|
4824
4915
|
};
|
|
4825
4916
|
turn?: string | undefined;
|
|
4826
4917
|
subagent?: string | undefined;
|
|
@@ -4915,6 +5006,9 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4915
5006
|
toolName: string;
|
|
4916
5007
|
elapsedSeconds: number;
|
|
4917
5008
|
taskId?: string | undefined;
|
|
5009
|
+
} | {
|
|
5010
|
+
t: "prompt-suggestion";
|
|
5011
|
+
suggestion: string;
|
|
4918
5012
|
};
|
|
4919
5013
|
turn?: string | undefined;
|
|
4920
5014
|
subagent?: string | undefined;
|
|
@@ -4928,5 +5022,5 @@ type CreateEnvelopeOptions = {
|
|
|
4928
5022
|
};
|
|
4929
5023
|
declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
|
|
4930
5024
|
|
|
4931
|
-
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, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
5025
|
+
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, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
4932
5026
|
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, LegacyMessageContent, MessageContent, MessageMeta, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };
|
package/dist/index.d.mts
CHANGED
|
@@ -396,6 +396,15 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
396
396
|
toolName: string;
|
|
397
397
|
elapsedSeconds: number;
|
|
398
398
|
taskId?: string | undefined;
|
|
399
|
+
}>, z.ZodObject<{
|
|
400
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
401
|
+
suggestion: z.ZodString;
|
|
402
|
+
}, "strip", z.ZodTypeAny, {
|
|
403
|
+
t: "prompt-suggestion";
|
|
404
|
+
suggestion: string;
|
|
405
|
+
}, {
|
|
406
|
+
t: "prompt-suggestion";
|
|
407
|
+
suggestion: string;
|
|
399
408
|
}>]>;
|
|
400
409
|
}, "strip", z.ZodTypeAny, {
|
|
401
410
|
id: string;
|
|
@@ -488,6 +497,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
488
497
|
toolName: string;
|
|
489
498
|
elapsedSeconds: number;
|
|
490
499
|
taskId?: string | undefined;
|
|
500
|
+
} | {
|
|
501
|
+
t: "prompt-suggestion";
|
|
502
|
+
suggestion: string;
|
|
491
503
|
};
|
|
492
504
|
turn?: string | undefined;
|
|
493
505
|
subagent?: string | undefined;
|
|
@@ -582,6 +594,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
582
594
|
toolName: string;
|
|
583
595
|
elapsedSeconds: number;
|
|
584
596
|
taskId?: string | undefined;
|
|
597
|
+
} | {
|
|
598
|
+
t: "prompt-suggestion";
|
|
599
|
+
suggestion: string;
|
|
585
600
|
};
|
|
586
601
|
turn?: string | undefined;
|
|
587
602
|
subagent?: string | undefined;
|
|
@@ -676,6 +691,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
676
691
|
toolName: string;
|
|
677
692
|
elapsedSeconds: number;
|
|
678
693
|
taskId?: string | undefined;
|
|
694
|
+
} | {
|
|
695
|
+
t: "prompt-suggestion";
|
|
696
|
+
suggestion: string;
|
|
679
697
|
};
|
|
680
698
|
turn?: string | undefined;
|
|
681
699
|
subagent?: string | undefined;
|
|
@@ -770,6 +788,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
770
788
|
toolName: string;
|
|
771
789
|
elapsedSeconds: number;
|
|
772
790
|
taskId?: string | undefined;
|
|
791
|
+
} | {
|
|
792
|
+
t: "prompt-suggestion";
|
|
793
|
+
suggestion: string;
|
|
773
794
|
};
|
|
774
795
|
turn?: string | undefined;
|
|
775
796
|
subagent?: string | undefined;
|
|
@@ -897,6 +918,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
897
918
|
toolName: string;
|
|
898
919
|
elapsedSeconds: number;
|
|
899
920
|
taskId?: string | undefined;
|
|
921
|
+
} | {
|
|
922
|
+
t: "prompt-suggestion";
|
|
923
|
+
suggestion: string;
|
|
900
924
|
};
|
|
901
925
|
turn?: string | undefined;
|
|
902
926
|
subagent?: string | undefined;
|
|
@@ -1005,6 +1029,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
1005
1029
|
toolName: string;
|
|
1006
1030
|
elapsedSeconds: number;
|
|
1007
1031
|
taskId?: string | undefined;
|
|
1032
|
+
} | {
|
|
1033
|
+
t: "prompt-suggestion";
|
|
1034
|
+
suggestion: string;
|
|
1008
1035
|
};
|
|
1009
1036
|
turn?: string | undefined;
|
|
1010
1037
|
subagent?: string | undefined;
|
|
@@ -1492,6 +1519,15 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1492
1519
|
toolName: string;
|
|
1493
1520
|
elapsedSeconds: number;
|
|
1494
1521
|
taskId?: string | undefined;
|
|
1522
|
+
}>, z.ZodObject<{
|
|
1523
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
1524
|
+
suggestion: z.ZodString;
|
|
1525
|
+
}, "strip", z.ZodTypeAny, {
|
|
1526
|
+
t: "prompt-suggestion";
|
|
1527
|
+
suggestion: string;
|
|
1528
|
+
}, {
|
|
1529
|
+
t: "prompt-suggestion";
|
|
1530
|
+
suggestion: string;
|
|
1495
1531
|
}>]>;
|
|
1496
1532
|
}, "strip", z.ZodTypeAny, {
|
|
1497
1533
|
id: string;
|
|
@@ -1584,6 +1620,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1584
1620
|
toolName: string;
|
|
1585
1621
|
elapsedSeconds: number;
|
|
1586
1622
|
taskId?: string | undefined;
|
|
1623
|
+
} | {
|
|
1624
|
+
t: "prompt-suggestion";
|
|
1625
|
+
suggestion: string;
|
|
1587
1626
|
};
|
|
1588
1627
|
turn?: string | undefined;
|
|
1589
1628
|
subagent?: string | undefined;
|
|
@@ -1678,6 +1717,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1678
1717
|
toolName: string;
|
|
1679
1718
|
elapsedSeconds: number;
|
|
1680
1719
|
taskId?: string | undefined;
|
|
1720
|
+
} | {
|
|
1721
|
+
t: "prompt-suggestion";
|
|
1722
|
+
suggestion: string;
|
|
1681
1723
|
};
|
|
1682
1724
|
turn?: string | undefined;
|
|
1683
1725
|
subagent?: string | undefined;
|
|
@@ -1772,6 +1814,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1772
1814
|
toolName: string;
|
|
1773
1815
|
elapsedSeconds: number;
|
|
1774
1816
|
taskId?: string | undefined;
|
|
1817
|
+
} | {
|
|
1818
|
+
t: "prompt-suggestion";
|
|
1819
|
+
suggestion: string;
|
|
1775
1820
|
};
|
|
1776
1821
|
turn?: string | undefined;
|
|
1777
1822
|
subagent?: string | undefined;
|
|
@@ -1866,6 +1911,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1866
1911
|
toolName: string;
|
|
1867
1912
|
elapsedSeconds: number;
|
|
1868
1913
|
taskId?: string | undefined;
|
|
1914
|
+
} | {
|
|
1915
|
+
t: "prompt-suggestion";
|
|
1916
|
+
suggestion: string;
|
|
1869
1917
|
};
|
|
1870
1918
|
turn?: string | undefined;
|
|
1871
1919
|
subagent?: string | undefined;
|
|
@@ -1993,6 +2041,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
1993
2041
|
toolName: string;
|
|
1994
2042
|
elapsedSeconds: number;
|
|
1995
2043
|
taskId?: string | undefined;
|
|
2044
|
+
} | {
|
|
2045
|
+
t: "prompt-suggestion";
|
|
2046
|
+
suggestion: string;
|
|
1996
2047
|
};
|
|
1997
2048
|
turn?: string | undefined;
|
|
1998
2049
|
subagent?: string | undefined;
|
|
@@ -2101,6 +2152,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
|
|
|
2101
2152
|
toolName: string;
|
|
2102
2153
|
elapsedSeconds: number;
|
|
2103
2154
|
taskId?: string | undefined;
|
|
2155
|
+
} | {
|
|
2156
|
+
t: "prompt-suggestion";
|
|
2157
|
+
suggestion: string;
|
|
2104
2158
|
};
|
|
2105
2159
|
turn?: string | undefined;
|
|
2106
2160
|
subagent?: string | undefined;
|
|
@@ -3923,6 +3977,16 @@ declare const sessionToolProgressEventSchema: z.ZodObject<{
|
|
|
3923
3977
|
elapsedSeconds: number;
|
|
3924
3978
|
taskId?: string | undefined;
|
|
3925
3979
|
}>;
|
|
3980
|
+
declare const sessionPromptSuggestionEventSchema: z.ZodObject<{
|
|
3981
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
3982
|
+
suggestion: z.ZodString;
|
|
3983
|
+
}, "strip", z.ZodTypeAny, {
|
|
3984
|
+
t: "prompt-suggestion";
|
|
3985
|
+
suggestion: string;
|
|
3986
|
+
}, {
|
|
3987
|
+
t: "prompt-suggestion";
|
|
3988
|
+
suggestion: string;
|
|
3989
|
+
}>;
|
|
3926
3990
|
declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
3927
3991
|
t: z.ZodLiteral<"text">;
|
|
3928
3992
|
text: z.ZodString;
|
|
@@ -4228,6 +4292,15 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
4228
4292
|
toolName: string;
|
|
4229
4293
|
elapsedSeconds: number;
|
|
4230
4294
|
taskId?: string | undefined;
|
|
4295
|
+
}>, z.ZodObject<{
|
|
4296
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
4297
|
+
suggestion: z.ZodString;
|
|
4298
|
+
}, "strip", z.ZodTypeAny, {
|
|
4299
|
+
t: "prompt-suggestion";
|
|
4300
|
+
suggestion: string;
|
|
4301
|
+
}, {
|
|
4302
|
+
t: "prompt-suggestion";
|
|
4303
|
+
suggestion: string;
|
|
4231
4304
|
}>]>;
|
|
4232
4305
|
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
4233
4306
|
declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -4541,6 +4614,15 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4541
4614
|
toolName: string;
|
|
4542
4615
|
elapsedSeconds: number;
|
|
4543
4616
|
taskId?: string | undefined;
|
|
4617
|
+
}>, z.ZodObject<{
|
|
4618
|
+
t: z.ZodLiteral<"prompt-suggestion">;
|
|
4619
|
+
suggestion: z.ZodString;
|
|
4620
|
+
}, "strip", z.ZodTypeAny, {
|
|
4621
|
+
t: "prompt-suggestion";
|
|
4622
|
+
suggestion: string;
|
|
4623
|
+
}, {
|
|
4624
|
+
t: "prompt-suggestion";
|
|
4625
|
+
suggestion: string;
|
|
4544
4626
|
}>]>;
|
|
4545
4627
|
}, "strip", z.ZodTypeAny, {
|
|
4546
4628
|
id: string;
|
|
@@ -4633,6 +4715,9 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4633
4715
|
toolName: string;
|
|
4634
4716
|
elapsedSeconds: number;
|
|
4635
4717
|
taskId?: string | undefined;
|
|
4718
|
+
} | {
|
|
4719
|
+
t: "prompt-suggestion";
|
|
4720
|
+
suggestion: string;
|
|
4636
4721
|
};
|
|
4637
4722
|
turn?: string | undefined;
|
|
4638
4723
|
subagent?: string | undefined;
|
|
@@ -4727,6 +4812,9 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4727
4812
|
toolName: string;
|
|
4728
4813
|
elapsedSeconds: number;
|
|
4729
4814
|
taskId?: string | undefined;
|
|
4815
|
+
} | {
|
|
4816
|
+
t: "prompt-suggestion";
|
|
4817
|
+
suggestion: string;
|
|
4730
4818
|
};
|
|
4731
4819
|
turn?: string | undefined;
|
|
4732
4820
|
subagent?: string | undefined;
|
|
@@ -4821,6 +4909,9 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4821
4909
|
toolName: string;
|
|
4822
4910
|
elapsedSeconds: number;
|
|
4823
4911
|
taskId?: string | undefined;
|
|
4912
|
+
} | {
|
|
4913
|
+
t: "prompt-suggestion";
|
|
4914
|
+
suggestion: string;
|
|
4824
4915
|
};
|
|
4825
4916
|
turn?: string | undefined;
|
|
4826
4917
|
subagent?: string | undefined;
|
|
@@ -4915,6 +5006,9 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
4915
5006
|
toolName: string;
|
|
4916
5007
|
elapsedSeconds: number;
|
|
4917
5008
|
taskId?: string | undefined;
|
|
5009
|
+
} | {
|
|
5010
|
+
t: "prompt-suggestion";
|
|
5011
|
+
suggestion: string;
|
|
4918
5012
|
};
|
|
4919
5013
|
turn?: string | undefined;
|
|
4920
5014
|
subagent?: string | undefined;
|
|
@@ -4928,5 +5022,5 @@ type CreateEnvelopeOptions = {
|
|
|
4928
5022
|
};
|
|
4929
5023
|
declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
|
|
4930
5024
|
|
|
4931
|
-
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, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
5025
|
+
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, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
4932
5026
|
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, LegacyMessageContent, MessageContent, MessageMeta, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };
|
package/dist/index.mjs
CHANGED
|
@@ -108,6 +108,10 @@ const sessionToolProgressEventSchema = z.object({
|
|
|
108
108
|
elapsedSeconds: z.number(),
|
|
109
109
|
taskId: z.string().optional()
|
|
110
110
|
});
|
|
111
|
+
const sessionPromptSuggestionEventSchema = z.object({
|
|
112
|
+
t: z.literal("prompt-suggestion"),
|
|
113
|
+
suggestion: z.string()
|
|
114
|
+
});
|
|
111
115
|
const sessionEventSchema = z.discriminatedUnion("t", [
|
|
112
116
|
sessionTextEventSchema,
|
|
113
117
|
sessionServiceMessageEventSchema,
|
|
@@ -122,7 +126,8 @@ const sessionEventSchema = z.discriminatedUnion("t", [
|
|
|
122
126
|
sessionTaskStartEventSchema,
|
|
123
127
|
sessionTaskProgressEventSchema,
|
|
124
128
|
sessionTaskEndEventSchema,
|
|
125
|
-
sessionToolProgressEventSchema
|
|
129
|
+
sessionToolProgressEventSchema,
|
|
130
|
+
sessionPromptSuggestionEventSchema
|
|
126
131
|
]);
|
|
127
132
|
const sessionEnvelopeSchema = z.object({
|
|
128
133
|
id: z.string(),
|
|
@@ -141,7 +146,7 @@ const sessionEnvelopeSchema = z.object({
|
|
|
141
146
|
path: ["role"]
|
|
142
147
|
});
|
|
143
148
|
}
|
|
144
|
-
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.role !== "agent") {
|
|
149
|
+
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") {
|
|
145
150
|
ctx.addIssue({
|
|
146
151
|
code: z.ZodIssueCode.custom,
|
|
147
152
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -261,4 +266,4 @@ const ApiUpdateMachineStateSchema = UpdateMachineBodySchema;
|
|
|
261
266
|
const UpdateBodySchema = UpdateNewMessageBodySchema;
|
|
262
267
|
const UpdateSchema = CoreUpdateContainerSchema;
|
|
263
268
|
|
|
264
|
-
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, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
269
|
+
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, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|