vibe-coding-master 0.6.4 → 0.6.5

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.
@@ -3,7 +3,7 @@ import { VcmError } from "../errors.js";
3
3
  import { submitTerminalInput } from "../runtime/terminal-submit.js";
4
4
  import { getTaskRuntimeRepoRoot } from "../services/task-service.js";
5
5
  import { resolveExistingClaudeTranscriptPath } from "../services/claude-transcript-service.js";
6
- import { isFinalTurnTextEvent, readTranscriptTextEvents, selectLatestTurnReply } from "../services/claude-transcript-reply.js";
6
+ import { isFinalTurnTextEvent, readTranscriptTextEvents } from "../services/claude-transcript-reply.js";
7
7
  import { parseGatewayCommand } from "./gateway-command-parser.js";
8
8
  import { createLarkRegistrationClient } from "./channels/lark-registration.js";
9
9
  const QR_LOGIN_TTL_MS = 8 * 60 * 1000;
@@ -1128,14 +1128,12 @@ export function createGatewayService(deps) {
1128
1128
  if (nextEvents.length === 0) {
1129
1129
  return;
1130
1130
  }
1131
- const text = nextEvents.map((event) => event.text).join("\n\n").trim();
1131
+ const latestReply = toGatewayPmReply(nextEvents[nextEvents.length - 1]);
1132
+ const text = latestReply.text.trim();
1132
1133
  if (!text) {
1133
1134
  return;
1134
1135
  }
1135
- const latestReply = selectLatestTurnReply(nextEvents, input.session);
1136
- if (latestReply) {
1137
- await saveLatestPmReply(input, latestReply);
1138
- }
1136
+ await saveLatestPmReply(input, latestReply);
1139
1137
  const account = toAccount(settings);
1140
1138
  const boundUserId = settings.binding.boundUserId;
1141
1139
  // A disarmed gateway never touches the channel: skip the outbound push.
@@ -1153,7 +1151,7 @@ export function createGatewayService(deps) {
1153
1151
  repoRoot: input.repoRoot,
1154
1152
  taskSlug: input.taskSlug,
1155
1153
  sourceText: text,
1156
- sourceEntryIds: nextEvents.map((event) => event.id)
1154
+ sourceEntryIds: latestReply.transcriptEventId ? [latestReply.transcriptEventId] : undefined
1157
1155
  });
1158
1156
  await sendGatewayText(settings, boundUserId, output.translationFailed
1159
1157
  ? formatGatewayPmTranslationFailure(output.translationError)
@@ -1162,15 +1160,14 @@ export function createGatewayService(deps) {
1162
1160
  else {
1163
1161
  clearFailedTranslation(input.repoRoot, input.taskSlug);
1164
1162
  }
1165
- const lastEvent = nextEvents.at(-1);
1166
1163
  const current = await deps.settings.loadSettings();
1167
1164
  await deps.settings.saveSettings({
1168
1165
  ...current,
1169
1166
  pushCursors: {
1170
1167
  ...current.pushCursors,
1171
1168
  [cursorKey]: {
1172
- lastTranscriptEventId: lastEvent?.id ?? null,
1173
- lastTranscriptTimestamp: lastEvent?.timestamp ?? null
1169
+ lastTranscriptEventId: latestReply.transcriptEventId,
1170
+ lastTranscriptTimestamp: latestReply.transcriptTimestamp
1174
1171
  }
1175
1172
  },
1176
1173
  lastMessageStatus: {
@@ -1429,6 +1426,14 @@ export function createGatewayService(deps) {
1429
1426
  lastFailedTranslation = null;
1430
1427
  }
1431
1428
  }
1429
+ function toGatewayPmReply(event) {
1430
+ return {
1431
+ text: event.text,
1432
+ truncated: false,
1433
+ transcriptEventId: event.id,
1434
+ transcriptTimestamp: event.timestamp
1435
+ };
1436
+ }
1432
1437
  async function saveLatestPmReply(input, reply) {
1433
1438
  const settings = await deps.settings.loadSettings();
1434
1439
  const key = latestPmReplyKey(input.repoRoot, input.taskSlug);
@@ -1080,18 +1080,12 @@ export function createTranslationService(deps) {
1080
1080
  if (reusable) {
1081
1081
  return reusable.trim();
1082
1082
  }
1083
- const translation = await translateText({
1084
- repoRoot: input.repoRoot,
1085
- taskSlug: input.taskSlug,
1086
- role: input.role,
1087
- direction: "cc-output-to-user",
1088
- text: input.text,
1089
- sourceKind: "prose",
1090
- sourceLanguage: "en",
1091
- targetLanguage: config.targetLanguage,
1092
- config
1083
+ throw new VcmError({
1084
+ code: "GATEWAY_TRANSLATION_RESULT_MISSING",
1085
+ message: "Gateway output translation is not available in the current translation panel.",
1086
+ statusCode: 409,
1087
+ hint: "Wait for the translation panel to finish translating the PM final reply, then retry from Gateway."
1093
1088
  });
1094
- return translation.text.trim();
1095
1089
  },
1096
1090
  getDiagnostics() {
1097
1091
  let transcriptWatchers = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-coding-master",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Local GUI session cockpit for Claude Code role sessions.",
5
5
  "type": "module",
6
6
  "files": [