@memtensor/memos-local-openclaw-plugin 1.0.0 → 1.0.2-beta.1

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 +1 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/viewer/html.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,mxvPAwgIf,CAAC"}
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/viewer/html.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,qgnQAiqIf,CAAC"}
@@ -515,6 +515,12 @@ input,textarea,select{font-family:inherit;font-size:inherit}
515
515
  .toggle-slider::before{content:'';position:absolute;height:14px;width:14px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:.2s}
516
516
  .toggle-switch input:checked+.toggle-slider{background:var(--pri)}
517
517
  .toggle-switch input:checked+.toggle-slider::before{transform:translateX(16px)}
518
+ .test-conn-row{display:flex;align-items:center;gap:10px;margin-top:12px;padding-top:10px;border-top:1px dashed var(--border)}
519
+ .test-conn-row .btn{font-size:11px;padding:5px 14px;border:1px solid var(--border);border-radius:6px}
520
+ .test-result{font-size:12px;line-height:1.5;word-break:break-word}
521
+ .test-result.ok{color:#22c55e}
522
+ .test-result.fail{color:var(--rose)}
523
+ .test-result.loading{color:var(--text-muted)}
518
524
  .settings-actions{display:flex;gap:12px;justify-content:flex-end;align-items:center;margin-top:16px;padding-top:16px;border-top:1px solid var(--border)}
519
525
  .settings-actions .btn{min-width:110px;padding:10px 20px;font-size:13px}
520
526
  .settings-actions .btn-primary{background:rgba(99,102,241,.08);color:var(--pri);border:1px solid rgba(99,102,241,.25);font-weight:600}
@@ -942,9 +948,12 @@ input,textarea,select{font-family:inherit;font-size:inherit}
942
948
  <div class="settings-grid">
943
949
  <div class="settings-field">
944
950
  <label data-i18n="settings.provider">Provider</label>
945
- <select id="cfgEmbProvider">
951
+ <select id="cfgEmbProvider" onchange="onProviderChange('embedding')">
946
952
  <option value="openai_compatible">OpenAI Compatible</option>
947
953
  <option value="openai">OpenAI</option>
954
+ <option value="siliconflow">SiliconFlow (\u7845\u57FA\u6D41\u52A8)</option>
955
+ <option value="zhipu">Zhipu AI (\u667A\u8C31)</option>
956
+ <option value="bailian">Alibaba Bailian (\u767E\u70BC)</option>
948
957
  <option value="gemini">Gemini</option>
949
958
  <option value="azure_openai">Azure OpenAI</option>
950
959
  <option value="cohere">Cohere</option>
@@ -966,6 +975,10 @@ input,textarea,select{font-family:inherit;font-size:inherit}
966
975
  <input type="password" id="cfgEmbApiKey" placeholder="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022">
967
976
  </div>
968
977
  </div>
978
+ <div class="test-conn-row">
979
+ <button class="btn btn-sm btn-ghost" onclick="testModel('embedding')" id="testEmbBtn" data-i18n="settings.test">Test Connection</button>
980
+ <span class="test-result" id="testEmbResult"></span>
981
+ </div>
969
982
  </div>
970
983
 
971
984
  <div class="settings-section">
@@ -973,9 +986,14 @@ input,textarea,select{font-family:inherit;font-size:inherit}
973
986
  <div class="settings-grid">
974
987
  <div class="settings-field">
975
988
  <label data-i18n="settings.provider">Provider</label>
976
- <select id="cfgSumProvider">
989
+ <select id="cfgSumProvider" onchange="onProviderChange('summarizer')">
977
990
  <option value="openai_compatible">OpenAI Compatible</option>
978
991
  <option value="openai">OpenAI</option>
992
+ <option value="siliconflow">SiliconFlow (\u7845\u57FA\u6D41\u52A8)</option>
993
+ <option value="zhipu">Zhipu AI (\u667A\u8C31)</option>
994
+ <option value="deepseek">DeepSeek</option>
995
+ <option value="bailian">Alibaba Bailian (\u767E\u70BC)</option>
996
+ <option value="moonshot">Moonshot (Kimi)</option>
979
997
  <option value="anthropic">Anthropic</option>
980
998
  <option value="gemini">Gemini</option>
981
999
  <option value="azure_openai">Azure OpenAI</option>
@@ -999,6 +1017,10 @@ input,textarea,select{font-family:inherit;font-size:inherit}
999
1017
  <input type="number" id="cfgSumTemp" step="0.1" min="0" max="2" placeholder="0">
1000
1018
  </div>
1001
1019
  </div>
1020
+ <div class="test-conn-row">
1021
+ <button class="btn btn-sm btn-ghost" onclick="testModel('summarizer')" id="testSumBtn" data-i18n="settings.test">Test Connection</button>
1022
+ <span class="test-result" id="testSumResult"></span>
1023
+ </div>
1002
1024
  </div>
1003
1025
  </div>
1004
1026
 
@@ -1028,10 +1050,15 @@ input,textarea,select{font-family:inherit;font-size:inherit}
1028
1050
  <div class="settings-grid">
1029
1051
  <div class="settings-field">
1030
1052
  <label data-i18n="settings.provider">Provider</label>
1031
- <select id="cfgSkillProvider">
1053
+ <select id="cfgSkillProvider" onchange="onProviderChange('skill')">
1032
1054
  <option value="">— <span data-i18n="settings.skill.usemain">Use main summarizer</span> —</option>
1033
1055
  <option value="openai_compatible">OpenAI Compatible</option>
1034
1056
  <option value="openai">OpenAI</option>
1057
+ <option value="siliconflow">SiliconFlow (\u7845\u57FA\u6D41\u52A8)</option>
1058
+ <option value="zhipu">Zhipu AI (\u667A\u8C31)</option>
1059
+ <option value="deepseek">DeepSeek</option>
1060
+ <option value="bailian">Alibaba Bailian (\u767E\u70BC)</option>
1061
+ <option value="moonshot">Moonshot (Kimi)</option>
1035
1062
  <option value="anthropic">Anthropic</option>
1036
1063
  <option value="gemini">Gemini</option>
1037
1064
  <option value="azure_openai">Azure OpenAI</option>
@@ -1051,6 +1078,10 @@ input,textarea,select{font-family:inherit;font-size:inherit}
1051
1078
  <input type="password" id="cfgSkillApiKey" placeholder="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022">
1052
1079
  </div>
1053
1080
  </div>
1081
+ <div class="test-conn-row">
1082
+ <button class="btn btn-sm btn-ghost" onclick="testModel('skill')" id="testSkillBtn" data-i18n="settings.test">Test Connection</button>
1083
+ <span class="test-result" id="testSkillResult"></span>
1084
+ </div>
1054
1085
  </div>
1055
1086
  </div>
1056
1087
 
@@ -1463,11 +1494,24 @@ const I18N={
1463
1494
  'settings.telemetry.hint':'Anonymous usage analytics to help improve the plugin. Only sends tool names, latencies, and version info. No memory content, queries, or personal data is ever sent.',
1464
1495
  'settings.viewerport':'Viewer Port',
1465
1496
  'settings.viewerport.hint':'Requires restart to take effect',
1497
+ 'settings.test':'Test Connection',
1498
+ 'settings.test.loading':'Testing...',
1499
+ 'settings.test.ok':'Connected',
1500
+ 'settings.test.fail':'Failed',
1466
1501
  'settings.save':'Save Settings',
1467
1502
  'settings.reset':'Reset',
1468
1503
  'settings.saved':'Saved',
1469
1504
  'settings.restart.hint':'Some changes require restarting the OpenClaw gateway to take effect.',
1470
1505
  'settings.save.fail':'Failed to save settings',
1506
+ 'settings.save.emb.required':'Embedding model is required. Please configure an embedding model before saving.',
1507
+ 'settings.save.emb.fail':'Embedding model test failed, cannot save',
1508
+ 'settings.save.sum.fail':'Summarizer model test failed, cannot save',
1509
+ 'settings.save.skill.fail':'Skill model test failed, cannot save',
1510
+ 'settings.save.sum.fallback':'Summarizer model is not configured — will use OpenClaw native model as fallback.',
1511
+ 'settings.save.skill.fallback':'Skill dedicated model is not configured — will use OpenClaw native model as fallback.',
1512
+ 'settings.save.fallback.model':'Fallback model: ',
1513
+ 'settings.save.fallback.none':'Not available (no OpenClaw native model found)',
1514
+ 'settings.save.fallback.confirm':'Continue to save?',
1471
1515
  'migrate.title':'Import OpenClaw Memory',
1472
1516
  'migrate.desc':'Migrate your existing OpenClaw built-in memories and conversation history into this plugin. The import process uses smart deduplication to avoid duplicates.',
1473
1517
  'migrate.modes.title':'Three ways to use:',
@@ -1574,7 +1618,10 @@ const I18N={
1574
1618
  'skill.cancel':'Cancel',
1575
1619
  'skill.delete.confirm':'Are you sure you want to delete this skill? This will also remove all associated files and cannot be undone.',
1576
1620
  'skill.delete.error':'Failed to delete skill: ',
1577
- 'skill.save.error':'Failed to save skill: '
1621
+ 'skill.save.error':'Failed to save skill: ',
1622
+ 'update.available':'New version available',
1623
+ 'update.run':'Run',
1624
+ 'update.dismiss':'Dismiss'
1578
1625
  },
1579
1626
  zh:{
1580
1627
  'title':'OpenClaw 记忆',
@@ -1756,11 +1803,24 @@ const I18N={
1756
1803
  'settings.telemetry.hint':'匿名使用统计,帮助改进插件。仅发送工具名称、响应时间和版本信息,不会发送任何记忆内容、搜索查询或个人数据。',
1757
1804
  'settings.viewerport':'Viewer 端口',
1758
1805
  'settings.viewerport.hint':'修改后需重启网关生效',
1806
+ 'settings.test':'测试连接',
1807
+ 'settings.test.loading':'测试中...',
1808
+ 'settings.test.ok':'连接成功',
1809
+ 'settings.test.fail':'连接失败',
1759
1810
  'settings.save':'保存设置',
1760
1811
  'settings.reset':'重置',
1761
1812
  'settings.saved':'已保存',
1762
1813
  'settings.restart.hint':'部分设置修改后需要重启 OpenClaw 网关才能生效。',
1763
1814
  'settings.save.fail':'保存设置失败',
1815
+ 'settings.save.emb.required':'嵌入模型为必填项,请先配置嵌入模型再保存。',
1816
+ 'settings.save.emb.fail':'嵌入模型测试失败,无法保存',
1817
+ 'settings.save.sum.fail':'摘要模型测试失败,无法保存',
1818
+ 'settings.save.skill.fail':'技能模型测试失败,无法保存',
1819
+ 'settings.save.sum.fallback':'摘要模型未配置 — 将使用 OpenClaw 原生模型作为降级方案。',
1820
+ 'settings.save.skill.fallback':'技能专用模型未配置 — 将使用 OpenClaw 原生模型作为降级方案。',
1821
+ 'settings.save.fallback.model':'降级模型:',
1822
+ 'settings.save.fallback.none':'不可用(未检测到 OpenClaw 原生模型)',
1823
+ 'settings.save.fallback.confirm':'是否继续保存?',
1764
1824
  'migrate.title':'导入 OpenClaw 记忆',
1765
1825
  'migrate.desc':'将 OpenClaw 内置的记忆数据和对话历史迁移到本插件中。导入过程使用智能去重,避免重复导入。',
1766
1826
  'migrate.modes.title':'三种使用方式:',
@@ -1867,7 +1927,10 @@ const I18N={
1867
1927
  'skill.cancel':'取消',
1868
1928
  'skill.delete.confirm':'确定要删除此技能吗?关联的文件也会被删除,此操作不可撤销。',
1869
1929
  'skill.delete.error':'删除技能失败:',
1870
- 'skill.save.error':'保存技能失败:'
1930
+ 'skill.save.error':'保存技能失败:',
1931
+ 'update.available':'发现新版本',
1932
+ 'update.run':'执行命令',
1933
+ 'update.dismiss':'关闭'
1871
1934
  }
1872
1935
  };
1873
1936
  const LANG_KEY='memos-viewer-lang';
@@ -2288,7 +2351,6 @@ async function loadTasks(){
2288
2351
  '</div>'+
2289
2352
  '<div class="card-actions" onclick="event.stopPropagation()">'+
2290
2353
  '<button class="btn btn-sm btn-ghost" onclick="openTaskDetail(\\''+task.id+'\\')">'+t('card.expand')+'</button>'+
2291
- '<button class="btn btn-sm btn-ghost" onclick="editTaskInline(\\''+task.id+'\\')">'+t('card.edit')+'</button>'+
2292
2354
  (task.status==='completed'&&(!task.skillStatus||task.skillStatus==='not_generated'||task.skillStatus==='skipped')?'<button class="btn btn-sm btn-ghost" onclick="retrySkillGen(\\''+task.id+'\\')">'+t('task.retrySkill.short')+'</button>':'')+
2293
2355
  '<button class="btn btn-sm btn-ghost" style="color:var(--accent)" onclick="deleteTask(\\''+task.id+'\\')">'+t('task.delete')+'</button>'+
2294
2356
  '</div>'+
@@ -2461,32 +2523,6 @@ async function deleteTask(taskId){
2461
2523
  }catch(e){ alert(t('task.delete.error')+e.message); }
2462
2524
  }
2463
2525
 
2464
- async function editTaskInline(){
2465
- if(!_currentTaskData) return;
2466
- var task=_currentTaskData;
2467
- var titleEl=document.getElementById('taskDetailTitle');
2468
- var summaryEl=document.getElementById('taskDetailSummary');
2469
- var actionsEl=document.getElementById('taskDetailActions');
2470
-
2471
- titleEl.innerHTML='<input id="editTaskTitle" class="filter-input" style="width:100%;font-size:16px;font-weight:600" value="'+esc(task.title||'')+'"/>';
2472
- summaryEl.innerHTML='<textarea id="editTaskSummary" class="filter-input" style="width:100%;min-height:80px;font-size:13px;resize:vertical">'+esc(task.summary||'')+'</textarea>';
2473
- actionsEl.innerHTML=
2474
- '<button class="btn btn-primary" onclick="saveTaskEdit()" style="font-size:12px">'+t('task.save')+'</button>'+
2475
- '<button class="btn btn-ghost" onclick="openTaskDetail(\\''+esc(task.id)+'\\')" style="font-size:12px">'+t('task.cancel')+'</button>';
2476
- }
2477
-
2478
- async function saveTaskEdit(){
2479
- if(!_currentTaskId) return;
2480
- var title=document.getElementById('editTaskTitle').value.trim();
2481
- var summary=document.getElementById('editTaskSummary').value.trim();
2482
- try{
2483
- const r=await fetch('/api/task/'+_currentTaskId,{method:'PUT',headers:{'Content-Type':'application/json'},body:JSON.stringify({title:title,summary:summary})});
2484
- const d=await r.json();
2485
- if(!r.ok) throw new Error(d.error||'unknown');
2486
- openTaskDetail(_currentTaskId);
2487
- loadTasks();
2488
- }catch(e){ alert(t('task.save.error')+e.message); }
2489
- }
2490
2526
 
2491
2527
  /* ─── Skills View Logic ─── */
2492
2528
  let skillsStatusFilter='';
@@ -2547,7 +2583,6 @@ async function loadSkills(){
2547
2583
  '</div>'+
2548
2584
  '<div class="card-actions" onclick="event.stopPropagation()">'+
2549
2585
  '<button class="btn btn-sm btn-ghost" onclick="openSkillDetail(\\''+skill.id+'\\')">'+t('card.expand')+'</button>'+
2550
- '<button class="btn btn-sm btn-ghost" onclick="editSkillInline(\\''+skill.id+'\\')">'+t('card.edit')+'</button>'+
2551
2586
  (skill.visibility==='public'?'<button class="btn btn-sm btn-ghost" onclick="toggleSkillPublic(\\''+skill.id+'\\',false)">\\u{1F512} '+t('skills.setPrivate')+'</button>':'<button class="btn btn-sm btn-ghost" onclick="toggleSkillPublic(\\''+skill.id+'\\',true)">\\u{1F310} '+t('skills.setPublic')+'</button>')+
2552
2587
  '<button class="btn btn-sm btn-ghost" style="color:var(--accent)" onclick="deleteSkill(\\''+skill.id+'\\')">'+t('skill.delete')+'</button>'+
2553
2588
  '</div>'+
@@ -2694,11 +2729,11 @@ async function toggleSkillVisibility(){
2694
2729
  const newVis=btn.dataset.vis==='public'?'private':'public';
2695
2730
  try{
2696
2731
  const r=await fetch('/api/skill/'+currentSkillId+'/visibility',{method:'PUT',headers:{'Content-Type':'application/json'},body:JSON.stringify({visibility:newVis})});
2697
- if(!r.ok) throw new Error('Failed: '+r.status);
2732
+ if(!r.ok){var errBody='';try{var ej=await r.json();errBody=ej.error||JSON.stringify(ej);}catch(x){errBody=await r.text();}throw new Error(r.status+': '+errBody);}
2698
2733
  openSkillDetail(currentSkillId);
2699
2734
  loadSkills();
2700
2735
  }catch(e){
2701
- alert('Error: '+e.message);
2736
+ toast('Error: '+e.message,'error');
2702
2737
  }
2703
2738
  }
2704
2739
 
@@ -2706,7 +2741,7 @@ async function toggleSkillPublic(id,setPublic){
2706
2741
  const newVis=setPublic?'public':'private';
2707
2742
  try{
2708
2743
  const r=await fetch('/api/skill/'+id+'/visibility',{method:'PUT',headers:{'Content-Type':'application/json'},body:JSON.stringify({visibility:newVis})});
2709
- if(!r.ok) throw new Error('Failed: '+r.status);
2744
+ if(!r.ok){var errBody='';try{var ej=await r.json();errBody=ej.error||JSON.stringify(ej);}catch(x){errBody=await r.text();}throw new Error(r.status+': '+errBody);}
2710
2745
  toast(setPublic?t('toast.setPublic'):t('toast.setPrivate'),'success');
2711
2746
  loadSkills();
2712
2747
  }catch(e){
@@ -2754,7 +2789,37 @@ async function loadConfig(){
2754
2789
  }
2755
2790
  }
2756
2791
 
2792
+ var _providerDefaults={
2793
+ siliconflow:{endpoint:'https://api.siliconflow.cn/v1',embModel:'BAAI/bge-m3',chatModel:'Qwen/Qwen2.5-7B-Instruct'},
2794
+ openai:{endpoint:'https://api.openai.com/v1',embModel:'text-embedding-3-small',chatModel:'gpt-4o-mini'},
2795
+ anthropic:{endpoint:'https://api.anthropic.com/v1/messages',chatModel:'claude-3-haiku-20240307'},
2796
+ cohere:{endpoint:'https://api.cohere.com/v2',embModel:'embed-english-v3.0'},
2797
+ mistral:{endpoint:'https://api.mistral.ai/v1',embModel:'mistral-embed'},
2798
+ voyage:{endpoint:'https://api.voyageai.com/v1',embModel:'voyage-3'},
2799
+ gemini:{endpoint:'',embModel:'text-embedding-004',chatModel:'gemini-2.0-flash'},
2800
+ zhipu:{endpoint:'https://open.bigmodel.cn/api/paas/v4',embModel:'embedding-3',chatModel:'glm-4-flash'},
2801
+ deepseek:{endpoint:'https://api.deepseek.com/v1',chatModel:'deepseek-chat'},
2802
+ bailian:{endpoint:'https://dashscope.aliyuncs.com/compatible-mode/v1',embModel:'text-embedding-v3',chatModel:'qwen-max'},
2803
+ moonshot:{endpoint:'https://api.moonshot.cn/v1',chatModel:'moonshot-v1-8k'}
2804
+ };
2805
+ function onProviderChange(section){
2806
+ var map={embedding:['cfgEmbEndpoint','cfgEmbModel','emb'],summarizer:['cfgSumEndpoint','cfgSumModel','chat'],skill:['cfgSkillEndpoint','cfgSkillModel','chat']};
2807
+ var m=map[section];if(!m)return;
2808
+ var sel=document.getElementById(section==='embedding'?'cfgEmbProvider':section==='summarizer'?'cfgSumProvider':'cfgSkillProvider');
2809
+ var pv=sel.value;
2810
+ var def=_providerDefaults[pv];
2811
+ if(!def)return;
2812
+ var epEl=document.getElementById(m[0]);
2813
+ var mdEl=document.getElementById(m[1]);
2814
+ if(def.endpoint&&!epEl.value.trim()) epEl.value=def.endpoint;
2815
+ if(m[2]==='emb'&&def.embModel&&!mdEl.value.trim()) mdEl.value=def.embModel;
2816
+ if(m[2]==='chat'&&def.chatModel&&!mdEl.value.trim()) mdEl.value=def.chatModel;
2817
+ }
2818
+
2757
2819
  async function saveConfig(){
2820
+ var saveBtn=document.querySelector('.settings-actions .btn-primary');
2821
+ saveBtn.disabled=true;saveBtn.textContent=t('settings.test.loading');
2822
+
2758
2823
  const cfg={};
2759
2824
  const embP=document.getElementById('cfgEmbProvider').value;
2760
2825
  if(embP){
@@ -2764,11 +2829,15 @@ async function saveConfig(){
2764
2829
  const k=document.getElementById('cfgEmbApiKey').value.trim();if(k) cfg.embedding.apiKey=k;
2765
2830
  }
2766
2831
  const sumP=document.getElementById('cfgSumProvider').value;
2767
- if(sumP){
2832
+ const sumModel=document.getElementById('cfgSumModel').value.trim();
2833
+ const sumEndpoint=document.getElementById('cfgSumEndpoint').value.trim();
2834
+ const sumApiKey=document.getElementById('cfgSumApiKey').value.trim();
2835
+ var hasSumConfig=!!(sumModel||sumEndpoint||sumApiKey);
2836
+ if(hasSumConfig&&sumP){
2768
2837
  cfg.summarizer={provider:sumP};
2769
- const v=document.getElementById('cfgSumModel').value.trim();if(v) cfg.summarizer.model=v;
2770
- const e=document.getElementById('cfgSumEndpoint').value.trim();if(e) cfg.summarizer.endpoint=e;
2771
- const k=document.getElementById('cfgSumApiKey').value.trim();if(k) cfg.summarizer.apiKey=k;
2838
+ if(sumModel) cfg.summarizer.model=sumModel;
2839
+ if(sumEndpoint) cfg.summarizer.endpoint=sumEndpoint;
2840
+ if(sumApiKey) cfg.summarizer.apiKey=sumApiKey;
2772
2841
  const tp=document.getElementById('cfgSumTemp').value.trim();if(tp!=='') cfg.summarizer.temperature=Number(tp);
2773
2842
  }
2774
2843
  cfg.skillEvolution={
@@ -2779,29 +2848,118 @@ async function saveConfig(){
2779
2848
  const mk=document.getElementById('cfgSkillMinChunks').value.trim();if(mk) cfg.skillEvolution.minChunksForEval=Number(mk);
2780
2849
 
2781
2850
  const skP=document.getElementById('cfgSkillProvider').value;
2782
- if(skP){
2851
+ const skModel=document.getElementById('cfgSkillModel').value.trim();
2852
+ const skEndpoint=document.getElementById('cfgSkillEndpoint').value.trim();
2853
+ const skApiKey=document.getElementById('cfgSkillApiKey').value.trim();
2854
+ var hasSkillConfig=!!(skP&&(skModel||skEndpoint||skApiKey));
2855
+ if(hasSkillConfig){
2783
2856
  cfg.skillEvolution.summarizer={provider:skP};
2784
- const sv=document.getElementById('cfgSkillModel').value.trim();if(sv) cfg.skillEvolution.summarizer.model=sv;
2785
- const se=document.getElementById('cfgSkillEndpoint').value.trim();if(se) cfg.skillEvolution.summarizer.endpoint=se;
2786
- const sk=document.getElementById('cfgSkillApiKey').value.trim();if(sk) cfg.skillEvolution.summarizer.apiKey=sk;
2857
+ if(skModel) cfg.skillEvolution.summarizer.model=skModel;
2858
+ if(skEndpoint) cfg.skillEvolution.summarizer.endpoint=skEndpoint;
2859
+ if(skApiKey) cfg.skillEvolution.summarizer.apiKey=skApiKey;
2787
2860
  }
2788
2861
 
2789
2862
  const vp=document.getElementById('cfgViewerPort').value.trim();
2790
2863
  if(vp) cfg.viewerPort=Number(vp);
2864
+ cfg.telemetry={enabled:document.getElementById('cfgTelemetryEnabled').checked};
2791
2865
 
2792
- cfg.telemetry={
2793
- enabled:document.getElementById('cfgTelemetryEnabled').checked
2794
- };
2866
+ function done(){saveBtn.disabled=false;saveBtn.textContent=t('settings.save');}
2867
+
2868
+ // 1) Embedding model is required
2869
+ if(!embP||embP===''){done();toast(t('settings.save.emb.required'),'error');return;}
2870
+
2871
+ // 2) Test embedding
2872
+ try{
2873
+ var er=await fetch('/api/test-model',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({type:'embedding',provider:cfg.embedding.provider,model:cfg.embedding.model||'',endpoint:cfg.embedding.endpoint||'',apiKey:cfg.embedding.apiKey||''})});
2874
+ var ed=await er.json();
2875
+ if(!ed.ok){done();toast(t('settings.save.emb.fail')+': '+ed.error,'error');document.getElementById('testEmbResult').className='test-result fail';document.getElementById('testEmbResult').innerHTML='\\u274C '+ed.error;return;}
2876
+ document.getElementById('testEmbResult').className='test-result ok';document.getElementById('testEmbResult').innerHTML='\\u2705 '+t('settings.test.ok');
2877
+ }catch(e){done();toast(t('settings.save.emb.fail')+': '+e.message,'error');return;}
2878
+
2879
+ // 3) Test summarizer if user filled it
2880
+ if(hasSumConfig&&cfg.summarizer){
2881
+ try{
2882
+ var sr=await fetch('/api/test-model',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({type:'summarizer',provider:cfg.summarizer.provider,model:cfg.summarizer.model||'',endpoint:cfg.summarizer.endpoint||'',apiKey:cfg.summarizer.apiKey||''})});
2883
+ var sd=await sr.json();
2884
+ if(!sd.ok){done();toast(t('settings.save.sum.fail')+': '+sd.error,'error');document.getElementById('testSumResult').className='test-result fail';document.getElementById('testSumResult').innerHTML='\\u274C '+sd.error;return;}
2885
+ document.getElementById('testSumResult').className='test-result ok';document.getElementById('testSumResult').innerHTML='\\u2705 '+t('settings.test.ok');
2886
+ }catch(e){done();toast(t('settings.save.sum.fail')+': '+e.message,'error');return;}
2887
+ }
2888
+
2889
+ // 4) Test skill model if user filled it
2890
+ if(hasSkillConfig&&cfg.skillEvolution.summarizer){
2891
+ try{
2892
+ var kr=await fetch('/api/test-model',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({type:'summarizer',provider:cfg.skillEvolution.summarizer.provider,model:cfg.skillEvolution.summarizer.model||'',endpoint:cfg.skillEvolution.summarizer.endpoint||'',apiKey:cfg.skillEvolution.summarizer.apiKey||''})});
2893
+ var kd=await kr.json();
2894
+ if(!kd.ok){done();toast(t('settings.save.skill.fail')+': '+kd.error,'error');document.getElementById('testSkillResult').className='test-result fail';document.getElementById('testSkillResult').innerHTML='\\u274C '+kd.error;return;}
2895
+ document.getElementById('testSkillResult').className='test-result ok';document.getElementById('testSkillResult').innerHTML='\\u2705 '+t('settings.test.ok');
2896
+ }catch(e){done();toast(t('settings.save.skill.fail')+': '+e.message,'error');return;}
2897
+ }
2898
+
2899
+ // 5) If summarizer or skill model not configured, check OpenClaw fallback and confirm
2900
+ if(!hasSumConfig||!hasSkillConfig){
2901
+ try{
2902
+ var fr=await fetch('/api/fallback-model');
2903
+ var fb=await fr.json();
2904
+ var msgs=[];
2905
+ if(!hasSumConfig){msgs.push(t('settings.save.sum.fallback'));}
2906
+ if(!hasSkillConfig){msgs.push(t('settings.save.skill.fallback'));}
2907
+ var fbInfo=fb.available?(fb.model+' ('+fb.baseUrl+')'):t('settings.save.fallback.none');
2908
+ var confirmMsg=msgs.join('\\n')+'\\n\\n'+t('settings.save.fallback.model')+fbInfo+'\\n\\n'+t('settings.save.fallback.confirm');
2909
+ if(!confirm(confirmMsg)){done();return;}
2910
+ }catch(e){}
2911
+ }
2795
2912
 
2913
+ // 6) All tests passed, save
2796
2914
  try{
2797
2915
  const r=await fetch('/api/config',{method:'PUT',headers:{'Content-Type':'application/json'},body:JSON.stringify(cfg)});
2798
2916
  if(!r.ok) throw new Error(await r.text());
2799
2917
  const el=document.getElementById('settingsSaved');
2800
2918
  el.classList.add('show');
2801
2919
  setTimeout(()=>el.classList.remove('show'),2500);
2920
+ toast(t('settings.saved'),'success');
2802
2921
  }catch(e){
2803
- showToast(t('settings.save.fail')+': '+e.message,'error');
2922
+ toast(t('settings.save.fail')+': '+e.message,'error');
2923
+ }finally{done();}
2924
+ }
2925
+
2926
+ async function testModel(type){
2927
+ var ids={embedding:['Emb','cfgEmbProvider','cfgEmbModel','cfgEmbEndpoint','cfgEmbApiKey'],summarizer:['Sum','cfgSumProvider','cfgSumModel','cfgSumEndpoint','cfgSumApiKey'],skill:['Skill','cfgSkillProvider','cfgSkillModel','cfgSkillEndpoint','cfgSkillApiKey']};
2928
+ var c=ids[type];if(!c)return;
2929
+ var resultEl=document.getElementById('test'+c[0]+'Result');
2930
+ var btn=document.getElementById('test'+c[0]+'Btn');
2931
+ var provider=document.getElementById(c[1]).value;
2932
+ var model=document.getElementById(c[2]).value.trim();
2933
+ var endpoint=document.getElementById(c[3]).value.trim();
2934
+ var apiKey=document.getElementById(c[4]).value.trim();
2935
+ if(!provider||(provider!=='local'&&!model)){
2936
+ resultEl.className='test-result fail';
2937
+ resultEl.innerHTML='\\u274C '+t('settings.test.fail')+'<div style="margin-top:4px;font-size:11px;color:var(--text-muted)">Provider and Model are required</div>';
2938
+ return;
2804
2939
  }
2940
+ if(provider!=='local'&&!apiKey){
2941
+ resultEl.className='test-result fail';
2942
+ resultEl.innerHTML='\\u274C '+t('settings.test.fail')+'<div style="margin-top:4px;font-size:11px;color:var(--text-muted)">API Key is required</div>';
2943
+ return;
2944
+ }
2945
+ resultEl.className='test-result loading';resultEl.textContent=t('settings.test.loading');
2946
+ btn.disabled=true;
2947
+ try{
2948
+ var body={type:type,provider:provider,model:model,endpoint:endpoint,apiKey:apiKey};
2949
+ var r=await fetch('/api/test-model',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)});
2950
+ var d=await r.json();
2951
+ if(d.ok){
2952
+ resultEl.className='test-result ok';
2953
+ resultEl.innerHTML='\\u2705 '+t('settings.test.ok')+'<div style="margin-top:4px;font-size:11px;color:var(--text-muted)">'+esc(d.detail||'')+'</div>';
2954
+ }else{
2955
+ var errMsg=d.error||'Unknown error';
2956
+ resultEl.className='test-result fail';
2957
+ resultEl.innerHTML='\\u274C '+t('settings.test.fail')+'<div style="margin-top:6px;font-size:11px;padding:8px 10px;background:rgba(239,68,68,.06);border:1px solid rgba(239,68,68,.15);border-radius:6px;white-space:pre-wrap;word-break:break-all;max-height:120px;overflow-y:auto;font-family:SF Mono,Monaco,Consolas,monospace">'+esc(errMsg)+'</div>';
2958
+ }
2959
+ }catch(e){
2960
+ resultEl.className='test-result fail';
2961
+ resultEl.innerHTML='\\u274C '+t('settings.test.fail')+'<div style="margin-top:6px;font-size:11px;padding:8px 10px;background:rgba(239,68,68,.06);border:1px solid rgba(239,68,68,.15);border-radius:6px;white-space:pre-wrap;word-break:break-all">'+esc(e.message)+'</div>';
2962
+ }finally{btn.disabled=false;}
2805
2963
  }
2806
2964
 
2807
2965
  function renderSkillMarkdown(md){
@@ -2847,28 +3005,6 @@ async function deleteSkill(skillId){
2847
3005
  }catch(e){ alert(t('skill.delete.error')+e.message); }
2848
3006
  }
2849
3007
 
2850
- function editSkillInline(){
2851
- var skill=window._currentSkillData;
2852
- if(!skill) return;
2853
- var descEl=document.getElementById('skillDetailDesc');
2854
- var actionsEl=document.getElementById('skillDetailActions');
2855
- descEl.innerHTML='<textarea id="editSkillDesc" class="filter-input" style="width:100%;min-height:60px;font-size:13px;resize:vertical">'+esc(skill.description||'')+'</textarea>';
2856
- actionsEl.innerHTML=
2857
- '<button class="btn btn-primary" onclick="saveSkillEdit()" style="font-size:12px">'+t('skill.save')+'</button>'+
2858
- '<button class="btn btn-ghost" onclick="openSkillDetail(\\''+esc(skill.id)+'\\')" style="font-size:12px">'+t('skill.cancel')+'</button>';
2859
- }
2860
-
2861
- async function saveSkillEdit(){
2862
- if(!currentSkillId) return;
2863
- var desc=document.getElementById('editSkillDesc').value.trim();
2864
- try{
2865
- const r=await fetch('/api/skill/'+currentSkillId,{method:'PUT',headers:{'Content-Type':'application/json'},body:JSON.stringify({description:desc})});
2866
- const d=await r.json();
2867
- if(!r.ok) throw new Error(d.error||'unknown');
2868
- openSkillDetail(currentSkillId);
2869
- loadSkills();
2870
- }catch(e){ alert(t('skill.save.error')+e.message); }
2871
- }
2872
3008
 
2873
3009
  function formatDuration(ms){
2874
3010
  const s=Math.floor(ms/1000);
@@ -3150,6 +3286,7 @@ async function loadAll(){
3150
3286
  await Promise.all([loadStats(),loadMemories()]);
3151
3287
  checkMigrateStatus();
3152
3288
  connectPPSSE();
3289
+ checkForUpdate();
3153
3290
  }
3154
3291
 
3155
3292
  async function loadStats(){
@@ -4086,6 +4223,22 @@ function initViewerTheme(){const s=localStorage.getItem(VIEWER_THEME_KEY);const
4086
4223
  function toggleViewerTheme(){const el=document.documentElement;const cur=el.getAttribute('data-theme')||'dark';const next=cur==='dark'?'light':'dark';el.setAttribute('data-theme',next);localStorage.setItem(VIEWER_THEME_KEY,next);}
4087
4224
  initViewerTheme();
4088
4225
 
4226
+ /* ─── Update check ─── */
4227
+ async function checkForUpdate(){
4228
+ try{
4229
+ const r=await fetch('/api/update-check');
4230
+ if(!r.ok)return;
4231
+ const d=await r.json();
4232
+ if(!d.updateAvailable)return;
4233
+ const banner=document.createElement('div');
4234
+ banner.id='updateBanner';
4235
+ banner.style.cssText='position:fixed;top:0;left:0;right:0;z-index:9999;background:linear-gradient(135deg,#f59e0b,#d97706);color:#fff;padding:10px 20px;display:flex;align-items:center;justify-content:space-between;font-size:14px;box-shadow:0 2px 8px rgba(0,0,0,.25)';
4236
+ banner.innerHTML='<span>🔔 '+t('update.available')+': <b>v'+esc(d.current)+'</b> → <b>v'+esc(d.latest)+'</b> — '+t('update.run')+': <code style="background:rgba(0,0,0,.2);padding:2px 8px;border-radius:4px;margin:0 4px">openclaw plugins install '+esc(d.packageName)+'</code></span><button onclick="this.parentElement.remove();document.body.style.paddingTop=\\'\\';" style="background:none;border:none;color:#fff;font-size:18px;cursor:pointer;padding:0 4px">&times;</button>';
4237
+ document.body.prepend(banner);
4238
+ document.body.style.paddingTop='48px';
4239
+ }catch(e){}
4240
+ }
4241
+
4089
4242
  /* ─── Init ─── */
4090
4243
  document.getElementById('modalOverlay').addEventListener('click',e=>{if(e.target.id==='modalOverlay')closeModal()});
4091
4244
  document.getElementById('searchInput').addEventListener('keydown',e=>{if(e.key==='Escape'){e.target.value='';loadMemories()}});
@@ -1 +1 @@
1
- {"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/viewer/html.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAiqIlB,CAAC"}
@@ -72,6 +72,12 @@ export declare class ViewerServer {
72
72
  private getOpenClawConfigPath;
73
73
  private serveConfig;
74
74
  private handleSaveConfig;
75
+ private handleTestModel;
76
+ private serveFallbackModel;
77
+ private findPluginPackageJson;
78
+ private handleUpdateCheck;
79
+ private testEmbeddingModel;
80
+ private testChatModel;
75
81
  private serveLogs;
76
82
  private serveLogTools;
77
83
  private getOpenClawHome;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/viewer/server.ts"],"names":[],"mappings":"AAM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