vibe-coding-master 0.4.27 → 0.4.28

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.
@@ -476,6 +476,7 @@ export function createSessionService(deps) {
476
476
  await deps.runtime.stop(existing.id);
477
477
  }
478
478
  deps.registry.remove(existing.id);
479
+ await clearPersistedTranslatorSession(deps.fs, repoRoot);
479
480
  return launchProjectTranslatorSession(repoRoot, input, "fresh");
480
481
  },
481
482
  async getProjectTranslatorSession(repoRoot) {
@@ -601,6 +602,7 @@ export function createSessionService(deps) {
601
602
  await deps.runtime.stop(existing.id);
602
603
  }
603
604
  deps.registry.remove(existing.id);
605
+ await clearPersistedHarnessEngineerSession(deps.fs, repoRoot);
604
606
  return launchProjectHarnessEngineerSession(repoRoot, input, "fresh");
605
607
  },
606
608
  async getProjectHarnessEngineerSession(repoRoot) {
@@ -737,6 +739,9 @@ export function createSessionService(deps) {
737
739
  await deps.runtime.stop(existing.id);
738
740
  }
739
741
  deps.registry.remove(existing.id);
742
+ const config = await deps.projectService.loadConfig(repoRoot);
743
+ const task = await deps.taskService.loadTask(repoRoot, taskSlug);
744
+ await clearPersistedRoleSessionRecord(deps.fs, getTaskRuntimeRepoRoot(task), config.stateRoot, taskSlug, role, now());
740
745
  return launchRoleSession(repoRoot, taskSlug, role, input, "fresh");
741
746
  },
742
747
  async getRoleSession(repoRoot, taskSlug, role) {
@@ -1125,6 +1130,23 @@ async function persistTaskSession(fs, repoRoot, stateRoot, session) {
1125
1130
  }
1126
1131
  });
1127
1132
  }
1133
+ async function clearPersistedRoleSessionRecord(fs, repoRoot, stateRoot, taskSlug, role, updatedAt) {
1134
+ const sessionPath = getTaskSessionPath(repoRoot, stateRoot, taskSlug);
1135
+ const current = await fs.pathExists(sessionPath)
1136
+ ? await fs.readJson(sessionPath)
1137
+ : createEmptyTaskSessionRecord(taskSlug, updatedAt);
1138
+ await fs.writeJsonAtomic(sessionPath, {
1139
+ ...current,
1140
+ updatedAt,
1141
+ roles: {
1142
+ ...current.roles,
1143
+ [role]: {
1144
+ id: null,
1145
+ status: "not_started"
1146
+ }
1147
+ }
1148
+ });
1149
+ }
1128
1150
  async function persistRoleSessionRecord(fs, baseRepoRoot, taskRepoRoot, stateRoot, session) {
1129
1151
  if (session.role === TRANSLATOR_ROLE) {
1130
1152
  await persistTranslatorSession(fs, baseRepoRoot, session);
@@ -1150,6 +1172,9 @@ async function persistTranslatorSession(fs, repoRoot, session) {
1150
1172
  }
1151
1173
  });
1152
1174
  }
1175
+ async function clearPersistedTranslatorSession(fs, repoRoot) {
1176
+ await removePersistedProjectSessionFile(fs, repoRoot, TRANSLATOR_SESSION_PATH);
1177
+ }
1153
1178
  async function persistHarnessEngineerSession(fs, repoRoot, session) {
1154
1179
  if (!hasConfirmedClaudeSessionId(session)) {
1155
1180
  return;
@@ -1164,6 +1189,24 @@ async function persistHarnessEngineerSession(fs, repoRoot, session) {
1164
1189
  }
1165
1190
  });
1166
1191
  }
1192
+ async function clearPersistedHarnessEngineerSession(fs, repoRoot) {
1193
+ await removePersistedProjectSessionFile(fs, repoRoot, HARNESS_ENGINEER_SESSION_PATH);
1194
+ }
1195
+ async function removePersistedProjectSessionFile(fs, repoRoot, relativePath) {
1196
+ const sessionPath = resolveRepoPath(repoRoot, relativePath);
1197
+ if (!(await fs.pathExists(sessionPath))) {
1198
+ return;
1199
+ }
1200
+ if (!fs.removePath) {
1201
+ throw new VcmError({
1202
+ code: "SESSION_CLEAR_UNAVAILABLE",
1203
+ message: "VCM cannot clear the persisted Claude session file in this runtime.",
1204
+ statusCode: 500,
1205
+ hint: `Remove ${relativePath} manually before restarting the role.`
1206
+ });
1207
+ }
1208
+ await fs.removePath(sessionPath, { force: true });
1209
+ }
1167
1210
  function isProjectRoleSessionFile(value) {
1168
1211
  return "record" in value && typeof value.record === "object" && value.record !== null;
1169
1212
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-coding-master",
3
- "version": "0.4.27",
3
+ "version": "0.4.28",
4
4
  "description": "Local GUI session cockpit for Claude Code role sessions.",
5
5
  "type": "module",
6
6
  "files": [