voice_control 0.1.0
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +55 -0
- data/CONTRIBUTING.md +56 -0
- data/LICENSE +21 -0
- data/README.md +343 -0
- data/SECURITY.md +15 -0
- data/app/controllers/voice_control/assets_controller.rb +20 -0
- data/app/controllers/voice_control/commands_controller.rb +77 -0
- data/assets/widget.css +346 -0
- data/assets/widget.js +1910 -0
- data/config/routes.rb +7 -0
- data/docs/browser-actions.md +112 -0
- data/docs/commands.md +113 -0
- data/docs/configuration.md +40 -0
- data/docs/demo.md +39 -0
- data/docs/deployment.md +103 -0
- data/docs/integration.md +79 -0
- data/examples/react.jsx +27 -0
- data/lib/generators/voice_control/install/install_generator.rb +21 -0
- data/lib/generators/voice_control/install/templates/voice_control.rb +72 -0
- data/lib/voice_control/argument.rb +59 -0
- data/lib/voice_control/browser_actions.rb +210 -0
- data/lib/voice_control/command.rb +51 -0
- data/lib/voice_control/configuration.rb +71 -0
- data/lib/voice_control/conversation.rb +217 -0
- data/lib/voice_control/engine.rb +11 -0
- data/lib/voice_control/jev.rb +60 -0
- data/lib/voice_control/result.rb +59 -0
- data/lib/voice_control/version.rb +3 -0
- data/lib/voice_control/widget_helper.rb +20 -0
- data/lib/voice_control.rb +29 -0
- metadata +153 -0
data/assets/widget.css
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
all: initial;
|
|
3
|
+
position: fixed;
|
|
4
|
+
bottom: 24px;
|
|
5
|
+
right: 24px;
|
|
6
|
+
z-index: 2147483000;
|
|
7
|
+
color: #222820;
|
|
8
|
+
font:
|
|
9
|
+
14px/1.5 system-ui,
|
|
10
|
+
-apple-system,
|
|
11
|
+
sans-serif;
|
|
12
|
+
}
|
|
13
|
+
* {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
:host([data-position="bottom_left"]) {
|
|
17
|
+
left: 24px;
|
|
18
|
+
right: auto;
|
|
19
|
+
}
|
|
20
|
+
:host([data-position="bottom_left"]) .launcher {
|
|
21
|
+
margin-left: 0;
|
|
22
|
+
margin-right: auto;
|
|
23
|
+
}
|
|
24
|
+
:host([data-position="bottom_left"]) .panel {
|
|
25
|
+
left: 0;
|
|
26
|
+
right: auto;
|
|
27
|
+
}
|
|
28
|
+
[hidden] {
|
|
29
|
+
display: none !important;
|
|
30
|
+
}
|
|
31
|
+
button,
|
|
32
|
+
input {
|
|
33
|
+
font: inherit;
|
|
34
|
+
}
|
|
35
|
+
button {
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
color: inherit;
|
|
38
|
+
}
|
|
39
|
+
button:focus-visible,
|
|
40
|
+
input:focus-visible {
|
|
41
|
+
outline: 3px solid #75904b;
|
|
42
|
+
outline-offset: 3px;
|
|
43
|
+
}
|
|
44
|
+
.launcher {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
margin-left: auto;
|
|
49
|
+
width: 56px;
|
|
50
|
+
height: 56px;
|
|
51
|
+
border: 1px solid #d4dfc4;
|
|
52
|
+
border-radius: 16px;
|
|
53
|
+
background: #d9f5ae;
|
|
54
|
+
box-shadow: 0 6px 24px #14240026;
|
|
55
|
+
}
|
|
56
|
+
.launcher:hover {
|
|
57
|
+
background: #c9ed92;
|
|
58
|
+
}
|
|
59
|
+
.launcher svg {
|
|
60
|
+
width: 24px;
|
|
61
|
+
height: 24px;
|
|
62
|
+
}
|
|
63
|
+
:host([data-launcher-size="small"]) .launcher {
|
|
64
|
+
width: 44px;
|
|
65
|
+
height: 44px;
|
|
66
|
+
border-radius: 12px;
|
|
67
|
+
}
|
|
68
|
+
:host([data-launcher-size="small"]) .launcher svg {
|
|
69
|
+
width: 20px;
|
|
70
|
+
height: 20px;
|
|
71
|
+
}
|
|
72
|
+
:host([data-launcher-size="small"]) .panel {
|
|
73
|
+
bottom: 58px;
|
|
74
|
+
}
|
|
75
|
+
.panel {
|
|
76
|
+
position: absolute;
|
|
77
|
+
bottom: 70px;
|
|
78
|
+
right: 0;
|
|
79
|
+
width: min(390px, calc(100vw - 32px));
|
|
80
|
+
max-height: calc(100dvh - 120px);
|
|
81
|
+
overflow-y: auto;
|
|
82
|
+
padding: 18px;
|
|
83
|
+
background: #fffef9;
|
|
84
|
+
border: 1px solid #dedfd5;
|
|
85
|
+
border-radius: 16px;
|
|
86
|
+
box-shadow: 0 14px 60px #1d2b2026;
|
|
87
|
+
}
|
|
88
|
+
header,
|
|
89
|
+
.activity,
|
|
90
|
+
form,
|
|
91
|
+
.controls {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: space-between;
|
|
95
|
+
gap: 10px;
|
|
96
|
+
}
|
|
97
|
+
strong {
|
|
98
|
+
font-size: 24px;
|
|
99
|
+
letter-spacing: -1.2px;
|
|
100
|
+
font-weight: 750;
|
|
101
|
+
}
|
|
102
|
+
strong span {
|
|
103
|
+
color: #6b8a39;
|
|
104
|
+
margin-left: 4px;
|
|
105
|
+
}
|
|
106
|
+
small {
|
|
107
|
+
display: block;
|
|
108
|
+
font-size: 12px;
|
|
109
|
+
color: #71786b;
|
|
110
|
+
}
|
|
111
|
+
.controls button {
|
|
112
|
+
border: 1px solid #e3e5db;
|
|
113
|
+
background: transparent;
|
|
114
|
+
border-radius: 50%;
|
|
115
|
+
width: 29px;
|
|
116
|
+
height: 29px;
|
|
117
|
+
padding: 0;
|
|
118
|
+
font-size: 17px;
|
|
119
|
+
}
|
|
120
|
+
.activity {
|
|
121
|
+
justify-content: start;
|
|
122
|
+
margin-top: 14px;
|
|
123
|
+
font-size: 12px;
|
|
124
|
+
color: #646b5e;
|
|
125
|
+
}
|
|
126
|
+
.indicator {
|
|
127
|
+
width: 7px;
|
|
128
|
+
height: 7px;
|
|
129
|
+
border-radius: 50%;
|
|
130
|
+
background: #adb5a5;
|
|
131
|
+
}
|
|
132
|
+
.indicator.live {
|
|
133
|
+
background: #668637;
|
|
134
|
+
box-shadow: 0 0 0 4px #e4efda;
|
|
135
|
+
animation: pulse 2s infinite;
|
|
136
|
+
}
|
|
137
|
+
.mic {
|
|
138
|
+
margin-left: auto;
|
|
139
|
+
background: none;
|
|
140
|
+
border: 0;
|
|
141
|
+
text-decoration: underline;
|
|
142
|
+
font-size: 12px;
|
|
143
|
+
}
|
|
144
|
+
.status {
|
|
145
|
+
font-size: 16px;
|
|
146
|
+
line-height: 1.5;
|
|
147
|
+
margin: 14px 0;
|
|
148
|
+
overflow-wrap: anywhere;
|
|
149
|
+
}
|
|
150
|
+
form {
|
|
151
|
+
background: #f0f2e9;
|
|
152
|
+
border: 1px solid #e0e4d5;
|
|
153
|
+
border-radius: 13px;
|
|
154
|
+
padding: 6px;
|
|
155
|
+
}
|
|
156
|
+
input {
|
|
157
|
+
min-width: 0;
|
|
158
|
+
width: 100%;
|
|
159
|
+
border: none;
|
|
160
|
+
background: transparent;
|
|
161
|
+
padding: 9px;
|
|
162
|
+
color: #222820;
|
|
163
|
+
}
|
|
164
|
+
.send {
|
|
165
|
+
flex-shrink: 0;
|
|
166
|
+
width: 36px;
|
|
167
|
+
height: 36px;
|
|
168
|
+
border: none;
|
|
169
|
+
border-radius: 9px;
|
|
170
|
+
background: #d9f5ae;
|
|
171
|
+
font-size: 22px;
|
|
172
|
+
}
|
|
173
|
+
.send:disabled {
|
|
174
|
+
opacity: 0.5;
|
|
175
|
+
cursor: wait;
|
|
176
|
+
}
|
|
177
|
+
.help {
|
|
178
|
+
margin-top: 18px;
|
|
179
|
+
border-top: 1px solid #e3e5db;
|
|
180
|
+
padding-top: 12px;
|
|
181
|
+
}
|
|
182
|
+
.help input {
|
|
183
|
+
border: 1px solid #e3e5db;
|
|
184
|
+
border-radius: 9px;
|
|
185
|
+
}
|
|
186
|
+
.catalog {
|
|
187
|
+
max-height: 230px;
|
|
188
|
+
overflow-y: auto;
|
|
189
|
+
}
|
|
190
|
+
h3 {
|
|
191
|
+
font-size: 10px;
|
|
192
|
+
text-transform: uppercase;
|
|
193
|
+
letter-spacing: 1px;
|
|
194
|
+
color: #7b8472;
|
|
195
|
+
margin: 18px 0 6px;
|
|
196
|
+
}
|
|
197
|
+
.catalog button,
|
|
198
|
+
.choices button {
|
|
199
|
+
display: block;
|
|
200
|
+
width: 100%;
|
|
201
|
+
padding: 8px 10px;
|
|
202
|
+
border: 0;
|
|
203
|
+
border-radius: 8px;
|
|
204
|
+
background: transparent;
|
|
205
|
+
text-align: left;
|
|
206
|
+
}
|
|
207
|
+
.catalog button:hover,
|
|
208
|
+
.choices button:hover {
|
|
209
|
+
background: #edf4e2;
|
|
210
|
+
}
|
|
211
|
+
.catalog small {
|
|
212
|
+
padding: 0 10px 8px;
|
|
213
|
+
font-size: 10px;
|
|
214
|
+
}
|
|
215
|
+
.choices {
|
|
216
|
+
margin-bottom: 12px;
|
|
217
|
+
}
|
|
218
|
+
.sr-only {
|
|
219
|
+
position: absolute;
|
|
220
|
+
width: 1px;
|
|
221
|
+
height: 1px;
|
|
222
|
+
overflow: hidden;
|
|
223
|
+
clip-path: inset(50%);
|
|
224
|
+
white-space: nowrap;
|
|
225
|
+
}
|
|
226
|
+
@keyframes pulse {
|
|
227
|
+
50% {
|
|
228
|
+
box-shadow: 0 0 0 6px #e4efda60;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
@media (prefers-reduced-motion: reduce) {
|
|
232
|
+
.indicator.live {
|
|
233
|
+
animation: none;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
@media (max-width: 480px) {
|
|
237
|
+
:host {
|
|
238
|
+
right: 16px;
|
|
239
|
+
bottom: 16px;
|
|
240
|
+
}
|
|
241
|
+
:host([data-position="bottom_left"]) {
|
|
242
|
+
left: 16px;
|
|
243
|
+
right: auto;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.field-tools {
|
|
248
|
+
display: flex;
|
|
249
|
+
align-items: center;
|
|
250
|
+
justify-content: space-between;
|
|
251
|
+
gap: 10px;
|
|
252
|
+
margin-top: 10px;
|
|
253
|
+
font-size: 12px;
|
|
254
|
+
color: #646b5e;
|
|
255
|
+
}
|
|
256
|
+
.selected-field {
|
|
257
|
+
overflow: hidden;
|
|
258
|
+
text-overflow: ellipsis;
|
|
259
|
+
white-space: nowrap;
|
|
260
|
+
}
|
|
261
|
+
.undo {
|
|
262
|
+
border: 0;
|
|
263
|
+
background: none;
|
|
264
|
+
text-decoration: underline;
|
|
265
|
+
padding: 3px;
|
|
266
|
+
flex-shrink: 0;
|
|
267
|
+
}
|
|
268
|
+
.suggestions {
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-wrap: wrap;
|
|
271
|
+
gap: 6px;
|
|
272
|
+
margin-top: 12px;
|
|
273
|
+
}
|
|
274
|
+
.suggestions button {
|
|
275
|
+
background: #f0f2e9;
|
|
276
|
+
border: 1px solid #e0e4d5;
|
|
277
|
+
border-radius: 8px;
|
|
278
|
+
padding: 5px 9px;
|
|
279
|
+
font-size: 12px;
|
|
280
|
+
max-width: 100%;
|
|
281
|
+
overflow-wrap: anywhere;
|
|
282
|
+
}
|
|
283
|
+
.suggestions button:hover {
|
|
284
|
+
background: #e4efda;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
header {
|
|
288
|
+
padding-bottom: 12px;
|
|
289
|
+
border-bottom: 1px solid #e3e5db;
|
|
290
|
+
}
|
|
291
|
+
.send:hover {
|
|
292
|
+
background: #c9ed92;
|
|
293
|
+
}
|
|
294
|
+
.debug {
|
|
295
|
+
margin-top: 14px;
|
|
296
|
+
padding-top: 10px;
|
|
297
|
+
border-top: 1px solid #e3e5db;
|
|
298
|
+
font-size: 11px;
|
|
299
|
+
color: #646b5e;
|
|
300
|
+
}
|
|
301
|
+
.debug summary {
|
|
302
|
+
cursor: pointer;
|
|
303
|
+
}
|
|
304
|
+
.debug pre {
|
|
305
|
+
max-height: 280px;
|
|
306
|
+
overflow-y: auto;
|
|
307
|
+
font:
|
|
308
|
+
11px/1.6 ui-monospace,
|
|
309
|
+
monospace;
|
|
310
|
+
white-space: pre-wrap;
|
|
311
|
+
overflow-wrap: anywhere;
|
|
312
|
+
margin-bottom: 0;
|
|
313
|
+
}
|
|
314
|
+
.copy-debug {
|
|
315
|
+
margin: 10px 8px 0 0;
|
|
316
|
+
padding: 5px 9px;
|
|
317
|
+
border: 1px solid #e0e4d5;
|
|
318
|
+
border-radius: 8px;
|
|
319
|
+
background: #f0f2e9;
|
|
320
|
+
font-size: 11px;
|
|
321
|
+
}
|
|
322
|
+
.copy-debug:disabled {
|
|
323
|
+
opacity: 0.5;
|
|
324
|
+
}
|
|
325
|
+
.copy-status {
|
|
326
|
+
font-size: 11px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.notification {
|
|
330
|
+
position: fixed;
|
|
331
|
+
top: 24px;
|
|
332
|
+
right: 24px;
|
|
333
|
+
max-width: min(360px, calc(100vw - 48px));
|
|
334
|
+
padding: 12px 18px;
|
|
335
|
+
border: 1px solid #c6d8b0;
|
|
336
|
+
border-radius: 12px;
|
|
337
|
+
background: #edf6e3;
|
|
338
|
+
color: #33492b;
|
|
339
|
+
box-shadow: 0 6px 24px #14240026;
|
|
340
|
+
overflow-wrap: anywhere;
|
|
341
|
+
pointer-events: none;
|
|
342
|
+
}
|
|
343
|
+
:host([data-position="bottom_left"]) .notification {
|
|
344
|
+
left: 24px;
|
|
345
|
+
right: auto;
|
|
346
|
+
}
|