post-engineer-mcp 1.52.599 → 1.52.605

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 (113) hide show
  1. package/dist/client-batch.d.ts +3 -1
  2. package/dist/client-batch.js +4 -1
  3. package/dist/client-batch.js.map +1 -1
  4. package/dist/client-billing.d.ts +5 -0
  5. package/dist/client-billing.js +34 -0
  6. package/dist/client-billing.js.map +1 -0
  7. package/dist/client-experiments.d.ts +5 -14
  8. package/dist/client-experiments.js +17 -3
  9. package/dist/client-experiments.js.map +1 -1
  10. package/dist/client-posts.d.ts +12 -6
  11. package/dist/client-posts.js +22 -11
  12. package/dist/client-posts.js.map +1 -1
  13. package/dist/client-prompts.d.ts +4 -8
  14. package/dist/client-prompts.js +7 -24
  15. package/dist/client-prompts.js.map +1 -1
  16. package/dist/client-publish-uploaded.d.ts +8 -1
  17. package/dist/client-publish-uploaded.js +121 -49
  18. package/dist/client-publish-uploaded.js.map +1 -1
  19. package/dist/client-publishing-accounts.d.ts +4 -2
  20. package/dist/client-publishing-accounts.js +6 -2
  21. package/dist/client-publishing-accounts.js.map +1 -1
  22. package/dist/client-types.d.ts +5 -4
  23. package/dist/client-user-media.d.ts +4 -3
  24. package/dist/client-user-media.js +17 -47
  25. package/dist/client-user-media.js.map +1 -1
  26. package/dist/client-video-task.d.ts +3 -1
  27. package/dist/client-video-task.js +4 -1
  28. package/dist/client-video-task.js.map +1 -1
  29. package/dist/client.d.ts +40 -39
  30. package/dist/client.js +80 -148
  31. package/dist/client.js.map +1 -1
  32. package/dist/cloned-voice-client.d.ts +7 -5
  33. package/dist/cloned-voice-client.js +10 -4
  34. package/dist/cloned-voice-client.js.map +1 -1
  35. package/dist/connect-account.js +14 -6
  36. package/dist/connect-account.js.map +1 -1
  37. package/dist/contract-response.d.ts +8 -0
  38. package/dist/contract-response.js +24 -0
  39. package/dist/contract-response.js.map +1 -0
  40. package/dist/contracts/accounts.d.ts +844 -0
  41. package/dist/contracts/accounts.js +346 -0
  42. package/dist/contracts/accounts.js.map +1 -0
  43. package/dist/contracts/billing.d.ts +109 -0
  44. package/dist/contracts/billing.js +88 -0
  45. package/dist/contracts/billing.js.map +1 -0
  46. package/dist/contracts/endpoint.d.ts +45 -0
  47. package/dist/contracts/endpoint.js +8 -0
  48. package/dist/contracts/endpoint.js.map +1 -0
  49. package/dist/contracts/experiments.d.ts +271 -0
  50. package/dist/contracts/experiments.js +170 -0
  51. package/dist/contracts/experiments.js.map +1 -0
  52. package/dist/contracts/media.d.ts +165 -0
  53. package/dist/contracts/media.js +139 -0
  54. package/dist/contracts/media.js.map +1 -0
  55. package/dist/contracts/metrics.d.ts +351 -0
  56. package/dist/contracts/metrics.js +256 -0
  57. package/dist/contracts/metrics.js.map +1 -0
  58. package/dist/contracts/personas.d.ts +560 -0
  59. package/dist/contracts/personas.js +346 -0
  60. package/dist/contracts/personas.js.map +1 -0
  61. package/dist/contracts/posts.d.ts +485 -0
  62. package/dist/contracts/posts.js +153 -0
  63. package/dist/contracts/posts.js.map +1 -0
  64. package/dist/contracts/prompts.d.ts +90 -0
  65. package/dist/contracts/prompts.js +48 -0
  66. package/dist/contracts/prompts.js.map +1 -0
  67. package/dist/contracts/schedule.d.ts +691 -0
  68. package/dist/contracts/schedule.js +264 -0
  69. package/dist/contracts/schedule.js.map +1 -0
  70. package/dist/contracts/video-tasks.d.ts +181 -0
  71. package/dist/contracts/video-tasks.js +121 -0
  72. package/dist/contracts/video-tasks.js.map +1 -0
  73. package/dist/contracts/videos.d.ts +693 -0
  74. package/dist/contracts/videos.js +443 -0
  75. package/dist/contracts/videos.js.map +1 -0
  76. package/dist/contracts/voices.d.ts +237 -0
  77. package/dist/contracts/voices.js +118 -0
  78. package/dist/contracts/voices.js.map +1 -0
  79. package/dist/generate-video.d.ts +33 -33
  80. package/dist/generate-video.js +13 -1
  81. package/dist/generate-video.js.map +1 -1
  82. package/dist/intent-content.js +1 -1
  83. package/dist/intent-personas.js +17 -7
  84. package/dist/intent-personas.js.map +1 -1
  85. package/dist/limits.d.ts +27 -44
  86. package/dist/limits.js +27 -45
  87. package/dist/limits.js.map +1 -1
  88. package/dist/persona-delete.js +9 -9
  89. package/dist/persona-delete.js.map +1 -1
  90. package/dist/persona-update.js +3 -2
  91. package/dist/persona-update.js.map +1 -1
  92. package/dist/script-segments.d.ts +1 -1
  93. package/dist/script-segments.js +1 -1
  94. package/dist/single-video-shape.d.ts +5 -5
  95. package/dist/single-video-shape.js +1 -1
  96. package/dist/tools-batch.d.ts +42 -42
  97. package/dist/tools-batch.js +12 -36
  98. package/dist/tools-batch.js.map +1 -1
  99. package/dist/tools-experiments.d.ts +11 -11
  100. package/dist/tools-experiments.js +17 -9
  101. package/dist/tools-experiments.js.map +1 -1
  102. package/dist/tools-pinterest.js +5 -15
  103. package/dist/tools-pinterest.js.map +1 -1
  104. package/dist/tools-single-video.js +14 -51
  105. package/dist/tools-single-video.js.map +1 -1
  106. package/dist/tools-user-media.js +3 -1
  107. package/dist/tools-user-media.js.map +1 -1
  108. package/dist/tools.d.ts +0 -25
  109. package/dist/tools.js +56 -96
  110. package/dist/tools.js.map +1 -1
  111. package/dist/voice-filters.js +2 -1
  112. package/dist/voice-filters.js.map +1 -1
  113. package/package.json +1 -1
