@prave/shared 1.4.6 → 1.4.7

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 (36) hide show
  1. package/dist/schemas/api-keys.schema.d.ts +2 -2
  2. package/dist/schemas/index.d.ts +0 -9
  3. package/dist/schemas/index.d.ts.map +1 -1
  4. package/dist/schemas/index.js +0 -9
  5. package/dist/schemas/install.schema.d.ts +4 -4
  6. package/dist/types/plan-limits.d.ts +6 -62
  7. package/dist/types/plan-limits.d.ts.map +1 -1
  8. package/dist/types/plan-limits.js +6 -46
  9. package/package.json +1 -1
  10. package/dist/schemas/credits.schema.d.ts +0 -73
  11. package/dist/schemas/credits.schema.d.ts.map +0 -1
  12. package/dist/schemas/credits.schema.js +0 -52
  13. package/dist/schemas/kv.schema.d.ts +0 -56
  14. package/dist/schemas/kv.schema.d.ts.map +0 -1
  15. package/dist/schemas/kv.schema.js +0 -39
  16. package/dist/schemas/run.schema.d.ts +0 -509
  17. package/dist/schemas/run.schema.d.ts.map +0 -1
  18. package/dist/schemas/run.schema.js +0 -192
  19. package/dist/schemas/sdk.schema.d.ts +0 -51
  20. package/dist/schemas/sdk.schema.d.ts.map +0 -1
  21. package/dist/schemas/sdk.schema.js +0 -36
  22. package/dist/schemas/skill-pr.schema.d.ts +0 -544
  23. package/dist/schemas/skill-pr.schema.d.ts.map +0 -1
  24. package/dist/schemas/skill-pr.schema.js +0 -87
  25. package/dist/schemas/skill-test.schema.d.ts +0 -60
  26. package/dist/schemas/skill-test.schema.d.ts.map +0 -1
  27. package/dist/schemas/skill-test.schema.js +0 -25
  28. package/dist/schemas/skill-version.schema.d.ts +0 -69
  29. package/dist/schemas/skill-version.schema.d.ts.map +0 -1
  30. package/dist/schemas/skill-version.schema.js +0 -21
  31. package/dist/schemas/vault.schema.d.ts +0 -54
  32. package/dist/schemas/vault.schema.d.ts.map +0 -1
  33. package/dist/schemas/vault.schema.js +0 -39
  34. package/dist/schemas/webhook-endpoint.schema.d.ts +0 -161
  35. package/dist/schemas/webhook-endpoint.schema.d.ts.map +0 -1
  36. package/dist/schemas/webhook-endpoint.schema.js +0 -74
@@ -47,12 +47,12 @@ export declare const aiGenerateInputSchema: z.ZodObject<{
47
47
  /** Existing skill content the user is iterating on. */
48
48
  existing_content: z.ZodOptional<z.ZodString>;
49
49
  }, "strip", z.ZodTypeAny, {
50
- prompt: string;
51
50
  provider: "gemini" | "anthropic" | "openai";
51
+ prompt: string;
52
52
  existing_content?: string | undefined;
53
53
  }, {
54
- prompt: string;
55
54
  provider: "gemini" | "anthropic" | "openai";
55
+ prompt: string;
56
56
  existing_content?: string | undefined;
57
57
  }>;
58
58
  export type AiGenerateInput = z.infer<typeof aiGenerateInputSchema>;
@@ -1,22 +1,13 @@
1
1
  export * from './api-response.schema.js';
2
2
  export * from './skill.schema.js';
3
- export * from './skill-version.schema.js';
4
3
  export * from './cli.schema.js';
5
4
  export * from './search.schema.js';
6
5
  export * from './ai-description.schema.js';
7
6
  export * from './skill-dependency.schema.js';
8
- export * from './skill-test.schema.js';
9
7
  export * from './marketplace.schema.js';
10
8
  export * from './billing.schema.js';
11
- export * from './credits.schema.js';
12
9
  export * from './install.schema.js';
13
- export * from './skill-pr.schema.js';
14
10
  export * from './intelligence.schema.js';
15
11
  export * from './api-keys.schema.js';
16
12
  export * from './skill-report.schema.js';
17
- export * from './run.schema.js';
18
- export * from './vault.schema.js';
19
- export * from './kv.schema.js';
20
- export * from './webhook-endpoint.schema.js';
21
- export * from './sdk.schema.js';
22
13
  //# 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,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iBAAiB,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,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA"}
