vibe-coding-master 0.7.12 → 0.7.14

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.
package/README.md CHANGED
@@ -250,11 +250,13 @@ from the container. In the VCM `Settings` section:
250
250
  4. select `GPT-5.6 Sol (CCR)` in any Session model control.
251
251
 
252
252
  The key is stored in global VCM state (`~/.vcm/settings.json`) with owner-only
253
- permissions and is never returned by the settings API. CCR settings are applied
254
- only to the child Claude Code process being launched. Native Claude selections
255
- remain unchanged. If CCR is disabled, unreachable, rejects the key, or does not
256
- expose `Codex API/gpt-5.6-sol`, VCM blocks the new Start, Resume, or Restart and
257
- does not fall back to another model.
253
+ permissions, is used only to check CCR and discover models, and is never
254
+ returned by the settings API. GPT sessions use the CCR-managed Claude Code
255
+ `apiKeyHelper`; VCM removes inherited Anthropic token variables only from those
256
+ child processes. Native Claude selections retain their existing launch and
257
+ authentication behavior. If CCR is disabled, unreachable, rejects the key, or
258
+ does not expose `Codex API/gpt-5.6-sol`, VCM blocks the new Start, Resume, or
259
+ Restart and does not fall back to another model.
258
260
 
259
261
  ## Launch Template
260
262
 
@@ -1,5 +1,6 @@
1
1
  import { CCR_GATEWAY_BASE_URL, CCR_GPT_MODEL_ID } from "../../shared/types/session.js";
2
2
  const DEFAULT_TIMEOUT_MS = 3_000;
3
+ const CCR_ENCODED_MODEL_PREFIX = "anthropic/claude-ccr-h";
3
4
  export function createCcrGatewayAdapter(deps = {}) {
4
5
  const baseUrl = (deps.baseUrl ?? CCR_GATEWAY_BASE_URL).replace(/\/+$/, "");
5
6
  const fetchImpl = deps.fetch ?? globalThis.fetch;
@@ -32,11 +33,11 @@ export function createCcrGatewayAdapter(deps = {}) {
32
33
  if (!models.response.ok) {
33
34
  return invalidResponse(`CCR model discovery returned HTTP ${models.response.status}.`);
34
35
  }
35
- const modelIds = readModelIds(models.payload);
36
- if (!modelIds) {
36
+ const modelDescriptors = readModelDescriptors(models.payload);
37
+ if (!modelDescriptors) {
37
38
  return invalidResponse("CCR returned an invalid /v1/models response.");
38
39
  }
39
- const modelAvailable = modelIds.includes(CCR_GPT_MODEL_ID);
40
+ const modelAvailable = modelDescriptors.some(isRequiredModel);
40
41
  return {
41
42
  connectionState: "available",
42
43
  modelAvailable,
@@ -91,18 +92,44 @@ function isCcrGateway(value) {
91
92
  || value.plugin === "claude-code-router"
92
93
  || value.core === "next-ai-gateway";
93
94
  }
94
- function readModelIds(value) {
95
+ function readModelDescriptors(value) {
95
96
  if (!isObject(value) || !Array.isArray(value.data)) {
96
97
  return undefined;
97
98
  }
98
- const ids = [];
99
+ const models = [];
99
100
  for (const item of value.data) {
100
101
  if (!isObject(item) || typeof item.id !== "string" || !item.id.trim()) {
101
102
  return undefined;
102
103
  }
103
- ids.push(item.id.trim());
104
+ models.push({
105
+ id: item.id.trim(),
106
+ ...(typeof item.display_name === "string" && item.display_name.trim()
107
+ ? { displayName: item.display_name.trim() }
108
+ : {})
109
+ });
110
+ }
111
+ return models;
112
+ }
113
+ function isRequiredModel(model) {
114
+ if (model.id === CCR_GPT_MODEL_ID) {
115
+ return true;
104
116
  }
105
- return ids;
117
+ const target = normalizeModelName(CCR_GPT_MODEL_ID);
118
+ return normalizeModelName(model.displayName) === target
119
+ || normalizeModelName(decodeCcrModelId(model.id)) === target;
120
+ }
121
+ function decodeCcrModelId(modelId) {
122
+ if (!modelId.startsWith(CCR_ENCODED_MODEL_PREFIX)) {
123
+ return undefined;
124
+ }
125
+ const encoded = modelId.slice(CCR_ENCODED_MODEL_PREFIX.length);
126
+ if (!encoded || encoded.length % 2 !== 0 || !/^[0-9a-f]+$/i.test(encoded)) {
127
+ return undefined;
128
+ }
129
+ return Buffer.from(encoded, "hex").toString("utf8");
130
+ }
131
+ function normalizeModelName(value) {
132
+ return (value ?? "").toLowerCase().replace(/[^a-z0-9]+/g, "");
106
133
  }
107
134
  function invalidResponse(error) {
108
135
  return {
@@ -258,6 +258,11 @@ export function buildPtyEnvironment(baseEnv, inputEnv = {}) {
258
258
  CLICOLOR: inputEnv.CLICOLOR ?? baseEnv.CLICOLOR ?? "1",
259
259
  TERM_PROGRAM: inputEnv.TERM_PROGRAM ?? "VibeCodingMaster"
260
260
  };
261
+ for (const [key, value] of Object.entries(inputEnv)) {
262
+ if (value === undefined) {
263
+ delete env[key];
264
+ }
265
+ }
261
266
  delete env.NO_COLOR;
262
267
  return env;
263
268
  }
@@ -147,7 +147,8 @@ export function createCcrIntegrationService(deps) {
147
147
  ANTHROPIC_BASE_URL: CCR_GATEWAY_BASE_URL,
148
148
  ANTHROPIC_API_BASE_URL: CCR_GATEWAY_BASE_URL,
149
149
  CLAUDE_AGENT_API_BASE_URL: CCR_GATEWAY_BASE_URL,
150
- ANTHROPIC_AUTH_TOKEN: settings.apiKey,
150
+ ANTHROPIC_AUTH_TOKEN: undefined,
151
+ ANTHROPIC_API_KEY: undefined,
151
152
  ANTHROPIC_MODEL: CCR_GPT_MODEL_ID,
152
153
  CCR_CLAUDE_CODE_MODEL: CCR_GPT_MODEL_ID,
153
154
  CODEXL_CLAUDE_CODE_MODEL: CCR_GPT_MODEL_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-coding-master",
3
- "version": "0.7.12",
3
+ "version": "0.7.14",
4
4
  "description": "Local GUI session cockpit for Claude Code role sessions.",
5
5
  "type": "module",
6
6
  "files": [