@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,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for uploading YouTube Shorts.
|
|
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.YouTubeShortTool = void 0;
|
|
11
|
+
const https_1 = __importDefault(require("https"));
|
|
12
|
+
const http_1 = __importDefault(require("http"));
|
|
13
|
+
class YouTubeShortTool {
|
|
14
|
+
constructor(service) {
|
|
15
|
+
this.service = service;
|
|
16
|
+
this.id = 'youtubeShort';
|
|
17
|
+
this.name = 'youtubeShort';
|
|
18
|
+
this.displayName = 'Upload Short';
|
|
19
|
+
this.description = 'Upload a YouTube Short (vertical video under 60 seconds) with #Shorts tag.';
|
|
20
|
+
this.category = 'social';
|
|
21
|
+
this.version = '0.1.0';
|
|
22
|
+
this.hasSideEffects = true;
|
|
23
|
+
this.inputSchema = {
|
|
24
|
+
type: 'object',
|
|
25
|
+
required: ['videoUrl', 'title'],
|
|
26
|
+
properties: {
|
|
27
|
+
videoUrl: { type: 'string', description: 'URL of the short-form video file' },
|
|
28
|
+
title: { type: 'string', description: 'Short title (max 100 chars)' },
|
|
29
|
+
description: { type: 'string', description: 'Short description' },
|
|
30
|
+
tags: {
|
|
31
|
+
type: 'array',
|
|
32
|
+
items: { type: 'string' },
|
|
33
|
+
description: 'Additional tags (besides #Shorts)',
|
|
34
|
+
},
|
|
35
|
+
privacyStatus: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
enum: ['public', 'private', 'unlisted'],
|
|
38
|
+
description: 'Privacy status (default: public)',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async execute(args, _context) {
|
|
44
|
+
try {
|
|
45
|
+
const videoStream = await this.fetchStream(args.videoUrl);
|
|
46
|
+
const result = await this.service.uploadVideo({
|
|
47
|
+
title: args.title,
|
|
48
|
+
description: args.description ?? '',
|
|
49
|
+
tags: [...(args.tags ?? []), 'Shorts'],
|
|
50
|
+
privacyStatus: args.privacyStatus,
|
|
51
|
+
videoStream,
|
|
52
|
+
isShort: true,
|
|
53
|
+
});
|
|
54
|
+
return { success: true, data: { ...result, isShort: true } };
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
return { success: false, error: error.message };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
fetchStream(url) {
|
|
61
|
+
const fetcher = url.startsWith('https') ? https_1.default : http_1.default;
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
fetcher.get(url, (res) => resolve(res)).on('error', reject);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.YouTubeShortTool = YouTubeShortTool;
|
|
68
|
+
//# sourceMappingURL=short.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"short.js","sourceRoot":"","sources":["../../src/tools/short.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;;;;AAKH,kDAA0B;AAC1B,gDAAwB;AAExB,MAAa,gBAAgB;IA6B3B,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QA5BpC,OAAE,GAAG,cAAc,CAAC;QACpB,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,cAAc,CAAC;QAC7B,gBAAW,GAAG,4EAA4E,CAAC;QAC3F,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,QAA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C;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;AAjED,4CAiEC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ITool for getting trending videos on YouTube.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { YouTubeService } from '../YouTubeService';
|
|
6
|
+
export declare class YouTubeTrendingTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "youtubeTrending";
|
|
9
|
+
readonly name = "youtubeTrending";
|
|
10
|
+
readonly displayName = "Get Trending";
|
|
11
|
+
readonly description = "Get the most popular (trending) videos on YouTube by region and category.";
|
|
12
|
+
readonly category = "social";
|
|
13
|
+
readonly version = "0.1.0";
|
|
14
|
+
readonly hasSideEffects = false;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
type: "object";
|
|
17
|
+
required: readonly [];
|
|
18
|
+
properties: {
|
|
19
|
+
regionCode: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
categoryId: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
maxResults: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
constructor(service: YouTubeService);
|
|
34
|
+
execute(args: {
|
|
35
|
+
regionCode?: string;
|
|
36
|
+
categoryId?: string;
|
|
37
|
+
maxResults?: number;
|
|
38
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=trending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trending.d.ts","sourceRoot":"","sources":["../../src/tools/trending.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;IAsBnC,OAAO,CAAC,QAAQ,CAAC,OAAO;IArBpC,SAAgB,EAAE,qBAAqB;IACvC,SAAgB,IAAI,qBAAqB;IACzC,SAAgB,WAAW,kBAAkB;IAC7C,SAAgB,WAAW,+EAA+E;IAC1G,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,SAAS;IAEvC,SAAgB,WAAW;;;;;;;;;;;;;;;;;MAWzB;gBAE2B,OAAO,EAAE,cAAc;IAE9C,OAAO,CACX,IAAI,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,EACvE,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;CAahC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for getting trending videos on YouTube.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.YouTubeTrendingTool = void 0;
|
|
8
|
+
class YouTubeTrendingTool {
|
|
9
|
+
constructor(service) {
|
|
10
|
+
this.service = service;
|
|
11
|
+
this.id = 'youtubeTrending';
|
|
12
|
+
this.name = 'youtubeTrending';
|
|
13
|
+
this.displayName = 'Get Trending';
|
|
14
|
+
this.description = 'Get the most popular (trending) videos on YouTube by region and category.';
|
|
15
|
+
this.category = 'social';
|
|
16
|
+
this.version = '0.1.0';
|
|
17
|
+
this.hasSideEffects = false;
|
|
18
|
+
this.inputSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: [],
|
|
21
|
+
properties: {
|
|
22
|
+
regionCode: { type: 'string', description: 'ISO 3166-1 alpha-2 region code (default: "US")' },
|
|
23
|
+
categoryId: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'YouTube video category ID (e.g., "10" for Music, "17" for Sports, "20" for Gaming)',
|
|
26
|
+
},
|
|
27
|
+
maxResults: { type: 'number', description: 'Max results to return (default: 20, max: 50)' },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async execute(args, _context) {
|
|
32
|
+
try {
|
|
33
|
+
const videos = await this.service.getTrending(args.regionCode, args.categoryId, args.maxResults);
|
|
34
|
+
return { success: true, data: { videos, count: videos.length, regionCode: args.regionCode ?? 'US' } };
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return { success: false, error: error.message };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.YouTubeTrendingTool = YouTubeTrendingTool;
|
|
42
|
+
//# sourceMappingURL=trending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trending.js","sourceRoot":"","sources":["../../src/tools/trending.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,mB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**
|
|
2
|
+
* @fileoverview ITool for uploading videos to YouTube.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { YouTubeService } from '../YouTubeService';
|
|
6
|
+
export declare class YouTubeUploadTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "youtubeUpload";
|
|
9
|
+
readonly name = "youtubeUpload";
|
|
10
|
+
readonly displayName = "Upload Video";
|
|
11
|
+
readonly description = "Upload a video to YouTube with title, description, tags, and privacy settings.";
|
|
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"];
|
|
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
|
+
categoryId: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
privacyStatus: {
|
|
43
|
+
type: string;
|
|
44
|
+
enum: string[];
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
mimeType: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
constructor(service: YouTubeService);
|
|
54
|
+
execute(args: {
|
|
55
|
+
videoUrl: string;
|
|
56
|
+
title: string;
|
|
57
|
+
description: string;
|
|
58
|
+
tags?: string[];
|
|
59
|
+
categoryId?: string;
|
|
60
|
+
privacyStatus?: 'public' | 'private' | 'unlisted';
|
|
61
|
+
mimeType?: string;
|
|
62
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
63
|
+
private fetchStream;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/tools/upload.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,iBAAkB,YAAW,KAAK;IA+BjC,OAAO,CAAC,QAAQ,CAAC,OAAO;IA9BpC,SAAgB,EAAE,mBAAmB;IACrC,SAAgB,IAAI,mBAAmB;IACvC,SAAgB,WAAW,kBAAkB;IAC7C,SAAgB,WAAW,oFAAoF;IAC/G,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,QAAQ;IAEtC,SAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoBzB;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,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;QAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,EACD,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAoB/B,OAAO,CAAC,WAAW;CAMpB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for uploading videos to 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.YouTubeUploadTool = void 0;
|
|
11
|
+
const https_1 = __importDefault(require("https"));
|
|
12
|
+
const http_1 = __importDefault(require("http"));
|
|
13
|
+
class YouTubeUploadTool {
|
|
14
|
+
constructor(service) {
|
|
15
|
+
this.service = service;
|
|
16
|
+
this.id = 'youtubeUpload';
|
|
17
|
+
this.name = 'youtubeUpload';
|
|
18
|
+
this.displayName = 'Upload Video';
|
|
19
|
+
this.description = 'Upload a video to YouTube with title, description, tags, and privacy settings.';
|
|
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'],
|
|
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
|
+
tags: {
|
|
31
|
+
type: 'array',
|
|
32
|
+
items: { type: 'string' },
|
|
33
|
+
description: 'Video tags for discoverability',
|
|
34
|
+
},
|
|
35
|
+
categoryId: { type: 'string', description: 'YouTube category ID (default: "22" People & Blogs)' },
|
|
36
|
+
privacyStatus: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
enum: ['public', 'private', 'unlisted'],
|
|
39
|
+
description: 'Privacy status (default: public)',
|
|
40
|
+
},
|
|
41
|
+
mimeType: { type: 'string', description: 'Video MIME type (default: video/mp4)' },
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async execute(args, _context) {
|
|
46
|
+
try {
|
|
47
|
+
const videoStream = await this.fetchStream(args.videoUrl);
|
|
48
|
+
const result = await this.service.uploadVideo({
|
|
49
|
+
title: args.title,
|
|
50
|
+
description: args.description,
|
|
51
|
+
tags: args.tags,
|
|
52
|
+
categoryId: args.categoryId,
|
|
53
|
+
privacyStatus: args.privacyStatus,
|
|
54
|
+
videoStream,
|
|
55
|
+
mimeType: args.mimeType,
|
|
56
|
+
});
|
|
57
|
+
return { success: true, data: result };
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return { success: false, error: error.message };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
fetchStream(url) {
|
|
64
|
+
const fetcher = url.startsWith('https') ? https_1.default : http_1.default;
|
|
65
|
+
return new Promise((resolve, reject) => {
|
|
66
|
+
fetcher.get(url, (res) => resolve(res)).on('error', reject);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.YouTubeUploadTool = YouTubeUploadTool;
|
|
71
|
+
//# sourceMappingURL=upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/tools/upload.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;;;;AAKH,kDAA0B;AAC1B,gDAAwB;AAExB,MAAa,iBAAiB;IA+B5B,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QA9BpC,OAAE,GAAG,eAAe,CAAC;QACrB,SAAI,GAAG,eAAe,CAAC;QACvB,gBAAW,GAAG,cAAc,CAAC;QAC7B,gBAAW,GAAG,gFAAgF,CAAC;QAC/F,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC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;gBACX,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAC,CAAC;YAEH,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;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;AAtED,8CAsEC"}
|
package/manifest.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
|
+
"id": "com.framers.channels.youtube",
|
|
4
|
+
"name": "YouTube Channel Extension",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "YouTube integration — upload videos, publish Shorts, comment on videos, search content, discover trending, track analytics, manage playlists, and schedule publishing via YouTube Data API v3.",
|
|
7
|
+
"categories": ["channel", "social"],
|
|
8
|
+
"platforms": ["youtube"],
|
|
9
|
+
"sdk": "googleapis",
|
|
10
|
+
"extensions": [
|
|
11
|
+
{ "kind": "tool", "id": "youtubeUpload", "displayName": "Upload Video" },
|
|
12
|
+
{ "kind": "tool", "id": "youtubeShort", "displayName": "Upload Short" },
|
|
13
|
+
{ "kind": "tool", "id": "youtubeComment", "displayName": "Comment on Video" },
|
|
14
|
+
{ "kind": "tool", "id": "youtubeSearch", "displayName": "Search YouTube" },
|
|
15
|
+
{ "kind": "tool", "id": "youtubeTrending", "displayName": "Get Trending" },
|
|
16
|
+
{ "kind": "tool", "id": "youtubeAnalytics", "displayName": "Video Analytics" },
|
|
17
|
+
{ "kind": "tool", "id": "youtubePlaylist", "displayName": "Manage Playlist" },
|
|
18
|
+
{ "kind": "tool", "id": "youtubeSchedule", "displayName": "Schedule Video" },
|
|
19
|
+
{ "kind": "messaging-channel", "id": "youtubeChannel", "displayName": "YouTube Channel Adapter" }
|
|
20
|
+
],
|
|
21
|
+
"requiredSecrets": ["youtube.apiKey"],
|
|
22
|
+
"optionalSecrets": ["youtube.oauth.clientId", "youtube.oauth.clientSecret", "youtube.oauth.refreshToken"],
|
|
23
|
+
"features": [
|
|
24
|
+
"Upload videos with metadata (title, description, tags, category)",
|
|
25
|
+
"Publish YouTube Shorts",
|
|
26
|
+
"Comment on videos and reply to comments",
|
|
27
|
+
"Search videos, channels, and playlists",
|
|
28
|
+
"Discover trending videos by region and category",
|
|
29
|
+
"Track channel and video analytics (views, likes, subscribers)",
|
|
30
|
+
"Create and manage playlists",
|
|
31
|
+
"Schedule video publishing with privacy status transitions",
|
|
32
|
+
"Thread-based comment replies"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@framers/agentos-ext-channel-youtube",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "YouTube channel adapter for AgentOS — upload videos, publish Shorts, comment, search, track analytics, manage playlists, and schedule via YouTube Data API v3.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"manifest.json"
|
|
10
|
+
],
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@framers/agentos": "^0.5.2"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"googleapis": "^130.0.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@framers/agentos": "^0.6.6",
|
|
19
|
+
"@types/node": "^20.0.0",
|
|
20
|
+
"typescript": "^5.0.0",
|
|
21
|
+
"vitest": "^1.0.0"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/framersai/agentos-extensions",
|
|
29
|
+
"directory": "registry/curated/channels/youtube"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"dev": "tsc --watch",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:watch": "vitest watch",
|
|
36
|
+
"clean": "rm -rf dist"
|
|
37
|
+
}
|
|
38
|
+
}
|