vibe-coding-master 0.8.1 → 0.8.2

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.
@@ -1,4 +1,5 @@
1
1
  import path from "node:path";
2
+ import { isVcmRoleName } from "../../shared/constants.js";
2
3
  import { resolveVcmDataDir } from "../vcm-data-dir.js";
3
4
  const DEFAULT_BASE_URL = "https://ilinkai.weixin.qq.com";
4
5
  const DEFAULT_GATEWAY_CHANNEL = "weixin-ilink";
@@ -41,6 +42,7 @@ export function createGatewaySettingsService(deps) {
41
42
  translationEnabled: input.translationEnabled ?? current.translationEnabled,
42
43
  currentProjectId: input.currentProjectId !== undefined ? normalizeNullableString(input.currentProjectId) : current.currentProjectId,
43
44
  currentTaskSlug: input.currentTaskSlug !== undefined ? normalizeNullableString(input.currentTaskSlug) : current.currentTaskSlug,
45
+ targetRole: input.targetRole ?? current.targetRole,
44
46
  binding: {
45
47
  ...current.binding,
46
48
  baseUrl: input.baseUrl !== undefined
@@ -71,7 +73,7 @@ export function createGatewaySettingsService(deps) {
71
73
  recentInboundMessageIds: []
72
74
  },
73
75
  pushCursors: {},
74
- latestPmReplies: current.latestPmReplies,
76
+ latestRoleReplies: current.latestRoleReplies,
75
77
  lastPollStatus: {
76
78
  state: "idle"
77
79
  },
@@ -89,6 +91,8 @@ export function createGatewaySettingsService(deps) {
89
91
  translationEnabled: settings.translationEnabled,
90
92
  currentProjectId: settings.currentProjectId,
91
93
  currentTaskSlug: settings.currentTaskSlug,
94
+ targetRole: settings.targetRole,
95
+ targetRoleSessionStatus: null,
92
96
  binding: {
93
97
  accountId: settings.binding.accountId,
94
98
  baseUrl: settings.binding.baseUrl,
@@ -128,9 +132,12 @@ export function normalizeSettings(input, timestamp, options = {
128
132
  ? input.pendingConfirmations
129
133
  : {};
130
134
  const pushCursors = isObject(input.pushCursors) ? input.pushCursors : {};
131
- const latestPmReplies = isObject(input.latestPmReplies)
132
- ? input.latestPmReplies
133
- : {};
135
+ const legacyInput = input;
136
+ const latestRoleReplies = isObject(input.latestRoleReplies)
137
+ ? input.latestRoleReplies
138
+ : isObject(legacyInput.latestPmReplies)
139
+ ? legacyInput.latestPmReplies
140
+ : {};
134
141
  return {
135
142
  version: 1,
136
143
  enabled: input.enabled === true,
@@ -138,6 +145,7 @@ export function normalizeSettings(input, timestamp, options = {
138
145
  translationEnabled: input.translationEnabled !== false,
139
146
  currentProjectId: normalizeNullableString(input.currentProjectId),
140
147
  currentTaskSlug: normalizeNullableString(input.currentTaskSlug),
148
+ targetRole: normalizeTargetRole(input.targetRole),
141
149
  binding: {
142
150
  ...createDefaultBinding(options.defaultBaseUrl),
143
151
  accountId: normalizeNullableString(bindingInput.accountId),
@@ -169,7 +177,7 @@ export function normalizeSettings(input, timestamp, options = {
169
177
  closeTask: normalizeCloseTaskConfirmation(pendingInput.closeTask)
170
178
  },
171
179
  pushCursors: normalizePushCursors(pushCursors),
172
- latestPmReplies: normalizeLatestPmReplies(latestPmReplies),
180
+ latestRoleReplies: normalizeLatestRoleReplies(latestRoleReplies),
173
181
  lastPollStatus: normalizePollStatus(input.lastPollStatus),
174
182
  lastMessageStatus: normalizeMessageStatus(input.lastMessageStatus),
175
183
  updatedAt: typeof input.updatedAt === "string" ? input.updatedAt : timestamp
@@ -200,6 +208,9 @@ function normalizeGatewayChannel(input, fallback) {
200
208
  function normalizeLarkDomain(input) {
201
209
  return input === "lark" || input === "feishu" ? input : null;
202
210
  }
211
+ function normalizeTargetRole(input) {
212
+ return typeof input === "string" && isVcmRoleName(input) ? input : "project-manager";
213
+ }
203
214
  function normalizeCloseTaskConfirmation(input) {
204
215
  if (!isObject(input)) {
205
216
  return null;
@@ -225,14 +236,15 @@ function normalizePushCursors(input) {
225
236
  }
226
237
  return out;
227
238
  }
228
- function normalizeLatestPmReplies(input) {
239
+ function normalizeLatestRoleReplies(input) {
229
240
  const out = {};
230
- for (const [key, value] of Object.entries(input)) {
241
+ for (const value of Object.values(input)) {
231
242
  if (!isObject(value)) {
232
243
  continue;
233
244
  }
234
245
  const repoRoot = normalizeNullableString(value.repoRoot);
235
246
  const taskSlug = normalizeNullableString(value.taskSlug);
247
+ const role = normalizeTargetRole("role" in value ? value.role : undefined);
236
248
  const sessionId = normalizeNullableString(value.sessionId);
237
249
  const claudeSessionId = normalizeNullableString(value.claudeSessionId);
238
250
  const capturedAt = normalizeNullableString(value.capturedAt);
@@ -240,9 +252,10 @@ function normalizeLatestPmReplies(input) {
240
252
  if (!repoRoot || !taskSlug || !sessionId || !claudeSessionId || !capturedAt || !text) {
241
253
  continue;
242
254
  }
243
- out[key] = {
255
+ out[JSON.stringify([repoRoot, taskSlug, role])] = {
244
256
  repoRoot,
245
257
  taskSlug,
258
+ role,
246
259
  sessionId,
247
260
  claudeSessionId,
248
261
  transcriptEventId: normalizeNullableString(value.transcriptEventId),
@@ -568,8 +568,8 @@ export function createClaudeHookService(deps) {
568
568
  if (eventName === "Stop" && input.role === "architect" && session) {
569
569
  await deps.architectRestartService?.recordArchitectStop(context.project.repoRoot, context.taskSlug, session.id);
570
570
  }
571
- if (options.notifyGateway && session && input.role === "project-manager") {
572
- void deps.gatewayService?.handlePmStop({
571
+ if (options.notifyGateway && session && isVcmRoleName(input.role)) {
572
+ void deps.gatewayService?.handleRoleStop({
573
573
  repoRoot: context.project.repoRoot,
574
574
  taskSlug: context.taskSlug,
575
575
  session
@@ -1675,7 +1675,8 @@ function normalizeClaudePermissionMode(value) {
1675
1675
  return "default";
1676
1676
  }
1677
1677
  function normalizeClaudeModel(value) {
1678
- if (value === "opus"
1678
+ if (value === "claude-fable-5-1"
1679
+ || value === "opus"
1679
1680
  || value === "claude-opus-4-8"
1680
1681
  || value === "sonnet"
1681
1682
  || value === "fable"
@@ -1096,7 +1096,7 @@ export function createTranslationService(deps) {
1096
1096
  code: "GATEWAY_TRANSLATION_RESULT_MISSING",
1097
1097
  message: "Gateway output translation is not available in the current translation panel.",
1098
1098
  statusCode: 409,
1099
- hint: "Wait for the translation panel to finish translating the PM final reply, then retry from Gateway."
1099
+ hint: "Wait for the translation panel to finish translating the selected role's Round Final Reply, then retry from Gateway."
1100
1100
  });
1101
1101
  },
1102
1102
  async shouldDelayFlowPauseNotification(input) {
@@ -23,10 +23,17 @@ export const CLAUDE_MODEL_OPTIONS = [
23
23
  source: "claude",
24
24
  available: true
25
25
  },
26
+ {
27
+ value: "claude-fable-5-1",
28
+ label: "Fable 5.1",
29
+ description: "Pinned Claude Fable 5.1",
30
+ source: "claude",
31
+ available: true
32
+ },
26
33
  {
27
34
  value: "fable",
28
- label: "Fable",
29
- description: "Claude Fable",
35
+ label: "Fable Alias",
36
+ description: "Claude Code provider-selected Fable",
30
37
  source: "claude",
31
38
  available: true
32
39
  },