@framers/agentos-ext-channel-youtube 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 +98 -0
- package/dist/YouTubeChannelAdapter.d.ts +30 -0
- package/dist/YouTubeChannelAdapter.d.ts.map +1 -0
- package/dist/YouTubeChannelAdapter.js +148 -0
- package/dist/YouTubeChannelAdapter.js.map +1 -0
- package/dist/YouTubeService.d.ts +115 -0
- package/dist/YouTubeService.d.ts.map +1 -0
- package/dist/YouTubeService.js +383 -0
- package/dist/YouTubeService.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/analytics.d.ts +41 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +49 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/comment.d.ts +40 -0
- package/dist/tools/comment.d.ts.map +1 -0
- package/dist/tools/comment.js +39 -0
- package/dist/tools/comment.js.map +1 -0
- package/dist/tools/playlist.d.ts +67 -0
- package/dist/tools/playlist.d.ts.map +1 -0
- package/dist/tools/playlist.js +82 -0
- package/dist/tools/playlist.js.map +1 -0
- package/dist/tools/schedule.d.ts +64 -0
- package/dist/tools/schedule.d.ts.map +1 -0
- package/dist/tools/schedule.js +81 -0
- package/dist/tools/schedule.js.map +1 -0
- package/dist/tools/search.d.ts +52 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +54 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/short.d.ts +55 -0
- package/dist/tools/short.d.ts.map +1 -0
- package/dist/tools/short.js +68 -0
- package/dist/tools/short.js.map +1 -0
- package/dist/tools/trending.d.ts +40 -0
- package/dist/tools/trending.d.ts.map +1 -0
- package/dist/tools/trending.js +42 -0
- package/dist/tools/trending.js.map +1 -0
- package/dist/tools/upload.d.ts +65 -0
- package/dist/tools/upload.d.ts.map +1 -0
- package/dist/tools/upload.js +71 -0
- package/dist/tools/upload.js.map +1 -0
- package/manifest.json +34 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,oBAAoB;IAuB/B,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QAtBpC,OAAE,GAAG,kBAAkB,CAAC;QACxB,SAAI,GAAG,kBAAkB,CAAC;QAC1B,gBAAW,GAAG,iBAAiB,CAAC;QAChC,gBAAW,GAAG,+FAA+F,CAAC;QAC9G,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,CAAC,MAAM,CAAU;YAC3B,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;oBAC1B,WAAW,EAAE,mDAAmD;iBACjE;gBACD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;gBACpF,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uFAAuF,EAAE;aACpI;SACF,CAAC;IAEqD,CAAC;IAExD,KAAK,CAAC,OAAO,CACX,IAAyE,EACzE,QAA8B;QAE9B,IAAI,CAAC;YACH,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBAC1B,IAAI,CAAC,IAAI,CAAC,OAAO;oBAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;gBAC/E,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YACxC,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACtE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3G,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AA1CD,oDA0CC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ITool for commenting on YouTube videos.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { YouTubeService } from '../YouTubeService';
|
|
6
|
+
export declare class YouTubeCommentTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "youtubeComment";
|
|
9
|
+
readonly name = "youtubeComment";
|
|
10
|
+
readonly displayName = "Comment on Video";
|
|
11
|
+
readonly description = "Post a comment or reply to an existing comment on a YouTube video.";
|
|
12
|
+
readonly category = "social";
|
|
13
|
+
readonly version = "0.1.0";
|
|
14
|
+
readonly hasSideEffects = true;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
type: "object";
|
|
17
|
+
required: readonly ["videoId", "text"];
|
|
18
|
+
properties: {
|
|
19
|
+
videoId: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
text: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
parentCommentId: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
constructor(service: YouTubeService);
|
|
34
|
+
execute(args: {
|
|
35
|
+
videoId: string;
|
|
36
|
+
text: string;
|
|
37
|
+
parentCommentId?: string;
|
|
38
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../src/tools/comment.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,kBAAmB,YAAW,KAAK;IAmBlC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAlBpC,SAAgB,EAAE,oBAAoB;IACtC,SAAgB,IAAI,oBAAoB;IACxC,SAAgB,WAAW,sBAAsB;IACjD,SAAgB,WAAW,wEAAwE;IACnG,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,QAAQ;IAEtC,SAAgB,WAAW;;;;;;;;;;;;;;;;;MAQzB;gBAE2B,OAAO,EAAE,cAAc;IAE9C,OAAO,CACX,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,EACjE,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;CAQhC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for commenting on YouTube videos.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.YouTubeCommentTool = void 0;
|
|
8
|
+
class YouTubeCommentTool {
|
|
9
|
+
constructor(service) {
|
|
10
|
+
this.service = service;
|
|
11
|
+
this.id = 'youtubeComment';
|
|
12
|
+
this.name = 'youtubeComment';
|
|
13
|
+
this.displayName = 'Comment on Video';
|
|
14
|
+
this.description = 'Post a comment or reply to an existing comment on a YouTube video.';
|
|
15
|
+
this.category = 'social';
|
|
16
|
+
this.version = '0.1.0';
|
|
17
|
+
this.hasSideEffects = true;
|
|
18
|
+
this.inputSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: ['videoId', 'text'],
|
|
21
|
+
properties: {
|
|
22
|
+
videoId: { type: 'string', description: 'YouTube video ID' },
|
|
23
|
+
text: { type: 'string', description: 'Comment text' },
|
|
24
|
+
parentCommentId: { type: 'string', description: 'Parent comment ID for replying to a comment' },
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async execute(args, _context) {
|
|
29
|
+
try {
|
|
30
|
+
const result = await this.service.postComment(args.videoId, args.text, args.parentCommentId);
|
|
31
|
+
return { success: true, data: result };
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return { success: false, error: error.message };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.YouTubeCommentTool = YouTubeCommentTool;
|
|
39
|
+
//# sourceMappingURL=comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/tools/comment.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,kBAAkB;IAmB7B,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QAlBpC,OAAE,GAAG,gBAAgB,CAAC;QACtB,SAAI,GAAG,gBAAgB,CAAC;QACxB,gBAAW,GAAG,kBAAkB,CAAC;QACjC,gBAAW,GAAG,oEAAoE,CAAC;QACnF,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,CAAU;YACtC,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE;gBAC5D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;gBACrD,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE;aAChG;SACF,CAAC;IAEqD,CAAC;IAExD,KAAK,CAAC,OAAO,CACX,IAAiE,EACjE,QAA8B;QAE9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAC7F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AAhCD,gDAgCC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ITool for managing YouTube playlists.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { YouTubeService } from '../YouTubeService';
|
|
6
|
+
export declare class YouTubePlaylistTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "youtubePlaylist";
|
|
9
|
+
readonly name = "youtubePlaylist";
|
|
10
|
+
readonly displayName = "Manage Playlist";
|
|
11
|
+
readonly description = "Create, list, add videos to, or delete YouTube playlists.";
|
|
12
|
+
readonly category = "social";
|
|
13
|
+
readonly version = "0.1.0";
|
|
14
|
+
readonly hasSideEffects = true;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
type: "object";
|
|
17
|
+
required: readonly ["action"];
|
|
18
|
+
properties: {
|
|
19
|
+
action: {
|
|
20
|
+
type: string;
|
|
21
|
+
enum: string[];
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
title: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
description: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
privacyStatus: {
|
|
33
|
+
type: string;
|
|
34
|
+
enum: string[];
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
playlistId: {
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
videoId: {
|
|
42
|
+
type: string;
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
channelId: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
maxResults: {
|
|
50
|
+
type: string;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
constructor(service: YouTubeService);
|
|
56
|
+
execute(args: {
|
|
57
|
+
action: 'create' | 'list' | 'listItems' | 'addVideo' | 'delete';
|
|
58
|
+
title?: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
privacyStatus?: 'public' | 'private' | 'unlisted';
|
|
61
|
+
playlistId?: string;
|
|
62
|
+
videoId?: string;
|
|
63
|
+
channelId?: string;
|
|
64
|
+
maxResults?: number;
|
|
65
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=playlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playlist.d.ts","sourceRoot":"","sources":["../../src/tools/playlist.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,mBAAoB,YAAW,KAAK;IAgCnC,OAAO,CAAC,QAAQ,CAAC,OAAO;IA/BpC,SAAgB,EAAE,qBAAqB;IACvC,SAAgB,IAAI,qBAAqB;IACzC,SAAgB,WAAW,qBAAqB;IAChD,SAAgB,WAAW,+DAA+D;IAC1F,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,QAAQ;IAEtC,SAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBzB;gBAE2B,OAAO,EAAE,cAAc;IAE9C,OAAO,CACX,IAAI,EAAE;QACJ,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;QAChE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,EACD,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;CAqChC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for managing YouTube playlists.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.YouTubePlaylistTool = void 0;
|
|
8
|
+
class YouTubePlaylistTool {
|
|
9
|
+
constructor(service) {
|
|
10
|
+
this.service = service;
|
|
11
|
+
this.id = 'youtubePlaylist';
|
|
12
|
+
this.name = 'youtubePlaylist';
|
|
13
|
+
this.displayName = 'Manage Playlist';
|
|
14
|
+
this.description = 'Create, list, add videos to, or delete YouTube playlists.';
|
|
15
|
+
this.category = 'social';
|
|
16
|
+
this.version = '0.1.0';
|
|
17
|
+
this.hasSideEffects = true;
|
|
18
|
+
this.inputSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: ['action'],
|
|
21
|
+
properties: {
|
|
22
|
+
action: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
enum: ['create', 'list', 'listItems', 'addVideo', 'delete'],
|
|
25
|
+
description: 'Playlist action to perform',
|
|
26
|
+
},
|
|
27
|
+
title: { type: 'string', description: 'Playlist title (required for create)' },
|
|
28
|
+
description: { type: 'string', description: 'Playlist description' },
|
|
29
|
+
privacyStatus: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
enum: ['public', 'private', 'unlisted'],
|
|
32
|
+
description: 'Privacy status (default: public)',
|
|
33
|
+
},
|
|
34
|
+
playlistId: { type: 'string', description: 'Playlist ID (required for listItems, addVideo, delete)' },
|
|
35
|
+
videoId: { type: 'string', description: 'Video ID (required for addVideo)' },
|
|
36
|
+
channelId: { type: 'string', description: 'Channel ID (optional for list — defaults to own channel)' },
|
|
37
|
+
maxResults: { type: 'number', description: 'Max results for list operations' },
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async execute(args, _context) {
|
|
42
|
+
try {
|
|
43
|
+
switch (args.action) {
|
|
44
|
+
case 'create': {
|
|
45
|
+
if (!args.title)
|
|
46
|
+
throw new Error('title is required for create action');
|
|
47
|
+
const playlist = await this.service.createPlaylist(args.title, args.description, args.privacyStatus);
|
|
48
|
+
return { success: true, data: playlist };
|
|
49
|
+
}
|
|
50
|
+
case 'list': {
|
|
51
|
+
const playlists = await this.service.getPlaylists(args.channelId, args.maxResults);
|
|
52
|
+
return { success: true, data: { playlists, count: playlists.length } };
|
|
53
|
+
}
|
|
54
|
+
case 'listItems': {
|
|
55
|
+
if (!args.playlistId)
|
|
56
|
+
throw new Error('playlistId is required for listItems action');
|
|
57
|
+
const items = await this.service.getPlaylistItems(args.playlistId, args.maxResults);
|
|
58
|
+
return { success: true, data: { items, count: items.length } };
|
|
59
|
+
}
|
|
60
|
+
case 'addVideo': {
|
|
61
|
+
if (!args.playlistId)
|
|
62
|
+
throw new Error('playlistId is required for addVideo action');
|
|
63
|
+
if (!args.videoId)
|
|
64
|
+
throw new Error('videoId is required for addVideo action');
|
|
65
|
+
await this.service.addToPlaylist(args.playlistId, args.videoId);
|
|
66
|
+
return { success: true, data: { added: true, playlistId: args.playlistId, videoId: args.videoId } };
|
|
67
|
+
}
|
|
68
|
+
case 'delete': {
|
|
69
|
+
if (!args.playlistId)
|
|
70
|
+
throw new Error('playlistId is required for delete action');
|
|
71
|
+
await this.service.deletePlaylist(args.playlistId);
|
|
72
|
+
return { success: true, data: { deleted: true, playlistId: args.playlistId } };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
return { success: false, error: error.message };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.YouTubePlaylistTool = YouTubePlaylistTool;
|
|
82
|
+
//# sourceMappingURL=playlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playlist.js","sourceRoot":"","sources":["../../src/tools/playlist.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,mBAAmB;IAgC9B,YAA6B,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AAI,CAAC,OAAO;wBAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;oBAC9E,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;oBAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;gBACtG,CAAC;gBACD,KAAK,QAAQ,CAAC,CAAC,CAAC;oBACd,IAAI,CAAC,IAAI,CAAC,UAAU;wBAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;oBAClF,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;oBACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;gBACjF,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AAnFD,kDAmFC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ITool for scheduling video publishing on YouTube.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { YouTubeService } from '../YouTubeService';
|
|
6
|
+
export declare class YouTubeScheduleTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "youtubeSchedule";
|
|
9
|
+
readonly name = "youtubeSchedule";
|
|
10
|
+
readonly displayName = "Schedule Video";
|
|
11
|
+
readonly description = "Upload a video and schedule it for future publishing on YouTube. The video is uploaded as private and automatically goes public at the scheduled time.";
|
|
12
|
+
readonly category = "social";
|
|
13
|
+
readonly version = "0.1.0";
|
|
14
|
+
readonly hasSideEffects = true;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
type: "object";
|
|
17
|
+
required: readonly ["videoUrl", "title", "description", "publishAt"];
|
|
18
|
+
properties: {
|
|
19
|
+
videoUrl: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
title: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
description: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
publishAt: {
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
tags: {
|
|
36
|
+
type: string;
|
|
37
|
+
items: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
categoryId: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
mimeType: {
|
|
47
|
+
type: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
constructor(service: YouTubeService);
|
|
53
|
+
execute(args: {
|
|
54
|
+
videoUrl: string;
|
|
55
|
+
title: string;
|
|
56
|
+
description: string;
|
|
57
|
+
publishAt: string;
|
|
58
|
+
tags?: string[];
|
|
59
|
+
categoryId?: string;
|
|
60
|
+
mimeType?: string;
|
|
61
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
62
|
+
private fetchStream;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/tools/schedule.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,qBAAa,mBAAoB,YAAW,KAAK;IA2BnC,OAAO,CAAC,QAAQ,CAAC,OAAO;IA1BpC,SAAgB,EAAE,qBAAqB;IACvC,SAAgB,IAAI,qBAAqB;IACzC,SAAgB,WAAW,oBAAoB;IAC/C,SAAgB,WAAW,4JAA4J;IACvL,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,QAAQ;IAEtC,SAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBzB;gBAE2B,OAAO,EAAE,cAAc;IAE9C,OAAO,CACX,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,EACD,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAmC/B,OAAO,CAAC,WAAW;CAMpB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for scheduling video publishing on YouTube.
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.YouTubeScheduleTool = void 0;
|
|
11
|
+
const https_1 = __importDefault(require("https"));
|
|
12
|
+
const http_1 = __importDefault(require("http"));
|
|
13
|
+
class YouTubeScheduleTool {
|
|
14
|
+
constructor(service) {
|
|
15
|
+
this.service = service;
|
|
16
|
+
this.id = 'youtubeSchedule';
|
|
17
|
+
this.name = 'youtubeSchedule';
|
|
18
|
+
this.displayName = 'Schedule Video';
|
|
19
|
+
this.description = 'Upload a video and schedule it for future publishing on YouTube. The video is uploaded as private and automatically goes public at the scheduled time.';
|
|
20
|
+
this.category = 'social';
|
|
21
|
+
this.version = '0.1.0';
|
|
22
|
+
this.hasSideEffects = true;
|
|
23
|
+
this.inputSchema = {
|
|
24
|
+
type: 'object',
|
|
25
|
+
required: ['videoUrl', 'title', 'description', 'publishAt'],
|
|
26
|
+
properties: {
|
|
27
|
+
videoUrl: { type: 'string', description: 'URL of the video file to upload' },
|
|
28
|
+
title: { type: 'string', description: 'Video title (max 100 chars)' },
|
|
29
|
+
description: { type: 'string', description: 'Video description (max 5000 chars)' },
|
|
30
|
+
publishAt: { type: 'string', description: 'ISO 8601 datetime for scheduled publish time' },
|
|
31
|
+
tags: {
|
|
32
|
+
type: 'array',
|
|
33
|
+
items: { type: 'string' },
|
|
34
|
+
description: 'Video tags for discoverability',
|
|
35
|
+
},
|
|
36
|
+
categoryId: { type: 'string', description: 'YouTube category ID (default: "22" People & Blogs)' },
|
|
37
|
+
mimeType: { type: 'string', description: 'Video MIME type (default: video/mp4)' },
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async execute(args, _context) {
|
|
42
|
+
try {
|
|
43
|
+
const publishDate = new Date(args.publishAt);
|
|
44
|
+
if (isNaN(publishDate.getTime())) {
|
|
45
|
+
throw new Error('Invalid publishAt date — provide a valid ISO 8601 datetime');
|
|
46
|
+
}
|
|
47
|
+
if (publishDate.getTime() <= Date.now()) {
|
|
48
|
+
throw new Error('publishAt must be in the future');
|
|
49
|
+
}
|
|
50
|
+
const videoStream = await this.fetchStream(args.videoUrl);
|
|
51
|
+
const result = await this.service.uploadVideo({
|
|
52
|
+
title: args.title,
|
|
53
|
+
description: args.description,
|
|
54
|
+
tags: args.tags,
|
|
55
|
+
categoryId: args.categoryId,
|
|
56
|
+
videoStream,
|
|
57
|
+
mimeType: args.mimeType,
|
|
58
|
+
publishAt: args.publishAt,
|
|
59
|
+
});
|
|
60
|
+
return {
|
|
61
|
+
success: true,
|
|
62
|
+
data: {
|
|
63
|
+
...result,
|
|
64
|
+
scheduled: true,
|
|
65
|
+
publishAt: args.publishAt,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return { success: false, error: error.message };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
fetchStream(url) {
|
|
74
|
+
const fetcher = url.startsWith('https') ? https_1.default : http_1.default;
|
|
75
|
+
return new Promise((resolve, reject) => {
|
|
76
|
+
fetcher.get(url, (res) => resolve(res)).on('error', reject);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.YouTubeScheduleTool = YouTubeScheduleTool;
|
|
81
|
+
//# sourceMappingURL=schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/tools/schedule.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;;;;AAKH,kDAA0B;AAC1B,gDAAwB;AAExB,MAAa,mBAAmB;IA2B9B,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QA1BpC,OAAE,GAAG,iBAAiB,CAAC;QACvB,SAAI,GAAG,iBAAiB,CAAC;QACzB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,gBAAW,GAAG,wJAAwJ,CAAC;QACvK,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,G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C,CAAC;YAE1D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;gBAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,WAAW;gBACX,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;aAC1B,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE;oBACJ,GAAG,MAAM;oBACT,SAAS,EAAE,IAAI;oBACf,SAAS,EAAE,IAAI,CAAC,SAAS;iBAC1B;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;IAEO,WAAW,CAAC,GAAW;QAC7B,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,eAAK,CAAC,CAAC,CAAC,cAAI,CAAC;QACvD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjFD,kDAiFC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ITool for searching videos, channels, and playlists on YouTube.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { YouTubeService } from '../YouTubeService';
|
|
6
|
+
export declare class YouTubeSearchTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "youtubeSearch";
|
|
9
|
+
readonly name = "youtubeSearch";
|
|
10
|
+
readonly displayName = "Search YouTube";
|
|
11
|
+
readonly description = "Search for videos, channels, or playlists on YouTube by keyword.";
|
|
12
|
+
readonly category = "social";
|
|
13
|
+
readonly version = "0.1.0";
|
|
14
|
+
readonly hasSideEffects = false;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
type: "object";
|
|
17
|
+
required: readonly ["query"];
|
|
18
|
+
properties: {
|
|
19
|
+
query: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
type: {
|
|
24
|
+
type: string;
|
|
25
|
+
enum: string[];
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
maxResults: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
order: {
|
|
33
|
+
type: string;
|
|
34
|
+
enum: string[];
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
regionCode: {
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
constructor(service: YouTubeService);
|
|
44
|
+
execute(args: {
|
|
45
|
+
query: string;
|
|
46
|
+
type?: 'video' | 'channel' | 'playlist';
|
|
47
|
+
maxResults?: number;
|
|
48
|
+
order?: string;
|
|
49
|
+
regionCode?: string;
|
|
50
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,iBAAkB,YAAW,KAAK;IA6BjC,OAAO,CAAC,QAAQ,CAAC,OAAO;IA5BpC,SAAgB,EAAE,mBAAmB;IACrC,SAAgB,IAAI,mBAAmB;IACvC,SAAgB,WAAW,oBAAoB;IAC/C,SAAgB,WAAW,sEAAsE;IACjG,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,SAAS;IAEvC,SAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkBzB;gBAE2B,OAAO,EAAE,cAAc;IAE9C,OAAO,CACX,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;QACxC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,EACD,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;CAchC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for searching videos, channels, and playlists on YouTube.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.YouTubeSearchTool = void 0;
|
|
8
|
+
class YouTubeSearchTool {
|
|
9
|
+
constructor(service) {
|
|
10
|
+
this.service = service;
|
|
11
|
+
this.id = 'youtubeSearch';
|
|
12
|
+
this.name = 'youtubeSearch';
|
|
13
|
+
this.displayName = 'Search YouTube';
|
|
14
|
+
this.description = 'Search for videos, channels, or playlists on YouTube by keyword.';
|
|
15
|
+
this.category = 'social';
|
|
16
|
+
this.version = '0.1.0';
|
|
17
|
+
this.hasSideEffects = false;
|
|
18
|
+
this.inputSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: ['query'],
|
|
21
|
+
properties: {
|
|
22
|
+
query: { type: 'string', description: 'Search query' },
|
|
23
|
+
type: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
enum: ['video', 'channel', 'playlist'],
|
|
26
|
+
description: 'Search type (default: video)',
|
|
27
|
+
},
|
|
28
|
+
maxResults: { type: 'number', description: 'Max results to return (default: 10, max: 50)' },
|
|
29
|
+
order: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
enum: ['relevance', 'date', 'rating', 'viewCount', 'title'],
|
|
32
|
+
description: 'Sort order (default: relevance)',
|
|
33
|
+
},
|
|
34
|
+
regionCode: { type: 'string', description: 'ISO 3166-1 alpha-2 region code (e.g., "US", "GB")' },
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async execute(args, _context) {
|
|
39
|
+
try {
|
|
40
|
+
const results = await this.service.search(args.query, {
|
|
41
|
+
type: args.type,
|
|
42
|
+
maxResults: args.maxResults,
|
|
43
|
+
order: args.order,
|
|
44
|
+
regionCode: args.regionCode,
|
|
45
|
+
});
|
|
46
|
+
return { success: true, data: { results, count: results.length } };
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return { success: false, error: error.message };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.YouTubeSearchTool = YouTubeSearchTool;
|
|
54
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,iBAAiB;IA6B5B,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QA5BpC,OAAE,GAAG,eAAe,CAAC;QACrB,SAAI,GAAG,eAAe,CAAC;QACvB,g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OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QACrE,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AAtDD,8CAsDC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ITool for uploading YouTube Shorts.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { YouTubeService } from '../YouTubeService';
|
|
6
|
+
export declare class YouTubeShortTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "youtubeShort";
|
|
9
|
+
readonly name = "youtubeShort";
|
|
10
|
+
readonly displayName = "Upload Short";
|
|
11
|
+
readonly description = "Upload a YouTube Short (vertical video under 60 seconds) with #Shorts tag.";
|
|
12
|
+
readonly category = "social";
|
|
13
|
+
readonly version = "0.1.0";
|
|
14
|
+
readonly hasSideEffects = true;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
type: "object";
|
|
17
|
+
required: readonly ["videoUrl", "title"];
|
|
18
|
+
properties: {
|
|
19
|
+
videoUrl: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
title: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
description: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
tags: {
|
|
32
|
+
type: string;
|
|
33
|
+
items: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
privacyStatus: {
|
|
39
|
+
type: string;
|
|
40
|
+
enum: string[];
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
constructor(service: YouTubeService);
|
|
46
|
+
execute(args: {
|
|
47
|
+
videoUrl: string;
|
|
48
|
+
title: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
tags?: string[];
|
|
51
|
+
privacyStatus?: 'public' | 'private' | 'unlisted';
|
|
52
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
53
|
+
private fetchStream;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=short.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"short.d.ts","sourceRoot":"","sources":["../../src/tools/short.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,qBAAa,gBAAiB,YAAW,KAAK;IA6BhC,OAAO,CAAC,QAAQ,CAAC,OAAO;IA5BpC,SAAgB,EAAE,kBAAkB;IACpC,SAAgB,IAAI,kBAAkB;IACtC,SAAgB,WAAW,kBAAkB;IAC7C,SAAgB,WAAW,gFAAgF;IAC3G,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,QAAQ;IAEtC,SAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkBzB;gBAE2B,OAAO,EAAE,cAAc;IAE9C,OAAO,CACX,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;KACnD,EACD,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAmB/B,OAAO,CAAC,WAAW;CAMpB"}
|