@kmmao/happy-wire 0.7.0 → 0.8.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 +38 -2
- package/dist/index.d.cts +72 -4
- package/dist/index.d.mts +72 -4
- package/dist/index.mjs +35 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -166,6 +166,17 @@ const sessionContextUsageCategorySchema = z__namespace.object({
|
|
|
166
166
|
tokens: z__namespace.number(),
|
|
167
167
|
color: z__namespace.string().optional()
|
|
168
168
|
});
|
|
169
|
+
const sessionTaskLogEventSchema = z__namespace.object({
|
|
170
|
+
t: z__namespace.literal("task-log"),
|
|
171
|
+
/** Background task ID or tool call ID that owns this log stream */
|
|
172
|
+
taskId: z__namespace.string(),
|
|
173
|
+
/** Path to the output file on the CLI machine */
|
|
174
|
+
outputFile: z__namespace.string(),
|
|
175
|
+
/** Incremental log content (new lines since last push) */
|
|
176
|
+
chunk: z__namespace.string(),
|
|
177
|
+
/** Byte offset in the output file where this chunk starts */
|
|
178
|
+
offset: z__namespace.number()
|
|
179
|
+
});
|
|
169
180
|
const sessionContextUsageEventSchema = z__namespace.object({
|
|
170
181
|
t: z__namespace.literal("context-usage"),
|
|
171
182
|
totalTokens: z__namespace.number(),
|
|
@@ -201,7 +212,8 @@ const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
|
201
212
|
sessionPromptSuggestionEventSchema,
|
|
202
213
|
sessionNeedsContinueEventSchema,
|
|
203
214
|
sessionStateChangedEventSchema,
|
|
204
|
-
sessionContextUsageEventSchema
|
|
215
|
+
sessionContextUsageEventSchema,
|
|
216
|
+
sessionTaskLogEventSchema
|
|
205
217
|
]);
|
|
206
218
|
const sessionEnvelopeSchema = z__namespace.object({
|
|
207
219
|
id: z__namespace.string(),
|
|
@@ -220,7 +232,7 @@ const sessionEnvelopeSchema = z__namespace.object({
|
|
|
220
232
|
path: ["role"]
|
|
221
233
|
});
|
|
222
234
|
}
|
|
223
|
-
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.ev.t === "session-state-changed" || envelope.ev.t === "context-usage") && envelope.role !== "agent") {
|
|
235
|
+
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.ev.t === "session-state-changed" || envelope.ev.t === "context-usage" || envelope.ev.t === "task-log") && envelope.role !== "agent") {
|
|
224
236
|
ctx.addIssue({
|
|
225
237
|
code: z__namespace.ZodIssueCode.custom,
|
|
226
238
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -579,6 +591,26 @@ const TurnKnowledgeExtractionSchema = z__namespace.object({
|
|
|
579
591
|
})
|
|
580
592
|
});
|
|
581
593
|
|
|
594
|
+
const VoiceTokenAllowedSchema = z__namespace.object({
|
|
595
|
+
allowed: z__namespace.literal(true),
|
|
596
|
+
token: z__namespace.string(),
|
|
597
|
+
agentId: z__namespace.string(),
|
|
598
|
+
elevenUserId: z__namespace.string(),
|
|
599
|
+
usedSeconds: z__namespace.number(),
|
|
600
|
+
limitSeconds: z__namespace.number()
|
|
601
|
+
});
|
|
602
|
+
const VoiceTokenDeniedSchema = z__namespace.object({
|
|
603
|
+
allowed: z__namespace.literal(false),
|
|
604
|
+
reason: z__namespace.enum(["voice_limit_reached", "subscription_required"]),
|
|
605
|
+
usedSeconds: z__namespace.number(),
|
|
606
|
+
limitSeconds: z__namespace.number(),
|
|
607
|
+
agentId: z__namespace.string()
|
|
608
|
+
});
|
|
609
|
+
const VoiceTokenResponseSchema = z__namespace.discriminatedUnion("allowed", [
|
|
610
|
+
VoiceTokenAllowedSchema,
|
|
611
|
+
VoiceTokenDeniedSchema
|
|
612
|
+
]);
|
|
613
|
+
|
|
582
614
|
exports.AgentMessageSchema = AgentMessageSchema;
|
|
583
615
|
exports.ApiMessageSchema = ApiMessageSchema;
|
|
584
616
|
exports.ApiUpdateMachineStateSchema = ApiUpdateMachineStateSchema;
|
|
@@ -626,6 +658,9 @@ exports.UserMessageSchema = UserMessageSchema;
|
|
|
626
658
|
exports.VersionedEncryptedValueSchema = VersionedEncryptedValueSchema;
|
|
627
659
|
exports.VersionedMachineEncryptedValueSchema = VersionedMachineEncryptedValueSchema;
|
|
628
660
|
exports.VersionedNullableEncryptedValueSchema = VersionedNullableEncryptedValueSchema;
|
|
661
|
+
exports.VoiceTokenAllowedSchema = VoiceTokenAllowedSchema;
|
|
662
|
+
exports.VoiceTokenDeniedSchema = VoiceTokenDeniedSchema;
|
|
663
|
+
exports.VoiceTokenResponseSchema = VoiceTokenResponseSchema;
|
|
629
664
|
exports.createEnvelope = createEnvelope;
|
|
630
665
|
exports.sessionContextUsageCategorySchema = sessionContextUsageCategorySchema;
|
|
631
666
|
exports.sessionContextUsageEventSchema = sessionContextUsageEventSchema;
|
|
@@ -641,6 +676,7 @@ exports.sessionStartEventSchema = sessionStartEventSchema;
|
|
|
641
676
|
exports.sessionStateChangedEventSchema = sessionStateChangedEventSchema;
|
|
642
677
|
exports.sessionStopEventSchema = sessionStopEventSchema;
|
|
643
678
|
exports.sessionTaskEndEventSchema = sessionTaskEndEventSchema;
|
|
679
|
+
exports.sessionTaskLogEventSchema = sessionTaskLogEventSchema;
|
|
644
680
|
exports.sessionTaskProgressEventSchema = sessionTaskProgressEventSchema;
|
|
645
681
|
exports.sessionTaskStartEventSchema = sessionTaskStartEventSchema;
|
|
646
682
|
exports.sessionTextEventSchema = sessionTextEventSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -192,6 +192,12 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
192
192
|
assistantMessageTokens: z.ZodNumber;
|
|
193
193
|
userMessageTokens: z.ZodNumber;
|
|
194
194
|
}, z.core.$strip>>;
|
|
195
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
196
|
+
t: z.ZodLiteral<"task-log">;
|
|
197
|
+
taskId: z.ZodString;
|
|
198
|
+
outputFile: z.ZodString;
|
|
199
|
+
chunk: z.ZodString;
|
|
200
|
+
offset: z.ZodNumber;
|
|
195
201
|
}, z.core.$strip>], "t">;
|
|
196
202
|
}, z.core.$strip>;
|
|
197
203
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -418,6 +424,12 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
418
424
|
assistantMessageTokens: z.ZodNumber;
|
|
419
425
|
userMessageTokens: z.ZodNumber;
|
|
420
426
|
}, z.core.$strip>>;
|
|
427
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
428
|
+
t: z.ZodLiteral<"task-log">;
|
|
429
|
+
taskId: z.ZodString;
|
|
430
|
+
outputFile: z.ZodString;
|
|
431
|
+
chunk: z.ZodString;
|
|
432
|
+
offset: z.ZodNumber;
|
|
421
433
|
}, z.core.$strip>], "t">;
|
|
422
434
|
}, z.core.$strip>;
|
|
423
435
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -995,6 +1007,13 @@ declare const sessionContextUsageCategorySchema: z.ZodObject<{
|
|
|
995
1007
|
tokens: z.ZodNumber;
|
|
996
1008
|
color: z.ZodOptional<z.ZodString>;
|
|
997
1009
|
}, z.core.$strip>;
|
|
1010
|
+
declare const sessionTaskLogEventSchema: z.ZodObject<{
|
|
1011
|
+
t: z.ZodLiteral<"task-log">;
|
|
1012
|
+
taskId: z.ZodString;
|
|
1013
|
+
outputFile: z.ZodString;
|
|
1014
|
+
chunk: z.ZodString;
|
|
1015
|
+
offset: z.ZodNumber;
|
|
1016
|
+
}, z.core.$strip>;
|
|
998
1017
|
declare const sessionContextUsageEventSchema: z.ZodObject<{
|
|
999
1018
|
t: z.ZodLiteral<"context-usage">;
|
|
1000
1019
|
totalTokens: z.ZodNumber;
|
|
@@ -1159,6 +1178,12 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1159
1178
|
assistantMessageTokens: z.ZodNumber;
|
|
1160
1179
|
userMessageTokens: z.ZodNumber;
|
|
1161
1180
|
}, z.core.$strip>>;
|
|
1181
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1182
|
+
t: z.ZodLiteral<"task-log">;
|
|
1183
|
+
taskId: z.ZodString;
|
|
1184
|
+
outputFile: z.ZodString;
|
|
1185
|
+
chunk: z.ZodString;
|
|
1186
|
+
offset: z.ZodNumber;
|
|
1162
1187
|
}, z.core.$strip>], "t">;
|
|
1163
1188
|
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
1164
1189
|
declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
@@ -1312,6 +1337,12 @@ declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
|
1312
1337
|
assistantMessageTokens: z.ZodNumber;
|
|
1313
1338
|
userMessageTokens: z.ZodNumber;
|
|
1314
1339
|
}, z.core.$strip>>;
|
|
1340
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1341
|
+
t: z.ZodLiteral<"task-log">;
|
|
1342
|
+
taskId: z.ZodString;
|
|
1343
|
+
outputFile: z.ZodString;
|
|
1344
|
+
chunk: z.ZodString;
|
|
1345
|
+
offset: z.ZodNumber;
|
|
1315
1346
|
}, z.core.$strip>], "t">;
|
|
1316
1347
|
}, z.core.$strip>;
|
|
1317
1348
|
type SessionEnvelope = z.infer<typeof sessionEnvelopeSchema>;
|
|
@@ -1517,8 +1548,8 @@ declare const KnowledgeEntryTypeSchema: z.ZodEnum<{
|
|
|
1517
1548
|
}>;
|
|
1518
1549
|
type KnowledgeEntryType = z.infer<typeof KnowledgeEntryTypeSchema>;
|
|
1519
1550
|
declare const KnowledgeContributorTypeSchema: z.ZodEnum<{
|
|
1520
|
-
user: "user";
|
|
1521
1551
|
session: "session";
|
|
1552
|
+
user: "user";
|
|
1522
1553
|
supervisor: "supervisor";
|
|
1523
1554
|
}>;
|
|
1524
1555
|
type KnowledgeContributorType = z.infer<typeof KnowledgeContributorTypeSchema>;
|
|
@@ -1550,8 +1581,8 @@ declare const CreateKnowledgeEntryBodySchema: z.ZodObject<{
|
|
|
1550
1581
|
warning: "warning";
|
|
1551
1582
|
}>;
|
|
1552
1583
|
contributorType: z.ZodEnum<{
|
|
1553
|
-
user: "user";
|
|
1554
1584
|
session: "session";
|
|
1585
|
+
user: "user";
|
|
1555
1586
|
supervisor: "supervisor";
|
|
1556
1587
|
}>;
|
|
1557
1588
|
action: z.ZodEnum<{
|
|
@@ -1823,5 +1854,42 @@ declare const TurnKnowledgeExtractionSchema: z.ZodObject<{
|
|
|
1823
1854
|
}, z.core.$strip>;
|
|
1824
1855
|
type TurnKnowledgeExtraction = z.infer<typeof TurnKnowledgeExtractionSchema>;
|
|
1825
1856
|
|
|
1826
|
-
|
|
1827
|
-
|
|
1857
|
+
declare const VoiceTokenAllowedSchema: z.ZodObject<{
|
|
1858
|
+
allowed: z.ZodLiteral<true>;
|
|
1859
|
+
token: z.ZodString;
|
|
1860
|
+
agentId: z.ZodString;
|
|
1861
|
+
elevenUserId: z.ZodString;
|
|
1862
|
+
usedSeconds: z.ZodNumber;
|
|
1863
|
+
limitSeconds: z.ZodNumber;
|
|
1864
|
+
}, z.core.$strip>;
|
|
1865
|
+
declare const VoiceTokenDeniedSchema: z.ZodObject<{
|
|
1866
|
+
allowed: z.ZodLiteral<false>;
|
|
1867
|
+
reason: z.ZodEnum<{
|
|
1868
|
+
voice_limit_reached: "voice_limit_reached";
|
|
1869
|
+
subscription_required: "subscription_required";
|
|
1870
|
+
}>;
|
|
1871
|
+
usedSeconds: z.ZodNumber;
|
|
1872
|
+
limitSeconds: z.ZodNumber;
|
|
1873
|
+
agentId: z.ZodString;
|
|
1874
|
+
}, z.core.$strip>;
|
|
1875
|
+
declare const VoiceTokenResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1876
|
+
allowed: z.ZodLiteral<true>;
|
|
1877
|
+
token: z.ZodString;
|
|
1878
|
+
agentId: z.ZodString;
|
|
1879
|
+
elevenUserId: z.ZodString;
|
|
1880
|
+
usedSeconds: z.ZodNumber;
|
|
1881
|
+
limitSeconds: z.ZodNumber;
|
|
1882
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1883
|
+
allowed: z.ZodLiteral<false>;
|
|
1884
|
+
reason: z.ZodEnum<{
|
|
1885
|
+
voice_limit_reached: "voice_limit_reached";
|
|
1886
|
+
subscription_required: "subscription_required";
|
|
1887
|
+
}>;
|
|
1888
|
+
usedSeconds: z.ZodNumber;
|
|
1889
|
+
limitSeconds: z.ZodNumber;
|
|
1890
|
+
agentId: z.ZodString;
|
|
1891
|
+
}, z.core.$strip>], "allowed">;
|
|
1892
|
+
type VoiceTokenResponse = z.infer<typeof VoiceTokenResponseSchema>;
|
|
1893
|
+
|
|
1894
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, CrossProjectSearchResponseSchema, CrossProjectSearchResultSchema, DaemonStateSchema, KnowledgeActionSchema, KnowledgeChainEntrySchema, KnowledgeChainRelationSchema, KnowledgeChainResponseSchema, KnowledgeConfidenceSchema, KnowledgeContributorTypeSchema, KnowledgeEntryTypeSchema, KnowledgeInjectionModeSchema, KnowledgeInjectionRequestSchema, KnowledgeInjectionResponseSchema, KnowledgeStatusSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, ProjectProfileSchema, QueryKnowledgeParamsSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, TunnelEntrySchema, TunnelProviderInfoSchema, TunnelStateSchema, TurnKnowledgeExtractionSchema, UpdateBodySchema, UpdateKnowledgeEntryBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceTokenAllowedSchema, VoiceTokenDeniedSchema, VoiceTokenResponseSchema, createEnvelope, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskLogEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
1895
|
+
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, CreateKnowledgeEntryBody, CrossProjectSearchResponse, CrossProjectSearchResult, DaemonState, KnowledgeAction, KnowledgeChainEntry, KnowledgeChainRelation, KnowledgeChainResponse, KnowledgeConfidence, KnowledgeContributorType, KnowledgeEntryType, KnowledgeInjectionMode, KnowledgeInjectionRequest, KnowledgeInjectionResponse, KnowledgeStatus, LegacyMessageContent, MachineMetadata, MessageContent, MessageMeta, ProjectProfile, QueryKnowledgeParams, SessionContextUsageEvent, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, TailscaleInfo, TailscaleServeEntry, TunnelEntry, TunnelProviderInfo, TunnelState, TurnKnowledgeExtraction, Update, UpdateBody, UpdateKnowledgeEntryBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue, VoiceTokenResponse };
|
package/dist/index.d.mts
CHANGED
|
@@ -192,6 +192,12 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
192
192
|
assistantMessageTokens: z.ZodNumber;
|
|
193
193
|
userMessageTokens: z.ZodNumber;
|
|
194
194
|
}, z.core.$strip>>;
|
|
195
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
196
|
+
t: z.ZodLiteral<"task-log">;
|
|
197
|
+
taskId: z.ZodString;
|
|
198
|
+
outputFile: z.ZodString;
|
|
199
|
+
chunk: z.ZodString;
|
|
200
|
+
offset: z.ZodNumber;
|
|
195
201
|
}, z.core.$strip>], "t">;
|
|
196
202
|
}, z.core.$strip>;
|
|
197
203
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -418,6 +424,12 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
418
424
|
assistantMessageTokens: z.ZodNumber;
|
|
419
425
|
userMessageTokens: z.ZodNumber;
|
|
420
426
|
}, z.core.$strip>>;
|
|
427
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
428
|
+
t: z.ZodLiteral<"task-log">;
|
|
429
|
+
taskId: z.ZodString;
|
|
430
|
+
outputFile: z.ZodString;
|
|
431
|
+
chunk: z.ZodString;
|
|
432
|
+
offset: z.ZodNumber;
|
|
421
433
|
}, z.core.$strip>], "t">;
|
|
422
434
|
}, z.core.$strip>;
|
|
423
435
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -995,6 +1007,13 @@ declare const sessionContextUsageCategorySchema: z.ZodObject<{
|
|
|
995
1007
|
tokens: z.ZodNumber;
|
|
996
1008
|
color: z.ZodOptional<z.ZodString>;
|
|
997
1009
|
}, z.core.$strip>;
|
|
1010
|
+
declare const sessionTaskLogEventSchema: z.ZodObject<{
|
|
1011
|
+
t: z.ZodLiteral<"task-log">;
|
|
1012
|
+
taskId: z.ZodString;
|
|
1013
|
+
outputFile: z.ZodString;
|
|
1014
|
+
chunk: z.ZodString;
|
|
1015
|
+
offset: z.ZodNumber;
|
|
1016
|
+
}, z.core.$strip>;
|
|
998
1017
|
declare const sessionContextUsageEventSchema: z.ZodObject<{
|
|
999
1018
|
t: z.ZodLiteral<"context-usage">;
|
|
1000
1019
|
totalTokens: z.ZodNumber;
|
|
@@ -1159,6 +1178,12 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1159
1178
|
assistantMessageTokens: z.ZodNumber;
|
|
1160
1179
|
userMessageTokens: z.ZodNumber;
|
|
1161
1180
|
}, z.core.$strip>>;
|
|
1181
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1182
|
+
t: z.ZodLiteral<"task-log">;
|
|
1183
|
+
taskId: z.ZodString;
|
|
1184
|
+
outputFile: z.ZodString;
|
|
1185
|
+
chunk: z.ZodString;
|
|
1186
|
+
offset: z.ZodNumber;
|
|
1162
1187
|
}, z.core.$strip>], "t">;
|
|
1163
1188
|
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
1164
1189
|
declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
@@ -1312,6 +1337,12 @@ declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
|
1312
1337
|
assistantMessageTokens: z.ZodNumber;
|
|
1313
1338
|
userMessageTokens: z.ZodNumber;
|
|
1314
1339
|
}, z.core.$strip>>;
|
|
1340
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1341
|
+
t: z.ZodLiteral<"task-log">;
|
|
1342
|
+
taskId: z.ZodString;
|
|
1343
|
+
outputFile: z.ZodString;
|
|
1344
|
+
chunk: z.ZodString;
|
|
1345
|
+
offset: z.ZodNumber;
|
|
1315
1346
|
}, z.core.$strip>], "t">;
|
|
1316
1347
|
}, z.core.$strip>;
|
|
1317
1348
|
type SessionEnvelope = z.infer<typeof sessionEnvelopeSchema>;
|
|
@@ -1517,8 +1548,8 @@ declare const KnowledgeEntryTypeSchema: z.ZodEnum<{
|
|
|
1517
1548
|
}>;
|
|
1518
1549
|
type KnowledgeEntryType = z.infer<typeof KnowledgeEntryTypeSchema>;
|
|
1519
1550
|
declare const KnowledgeContributorTypeSchema: z.ZodEnum<{
|
|
1520
|
-
user: "user";
|
|
1521
1551
|
session: "session";
|
|
1552
|
+
user: "user";
|
|
1522
1553
|
supervisor: "supervisor";
|
|
1523
1554
|
}>;
|
|
1524
1555
|
type KnowledgeContributorType = z.infer<typeof KnowledgeContributorTypeSchema>;
|
|
@@ -1550,8 +1581,8 @@ declare const CreateKnowledgeEntryBodySchema: z.ZodObject<{
|
|
|
1550
1581
|
warning: "warning";
|
|
1551
1582
|
}>;
|
|
1552
1583
|
contributorType: z.ZodEnum<{
|
|
1553
|
-
user: "user";
|
|
1554
1584
|
session: "session";
|
|
1585
|
+
user: "user";
|
|
1555
1586
|
supervisor: "supervisor";
|
|
1556
1587
|
}>;
|
|
1557
1588
|
action: z.ZodEnum<{
|
|
@@ -1823,5 +1854,42 @@ declare const TurnKnowledgeExtractionSchema: z.ZodObject<{
|
|
|
1823
1854
|
}, z.core.$strip>;
|
|
1824
1855
|
type TurnKnowledgeExtraction = z.infer<typeof TurnKnowledgeExtractionSchema>;
|
|
1825
1856
|
|
|
1826
|
-
|
|
1827
|
-
|
|
1857
|
+
declare const VoiceTokenAllowedSchema: z.ZodObject<{
|
|
1858
|
+
allowed: z.ZodLiteral<true>;
|
|
1859
|
+
token: z.ZodString;
|
|
1860
|
+
agentId: z.ZodString;
|
|
1861
|
+
elevenUserId: z.ZodString;
|
|
1862
|
+
usedSeconds: z.ZodNumber;
|
|
1863
|
+
limitSeconds: z.ZodNumber;
|
|
1864
|
+
}, z.core.$strip>;
|
|
1865
|
+
declare const VoiceTokenDeniedSchema: z.ZodObject<{
|
|
1866
|
+
allowed: z.ZodLiteral<false>;
|
|
1867
|
+
reason: z.ZodEnum<{
|
|
1868
|
+
voice_limit_reached: "voice_limit_reached";
|
|
1869
|
+
subscription_required: "subscription_required";
|
|
1870
|
+
}>;
|
|
1871
|
+
usedSeconds: z.ZodNumber;
|
|
1872
|
+
limitSeconds: z.ZodNumber;
|
|
1873
|
+
agentId: z.ZodString;
|
|
1874
|
+
}, z.core.$strip>;
|
|
1875
|
+
declare const VoiceTokenResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1876
|
+
allowed: z.ZodLiteral<true>;
|
|
1877
|
+
token: z.ZodString;
|
|
1878
|
+
agentId: z.ZodString;
|
|
1879
|
+
elevenUserId: z.ZodString;
|
|
1880
|
+
usedSeconds: z.ZodNumber;
|
|
1881
|
+
limitSeconds: z.ZodNumber;
|
|
1882
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1883
|
+
allowed: z.ZodLiteral<false>;
|
|
1884
|
+
reason: z.ZodEnum<{
|
|
1885
|
+
voice_limit_reached: "voice_limit_reached";
|
|
1886
|
+
subscription_required: "subscription_required";
|
|
1887
|
+
}>;
|
|
1888
|
+
usedSeconds: z.ZodNumber;
|
|
1889
|
+
limitSeconds: z.ZodNumber;
|
|
1890
|
+
agentId: z.ZodString;
|
|
1891
|
+
}, z.core.$strip>], "allowed">;
|
|
1892
|
+
type VoiceTokenResponse = z.infer<typeof VoiceTokenResponseSchema>;
|
|
1893
|
+
|
|
1894
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, CrossProjectSearchResponseSchema, CrossProjectSearchResultSchema, DaemonStateSchema, KnowledgeActionSchema, KnowledgeChainEntrySchema, KnowledgeChainRelationSchema, KnowledgeChainResponseSchema, KnowledgeConfidenceSchema, KnowledgeContributorTypeSchema, KnowledgeEntryTypeSchema, KnowledgeInjectionModeSchema, KnowledgeInjectionRequestSchema, KnowledgeInjectionResponseSchema, KnowledgeStatusSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, ProjectProfileSchema, QueryKnowledgeParamsSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, TunnelEntrySchema, TunnelProviderInfoSchema, TunnelStateSchema, TurnKnowledgeExtractionSchema, UpdateBodySchema, UpdateKnowledgeEntryBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceTokenAllowedSchema, VoiceTokenDeniedSchema, VoiceTokenResponseSchema, createEnvelope, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskLogEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
1895
|
+
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, CreateKnowledgeEntryBody, CrossProjectSearchResponse, CrossProjectSearchResult, DaemonState, KnowledgeAction, KnowledgeChainEntry, KnowledgeChainRelation, KnowledgeChainResponse, KnowledgeConfidence, KnowledgeContributorType, KnowledgeEntryType, KnowledgeInjectionMode, KnowledgeInjectionRequest, KnowledgeInjectionResponse, KnowledgeStatus, LegacyMessageContent, MachineMetadata, MessageContent, MessageMeta, ProjectProfile, QueryKnowledgeParams, SessionContextUsageEvent, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, TailscaleInfo, TailscaleServeEntry, TunnelEntry, TunnelProviderInfo, TunnelState, TurnKnowledgeExtraction, Update, UpdateBody, UpdateKnowledgeEntryBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue, VoiceTokenResponse };
|
package/dist/index.mjs
CHANGED
|
@@ -145,6 +145,17 @@ const sessionContextUsageCategorySchema = z.object({
|
|
|
145
145
|
tokens: z.number(),
|
|
146
146
|
color: z.string().optional()
|
|
147
147
|
});
|
|
148
|
+
const sessionTaskLogEventSchema = z.object({
|
|
149
|
+
t: z.literal("task-log"),
|
|
150
|
+
/** Background task ID or tool call ID that owns this log stream */
|
|
151
|
+
taskId: z.string(),
|
|
152
|
+
/** Path to the output file on the CLI machine */
|
|
153
|
+
outputFile: z.string(),
|
|
154
|
+
/** Incremental log content (new lines since last push) */
|
|
155
|
+
chunk: z.string(),
|
|
156
|
+
/** Byte offset in the output file where this chunk starts */
|
|
157
|
+
offset: z.number()
|
|
158
|
+
});
|
|
148
159
|
const sessionContextUsageEventSchema = z.object({
|
|
149
160
|
t: z.literal("context-usage"),
|
|
150
161
|
totalTokens: z.number(),
|
|
@@ -180,7 +191,8 @@ const sessionEventSchema = z.discriminatedUnion("t", [
|
|
|
180
191
|
sessionPromptSuggestionEventSchema,
|
|
181
192
|
sessionNeedsContinueEventSchema,
|
|
182
193
|
sessionStateChangedEventSchema,
|
|
183
|
-
sessionContextUsageEventSchema
|
|
194
|
+
sessionContextUsageEventSchema,
|
|
195
|
+
sessionTaskLogEventSchema
|
|
184
196
|
]);
|
|
185
197
|
const sessionEnvelopeSchema = z.object({
|
|
186
198
|
id: z.string(),
|
|
@@ -199,7 +211,7 @@ const sessionEnvelopeSchema = z.object({
|
|
|
199
211
|
path: ["role"]
|
|
200
212
|
});
|
|
201
213
|
}
|
|
202
|
-
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.ev.t === "session-state-changed" || envelope.ev.t === "context-usage") && envelope.role !== "agent") {
|
|
214
|
+
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.ev.t === "session-state-changed" || envelope.ev.t === "context-usage" || envelope.ev.t === "task-log") && envelope.role !== "agent") {
|
|
203
215
|
ctx.addIssue({
|
|
204
216
|
code: z.ZodIssueCode.custom,
|
|
205
217
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -558,4 +570,24 @@ const TurnKnowledgeExtractionSchema = z.object({
|
|
|
558
570
|
})
|
|
559
571
|
});
|
|
560
572
|
|
|
561
|
-
|
|
573
|
+
const VoiceTokenAllowedSchema = z.object({
|
|
574
|
+
allowed: z.literal(true),
|
|
575
|
+
token: z.string(),
|
|
576
|
+
agentId: z.string(),
|
|
577
|
+
elevenUserId: z.string(),
|
|
578
|
+
usedSeconds: z.number(),
|
|
579
|
+
limitSeconds: z.number()
|
|
580
|
+
});
|
|
581
|
+
const VoiceTokenDeniedSchema = z.object({
|
|
582
|
+
allowed: z.literal(false),
|
|
583
|
+
reason: z.enum(["voice_limit_reached", "subscription_required"]),
|
|
584
|
+
usedSeconds: z.number(),
|
|
585
|
+
limitSeconds: z.number(),
|
|
586
|
+
agentId: z.string()
|
|
587
|
+
});
|
|
588
|
+
const VoiceTokenResponseSchema = z.discriminatedUnion("allowed", [
|
|
589
|
+
VoiceTokenAllowedSchema,
|
|
590
|
+
VoiceTokenDeniedSchema
|
|
591
|
+
]);
|
|
592
|
+
|
|
593
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, CrossProjectSearchResponseSchema, CrossProjectSearchResultSchema, DaemonStateSchema, KnowledgeActionSchema, KnowledgeChainEntrySchema, KnowledgeChainRelationSchema, KnowledgeChainResponseSchema, KnowledgeConfidenceSchema, KnowledgeContributorTypeSchema, KnowledgeEntryTypeSchema, KnowledgeInjectionModeSchema, KnowledgeInjectionRequestSchema, KnowledgeInjectionResponseSchema, KnowledgeStatusSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, ProjectProfileSchema, QueryKnowledgeParamsSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, TunnelEntrySchema, TunnelProviderInfoSchema, TunnelStateSchema, TurnKnowledgeExtractionSchema, UpdateBodySchema, UpdateKnowledgeEntryBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceTokenAllowedSchema, VoiceTokenDeniedSchema, VoiceTokenResponseSchema, createEnvelope, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskLogEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|