feishu-devops 26.627.0 → 26.627.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.
Files changed (2) hide show
  1. package/dist/cli.js +23 -10
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import { Command } from "commander";
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "feishu-devops",
7
- version: "26.627.0",
7
+ version: "26.627.1",
8
8
  description: "\u98DE\u4E66\u6D88\u606F bot\uFF1A\u626B\u7801\u521B\u5EFA\u5E94\u7528\uFF0C\u901A\u8FC7 Claude Code / Codex \u5904\u7406\u6D88\u606F",
9
9
  type: "module",
10
10
  bin: {
@@ -5963,7 +5963,7 @@ async function handleStatus(_args, ctx) {
5963
5963
  effectiveCwd: effective,
5964
5964
  sessionId: isCodex ? catalogEntry?.threadId : sess?.sessionId,
5965
5965
  sessionStale: usesSessionStore && Boolean(cwd && sess && sess.cwd !== cwd),
5966
- agentName: ctx.agent?.displayName ?? profile?.agentKind ?? "unknown",
5966
+ agentName: resolveStatusAgentName(ctx),
5967
5967
  runtimeAccess: runtimeAccessStatus(profile),
5968
5968
  activeRun: Boolean(ctx.activeRuns?.get(ctx.scope)),
5969
5969
  queue: ctx.processPool?.snapshot(),
@@ -6069,6 +6069,13 @@ async function handleSwitch(args, ctx) {
6069
6069
  function isSwitchableAgentKind(value) {
6070
6070
  return value === "claude" || value === "codex" || value === "cursor";
6071
6071
  }
6072
+ function resolveStatusAgentName(ctx) {
6073
+ if (ctx.runtime?.agentUnavailable) {
6074
+ const kind = ctx.profileConfig?.agentKind ?? "agent";
6075
+ return `${kind}\uFF08\u4E0D\u53EF\u7528\uFF09`;
6076
+ }
6077
+ return ctx.agent?.displayName ?? ctx.profileConfig?.agentKind ?? "unknown";
6078
+ }
6072
6079
  function runtimeAccessStatus(profile) {
6073
6080
  if (!profile) return { label: "access", value: "unknown" };
6074
6081
  if (profile.agentKind === "claude") {
@@ -6206,8 +6213,9 @@ function log2(level, phase, detail) {
6206
6213
  async function startChannel(cfg, startOpts = {}) {
6207
6214
  const fullCfg = startOpts.cfg ?? cfg;
6208
6215
  const configPath = startOpts.configPath ?? paths.configFile;
6216
+ const profileConfig = toProfileConfig(fullCfg);
6209
6217
  const agentEnabled = Boolean(startOpts.agent) && isAgentEnabled(fullCfg);
6210
- const profileConfig = agentEnabled ? toProfileConfig(fullCfg) : void 0;
6218
+ const agentUnavailable = startOpts.agentUnavailable === true;
6211
6219
  configureLogger({ logsDir: `${paths.rootDir}/logs` });
6212
6220
  const { app } = cfg.accounts;
6213
6221
  const workspaces = startOpts.workspaces ?? new WorkspaceStore();
@@ -6231,6 +6239,7 @@ async function startChannel(cfg, startOpts = {}) {
6231
6239
  agent: startOpts.agent,
6232
6240
  executor: agentEnabled && startOpts.agent ? new RunExecutor({ agent: startOpts.agent, pool, activeRuns }) : void 0,
6233
6241
  agentEnabled,
6242
+ agentUnavailable,
6234
6243
  cursorDebug: startOpts.cursorDebug === true,
6235
6244
  configPath
6236
6245
  };
@@ -6341,10 +6350,11 @@ async function startChannel(cfg, startOpts = {}) {
6341
6350
  bot: identity?.name ?? "unknown",
6342
6351
  openId: identity?.openId ?? "-",
6343
6352
  appId: app.id,
6344
- agent: runtime.agentEnabled ? runtime.profileConfig?.agentKind : "disabled"
6353
+ agent: agentEnabled ? profileConfig.agentKind : agentUnavailable ? "unavailable" : "disabled"
6345
6354
  });
6346
6355
  console.log(
6347
- runtime.agentEnabled ? `\u6B63\u5728\u76D1\u542C\u6D88\u606F\uFF08agent: ${runtime.profileConfig?.agentKind ?? "unknown"}\uFF09\u3002\u6309 Ctrl+C \u9000\u51FA\u3002
6356
+ agentEnabled ? `\u6B63\u5728\u76D1\u542C\u6D88\u606F\uFF08agent: ${profileConfig.agentKind}\uFF09\u3002\u6309 Ctrl+C \u9000\u51FA\u3002
6357
+ ` : agentUnavailable ? `\u6B63\u5728\u76D1\u542C\u6D88\u606F\uFF08agent \u4E0D\u53EF\u7528\uFF0C\u659C\u6760\u547D\u4EE4\u4E0E\u56FA\u5B9A\u56DE\u590D\u4ECD\u53EF\u7528\uFF09\u3002\u6309 Ctrl+C \u9000\u51FA\u3002
6348
6358
  ` : "\u6B63\u5728\u76D1\u542C\u6D88\u606F\u3002\u6309 Ctrl+C \u9000\u51FA\u3002\n"
6349
6359
  );
6350
6360
  return {
@@ -6461,14 +6471,16 @@ async function runStart(opts) {
6461
6471
  const sessionCatalog = new SessionCatalog();
6462
6472
  await sessionCatalog.load();
6463
6473
  let agent;
6474
+ let agentUnavailable = false;
6464
6475
  if (agentKind !== "disabled") {
6465
6476
  agent = createRuntimeAgent(fullCfg, { configPath, cursorDebug: opts.debug });
6466
6477
  const availability = await checkRuntimeAgentAvailability(agent);
6467
6478
  if (!availability.ok) {
6468
- console.error(availability.message);
6469
- process.exit(1);
6470
- }
6471
- if (agentKind === "claude") {
6479
+ console.warn("\u26A0 Agent \u4E0D\u53EF\u7528\uFF0C\u670D\u52A1\u5C06\u4EE5\u65E0 Agent \u6A21\u5F0F\u542F\u52A8\uFF08/cmd\u3001/status \u7B49\u547D\u4EE4\u4ECD\u53EF\u7528\uFF09");
6480
+ console.warn(availability.message);
6481
+ agent = void 0;
6482
+ agentUnavailable = true;
6483
+ } else if (agentKind === "claude") {
6472
6484
  try {
6473
6485
  const claudePath = await resolveClaudeBinaryPath();
6474
6486
  console.log(`\u2713 Claude Code: ${claudePath}`);
@@ -6492,7 +6504,8 @@ async function runStart(opts) {
6492
6504
  sessions,
6493
6505
  sessionCatalog,
6494
6506
  cursorDebug: opts.debug,
6495
- configPath
6507
+ configPath,
6508
+ agentUnavailable
6496
6509
  });
6497
6510
  const shutdown = async (signal) => {
6498
6511
  console.log(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feishu-devops",
3
- "version": "26.627.0",
3
+ "version": "26.627.1",
4
4
  "description": "飞书消息 bot:扫码创建应用,通过 Claude Code / Codex 处理消息",
5
5
  "type": "module",
6
6
  "bin": {