@fias/plugin-dev-harness 1.1.5 → 1.1.7
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/cli/submit.d.ts.map +1 -1
- package/dist/cli/submit.js +13 -6
- package/dist/cli/submit.js.map +1 -1
- package/dist/cli/submit.test.js +7 -6
- package/dist/cli/submit.test.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/mocks/theme.d.ts +6 -34
- package/dist/mocks/theme.d.ts.map +1 -1
- package/dist/mocks/theme.js +8 -46
- package/dist/mocks/theme.js.map +1 -1
- package/dist/server/harness-server.js +7 -7
- package/dist/server/static/harness.css +7 -7
- package/dist/server/static/harness.js +10 -10
- package/dist/server/static/static/harness.css +332 -0
- package/dist/server/static/static/harness.html +53 -0
- package/dist/server/static/static/harness.js +550 -0
- package/package.json +11 -11
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
* {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
body {
|
|
8
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
9
|
+
background: #0a0a0f;
|
|
10
|
+
color: #e4e4e7;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
height: 100vh;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Toolbar */
|
|
17
|
+
.toolbar {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
align-items: center;
|
|
21
|
+
padding: 8px 16px;
|
|
22
|
+
background: #18181b;
|
|
23
|
+
border-bottom: 1px solid #3f3f46;
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.toolbar-left,
|
|
28
|
+
.toolbar-right {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 12px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.logo {
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
color: #a78bfa;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.mode-badge {
|
|
41
|
+
padding: 3px 10px;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
font-size: 11px;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
transition: background 0.15s, border-color 0.15s;
|
|
48
|
+
user-select: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.mode-badge:hover {
|
|
52
|
+
filter: brightness(1.3);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.mode-badge:active {
|
|
56
|
+
filter: brightness(0.9);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.mode-mock {
|
|
60
|
+
background: #166534;
|
|
61
|
+
color: #86efac;
|
|
62
|
+
border: 1px solid #22c55e;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.mode-live {
|
|
66
|
+
background: #854d0e;
|
|
67
|
+
color: #fde047;
|
|
68
|
+
border: 1px solid #eab308;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.theme-badge {
|
|
72
|
+
padding: 2px 8px;
|
|
73
|
+
border-radius: 4px;
|
|
74
|
+
font-size: 11px;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
text-transform: uppercase;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.theme-dark {
|
|
80
|
+
background: #171717;
|
|
81
|
+
color: #a6a6a6;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.theme-light {
|
|
85
|
+
background: #e5e5e5;
|
|
86
|
+
color: #171717;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.credit-balance {
|
|
90
|
+
font-size: 12px;
|
|
91
|
+
color: #fde047;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.btn-icon {
|
|
95
|
+
background: #27272a;
|
|
96
|
+
border: 1px solid #3f3f46;
|
|
97
|
+
color: #e4e4e7;
|
|
98
|
+
padding: 4px 8px;
|
|
99
|
+
border-radius: 4px;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.btn-icon:hover {
|
|
105
|
+
background: #3f3f46;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Login Modal */
|
|
109
|
+
.modal-overlay {
|
|
110
|
+
position: fixed;
|
|
111
|
+
inset: 0;
|
|
112
|
+
background: rgba(0, 0, 0, 0.7);
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
z-index: 1000;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.modal {
|
|
120
|
+
background: #27272a;
|
|
121
|
+
border: 1px solid #3f3f46;
|
|
122
|
+
border-radius: 8px;
|
|
123
|
+
padding: 24px;
|
|
124
|
+
width: 420px;
|
|
125
|
+
max-width: 90vw;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.modal h3 {
|
|
129
|
+
font-size: 16px;
|
|
130
|
+
color: #e4e4e7;
|
|
131
|
+
margin-bottom: 8px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.modal p {
|
|
135
|
+
font-size: 13px;
|
|
136
|
+
color: #a1a1aa;
|
|
137
|
+
line-height: 1.5;
|
|
138
|
+
margin-bottom: 4px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.modal-hint {
|
|
142
|
+
font-size: 12px !important;
|
|
143
|
+
color: #6b7280 !important;
|
|
144
|
+
margin-bottom: 16px !important;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.modal-input {
|
|
148
|
+
width: 100%;
|
|
149
|
+
padding: 8px 12px;
|
|
150
|
+
background: #18181b;
|
|
151
|
+
border: 1px solid #3f3f46;
|
|
152
|
+
border-radius: 4px;
|
|
153
|
+
color: #e4e4e7;
|
|
154
|
+
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
155
|
+
font-size: 13px;
|
|
156
|
+
margin-bottom: 12px;
|
|
157
|
+
outline: none;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.modal-input:focus {
|
|
161
|
+
border-color: #a78bfa;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.modal-error {
|
|
165
|
+
font-size: 12px;
|
|
166
|
+
color: #fca5a5;
|
|
167
|
+
margin-bottom: 12px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.modal-actions {
|
|
171
|
+
display: flex;
|
|
172
|
+
justify-content: flex-end;
|
|
173
|
+
gap: 8px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.btn-primary {
|
|
177
|
+
background: #ffffff;
|
|
178
|
+
color: #0a0a0a;
|
|
179
|
+
border: none;
|
|
180
|
+
padding: 6px 16px;
|
|
181
|
+
border-radius: 4px;
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
font-size: 13px;
|
|
184
|
+
font-weight: 500;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.btn-primary:hover {
|
|
188
|
+
background: #e5e5e5;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.btn-primary:disabled {
|
|
192
|
+
opacity: 0.5;
|
|
193
|
+
cursor: not-allowed;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.btn-secondary {
|
|
197
|
+
background: transparent;
|
|
198
|
+
color: #a1a1aa;
|
|
199
|
+
border: 1px solid #3f3f46;
|
|
200
|
+
padding: 6px 16px;
|
|
201
|
+
border-radius: 4px;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
font-size: 13px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.btn-secondary:hover {
|
|
207
|
+
background: #3f3f46;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Plugin status overlay */
|
|
211
|
+
.plugin-status {
|
|
212
|
+
flex: 1;
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
align-items: center;
|
|
216
|
+
justify-content: center;
|
|
217
|
+
gap: 16px;
|
|
218
|
+
color: #a1a1aa;
|
|
219
|
+
font-size: 14px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.plugin-status.hidden {
|
|
223
|
+
display: none;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.plugin-status.error {
|
|
227
|
+
color: #fca5a5;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.plugin-status p {
|
|
231
|
+
max-width: 500px;
|
|
232
|
+
text-align: center;
|
|
233
|
+
line-height: 1.6;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.plugin-status code {
|
|
237
|
+
background: #27272a;
|
|
238
|
+
padding: 2px 8px;
|
|
239
|
+
border-radius: 4px;
|
|
240
|
+
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
241
|
+
font-size: 13px;
|
|
242
|
+
color: #e4e4e7;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.status-spinner {
|
|
246
|
+
width: 24px;
|
|
247
|
+
height: 24px;
|
|
248
|
+
border: 3px solid #3f3f46;
|
|
249
|
+
border-top-color: #a78bfa;
|
|
250
|
+
border-radius: 50%;
|
|
251
|
+
animation: spin 0.8s linear infinite;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@keyframes spin {
|
|
255
|
+
to { transform: rotate(360deg); }
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* Plugin iframe */
|
|
259
|
+
#plugin-iframe {
|
|
260
|
+
flex: 1;
|
|
261
|
+
border: none;
|
|
262
|
+
width: 100%;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
#plugin-iframe.hidden {
|
|
266
|
+
display: none;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* Dev Console */
|
|
270
|
+
.console-panel {
|
|
271
|
+
flex-shrink: 0;
|
|
272
|
+
border-top: 1px solid #3f3f46;
|
|
273
|
+
background: #18181b;
|
|
274
|
+
max-height: 250px;
|
|
275
|
+
display: flex;
|
|
276
|
+
flex-direction: column;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.console-header {
|
|
280
|
+
display: flex;
|
|
281
|
+
justify-content: space-between;
|
|
282
|
+
padding: 6px 16px;
|
|
283
|
+
cursor: pointer;
|
|
284
|
+
font-size: 12px;
|
|
285
|
+
color: #a1a1aa;
|
|
286
|
+
border-bottom: 1px solid #27272a;
|
|
287
|
+
user-select: none;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.console-header:hover {
|
|
291
|
+
background: #1e1e22;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.console-body {
|
|
295
|
+
overflow-y: auto;
|
|
296
|
+
padding: 8px 16px;
|
|
297
|
+
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
298
|
+
font-size: 11px;
|
|
299
|
+
flex: 1;
|
|
300
|
+
display: none;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.console-body.open {
|
|
304
|
+
display: block;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.log-entry {
|
|
308
|
+
padding: 2px 0;
|
|
309
|
+
border-bottom: 1px solid #1e1e22;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.log-info {
|
|
313
|
+
color: #93c5fd;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.log-warn {
|
|
317
|
+
color: #fde047;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.log-error {
|
|
321
|
+
color: #fca5a5;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.log-time {
|
|
325
|
+
color: #6b7280;
|
|
326
|
+
margin-right: 8px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.log-cost {
|
|
330
|
+
color: #fbbf24;
|
|
331
|
+
margin-left: 8px;
|
|
332
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Fias Arche Dev</title>
|
|
7
|
+
<link rel="stylesheet" href="/static/harness.css" />
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div class="toolbar">
|
|
11
|
+
<div class="toolbar-left">
|
|
12
|
+
<span class="logo">Fias Arche Dev</span>
|
|
13
|
+
<button id="mode-badge" class="mode-badge mode-mock" title="Click to switch mode">MOCK ⇆</button>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="toolbar-right">
|
|
16
|
+
<span id="credit-balance" class="credit-balance" style="display: none"></span>
|
|
17
|
+
<span id="theme-badge" class="theme-badge theme-dark">DARK</span>
|
|
18
|
+
<button id="theme-toggle" class="btn-icon" title="Toggle theme">☼/☾</button>
|
|
19
|
+
<button id="reload-btn" class="btn-icon" title="Reload plugin">↻</button>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<!-- Login modal -->
|
|
23
|
+
<div id="login-modal" class="modal-overlay" style="display: none">
|
|
24
|
+
<div class="modal">
|
|
25
|
+
<h3>Connect to FIAS</h3>
|
|
26
|
+
<p>Enter your API key to enable live mode with real AI responses.</p>
|
|
27
|
+
<p class="modal-hint">Get an API key from your FIAS platform account settings.</p>
|
|
28
|
+
<input id="login-input" type="password" class="modal-input" placeholder="fias_sk_..." autocomplete="off" />
|
|
29
|
+
<div id="login-error" class="modal-error" style="display: none"></div>
|
|
30
|
+
<div class="modal-actions">
|
|
31
|
+
<button id="login-cancel" class="btn-secondary">Cancel</button>
|
|
32
|
+
<button id="login-submit" class="btn-primary">Save & Connect</button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div id="plugin-status" class="plugin-status">
|
|
37
|
+
<div class="status-spinner"></div>
|
|
38
|
+
<p>Connecting to plugin server...</p>
|
|
39
|
+
</div>
|
|
40
|
+
<iframe
|
|
41
|
+
id="plugin-iframe"
|
|
42
|
+
sandbox="allow-scripts allow-forms allow-same-origin"
|
|
43
|
+
></iframe>
|
|
44
|
+
<div id="console-panel" class="console-panel">
|
|
45
|
+
<div class="console-header" id="console-toggle">
|
|
46
|
+
<span>Dev Console</span>
|
|
47
|
+
<span id="console-count">0 messages</span>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="console-body" id="console-body"></div>
|
|
50
|
+
</div>
|
|
51
|
+
<script src="/static/harness.js"></script>
|
|
52
|
+
</body>
|
|
53
|
+
</html>
|