@cremini/skillpack 1.2.10 → 1.2.12
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/dist/cli.js +952 -728
- package/package.json +3 -3
- package/web/index.html +11 -0
- package/web/js/chat-apps-dialog.js +35 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cremini/skillpack",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.12",
|
|
4
4
|
"description": "Pack AI Skills into Local Agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"author": "CreminiAI",
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@larksuiteoapi/node-sdk": "^1.63.1",
|
|
47
48
|
"@mariozechner/pi-coding-agent": "^0.57.1",
|
|
48
49
|
"@sinclair/typebox": "^0.34.41",
|
|
49
50
|
"@slack/bolt": "^4.6.0",
|
|
@@ -55,7 +56,6 @@
|
|
|
55
56
|
"inquirer": "^13.3.0",
|
|
56
57
|
"node-cron": "^4.2.1",
|
|
57
58
|
"node-telegram-bot-api": "^0.66.0",
|
|
58
|
-
"sqlite3": "^5.1.7",
|
|
59
59
|
"ws": "^8.19.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
@@ -71,4 +71,4 @@
|
|
|
71
71
|
"tsx": "^4.21.0",
|
|
72
72
|
"typescript": "^5.9.3"
|
|
73
73
|
}
|
|
74
|
-
}
|
|
74
|
+
}
|
package/web/index.html
CHANGED
|
@@ -164,6 +164,17 @@
|
|
|
164
164
|
<input type="password" id="chatapps-slack-app-token" placeholder="xapp-..." class="form-input" />
|
|
165
165
|
</div>
|
|
166
166
|
</div>
|
|
167
|
+
<div class="settings-section">
|
|
168
|
+
<h3 class="section-title">Feishu</h3>
|
|
169
|
+
<div class="form-group">
|
|
170
|
+
<label>App ID</label>
|
|
171
|
+
<input type="password" id="chatapps-feishu-app-id" placeholder="cli_a1b2c3d4..." class="form-input" />
|
|
172
|
+
</div>
|
|
173
|
+
<div class="form-group">
|
|
174
|
+
<label>App Secret</label>
|
|
175
|
+
<input type="password" id="chatapps-feishu-app-secret" placeholder="your-feishu-app-secret" class="form-input" />
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
167
178
|
</div>
|
|
168
179
|
</div>
|
|
169
180
|
<div class="settings-modal-footer">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Chat Apps (IM Bots) Dialog Module
|
|
3
3
|
*
|
|
4
|
-
* 负责 IM Bots(Telegram / Slack
|
|
4
|
+
* 负责 IM Bots(Telegram / Slack / Feishu)配置管理。
|
|
5
5
|
* 独立的 Dialog,从原 SettingDialog 的 IM Bots 部分拆分出来。
|
|
6
6
|
*/
|
|
7
7
|
import { state } from "./config.js";
|
|
@@ -16,8 +16,22 @@ let restartBtn;
|
|
|
16
16
|
let telegramTokenInput;
|
|
17
17
|
let slackBotTokenInput;
|
|
18
18
|
let slackAppTokenInput;
|
|
19
|
+
let feishuAppIdInput;
|
|
20
|
+
let feishuAppSecretInput;
|
|
19
21
|
let statusEl;
|
|
20
22
|
|
|
23
|
+
function hasConfiguredChatApp(adapters = {}) {
|
|
24
|
+
const telegramConfigured = Boolean(adapters.telegram?.token);
|
|
25
|
+
const slackConfigured = Boolean(
|
|
26
|
+
adapters.slack?.botToken && adapters.slack?.appToken,
|
|
27
|
+
);
|
|
28
|
+
const feishuConfigured = Boolean(
|
|
29
|
+
adapters.feishu?.appId && adapters.feishu?.appSecret,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return telegramConfigured || slackConfigured || feishuConfigured;
|
|
33
|
+
}
|
|
34
|
+
|
|
21
35
|
// --- Public API ---
|
|
22
36
|
|
|
23
37
|
export function initChatAppsDialog() {
|
|
@@ -29,6 +43,8 @@ export function initChatAppsDialog() {
|
|
|
29
43
|
telegramTokenInput = document.getElementById("chatapps-telegram-token");
|
|
30
44
|
slackBotTokenInput = document.getElementById("chatapps-slack-bot-token");
|
|
31
45
|
slackAppTokenInput = document.getElementById("chatapps-slack-app-token");
|
|
46
|
+
feishuAppIdInput = document.getElementById("chatapps-feishu-app-id");
|
|
47
|
+
feishuAppSecretInput = document.getElementById("chatapps-feishu-app-secret");
|
|
32
48
|
statusEl = document.getElementById("chatapps-status");
|
|
33
49
|
|
|
34
50
|
if (!dialog) return;
|
|
@@ -54,9 +70,7 @@ export function updateChatAppsButton() {
|
|
|
54
70
|
if (!openBtn) return;
|
|
55
71
|
const config = state.config;
|
|
56
72
|
const adapters = config?.adapters || {};
|
|
57
|
-
const hasAnyToken =
|
|
58
|
-
(adapters.telegram && adapters.telegram.token) ||
|
|
59
|
-
(adapters.slack && (adapters.slack.botToken || adapters.slack.appToken));
|
|
73
|
+
const hasAnyToken = hasConfiguredChatApp(adapters);
|
|
60
74
|
|
|
61
75
|
if (hasAnyToken) {
|
|
62
76
|
openBtn.classList.add("connected");
|
|
@@ -99,6 +113,14 @@ function populateForm() {
|
|
|
99
113
|
slackAppTokenInput.value = "";
|
|
100
114
|
}
|
|
101
115
|
|
|
116
|
+
if (adapters.feishu) {
|
|
117
|
+
feishuAppIdInput.value = adapters.feishu.appId || "";
|
|
118
|
+
feishuAppSecretInput.value = adapters.feishu.appSecret || "";
|
|
119
|
+
} else {
|
|
120
|
+
feishuAppIdInput.value = "";
|
|
121
|
+
feishuAppSecretInput.value = "";
|
|
122
|
+
}
|
|
123
|
+
|
|
102
124
|
// Restart required status
|
|
103
125
|
if (state.restartRequired) {
|
|
104
126
|
setStatus(
|
|
@@ -116,6 +138,8 @@ async function handleSave() {
|
|
|
116
138
|
const telegramToken = telegramTokenInput.value.trim();
|
|
117
139
|
const slackBotToken = slackBotTokenInput.value.trim();
|
|
118
140
|
const slackAppToken = slackAppTokenInput.value.trim();
|
|
141
|
+
const feishuAppId = feishuAppIdInput.value.trim();
|
|
142
|
+
const feishuAppSecret = feishuAppSecretInput.value.trim();
|
|
119
143
|
|
|
120
144
|
// 始终写入所有 adapter 键,空值也要显式传递,让后端能感知「清空」操作
|
|
121
145
|
const adapters = {
|
|
@@ -127,6 +151,13 @@ async function handleSave() {
|
|
|
127
151
|
appToken: slackAppToken || undefined,
|
|
128
152
|
}
|
|
129
153
|
: null,
|
|
154
|
+
feishu:
|
|
155
|
+
feishuAppId || feishuAppSecret
|
|
156
|
+
? {
|
|
157
|
+
appId: feishuAppId || undefined,
|
|
158
|
+
appSecret: feishuAppSecret || undefined,
|
|
159
|
+
}
|
|
160
|
+
: null,
|
|
130
161
|
};
|
|
131
162
|
|
|
132
163
|
const updates = { adapters };
|