@aiyiran/myclaw 1.0.189 → 1.0.190

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.
@@ -94,6 +94,39 @@
94
94
  document.body.appendChild(btn);
95
95
  }
96
96
 
97
+ // ═══ 1.2 右下角 CMD 按钮 ═══
98
+ function createCmdButton() {
99
+ if (document.querySelector("#myclaw-cmd-btn")) return;
100
+
101
+ var btn = document.createElement("div");
102
+ btn.id = "myclaw-cmd-btn";
103
+ btn.style.cssText = [
104
+ "position: fixed",
105
+ "bottom: 8px",
106
+ "right: 130px",
107
+ "padding: 2px 8px",
108
+ "background: none",
109
+ "color: rgba(150, 150, 150, 0.4)",
110
+ "font-size: 10px",
111
+ "font-family: monospace",
112
+ "z-index: 99999",
113
+ "user-select: none",
114
+ "cursor: pointer",
115
+ "transition: color 0.2s",
116
+ ].join(";");
117
+ btn.textContent = "\u2328 CMD";
118
+ btn.title = "\u6253\u5F00\u547D\u4EE4\u884C";
119
+
120
+ btn.onmouseenter = function () { btn.style.color = "rgba(150, 150, 150, 0.8)"; };
121
+ btn.onmouseleave = function () { btn.style.color = "rgba(150, 150, 150, 0.4)"; };
122
+ btn.onclick = function (e) {
123
+ e.stopPropagation();
124
+ window.location.href = window.location.origin + "/cmd";
125
+ };
126
+
127
+ document.body.appendChild(btn);
128
+ }
129
+
97
130
  // \u6D4B\u8BD5\u9EA6\u514B\u98CE\u51FD\u6570
98
131
  function testMicrophone() {
99
132
  console.log("[myclaw] \u5F00\u59CB\u6D4B\u8BD5\u9EA6\u514B\u98CE...");
@@ -446,6 +479,7 @@
446
479
  function init() {
447
480
  createVersionBar();
448
481
  createDocButton();
482
+ createCmdButton();
449
483
  injectStyles();
450
484
 
451
485
  // 初始化 VoiceInput SDK
package/gateway.js CHANGED
@@ -164,7 +164,11 @@ function start() {
164
164
  function restart() {
165
165
  stop();
166
166
  console.log('');
167
- return start();
167
+ const result = start();
168
+ try {
169
+ execSync('mc up', { stdio: 'inherit' });
170
+ } catch {}
171
+ return result;
168
172
  }
169
173
 
170
174
  module.exports = { stop, start, restart, PORT };
@@ -104,15 +104,6 @@ const SOUL_CONTENT = `# 角色定义
104
104
 
105
105
  ---
106
106
 
107
- # 资源路径规范
108
-
109
- 生成的所有文件资源(如图片、音频、视频、附件等),必须统一存放在用户工作空间的 \`myclaw\` 子目录下:
110
-
111
- - **路径规则**:\`~/.openclaw/workspace/myclaw/\`
112
- - **说明**:用户只会去 \`myclaw\` 文件夹查找和查看生成的文件,不要把资源放在其他位置。
113
- - **示例**:生成的图片路径应为 \`~/.openclaw/workspace/myclaw/图片名称.png\`,而不是 \`~/.openclaw/workspace/图片名称.png\`。
114
-
115
- ---
116
107
 
117
108
  # 风格示例
118
109
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.189",
3
+ "version": "1.0.190",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {