@prave/shared 1.4.14 → 1.4.16
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/schemas/install.schema.d.ts +1 -0
- package/dist/schemas/install.schema.d.ts.map +1 -1
- package/dist/schemas/intelligence.schema.d.ts +51 -0
- package/dist/schemas/intelligence.schema.d.ts.map +1 -1
- package/dist/schemas/intelligence.schema.js +31 -0
- package/dist/schemas/search.schema.d.ts +3 -0
- package/dist/schemas/search.schema.d.ts.map +1 -1
- package/dist/schemas/skill-dependency.schema.d.ts +1 -0
- package/dist/schemas/skill-dependency.schema.d.ts.map +1 -1
- package/dist/schemas/skill.schema.d.ts +71 -0
- package/dist/schemas/skill.schema.d.ts.map +1 -1
- package/dist/schemas/skill.schema.js +37 -0
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ export declare const installRowSchema: z.ZodObject<{
|
|
|
40
40
|
license: z.ZodDefault<z.ZodString>;
|
|
41
41
|
category: z.ZodNullable<z.ZodString>;
|
|
42
42
|
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
+
extracted_triggers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
43
44
|
install_count: z.ZodDefault<z.ZodNumber>;
|
|
44
45
|
bookmark_count: z.ZodDefault<z.ZodNumber>;
|
|
45
46
|
is_verified: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/install.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,4DAA4D;AAC5D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAMxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD,wDAAwD;AACxD,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"install.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/install.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,4DAA4D;AAC5D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAMxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD,wDAAwD;AACxD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAU3B,iEAAiE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjE,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,wBAAwB;IACnC,0EAA0E;;;;;;EAE1E,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
|
@@ -157,4 +157,55 @@ export declare const recordSkillUsageBySlugSchema: z.ZodObject<{
|
|
|
157
157
|
meta?: Record<string, string | number | boolean | null> | undefined;
|
|
158
158
|
}>;
|
|
159
159
|
export type RecordSkillUsageBySlugInput = z.infer<typeof recordSkillUsageBySlugSchema>;
|
|
160
|
+
/**
|
|
161
|
+
* Bulk version of `recordSkillUsageBySlug` — drives the CLI's offline
|
|
162
|
+
* telemetry-buffer flush.
|
|
163
|
+
*
|
|
164
|
+
* The PostToolUse hook on a logged-out machine buffers events as JSONL
|
|
165
|
+
* lines in `~/.prave/telemetry-queue.jsonl`. Earlier flush logic
|
|
166
|
+
* replayed them with one POST per event, which after a long offline
|
|
167
|
+
* window (1 week of heavy use → 300+ events) burned through the
|
|
168
|
+
* default 240/min/user limit and stopped mid-flush with 429s. This
|
|
169
|
+
* schema lets the CLI send up to 500 events in ONE authenticated
|
|
170
|
+
* request — server resolves each unique (slug, agent_type) pair once
|
|
171
|
+
* and batch-inserts the lot.
|
|
172
|
+
*/
|
|
173
|
+
export declare const recordSkillUsageBySlugBatchSchema: z.ZodObject<{
|
|
174
|
+
events: z.ZodArray<z.ZodObject<{
|
|
175
|
+
slug: z.ZodString;
|
|
176
|
+
trigger_phrase: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
+
triggered_at: z.ZodOptional<z.ZodString>;
|
|
178
|
+
agent_type: z.ZodOptional<z.ZodEnum<["claude", "codex", "cursor", "gemini", "cline", "amp"]>>;
|
|
179
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
slug: string;
|
|
182
|
+
agent_type?: "claude" | "codex" | "cursor" | "gemini" | "cline" | "amp" | undefined;
|
|
183
|
+
trigger_phrase?: string | null | undefined;
|
|
184
|
+
triggered_at?: string | undefined;
|
|
185
|
+
meta?: Record<string, string | number | boolean | null> | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
slug: string;
|
|
188
|
+
agent_type?: "claude" | "codex" | "cursor" | "gemini" | "cline" | "amp" | undefined;
|
|
189
|
+
trigger_phrase?: string | null | undefined;
|
|
190
|
+
triggered_at?: string | undefined;
|
|
191
|
+
meta?: Record<string, string | number | boolean | null> | undefined;
|
|
192
|
+
}>, "many">;
|
|
193
|
+
}, "strip", z.ZodTypeAny, {
|
|
194
|
+
events: {
|
|
195
|
+
slug: string;
|
|
196
|
+
agent_type?: "claude" | "codex" | "cursor" | "gemini" | "cline" | "amp" | undefined;
|
|
197
|
+
trigger_phrase?: string | null | undefined;
|
|
198
|
+
triggered_at?: string | undefined;
|
|
199
|
+
meta?: Record<string, string | number | boolean | null> | undefined;
|
|
200
|
+
}[];
|
|
201
|
+
}, {
|
|
202
|
+
events: {
|
|
203
|
+
slug: string;
|
|
204
|
+
agent_type?: "claude" | "codex" | "cursor" | "gemini" | "cline" | "amp" | undefined;
|
|
205
|
+
trigger_phrase?: string | null | undefined;
|
|
206
|
+
triggered_at?: string | undefined;
|
|
207
|
+
meta?: Record<string, string | number | boolean | null> | undefined;
|
|
208
|
+
}[];
|
|
209
|
+
}>;
|
|
210
|
+
export type RecordSkillUsageBySlugBatchInput = z.infer<typeof recordSkillUsageBySlugBatchSchema>;
|
|
160
211
|
//# 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,GA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AC,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;AAEpF;;;;;GAKG;AACH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,0GAKf,CAAA;AACb,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAUvC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEtF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB5C,CAAA;AACF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA"}
|
|
@@ -81,3 +81,34 @@ export const recordSkillUsageBySlugSchema = z.object({
|
|
|
81
81
|
agent_type: z.enum(['claude', 'codex', 'cursor', 'gemini', 'cline', 'amp']).optional(),
|
|
82
82
|
meta: usageMetaSchema,
|
|
83
83
|
});
|
|
84
|
+
/**
|
|
85
|
+
* Bulk version of `recordSkillUsageBySlug` — drives the CLI's offline
|
|
86
|
+
* telemetry-buffer flush.
|
|
87
|
+
*
|
|
88
|
+
* The PostToolUse hook on a logged-out machine buffers events as JSONL
|
|
89
|
+
* lines in `~/.prave/telemetry-queue.jsonl`. Earlier flush logic
|
|
90
|
+
* replayed them with one POST per event, which after a long offline
|
|
91
|
+
* window (1 week of heavy use → 300+ events) burned through the
|
|
92
|
+
* default 240/min/user limit and stopped mid-flush with 429s. This
|
|
93
|
+
* schema lets the CLI send up to 500 events in ONE authenticated
|
|
94
|
+
* request — server resolves each unique (slug, agent_type) pair once
|
|
95
|
+
* and batch-inserts the lot.
|
|
96
|
+
*/
|
|
97
|
+
export const recordSkillUsageBySlugBatchSchema = z.object({
|
|
98
|
+
events: z
|
|
99
|
+
.array(z.object({
|
|
100
|
+
slug: z
|
|
101
|
+
.string()
|
|
102
|
+
.min(1)
|
|
103
|
+
.max(120)
|
|
104
|
+
.regex(/^[a-z0-9][a-z0-9_-]*$/i, 'slug must be kebab/snake case'),
|
|
105
|
+
trigger_phrase: z.string().max(500).nullish(),
|
|
106
|
+
triggered_at: z.string().datetime().optional(),
|
|
107
|
+
agent_type: z
|
|
108
|
+
.enum(['claude', 'codex', 'cursor', 'gemini', 'cline', 'amp'])
|
|
109
|
+
.optional(),
|
|
110
|
+
meta: usageMetaSchema,
|
|
111
|
+
}))
|
|
112
|
+
.min(1)
|
|
113
|
+
.max(500),
|
|
114
|
+
});
|
|
@@ -15,6 +15,7 @@ export declare const skillSearchHitSchema: z.ZodObject<{
|
|
|
15
15
|
license: z.ZodDefault<z.ZodString>;
|
|
16
16
|
category: z.ZodNullable<z.ZodString>;
|
|
17
17
|
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
extracted_triggers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
18
19
|
install_count: z.ZodDefault<z.ZodNumber>;
|
|
19
20
|
bookmark_count: z.ZodDefault<z.ZodNumber>;
|
|
20
21
|
is_verified: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -118,6 +119,7 @@ export declare const skillSearchHitSchema: z.ZodObject<{
|
|
|
118
119
|
source_repo: string | null;
|
|
119
120
|
license: string;
|
|
120
121
|
tags: string[];
|
|
122
|
+
extracted_triggers: string[];
|
|
121
123
|
bookmark_count: number;
|
|
122
124
|
is_verified: boolean;
|
|
123
125
|
price_cents: number;
|
|
@@ -171,6 +173,7 @@ export declare const skillSearchHitSchema: z.ZodObject<{
|
|
|
171
173
|
visibility?: "public" | "private" | undefined;
|
|
172
174
|
license?: string | undefined;
|
|
173
175
|
tags?: string[] | undefined;
|
|
176
|
+
extracted_triggers?: string[] | undefined;
|
|
174
177
|
bookmark_count?: number | undefined;
|
|
175
178
|
is_verified?: boolean | undefined;
|
|
176
179
|
price_cents?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/search.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;GAGG;AACH,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"search.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/search.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,gDAAgD;AAChD,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,gDAAgD;AAChD,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;IAEjC,iFAAiF;;;;;;;;EAEjF,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;IAClC,kFAAkF;;IAElF,0EAA0E;;;;;;;;EAE1E,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -44,6 +44,7 @@ export declare const dependencyRowSchema: z.ZodObject<{
|
|
|
44
44
|
license: z.ZodDefault<z.ZodString>;
|
|
45
45
|
category: z.ZodNullable<z.ZodString>;
|
|
46
46
|
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
47
|
+
extracted_triggers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
47
48
|
install_count: z.ZodDefault<z.ZodNumber>;
|
|
48
49
|
bookmark_count: z.ZodDefault<z.ZodNumber>;
|
|
49
50
|
is_verified: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-dependency.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/skill-dependency.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAMhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"skill-dependency.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/skill-dependency.schema.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;;;;;;;;;;EAOnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
|
@@ -70,6 +70,17 @@ export declare const skillSchema: z.ZodObject<{
|
|
|
70
70
|
license: z.ZodDefault<z.ZodString>;
|
|
71
71
|
category: z.ZodNullable<z.ZodString>;
|
|
72
72
|
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
73
|
+
/**
|
|
74
|
+
* Server-extracted triggers — parsed from the SKILL.md content by
|
|
75
|
+
* `extract_triggers_from_md()` (migration 057). Frontmatter
|
|
76
|
+
* `triggers:` list plus prose patterns ("Load on …", "Triggers: …",
|
|
77
|
+
* "Auto-loads when …"). Recomputed on every content write via the
|
|
78
|
+
* `skills_refresh_extracted_triggers` trigger so the value never
|
|
79
|
+
* drifts. The Discover detail page renders these as chips and only
|
|
80
|
+
* falls back to tags / "Claude reads the description" when this
|
|
81
|
+
* array is empty.
|
|
82
|
+
*/
|
|
83
|
+
extracted_triggers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
73
84
|
install_count: z.ZodDefault<z.ZodNumber>;
|
|
74
85
|
bookmark_count: z.ZodDefault<z.ZodNumber>;
|
|
75
86
|
is_verified: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -182,6 +193,7 @@ export declare const skillSchema: z.ZodObject<{
|
|
|
182
193
|
source_repo: string | null;
|
|
183
194
|
license: string;
|
|
184
195
|
tags: string[];
|
|
196
|
+
extracted_triggers: string[];
|
|
185
197
|
bookmark_count: number;
|
|
186
198
|
is_verified: boolean;
|
|
187
199
|
price_cents: number;
|
|
@@ -233,6 +245,7 @@ export declare const skillSchema: z.ZodObject<{
|
|
|
233
245
|
visibility?: "public" | "private" | undefined;
|
|
234
246
|
license?: string | undefined;
|
|
235
247
|
tags?: string[] | undefined;
|
|
248
|
+
extracted_triggers?: string[] | undefined;
|
|
236
249
|
bookmark_count?: number | undefined;
|
|
237
250
|
is_verified?: boolean | undefined;
|
|
238
251
|
price_cents?: number | undefined;
|
|
@@ -494,18 +507,76 @@ export declare const autoSkillFromRepoRequestSchema: z.ZodObject<{
|
|
|
494
507
|
* behind an "Advanced" disclosure in the wizard.
|
|
495
508
|
*/
|
|
496
509
|
custom_instructions: z.ZodOptional<z.ZodString>;
|
|
510
|
+
/**
|
|
511
|
+
* Optional display name override. When empty, the generator picks
|
|
512
|
+
* a name from the README / repo title — which historically went
|
|
513
|
+
* long ("Testing Node/TypeScript API and React Web Apps") and
|
|
514
|
+
* looked terrible in the sidebar / project switcher. The wizard
|
|
515
|
+
* surfaces this on step 1 as a soft suggestion so users can
|
|
516
|
+
* shorten the title up front without round-tripping through the
|
|
517
|
+
* editor settings drawer.
|
|
518
|
+
*/
|
|
519
|
+
name: z.ZodOptional<z.ZodString>;
|
|
497
520
|
}, "strip", z.ZodTypeAny, {
|
|
498
521
|
repo_url: string;
|
|
522
|
+
name?: string | undefined;
|
|
499
523
|
category?: string | undefined;
|
|
500
524
|
focus?: string | undefined;
|
|
501
525
|
triggers?: string[] | undefined;
|
|
502
526
|
custom_instructions?: string | undefined;
|
|
503
527
|
}, {
|
|
504
528
|
repo_url: string;
|
|
529
|
+
name?: string | undefined;
|
|
505
530
|
category?: string | undefined;
|
|
506
531
|
focus?: string | undefined;
|
|
507
532
|
triggers?: string[] | undefined;
|
|
508
533
|
custom_instructions?: string | undefined;
|
|
509
534
|
}>;
|
|
510
535
|
export type AutoSkillFromRepoRequest = z.infer<typeof autoSkillFromRepoRequestSchema>;
|
|
536
|
+
/**
|
|
537
|
+
* `prave sync` previously hit GET /skills/:slug + POST /skills/:slug/install
|
|
538
|
+
* + POST /intelligence/analyze for each locally installed skill. With 85
|
|
539
|
+
* skills that's 255 requests per sync — well past the default 240/min/user
|
|
540
|
+
* cap, hitting the user mid-sync with "Too many requests" 429s. The bulk
|
|
541
|
+
* endpoint below collapses the round-trips into one request that returns
|
|
542
|
+
* every skill's content and records every install in a single DB pass.
|
|
543
|
+
*
|
|
544
|
+
* Slug cap of 250 keeps payload size reasonable (avg SKILL.md is ~4KB →
|
|
545
|
+
* ~1MB max response). Real-world libraries hit 50–150 skills so this
|
|
546
|
+
* leaves plenty of headroom without uncapped abuse risk.
|
|
547
|
+
*/
|
|
548
|
+
export declare const bulkSyncInputSchema: z.ZodObject<{
|
|
549
|
+
slugs: z.ZodArray<z.ZodString, "many">;
|
|
550
|
+
}, "strip", z.ZodTypeAny, {
|
|
551
|
+
slugs: string[];
|
|
552
|
+
}, {
|
|
553
|
+
slugs: string[];
|
|
554
|
+
}>;
|
|
555
|
+
export type BulkSyncInput = z.infer<typeof bulkSyncInputSchema>;
|
|
556
|
+
/**
|
|
557
|
+
* Per-slug result shape. Only the fields the CLI actually needs to write
|
|
558
|
+
* the file and to surface paywall errors — keeps payload tight.
|
|
559
|
+
*
|
|
560
|
+
* slug — echoed for client-side mapping
|
|
561
|
+
* content — SKILL.md body, or null when paid-and-unpurchased
|
|
562
|
+
* price_cents — 0 for free skills
|
|
563
|
+
* purchased — true if owner or has purchase receipt
|
|
564
|
+
* is_owner — true if caller authored the skill
|
|
565
|
+
* error — populated when the skill can't be installed (not found,
|
|
566
|
+
* paywalled, no content). Lets the bulk response carry
|
|
567
|
+
* per-slug failures without breaking the whole sync.
|
|
568
|
+
*/
|
|
569
|
+
export interface BulkSyncItem {
|
|
570
|
+
slug: string;
|
|
571
|
+
content: string | null;
|
|
572
|
+
price_cents: number;
|
|
573
|
+
purchased: boolean;
|
|
574
|
+
is_owner: boolean;
|
|
575
|
+
error: string | null;
|
|
576
|
+
}
|
|
577
|
+
export interface BulkSyncResponse {
|
|
578
|
+
items: BulkSyncItem[];
|
|
579
|
+
/** Slugs that couldn't be resolved at all (skill deleted, never existed). */
|
|
580
|
+
missing: string[];
|
|
581
|
+
}
|
|
511
582
|
//# sourceMappingURL=skill.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/skill.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,qBAAqB,kCAAgC,CAAA;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS1B,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,iFAAiF;AACjF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EAO5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"skill.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/skill.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,qBAAqB,kCAAgC,CAAA;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS1B,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,iFAAiF;AACjF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EAO5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,WAAW;;;;;;;;;;;;IAgBtB;;;;;;;;;OASG;;;;;;;IAQH;;;;;OAKG;;;;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;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;IAQzC;;;OAGG;;IAEH;;;;;;;OAOG;;IAEH;;;;;OAKG;;IAEH;;;;;;OAMG;;IAEH;;;;;;;;OAQG;;;;;;;;;;;;;;;;EAEH,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAIrF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB;;;;;;EAE9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB"}
|
|
@@ -39,6 +39,17 @@ export const skillSchema = z.object({
|
|
|
39
39
|
license: z.string().default('MIT'),
|
|
40
40
|
category: z.string().nullable(),
|
|
41
41
|
tags: z.array(z.string()).default([]),
|
|
42
|
+
/**
|
|
43
|
+
* Server-extracted triggers — parsed from the SKILL.md content by
|
|
44
|
+
* `extract_triggers_from_md()` (migration 057). Frontmatter
|
|
45
|
+
* `triggers:` list plus prose patterns ("Load on …", "Triggers: …",
|
|
46
|
+
* "Auto-loads when …"). Recomputed on every content write via the
|
|
47
|
+
* `skills_refresh_extracted_triggers` trigger so the value never
|
|
48
|
+
* drifts. The Discover detail page renders these as chips and only
|
|
49
|
+
* falls back to tags / "Claude reads the description" when this
|
|
50
|
+
* array is empty.
|
|
51
|
+
*/
|
|
52
|
+
extracted_triggers: z.array(z.string()).default([]),
|
|
42
53
|
install_count: z.number().int().nonnegative().default(0),
|
|
43
54
|
bookmark_count: z.number().int().nonnegative().default(0),
|
|
44
55
|
is_verified: z.boolean().default(false),
|
|
@@ -172,4 +183,30 @@ export const autoSkillFromRepoRequestSchema = z.object({
|
|
|
172
183
|
* behind an "Advanced" disclosure in the wizard.
|
|
173
184
|
*/
|
|
174
185
|
custom_instructions: z.string().min(1).max(800).optional(),
|
|
186
|
+
/**
|
|
187
|
+
* Optional display name override. When empty, the generator picks
|
|
188
|
+
* a name from the README / repo title — which historically went
|
|
189
|
+
* long ("Testing Node/TypeScript API and React Web Apps") and
|
|
190
|
+
* looked terrible in the sidebar / project switcher. The wizard
|
|
191
|
+
* surfaces this on step 1 as a soft suggestion so users can
|
|
192
|
+
* shorten the title up front without round-tripping through the
|
|
193
|
+
* editor settings drawer.
|
|
194
|
+
*/
|
|
195
|
+
name: z.string().trim().min(1).max(60).optional(),
|
|
196
|
+
});
|
|
197
|
+
/* ─── Bulk sync — used by `prave sync` ─────────────────────────── */
|
|
198
|
+
/**
|
|
199
|
+
* `prave sync` previously hit GET /skills/:slug + POST /skills/:slug/install
|
|
200
|
+
* + POST /intelligence/analyze for each locally installed skill. With 85
|
|
201
|
+
* skills that's 255 requests per sync — well past the default 240/min/user
|
|
202
|
+
* cap, hitting the user mid-sync with "Too many requests" 429s. The bulk
|
|
203
|
+
* endpoint below collapses the round-trips into one request that returns
|
|
204
|
+
* every skill's content and records every install in a single DB pass.
|
|
205
|
+
*
|
|
206
|
+
* Slug cap of 250 keeps payload size reasonable (avg SKILL.md is ~4KB →
|
|
207
|
+
* ~1MB max response). Real-world libraries hit 50–150 skills so this
|
|
208
|
+
* leaves plenty of headroom without uncapped abuse risk.
|
|
209
|
+
*/
|
|
210
|
+
export const bulkSyncInputSchema = z.object({
|
|
211
|
+
slugs: z.array(z.string().min(1).max(120)).min(1).max(250),
|
|
175
212
|
});
|