@widgetic/creator 0.3.56 → 0.3.57

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.
@@ -3591,12 +3591,12 @@
3591
3591
  const buildSha = import.meta.env.VITE_BUILD_SHA || 'local';
3592
3592
  const buildLabel = `v${appVersion} · ${buildSha}`;
3593
3593
 
3594
- // Default coder: host prop (site embed) wins. Fallback Flash for speed.
3594
+ // Default coder: host prop (site embed) wins. Fallback = first catalog model (DeepSeek V4.1 Flash on Baseten).
3595
3595
  const hostCoderModelId = (defaultCoderModelId || '').trim() || null;
3596
3596
  const hostPlannerRaw = (defaultPlannerModelId || '').trim();
3597
3597
  const hostPlannerModelId =
3598
3598
  !hostPlannerRaw || /^(none|skip)$/i.test(hostPlannerRaw) ? null : hostPlannerRaw;
3599
- let defaultModelId = hostCoderModelId || 'baseten-glm-5.3-fast';
3599
+ let defaultModelId = hostCoderModelId || 'baseten-deepseek-v4.1-flash';
3600
3600
 
3601
3601
  // Available LLM models for code generation
3602
3602
  interface LLMModelOption {
@@ -3607,18 +3607,18 @@
3607
3607
  supportsVision?: boolean;
3608
3608
  }
3609
3609
 
3610
- // Default fallback models in case API fails (one from each provider)
3610
+ // Default fallback models in case API fails (order mirrors llm-models.catalog.json)
3611
3611
  const fallbackModels: LLMModelOption[] = [
3612
+ { id: 'baseten-deepseek-v4.1-flash', name: 'DeepSeek V4.1 Flash (Baseten)', provider: 'Baseten', description: 'V4.1 Flash via Baseten Model APIs', supportsVision: true },
3612
3613
  { id: 'baseten-glm-5.3-fast', name: 'GLM 5.3 Fast (Baseten)', provider: 'Baseten', description: 'Lower-latency GLM 5.3 on Baseten Fast capacity', supportsVision: true },
3613
3614
  { id: 'baseten-glm-5.3-flash', name: 'GLM 5.3 Flash (Baseten)', provider: 'Baseten', description: 'Cheaper GLM via Baseten Model APIs', supportsVision: true },
3614
3615
  { id: 'zhipu-glm-5.3-flash', name: 'GLM 5.3 Flash (Z.ai)', provider: 'Zhipu', description: 'Cheapest vision + coding model', supportsVision: true },
3616
+ { id: 'deepseek-v4.1-flash', name: 'DeepSeek V4.1 Flash (DeepSeek API)', provider: 'DeepSeek', description: 'V4.1 Flash via DeepSeek direct API', supportsVision: true },
3615
3617
  { id: 'deepseek-v4-pro', name: 'DeepSeek V4 Pro', provider: 'DeepSeek', description: 'Frontier coding model, 1M context', supportsVision: false },
3616
- { id: 'deepseek-v4-flash', name: 'DeepSeek V4 Flash', provider: 'DeepSeek', description: 'Fast and cost-efficient', supportsVision: false },
3617
- { id: 'openai-gpt-5.4', name: 'GPT-5.4 (OpenAI)', provider: 'OpenAI', description: 'Affordable model for coding', supportsVision: true },
3618
- { id: 'openai-gpt-5.5', name: 'GPT-5.5 (OpenAI)', provider: 'OpenAI', description: 'Frontier model for complex work', supportsVision: true },
3618
+ { id: 'deepseek-v4-flash', name: 'DeepSeek V4 Flash', provider: 'DeepSeek', description: 'Legacy id; routes to V4.1 Flash', supportsVision: true },
3619
3619
  { id: 'openai-codex-3.2', name: 'Codex 3.2 (OpenAI)', provider: 'OpenAI', description: 'Coding-specialized model', supportsVision: false },
3620
- { id: 'gemini-3-flash', name: 'Gemini 3 Flash (Google)', provider: 'Google', description: 'Google\'s fast Gemini model', supportsVision: true },
3621
- { id: 'anthropic-claude-sonnet-4.6', name: 'Claude Sonnet 4.6 (Anthropic)', provider: 'Anthropic', description: 'Best balance of intelligence, speed, and cost', supportsVision: true },
3620
+ { id: 'openai-gpt-5.5', name: 'GPT-5.5 (OpenAI)', provider: 'OpenAI', description: 'Frontier model for complex work', supportsVision: true },
3621
+ { id: 'gemini-3.8-flash', name: 'Gemini 3.8 Flash (Google)', provider: 'Google', description: 'Most capable Gemini Flash', supportsVision: true },
3622
3622
  ];
