claude-codex-wechat 0.1.49 → 0.1.51

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/server/cli.js +34 -6
  2. package/package.json +1 -1
@@ -3251,6 +3251,8 @@ var ClaudeStreamingRunner = class {
3251
3251
  }
3252
3252
  session.turnCount += 1;
3253
3253
  yield { type: "message_done" };
3254
+ const resultError = extractResultError(record);
3255
+ if (resultError) yield { type: "error", error: resultError };
3254
3256
  if (session.pendingFollowUps > 0) {
3255
3257
  session.pendingFollowUps -= 1;
3256
3258
  continue;
@@ -3329,6 +3331,17 @@ function userEnvelope(text) {
3329
3331
  return `${JSON.stringify({ type: "user", message: { role: "user", content: text }, parent_tool_use_id: null })}
3330
3332
  `;
3331
3333
  }
3334
+ function extractResultError(record) {
3335
+ if (record.is_error !== true) return void 0;
3336
+ const errors = record.errors;
3337
+ if (Array.isArray(errors)) {
3338
+ const joined = errors.filter((item) => typeof item === "string" && item).join("; ");
3339
+ if (joined) return joined;
3340
+ }
3341
+ if (typeof record.result === "string" && record.result) return record.result;
3342
+ if (typeof record.subtype === "string" && record.subtype) return record.subtype;
3343
+ return JSON.stringify(record);
3344
+ }
3332
3345
  function extractError(record) {
3333
3346
  if (typeof record.message === "string") return record.message;
3334
3347
  if (record.error && typeof record.error === "object") {
@@ -3665,6 +3678,23 @@ function readTurnId(value) {
3665
3678
  if (typeof record.turnId === "string" && record.turnId) return record.turnId;
3666
3679
  return void 0;
3667
3680
  }
3681
+ function readTurnError(value) {
3682
+ if (!value || typeof value !== "object") return void 0;
3683
+ const record = value;
3684
+ const turn = record.turn && typeof record.turn === "object" ? record.turn : void 0;
3685
+ const raw = turn?.error ?? record.error;
3686
+ if (raw === void 0 || raw === null) return void 0;
3687
+ if (typeof raw === "string") return raw || void 0;
3688
+ if (typeof raw === "object") {
3689
+ const message = raw.message;
3690
+ if (typeof message === "string" && message) return message;
3691
+ }
3692
+ try {
3693
+ return JSON.stringify(raw);
3694
+ } catch {
3695
+ return String(raw);
3696
+ }
3697
+ }
3668
3698
  var CodexInteractiveRunner = class {
3669
3699
  sessions = /* @__PURE__ */ new Map();
3670
3700
  command;
@@ -3846,8 +3876,10 @@ var CodexInteractiveRunner = class {
3846
3876
  const turnId = readTurnId(params);
3847
3877
  if (turnId) session.activeTurnId = turnId;
3848
3878
  });
3849
- client.onNotification("turn/completed", () => {
3879
+ client.onNotification("turn/completed", (params) => {
3850
3880
  this.flushActiveMessage(session);
3881
+ const turnError = readTurnError(params);
3882
+ if (turnError) this.enqueueEvent(session, { type: "error", error: turnError });
3851
3883
  session.turnClosed = true;
3852
3884
  session.eventResolver?.();
3853
3885
  session.eventResolver = void 0;
@@ -4660,14 +4692,10 @@ var MessageRouter = class _MessageRouter {
4660
4692
  bridgeSessionId: current.id,
4661
4693
  cwd: current.cwd
4662
4694
  });
4663
- const version = await provider.getNativeVersion?.({
4664
- providerSessionId: reattached.providerSessionId ?? current.providerSessionId,
4665
- cwd: current.cwd
4666
- }).catch(() => null);
4667
4695
  this.conversation.update({
4668
4696
  providerSessionId: reattached.providerSessionId ?? current.providerSessionId,
4669
4697
  status: reattached.status,
4670
- lastSeenNativeFingerprint: version?.fingerprint,
4698
+ lastSeenNativeFingerprint: void 0,
4671
4699
  lastReloadedAt: Date.now(),
4672
4700
  staleReason: void 0,
4673
4701
  lastActivityAt: Date.now()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-codex-wechat",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.5.0",