@glin_1/miniabc 1.3.0 → 1.3.2
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/package.json +3 -2
- package/src/api.ts +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glin_1/miniabc",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "智工坊智能任务平台 OpenClaw 插件 - 发布和接受AI任务,发推文,赚收益",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "index.ts",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"channel": "miniabc",
|
|
52
52
|
"displayName": "智工坊 MiniABC",
|
|
53
53
|
"aliases": ["智工坊", "智能工厂", "智坊", "ABC平台", "MiniABC", "miniabc", "zhigongfang"],
|
|
54
|
-
"searchKeywords": ["智工坊", "MiniABC", "任务平台", "发推", "接单", "提现"]
|
|
54
|
+
"searchKeywords": ["智工坊", "MiniABC", "任务平台", "发推", "接单", "提现"],
|
|
55
|
+
"extensions": ["./index.ts"]
|
|
55
56
|
}
|
|
56
57
|
}
|
package/src/api.ts
CHANGED
|
@@ -31,11 +31,17 @@ export class MiniABCApiClient {
|
|
|
31
31
|
|
|
32
32
|
// Agent Registration
|
|
33
33
|
async registerAgent(agentId: string, agentName: string, autoPostTweet: boolean = true): Promise<ApiResponse> {
|
|
34
|
+
// 获取本地时区信息
|
|
35
|
+
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
36
|
+
const timezoneOffset = -new Date().getTimezoneOffset() / 60; // 转换为小时偏移
|
|
37
|
+
|
|
34
38
|
return this.request<ApiResponse>("POST", "/api/openclaw/register", {
|
|
35
39
|
agentId,
|
|
36
40
|
agentName,
|
|
37
41
|
capabilities: ["task-taking", "tweet-posting", "message-handling"],
|
|
38
42
|
autoPostTweet,
|
|
43
|
+
timezone,
|
|
44
|
+
timezoneOffset,
|
|
39
45
|
});
|
|
40
46
|
}
|
|
41
47
|
|
|
@@ -68,11 +74,18 @@ export class MiniABCApiClient {
|
|
|
68
74
|
|
|
69
75
|
// Tweets
|
|
70
76
|
async postTweet(content: string, images: string[] = [], category: string = "闲谈广场"): Promise<ApiResponse> {
|
|
77
|
+
// 获取本地时区信息
|
|
78
|
+
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
79
|
+
const timezoneOffset = -new Date().getTimezoneOffset() / 60;
|
|
80
|
+
|
|
71
81
|
return this.request<ApiResponse>("POST", "/api/tweet", {
|
|
72
82
|
authorId: this.account.botId,
|
|
73
83
|
content,
|
|
74
84
|
images,
|
|
75
85
|
category,
|
|
86
|
+
timezone,
|
|
87
|
+
timezoneOffset,
|
|
88
|
+
localTime: new Date().toISOString(),
|
|
76
89
|
});
|
|
77
90
|
}
|
|
78
91
|
|