3623
3623
 
3624
3624
  // Models loaded from API (single source of truth)
@@ -3644,10 +3644,18 @@
3644
3644
  supportsVision: m.supportsVision === true,
3645
3645
  }));
3646
3646
 
3647
- // Model LIST + default coder come from GET /models (API / Doppler).
3647
+ // Model LIST from GET /models. Selection: host pin → first listed
3648
+ // (catalog puts DeepSeek V4.1 Flash Baseten first) → API default → fallback.
3648
3649
  const apiCoderId = (response as any).defaultModelId || (response as any).data?.defaultModelId;
3649
3650
  const firstListedId = availableModels[0]?.id;
3650
- defaultModelId = hostCoderModelId || apiCoderId || firstListedId || defaultModelId;
3651
+ const listedIds = new Set(availableModels.map((m) => m.id));
3652
+ const pickListed = (id: string | null | undefined) =>
3653
+ id && listedIds.has(id) ? id : null;
3654
+ defaultModelId =
3655
+ pickListed(hostCoderModelId) ||
3656
+ pickListed(firstListedId) ||
3657
+ pickListed(apiCoderId) ||
3658
+ defaultModelId;
3651
3659
  userSelectedModelId = defaultModelId;
3652
3660
  console.log('[WidgetCreator] Default coder model', {
3653
3661
  defaultModelId,
@@ -3723,6 +3731,11 @@
3723
3731
 
3724
3732
  // Get selected model object
3725
3733
  $: selectedModel = availableModels.find(m => m.id === selectedModelId) || availableModels[0];
3734
+ $: modelDropdownItems = availableModels.map((model) => ({
3735
+ id: model.id,
3736
+ name: model.name,
3737
+ badge: model.provider,
3738
+ }));
3726
3739
 
3727
3740
  // Handle model selection (only used in debug mode)
3728
3741
  function handleModelSelect(modelId: string) {
@@ -13234,22 +13247,21 @@ $: if (codeGenerationPrompt && selectedWidgetId && promptLoadedForWidgetId === s
13234
13247
  <div class="generation-chat-sticky-header shrink-0 z-20 bg-white border-b border-gray-200">
13235
13248
  <!-- svelte-ignore a11y_label_has_associated_control -->
13236
13249
  <div class="generation-models-header flex items-center justify-end gap-2 px-2 py-1.5 bg-gray-50">
13237
- <span class="text-[10px] font-semibold text-gray-500 uppercase tracking-wide shrink-0">Model</span>
13238
13250
  <div class="coder-model-selector flex items-center justify-end min-w-0">
13239
- <select
13240
- class="coder-model-dropdown w-max max-w-full text-[11px] border border-gray-300 rounded px-1.5 py-0.5 bg-white text-gray-700 cursor-pointer focus:outline-none focus:border-blue-400"
13241
- style="width: {Math.max(18, (availableModels.reduce((longest, model) => model.name.length > longest.length ? model.name : longest, '').length) + 3)}ch"
13242
- value={userSelectedModelId}
13243
- onchange={(e) => handleModelSelect(e.currentTarget.value)}
13244
- >
13245
- {#if modelsLoading}
13246
- <option value="" disabled>Loading...</option>
13247
- {:else}
13248
- {#each availableModels as model (model.id)}
13249
- <option value={model.id}>{model.name}</option>
13250
- {/each}
13251
- {/if}
13252
- </select>
13251
+ <SelectorDropdown
13252
+ class="coder-model-dropdown"
13253
+ label="Model"
13254
+ labelPosition="inline"
13255
+ items={modelDropdownItems}
13256
+ selectedId={userSelectedModelId}
13257
+ placeholder={modelsLoading ? 'Loading…' : 'Select model'}
13258
+ nameWidth="240px"
13259
+ accentColor="#314F2F"
13260
+ showNewButton={false}
13261
+ allowRename={false}
13262
+ loading={modelsLoading}
13263
+ onselect={(item) => handleModelSelect(item.id)}
13264
+ />
13253
13265
  </div>
13254
13266
  </div>
13255
13267
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/creator",
3
- "version": "0.3.56",
3
+ "version": "0.3.57",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "@sveltejs/kit": "^2.20.0",