@aiyiran/myclaw 1.1.43 → 1.1.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.1.43",
3
+ "version": "1.1.44",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -520,6 +520,13 @@ def _do_sync_templates(cdn_index, local_index, pending):
520
520
  folder_dir = os.path.join(TEMPLATE_LOCAL_DIR, folder_name)
521
521
  os.makedirs(folder_dir, exist_ok=True)
522
522
 
523
+ # 下载开始前先删掉标记,防止更新窗口期内被误判为就绪
524
+ done_marker = os.path.join(folder_dir, '.sync-done')
525
+ try:
526
+ os.remove(done_marker)
527
+ except OSError:
528
+ pass
529
+
523
530
  cdn_files = _list_files_from_qiniu(cdn_prefix)
524
531
  _sync_log(' 列举到 {} 个文件'.format(len(cdn_files)))
525
532
  for item in cdn_files:
@@ -530,6 +537,13 @@ def _do_sync_templates(cdn_index, local_index, pending):
530
537
  ok = _download_from_cdn(key, os.path.join(folder_dir, filename))
531
538
  _sync_log(' {} {}'.format('✓' if ok else '✗', filename))
532
539
 
540
+ # 全部下完后写标记
541
+ try:
542
+ with open(done_marker, 'w') as f:
543
+ f.write(cdn_ua or '')
544
+ except Exception:
545
+ pass
546
+
533
547
  if is_new:
534
548
  added.append(folder_name)
535
549
  else:
@@ -1038,7 +1052,7 @@ class MyclawAPIHandler(BaseHTTPRequestHandler):
1038
1052
  def _skill_scripts_root(self):
1039
1053
  """返回 yiran-playground-template-use/scripts 的绝对路径"""
1040
1054
  return os.path.join(
1041
- get_openclaw_path(), 'workspace-ai-demo', 'skills',
1055
+ get_openclaw_path(), 'skills',
1042
1056
  'yiran-playground-template-use', 'scripts'
1043
1057
  )
1044
1058
 
@@ -1048,11 +1062,11 @@ class MyclawAPIHandler(BaseHTTPRequestHandler):
1048
1062
  self._send_json({'error': 'invalid folder'}, 400)
1049
1063
  return None
1050
1064
  path = os.path.join(
1051
- get_openclaw_path(), 'workspace-ai-demo', 'skills',
1065
+ get_openclaw_path(), 'skills',
1052
1066
  'yiran-playground-template-use', 'templates', folder
1053
1067
  )
1054
- if not os.path.isdir(path):
1055
- self._send_json({'error': f'模板目录不存在: {folder}'}, 404)
1068
+ if not os.path.isfile(os.path.join(path, '.sync-done')):
1069
+ self._send_json({'error': '模板尚未下载完成,请稍后重试', 'code': 'not_ready'}, 409)
1056
1070
  return None
1057
1071
  return path
1058
1072
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "index_updated_at": "2026-04-22T06:49:25Z",
2
+ "index_updated_at": "2026-04-22T09:27:21Z",
3
3
  "templates": {
4
4
  "A": {
5
5
  "100": {
@@ -161,7 +161,7 @@
161
161
  "表达构建",
162
162
  "游戏机制"
163
163
  ],
164
- "updated_at": "2026-04-22T04:32:36Z"
164
+ "updated_at": "2026-04-22T09:26:36Z"
165
165
  }
166
166
  },
167
167
  "C": {
@@ -191,7 +191,7 @@
191
191
  "问题判断",
192
192
  "改编优化"
193
193
  ],
194
- "updated_at": "2026-04-22T04:32:36Z"
194
+ "updated_at": "2026-04-22T09:26:36Z"
195
195
  }
196
196
  }
197
197
  }