@framers/agentos-ext-channel-threads 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/ThreadsChannelAdapter.d.ts +50 -0
- package/dist/ThreadsChannelAdapter.d.ts.map +1 -0
- package/dist/ThreadsChannelAdapter.js +90 -0
- package/dist/ThreadsChannelAdapter.js.map +1 -0
- package/dist/ThreadsService.d.ts +66 -0
- package/dist/ThreadsService.d.ts.map +1 -0
- package/dist/ThreadsService.js +281 -0
- package/dist/ThreadsService.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +103 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/analytics.d.ts +30 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +34 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/like.d.ts +35 -0
- package/dist/tools/like.d.ts.map +1 -0
- package/dist/tools/like.js +40 -0
- package/dist/tools/like.js.map +1 -0
- package/dist/tools/post.d.ts +60 -0
- package/dist/tools/post.d.ts.map +1 -0
- package/dist/tools/post.js +60 -0
- package/dist/tools/post.js.map +1 -0
- package/dist/tools/quote.d.ts +35 -0
- package/dist/tools/quote.d.ts.map +1 -0
- package/dist/tools/quote.js +35 -0
- package/dist/tools/quote.js.map +1 -0
- package/dist/tools/reply.d.ts +40 -0
- package/dist/tools/reply.d.ts.map +1 -0
- package/dist/tools/reply.js +36 -0
- package/dist/tools/reply.js.map +1 -0
- package/dist/tools/search.d.ts +35 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +40 -0
- package/dist/tools/search.js.map +1 -0
- package/manifest.json +33 -0
- package/package.json +35 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,qBAAa,iBAAiB;IAkBhB,OAAO,CAAC,OAAO;IAjB3B,QAAQ,CAAC,EAAE,mBAAmB;IAC9B,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,yBAAyB;IAC7C,QAAQ,CAAC,WAAW,6IAAwI;IAC5J,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;MAOlB;gBAEkB,OAAO,EAAE,cAAc;IAErC,OAAO,CAAC,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAenH"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadsSearchTool = void 0;
|
|
4
|
+
class ThreadsSearchTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'threadsSearch';
|
|
7
|
+
name = 'threadsSearch';
|
|
8
|
+
displayName = 'Search User Threads';
|
|
9
|
+
description = "Browse a user's recent Threads posts. Note: Threads API doesn't support full-text search — this returns the user's recent threads.";
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = false;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
query: { type: 'string', description: 'Optional filter keyword (client-side filtering on returned posts)' },
|
|
17
|
+
limit: { type: 'number', description: 'Max posts to return (default 25, max 100)' },
|
|
18
|
+
},
|
|
19
|
+
required: [],
|
|
20
|
+
};
|
|
21
|
+
constructor(service) {
|
|
22
|
+
this.service = service;
|
|
23
|
+
}
|
|
24
|
+
async execute(args) {
|
|
25
|
+
try {
|
|
26
|
+
let threads = await this.service.getUserThreads(undefined, args.limit ?? 25);
|
|
27
|
+
// Client-side filtering if query provided (Threads API has no search endpoint)
|
|
28
|
+
if (args.query) {
|
|
29
|
+
const q = args.query.toLowerCase();
|
|
30
|
+
threads = threads.filter((t) => t.text?.toLowerCase().includes(q));
|
|
31
|
+
}
|
|
32
|
+
return { success: true, data: threads };
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return { success: false, error: err.message };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ThreadsSearchTool = ThreadsSearchTool;
|
|
40
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":";;;AAGA,MAAa,iBAAiB;IAkBR;IAjBX,EAAE,GAAG,eAAe,CAAC;IACrB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAAG,qBAAqB,CAAC;IACpC,WAAW,GAAG,oIAAoI,CAAC;IACnJ,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,KAAK,CAAC;IAEvB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mEAAmE,EAAE;YAC3G,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE;SACpF;QACD,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,YAAoB,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAE/C,KAAK,CAAC,OAAO,CAAC,IAAwC;QACpD,IAAI,CAAC;YACH,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YAE7E,+EAA+E;YAC/E,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;gBACnC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACrE,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAnCD,8CAmCC"}
|
package/manifest.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
|
+
"id": "com.framers.channels.threads",
|
|
4
|
+
"name": "Threads Channel Extension",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "Bidirectional Threads integration — post text, images, videos, carousels, reply, quote, like, search user threads, and track engagement analytics via Meta Threads Publishing API.",
|
|
7
|
+
"categories": ["channel", "social"],
|
|
8
|
+
"platforms": ["threads"],
|
|
9
|
+
"sdk": "axios",
|
|
10
|
+
"extensions": [
|
|
11
|
+
{ "kind": "tool", "id": "threadsPost", "displayName": "Post to Threads" },
|
|
12
|
+
{ "kind": "tool", "id": "threadsReply", "displayName": "Reply to Thread" },
|
|
13
|
+
{ "kind": "tool", "id": "threadsLike", "displayName": "Like Thread Post" },
|
|
14
|
+
{ "kind": "tool", "id": "threadsSearch", "displayName": "Search User Threads" },
|
|
15
|
+
{ "kind": "tool", "id": "threadsAnalytics", "displayName": "Thread Post Analytics" },
|
|
16
|
+
{ "kind": "tool", "id": "threadsQuote", "displayName": "Quote Thread Post" },
|
|
17
|
+
{ "kind": "messaging-channel", "id": "threadsChannel", "displayName": "Threads Channel Adapter" }
|
|
18
|
+
],
|
|
19
|
+
"requiredSecrets": ["threads.accessToken"],
|
|
20
|
+
"optionalSecrets": ["threads.userId"],
|
|
21
|
+
"features": [
|
|
22
|
+
"Post text posts to Threads",
|
|
23
|
+
"Post image posts with captions",
|
|
24
|
+
"Post video posts with captions",
|
|
25
|
+
"Post carousel posts with multiple images/videos",
|
|
26
|
+
"Reply to existing thread posts",
|
|
27
|
+
"Like and unlike thread posts",
|
|
28
|
+
"Quote existing thread posts",
|
|
29
|
+
"Search/browse user's recent threads",
|
|
30
|
+
"Get post analytics (views, likes, replies, reposts, quotes)",
|
|
31
|
+
"Delete thread posts"
|
|
32
|
+
]
|
|
33
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@framers/agentos-ext-channel-threads",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Threads channel adapter for AgentOS — post text, images, videos, carousels, replies, quotes, likes, and analytics via Meta Threads API.",
|
|
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
|
+
"axios": "^1.7.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
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/framersai/agentos-extensions",
|
|
26
|
+
"directory": "registry/curated/channels/threads"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc",
|
|
30
|
+
"dev": "tsc --watch",
|
|
31
|
+
"test": "vitest run",
|
|
32
|
+
"test:watch": "vitest watch",
|
|
33
|
+
"clean": "rm -rf dist"
|
|
34
|
+
}
|
|
35
|
+
}
|