@framers/agentos-ext-channel-lemmy 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/LemmyChannelAdapter.d.ts +50 -0
- package/dist/LemmyChannelAdapter.d.ts.map +1 -0
- package/dist/LemmyChannelAdapter.js +82 -0
- package/dist/LemmyChannelAdapter.js.map +1 -0
- package/dist/LemmyService.d.ts +66 -0
- package/dist/LemmyService.d.ts.map +1 -0
- package/dist/LemmyService.js +253 -0
- package/dist/LemmyService.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +93 -0
- package/dist/index.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 +36 -0
- package/dist/tools/comment.js.map +1 -0
- package/dist/tools/feed.d.ts +42 -0
- package/dist/tools/feed.d.ts.map +1 -0
- package/dist/tools/feed.js +36 -0
- package/dist/tools/feed.js.map +1 -0
- package/dist/tools/post.d.ts +45 -0
- package/dist/tools/post.d.ts.map +1 -0
- package/dist/tools/post.js +37 -0
- package/dist/tools/post.js.map +1 -0
- package/dist/tools/search.d.ts +41 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +36 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/subscribe.d.ts +34 -0
- package/dist/tools/subscribe.d.ts.map +1 -0
- package/dist/tools/subscribe.js +35 -0
- package/dist/tools/subscribe.js.map +1 -0
- package/dist/tools/vote.d.ts +41 -0
- package/dist/tools/vote.d.ts.map +1 -0
- package/dist/tools/vote.js +36 -0
- package/dist/tools/vote.js.map +1 -0
- package/manifest.json +29 -0
- package/package.json +35 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Lemmy Channel Extension for AgentOS.
|
|
5
|
+
*
|
|
6
|
+
* Provides a full IChannelAdapter + 6 tools for autonomous Lemmy interaction
|
|
7
|
+
* via the Lemmy HTTP API v3.
|
|
8
|
+
*
|
|
9
|
+
* @module @framers/agentos-ext-channel-lemmy
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LemmyFeedTool = exports.LemmySubscribeTool = exports.LemmySearchTool = exports.LemmyVoteTool = exports.LemmyCommentTool = exports.LemmyPostTool = exports.LemmyChannelAdapter = exports.LemmyService = void 0;
|
|
13
|
+
exports.createExtensionPack = createExtensionPack;
|
|
14
|
+
const LemmyService_js_1 = require("./LemmyService.js");
|
|
15
|
+
const LemmyChannelAdapter_js_1 = require("./LemmyChannelAdapter.js");
|
|
16
|
+
const post_js_1 = require("./tools/post.js");
|
|
17
|
+
const comment_js_1 = require("./tools/comment.js");
|
|
18
|
+
const vote_js_1 = require("./tools/vote.js");
|
|
19
|
+
const search_js_1 = require("./tools/search.js");
|
|
20
|
+
const subscribe_js_1 = require("./tools/subscribe.js");
|
|
21
|
+
const feed_js_1 = require("./tools/feed.js");
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Secret Resolution
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
function resolveConfig(opts, secrets) {
|
|
26
|
+
return {
|
|
27
|
+
instanceUrl: opts.instanceUrl ?? secrets['lemmy.instanceUrl']
|
|
28
|
+
?? process.env.LEMMY_INSTANCE_URL ?? '',
|
|
29
|
+
username: opts.username ?? secrets['lemmy.username']
|
|
30
|
+
?? process.env.LEMMY_USERNAME ?? '',
|
|
31
|
+
password: opts.password ?? secrets['lemmy.password']
|
|
32
|
+
?? process.env.LEMMY_PASSWORD ?? '',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Factory
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
function createExtensionPack(context) {
|
|
39
|
+
const opts = (context.options ?? {});
|
|
40
|
+
const secrets = opts.secrets ?? context.secrets ?? {};
|
|
41
|
+
const config = resolveConfig(opts, secrets);
|
|
42
|
+
const service = new LemmyService_js_1.LemmyService(config);
|
|
43
|
+
const adapter = new LemmyChannelAdapter_js_1.LemmyChannelAdapter(service);
|
|
44
|
+
const postTool = new post_js_1.LemmyPostTool(service);
|
|
45
|
+
const commentTool = new comment_js_1.LemmyCommentTool(service);
|
|
46
|
+
const voteTool = new vote_js_1.LemmyVoteTool(service);
|
|
47
|
+
const searchTool = new search_js_1.LemmySearchTool(service);
|
|
48
|
+
const subscribeTool = new subscribe_js_1.LemmySubscribeTool(service);
|
|
49
|
+
const feedTool = new feed_js_1.LemmyFeedTool(service);
|
|
50
|
+
return {
|
|
51
|
+
name: '@framers/agentos-ext-channel-lemmy',
|
|
52
|
+
version: '0.1.0',
|
|
53
|
+
descriptors: [
|
|
54
|
+
{ id: 'lemmyPost', kind: 'tool', priority: 50, payload: postTool },
|
|
55
|
+
{ id: 'lemmyComment', kind: 'tool', priority: 50, payload: commentTool },
|
|
56
|
+
{ id: 'lemmyVote', kind: 'tool', priority: 50, payload: voteTool },
|
|
57
|
+
{ id: 'lemmySearch', kind: 'tool', priority: 50, payload: searchTool },
|
|
58
|
+
{ id: 'lemmySubscribe', kind: 'tool', priority: 50, payload: subscribeTool },
|
|
59
|
+
{ id: 'lemmyFeed', kind: 'tool', priority: 50, payload: feedTool },
|
|
60
|
+
{ id: 'lemmyChannel', kind: 'messaging-channel', priority: 50, payload: adapter },
|
|
61
|
+
],
|
|
62
|
+
onActivate: async () => {
|
|
63
|
+
await service.initialize();
|
|
64
|
+
const credential = config.instanceUrl || '';
|
|
65
|
+
if (credential) {
|
|
66
|
+
await adapter.initialize({ platform: 'lemmy', credential });
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
onDeactivate: async () => {
|
|
70
|
+
await adapter.shutdown();
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// Public exports
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
var LemmyService_js_2 = require("./LemmyService.js");
|
|
78
|
+
Object.defineProperty(exports, "LemmyService", { enumerable: true, get: function () { return LemmyService_js_2.LemmyService; } });
|
|
79
|
+
var LemmyChannelAdapter_js_2 = require("./LemmyChannelAdapter.js");
|
|
80
|
+
Object.defineProperty(exports, "LemmyChannelAdapter", { enumerable: true, get: function () { return LemmyChannelAdapter_js_2.LemmyChannelAdapter; } });
|
|
81
|
+
var post_js_2 = require("./tools/post.js");
|
|
82
|
+
Object.defineProperty(exports, "LemmyPostTool", { enumerable: true, get: function () { return post_js_2.LemmyPostTool; } });
|
|
83
|
+
var comment_js_2 = require("./tools/comment.js");
|
|
84
|
+
Object.defineProperty(exports, "LemmyCommentTool", { enumerable: true, get: function () { return comment_js_2.LemmyCommentTool; } });
|
|
85
|
+
var vote_js_2 = require("./tools/vote.js");
|
|
86
|
+
Object.defineProperty(exports, "LemmyVoteTool", { enumerable: true, get: function () { return vote_js_2.LemmyVoteTool; } });
|
|
87
|
+
var search_js_2 = require("./tools/search.js");
|
|
88
|
+
Object.defineProperty(exports, "LemmySearchTool", { enumerable: true, get: function () { return search_js_2.LemmySearchTool; } });
|
|
89
|
+
var subscribe_js_2 = require("./tools/subscribe.js");
|
|
90
|
+
Object.defineProperty(exports, "LemmySubscribeTool", { enumerable: true, get: function () { return subscribe_js_2.LemmySubscribeTool; } });
|
|
91
|
+
var feed_js_2 = require("./tools/feed.js");
|
|
92
|
+
Object.defineProperty(exports, "LemmyFeedTool", { enumerable: true, get: function () { return feed_js_2.LemmyFeedTool; } });
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;;;;;;GAOG;;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MAAM,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC;QACD,YAAY,EAAE,KAAK,IAAI,EAAE;YACvB,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AAErB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,2CAAgD;AAAvC,wGAAA,aAAa,OAAA;AACtB,iDAAsD;AAA7C,8GAAA,gBAAgB,OAAA;AACzB,2CAAgD;AAAvC,wGAAA,aAAa,OAAA;AACtB,+CAAoD;AAA3C,4GAAA,eAAe,OAAA;AACxB,qDAA0D;AAAjD,kHAAA,kBAAkB,OAAA;AAC3B,2CAAgD;AAAvC,wGAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { LemmyService } from '../LemmyService.js';
|
|
2
|
+
export declare class LemmyCommentTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "lemmyComment";
|
|
5
|
+
readonly name = "lemmyComment";
|
|
6
|
+
readonly displayName = "Create Comment";
|
|
7
|
+
readonly description = "Create a comment on a Lemmy post, optionally as a reply to another 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
|
+
content: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
parentId: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
constructor(service: LemmyService);
|
|
30
|
+
execute(args: {
|
|
31
|
+
postId: number;
|
|
32
|
+
content: string;
|
|
33
|
+
parentId?: number;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
success: boolean;
|
|
36
|
+
data?: any;
|
|
37
|
+
error?: string;
|
|
38
|
+
}>;
|
|
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,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,gBAAgB;IAmBf,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,kBAAkB;IAC7B,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,oBAAoB;IACxC,QAAQ,CAAC,WAAW,iFAAiF;IACrG,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,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;CAQvI"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LemmyCommentTool = void 0;
|
|
4
|
+
class LemmyCommentTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'lemmyComment';
|
|
7
|
+
name = 'lemmyComment';
|
|
8
|
+
displayName = 'Create Comment';
|
|
9
|
+
description = 'Create a comment on a Lemmy post, optionally as a reply to another comment.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = true;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
postId: { type: 'number', description: 'ID of the post to comment on' },
|
|
17
|
+
content: { type: 'string', description: 'Comment text (Markdown supported)' },
|
|
18
|
+
parentId: { type: 'number', description: 'ID of parent comment for threaded replies' },
|
|
19
|
+
},
|
|
20
|
+
required: ['postId', 'content'],
|
|
21
|
+
};
|
|
22
|
+
constructor(service) {
|
|
23
|
+
this.service = service;
|
|
24
|
+
}
|
|
25
|
+
async execute(args) {
|
|
26
|
+
try {
|
|
27
|
+
const result = await this.service.createComment(args.postId, args.content, args.parentId);
|
|
28
|
+
return { success: true, data: result };
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return { success: false, error: err.message };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.LemmyCommentTool = LemmyCommentTool;
|
|
36
|
+
//# sourceMappingURL=comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/tools/comment.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAmBP;IAlBX,EAAE,GAAG,cAAc,CAAC;IACpB,IAAI,GAAG,cAAc,CAAC;IACtB,WAAW,GAAG,gBAAgB,CAAC;IAC/B,WAAW,GAAG,6EAA6E,CAAC;IAC5F,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,8BAA8B,EAAE;YACvE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE;YAC7E,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE;SACvF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;KAChC,CAAC;IAEF,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAE7C,KAAK,CAAC,OAAO,CAAC,IAA4D;QACxE,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1F,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,42 @@
|
|
|
1
|
+
import type { LemmyService } from '../LemmyService.js';
|
|
2
|
+
export declare class LemmyFeedTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "lemmyFeed";
|
|
5
|
+
readonly name = "lemmyFeed";
|
|
6
|
+
readonly displayName = "Get Feed";
|
|
7
|
+
readonly description = "Get Lemmy feed posts by type and sort order.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = false;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
type: {
|
|
15
|
+
type: string;
|
|
16
|
+
enum: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
sort: {
|
|
20
|
+
type: string;
|
|
21
|
+
enum: string[];
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
limit: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
required: never[];
|
|
30
|
+
};
|
|
31
|
+
constructor(service: LemmyService);
|
|
32
|
+
execute(args: {
|
|
33
|
+
type?: 'All' | 'Local' | 'Subscribed';
|
|
34
|
+
sort?: 'Hot' | 'New' | 'Top';
|
|
35
|
+
limit?: number;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
success: boolean;
|
|
38
|
+
data?: any;
|
|
39
|
+
error?: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=feed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../../src/tools/feed.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,aAAa;IAmBZ,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,eAAe;IAC1B,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,WAAW,cAAc;IAClC,QAAQ,CAAC,WAAW,kDAAkD;IACtE,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,YAAY,CAAC;QAAC,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,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;CAQxK"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LemmyFeedTool = void 0;
|
|
4
|
+
class LemmyFeedTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'lemmyFeed';
|
|
7
|
+
name = 'lemmyFeed';
|
|
8
|
+
displayName = 'Get Feed';
|
|
9
|
+
description = 'Get Lemmy feed posts by type and sort order.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = false;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
type: { type: 'string', enum: ['All', 'Local', 'Subscribed'], description: 'Feed type (default "All")' },
|
|
17
|
+
sort: { type: 'string', enum: ['Hot', 'New', 'Top'], description: 'Sort order (default "Hot")' },
|
|
18
|
+
limit: { type: 'number', description: 'Max posts to return (default 20)' },
|
|
19
|
+
},
|
|
20
|
+
required: [],
|
|
21
|
+
};
|
|
22
|
+
constructor(service) {
|
|
23
|
+
this.service = service;
|
|
24
|
+
}
|
|
25
|
+
async execute(args) {
|
|
26
|
+
try {
|
|
27
|
+
const results = await this.service.getFeed(args.type, args.sort, args.limit);
|
|
28
|
+
return { success: true, data: results };
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return { success: false, error: err.message };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.LemmyFeedTool = LemmyFeedTool;
|
|
36
|
+
//# sourceMappingURL=feed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feed.js","sourceRoot":"","sources":["../../src/tools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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { LemmyService } from '../LemmyService.js';
|
|
2
|
+
export declare class LemmyPostTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "lemmyPost";
|
|
5
|
+
readonly name = "lemmyPost";
|
|
6
|
+
readonly displayName = "Create Post";
|
|
7
|
+
readonly description = "Create a new post in a Lemmy community.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
communityId: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
name: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
body: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
url: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
required: string[];
|
|
32
|
+
};
|
|
33
|
+
constructor(service: LemmyService);
|
|
34
|
+
execute(args: {
|
|
35
|
+
communityId: number;
|
|
36
|
+
name: string;
|
|
37
|
+
body?: string;
|
|
38
|
+
url?: string;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
success: boolean;
|
|
41
|
+
data?: any;
|
|
42
|
+
error?: string;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
//# 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,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,aAAa;IAoBZ,OAAO,CAAC,OAAO;IAnB3B,QAAQ,CAAC,EAAE,eAAe;IAC1B,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,WAAW,iBAAiB;IACrC,QAAQ,CAAC,WAAW,6CAA6C;IACjE,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;MASlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,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;CAQnJ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LemmyPostTool = void 0;
|
|
4
|
+
class LemmyPostTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'lemmyPost';
|
|
7
|
+
name = 'lemmyPost';
|
|
8
|
+
displayName = 'Create Post';
|
|
9
|
+
description = 'Create a new post in a Lemmy community.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = true;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
communityId: { type: 'number', description: 'ID of the community to post in' },
|
|
17
|
+
name: { type: 'string', description: 'Post title' },
|
|
18
|
+
body: { type: 'string', description: 'Post body text (Markdown supported)' },
|
|
19
|
+
url: { type: 'string', description: 'Optional URL to link' },
|
|
20
|
+
},
|
|
21
|
+
required: ['communityId', 'name'],
|
|
22
|
+
};
|
|
23
|
+
constructor(service) {
|
|
24
|
+
this.service = service;
|
|
25
|
+
}
|
|
26
|
+
async execute(args) {
|
|
27
|
+
try {
|
|
28
|
+
const result = await this.service.createPost(args.communityId, args.name, args.body, args.url);
|
|
29
|
+
return { success: true, data: result };
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
return { success: false, error: err.message };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.LemmyPostTool = LemmyPostTool;
|
|
37
|
+
//# sourceMappingURL=post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../src/tools/post.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IAoBJ;IAnBX,EAAE,GAAG,WAAW,CAAC;IACjB,IAAI,GAAG,WAAW,CAAC;IACnB,WAAW,GAAG,aAAa,CAAC;IAC5B,WAAW,GAAG,yCAAyC,CAAC;IACxD,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,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;YAC9E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE;YACnD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;YAC5E,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;SAC7D;QACD,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC;KAClC,CAAC;IAEF,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAE7C,KAAK,CAAC,OAAO,CAAC,IAAwE;QACpF,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/F,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;AA9BD,sCA8BC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { LemmyService } from '../LemmyService.js';
|
|
2
|
+
export declare class LemmySearchTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "lemmySearch";
|
|
5
|
+
readonly name = "lemmySearch";
|
|
6
|
+
readonly displayName = "Search";
|
|
7
|
+
readonly description = "Search Lemmy for posts, comments, and communities matching a query.";
|
|
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
|
+
type: {
|
|
19
|
+
type: string;
|
|
20
|
+
enum: string[];
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
limit: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
required: string[];
|
|
29
|
+
};
|
|
30
|
+
constructor(service: LemmyService);
|
|
31
|
+
execute(args: {
|
|
32
|
+
query: string;
|
|
33
|
+
type?: 'All' | 'Posts' | 'Comments' | 'Communities';
|
|
34
|
+
limit?: number;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
data?: any;
|
|
38
|
+
error?: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,eAAe;IAmBd,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,iBAAiB;IAC5B,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,YAAY;IAChC,QAAQ,CAAC,WAAW,yEAAyE;IAC7F,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,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;CAQvK"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LemmySearchTool = void 0;
|
|
4
|
+
class LemmySearchTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'lemmySearch';
|
|
7
|
+
name = 'lemmySearch';
|
|
8
|
+
displayName = 'Search';
|
|
9
|
+
description = 'Search Lemmy for posts, comments, and communities matching a query.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = false;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
query: { type: 'string', description: 'Search query' },
|
|
17
|
+
type: { type: 'string', enum: ['All', 'Posts', 'Comments', 'Communities'], description: 'Type of content to search (default "All")' },
|
|
18
|
+
limit: { type: 'number', description: 'Max results to return (default 10)' },
|
|
19
|
+
},
|
|
20
|
+
required: ['query'],
|
|
21
|
+
};
|
|
22
|
+
constructor(service) {
|
|
23
|
+
this.service = service;
|
|
24
|
+
}
|
|
25
|
+
async execute(args) {
|
|
26
|
+
try {
|
|
27
|
+
const results = await this.service.search(args.query, args.type, args.limit);
|
|
28
|
+
return { success: true, data: results };
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return { success: false, error: err.message };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.LemmySearchTool = LemmySearchTool;
|
|
36
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":";;;AAGA,MAAa,eAAe;IAmBN;IAlBX,EAAE,GAAG,aAAa,CAAC;IACnB,IAAI,GAAG,aAAa,CAAC;IACrB,WAAW,GAAG,QAAQ,CAAC;IACvB,WAAW,GAAG,qEAAqE,CAAC;IACpF,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,cAAc,EAAE;YACtD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE;YACrI,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;SAC7E;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB,CAAC;IAEF,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAE7C,KAAK,CAAC,OAAO,CAAC,IAA4F;QACxG,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7E,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;AA7BD,0CA6BC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LemmyService } from '../LemmyService.js';
|
|
2
|
+
export declare class LemmySubscribeTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "lemmySubscribe";
|
|
5
|
+
readonly name = "lemmySubscribe";
|
|
6
|
+
readonly displayName = "Subscribe to Community";
|
|
7
|
+
readonly description = "Subscribe to or unsubscribe from a Lemmy community.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
communityId: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
follow: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
required: string[];
|
|
24
|
+
};
|
|
25
|
+
constructor(service: LemmyService);
|
|
26
|
+
execute(args: {
|
|
27
|
+
communityId: number;
|
|
28
|
+
follow?: boolean;
|
|
29
|
+
}): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
error?: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=subscribe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["../../src/tools/subscribe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,kBAAkB;IAkBjB,OAAO,CAAC,OAAO;IAjB3B,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,4BAA4B;IAChD,QAAQ,CAAC,WAAW,yDAAyD;IAC7E,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;MAOlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAAE,WAAW,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;CAQ9G"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LemmySubscribeTool = void 0;
|
|
4
|
+
class LemmySubscribeTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'lemmySubscribe';
|
|
7
|
+
name = 'lemmySubscribe';
|
|
8
|
+
displayName = 'Subscribe to Community';
|
|
9
|
+
description = 'Subscribe to or unsubscribe from a Lemmy community.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = true;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
communityId: { type: 'number', description: 'ID of the community' },
|
|
17
|
+
follow: { type: 'boolean', description: 'true to subscribe, false to unsubscribe (default true)' },
|
|
18
|
+
},
|
|
19
|
+
required: ['communityId'],
|
|
20
|
+
};
|
|
21
|
+
constructor(service) {
|
|
22
|
+
this.service = service;
|
|
23
|
+
}
|
|
24
|
+
async execute(args) {
|
|
25
|
+
try {
|
|
26
|
+
await this.service.subscribeToCommunity(args.communityId, args.follow ?? true);
|
|
27
|
+
return { success: true };
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
return { success: false, error: err.message };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.LemmySubscribeTool = LemmySubscribeTool;
|
|
35
|
+
//# sourceMappingURL=subscribe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.js","sourceRoot":"","sources":["../../src/tools/subscribe.ts"],"names":[],"mappings":";;;AAGA,MAAa,kBAAkB;IAkBT;IAjBX,EAAE,GAAG,gBAAgB,CAAC;IACtB,IAAI,GAAG,gBAAgB,CAAC;IACxB,WAAW,GAAG,wBAAwB,CAAC;IACvC,WAAW,GAAG,qDAAqD,CAAC;IACpE,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,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;YACnE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,wDAAwD,EAAE;SACnG;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B,CAAC;IAEF,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAE7C,KAAK,CAAC,OAAO,CAAC,IAA+C;QAC3D,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;YAC/E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,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,gDA4BC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { LemmyService } from '../LemmyService.js';
|
|
2
|
+
export declare class LemmyVoteTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "lemmyVote";
|
|
5
|
+
readonly name = "lemmyVote";
|
|
6
|
+
readonly displayName = "Vote";
|
|
7
|
+
readonly description = "Upvote, downvote, or reset vote on a Lemmy post or comment.";
|
|
8
|
+
readonly category = "social";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
type: {
|
|
15
|
+
type: string;
|
|
16
|
+
enum: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
id: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
score: {
|
|
24
|
+
type: string;
|
|
25
|
+
enum: number[];
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
required: string[];
|
|
30
|
+
};
|
|
31
|
+
constructor(service: LemmyService);
|
|
32
|
+
execute(args: {
|
|
33
|
+
type: 'post' | 'comment';
|
|
34
|
+
id: number;
|
|
35
|
+
score: 1 | 0 | -1;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
success: boolean;
|
|
38
|
+
error?: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=vote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../src/tools/vote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,aAAa;IAmBZ,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,eAAe;IAC1B,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,WAAW,UAAU;IAC9B,QAAQ,CAAC,WAAW,iEAAiE;IACrF,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQhI"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LemmyVoteTool = void 0;
|
|
4
|
+
class LemmyVoteTool {
|
|
5
|
+
service;
|
|
6
|
+
id = 'lemmyVote';
|
|
7
|
+
name = 'lemmyVote';
|
|
8
|
+
displayName = 'Vote';
|
|
9
|
+
description = 'Upvote, downvote, or reset vote on a Lemmy post or comment.';
|
|
10
|
+
category = 'social';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
hasSideEffects = true;
|
|
13
|
+
inputSchema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
type: { type: 'string', enum: ['post', 'comment'], description: 'Whether to vote on a post or comment' },
|
|
17
|
+
id: { type: 'number', description: 'ID of the post or comment' },
|
|
18
|
+
score: { type: 'number', enum: [1, 0, -1], description: '1 = upvote, -1 = downvote, 0 = reset vote' },
|
|
19
|
+
},
|
|
20
|
+
required: ['type', 'id', 'score'],
|
|
21
|
+
};
|
|
22
|
+
constructor(service) {
|
|
23
|
+
this.service = service;
|
|
24
|
+
}
|
|
25
|
+
async execute(args) {
|
|
26
|
+
try {
|
|
27
|
+
await this.service.vote(args.type, args.id, args.score);
|
|
28
|
+
return { success: true };
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return { success: false, error: err.message };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.LemmyVoteTool = LemmyVoteTool;
|
|
36
|
+
//# sourceMappingURL=vote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vote.js","sourceRoot":"","sources":["../../src/tools/vote.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IAmBJ;IAlBX,EAAE,GAAG,WAAW,CAAC;IACjB,IAAI,GAAG,WAAW,CAAC;IACnB,WAAW,GAAG,MAAM,CAAC;IACrB,WAAW,GAAG,6DAA6D,CAAC;IAC5E,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,IAAI,EAAE,EAA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