@lyy0709/contextweaver 1.0.2 → 1.0.3
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/dist/index.js
CHANGED
|
@@ -153,7 +153,7 @@ cli.command("enhance <prompt>", "\u589E\u5F3A\u63D0\u793A\u8BCD").option("--no-b
|
|
|
153
153
|
}
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
const { startEnhanceServer } = await import("./server-
|
|
156
|
+
const { startEnhanceServer } = await import("./server-MLTGGZFP.js");
|
|
157
157
|
const { openBrowser } = await import("./browser-VC5772XM.js");
|
|
158
158
|
try {
|
|
159
159
|
const result = await startEnhanceServer(prompt, {
|
|
@@ -59,6 +59,7 @@ function getEnhancePageHtml() {
|
|
|
59
59
|
justify-content: space-between;
|
|
60
60
|
gap: 16px;
|
|
61
61
|
margin-bottom: 14px;
|
|
62
|
+
flex-wrap: wrap;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
.title {
|
|
@@ -71,6 +72,8 @@ function getEnhancePageHtml() {
|
|
|
71
72
|
display: flex;
|
|
72
73
|
align-items: center;
|
|
73
74
|
gap: 14px;
|
|
75
|
+
flex-wrap: wrap;
|
|
76
|
+
justify-content: flex-end;
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
.countdown {
|
|
@@ -90,6 +93,7 @@ function getEnhancePageHtml() {
|
|
|
90
93
|
color: var(--muted2);
|
|
91
94
|
text-align: right;
|
|
92
95
|
line-height: 1.4;
|
|
96
|
+
word-break: break-word;
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
.panel {
|
|
@@ -98,29 +102,63 @@ function getEnhancePageHtml() {
|
|
|
98
102
|
border-radius: 14px;
|
|
99
103
|
overflow: hidden;
|
|
100
104
|
box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
.grid {
|
|
104
110
|
display: grid;
|
|
105
111
|
grid-template-columns: 1fr 1fr;
|
|
106
112
|
gap: 0;
|
|
113
|
+
height: min(720px, calc(100vh - 240px));
|
|
114
|
+
height: min(720px, calc(100dvh - 240px));
|
|
107
115
|
min-height: 520px;
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
@media (max-width: 920px) {
|
|
111
119
|
.grid {
|
|
112
120
|
grid-template-columns: 1fr;
|
|
121
|
+
height: auto;
|
|
122
|
+
min-height: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.header-right {
|
|
126
|
+
width: 100%;
|
|
127
|
+
justify-content: flex-start;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.meta {
|
|
131
|
+
text-align: left;
|
|
113
132
|
}
|
|
114
133
|
}
|
|
115
134
|
|
|
116
135
|
.col {
|
|
117
136
|
padding: 14px;
|
|
118
137
|
border-right: 1px solid var(--border);
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
gap: 10px;
|
|
141
|
+
min-height: 0;
|
|
119
142
|
}
|
|
120
143
|
.col:last-child {
|
|
121
144
|
border-right: none;
|
|
122
145
|
}
|
|
123
146
|
|
|
147
|
+
@media (max-width: 920px) {
|
|
148
|
+
.col {
|
|
149
|
+
border-right: none;
|
|
150
|
+
border-bottom: 1px solid var(--border);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.col:last-child {
|
|
154
|
+
border-bottom: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
textarea {
|
|
158
|
+
min-height: 320px;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
124
162
|
.label {
|
|
125
163
|
display: flex;
|
|
126
164
|
align-items: baseline;
|
|
@@ -128,14 +166,14 @@ function getEnhancePageHtml() {
|
|
|
128
166
|
gap: 12px;
|
|
129
167
|
font-size: 12px;
|
|
130
168
|
color: var(--muted);
|
|
131
|
-
margin: 4px 2px
|
|
169
|
+
margin: 4px 2px 0;
|
|
132
170
|
letter-spacing: 0.5px;
|
|
133
171
|
}
|
|
134
172
|
|
|
135
173
|
textarea {
|
|
136
174
|
width: 100%;
|
|
137
|
-
|
|
138
|
-
min-height:
|
|
175
|
+
flex: 1;
|
|
176
|
+
min-height: 0;
|
|
139
177
|
padding: 12px 12px;
|
|
140
178
|
border: 1px solid var(--border);
|
|
141
179
|
border-radius: 10px;
|
|
@@ -145,29 +183,35 @@ function getEnhancePageHtml() {
|
|
|
145
183
|
'Courier New', monospace;
|
|
146
184
|
font-size: 13px;
|
|
147
185
|
line-height: 1.55;
|
|
148
|
-
resize:
|
|
186
|
+
resize: none;
|
|
149
187
|
outline: none;
|
|
188
|
+
overflow: auto;
|
|
189
|
+
scrollbar-gutter: stable;
|
|
150
190
|
}
|
|
151
191
|
|
|
152
192
|
textarea:focus {
|
|
153
193
|
border-color: rgba(255, 255, 255, 0.45);
|
|
154
|
-
|
|
194
|
+
outline: 2px solid rgba(255, 255, 255, 0.28);
|
|
195
|
+
outline-offset: -2px;
|
|
155
196
|
}
|
|
156
197
|
|
|
157
198
|
.footer {
|
|
158
199
|
display: flex;
|
|
159
|
-
align-items:
|
|
200
|
+
align-items: flex-start;
|
|
160
201
|
justify-content: space-between;
|
|
161
202
|
gap: 12px;
|
|
162
203
|
padding: 12px 14px;
|
|
163
204
|
border-top: 1px solid var(--border);
|
|
164
205
|
background: rgba(0, 0, 0, 0.5);
|
|
206
|
+
flex-wrap: wrap;
|
|
165
207
|
}
|
|
166
208
|
|
|
167
209
|
.hint {
|
|
168
210
|
font-size: 12px;
|
|
169
211
|
color: var(--muted2);
|
|
170
212
|
line-height: 1.45;
|
|
213
|
+
flex: 1 1 260px;
|
|
214
|
+
min-width: 220px;
|
|
171
215
|
}
|
|
172
216
|
|
|
173
217
|
.buttons {
|
|
@@ -177,6 +221,18 @@ function getEnhancePageHtml() {
|
|
|
177
221
|
justify-content: flex-end;
|
|
178
222
|
}
|
|
179
223
|
|
|
224
|
+
@media (max-width: 520px) {
|
|
225
|
+
.buttons {
|
|
226
|
+
width: 100%;
|
|
227
|
+
justify-content: stretch;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.buttons button {
|
|
231
|
+
flex: 1 1 auto;
|
|
232
|
+
justify-content: center;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
180
236
|
button {
|
|
181
237
|
appearance: none;
|
|
182
238
|
border: 1px solid var(--border);
|
|
@@ -309,7 +365,7 @@ function getEnhancePageHtml() {
|
|
|
309
365
|
if (remaining <= 0) {
|
|
310
366
|
clearInterval(countdownTimer);
|
|
311
367
|
countdownEl.textContent = '\u5DF2\u8D85\u65F6';
|
|
312
|
-
setStatus('\u4F1A\u8BDD\
|
|
368
|
+
setStatus('\u4F1A\u8BDD\u8D85\u65F6\uFF0C\u5DF2\u81EA\u52A8\u91C7\u7528\u589E\u5F3A\u7248\u7ED3\u679C\u3002', 'success');
|
|
313
369
|
}
|
|
314
370
|
}
|
|
315
371
|
|
|
@@ -327,6 +383,7 @@ function getEnhancePageHtml() {
|
|
|
327
383
|
|
|
328
384
|
const edited = (enhancedEl.value || '').trim() && enhancedEl.value !== baselineEnhanced;
|
|
329
385
|
useEditedBtn.style.display = edited ? 'inline-block' : 'none';
|
|
386
|
+
useEditedBtn.disabled = !edited;
|
|
330
387
|
}
|
|
331
388
|
|
|
332
389
|
originalEl.addEventListener('input', updateCounts);
|
|
@@ -610,10 +667,8 @@ async function startEnhanceServer(prompt, options = {}) {
|
|
|
610
667
|
const timeoutMs = 8 * 60 * 1e3;
|
|
611
668
|
const timeout = setTimeout(() => {
|
|
612
669
|
if (resolved) return;
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
rejectResult?.(new Error("User interaction timeout (8 minutes)"));
|
|
616
|
-
});
|
|
670
|
+
logger.info("\u4F1A\u8BDD\u8D85\u65F6\uFF0C\u81EA\u52A8\u4F7F\u7528\u589E\u5F3A\u7248\u7ED3\u679C");
|
|
671
|
+
finish(session.enhanced);
|
|
617
672
|
}, timeoutMs);
|
|
618
673
|
function abort(message) {
|
|
619
674
|
if (resolved) return;
|