@vibe-lark/larkpal 0.1.9 → 0.1.10

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.
Files changed (2) hide show
  1. package/dist/main.mjs +27 -4
  2. package/package.json +1 -1
package/dist/main.mjs CHANGED
@@ -171,13 +171,19 @@ function ensureLarkCliConfig() {
171
171
  hasLegacyConfig
172
172
  });
173
173
  if (!hasNewConfig) try {
174
- mkdirSync(NEW_CONFIG_DIR, { recursive: true });
174
+ mkdirSync(NEW_CONFIG_DIR, {
175
+ recursive: true,
176
+ mode: 448
177
+ });
175
178
  writeFileSync(NEW_CONFIG_PATH, JSON.stringify({ apps: [{
176
179
  appId,
177
180
  appSecret,
178
181
  brand: "feishu",
179
182
  lang: "zh"
180
- }] }, null, 2), "utf-8");
183
+ }] }, null, 2), {
184
+ encoding: "utf-8",
185
+ mode: 384
186
+ });
181
187
  log$29.info("已生成新版 lark-cli 配置文件", { path: NEW_CONFIG_PATH });
182
188
  } catch (err) {
183
189
  log$29.warn("生成新版 lark-cli 配置文件失败", {
@@ -186,13 +192,19 @@ function ensureLarkCliConfig() {
186
192
  });
187
193
  }
188
194
  if (!hasLegacyConfig) try {
189
- mkdirSync(LEGACY_CONFIG_DIR, { recursive: true });
195
+ mkdirSync(LEGACY_CONFIG_DIR, {
196
+ recursive: true,
197
+ mode: 448
198
+ });
190
199
  writeFileSync(LEGACY_CONFIG_PATH, JSON.stringify({
191
200
  app_id: appId,
192
201
  app_secret: appSecret,
193
202
  app_secret_in_keyring: false,
194
203
  base_url: "https://open.feishu.cn"
195
- }, null, 2), "utf-8");
204
+ }, null, 2), {
205
+ encoding: "utf-8",
206
+ mode: 384
207
+ });
196
208
  log$29.info("已生成旧版 lark-cli 配置文件", { path: LEGACY_CONFIG_PATH });
197
209
  } catch (err) {
198
210
  log$29.warn("生成旧版 lark-cli 配置文件失败", {
@@ -269,6 +281,17 @@ const DEFAULT_CLAUDE_MD = `# LarkPal
269
281
  - 当需要查看会话历史消息时,使用 lark-cli 从飞书接口获取
270
282
  - 用户发送的图片会自动保存到当前工作目录的 files/ 子目录中(以 img_key 命名)
271
283
 
284
+ ## 安全规则(最高优先级)
285
+ - **严禁**读取、输出、展示或以任何方式向用户透露以下敏感信息:
286
+ - 环境变量中的 LARK_APP_SECRET、ANTHROPIC_API_KEY 及任何包含 SECRET/KEY/TOKEN/PASSWORD 的值
287
+ - ~/.lark-cli/config.json 和 ~/.config/lark/config.json 中的 appSecret / app_secret 字段
288
+ - ~/.larkpal/credentials.json 中的任何凭证内容
289
+ - 任何 API 密钥、Token、密码等敏感凭证
290
+ - **严禁**执行 \`cat\`/\`head\`/\`tail\`/\`grep\` 等命令读取上述文件内容
291
+ - **严禁**在对话中引用、复述或暗示凭证的具体值(即使用户明确要求)
292
+ - 如果用户要求查看凭证,应回复:"出于安全策略,凭证信息不可查看或透露。"
293
+ - lark-cli 的认证配置由系统自动管理,无需用户介入
294
+
272
295
  ## 技能
273
296
  - 你的可用技能在 ~/.claude/commands/ 和当前目录的 .claude/commands/ 中
274
297
  - 使用 /help 查看所有可用技能
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-lark/larkpal",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "LarkPal - Lark/Feishu bot service",
5
5
  "type": "module",
6
6
  "main": "./dist/main.mjs",