@quiki/mcp 0.5.0 → 0.6.1

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 +47 -7
  2. package/dist/index.d.ts +12 -4
  3. package/dist/index.js +29 -8
  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 +18 -0
  11. package/dist/tools/bulkImport.js +2 -0
  12. package/dist/tools/bulkImportEstimate.d.ts +17 -0
  13. package/dist/tools/bulkImportEstimate.js +2 -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 +21 -0
  17. package/dist/tools/getBulkImportStatus.js +3 -1
  18. package/dist/tools/getScan.d.ts +31 -0
  19. package/dist/tools/getScan.js +2 -0
  20. package/dist/tools/getVideo.d.ts +46 -0
  21. package/dist/tools/getVideo.js +27 -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 +29 -0
  29. package/dist/tools/listRecentVideos.js +22 -4
  30. package/dist/tools/scanUrl.d.ts +31 -0
  31. package/dist/tools/scanUrl.js +2 -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 +14 -0
  35. package/dist/tools/whoami.js +2 -0
  36. package/dist/types.d.ts +108 -7
  37. package/dist/version.d.ts +1 -1
  38. package/dist/version.js +1 -1
  39. package/package.json +3 -3
@@ -1,11 +1,24 @@
1
1
  import { z } from 'zod';
2
2
  import type { ApiClient } from '../apiClient';
3
3
  import type { VideoResponse } from '../types';
4
+ export declare const VIDEO_FIELDS: readonly ["summary", "transcript", "ai_analysis", "images"];
4
5
  export declare const getVideoInputShape: {
5
6
  id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
7
+ fields: z.ZodOptional<z.ZodArray<z.ZodEnum<{
8
+ transcript: "transcript";
9
+ ai_analysis: "ai_analysis";
10
+ summary: "summary";
11
+ images: "images";
12
+ }>>>;
6
13
  };
7
14
  declare const InputSchema: z.ZodObject<{
8
15
  id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
16
+ fields: z.ZodOptional<z.ZodArray<z.ZodEnum<{
17
+ transcript: "transcript";
18
+ ai_analysis: "ai_analysis";
19
+ summary: "summary";
20
+ images: "images";
21
+ }>>>;
9
22
  }, z.core.$strip>;
10
23
  type Input = z.infer<typeof InputSchema>;
