@quiki/mcp 0.4.2 → 0.6.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.
Files changed (39) hide show
  1. package/README.md +68 -10
  2. package/dist/index.d.ts +28 -0
  3. package/dist/index.js +62 -99
  4. package/dist/nextCursor.d.ts +3 -0
  5. package/dist/nextCursor.js +11 -0
  6. package/dist/outputSchemas.d.ts +267 -0
  7. package/dist/outputSchemas.js +232 -0
  8. package/dist/tools/addToFolder.d.ts +43 -0
  9. package/dist/tools/addToFolder.js +69 -0
  10. package/dist/tools/bulkImport.d.ts +25 -0
  11. package/dist/tools/bulkImport.js +11 -0
  12. package/dist/tools/bulkImportEstimate.d.ts +24 -0
  13. package/dist/tools/bulkImportEstimate.js +10 -0
  14. package/dist/tools/createFolder.d.ts +41 -0
  15. package/dist/tools/createFolder.js +50 -0
  16. package/dist/tools/getBulkImportStatus.d.ts +28 -0
  17. package/dist/tools/getBulkImportStatus.js +10 -0
  18. package/dist/tools/getScan.d.ts +38 -0
  19. package/dist/tools/getScan.js +10 -0
  20. package/dist/tools/getVideo.d.ts +53 -0
  21. package/dist/tools/getVideo.js +35 -6
  22. package/dist/tools/listBulkImports.d.ts +45 -0
  23. package/dist/tools/listBulkImports.js +55 -0
  24. package/dist/tools/listFolderVideos.d.ts +65 -0
  25. package/dist/tools/listFolderVideos.js +64 -0
  26. package/dist/tools/listFolders.d.ts +27 -0
  27. package/dist/tools/listFolders.js +29 -0
  28. package/dist/tools/listRecentVideos.d.ts +36 -0
  29. package/dist/tools/listRecentVideos.js +30 -4
  30. package/dist/tools/scanUrl.d.ts +38 -0
  31. package/dist/tools/scanUrl.js +11 -0
  32. package/dist/tools/searchVideos.d.ts +88 -0
  33. package/dist/tools/searchVideos.js +91 -0
  34. package/dist/tools/whoami.d.ts +21 -0
  35. package/dist/tools/whoami.js +20 -1
  36. package/dist/types.d.ts +121 -8
  37. package/dist/version.d.ts +1 -1
  38. package/dist/version.js +1 -1
  39. package/package.json +3 -3
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+ // Output schemas for every tool (0.6.0). The MCP SDK publishes each one as the
3
+ // tool's JSON Schema `outputSchema` in tools/list, and validates the tool's
4
+ // `structuredContent` against it on BOTH sides: McpServer parses it with zod
5
+ // before replying (a mismatch turns the whole call into an error result, the
6
+ // data is lost), and the SDK Client checks it again with Ajv.
7
+ //
8
+ // So these are deliberately permissive. An older @quiki/mcp must keep working
9
+ // against a newer Quiki server, and this package must keep working against an
10
+ // older one:
11
+ // - every object is z.looseObject, at every level. A plain z.object becomes
12
+ // `additionalProperties: false` in zod v4's JSON Schema output, so one new
13
+ // server field would fail validation everywhere.
14
+ // - server enums (platform, mode, status, tier...) are z.string(), so a new
15
+ // value is not a validation failure.
16
+ // - numbers are z.number(), never .int(), for the same reason.
17
+ // - fields older servers do not send are optional; values the database can
18
+ // hold as null are nullable.
19
+ // The handlers return the API body as-is (apart from filling a missing
20
+ // `nextCursor` with null), so these schemas describe the API, they do not
21
+ // reshape it.
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.ListBulkImportsOutput = exports.BulkImportStatusOutput = exports.BulkImportEstimateOutput = exports.BulkImportSubmitOutput = exports.AddToFolderOutput = exports.CreateFolderOutput = exports.FolderVideosOutput = exports.ListFoldersOutput = exports.SearchVideosOutput = exports.VideoOutput = exports.RecentVideosOutput = exports.ScanOutput = exports.WhoamiOutput = void 0;
24
+ const zod_1 = require("zod");
25
+ // ---------------------------------------------------------------------------
26
+ // Building blocks
27
+ // ---------------------------------------------------------------------------
28
+ /** Free-form JSON object (AI analysis). Published as an open `object`. */
29
+ const OpenRecord = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
30
+ /** A paging cursor. The tool returns null on the last page and for servers that predate paging. */
31
+ const NextCursor = zod_1.z
32
+ .string()
33
+ .nullable()
34
+ .describe('Pass back as `cursor` to get the next page. null when there are no more results.');
35
+ const ErrorDetail = zod_1.z.looseObject({
36
+ code: zod_1.z.string(),
37
+ detail: zod_1.z.string().optional(),
38
+ });
39
+ /** Video metadata. Photo posts have no duration_s or thumbnail_url. */
40
+ const Metadata = zod_1.z.looseObject({
41
+ title: zod_1.z.string().nullable(),
42
+ author: zod_1.z.string().nullable(),
43
+ posted_at: zod_1.z.string().nullable(),
44
+ duration_s: zod_1.z.number().nullable().optional(),
45
+ thumbnail_url: zod_1.z.string().nullable().optional(),
46
+ });
47
+ /**
48
+ * One library video in list form (list_recent_videos, search_videos,
49
+ * list_folder_videos). `status` and `error` appear with include_failed.
50
+ */
51
+ const VideoSummary = zod_1.z.looseObject({
52
+ id: zod_1.z.number(),
53
+ url: zod_1.z.string(),
54
+ platform_video_id: zod_1.z.string().nullable(),
55
+ platform: zod_1.z.string(),
56
+ media_type: zod_1.z.string().describe('"video" or "photo" (TikTok photo carousels).'),
57
+ mode: zod_1.z.string(),
58
+ source: zod_1.z.string(),
59
+ metadata: Metadata,
60
+ first_scanned_at: zod_1.z.string(),
61
+ scanned_at: zod_1.z.string(),
62
+ status: zod_1.z.string().optional(),
63
+ error: ErrorDetail.optional(),
64
+ });
65
+ // ---------------------------------------------------------------------------
66
+ // Per-tool output schemas
67
+ // ---------------------------------------------------------------------------
68
+ exports.WhoamiOutput = zod_1.z.looseObject({
69
+ id: zod_1.z.string(),
70
+ // Sign in with Apple can leave an account with no email.
71
+ email: zod_1.z.string().nullable(),
72
+ tier: zod_1.z.string(),
73
+ // Server 1.2.71+.
74
+ credits: zod_1.z.looseObject({ balance: zod_1.z.number() }).optional(),
75
+ dailyScans: zod_1.z
76
+ .looseObject({
77
+ limit: zod_1.z.number(),
78
+ used: zod_1.z.number(),
79
+ remaining: zod_1.z.number(),
80
+ resetsAt: zod_1.z.string(),
81
+ })
82
+ .nullable()
83
+ .optional(),
84
+ });
85
+ exports.ScanOutput = zod_1.z.looseObject({
86
+ id: zod_1.z.string(),
87
+ status: zod_1.z.string(),
88
+ platform: zod_1.z.string(),
89
+ mode: zod_1.z.string(),
90
+ created_at: zod_1.z.string(),
91
+ completed_at: zod_1.z.string().nullable().optional(),
92
+ retry: zod_1.z
93
+ .looseObject({ attempt: zod_1.z.number(), next_attempt_at: zod_1.z.string() })
94
+ .nullable()
95
+ .optional(),
96
+ video_id: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).nullable().optional(),
97
+ result: zod_1.z
98
+ .looseObject({
99
+ platform: zod_1.z.string(),
100
+ mode: zod_1.z.string(),
101
+ metadata: Metadata,
102
+ transcript: zod_1.z.string().nullable().optional(),
103
+ ai_analysis: OpenRecord.nullable().optional(),
104
+ scanned_at: zod_1.z.string(),
105
+ })
106
+ .nullable()
107
+ .optional(),
108
+ error: ErrorDetail.nullable().optional(),
109
+ });
110
+ exports.RecentVideosOutput = zod_1.z.looseObject({
111
+ videos: zod_1.z.array(VideoSummary),
112
+ nextCursor: NextCursor,
113
+ });
114
+ exports.VideoOutput = VideoSummary.extend({
115
+ summary: zod_1.z.string().nullable().optional().describe('Short AI summary. Server 1.2.72+.'),
116
+ transcript: zod_1.z.string().nullable().optional(),
117
+ images: zod_1.z.array(zod_1.z.string()).optional(),
118
+ ai_analysis: OpenRecord.nullable().optional(),
119
+ });
120
+ exports.SearchVideosOutput = zod_1.z.looseObject({
121
+ videos: zod_1.z.array(VideoSummary.extend({
122
+ matched_in: zod_1.z
123
+ .array(zod_1.z.string())
124
+ .optional()
125
+ .describe('Which fields matched the query, e.g. "title", "transcript".'),
126
+ })),
127
+ total: zod_1.z.number(),
128
+ nextCursor: NextCursor,
129
+ warnings: zod_1.z
130
+ .array(zod_1.z.union([
131
+ zod_1.z.string(),
132
+ zod_1.z.looseObject({ code: zod_1.z.string().optional(), message: zod_1.z.string().optional() }),
133
+ ]))
134
+ .optional(),
135
+ });
136
+ const Folder = zod_1.z.looseObject({
137
+ id: zod_1.z.string(),
138
+ name: zod_1.z.string(),
139
+ parent_id: zod_1.z.string().nullable().optional(),
140
+ sort_order: zod_1.z.number().optional(),
141
+ video_count: zod_1.z.number().optional(),
142
+ created_at: zod_1.z.string().optional(),
143
+ updated_at: zod_1.z.string().optional(),
144
+ });
145
+ exports.ListFoldersOutput = zod_1.z.looseObject({
146
+ folders: zod_1.z.array(Folder),
147
+ });
148
+ exports.FolderVideosOutput = zod_1.z.looseObject({
149
+ folder: zod_1.z
150
+ .looseObject({ id: zod_1.z.string(), name: zod_1.z.string() })
151
+ .nullable()
152
+ .describe('null for `unfiled` (videos in no folder).'),
153
+ videos: zod_1.z.array(VideoSummary),
154
+ nextCursor: NextCursor,
155
+ });
156
+ exports.CreateFolderOutput = zod_1.z.looseObject({
157
+ folder: Folder,
158
+ created: zod_1.z.boolean().describe('false when a folder with that name already existed and was returned instead.'),
159
+ });
160
+ // The per-video groups. Server 1.2.72 sends arrays of video ids; the items are
161
+ // left open so a richer item later (say, naming the other folder) is not a
162
+ // validation failure.
163
+ const IdGroup = zod_1.z.array(zod_1.z.unknown()).optional().describe('Video ids.');
164
+ exports.AddToFolderOutput = zod_1.z.looseObject({
165
+ folder: zod_1.z.looseObject({ id: zod_1.z.string(), name: zod_1.z.string().optional() }).nullable().optional(),
166
+ added: IdGroup,
167
+ moved_from_other_folder: IdGroup,
168
+ already_in_folder: IdGroup,
169
+ in_other_folder: IdGroup,
170
+ not_found: IdGroup,
171
+ });
172
+ const BulkTotals = zod_1.z.looseObject({
173
+ totalEntries: zod_1.z.number(),
174
+ duplicateCount: zod_1.z.number(),
175
+ // Server 1.0.74+.
176
+ rejectedCount: zod_1.z.number().optional(),
177
+ newEntryCount: zod_1.z.number(),
178
+ });
179
+ exports.BulkImportSubmitOutput = zod_1.z.looseObject({
180
+ bulkImportId: zod_1.z.string(),
181
+ platform: zod_1.z.string(),
182
+ totals: BulkTotals,
183
+ scannableCount: zod_1.z.number(),
184
+ costPerVideo: zod_1.z.number(),
185
+ effectiveCostPerVideo: zod_1.z.number(),
186
+ estimatedCost: zod_1.z.number(),
187
+ currentBalance: zod_1.z.number(),
188
+ queuedTodayCount: zod_1.z.number().optional(),
189
+ waitingForDailyAllowance: zod_1.z.number().optional(),
190
+ createdAt: zod_1.z.string(),
191
+ });
192
+ exports.BulkImportEstimateOutput = zod_1.z.looseObject({
193
+ platform: zod_1.z.string(),
194
+ totals: BulkTotals,
195
+ scannableCount: zod_1.z.number(),
196
+ costPerVideo: zod_1.z.number(),
197
+ effectiveCostPerVideo: zod_1.z.number(),
198
+ estimatedCost: zod_1.z.number(),
199
+ currentBalance: zod_1.z.number(),
200
+ shortfall: zod_1.z.number(),
201
+ fits: zod_1.z.boolean(),
202
+ userTier: zod_1.z.string(),
203
+ });
204
+ const BulkImportRow = zod_1.z.looseObject({
205
+ id: zod_1.z.string(),
206
+ fileName: zod_1.z.string().nullable(),
207
+ status: zod_1.z.string(),
208
+ totalVideos: zod_1.z.number(),
209
+ processedVideos: zod_1.z.number(),
210
+ failedVideos: zod_1.z.number(),
211
+ // Server 1.2.67+.
212
+ skippedVideos: zod_1.z.number().optional(),
213
+ skippedAsDuplicate: zod_1.z.number(),
214
+ createdAt: zod_1.z.string(),
215
+ updatedAt: zod_1.z.string(),
216
+ completedAt: zod_1.z.string().nullable(),
217
+ });
218
+ exports.BulkImportStatusOutput = BulkImportRow.extend({
219
+ jobStats: zod_1.z.looseObject({
220
+ pending: zod_1.z.number(),
221
+ processing: zod_1.z.number(),
222
+ completed: zod_1.z.number(),
223
+ failed: zod_1.z.number(),
224
+ skipped: zod_1.z.number().optional(),
225
+ // Server 1.2.42+.
226
+ retrying: zod_1.z.number().optional(),
227
+ }),
228
+ });
229
+ exports.ListBulkImportsOutput = zod_1.z.looseObject({
230
+ bulkImports: zod_1.z.array(BulkImportRow),
231
+ nextCursor: NextCursor,
232
+ });
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ import type { ApiClient } from '../apiClient';
3
+ import type { AddToFolderResponse } from '../types';
4
+ export declare const addToFolderInputShape: {
5
+ folder_id: z.ZodString;
6
+ video_ids: z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
7
+ move: z.ZodOptional<z.ZodBoolean>;
8
+ };
9
+ declare const InputSchema: z.ZodObject<{
10
+ folder_id: z.ZodString;
11
+ video_ids: z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
12
+ move: z.ZodOptional<z.ZodBoolean>;
13
+ }, z.core.$strip>;
14
+ type Input = z.infer<typeof InputSchema>;
15
+ export declare const addToFolderTool: {
16
+ name: string;
17
+ annotations: {
18
+ title: string;
19
+ readOnlyHint: false;
20
+ destructiveHint: true;
21
+ idempotentHint: true;
22
+ openWorldHint: false;
23
+ };
24
+ outputSchema: z.ZodObject<{
25
+ folder: z.ZodOptional<z.ZodNullable<z.ZodObject<{
26
+ id: z.ZodString;
27
+ name: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$loose>>>;
29
+ added: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
30
+ moved_from_other_folder: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
31
+ already_in_folder: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
32
+ in_other_folder: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
33
+ not_found: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
34
+ }, z.core.$loose>;
35
+ description: string;
36
+ inputShape: z.ZodObject<{
37
+ folder_id: z.ZodString;
38
+ video_ids: z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
39
+ move: z.ZodOptional<z.ZodBoolean>;
40
+ }, z.core.$strip>;
41
+ handler(client: ApiClient, args: Input): Promise<AddToFolderResponse>;
42
+ };
43
+ export {};
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ // add_to_folder — wraps POST /api/v1/folders/:id/videos (server 1.2.72+).
3
+ // Write scope, PRO tier. A video lives in at most one folder: by default a
4
+ // video already in another folder is reported and left alone; `move: true`
5
+ // moves it. Marked destructive because a move takes the video out of the
6
+ // folder it was in.
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.addToFolderTool = exports.addToFolderInputShape = void 0;
9
+ const zod_1 = require("zod");
10
+ const outputSchemas_1 = require("../outputSchemas");
11
+ // Video ids are Postgres int4; the API rejects anything larger.
12
+ const MAX_VIDEO_ID = 2147483647;
13
+ exports.addToFolderInputShape = {
14
+ folder_id: zod_1.z
15
+ .string()
16
+ .min(1)
17
+ .describe('The folder to file the videos in: an id from `list_folders` or `create_folder`.'),
18
+ video_ids: zod_1.z
19
+ .array(zod_1.z.union([
20
+ zod_1.z.number().int().positive().max(MAX_VIDEO_ID),
21
+ zod_1.z
22
+ .string()
23
+ .regex(/^\d+$/)
24
+ .refine((v) => Number(v) <= MAX_VIDEO_ID),
25
+ ]))
26
+ .min(1)
27
+ .max(100)
28
+ .describe('Video ids (integers, as returned by the list and search tools). 1 to 100 per call.'),
29
+ move: zod_1.z
30
+ .boolean()
31
+ .optional()
32
+ .describe('When true, videos already in a different folder are moved here. Default false: they are left where they are and listed in `in_other_folder`.'),
33
+ };
34
+ const InputSchema = zod_1.z.object(exports.addToFolderInputShape);
35
+ exports.addToFolderTool = {
36
+ name: 'add_to_folder',
37
+ // Writes to the library and, with move: true, takes a video out of its
38
+ // current folder, so destructive. Repeating the call changes nothing more.
39
+ annotations: {
40
+ title: 'Add videos to a folder',
41
+ readOnlyHint: false,
42
+ destructiveHint: true,
43
+ idempotentHint: true,
44
+ openWorldHint: false,
45
+ },
46
+ outputSchema: outputSchemas_1.AddToFolderOutput,
47
+ description: [
48
+ 'Files videos from the library into a folder. A video can be in only ONE folder at a time, so adding it here takes it out of any other folder.',
49
+ '',
50
+ 'By default nothing is moved: a video that is already in a different folder is left there and reported in `in_other_folder`. Pass `move: true` to move those videos here too. Check with the user before moving videos they have already filed.',
51
+ '',
52
+ 'The response sorts every requested id into groups: `added` (was in no folder), `moved_from_other_folder` (moved, only with `move: true`), `already_in_folder` (nothing to do), `in_other_folder` (left alone because `move` was false), `not_found` (no such video in this library). The call succeeds even when some ids land in `not_found` or `in_other_folder`; read the groups.',
53
+ '',
54
+ 'Side effect: filing or moving a video counts as a change to it, so its `scanned_at` becomes the time of the move and it jumps to the top of `list_recent_videos`. Its publish date, and so its place in `search_videos` and `list_folder_videos`, does not change.',
55
+ '',
56
+ 'Write scope, PRO plan. A folder id that does not exist or belongs to someone else returns 404 FOLDER_NOT_FOUND. Use `create_folder` to make a folder first.',
57
+ ].join('\n'),
58
+ inputShape: InputSchema,
59
+ async handler(client, args) {
60
+ const parsed = InputSchema.parse(args);
61
+ // The API takes integers; the schema also accepts digit strings.
62
+ const body = {
63
+ video_ids: parsed.video_ids.map((id) => Number(id)),
64
+ };
65
+ if (parsed.move)
66
+ body.move = true;
67
+ return client.post(`/folders/${encodeURIComponent(parsed.folder_id)}/videos`, body);
68
+ },
69
+ };
@@ -20,6 +20,31 @@ declare const InputSchema: z.ZodObject<{
20
20
  type Input = z.infer<typeof InputSchema>;
21
21
  export declare const bulkImportTool: {
22
22
  name: string;
23
+ annotations: {
24
+ title: string;
25
+ readOnlyHint: false;
26
+ destructiveHint: false;
27
+ idempotentHint: false;
28
+ openWorldHint: true;
29
+ };
30
+ outputSchema: z.ZodObject<{
31
+ bulkImportId: z.ZodString;
32
+ platform: z.ZodString;
33
+ totals: z.ZodObject<{
34
+ totalEntries: z.ZodNumber;
35
+ duplicateCount: z.ZodNumber;
36
+ rejectedCount: z.ZodOptional<z.ZodNumber>;
37
+ newEntryCount: z.ZodNumber;
38
+ }, z.core.$loose>;
39
+ scannableCount: z.ZodNumber;
40
+ costPerVideo: z.ZodNumber;
41
+ effectiveCostPerVideo: z.ZodNumber;
42
+ estimatedCost: z.ZodNumber;
43
+ currentBalance: z.ZodNumber;
44
+ queuedTodayCount: z.ZodOptional<z.ZodNumber>;
45
+ waitingForDailyAllowance: z.ZodOptional<z.ZodNumber>;
46
+ createdAt: z.ZodString;
47
+ }, z.core.$loose>;
23
48
  description: string;
24
49
  inputShape: z.ZodObject<{
25
50
  urls: z.ZodArray<z.ZodString>;
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.bulkImportTool = exports.bulkImportInputShape = void 0;
6
6
  const zod_1 = require("zod");
7
+ const outputSchemas_1 = require("../outputSchemas");
7
8
  exports.bulkImportInputShape = {
8
9
  urls: zod_1.z
9
10
  .array(zod_1.z.string())
@@ -18,6 +19,16 @@ exports.bulkImportInputShape = {
18
19
  const InputSchema = zod_1.z.object(exports.bulkImportInputShape);
19
20
  exports.bulkImportTool = {
20
21
  name: 'bulk_import',
22
+ // Spends credits and fetches the video from its platform, so it is
23
+ // neither read-only nor idempotent. Nothing here deletes data.
24
+ annotations: {
25
+ title: 'Bulk import video URLs',
26
+ readOnlyHint: false,
27
+ destructiveHint: false,
28
+ idempotentHint: false,
29
+ openWorldHint: true,
30
+ },
31
+ outputSchema: outputSchemas_1.BulkImportSubmitOutput,
21
32
  description: [
22
33
  'Submits a list of video URLs for bulk scanning. Returns a `bulkImportId` you can pass to `get_bulk_import_status` to poll progress.',
23
34
  '',
@@ -20,6 +20,30 @@ declare const InputSchema: z.ZodObject<{
20
20
  type Input = z.infer<typeof InputSchema>;
21
21
  export declare const bulkImportEstimateTool: {
22
22
  name: string;
23
+ annotations: {
24
+ title: string;
25
+ readOnlyHint: true;
26
+ destructiveHint: false;
27
+ idempotentHint: true;
28
+ openWorldHint: false;
29
+ };
30
+ outputSchema: z.ZodObject<{
31
+ platform: z.ZodString;
32
+ totals: z.ZodObject<{
33
+ totalEntries: z.ZodNumber;
34
+ duplicateCount: z.ZodNumber;
35
+ rejectedCount: z.ZodOptional<z.ZodNumber>;
36
+ newEntryCount: z.ZodNumber;
37
+ }, z.core.$loose>;
38
+ scannableCount: z.ZodNumber;
39
+ costPerVideo: z.ZodNumber;
40
+ effectiveCostPerVideo: z.ZodNumber;
41
+ estimatedCost: z.ZodNumber;
42
+ currentBalance: z.ZodNumber;
43
+ shortfall: z.ZodNumber;
44
+ fits: z.ZodBoolean;
45
+ userTier: z.ZodString;
46
+ }, z.core.$loose>;
23
47
  description: string;
24
48
  inputShape: z.ZodObject<{
25
49
  urls: z.ZodArray<z.ZodString>;
@@ -5,6 +5,7 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.bulkImportEstimateTool = exports.bulkImportEstimateInputShape = void 0;
7
7
  const zod_1 = require("zod");
8
+ const outputSchemas_1 = require("../outputSchemas");
8
9
  exports.bulkImportEstimateInputShape = {
9
10
  urls: zod_1.z
10
11
  .array(zod_1.z.string())
@@ -19,6 +20,15 @@ exports.bulkImportEstimateInputShape = {
19
20
  const InputSchema = zod_1.z.object(exports.bulkImportEstimateInputShape);
20
21
  exports.bulkImportEstimateTool = {
21
22
  name: 'bulk_import_estimate',
23
+ // Reads only; safe for a client to auto-approve.
24
+ annotations: {
25
+ title: 'Estimate a bulk import',
26
+ readOnlyHint: true,
27
+ destructiveHint: false,
28
+ idempotentHint: true,
29
+ openWorldHint: false,
30
+ },
31
+ outputSchema: outputSchemas_1.BulkImportEstimateOutput,
22
32
  description: [
23
33
  'Returns the dedup + credit math for a URL list without starting an import. Use this to plan a bulk submission before committing -- `fits: true` means `bulk_import` would succeed; `fits: false` returns `shortfall: N` so you can trim the list.',
24
34
  '',
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ import type { ApiClient } from '../apiClient';
3
+ import type { CreateFolderResponse } from '../types';
4
+ export declare const createFolderInputShape: {
5
+ name: z.ZodString;
6
+ parent_id: z.ZodOptional<z.ZodString>;
7
+ };
8
+ declare const InputSchema: z.ZodObject<{
9
+ name: z.ZodString;
10
+ parent_id: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ type Input = z.infer<typeof InputSchema>;
13
+ export declare const createFolderTool: {
14
+ name: string;
15
+ annotations: {
16
+ title: string;
17
+ readOnlyHint: false;
18
+ destructiveHint: false;
19
+ idempotentHint: true;
20
+ openWorldHint: false;
21
+ };
22
+ outputSchema: z.ZodObject<{
23
+ folder: z.ZodObject<{
24
+ id: z.ZodString;
25
+ name: z.ZodString;
26
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ sort_order: z.ZodOptional<z.ZodNumber>;
28
+ video_count: z.ZodOptional<z.ZodNumber>;
29
+ created_at: z.ZodOptional<z.ZodString>;
30
+ updated_at: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$loose>;
32
+ created: z.ZodBoolean;
33
+ }, z.core.$loose>;
34
+ description: string;
35
+ inputShape: z.ZodObject<{
36
+ name: z.ZodString;
37
+ parent_id: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strip>;
39
+ handler(client: ApiClient, args: Input): Promise<CreateFolderResponse>;
40
+ };
41
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // create_folder — wraps POST /api/v1/folders (server 1.2.72+). Write scope,
3
+ // PRO tier. Find-or-create: an existing folder with the same name (any case)
4
+ // under the same parent is returned instead of a duplicate.
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createFolderTool = exports.createFolderInputShape = void 0;
7
+ const zod_1 = require("zod");
8
+ const outputSchemas_1 = require("../outputSchemas");
9
+ exports.createFolderInputShape = {
10
+ name: zod_1.z
11
+ .string()
12
+ .trim()
13
+ .min(1)
14
+ .max(255)
15
+ .describe('Folder name, 1 to 255 characters.'),
16
+ parent_id: zod_1.z
17
+ .string()
18
+ .min(1)
19
+ .optional()
20
+ .describe('Make it a sub-folder of this folder (an id from `list_folders`). Omit for a top-level folder.'),
21
+ };
22
+ const InputSchema = zod_1.z.object(exports.createFolderInputShape);
23
+ exports.createFolderTool = {
24
+ name: 'create_folder',
25
+ // Writes, but never deletes, and calling it again with the same name
26
+ // returns the same folder.
27
+ annotations: {
28
+ title: 'Create a folder',
29
+ readOnlyHint: false,
30
+ destructiveHint: false,
31
+ idempotentHint: true,
32
+ openWorldHint: false,
33
+ },
34
+ outputSchema: outputSchemas_1.CreateFolderOutput,
35
+ description: [
36
+ "Creates a folder in the authenticated user's library, or returns the existing one: if a folder with the same name (ignoring case) already exists under the same parent, that folder is returned with `created: false` and nothing new is made. A new folder returns `created: true`. Either way `folder.id` is ready for `add_to_folder`.",
37
+ '',
38
+ "Pass `parent_id` (one of the user's folders, from `list_folders`) to nest it under that folder; omit it for a top-level folder. A `parent_id` that is not one of the user's folders returns 404 FOLDER_NOT_FOUND.",
39
+ '',
40
+ 'Write scope, PRO plan.',
41
+ ].join('\n'),
42
+ inputShape: InputSchema,
43
+ async handler(client, args) {
44
+ const parsed = InputSchema.parse(args);
45
+ const body = { name: parsed.name };
46
+ if (parsed.parent_id !== undefined)
47
+ body.parent_id = parsed.parent_id;
48
+ return client.post('/folders', body);
49
+ },
50
+ };
@@ -10,6 +10,34 @@ declare const InputSchema: z.ZodObject<{
10
10
  type Input = z.infer<typeof InputSchema>;
11
11
  export declare const getBulkImportStatusTool: {
12
12
  name: string;
13
+ annotations: {
14
+ title: string;
15
+ readOnlyHint: true;
16
+ destructiveHint: false;
17
+ idempotentHint: true;
18
+ openWorldHint: false;
19
+ };
20
+ outputSchema: z.ZodObject<{
21
+ id: z.ZodString;
22
+ fileName: z.ZodNullable<z.ZodString>;
23
+ status: z.ZodString;
24
+ totalVideos: z.ZodNumber;
25
+ processedVideos: z.ZodNumber;
26
+ failedVideos: z.ZodNumber;
27
+ skippedVideos: z.ZodOptional<z.ZodNumber>;
28
+ skippedAsDuplicate: z.ZodNumber;
29
+ createdAt: z.ZodString;
30
+ updatedAt: z.ZodString;
31
+ completedAt: z.ZodNullable<z.ZodString>;
32
+ jobStats: z.ZodObject<{
33
+ pending: z.ZodNumber;
34
+ processing: z.ZodNumber;
35
+ completed: z.ZodNumber;
36
+ failed: z.ZodNumber;
37
+ skipped: z.ZodOptional<z.ZodNumber>;
38
+ retrying: z.ZodOptional<z.ZodNumber>;
39
+ }, z.core.$loose>;
40
+ }, z.core.$loose>;
13
41
  description: string;
14
42
  inputShape: z.ZodObject<{
15
43
  id: z.ZodString;
@@ -4,12 +4,22 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.getBulkImportStatusTool = exports.getBulkImportStatusInputShape = void 0;
6
6
  const zod_1 = require("zod");
7
+ const outputSchemas_1 = require("../outputSchemas");
7
8
  exports.getBulkImportStatusInputShape = {
8
9
  id: zod_1.z.string().min(1).describe('The bulkImportId returned by `bulk_import`.'),
9
10
  };
10
11
  const InputSchema = zod_1.z.object(exports.getBulkImportStatusInputShape);
11
12
  exports.getBulkImportStatusTool = {
12
13
  name: 'get_bulk_import_status',
14
+ // Reads only; safe for a client to auto-approve.
15
+ annotations: {
16
+ title: 'Get bulk import status',
17
+ readOnlyHint: true,
18
+ destructiveHint: false,
19
+ idempotentHint: true,
20
+ openWorldHint: false,
21
+ },
22
+ outputSchema: outputSchemas_1.BulkImportStatusOutput,
13
23
  description: [
14
24
  'Returns the current state of a bulk import. Poll this after `bulk_import` until `status` is one of `COMPLETED`, `FAILED`, or `CANCELLED`.',
15
25
  '',
@@ -10,6 +10,44 @@ declare const InputSchema: z.ZodObject<{
10
10
  type Input = z.infer<typeof InputSchema>;
11
11
  export declare const getScanTool: {
12
12
  name: string;
13
+ annotations: {
14
+ title: string;
15
+ readOnlyHint: true;
16
+ destructiveHint: false;
17
+ idempotentHint: true;
18
+ openWorldHint: false;
19
+ };
20
+ outputSchema: z.ZodObject<{
21
+ id: z.ZodString;
22
+ status: z.ZodString;
23
+ platform: z.ZodString;
24
+ mode: z.ZodString;
25
+ created_at: z.ZodString;
26
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ retry: z.ZodOptional<z.ZodNullable<z.ZodObject<{
28
+ attempt: z.ZodNumber;
29
+ next_attempt_at: z.ZodString;
30
+ }, z.core.$loose>>>;
31
+ video_id: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
32
+ result: z.ZodOptional<z.ZodNullable<z.ZodObject<{
33
+ platform: z.ZodString;
34
+ mode: z.ZodString;
35
+ metadata: z.ZodObject<{
36
+ title: z.ZodNullable<z.ZodString>;
37
+ author: z.ZodNullable<z.ZodString>;
38
+ posted_at: z.ZodNullable<z.ZodString>;
39
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
40
+ thumbnail_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
+ }, z.core.$loose>;
42
+ transcript: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
+ ai_analysis: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
44
+ scanned_at: z.ZodString;
45
+ }, z.core.$loose>>>;
46
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
47
+ code: z.ZodString;
48
+ detail: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$loose>>>;
50
+ }, z.core.$loose>;
13
51
  description: string;
14
52
  inputShape: z.ZodObject<{
15
53
  id: z.ZodString;
@@ -4,12 +4,22 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.getScanTool = exports.getScanInputShape = void 0;
6
6
  const zod_1 = require("zod");
7
+ const outputSchemas_1 = require("../outputSchemas");
7
8
  exports.getScanInputShape = {
8
9
  id: zod_1.z.string().describe('The scan ID returned by scan_url.'),
9
10
  };
10
11
  const InputSchema = zod_1.z.object(exports.getScanInputShape);
11
12
  exports.getScanTool = {
12
13
  name: 'get_scan',
14
+ // Reads only; safe for a client to auto-approve.
15
+ annotations: {
16
+ title: 'Get scan status and result',
17
+ readOnlyHint: true,
18
+ destructiveHint: false,
19
+ idempotentHint: true,
20
+ openWorldHint: false,
21
+ },
22
+ outputSchema: outputSchemas_1.ScanOutput,
13
23
  description: 'Retrieves the current status and result of a previously submitted scan. Poll this after `scan_url` returns a scan ID. The scan is done when `status` is `"completed"` or `"failed"`.',
14
24
  inputShape: InputSchema,
15
25
  async handler(client, args) {