post-engineer-mcp 1.52.671 → 1.53.662

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 (260) hide show
  1. package/README.md +1 -2
  2. package/dist/account-shapes.d.ts +2 -0
  3. package/dist/account-shapes.js +0 -12
  4. package/dist/account-shapes.js.map +1 -1
  5. package/dist/action-tool.d.ts +0 -15
  6. package/dist/action-tool.js +0 -15
  7. package/dist/action-tool.js.map +1 -1
  8. package/dist/analytics.js +0 -39
  9. package/dist/analytics.js.map +1 -1
  10. package/dist/client-base-url.d.ts +2 -0
  11. package/dist/client-base-url.js +23 -0
  12. package/dist/client-base-url.js.map +1 -0
  13. package/dist/client-batch.js.map +1 -1
  14. package/dist/client-billing.js +0 -11
  15. package/dist/client-billing.js.map +1 -1
  16. package/dist/client-experiments.js +0 -9
  17. package/dist/client-experiments.js.map +1 -1
  18. package/dist/client-posts.js +0 -7
  19. package/dist/client-posts.js.map +1 -1
  20. package/dist/client-prompts.js +0 -2
  21. package/dist/client-prompts.js.map +1 -1
  22. package/dist/client-publish-existing.js +0 -13
  23. package/dist/client-publish-existing.js.map +1 -1
  24. package/dist/client-publish-uploaded.d.ts +0 -5
  25. package/dist/client-publish-uploaded.js +0 -48
  26. package/dist/client-publish-uploaded.js.map +1 -1
  27. package/dist/client-publishing-accounts.js +0 -7
  28. package/dist/client-publishing-accounts.js.map +1 -1
  29. package/dist/client-telegram.d.ts +4 -0
  30. package/dist/client-telegram.js +13 -0
  31. package/dist/client-telegram.js.map +1 -0
  32. package/dist/client-tool-config.js +0 -7
  33. package/dist/client-tool-config.js.map +1 -1
  34. package/dist/client-types.d.ts +11 -87
  35. package/dist/client-user-media.d.ts +0 -28
  36. package/dist/client-user-media.js +0 -42
  37. package/dist/client-user-media.js.map +1 -1
  38. package/dist/client-video-task.js +0 -5
  39. package/dist/client-video-task.js.map +1 -1
  40. package/dist/client.js +6 -119
  41. package/dist/client.js.map +1 -1
  42. package/dist/cloned-voice-client.d.ts +0 -8
  43. package/dist/cloned-voice-client.js +0 -49
  44. package/dist/cloned-voice-client.js.map +1 -1
  45. package/dist/cloned-voice-tools.d.ts +0 -5
  46. package/dist/cloned-voice-tools.js +0 -7
  47. package/dist/cloned-voice-tools.js.map +1 -1
  48. package/dist/connect-account.d.ts +14 -0
  49. package/dist/connect-account.js +47 -26
  50. package/dist/connect-account.js.map +1 -1
  51. package/dist/contract-response.js +0 -12
  52. package/dist/contract-response.js.map +1 -1
  53. package/dist/contracts/accounts.d.ts +114 -11
  54. package/dist/contracts/accounts.js +32 -56
  55. package/dist/contracts/accounts.js.map +1 -1
  56. package/dist/contracts/billing.d.ts +0 -14
  57. package/dist/contracts/billing.js +0 -26
  58. package/dist/contracts/billing.js.map +1 -1
  59. package/dist/contracts/endpoint.d.ts +0 -11
  60. package/dist/contracts/endpoint.js +0 -4
  61. package/dist/contracts/endpoint.js.map +1 -1
  62. package/dist/contracts/experiments.d.ts +0 -20
  63. package/dist/contracts/experiments.js +0 -34
  64. package/dist/contracts/experiments.js.map +1 -1
  65. package/dist/contracts/media.d.ts +0 -19
  66. package/dist/contracts/media.js +0 -58
  67. package/dist/contracts/media.js.map +1 -1
  68. package/dist/contracts/metrics.d.ts +6 -15
  69. package/dist/contracts/metrics.js +0 -74
  70. package/dist/contracts/metrics.js.map +1 -1
  71. package/dist/contracts/personas.d.ts +98 -19
  72. package/dist/contracts/personas.js +24 -93
  73. package/dist/contracts/personas.js.map +1 -1
  74. package/dist/contracts/posts.d.ts +9 -11
  75. package/dist/contracts/posts.js +1 -17
  76. package/dist/contracts/posts.js.map +1 -1
  77. package/dist/contracts/prompts.d.ts +0 -11
  78. package/dist/contracts/prompts.js +0 -15
  79. package/dist/contracts/prompts.js.map +1 -1
  80. package/dist/contracts/providers.d.ts +4 -17
  81. package/dist/contracts/providers.js +5 -30
  82. package/dist/contracts/providers.js.map +1 -1
  83. package/dist/contracts/schedule-warnings.d.ts +2 -0
  84. package/dist/contracts/schedule-warnings.js +0 -3
  85. package/dist/contracts/schedule-warnings.js.map +1 -1
  86. package/dist/contracts/schedule.d.ts +7 -14
  87. package/dist/contracts/schedule.js +1 -46
  88. package/dist/contracts/schedule.js.map +1 -1
  89. package/dist/contracts/tool-config.d.ts +0 -11
  90. package/dist/contracts/tool-config.js +0 -26
  91. package/dist/contracts/tool-config.js.map +1 -1
  92. package/dist/contracts/upload-types.d.ts +0 -3
  93. package/dist/contracts/upload-types.js +0 -10
  94. package/dist/contracts/upload-types.js.map +1 -1
  95. package/dist/contracts/video-tasks.d.ts +0 -23
  96. package/dist/contracts/video-tasks.js +0 -42
  97. package/dist/contracts/video-tasks.js.map +1 -1
  98. package/dist/contracts/videos.d.ts +40 -38
  99. package/dist/contracts/videos.js +3 -137
  100. package/dist/contracts/videos.js.map +1 -1
  101. package/dist/contracts/voices.d.ts +0 -24
  102. package/dist/contracts/voices.js +0 -34
  103. package/dist/contracts/voices.js.map +1 -1
  104. package/dist/direct-publish-form.js +0 -15
  105. package/dist/direct-publish-form.js.map +1 -1
  106. package/dist/direct-publish-narrowing.js +0 -5
  107. package/dist/direct-publish-narrowing.js.map +1 -1
  108. package/dist/errors.d.ts +0 -35
  109. package/dist/errors.js +0 -48
  110. package/dist/errors.js.map +1 -1
  111. package/dist/generate-video.d.ts +48 -4
  112. package/dist/generate-video.js +2 -6
  113. package/dist/generate-video.js.map +1 -1
  114. package/dist/http-auth.d.ts +0 -1
  115. package/dist/http-auth.js +0 -37
  116. package/dist/http-auth.js.map +1 -1
  117. package/dist/http-rate-limit.d.ts +0 -1
  118. package/dist/http-rate-limit.js +0 -18
  119. package/dist/http-rate-limit.js.map +1 -1
  120. package/dist/http-transport.js +0 -95
  121. package/dist/http-transport.js.map +1 -1
  122. package/dist/http-web.js +0 -16
  123. package/dist/http-web.js.map +1 -1
  124. package/dist/image-guards.d.ts +0 -4
  125. package/dist/image-guards.js +0 -11
  126. package/dist/image-guards.js.map +1 -1
  127. package/dist/index.js +0 -20
  128. package/dist/index.js.map +1 -1
  129. package/dist/intent-accounts.js +1 -6
  130. package/dist/intent-accounts.js.map +1 -1
  131. package/dist/intent-content.js +0 -7
  132. package/dist/intent-content.js.map +1 -1
  133. package/dist/intent-library.js +0 -4
  134. package/dist/intent-library.js.map +1 -1
  135. package/dist/intent-personas.js +0 -10
  136. package/dist/intent-personas.js.map +1 -1
  137. package/dist/intent-tool-config.js +0 -5
  138. package/dist/intent-tool-config.js.map +1 -1
  139. package/dist/intent-video.js +0 -5
  140. package/dist/intent-video.js.map +1 -1
  141. package/dist/intent-voices.js +0 -6
  142. package/dist/intent-voices.js.map +1 -1
  143. package/dist/language.d.ts +0 -8
  144. package/dist/language.js +0 -11
  145. package/dist/language.js.map +1 -1
  146. package/dist/limits.d.ts +1 -79
  147. package/dist/limits.js +1 -79
  148. package/dist/limits.js.map +1 -1
  149. package/dist/music-mood-field.js +0 -25
  150. package/dist/music-mood-field.js.map +1 -1
  151. package/dist/persona-avatar.d.ts +0 -13
  152. package/dist/persona-avatar.js +0 -40
  153. package/dist/persona-avatar.js.map +1 -1
  154. package/dist/persona-create.d.ts +96 -0
  155. package/dist/persona-create.js +39 -0
  156. package/dist/persona-create.js.map +1 -0
  157. package/dist/persona-cta-shape.d.ts +16 -0
  158. package/dist/persona-cta-shape.js +45 -0
  159. package/dist/persona-cta-shape.js.map +1 -0
  160. package/dist/persona-delete.js +0 -1
  161. package/dist/persona-delete.js.map +1 -1
  162. package/dist/persona-update.d.ts +26 -0
  163. package/dist/persona-update.js +2 -6
  164. package/dist/persona-update.js.map +1 -1
  165. package/dist/progress-poll-hint.d.ts +0 -6
  166. package/dist/progress-poll-hint.js +0 -15
  167. package/dist/progress-poll-hint.js.map +1 -1
  168. package/dist/prompts.js +0 -12
  169. package/dist/prompts.js.map +1 -1
  170. package/dist/public-ip.js +25 -58
  171. package/dist/public-ip.js.map +1 -1
  172. package/dist/publish-direct-shape.d.ts +2 -0
  173. package/dist/publish-direct-shape.js +0 -4
  174. package/dist/publish-direct-shape.js.map +1 -1
  175. package/dist/publish-existing-shape.d.ts +0 -7
  176. package/dist/publish-existing-shape.js +0 -26
  177. package/dist/publish-existing-shape.js.map +1 -1
  178. package/dist/publish-notices.js +0 -2
  179. package/dist/publish-notices.js.map +1 -1
  180. package/dist/publish-uploaded-shape.d.ts +2 -0
  181. package/dist/publish-uploaded-shape.js +0 -7
  182. package/dist/publish-uploaded-shape.js.map +1 -1
  183. package/dist/recipe-session.d.ts +0 -4
  184. package/dist/recipe-session.js +0 -17
  185. package/dist/recipe-session.js.map +1 -1
  186. package/dist/refs.d.ts +0 -11
  187. package/dist/refs.js +1 -15
  188. package/dist/refs.js.map +1 -1
  189. package/dist/remote-shapes.d.ts +52 -2
  190. package/dist/remote-shapes.js +2 -16
  191. package/dist/remote-shapes.js.map +1 -1
  192. package/dist/require-api-key.js +0 -2
  193. package/dist/require-api-key.js.map +1 -1
  194. package/dist/require-publishing-accounts.js +0 -7
  195. package/dist/require-publishing-accounts.js.map +1 -1
  196. package/dist/require-title.js +0 -4
  197. package/dist/require-title.js.map +1 -1
  198. package/dist/schedule-shapes.js +0 -19
  199. package/dist/schedule-shapes.js.map +1 -1
  200. package/dist/script-segments.d.ts +1 -5
  201. package/dist/script-segments.js +1 -54
  202. package/dist/script-segments.js.map +1 -1
  203. package/dist/secret-redaction.js +0 -4
  204. package/dist/secret-redaction.js.map +1 -1
  205. package/dist/segment-media.js +0 -22
  206. package/dist/segment-media.js.map +1 -1
  207. package/dist/segment-text.js +0 -18
  208. package/dist/segment-text.js.map +1 -1
  209. package/dist/single-video-shape.d.ts +35 -1
  210. package/dist/single-video-shape.js +7 -18
  211. package/dist/single-video-shape.js.map +1 -1
  212. package/dist/slot-detail-present.d.ts +67 -0
  213. package/dist/slot-detail-present.js +47 -0
  214. package/dist/slot-detail-present.js.map +1 -0
  215. package/dist/tool-annotations.js.map +1 -1
  216. package/dist/tools-batch.d.ts +51 -3
  217. package/dist/tools-batch.js +0 -17
  218. package/dist/tools-batch.js.map +1 -1
  219. package/dist/tools-call.d.ts +0 -1
  220. package/dist/tools-call.js +0 -1
  221. package/dist/tools-call.js.map +1 -1
  222. package/dist/tools-experiments.d.ts +6 -3
  223. package/dist/tools-experiments.js +1 -31
  224. package/dist/tools-experiments.js.map +1 -1
  225. package/dist/tools-list-stats.d.ts +0 -4
  226. package/dist/tools-list-stats.js +0 -5
  227. package/dist/tools-list-stats.js.map +1 -1
  228. package/dist/tools-pinterest.js +0 -10
  229. package/dist/tools-pinterest.js.map +1 -1
  230. package/dist/tools-posts.d.ts +2 -0
  231. package/dist/tools-posts.js +0 -9
  232. package/dist/tools-posts.js.map +1 -1
  233. package/dist/tools-prompts.js +0 -23
  234. package/dist/tools-prompts.js.map +1 -1
  235. package/dist/tools-publish-existing.js +0 -17
  236. package/dist/tools-publish-existing.js.map +1 -1
  237. package/dist/tools-publish-uploaded.js +0 -8
  238. package/dist/tools-publish-uploaded.js.map +1 -1
  239. package/dist/tools-publishing-accounts.js +1 -11
  240. package/dist/tools-publishing-accounts.js.map +1 -1
  241. package/dist/tools-single-video.d.ts +2 -4
  242. package/dist/tools-single-video.js +2 -55
  243. package/dist/tools-single-video.js.map +1 -1
  244. package/dist/tools-tool-config.js +0 -13
  245. package/dist/tools-tool-config.js.map +1 -1
  246. package/dist/tools-user-media.js +0 -5
  247. package/dist/tools-user-media.js.map +1 -1
  248. package/dist/tools.d.ts +2 -76
  249. package/dist/tools.js +5 -131
  250. package/dist/tools.js.map +1 -1
  251. package/dist/video-task-tools.d.ts +0 -2
  252. package/dist/video-task-tools.js +0 -43
  253. package/dist/video-task-tools.js.map +1 -1
  254. package/dist/video-type.d.ts +0 -10
  255. package/dist/video-type.js +0 -17
  256. package/dist/video-type.js.map +1 -1
  257. package/dist/voice-filters.d.ts +0 -27
  258. package/dist/voice-filters.js +0 -62
  259. package/dist/voice-filters.js.map +1 -1
  260. package/package.json +1 -1
