post-engineer-mcp 1.52.672 → 1.53.668
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/account-shapes.js +0 -12
- package/dist/account-shapes.js.map +1 -1
- package/dist/action-tool.d.ts +0 -15
- package/dist/action-tool.js +0 -15
- package/dist/action-tool.js.map +1 -1
- package/dist/analytics.js +0 -39
- package/dist/analytics.js.map +1 -1
- package/dist/client-base-url.d.ts +2 -0
- package/dist/client-base-url.js +23 -0
- package/dist/client-base-url.js.map +1 -0
- package/dist/client-batch.js.map +1 -1
- package/dist/client-billing.js +0 -11
- package/dist/client-billing.js.map +1 -1
- package/dist/client-experiments.js +0 -9
- package/dist/client-experiments.js.map +1 -1
- package/dist/client-posts.js +0 -7
- package/dist/client-posts.js.map +1 -1
- package/dist/client-prompts.js +0 -2
- package/dist/client-prompts.js.map +1 -1
- package/dist/client-publish-existing.js +0 -13
- package/dist/client-publish-existing.js.map +1 -1
- package/dist/client-publish-uploaded.d.ts +0 -5
- package/dist/client-publish-uploaded.js +0 -48
- package/dist/client-publish-uploaded.js.map +1 -1
- package/dist/client-publishing-accounts.js +0 -7
- package/dist/client-publishing-accounts.js.map +1 -1
- package/dist/client-telegram.js +0 -7
- package/dist/client-telegram.js.map +1 -1
- package/dist/client-tool-config.js +0 -7
- package/dist/client-tool-config.js.map +1 -1
- package/dist/client-types.d.ts +10 -87
- package/dist/client-user-media.d.ts +0 -28
- package/dist/client-user-media.js +0 -42
- package/dist/client-user-media.js.map +1 -1
- package/dist/client-video-task.js +0 -5
- package/dist/client-video-task.js.map +1 -1
- package/dist/client.js +5 -118
- package/dist/client.js.map +1 -1
- package/dist/cloned-voice-client.d.ts +0 -8
- package/dist/cloned-voice-client.js +0 -49
- package/dist/cloned-voice-client.js.map +1 -1
- package/dist/cloned-voice-tools.d.ts +0 -5
- package/dist/cloned-voice-tools.js +0 -7
- package/dist/cloned-voice-tools.js.map +1 -1
- package/dist/connect-account.js +0 -23
- package/dist/connect-account.js.map +1 -1
- package/dist/contract-response.js +0 -12
- package/dist/contract-response.js.map +1 -1
- package/dist/contracts/accounts.d.ts +0 -11
- package/dist/contracts/accounts.js +0 -60
- package/dist/contracts/accounts.js.map +1 -1
- package/dist/contracts/billing.d.ts +0 -14
- package/dist/contracts/billing.js +0 -26
- package/dist/contracts/billing.js.map +1 -1
- package/dist/contracts/endpoint.d.ts +0 -11
- package/dist/contracts/endpoint.js +0 -4
- package/dist/contracts/endpoint.js.map +1 -1
- package/dist/contracts/experiments.d.ts +0 -20
- package/dist/contracts/experiments.js +0 -34
- package/dist/contracts/experiments.js.map +1 -1
- package/dist/contracts/media.d.ts +0 -19
- package/dist/contracts/media.js +0 -58
- package/dist/contracts/media.js.map +1 -1
- package/dist/contracts/metrics.d.ts +0 -15
- package/dist/contracts/metrics.js +0 -74
- package/dist/contracts/metrics.js.map +1 -1
- package/dist/contracts/personas.d.ts +95 -19
- package/dist/contracts/personas.js +24 -93
- package/dist/contracts/personas.js.map +1 -1
- package/dist/contracts/posts.d.ts +0 -11
- package/dist/contracts/posts.js +0 -17
- package/dist/contracts/posts.js.map +1 -1
- package/dist/contracts/prompts.d.ts +0 -11
- package/dist/contracts/prompts.js +0 -15
- package/dist/contracts/prompts.js.map +1 -1
- package/dist/contracts/providers.d.ts +0 -16
- package/dist/contracts/providers.js +0 -30
- package/dist/contracts/providers.js.map +1 -1
- package/dist/contracts/schedule-warnings.js +0 -3
- package/dist/contracts/schedule-warnings.js.map +1 -1
- package/dist/contracts/schedule.d.ts +0 -14
- package/dist/contracts/schedule.js +0 -46
- package/dist/contracts/schedule.js.map +1 -1
- package/dist/contracts/tool-config.d.ts +7 -11
- package/dist/contracts/tool-config.js +1 -27
- package/dist/contracts/tool-config.js.map +1 -1
- package/dist/contracts/upload-types.d.ts +0 -3
- package/dist/contracts/upload-types.js +0 -10
- package/dist/contracts/upload-types.js.map +1 -1
- package/dist/contracts/video-tasks.d.ts +0 -23
- package/dist/contracts/video-tasks.js +0 -42
- package/dist/contracts/video-tasks.js.map +1 -1
- package/dist/contracts/videos.d.ts +29 -37
- package/dist/contracts/videos.js +3 -137
- package/dist/contracts/videos.js.map +1 -1
- package/dist/contracts/voices.d.ts +0 -24
- package/dist/contracts/voices.js +0 -34
- package/dist/contracts/voices.js.map +1 -1
- package/dist/direct-publish-form.js +0 -15
- package/dist/direct-publish-form.js.map +1 -1
- package/dist/direct-publish-narrowing.js +0 -5
- package/dist/direct-publish-narrowing.js.map +1 -1
- package/dist/errors.d.ts +0 -35
- package/dist/errors.js +0 -48
- package/dist/errors.js.map +1 -1
- package/dist/generate-video.d.ts +45 -4
- package/dist/generate-video.js +0 -6
- package/dist/generate-video.js.map +1 -1
- package/dist/http-auth.d.ts +0 -1
- package/dist/http-auth.js +0 -37
- package/dist/http-auth.js.map +1 -1
- package/dist/http-rate-limit.d.ts +0 -1
- package/dist/http-rate-limit.js +0 -18
- package/dist/http-rate-limit.js.map +1 -1
- package/dist/http-transport.js +0 -95
- package/dist/http-transport.js.map +1 -1
- package/dist/http-web.js +0 -16
- package/dist/http-web.js.map +1 -1
- package/dist/image-guards.d.ts +0 -4
- package/dist/image-guards.js +0 -11
- package/dist/image-guards.js.map +1 -1
- package/dist/index.js +0 -20
- package/dist/index.js.map +1 -1
- package/dist/intent-accounts.js +0 -5
- package/dist/intent-accounts.js.map +1 -1
- package/dist/intent-content.js +0 -7
- package/dist/intent-content.js.map +1 -1
- package/dist/intent-library.js +0 -4
- package/dist/intent-library.js.map +1 -1
- package/dist/intent-personas.js +0 -10
- package/dist/intent-personas.js.map +1 -1
- package/dist/intent-tool-config.js +1 -6
- package/dist/intent-tool-config.js.map +1 -1
- package/dist/intent-video.js +0 -5
- package/dist/intent-video.js.map +1 -1
- package/dist/intent-voices.js +0 -6
- package/dist/intent-voices.js.map +1 -1
- package/dist/language.d.ts +0 -8
- package/dist/language.js +0 -11
- package/dist/language.js.map +1 -1
- package/dist/limits.d.ts +1 -79
- package/dist/limits.js +1 -79
- package/dist/limits.js.map +1 -1
- package/dist/music-mood-field.js +0 -25
- package/dist/music-mood-field.js.map +1 -1
- package/dist/persona-avatar.d.ts +0 -13
- package/dist/persona-avatar.js +0 -40
- package/dist/persona-avatar.js.map +1 -1
- package/dist/persona-create.d.ts +96 -0
- package/dist/persona-create.js +39 -0
- package/dist/persona-create.js.map +1 -0
- package/dist/persona-cta-shape.d.ts +16 -0
- package/dist/persona-cta-shape.js +45 -0
- package/dist/persona-cta-shape.js.map +1 -0
- package/dist/persona-delete.js +0 -1
- package/dist/persona-delete.js.map +1 -1
- package/dist/persona-update.d.ts +26 -0
- package/dist/persona-update.js +2 -6
- package/dist/persona-update.js.map +1 -1
- package/dist/progress-poll-hint.d.ts +0 -6
- package/dist/progress-poll-hint.js +0 -15
- package/dist/progress-poll-hint.js.map +1 -1
- package/dist/prompts.js +0 -12
- package/dist/prompts.js.map +1 -1
- package/dist/public-ip.js +25 -58
- package/dist/public-ip.js.map +1 -1
- package/dist/publish-direct-shape.js +0 -4
- package/dist/publish-direct-shape.js.map +1 -1
- package/dist/publish-existing-shape.d.ts +0 -7
- package/dist/publish-existing-shape.js +0 -26
- package/dist/publish-existing-shape.js.map +1 -1
- package/dist/publish-notices.js +0 -2
- package/dist/publish-notices.js.map +1 -1
- package/dist/publish-uploaded-shape.js +0 -7
- package/dist/publish-uploaded-shape.js.map +1 -1
- package/dist/recipe-session.d.ts +0 -4
- package/dist/recipe-session.js +0 -17
- package/dist/recipe-session.js.map +1 -1
- package/dist/refs.d.ts +0 -11
- package/dist/refs.js +0 -15
- package/dist/refs.js.map +1 -1
- package/dist/remote-shapes.d.ts +52 -2
- package/dist/remote-shapes.js +2 -16
- package/dist/remote-shapes.js.map +1 -1
- package/dist/require-api-key.js +0 -2
- package/dist/require-api-key.js.map +1 -1
- package/dist/require-publishing-accounts.js +0 -7
- package/dist/require-publishing-accounts.js.map +1 -1
- package/dist/require-title.js +0 -4
- package/dist/require-title.js.map +1 -1
- package/dist/schedule-shapes.js +0 -19
- package/dist/schedule-shapes.js.map +1 -1
- package/dist/script-segments.d.ts +1 -5
- package/dist/script-segments.js +1 -54
- package/dist/script-segments.js.map +1 -1
- package/dist/secret-redaction.js +0 -4
- package/dist/secret-redaction.js.map +1 -1
- package/dist/segment-media.js +0 -22
- package/dist/segment-media.js.map +1 -1
- package/dist/segment-text.js +0 -18
- package/dist/segment-text.js.map +1 -1
- package/dist/single-video-shape.d.ts +31 -1
- package/dist/single-video-shape.js +6 -18
- package/dist/single-video-shape.js.map +1 -1
- package/dist/slot-detail-present.d.ts +0 -4
- package/dist/slot-detail-present.js +0 -9
- package/dist/slot-detail-present.js.map +1 -1
- package/dist/tool-annotations.js.map +1 -1
- package/dist/tools-batch.d.ts +45 -3
- package/dist/tools-batch.js +0 -17
- package/dist/tools-batch.js.map +1 -1
- package/dist/tools-call.d.ts +0 -1
- package/dist/tools-call.js +0 -1
- package/dist/tools-call.js.map +1 -1
- package/dist/tools-experiments.d.ts +4 -3
- package/dist/tools-experiments.js +1 -31
- package/dist/tools-experiments.js.map +1 -1
- package/dist/tools-list-stats.d.ts +0 -4
- package/dist/tools-list-stats.js +0 -5
- package/dist/tools-list-stats.js.map +1 -1
- package/dist/tools-pinterest.js +0 -10
- package/dist/tools-pinterest.js.map +1 -1
- package/dist/tools-posts.js +0 -9
- package/dist/tools-posts.js.map +1 -1
- package/dist/tools-prompts.js +0 -23
- package/dist/tools-prompts.js.map +1 -1
- package/dist/tools-publish-existing.js +0 -17
- package/dist/tools-publish-existing.js.map +1 -1
- package/dist/tools-publish-uploaded.js +0 -8
- package/dist/tools-publish-uploaded.js.map +1 -1
- package/dist/tools-publishing-accounts.js +0 -10
- package/dist/tools-publishing-accounts.js.map +1 -1
- package/dist/tools-single-video.d.ts +0 -4
- package/dist/tools-single-video.js +1 -55
- package/dist/tools-single-video.js.map +1 -1
- package/dist/tools-tool-config.d.ts +2 -0
- package/dist/tools-tool-config.js +2 -15
- package/dist/tools-tool-config.js.map +1 -1
- package/dist/tools-user-media.js +0 -5
- package/dist/tools-user-media.js.map +1 -1
- package/dist/tools.d.ts +2 -76
- package/dist/tools.js +4 -82
- package/dist/tools.js.map +1 -1
- package/dist/video-task-tools.d.ts +0 -2
- package/dist/video-task-tools.js +0 -43
- package/dist/video-task-tools.js.map +1 -1
- package/dist/video-type.d.ts +0 -10
- package/dist/video-type.js +0 -17
- package/dist/video-type.js.map +1 -1
- package/dist/voice-filters.d.ts +0 -27
- package/dist/voice-filters.js +0 -62
- package/dist/voice-filters.js.map +1 -1
- 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}`> : {
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
|
-
// Recipe prompt catalog contract: the single source of truth for
|
|
4
|
-
// GET /api/prompts and GET /api/prompts/[slug]. Both apps generate a copy
|
|
5
|
-
// of this file (see scripts/sync-contracts.mjs); never edit a generated copy by hand.
|
|
6
|
-
//
|
|
7
|
-
// The routes serve the web hub (PROMPTS + English recipes copy) to the MCP:
|
|
8
|
-
// the list carries slug/title/description only, the detail adds the full
|
|
9
|
-
// prompt text. Neither endpoint takes a body or a query. Unknown slug ->
|
|
10
|
-
// 404 PROMPT_NOT_FOUND (an ApiError on the MCP, never a 200), so the
|
|
11
|
-
// response schemas below cover the 200 shape only. `success` is a literal
|
|
12
|
-
// `true`: the MCP used to reject any other value as malformed, and the
|
|
13
|
-
// routes never return success:false with a 200.
|
|
14
3
|
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
4
|
export function defineEndpoint(config) {
|
|
20
5
|
return config;
|
|
21
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/contracts/prompts.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/contracts/prompts.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,MAAM,UAAU,cAAc,CAK5B,MAMD;IACC,OAAO,MAAM,CAAC;AAChB,CAAC;AA0BD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC3D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,MAAM,EAAE,kBAAkB;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;IACxC,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,yBAAyB;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,uBAAuB;CAClC,CAAC,CAAC"}
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
export declare const SOCIAL_PROVIDERS: readonly ["youtube", "instagram", "bluesky", "linkedin", "threads", "facebook", "pinterest", "3speak", "rumble", "fanvue", "telegram"];
|
|
2
2
|
export type SocialProvider = (typeof SOCIAL_PROVIDERS)[number];
|
|
3
3
|
export declare function isSocialProvider(value: unknown): value is SocialProvider;
|
|
4
|
-
/** Networks that connect with a credential typed by the user (Bluesky
|
|
5
|
-
* app password, Hive posting key, Rumble access token, Telegram bot
|
|
6
|
-
* token), not OAuth. */
|
|
7
4
|
export declare const DIRECT_CONNECT_PROVIDERS: readonly ["bluesky", "3speak", "rumble", "telegram"];
|
|
8
5
|
export type DirectConnectProvider = (typeof DIRECT_CONNECT_PROVIDERS)[number];
|
|
9
|
-
/** Networks served by POST /api/account/connect-url: every network that
|
|
10
|
-
* does not connect directly. */
|
|
11
6
|
export type OAuthConnectProvider = Exclude<SocialProvider, DirectConnectProvider>;
|
|
12
7
|
export declare const OAUTH_CONNECT_PROVIDERS: readonly OAuthConnectProvider[];
|
|
13
8
|
export declare function isOAuthConnectProvider(value: unknown): value is OAuthConnectProvider;
|
|
14
|
-
/** Networks whose publish handler posts an image (JPEG/PNG) as well as a
|
|
15
|
-
* video. YouTube, Rumble and 3Speak are video-only platforms; Fanvue's
|
|
16
|
-
* vault upload is wired for video only. Telegram sends a photo with
|
|
17
|
-
* sendPhoto. */
|
|
18
9
|
export declare const IMAGE_PROVIDERS: readonly ["instagram", "bluesky", "linkedin", "threads", "facebook", "pinterest", "telegram"];
|
|
19
10
|
export type ImageProvider = (typeof IMAGE_PROVIDERS)[number];
|
|
20
11
|
export declare function isImageProvider(value: unknown): value is ImageProvider;
|
|
21
|
-
/** Networks whose publish takes a title and a description instead of a
|
|
22
|
-
* caption. Every other network takes a caption (Pinterest also takes an
|
|
23
|
-
* optional pin title next to it). */
|
|
24
12
|
export declare const TITLE_PROVIDERS: readonly ["youtube", "rumble", "fanvue"];
|
|
25
13
|
export type TitleProvider = (typeof TITLE_PROVIDERS)[number];
|
|
26
14
|
export declare function isTitleProvider(value: unknown): value is TitleProvider;
|
|
27
|
-
/** The multipart field each network's account ids arrive under in
|
|
28
|
-
* POST /api/upload-content. The web handlers read it, and the web
|
|
29
|
-
* publish paths and the MCP direct publish write it. */
|
|
30
15
|
export declare const PUBLISH_ACCOUNT_FIELDS: Record<SocialProvider, string>;
|
|
31
|
-
/** The account-id column of each network in public.schedules. */
|
|
32
16
|
export declare const SCHEDULE_ACCOUNT_COLUMNS: {
|
|
33
17
|
readonly youtube: "youtube_account_ids";
|
|
34
18
|
readonly instagram: "instagram_account_ids";
|
|
@@ -1,21 +1,5 @@
|
|
|
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
|
-
// providers — THE list of social networks Post Engineer publishes to.
|
|
5
|
-
//
|
|
6
|
-
// Every provider list in the web app, the MCP server and the OpenAPI
|
|
7
|
-
// generator derives from SOCIAL_PROVIDERS. Never type the list again
|
|
8
|
-
// anywhere else: a hand copy drifts the moment a network is added (each
|
|
9
|
-
// of fanvue, 3speak and rumble needed edits in about 25 copies, and the
|
|
10
|
-
// MCP accounts (action: connect) list silently missed pinterest).
|
|
11
|
-
//
|
|
12
|
-
// The subsets below are facts of their own (how a network connects), so
|
|
13
|
-
// they name their members and are checked against SOCIAL_PROVIDERS at
|
|
14
|
-
// compile time by `satisfies`.
|
|
15
|
-
//
|
|
16
|
-
// This file has no imports, so the OpenAPI generator (plain Node .mjs)
|
|
17
|
-
// can import it directly too: Node strips the types.
|
|
18
|
-
//---------------
|
|
19
3
|
export const SOCIAL_PROVIDERS = [
|
|
20
4
|
'youtube',
|
|
21
5
|
'instagram',
|
|
@@ -32,32 +16,19 @@ export const SOCIAL_PROVIDERS = [
|
|
|
32
16
|
export function isSocialProvider(value) {
|
|
33
17
|
return typeof value === 'string' && SOCIAL_PROVIDERS.includes(value);
|
|
34
18
|
}
|
|
35
|
-
/** Networks that connect with a credential typed by the user (Bluesky
|
|
36
|
-
* app password, Hive posting key, Rumble access token, Telegram bot
|
|
37
|
-
* token), not OAuth. */
|
|
38
19
|
export const DIRECT_CONNECT_PROVIDERS = ['bluesky', '3speak', 'rumble', 'telegram'];
|
|
39
20
|
export const OAUTH_CONNECT_PROVIDERS = SOCIAL_PROVIDERS.filter((provider) => !DIRECT_CONNECT_PROVIDERS.includes(provider));
|
|
40
21
|
export function isOAuthConnectProvider(value) {
|
|
41
22
|
return typeof value === 'string' && OAUTH_CONNECT_PROVIDERS.includes(value);
|
|
42
23
|
}
|
|
43
|
-
/** Networks whose publish handler posts an image (JPEG/PNG) as well as a
|
|
44
|
-
* video. YouTube, Rumble and 3Speak are video-only platforms; Fanvue's
|
|
45
|
-
* vault upload is wired for video only. Telegram sends a photo with
|
|
46
|
-
* sendPhoto. */
|
|
47
24
|
export const IMAGE_PROVIDERS = ['instagram', 'bluesky', 'linkedin', 'threads', 'facebook', 'pinterest', 'telegram'];
|
|
48
25
|
export function isImageProvider(value) {
|
|
49
26
|
return typeof value === 'string' && IMAGE_PROVIDERS.includes(value);
|
|
50
27
|
}
|
|
51
|
-
/** Networks whose publish takes a title and a description instead of a
|
|
52
|
-
* caption. Every other network takes a caption (Pinterest also takes an
|
|
53
|
-
* optional pin title next to it). */
|
|
54
28
|
export const TITLE_PROVIDERS = ['youtube', 'rumble', 'fanvue'];
|
|
55
29
|
export function isTitleProvider(value) {
|
|
56
30
|
return typeof value === 'string' && TITLE_PROVIDERS.includes(value);
|
|
57
31
|
}
|
|
58
|
-
/** The multipart field each network's account ids arrive under in
|
|
59
|
-
* POST /api/upload-content. The web handlers read it, and the web
|
|
60
|
-
* publish paths and the MCP direct publish write it. */
|
|
61
32
|
export const PUBLISH_ACCOUNT_FIELDS = {
|
|
62
33
|
youtube: 'accountIds',
|
|
63
34
|
instagram: 'igAccountIds',
|
|
@@ -71,7 +42,6 @@ export const PUBLISH_ACCOUNT_FIELDS = {
|
|
|
71
42
|
fanvue: 'fanvueAccountIds',
|
|
72
43
|
telegram: 'telegramAccountIds',
|
|
73
44
|
};
|
|
74
|
-
/** The account-id column of each network in public.schedules. */
|
|
75
45
|
export const SCHEDULE_ACCOUNT_COLUMNS = {
|
|
76
46
|
youtube: 'youtube_account_ids',
|
|
77
47
|
instagram: 'instagram_account_ids',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/contracts/providers.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/contracts/providers.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,WAAW;IACX,SAAS;IACT,UAAU;IACV,SAAS;IACT,UAAU;IACV,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,UAAU;CACF,CAAC;AAGX,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,gBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9F,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAS,E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IACtC,OAAO,EAAE,qBAAqB;IAC9B,SAAS,EAAE,uBAAuB;IAClC,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,sBAAsB;IAChC,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,sBAAsB;IAChC,SAAS,EAAE,uBAAuB;IAClC,QAAQ,EAAE,wBAAwB;IAClC,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,oBAAoB;IAC5B,QAAQ,EAAE,sBAAsB;CACiB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
|
-
// Schedule warning objects (never a bare string). `voice_fallback_applied`
|
|
4
|
-
// names the voice the route swapped in. `account_needs_reconnect` names
|
|
5
|
-
// the accounts whose stored login is already dead.
|
|
6
3
|
import { z } from 'zod';
|
|
7
4
|
import { SOCIAL_PROVIDERS } from './providers.js';
|
|
8
5
|
export const VOICE_FALLBACK_WARNING_CODE = 'voice_fallback_applied';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-warnings.js","sourceRoot":"","sources":["../../src/contracts/schedule-warnings.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"schedule-warnings.js","sourceRoot":"","sources":["../../src/contracts/schedule-warnings.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,2BAA2B,GAAG,wBAAwB,CAAC;AACpE,MAAM,CAAC,MAAM,oCAAoC,GAAG,yBAAyB,CAAC;AAE9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC;IAC5C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,oCAAoC,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACzB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC7B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACX,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAChE,0BAA0B;IAC1B,kCAAkC;CACnC,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,32 +14,24 @@ 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}`> : {
|
|
44
33
|
[Key in Rest]: string;
|
|
45
34
|
} : Record<never, never>;
|
|
46
|
-
/** A row of the schedules table, as GET /api/schedule returns it. */
|
|
47
35
|
export declare const ScheduleRowSchema: z.ZodObject<{
|
|
48
36
|
id: z.ZodString;
|
|
49
37
|
persona_id: z.ZodNullable<z.ZodString>;
|
|
@@ -160,9 +148,7 @@ export type RangeParseResult = {
|
|
|
160
148
|
message: string;
|
|
161
149
|
};
|
|
162
150
|
export declare function parseStatusRange(params: URLSearchParams): RangeParseResult;
|
|
163
|
-
/** Mirrors apps/web/lib/timezone.ts hasExplicitOffset (Z or ±hh:mm / ±hhmm). */
|
|
164
151
|
export declare function hasExplicitOffset(value: string): boolean;
|
|
165
|
-
/** A presented slot: the row fields plus the enrichment spread over them. */
|
|
166
152
|
export declare const StatusSlotSchema: z.ZodObject<{
|
|
167
153
|
id: z.ZodString;
|
|
168
154
|
slot_at: z.ZodString;
|
|
@@ -1,38 +1,10 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
|
-
// Schedule contract: the single source of truth for the schedule reads and
|
|
4
|
-
// slot mutations (GET/DELETE /api/schedule, GET /api/schedule/status,
|
|
5
|
-
// GET/PATCH/DELETE /api/schedule/slots/[slotId]). Both apps generate a copy
|
|
6
|
-
// of this file (see scripts/sync-contracts.mjs); never edit a generated
|
|
7
|
-
// copy by hand.
|
|
8
|
-
//
|
|
9
|
-
// Shapes mirror the routes, not a cleaned-up ideal:
|
|
10
|
-
// - GET /api/schedule returns the raw Supabase rows, so the schedule row
|
|
11
|
-
// keeps its snake_case keys and DB nullability (persona_id is nullable
|
|
12
|
-
// for faceless schedules, migration 012; publish_mode is pinned to the
|
|
13
|
-
// 'scheduled'/'asap' CHECK of migration 015).
|
|
14
|
-
// - GET /api/schedule/status returns the presented slots: the snake_case
|
|
15
|
-
// row fields (RESULT_SELECT) plus the camelCase enrichment
|
|
16
|
-
// (apps/web/lib/schedule-slot-presentation.ts) and the publish rows
|
|
17
|
-
// (apps/web/lib/publish-user-notice.ts). `status` is the PRESENTED
|
|
18
|
-
// status: pending shows as 'awaiting', a failed slot with published
|
|
19
|
-
// outcomes shows as 'completed'.
|
|
20
|
-
// - PATCH /api/schedule/slots/[slotId] does not use readBody (its coded
|
|
21
|
-
// error envelope would change), so the body schema below mirrors the
|
|
22
|
-
// route's messages and the equivalence test pins them; the 3h/30d
|
|
23
|
-
// window rule stays server-side (apps/web/lib/schedule-window.ts).
|
|
24
|
-
// `success` is a literal `true`: the routes never return success:false
|
|
25
|
-
// with a 200.
|
|
26
3
|
import { z } from 'zod';
|
|
27
|
-
/** Define one endpoint contract. The literal path is preserved in the type
|
|
28
|
-
* so ParamsOf can read its `:param` segments. `Body`/`Query` default to
|
|
29
|
-
* `undefined` so an omitted optional schema stays `undefined` (not the
|
|
30
|
-
* bare `ZodType`) in the returned definition. */
|
|
31
4
|
export function defineEndpoint(config) {
|
|
32
5
|
return config;
|
|
33
6
|
}
|
|
34
7
|
import { PublishProviderFailureSchema, PublishUserNoticeSchema, SlotDetailSchema, } from './posts.js';
|
|
35
|
-
/** A row of the schedules table, as GET /api/schedule returns it. */
|
|
36
8
|
export const ScheduleRowSchema = z.object({
|
|
37
9
|
id: z.string(),
|
|
38
10
|
persona_id: z.string().nullable(),
|
|
@@ -62,10 +34,6 @@ export const ListSchedulesResponseSchema = z.object({
|
|
|
62
34
|
success: z.literal(true),
|
|
63
35
|
schedules: z.array(ScheduleRowSchema),
|
|
64
36
|
});
|
|
65
|
-
//---------------
|
|
66
|
-
// DELETE /api/schedule?id= — the id check, as a parser so the MCP side
|
|
67
|
-
// can pin it. The route returns the same 400 message as before.
|
|
68
|
-
//---------------
|
|
69
37
|
export function parseCancelScheduleQuery(params) {
|
|
70
38
|
const id = params.get('id');
|
|
71
39
|
if (!id) {
|
|
@@ -92,10 +60,6 @@ export const CancelScheduleResponseSchema = z.object({
|
|
|
92
60
|
refunds: z.array(CancelRefundSchema),
|
|
93
61
|
batchDiscountWithheld: z.number(),
|
|
94
62
|
});
|
|
95
|
-
//---------------
|
|
96
|
-
// GET /api/schedule/status — the limit and range parsers, moved verbatim
|
|
97
|
-
// from apps/web/app/api/schedule/status/route.ts and range.ts.
|
|
98
|
-
//---------------
|
|
99
63
|
export const STATUS_LIMIT_DEFAULT = 10;
|
|
100
64
|
export const STATUS_LIMIT_MAX = 500;
|
|
101
65
|
export function parseStatusLimit(value) {
|
|
@@ -150,11 +114,9 @@ export function parseStatusRange(params) {
|
|
|
150
114
|
}
|
|
151
115
|
return { kind: 'range', from: fromDate.toISOString(), to: toDate.toISOString() };
|
|
152
116
|
}
|
|
153
|
-
/** Mirrors apps/web/lib/timezone.ts hasExplicitOffset (Z or ±hh:mm / ±hhmm). */
|
|
154
117
|
export function hasExplicitOffset(value) {
|
|
155
118
|
return /(?:Z|[+-]\d{2}:?\d{2})$/.test(value.trim());
|
|
156
119
|
}
|
|
157
|
-
/** A presented slot: the row fields plus the enrichment spread over them. */
|
|
158
120
|
export const StatusSlotSchema = z.object({
|
|
159
121
|
id: z.string(),
|
|
160
122
|
slot_at: z.string(),
|
|
@@ -192,17 +154,9 @@ export const ListPostsInRangeResponseSchema = z.object({
|
|
|
192
154
|
slots: z.array(StatusSlotSchema),
|
|
193
155
|
truncated: z.boolean(),
|
|
194
156
|
});
|
|
195
|
-
//---------------
|
|
196
|
-
// GET /api/schedule/slots/[slotId] — the same detail as GET /api/posts/[id]
|
|
197
|
-
// returns for a slot, without the `kind` wrapper the posts route adds.
|
|
198
|
-
//---------------
|
|
199
157
|
export const GetSlotResponseSchema = SlotDetailSchema.extend({
|
|
200
158
|
success: z.literal(true),
|
|
201
159
|
});
|
|
202
|
-
//---------------
|
|
203
|
-
// PATCH /api/schedule/slots/[slotId] — mirrors the route's validation
|
|
204
|
-
// messages; the 3h/30d window rule stays server-side.
|
|
205
|
-
//---------------
|
|
206
160
|
function nonBlank(message) {
|
|
207
161
|
return z.string().min(1, message).refine((value) => value.trim().length > 0, message);
|
|
208
162
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/contracts/schedule.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/contracts/schedule.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0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AE,QAAQ;IAChB,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,4BAA4B;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,sBAAsB;IAC5B,QAAQ,EAAE,uBAAuB;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;IAC7C,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,sBAAsB;IAC5B,QAAQ,EAAE,8BAA8B;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC;IACpC,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,6BAA6B;IACnC,QAAQ,EAAE,qBAAqB;CAChC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC;IACvC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,6BAA6B;IACnC,QAAQ,EAAE,wBAAwB;CACnC,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}`> : {
|
|
@@ -46,6 +35,7 @@ export type ParamsOf<Path extends string> = Path extends `${string}:${infer Rest
|
|
|
46
35
|
export declare const ToolConfigSearchToolSchema: z.ZodEnum<{
|
|
47
36
|
tavily: "tavily";
|
|
48
37
|
exa: "exa";
|
|
38
|
+
own: "own";
|
|
49
39
|
}>;
|
|
50
40
|
export type ToolConfigSearchTool = z.infer<typeof ToolConfigSearchToolSchema>;
|
|
51
41
|
export declare const ToolConfigStockSourceSchema: z.ZodEnum<{
|
|
@@ -73,6 +63,7 @@ export declare const SaveToolConfigBodySchema: z.ZodObject<{
|
|
|
73
63
|
searchTool: z.ZodNullable<z.ZodEnum<{
|
|
74
64
|
tavily: "tavily";
|
|
75
65
|
exa: "exa";
|
|
66
|
+
own: "own";
|
|
76
67
|
}>>;
|
|
77
68
|
stockSources: z.ZodArray<z.ZodEnum<{
|
|
78
69
|
pexels: "pexels";
|
|
@@ -94,6 +85,7 @@ export declare const GetToolConfigResponseSchema: z.ZodObject<{
|
|
|
94
85
|
searchTool: z.ZodNullable<z.ZodEnum<{
|
|
95
86
|
tavily: "tavily";
|
|
96
87
|
exa: "exa";
|
|
88
|
+
own: "own";
|
|
97
89
|
}>>;
|
|
98
90
|
stockSources: z.ZodArray<z.ZodEnum<{
|
|
99
91
|
pexels: "pexels";
|
|
@@ -122,6 +114,7 @@ export declare const SaveToolConfigResponseSchema: z.ZodObject<{
|
|
|
122
114
|
searchTool: z.ZodNullable<z.ZodEnum<{
|
|
123
115
|
tavily: "tavily";
|
|
124
116
|
exa: "exa";
|
|
117
|
+
own: "own";
|
|
125
118
|
}>>;
|
|
126
119
|
stockSources: z.ZodArray<z.ZodEnum<{
|
|
127
120
|
pexels: "pexels";
|
|
@@ -150,6 +143,7 @@ export declare const getToolConfig: EndpointDefinition<undefined, undefined, z.Z
|
|
|
150
143
|
searchTool: z.ZodNullable<z.ZodEnum<{
|
|
151
144
|
tavily: "tavily";
|
|
152
145
|
exa: "exa";
|
|
146
|
+
own: "own";
|
|
153
147
|
}>>;
|
|
154
148
|
stockSources: z.ZodArray<z.ZodEnum<{
|
|
155
149
|
pexels: "pexels";
|
|
@@ -175,6 +169,7 @@ export declare const saveToolConfig: EndpointDefinition<z.ZodObject<{
|
|
|
175
169
|
searchTool: z.ZodNullable<z.ZodEnum<{
|
|
176
170
|
tavily: "tavily";
|
|
177
171
|
exa: "exa";
|
|
172
|
+
own: "own";
|
|
178
173
|
}>>;
|
|
179
174
|
stockSources: z.ZodArray<z.ZodEnum<{
|
|
180
175
|
pexels: "pexels";
|
|
@@ -194,6 +189,7 @@ export declare const saveToolConfig: EndpointDefinition<z.ZodObject<{
|
|
|
194
189
|
searchTool: z.ZodNullable<z.ZodEnum<{
|
|
195
190
|
tavily: "tavily";
|
|
196
191
|
exa: "exa";
|
|
192
|
+
own: "own";
|
|
197
193
|
}>>;
|
|
198
194
|
stockSources: z.ZodArray<z.ZodEnum<{
|
|
199
195
|
pexels: "pexels";
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
/** Define one endpoint contract. The literal path is preserved in the type
|
|
5
|
-
* so ParamsOf can read its `:param` segments. `Body`/`Query` default to
|
|
6
|
-
* `undefined` so an omitted optional schema stays `undefined` (not the
|
|
7
|
-
* bare `ZodType`) in the returned definition. */
|
|
8
4
|
export function defineEndpoint(config) {
|
|
9
5
|
return config;
|
|
10
6
|
}
|
|
11
|
-
|
|
12
|
-
// Tool Config (issue #669): per-user research/stock tool configuration.
|
|
13
|
-
// The single source of truth for the GET/PUT /api/tool-config exchange.
|
|
14
|
-
// The route re-validates strictly (lib/tool-config.ts): a key is only
|
|
15
|
-
// accepted for the tool/source it belongs to, and nothing is truncated,
|
|
16
|
-
// coerced, or dropped. These schemas describe the exchange shape only.
|
|
17
|
-
//---------------
|
|
18
|
-
export const ToolConfigSearchToolSchema = z.enum(['tavily', 'exa']);
|
|
7
|
+
export const ToolConfigSearchToolSchema = z.enum(['tavily', 'exa', 'own']);
|
|
19
8
|
export const ToolConfigStockSourceSchema = z.enum(['pexels', 'pixabay', 'coverr']);
|
|
20
9
|
export const ToolConfigKeyNamesSchema = z.enum(['tavily', 'exa', 'pexels', 'pixabay', 'coverr']);
|
|
21
|
-
// Keys are optional per name: only the configured tools carry one. The
|
|
22
|
-
// 512-character cap is the lib's validation bound, pinned here too. Strict:
|
|
23
|
-
// an unknown key name fails fast instead of being stripped silently —
|
|
24
|
-
// a typo'd key would otherwise vanish while the save reports success.
|
|
25
10
|
export const ToolConfigKeysSchema = z
|
|
26
11
|
.object({
|
|
27
12
|
tavily: z.string().min(1).max(512).optional(),
|
|
@@ -31,17 +16,11 @@ export const ToolConfigKeysSchema = z
|
|
|
31
16
|
coverr: z.string().min(1).max(512).optional(),
|
|
32
17
|
})
|
|
33
18
|
.strict();
|
|
34
|
-
// Replace-whole save: every field is required, so a partial write can
|
|
35
|
-
// never leave a stale key behind for a tool the user just removed.
|
|
36
19
|
export const SaveToolConfigBodySchema = z.object({
|
|
37
20
|
searchTool: ToolConfigSearchToolSchema.nullable(),
|
|
38
21
|
stockSources: z.array(ToolConfigStockSourceSchema),
|
|
39
22
|
keys: ToolConfigKeysSchema,
|
|
40
23
|
});
|
|
41
|
-
// GET returns presence only — never a key value. The keys are stored
|
|
42
|
-
// encrypted as the vault of record; what a later session needs to know is
|
|
43
|
-
// which tools are configured, and the agent calls those APIs with the keys
|
|
44
|
-
// from its own environment.
|
|
45
24
|
export const GetToolConfigResponseSchema = z.object({
|
|
46
25
|
success: z.literal(true),
|
|
47
26
|
configured: z.boolean(),
|
|
@@ -62,8 +41,6 @@ export const GetToolConfigResponseSchema = z.object({
|
|
|
62
41
|
coverr: z.string().nullable(),
|
|
63
42
|
}),
|
|
64
43
|
});
|
|
65
|
-
// PUT returns presence only: each key as present + its last 4 characters,
|
|
66
|
-
// never a key value.
|
|
67
44
|
export const SaveToolConfigResponseSchema = z.object({
|
|
68
45
|
success: z.literal(true),
|
|
69
46
|
configured: z.literal(true),
|
|
@@ -84,9 +61,6 @@ export const SaveToolConfigResponseSchema = z.object({
|
|
|
84
61
|
coverr: z.string().nullable(),
|
|
85
62
|
}),
|
|
86
63
|
});
|
|
87
|
-
//---------------
|
|
88
|
-
// Endpoints.
|
|
89
|
-
//---------------
|
|
90
64
|
export const getToolConfig = defineEndpoint({
|
|
91
65
|
method: 'GET',
|
|
92
66
|
path: '/api/tool-config',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../src/contracts/tool-config.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../src/contracts/tool-config.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,MAAM,UAAU,cAAc,CAK5B,MAMD;IACC,OAAO,MAAM,CAAC;AAChB,CAAC;AA0BD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAG3E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGnF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC7C,GAAG,EAAE,C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MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC;IAC1C,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,2BAA2B;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;IAC3C,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,wBAAwB;IAC9B,QAAQ,EAAE,4BAA4B;CACvC,CAAC,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/** Signed video uploads (issue #561): the 2GB ceiling, same as upload-content. */
|
|
2
1
|
export declare const VIDEO_UPLOAD_CONTENT_TYPES: readonly ["video/mp4", "video/quicktime"];
|
|
3
2
|
export type VideoUploadContentType = (typeof VIDEO_UPLOAD_CONTENT_TYPES)[number];
|
|
4
3
|
export declare const MAX_VIDEO_UPLOAD_BYTES: number;
|
|
5
|
-
/** A signed upload may also carry an image (JPEG/PNG) for the image
|
|
6
|
-
* networks (IMAGE_PROVIDERS), capped like an inline image. */
|
|
7
4
|
export declare const IMAGE_UPLOAD_CONTENT_TYPES: readonly ["image/jpeg", "image/png"];
|
|
8
5
|
export type ImageUploadContentType = (typeof IMAGE_UPLOAD_CONTENT_TYPES)[number];
|
|
9
6
|
export declare const MAX_IMAGE_UPLOAD_BYTES: number;
|
|
@@ -1,17 +1,7 @@
|
|
|
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
|
-
// upload-types — what a signed upload (POST /api/videos/upload-url) may
|
|
5
|
-
// carry: a video (MP4/MOV, 2GB) or, for the image networks, an image
|
|
6
|
-
// (JPEG/PNG, 8 MB; the same cap as an inline image and every image
|
|
7
|
-
// handler). No imports, so the OpenAPI generator (plain Node) imports it
|
|
8
|
-
// directly; videos.ts re-exports it for the endpoint contracts.
|
|
9
|
-
//---------------
|
|
10
|
-
/** Signed video uploads (issue #561): the 2GB ceiling, same as upload-content. */
|
|
11
3
|
export const VIDEO_UPLOAD_CONTENT_TYPES = ['video/mp4', 'video/quicktime'];
|
|
12
4
|
export const MAX_VIDEO_UPLOAD_BYTES = 2 * 1024 * 1024 * 1024;
|
|
13
|
-
/** A signed upload may also carry an image (JPEG/PNG) for the image
|
|
14
|
-
* networks (IMAGE_PROVIDERS), capped like an inline image. */
|
|
15
5
|
export const IMAGE_UPLOAD_CONTENT_TYPES = ['image/jpeg', 'image/png'];
|
|
16
6
|
export const MAX_IMAGE_UPLOAD_BYTES = 8 * 1024 * 1024;
|
|
17
7
|
export const UPLOAD_CONTENT_TYPES = [...VIDEO_UPLOAD_CONTENT_TYPES, ...IMAGE_UPLOAD_CONTENT_TYPES];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-types.js","sourceRoot":"","sources":["../../src/contracts/upload-types.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"upload-types.js","sourceRoot":"","sources":["../../src/contracts/upload-types.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAU,CAAC;AAEpF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,YAAY,EAAE,WAAW,CAAU,CAAC;AAE/E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,0BAA0B,EAAE,GAAG,0BAA0B,CAAU,CAAC;AAE5G,MAAM,CAAC,MAAM,2BAA2B,GAAG,0EAA0E,CAAC;AAEtH,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,0BAAgD,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxG,CAAC"}
|