@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
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Threads Channel Extension for AgentOS.
|
|
3
|
+
*
|
|
4
|
+
* Provides a full IChannelAdapter + 6 tools for autonomous Threads interaction
|
|
5
|
+
* via Meta's Threads Publishing API.
|
|
6
|
+
*
|
|
7
|
+
* @module @framers/agentos-ext-channel-threads
|
|
8
|
+
*/
|
|
9
|
+
export interface ThreadsChannelOptions {
|
|
10
|
+
accessToken?: string;
|
|
11
|
+
userId?: string;
|
|
12
|
+
secrets?: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export interface ExtensionContext {
|
|
15
|
+
options?: Record<string, unknown>;
|
|
16
|
+
secrets?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export interface ExtensionPack {
|
|
19
|
+
name: string;
|
|
20
|
+
version: string;
|
|
21
|
+
descriptors: Array<{
|
|
22
|
+
id: string;
|
|
23
|
+
kind: string;
|
|
24
|
+
priority?: number;
|
|
25
|
+
payload: unknown;
|
|
26
|
+
}>;
|
|
27
|
+
onActivate?: () => Promise<void>;
|
|
28
|
+
onDeactivate?: () => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export declare function createExtensionPack(context: ExtensionContext): ExtensionPack;
|
|
31
|
+
export { ThreadsService } from './ThreadsService.js';
|
|
32
|
+
export type { ThreadsConfig, ThreadsProfile, ThreadsPostResult, ThreadsInsights, CarouselItem } from './ThreadsService.js';
|
|
33
|
+
export { ThreadsChannelAdapter } from './ThreadsChannelAdapter.js';
|
|
34
|
+
export { ThreadsPostTool } from './tools/post.js';
|
|
35
|
+
export { ThreadsReplyTool } from './tools/reply.js';
|
|
36
|
+
export { ThreadsLikeTool } from './tools/like.js';
|
|
37
|
+
export { ThreadsSearchTool } from './tools/search.js';
|
|
38
|
+
export { ThreadsAnalyticsTool } from './tools/analytics.js';
|
|
39
|
+
export { ThreadsQuoteTool } from './tools/quote.js';
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAg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AE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Threads Channel Extension for AgentOS.
|
|
5
|
+
*
|
|
6
|
+
* Provides a full IChannelAdapter + 6 tools for autonomous Threads interaction
|
|
7
|
+
* via Meta's Threads Publishing API.
|
|
8
|
+
*
|
|
9
|
+
* @module @framers/agentos-ext-channel-threads
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ThreadsQuoteTool = exports.ThreadsAnalyticsTool = exports.ThreadsSearchTool = exports.ThreadsLikeTool = exports.ThreadsReplyTool = exports.ThreadsPostTool = exports.ThreadsChannelAdapter = exports.ThreadsService = void 0;
|
|
13
|
+
exports.createExtensionPack = createExtensionPack;
|
|
14
|
+
const ThreadsService_js_1 = require("./ThreadsService.js");
|
|
15
|
+
const ThreadsChannelAdapter_js_1 = require("./ThreadsChannelAdapter.js");
|
|
16
|
+
const post_js_1 = require("./tools/post.js");
|
|
17
|
+
const reply_js_1 = require("./tools/reply.js");
|
|
18
|
+
const like_js_1 = require("./tools/like.js");
|
|
19
|
+
const search_js_1 = require("./tools/search.js");
|
|
20
|
+
const analytics_js_1 = require("./tools/analytics.js");
|
|
21
|
+
const quote_js_1 = require("./tools/quote.js");
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Secret Resolution
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
function resolveConfig(opts, secrets) {
|
|
26
|
+
return {
|
|
27
|
+
accessToken: opts.accessToken ?? secrets['threads.accessToken']
|
|
28
|
+
?? process.env.THREADS_ACCESS_TOKEN ?? process.env.META_ACCESS_TOKEN
|
|
29
|
+
?? '',
|
|
30
|
+
userId: opts.userId ?? secrets['threads.userId']
|
|
31
|
+
?? process.env.THREADS_USER_ID,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// Factory
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
function createExtensionPack(context) {
|
|
38
|
+
const opts = (context.options ?? {});
|
|
39
|
+
const secrets = opts.secrets ?? context.secrets ?? {};
|
|
40
|
+
const config = resolveConfig(opts, secrets);
|
|
41
|
+
const service = new ThreadsService_js_1.ThreadsService(config);
|
|
42
|
+
const adapter = new ThreadsChannelAdapter_js_1.ThreadsChannelAdapter(service);
|
|
43
|
+
const postTool = new post_js_1.ThreadsPostTool(service);
|
|
44
|
+
const replyTool = new reply_js_1.ThreadsReplyTool(service);
|
|
45
|
+
const likeTool = new like_js_1.ThreadsLikeTool(service);
|
|
46
|
+
const searchTool = new search_js_1.ThreadsSearchTool(service);
|
|
47
|
+
const analyticsTool = new analytics_js_1.ThreadsAnalyticsTool(service);
|
|
48
|
+
const quoteTool = new quote_js_1.ThreadsQuoteTool(service);
|
|
49
|
+
return {
|
|
50
|
+
name: '@framers/agentos-ext-channel-threads',
|
|
51
|
+
version: '0.1.0',
|
|
52
|
+
descriptors: [
|
|
53
|
+
{ id: 'threadsPost', kind: 'tool', priority: 50, payload: postTool },
|
|
54
|
+
{ id: 'threadsReply', kind: 'tool', priority: 50, payload: replyTool },
|
|
55
|
+
{ id: 'threadsLike', kind: 'tool', priority: 50, payload: likeTool },
|
|
56
|
+
{ id: 'threadsSearch', kind: 'tool', priority: 50, payload: searchTool },
|
|
57
|
+
{ id: 'threadsAnalytics', kind: 'tool', priority: 50, payload: analyticsTool },
|
|
58
|
+
{ id: 'threadsQuote', kind: 'tool', priority: 50, payload: quoteTool },
|
|
59
|
+
{ id: 'threadsChannel', kind: 'messaging-channel', priority: 50, payload: adapter },
|
|
60
|
+
],
|
|
61
|
+
onActivate: async () => {
|
|
62
|
+
// If no credentials from env/options, try OAuth 2.0 token store
|
|
63
|
+
if (!config.accessToken) {
|
|
64
|
+
try {
|
|
65
|
+
const { FileTokenStore } = await import('@framers/agentos/auth');
|
|
66
|
+
const tokens = await new FileTokenStore().load('threads');
|
|
67
|
+
if (tokens?.accessToken) {
|
|
68
|
+
config.accessToken = tokens.accessToken;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch { /* FileTokenStore not available — ignore */ }
|
|
72
|
+
}
|
|
73
|
+
await service.initialize();
|
|
74
|
+
const credential = config.accessToken || '';
|
|
75
|
+
if (credential) {
|
|
76
|
+
await adapter.initialize({ platform: 'threads', credential });
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
onDeactivate: async () => {
|
|
80
|
+
await adapter.shutdown();
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Public exports
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
var ThreadsService_js_2 = require("./ThreadsService.js");
|
|
88
|
+
Object.defineProperty(exports, "ThreadsService", { enumerable: true, get: function () { return ThreadsService_js_2.ThreadsService; } });
|
|
89
|
+
var ThreadsChannelAdapter_js_2 = require("./ThreadsChannelAdapter.js");
|
|
90
|
+
Object.defineProperty(exports, "ThreadsChannelAdapter", { enumerable: true, get: function () { return ThreadsChannelAdapter_js_2.ThreadsChannelAdapter; } });
|
|
91
|
+
var post_js_2 = require("./tools/post.js");
|
|
92
|
+
Object.defineProperty(exports, "ThreadsPostTool", { enumerable: true, get: function () { return post_js_2.ThreadsPostTool; } });
|
|
93
|
+
var reply_js_2 = require("./tools/reply.js");
|
|
94
|
+
Object.defineProperty(exports, "ThreadsReplyTool", { enumerable: true, get: function () { return reply_js_2.ThreadsReplyTool; } });
|
|
95
|
+
var like_js_2 = require("./tools/like.js");
|
|
96
|
+
Object.defineProperty(exports, "ThreadsLikeTool", { enumerable: true, get: function () { return like_js_2.ThreadsLikeTool; } });
|
|
97
|
+
var search_js_2 = require("./tools/search.js");
|
|
98
|
+
Object.defineProperty(exports, "ThreadsSearchTool", { enumerable: true, get: function () { return search_js_2.ThreadsSearchTool; } });
|
|
99
|
+
var analytics_js_2 = require("./tools/analytics.js");
|
|
100
|
+
Object.defineProperty(exports, "ThreadsAnalyticsTool", { enumerable: true, get: function () { return analytics_js_2.ThreadsAnalyticsTool; } });
|
|
101
|
+
var quote_js_2 = require("./tools/quote.js");
|
|
102
|
+
Object.defineProperty(exports, "ThreadsQuoteTool", { enumerable: true, get: function () { return quote_js_2.ThreadsQuoteTool; } });
|
|
103
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;;;;;;GAOG;;;AA2DH,kDAiDC;AA1GD,2DAAqD;AAErD,yEAAmE;AACnE,6CAAkD;AAClD,+CAAoD;AACpD,6CAAkD;AAClD,iDAAsD;AACtD,uDAA4D;AAC5D,+CAAoD;AAYpD,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,SAAS,aAAa,CAAC,IAA2B,EAAE,OAA+B;IACjF,OAAO;QACL,WAAW,EACT,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,qBAAqB,CAAC;eAC/C,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB;eACjE,EAAE;QACP,MAAM,EACJ,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;eACrC,OAAO,CAAC,GAAG,CAAC,eAAe;KACjC,CAAC;AACJ,CAAC;AAmBD,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAgB,mBAAmB,CAAC,OAAyB;IAC3D,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAA0B,CAAC;IAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,OAAO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xB,6CAAoD;AAA3C,4GAAA,gBAAgB,OAAA;AACzB,2CAAkD;AAAzC,0GAAA,eAAe,OAAA;AACxB,+CAAsD;AAA7C,8GAAA,iBAAiB,OAAA;AAC1B,qDAA4D;AAAnD,oHAAA,oBAAoB,OAAA;AAC7B,6CAAoD;AAA3C,4GAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ThreadsService } from '../ThreadsService.js';
|
|
2
|
+
export declare class ThreadsAnalyticsTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "threadsAnalytics";
|
|
5
|
+
readonly name = "threadsAnalytics";
|
|
6
|
+
readonly displayName = "Thread Post Analytics";
|
|
7
|
+
readonly description = "Get engagement metrics (views, likes, replies, reposts, quotes) for a specific Threads post.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = false;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
postId: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
required: string[];
|
|
20
|
+
};
|
|
21
|
+
constructor(service: ThreadsService);
|
|
22
|
+
execute(args: {
|
|
23
|
+
postId: string;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
success: boolean;
|
|
26
|
+
data?: any;
|
|
27
|
+
error?: string;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,qBAAa,oBAAoB;IAiBnB,OAAO,CAAC,OAAO;IAhB3B,QAAQ,CAAC,EAAE,sBAAsB;IACjC,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,WAAW,2BAA2B;IAC/C,QAAQ,CAAC,WAAW,kGAAkG;IACtH,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;MAMlB;gBAEkB,OAAO,EAAE,cAAc;IAErC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,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;CAQnG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadsAnalyticsTool = void 0;
|
|
4
|
+
class ThreadsAnalyticsTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'threadsAnalytics';
|
|
7
|
+
name = 'threadsAnalytics';
|
|
8
|
+
displayName = 'Thread Post Analytics';
|
|
9
|
+
description = 'Get engagement metrics (views, likes, replies, reposts, quotes) for a specific Threads post.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = false;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
postId: { type: 'string', description: 'ID of the Threads post to analyze' },
|
|
17
|
+
},
|
|
18
|
+
required: ['postId'],
|
|
19
|
+
};
|
|
20
|
+
constructor(service) {
|
|
21
|
+
this.service = service;
|
|
22
|
+
}
|
|
23
|
+
async execute(args) {
|
|
24
|
+
try {
|
|
25
|
+
const insights = await this.service.getPostInsights(args.postId);
|
|
26
|
+
return { success: true, data: insights };
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return { success: false, error: err.message };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ThreadsAnalyticsTool = ThreadsAnalyticsTool;
|
|
34
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":";;;AAGA,MAAa,oBAAoB;IAiBX;IAhBX,EAAE,GAAG,kBAAkB,CAAC;IACxB,IAAI,GAAG,kBAAkB,CAAC;IAC1B,WAAW,GAAG,uBAAuB,CAAC;IACtC,WAAW,GAAG,8FAA8F,CAAC;IAC7G,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,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE;SAC7E;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB,CAAC;IAEF,YAAoB,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAE/C,KAAK,CAAC,OAAO,CAAC,IAAwB;QACpC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC3C,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;AA3BD,oDA2BC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ThreadsService } from '../ThreadsService.js';
|
|
2
|
+
export declare class ThreadsLikeTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "threadsLike";
|
|
5
|
+
readonly name = "threadsLike";
|
|
6
|
+
readonly displayName = "Like Thread Post";
|
|
7
|
+
readonly description = "Like or unlike a Threads post.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
postId: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
unlike: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
required: string[];
|
|
25
|
+
};
|
|
26
|
+
constructor(service: ThreadsService);
|
|
27
|
+
execute(args: {
|
|
28
|
+
postId: string;
|
|
29
|
+
unlike?: boolean;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
success: boolean;
|
|
32
|
+
error?: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=like.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"like.d.ts","sourceRoot":"","sources":["../../src/tools/like.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,qBAAa,eAAe;IAkBd,OAAO,CAAC,OAAO;IAjB3B,QAAQ,CAAC,EAAE,iBAAiB;IAC5B,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,sBAAsB;IAC1C,QAAQ,CAAC,WAAW,oCAAoC;IACxD,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;MAOlB;gBAEkB,OAAO,EAAE,cAAc;IAErC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAYzG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadsLikeTool = void 0;
|
|
4
|
+
class ThreadsLikeTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'threadsLike';
|
|
7
|
+
name = 'threadsLike';
|
|
8
|
+
displayName = 'Like Thread Post';
|
|
9
|
+
description = 'Like or unlike a Threads post.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = true;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
postId: { type: 'string', description: 'ID of the Threads post' },
|
|
17
|
+
unlike: { type: 'boolean', description: 'Set to true to unlike', default: false },
|
|
18
|
+
},
|
|
19
|
+
required: ['postId'],
|
|
20
|
+
};
|
|
21
|
+
constructor(service) {
|
|
22
|
+
this.service = service;
|
|
23
|
+
}
|
|
24
|
+
async execute(args) {
|
|
25
|
+
try {
|
|
26
|
+
if (args.unlike) {
|
|
27
|
+
await this.service.unlikePost(args.postId);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
await this.service.likePost(args.postId);
|
|
31
|
+
}
|
|
32
|
+
return { success: true };
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return { success: false, error: err.message };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ThreadsLikeTool = ThreadsLikeTool;
|
|
40
|
+
//# sourceMappingURL=like.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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readsService, CarouselItem } from '../ThreadsService.js';
|
|
2
|
+
export declare class ThreadsPostTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "threadsPost";
|
|
5
|
+
readonly name = "threadsPost";
|
|
6
|
+
readonly displayName = "Post to Threads";
|
|
7
|
+
readonly description = "Create a post on Threads with text, optional image, video, or carousel items.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
text: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
imageUrl: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
videoUrl: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
carouselItems: {
|
|
27
|
+
type: string;
|
|
28
|
+
items: {
|
|
29
|
+
type: string;
|
|
30
|
+
properties: {
|
|
31
|
+
type: {
|
|
32
|
+
type: string;
|
|
33
|
+
enum: string[];
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
url: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
required: string[];
|
|
42
|
+
};
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
required: string[];
|
|
47
|
+
};
|
|
48
|
+
constructor(service: ThreadsService);
|
|
49
|
+
execute(args: {
|
|
50
|
+
text: string;
|
|
51
|
+
imageUrl?: string;
|
|
52
|
+
videoUrl?: string;
|
|
53
|
+
carouselItems?: CarouselItem[];
|
|
54
|
+
}): Promise<{
|
|
55
|
+
success: boolean;
|
|
56
|
+
data?: any;
|
|
57
|
+
error?: string;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/tools/post.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzE,qBAAa,eAAe;IA+Bd,OAAO,CAAC,OAAO;IA9B3B,QAAQ,CAAC,EAAE,iBAAiB;IAC5B,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,qBAAqB;IACzC,QAAQ,CAAC,WAAW,mFAAmF;IACvG,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoBlB;gBAEkB,OAAO,EAAE,cAAc;IAErC,OAAO,CAAC,IAAI,EAAE;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;KAChC,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAmB9D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadsPostTool = void 0;
|
|
4
|
+
class ThreadsPostTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'threadsPost';
|
|
7
|
+
name = 'threadsPost';
|
|
8
|
+
displayName = 'Post to Threads';
|
|
9
|
+
description = 'Create a post on Threads with text, optional image, video, or carousel items.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = true;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
text: { type: 'string', description: 'Post text (max 500 characters)' },
|
|
17
|
+
imageUrl: { type: 'string', description: 'URL of image to attach' },
|
|
18
|
+
videoUrl: { type: 'string', description: 'URL of video to attach' },
|
|
19
|
+
carouselItems: {
|
|
20
|
+
type: 'array',
|
|
21
|
+
items: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
type: { type: 'string', enum: ['IMAGE', 'VIDEO'], description: 'Media type' },
|
|
25
|
+
url: { type: 'string', description: 'Media URL' },
|
|
26
|
+
},
|
|
27
|
+
required: ['type', 'url'],
|
|
28
|
+
},
|
|
29
|
+
description: 'Carousel items (array of image/video objects)',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
required: ['text'],
|
|
33
|
+
};
|
|
34
|
+
constructor(service) {
|
|
35
|
+
this.service = service;
|
|
36
|
+
}
|
|
37
|
+
async execute(args) {
|
|
38
|
+
try {
|
|
39
|
+
let result;
|
|
40
|
+
if (args.carouselItems?.length) {
|
|
41
|
+
result = await this.service.createCarouselPost(args.text, args.carouselItems);
|
|
42
|
+
}
|
|
43
|
+
else if (args.videoUrl) {
|
|
44
|
+
result = await this.service.createVideoPost(args.text, args.videoUrl);
|
|
45
|
+
}
|
|
46
|
+
else if (args.imageUrl) {
|
|
47
|
+
result = await this.service.createImagePost(args.text, args.imageUrl);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
result = await this.service.createTextPost(args.text);
|
|
51
|
+
}
|
|
52
|
+
return { success: true, data: result };
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
return { success: false, error: err.message };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.ThreadsPostTool = ThreadsPostTool;
|
|
60
|
+
//# sourceMappingURL=post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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,MAAM,EAAE,CAAC;gBAC/B,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAChF,CAAC;iBAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACzB,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACxE,CAAC;iBAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACzB,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACxE,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxD,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,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;AAzDD,0CAyDC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ThreadsService } from '../ThreadsService.js';
|
|
2
|
+
export declare class ThreadsQuoteTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "threadsQuote";
|
|
5
|
+
readonly name = "threadsQuote";
|
|
6
|
+
readonly displayName = "Quote Thread Post";
|
|
7
|
+
readonly description = "Quote an existing Threads post with your own comment.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
postId: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
text: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
required: string[];
|
|
24
|
+
};
|
|
25
|
+
constructor(service: ThreadsService);
|
|
26
|
+
execute(args: {
|
|
27
|
+
postId: string;
|
|
28
|
+
text: string;
|
|
29
|
+
}): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
data?: any;
|
|
32
|
+
error?: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/tools/quote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,qBAAa,gBAAgB;IAkBf,OAAO,CAAC,OAAO;IAjB3B,QAAQ,CAAC,EAAE,kBAAkB;IAC7B,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,uBAAuB;IAC3C,QAAQ,CAAC,WAAW,2DAA2D;IAC/E,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;MAOlB;gBAEkB,OAAO,EAAE,cAAc;IAErC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,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;CAQjH"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadsQuoteTool = void 0;
|
|
4
|
+
class ThreadsQuoteTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'threadsQuote';
|
|
7
|
+
name = 'threadsQuote';
|
|
8
|
+
displayName = 'Quote Thread Post';
|
|
9
|
+
description = 'Quote an existing Threads post with your own comment.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = true;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
postId: { type: 'string', description: 'ID of the Threads post to quote' },
|
|
17
|
+
text: { type: 'string', description: 'Your quote comment' },
|
|
18
|
+
},
|
|
19
|
+
required: ['postId', 'text'],
|
|
20
|
+
};
|
|
21
|
+
constructor(service) {
|
|
22
|
+
this.service = service;
|
|
23
|
+
}
|
|
24
|
+
async execute(args) {
|
|
25
|
+
try {
|
|
26
|
+
const result = await this.service.quotePost(args.postId, args.text);
|
|
27
|
+
return { success: true, data: result };
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
return { success: false, error: err.message };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.ThreadsQuoteTool = ThreadsQuoteTool;
|
|
35
|
+
//# sourceMappingURL=quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../src/tools/quote.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAkBP;IAjBX,EAAE,GAAG,cAAc,CAAC;IACpB,IAAI,GAAG,cAAc,CAAC;IACtB,WAAW,GAAG,mBAAmB,CAAC;IAClC,WAAW,GAAG,uDAAuD,CAAC;IACtE,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,IAAI,CAAC;IAEtB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;YAC1E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;SAC5D;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC7B,CAAC;IAEF,YAAoB,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAE/C,KAAK,CAAC,OAAO,CAAC,IAAsC;QAClD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACpE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,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;AA5BD,4CA4BC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ThreadsService } from '../ThreadsService.js';
|
|
2
|
+
export declare class ThreadsReplyTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "threadsReply";
|
|
5
|
+
readonly name = "threadsReply";
|
|
6
|
+
readonly displayName = "Reply to Thread";
|
|
7
|
+
readonly description = "Reply to an existing Threads post with text and optional media.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
postId: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
text: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
mediaUrl: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
constructor(service: ThreadsService);
|
|
30
|
+
execute(args: {
|
|
31
|
+
postId: string;
|
|
32
|
+
text: string;
|
|
33
|
+
mediaUrl?: string;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
success: boolean;
|
|
36
|
+
data?: any;
|
|
37
|
+
error?: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=reply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../src/tools/reply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,qBAAa,gBAAgB;IAmBf,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,kBAAkB;IAC7B,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,qBAAqB;IACzC,QAAQ,CAAC,WAAW,qEAAqE;IACzF,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,cAAc;IAErC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,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;CAQpI"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadsReplyTool = void 0;
|
|
4
|
+
class ThreadsReplyTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'threadsReply';
|
|
7
|
+
name = 'threadsReply';
|
|
8
|
+
displayName = 'Reply to Thread';
|
|
9
|
+
description = 'Reply to an existing Threads post with text and optional media.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = true;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
postId: { type: 'string', description: 'ID of the Threads post to reply to' },
|
|
17
|
+
text: { type: 'string', description: 'Reply text' },
|
|
18
|
+
mediaUrl: { type: 'string', description: 'Optional image or video URL to attach' },
|
|
19
|
+
},
|
|
20
|
+
required: ['postId', 'text'],
|
|
21
|
+
};
|
|
22
|
+
constructor(service) {
|
|
23
|
+
this.service = service;
|
|
24
|
+
}
|
|
25
|
+
async execute(args) {
|
|
26
|
+
try {
|
|
27
|
+
const result = await this.service.replyToPost(args.postId, args.text, args.mediaUrl);
|
|
28
|
+
return { success: true, data: result };
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return { success: false, error: err.message };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ThreadsReplyTool = ThreadsReplyTool;
|
|
36
|
+
//# sourceMappingURL=reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.js","sourceRoot":"","sources":["../../src/tools/reply.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAmBP;IAlBX,EAAE,GAAG,cAAc,CAAC;IACpB,IAAI,GAAG,cAAc,CAAC;IACtB,WAAW,GAAG,iBAAiB,CAAC;IAChC,WAAW,GAAG,iEAAiE,CAAC;IAChF,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,IAAI,CAAC;IAEtB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;YAC7E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE;YACnD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;SACnF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC7B,CAAC;IAEF,YAAoB,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAE/C,KAAK,CAAC,OAAO,CAAC,IAAyD;QACrE,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,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;AA7BD,4CA6BC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ThreadsService } from '../ThreadsService.js';
|
|
2
|
+
export declare class ThreadsSearchTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "threadsSearch";
|
|
5
|
+
readonly name = "threadsSearch";
|
|
6
|
+
readonly displayName = "Search User Threads";
|
|
7
|
+
readonly description = "Browse a user's recent Threads posts. Note: Threads API doesn't support full-text search \u2014 this returns the user's recent threads.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = false;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
query: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
limit: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
required: never[];
|
|
24
|
+
};
|
|
25
|
+
constructor(service: ThreadsService);
|
|
26
|
+
execute(args: {
|
|
27
|
+
query?: string;
|
|
28
|
+
limit?: number;
|
|
29
|
+
}): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
data?: any;
|
|
32
|
+
error?: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=search.d.ts.map
|