koishi-plugin-spawn-modified 1.1.16 → 1.1.17

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/lib/index.js CHANGED
@@ -100,7 +100,7 @@ function renderTerminalImage(ctx, workingDir, command, output) {
100
100
  throw new Error('Puppeteer plugin is not available');
101
101
  }
102
102
  fontPath = (0, url_1.pathToFileURL)(path_1.default.resolve(__dirname, '../fonts/JetBrainsMono-Regular.ttf')).href;
103
- html = "\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <style>\n @font-face {\n font-family: 'JetBrains Mono';\n src: url('".concat(fontPath, "') format('truetype');\n }\n \n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n \n body {\n background: #1e1e1e;\n color: #cccccc;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 14px;\n padding: 0;\n display: inline-block;\n min-width: 600px;\n max-width: 1200px;\n }\n \n .terminal {\n background: #1e1e1e;\n border: 1px solid #3c3c3c;\n border-radius: 8px;\n overflow: hidden;\n }\n \n .title-bar {\n background: #2d2d2d;\n height: 35px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 12px;\n border-bottom: 1px solid #3c3c3c;\n }\n \n .title {\n color: #cccccc;\n font-size: 13px;\n font-weight: 500;\n }\n \n .buttons {\n display: flex;\n gap: 8px;\n }\n \n .button {\n width: 12px;\n height: 12px;\n border-radius: 50%;\n }\n \n .button.minimize { background: #ffbd2e; }\n .button.maximize { background: #28c940; }\n .button.close { background: #ff5f56; }\n \n .content {\n padding: 16px;\n white-space: pre-wrap;\n word-break: break-all;\n line-height: 1.5;\n }\n \n .prompt {\n color: #4ec9b0;\n margin-bottom: 8px;\n }\n \n .command {\n color: #dcdcaa;\n margin-bottom: 12px;\n }\n \n .output {\n color: #cccccc;\n }\n </style>\n</head>\n<body>\n <div class=\"terminal\">\n <div class=\"title-bar\">\n <div class=\"title\">Terminal</div>\n <div class=\"buttons\">\n <div class=\"button minimize\"></div>\n <div class=\"button maximize\"></div>\n <div class=\"button close\"></div>\n </div>\n </div>\n <div class=\"content\">\n <div class=\"prompt\">").concat(escapeHtml(workingDir), "$</div>\n <div class=\"command\">").concat(escapeHtml(command), "</div>\n <div class=\"output\">").concat(escapeHtml(output), "</div>\n </div>\n </div>\n</body>\n</html>\n ");
103
+ html = "\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <style>\n @font-face {\n font-family: 'JetBrains Mono';\n src: url('".concat(fontPath, "') format('truetype');\n }\n \n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n \n body {\n background: #1e1e1e;\n color: #cccccc;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-weight: 400;\n font-size: 14px;\n padding: 0;\n display: inline-block;\n min-width: 600px;\n max-width: 1200px;\n }\n \n .terminal {\n background: #1e1e1e;\n border: 1px solid #3c3c3c;\n border-radius: 8px;\n overflow: hidden;\n }\n \n .title-bar {\n background: #2d2d2d;\n height: 35px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 12px;\n border-bottom: 1px solid #3c3c3c;\n }\n \n .title {\n color: #cccccc;\n font-size: 13px;\n font-weight: 500;\n }\n \n .buttons {\n display: flex;\n gap: 8px;\n }\n \n .button {\n width: 12px;\n height: 12px;\n border-radius: 50%;\n }\n \n .button.minimize { background: #ffbd2e; }\n .button.maximize { background: #28c940; }\n .button.close { background: #ff5f56; }\n \n .content {\n padding: 12px 16px;\n white-space: pre-wrap;\n word-break: break-word;\n line-height: 1.35;\n }\n \n .command-line {\n display: flex;\n gap: 6px;\n align-items: baseline;\n margin-bottom: 10px;\n }\n \n .prompt {\n color: #4ec9b0;\n margin: 0;\n flex-shrink: 0;\n }\n \n .command {\n color: #dcdcaa;\n margin: 0;\n word-break: break-word;\n flex: 1;\n }\n \n .output {\n color: #cccccc;\n line-height: 1.4;\n }\n </style>\n</head>\n<body>\n <div class=\"terminal\">\n <div class=\"title-bar\">\n <div class=\"title\">Terminal</div>\n <div class=\"buttons\">\n <div class=\"button minimize\"></div>\n <div class=\"button maximize\"></div>\n <div class=\"button close\"></div>\n </div>\n </div>\n <div class=\"content\">\n <div class=\"command-line\">\n <div class=\"prompt\">").concat(escapeHtml(workingDir), "$</div>\n <div class=\"command\">").concat(escapeHtml(command), "</div>\n </div>\n <div class=\"output\">").concat(escapeHtml(output), "</div>\n </div>\n </div>\n</body>\n</html>\n ");
104
104
  return [4 /*yield*/, ctx.puppeteer.page()];
105
105
  case 1:
106
106
  page = _a.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-spawn-modified",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "Run shell commands with Koishi",
5
5
  "keywords": [
6
6
  "bot",
package/src/index.ts CHANGED
@@ -114,6 +114,7 @@ async function renderTerminalImage(ctx: Context, workingDir: string, command: st
114
114
  background: #1e1e1e;
115
115
  color: #cccccc;
116
116
  font-family: 'JetBrains Mono', 'Courier New', monospace;
117
+ font-weight: 400;
117
118
  font-size: 14px;
118
119
  padding: 0;
119
120
  display: inline-block;
@@ -160,24 +161,35 @@ async function renderTerminalImage(ctx: Context, workingDir: string, command: st
160
161
  .button.close { background: #ff5f56; }
161
162
 
162
163
  .content {
163
- padding: 16px;
164
+ padding: 12px 16px;
164
165
  white-space: pre-wrap;
165
- word-break: break-all;
166
- line-height: 1.5;
166
+ word-break: break-word;
167
+ line-height: 1.35;
168
+ }
169
+
170
+ .command-line {
171
+ display: flex;
172
+ gap: 6px;
173
+ align-items: baseline;
174
+ margin-bottom: 10px;
167
175
  }
168
176
 
169
177
  .prompt {
170
178
  color: #4ec9b0;
171
- margin-bottom: 8px;
179
+ margin: 0;
180
+ flex-shrink: 0;
172
181
  }
173
182
 
174
183
  .command {
175
184
  color: #dcdcaa;
176
- margin-bottom: 12px;
185
+ margin: 0;
186
+ word-break: break-word;
187
+ flex: 1;
177
188
  }
178
189
 
179
190
  .output {
180
191
  color: #cccccc;
192
+ line-height: 1.4;
181
193
  }
182
194
  </style>
183
195
  </head>
@@ -192,8 +204,10 @@ async function renderTerminalImage(ctx: Context, workingDir: string, command: st
192
204
  </div>
193
205
  </div>
194
206
  <div class="content">
195
- <div class="prompt">${escapeHtml(workingDir)}$</div>
196
- <div class="command">${escapeHtml(command)}</div>
207
+ <div class="command-line">
208
+ <div class="prompt">${escapeHtml(workingDir)}$</div>
209
+ <div class="command">${escapeHtml(command)}</div>
210
+ </div>
197
211
  <div class="output">${escapeHtml(output)}</div>
198
212
  </div>
199
213
  </div>