@prave/shared 0.4.0 → 1.0.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.
|
@@ -79,4 +79,40 @@ export declare const recordSkillUsageSchema: z.ZodObject<{
|
|
|
79
79
|
trigger_phrase?: string | null | undefined;
|
|
80
80
|
}>;
|
|
81
81
|
export type RecordSkillUsageInput = z.infer<typeof recordSkillUsageSchema>;
|
|
82
|
+
/**
|
|
83
|
+
* Batch-flavoured usage ingest. Used by the CLI transcript scanner — it
|
|
84
|
+
* pages through `~/.claude/projects/**\/*.jsonl` and may produce hundreds
|
|
85
|
+
* of events at once. Sending them one-by-one would burn HTTP overhead and
|
|
86
|
+
* trip rate limits, so the API accepts an array of events with explicit
|
|
87
|
+
* timestamps. The server bucket-dedupes per (skill, hour) so re-running
|
|
88
|
+
* the scanner over the same transcripts is idempotent.
|
|
89
|
+
*/
|
|
90
|
+
export declare const recordSkillUsageBatchSchema: z.ZodObject<{
|
|
91
|
+
events: z.ZodArray<z.ZodObject<{
|
|
92
|
+
skill_metadata_id: z.ZodString;
|
|
93
|
+
trigger_phrase: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
triggered_at: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
skill_metadata_id: string;
|
|
97
|
+
trigger_phrase?: string | null | undefined;
|
|
98
|
+
triggered_at?: string | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
skill_metadata_id: string;
|
|
101
|
+
trigger_phrase?: string | null | undefined;
|
|
102
|
+
triggered_at?: string | undefined;
|
|
103
|
+
}>, "many">;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
events: {
|
|
106
|
+
skill_metadata_id: string;
|
|
107
|
+
trigger_phrase?: string | null | undefined;
|
|
108
|
+
triggered_at?: string | undefined;
|
|
109
|
+
}[];
|
|
110
|
+
}, {
|
|
111
|
+
events: {
|
|
112
|
+
skill_metadata_id: string;
|
|
113
|
+
trigger_phrase?: string | null | undefined;
|
|
114
|
+
triggered_at?: string | undefined;
|
|
115
|
+
}[];
|
|
116
|
+
}>;
|
|
117
|
+
export type RecordSkillUsageBatchInput = z.infer<typeof recordSkillUsageBatchSchema>;
|
|
82
118
|
//# sourceMappingURL=intelligence.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intelligence.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/intelligence.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,eAAe,oEAAsB,CAAA;AAElD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEnF,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYpC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEhF,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"intelligence.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/intelligence.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,eAAe,oEAAsB,CAAA;AAElD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEnF,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYpC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEhF,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE1E;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;EAWtC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
|
@@ -29,3 +29,21 @@ export const recordSkillUsageSchema = z.object({
|
|
|
29
29
|
skill_metadata_id: z.string().uuid(),
|
|
30
30
|
trigger_phrase: z.string().max(500).nullish(),
|
|
31
31
|
});
|
|
32
|
+
/**
|
|
33
|
+
* Batch-flavoured usage ingest. Used by the CLI transcript scanner — it
|
|
34
|
+
* pages through `~/.claude/projects/**\/*.jsonl` and may produce hundreds
|
|
35
|
+
* of events at once. Sending them one-by-one would burn HTTP overhead and
|
|
36
|
+
* trip rate limits, so the API accepts an array of events with explicit
|
|
37
|
+
* timestamps. The server bucket-dedupes per (skill, hour) so re-running
|
|
38
|
+
* the scanner over the same transcripts is idempotent.
|
|
39
|
+
*/
|
|
40
|
+
export const recordSkillUsageBatchSchema = z.object({
|
|
41
|
+
events: z
|
|
42
|
+
.array(z.object({
|
|
43
|
+
skill_metadata_id: z.string().uuid(),
|
|
44
|
+
trigger_phrase: z.string().max(500).nullish(),
|
|
45
|
+
triggered_at: z.string().datetime().optional(),
|
|
46
|
+
}))
|
|
47
|
+
.min(1)
|
|
48
|
+
.max(500),
|
|
49
|
+
});
|