@@ -0,0 +1,346 @@
1
+ // GENERATED from shared/contracts — do not edit.
2
+ // Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
3
+ //---------------
4
+ // accounts — the social-accounts contract, shared by the web routes and
5
+ // the MCP accounts tools.
6
+ //
7
+ // GET /api/account lists the caller's connected accounts (no tokens);
8
+ // DELETE disconnects one; POST /api/account/connect-url mints an OAuth
9
+ // URL for the seven OAuth providers (Bluesky takes an app password and
10
+ // Rumble a manual access token instead); POST /api/bluesky-connect,
11
+ // /api/threespeak-connect and /api/rumble-connect connect those three;
12
+ // GET /api/pinterest/boards lists one Pinterest account's boards; and
13
+ // GET/PUT /api/persona/publishing-accounts read/replace a persona's
14
+ // bound publishing accounts.
15
+ //
16
+ // The connect routes validate credentials by hand (JSON and, for
17
+ // Bluesky, multipart) with stable messages; the contract body schemas
18
+ // mirror those messages, pinned by the MCP tool-schema equivalence
19
+ // test. The publishing-accounts PUT normalizes server-side (unknown
20
+ // providers rejected, ids trimmed/deduped, empties dropped, at least
21
+ // one bound account required) — the contract body schema mirrors what
22
+ // the MCP sends, and those server rules stay server-side.
23
+ //---------------
24
+ import { z } from 'zod';
25
+ /** Define one endpoint contract. The literal path is preserved in the type
26
+ * so ParamsOf can read its `:param` segments. `Body`/`Query` default to
27
+ * `undefined` so an omitted optional schema stays `undefined` (not the
28
+ * bare `ZodType`) in the returned definition. */
29
+ export function defineEndpoint(config) {
30
+ return config;
31
+ }
32
+ import { SOCIAL_PROVIDERS } from './metrics.js';
33
+ /** OAuth providers served by POST /api/account/connect-url. Mirrors
34
+ * apps/web/lib/oauth-connect.ts (OAUTH_CONNECT_PROVIDERS): Bluesky,
35
+ * 3Speak and Rumble connect directly and are rejected here. */
36
+ export const OAUTH_CONNECT_PROVIDERS = ['youtube', 'instagram', 'linkedin', 'threads', 'facebook', 'pinterest', 'fanvue'];
37
+ export const ACCOUNT_SYNC_STATUSES = ['ok', 'error'];
38
+ //---------------
39
+ // Public account items — what GET /api/account returns, mirroring
40
+ // apps/web/lib/providers/registry.ts (PublicAccountItem) and
41
+ // apps/web/lib/types.ts (AccountData, InstagramAccountData). No tokens.
42
+ //---------------
43
+ const accountStatus = z.enum(ACCOUNT_SYNC_STATUSES).optional();
44
+ const accountTimestamps = { connectedAt: z.number(), lastUsed: z.number(), status: accountStatus };
45
+ export const YoutubeAccountSchema = z.object({
46
+ provider: z.literal('youtube'),
47
+ recordId: z.string(),
48
+ channelId: z.string(),
49
+ channelName: z.string(),
50
+ email: z.string().optional(),
51
+ thumbnail: z.string().optional(),
52
+ customUrl: z.string().optional(),
53
+ ...accountTimestamps,
54
+ statistics: z
55
+ .object({
56
+ subscriberCount: z.string().optional(),
57
+ viewCount: z.string().optional(),
58
+ videoCount: z.string().optional(),
59
+ hiddenSubscriberCount: z.boolean().optional(),
60
+ })
61
+ .optional(),
62
+ });
63
+ export const InstagramAccountSchema = z.object({
64
+ provider: z.literal('instagram'),
65
+ recordId: z.string(),
66
+ igUserId: z.string(),
67
+ username: z.string(),
68
+ name: z.string().optional(),
69
+ profilePictureUrl: z.string().optional(),
70
+ followersCount: z.number().optional(),
71
+ mediaCount: z.number().optional(),
72
+ ...accountTimestamps,
73
+ });
74
+ export const BlueskyAccountSchema = z.object({
75
+ provider: z.literal('bluesky'),
76
+ recordId: z.string(),
77
+ did: z.string(),
78
+ handle: z.string(),
79
+ displayName: z.string().optional(),
80
+ avatar: z.string().optional(),
81
+ ...accountTimestamps,
82
+ });
83
+ export const LinkedinAccountSchema = z.object({
84
+ provider: z.literal('linkedin'),
85
+ recordId: z.string(),
86
+ providerAccountId: z.string(),
87
+ accountName: z.string().nullable(),
88
+ accountMetadata: z
89
+ .object({ kind: z.enum(['member', 'organization']).optional(), name: z.string().nullable().optional() })
90
+ .optional(),
91
+ profilePictureUrl: z.string().optional(),
92
+ ...accountTimestamps,
93
+ });
94
+ export const ThreadsAccountSchema = z.object({
95
+ provider: z.literal('threads'),
96
+ recordId: z.string(),
97
+ providerAccountId: z.string(),
98
+ accountName: z.string().nullable(),
99
+ profilePictureUrl: z.string().optional(),
100
+ ...accountTimestamps,
101
+ });
102
+ export const FacebookAccountSchema = z.object({
103
+ provider: z.literal('facebook'),
104
+ recordId: z.string(),
105
+ providerAccountId: z.string(),
106
+ accountName: z.string().nullable(),
107
+ profilePictureUrl: z.string().optional(),
108
+ category: z.string().optional(),
109
+ followersCount: z.number().optional(),
110
+ ...accountTimestamps,
111
+ });
112
+ export const PinterestAccountSchema = z.object({
113
+ provider: z.literal('pinterest'),
114
+ recordId: z.string(),
115
+ providerAccountId: z.string(),
116
+ accountName: z.string().nullable(),
117
+ profilePictureUrl: z.string().optional(),
118
+ ...accountTimestamps,
119
+ });
120
+ export const ThreespeakAccountSchema = z.object({
121
+ provider: z.literal('3speak'),
122
+ recordId: z.string(),
123
+ providerAccountId: z.string(),
124
+ accountName: z.string().nullable(),
125
+ ...accountTimestamps,
126
+ });
127
+ export const RumbleAccountSchema = z.object({
128
+ provider: z.literal('rumble'),
129
+ recordId: z.string(),
130
+ providerAccountId: z.string(),
131
+ accountName: z.string().nullable(),
132
+ ...accountTimestamps,
133
+ });
134
+ export const FanvueAccountSchema = z.object({
135
+ provider: z.literal('fanvue'),
136
+ recordId: z.string(),
137
+ providerAccountId: z.string(),
138
+ accountName: z.string().nullable(),
139
+ profilePictureUrl: z.string().optional(),
140
+ ...accountTimestamps,
141
+ });
142
+ export const PublicAccountItemSchema = z.discriminatedUnion('provider', [
143
+ YoutubeAccountSchema,
144
+ InstagramAccountSchema,
145
+ BlueskyAccountSchema,
146
+ LinkedinAccountSchema,
147
+ ThreadsAccountSchema,
148
+ FacebookAccountSchema,
149
+ PinterestAccountSchema,
150
+ ThreespeakAccountSchema,
151
+ RumbleAccountSchema,
152
+ FanvueAccountSchema,
153
+ ]);
154
+ // A non-blank credential field: the routes trim and reject blanks with
155
+ // the same message, so the schema does too.
156
+ function nonBlank(message) {
157
+ return z
158
+ .string()
159
+ .min(1, message)
160
+ .refine((value) => value.trim().length > 0, { message });
161
+ }
162
+ //---------------
163
+ // Request bodies — mirror the routes' hand-rolled validation.
164
+ //---------------
165
+ export const ConnectUrlBodySchema = z.object({
166
+ provider: z.enum(OAUTH_CONNECT_PROVIDERS),
167
+ });
168
+ export const BlueskyConnectBodySchema = z.object({
169
+ handle: nonBlank('Bluesky handle is required.'),
170
+ appPassword: nonBlank('Bluesky app password is required.'),
171
+ });
172
+ export const ThreespeakConnectBodySchema = z.object({
173
+ username: nonBlank('Hive username is required.'),
174
+ postingKey: nonBlank('Hive posting key is required.'),
175
+ });
176
+ export const RumbleConnectBodySchema = z.object({
177
+ channelId: nonBlank('Rumble channel ID is required.'),
178
+ accessToken: nonBlank('Rumble access token is required.'),
179
+ });
180
+ export const DisconnectAccountQuerySchema = z.strictObject({
181
+ provider: z.string(),
182
+ providerAccountId: z.string(),
183
+ });
184
+ export const ListPinterestBoardsQuerySchema = z.strictObject({
185
+ accountId: z.string(),
186
+ });
187
+ export const GetPersonaPublishingAccountsQuerySchema = z.strictObject({
188
+ personaId: z.string(),
189
+ });
190
+ export const SetPersonaPublishingAccountsBodySchema = z.object({
191
+ accounts: z.record(z.string(), z.array(z.string().min(1))),
192
+ });
193
+ //---------------
194
+ // Query parsers — the validators the routes call, mirroring their
195
+ // 400 messages exactly (metrics.ts pattern). The query schemas above
196
+ // are descriptive (raw strings); these are the validators.
197
+ //---------------
198
+ const UUID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
199
+ export function parseDisconnectAccountQuery(params) {
200
+ const provider = params.get('provider');
201
+ const providerAccountId = params.get('providerAccountId');
202
+ if (!provider || !providerAccountId) {
203
+ return { ok: false, error: 'provider and providerAccountId are required.', code: 'INVALID_PARAMS' };
204
+ }
205
+ if (!SOCIAL_PROVIDERS.includes(provider)) {
206
+ return { ok: false, error: 'Unknown provider.', code: 'INVALID_PROVIDER' };
207
+ }
208
+ return { ok: true, query: { provider, providerAccountId } };
209
+ }
210
+ export function parseListPinterestBoardsQuery(params) {
211
+ const accountId = params.get('accountId');
212
+ if (accountId === null || accountId.trim() === '') {
213
+ return { ok: false, error: 'accountId is required.' };
214
+ }
215
+ // The route looks the token up by the trimmed id.
216
+ return { ok: true, accountId: accountId.trim() };
217
+ }
218
+ // Placeholder/sentinel ids (e.g. 'p-1' from an unthinking caller — the
219
+ // production warnings were `invalid input syntax for type uuid: "p-1"`)
220
+ // never reach Postgres: a stable validation 400 answers them with a
221
+ // machine-readable field, instead of a PostgREST error the UI can't
222
+ // classify and PostHog can't group (same convention as issue #216).
223
+ // Same canonical-shape check the engine's SAFE_TASK_ID enforces upstream:
224
+ // a uuid-shaped string (any version layout the DB generates).
225
+ export function parsePersonaPublishingAccountsQuery(params) {
226
+ const personaId = params.get('personaId');
227
+ if (!personaId)
228
+ return { ok: false, error: 'personaId is required.' };
229
+ if (!UUID_SHAPE.test(personaId))
230
+ return { ok: false, error: 'personaId must be a UUID.' };
231
+ return { ok: true, personaId };
232
+ }
233
+ //---------------
234
+ // Response views.
235
+ //---------------
236
+ export const ListSocialAccountsResponseSchema = z.object({
237
+ authenticated: z.literal(true),
238
+ accounts: z.array(PublicAccountItemSchema),
239
+ message: z.string(),
240
+ });
241
+ export const DisconnectAccountResponseSchema = z.object({
242
+ success: z.literal(true),
243
+ });
244
+ export const ConnectUrlResponseSchema = z.object({
245
+ success: z.literal(true),
246
+ auth_url: z.string(),
247
+ });
248
+ export const BlueskyConnectResponseSchema = z.object({
249
+ success: z.literal(true),
250
+ accountId: z.string(),
251
+ did: z.string(),
252
+ });
253
+ export const ThreespeakConnectResponseSchema = z.object({
254
+ success: z.literal(true),
255
+ accountId: z.string(),
256
+ username: z.string(),
257
+ });
258
+ export const RumbleConnectResponseSchema = z.object({
259
+ success: z.literal(true),
260
+ accountId: z.string(),
261
+ channelId: z.string(),
262
+ });
263
+ export const PinterestBoardSchema = z.object({
264
+ id: z.string(),
265
+ name: z.string(),
266
+ });
267
+ export const ListPinterestBoardsResponseSchema = z.object({
268
+ success: z.literal(true),
269
+ boards: z.array(PinterestBoardSchema),
270
+ });
271
+ // Every known provider is always present (possibly empty) — the GET
272
+ // returns the full map, never a partial one.
273
+ export const PersonaPublishingAccountsSchema = z.object({
274
+ youtube: z.array(z.string()),
275
+ instagram: z.array(z.string()),
276
+ bluesky: z.array(z.string()),
277
+ linkedin: z.array(z.string()),
278
+ threads: z.array(z.string()),
279
+ facebook: z.array(z.string()),
280
+ pinterest: z.array(z.string()),
281
+ '3speak': z.array(z.string()),
282
+ rumble: z.array(z.string()),
283
+ fanvue: z.array(z.string()),
284
+ });
285
+ export const PersonaPublishingAccountsResponseSchema = z.object({
286
+ success: z.literal(true),
287
+ defaults: PersonaPublishingAccountsSchema,
288
+ });
289
+ //---------------
290
+ // Endpoints.
291
+ //---------------
292
+ export const listSocialAccounts = defineEndpoint({
293
+ method: 'GET',
294
+ path: '/api/account',
295
+ response: ListSocialAccountsResponseSchema,
296
+ });
297
+ export const disconnectAccount = defineEndpoint({
298
+ method: 'DELETE',
299
+ path: '/api/account',
300
+ query: DisconnectAccountQuerySchema,
301
+ response: DisconnectAccountResponseSchema,
302
+ });
303
+ export const getOAuthConnectUrl = defineEndpoint({
304
+ method: 'POST',
305
+ path: '/api/account/connect-url',
306
+ body: ConnectUrlBodySchema,
307
+ response: ConnectUrlResponseSchema,
308
+ });
309
+ export const connectBlueskyAccount = defineEndpoint({
310
+ method: 'POST',
311
+ path: '/api/bluesky-connect',
312
+ body: BlueskyConnectBodySchema,
313
+ response: BlueskyConnectResponseSchema,
314
+ });
315
+ export const connectThreespeakAccount = defineEndpoint({
316
+ method: 'POST',
317
+ path: '/api/threespeak-connect',
318
+ body: ThreespeakConnectBodySchema,
319
+ response: ThreespeakConnectResponseSchema,
320
+ });
321
+ export const connectRumbleAccount = defineEndpoint({
322
+ method: 'POST',
323
+ path: '/api/rumble-connect',
324
+ body: RumbleConnectBodySchema,
325
+ response: RumbleConnectResponseSchema,
326
+ });
327
+ export const listPinterestBoards = defineEndpoint({
328
+ method: 'GET',
329
+ path: '/api/pinterest/boards',
330
+ query: ListPinterestBoardsQuerySchema,
331
+ response: ListPinterestBoardsResponseSchema,
332
+ });
333
+ export const getPersonaPublishingAccounts = defineEndpoint({
334
+ method: 'GET',
335
+ path: '/api/persona/publishing-accounts',
336
+ query: GetPersonaPublishingAccountsQuerySchema,
337
+ response: PersonaPublishingAccountsResponseSchema,
338
+ });
339
+ export const setPersonaPublishingAccounts = defineEndpoint({
340
+ method: 'PUT',
341
+ path: '/api/persona/publishing-accounts',
342
+ query: GetPersonaPublishingAccountsQuerySchema,
343
+ body: SetPersonaPublishingAccountsBodySchema,
344
+ response: PersonaPublishingAccountsResponseSchema,
345
+ });
346
+ //# sourceMappingURL=accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/contracts/accounts.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,iBAAiB;AACjB,wEAAwE;AACxE,0BAA0B;AAC1B,EAAE;AACF,sEAAsE;AACtE,uEAAuE;AACvE,uEAAuE;AACvE,oEAAoE;AACpE,uEAAuE;AACvE,sEAAsE;AACtE,oEAAoE;AACpE,6BAA6B;AAC7B,EAAE;AACF,iEAAiE;AACjE,sEAAsE;AACtE,mEAAmE;AACnE,oEAAoE;AACpE,qEAAqE;AACrE,sEAAsE;AACtE,0DAA0D;AAC1D,iBAAiB;AAEjB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB;;;iDAGiD;AACjD,MAAM,UAAU,cAAc,CAK5B,MAMD;IACC,OAAO,MAAM,CAAC;AAChB,CAAC;AAgCD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;+DAE+D;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAGnI,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,OAAO,CAAU,CAAC;AAE9D,iBAAiB;AACjB,kEAAkE;AAClE,6DAA6D;AAC7D,wEAAwE;AACxE,iBAAiB;AACjB,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC/D,MAAM,iBAAiB,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AAEnG,MAAM,CAAC,MAAM,oBAA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E,uCAAuC;CAClD,CAAC,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { z } from 'zod';
2
+ export type EndpointMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
3
+ export interface EndpointDefinition<Body extends z.ZodType | undefined, Query extends z.ZodType | undefined, Response extends z.ZodType, Path extends string> {
4
+ method: EndpointMethod;
5
+ path: Path;
6
+ body?: Body;
7
+ query?: Query;
8
+ response: Response;
9
+ }
10
+ /** Define one endpoint contract. The literal path is preserved in the type
11
+ * so ParamsOf can read its `:param` segments. `Body`/`Query` default to
12
+ * `undefined` so an omitted optional schema stays `undefined` (not the
13
+ * bare `ZodType`) in the returned definition. */
14
+ export declare function defineEndpoint<Body extends z.ZodType | undefined = undefined, Query extends z.ZodType | undefined = undefined, Response extends z.ZodType = z.ZodType, Path extends string = string>(config: {
15
+ method: EndpointMethod;
16
+ path: Path;
17
+ body?: Body;
18
+ query?: Query;
19
+ response: Response;
20
+ }): EndpointDefinition<Body, Query, Response, Path>;
21
+ /** Request body input type (`z.input` of the `body` schema). Indexed
22
+ * access is used (not infer) so an optional `body?` property keeps its
23
+ * schema type instead of widening to `unknown`. */
24
+ export type BodyOf<Endpoint extends {
25
+ body?: z.ZodType | undefined;
26
+ }> = [
27
+ Exclude<Endpoint['body'], undefined>
28
+ ] extends [never] ? never : Exclude<Endpoint['body'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['body'], undefined>> : never;
29
+ /** Query input type (`z.input` of the `query` schema). */
30
+ export type QueryOf<Endpoint extends {
31
+ query?: z.ZodType | undefined;
32
+ }> = [
33
+ Exclude<Endpoint['query'], undefined>
34
+ ] extends [never] ? never : Exclude<Endpoint['query'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['query'], undefined>> : never;
35
+ /** Response output type (`z.output` of the `response` schema). */
36
+ export type ResponseOf<Endpoint extends {
37
+ response: z.ZodType;
38
+ }> = Endpoint['response'] extends z.ZodType ? z.output<Endpoint['response']> : never;
39
+ /** Path params from a path template: each `:name` segment becomes a
40
+ * `string` field. A path without segments is an empty record. */
41
+ export type ParamsOf<Path extends string> = Path extends `${string}:${infer Rest}` ? Rest extends `${infer Name}/${infer After}` ? {
42
+ [Key in Name]: string;
43
+ } & ParamsOf<`/${After}`> : {
44
+ [Key in Rest]: string;
45
+ } : Record<never, never>;
46
+ /** Ledger paging defaults (also the MCP client's fail-fast bound). */
47
+ export declare const TOKEN_TRANSACTIONS_DEFAULT_LIMIT = 20;
48
+ export declare const TOKEN_TRANSACTIONS_MAX_LIMIT = 100;
49
+ export declare const TOKEN_TRANSACTIONS_DEFAULT_OFFSET = 0;
50
+ export declare function parseTransactionsLimit(value: string | null): number;
51
+ export declare function parseTransactionsOffset(value: string | null): number;
52
+ export declare const TokenBalanceResponseSchema: z.ZodObject<{
53
+ success: z.ZodLiteral<true>;
54
+ balance: z.ZodNumber;
55
+ free: z.ZodNumber;
56
+ }, z.core.$strip>;
57
+ export declare const TokenTransactionSchema: z.ZodObject<{
58
+ id: z.ZodString;
59
+ amount: z.ZodNumber;
60
+ type: z.ZodString;
61
+ description: z.ZodNullable<z.ZodString>;
62
+ reason: z.ZodNullable<z.ZodString>;
63
+ generationId: z.ZodNullable<z.ZodString>;
64
+ createdAt: z.ZodString;
65
+ }, z.core.$strip>;
66
+ export declare const ListTokenTransactionsResponseSchema: z.ZodObject<{
67
+ success: z.ZodLiteral<true>;
68
+ transactions: z.ZodArray<z.ZodObject<{
69
+ id: z.ZodString;
70
+ amount: z.ZodNumber;
71
+ type: z.ZodString;
72
+ description: z.ZodNullable<z.ZodString>;
73
+ reason: z.ZodNullable<z.ZodString>;
74
+ generationId: z.ZodNullable<z.ZodString>;
75
+ createdAt: z.ZodString;
76
+ }, z.core.$strip>>;
77
+ total: z.ZodNumber;
78
+ limit: z.ZodNumber;
79
+ offset: z.ZodNumber;
80
+ }, z.core.$strip>;
81
+ /** Raw paging params as the MCP sends them (strings in the query). Plain
82
+ * object, not strict: the route ignores unknown query params. */
83
+ export declare const ListTokenTransactionsQuerySchema: z.ZodObject<{
84
+ limit: z.ZodOptional<z.ZodString>;
85
+ offset: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strip>;
87
+ export declare const getTokenBalance: EndpointDefinition<undefined, undefined, z.ZodObject<{
88
+ success: z.ZodLiteral<true>;
89
+ balance: z.ZodNumber;
90
+ free: z.ZodNumber;
91
+ }, z.core.$strip>, "/api/billing/tokens">;
92
+ export declare const listTokenTransactions: EndpointDefinition<undefined, z.ZodObject<{
93
+ limit: z.ZodOptional<z.ZodString>;
94
+ offset: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>, z.ZodObject<{
96
+ success: z.ZodLiteral<true>;
97
+ transactions: z.ZodArray<z.ZodObject<{
98
+ id: z.ZodString;
99
+ amount: z.ZodNumber;
100
+ type: z.ZodString;
101
+ description: z.ZodNullable<z.ZodString>;
102
+ reason: z.ZodNullable<z.ZodString>;
103
+ generationId: z.ZodNullable<z.ZodString>;
104
+ createdAt: z.ZodString;
105
+ }, z.core.$strip>>;
106
+ total: z.ZodNumber;
107
+ limit: z.ZodNumber;
108
+ offset: z.ZodNumber;
109
+ }, z.core.$strip>, "/api/billing/transactions">;
@@ -0,0 +1,88 @@
1
+ // GENERATED from shared/contracts — do not edit.
2
+ // Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
3
+ // Billing contract: the single source of truth for GET /api/billing/tokens
4
+ // and GET /api/billing/transactions. Both apps generate a copy of this file
5
+ // (see scripts/sync-contracts.mjs); never edit a generated copy by hand.
6
+ //
7
+ // GET /api/billing/tokens returns the prepaid wallet balance (paid + free).
8
+ // GET /api/billing/transactions returns the token ledger, newest first,
9
+ // paginated. The paging query is LENIENT by design (long-standing route
10
+ // behavior): an invalid or out-of-range limit/offset falls back to the
11
+ // default instead of failing, so the query schema below only names the
12
+ // params and the parse helpers carry the fallback. `success` is a literal
13
+ // `true`: the routes never return success:false with a 200.
14
+ import { z } from 'zod';
15
+ /** Define one endpoint contract. The literal path is preserved in the type
16
+ * so ParamsOf can read its `:param` segments. `Body`/`Query` default to
17
+ * `undefined` so an omitted optional schema stays `undefined` (not the
18
+ * bare `ZodType`) in the returned definition. */
19
+ export function defineEndpoint(config) {
20
+ return config;
21
+ }
22
+ /** Ledger paging defaults (also the MCP client's fail-fast bound). */
23
+ export const TOKEN_TRANSACTIONS_DEFAULT_LIMIT = 20;
24
+ export const TOKEN_TRANSACTIONS_MAX_LIMIT = 100;
25
+ export const TOKEN_TRANSACTIONS_DEFAULT_OFFSET = 0;
26
+ //---------------
27
+ // parseTransactionsLimit — validates the ?limit= query param; invalid or
28
+ // out-of-range values fall back to the default instead of failing.
29
+ //---------------
30
+ export function parseTransactionsLimit(value) {
31
+ if (value === null || !/^\d+$/.test(value))
32
+ return TOKEN_TRANSACTIONS_DEFAULT_LIMIT;
33
+ const parsed = Number.parseInt(value, 10);
34
+ if (!Number.isInteger(parsed) || parsed < 1)
35
+ return TOKEN_TRANSACTIONS_DEFAULT_LIMIT;
36
+ return Math.min(parsed, TOKEN_TRANSACTIONS_MAX_LIMIT);
37
+ }
38
+ //---------------
39
+ // parseTransactionsOffset — validates the ?offset= query param; invalid or
40
+ // negative values fall back to 0 instead of failing.
41
+ //---------------
42
+ export function parseTransactionsOffset(value) {
43
+ if (value === null || !/^\d+$/.test(value))
44
+ return TOKEN_TRANSACTIONS_DEFAULT_OFFSET;
45
+ const parsed = Number.parseInt(value, 10);
46
+ if (!Number.isInteger(parsed) || parsed < 0)
47
+ return TOKEN_TRANSACTIONS_DEFAULT_OFFSET;
48
+ return parsed;
49
+ }
50
+ export const TokenBalanceResponseSchema = z.object({
51
+ success: z.literal(true),
52
+ balance: z.number(),
53
+ free: z.number(),
54
+ });
55
+ export const TokenTransactionSchema = z.object({
56
+ id: z.string(),
57
+ amount: z.number(),
58
+ type: z.string(),
59
+ description: z.string().nullable(),
60
+ reason: z.string().nullable(),
61
+ generationId: z.string().nullable(),
62
+ createdAt: z.string(),
63
+ });
64
+ export const ListTokenTransactionsResponseSchema = z.object({
65
+ success: z.literal(true),
66
+ transactions: z.array(TokenTransactionSchema),
67
+ total: z.number(),
68
+ limit: z.number(),
69
+ offset: z.number(),
70
+ });
71
+ /** Raw paging params as the MCP sends them (strings in the query). Plain
72
+ * object, not strict: the route ignores unknown query params. */
73
+ export const ListTokenTransactionsQuerySchema = z.object({
74
+ limit: z.string().optional(),
75
+ offset: z.string().optional(),
76
+ });
77
+ export const getTokenBalance = defineEndpoint({
78
+ method: 'GET',
79
+ path: '/api/billing/tokens',
80
+ response: TokenBalanceResponseSchema,
81
+ });
82
+ export const listTokenTransactions = defineEndpoint({
83
+ method: 'GET',
84
+ path: '/api/billing/transactions',
85
+ query: ListTokenTransactionsQuerySchema,
86
+ response: ListTokenTransactionsResponseSchema,
87
+ });
88
+ //# sourceMappingURL=billing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/contracts/billing.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,wEAAwE;AACxE,uEAAuE;AACvE,uEAAuE;AACvE,0EAA0E;AAC1E,4DAA4D;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB;;;iDAGiD;AACjD,MAAM,UAAU,cAAc,CAK5B,MAMD;IACC,OAAO,MAAM,CAAC;AAChB,CAAC;AAiCD,sEAAsE;AACtE,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAChD,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC;AAEnD,iBAAiB;AACjB,yEAAyE;AACzE,mEAAmE;AACnE,iBAAiB;AACjB,MAAM,UAAU,sBAAsB,CAAC,KAAoB;IACzD,IAAI,KAAK,KAAK,IAAI,IA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AClC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1D,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH;iEACiE;AACjE,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,0BAA0B;CACrC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;IAClD,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAAE,gCAAgC;IACvC,QAAQ,EAAE,mCAAmC;CAC9C,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ export type EndpointMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
3
+ export interface EndpointDefinition<Body extends z.ZodType | undefined, Query extends z.ZodType | undefined, Response extends z.ZodType, Path extends string> {
4
+ method: EndpointMethod;
5
+ path: Path;
6
+ body?: Body;
7
+ query?: Query;
8
+ response: Response;
9
+ }
10
+ /** Define one endpoint contract. The literal path is preserved in the type
11
+ * so ParamsOf can read its `:param` segments. `Body`/`Query` default to
12
+ * `undefined` so an omitted optional schema stays `undefined` (not the
13
+ * bare `ZodType`) in the returned definition. */
14
+ export declare function defineEndpoint<Body extends z.ZodType | undefined = undefined, Query extends z.ZodType | undefined = undefined, Response extends z.ZodType = z.ZodType, Path extends string = string>(config: {
15
+ method: EndpointMethod;
16
+ path: Path;
17
+ body?: Body;
18
+ query?: Query;
19
+ response: Response;
20
+ }): EndpointDefinition<Body, Query, Response, Path>;
21
+ /** Request body input type (`z.input` of the `body` schema). Indexed
22
+ * access is used (not infer) so an optional `body?` property keeps its
23
+ * schema type instead of widening to `unknown`. */
24
+ export type BodyOf<Endpoint extends {
25
+ body?: z.ZodType | undefined;
26
+ }> = [
27
+ Exclude<Endpoint['body'], undefined>
28
+ ] extends [never] ? never : Exclude<Endpoint['body'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['body'], undefined>> : never;
29
+ /** Query input type (`z.input` of the `query` schema). */
30
+ export type QueryOf<Endpoint extends {
31
+ query?: z.ZodType | undefined;
32
+ }> = [
33
+ Exclude<Endpoint['query'], undefined>
34
+ ] extends [never] ? never : Exclude<Endpoint['query'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['query'], undefined>> : never;
35
+ /** Response output type (`z.output` of the `response` schema). */
36
+ export type ResponseOf<Endpoint extends {
37
+ response: z.ZodType;
38
+ }> = Endpoint['response'] extends z.ZodType ? z.output<Endpoint['response']> : never;
39
+ /** Path params from a path template: each `:name` segment becomes a
40
+ * `string` field. A path without segments is an empty record. */
41
+ export type ParamsOf<Path extends string> = Path extends `${string}:${infer Rest}` ? Rest extends `${infer Name}/${infer After}` ? {
42
+ [Key in Name]: string;
43
+ } & ParamsOf<`/${After}`> : {
44
+ [Key in Rest]: string;
45
+ } : Record<never, never>;
@@ -0,0 +1,8 @@
1
+ /** Define one endpoint contract. The literal path is preserved in the type
2
+ * so ParamsOf can read its `:param` segments. `Body`/`Query` default to
3
+ * `undefined` so an omitted optional schema stays `undefined` (not the
4
+ * bare `ZodType`) in the returned definition. */
5
+ export function defineEndpoint(config) {
6
+ return config;
7
+ }
8
+ //# sourceMappingURL=endpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/contracts/endpoint.ts"],"names":[],"mappings":"AAwBA;;;iDAGiD;AACjD,MAAM,UAAU,cAAc,CAK5B,MAMD;IACC,OAAO,MAAM,CAAC;AAChB,CAAC"}