@@ -1,21 +1,12 @@
1
1
  export * from './api-response.schema.js';
2
2
  export * from './skill.schema.js';
3
- export * from './skill-version.schema.js';
4
3
  export * from './cli.schema.js';
5
4
  export * from './search.schema.js';
6
5
  export * from './ai-description.schema.js';
7
6
  export * from './skill-dependency.schema.js';
8
- export * from './skill-test.schema.js';
9
7
  export * from './marketplace.schema.js';
10
8
  export * from './billing.schema.js';
11
- export * from './credits.schema.js';
12
9
  export * from './install.schema.js';
13
- export * from './skill-pr.schema.js';
14
10
  export * from './intelligence.schema.js';
15
11
  export * from './api-keys.schema.js';
16
12
  export * from './skill-report.schema.js';
17
- export * from './run.schema.js';
18
- export * from './vault.schema.js';
19
- export * from './kv.schema.js';
20
- export * from './webhook-endpoint.schema.js';
21
- export * from './sdk.schema.js';
@@ -9,14 +9,14 @@ export declare const installSchema: z.ZodObject<{
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  id: string;
11
11
  skill_id: string;
12
- version: number | null;
13
12
  user_id: string;
13
+ version: number | null;
14
14
  installed_at: string;
15
15
  }, {
16
16
  id: string;
17
17
  skill_id: string;
18
- version: number | null;
19
18
  user_id: string;
19
+ version: number | null;
20
20
  installed_at: string;
21
21
  }>;
22
22
  export type Install = z.infer<typeof installSchema>;
