@modelzen/feishu-codex-bridge 0.3.12-test.2 → 0.3.12-test.3

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/cli.js +22 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -9471,7 +9471,7 @@ function createOrchestrator(channel, cfg, fallbackCwd) {
9471
9471
  }
9472
9472
  const ts = turnSession(msg.chatId, project, msg.senderId);
9473
9473
  if (cmd === "model") {
9474
- postModelCard(msg, ts.sessionKey);
9474
+ postModelCard(msg, ts.sessionKey, false);
9475
9475
  return;
9476
9476
  }
9477
9477
  if (cmd === "compact") {
@@ -9505,7 +9505,7 @@ function createOrchestrator(channel, cfg, fallbackCwd) {
9505
9505
  }
9506
9506
  const ts = turnSession(msg.threadId, project, msg.senderId);
9507
9507
  if (cmd === "model") {
9508
- postModelCard(msg, ts.sessionKey);
9508
+ postModelCard(msg, ts.sessionKey, true);
9509
9509
  return;
9510
9510
  }
9511
9511
  if (cmd === "compact") {
@@ -9911,7 +9911,7 @@ function createOrchestrator(channel, cfg, fallbackCwd) {
9911
9911
  }
9912
9912
  });
9913
9913
  }
9914
- function postModelCard(msg, sessionKey) {
9914
+ function postModelCard(msg, sessionKey, inThread) {
9915
9915
  void withTrace({ chatId: msg.chatId, msgId: msg.messageId }, async () => {
9916
9916
  try {
9917
9917
  const [rec, project] = await Promise.all([getSession(sessionKey), getProjectByChatId(msg.chatId)]);
@@ -9929,7 +9929,7 @@ function createOrchestrator(channel, cfg, fallbackCwd) {
9929
9929
  backend: be.id,
9930
9930
  createdAt: Date.now()
9931
9931
  };
9932
- const res = await sendManagedCard(channel, msg.chatId, buildModelCard(state), msg.messageId, true);
9932
+ const res = await sendManagedCard(channel, msg.chatId, buildModelCard(state), msg.messageId, inThread);
9933
9933
  pruneModelPending();
9934
9934
  modelPending.set(res.messageId, state);
9935
9935
  log.info("card", "model", { threadId: sessionKey, model: state.model, effort: state.effort });
@@ -14361,6 +14361,18 @@ ${UI_PURE_JS}
14361
14361
  if (drawerProject) renderDrawer(drawerProject);
14362
14362
  }
14363
14363
 
14364
+ // \u98DE\u4E66 applink\u300C\u6253\u5F00\u673A\u5668\u4EBA\u300D\uFF1A\u5728\u98DE\u4E66\u5BA2\u6237\u7AEF\u91CC\u76F4\u63A5\u62C9\u8D77\u4E0E\u8BE5 bot \u7684\u79C1\u804A\uFF08\u540C\u5F00\u53D1\u8005\u540E\u53F0
14365
+ // \u300C\u521B\u5EFA\u6210\u529F \u2192 \u6253\u5F00\u5E94\u7528\u300D\u90A3\u6761\u94FE\uFF09\u3002feishu / lark \u5404\u81EA\u57DF\u540D\u3002
14366
+ function botOpenLink(appId, tenant) {
14367
+ var host = tenant === 'lark' ? 'applink.larksuite.com' : 'applink.feishu.cn';
14368
+ return 'https://' + host + '/client/bot/open?appId=' + encodeURIComponent(appId || '');
14369
+ }
14370
+ function openBotBtn(appId, tenant, label) {
14371
+ var a = el('a', 'btn', label || '\u{1F517} \u5728\u98DE\u4E66\u4E2D\u6253\u5F00');
14372
+ a.href = botOpenLink(appId, tenant); a.target = '_blank'; a.rel = 'noopener';
14373
+ return a;
14374
+ }
14375
+
14364
14376
  function renderBotOverview(card, b) {
14365
14377
  var line1 = el('div', 'statline');
14366
14378
  line1.appendChild(el('span', 'tag', b.tenant === 'lark' ? 'Lark' : '\u98DE\u4E66'));
@@ -14368,6 +14380,9 @@ ${UI_PURE_JS}
14368
14380
  if (b.current) line1.appendChild(el('span', 'tag blue', '\u4E3B bot'));
14369
14381
  if (b.active) line1.appendChild(el('span', 'tag blue', '\u6D3B\u8DC3\u96C6'));
14370
14382
  card.appendChild(line1);
14383
+ var openRow = el('div'); openRow.style.marginTop = '8px';
14384
+ openRow.appendChild(openBotBtn(b.appId, b.tenant, '\u{1F517} \u5728\u98DE\u4E66\u4E2D\u6253\u5F00\u673A\u5668\u4EBA'));
14385
+ card.appendChild(openRow);
14371
14386
  var line2 = el('div', 'statline');
14372
14387
  if (b.running) {
14373
14388
  line2.appendChild(el('span', 'tag green', '\u2705 bridge \u8FD0\u884C\u4E2D \xB7 pid ' + b.pid));
@@ -14938,6 +14953,9 @@ ${UI_PURE_JS}
14938
14953
  // \u5F15\u5BFC\uFF08\u90A3\u4F1A\u8BA9\u4EBA\u4EE5\u4E3A\u5F97\u5148\u505A\u5B8C\u624D\u80FD\u7EE7\u7EED\uFF09\u3002\u91CD\u542F\u5165\u53E3**\u53EA\u6B64\u4E00\u5904**\uFF1A\u4E3B\u6309\u94AE\u300C\u91CD\u542F\u4F7F\u5176\u4E0A\u7EBF\u300D\uFF1B
14939
14954
  // \u60F3\u665A\u70B9\u518D\u8BF4\u5C31\u70B9\u300C\u7A0D\u540E\u518D\u91CD\u542F\u300D\u3002
14940
14955
  w.appendChild(el('div', 'note', '\u673A\u5668\u4EBA\u300C' + who + '\u300D\u5DF2\u52A0\u5165\u6D3B\u8DC3\u96C6\u3002\u6700\u540E\u4E00\u6B65\uFF1A\u91CD\u542F Feishu Bridge \u8BA9\u5B83\u4E0A\u7EBF\uFF08\u7EA6\u6570\u79D2\uFF0C\u5176\u5B83\u5728\u7EBF\u673A\u5668\u4EBA\u4F1A\u77ED\u6682\u65AD\u8FDE\u540E\u81EA\u52A8\u91CD\u8FDE\uFF09\u3002'));
14956
+ var openRow = el('div'); openRow.style.margin = '4px 0 12px';
14957
+ openRow.appendChild(openBotBtn(wizBotId, wizSetup && wizSetup.tenant, '\u{1F517} \u5728\u98DE\u4E66\u4E2D\u6253\u5F00\u673A\u5668\u4EBA'));
14958
+ w.appendChild(openRow);
14941
14959
  var gotoBot = function () { var id = wizBotId; closeWizard(); if (id) go({ tab: 'bot', botId: id }); };
14942
14960
  var actions = el('div', 'actions');
14943
14961
  var later = el('button', 'btn', '\u7A0D\u540E\u518D\u91CD\u542F');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelzen/feishu-codex-bridge",
3
- "version": "0.3.12-test.2",
3
+ "version": "0.3.12-test.3",
4
4
  "description": "Bridge Feishu/Lark messenger with local Codex via app-server (project=group, thread=session)",
5
5
  "type": "module",
6
6
  "bin": {