@aiyiran/myclaw 1.0.188 → 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.
- package/assets/myclaw-inject.js +34 -0
- package/gateway.js +5 -1
- package/inject-minimax.js +1 -1
- package/inject-workspaceAndSoul.js +0 -9
- package/package.json +1 -1
package/assets/myclaw-inject.js
CHANGED
|
@@ -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
|
-
|
|
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 };
|
package/inject-minimax.js
CHANGED
|
@@ -19,7 +19,7 @@ const { readConfig, writeConfig } = require('./find-config');
|
|
|
19
19
|
// ============================================================
|
|
20
20
|
// 请在这里填写默认的 MiniMax API Key
|
|
21
21
|
// ============================================================
|
|
22
|
-
const DEFAULT_MINIMAX_KEY = "sk-
|
|
22
|
+
const DEFAULT_MINIMAX_KEY = "sk-cp-DC5lWd2Stt9CBFzLIT2awP4K-ZEn5AkYwjl3Cdj-mIBmgjxod518F2LaVF2L9c35Wv5-Eox0F1ctJD5vXtB9p3OmxoWLd9ge9zIUIMrCVuqBYdL_s6kb8Qs";
|
|
23
23
|
|
|
24
24
|
function run(cliArgs) {
|
|
25
25
|
// 解析参数
|
|
@@ -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
|
|