@aiyiran/myclaw 1.1.86 → 1.1.88
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.
|
@@ -632,32 +632,23 @@
|
|
|
632
632
|
|
|
633
633
|
var fullPath = asset.path || asset.name || '未命名';
|
|
634
634
|
var parts = fullPath.split('/').filter(function (p) { return p !== ''; });
|
|
635
|
-
//
|
|
636
|
-
//
|
|
637
|
-
var
|
|
638
|
-
var
|
|
639
|
-
if (parts.length >= 3) {
|
|
640
|
-
// 有多层:上行 = 除最后两段外的路径,下行 = 最后两段
|
|
641
|
-
topPart = parts.slice(0, parts.length - 2).join('/') + '/';
|
|
642
|
-
bottomPart = parts.slice(parts.length - 2).join('/');
|
|
643
|
-
} else if (parts.length === 2) {
|
|
644
|
-
// 只有一层目录:只显示下行(dir/file)
|
|
645
|
-
topPart = '';
|
|
646
|
-
bottomPart = parts.join('/');
|
|
647
|
-
}
|
|
635
|
+
// 上行:相对路径(除文件名外的所有目录)
|
|
636
|
+
// 下行:文件名
|
|
637
|
+
var fileName = parts[parts.length - 1] || fullPath;
|
|
638
|
+
var dirPath = parts.length >= 2 ? parts.slice(0, parts.length - 1).join('/') + '/' : '';
|
|
648
639
|
|
|
649
|
-
//
|
|
650
|
-
if (
|
|
640
|
+
// 上行:相对路径(灰色极小字)
|
|
641
|
+
if (dirPath) {
|
|
651
642
|
var dirSpan = document.createElement('span');
|
|
652
|
-
dirSpan.textContent =
|
|
643
|
+
dirSpan.textContent = dirPath;
|
|
653
644
|
dirSpan.title = fullPath;
|
|
654
|
-
dirSpan.style.cssText = 'color:#666;font-size:9px;line-height:1.3;white-space:nowrap;';
|
|
645
|
+
dirSpan.style.cssText = 'color:#666;font-size:9px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;';
|
|
655
646
|
fname.appendChild(dirSpan);
|
|
656
647
|
}
|
|
657
648
|
|
|
658
|
-
//
|
|
649
|
+
// 下行:文件名(大字体)
|
|
659
650
|
var nameSpan = document.createElement('span');
|
|
660
|
-
nameSpan.textContent =
|
|
651
|
+
nameSpan.textContent = fileName;
|
|
661
652
|
nameSpan.title = fullPath;
|
|
662
653
|
nameSpan.style.cssText = 'font-size:13px;font-weight:500;line-height:1.5;white-space:nowrap;';
|
|
663
654
|
fname.appendChild(nameSpan);
|
|
@@ -1230,8 +1221,6 @@
|
|
|
1230
1221
|
row.appendChild(row3);
|
|
1231
1222
|
leftPane.appendChild(row);
|
|
1232
1223
|
|
|
1233
|
-
// 默认选中第一条并预览
|
|
1234
|
-
if (idx === 0) setActive();
|
|
1235
1224
|
});
|
|
1236
1225
|
}
|
|
1237
1226
|
|
|
@@ -2594,7 +2583,7 @@
|
|
|
2594
2583
|
// ── 并行:加载本地 index + 检查 CDN 更新 ──────────────────────────────
|
|
2595
2584
|
var _pollTimer = null; // 提到外层,doSync 守卫用
|
|
2596
2585
|
|
|
2597
|
-
function doSync() {
|
|
2586
|
+
function doSync(force) {
|
|
2598
2587
|
// 轮询进行中时点击无效,避免重复起 timer
|
|
2599
2588
|
if (_pollTimer) return;
|
|
2600
2589
|
headSyncBtn.disabled = true;
|
|
@@ -2646,7 +2635,7 @@
|
|
|
2646
2635
|
}, 3000);
|
|
2647
2636
|
}
|
|
2648
2637
|
|
|
2649
|
-
fetch(MYCLAW_API_BASE + '/api/sync-templates')
|
|
2638
|
+
fetch(MYCLAW_API_BASE + '/api/sync-templates' + (force ? '?force=1' : ''))
|
|
2650
2639
|
.then(function (r) { return r.json(); })
|
|
2651
2640
|
.then(function (sync) {
|
|
2652
2641
|
headSyncBtn.disabled = false;
|
|
@@ -2680,7 +2669,7 @@
|
|
|
2680
2669
|
});
|
|
2681
2670
|
}
|
|
2682
2671
|
|
|
2683
|
-
headSyncBtn.onclick = doSync;
|
|
2672
|
+
headSyncBtn.onclick = function () { doSync(true); };
|
|
2684
2673
|
doSync();
|
|
2685
2674
|
|
|
2686
2675
|
fetch(MYCLAW_API_BASE + '/api/file?path=' + encodeURIComponent(TEMPLATE_ROOT + '/template-index.json'))
|
package/package.json
CHANGED
package/server/sync_workspace.py
CHANGED
|
@@ -872,7 +872,7 @@ class MyclawAPIHandler(BaseHTTPRequestHandler):
|
|
|
872
872
|
elif path == '/api/file':
|
|
873
873
|
return self._handle_file(params)
|
|
874
874
|
elif path == '/api/sync-templates':
|
|
875
|
-
return self._handle_sync_templates()
|
|
875
|
+
return self._handle_sync_templates(params)
|
|
876
876
|
elif path == '/api/sync-status':
|
|
877
877
|
return self._handle_sync_status()
|
|
878
878
|
else:
|
|
@@ -1264,11 +1264,16 @@ class MyclawAPIHandler(BaseHTTPRequestHandler):
|
|
|
1264
1264
|
except Exception as e:
|
|
1265
1265
|
self._send_json({"error": str(e)}, 500)
|
|
1266
1266
|
|
|
1267
|
-
def _handle_sync_templates(self):
|
|
1268
|
-
"""GET /api/sync-templates
|
|
1267
|
+
def _handle_sync_templates(self, params=None):
|
|
1268
|
+
"""GET /api/sync-templates[?force=1]
|
|
1269
1269
|
快速比对 CDN index_updated_at 与本地,若一致立即返回 {changed: false}。
|
|
1270
1270
|
若有变化,启动后台线程下载,立即返回 {changed: true, syncing: true}。
|
|
1271
|
+
force=1:删除本地 index,强制重新全量比对。
|
|
1271
1272
|
"""
|
|
1273
|
+
# force=1:清除本地 index 强制重新下载
|
|
1274
|
+
if params and params.get('force', [''])[0] == '1':
|
|
1275
|
+
if os.path.isfile(TEMPLATE_LOCAL_INDEX):
|
|
1276
|
+
os.remove(TEMPLATE_LOCAL_INDEX)
|
|
1272
1277
|
# 快速拉取 CDN index(仅 JSON,通常 <1s)
|
|
1273
1278
|
try:
|
|
1274
1279
|
import ssl
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"index_updated_at": "2026-05-
|
|
2
|
+
"index_updated_at": "2026-05-08T02:45:34Z",
|
|
3
3
|
"templates": {
|
|
4
4
|
"696de592": {
|
|
5
5
|
"id": "696de592",
|
|
@@ -329,9 +329,9 @@
|
|
|
329
329
|
"编号": "101",
|
|
330
330
|
"名称": "万物图签:我的AI卡牌宇宙",
|
|
331
331
|
"文件夹名": "c101_万物图签:我的AI卡牌宇宙",
|
|
332
|
-
"version": "
|
|
333
|
-
"路径": "templates/c101_万物图签:我的AI卡牌宇宙/
|
|
334
|
-
"入口文件": "templates/c101_万物图签:我的AI卡牌宇宙/
|
|
332
|
+
"version": "v6",
|
|
333
|
+
"路径": "templates/c101_万物图签:我的AI卡牌宇宙/v6",
|
|
334
|
+
"入口文件": "templates/c101_万物图签:我的AI卡牌宇宙/v6/index.html",
|
|
335
335
|
"一句话说明": "分四个阶段逐步做出你的精灵卡牌:先让角色诞生,再加属性和特效,最后扩展成一个系列。",
|
|
336
336
|
"主能力标签": "第四能力:迭代推进",
|
|
337
337
|
"任务类型标签": "视听表达",
|
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
"第四能力:迭代推进",
|
|
349
349
|
"视听表达"
|
|
350
350
|
],
|
|
351
|
-
"updated_at": "2026-05-
|
|
351
|
+
"updated_at": "2026-05-08T02:45:29Z"
|
|
352
352
|
},
|
|
353
353
|
"cf03758c": {
|
|
354
354
|
"id": "cf03758c",
|
|
@@ -112,9 +112,9 @@
|
|
|
112
112
|
|
|
113
113
|
## C101 万物图签:我的AI卡牌宇宙
|
|
114
114
|
- ID:a2f9502c
|
|
115
|
-
- 版本:
|
|
116
|
-
- 路径:templates/c101_万物图签:我的AI卡牌宇宙/
|
|
117
|
-
- 入口文件:templates/c101_万物图签:我的AI卡牌宇宙/
|
|
115
|
+
- 版本:v6
|
|
116
|
+
- 路径:templates/c101_万物图签:我的AI卡牌宇宙/v6
|
|
117
|
+
- 入口文件:templates/c101_万物图签:我的AI卡牌宇宙/v6/index.html
|
|
118
118
|
- 主能力标签:第四能力:迭代推进
|
|
119
119
|
- 任务类型标签:视听表达
|
|
120
120
|
- 关键词:c101_万物图签:我的AI卡牌宇宙, 分四个阶段逐步做出你的精灵卡牌:先让角色诞生,再加属性和特效,最后扩展成一个系列。, 已经做过基础卡牌任务的学生, 对卡牌游戏有兴趣、想做出有系统感作品的学生, 会做但容易停在第一版不改的学生, 在复杂框架上读懂结构,再做定向修改, 规划主题和阵营分组逻辑, 明确识别问题并做一次有意识的迭代升级, 万物图签:我的AI卡牌宇宙, 第四能力:迭代推进, 视听表达
|