@@ -7,10 +7,6 @@ export interface EndpointDefinition<Body extends z.ZodType | undefined, Query ex
7
7
  query?: Query;
8
8
  response: Response;
9
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
10
  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
11
  method: EndpointMethod;
16
12
  path: Path;
@@ -18,26 +14,19 @@ export declare function defineEndpoint<Body extends z.ZodType | undefined = unde
18
14
  query?: Query;
19
15
  response: Response;
20
16
  }): 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
17
  export type BodyOf<Endpoint extends {
25
18
  body?: z.ZodType | undefined;
26
19
  }> = [
27
20
  Exclude<Endpoint['body'], undefined>
28
21
  ] 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
22
  export type QueryOf<Endpoint extends {
31
23
  query?: z.ZodType | undefined;
32
24
  }> = [
33
25
  Exclude<Endpoint['query'], undefined>
34
26
  ] 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
27
  export type ResponseOf<Endpoint extends {
37
28
  response: z.ZodType;
38
29
  }> = 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
30
  export type ParamsOf<Path extends string> = Path extends `${string}:${infer Rest}` ? Rest extends `${infer Name}/${infer After}` ? {
42
31
  [Key in Name]: string;
43
32
  } & ParamsOf<`/${After}`> : {
@@ -48,8 +37,6 @@ import { METRICS_WINDOWS, type MetricsWindow } from './experiments.js';
48
37
  export { METRICS_WINDOWS };
49
38
  export declare const METRICS_NONE = "^@none";
50
39
  export declare const METRICS_FILTER_MAX_LENGTH = 200;
51
- /** YouTube video id (11 chars, base64url). Mirrors
52
- * apps/web/lib/youtube-analytics.ts (VIDEO_ID). */
53
40
  export declare const YOUTUBE_VIDEO_ID: RegExp;
54
41
  export declare const ANALYTICS_STATUSES: readonly ["ok", "scope_missing", "not_owned", "no_data"];
55
42
  export type AnalyticsStatus = (typeof ANALYTICS_STATUSES)[number];
@@ -75,8 +62,6 @@ type MetricsParseResult = {
75
62
  };
76
63
  export declare function parseMetricsQuery(params: URLSearchParams): MetricsParseResult;
77
64
  export declare function metricsSearchParams(query: MetricsQuery): URLSearchParams;
78
- /** `?account=&video=` for the retention-curve read: each exactly once,
79
- * a non-empty account within the filter length, a YouTube video id. */
80
65
  export declare function parseRetentionCurveQuery(params: URLSearchParams): {
81
66
  account: string;
82
67
  video: string;
@@ -108,6 +93,7 @@ export declare const MetricsRowSchema: z.ZodObject<{
108
93
  "3speak": "3speak";
109
94
  rumble: "rumble";
110
95
  fanvue: "fanvue";
96
+ telegram: "telegram";
111
97
  }>;
112
98
  accountId: z.ZodString;
113
99
  externalId: z.ZodString;
@@ -147,6 +133,7 @@ export declare const CoverageItemSchema: z.ZodObject<{
147
133
  "3speak": "3speak";
148
134
  rumble: "rumble";
149
135
  fanvue: "fanvue";
136
+ telegram: "telegram";
150
137
  }>;
151
138
  accountId: z.ZodString;
152
139
  externalId: z.ZodNullable<z.ZodString>;
@@ -179,6 +166,7 @@ export declare const MetricsResponseSchema: z.ZodObject<{
179
166
  "3speak": "3speak";
180
167
  rumble: "rumble";
181
168
  fanvue: "fanvue";
169
+ telegram: "telegram";
182
170
  }>;
183
171
  accountId: z.ZodString;
184
172
  externalId: z.ZodString;
@@ -218,6 +206,7 @@ export declare const MetricsResponseSchema: z.ZodObject<{
218
206
  "3speak": "3speak";
219
207
  rumble: "rumble";
220
208
  fanvue: "fanvue";
209
+ telegram: "telegram";
221
210
  }>;
222
211
  accountId: z.ZodString;
223
212
  externalId: z.ZodNullable<z.ZodString>;
@@ -277,6 +266,7 @@ export declare const listMetrics: EndpointDefinition<undefined, z.ZodObject<{
277
266
  "3speak": "3speak";
278
267
  rumble: "rumble";
279
268
  fanvue: "fanvue";
269
+ telegram: "telegram";
280
270
  }>;
281
271
  accountId: z.ZodString;
282
272
  externalId: z.ZodString;
@@ -316,6 +306,7 @@ export declare const listMetrics: EndpointDefinition<undefined, z.ZodObject<{
316
306
  "3speak": "3speak";
317
307
  rumble: "rumble";
318
308
  fanvue: "fanvue";
309
+ telegram: "telegram";
319
310
  }>;
320
311
  accountId: z.ZodString;
321
312
  externalId: z.ZodNullable<z.ZodString>;
@@ -1,53 +1,19 @@
1
1
  // GENERATED from shared/contracts — do not edit.
2
2
  // Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
3
- //---------------
4
- // metrics — the GET /api/metrics + GET /api/metrics/retention-curve
5
- // contract, shared by the web routes and the MCP insights tools.
6
- //
7
- // The query parsing (parseMetricsQuery / parseRetentionCurveQuery) lives
8
- // here, not in the routes: the MCP tools validate their arguments locally
9
- // against the same rules, so a one-sided edit would make the MCP reject
10
- // what the route accepts (or forward what it rejects). The route keeps
11
- // the same 400 messages — the parsers moved verbatim out of
12
- // apps/web/lib/metrics/metrics-query.ts and
13
- // apps/web/app/api/metrics/retention-curve/route.ts.
14
- //---------------
15
3
  import { z } from 'zod';
16
- /** Define one endpoint contract. The literal path is preserved in the type
17
- * so ParamsOf can read its `:param` segments. `Body`/`Query` default to
18
- * `undefined` so an omitted optional schema stays `undefined` (not the
19
- * bare `ZodType`) in the returned definition. */
20
4
  export function defineEndpoint(config) {
21
5
  return config;
22
6
  }
23
7
  import { SOCIAL_PROVIDERS, isSocialProvider } from './providers.js';
24
8
  import { METRICS_WINDOWS } from './experiments.js';
25
- // The window values live in the experiments contract (its results read
26
- // takes the same ?window=); re-exported so the metrics query contract
27
- // is the one place the MCP and the web read them from.
28
9
  export { METRICS_WINDOWS };
29
- // Null-filter sentinel. Not a plain word: script angles are unvalidated
30
- // engine-generated text, so a literal like 'none' could be a real angle
31
- // and would become unfilterable (selecting it would filter for null rows
32
- // instead). Persona ids are uuids, so the sentinel is safe for them too.
33
10
  export const METRICS_NONE = '^@none';
34
11
  export const METRICS_FILTER_MAX_LENGTH = 200;
35
- /** YouTube video id (11 chars, base64url). Mirrors
36
- * apps/web/lib/youtube-analytics.ts (VIDEO_ID). */
37
12
  export const YOUTUBE_VIDEO_ID = /^[A-Za-z0-9_-]{1,64}$/;
38
- // post_metrics.analytics_status (migration 039 check, pinned by a sync test).
39
13
  export const ANALYTICS_STATUSES = ['ok', 'scope_missing', 'not_owned', 'no_data'];
40
14
  export function isAnalyticsStatus(value) {
41
15
  return typeof value === 'string' && ANALYTICS_STATUSES.includes(value);
42
16
  }
43
- // Coverage reasons (issue #525): why a published video has no snapshot
44
- // for the selected window. pending = the window has not opened yet;
45
- // retrying = the window is open and the collector keeps trying; missed =
46
- // the window closed while collection kept failing; no-target = the window
47
- // closed and the collector finished the post without ever seeing this
48
- // video (it was published late, after the post was marked done);
49
- // publish-failed = the publish outcome is 'failed', so there is no video
50
- // id to measure.
51
17
  export const COVERAGE_REASONS = ['pending', 'retrying', 'missed', 'no-target', 'publish-failed'];
52
18
  export function isCoverageReason(value) {
53
19
  return typeof value === 'string' && COVERAGE_REASONS.includes(value);
@@ -55,9 +21,6 @@ export function isCoverageReason(value) {
55
21
  export function isMetricsWindow(value) {
56
22
  return typeof value === 'string' && METRICS_WINDOWS.includes(value);
57
23
  }
58
- // Exported for the metrics route, which validates stored API-key
59
- // persona ids with the same pattern before interpolating them into a
60
- // PostgREST filter string.
61
24
  export const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
62
25
  const KNOWN_PARAMS = new Set(['window', 'persona', 'account', 'provider', 'angle']);
63
26
  function readOptional(params, key) {
@@ -73,10 +36,6 @@ function readOptional(params, key) {
73
36
  return { error: `${key} is too long.` };
74
37
  return value;
75
38
  }
76
- //---------------
77
- // parseMetricsQuery — strict: unknown, duplicate, empty, over-length or
78
- // malformed params are rejected (400), never ignored or coerced.
79
- //---------------
80
39
  export function parseMetricsQuery(params) {
81
40
  for (const key of params.keys()) {
82
41
  if (!KNOWN_PARAMS.has(key))
@@ -110,9 +69,6 @@ export function parseMetricsQuery(params) {
110
69
  },
111
70
  };
112
71
  }
113
- //---------------
114
- // metricsSearchParams — the inverse, for the client fetch.
115
- //---------------
116
72
  export function metricsSearchParams(query) {
117
73
  const params = new URLSearchParams({ window: query.window });
118
74
  if (query.personaId !== null)
@@ -125,8 +81,6 @@ export function metricsSearchParams(query) {
125
81
  params.set('angle', query.angle);
126
82
  return params;
127
83
  }
128
- /** `?account=&video=` for the retention-curve read: each exactly once,
129
- * a non-empty account within the filter length, a YouTube video id. */
130
84
  export function parseRetentionCurveQuery(params) {
131
85
  for (const key of params.keys()) {
132
86
  if (key !== 'account' && key !== 'video')
@@ -142,11 +96,6 @@ export function parseRetentionCurveQuery(params) {
142
96
  return { error: 'Invalid video.' };
143
97
  return { account: account[0], video: video[0] };
144
98
  }
145
- //---------------
146
- // Query params as the routes receive them (raw strings; the parsers
147
- // above are the validators). The endpoints declare them so the MCP
148
- // client and the route share one shape.
149
- //---------------
150
99
  export const MetricsQueryParamsSchema = z.strictObject({
151
100
  window: z.string().optional(),
152
101
  persona: z.string().optional(),
@@ -158,12 +107,6 @@ export const RetentionCurveQuerySchema = z.strictObject({
158
107
  account: z.string(),
159
108
  video: z.string(),
160
109
  });
161
- //---------------
162
- // Response views, mirroring apps/web/lib/metrics/metrics-query.ts
163
- // (MetricsRowView / CoverageItem) and apps/web/lib/youtube-analytics.ts
164
- // (RetentionPoint). The MCP reads these rows; app field names are the
165
- // contract one rename away from breaking both typechecks.
166
- //---------------
167
110
  export const MetricsRowSchema = z.object({
168
111
  postId: z.string(),
169
112
  personaId: z.string().nullable(),
@@ -171,22 +114,11 @@ export const MetricsRowSchema = z.object({
171
114
  accountId: z.string(),
172
115
  externalId: z.string(),
173
116
  scriptAngle: z.string().nullable(),
174
- // When the slot was published, from scheduled_posts.published_at (the
175
- // publish date every date chart buckets by, #647). Required, not
176
- // nullable: post_metrics rows are only ever created for published slots
177
- // with a non-null published_at — find_post_metrics_due (migrations 025
178
- // and 039) requires status 'published' plus published_at window
179
- // comparisons that NULL never satisfies, the re-open scan requires a
180
- // string published_at, and the engine sets published_at once on publish
181
- // and never clears it. A missing parent at read time (a concurrent
182
- // delete race) is a read failure (500), never a null row.
183
117
  publishedAt: z.string(),
184
118
  views: z.number().nullable(),
185
119
  likes: z.number().nullable(),
186
120
  comments: z.number().nullable(),
187
121
  saves: z.number().nullable(),
188
- // YouTube Analytics (own videos only); null on other providers or when
189
- // not collected. analyticsStatus 'scope_missing' = reconnect YouTube.
190
122
  analyticsViews: z.number().nullable(),
191
123
  engagedViews: z.number().nullable(),
192
124
  stayedToWatchPct: z.number().nullable(),
@@ -202,7 +134,6 @@ export const CoverageItemSchema = z.object({
202
134
  personaId: z.string().nullable(),
203
135
  provider: z.enum(SOCIAL_PROVIDERS),
204
136
  accountId: z.string(),
205
- // Null for publish-failed items: a failed publish records no video id.
206
137
  externalId: z.string().nullable(),
207
138
  scriptAngle: z.string().nullable(),
208
139
  reason: z.enum(COVERAGE_REASONS),
@@ -216,11 +147,9 @@ export const MetricsResponseSchema = z.object({
216
147
  truncated: z.boolean(),
217
148
  coverage: z.array(CoverageItemSchema),
218
149
  coverageTruncated: z.boolean(),
219
- // The newest snapshot in the response: the page dates its data by it.
220
150
  asOf: z.string().nullable(),
221
151
  });
222
152
  export const RetentionPointSchema = z.object({
223
- // elapsedVideoTimeRatio: exclusive end of the interval, 0.01..1.0.
224
153
  ratio: z.number(),
225
154
  audienceWatchRatio: z.number(),
226
155
  relativeRetentionPerformance: z.number().nullable(),
@@ -232,9 +161,6 @@ export const RetentionCurveResponseSchema = z.object({
232
161
  endDate: z.string(),
233
162
  provisional: z.boolean(),
234
163
  });
235
- //---------------
236
- // Endpoints.
237
- //---------------
238
164
  export const listMetrics = defineEndpoint({
239
165
  method: 'GET',
240
166
  path: '/api/metrics',
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/contracts/metrics.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,iBAAiB;AACjB,oEAAoE;AACpE,iEAAiE;AACjE,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,wEAAwE;AACxE,uEAAuE;AACvE,4DAA4D;AAC5D,4CAA4C;AAC5C,qDAAqD;AACrD,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,gBAAgB,EAAuB,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAC;AAEvE,uEAAuE;AACvE,sEAAsE;AACtE,uDAAuD;AACvD,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,wEAAwE;AACxE,wEAAwE;AACxE,yEAAyE;AACzE,yEAAyE;AACzE,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC;AAErC,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAG7C;mDACmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,CAAU,CAAC;AAG3F,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,OAAO,KAAK,KAAK,QA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C;AAGH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;IACxC,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,wBAAwB;IAC/B,QAAQ,EAAE,qBAAqB;CAChC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;IAC9C,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,yBAAyB;IAChC,QAAQ,EAAE,4BAA4B;CACvC,CAAC,CAAC"}
@@ -7,10 +7,6 @@ export interface EndpointDefinition<Body extends z.ZodType | undefined, Query ex
7
7
  query?: Query;
8
8
  response: Response;
9
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
10
  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
11
  method: EndpointMethod;
16
12
  path: Path;
@@ -18,26 +14,19 @@ export declare function defineEndpoint<Body extends z.ZodType | undefined = unde
18
14
  query?: Query;
19
15
  response: Response;
20
16
  }): 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
17
  export type BodyOf<Endpoint extends {
25
18
  body?: z.ZodType | undefined;
26
19
  }> = [
27
20
  Exclude<Endpoint['body'], undefined>
28
21
  ] 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
22
  export type QueryOf<Endpoint extends {
31
23
  query?: z.ZodType | undefined;
32
24
  }> = [
33
25
  Exclude<Endpoint['query'], undefined>
34
26
  ] 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
27
  export type ResponseOf<Endpoint extends {
37
28
  response: z.ZodType;
38
29
  }> = 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
30
  export type ParamsOf<Path extends string> = Path extends `${string}:${infer Rest}` ? Rest extends `${infer Name}/${infer After}` ? {
42
31
  [Key in Name]: string;
43
32
  } & ParamsOf<`/${After}`> : {
@@ -50,7 +39,24 @@ export declare const VIDEO_LAYOUTS: readonly ["standard", "react"];
50
39
  export type VideoLayout = (typeof VIDEO_LAYOUTS)[number];
51
40
  export declare const FACE_QUALITIES: readonly ["ok", "very_good"];
52
41
  export type FaceQuality = (typeof FACE_QUALITIES)[number];
53
- export declare const PERSONA_CTA_MAX_LENGTH = 200;
42
+ export declare const PERSONA_CTA_TYPES: readonly ["follow", "comment", "share", "save", "link", "buy", "other"];
43
+ export type PersonaCtaType = (typeof PERSONA_CTA_TYPES)[number];
44
+ export declare const PERSONA_CTA_URL_MAX_LENGTH = 2048;
45
+ export declare const PERSONA_CTA_INSTRUCTION_MAX_LENGTH = 500;
46
+ export declare const PersonaCtaSchema: z.ZodObject<{
47
+ type: z.ZodEnum<{
48
+ link: "link";
49
+ follow: "follow";
50
+ comment: "comment";
51
+ share: "share";
52
+ save: "save";
53
+ buy: "buy";
54
+ other: "other";
55
+ }>;
56
+ url: z.ZodOptional<z.ZodString>;
57
+ instruction: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strip>;
59
+ export type PersonaCta = z.infer<typeof PersonaCtaSchema>;
54
60
  export declare const MAX_LIBRARY_IMAGES = 10;
55
61
  export declare const MAX_TAG_LENGTH = 100;
56
62
  export declare const MAX_DESCRIPTION_LENGTH = 500;
@@ -73,7 +79,17 @@ export declare const PersonaListItemSchema: z.ZodObject<{
73
79
  videoAspect: z.ZodOptional<z.ZodString>;
74
80
  videoLayout: z.ZodOptional<z.ZodString>;
75
81
  scriptPrompt: z.ZodOptional<z.ZodString>;
76
- ctaText: z.ZodOptional<z.ZodString>;
82
+ ctaType: z.ZodOptional<z.ZodEnum<{
83
+ link: "link";
84
+ follow: "follow";
85
+ comment: "comment";
86
+ share: "share";
87
+ save: "save";
88
+ buy: "buy";
89
+ other: "other";
90
+ }>>;
91
+ ctaUrl: z.ZodOptional<z.ZodString>;
92
+ ctaInstruction: z.ZodOptional<z.ZodString>;
77
93
  paragraphNumber: z.ZodOptional<z.ZodNumber>;
78
94
  niche: z.ZodOptional<z.ZodString>;
79
95
  faceQuality: z.ZodOptional<z.ZodString>;
@@ -88,6 +104,7 @@ export declare const PersonaListItemSchema: z.ZodObject<{
88
104
  '3speak': z.ZodArray<z.ZodString>;
89
105
  rumble: z.ZodArray<z.ZodString>;
90
106
  fanvue: z.ZodArray<z.ZodString>;
107
+ telegram: z.ZodArray<z.ZodString>;
91
108
  }, z.core.$strip>;
92
109
  }, z.core.$strip>;
93
110
  export type PersonaListItem = z.infer<typeof PersonaListItemSchema>;
@@ -106,7 +123,17 @@ export declare const ListPersonasResponseSchema: z.ZodObject<{
106
123
  videoAspect: z.ZodOptional<z.ZodString>;
107
124
  videoLayout: z.ZodOptional<z.ZodString>;
108
125
  scriptPrompt: z.ZodOptional<z.ZodString>;
109
- ctaText: z.ZodOptional<z.ZodString>;
126
+ ctaType: z.ZodOptional<z.ZodEnum<{
127
+ link: "link";
128
+ follow: "follow";
129
+ comment: "comment";
130
+ share: "share";
131
+ save: "save";
132
+ buy: "buy";
133
+ other: "other";
134
+ }>>;
135
+ ctaUrl: z.ZodOptional<z.ZodString>;
136
+ ctaInstruction: z.ZodOptional<z.ZodString>;
110
137
  paragraphNumber: z.ZodOptional<z.ZodNumber>;
111
138
  niche: z.ZodOptional<z.ZodString>;
112
139
  faceQuality: z.ZodOptional<z.ZodString>;
@@ -121,6 +148,7 @@ export declare const ListPersonasResponseSchema: z.ZodObject<{
121
148
  '3speak': z.ZodArray<z.ZodString>;
122
149
  rumble: z.ZodArray<z.ZodString>;
123
150
  fanvue: z.ZodArray<z.ZodString>;
151
+ telegram: z.ZodArray<z.ZodString>;
124
152
  }, z.core.$strip>;
125
153
  }, z.core.$strip>>;
126
154
  }, z.core.$strip>;
@@ -286,7 +314,17 @@ export declare const CreatePersonaBodySchema: z.ZodObject<{
286
314
  react: "react";
287
315
  }>>;
288
316
  scriptPrompt: z.ZodOptional<z.ZodString>;
289
- ctaText: z.ZodOptional<z.ZodString>;
317
+ ctaType: z.ZodOptional<z.ZodEnum<{
318
+ link: "link";
319
+ follow: "follow";
320
+ comment: "comment";
321
+ share: "share";
322
+ save: "save";
323
+ buy: "buy";
324
+ other: "other";
325
+ }>>;
326
+ ctaUrl: z.ZodOptional<z.ZodString>;
327
+ ctaInstruction: z.ZodOptional<z.ZodString>;
290
328
  niche: z.ZodOptional<z.ZodString>;
291
329
  paragraphNumber: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
292
330
  faceQuality: z.ZodOptional<z.ZodEnum<{
@@ -314,7 +352,17 @@ export declare const UpdatePersonaBodySchema: z.ZodObject<{
314
352
  react: "react";
315
353
  }>>, unknown>;
316
354
  scriptPrompt: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
317
- ctaText: z.ZodOptional<z.ZodString>;
355
+ ctaType: z.ZodOptional<z.ZodEnum<{
356
+ link: "link";
357
+ follow: "follow";
358
+ comment: "comment";
359
+ share: "share";
360
+ save: "save";
361
+ buy: "buy";
362
+ other: "other";
363
+ }>>;
364
+ ctaUrl: z.ZodOptional<z.ZodString>;
365
+ ctaInstruction: z.ZodOptional<z.ZodString>;
318
366
  paragraphNumber: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
319
367
  niche: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
320
368
  faceQuality: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
@@ -379,7 +427,17 @@ export declare const createPersona: EndpointDefinition<z.ZodObject<{
379
427
  react: "react";
380
428
  }>>;
381
429
  scriptPrompt: z.ZodOptional<z.ZodString>;
382
- ctaText: z.ZodOptional<z.ZodString>;
430
+ ctaType: z.ZodOptional<z.ZodEnum<{
431
+ link: "link";
432
+ follow: "follow";
433
+ comment: "comment";
434
+ share: "share";
435
+ save: "save";
436
+ buy: "buy";
437
+ other: "other";
438
+ }>>;
439
+ ctaUrl: z.ZodOptional<z.ZodString>;
440
+ ctaInstruction: z.ZodOptional<z.ZodString>;
383
441
  niche: z.ZodOptional<z.ZodString>;
384
442
  paragraphNumber: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
385
443
  faceQuality: z.ZodOptional<z.ZodEnum<{
@@ -416,7 +474,17 @@ export declare const listPersonas: EndpointDefinition<undefined, undefined, z.Zo
416
474
  videoAspect: z.ZodOptional<z.ZodString>;
417
475
  videoLayout: z.ZodOptional<z.ZodString>;
418
476
  scriptPrompt: z.ZodOptional<z.ZodString>;
419
- ctaText: z.ZodOptional<z.ZodString>;
477
+ ctaType: z.ZodOptional<z.ZodEnum<{
478
+ link: "link";
479
+ follow: "follow";
480
+ comment: "comment";
481
+ share: "share";
482
+ save: "save";
483
+ buy: "buy";
484
+ other: "other";
485
+ }>>;
486
+ ctaUrl: z.ZodOptional<z.ZodString>;
487
+ ctaInstruction: z.ZodOptional<z.ZodString>;
420
488
  paragraphNumber: z.ZodOptional<z.ZodNumber>;
421
489
  niche: z.ZodOptional<z.ZodString>;
422
490
  faceQuality: z.ZodOptional<z.ZodString>;
@@ -431,6 +499,7 @@ export declare const listPersonas: EndpointDefinition<undefined, undefined, z.Zo
431
499
  '3speak': z.ZodArray<z.ZodString>;
432
500
  rumble: z.ZodArray<z.ZodString>;
433
501
  fanvue: z.ZodArray<z.ZodString>;
502
+ telegram: z.ZodArray<z.ZodString>;
434
503
  }, z.core.$strip>;
435
504
  }, z.core.$strip>>;
436
505
  }, z.core.$strip>, "/api/persona/list">;
@@ -464,7 +533,17 @@ export declare const updatePersona: EndpointDefinition<z.ZodObject<{
464
533
  react: "react";
465
534
  }>>, unknown>;
466
535
  scriptPrompt: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
467
- ctaText: z.ZodOptional<z.ZodString>;
536
+ ctaType: z.ZodOptional<z.ZodEnum<{
537
+ link: "link";
538
+ follow: "follow";
539
+ comment: "comment";
540
+ share: "share";
541
+ save: "save";
542
+ buy: "buy";
543
+ other: "other";
544
+ }>>;
545
+ ctaUrl: z.ZodOptional<z.ZodString>;
546
+ ctaInstruction: z.ZodOptional<z.ZodString>;
468
547
  paragraphNumber: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
469
548
  niche: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
470
549
  faceQuality: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{