@aiyiran/myclaw 1.1.186 → 1.1.187

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.
@@ -31,6 +31,7 @@
31
31
  var cachedData = null;
32
32
  var pollTimer = null;
33
33
  var lastKnownClawName = null; // 统一从 /api/config 读取并缓存(本地与远程一致)
34
+ var lastKnownOpenclawRoot = null; // .openclaw 根目录绝对路径,从 /api/config 读取
34
35
  var _preloadCache = {}; // url → Image 对象,防止重复预加载
35
36
  var showHiddenArtifacts = false; // 是否显示被过滤掉的系统/模板内部文件
36
37
  var MYCLAW_API_PORT = 18800;
@@ -74,6 +75,7 @@
74
75
  })
75
76
  .then(function (data) {
76
77
  lastKnownClawName = data.claw;
78
+ lastKnownOpenclawRoot = data.root || null;
77
79
  return data.claw;
78
80
  })
79
81
  .catch(function (err) {
@@ -449,6 +451,10 @@
449
451
  // 1. 检查文件名是否包含在黑名单中
450
452
  if (ARTIFACT_BLACKLIST.indexOf(basename) !== -1) return false;
451
453
 
454
+ // 1.5 约定前缀:文件名以 hide- 开头 = 内部/生成文件,默认不显示
455
+ // (Markdown 安全、shell 安全,供各流水线自命名用,无需维护清单)
456
+ if (basename.indexOf('hide-') === 0) return false;
457
+
452
458
  // 2. 检查路径是否以黑名单目录开头
453
459
  for (var i = 0; i < DIR_BLACKLIST.length; i++) {
454
460
  if (path.indexOf(DIR_BLACKLIST[i]) === 0) {
@@ -537,8 +543,9 @@
537
543
  copyPathBtn.onmouseleave = function () { copyPathBtn.style.background = '#2d2d4a'; };
538
544
  copyPathBtn.onclick = function (e) {
539
545
  e.stopPropagation();
540
- var relativePath = getWorkspaceId() + '/' + (asset.path || '');
541
- navigator.clipboard.writeText(relativePath).then(function () {
546
+ var rel = getWorkspaceId() + '/' + (asset.path || '');
547
+ var pathToCopy = lastKnownOpenclawRoot ? lastKnownOpenclawRoot + '/' + rel : rel;
548
+ navigator.clipboard.writeText(pathToCopy).then(function () {
542
549
  copyPathBtn.textContent = '✓';
543
550
  copyPathBtn.style.color = '#10b981';
544
551
  copyPathBtn.style.borderColor = '#10b981';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.1.186",
3
+ "version": "1.1.187",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1156,7 +1156,7 @@ class MyclawAPIHandler(BaseHTTPRequestHandler):
1156
1156
 
1157
1157
  def _handle_config(self):
1158
1158
  """GET /api/config → 返回 claw 名称和 CDN base_url"""
1159
- self._send_json({"claw": claw, "base_url": BASE_URL})
1159
+ self._send_json({"claw": claw, "base_url": BASE_URL, "root": get_openclaw_path()})
1160
1160
 
1161
1161
  def _handle_artifacts(self, params):
1162
1162
  """GET /api/artifacts?workspace=xxx → 直接从磁盘读取 __MY_ARTIFACTS__.json"""