@kmmao/happy-wire 0.5.0 → 0.7.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 +70 -2
- package/dist/index.d.cts +241 -2
- package/dist/index.d.mts +241 -2
- package/dist/index.mjs +64 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -161,6 +161,28 @@ const sessionStateChangedEventSchema = z__namespace.object({
|
|
|
161
161
|
/** Authoritative session lifecycle state from the SDK */
|
|
162
162
|
state: z__namespace.enum(["idle", "running", "requires_action"])
|
|
163
163
|
});
|
|
164
|
+
const sessionContextUsageCategorySchema = z__namespace.object({
|
|
165
|
+
name: z__namespace.string(),
|
|
166
|
+
tokens: z__namespace.number(),
|
|
167
|
+
color: z__namespace.string().optional()
|
|
168
|
+
});
|
|
169
|
+
const sessionContextUsageEventSchema = z__namespace.object({
|
|
170
|
+
t: z__namespace.literal("context-usage"),
|
|
171
|
+
totalTokens: z__namespace.number(),
|
|
172
|
+
maxTokens: z__namespace.number(),
|
|
173
|
+
percentage: z__namespace.number(),
|
|
174
|
+
model: z__namespace.string().optional(),
|
|
175
|
+
categories: z__namespace.array(sessionContextUsageCategorySchema).optional(),
|
|
176
|
+
isAutoCompactEnabled: z__namespace.boolean().optional(),
|
|
177
|
+
autoCompactThreshold: z__namespace.number().optional(),
|
|
178
|
+
messageBreakdown: z__namespace.object({
|
|
179
|
+
toolCallTokens: z__namespace.number(),
|
|
180
|
+
toolResultTokens: z__namespace.number(),
|
|
181
|
+
attachmentTokens: z__namespace.number(),
|
|
182
|
+
assistantMessageTokens: z__namespace.number(),
|
|
183
|
+
userMessageTokens: z__namespace.number()
|
|
184
|
+
}).optional()
|
|
185
|
+
});
|
|
164
186
|
const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
165
187
|
sessionTextEventSchema,
|
|
166
188
|
sessionServiceMessageEventSchema,
|
|
@@ -178,7 +200,8 @@ const sessionEventSchema = z__namespace.discriminatedUnion("t", [
|
|
|
178
200
|
sessionToolProgressEventSchema,
|
|
179
201
|
sessionPromptSuggestionEventSchema,
|
|
180
202
|
sessionNeedsContinueEventSchema,
|
|
181
|
-
sessionStateChangedEventSchema
|
|
203
|
+
sessionStateChangedEventSchema,
|
|
204
|
+
sessionContextUsageEventSchema
|
|
182
205
|
]);
|
|
183
206
|
const sessionEnvelopeSchema = z__namespace.object({
|
|
184
207
|
id: z__namespace.string(),
|
|
@@ -197,7 +220,7 @@ const sessionEnvelopeSchema = z__namespace.object({
|
|
|
197
220
|
path: ["role"]
|
|
198
221
|
});
|
|
199
222
|
}
|
|
200
|
-
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.role !== "agent") {
|
|
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") {
|
|
201
224
|
ctx.addIssue({
|
|
202
225
|
code: z__namespace.ZodIssueCode.custom,
|
|
203
226
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -501,6 +524,44 @@ const KnowledgeInjectionResponseSchema = z__namespace.object({
|
|
|
501
524
|
createdAt: z__namespace.string()
|
|
502
525
|
}))
|
|
503
526
|
});
|
|
527
|
+
const KnowledgeChainRelationSchema = z__namespace.object({
|
|
528
|
+
from: z__namespace.string(),
|
|
529
|
+
to: z__namespace.string(),
|
|
530
|
+
type: z__namespace.enum(["supersedes", "related"])
|
|
531
|
+
});
|
|
532
|
+
const KnowledgeChainEntrySchema = z__namespace.object({
|
|
533
|
+
id: z__namespace.string(),
|
|
534
|
+
entryType: KnowledgeEntryTypeSchema,
|
|
535
|
+
action: KnowledgeActionSchema,
|
|
536
|
+
status: KnowledgeStatusSchema,
|
|
537
|
+
title: z__namespace.string(),
|
|
538
|
+
content: z__namespace.string(),
|
|
539
|
+
tags: z__namespace.array(z__namespace.string()),
|
|
540
|
+
confidence: KnowledgeConfidenceSchema,
|
|
541
|
+
supersedesId: z__namespace.string().nullable(),
|
|
542
|
+
createdAt: z__namespace.string()
|
|
543
|
+
});
|
|
544
|
+
const KnowledgeChainResponseSchema = z__namespace.object({
|
|
545
|
+
chain: z__namespace.array(KnowledgeChainEntrySchema),
|
|
546
|
+
relations: z__namespace.array(KnowledgeChainRelationSchema)
|
|
547
|
+
});
|
|
548
|
+
const CrossProjectSearchResultSchema = z__namespace.object({
|
|
549
|
+
id: z__namespace.string(),
|
|
550
|
+
projectId: z__namespace.string(),
|
|
551
|
+
projectPath: z__namespace.string(),
|
|
552
|
+
entryType: KnowledgeEntryTypeSchema,
|
|
553
|
+
title: z__namespace.string(),
|
|
554
|
+
content: z__namespace.string(),
|
|
555
|
+
tags: z__namespace.array(z__namespace.string()),
|
|
556
|
+
confidence: KnowledgeConfidenceSchema,
|
|
557
|
+
similarity: z__namespace.number().optional(),
|
|
558
|
+
// Present when using semantic search
|
|
559
|
+
createdAt: z__namespace.string()
|
|
560
|
+
});
|
|
561
|
+
const CrossProjectSearchResponseSchema = z__namespace.object({
|
|
562
|
+
results: z__namespace.array(CrossProjectSearchResultSchema),
|
|
563
|
+
total: z__namespace.number()
|
|
564
|
+
});
|
|
504
565
|
const TurnKnowledgeExtractionSchema = z__namespace.object({
|
|
505
566
|
projectId: z__namespace.string(),
|
|
506
567
|
sessionId: z__namespace.string(),
|
|
@@ -526,8 +587,13 @@ exports.ApiUpdateSessionStateSchema = ApiUpdateSessionStateSchema;
|
|
|
526
587
|
exports.CoreUpdateBodySchema = CoreUpdateBodySchema;
|
|
527
588
|
exports.CoreUpdateContainerSchema = CoreUpdateContainerSchema;
|
|
528
589
|
exports.CreateKnowledgeEntryBodySchema = CreateKnowledgeEntryBodySchema;
|
|
590
|
+
exports.CrossProjectSearchResponseSchema = CrossProjectSearchResponseSchema;
|
|
591
|
+
exports.CrossProjectSearchResultSchema = CrossProjectSearchResultSchema;
|
|
529
592
|
exports.DaemonStateSchema = DaemonStateSchema;
|
|
530
593
|
exports.KnowledgeActionSchema = KnowledgeActionSchema;
|
|
594
|
+
exports.KnowledgeChainEntrySchema = KnowledgeChainEntrySchema;
|
|
595
|
+
exports.KnowledgeChainRelationSchema = KnowledgeChainRelationSchema;
|
|
596
|
+
exports.KnowledgeChainResponseSchema = KnowledgeChainResponseSchema;
|
|
531
597
|
exports.KnowledgeConfidenceSchema = KnowledgeConfidenceSchema;
|
|
532
598
|
exports.KnowledgeContributorTypeSchema = KnowledgeContributorTypeSchema;
|
|
533
599
|
exports.KnowledgeEntryTypeSchema = KnowledgeEntryTypeSchema;
|
|
@@ -561,6 +627,8 @@ exports.VersionedEncryptedValueSchema = VersionedEncryptedValueSchema;
|
|
|
561
627
|
exports.VersionedMachineEncryptedValueSchema = VersionedMachineEncryptedValueSchema;
|
|
562
628
|
exports.VersionedNullableEncryptedValueSchema = VersionedNullableEncryptedValueSchema;
|
|
563
629
|
exports.createEnvelope = createEnvelope;
|
|
630
|
+
exports.sessionContextUsageCategorySchema = sessionContextUsageCategorySchema;
|
|
631
|
+
exports.sessionContextUsageEventSchema = sessionContextUsageEventSchema;
|
|
564
632
|
exports.sessionEnvelopeSchema = sessionEnvelopeSchema;
|
|
565
633
|
exports.sessionEventSchema = sessionEventSchema;
|
|
566
634
|
exports.sessionFileEventSchema = sessionFileEventSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -172,6 +172,26 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
172
172
|
running: "running";
|
|
173
173
|
requires_action: "requires_action";
|
|
174
174
|
}>;
|
|
175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
+
t: z.ZodLiteral<"context-usage">;
|
|
177
|
+
totalTokens: z.ZodNumber;
|
|
178
|
+
maxTokens: z.ZodNumber;
|
|
179
|
+
percentage: z.ZodNumber;
|
|
180
|
+
model: z.ZodOptional<z.ZodString>;
|
|
181
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
tokens: z.ZodNumber;
|
|
184
|
+
color: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>>>;
|
|
186
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
toolCallTokens: z.ZodNumber;
|
|
190
|
+
toolResultTokens: z.ZodNumber;
|
|
191
|
+
attachmentTokens: z.ZodNumber;
|
|
192
|
+
assistantMessageTokens: z.ZodNumber;
|
|
193
|
+
userMessageTokens: z.ZodNumber;
|
|
194
|
+
}, z.core.$strip>>;
|
|
175
195
|
}, z.core.$strip>], "t">;
|
|
176
196
|
}, z.core.$strip>;
|
|
177
197
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -378,6 +398,26 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
378
398
|
running: "running";
|
|
379
399
|
requires_action: "requires_action";
|
|
380
400
|
}>;
|
|
401
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
402
|
+
t: z.ZodLiteral<"context-usage">;
|
|
403
|
+
totalTokens: z.ZodNumber;
|
|
404
|
+
maxTokens: z.ZodNumber;
|
|
405
|
+
percentage: z.ZodNumber;
|
|
406
|
+
model: z.ZodOptional<z.ZodString>;
|
|
407
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
408
|
+
name: z.ZodString;
|
|
409
|
+
tokens: z.ZodNumber;
|
|
410
|
+
color: z.ZodOptional<z.ZodString>;
|
|
411
|
+
}, z.core.$strip>>>;
|
|
412
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
413
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
414
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
415
|
+
toolCallTokens: z.ZodNumber;
|
|
416
|
+
toolResultTokens: z.ZodNumber;
|
|
417
|
+
attachmentTokens: z.ZodNumber;
|
|
418
|
+
assistantMessageTokens: z.ZodNumber;
|
|
419
|
+
userMessageTokens: z.ZodNumber;
|
|
420
|
+
}, z.core.$strip>>;
|
|
381
421
|
}, z.core.$strip>], "t">;
|
|
382
422
|
}, z.core.$strip>;
|
|
383
423
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -950,6 +990,33 @@ declare const sessionStateChangedEventSchema: z.ZodObject<{
|
|
|
950
990
|
requires_action: "requires_action";
|
|
951
991
|
}>;
|
|
952
992
|
}, z.core.$strip>;
|
|
993
|
+
declare const sessionContextUsageCategorySchema: z.ZodObject<{
|
|
994
|
+
name: z.ZodString;
|
|
995
|
+
tokens: z.ZodNumber;
|
|
996
|
+
color: z.ZodOptional<z.ZodString>;
|
|
997
|
+
}, z.core.$strip>;
|
|
998
|
+
declare const sessionContextUsageEventSchema: z.ZodObject<{
|
|
999
|
+
t: z.ZodLiteral<"context-usage">;
|
|
1000
|
+
totalTokens: z.ZodNumber;
|
|
1001
|
+
maxTokens: z.ZodNumber;
|
|
1002
|
+
percentage: z.ZodNumber;
|
|
1003
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1004
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1005
|
+
name: z.ZodString;
|
|
1006
|
+
tokens: z.ZodNumber;
|
|
1007
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1008
|
+
}, z.core.$strip>>>;
|
|
1009
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1010
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1011
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
1012
|
+
toolCallTokens: z.ZodNumber;
|
|
1013
|
+
toolResultTokens: z.ZodNumber;
|
|
1014
|
+
attachmentTokens: z.ZodNumber;
|
|
1015
|
+
assistantMessageTokens: z.ZodNumber;
|
|
1016
|
+
userMessageTokens: z.ZodNumber;
|
|
1017
|
+
}, z.core.$strip>>;
|
|
1018
|
+
}, z.core.$strip>;
|
|
1019
|
+
type SessionContextUsageEvent = z.infer<typeof sessionContextUsageEventSchema>;
|
|
953
1020
|
declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
954
1021
|
t: z.ZodLiteral<"text">;
|
|
955
1022
|
text: z.ZodString;
|
|
@@ -1072,6 +1139,26 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1072
1139
|
running: "running";
|
|
1073
1140
|
requires_action: "requires_action";
|
|
1074
1141
|
}>;
|
|
1142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1143
|
+
t: z.ZodLiteral<"context-usage">;
|
|
1144
|
+
totalTokens: z.ZodNumber;
|
|
1145
|
+
maxTokens: z.ZodNumber;
|
|
1146
|
+
percentage: z.ZodNumber;
|
|
1147
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1148
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1149
|
+
name: z.ZodString;
|
|
1150
|
+
tokens: z.ZodNumber;
|
|
1151
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1152
|
+
}, z.core.$strip>>>;
|
|
1153
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1154
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1155
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
1156
|
+
toolCallTokens: z.ZodNumber;
|
|
1157
|
+
toolResultTokens: z.ZodNumber;
|
|
1158
|
+
attachmentTokens: z.ZodNumber;
|
|
1159
|
+
assistantMessageTokens: z.ZodNumber;
|
|
1160
|
+
userMessageTokens: z.ZodNumber;
|
|
1161
|
+
}, z.core.$strip>>;
|
|
1075
1162
|
}, z.core.$strip>], "t">;
|
|
1076
1163
|
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
1077
1164
|
declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
@@ -1205,6 +1292,26 @@ declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
|
1205
1292
|
running: "running";
|
|
1206
1293
|
requires_action: "requires_action";
|
|
1207
1294
|
}>;
|
|
1295
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1296
|
+
t: z.ZodLiteral<"context-usage">;
|
|
1297
|
+
totalTokens: z.ZodNumber;
|
|
1298
|
+
maxTokens: z.ZodNumber;
|
|
1299
|
+
percentage: z.ZodNumber;
|
|
1300
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1301
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1302
|
+
name: z.ZodString;
|
|
1303
|
+
tokens: z.ZodNumber;
|
|
1304
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1305
|
+
}, z.core.$strip>>>;
|
|
1306
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1307
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1308
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
1309
|
+
toolCallTokens: z.ZodNumber;
|
|
1310
|
+
toolResultTokens: z.ZodNumber;
|
|
1311
|
+
attachmentTokens: z.ZodNumber;
|
|
1312
|
+
assistantMessageTokens: z.ZodNumber;
|
|
1313
|
+
userMessageTokens: z.ZodNumber;
|
|
1314
|
+
}, z.core.$strip>>;
|
|
1208
1315
|
}, z.core.$strip>], "t">;
|
|
1209
1316
|
}, z.core.$strip>;
|
|
1210
1317
|
type SessionEnvelope = z.infer<typeof sessionEnvelopeSchema>;
|
|
@@ -1563,6 +1670,138 @@ declare const KnowledgeInjectionResponseSchema: z.ZodObject<{
|
|
|
1563
1670
|
}, z.core.$strip>>;
|
|
1564
1671
|
}, z.core.$strip>;
|
|
1565
1672
|
type KnowledgeInjectionResponse = z.infer<typeof KnowledgeInjectionResponseSchema>;
|
|
1673
|
+
declare const KnowledgeChainRelationSchema: z.ZodObject<{
|
|
1674
|
+
from: z.ZodString;
|
|
1675
|
+
to: z.ZodString;
|
|
1676
|
+
type: z.ZodEnum<{
|
|
1677
|
+
supersedes: "supersedes";
|
|
1678
|
+
related: "related";
|
|
1679
|
+
}>;
|
|
1680
|
+
}, z.core.$strip>;
|
|
1681
|
+
type KnowledgeChainRelation = z.infer<typeof KnowledgeChainRelationSchema>;
|
|
1682
|
+
declare const KnowledgeChainEntrySchema: z.ZodObject<{
|
|
1683
|
+
id: z.ZodString;
|
|
1684
|
+
entryType: z.ZodEnum<{
|
|
1685
|
+
discovery: "discovery";
|
|
1686
|
+
decision: "decision";
|
|
1687
|
+
fix: "fix";
|
|
1688
|
+
convention: "convention";
|
|
1689
|
+
warning: "warning";
|
|
1690
|
+
}>;
|
|
1691
|
+
action: z.ZodEnum<{
|
|
1692
|
+
create: "create";
|
|
1693
|
+
amend: "amend";
|
|
1694
|
+
supersede: "supersede";
|
|
1695
|
+
verify: "verify";
|
|
1696
|
+
}>;
|
|
1697
|
+
status: z.ZodEnum<{
|
|
1698
|
+
active: "active";
|
|
1699
|
+
superseded: "superseded";
|
|
1700
|
+
archived: "archived";
|
|
1701
|
+
}>;
|
|
1702
|
+
title: z.ZodString;
|
|
1703
|
+
content: z.ZodString;
|
|
1704
|
+
tags: z.ZodArray<z.ZodString>;
|
|
1705
|
+
confidence: z.ZodEnum<{
|
|
1706
|
+
high: "high";
|
|
1707
|
+
medium: "medium";
|
|
1708
|
+
low: "low";
|
|
1709
|
+
}>;
|
|
1710
|
+
supersedesId: z.ZodNullable<z.ZodString>;
|
|
1711
|
+
createdAt: z.ZodString;
|
|
1712
|
+
}, z.core.$strip>;
|
|
1713
|
+
type KnowledgeChainEntry = z.infer<typeof KnowledgeChainEntrySchema>;
|
|
1714
|
+
declare const KnowledgeChainResponseSchema: z.ZodObject<{
|
|
1715
|
+
chain: z.ZodArray<z.ZodObject<{
|
|
1716
|
+
id: z.ZodString;
|
|
1717
|
+
entryType: z.ZodEnum<{
|
|
1718
|
+
discovery: "discovery";
|
|
1719
|
+
decision: "decision";
|
|
1720
|
+
fix: "fix";
|
|
1721
|
+
convention: "convention";
|
|
1722
|
+
warning: "warning";
|
|
1723
|
+
}>;
|
|
1724
|
+
action: z.ZodEnum<{
|
|
1725
|
+
create: "create";
|
|
1726
|
+
amend: "amend";
|
|
1727
|
+
supersede: "supersede";
|
|
1728
|
+
verify: "verify";
|
|
1729
|
+
}>;
|
|
1730
|
+
status: z.ZodEnum<{
|
|
1731
|
+
active: "active";
|
|
1732
|
+
superseded: "superseded";
|
|
1733
|
+
archived: "archived";
|
|
1734
|
+
}>;
|
|
1735
|
+
title: z.ZodString;
|
|
1736
|
+
content: z.ZodString;
|
|
1737
|
+
tags: z.ZodArray<z.ZodString>;
|
|
1738
|
+
confidence: z.ZodEnum<{
|
|
1739
|
+
high: "high";
|
|
1740
|
+
medium: "medium";
|
|
1741
|
+
low: "low";
|
|
1742
|
+
}>;
|
|
1743
|
+
supersedesId: z.ZodNullable<z.ZodString>;
|
|
1744
|
+
createdAt: z.ZodString;
|
|
1745
|
+
}, z.core.$strip>>;
|
|
1746
|
+
relations: z.ZodArray<z.ZodObject<{
|
|
1747
|
+
from: z.ZodString;
|
|
1748
|
+
to: z.ZodString;
|
|
1749
|
+
type: z.ZodEnum<{
|
|
1750
|
+
supersedes: "supersedes";
|
|
1751
|
+
related: "related";
|
|
1752
|
+
}>;
|
|
1753
|
+
}, z.core.$strip>>;
|
|
1754
|
+
}, z.core.$strip>;
|
|
1755
|
+
type KnowledgeChainResponse = z.infer<typeof KnowledgeChainResponseSchema>;
|
|
1756
|
+
declare const CrossProjectSearchResultSchema: z.ZodObject<{
|
|
1757
|
+
id: z.ZodString;
|
|
1758
|
+
projectId: z.ZodString;
|
|
1759
|
+
projectPath: z.ZodString;
|
|
1760
|
+
entryType: z.ZodEnum<{
|
|
1761
|
+
discovery: "discovery";
|
|
1762
|
+
decision: "decision";
|
|
1763
|
+
fix: "fix";
|
|
1764
|
+
convention: "convention";
|
|
1765
|
+
warning: "warning";
|
|
1766
|
+
}>;
|
|
1767
|
+
title: z.ZodString;
|
|
1768
|
+
content: z.ZodString;
|
|
1769
|
+
tags: z.ZodArray<z.ZodString>;
|
|
1770
|
+
confidence: z.ZodEnum<{
|
|
1771
|
+
high: "high";
|
|
1772
|
+
medium: "medium";
|
|
1773
|
+
low: "low";
|
|
1774
|
+
}>;
|
|
1775
|
+
similarity: z.ZodOptional<z.ZodNumber>;
|
|
1776
|
+
createdAt: z.ZodString;
|
|
1777
|
+
}, z.core.$strip>;
|
|
1778
|
+
type CrossProjectSearchResult = z.infer<typeof CrossProjectSearchResultSchema>;
|
|
1779
|
+
declare const CrossProjectSearchResponseSchema: z.ZodObject<{
|
|
1780
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1781
|
+
id: z.ZodString;
|
|
1782
|
+
projectId: z.ZodString;
|
|
1783
|
+
projectPath: z.ZodString;
|
|
1784
|
+
entryType: z.ZodEnum<{
|
|
1785
|
+
discovery: "discovery";
|
|
1786
|
+
decision: "decision";
|
|
1787
|
+
fix: "fix";
|
|
1788
|
+
convention: "convention";
|
|
1789
|
+
warning: "warning";
|
|
1790
|
+
}>;
|
|
1791
|
+
title: z.ZodString;
|
|
1792
|
+
content: z.ZodString;
|
|
1793
|
+
tags: z.ZodArray<z.ZodString>;
|
|
1794
|
+
confidence: z.ZodEnum<{
|
|
1795
|
+
high: "high";
|
|
1796
|
+
medium: "medium";
|
|
1797
|
+
low: "low";
|
|
1798
|
+
}>;
|
|
1799
|
+
similarity: z.ZodOptional<z.ZodNumber>;
|
|
1800
|
+
createdAt: z.ZodString;
|
|
1801
|
+
}, z.core.$strip>>;
|
|
1802
|
+
total: z.ZodNumber;
|
|
1803
|
+
}, z.core.$strip>;
|
|
1804
|
+
type CrossProjectSearchResponse = z.infer<typeof CrossProjectSearchResponseSchema>;
|
|
1566
1805
|
declare const TurnKnowledgeExtractionSchema: z.ZodObject<{
|
|
1567
1806
|
projectId: z.ZodString;
|
|
1568
1807
|
sessionId: z.ZodString;
|
|
@@ -1584,5 +1823,5 @@ declare const TurnKnowledgeExtractionSchema: z.ZodObject<{
|
|
|
1584
1823
|
}, z.core.$strip>;
|
|
1585
1824
|
type TurnKnowledgeExtraction = z.infer<typeof TurnKnowledgeExtractionSchema>;
|
|
1586
1825
|
|
|
1587
|
-
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, DaemonStateSchema, KnowledgeActionSchema, 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, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
1588
|
-
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, CreateKnowledgeEntryBody, DaemonState, KnowledgeAction, KnowledgeConfidence, KnowledgeContributorType, KnowledgeEntryType, KnowledgeInjectionMode, KnowledgeInjectionRequest, KnowledgeInjectionResponse, KnowledgeStatus, LegacyMessageContent, MachineMetadata, MessageContent, MessageMeta, ProjectProfile, QueryKnowledgeParams, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, TailscaleInfo, TailscaleServeEntry, TunnelEntry, TunnelProviderInfo, TunnelState, TurnKnowledgeExtraction, Update, UpdateBody, UpdateKnowledgeEntryBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };
|
|
1826
|
+
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, createEnvelope, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
1827
|
+
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 };
|
package/dist/index.d.mts
CHANGED
|
@@ -172,6 +172,26 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
|
172
172
|
running: "running";
|
|
173
173
|
requires_action: "requires_action";
|
|
174
174
|
}>;
|
|
175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
+
t: z.ZodLiteral<"context-usage">;
|
|
177
|
+
totalTokens: z.ZodNumber;
|
|
178
|
+
maxTokens: z.ZodNumber;
|
|
179
|
+
percentage: z.ZodNumber;
|
|
180
|
+
model: z.ZodOptional<z.ZodString>;
|
|
181
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
tokens: z.ZodNumber;
|
|
184
|
+
color: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>>>;
|
|
186
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
toolCallTokens: z.ZodNumber;
|
|
190
|
+
toolResultTokens: z.ZodNumber;
|
|
191
|
+
attachmentTokens: z.ZodNumber;
|
|
192
|
+
assistantMessageTokens: z.ZodNumber;
|
|
193
|
+
userMessageTokens: z.ZodNumber;
|
|
194
|
+
}, z.core.$strip>>;
|
|
175
195
|
}, z.core.$strip>], "t">;
|
|
176
196
|
}, z.core.$strip>;
|
|
177
197
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -378,6 +398,26 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
378
398
|
running: "running";
|
|
379
399
|
requires_action: "requires_action";
|
|
380
400
|
}>;
|
|
401
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
402
|
+
t: z.ZodLiteral<"context-usage">;
|
|
403
|
+
totalTokens: z.ZodNumber;
|
|
404
|
+
maxTokens: z.ZodNumber;
|
|
405
|
+
percentage: z.ZodNumber;
|
|
406
|
+
model: z.ZodOptional<z.ZodString>;
|
|
407
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
408
|
+
name: z.ZodString;
|
|
409
|
+
tokens: z.ZodNumber;
|
|
410
|
+
color: z.ZodOptional<z.ZodString>;
|
|
411
|
+
}, z.core.$strip>>>;
|
|
412
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
413
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
414
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
415
|
+
toolCallTokens: z.ZodNumber;
|
|
416
|
+
toolResultTokens: z.ZodNumber;
|
|
417
|
+
attachmentTokens: z.ZodNumber;
|
|
418
|
+
assistantMessageTokens: z.ZodNumber;
|
|
419
|
+
userMessageTokens: z.ZodNumber;
|
|
420
|
+
}, z.core.$strip>>;
|
|
381
421
|
}, z.core.$strip>], "t">;
|
|
382
422
|
}, z.core.$strip>;
|
|
383
423
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -950,6 +990,33 @@ declare const sessionStateChangedEventSchema: z.ZodObject<{
|
|
|
950
990
|
requires_action: "requires_action";
|
|
951
991
|
}>;
|
|
952
992
|
}, z.core.$strip>;
|
|
993
|
+
declare const sessionContextUsageCategorySchema: z.ZodObject<{
|
|
994
|
+
name: z.ZodString;
|
|
995
|
+
tokens: z.ZodNumber;
|
|
996
|
+
color: z.ZodOptional<z.ZodString>;
|
|
997
|
+
}, z.core.$strip>;
|
|
998
|
+
declare const sessionContextUsageEventSchema: z.ZodObject<{
|
|
999
|
+
t: z.ZodLiteral<"context-usage">;
|
|
1000
|
+
totalTokens: z.ZodNumber;
|
|
1001
|
+
maxTokens: z.ZodNumber;
|
|
1002
|
+
percentage: z.ZodNumber;
|
|
1003
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1004
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1005
|
+
name: z.ZodString;
|
|
1006
|
+
tokens: z.ZodNumber;
|
|
1007
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1008
|
+
}, z.core.$strip>>>;
|
|
1009
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1010
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1011
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
1012
|
+
toolCallTokens: z.ZodNumber;
|
|
1013
|
+
toolResultTokens: z.ZodNumber;
|
|
1014
|
+
attachmentTokens: z.ZodNumber;
|
|
1015
|
+
assistantMessageTokens: z.ZodNumber;
|
|
1016
|
+
userMessageTokens: z.ZodNumber;
|
|
1017
|
+
}, z.core.$strip>>;
|
|
1018
|
+
}, z.core.$strip>;
|
|
1019
|
+
type SessionContextUsageEvent = z.infer<typeof sessionContextUsageEventSchema>;
|
|
953
1020
|
declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
954
1021
|
t: z.ZodLiteral<"text">;
|
|
955
1022
|
text: z.ZodString;
|
|
@@ -1072,6 +1139,26 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1072
1139
|
running: "running";
|
|
1073
1140
|
requires_action: "requires_action";
|
|
1074
1141
|
}>;
|
|
1142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1143
|
+
t: z.ZodLiteral<"context-usage">;
|
|
1144
|
+
totalTokens: z.ZodNumber;
|
|
1145
|
+
maxTokens: z.ZodNumber;
|
|
1146
|
+
percentage: z.ZodNumber;
|
|
1147
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1148
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1149
|
+
name: z.ZodString;
|
|
1150
|
+
tokens: z.ZodNumber;
|
|
1151
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1152
|
+
}, z.core.$strip>>>;
|
|
1153
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1154
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1155
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
1156
|
+
toolCallTokens: z.ZodNumber;
|
|
1157
|
+
toolResultTokens: z.ZodNumber;
|
|
1158
|
+
attachmentTokens: z.ZodNumber;
|
|
1159
|
+
assistantMessageTokens: z.ZodNumber;
|
|
1160
|
+
userMessageTokens: z.ZodNumber;
|
|
1161
|
+
}, z.core.$strip>>;
|
|
1075
1162
|
}, z.core.$strip>], "t">;
|
|
1076
1163
|
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
1077
1164
|
declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
@@ -1205,6 +1292,26 @@ declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
|
1205
1292
|
running: "running";
|
|
1206
1293
|
requires_action: "requires_action";
|
|
1207
1294
|
}>;
|
|
1295
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1296
|
+
t: z.ZodLiteral<"context-usage">;
|
|
1297
|
+
totalTokens: z.ZodNumber;
|
|
1298
|
+
maxTokens: z.ZodNumber;
|
|
1299
|
+
percentage: z.ZodNumber;
|
|
1300
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1301
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1302
|
+
name: z.ZodString;
|
|
1303
|
+
tokens: z.ZodNumber;
|
|
1304
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1305
|
+
}, z.core.$strip>>>;
|
|
1306
|
+
isAutoCompactEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1307
|
+
autoCompactThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1308
|
+
messageBreakdown: z.ZodOptional<z.ZodObject<{
|
|
1309
|
+
toolCallTokens: z.ZodNumber;
|
|
1310
|
+
toolResultTokens: z.ZodNumber;
|
|
1311
|
+
attachmentTokens: z.ZodNumber;
|
|
1312
|
+
assistantMessageTokens: z.ZodNumber;
|
|
1313
|
+
userMessageTokens: z.ZodNumber;
|
|
1314
|
+
}, z.core.$strip>>;
|
|
1208
1315
|
}, z.core.$strip>], "t">;
|
|
1209
1316
|
}, z.core.$strip>;
|
|
1210
1317
|
type SessionEnvelope = z.infer<typeof sessionEnvelopeSchema>;
|
|
@@ -1563,6 +1670,138 @@ declare const KnowledgeInjectionResponseSchema: z.ZodObject<{
|
|
|
1563
1670
|
}, z.core.$strip>>;
|
|
1564
1671
|
}, z.core.$strip>;
|
|
1565
1672
|
type KnowledgeInjectionResponse = z.infer<typeof KnowledgeInjectionResponseSchema>;
|
|
1673
|
+
declare const KnowledgeChainRelationSchema: z.ZodObject<{
|
|
1674
|
+
from: z.ZodString;
|
|
1675
|
+
to: z.ZodString;
|
|
1676
|
+
type: z.ZodEnum<{
|
|
1677
|
+
supersedes: "supersedes";
|
|
1678
|
+
related: "related";
|
|
1679
|
+
}>;
|
|
1680
|
+
}, z.core.$strip>;
|
|
1681
|
+
type KnowledgeChainRelation = z.infer<typeof KnowledgeChainRelationSchema>;
|
|
1682
|
+
declare const KnowledgeChainEntrySchema: z.ZodObject<{
|
|
1683
|
+
id: z.ZodString;
|
|
1684
|
+
entryType: z.ZodEnum<{
|
|
1685
|
+
discovery: "discovery";
|
|
1686
|
+
decision: "decision";
|
|
1687
|
+
fix: "fix";
|
|
1688
|
+
convention: "convention";
|
|
1689
|
+
warning: "warning";
|
|
1690
|
+
}>;
|
|
1691
|
+
action: z.ZodEnum<{
|
|
1692
|
+
create: "create";
|
|
1693
|
+
amend: "amend";
|
|
1694
|
+
supersede: "supersede";
|
|
1695
|
+
verify: "verify";
|
|
1696
|
+
}>;
|
|
1697
|
+
status: z.ZodEnum<{
|
|
1698
|
+
active: "active";
|
|
1699
|
+
superseded: "superseded";
|
|
1700
|
+
archived: "archived";
|
|
1701
|
+
}>;
|
|
1702
|
+
title: z.ZodString;
|
|
1703
|
+
content: z.ZodString;
|
|
1704
|
+
tags: z.ZodArray<z.ZodString>;
|
|
1705
|
+
confidence: z.ZodEnum<{
|
|
1706
|
+
high: "high";
|
|
1707
|
+
medium: "medium";
|
|
1708
|
+
low: "low";
|
|
1709
|
+
}>;
|
|
1710
|
+
supersedesId: z.ZodNullable<z.ZodString>;
|
|
1711
|
+
createdAt: z.ZodString;
|
|
1712
|
+
}, z.core.$strip>;
|
|
1713
|
+
type KnowledgeChainEntry = z.infer<typeof KnowledgeChainEntrySchema>;
|
|
1714
|
+
declare const KnowledgeChainResponseSchema: z.ZodObject<{
|
|
1715
|
+
chain: z.ZodArray<z.ZodObject<{
|
|
1716
|
+
id: z.ZodString;
|
|
1717
|
+
entryType: z.ZodEnum<{
|
|
1718
|
+
discovery: "discovery";
|
|
1719
|
+
decision: "decision";
|
|
1720
|
+
fix: "fix";
|
|
1721
|
+
convention: "convention";
|
|
1722
|
+
warning: "warning";
|
|
1723
|
+
}>;
|
|
1724
|
+
action: z.ZodEnum<{
|
|
1725
|
+
create: "create";
|
|
1726
|
+
amend: "amend";
|
|
1727
|
+
supersede: "supersede";
|
|
1728
|
+
verify: "verify";
|
|
1729
|
+
}>;
|
|
1730
|
+
status: z.ZodEnum<{
|
|
1731
|
+
active: "active";
|
|
1732
|
+
superseded: "superseded";
|
|
1733
|
+
archived: "archived";
|
|
1734
|
+
}>;
|
|
1735
|
+
title: z.ZodString;
|
|
1736
|
+
content: z.ZodString;
|
|
1737
|
+
tags: z.ZodArray<z.ZodString>;
|
|
1738
|
+
confidence: z.ZodEnum<{
|
|
1739
|
+
high: "high";
|
|
1740
|
+
medium: "medium";
|
|
1741
|
+
low: "low";
|
|
1742
|
+
}>;
|
|
1743
|
+
supersedesId: z.ZodNullable<z.ZodString>;
|
|
1744
|
+
createdAt: z.ZodString;
|
|
1745
|
+
}, z.core.$strip>>;
|
|
1746
|
+
relations: z.ZodArray<z.ZodObject<{
|
|
1747
|
+
from: z.ZodString;
|
|
1748
|
+
to: z.ZodString;
|
|
1749
|
+
type: z.ZodEnum<{
|
|
1750
|
+
supersedes: "supersedes";
|
|
1751
|
+
related: "related";
|
|
1752
|
+
}>;
|
|
1753
|
+
}, z.core.$strip>>;
|
|
1754
|
+
}, z.core.$strip>;
|
|
1755
|
+
type KnowledgeChainResponse = z.infer<typeof KnowledgeChainResponseSchema>;
|
|
1756
|
+
declare const CrossProjectSearchResultSchema: z.ZodObject<{
|
|
1757
|
+
id: z.ZodString;
|
|
1758
|
+
projectId: z.ZodString;
|
|
1759
|
+
projectPath: z.ZodString;
|
|
1760
|
+
entryType: z.ZodEnum<{
|
|
1761
|
+
discovery: "discovery";
|
|
1762
|
+
decision: "decision";
|
|
1763
|
+
fix: "fix";
|
|
1764
|
+
convention: "convention";
|
|
1765
|
+
warning: "warning";
|
|
1766
|
+
}>;
|
|
1767
|
+
title: z.ZodString;
|
|
1768
|
+
content: z.ZodString;
|
|
1769
|
+
tags: z.ZodArray<z.ZodString>;
|
|
1770
|
+
confidence: z.ZodEnum<{
|
|
1771
|
+
high: "high";
|
|
1772
|
+
medium: "medium";
|
|
1773
|
+
low: "low";
|
|
1774
|
+
}>;
|
|
1775
|
+
similarity: z.ZodOptional<z.ZodNumber>;
|
|
1776
|
+
createdAt: z.ZodString;
|
|
1777
|
+
}, z.core.$strip>;
|
|
1778
|
+
type CrossProjectSearchResult = z.infer<typeof CrossProjectSearchResultSchema>;
|
|
1779
|
+
declare const CrossProjectSearchResponseSchema: z.ZodObject<{
|
|
1780
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1781
|
+
id: z.ZodString;
|
|
1782
|
+
projectId: z.ZodString;
|
|
1783
|
+
projectPath: z.ZodString;
|
|
1784
|
+
entryType: z.ZodEnum<{
|
|
1785
|
+
discovery: "discovery";
|
|
1786
|
+
decision: "decision";
|
|
1787
|
+
fix: "fix";
|
|
1788
|
+
convention: "convention";
|
|
1789
|
+
warning: "warning";
|
|
1790
|
+
}>;
|
|
1791
|
+
title: z.ZodString;
|
|
1792
|
+
content: z.ZodString;
|
|
1793
|
+
tags: z.ZodArray<z.ZodString>;
|
|
1794
|
+
confidence: z.ZodEnum<{
|
|
1795
|
+
high: "high";
|
|
1796
|
+
medium: "medium";
|
|
1797
|
+
low: "low";
|
|
1798
|
+
}>;
|
|
1799
|
+
similarity: z.ZodOptional<z.ZodNumber>;
|
|
1800
|
+
createdAt: z.ZodString;
|
|
1801
|
+
}, z.core.$strip>>;
|
|
1802
|
+
total: z.ZodNumber;
|
|
1803
|
+
}, z.core.$strip>;
|
|
1804
|
+
type CrossProjectSearchResponse = z.infer<typeof CrossProjectSearchResponseSchema>;
|
|
1566
1805
|
declare const TurnKnowledgeExtractionSchema: z.ZodObject<{
|
|
1567
1806
|
projectId: z.ZodString;
|
|
1568
1807
|
sessionId: z.ZodString;
|
|
@@ -1584,5 +1823,5 @@ declare const TurnKnowledgeExtractionSchema: z.ZodObject<{
|
|
|
1584
1823
|
}, z.core.$strip>;
|
|
1585
1824
|
type TurnKnowledgeExtraction = z.infer<typeof TurnKnowledgeExtractionSchema>;
|
|
1586
1825
|
|
|
1587
|
-
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, DaemonStateSchema, KnowledgeActionSchema, 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, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
1588
|
-
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, CreateKnowledgeEntryBody, DaemonState, KnowledgeAction, KnowledgeConfidence, KnowledgeContributorType, KnowledgeEntryType, KnowledgeInjectionMode, KnowledgeInjectionRequest, KnowledgeInjectionResponse, KnowledgeStatus, LegacyMessageContent, MachineMetadata, MessageContent, MessageMeta, ProjectProfile, QueryKnowledgeParams, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, TailscaleInfo, TailscaleServeEntry, TunnelEntry, TunnelProviderInfo, TunnelState, TurnKnowledgeExtraction, Update, UpdateBody, UpdateKnowledgeEntryBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };
|
|
1826
|
+
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, createEnvelope, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
1827
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -140,6 +140,28 @@ const sessionStateChangedEventSchema = z.object({
|
|
|
140
140
|
/** Authoritative session lifecycle state from the SDK */
|
|
141
141
|
state: z.enum(["idle", "running", "requires_action"])
|
|
142
142
|
});
|
|
143
|
+
const sessionContextUsageCategorySchema = z.object({
|
|
144
|
+
name: z.string(),
|
|
145
|
+
tokens: z.number(),
|
|
146
|
+
color: z.string().optional()
|
|
147
|
+
});
|
|
148
|
+
const sessionContextUsageEventSchema = z.object({
|
|
149
|
+
t: z.literal("context-usage"),
|
|
150
|
+
totalTokens: z.number(),
|
|
151
|
+
maxTokens: z.number(),
|
|
152
|
+
percentage: z.number(),
|
|
153
|
+
model: z.string().optional(),
|
|
154
|
+
categories: z.array(sessionContextUsageCategorySchema).optional(),
|
|
155
|
+
isAutoCompactEnabled: z.boolean().optional(),
|
|
156
|
+
autoCompactThreshold: z.number().optional(),
|
|
157
|
+
messageBreakdown: z.object({
|
|
158
|
+
toolCallTokens: z.number(),
|
|
159
|
+
toolResultTokens: z.number(),
|
|
160
|
+
attachmentTokens: z.number(),
|
|
161
|
+
assistantMessageTokens: z.number(),
|
|
162
|
+
userMessageTokens: z.number()
|
|
163
|
+
}).optional()
|
|
164
|
+
});
|
|
143
165
|
const sessionEventSchema = z.discriminatedUnion("t", [
|
|
144
166
|
sessionTextEventSchema,
|
|
145
167
|
sessionServiceMessageEventSchema,
|
|
@@ -157,7 +179,8 @@ const sessionEventSchema = z.discriminatedUnion("t", [
|
|
|
157
179
|
sessionToolProgressEventSchema,
|
|
158
180
|
sessionPromptSuggestionEventSchema,
|
|
159
181
|
sessionNeedsContinueEventSchema,
|
|
160
|
-
sessionStateChangedEventSchema
|
|
182
|
+
sessionStateChangedEventSchema,
|
|
183
|
+
sessionContextUsageEventSchema
|
|
161
184
|
]);
|
|
162
185
|
const sessionEnvelopeSchema = z.object({
|
|
163
186
|
id: z.string(),
|
|
@@ -176,7 +199,7 @@ const sessionEnvelopeSchema = z.object({
|
|
|
176
199
|
path: ["role"]
|
|
177
200
|
});
|
|
178
201
|
}
|
|
179
|
-
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.role !== "agent") {
|
|
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") {
|
|
180
203
|
ctx.addIssue({
|
|
181
204
|
code: z.ZodIssueCode.custom,
|
|
182
205
|
message: `${envelope.ev.t} events must use role "agent"`,
|
|
@@ -480,6 +503,44 @@ const KnowledgeInjectionResponseSchema = z.object({
|
|
|
480
503
|
createdAt: z.string()
|
|
481
504
|
}))
|
|
482
505
|
});
|
|
506
|
+
const KnowledgeChainRelationSchema = z.object({
|
|
507
|
+
from: z.string(),
|
|
508
|
+
to: z.string(),
|
|
509
|
+
type: z.enum(["supersedes", "related"])
|
|
510
|
+
});
|
|
511
|
+
const KnowledgeChainEntrySchema = z.object({
|
|
512
|
+
id: z.string(),
|
|
513
|
+
entryType: KnowledgeEntryTypeSchema,
|
|
514
|
+
action: KnowledgeActionSchema,
|
|
515
|
+
status: KnowledgeStatusSchema,
|
|
516
|
+
title: z.string(),
|
|
517
|
+
content: z.string(),
|
|
518
|
+
tags: z.array(z.string()),
|
|
519
|
+
confidence: KnowledgeConfidenceSchema,
|
|
520
|
+
supersedesId: z.string().nullable(),
|
|
521
|
+
createdAt: z.string()
|
|
522
|
+
});
|
|
523
|
+
const KnowledgeChainResponseSchema = z.object({
|
|
524
|
+
chain: z.array(KnowledgeChainEntrySchema),
|
|
525
|
+
relations: z.array(KnowledgeChainRelationSchema)
|
|
526
|
+
});
|
|
527
|
+
const CrossProjectSearchResultSchema = z.object({
|
|
528
|
+
id: z.string(),
|
|
529
|
+
projectId: z.string(),
|
|
530
|
+
projectPath: z.string(),
|
|
531
|
+
entryType: KnowledgeEntryTypeSchema,
|
|
532
|
+
title: z.string(),
|
|
533
|
+
content: z.string(),
|
|
534
|
+
tags: z.array(z.string()),
|
|
535
|
+
confidence: KnowledgeConfidenceSchema,
|
|
536
|
+
similarity: z.number().optional(),
|
|
537
|
+
// Present when using semantic search
|
|
538
|
+
createdAt: z.string()
|
|
539
|
+
});
|
|
540
|
+
const CrossProjectSearchResponseSchema = z.object({
|
|
541
|
+
results: z.array(CrossProjectSearchResultSchema),
|
|
542
|
+
total: z.number()
|
|
543
|
+
});
|
|
483
544
|
const TurnKnowledgeExtractionSchema = z.object({
|
|
484
545
|
projectId: z.string(),
|
|
485
546
|
sessionId: z.string(),
|
|
@@ -497,4 +558,4 @@ const TurnKnowledgeExtractionSchema = z.object({
|
|
|
497
558
|
})
|
|
498
559
|
});
|
|
499
560
|
|
|
500
|
-
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, DaemonStateSchema, KnowledgeActionSchema, 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, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|
|
561
|
+
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, createEnvelope, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
|