deepcode-ai 1.1.31 → 1.1.32

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/dist/index.js CHANGED
@@ -6416,6 +6416,7 @@ var ProviderManager = class {
6416
6416
  const isPreferred = providerId === options.preferredProvider;
6417
6417
  const providerModel = isPreferred ? options.model : resolveConfiguredModelForProvider(this.config, providerId);
6418
6418
  if (!isPreferred && !providerModel) continue;
6419
+ validateModelForProvider(providerId, providerModel);
6419
6420
  for (let attempt = 0; attempt <= this.retries; attempt += 1) {
6420
6421
  let emitted = false;
6421
6422
  try {
@@ -6453,6 +6454,7 @@ var ProviderManager = class {
6453
6454
  );
6454
6455
  }
6455
6456
  const model = normalizeProviderModelId(providerId, configuredModel);
6457
+ validateModelForProvider(providerId, model);
6456
6458
  const started = Date.now();
6457
6459
  const controller = new AbortController();
6458
6460
  const timeout = setTimeout(() => controller.abort(), options.timeoutMs ?? 15e3);
@@ -6483,6 +6485,26 @@ var ProviderManager = class {
6483
6485
  }
6484
6486
  }
6485
6487
  };
6488
+ var OPENROUTER_SUFFIX_RE = /:(?:free|nitro|extended|beta|floor|online)$/i;
6489
+ function validateModelForProvider(providerId, model) {
6490
+ if (!model || providerId === "openrouter") return;
6491
+ if (OPENROUTER_SUFFIX_RE.test(model)) {
6492
+ throw new ProviderError(
6493
+ `Model "${model}" uses an OpenRouter-specific variant suffix (e.g. :free, :nitro). Set provider to "openrouter" instead of "${providerId}".`,
6494
+ providerId
6495
+ );
6496
+ }
6497
+ const slash = model.indexOf("/");
6498
+ if (slash > 0) {
6499
+ const prefix = model.slice(0, slash);
6500
+ if (PROVIDER_IDS.includes(prefix) && prefix !== providerId) {
6501
+ throw new ProviderError(
6502
+ `Model "${model}" belongs to provider "${prefix}" but is being used with "${providerId}". Switch provider to "${prefix}" or use a model native to "${providerId}".`,
6503
+ providerId
6504
+ );
6505
+ }
6506
+ }
6507
+ }
6486
6508
  function backoffMs(attempt) {
6487
6509
  return Math.min(250 * 2 ** attempt, 2e3);
6488
6510
  }
@@ -28269,7 +28291,7 @@ function parseVersion2(version) {
28269
28291
  if (!match) return null;
28270
28292
  return [Number(match[1]), Number(match[2]), Number(match[3])];
28271
28293
  }
28272
- var VERSION = "1.1.31".length > 0 ? "1.1.31" : "0.0.0-dev";
28294
+ var VERSION = "1.1.32".length > 0 ? "1.1.32" : "0.0.0-dev";
28273
28295
  var updateCommand = {
28274
28296
  name: "update",
28275
28297
  description: "Check published DeepCode versions",
@@ -29906,6 +29928,8 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
29906
29928
  const lastSubmittedPromptRef = useRef17(null);
29907
29929
  const runStartedAtRef = useRef17(null);
29908
29930
  const streamingResponseLengthRef = useRef17(0);
29931
+ const pendingTextBufferRef = useRef17("");
29932
+ const taskStreamsBufferRef = useRef17({});
29909
29933
  const drainingQueueRef = useRef17(false);
29910
29934
  const messageQueueRef = useRef17([]);
29911
29935
  const sessionShellAllowlistRef = useRef17(/* @__PURE__ */ new Set());
@@ -30182,6 +30206,28 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
30182
30206
  }, 250);
30183
30207
  return () => clearInterval(interval);
30184
30208
  }, [isRunning]);
30209
+ useEffect27(() => {
30210
+ const id = setInterval(() => {
30211
+ const text = pendingTextBufferRef.current;
30212
+ if (text) {
30213
+ pendingTextBufferRef.current = "";
30214
+ setPendingAssistantText((prev) => prev + text);
30215
+ }
30216
+ const taskBuf = taskStreamsBufferRef.current;
30217
+ const taskKeys = Object.keys(taskBuf);
30218
+ if (taskKeys.length > 0) {
30219
+ taskStreamsBufferRef.current = {};
30220
+ setTaskStreams((prev) => {
30221
+ const next = { ...prev };
30222
+ for (const taskId of taskKeys) {
30223
+ next[taskId] = (next[taskId] ?? "") + taskBuf[taskId];
30224
+ }
30225
+ return next;
30226
+ });
30227
+ }
30228
+ }, 50);
30229
+ return () => clearInterval(id);
30230
+ }, []);
30185
30231
  useEffect27(() => {
30186
30232
  let mounted = true;
30187
30233
  const initialize = async () => {
@@ -30431,6 +30477,8 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
30431
30477
  historyManager.addItem({ type: "user", text: prompt }, Date.now());
30432
30478
  lastSubmittedPromptRef.current = prompt;
30433
30479
  setPromptSuggestion(null);
30480
+ pendingTextBufferRef.current = "";
30481
+ taskStreamsBufferRef.current = {};
30434
30482
  setPendingAssistantText("");
30435
30483
  setIsRunning(true);
30436
30484
  setIsReceivingContent(false);
@@ -30451,15 +30499,12 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
30451
30499
  signal: controller.signal,
30452
30500
  onChunk: (text) => {
30453
30501
  streamingResponseLengthRef.current += text.length;
30454
- setPendingAssistantText((prev) => prev + text);
30502
+ pendingTextBufferRef.current += text;
30455
30503
  setIsReceivingContent(true);
30456
30504
  },
30457
30505
  onChunkForTask: (taskId, text) => {
30458
30506
  streamingResponseLengthRef.current += text.length;
30459
- setTaskStreams((prev) => ({
30460
- ...prev,
30461
- [taskId]: (prev[taskId] ?? "") + text
30462
- }));
30507
+ taskStreamsBufferRef.current[taskId] = (taskStreamsBufferRef.current[taskId] ?? "") + text;
30463
30508
  setIsReceivingContent(true);
30464
30509
  },
30465
30510
  onUsage: (inputTokens, outputTokens) => {
@@ -30515,6 +30560,8 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
30515
30560
  );
30516
30561
  } finally {
30517
30562
  abortRef.current = null;
30563
+ pendingTextBufferRef.current = "";
30564
+ taskStreamsBufferRef.current = {};
30518
30565
  setPendingAssistantText("");
30519
30566
  setIsRunning(false);
30520
30567
  setLiveToolCalls([]);