@prave/shared 0.2.0 → 0.3.1

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.
Files changed (38) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -0
  4. package/dist/lib/classify.d.ts +21 -0
  5. package/dist/lib/classify.d.ts.map +1 -0
  6. package/dist/lib/classify.js +121 -0
  7. package/dist/lib/index.d.ts +2 -0
  8. package/dist/lib/index.d.ts.map +1 -0
  9. package/dist/lib/index.js +1 -0
  10. package/dist/schemas/api-keys.schema.d.ts +71 -0
  11. package/dist/schemas/api-keys.schema.d.ts.map +1 -0
  12. package/dist/schemas/api-keys.schema.js +29 -0
  13. package/dist/schemas/credits.schema.d.ts +61 -0
  14. package/dist/schemas/credits.schema.d.ts.map +1 -0
  15. package/dist/schemas/credits.schema.js +44 -0
  16. package/dist/schemas/index.d.ts +3 -0
  17. package/dist/schemas/index.d.ts.map +1 -1
  18. package/dist/schemas/index.js +3 -0
  19. package/dist/schemas/intelligence.schema.d.ts +82 -0
  20. package/dist/schemas/intelligence.schema.d.ts.map +1 -0
  21. package/dist/schemas/intelligence.schema.js +31 -0
  22. package/dist/schemas/skill-pr.schema.d.ts +139 -0
  23. package/dist/schemas/skill-pr.schema.d.ts.map +1 -1
  24. package/dist/schemas/skill-pr.schema.js +23 -0
  25. package/dist/schemas/skill-test.schema.d.ts +4 -9
  26. package/dist/schemas/skill-test.schema.d.ts.map +1 -1
  27. package/dist/schemas/skill-test.schema.js +4 -9
  28. package/dist/types/index.d.ts +1 -0
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types/index.js +1 -0
  31. package/dist/types/intelligence.d.ts +132 -0
  32. package/dist/types/intelligence.d.ts.map +1 -0
  33. package/dist/types/intelligence.js +52 -0
  34. package/dist/types/plan-limits.js +6 -6
  35. package/package.json +1 -1
  36. package/dist/schemas/org.schema.d.ts +0 -112
  37. package/dist/schemas/org.schema.d.ts.map +0 -1
  38. package/dist/schemas/org.schema.js +0 -34
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './schemas/index.js';
2
2
  export * from './types/index.js';
3
+ export * from './lib/index.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './schemas/index.js';
2
2
  export * from './types/index.js';
