@zhin.js/adapter-slack 1.1.15 → 1.1.16
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/CHANGELOG.md +27 -0
- package/agents/slack/messages.js +52 -0
- package/agents/slack/messages.ts +52 -0
- package/agents/slack/skills/slack-channels/tools/archive_channel/index.js +2 -1
- package/agents/slack/skills/slack-channels/tools/archive_channel/index.ts +2 -1
- package/agents/slack/skills/slack-channels/tools/invite_to_channel/index.js +2 -1
- package/agents/slack/skills/slack-channels/tools/invite_to_channel/index.ts +2 -1
- package/agents/slack/skills/slack-channels/tools/set_purpose/index.js +2 -1
- package/agents/slack/skills/slack-channels/tools/set_purpose/index.ts +2 -1
- package/agents/slack/skills/slack-channels/tools/set_topic/index.js +2 -1
- package/agents/slack/skills/slack-channels/tools/set_topic/index.ts +2 -1
- package/agents/slack/skills/slack-channels/tools/unarchive/index.js +2 -1
- package/agents/slack/skills/slack-channels/tools/unarchive/index.ts +2 -1
- package/agents/slack/skills/slack-messages/tools/add_reaction/index.js +2 -1
- package/agents/slack/skills/slack-messages/tools/add_reaction/index.ts +2 -1
- package/agents/slack/skills/slack-messages/tools/edit_message/index.js +2 -1
- package/agents/slack/skills/slack-messages/tools/edit_message/index.ts +2 -1
- package/agents/slack/skills/slack-messages/tools/pin_message/index.js +2 -1
- package/agents/slack/skills/slack-messages/tools/pin_message/index.ts +2 -1
- package/agents/slack/skills/slack-messages/tools/remove_reaction/index.js +2 -1
- package/agents/slack/skills/slack-messages/tools/remove_reaction/index.ts +2 -1
- package/agents/slack/skills/slack-messages/tools/unpin_message/index.js +2 -1
- package/agents/slack/skills/slack-messages/tools/unpin_message/index.ts +2 -1
- package/agents/slack/skills/slack-users/tools/user_info/index.js +2 -1
- package/agents/slack/skills/slack-users/tools/user_info/index.ts +2 -1
- package/commands/slack/endpoint/definition.js +1 -1
- package/commands/slack/endpoint/definition.ts +1 -1
- package/package.json +16 -16
- package/schema.json +47 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 53bc6a0: 适配器配置标签、端点命令和工具反馈支持中英文;复用当前操作语言,保持协议值、用户内容、身份、权限与发送链路不变。Sandbox 展示使用项目语言,QQ 绑定与交互状态保留完整会话身份。
|
|
8
|
+
- Updated dependencies [334e92d]
|
|
9
|
+
- Updated dependencies [f3b7c9f]
|
|
10
|
+
- Updated dependencies [658a5fb]
|
|
11
|
+
- Updated dependencies [144a17b]
|
|
12
|
+
- Updated dependencies [18296cf]
|
|
13
|
+
- Updated dependencies [08e64de]
|
|
14
|
+
- Updated dependencies [9cade30]
|
|
15
|
+
- Updated dependencies [53bc6a0]
|
|
16
|
+
- Updated dependencies [7595136]
|
|
17
|
+
- Updated dependencies [66b6404]
|
|
18
|
+
- Updated dependencies [adb4af2]
|
|
19
|
+
- Updated dependencies [69f9ef6]
|
|
20
|
+
- Updated dependencies [17d1301]
|
|
21
|
+
- @zhin.js/adapter@1.1.23
|
|
22
|
+
- @zhin.js/host-http@1.1.10
|
|
23
|
+
- @zhin.js/core@1.1.51
|
|
24
|
+
- @zhin.js/tool@1.1.10
|
|
25
|
+
- @zhin.js/skill@1.1.10
|
|
26
|
+
- @zhin.js/im-contract@1.1.7
|
|
27
|
+
- @zhin.js/agent-feature@1.1.10
|
|
28
|
+
- @zhin.js/feature-kit@1.1.9
|
|
29
|
+
|
|
3
30
|
## 1.1.15
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
3
|
+
export const messages = createMessages({
|
|
4
|
+
"operationFailed": {
|
|
5
|
+
"zh-CN": "操作失败",
|
|
6
|
+
"en": "Operation failed"
|
|
7
|
+
},
|
|
8
|
+
"channelArchived": {
|
|
9
|
+
"zh-CN": "已归档频道",
|
|
10
|
+
"en": "Channel archived"
|
|
11
|
+
},
|
|
12
|
+
"channelInvited": {
|
|
13
|
+
"zh-CN": "已邀请用户加入频道",
|
|
14
|
+
"en": "Users invited to the channel"
|
|
15
|
+
},
|
|
16
|
+
"purposeUpdated": {
|
|
17
|
+
"zh-CN": "频道用途已更新",
|
|
18
|
+
"en": "Channel purpose updated"
|
|
19
|
+
},
|
|
20
|
+
"topicUpdated": {
|
|
21
|
+
"zh-CN": "已设置频道话题",
|
|
22
|
+
"en": "Channel topic updated"
|
|
23
|
+
},
|
|
24
|
+
"channelRestored": {
|
|
25
|
+
"zh-CN": "频道已恢复",
|
|
26
|
+
"en": "Channel restored"
|
|
27
|
+
},
|
|
28
|
+
"slackReactionAdded": {
|
|
29
|
+
"zh-CN": "已添加反应 :{p0}:",
|
|
30
|
+
"en": "Reaction added: :{p0}:"
|
|
31
|
+
},
|
|
32
|
+
"messageEdited": {
|
|
33
|
+
"zh-CN": "消息已编辑",
|
|
34
|
+
"en": "Message edited"
|
|
35
|
+
},
|
|
36
|
+
"messagePinned": {
|
|
37
|
+
"zh-CN": "已置顶消息",
|
|
38
|
+
"en": "Message pinned"
|
|
39
|
+
},
|
|
40
|
+
"slackReactionRemoved": {
|
|
41
|
+
"zh-CN": "已移除反应 :{p0}:",
|
|
42
|
+
"en": "Reaction removed: :{p0}:"
|
|
43
|
+
},
|
|
44
|
+
"messageUnpinned": {
|
|
45
|
+
"zh-CN": "已取消置顶",
|
|
46
|
+
"en": "Message unpinned"
|
|
47
|
+
},
|
|
48
|
+
"slackUserMissing": {
|
|
49
|
+
"zh-CN": "Slack 用户不存在: {p0}",
|
|
50
|
+
"en": "Slack user does not exist: {p0}"
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
2
|
+
|
|
3
|
+
export const messages = createMessages({
|
|
4
|
+
"operationFailed": {
|
|
5
|
+
"zh-CN": "操作失败",
|
|
6
|
+
"en": "Operation failed"
|
|
7
|
+
},
|
|
8
|
+
"channelArchived": {
|
|
9
|
+
"zh-CN": "已归档频道",
|
|
10
|
+
"en": "Channel archived"
|
|
11
|
+
},
|
|
12
|
+
"channelInvited": {
|
|
13
|
+
"zh-CN": "已邀请用户加入频道",
|
|
14
|
+
"en": "Users invited to the channel"
|
|
15
|
+
},
|
|
16
|
+
"purposeUpdated": {
|
|
17
|
+
"zh-CN": "频道用途已更新",
|
|
18
|
+
"en": "Channel purpose updated"
|
|
19
|
+
},
|
|
20
|
+
"topicUpdated": {
|
|
21
|
+
"zh-CN": "已设置频道话题",
|
|
22
|
+
"en": "Channel topic updated"
|
|
23
|
+
},
|
|
24
|
+
"channelRestored": {
|
|
25
|
+
"zh-CN": "频道已恢复",
|
|
26
|
+
"en": "Channel restored"
|
|
27
|
+
},
|
|
28
|
+
"slackReactionAdded": {
|
|
29
|
+
"zh-CN": "已添加反应 :{p0}:",
|
|
30
|
+
"en": "Reaction added: :{p0}:"
|
|
31
|
+
},
|
|
32
|
+
"messageEdited": {
|
|
33
|
+
"zh-CN": "消息已编辑",
|
|
34
|
+
"en": "Message edited"
|
|
35
|
+
},
|
|
36
|
+
"messagePinned": {
|
|
37
|
+
"zh-CN": "已置顶消息",
|
|
38
|
+
"en": "Message pinned"
|
|
39
|
+
},
|
|
40
|
+
"slackReactionRemoved": {
|
|
41
|
+
"zh-CN": "已移除反应 :{p0}:",
|
|
42
|
+
"en": "Reaction removed: :{p0}:"
|
|
43
|
+
},
|
|
44
|
+
"messageUnpinned": {
|
|
45
|
+
"zh-CN": "已取消置顶",
|
|
46
|
+
"en": "Message unpinned"
|
|
47
|
+
},
|
|
48
|
+
"slackUserMissing": {
|
|
49
|
+
"zh-CN": "Slack 用户不存在: {p0}",
|
|
50
|
+
"en": "Slack user does not exist: {p0}"
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -15,6 +16,6 @@ export default defineAgentTool({
|
|
|
15
16
|
const client = context.$client;
|
|
16
17
|
await client.conversations.archive({ channel });
|
|
17
18
|
const success = true;
|
|
18
|
-
return { success, message: success ? '
|
|
19
|
+
return { success, message: success ? t(context.locale, 'channelArchived') : t(context.locale, 'operationFailed') };
|
|
19
20
|
},
|
|
20
21
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -17,6 +18,6 @@ export default defineAgentTool<{
|
|
|
17
18
|
const client = context.$client;
|
|
18
19
|
await client.conversations.archive({ channel });
|
|
19
20
|
const success = true;
|
|
20
|
-
return { success, message: success ? '
|
|
21
|
+
return { success, message: success ? t(context.locale, 'channelArchived') : t(context.locale, 'operationFailed') };
|
|
21
22
|
},
|
|
22
23
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -16,6 +17,6 @@ export default defineAgentTool({
|
|
|
16
17
|
const client = context.$client;
|
|
17
18
|
await client.conversations.invite({ channel, users });
|
|
18
19
|
const success = true;
|
|
19
|
-
return { success, message: success ? '
|
|
20
|
+
return { success, message: success ? t(context.locale, 'channelInvited') : t(context.locale, 'operationFailed') };
|
|
20
21
|
},
|
|
21
22
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -19,6 +20,6 @@ export default defineAgentTool<{
|
|
|
19
20
|
const client = context.$client;
|
|
20
21
|
await client.conversations.invite({ channel, users });
|
|
21
22
|
const success = true;
|
|
22
|
-
return { success, message: success ? '
|
|
23
|
+
return { success, message: success ? t(context.locale, 'channelInvited') : t(context.locale, 'operationFailed') };
|
|
23
24
|
},
|
|
24
25
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -16,6 +17,6 @@ export default defineAgentTool({
|
|
|
16
17
|
const client = context.$client;
|
|
17
18
|
await client.conversations.setPurpose({ channel: channel_id, purpose });
|
|
18
19
|
const success = true;
|
|
19
|
-
return { success, message: success ? '
|
|
20
|
+
return { success, message: success ? t(context.locale, 'purposeUpdated') : t(context.locale, 'operationFailed') };
|
|
20
21
|
},
|
|
21
22
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -19,6 +20,6 @@ export default defineAgentTool<{
|
|
|
19
20
|
const client = context.$client;
|
|
20
21
|
await client.conversations.setPurpose({ channel: channel_id, purpose });
|
|
21
22
|
const success = true;
|
|
22
|
-
return { success, message: success ? '
|
|
23
|
+
return { success, message: success ? t(context.locale, 'purposeUpdated') : t(context.locale, 'operationFailed') };
|
|
23
24
|
},
|
|
24
25
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -16,6 +17,6 @@ export default defineAgentTool({
|
|
|
16
17
|
const client = context.$client;
|
|
17
18
|
await client.conversations.setTopic({ channel, topic });
|
|
18
19
|
const success = true;
|
|
19
|
-
return { success, message: success ? '
|
|
20
|
+
return { success, message: success ? t(context.locale, 'topicUpdated') : t(context.locale, 'operationFailed') };
|
|
20
21
|
},
|
|
21
22
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -19,6 +20,6 @@ export default defineAgentTool<{
|
|
|
19
20
|
const client = context.$client;
|
|
20
21
|
await client.conversations.setTopic({ channel, topic });
|
|
21
22
|
const success = true;
|
|
22
|
-
return { success, message: success ? '
|
|
23
|
+
return { success, message: success ? t(context.locale, 'topicUpdated') : t(context.locale, 'operationFailed') };
|
|
23
24
|
},
|
|
24
25
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -15,6 +16,6 @@ export default defineAgentTool({
|
|
|
15
16
|
const client = context.$client;
|
|
16
17
|
await client.conversations.unarchive({ channel: channel_id });
|
|
17
18
|
const success = true;
|
|
18
|
-
return { success, message: success ? '
|
|
19
|
+
return { success, message: success ? t(context.locale, 'channelRestored') : t(context.locale, 'operationFailed') };
|
|
19
20
|
},
|
|
20
21
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -17,6 +18,6 @@ export default defineAgentTool<{
|
|
|
17
18
|
const client = context.$client;
|
|
18
19
|
await client.conversations.unarchive({ channel: channel_id });
|
|
19
20
|
const success = true;
|
|
20
|
-
return { success, message: success ? '
|
|
21
|
+
return { success, message: success ? t(context.locale, 'channelRestored') : t(context.locale, 'operationFailed') };
|
|
21
22
|
},
|
|
22
23
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { normalizeSlackReactionName } from '@zhin.js/adapter-slack';
|
|
@@ -22,6 +23,6 @@ export default defineAgentTool({
|
|
|
22
23
|
throw error;
|
|
23
24
|
}
|
|
24
25
|
const success = true;
|
|
25
|
-
return { success, message: success ?
|
|
26
|
+
return { success, message: success ? t(context.locale, 'slackReactionAdded', { p0: emoji }) : t(context.locale, 'operationFailed') };
|
|
26
27
|
},
|
|
27
28
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { normalizeSlackReactionName } from '@zhin.js/adapter-slack';
|
|
@@ -24,6 +25,6 @@ export default defineAgentTool<{
|
|
|
24
25
|
if ((error as { data?: { error?: string } })?.data?.error !== 'already_reacted') throw error;
|
|
25
26
|
}
|
|
26
27
|
const success = true;
|
|
27
|
-
return { success, message: success ?
|
|
28
|
+
return { success, message: success ? t(context.locale, 'slackReactionAdded', { p0: emoji }) : t(context.locale, 'operationFailed') };
|
|
28
29
|
},
|
|
29
30
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { editSlackContent } from '@zhin.js/adapter-slack';
|
|
@@ -16,6 +17,6 @@ export default defineAgentTool({
|
|
|
16
17
|
await editSlackContent(client, channel, message_ts, [
|
|
17
18
|
{ type: 'text', data: { text } },
|
|
18
19
|
]);
|
|
19
|
-
return { success: true, message: '
|
|
20
|
+
return { success: true, message: t(context.locale, 'messageEdited') };
|
|
20
21
|
},
|
|
21
22
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { editSlackContent } from '@zhin.js/adapter-slack';
|
|
@@ -20,6 +21,6 @@ export default defineAgentTool<{
|
|
|
20
21
|
await editSlackContent(client, channel, message_ts, [
|
|
21
22
|
{ type: 'text', data: { text } },
|
|
22
23
|
]);
|
|
23
|
-
return { success: true, message: '
|
|
24
|
+
return { success: true, message: t(context.locale, 'messageEdited') };
|
|
24
25
|
},
|
|
25
26
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -15,6 +16,6 @@ export default defineAgentTool({
|
|
|
15
16
|
const client = context.$client;
|
|
16
17
|
await client.pins.add({ channel, timestamp });
|
|
17
18
|
const success = true;
|
|
18
|
-
return { success, message: success ? '
|
|
19
|
+
return { success, message: success ? t(context.locale, 'messagePinned') : t(context.locale, 'operationFailed') };
|
|
19
20
|
},
|
|
20
21
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -18,6 +19,6 @@ export default defineAgentTool<{
|
|
|
18
19
|
const client = context.$client;
|
|
19
20
|
await client.pins.add({ channel, timestamp });
|
|
20
21
|
const success = true;
|
|
21
|
-
return { success, message: success ? '
|
|
22
|
+
return { success, message: success ? t(context.locale, 'messagePinned') : t(context.locale, 'operationFailed') };
|
|
22
23
|
},
|
|
23
24
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { normalizeSlackReactionName } from '@zhin.js/adapter-slack';
|
|
@@ -25,6 +26,6 @@ export default defineAgentTool({
|
|
|
25
26
|
throw error;
|
|
26
27
|
}
|
|
27
28
|
const success = true;
|
|
28
|
-
return { success, message: success ?
|
|
29
|
+
return { success, message: success ? t(context.locale, 'slackReactionRemoved', { p0: name }) : t(context.locale, 'operationFailed') };
|
|
29
30
|
},
|
|
30
31
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { normalizeSlackReactionName } from '@zhin.js/adapter-slack';
|
|
@@ -27,6 +28,6 @@ export default defineAgentTool<{
|
|
|
27
28
|
if ((error as { data?: { error?: string } })?.data?.error !== 'no_reaction') throw error;
|
|
28
29
|
}
|
|
29
30
|
const success = true;
|
|
30
|
-
return { success, message: success ?
|
|
31
|
+
return { success, message: success ? t(context.locale, 'slackReactionRemoved', { p0: name }) : t(context.locale, 'operationFailed') };
|
|
31
32
|
},
|
|
32
33
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -15,6 +16,6 @@ export default defineAgentTool({
|
|
|
15
16
|
const client = context.$client;
|
|
16
17
|
await client.pins.remove({ channel: channel_id, timestamp });
|
|
17
18
|
const success = true;
|
|
18
|
-
return { success, message: success ? '
|
|
19
|
+
return { success, message: success ? t(context.locale, 'messageUnpinned') : t(context.locale, 'operationFailed') };
|
|
19
20
|
},
|
|
20
21
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { platformPermission } from '@zhin.js/permission';
|
|
@@ -18,6 +19,6 @@ export default defineAgentTool<{
|
|
|
18
19
|
const client = context.$client;
|
|
19
20
|
await client.pins.remove({ channel: channel_id, timestamp });
|
|
20
21
|
const success = true;
|
|
21
|
-
return { success, message: success ? '
|
|
22
|
+
return { success, message: success ? t(context.locale, 'messageUnpinned') : t(context.locale, 'operationFailed') };
|
|
22
23
|
},
|
|
23
24
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
export default defineAgentTool({
|
|
@@ -12,7 +13,7 @@ export default defineAgentTool({
|
|
|
12
13
|
const client = context.$client;
|
|
13
14
|
const user = (await client.users.info({ user: user_id })).user;
|
|
14
15
|
if (!user)
|
|
15
|
-
throw new Error(
|
|
16
|
+
throw new Error(t(context.locale, 'slackUserMissing', { p0: user_id }));
|
|
16
17
|
return {
|
|
17
18
|
id: user.id,
|
|
18
19
|
name: user.name,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import type { SlackUserInfo } from '@zhin.js/adapter-slack';
|
|
@@ -14,7 +15,7 @@ export default defineAgentTool<{
|
|
|
14
15
|
async execute({ user_id }, context) {
|
|
15
16
|
const client = context.$client;
|
|
16
17
|
const user = (await client.users.info({ user: user_id })).user as SlackUserInfo | undefined;
|
|
17
|
-
if (!user) throw new Error(
|
|
18
|
+
if (!user) throw new Error(t(context.locale, 'slackUserMissing', { p0: user_id }));
|
|
18
19
|
return {
|
|
19
20
|
id: user.id,
|
|
20
21
|
name: user.name,
|
|
@@ -11,7 +11,7 @@ export const slackEndpointCommands = createEndpointCommands({
|
|
|
11
11
|
adapterDisplayName: 'Slack',
|
|
12
12
|
fields: [
|
|
13
13
|
{ key: 'token', required: true, env: true, description: 'Bot User OAuth Token(xoxb-...)' },
|
|
14
|
-
{ key: 'signingSecret', env: true, description: '签名密钥(HTTP Events,socketMode: false 必填)' },
|
|
14
|
+
{ key: 'signingSecret', env: true, description: '签名密钥(HTTP Events,socketMode: false 必填)', descriptionI18n: { en: "Signing secret (required for HTTP Events when socketMode is false)" } },
|
|
15
15
|
{ key: 'appToken', env: true, description: 'App-Level Token(xapp-...,Socket Mode)' },
|
|
16
16
|
],
|
|
17
17
|
running: (use) => use(slackRuntimeStateToken).endpoints.values(),
|
|
@@ -11,7 +11,7 @@ export const slackEndpointCommands = createEndpointCommands({
|
|
|
11
11
|
adapterDisplayName: 'Slack',
|
|
12
12
|
fields: [
|
|
13
13
|
{ key: 'token', required: true, env: true, description: 'Bot User OAuth Token(xoxb-...)' },
|
|
14
|
-
{ key: 'signingSecret', env: true, description: '签名密钥(HTTP Events,socketMode: false 必填)' },
|
|
14
|
+
{ key: 'signingSecret', env: true, description: '签名密钥(HTTP Events,socketMode: false 必填)', descriptionI18n: { en: "Signing secret (required for HTTP Events when socketMode is false)" } },
|
|
15
15
|
{ key: 'appToken', env: true, description: 'App-Level Token(xapp-...,Socket Mode)' },
|
|
16
16
|
],
|
|
17
17
|
running: (use) => use(slackRuntimeStateToken).endpoints.values(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-slack",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.16",
|
|
4
4
|
"description": "Zhin.js Slack adapter for Plugin Runtime (Socket Mode / HTTP Events)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@slack/socket-mode": "^2.0.7",
|
|
35
35
|
"@slack/web-api": "^7.19.0",
|
|
36
|
-
"@zhin.js/adapter": "1.1.
|
|
37
|
-
"@zhin.js/agent-feature": "1.1.
|
|
38
|
-
"@zhin.js/core": "1.1.
|
|
39
|
-
"@zhin.js/feature-kit": "1.1.
|
|
40
|
-
"@zhin.js/host-http": "1.1.
|
|
41
|
-
"@zhin.js/im-contract": "1.1.
|
|
36
|
+
"@zhin.js/adapter": "1.1.23",
|
|
37
|
+
"@zhin.js/agent-feature": "1.1.10",
|
|
38
|
+
"@zhin.js/core": "1.1.51",
|
|
39
|
+
"@zhin.js/feature-kit": "1.1.9",
|
|
40
|
+
"@zhin.js/host-http": "1.1.10",
|
|
41
|
+
"@zhin.js/im-contract": "1.1.7",
|
|
42
42
|
"@zhin.js/logger": "1.1.2",
|
|
43
|
-
"@zhin.js/skill": "1.1.
|
|
44
|
-
"@zhin.js/tool": "1.1.
|
|
43
|
+
"@zhin.js/skill": "1.1.10",
|
|
44
|
+
"@zhin.js/tool": "1.1.10"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"zod": "^4.0.0",
|
|
48
|
-
"@zhin.js/adapter": "^1.1.
|
|
49
|
-
"@zhin.js/command": "^1.1.
|
|
50
|
-
"@zhin.js/core": "^1.1.
|
|
51
|
-
"@zhin.js/host-http": "^1.1.
|
|
52
|
-
"@zhin.js/permission": "^1.1.
|
|
53
|
-
"zhin.js": "^1.1.
|
|
48
|
+
"@zhin.js/adapter": "^1.1.23",
|
|
49
|
+
"@zhin.js/command": "^1.1.11",
|
|
50
|
+
"@zhin.js/core": "^1.1.51",
|
|
51
|
+
"@zhin.js/host-http": "^1.1.10",
|
|
52
|
+
"@zhin.js/permission": "^1.1.9",
|
|
53
|
+
"zhin.js": "^1.1.16"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|
|
56
56
|
"@zhin.js/command": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"typescript": "^6.0.3",
|
|
69
69
|
"vitest": "^4.1.10",
|
|
70
70
|
"zod": "^4.4.3",
|
|
71
|
-
"zhin.js": "1.1.
|
|
71
|
+
"zhin.js": "1.1.16"
|
|
72
72
|
},
|
|
73
73
|
"files": [
|
|
74
74
|
"adapters",
|
package/schema.json
CHANGED
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
"string",
|
|
23
23
|
"number"
|
|
24
24
|
],
|
|
25
|
-
"description": "框架 master(Slack user id;AI/工具权限、endpoint 管理)。endpoints[i].master 可逐项覆盖"
|
|
25
|
+
"description": "框架 master(Slack user id;AI/工具权限、endpoint 管理)。endpoints[i].master 可逐项覆盖",
|
|
26
|
+
"x-i18n": {
|
|
27
|
+
"en": {
|
|
28
|
+
"description": "Framework masters (Slack user id; AI/tool permissions and endpoint management). endpoints[i].master can override this value."
|
|
29
|
+
}
|
|
30
|
+
}
|
|
26
31
|
},
|
|
27
32
|
"trusted": {
|
|
28
33
|
"type": "array",
|
|
@@ -33,7 +38,12 @@
|
|
|
33
38
|
],
|
|
34
39
|
"description": "Trusted Slack user id"
|
|
35
40
|
},
|
|
36
|
-
"description": "框架 trusted 用户列表(弱于 master)。endpoints[i].trusted 可逐项追加"
|
|
41
|
+
"description": "框架 trusted 用户列表(弱于 master)。endpoints[i].trusted 可逐项追加",
|
|
42
|
+
"x-i18n": {
|
|
43
|
+
"en": {
|
|
44
|
+
"description": "Framework trusted users, below master authority. endpoints[i].trusted can add users."
|
|
45
|
+
}
|
|
46
|
+
}
|
|
37
47
|
},
|
|
38
48
|
"endpoints": {
|
|
39
49
|
"type": "array",
|
|
@@ -48,7 +58,12 @@
|
|
|
48
58
|
"string",
|
|
49
59
|
"number"
|
|
50
60
|
],
|
|
51
|
-
"description": "本 endpoint 的框架 master(Slack user id);覆盖顶层 master"
|
|
61
|
+
"description": "本 endpoint 的框架 master(Slack user id);覆盖顶层 master",
|
|
62
|
+
"x-i18n": {
|
|
63
|
+
"en": {
|
|
64
|
+
"description": "Framework masters for this endpoint (Slack user id), overriding the top-level master list."
|
|
65
|
+
}
|
|
66
|
+
}
|
|
52
67
|
},
|
|
53
68
|
"trusted": {
|
|
54
69
|
"type": "array",
|
|
@@ -59,7 +74,12 @@
|
|
|
59
74
|
],
|
|
60
75
|
"description": "Trusted Slack user id"
|
|
61
76
|
},
|
|
62
|
-
"description": "本 endpoint 的 trusted 列表"
|
|
77
|
+
"description": "本 endpoint 的 trusted 列表",
|
|
78
|
+
"x-i18n": {
|
|
79
|
+
"en": {
|
|
80
|
+
"description": "Trusted users for this endpoint."
|
|
81
|
+
}
|
|
82
|
+
}
|
|
63
83
|
},
|
|
64
84
|
"token": {
|
|
65
85
|
"type": "string",
|
|
@@ -108,7 +128,12 @@
|
|
|
108
128
|
"port",
|
|
109
129
|
"serverName"
|
|
110
130
|
],
|
|
111
|
-
"description": "Socket故障验收:WSS固定loopback TCP,API仍标准TLS直连"
|
|
131
|
+
"description": "Socket故障验收:WSS固定loopback TCP,API仍标准TLS直连",
|
|
132
|
+
"x-i18n": {
|
|
133
|
+
"en": {
|
|
134
|
+
"description": "Socket fault-injection tests: pin WSS TCP to loopback while API requests retain direct standard TLS."
|
|
135
|
+
}
|
|
136
|
+
}
|
|
112
137
|
},
|
|
113
138
|
"webApiProxy": {
|
|
114
139
|
"type": "object",
|
|
@@ -123,19 +148,34 @@
|
|
|
123
148
|
"required": [
|
|
124
149
|
"port"
|
|
125
150
|
],
|
|
126
|
-
"description": "出站JSON Web API专用故障代理:仅slack.com:443,固定loopbackTCP,保留SNI和证书校验,与Socket代理独立;上传域名不适用"
|
|
151
|
+
"description": "出站JSON Web API专用故障代理:仅slack.com:443,固定loopbackTCP,保留SNI和证书校验,与Socket代理独立;上传域名不适用",
|
|
152
|
+
"x-i18n": {
|
|
153
|
+
"en": {
|
|
154
|
+
"description": "Fault proxy for outbound JSON Web APIs only: pin slack.com:443 TCP to loopback while preserving SNI and certificate validation. Independent of the Socket proxy; does not apply to upload hosts."
|
|
155
|
+
}
|
|
156
|
+
}
|
|
127
157
|
}
|
|
128
158
|
},
|
|
129
159
|
"required": [
|
|
130
160
|
"id",
|
|
131
161
|
"token"
|
|
132
162
|
]
|
|
163
|
+
},
|
|
164
|
+
"x-i18n": {
|
|
165
|
+
"en": {
|
|
166
|
+
"description": "Multiple accounts: mount multiple endpoints in one plugin instance. Each entry uses the top-level fields; id is required and other fields override defaults."
|
|
167
|
+
}
|
|
133
168
|
}
|
|
134
169
|
},
|
|
135
170
|
"commandPrefix": {
|
|
136
171
|
"type": "string",
|
|
137
172
|
"default": "",
|
|
138
|
-
"description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖"
|
|
173
|
+
"description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖",
|
|
174
|
+
"x-i18n": {
|
|
175
|
+
"en": {
|
|
176
|
+
"description": "Command prefix. The default empty string allows unprefixed commands; '/' requires a leading slash. Each endpoints[i] can override it."
|
|
177
|
+
}
|
|
178
|
+
}
|
|
139
179
|
}
|
|
140
180
|
},
|
|
141
181
|
"required": [
|