larkway 0.3.35 → 0.3.37

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
@@ -8,7 +8,7 @@
8
8
 
9
9
  You @ the bot in a Feishu thread. It runs on your machine — reading your real codebase, executing commands, opening MRs — and posts the result back. You define what the agent knows and what it can do. Larkway just carries the messages.
10
10
 
11
- **Current release: v0.3.35**
11
+ **Current release: v0.3.37**
12
12
 
13
13
  ---
14
14
 
package/README.zh.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  你在飞书话题里 @ bot,它在你的机器上运行——读真实代码库、执行命令、开 MR——把结果贴回飞书。你定义 agent 知道什么、能做什么。Larkway 只负责传递消息。
10
10
 
11
- **当前版本:v0.3.35**
11
+ **当前版本:v0.3.37**
12
12
 
13
13
  ---
14
14
 
package/dist/cli/index.js CHANGED
@@ -114001,6 +114001,34 @@ var init_client = __esm({
114001
114001
  }
114002
114002
  });
114003
114003
 
114004
+ // src/lark/sdkLogger.ts
114005
+ var sdkLogger_exports = {};
114006
+ __export(sdkLogger_exports, {
114007
+ compactErrorText: () => compactErrorText,
114008
+ silentSdkLogger: () => silentSdkLogger
114009
+ });
114010
+ function compactErrorText(err2) {
114011
+ return err2 instanceof Error ? err2.message : String(err2);
114012
+ }
114013
+ var silentSdkLogger;
114014
+ var init_sdkLogger = __esm({
114015
+ "src/lark/sdkLogger.ts"() {
114016
+ "use strict";
114017
+ silentSdkLogger = {
114018
+ error(..._msg) {
114019
+ },
114020
+ warn(..._msg) {
114021
+ },
114022
+ info(..._msg) {
114023
+ },
114024
+ debug(..._msg) {
114025
+ },
114026
+ trace(..._msg) {
114027
+ }
114028
+ };
114029
+ }
114030
+ });
114031
+
114004
114032
  // src/tasklist/teamRegistry.ts
114005
114033
  var teamRegistry_exports = {};