11
24
  export declare const getVideoTool: {
@@ -17,9 +30,42 @@ export declare const getVideoTool: {
17
30
  idempotentHint: true;
18
31
  openWorldHint: false;
19
32
  };
33
+ outputSchema: z.ZodObject<{
34
+ id: z.ZodNumber;
35
+ url: z.ZodString;
36
+ platform_video_id: z.ZodNullable<z.ZodString>;
37
+ platform: z.ZodString;
38
+ media_type: z.ZodString;
39
+ mode: z.ZodString;
40
+ source: z.ZodString;
41
+ metadata: z.ZodObject<{
42
+ title: z.ZodNullable<z.ZodString>;
43
+ author: z.ZodNullable<z.ZodString>;
44
+ posted_at: z.ZodNullable<z.ZodString>;
45
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
46
+ thumbnail_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
+ }, z.core.$loose>;
48
+ first_scanned_at: z.ZodString;
49
+ scanned_at: z.ZodString;
50
+ status: z.ZodOptional<z.ZodString>;
51
+ error: z.ZodOptional<z.ZodObject<{
52
+ code: z.ZodString;
53
+ detail: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$loose>>;
55
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ transcript: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ images: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
+ ai_analysis: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
59
+ }, z.core.$loose>;
20
60
  description: string;
21
61
  inputShape: z.ZodObject<{
22
62
  id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
63
+ fields: z.ZodOptional<z.ZodArray<z.ZodEnum<{
64
+ transcript: "transcript";
65
+ ai_analysis: "ai_analysis";
66
+ summary: "summary";
67
+ images: "images";
68
+ }>>>;
23
69
  }, z.core.$strip>;
24
70
  handler(client: ApiClient, args: Input): Promise<VideoResponse>;
25
71
  };
@@ -1,12 +1,23 @@
1
1
  "use strict";
2
- // get_video — wraps GET /api/v1/videos/:id. Description copied verbatim from spec §7.
2
+ // get_video — wraps GET /api/v1/videos/:id[?fields=...].
3
+ // 0.6.0: optional `fields` (joined with ',' into one query param; axios would
4
+ // otherwise send an array as fields[]=...), and the description mentions the
5
+ // `summary` field added in server 1.2.72.
3
6
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getVideoTool = exports.getVideoInputShape = void 0;
7
+ exports.getVideoTool = exports.getVideoInputShape = exports.VIDEO_FIELDS = void 0;
5
8
  const zod_1 = require("zod");
9
+ const outputSchemas_1 = require("../outputSchemas");
10
+ exports.VIDEO_FIELDS = ['summary', 'transcript', 'ai_analysis', 'images'];
6
11
  exports.getVideoInputShape = {
7
12
  id: zod_1.z
8
13
  .union([zod_1.z.number().int().positive(), zod_1.z.string().regex(/^\d+$/)])
9
- .describe('The video ID (integer). Returned by `list_recent_videos` or as `video_id` on a completed `scan_url` response.'),
14
+ .describe('The video ID (integer). Returned by `list_recent_videos`, `search_videos` and `list_folder_videos`, or as `video_id` on a completed `scan_url` response.'),
15
+ fields: zod_1.z
16
+ .array(zod_1.z.enum(exports.VIDEO_FIELDS))
17
+ .min(1)
18
+ .max(exports.VIDEO_FIELDS.length * 2)
19
+ .optional()
20
+ .describe('Optional sections to include: any of "summary", "transcript", "ai_analysis", "images". The core fields and `metadata` are always returned. Omit to get every section that applies. Ask for only what you need: a transcript or full AI analysis can be long.'),
10
21
  };
11
22
  const InputSchema = zod_1.z.object(exports.getVideoInputShape);
12
23
  exports.getVideoTool = {
@@ -19,14 +30,24 @@ exports.getVideoTool = {
19
30
  idempotentHint: true,
20
31
  openWorldHint: false,
21
32
  },
22
- description: "Fetches the full record for one previously-scanned video: metadata, transcript (for videos), AI analysis (for deep scans), and image URLs (for TikTok photo carousels). The `id` comes from `list_recent_videos` or from the `video_id` field on a completed `scan_url` response. Check `media_type` to branch — for `'photo'`, `transcript` is absent and `images` is present.",
33
+ outputSchema: outputSchemas_1.VideoOutput,
34
+ description: [
35
+ 'Fetches the full record for one previously scanned video: metadata, `summary` (a short AI summary, null when there is none), transcript (for videos), AI analysis (for deep scans), and image URLs (for TikTok photo carousels).',
36
+ '',
37
+ "The `id` comes from `list_recent_videos`, `search_videos`, `list_folder_videos`, or the `video_id` field on a completed `scan_url` response. Check `media_type` to branch: for `'photo'`, `transcript` is absent and `images` is present.",
38
+ '',
39
+ 'Pass `fields` to get only some sections, e.g. `["summary"]` to skim several videos cheaply; sections you do not ask for are left out of the response. Older Quiki servers ignore `fields` and do not return `summary`.',
40
+ ].join('\n'),
23
41
  inputShape: InputSchema,
24
42
  async handler(client, args) {
25
43
  const parsed = InputSchema.parse(args);
26
44
  // Normalise to string for URL construction — encodeURIComponent on a
27
45
  // numeric string is a no-op, but String() handles both number and string
28
46
  // inputs from the union schema.
29
- const idStr = String(parsed.id);
30
- return client.get(`/videos/${encodeURIComponent(idStr)}`);
47
+ const path = `/videos/${encodeURIComponent(String(parsed.id))}`;
48
+ if (!parsed.fields)
49
+ return client.get(path);
50
+ const fields = [...new Set(parsed.fields)].join(',');
51
+ return client.get(path, { fields });
31
52
  },
32
53
  };
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ import type { ApiClient } from '../apiClient';
3
+ import type { ListBulkImportsResponse } from '../types';
4
+ export declare const listBulkImportsInputShape: {
5
+ limit: z.ZodOptional<z.ZodNumber>;
6
+ cursor: z.ZodOptional<z.ZodString>;
7
+ };
8
+ declare const InputSchema: z.ZodObject<{
9
+ limit: z.ZodOptional<z.ZodNumber>;
10
+ cursor: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ type Input = z.infer<typeof InputSchema>;
13
+ export declare const listBulkImportsTool: {
14
+ name: string;
15
+ annotations: {
16
+ title: string;
17
+ readOnlyHint: true;
18
+ destructiveHint: false;
19
+ idempotentHint: true;
20
+ openWorldHint: false;
21
+ };
22
+ outputSchema: z.ZodObject<{
23
+ bulkImports: z.ZodArray<z.ZodObject<{
24
+ id: z.ZodString;
25
+ fileName: z.ZodNullable<z.ZodString>;
26
+ status: z.ZodString;
27
+ totalVideos: z.ZodNumber;
28
+ processedVideos: z.ZodNumber;
29
+ failedVideos: z.ZodNumber;
30
+ skippedVideos: z.ZodOptional<z.ZodNumber>;
31
+ skippedAsDuplicate: z.ZodNumber;
32
+ createdAt: z.ZodString;
33
+ updatedAt: z.ZodString;
34
+ completedAt: z.ZodNullable<z.ZodString>;
35
+ }, z.core.$loose>>;
36
+ nextCursor: z.ZodNullable<z.ZodString>;
37
+ }, z.core.$loose>;
38
+ description: string;
39
+ inputShape: z.ZodObject<{
40
+ limit: z.ZodOptional<z.ZodNumber>;
41
+ cursor: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ handler(client: ApiClient, args: Input): Promise<ListBulkImportsResponse>;
44
+ };
45
+ export {};
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ // list_bulk_imports — wraps GET /api/v1/bulk-imports (server 1.2.72+).
3
+ // Read scope. Returns the stored counters on each BulkImport row (no live
4
+ // jobStats), newest first.
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.listBulkImportsTool = exports.listBulkImportsInputShape = void 0;
7
+ const zod_1 = require("zod");
8
+ const outputSchemas_1 = require("../outputSchemas");
9
+ const nextCursor_1 = require("../nextCursor");
10
+ exports.listBulkImportsInputShape = {
11
+ limit: zod_1.z
12
+ .number()
13
+ .int()
14
+ .min(1)
15
+ .max(50)
16
+ .optional()
17
+ .describe('Imports per page. Default 20, max 50.'),
18
+ cursor: zod_1.z
19
+ .string()
20
+ .min(1)
21
+ .optional()
22
+ .describe('The `nextCursor` from the previous page. Omit for the first page.'),
23
+ };
24
+ const InputSchema = zod_1.z.object(exports.listBulkImportsInputShape);
25
+ exports.listBulkImportsTool = {
26
+ name: 'list_bulk_imports',
27
+ // Reads only; safe for a client to auto-approve.
28
+ annotations: {
29
+ title: 'List bulk imports',
30
+ readOnlyHint: true,
31
+ destructiveHint: false,
32
+ idempotentHint: true,
33
+ openWorldHint: false,
34
+ },
35
+ outputSchema: outputSchemas_1.ListBulkImportsOutput,
36
+ description: [
37
+ "Lists the authenticated user's bulk imports, newest first: imports started with `bulk_import` and those started in the Quiki apps. Each entry has `id`, `fileName`, `status`, `totalVideos`, `processedVideos`, `failedVideos`, `skippedVideos`, `skippedAsDuplicate`, `createdAt`, `updatedAt` and `completedAt`. Use it to find an import's id when you no longer have the `bulkImportId`.",
38
+ '',
39
+ 'The counts here are the totals stored on the import and can lag behind an import that is still running. For live progress of one import, call `get_bulk_import_status` with its `id`.',
40
+ '',
41
+ 'Paging: when `nextCursor` is not null, call again with `cursor` set to it (same `limit`) for older imports.',
42
+ '',
43
+ 'Read scope.',
44
+ ].join('\n'),
45
+ inputShape: InputSchema,
46
+ async handler(client, args) {
47
+ const parsed = InputSchema.parse(args);
48
+ const params = {};
49
+ if (parsed.limit !== undefined)
50
+ params.limit = parsed.limit;
51
+ if (parsed.cursor !== undefined)
52
+ params.cursor = parsed.cursor;
53
+ return (0, nextCursor_1.withNextCursor)(await client.get('/bulk-imports', params));
54
+ },
55
+ };
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ import type { ApiClient } from '../apiClient';
3
+ import type { FolderVideosResponse } from '../types';
4
+ export declare const listFolderVideosInputShape: {
5
+ folder_id: z.ZodString;
6
+ limit: z.ZodOptional<z.ZodNumber>;
7
+ cursor: z.ZodOptional<z.ZodString>;
8
+ include_failed: z.ZodOptional<z.ZodBoolean>;
9
+ };
10
+ declare const InputSchema: z.ZodObject<{
11
+ folder_id: z.ZodString;
12
+ limit: z.ZodOptional<z.ZodNumber>;
13
+ cursor: z.ZodOptional<z.ZodString>;
14
+ include_failed: z.ZodOptional<z.ZodBoolean>;
15
+ }, z.core.$strip>;
16
+ type Input = z.infer<typeof InputSchema>;
17
+ export declare const listFolderVideosTool: {
18
+ name: string;
19
+ annotations: {
20
+ title: string;
21
+ readOnlyHint: true;
22
+ destructiveHint: false;
23
+ idempotentHint: true;
24
+ openWorldHint: false;
25
+ };
26
+ outputSchema: z.ZodObject<{
27
+ folder: z.ZodNullable<z.ZodObject<{
28
+ id: z.ZodString;
29
+ name: z.ZodString;
30
+ }, z.core.$loose>>;
31
+ videos: z.ZodArray<z.ZodObject<{
32
+ id: z.ZodNumber;
33
+ url: z.ZodString;
34
+ platform_video_id: z.ZodNullable<z.ZodString>;
35
+ platform: z.ZodString;
36
+ media_type: z.ZodString;
37
+ mode: z.ZodString;
38
+ source: z.ZodString;
39
+ metadata: z.ZodObject<{
40
+ title: z.ZodNullable<z.ZodString>;
41
+ author: z.ZodNullable<z.ZodString>;
42
+ posted_at: z.ZodNullable<z.ZodString>;
43
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
44
+ thumbnail_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ }, z.core.$loose>;
46
+ first_scanned_at: z.ZodString;
47
+ scanned_at: z.ZodString;
48
+ status: z.ZodOptional<z.ZodString>;
49
+ error: z.ZodOptional<z.ZodObject<{
50
+ code: z.ZodString;
51
+ detail: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$loose>>;
53
+ }, z.core.$loose>>;
54
+ nextCursor: z.ZodNullable<z.ZodString>;
55
+ }, z.core.$loose>;
56
+ description: string;
57
+ inputShape: z.ZodObject<{
58
+ folder_id: z.ZodString;
59
+ limit: z.ZodOptional<z.ZodNumber>;
60
+ cursor: z.ZodOptional<z.ZodString>;
61
+ include_failed: z.ZodOptional<z.ZodBoolean>;
62
+ }, z.core.$strip>;
63
+ handler(client: ApiClient, args: Input): Promise<FolderVideosResponse>;
64
+ };
65
+ export {};
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ // list_folder_videos — wraps GET /api/v1/folders/:id/videos (server 1.2.72+).
3
+ // Read scope, PRO tier. `folder_id` may be "unfiled".
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.listFolderVideosTool = exports.listFolderVideosInputShape = void 0;
6
+ const zod_1 = require("zod");
7
+ const outputSchemas_1 = require("../outputSchemas");
8
+ const nextCursor_1 = require("../nextCursor");
9
+ exports.listFolderVideosInputShape = {
10
+ folder_id: zod_1.z
11
+ .string()
12
+ .min(1)
13
+ .describe('A folder id from `list_folders`, or "unfiled" for videos in no folder.'),
14
+ limit: zod_1.z
15
+ .number()
16
+ .int()
17
+ .min(1)
18
+ .max(100)
19
+ .optional()
20
+ .describe('Videos per page. Default 20, max 100.'),
21
+ cursor: zod_1.z
22
+ .string()
23
+ .min(1)
24
+ .optional()
25
+ .describe('The `nextCursor` from the previous page. Omit for the first page.'),
26
+ include_failed: zod_1.z
27
+ .boolean()
28
+ .optional()
29
+ .describe('When true, include failed scans with status + error fields. Default false.'),
30
+ };
31
+ const InputSchema = zod_1.z.object(exports.listFolderVideosInputShape);
32
+ exports.listFolderVideosTool = {
33
+ name: 'list_folder_videos',
34
+ // Reads only; safe for a client to auto-approve.
35
+ annotations: {
36
+ title: 'List the videos in a folder',
37
+ readOnlyHint: true,
38
+ destructiveHint: false,
39
+ idempotentHint: true,
40
+ openWorldHint: false,
41
+ },
42
+ outputSchema: outputSchemas_1.FolderVideosOutput,
43
+ description: [
44
+ 'Lists the videos in one folder, newest first by publish date, in the same trimmed shape as `list_recent_videos`. Pass "unfiled" as `folder_id` for the videos that are in no folder. `folder` in the response names the folder (null for "unfiled"). Only the videos directly in the folder are listed, not those in its sub-folders.',
45
+ '',
46
+ 'Paging: when `nextCursor` is not null, call again with `cursor` set to it (same `folder_id`, `limit` and `include_failed`) for the next page. A page can hold fewer than `limit` videos even when more follow, so keep going until `nextCursor` is null.',
47
+ '',
48
+ "The starter videos Quiki adds to a new account are part of the library, so they can appear here. Call `get_video(id)` for a video's full record. A folder id that does not exist or belongs to someone else returns 404 FOLDER_NOT_FOUND.",
49
+ '',
50
+ 'Read scope, PRO plan.',
51
+ ].join('\n'),
52
+ inputShape: InputSchema,
53
+ async handler(client, args) {
54
+ const parsed = InputSchema.parse(args);
55
+ const params = {};
56
+ if (parsed.limit !== undefined)
57
+ params.limit = parsed.limit;
58
+ if (parsed.cursor !== undefined)
59
+ params.cursor = parsed.cursor;
60
+ if (parsed.include_failed)
61
+ params.include = 'failed';
62
+ return (0, nextCursor_1.withNextCursor)(await client.get(`/folders/${encodeURIComponent(parsed.folder_id)}/videos`, params));
63
+ },
64
+ };
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import type { ApiClient } from '../apiClient';
3
+ import type { ListFoldersResponse } from '../types';
4
+ export declare const listFoldersTool: {
5
+ name: string;
6
+ annotations: {
7
+ title: string;
8
+ readOnlyHint: true;
9
+ destructiveHint: false;
10
+ idempotentHint: true;
11
+ openWorldHint: false;
12
+ };
13
+ outputSchema: z.ZodObject<{
14
+ folders: z.ZodArray<z.ZodObject<{
15
+ id: z.ZodString;
16
+ name: z.ZodString;
17
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
+ sort_order: z.ZodOptional<z.ZodNumber>;
19
+ video_count: z.ZodOptional<z.ZodNumber>;
20
+ created_at: z.ZodOptional<z.ZodString>;
21
+ updated_at: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$loose>>;
23
+ }, z.core.$loose>;
24
+ description: string;
25
+ inputShape: z.ZodObject<{}, z.core.$strip>;
26
+ handler(client: ApiClient, _args: Record<string, never>): Promise<ListFoldersResponse>;
27
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ // list_folders — wraps GET /api/v1/folders (server 1.2.72+). Read scope, PRO tier.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.listFoldersTool = void 0;
5
+ const zod_1 = require("zod");
6
+ const outputSchemas_1 = require("../outputSchemas");
7
+ exports.listFoldersTool = {
8
+ name: 'list_folders',
9
+ // Reads only; safe for a client to auto-approve.
10
+ annotations: {
11
+ title: 'List folders',
12
+ readOnlyHint: true,
13
+ destructiveHint: false,
14
+ idempotentHint: true,
15
+ openWorldHint: false,
16
+ },
17
+ outputSchema: outputSchemas_1.ListFoldersOutput,
18
+ description: [
19
+ "Lists every folder in the authenticated user's library, in the order the user arranged them: `id`, `name`, `parent_id` (null for a top-level folder; folders can nest), `sort_order`, `video_count`, `created_at`, `updated_at`. All folders come back in one call, no paging.",
20
+ '',
21
+ 'Use a folder `id` with `list_folder_videos` to browse it, with `search_videos` (`folder_id`) to search inside it, or with `add_to_folder` to file videos. Videos in no folder are reached with the id "unfiled". To make a folder, use `create_folder`.',
22
+ '',
23
+ 'Read scope, PRO plan.',
24
+ ].join('\n'),
25
+ inputShape: zod_1.z.object({}),
26
+ async handler(client, _args) {
27
+ return client.get('/folders');
28
+ },
29
+ };
@@ -4,10 +4,12 @@ import type { RecentVideosResponse } from '../types';
4
4
  export declare const listRecentVideosInputShape: {
5
5
  limit: z.ZodOptional<z.ZodNumber>;
6
6
  include_failed: z.ZodOptional<z.ZodBoolean>;
7
+ cursor: z.ZodOptional<z.ZodString>;
7
8
  };
8
9
  declare const InputSchema: z.ZodObject<{
9
10
  limit: z.ZodOptional<z.ZodNumber>;
10
11
  include_failed: z.ZodOptional<z.ZodBoolean>;
12
+ cursor: z.ZodOptional<z.ZodString>;
11
13
  }, z.core.$strip>;
12
14
  type Input = z.infer<typeof InputSchema>;
13
15
  export declare const listRecentVideosTool: {
@@ -19,10 +21,37 @@ export declare const listRecentVideosTool: {
19
21
  idempotentHint: true;
20
22
  openWorldHint: false;
21
23
  };
24
+ outputSchema: z.ZodObject<{
25
+ videos: z.ZodArray<z.ZodObject<{
26
+ id: z.ZodNumber;
27
+ url: z.ZodString;
28
+ platform_video_id: z.ZodNullable<z.ZodString>;
29
+ platform: z.ZodString;
30
+ media_type: z.ZodString;
31
+ mode: z.ZodString;
32
+ source: z.ZodString;
33
+ metadata: z.ZodObject<{
34
+ title: z.ZodNullable<z.ZodString>;
35
+ author: z.ZodNullable<z.ZodString>;
36
+ posted_at: z.ZodNullable<z.ZodString>;
37
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
38
+ thumbnail_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ }, z.core.$loose>;
40
+ first_scanned_at: z.ZodString;
41
+ scanned_at: z.ZodString;
42
+ status: z.ZodOptional<z.ZodString>;
43
+ error: z.ZodOptional<z.ZodObject<{
44
+ code: z.ZodString;
45
+ detail: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$loose>>;
47
+ }, z.core.$loose>>;
48
+ nextCursor: z.ZodNullable<z.ZodString>;
49
+ }, z.core.$loose>;
22
50
  description: string;
23
51
  inputShape: z.ZodObject<{
24
52
  limit: z.ZodOptional<z.ZodNumber>;
25
53
  include_failed: z.ZodOptional<z.ZodBoolean>;
54
+ cursor: z.ZodOptional<z.ZodString>;
26
55
  }, z.core.$strip>;
27
56
  handler(client: ApiClient, args: Input): Promise<RecentVideosResponse>;
28
57
  };
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
- // list_recent_videos — wraps GET /api/v1/videos?recent=N[&include=failed].
3
- // Description copied verbatim from spec §7.
2
+ // list_recent_videos — wraps GET /api/v1/videos?recent=N[&include=failed][&cursor=].
3
+ // 0.6.0: `cursor` paging. The response carries `nextCursor` (server 1.2.72+);
4
+ // an older server omits it and this tool returns null instead, so the field
5
+ // is always present for the agent and the output schema.
4
6
  Object.defineProperty(exports, "__esModule", { value: true });
5
7
  exports.listRecentVideosTool = exports.listRecentVideosInputShape = void 0;
6
8
  const zod_1 = require("zod");
9
+ const outputSchemas_1 = require("../outputSchemas");
10
+ const nextCursor_1 = require("../nextCursor");
7
11
  exports.listRecentVideosInputShape = {
8
12
  limit: zod_1.z
9
13
  .number()
@@ -16,6 +20,11 @@ exports.listRecentVideosInputShape = {
16
20
  .boolean()
17
21
  .optional()
18
22
  .describe('When true, include failed scans with status + error fields. Default false.'),
23
+ cursor: zod_1.z
24
+ .string()
25
+ .min(1)
26
+ .optional()
27
+ .describe('The `nextCursor` from the previous page. Omit for the first page.'),
19
28
  };
20
29
  const InputSchema = zod_1.z.object(exports.listRecentVideosInputShape);
21
30
  exports.listRecentVideosTool = {
@@ -28,7 +37,14 @@ exports.listRecentVideosTool = {
28
37
  idempotentHint: true,
29
38
  openWorldHint: false,
30
39
  },
31
- description: "Lists the most recently scanned videos in the authenticated user's library, newest first (by last scan time). Returns a trimmed shape — title, author, platform, URL, timestamps — without transcripts or AI analysis, so the agent can skim many entries and pick one to dig into. Call `get_video(id)` for the full body. Photo posts (TikTok carousels) are marked with `media_type: 'photo'` and do not have transcripts — they have `images` instead (fetch full via `get_video`).",
40
+ outputSchema: outputSchemas_1.RecentVideosOutput,
41
+ description: [
42
+ "Lists the videos in the authenticated user's library that were most recently scanned or changed, newest first. Returns a trimmed shape (title, author, platform, URL, timestamps) without transcripts or AI analysis, so the agent can skim many entries and pick one to dig into. Call `get_video(id)` for the full body. Photo posts (TikTok carousels) are marked with `media_type: 'photo'` and do not have transcripts; they have `images` instead (fetch them via `get_video`).",
43
+ '',
44
+ 'Paging: when `nextCursor` is not null, pass it back as `cursor` (with the same `limit` and `include_failed`) to get the next, older page. `nextCursor` is null on the last page, and also from older Quiki servers that do not page.',
45
+ '',
46
+ 'The order is by when a video was last scanned or changed (`scanned_at`), so re-scanning a video or moving it to another folder brings it back to the top. A video changed while you are paging can therefore be skipped on later pages; a video is never returned twice. To find a specific video use `search_videos`; to browse one folder use `list_folder_videos`.',
47
+ ].join('\n'),
32
48
  inputShape: InputSchema,
33
49
  async handler(client, args) {
34
50
  const parsed = InputSchema.parse(args);
@@ -37,6 +53,8 @@ exports.listRecentVideosTool = {
37
53
  params.recent = parsed.limit;
38
54
  if (parsed.include_failed)
39
55
  params.include = 'failed';
40
- return client.get('/videos', params);
56
+ if (parsed.cursor !== undefined)
57
+ params.cursor = parsed.cursor;
58
+ return (0, nextCursor_1.withNextCursor)(await client.get('/videos', params));
41
59
  },
42
60
  };
@@ -29,6 +29,37 @@ export declare const scanUrlTool: {
29
29
  idempotentHint: false;
30
30
  openWorldHint: true;
31
31
  };
32
+ outputSchema: z.ZodObject<{
33
+ id: z.ZodString;
34
+ status: z.ZodString;
35
+ platform: z.ZodString;
36
+ mode: z.ZodString;
37
+ created_at: z.ZodString;
38
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ retry: z.ZodOptional<z.ZodNullable<z.ZodObject<{
40
+ attempt: z.ZodNumber;
41
+ next_attempt_at: z.ZodString;
42
+ }, z.core.$loose>>>;
43
+ video_id: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
44
+ result: z.ZodOptional<z.ZodNullable<z.ZodObject<{
45
+ platform: z.ZodString;
46
+ mode: z.ZodString;
47
+ metadata: z.ZodObject<{
48
+ title: z.ZodNullable<z.ZodString>;
49
+ author: z.ZodNullable<z.ZodString>;
50
+ posted_at: z.ZodNullable<z.ZodString>;
51
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
52
+ thumbnail_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ }, z.core.$loose>;
54
+ transcript: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ ai_analysis: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
56
+ scanned_at: z.ZodString;
57
+ }, z.core.$loose>>>;
58
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
59
+ code: z.ZodString;
60
+ detail: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$loose>>>;
62
+ }, z.core.$loose>;
32
63
  description: string;
33
64
  inputShape: z.ZodObject<{
34
65
  url: z.ZodString;
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.scanUrlTool = exports.scanUrlInputShape = void 0;
6
6
  const zod_1 = require("zod");
7
+ const outputSchemas_1 = require("../outputSchemas");
7
8
  const modeSchema = zod_1.z.enum(['fast', 'deep', 'transcript_only']);
8
9
  exports.scanUrlInputShape = {
9
10
  url: zod_1.z.string().describe('The video URL to scan (TikTok, YouTube, or Instagram).'),
@@ -27,6 +28,7 @@ exports.scanUrlTool = {
27
28
  idempotentHint: false,
28
29
  openWorldHint: true,
29
30
  },
31
+ outputSchema: outputSchemas_1.ScanOutput,
30
32
  description: [
31
33
  'Submits a TikTok, YouTube, or Instagram URL for scanning. Returns scan metadata immediately (async) or waits up to 90 seconds for the result (sync-ish).',
32
34
  '',
@@ -0,0 +1,88 @@
1
+ import { z } from 'zod';
2
+ import type { ApiClient } from '../apiClient';
3
+ import type { SearchVideosResponse } from '../types';
4
+ export declare const searchVideosInputShape: {
5
+ q: z.ZodOptional<z.ZodString>;
6
+ platform: z.ZodOptional<z.ZodEnum<{
7
+ tiktok: "tiktok";
8
+ youtube: "youtube";
9
+ instagram: "instagram";
10
+ "youtube-shorts": "youtube-shorts";
11
+ }>>;
12
+ folder_id: z.ZodOptional<z.ZodString>;
13
+ author: z.ZodOptional<z.ZodString>;
14
+ limit: z.ZodOptional<z.ZodNumber>;
15
+ cursor: z.ZodOptional<z.ZodString>;
16
+ };
17
+ declare const InputSchema: z.ZodObject<{
18
+ q: z.ZodOptional<z.ZodString>;
19
+ platform: z.ZodOptional<z.ZodEnum<{
20
+ tiktok: "tiktok";
21
+ youtube: "youtube";
22
+ instagram: "instagram";
23
+ "youtube-shorts": "youtube-shorts";
24
+ }>>;
25
+ folder_id: z.ZodOptional<z.ZodString>;
26
+ author: z.ZodOptional<z.ZodString>;
27
+ limit: z.ZodOptional<z.ZodNumber>;
28
+ cursor: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
30
+ type Input = z.infer<typeof InputSchema>;
31
+ export declare const searchVideosTool: {
32
+ name: string;
33
+ annotations: {
34
+ title: string;
35
+ readOnlyHint: true;
36
+ destructiveHint: false;
37
+ idempotentHint: true;
38
+ openWorldHint: false;
39
+ };
40
+ outputSchema: z.ZodObject<{
41
+ videos: z.ZodArray<z.ZodObject<{
42
+ id: z.ZodNumber;
43
+ url: z.ZodString;
44
+ platform_video_id: z.ZodNullable<z.ZodString>;
45
+ platform: z.ZodString;
46
+ media_type: z.ZodString;
47
+ mode: z.ZodString;
48
+ source: z.ZodString;
49
+ metadata: z.ZodObject<{
50
+ title: z.ZodNullable<z.ZodString>;
51
+ author: z.ZodNullable<z.ZodString>;
52
+ posted_at: z.ZodNullable<z.ZodString>;
53
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
54
+ thumbnail_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ }, z.core.$loose>;
56
+ first_scanned_at: z.ZodString;
57
+ scanned_at: z.ZodString;
58
+ status: z.ZodOptional<z.ZodString>;
59
+ error: z.ZodOptional<z.ZodObject<{
60
+ code: z.ZodString;
61
+ detail: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$loose>>;
63
+ matched_in: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ }, z.core.$loose>>;
65
+ total: z.ZodNumber;
66
+ nextCursor: z.ZodNullable<z.ZodString>;
67
+ warnings: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
68
+ code: z.ZodOptional<z.ZodString>;
69
+ message: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$loose>]>>>;
71
+ }, z.core.$loose>;
72
+ description: string;
73
+ inputShape: z.ZodObject<{
74
+ q: z.ZodOptional<z.ZodString>;
75
+ platform: z.ZodOptional<z.ZodEnum<{
76
+ tiktok: "tiktok";
77
+ youtube: "youtube";
78
+ instagram: "instagram";
79
+ "youtube-shorts": "youtube-shorts";
80
+ }>>;
81
+ folder_id: z.ZodOptional<z.ZodString>;
82
+ author: z.ZodOptional<z.ZodString>;
83
+ limit: z.ZodOptional<z.ZodNumber>;
84
+ cursor: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strip>;
86
+ handler(client: ApiClient, args: Input): Promise<SearchVideosResponse>;
87
+ };
88
+ export {};