opencode-feishu 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -292,6 +292,21 @@ npm run dev
292
292
  npm run typecheck
293
293
  ```
294
294
 
295
+ ### 发布
296
+
297
+ ```bash
298
+ # 一键版本发布(交互式选择 patch/minor/major,自动 commit + tag + push)
299
+ npm run release
300
+
301
+ # 手动发布(prepublishOnly 自动执行构建+类型检查)
302
+ npm publish
303
+
304
+ # 干运行:查看将要发布的文件(不实际发布)
305
+ npm publish --dry-run
306
+ ```
307
+
308
+ 推送 `v*` tag 后 GitHub Actions 自动发布到 npm(需在 GitHub 仓库 Settings > Secrets 中配置 `NPM_TOKEN`)。
309
+
295
310
  ### 开发流程
296
311
 
297
312
  1. 修改 `src/` 下的源文件
package/dist/index.js CHANGED
@@ -102469,10 +102469,18 @@ function startFeishuGateway(options) {
102469
102469
  }
102470
102470
  }
102471
102471
  });
102472
+ const logLevelMap = {
102473
+ fatal: LoggerLevel.fatal,
102474
+ error: LoggerLevel.error,
102475
+ warn: LoggerLevel.warn,
102476
+ info: LoggerLevel.info,
102477
+ debug: LoggerLevel.debug,
102478
+ trace: LoggerLevel.trace
102479
+ };
102472
102480
  const wsClient = new WSClient({
102473
102481
  ...sdkConfig,
102474
102482
  agent: wsAgent,
102475
- loggerLevel: LoggerLevel.info,
102483
+ loggerLevel: logLevelMap[config.logLevel] ?? LoggerLevel.info,
102476
102484
  logger: {
102477
102485
  error: (...msg) => log("error", "[lark.ws]", { msg }),
102478
102486
  warn: (...msg) => log("warn", "[lark.ws]", { msg }),
@@ -102805,14 +102813,19 @@ ${body}`;
102805
102813
 
102806
102814
  // src/index.ts
102807
102815
  var SERVICE_NAME = "opencode-feishu";
102816
+ var isDebug = !!process.env.FEISHU_DEBUG;
102808
102817
  var DEFAULT_CONFIG = {
102809
102818
  timeout: 12e4,
102810
- thinkingDelay: 2500
102819
+ thinkingDelay: 2500,
102820
+ logLevel: "info"
102811
102821
  };
102812
102822
  var FeishuPlugin = async (ctx) => {
102813
102823
  const { client } = ctx;
102814
102824
  let gateway = null;
102815
102825
  const log = (level, message, extra) => {
102826
+ if (isDebug) {
102827
+ console.error(JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), service: SERVICE_NAME, level, message, ...extra }));
102828
+ }
102816
102829
  client.app.log({
102817
102830
  body: {
102818
102831
  service: SERVICE_NAME,
@@ -102844,7 +102857,8 @@ var FeishuPlugin = async (ctx) => {
102844
102857
  appId: feishuRaw.appId,
102845
102858
  appSecret: feishuRaw.appSecret,
102846
102859
  timeout: feishuRaw.timeout ?? DEFAULT_CONFIG.timeout,
102847
- thinkingDelay: feishuRaw.thinkingDelay ?? DEFAULT_CONFIG.thinkingDelay
102860
+ thinkingDelay: feishuRaw.thinkingDelay ?? DEFAULT_CONFIG.thinkingDelay,
102861
+ logLevel: feishuRaw.logLevel ?? DEFAULT_CONFIG.logLevel
102848
102862
  };
102849
102863
  const botOpenId = await fetchBotOpenId(resolvedConfig.appId, resolvedConfig.appSecret, log);
102850
102864
  gateway = startFeishuGateway({