@vidofy/mcp 0.1.0
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/LICENSE +21 -0
- package/README.md +151 -0
- package/dist/backend.d.ts +133 -0
- package/dist/backend.js +455 -0
- package/dist/config.d.ts +85 -0
- package/dist/config.js +207 -0
- package/dist/heartbeat.d.ts +11 -0
- package/dist/heartbeat.js +70 -0
- package/dist/http.d.ts +44 -0
- package/dist/http.js +885 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +661 -0
- package/dist/log.d.ts +19 -0
- package/dist/log.js +22 -0
- package/dist/map/b2c.d.ts +139 -0
- package/dist/map/b2c.js +236 -0
- package/dist/media-duration.d.ts +33 -0
- package/dist/media-duration.js +137 -0
- package/dist/oauth/authorize.d.ts +61 -0
- package/dist/oauth/authorize.js +275 -0
- package/dist/oauth/clients.d.ts +137 -0
- package/dist/oauth/clients.js +621 -0
- package/dist/oauth/ratelimit.d.ts +92 -0
- package/dist/oauth/ratelimit.js +116 -0
- package/dist/oauth/store.d.ts +135 -0
- package/dist/oauth/store.js +277 -0
- package/dist/oauth/token.d.ts +29 -0
- package/dist/oauth/token.js +165 -0
- package/dist/schema.d.ts +147 -0
- package/dist/schema.js +629 -0
- package/dist/tools/account.d.ts +28 -0
- package/dist/tools/account.js +130 -0
- package/dist/tools/generation.d.ts +102 -0
- package/dist/tools/generation.js +1194 -0
- package/dist/tools/info.d.ts +50 -0
- package/dist/tools/info.js +95 -0
- package/dist/ui/generation-card.html +869 -0
- package/package.json +79 -0
- package/server.json +36 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The read-only catalogue tools: what can Vidofy do, with which model, and
|
|
3
|
+
* what does that model need.
|
|
4
|
+
*
|
|
5
|
+
* These are what an agent calls first, and they are the proof that the
|
|
6
|
+
* transport works end to end — no credential spending, no state change.
|
|
7
|
+
*
|
|
8
|
+
* list_modes → list_models → get_model is the intended path: the first two are
|
|
9
|
+
* cheap and slim, the third is the detailed one you ask for once you have
|
|
10
|
+
* chosen.
|
|
11
|
+
*
|
|
12
|
+
* THE FIRST TWO SLIM THE RESPONSE HARD, on purpose. /app/v1/info/models-flat/t2i is
|
|
13
|
+
* 116 KB because every item carries the model's full m_options (upload rules,
|
|
14
|
+
* dynamic fields, posters, preview video). Handing that to a language model
|
|
15
|
+
* would burn its context to list fifty names. Slimmed to what a chooser needs,
|
|
16
|
+
* the same call is 6.9 KB — measured 2026-09-06. The full options come back on
|
|
17
|
+
* demand through get_model, which is what they are for.
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
import type { Config } from '../config.js';
|
|
21
|
+
export declare const listModesInput: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
22
|
+
export declare function listModes(cfg: Config): Promise<unknown>;
|
|
23
|
+
export declare const listModelsInput: z.ZodObject<{
|
|
24
|
+
mode: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
mode: string;
|
|
27
|
+
}, {
|
|
28
|
+
mode: string;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function listModels(cfg: Config, args: {
|
|
31
|
+
mode: string;
|
|
32
|
+
}): Promise<unknown>;
|
|
33
|
+
export declare const getModelInput: z.ZodObject<{
|
|
34
|
+
model: z.ZodString;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
model: string;
|
|
37
|
+
}, {
|
|
38
|
+
model: string;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Everything needed to call generate on one model: a JSON Schema for its
|
|
42
|
+
* inputs, the wire names, the file slots with their limits, and the notes a
|
|
43
|
+
* schema cannot express.
|
|
44
|
+
*
|
|
45
|
+
* This is where a model's full options are meant to be read — list_models
|
|
46
|
+
* strips them precisely because they belong here and nowhere else.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getModel(cfg: Config, args: {
|
|
49
|
+
model: string;
|
|
50
|
+
}): Promise<unknown>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The read-only catalogue tools: what can Vidofy do, with which model, and
|
|
3
|
+
* what does that model need.
|
|
4
|
+
*
|
|
5
|
+
* These are what an agent calls first, and they are the proof that the
|
|
6
|
+
* transport works end to end — no credential spending, no state change.
|
|
7
|
+
*
|
|
8
|
+
* list_modes → list_models → get_model is the intended path: the first two are
|
|
9
|
+
* cheap and slim, the third is the detailed one you ask for once you have
|
|
10
|
+
* chosen.
|
|
11
|
+
*
|
|
12
|
+
* THE FIRST TWO SLIM THE RESPONSE HARD, on purpose. /app/v1/info/models-flat/t2i is
|
|
13
|
+
* 116 KB because every item carries the model's full m_options (upload rules,
|
|
14
|
+
* dynamic fields, posters, preview video). Handing that to a language model
|
|
15
|
+
* would burn its context to list fifty names. Slimmed to what a chooser needs,
|
|
16
|
+
* the same call is 6.9 KB — measured 2026-09-06. The full options come back on
|
|
17
|
+
* demand through get_model, which is what they are for.
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
import { request } from '../backend.js';
|
|
21
|
+
import { buildModelSchema } from '../schema.js';
|
|
22
|
+
export const listModesInput = z.object({}).describe('No arguments.');
|
|
23
|
+
export async function listModes(cfg) {
|
|
24
|
+
const res = await request(cfg, { method: 'GET', path: 'info/modes' });
|
|
25
|
+
const modes = (res.modes ?? []).map((m) => ({
|
|
26
|
+
// m_code is what every other endpoint wants in its URL, so it leads.
|
|
27
|
+
mode: m['m_code'],
|
|
28
|
+
name: m['m_name'],
|
|
29
|
+
description: m['m_description'] ?? null,
|
|
30
|
+
media_type: m['m_media_type'],
|
|
31
|
+
input_type: m['m_input_type'],
|
|
32
|
+
models: m['models_count'],
|
|
33
|
+
default_model: m['m_default_model'] ?? null,
|
|
34
|
+
}));
|
|
35
|
+
return { count: modes.length, modes };
|
|
36
|
+
}
|
|
37
|
+
export const listModelsInput = z.object({
|
|
38
|
+
mode: z
|
|
39
|
+
.string()
|
|
40
|
+
.min(1)
|
|
41
|
+
.describe('Mode code from list_modes — e.g. t2i, t2v, i2v, lipsync. Not the long name.'),
|
|
42
|
+
});
|
|
43
|
+
export async function listModels(cfg, args) {
|
|
44
|
+
const res = await request(cfg, {
|
|
45
|
+
method: 'GET',
|
|
46
|
+
path: `info/models-flat/${encodeURIComponent(args.mode)}`,
|
|
47
|
+
});
|
|
48
|
+
const models = (res.models_flat ?? []).map((m) => ({
|
|
49
|
+
// model_key is the identifier generate() takes; slug is what get_model
|
|
50
|
+
// and the website URLs use. Both are needed, and they are not the same
|
|
51
|
+
// string — 'Qwen_image_3_0_pro_t2i' vs 'qwen-image-3-0-pro-t2i'.
|
|
52
|
+
model_key: m['m_model_key'],
|
|
53
|
+
slug: m['m_slug'],
|
|
54
|
+
name: m['m_name'],
|
|
55
|
+
/* The FLOOR across every option combination, not the price of any
|
|
56
|
+
particular request — see ModelSchema.credits_from in schema.ts for
|
|
57
|
+
why the name carries the qualifier. Comparable between models on
|
|
58
|
+
this list, which is what a picker needs; never quotable to a user. */
|
|
59
|
+
credits_from: m['m_coins'],
|
|
60
|
+
estimated_seconds: m['m_sec'],
|
|
61
|
+
media_type: m['m_media_type'],
|
|
62
|
+
quality: m['m_quality'] ?? null,
|
|
63
|
+
summary: m['m_title'] ?? null,
|
|
64
|
+
}));
|
|
65
|
+
return {
|
|
66
|
+
mode: res.mode_code ?? args.mode,
|
|
67
|
+
default_model: res.default_model ?? null,
|
|
68
|
+
count: models.length,
|
|
69
|
+
models,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/* ── get_model ───────────────────────────────────────────────────────────── */
|
|
73
|
+
export const getModelInput = z.object({
|
|
74
|
+
model: z
|
|
75
|
+
.string()
|
|
76
|
+
.min(1)
|
|
77
|
+
.describe('The model slug from list_models (e.g. "nano-banana-2-t2i"). ' +
|
|
78
|
+
'The slug, not the model_key — they differ in case and separators.'),
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Everything needed to call generate on one model: a JSON Schema for its
|
|
82
|
+
* inputs, the wire names, the file slots with their limits, and the notes a
|
|
83
|
+
* schema cannot express.
|
|
84
|
+
*
|
|
85
|
+
* This is where a model's full options are meant to be read — list_models
|
|
86
|
+
* strips them precisely because they belong here and nowhere else.
|
|
87
|
+
*/
|
|
88
|
+
export async function getModel(cfg, args) {
|
|
89
|
+
const payload = await request(cfg, {
|
|
90
|
+
method: 'GET',
|
|
91
|
+
path: `info/model-info/${encodeURIComponent(args.model)}`,
|
|
92
|
+
});
|
|
93
|
+
return buildModelSchema(payload);
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=info.js.map
|