114006
114034
  __export(teamRegistry_exports, {
@@ -128031,7 +128059,8 @@ async function probeTaskScope(appId, appSecret, tasklistGuid) {
128031
128059
  try {
128032
128060
  const { Client: LarkSdkClient2 } = await Promise.resolve().then(() => __toESM(require_lib2(), 1));
128033
128061
  const { TaskListClient: TaskListClient2 } = await Promise.resolve().then(() => (init_client(), client_exports));
128034
- const sdkClient = new LarkSdkClient2({ appId, appSecret });
128062
+ const { silentSdkLogger: silentSdkLogger2 } = await Promise.resolve().then(() => (init_sdkLogger(), sdkLogger_exports));
128063
+ const sdkClient = new LarkSdkClient2({ appId, appSecret, logger: silentSdkLogger2 });
128035
128064
  const taskClient = new TaskListClient2({
128036
128065
  request: (config) => sdkClient.request(config)
128037
128066
  });
@@ -132791,6 +132820,7 @@ function exitCodeFor(checks) {
132791
132820
 
132792
132821
  // src/cli/commands/tasklistInit.ts
132793
132822
  var import_node_sdk2 = __toESM(require_lib2(), 1);
132823
+ init_sdkLogger();
132794
132824
  init_client();
132795
132825
  init_paths();
132796
132826
  init_teamRegistry();
@@ -132862,27 +132892,50 @@ function runLarkCliJson(args, spawnSyncFn) {
132862
132892
  }
132863
132893
  return { ok: true, data: parsed };
132864
132894
  }
132865
- function listUserTasklists(profile, spawnSyncFn = spawnSync3) {
132895
+ function searchUserTasklists(profile, query, spawnSyncFn = spawnSync3) {
132866
132896
  const result = runLarkCliJson(
132867
- ["task", "tasklists", "list", "--as", "user", "--profile", profile, "--page-all", "--json"],
132897
+ ["task", "+tasklist-search", "--as", "user", "--profile", profile, "--query", query, "--page-all", "--json"],
132868
132898
  spawnSyncFn
132869
132899
  );
132870
132900
  if (!result.ok) return result;
132871
- const data = result.data;
132872
- const items = typeof data === "object" && data !== null ? data["items"] : void 0;
132873
- if (!Array.isArray(items)) {
132874
- return { ok: false, error: `lark-cli \u8FD4\u56DE\u7684\u6E05\u5355\u5217\u8868\u5F62\u72B6\u4E0D\u5BF9(\u7F3A\u5C11 items \u6570\u7EC4):${JSON.stringify(data).slice(0, 300)}` };
132901
+ return extractTasklistSummaries(result.data);
132902
+ }
132903
+ function extractTasklistSummaries(data) {
132904
+ const rec = typeof data === "object" && data !== null ? data : {};
132905
+ const nested = typeof rec["data"] === "object" && rec["data"] !== null ? rec["data"] : {};
132906
+ let arr;
132907
+ for (const candidate of [
132908
+ data,
132909
+ rec["items"],
132910
+ rec["tasklists"],
132911
+ rec["results"],
132912
+ nested["items"],
132913
+ nested["tasklists"],
132914
+ nested["results"]
132915
+ ]) {
132916
+ if (Array.isArray(candidate)) {
132917
+ arr = candidate;
132918
+ break;
132919
+ }
132875
132920
  }
132876
- const tasklists = [];
132877
- for (const raw of items) {
132921
+ if (!arr) {
132922
+ return {
132923
+ ok: false,
132924
+ error: `lark-cli +tasklist-search \u8FD4\u56DE\u7684\u5F62\u72B6\u65E0\u6CD5\u8BC6\u522B(\u627E\u4E0D\u5230\u6E05\u5355\u6570\u7EC4):${JSON.stringify(data).slice(0, 300)}`
132925
+ };
132926
+ }
132927
+ const out = [];
132928
+ const seen = /* @__PURE__ */ new Set();
132929
+ for (const raw of arr) {
132878
132930
  if (typeof raw !== "object" || raw === null) continue;
132879
132931
  const guid = raw["guid"];
132880
132932
  const name = raw["name"];
132881
- if (typeof guid === "string" && guid.length > 0) {
132882
- tasklists.push({ guid, name: typeof name === "string" ? name : "(\u65E0\u6807\u9898)" });
132933
+ if (typeof guid === "string" && guid.length > 0 && !seen.has(guid)) {
132934
+ seen.add(guid);
132935
+ out.push({ guid, name: typeof name === "string" ? name : "(\u65E0\u6807\u9898)" });
132883
132936
  }
132884
132937
  }
132885
- return { ok: true, data: tasklists };
132938
+ return { ok: true, data: out };
132886
132939
  }
132887
132940
  function addTasklistMembersAsUser(profile, tasklistGuid, members, spawnSyncFn = spawnSync3) {
132888
132941
  const dataJson = JSON.stringify({ members });
@@ -132969,33 +133022,41 @@ var USAGE2 = `larkway tasklist-init [--team <bot1,bot2,\u2026>] [--name <\u6E05\
132969
133022
  \u5E2E\u52A9\u7684 agent,\u7B2C\u4E00\u6B65\u5FC5\u7136\u4F1A\u8DD1 \`larkway tasklist-init --help\`(\u5C31\u662F\u4F60\u6B63\u5728\u770B\u7684\u8FD9\u6BB5),
132970
133023
  \u4ECE\u8FD9\u91CC\u5C31\u80FD\u5B66\u4F1A\u600E\u4E48\u628A\u672C\u673A\u6240\u6709\u5DF2\u914D\u7F6E\u7684 bot \u90FD\u914D\u6210\u6E05\u5355\u6210\u5458,\u4E0D\u9700\u8981\u4F60\u518D\u624B\u52A8\u4F20\u4EFB\u4F55\u53C2\u6570\u3002
132971
133024
 
132972
- \u96F6\u53C2\u6570\u4E09\u6B65 Quickstart:
132973
- 1. (\u53EF\u9009)\u5148\u5728\u98DE\u4E66\u4EFB\u52A1\u4E2D\u5FC3\u624B\u52A8\u5EFA\u4E00\u4E2A\u6E05\u5355,\u540D\u5B57\u968F\u4FBF\u53D6,\u6BD4\u5982 "Agent Team"\u3002
132974
- 2. \u8DD1:larkway tasklist-init
133025
+ \u96F6\u53C2\u6570 Quickstart:
133026
+ 1. \u8DD1:larkway tasklist-init
132975
133027
  \u2014\u2014 \u4F1A\u81EA\u52A8:--team = \u672C\u673A bots/ \u76EE\u5F55\u4E0B\u5168\u90E8\u5DF2\u914D\u7F6E bot;--name = "Agent Team";
132976
- \u7528\u4F60\u7684 lark-cli \u7528\u6237\u8EAB\u4EFD\u6309\u540D\u5B57\u67E5\u4E00\u904D\u80FD\u770B\u5230\u7684\u6E05\u5355 \u2014\u2014 \u67E5\u5230\u540C\u540D\u7684\u5C31 adopt(\u628A\u8FD9\u4E9B
132977
- bot \u52A0\u4E3A editor);\u67E5\u4E0D\u5230(\u6216\u6CA1\u767B\u5F55/\u7F3A scope)\u5C31\u9759\u9ED8\u56DE\u9000\u5230\u65E7\u7684\u521B\u5EFA\u8DEF\u5F84(\u7528\u7B2C\u4E00\u4E2A
132978
- bot \u7684 app \u8EAB\u4EFD\u65B0\u5EFA\u4E00\u4E2A\u6E05\u5355,\u5E76\u81EA\u52A8\u628A\u4F60\u52A0\u4E3A owner)\u3002
132979
- 3. \u53BB\u98DE\u4E66\u4EFB\u52A1\u4E2D\u5FC3\u786E\u8BA4\u8FD9\u4E2A\u6E05\u5355\u5728\u4F60\u7684\u5217\u8868\u91CC\u53EF\u89C1,\u4E4B\u540E\u53F3\u952E\u8BDD\u9898\u6D88\u606F\u9009"\u8F6C\u4EFB\u52A1"\u5373\u53EF\u3002
133028
+ \u7528\u7B2C\u4E00\u4E2A bot \u7684 app \u8EAB\u4EFD**\u65B0\u5EFA**\u4E00\u4E2A\u6E05\u5355(\u6E05\u5355 owner = \u8BE5 bot app),\u5E76\u628A\u4F60
133029
+ \u52A0\u4E3A editor \u6210\u5458(\u65B9\u4FBF\u5728\u4EFB\u52A1\u4E2D\u5FC3\u770B\u5230\u5E76\u7F16\u8F91)\u3002\u96F6\u53C2\u6570**\u4E0D\u4F1A**\u81EA\u52A8\u53BB\u8BA4\u9886\u540C\u540D\u6E05\u5355\u3002
133030
+ 2. \u53BB\u98DE\u4E66\u4EFB\u52A1\u4E2D\u5FC3\u786E\u8BA4\u8FD9\u4E2A\u6E05\u5355\u5728\u4F60\u7684\u5217\u8868\u91CC\u53EF\u89C1,\u4E4B\u540E\u53F3\u952E\u8BDD\u9898\u6D88\u606F\u9009"\u8F6C\u4EFB\u52A1"\u5373\u53EF\u3002
133031
+
133032
+ \u60F3\u8BA9\u6E05\u5355\u5F52**\u4F60\u81EA\u5DF1**\u6240\u6709(\u800C\u4E0D\u662F bot app)?\u5148\u5728\u4EFB\u52A1\u4E2D\u5FC3\u81EA\u5DF1\u5EFA\u4E00\u4E2A,\u518D\u7528
133033
+ \`--adopt "<\u6E05\u5355\u540D>"\` \u8BA4\u9886(\u89C1\u4E0B)\u3002\u591A\u5957 Larkway \u90E8\u7F72\u65F6,\u7ED9\u6BCF\u5957\u7528 --name \u6539\u4E2A\u4E0D\u540C
133034
+ \u540D\u5B57\u505A\u9694\u79BB,\u907F\u514D\u6DF7\u7528\u3002
132980
133035
 
132981
133036
  \u4EE5\u4E0A\u5168\u90E8\u662F\u7F3A\u7701\u884C\u4E3A,\u4EE5\u4E0B flag \u4EC5\u7528\u4E8E\u8986\u76D6:
132982
133037
 
132983
133038
  --team <bot1,bot2,\u2026> \u663E\u5F0F\u6307\u5B9A\u8981\u52A0\u5165\u6E05\u5355\u7684 bot(\u9ED8\u8BA4 = \u5168\u90E8\u5DF2\u914D\u7F6E bot)
132984
- --name <\u6E05\u5355\u540D> \u663E\u5F0F\u6307\u5B9A\u6E05\u5355\u540D(\u9ED8\u8BA4 "Agent Team"),\u4EC5\u5728\u81EA\u52A8/\u663E\u5F0F create
132985
- \u8DEF\u5F84\u91CC\u751F\u6548;--adopt/--adopt-guid \u4F1A\u5FFD\u7565\u5B83,\u6309\u540D\u5B57/guid \u67E5
132986
- --adopt "<\u6E05\u5355\u540D>" \u5F3A\u5236\u8D70 adopt \u6A21\u5F0F\u5E76\u7528\u8FD9\u4E2A\u540D\u5B57\u67E5\u627E\u2014\u2014\u67E5\u4E0D\u5230/\u67E5\u51FA\u591A\u4E2A\u90FD\u4F1A
132987
- \u76F4\u63A5\u62A5\u9519\u9000\u51FA,\u4E0D\u4F1A\u9759\u9ED8\u56DE\u9000\u5230\u521B\u5EFA\u8DEF\u5F84(\u4F60\u5DF2\u7ECF\u660E\u786E\u8981 adopt\u4E86)
132988
- --adopt-guid <guid> \u8DF3\u8FC7\u6309\u540D\u5B57\u67E5\u627E,\u76F4\u63A5 adopt \u8FD9\u4E2A guid \u7684\u6E05\u5355(\u5355\u72EC\u4F7F\u7528\u4E5F
132989
- \u7B49\u4EF7\u4E8E\u5F3A\u5236 adopt \u6A21\u5F0F);\u591A\u4E2A\u540C\u540D\u6E05\u5355\u65F6\u7528\u5B83\u6D88\u6B67
133039
+ --name <\u6E05\u5355\u540D> \u663E\u5F0F\u6307\u5B9A\u8981\u521B\u5EFA/\u590D\u7528\u7684\u6E05\u5355\u540D(\u9ED8\u8BA4 "Agent Team");\u591A\u56E2\u961F
133040
+ \u90E8\u7F72\u7528\u5B83\u9694\u79BB\u3002--adopt/--adopt-guid \u4F1A\u5FFD\u7565\u5B83,\u6309\u540D\u5B57/guid \u67E5
133041
+ --adopt "<\u6E05\u5355\u540D>" \u8BA4\u9886\u4F60\u81EA\u5DF1\u5728\u4EFB\u52A1\u4E2D\u5FC3\u5EFA\u597D\u7684\u540C\u540D\u6E05\u5355(\u628A\u8FD9\u4E9B bot \u52A0\u4E3A editor)\u2014\u2014
133042
+ \u67E5\u4E0D\u5230/\u67E5\u51FA\u591A\u4E2A\u90FD\u76F4\u63A5\u62A5\u9519\u9000\u51FA,\u7EDD\u4E0D\u9759\u9ED8\u56DE\u9000\u5230\u521B\u5EFA\u8DEF\u5F84
133043
+ --adopt-guid <guid> \u8DF3\u8FC7\u6309\u540D\u5B57\u67E5\u627E,\u76F4\u63A5\u8BA4\u9886\u8FD9\u4E2A guid \u7684\u6E05\u5355;\u591A\u4E2A\u540C\u540D\u6E05\u5355\u65F6\u6D88\u6B67
132990
133044
  --owner <open_id> \u663E\u5F0F\u6307\u5B9A\u4EBA\u7C7B owner(\u4EC5\u521B\u5EFA\u8DEF\u5F84\u7528\u5230,adopt \u6A21\u5F0F\u4E0B\u4F60\u672C\u6765\u5C31\u662F
132991
133045
  owner,\u4E0D\u9700\u8981\u8FD9\u4E2A)
132992
133046
  --force \u8986\u76D6\u5171\u4EAB\u6CE8\u518C\u6587\u4EF6\u91CC\u5DF2\u6709\u7684 guid(\u9ED8\u8BA4\u4E0D\u8986\u76D6,\u907F\u514D\u8BEF\u64CD\u4F5C\u628A
132993
133047
  \u6574\u4E2A\u56E2\u961F\u5207\u5230\u4E00\u4E2A\u65B0\u677F)
132994
133048
 
132995
- \u2500\u2500 adopt \u6A21\u5F0F\u5185\u90E8\u6B65\u9AA4(\u81EA\u52A8\u9009\u4E2D,\u6216\u663E\u5F0F --adopt/--adopt-guid \u89E6\u53D1)\u2500\u2500
133049
+ \u2500\u2500 \u5220\u9664/\u6E05\u7406(\u6682\u65E0\u81EA\u52A8\u5B50\u547D\u4EE4)\u2500\u2500
133050
+ \u96F6\u53C2\u6570\u521B\u5EFA\u7684\u6E05\u5355 owner \u662F bot app,\u4F60\u7684\u7528\u6237\u8EAB\u4EFD\u5220\u4E0D\u6389\u5B83\u3002\u8981\u5220\u9664\u672C\u673A\u6CE8\u518C\u7684\u6E05\u5355:
133051
+ \u7528\u521B\u5EFA\u5B83\u7684 bot \u7684 app \u51ED\u8BC1(bridge \u81EA\u5DF1\u7528\u7684\u90A3\u5957,tenant_access_token)\u8C03
133052
+ \`DELETE /open-apis/task/v2/tasklists/{guid}\`(guid \u89C1 <LARKWAY_HOME>/task-team.json),
133053
+ \u518D\u5220\u6389\u672C\u673A\u72B6\u6001\u6587\u4EF6:task-team.json\u3001candidate-alerts-<guid>.json\u3001\u5404 bot \u7684
133054
+ task-handles.json \u91CC\u5BF9\u5E94\u8BB0\u5F55\u3002(\u81EA\u52A8 --delete \u5B50\u547D\u4EE4\u6309\u9700\u518D\u52A0\u3002)
133055
+
133056
+ \u2500\u2500 adopt \u6A21\u5F0F\u5185\u90E8\u6B65\u9AA4(\u4EC5\u663E\u5F0F --adopt/--adopt-guid \u89E6\u53D1)\u2500\u2500
132996
133057
  1. \u4EE5\u4F60(\u64CD\u4F5C\u8005)\u7684\u7528\u6237\u8EAB\u4EFD\u6309\u540D\u5B57\u7CBE\u786E\u5339\u914D\u4F60\u80FD\u770B\u5230\u7684\u6E05\u5355(\u91CD\u540D \u2192 \u62A5\u9519\u5217\u51FA\u5168\u90E8
132997
- guid,\u8BA9\u4F60\u52A0 --adopt-guid <guid> \u6D88\u6B67\u91CD\u8DD1;\u4E00\u4E2A\u90FD\u627E\u4E0D\u5230 \u2192 \u81EA\u52A8\u6A21\u5F0F\u4E0B\u9759\u9ED8\u56DE\u9000
132998
- \u521B\u5EFA\u8DEF\u5F84,\u663E\u5F0F --adopt \u4E0B\u62A5\u9519\u63D0\u793A\u5148\u53BB\u4EFB\u52A1\u4E2D\u5FC3\u5EFA\u4E00\u4E2A)
133058
+ guid,\u8BA9\u4F60\u52A0 --adopt-guid <guid> \u6D88\u6B67\u91CD\u8DD1;\u4E00\u4E2A\u90FD\u627E\u4E0D\u5230 \u2192 \u62A5\u9519\u63D0\u793A\u5148\u53BB\u4EFB\u52A1
133059
+ \u4E2D\u5FC3\u5EFA\u4E00\u4E2A,\u7EDD\u4E0D\u9759\u9ED8\u521B\u5EFA)
132999
133060
  2. \u628A\u6BCF\u4E2A bot \u7684 app \u52A0\u4E3A\u6E05\u5355\u6210\u5458(role=editor,\u5E42\u7B49,\u5DF2\u662F\u6210\u5458\u7684\u8DF3\u8FC7/\u65E0\u5BB3\u91CD\u590D)
133000
133061
  3. \u5199\u5165\u5171\u4EAB\u6CE8\u518C\u6587\u4EF6 <LARKWAY_HOME>/task-team.json(\u4E0E\u521B\u5EFA\u8DEF\u5F84\u540C\u4E00\u5957
133001
133062
  first-writer-wins / --force \u8986\u76D6\u8BED\u4E49)
@@ -133105,25 +133166,12 @@ async function run10(ctx, args) {
133105
133166
  loginHint
133106
133167
  });
133107
133168
  }
133108
- const autoTarget = resolveAdoptTarget(creatorProfile, name, void 0, loginHint);
133109
- if (autoTarget.ok) {
133110
- return runAdoptWithGuid(ctx, {
133111
- guid: autoTarget.guid,
133112
- matchedName: autoTarget.matchedName,
133113
- bots,
133114
- force,
133115
- creatorProfile,
133116
- loginHint
133117
- });
133118
- }
133119
- if (autoTarget.reason === "ambiguous") {
133120
- if (ctx.flags.json) ctx.ui.emitJson({ ok: false, error: autoTarget.message });
133121
- else ctx.ui.failure(autoTarget.message);
133122
- return 1;
133123
- }
133124
133169
  if (!ctx.flags.json) {
133125
- const why = autoTarget.reason === "list-failed" ? "\u65E0\u6CD5\u4EE5\u4F60\u7684\u7528\u6237\u8EAB\u4EFD\u67E5\u8BE2\u6E05\u5355" : `\u6CA1\u627E\u5230\u540C\u540D\u6E05\u5355 "${name}"`;
133126
- ctx.ui.print(ctx.ui.dim(`(${why},\u56DE\u9000\u5230\u7528 bot app \u8EAB\u4EFD\u521B\u5EFA/\u590D\u7528\u6E05\u5355\u2014\u2014\u5982\u9700\u5F3A\u5236 adopt \u89C1 --adopt)`));
133170
+ ctx.ui.print(
133171
+ ctx.ui.dim(
133172
+ `(\u7528 bot app \u8EAB\u4EFD\u521B\u5EFA/\u590D\u7528\u6E05\u5355 "${name}"\u3002\u60F3\u8BA4\u9886\u4F60\u81EA\u5DF1\u5728\u4EFB\u52A1\u4E2D\u5FC3\u5EFA\u7684\u6E05\u5355\u8BF7\u7528 --adopt "<\u6E05\u5355\u540D>" / --adopt-guid <guid>;\u591A\u56E2\u961F\u90E8\u7F72\u5EFA\u8BAE\u7528 --name \u6539\u540D\u9694\u79BB\u3002)`
133173
+ )
133174
+ );
133127
133175
  }
133128
133176
  const ownerOpenId = explicitOwner ?? resolveOwnerOpenId(creatorProfile);
133129
133177
  if (!ownerOpenId) {
@@ -133135,7 +133183,11 @@ async function run10(ctx, args) {
133135
133183
  }
133136
133184
  return 1;
133137
133185
  }
133138
- const sdkClient = new import_node_sdk2.Client({ appId: creator.app_id, appSecret: creator.appSecret });
133186
+ const sdkClient = new import_node_sdk2.Client({
133187
+ appId: creator.app_id,
133188
+ appSecret: creator.appSecret,
133189
+ logger: silentSdkLogger
133190
+ });
133139
133191
  const requester = {
133140
133192
  request: (config) => sdkClient.request(config)
133141
133193
  };
@@ -133154,13 +133206,22 @@ async function run10(ctx, args) {
133154
133206
  try {
133155
133207
  await taskClient.addTasklistMembers(tasklistGuid, members);
133156
133208
  } catch (err2) {
133157
- const msg = `\u590D\u7528\u5DF2\u6709\u6E05\u5355 ${tasklistGuid} \u65F6\u8865\u5145\u6210\u5458\u5931\u8D25: ${err2 instanceof Error ? err2.message : String(err2)}`;
133158
- if (ctx.flags.json) ctx.ui.emitJson({ ok: false, error: msg });
133159
- else {
133160
- ctx.ui.failure(msg);
133161
- ctx.ui.print("\u5E38\u89C1\u539F\u56E0:app \u672A\u5728\u5F00\u653E\u5E73\u53F0\u540E\u53F0\u52FE\u9009 task:tasklist:write / task:task:write scope(\u89C1 docs/task-handle.md \xA77)\u3002");
133209
+ const errMsg = err2 instanceof Error ? err2.message : String(err2);
133210
+ if (isMembersEndpoint404(err2)) {
133211
+ if (!ctx.flags.json) {
133212
+ ctx.ui.warning(
133213
+ `\u590D\u7528\u6E05\u5355 ${tasklistGuid} \u65F6 add_members \u8FD4\u56DE 404(app \u7C7B\u578B\u6210\u5458\u7AEF\u70B9\u4E0D\u652F\u6301\u81EA\u52A9\u52A0\u5165,bot \u901A\u5E38\u5DF2\u7ECF\u662F\u6210\u5458)\u2014\u2014\u5DF2\u5FFD\u7565,\u4E0D\u5F71\u54CD\u4F7F\u7528(\u4E0E bridge \u542F\u52A8\u7684\u81EA\u52A9\u52A0\u5165\u540C\u6B3E\u964D\u7EA7)\u3002`
133214
+ );
133215
+ }
133216
+ } else {
133217
+ const msg = `\u590D\u7528\u5DF2\u6709\u6E05\u5355 ${tasklistGuid} \u65F6\u8865\u5145\u6210\u5458\u5931\u8D25: ${errMsg}`;
133218
+ if (ctx.flags.json) ctx.ui.emitJson({ ok: false, error: msg });
133219
+ else {
133220
+ ctx.ui.failure(msg);
133221
+ ctx.ui.print("\u5E38\u89C1\u539F\u56E0:app \u672A\u5728\u5F00\u653E\u5E73\u53F0\u540E\u53F0\u52FE\u9009 task:tasklist:write / task:task:write scope(\u89C1 docs/task-handle.md \xA77)\u3002");
133222
+ }
133223
+ return 1;
133162
133224
  }
133163
- return 1;
133164
133225
  }
133165
133226
  } else {
133166
133227
  reused = false;
@@ -133217,8 +133278,10 @@ async function run10(ctx, args) {
133217
133278
  } else {
133218
133279
  ctx.ui.success(`\u6E05\u5355 "${name}" \u5DF2\u521B\u5EFA: ${tasklistGuid}`);
133219
133280
  }
133220
- ctx.ui.print(`owner \u6210\u5458: ${ownerOpenId}${explicitOwner ? "" : "(\u4ECE lark-cli \u5F53\u524D\u767B\u5F55\u7528\u6237\u81EA\u52A8\u89E3\u6790)"}`);
133221
- ctx.ui.print(`\u5DF2\u52A0\u5165\u6210\u5458(editor): ${bots.map((b) => b.id).join(", ")}`);
133281
+ ctx.ui.print(
133282
+ `\u4F60(${ownerOpenId})\u5DF2\u4F5C\u4E3A editor \u52A0\u5165${explicitOwner ? "" : "(open_id \u4ECE lark-cli \u5F53\u524D\u767B\u5F55\u7528\u6237\u81EA\u52A8\u89E3\u6790)"} \u2014\u2014 \u6E05\u5355 owner \u662F\u521B\u5EFA\u5B83\u7684 bot app;\u4F60\u662F editor \u6210\u5458(\u53EF\u5728\u4EFB\u52A1\u4E2D\u5FC3\u770B\u5230\u5E76\u7F16\u8F91)\u3002`
133283
+ );
133284
+ ctx.ui.print(`\u5DF2\u52A0\u5165(editor)\u7684 bot: ${bots.map((b) => b.id).join(", ")}`);
133222
133285
  ctx.ui.print("");
133223
133286
  if (!reused) {
133224
133287
  ctx.ui.print(
@@ -133237,16 +133300,22 @@ async function run10(ctx, args) {
133237
133300
  );
133238
133301
  return 0;
133239
133302
  }
133303
+ function isMembersEndpoint404(err2) {
133304
+ if (err2 instanceof TaskApiError) {
133305
+ return err2.status === 404 && err2.code === void 0;
133306
+ }
133307
+ return /page not found/i.test(err2 instanceof Error ? err2.message : String(err2));
133308
+ }
133240
133309
  function resolveAdoptTarget(creatorProfile, name, explicitGuid, loginHint) {
133241
133310
  if (explicitGuid) {
133242
133311
  return { ok: true, guid: explicitGuid, matchedName: name };
133243
133312
  }
133244
- const listResult = listUserTasklists(creatorProfile);
133313
+ const listResult = searchUserTasklists(creatorProfile, name);
133245
133314
  if (!listResult.ok) {
133246
133315
  return {
133247
133316
  ok: false,
133248
133317
  reason: "list-failed",
133249
- message: `\u65E0\u6CD5\u4EE5\u4F60\u7684\u7528\u6237\u8EAB\u4EFD\u5217\u51FA\u6E05\u5355:${listResult.error}
133318
+ message: `\u65E0\u6CD5\u4EE5\u4F60\u7684\u7528\u6237\u8EAB\u4EFD\u67E5\u8BE2\u6E05\u5355:${listResult.error}
133250
133319
 
133251
133320
  \u8BF7\u5148\u786E\u8BA4\u5DF2\u7528\u8FD9\u4E2A profile \u767B\u5F55\u8FC7\u7528\u6237\u8EAB\u4EFD\u3001\u4E14\u7533\u8BF7\u4E86 task \u57DF\u6743\u9650:
133252
133321
  ${loginHint}
package/dist/main.js CHANGED
@@ -118230,6 +118230,23 @@ var CardRenderer = class {
118230
118230
  }
118231
118231
  };
118232
118232
 
118233
+ // src/lark/sdkLogger.ts
118234
+ var silentSdkLogger = {
118235
+ error(..._msg) {
118236
+ },
118237
+ warn(..._msg) {
118238
+ },
118239
+ info(..._msg) {
118240
+ },
118241
+ debug(..._msg) {
118242
+ },
118243
+ trace(..._msg) {
118244
+ }
118245
+ };
118246
+ function compactErrorText(err) {
118247
+ return err instanceof Error ? err.message : String(err);
118248
+ }
118249
+
118233
118250
  // src/claude/sessionStore.ts
118234
118251
  import { rename as rename2, readFile as readFile3, writeFile as writeFile2, mkdir as mkdir2, copyFile } from "node:fs/promises";
118235
118252
  import { dirname } from "node:path";
@@ -131508,7 +131525,7 @@ function printExternalCliProbe(bots) {
131508
131525
  }
131509
131526
  async function fetchBotAvatar(appId, appSecret) {
131510
131527
  try {
131511
- const client = new import_node_sdk2.Client({ appId, appSecret });
131528
+ const client = new import_node_sdk2.Client({ appId, appSecret, logger: silentSdkLogger });
131512
131529
  const resp = await client.request({
131513
131530
  method: "GET",
131514
131531
  url: "/open-apis/bot/v3/info"
@@ -131669,15 +131686,18 @@ async function runV2Mode({
131669
131686
  {
131670
131687
  const guid = bot.taskHandle?.tasklistGuid ?? await readTeamTasklistGuid(resolveTaskTeamRegistryPath());
131671
131688
  if (guid) {
131672
- const taskSdkClient = new import_node_sdk2.Client({ appId: bot.app_id, appSecret });
131689
+ const taskSdkClient = new import_node_sdk2.Client({
131690
+ appId: bot.app_id,
131691
+ appSecret,
131692
+ logger: silentSdkLogger
131693
+ });
131673
131694
  const taskRequester = {
131674
131695
  request: (config2) => taskSdkClient.request(config2)
131675
131696
  };
131676
131697
  const taskListClient = new TaskListClient(taskRequester);
131677
131698
  await taskListClient.addTasklistMembers(guid, [{ id: bot.app_id, type: "app", role: "editor" }]).catch((err) => {
131678
131699
  console.warn(
131679
- `[larkway] bot "${bot.id}": self-join tasklist ${guid} as editor failed (continuing, best-effort):`,
131680
- err
131700
+ `[larkway] bot "${bot.id}": self-join tasklist ${guid} as editor failed (continuing, best-effort): ${compactErrorText(err)}`
131681
131701
  );
131682
131702
  });
131683
131703
  effectiveTaskHandleTasklistGuid = guid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larkway",
3
- "version": "0.3.35",
3
+ "version": "0.3.37",
4
4
  "description": "Thin bridge: Feishu thread to local Claude Code CLI",
5
5
  "license": "MIT",
6
6
  "author": "Chuck Wu (chuckwu0)",