3
+ export * from './lib/index.js';
@@ -0,0 +1,21 @@
1
+ import type { SkillCategory } from '@prave/shared';
2
+ /**
3
+ * Pull a yaml `category:` value out of SKILL.md frontmatter. Returns null
4
+ * when no frontmatter, no `category` key, or value isn't in the enum.
5
+ */
6
+ export declare function extractCategoryFromFrontmatter(content: string): SkillCategory | null;
7
+ /**
8
+ * Pull a yaml `description:` from SKILL.md frontmatter, if present. Used by
9
+ * the import path so frontmatter authors don't pay for AI generation.
10
+ */
11
+ export declare function extractDescriptionFromFrontmatter(content: string): string | null;
12
+ /**
13
+ * Classify a skill by frontmatter first, then by keyword score, then 'other'.
14
+ * Caller should still allow the user to override before insert.
15
+ */
16
+ export declare function classifySkill(opts: {
17
+ name?: string | null;
18
+ description?: string | null;
19
+ content?: string | null;
20
+ }): SkillCategory;
21
+ //# sourceMappingURL=classify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/lib/classify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAyClD;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CASpF;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAShF;AAkDD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB,GAAG,aAAa,CAmBhB"}
@@ -0,0 +1,121 @@
1
+ const RULES = [
2
+ { category: 'engineering', keywords: /\b(typescript|react|api|backend|frontend|database|sql|component|refactor|build|deploy|library|framework|debug|test runner)\b/i },
3
+ { category: 'devops', keywords: /\b(docker|kubernetes|k8s|ci\/cd|pipeline|terraform|ansible|helm|nginx|caddy|reverse proxy|deployment|infrastructure)\b/i },
4
+ { category: 'security', keywords: /\b(auth|jwt|oauth|xss|csrf|rbac|encryption|vulnerab|pentest|threat|owasp|sanitize|escape)\b/i },
5
+ { category: 'data', keywords: /\b(etl|airflow|warehouse|snowflake|bigquery|pipeline|ingest|elasticsearch|postgres|mongodb|redis)\b/i },
6
+ { category: 'ai', keywords: /\b(claude|gpt|llm|prompt|embedding|rag|tokeniz|fine[- ]?tune|inference|anthropic|openai|hugging.?face|model|agent)\b/i },
7
+ { category: 'design', keywords: /\b(ui|ux|figma|wireframe|mockup|color palette|typography|spacing|layout|brand|visual|prototype|usability)\b/i },
8
+ { category: 'marketing', keywords: /\b(seo|sem|cro|conversion|funnel|landing page|copywriting|ad creative|paid ads|email marketing|growth|campaign|outreach|social media|trustpilot|cold email|lead magnet)\b/i },
9
+ { category: 'analytics', keywords: /\b(analytics|metrics|dashboard|kpi|cohort|retention|attribution|event tracking|mixpanel|amplitude|posthog|ga4|google analytics)\b/i },
10
+ { category: 'research', keywords: /\b(research|interview|survey|user testing|persona|hypothesis|experiment|methodology|literature review|customer development)\b/i },
11
+ { category: 'writing', keywords: /\b(write|writing|edit|editorial|tone of voice|narrative|story|blog post|copy[- ]?edit|grammar|style guide|proofread)\b/i },
12
+ { category: 'product', keywords: /\b(product[- ]?management|roadmap|backlog|user story|epic|requirement|spec(ification)?|feature flag|prd|stakeholder|prioriti[zs]ation|jira|linear)\b/i },
13
+ { category: 'productivity', keywords: /\b(productivity|workflow|automation|task management|todo|note[- ]?taking|knowledge base|second brain|gtd|focus|inbox)\b/i },
14
+ { category: 'workflow-orchestration', keywords: /\b(orchestrat|workflow engine|state machine|saga|step function|temporal|n8n|zapier|airflow dag|orchestration)\b/i },
15
+ ];
16
+ const FRONTMATTER_RE = /^---\s*\n([\s\S]*?)\n---/;
17
+ const FALLBACK = 'other';
18
+ /**
19
+ * Pull a yaml `category:` value out of SKILL.md frontmatter. Returns null
20
+ * when no frontmatter, no `category` key, or value isn't in the enum.
21
+ */
22
+ export function extractCategoryFromFrontmatter(content) {
23
+ const match = FRONTMATTER_RE.exec(content);
24
+ if (!match)
25
+ return null;
26
+ const fm = match[1];
27
+ if (!fm)
28
+ return null;
29
+ const line = fm.split('\n').find((l) => /^\s*category\s*:/i.test(l));
30
+ if (!line)
31
+ return null;
32
+ const raw = line.split(':').slice(1).join(':').trim().replace(/^['"]|['"]$/g, '').toLowerCase();
33
+ return normalizeCategory(raw);
34
+ }
35
+ /**
36
+ * Pull a yaml `description:` from SKILL.md frontmatter, if present. Used by
37
+ * the import path so frontmatter authors don't pay for AI generation.
38
+ */
39
+ export function extractDescriptionFromFrontmatter(content) {
40
+ const match = FRONTMATTER_RE.exec(content);
41
+ if (!match)
42
+ return null;
43
+ const fm = match[1];
44
+ if (!fm)
45
+ return null;
46
+ const line = fm.split('\n').find((l) => /^\s*description\s*:/i.test(l));
47
+ if (!line)
48
+ return null;
49
+ const raw = line.split(':').slice(1).join(':').trim().replace(/^['"]|['"]$/g, '');
50
+ return raw.length >= 12 ? raw.slice(0, 280) : null;
51
+ }
52
+ const ALIASES = {
53
+ dev: 'engineering',
54
+ software: 'engineering',
55
+ coding: 'engineering',
56
+ programming: 'engineering',
57
+ ml: 'ai',
58
+ llm: 'ai',
59
+ ops: 'devops',
60
+ infra: 'devops',
61
+ infrastructure: 'devops',
62
+ ux: 'design',
63
+ ui: 'design',
64
+ growth: 'marketing',
65
+ copywriting: 'writing',
66
+ copy: 'writing',
67
+ pm: 'product',
68
+ 'product-management': 'product',
69
+ };
70
+ function normalizeCategory(raw) {
71
+ if (!raw)
72
+ return null;
73
+ const key = raw.toLowerCase().trim();
74
+ const aliased = ALIASES[key];
75
+ if (aliased)
76
+ return aliased;
77
+ // Direct match against the enum literals.
78
+ if ([
79
+ 'engineering',
80
+ 'design',
81
+ 'marketing',
82
+ 'research',
83
+ 'writing',
84
+ 'analytics',
85
+ 'productivity',
86
+ 'devops',
87
+ 'data',
88
+ 'ai',
89
+ 'security',
90
+ 'product',
91
+ 'workflow-orchestration',
92
+ 'other',
93
+ ].includes(key)) {
94
+ return key;
95
+ }
96
+ return null;
97
+ }
98
+ /**
99
+ * Classify a skill by frontmatter first, then by keyword score, then 'other'.
100
+ * Caller should still allow the user to override before insert.
101
+ */
102
+ export function classifySkill(opts) {
103
+ const text = [opts.name ?? '', opts.description ?? '', opts.content ?? ''].join('\n');
104
+ if (opts.content) {
105
+ const fm = extractCategoryFromFrontmatter(opts.content);
106
+ if (fm)
107
+ return fm;
108
+ }
109
+ let bestCategory = FALLBACK;
110
+ let bestScore = 0;
111
+ for (const rule of RULES) {
112
+ const matches = text.match(new RegExp(rule.keywords.source, 'gi'));
113
+ const score = matches ? matches.length : 0;
114
+ if (score > bestScore) {
115
+ bestScore = score;
116
+ bestCategory = rule.category;
117
+ }
118
+ }
119
+ // Require at least 2 keyword hits before committing — single hits are noisy.
120
+ return bestScore >= 2 ? bestCategory : FALLBACK;
121
+ }
@@ -0,0 +1,2 @@
1
+ export * from './classify.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './classify.js';
@@ -0,0 +1,71 @@
1
+ import { z } from 'zod';
2
+ export declare const aiProviderSchema: z.ZodEnum<["anthropic", "openai", "gemini"]>;
3
+ export type AiProvider = z.infer<typeof aiProviderSchema>;
4
+ export declare const AI_PROVIDER_LABELS: Record<AiProvider, string>;
5
+ export declare const setApiKeyInputSchema: z.ZodObject<{
6
+ provider: z.ZodEnum<["anthropic", "openai", "gemini"]>;
7
+ api_key: z.ZodString;
8
+ label: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ provider: "gemini" | "anthropic" | "openai";
11
+ api_key: string;
12
+ label?: string | undefined;
13
+ }, {
14
+ provider: "gemini" | "anthropic" | "openai";
15
+ api_key: string;
16
+ label?: string | undefined;
17
+ }>;
18
+ export type SetApiKeyInput = z.infer<typeof setApiKeyInputSchema>;
19
+ export interface UserApiKeyView {
20
+ id: string;
21
+ provider: AiProvider;
22
+ last4: string;
23
+ label: string | null;
24
+ created_at: string;
25
+ updated_at: string;
26
+ }
27
+ export declare const aiCompleteInputSchema: z.ZodObject<{
28
+ provider: z.ZodEnum<["anthropic", "openai", "gemini"]>;
29
+ before: z.ZodString;
30
+ after: z.ZodOptional<z.ZodString>;
31
+ file_type: z.ZodDefault<z.ZodEnum<["md", "json", "ts", "js", "yaml", "plain"]>>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ provider: "gemini" | "anthropic" | "openai";
34
+ before: string;
35
+ file_type: "md" | "json" | "ts" | "js" | "yaml" | "plain";
36
+ after?: string | undefined;
37
+ }, {
38
+ provider: "gemini" | "anthropic" | "openai";
39
+ before: string;
40
+ after?: string | undefined;
41
+ file_type?: "md" | "json" | "ts" | "js" | "yaml" | "plain" | undefined;
42
+ }>;
43
+ export type AiCompleteInput = z.infer<typeof aiCompleteInputSchema>;
44
+ export declare const aiGenerateInputSchema: z.ZodObject<{
45
+ provider: z.ZodEnum<["anthropic", "openai", "gemini"]>;
46
+ prompt: z.ZodString;
47
+ /** Existing skill content the user is iterating on. */
48
+ existing_content: z.ZodOptional<z.ZodString>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ prompt: string;
51
+ provider: "gemini" | "anthropic" | "openai";
52
+ existing_content?: string | undefined;
53
+ }, {
54
+ prompt: string;
55
+ provider: "gemini" | "anthropic" | "openai";
56
+ existing_content?: string | undefined;
57
+ }>;
58
+ export type AiGenerateInput = z.infer<typeof aiGenerateInputSchema>;
59
+ export interface AiCompleteResult {
60
+ completion: string;
61
+ /** Tokens consumed if the provider reports them. */
62
+ input_tokens?: number;
63
+ output_tokens?: number;
64
+ }
65
+ export interface AiGenerateResult {
66
+ /** Full SKILL.md body the editor should drop into the buffer. */
67
+ content: string;
68
+ input_tokens?: number;
69
+ output_tokens?: number;
70
+ }
71
+ //# sourceMappingURL=api-keys.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/api-keys.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,gBAAgB,8CAA4C,CAAA;AACzE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIzD,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAQ/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,UAAU,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAID,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,qBAAqB;;;IAGhC,uDAAuD;;;;;;;;;;EAEvD,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export const aiProviderSchema = z.enum(['anthropic', 'openai', 'gemini']);
3
+ export const AI_PROVIDER_LABELS = {
4
+ anthropic: 'Claude (Anthropic)',
5
+ openai: 'OpenAI',
6
+ gemini: 'Google Gemini',
7
+ };
8
+ export const setApiKeyInputSchema = z.object({
9
+ provider: aiProviderSchema,
10
+ api_key: z
11
+ .string()
12
+ .min(8, 'API key looks too short')
13
+ .max(400, 'API key looks too long')
14
+ .trim(),
15
+ label: z.string().max(80).optional(),
16
+ });
17
+ /* ── In-editor AI assistant ─────────────────────────────────────────── */
18
+ export const aiCompleteInputSchema = z.object({
19
+ provider: aiProviderSchema,
20
+ before: z.string().max(8000),
21
+ after: z.string().max(2000).optional(),
22
+ file_type: z.enum(['md', 'json', 'ts', 'js', 'yaml', 'plain']).default('md'),
23
+ });
24
+ export const aiGenerateInputSchema = z.object({
25
+ provider: aiProviderSchema,
26
+ prompt: z.string().min(8).max(4000),
27
+ /** Existing skill content the user is iterating on. */
28
+ existing_content: z.string().max(50_000).optional(),
29
+ });
@@ -0,0 +1,61 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Credit-pack catalog. One-time purchases that top up
4
+ * `profiles.tester_credits_balance`. Prices target a ≥40% gross margin
5
+ * over Haiku 4.5 worst-case usage (~€0.015/credit).
6
+ */
7
+ export declare const CREDIT_PACK_IDS: readonly ["pack_25", "pack_100"];
8
+ export declare const creditPackIdSchema: z.ZodEnum<["pack_25", "pack_100"]>;
9
+ export type CreditPackId = z.infer<typeof creditPackIdSchema>;
10
+ export interface CreditPack {
11
+ id: CreditPackId;
12
+ credits: number;
13
+ /** Gross price in EUR (VAT-inclusive — Stripe Tax computes the net split). */
14
+ price_eur: number;
15
+ /** Best-for hint shown on the pack card. */
16
+ blurb: string;
17
+ }
18
+ /**
19
+ * Two top-up tiers — entry and refill. Per-credit price is intentionally
20
+ * kept *higher* than every paid subscription so power users always come
21
+ * out ahead by upgrading instead of hoarding packs. A single big pack
22
+ * tier was tested and dropped: it created subscription cannibalisation
23
+ * (Creator @ €0.040/credit vs a hypothetical 500-pack @ €0.038/credit)
24
+ * and one-shot LTV with months of dormancy.
25
+ */
26
+ export declare const CREDIT_PACKS: Record<CreditPackId, CreditPack>;
27
+ export declare const creditCheckoutInputSchema: z.ZodObject<{
28
+ pack: z.ZodEnum<["pack_25", "pack_100"]>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ pack: "pack_25" | "pack_100";
31
+ }, {
32
+ pack: "pack_25" | "pack_100";
33
+ }>;
34
+ export type CreditCheckoutInput = z.infer<typeof creditCheckoutInputSchema>;
35
+ export declare const creditBalanceSchema: z.ZodObject<{
36
+ monthly_quota: z.ZodNumber;
37
+ monthly_used: z.ZodNumber;
38
+ monthly_remaining: z.ZodNumber;
39
+ /** Purchased top-up balance (never expires). */
40
+ balance: z.ZodNumber;
41
+ /** Total credits available right now (monthly_remaining + balance). */
42
+ total_available: z.ZodNumber;
43
+ /** ISO timestamp when the monthly window resets. */
44
+ resets_at: z.ZodString;
45
+ }, "strip", z.ZodTypeAny, {
46
+ monthly_quota: number;
47
+ monthly_used: number;
48
+ monthly_remaining: number;
49
+ balance: number;
50
+ total_available: number;
51
+ resets_at: string;
52
+ }, {
53
+ monthly_quota: number;
54
+ monthly_used: number;
55
+ monthly_remaining: number;
56
+ balance: number;
57
+ total_available: number;
58
+ resets_at: string;
59
+ }>;
60
+ export type CreditBalance = z.infer<typeof creditBalanceSchema>;
61
+ //# sourceMappingURL=credits.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credits.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/credits.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,eAAe,kCAAmC,CAAA;AAC/D,eAAO,MAAM,kBAAkB,oCAA0B,CAAA;AACzD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,YAAY,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,UAAU,CAazD,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,mBAAmB;;;;IAI9B,gDAAgD;;IAEhD,uEAAuE;;IAEvE,oDAAoD;;;;;;;;;;;;;;;;EAEpD,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Credit-pack catalog. One-time purchases that top up
4
+ * `profiles.tester_credits_balance`. Prices target a ≥40% gross margin
5
+ * over Haiku 4.5 worst-case usage (~€0.015/credit).
6
+ */
7
+ export const CREDIT_PACK_IDS = ['pack_25', 'pack_100'];
8
+ export const creditPackIdSchema = z.enum(CREDIT_PACK_IDS);
9
+ /**
10
+ * Two top-up tiers — entry and refill. Per-credit price is intentionally
11
+ * kept *higher* than every paid subscription so power users always come
12
+ * out ahead by upgrading instead of hoarding packs. A single big pack
13
+ * tier was tested and dropped: it created subscription cannibalisation
14
+ * (Creator @ €0.040/credit vs a hypothetical 500-pack @ €0.038/credit)
15
+ * and one-shot LTV with months of dormancy.
16
+ */
17
+ export const CREDIT_PACKS = {
18
+ pack_25: {
19
+ id: 'pack_25',
20
+ credits: 25,
21
+ price_eur: 2,
22
+ blurb: 'Quick top-up when you hit the wall.',
23
+ },
24
+ pack_100: {
25
+ id: 'pack_100',
26
+ credits: 100,
27
+ price_eur: 6,
28
+ blurb: 'Best value for active builders.',
29
+ },
30
+ };
31
+ export const creditCheckoutInputSchema = z.object({
32
+ pack: creditPackIdSchema,
33
+ });
34
+ export const creditBalanceSchema = z.object({
35
+ monthly_quota: z.number().int().nonnegative(),
36
+ monthly_used: z.number().int().nonnegative(),
37
+ monthly_remaining: z.number().int().nonnegative(),
38
+ /** Purchased top-up balance (never expires). */
39
+ balance: z.number().int().nonnegative(),
40
+ /** Total credits available right now (monthly_remaining + balance). */
41
+ total_available: z.number().int().nonnegative(),
42
+ /** ISO timestamp when the monthly window resets. */
43
+ resets_at: z.string().datetime(),
44
+ });
@@ -8,6 +8,9 @@ export * from './skill-dependency.schema.js';
8
8
  export * from './skill-test.schema.js';
9
9
  export * from './marketplace.schema.js';
10
10
  export * from './billing.schema.js';
11
+ export * from './credits.schema.js';
11
12
  export * from './install.schema.js';
12
13
  export * from './skill-pr.schema.js';
14
+ export * from './intelligence.schema.js';
15
+ export * from './api-keys.schema.js';
13
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA"}
@@ -8,5 +8,8 @@ export * from './skill-dependency.schema.js';
8
8
  export * from './skill-test.schema.js';
9
9
  export * from './marketplace.schema.js';
10
10
  export * from './billing.schema.js';
11
+ export * from './credits.schema.js';
11
12
  export * from './install.schema.js';
12
13
  export * from './skill-pr.schema.js';
14
+ export * from './intelligence.schema.js';
15
+ export * from './api-keys.schema.js';
@@ -0,0 +1,82 @@
1
+ import { z } from 'zod';
2
+ export declare const agentTypeSchema: z.ZodEnum<["claude", "codex", "cursor", "gemini", "cline", "amp"]>;
3
+ export declare const analyzeSkillInputSchema: z.ZodObject<{
4
+ content: z.ZodString;
5
+ file_path: z.ZodString;
6
+ skill_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
+ agent_type: z.ZodDefault<z.ZodEnum<["claude", "codex", "cursor", "gemini", "cline", "amp"]>>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ content: string;
10
+ file_path: string;
11
+ agent_type: "claude" | "codex" | "cursor" | "gemini" | "cline" | "amp";
12
+ skill_id?: string | null | undefined;
13
+ }, {
14
+ content: string;
15
+ file_path: string;
16
+ skill_id?: string | null | undefined;
17
+ agent_type?: "claude" | "codex" | "cursor" | "gemini" | "cline" | "amp" | undefined;
18
+ }>;
19
+ export type AnalyzeSkillInput = z.infer<typeof analyzeSkillInputSchema>;
20
+ export declare const intelligenceSearchInputSchema: z.ZodObject<{
21
+ query: z.ZodString;
22
+ scope: z.ZodDefault<z.ZodEnum<["local", "marketplace", "both"]>>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ query: string;
25
+ scope: "local" | "marketplace" | "both";
26
+ }, {
27
+ query: string;
28
+ scope?: "local" | "marketplace" | "both" | undefined;
29
+ }>;
30
+ export type IntelligenceSearchInput = z.infer<typeof intelligenceSearchInputSchema>;
31
+ export declare const llmSearchInputSchema: z.ZodObject<{
32
+ query: z.ZodString;
33
+ context: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ query: string;
36
+ context?: string | undefined;
37
+ }, {
38
+ query: string;
39
+ context?: string | undefined;
40
+ }>;
41
+ export type LlmSearchInput = z.infer<typeof llmSearchInputSchema>;
42
+ export declare const updateAgentSettingsSchema: z.ZodObject<{
43
+ enabled_agents: z.ZodOptional<z.ZodArray<z.ZodEnum<["claude", "codex", "cursor", "gemini", "cline", "amp"]>, "many">>;
44
+ skill_paths: z.ZodOptional<z.ZodRecord<z.ZodEnum<["claude", "codex", "cursor", "gemini", "cline", "amp"]>, z.ZodObject<{
45
+ mac: z.ZodOptional<z.ZodString>;
46
+ windows: z.ZodOptional<z.ZodString>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ mac?: string | undefined;
49
+ windows?: string | undefined;
50
+ }, {
51
+ mac?: string | undefined;
52
+ windows?: string | undefined;
53
+ }>>>;
54
+ detected_os: z.ZodOptional<z.ZodEnum<["mac", "windows", "linux"]>>;
55
+ }, "strip", z.ZodTypeAny, {
56
+ enabled_agents?: ("claude" | "codex" | "cursor" | "gemini" | "cline" | "amp")[] | undefined;
57
+ skill_paths?: Partial<Record<"claude" | "codex" | "cursor" | "gemini" | "cline" | "amp", {
58
+ mac?: string | undefined;
59
+ windows?: string | undefined;
60
+ }>> | undefined;
61
+ detected_os?: "mac" | "windows" | "linux" | undefined;
62
+ }, {
63
+ enabled_agents?: ("claude" | "codex" | "cursor" | "gemini" | "cline" | "amp")[] | undefined;
64
+ skill_paths?: Partial<Record<"claude" | "codex" | "cursor" | "gemini" | "cline" | "amp", {
65
+ mac?: string | undefined;
66
+ windows?: string | undefined;
67
+ }>> | undefined;
68
+ detected_os?: "mac" | "windows" | "linux" | undefined;
69
+ }>;
70
+ export type UpdateAgentSettingsInput = z.infer<typeof updateAgentSettingsSchema>;
71
+ export declare const recordSkillUsageSchema: z.ZodObject<{
72
+ skill_metadata_id: z.ZodString;
73
+ trigger_phrase: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ skill_metadata_id: string;
76
+ trigger_phrase?: string | null | undefined;
77
+ }, {
78
+ skill_metadata_id: string;
79
+ trigger_phrase?: string | null | undefined;
80
+ }>;
81
+ export type RecordSkillUsageInput = z.infer<typeof recordSkillUsageSchema>;
82
+ //# sourceMappingURL=intelligence.schema.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_TYPES } from '../types/intelligence.js';
3
+ export const agentTypeSchema = z.enum(AGENT_TYPES);
4
+ export const analyzeSkillInputSchema = z.object({
5
+ content: z.string().min(1).max(500_000),
6
+ file_path: z.string().min(1).max(2048),
7
+ skill_id: z.string().uuid().nullish(),
8
+ agent_type: agentTypeSchema.default('claude'),
9
+ });
10
+ export const intelligenceSearchInputSchema = z.object({
11
+ query: z.string().min(1).max(200),
12
+ scope: z.enum(['local', 'marketplace', 'both']).default('both'),
13
+ });
14
+ export const llmSearchInputSchema = z.object({
15
+ query: z.string().min(1).max(500),
16
+ context: z.string().max(2000).optional(),
17
+ });
18
+ export const updateAgentSettingsSchema = z.object({
19
+ enabled_agents: z.array(agentTypeSchema).min(1).optional(),
20
+ skill_paths: z
21
+ .record(agentTypeSchema, z.object({
22
+ mac: z.string().min(1).max(512).optional(),
23
+ windows: z.string().min(1).max(512).optional(),
24
+ }))
25
+ .optional(),
26
+ detected_os: z.enum(['mac', 'windows', 'linux']).optional(),
27
+ });
28
+ export const recordSkillUsageSchema = z.object({
29
+ skill_metadata_id: z.string().uuid(),
30
+ trigger_phrase: z.string().max(500).nullish(),
31
+ });
@@ -104,6 +104,25 @@ export declare const createPullRequestInputSchema: z.ZodObject<{
104
104
  proposed_description?: string | null | undefined;
105
105
  }>;
106
106
  export type CreatePullRequestInput = z.infer<typeof createPullRequestInputSchema>;
107
+ /**
108
+ * Author can push a new "commit" — a fresh proposed_content body — to an
109
+ * already-open PR. Same shape as create minus the title (title doesn't
110
+ * change once the PR is open).
111
+ */
112
+ export declare const updatePullRequestInputSchema: z.ZodObject<{
113
+ summary: z.ZodNullable<z.ZodOptional<z.ZodString>>;
114
+ proposed_content: z.ZodString;
115
+ proposed_description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ proposed_content: string;
118
+ summary?: string | null | undefined;
119
+ proposed_description?: string | null | undefined;
120
+ }, {
121
+ proposed_content: string;
122
+ summary?: string | null | undefined;
123
+ proposed_description?: string | null | undefined;
124
+ }>;
125
+ export type UpdatePullRequestInput = z.infer<typeof updatePullRequestInputSchema>;
107
126
  export declare const skillPrCommentSchema: z.ZodObject<{
108
127
  id: z.ZodString;
109
128
  pull_request_id: z.ZodString;
@@ -402,4 +421,124 @@ export declare const pullRequestPageSchema: z.ZodObject<{
402
421
  base_description: string | null;
403
422
  }>;
404
423
  export type PullRequestPage = z.infer<typeof pullRequestPageSchema>;
424
+ /**
425
+ * Cross-skill PR listing — used by the authenticated `/me/pulls` view.
426
+ * Each row carries a slim skill slice so the UI can render the
427
+ * "Proposed change to <skill name>" line + deep-link back to the skill.
428
+ */
429
+ export declare const myPullRequestSchema: z.ZodObject<{
430
+ id: z.ZodString;
431
+ skill_id: z.ZodString;
432
+ author_id: z.ZodString;
433
+ title: z.ZodString;
434
+ summary: z.ZodNullable<z.ZodString>;
435
+ proposed_content: z.ZodString;
436
+ proposed_description: z.ZodNullable<z.ZodString>;
437
+ status: z.ZodEnum<["open", "merged", "closed"]>;
438
+ merged_by: z.ZodNullable<z.ZodString>;
439
+ merged_at: z.ZodNullable<z.ZodString>;
440
+ closed_by: z.ZodNullable<z.ZodString>;
441
+ closed_at: z.ZodNullable<z.ZodString>;
442
+ created_at: z.ZodString;
443
+ updated_at: z.ZodString;
444
+ /** Attached by the API: public-safe author slice for cards/avatars. */
445
+ author: z.ZodOptional<z.ZodNullable<z.ZodObject<{
446
+ id: z.ZodString;
447
+ username: z.ZodNullable<z.ZodString>;
448
+ display_name: z.ZodNullable<z.ZodString>;
449
+ avatar_url: z.ZodNullable<z.ZodString>;
450
+ is_creator: z.ZodBoolean;
451
+ is_partner: z.ZodBoolean;
452
+ }, "strip", z.ZodTypeAny, {
453
+ id: string;
454
+ username: string | null;
455
+ display_name: string | null;
456
+ avatar_url: string | null;
457
+ is_creator: boolean;
458
+ is_partner: boolean;
459
+ }, {
460
+ id: string;
461
+ username: string | null;
462
+ display_name: string | null;
463
+ avatar_url: string | null;
464
+ is_creator: boolean;
465
+ is_partner: boolean;
466
+ }>>>;
467
+ } & {
468
+ skill: z.ZodObject<{
469
+ id: z.ZodString;
470
+ slug: z.ZodString;
471
+ name: z.ZodString;
472
+ visibility: z.ZodEnum<["public", "private"]>;
473
+ }, "strip", z.ZodTypeAny, {
474
+ id: string;
475
+ name: string;
476
+ slug: string;
477
+ visibility: "public" | "private";
478
+ }, {
479
+ id: string;
480
+ name: string;
481
+ slug: string;
482
+ visibility: "public" | "private";
483
+ }>;
484
+ }, "strip", z.ZodTypeAny, {
485
+ status: "open" | "merged" | "closed";
486
+ id: string;
487
+ created_at: string;
488
+ updated_at: string;
489
+ skill_id: string;
490
+ summary: string | null;
491
+ skill: {
492
+ id: string;
493
+ name: string;
494
+ slug: string;
495
+ visibility: "public" | "private";
496
+ };
497
+ author_id: string;
498
+ title: string;
499
+ proposed_content: string;
500
+ proposed_description: string | null;
501
+ merged_by: string | null;
502
+ merged_at: string | null;
503
+ closed_by: string | null;
504
+ closed_at: string | null;
505
+ author?: {
506
+ id: string;
507
+ username: string | null;
508
+ display_name: string | null;
509
+ avatar_url: string | null;
510
+ is_creator: boolean;
511
+ is_partner: boolean;
512
+ } | null | undefined;
513
+ }, {
514
+ status: "open" | "merged" | "closed";
515
+ id: string;
516
+ created_at: string;
517
+ updated_at: string;
518
+ skill_id: string;
519
+ summary: string | null;
520
+ skill: {
521
+ id: string;
522
+ name: string;
523
+ slug: string;
524
+ visibility: "public" | "private";
525
+ };
526
+ author_id: string;
527
+ title: string;
528
+ proposed_content: string;
529
+ proposed_description: string | null;
530
+ merged_by: string | null;
531
+ merged_at: string | null;
532
+ closed_by: string | null;
533
+ closed_at: string | null;
534
+ author?: {
535
+ id: string;
536
+ username: string | null;
537
+ display_name: string | null;
538
+ avatar_url: string | null;
539
+ is_creator: boolean;
540
+ is_partner: boolean;
541
+ } | null | undefined;
542
+ }>;
543
+ export type MyPullRequest = z.infer<typeof myPullRequestSchema>;
405
544
  //# sourceMappingURL=skill-pr.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-pr.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/skill-pr.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc,yCAAuC,CAAA;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE9D,eAAO,MAAM,sBAAsB;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGpF,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;IA1E9B,uEAAuE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFvE,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -34,6 +34,16 @@ export const createPullRequestInputSchema = z.object({
34
34
  proposed_content: z.string().min(1),
35
35
  proposed_description: z.string().max(500).optional().nullable(),
36
36
  });
37
+ /**
38
+ * Author can push a new "commit" — a fresh proposed_content body — to an
39
+ * already-open PR. Same shape as create minus the title (title doesn't
40
+ * change once the PR is open).
41
+ */
42
+ export const updatePullRequestInputSchema = z.object({
43
+ summary: z.string().max(2000).optional().nullable(),
44
+ proposed_content: z.string().min(1),
45
+ proposed_description: z.string().max(500).optional().nullable(),
46
+ });
37
47
  export const skillPrCommentSchema = z.object({
38
48
  id: z.string().uuid(),
39
49
  pull_request_id: z.string().uuid(),
@@ -62,3 +72,16 @@ export const pullRequestPageSchema = z.object({
62
72
  base_content: z.string(),
63
73
  base_description: z.string().nullable(),
64
74
  });
75
+ /**
76
+ * Cross-skill PR listing — used by the authenticated `/me/pulls` view.
77
+ * Each row carries a slim skill slice so the UI can render the
78
+ * "Proposed change to <skill name>" line + deep-link back to the skill.
79
+ */
80
+ export const myPullRequestSchema = skillPullRequestSchema.extend({
81
+ skill: z.object({
82
+ id: z.string().uuid(),
83
+ slug: z.string(),
84
+ name: z.string(),
85
+ visibility: z.enum(['public', 'private']),
86
+ }),
87
+ });
@@ -1,25 +1,20 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * BYOK (Bring Your Own Key) tester input. The API **never** persists
4
- * the caller's Anthropic key it's used once for the round-trip and
5
- * dropped. Store hashes of keys only if rate-limiting is added later.
3
+ * Managed Skill-Tester input. Prave provides the Anthropic API key
4
+ * server-side and meters usage in credits one credit per request.
5
+ * Model is fixed to Haiku 4.5 for predictable cost; advanced users can
6
+ * later override via a per-plan whitelist.
6
7
  */
7
8
  export declare const skillTestInputSchema: z.ZodObject<{
8
9
  prompt: z.ZodString;
9
- api_key: z.ZodString;
10
- model: z.ZodOptional<z.ZodString>;
11
10
  max_tokens: z.ZodOptional<z.ZodNumber>;
12
11
  temperature: z.ZodOptional<z.ZodNumber>;
13
12
  }, "strip", z.ZodTypeAny, {
14
13
  prompt: string;
15
- api_key: string;
16
- model?: string | undefined;
17
14
  max_tokens?: number | undefined;
18
15
  temperature?: number | undefined;
19
16
  }, {
20
17
  prompt: string;
21
- api_key: string;
22
- model?: string | undefined;
23
18
  max_tokens?: number | undefined;
24
19
  temperature?: number | undefined;
25
20
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"skill-test.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/skill-test.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAU/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
1
+ {"version":3,"file":"skill-test.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/skill-test.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -1,17 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * BYOK (Bring Your Own Key) tester input. The API **never** persists
4
- * the caller's Anthropic key it's used once for the round-trip and
5
- * dropped. Store hashes of keys only if rate-limiting is added later.
3
+ * Managed Skill-Tester input. Prave provides the Anthropic API key
4
+ * server-side and meters usage in credits one credit per request.
5
+ * Model is fixed to Haiku 4.5 for predictable cost; advanced users can
6
+ * later override via a per-plan whitelist.
6
7
  */
7
8
  export const skillTestInputSchema = z.object({
8
9
  prompt: z.string().min(1).max(12_000),
9
- api_key: z
10
- .string()
11
- .min(10)
12
- .max(256)
13
- .regex(/^sk-ant-/, 'Must be an Anthropic key (starts with sk-ant-)'),
14
- model: z.string().min(1).max(80).optional(),
15
10
  max_tokens: z.number().int().min(1).max(8192).optional(),
16
11
  temperature: z.number().min(0).max(1).optional(),
17
12
  });
@@ -1,5 +1,6 @@
1
1
  export * from './categories.js';
2
2
  export * from './plan-limits.js';
3
+ export * from './intelligence.js';
3
4
  export type UserPlan = 'free' | 'explorer' | 'creator';
4
5
  export type UserRole = 'user' | 'admin';
5
6
  export interface Profile {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAEhC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CA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nB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,OAAO,4BAA4B,EAAE,KAAK,EAAE,CAAA;IACpD,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd"}
@@ -1,2 +1,3 @@
1
1
  export * from './categories.js';
2
2
  export * from './plan-limits.js';
3
+ export * from './intelligence.js';
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Skill Intelligence — types shared across the API, web, CLI.
3
+ *
4
+ * Source-of-truth for the rows in `skill_metadata`, `skill_conflicts`,
5
+ * `skill_usage_stats`, and `user_agent_settings`. Every layer reads these.
6
+ */
7
+ export declare const AGENT_TYPES: readonly ["claude", "codex", "cursor", "gemini", "cline", "amp"];
8
+ export type AgentType = (typeof AGENT_TYPES)[number];
9
+ export interface AgentMeta {
10
+ id: AgentType;
11
+ label: string;
12
+ description: string;
13
+ /** Default OS-specific skill paths used as a fallback in the UI. */
14
+ defaultPath: {
15
+ mac: string;
16
+ windows: string;
17
+ };
18
+ /** When true, the SKILL.md needs format conversion before deploy. */
19
+ conversionRequired: boolean;
20
+ }
21
+ export declare const AGENT_REGISTRY: Record<AgentType, AgentMeta>;
22
+ export interface SkillMetadata {
23
+ id: string;
24
+ skill_id: string | null;
25
+ user_id: string;
26
+ name: string | null;
27
+ description: string | null;
28
+ triggers: string[];
29
+ slash_command: string | null;
30
+ disable_model_invocation: boolean;
31
+ user_invocable: boolean;
32
+ requires: string[];
33
+ estimated_tokens: number;
34
+ file_path: string;
35
+ agent_type: AgentType;
36
+ last_analyzed: string;
37
+ created_at: string;
38
+ updated_at: string;
39
+ }
40
+ export type ConflictType = 'trigger_overlap' | 'auto_invocation_collision' | 'dependency_conflict';
41
+ export interface SkillConflict {
42
+ id: string;
43
+ user_id: string;
44
+ skill_a_id: string;
45
+ skill_b_id: string;
46
+ conflict_type: ConflictType;
47
+ conflict_detail: string | null;
48
+ detected_at: string;
49
+ skill_a_name?: string | null;
50
+ skill_b_name?: string | null;
51
+ }
52
+ export interface SkillUsageStat {
53
+ id: string;
54
+ user_id: string;
55
+ skill_metadata_id: string;
56
+ trigger_phrase: string | null;
57
+ triggered_at: string;
58
+ }
59
+ export interface UserAgentSettings {
60
+ user_id: string;
61
+ enabled_agents: AgentType[];
62
+ skill_paths: Record<AgentType, {
63
+ mac: string;
64
+ windows: string;
65
+ }>;
66
+ detected_os: 'mac' | 'windows' | 'linux' | null;
67
+ updated_at: string;
68
+ }
69
+ export interface IntelligenceOverview {
70
+ total_skills: number;
71
+ auto_trigger_count: number;
72
+ user_invocable_count: number;
73
+ total_estimated_tokens: number;
74
+ conflict_count: number;
75
+ agents: {
76
+ agent: AgentType;
77
+ skill_count: number;
78
+ }[];
79
+ /** Top 5 token-heaviest skills, for the panel summary. */
80
+ heaviest: Array<Pick<SkillMetadata, 'id' | 'name' | 'slash_command' | 'estimated_tokens'>>;
81
+ }
82
+ export interface IntelligenceOptimization {
83
+ underused: SkillMetadata[];
84
+ merge_candidates: Array<{
85
+ a: SkillMetadata;
86
+ b: SkillMetadata;
87
+ reason: string;
88
+ }>;
89
+ heavy: SkillMetadata[];
90
+ total_savings_estimate_tokens: number;
91
+ }
92
+ export interface IntelligenceSearchResult {
93
+ source: 'local' | 'marketplace';
94
+ id: string;
95
+ slug: string;
96
+ name: string;
97
+ description: string | null;
98
+ slash_command: string | null;
99
+ estimated_tokens: number;
100
+ install_count?: number | null;
101
+ rating?: number | null;
102
+ is_installed: boolean;
103
+ }
104
+ export interface LlmSearchResult {
105
+ task: string;
106
+ keywords: string[];
107
+ scope: 'local' | 'marketplace' | 'both';
108
+ suggested_triggers: string[];
109
+ results: IntelligenceSearchResult[];
110
+ }
111
+ /** Shape returned to `prave whatdoes` and the Intelligence detail panel. */
112
+ export interface SkillWhatDoes {
113
+ found: boolean;
114
+ source: 'local' | 'marketplace' | null;
115
+ metadata: SkillMetadata | null;
116
+ marketplace?: {
117
+ slug: string;
118
+ name: string;
119
+ description: string | null;
120
+ install_count: number;
121
+ rating: number | null;
122
+ } | null;
123
+ conflicts: SkillConflict[];
124
+ similar?: Array<{
125
+ slug: string;
126
+ name: string;
127
+ }>;
128
+ }
129
+ /** Token-tier classification used by the CLI + UI badges. */
130
+ export type TokenTier = 'lean' | 'medium' | 'heavy';
131
+ export declare const tokenTier: (n: number) => TokenTier;
132
+ //# sourceMappingURL=intelligence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intelligence.d.ts","sourceRoot":"","sources":["../../src/types/intelligence.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,WAAW,kEAAmE,CAAA;AAC3F,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpD,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,SAAS,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,oEAAoE;IACpE,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7C,qEAAqE;IACrE,kBAAkB,EAAE,OAAO,CAAA;CAC5B;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,CA2CvD,CAAA;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,wBAAwB,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CAAA;IACvC,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,OAAO,EAAE,wBAAwB,EAAE,CAAA;CACpC;AAED,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAAA;IACtC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,aAAa,EAAE,MAAM,CAAA;QACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KACtB,GAAG,IAAI,CAAA;IACR,SAAS,EAAE,aAAa,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChD;AAED,6DAA6D;AAC7D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AACnD,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,SACY,CAAA"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Skill Intelligence — types shared across the API, web, CLI.
3
+ *
4
+ * Source-of-truth for the rows in `skill_metadata`, `skill_conflicts`,
5
+ * `skill_usage_stats`, and `user_agent_settings`. Every layer reads these.
6
+ */
7
+ export const AGENT_TYPES = ['claude', 'codex', 'cursor', 'gemini', 'cline', 'amp'];
8
+ export const AGENT_REGISTRY = {
9
+ claude: {
10
+ id: 'claude',
11
+ label: 'Claude Code',
12
+ description: "Anthropic's terminal-based coding agent",
13
+ defaultPath: { mac: '~/.claude/skills/', windows: '%APPDATA%\\Claude\\skills\\' },
14
+ conversionRequired: false,
15
+ },
16
+ codex: {
17
+ id: 'codex',
18
+ label: 'OpenAI Codex',
19
+ description: "OpenAI's CLI coding agent",
20
+ defaultPath: { mac: '~/.codex/skills/', windows: '%APPDATA%\\Codex\\skills\\' },
21
+ conversionRequired: false,
22
+ },
23
+ cursor: {
24
+ id: 'cursor',
25
+ label: 'Cursor',
26
+ description: 'AI-first code editor',
27
+ defaultPath: { mac: '.cursor/rules/', windows: '.cursor\\rules\\' },
28
+ conversionRequired: true,
29
+ },
30
+ gemini: {
31
+ id: 'gemini',
32
+ label: 'Gemini CLI',
33
+ description: "Google's terminal agent",
34
+ defaultPath: { mac: '~/.gemini/skills/', windows: '%APPDATA%\\Gemini\\skills\\' },
35
+ conversionRequired: false,
36
+ },
37
+ cline: {
38
+ id: 'cline',
39
+ label: 'Cline',
40
+ description: 'Open-source VS Code agent',
41
+ defaultPath: { mac: '~/.cline/skills/', windows: '%APPDATA%\\Cline\\skills\\' },
42
+ conversionRequired: false,
43
+ },
44
+ amp: {
45
+ id: 'amp',
46
+ label: 'Amp',
47
+ description: 'Ampcode terminal agent',
48
+ defaultPath: { mac: '~/.amp/skills/', windows: '%APPDATA%\\Amp\\skills\\' },
49
+ conversionRequired: false,
50
+ },
51
+ };
52
+ export const tokenTier = (n) => n < 500 ? 'lean' : n < 2000 ? 'medium' : 'heavy';
@@ -9,7 +9,7 @@ export const PLAN_LIMITS = {
9
9
  max_private_skills: 0,
10
10
  can_versioning: false,
11
11
  max_marketplace_listings: 0,
12
- tester_credits_monthly: 0,
12
+ tester_credits_monthly: 10,
13
13
  max_bookmarks: 5,
14
14
  cli_max_imports: 10,
15
15
  cli_exports_monthly: 0,
@@ -24,14 +24,14 @@ export const PLAN_LIMITS = {
24
24
  explorer: {
25
25
  label: 'Explorer',
26
26
  price_eur_monthly: 4,
27
- tagline: 'For developers building, sharing and selling Skills.',
28
- creator_revenue_share: 0.7,
27
+ tagline: 'For developers building and shipping Skills.',
28
+ creator_revenue_share: null,
29
29
  max_public_skills: 20,
30
30
  can_private_skills: true,
31
31
  max_private_skills: 20,
32
32
  can_versioning: true,
33
- max_marketplace_listings: 5,
34
- tester_credits_monthly: 30,
33
+ max_marketplace_listings: 0,
34
+ tester_credits_monthly: 80,
35
35
  max_bookmarks: null,
36
36
  cli_max_imports: null,
37
37
  cli_exports_monthly: 50,
@@ -53,7 +53,7 @@ export const PLAN_LIMITS = {
53
53
  max_private_skills: null,
54
54
  can_versioning: true,
55
55
  max_marketplace_listings: null,
56
- tester_credits_monthly: 150,
56
+ tester_credits_monthly: 250,
57
57
  max_bookmarks: null,
58
58
  cli_max_imports: null,
59
59
  cli_exports_monthly: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prave/shared",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,112 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const orgRoleSchema: z.ZodEnum<["owner", "admin", "member"]>;
3
- export type OrgRole = z.infer<typeof orgRoleSchema>;
4
- export declare const orgSchema: z.ZodObject<{
5
- id: z.ZodString;
6
- name: z.ZodString;
7
- slug: z.ZodString;
8
- owner_id: z.ZodString;
9
- stripe_subscription_id: z.ZodNullable<z.ZodString>;
10
- seats: z.ZodNumber;
11
- created_at: z.ZodString;
12
- updated_at: z.ZodString;
13
- }, "strip", z.ZodTypeAny, {
14
- id: string;
15
- owner_id: string;
16
- name: string;
17
- slug: string;
18
- created_at: string;
19
- updated_at: string;
20
- stripe_subscription_id: string | null;
21
- seats: number;
22
- }, {
23
- id: string;
24
- owner_id: string;
25
- name: string;
26
- slug: string;
27
- created_at: string;
28
- updated_at: string;
29
- stripe_subscription_id: string | null;
30
- seats: number;
31
- }>;
32
- export type Org = z.infer<typeof orgSchema>;
33
- export declare const orgMemberSchema: z.ZodObject<{
34
- org_id: z.ZodString;
35
- user_id: z.ZodString;
36
- role: z.ZodEnum<["owner", "admin", "member"]>;
37
- invited_email: z.ZodNullable<z.ZodString>;
38
- joined_at: z.ZodString;
39
- }, "strip", z.ZodTypeAny, {
40
- user_id: string;
41
- org_id: string;
42
- role: "owner" | "admin" | "member";
43
- invited_email: string | null;
44
- joined_at: string;
45
- }, {
46
- user_id: string;
47
- org_id: string;
48
- role: "owner" | "admin" | "member";
49
- invited_email: string | null;
50
- joined_at: string;
51
- }>;
52
- export type OrgMember = z.infer<typeof orgMemberSchema>;
53
- /** Hydrated row used by the Teams panel — joins the auth user's email/name. */
54
- export declare const orgMemberRowSchema: z.ZodObject<{
55
- org_id: z.ZodString;
56
- user_id: z.ZodString;
57
- role: z.ZodEnum<["owner", "admin", "member"]>;
58
- invited_email: z.ZodNullable<z.ZodString>;
59
- joined_at: z.ZodString;
60
- } & {
61
- email: z.ZodNullable<z.ZodString>;
62
- display_name: z.ZodNullable<z.ZodString>;
63
- avatar_url: z.ZodNullable<z.ZodString>;
64
- }, "strip", z.ZodTypeAny, {
65
- display_name: string | null;
66
- avatar_url: string | null;
67
- user_id: string;
68
- email: string | null;
69
- org_id: string;
70
- role: "owner" | "admin" | "member";
71
- invited_email: string | null;
72
- joined_at: string;
73
- }, {
74
- display_name: string | null;
75
- avatar_url: string | null;
76
- user_id: string;
77
- email: string | null;
78
- org_id: string;
79
- role: "owner" | "admin" | "member";
80
- invited_email: string | null;
81
- joined_at: string;
82
- }>;
83
- export type OrgMemberRow = z.infer<typeof orgMemberRowSchema>;
84
- export declare const createOrgInputSchema: z.ZodObject<Pick<{
85
- id: z.ZodString;
86
- name: z.ZodString;
87
- slug: z.ZodString;
88
- owner_id: z.ZodString;
89
- stripe_subscription_id: z.ZodNullable<z.ZodString>;
90
- seats: z.ZodNumber;
91
- created_at: z.ZodString;
92
- updated_at: z.ZodString;
93
- }, "name" | "slug">, "strip", z.ZodTypeAny, {
94
- name: string;
95
- slug: string;
96
- }, {
97
- name: string;
98
- slug: string;
99
- }>;
100
- export type CreateOrgInput = z.infer<typeof createOrgInputSchema>;
101
- export declare const addMemberInputSchema: z.ZodObject<{
102
- email: z.ZodString;
103
- role: z.ZodDefault<z.ZodEnum<["admin", "member"]>>;
104
- }, "strip", z.ZodTypeAny, {
105
- email: string;
106
- role: "admin" | "member";
107
- }, {
108
- email: string;
109
- role?: "admin" | "member" | undefined;
110
- }>;
111
- export type AddMemberInput = z.infer<typeof addMemberInputSchema>;
112
- //# sourceMappingURL=org.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"org.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/org.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,aAAa,yCAAuC,CAAA;AACjE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;EAapB,CAAA;AACF,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAE3C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;EAM1B,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI7B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAA6C,CAAA;AAC9E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
@@ -1,34 +0,0 @@
1
- import { z } from 'zod';
2
- export const orgRoleSchema = z.enum(['owner', 'admin', 'member']);
3
- export const orgSchema = z.object({
4
- id: z.string().uuid(),
5
- name: z.string().min(1).max(120),
6
- slug: z
7
- .string()
8
- .min(1)
9
- .max(80)
10
- .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, 'slug must be kebab-case'),
11
- owner_id: z.string().uuid(),
12
- stripe_subscription_id: z.string().nullable(),
13
- seats: z.number().int().positive(),
14
- created_at: z.string().datetime(),
15
- updated_at: z.string().datetime(),
16
- });
17
- export const orgMemberSchema = z.object({
18
- org_id: z.string().uuid(),
19
- user_id: z.string().uuid(),
20
- role: orgRoleSchema,
21
- invited_email: z.string().email().nullable(),
22
- joined_at: z.string().datetime(),
23
- });
24
- /** Hydrated row used by the Teams panel — joins the auth user's email/name. */
25
- export const orgMemberRowSchema = orgMemberSchema.extend({
26
- email: z.string().email().nullable(),
27
- display_name: z.string().nullable(),
28
- avatar_url: z.string().nullable(),
29
- });
30
- export const createOrgInputSchema = orgSchema.pick({ name: true, slug: true });
31
- export const addMemberInputSchema = z.object({
32
- email: z.string().email(),
33
- role: z.enum(['admin', 'member']).default('member'),
34
- });