@@ -147,8 +147,8 @@ export declare const installRowSchema: z.ZodObject<{
147
147
  }, "strip", z.ZodTypeAny, {
148
148
  id: string;
149
149
  skill_id: string;
150
- version: number | null;
151
150
  user_id: string;
151
+ version: number | null;
152
152
  installed_at: string;
153
153
  skill: {
154
154
  id: string;
@@ -163,8 +163,8 @@ export declare const installRowSchema: z.ZodObject<{
163
163
  }, {
164
164
  id: string;
165
165
  skill_id: string;
166
- version: number | null;
167
166
  user_id: string;
167
+ version: number | null;
168
168
  installed_at: string;
169
169
  skill: {
170
170
  id: string;
@@ -1,4 +1,5 @@
1
1
  import type { Plan } from '../schemas/billing.schema.js';
2
+ import { type AgentType } from './intelligence.js';
2
3
  /**
3
4
  * PLAN_LIMITS — single source of truth for every gate, quota and copy
4
5
  * choice across the platform.
@@ -46,8 +47,6 @@ export interface PlanLimits {
46
47
  * Free: 5/mo, Pro+ unlimited. Counter resets on calendar month rollover.
47
48
  */
48
49
  install_monthly_limit: number | null;
49
- /** Allowed deploy targets. Empty list = no Multi-Agent feature. */
50
- multi_agent_targets: ReadonlyArray<'claude' | 'codex' | 'cursor' | 'gemini' | 'cline' | 'amp'>;
51
50
  /** `prave sync` enabled. */
52
51
  can_cli_sync: boolean;
53
52
  /** `prave update` (and the dashboard Update Banner). */
@@ -62,27 +61,8 @@ export interface PlanLimits {
62
61
  * Total authored-skill ceiling (public + private). `null` = unlimited.
63
62
  */
64
63
  authoring_max_skills: number | null;
65
- /** History tab + revert. */
66
- can_versioning: boolean;
67
64
  /** AI-Description generate-button in the editor. */
68
65
  can_ai_description: boolean;
69
- /** Pull-request workflow on others' skills. */
70
- can_pull_requests: boolean;
71
- /**
72
- * Monthly Skill-Tester credits. 0 = blocked entirely.
73
- * 1 run costs `tester_cost_per_run` credits.
74
- * Free: 0 · Pro: 100 · Max: 300
75
- */
76
- tester_credits_monthly: number;
77
- /** Cost (in credits) of a single tester run. */
78
- tester_cost_per_run: number;
79
- /**
80
- * Anti-spam cooldown between tester runs in seconds. 0 = no cooldown
81
- * (Max-tier privilege). Pro = 180s (3 min).
82
- */
83
- tester_cooldown_seconds: number;
84
- /** BYO-Anthropic-key tester mode (uses user's own key, no Prave credits). */
85
- can_byo_tester_key: boolean;
86
66
  /** Access the Intelligence dashboard at all. */
87
67
  can_intelligence: boolean;
88
68
  /**
@@ -126,48 +106,12 @@ export interface PlanLimits {
126
106
  /** Early access to in-development features. */
127
107
  has_early_access: boolean;
128
108
  /**
129
- * Max number of active Runs (deployed schedules) per user. 0 = the
130
- * feature is locked behind an upgrade the user can still browse
131
- * the section but the "Schedule a run" CTA opens an upgrade modal.
132
- */
133
- runs_max_active: number;
134
- /**
135
- * Smallest schedule interval the user can pick. Strings map to the
136
- * wizard's preset list:
137
- * 'none' — Runs feature disabled entirely
138
- * 'daily' — daily / weekly / monthly only
139
- * 'hourly' — adds the hourly preset (Max-tier)
140
- * 'custom' — adds the custom-cron field (Max-tier)
141
- * The UI uses this to hide presets the plan doesn't allow.
142
- */
143
- runs_min_frequency: 'none' | 'daily' | 'hourly' | 'custom';
144
- /** Hard timeout cap (seconds) per single execution. */
145
- runs_max_timeout_seconds: number;
146
- /** Max stdout/stderr captured per execution (bytes). */
147
- runs_max_log_bytes: number;
148
- /**
149
- * Vault keys per run. Each key holds a single user-supplied secret
150
- * (API key, OAuth client_secret, etc.) readable from the skill via
151
- * `prave.vault.get('KEY')`. `null` = unlimited.
152
- */
153
- vault_keys_max: number | null;
154
- /**
155
- * Per-run KV bytes budget — the total encrypted-value size summed
156
- * across all `run_kv` rows for the run. Hits 413 on PUT once
157
- * exceeded. `null` = unlimited.
158
- */
159
- kv_bytes_max: number | null;
160
- /**
161
- * Webhook endpoints per run. Each endpoint mints one stable URL on
162
- * `in.prave.app/w/<token>/<endpoint_id>`. `null` = unlimited.
163
- */
164
- webhooks_max: number | null;
165
- /**
166
- * Inbound webhook events per day across all endpoints on the run.
167
- * Over-cap requests are dropped with 429 (event NOT buffered).
168
- * `null` = unlimited.
109
+ * Which target agents `prave install` may fan out to in a single
110
+ * invocation. Free is locked to Claude Code; Pro+ unlocks the full
111
+ * set so a Skill can be dropped into Claude / Codex / Gemini /
112
+ * Cursor / Cline / Amp at once.
169
113
  */
170
- webhook_events_per_day: number | null;
114
+ multi_agent_targets: readonly AgentType[];
171
115
  }
172
116
  export declare const PLAN_LIMITS: Record<Plan, PlanLimits>;
173
117
  export declare const PLAN_RANK: Record<Plan, number>;
@@ -1 +1 @@
1
- {"version":3,"file":"plan-limits.d.ts","sourceRoot":"","sources":["../../src/types/plan-limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAExD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,UAAU;IACzB,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAA;IACb,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,2EAA2E;IAC3E,iBAAiB,EAAE,MAAM,CAAA;IACzB,gEAAgE;IAChE,gBAAgB,EAAE,MAAM,CAAA;IACxB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAA;IAGlB,+EAA+E;IAC/E,YAAY,EAAE,OAAO,CAAA;IACrB,8BAA8B;IAC9B,YAAY,EAAE,OAAO,CAAA;IACrB;;;;;;;;OAQG;IACH,mBAAmB,EAAE,OAAO,CAAA;IAG5B;;;OAGG;IACH,qBA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EAAE,OAAO,CAAA;IACtB,qCAAqC;IACrC,kBAAkB,EAAE,OAAO,CAAA;IAC3B;;;OAGG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,mCAAmC;IACnC,gBAAgB,EAAE,OAAO,CAAA;IAGzB,8CAA8C;IAC9C,kBAAkB,EAAE,OAAO,CAAA;IAC3B;;;OAGG;IACH,oBAAoB,EAAE,OAAO,CAAA;IAC7B,oDAAoD;IACpD,kBAAkB,EAAE,OAAO,CAAA;IAC3B,mEAAmE;IACnE,kBAAkB,EAAE,OAAO,CAAA;IAG3B,6CAA6C;IAC7C,oBAAoB,EAAE,OAAO,CAAA;IAC7B,+CAA+C;IAC/C,gBAAgB,EAAE,OAAO,CAAA;IAGzB;;;;;OAKG;IACH,mBAAmB,EAAE,SAAS,SAAS,EAAE,CAAA;CAC1C;AAKD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,CAsJhD,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAI1C,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,SAAS,GAAI,QAAQ,IAAI,EAAE,UAAU,IAAI,KAAG,OACf,CAAA;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,UAAU,KAAG,IAAI,GAAG,IAU7D,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,KAAG,MAAiC,CAAA;AAExE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,EAAE,eAAe,MAAM,KAAG,MAAM,GAAG,IAI9E,CAAA"}
@@ -1,4 +1,6 @@
1
- const ALL_AGENTS = ['claude', 'codex', 'cursor', 'gemini', 'cline', 'amp'];
1
+ import { AGENT_TYPES } from './intelligence.js';
2
+ /** Convenience constant — every agent that `prave install` knows about. */
3
+ const ALL_AGENTS = AGENT_TYPES;
2
4
  export const PLAN_LIMITS = {
3
5
  // ── Free ──────────────────────────────────────────────────────────
4
6
  free: {
@@ -16,7 +18,6 @@ export const PLAN_LIMITS = {
16
18
  // harm onboarding. The real value-add lives in Sync, Skill Intelligence
17
19
  // (token cost + conflicts), and semantic search — all gated above.
18
20
  install_monthly_limit: null,
19
- multi_agent_targets: ['claude'],
20
21
  can_cli_sync: false,
21
22
  can_cli_update: false,
22
23
  can_cross_machine_sync: false,
@@ -27,16 +28,10 @@ export const PLAN_LIMITS = {
27
28
  can_authoring_public: false,
28
29
  can_authoring_private: true,
29
30
  authoring_max_skills: 1,
30
- can_versioning: false,
31
31
  can_ai_description: false,
32
- can_pull_requests: false,
33
32
  // Free gets a single Tester run / month — one taste of the agent
34
33
  // sandbox so the upgrade prompt isn't an abstract "you've never
35
34
  // seen this" wall. 1 run = 5 credits = ~$0.02 LLM cost to us.
36
- tester_credits_monthly: 5,
37
- tester_cost_per_run: 5,
38
- tester_cooldown_seconds: 600,
39
- can_byo_tester_key: false,
40
35
  can_intelligence: false,
41
36
  intelligence_indexed_max: 0,
42
37
  auto_skill_monthly_limit: 3,
@@ -50,14 +45,7 @@ export const PLAN_LIMITS = {
50
45
  has_priority_badge: false,
51
46
  has_priority_support: false,
52
47
  has_early_access: false,
53
- runs_max_active: 0,
54
- runs_min_frequency: 'none',
55
- runs_max_timeout_seconds: 0,
56
- runs_max_log_bytes: 0,
57
- vault_keys_max: 0,
58
- kv_bytes_max: 0,
59
- webhooks_max: 0,
60
- webhook_events_per_day: 0,
48
+ multi_agent_targets: ['claude'],
61
49
  },
62
50
  // ── Pro (internally `explorer`) ───────────────────────────────────
63
51
  explorer: {
@@ -77,20 +65,13 @@ export const PLAN_LIMITS = {
77
65
  can_bookmark: true,
78
66
  can_semantic_search: true,
79
67
  install_monthly_limit: null,
80
- multi_agent_targets: ALL_AGENTS,
81
68
  can_cli_sync: true,
82
69
  can_cli_update: true,
83
70
  can_cross_machine_sync: true,
84
71
  can_authoring_public: true,
85
72
  can_authoring_private: true,
86
73
  authoring_max_skills: null,
87
- can_versioning: true,
88
74
  can_ai_description: true,
89
- can_pull_requests: true,
90
- tester_credits_monthly: 100,
91
- tester_cost_per_run: 5,
92
- tester_cooldown_seconds: 180,
93
- can_byo_tester_key: false,
94
75
  can_intelligence: true,
95
76
  intelligence_indexed_max: 25,
96
77
  auto_skill_monthly_limit: 30,
@@ -104,14 +85,7 @@ export const PLAN_LIMITS = {
104
85
  has_priority_badge: false,
105
86
  has_priority_support: false,
106
87
  has_early_access: false,
107
- runs_max_active: 3,
108
- runs_min_frequency: 'daily',
109
- runs_max_timeout_seconds: 60,
110
- runs_max_log_bytes: 65_536,
111
- vault_keys_max: 25,
112
- kv_bytes_max: 1_048_576,
113
- webhooks_max: 5,
114
- webhook_events_per_day: 5_000,
88
+ multi_agent_targets: ALL_AGENTS,
115
89
  },
116
90
  // ── Max (internally `creator`) ────────────────────────────────────
117
91
  creator: {
@@ -129,20 +103,13 @@ export const PLAN_LIMITS = {
129
103
  can_bookmark: true,
130
104
  can_semantic_search: true,
131
105
  install_monthly_limit: null,
132
- multi_agent_targets: ALL_AGENTS,
133
106
  can_cli_sync: true,
134
107
  can_cli_update: true,
135
108
  can_cross_machine_sync: true,
136
109
  can_authoring_public: true,
137
110
  can_authoring_private: true,
138
111
  authoring_max_skills: null,
139
- can_versioning: true,
140
112
  can_ai_description: true,
141
- can_pull_requests: true,
142
- tester_credits_monthly: 300,
143
- tester_cost_per_run: 5,
144
- tester_cooldown_seconds: 0,
145
- can_byo_tester_key: true,
146
113
  can_intelligence: true,
147
114
  intelligence_indexed_max: null,
148
115
  auto_skill_monthly_limit: null,
@@ -156,14 +123,7 @@ export const PLAN_LIMITS = {
156
123
  has_priority_badge: true,
157
124
  has_priority_support: true,
158
125
  has_early_access: true,
159
- runs_max_active: 25,
160
- runs_min_frequency: 'custom',
161
- runs_max_timeout_seconds: 300,
162
- runs_max_log_bytes: 262_144,
163
- vault_keys_max: null,
164
- kv_bytes_max: 16_777_216,
165
- webhooks_max: null,
166
- webhook_events_per_day: 50_000,
126
+ multi_agent_targets: ALL_AGENTS,
167
127
  },
168
128
  };
169
129
  export const PLAN_RANK = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prave/shared",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,73 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Credit-pack catalog. One-time purchases that top up
4
- * `profiles.tester_credits_balance`. Prices are denominated in USD now
5
- * (the `price_eur` field name kept for column-rename safety — Stripe
6
- * still treats it as the gross USD amount, see stripe-seed.ts).
7
- *
8
- * Margin: Haiku 4.5 worst-case = ~$0.013 per Tester run = ~$0.0026 per
9
- * credit. We charge $0.10–$0.12 per credit on top-ups, ~40-45× markup,
10
- * which keeps the per-credit price *higher* than any subscription
11
- * average so power-users always come out ahead by upgrading.
12
- */
13
- export declare const CREDIT_PACK_IDS: readonly ["pack_25", "pack_100"];
14
- export declare const creditPackIdSchema: z.ZodEnum<["pack_25", "pack_100"]>;
15
- export type CreditPackId = z.infer<typeof creditPackIdSchema>;
16
- export interface CreditPack {
17
- id: CreditPackId;
18
- credits: number;
19
- /**
20
- * Gross price in **USD** (VAT-inclusive — Stripe Tax computes the net
21
- * split). The field name `price_eur` is preserved for column-rename
22
- * safety; the Stripe seed and the UI both treat it as USD.
23
- */
24
- price_eur: number;
25
- /** Best-for hint shown on the pack card. */
26
- blurb: string;
27
- }
28
- /**
29
- * Two top-up tiers — entry and refill. Per-credit price stays *higher*
30
- * than the subscription effective rates so a heavy user always saves
31
- * by upgrading instead of hoarding top-ups.
32
- *
33
- * Margin (per pack, full burn):
34
- * pack_25 ($3): ~$0.07 API + ~$0.39 Stripe = $0.46 cost. Net ~$2.54 (85%).
35
- * pack_100 ($10): ~$0.26 API + ~$0.59 Stripe = $0.85 cost. Net ~$9.15 (92%).
36
- * Both safely positive even on worst-case burn.
37
- */
38
- export declare const CREDIT_PACKS: Record<CreditPackId, CreditPack>;
39
- export declare const creditCheckoutInputSchema: z.ZodObject<{
40
- pack: z.ZodEnum<["pack_25", "pack_100"]>;
41
- }, "strip", z.ZodTypeAny, {
42
- pack: "pack_25" | "pack_100";
43
- }, {
44
- pack: "pack_25" | "pack_100";
45
- }>;
46
- export type CreditCheckoutInput = z.infer<typeof creditCheckoutInputSchema>;
47
- export declare const creditBalanceSchema: z.ZodObject<{
48
- monthly_quota: z.ZodNumber;
49
- monthly_used: z.ZodNumber;
50
- monthly_remaining: z.ZodNumber;
51
- /** Purchased top-up balance (never expires). */
52
- balance: z.ZodNumber;
53
- /** Total credits available right now (monthly_remaining + balance). */
54
- total_available: z.ZodNumber;
55
- /** ISO timestamp when the monthly window resets. */
56
- resets_at: z.ZodString;
57
- }, "strip", z.ZodTypeAny, {
58
- monthly_quota: number;
59
- monthly_used: number;
60
- monthly_remaining: number;
61
- balance: number;
62
- total_available: number;
63
- resets_at: string;
64
- }, {
65
- monthly_quota: number;
66
- monthly_used: number;
67
- monthly_remaining: number;
68
- balance: number;
69
- total_available: number;
70
- resets_at: string;
71
- }>;
72
- export type CreditBalance = z.infer<typeof creditBalanceSchema>;
73
- //# sourceMappingURL=credits.schema.d.ts.map
@@ -1 +0,0 @@
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;;;;;;;;;;GAUG;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;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;GASG;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"}
@@ -1,52 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Credit-pack catalog. One-time purchases that top up
4
- * `profiles.tester_credits_balance`. Prices are denominated in USD now
5
- * (the `price_eur` field name kept for column-rename safety — Stripe
6
- * still treats it as the gross USD amount, see stripe-seed.ts).
7
- *
8
- * Margin: Haiku 4.5 worst-case = ~$0.013 per Tester run = ~$0.0026 per
9
- * credit. We charge $0.10–$0.12 per credit on top-ups, ~40-45× markup,
10
- * which keeps the per-credit price *higher* than any subscription
11
- * average so power-users always come out ahead by upgrading.
12
- */
13
- export const CREDIT_PACK_IDS = ['pack_25', 'pack_100'];
14
- export const creditPackIdSchema = z.enum(CREDIT_PACK_IDS);
15
- /**
16
- * Two top-up tiers — entry and refill. Per-credit price stays *higher*
17
- * than the subscription effective rates so a heavy user always saves
18
- * by upgrading instead of hoarding top-ups.
19
- *
20
- * Margin (per pack, full burn):
21
- * pack_25 ($3): ~$0.07 API + ~$0.39 Stripe = $0.46 cost. Net ~$2.54 (85%).
22
- * pack_100 ($10): ~$0.26 API + ~$0.59 Stripe = $0.85 cost. Net ~$9.15 (92%).
23
- * Both safely positive even on worst-case burn.
24
- */
25
- export const CREDIT_PACKS = {
26
- pack_25: {
27
- id: 'pack_25',
28
- credits: 25,
29
- price_eur: 3,
30
- blurb: 'Quick top-up when you hit the wall.',
31
- },
32
- pack_100: {
33
- id: 'pack_100',
34
- credits: 100,
35
- price_eur: 10,
36
- blurb: 'Best value for active builders.',
37
- },
38
- };
39
- export const creditCheckoutInputSchema = z.object({
40
- pack: creditPackIdSchema,
41
- });
42
- export const creditBalanceSchema = z.object({
43
- monthly_quota: z.number().int().nonnegative(),
44
- monthly_used: z.number().int().nonnegative(),
45
- monthly_remaining: z.number().int().nonnegative(),
46
- /** Purchased top-up balance (never expires). */
47
- balance: z.number().int().nonnegative(),
48
- /** Total credits available right now (monthly_remaining + balance). */
49
- total_available: z.number().int().nonnegative(),
50
- /** ISO timestamp when the monthly window resets. */
51
- resets_at: z.string().datetime(),
52
- });
@@ -1,56 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * KV — per-run persistent key/value store, encrypted at rest.
4
- *
5
- * Lives in the `run_kv` table. Each row is scoped to a single `run_id`;
6
- * RLS for dashboard reads, JWT-scoped service-role for SDK reads.
7
- *
8
- * Designed for the canonical "skill exchanged OAuth code → access token,
9
- * stashes it for the next cron tick" pattern. Values are opaque blobs
10
- * (we don't introspect them); 64KB per value, optional TTL.
11
- */
12
- export declare const kvKeySchema: z.ZodString;
13
- export type KvKey = z.infer<typeof kvKeySchema>;
14
- export declare const kvEntrySchema: z.ZodObject<{
15
- key: z.ZodString;
16
- value: z.ZodString;
17
- size_bytes: z.ZodNumber;
18
- expires_at: z.ZodNullable<z.ZodString>;
19
- updated_at: z.ZodString;
20
- }, "strip", z.ZodTypeAny, {
21
- value: string;
22
- size_bytes: number;
23
- updated_at: string;
24
- expires_at: string | null;
25
- key: string;
26
- }, {
27
- value: string;
28
- size_bytes: number;
29
- updated_at: string;
30
- expires_at: string | null;
31
- key: string;
32
- }>;
33
- export type KvEntry = z.infer<typeof kvEntrySchema>;
34
- export declare const kvPutInputSchema: z.ZodObject<{
35
- value: z.ZodString;
36
- ttl_seconds: z.ZodOptional<z.ZodNumber>;
37
- }, "strip", z.ZodTypeAny, {
38
- value: string;
39
- ttl_seconds?: number | undefined;
40
- }, {
41
- value: string;
42
- ttl_seconds?: number | undefined;
43
- }>;
44
- export type KvPutInput = z.infer<typeof kvPutInputSchema>;
45
- export declare const kvListQuerySchema: z.ZodObject<{
46
- prefix: z.ZodOptional<z.ZodString>;
47
- limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
48
- }, "strip", z.ZodTypeAny, {
49
- limit?: number | undefined;
50
- prefix?: string | undefined;
51
- }, {
52
- limit?: number | undefined;
53
- prefix?: string | undefined;
54
- }>;
55
- export type KvListQuery = z.infer<typeof kvListQuerySchema>;
56
- //# sourceMappingURL=kv.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kv.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/kv.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;GASG;AAMH,eAAO,MAAM,WAAW,aAOrB,CAAA;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAE/C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAMxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAKnD,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAGzD,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
@@ -1,39 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * KV — per-run persistent key/value store, encrypted at rest.
4
- *
5
- * Lives in the `run_kv` table. Each row is scoped to a single `run_id`;
6
- * RLS for dashboard reads, JWT-scoped service-role for SDK reads.
7
- *
8
- * Designed for the canonical "skill exchanged OAuth code → access token,
9
- * stashes it for the next cron tick" pattern. Values are opaque blobs
10
- * (we don't introspect them); 64KB per value, optional TTL.
11
- */
12
- // Same shape as a URL path-segment with a few "scoped" delimiters so
13
- // skills can build namespaces (`oauth:tiktok:state`, `queue:pending`).
14
- // We keep it permissive enough not to surprise users; the colon /
15
- // dash / dot are common across all KV ecosystems.
16
- export const kvKeySchema = z
17
- .string()
18
- .min(1)
19
- .max(256)
20
- .regex(/^[A-Za-z0-9_\-.:]+$/, 'Letters, digits, and any of `_ - . :` — no spaces or slashes.');
21
- export const kvEntrySchema = z.object({
22
- key: kvKeySchema,
23
- value: z.string(),
24
- size_bytes: z.number().int().nonnegative(),
25
- expires_at: z.string().datetime().nullable(),
26
- updated_at: z.string().datetime(),
27
- });
28
- // Body for PUT /api/v1/sdk/kv/:key (the SDK route) and PUT
29
- // /api/v1/runs/:slug/kv/:key (the dashboard debug route). ttlSeconds
30
- // translates to expires_at = now() + ttlSeconds in the service layer.
31
- export const kvPutInputSchema = z.object({
32
- value: z.string().max(65_536),
33
- ttl_seconds: z.number().int().positive().max(60 * 60 * 24 * 365).optional(),
34
- });
35
- // GET list filter — prefix is the only filter supported.
36
- export const kvListQuerySchema = z.object({
37
- prefix: z.string().max(256).optional(),
38
- limit: z.number().int().min(1).max(1_000).default(100).optional(),
39
- });