@hackbuild/ai-views 0.1.8 → 0.1.10
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/README.md +1 -1
- package/dist/dom.js +3 -3
- package/dist/single/index.iife.js +1 -1
- package/dist/single/index.js +1 -1
- package/dist/speaker.d.ts +2 -0
- package/dist/speaker.js +1 -1
- package/dist/vue.d.ts +14 -0
- package/dist/vue.js +117 -16
- package/llms.md +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -254,7 +254,7 @@ Changes are in the repository [CHANGELOG](../../CHANGELOG.md). Code is MIT ([LIC
|
|
|
254
254
|
|
|
255
255
|
| file | gzip (measured) | ceiling |
|
|
256
256
|
|---|---|---|
|
|
257
|
-
| `dist/index.js` (main entry, imports external) | 21,
|
|
257
|
+
| `dist/index.js` (main entry, imports external) | 21,606 bytes | 22,686 bytes |
|
|
258
258
|
| `dist/single/elements.iife.js` (single file build) | 100,083 bytes | 105,087 bytes |
|
|
259
259
|
|
|
260
260
|
Measured 2026-11-26 by `node tools/lint-packages.mjs` (gzip level 9) from the packed
|
package/dist/dom.js
CHANGED
|
@@ -51,7 +51,7 @@ export const ICON = {
|
|
|
51
51
|
zoomIn: svg('<circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3M11 8v6M8 11h6"/>'),
|
|
52
52
|
zoomOut: svg('<circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3M8 11h6"/>'),
|
|
53
53
|
fit: svg('<path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"/>'),
|
|
54
|
-
x: svg('<path d="M6 6l12 12M18 6 6 18"/>',
|
|
54
|
+
x: svg('<path d="M6 6l12 12M18 6 6 18"/>', 14),
|
|
55
55
|
copy: svg('<rect x="9" y="9" width="11" height="11"/><path d="M5 15V4h11"/>', 14),
|
|
56
56
|
redoMsg: svg('<path d="M21 12a9 9 0 1 1-3-6.7L21 8"/><path d="M21 3v5h-5"/>', 14),
|
|
57
57
|
point: svg('<circle cx="12" cy="12" r="3"/><path d="M12 2v5M12 17v5M2 12h5M17 12h5"/>', 18),
|
|
@@ -62,6 +62,6 @@ export const ICON = {
|
|
|
62
62
|
camera: svg('<path d="M3 7h4l2-3h6l2 3h4v13H3z"/><circle cx="12" cy="13" r="4"/>'),
|
|
63
63
|
menu: svg('<path d="M4 6h16M4 12h16M4 18h16"/>'),
|
|
64
64
|
plus: svg('<path d="M12 5v14M5 12h14"/>', 14),
|
|
65
|
-
pen: svg('<path d="M4 20h4L19 9l-4-4L4 16z"/>',
|
|
66
|
-
trash: svg('<path d="M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13"/>',
|
|
65
|
+
pen: svg('<path d="M4 20h4L19 9l-4-4L4 16z"/>', 14),
|
|
66
|
+
trash: svg('<path d="M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13"/>', 14),
|
|
67
67
|
};
|
|
@@ -18897,7 +18897,7 @@ self.onmessage = async (ev) => {
|
|
|
18897
18897
|
},
|
|
18898
18898
|
say(text) {
|
|
18899
18899
|
const signal = ctl.signal;
|
|
18900
|
-
chain = chain.then(() => speak(text, signal)).catch(() =>
|
|
18900
|
+
chain = chain.then(() => speak(text, signal)).catch((err) => o.onError?.(err, text));
|
|
18901
18901
|
return chain;
|
|
18902
18902
|
},
|
|
18903
18903
|
stop() {
|
package/dist/single/index.js
CHANGED
|
@@ -18895,7 +18895,7 @@ function speaker(engine, o = {}) {
|
|
|
18895
18895
|
},
|
|
18896
18896
|
say(text) {
|
|
18897
18897
|
const signal = ctl.signal;
|
|
18898
|
-
chain = chain.then(() => speak(text, signal)).catch(() =>
|
|
18898
|
+
chain = chain.then(() => speak(text, signal)).catch((err) => o.onError?.(err, text));
|
|
18899
18899
|
return chain;
|
|
18900
18900
|
},
|
|
18901
18901
|
stop() {
|
package/dist/speaker.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export interface SpeakerOptions {
|
|
|
33
33
|
halt?: () => void;
|
|
34
34
|
/** Each line as it starts, for a caption. */
|
|
35
35
|
onLine?: (text: string) => void;
|
|
36
|
+
/** A line that failed to render or play, with the reason; the chain goes on with the next line. */
|
|
37
|
+
onError?: (err: unknown, text: string) => void;
|
|
36
38
|
/** The voice config each line uses; a clone sets its own. */
|
|
37
39
|
config?: () => VoiceConfig;
|
|
38
40
|
}
|
package/dist/speaker.js
CHANGED
|
@@ -62,7 +62,7 @@ export function speaker(engine, o = {}) {
|
|
|
62
62
|
},
|
|
63
63
|
say(text) {
|
|
64
64
|
const signal = ctl.signal;
|
|
65
|
-
chain = chain.then(() => speak(text, signal)).catch(() =>
|
|
65
|
+
chain = chain.then(() => speak(text, signal)).catch((err) => o.onError?.(err, text));
|
|
66
66
|
return chain;
|
|
67
67
|
},
|
|
68
68
|
stop() {
|
package/dist/vue.d.ts
CHANGED
|
@@ -229,14 +229,17 @@ export declare const TranscriptView: import("vue").DefineComponent<{
|
|
|
229
229
|
* sample button is pressed, and with `demand` set, `want` when a tool needs a model not loaded yet.
|
|
230
230
|
*/
|
|
231
231
|
export declare const MaskStudio: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
232
|
+
/** The models it may use: a click segment and a segment everything. With none, the hand tools still work. */
|
|
232
233
|
models: {
|
|
233
234
|
type: PropType<MaskModels>;
|
|
234
235
|
default: () => {};
|
|
235
236
|
};
|
|
237
|
+
/** A sample button's label; empty hides it. A press emits `sample` for the page to set an image. */
|
|
236
238
|
sampleLabel: {
|
|
237
239
|
type: StringConstructor;
|
|
238
240
|
default: string;
|
|
239
241
|
};
|
|
242
|
+
/** Show the model tools before their models load; using one emits `want` so the page loads it. */
|
|
240
243
|
demand: {
|
|
241
244
|
type: BooleanConstructor;
|
|
242
245
|
default: boolean;
|
|
@@ -244,14 +247,17 @@ export declare const MaskStudio: import("vue").DefineComponent<import("vue").Ext
|
|
|
244
247
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
245
248
|
[key: string]: any;
|
|
246
249
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("sample" | "studio" | "want")[], "sample" | "studio" | "want", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
250
|
+
/** The models it may use: a click segment and a segment everything. With none, the hand tools still work. */
|
|
247
251
|
models: {
|
|
248
252
|
type: PropType<MaskModels>;
|
|
249
253
|
default: () => {};
|
|
250
254
|
};
|
|
255
|
+
/** A sample button's label; empty hides it. A press emits `sample` for the page to set an image. */
|
|
251
256
|
sampleLabel: {
|
|
252
257
|
type: StringConstructor;
|
|
253
258
|
default: string;
|
|
254
259
|
};
|
|
260
|
+
/** Show the model tools before their models load; using one emits `want` so the page loads it. */
|
|
255
261
|
demand: {
|
|
256
262
|
type: BooleanConstructor;
|
|
257
263
|
default: boolean;
|
|
@@ -318,6 +324,7 @@ export declare const TranscribeQueue: import("vue").DefineComponent<{
|
|
|
318
324
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
319
325
|
/** Vue component that shows a recall trace as a table. */
|
|
320
326
|
export declare const MemoryInspector: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
327
|
+
/** The last recall from @hackbuild/memory: its query, mode, hits and the trace of each memory scored. */
|
|
321
328
|
recall: {
|
|
322
329
|
type: PropType<RecallLike | null>;
|
|
323
330
|
default: null;
|
|
@@ -325,6 +332,7 @@ export declare const MemoryInspector: import("vue").DefineComponent<import("vue"
|
|
|
325
332
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
326
333
|
[key: string]: any;
|
|
327
334
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
335
|
+
/** The last recall from @hackbuild/memory: its query, mode, hits and the trace of each memory scored. */
|
|
328
336
|
recall: {
|
|
329
337
|
type: PropType<RecallLike | null>;
|
|
330
338
|
default: null;
|
|
@@ -364,14 +372,17 @@ export declare const ContextMeter: import("vue").DefineComponent<{
|
|
|
364
372
|
* mounted view.
|
|
365
373
|
*/
|
|
366
374
|
export declare const FrameView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
375
|
+
/** The picture: a URL, an image, a live video or a canvas. */
|
|
367
376
|
source: {
|
|
368
377
|
type: PropType<string | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null>;
|
|
369
378
|
default: null;
|
|
370
379
|
};
|
|
380
|
+
/** What to draw on it, in image pixels: boxes, landmarks, a caption and a corner tag. */
|
|
371
381
|
results: {
|
|
372
382
|
type: PropType<FrameResults>;
|
|
373
383
|
default: () => {};
|
|
374
384
|
};
|
|
385
|
+
/** Flip it left to right, as a front camera reads. */
|
|
375
386
|
mirror: {
|
|
376
387
|
type: BooleanConstructor;
|
|
377
388
|
default: boolean;
|
|
@@ -379,14 +390,17 @@ export declare const FrameView: import("vue").DefineComponent<import("vue").Extr
|
|
|
379
390
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
380
391
|
[key: string]: any;
|
|
381
392
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "view"[], "view", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
393
|
+
/** The picture: a URL, an image, a live video or a canvas. */
|
|
382
394
|
source: {
|
|
383
395
|
type: PropType<string | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null>;
|
|
384
396
|
default: null;
|
|
385
397
|
};
|
|
398
|
+
/** What to draw on it, in image pixels: boxes, landmarks, a caption and a corner tag. */
|
|
386
399
|
results: {
|
|
387
400
|
type: PropType<FrameResults>;
|
|
388
401
|
default: () => {};
|
|
389
402
|
};
|
|
403
|
+
/** Flip it left to right, as a front camera reads. */
|
|
390
404
|
mirror: {
|
|
391
405
|
type: BooleanConstructor;
|
|
392
406
|
default: boolean;
|
package/dist/vue.js
CHANGED
|
@@ -34,11 +34,15 @@ function hosted(setupMount, deps = () => []) {
|
|
|
34
34
|
export const ModelSelect = defineComponent({
|
|
35
35
|
name: "ModelSelect",
|
|
36
36
|
props: {
|
|
37
|
+
/** The job to pick for when no pick is passed: chat, voice, transcribe, detect and the rest. */
|
|
37
38
|
job: { type: String, default: "chat" },
|
|
39
|
+
/** A picker made with useModelPick, shared with the code that uses the model. Without one the view makes its own and emits it as `pick`. */
|
|
38
40
|
pick: { type: Object, default: undefined },
|
|
39
41
|
variant: { type: String, default: "line" },
|
|
40
42
|
go: { type: Boolean, default: true },
|
|
43
|
+
/** What this machine can run, from probe(); rows it cannot run say why. Used only when no pick is passed. */
|
|
41
44
|
env: { type: Object, default: undefined },
|
|
45
|
+
/** Fetches and starts the chosen model, such as jobLoader(job). Used only when no pick is passed. */
|
|
42
46
|
loader: { type: Function, default: undefined },
|
|
43
47
|
},
|
|
44
48
|
emits: ["choose", "pick", "loaded", "failed"],
|
|
@@ -64,9 +68,13 @@ export const ModelSelect = defineComponent({
|
|
|
64
68
|
export const ChatPane = defineComponent({
|
|
65
69
|
name: "ChatPane",
|
|
66
70
|
props: {
|
|
71
|
+
/** The thread to draw, from chatThread or a chatList's thread. */
|
|
67
72
|
thread: { type: Object, required: true },
|
|
73
|
+
/** The reply's name in its head. */
|
|
68
74
|
name: { type: String, default: "reply" },
|
|
75
|
+
/** The empty state's line, shown until the first turn. */
|
|
69
76
|
emptyName: { type: String, default: "what are we working on?" },
|
|
77
|
+
/** A plain note under the empty state's line. */
|
|
70
78
|
emptyNote: { type: String, default: "" },
|
|
71
79
|
},
|
|
72
80
|
setup: hosted((host, p) => mountChatPane(host, p.thread, { name: p.name, emptyName: p.emptyName, emptyNote: p.emptyNote }), (p) => [p.thread]),
|
|
@@ -74,19 +82,31 @@ export const ChatPane = defineComponent({
|
|
|
74
82
|
/** Vue component for the message box of a chat thread. */
|
|
75
83
|
export const Composer = defineComponent({
|
|
76
84
|
name: "Composer",
|
|
77
|
-
props: {
|
|
85
|
+
props: {
|
|
86
|
+
/** The thread a message goes to. */
|
|
87
|
+
thread: { type: Object, required: true },
|
|
88
|
+
/** The box's placeholder. */
|
|
89
|
+
placeholder: { type: String, default: "say something" },
|
|
90
|
+
},
|
|
78
91
|
setup: hosted((host, p) => mountComposer(host, p.thread, { placeholder: p.placeholder }), (p) => [p.thread]),
|
|
79
92
|
});
|
|
80
93
|
/** Vue component for the drop zone that becomes the transcript; emits `sample` and `drop` (the handle, whose `pick` opens the file picker). */
|
|
81
94
|
export const TranscribeDrop = defineComponent({
|
|
82
95
|
name: "TranscribeDrop",
|
|
83
96
|
props: {
|
|
97
|
+
/** The queue from transcribeQueue: files, their transcripts, edits and undo. */
|
|
84
98
|
queue: { type: Object, required: true },
|
|
99
|
+
/** The file types the picker offers; a drop takes any audio or video. */
|
|
85
100
|
accept: { type: String, default: "audio/*,video/*" },
|
|
101
|
+
/** A sample button's label; empty hides it. A press emits `sample` for the page to queue one. */
|
|
86
102
|
sampleLabel: { type: String, default: "" },
|
|
103
|
+
/** The zone's line before anything is dropped. */
|
|
87
104
|
title: { type: String, default: "" },
|
|
105
|
+
/** A plain note under the line. */
|
|
88
106
|
note: { type: String, default: "" },
|
|
107
|
+
/** Add a "choose a folder" button; a dropped folder is read whole either way. */
|
|
89
108
|
folders: { type: Boolean, default: false },
|
|
109
|
+
/** Show the lines the cleanup dropped (repeats, phantom text), struck through. */
|
|
90
110
|
showDropped: { type: Boolean, default: false },
|
|
91
111
|
},
|
|
92
112
|
emits: ["sample", "drop"],
|
|
@@ -106,14 +126,23 @@ export const TranscribeDrop = defineComponent({
|
|
|
106
126
|
/** Vue component for the export menu of a transcribe queue: four formats, copy, all as zip, undo and redo. */
|
|
107
127
|
export const ExportMenu = defineComponent({
|
|
108
128
|
name: "ExportMenu",
|
|
109
|
-
props: {
|
|
129
|
+
props: {
|
|
130
|
+
/** The queue from transcribeQueue: files, their transcripts, edits and undo. */
|
|
131
|
+
queue: { type: Object, required: true },
|
|
132
|
+
/** The tool name written into an export's header and the zip manifest. */
|
|
133
|
+
tool: { type: String, default: "" },
|
|
134
|
+
/** Make the main export button the pink action. */
|
|
135
|
+
go: { type: Boolean, default: false },
|
|
136
|
+
},
|
|
110
137
|
setup: hosted((host, p) => mountExportMenu(host, p.queue, { go: p.go, ...(p.tool ? { tool: p.tool } : {}) }), (p) => [p.queue, p.go]),
|
|
111
138
|
});
|
|
112
139
|
/** Vue component for a memory pane over a store; emits `pane` with the handle (refresh, used). */
|
|
113
140
|
export const MemoryPane = defineComponent({
|
|
114
141
|
name: "MemoryPane",
|
|
115
142
|
props: {
|
|
143
|
+
/** The store to show: a @hackbuild/memory store or anything with the same list, edit and forget calls. */
|
|
116
144
|
memory: { type: Object, required: true },
|
|
145
|
+
/** The pane's heading. */
|
|
117
146
|
name: { type: String, default: "memory" },
|
|
118
147
|
by: { type: String, default: "source" },
|
|
119
148
|
kinds: { type: Object, default: undefined },
|
|
@@ -130,38 +159,68 @@ export const MemoryPane = defineComponent({
|
|
|
130
159
|
/** Vue component for a sources drop: files and folders into memory through `ingest`. */
|
|
131
160
|
export const SourcesDrop = defineComponent({
|
|
132
161
|
name: "SourcesDrop",
|
|
133
|
-
props: {
|
|
162
|
+
props: {
|
|
163
|
+
/** @hackbuild/memory `ingest(mem, files, o)` bound to a store; resolves to the files and parts read. */
|
|
164
|
+
ingest: { type: Function, required: true },
|
|
165
|
+
/** The file types the picker offers; empty takes text, markdown, csv, json, html, pdf, docx, zip and eml. */
|
|
166
|
+
accept: { type: String, default: "" },
|
|
167
|
+
},
|
|
134
168
|
setup: hosted((host, p) => mountSourcesDrop(host, { ingest: p.ingest, ...(p.accept ? { accept: p.accept } : {}) }), (p) => [p.ingest]),
|
|
135
169
|
});
|
|
136
170
|
/** Vue component for a persona rack. */
|
|
137
171
|
export const PersonaRack = defineComponent({
|
|
138
172
|
name: "PersonaRack",
|
|
139
|
-
props: {
|
|
173
|
+
props: {
|
|
174
|
+
/** The persona state from personaRack: name, prompt, presets and saved ones. */
|
|
175
|
+
rack: { type: Object, required: true },
|
|
176
|
+
},
|
|
140
177
|
setup: hosted((host, p) => mountPersonaRack(host, p.rack), (p) => [p.rack]),
|
|
141
178
|
});
|
|
142
179
|
/** Vue component for a voice row. */
|
|
143
180
|
export const VoiceRow = defineComponent({
|
|
144
181
|
name: "VoiceRow",
|
|
145
|
-
props: {
|
|
182
|
+
props: {
|
|
183
|
+
/** The voice state from voiceRow: voice, rate, pitch and auto speak. */
|
|
184
|
+
row: { type: Object, required: true },
|
|
185
|
+
/** The line the test button reads; empty uses the row's own. */
|
|
186
|
+
test: { type: String, default: "" },
|
|
187
|
+
},
|
|
146
188
|
setup: hosted((host, p) => mountVoiceRow(host, p.row, p.test ? { test: p.test } : {}), (p) => [p.row]),
|
|
147
189
|
});
|
|
148
190
|
/** Vue component for the voice clone row of a speaker; `can` says the loaded voice clones. */
|
|
149
191
|
export const VoiceClone = defineComponent({
|
|
150
192
|
name: "VoiceClone",
|
|
151
|
-
props: {
|
|
193
|
+
props: {
|
|
194
|
+
/** The speaker from speaker(): its engine takes the reference clip. */
|
|
195
|
+
speaker: { type: Object, required: true },
|
|
196
|
+
/** Whether the loaded voice can clone; when false the row says to load one that can. */
|
|
197
|
+
can: { type: Boolean, default: true },
|
|
198
|
+
/** How many seconds the microphone records. */
|
|
199
|
+
seconds: { type: Number, default: 10 },
|
|
200
|
+
/** A plain line under the row. */
|
|
201
|
+
hint: { type: String, default: "" },
|
|
202
|
+
},
|
|
152
203
|
setup: hosted((host, p) => mountVoiceClone(host, p.speaker, { seconds: p.seconds, can: () => p.can, ...(p.hint ? { hint: p.hint } : {}) }), (p) => [p.speaker, p.can]),
|
|
153
204
|
});
|
|
154
205
|
/** Vue component for the session menu of a chat list; emits `import` with the number of chats. */
|
|
155
206
|
export const SessionMenu = defineComponent({
|
|
156
207
|
name: "SessionMenu",
|
|
157
|
-
props: {
|
|
208
|
+
props: {
|
|
209
|
+
/** The chat list to export, import and clear. */
|
|
210
|
+
list: { type: Object, required: true },
|
|
211
|
+
},
|
|
158
212
|
emits: ["import"],
|
|
159
213
|
setup: hosted((host, p, emit) => mountSessionMenu(host, p.list, { onImport: (n) => emit("import", n) }), (p) => [p.list]),
|
|
160
214
|
});
|
|
161
215
|
/** Vue component for the selected transcript, or its export buttons when `exports` is set. */
|
|
162
216
|
export const TranscriptView = defineComponent({
|
|
163
217
|
name: "TranscriptView",
|
|
164
|
-
props: {
|
|
218
|
+
props: {
|
|
219
|
+
/** The queue from transcribeQueue: files, their transcripts, edits and undo. */
|
|
220
|
+
queue: { type: Object, required: true },
|
|
221
|
+
/** Show the export buttons for the selected file instead of its lines. */
|
|
222
|
+
exports: { type: Boolean, default: false },
|
|
223
|
+
},
|
|
165
224
|
setup: hosted((host, p) => (p.exports ? mountTranscriptExports(host, p.queue) : mountTranscriptView(host, p.queue)), (p) => [p.queue, p.exports]),
|
|
166
225
|
});
|
|
167
226
|
/**
|
|
@@ -170,7 +229,14 @@ export const TranscriptView = defineComponent({
|
|
|
170
229
|
*/
|
|
171
230
|
export const MaskStudio = defineComponent({
|
|
172
231
|
name: "MaskStudio",
|
|
173
|
-
props: {
|
|
232
|
+
props: {
|
|
233
|
+
/** The models it may use: a click segment and a segment everything. With none, the hand tools still work. */
|
|
234
|
+
models: { type: Object, default: () => ({}) },
|
|
235
|
+
/** A sample button's label; empty hides it. A press emits `sample` for the page to set an image. */
|
|
236
|
+
sampleLabel: { type: String, default: "" },
|
|
237
|
+
/** Show the model tools before their models load; using one emits `want` so the page loads it. */
|
|
238
|
+
demand: { type: Boolean, default: false },
|
|
239
|
+
},
|
|
174
240
|
emits: ["studio", "sample", "want"],
|
|
175
241
|
setup(props, { emit }) {
|
|
176
242
|
const el = ref(null);
|
|
@@ -190,21 +256,30 @@ export const MaskStudio = defineComponent({
|
|
|
190
256
|
/** Vue component for the tool rail of a mask studio. */
|
|
191
257
|
export const MaskTools = defineComponent({
|
|
192
258
|
name: "MaskTools",
|
|
193
|
-
props: {
|
|
259
|
+
props: {
|
|
260
|
+
/** The studio from mountMaskStudio, or the one MaskStudio emits as `studio`. */
|
|
261
|
+
studio: { type: Object, required: true },
|
|
262
|
+
},
|
|
194
263
|
setup: hosted((host, p) => mountMaskTools(host, p.studio), (p) => [p.studio]),
|
|
195
264
|
});
|
|
196
265
|
/** Vue component for the undo, redo and zoom row of a mask studio. */
|
|
197
266
|
export const MaskVerbs = defineComponent({
|
|
198
267
|
name: "MaskVerbs",
|
|
199
|
-
props: {
|
|
268
|
+
props: {
|
|
269
|
+
/** The studio from mountMaskStudio, or the one MaskStudio emits as `studio`. */
|
|
270
|
+
studio: { type: Object, required: true },
|
|
271
|
+
},
|
|
200
272
|
setup: hosted((host, p) => mountMaskVerbs(host, p.studio), (p) => [p.studio]),
|
|
201
273
|
});
|
|
202
274
|
/** Vue component for one rack part of a mask studio: found, mask, saved or export. */
|
|
203
275
|
export const MaskRack = defineComponent({
|
|
204
276
|
name: "MaskRack",
|
|
205
277
|
props: {
|
|
278
|
+
/** The studio from mountMaskStudio, or the one MaskStudio emits as `studio`. */
|
|
206
279
|
studio: { type: Object, required: true },
|
|
280
|
+
/** Which panel: the found objects, the mask tools, saved masks or the exports. */
|
|
207
281
|
part: { type: String, default: "found" },
|
|
282
|
+
/** The exported files' name, without extension. */
|
|
208
283
|
name: { type: String, default: "mask" },
|
|
209
284
|
},
|
|
210
285
|
setup: hosted((host, p) => mountMaskRack(host, p.studio, p.part, { name: p.name }), (p) => [p.studio, p.part]),
|
|
@@ -213,7 +288,9 @@ export const MaskRack = defineComponent({
|
|
|
213
288
|
export const ModelJobs = defineComponent({
|
|
214
289
|
name: "ModelJobs",
|
|
215
290
|
props: {
|
|
291
|
+
/** The rack made with useJobsPick: one picker per job, presets and load all. */
|
|
216
292
|
jobs: { type: Object, required: true },
|
|
293
|
+
/** Draw the pink load all. Off on a gate, whose own button is the pink action. */
|
|
217
294
|
go: { type: Boolean, default: true },
|
|
218
295
|
},
|
|
219
296
|
setup: hosted((host, p) => mountModelJobs(host, p.jobs, { go: p.go }), (p) => [p.jobs, p.go]),
|
|
@@ -221,13 +298,19 @@ export const ModelJobs = defineComponent({
|
|
|
221
298
|
/** Vue component for the file list of a transcribe queue. */
|
|
222
299
|
export const TranscribeQueue = defineComponent({
|
|
223
300
|
name: "TranscribeQueue",
|
|
224
|
-
props: {
|
|
301
|
+
props: {
|
|
302
|
+
/** The queue from transcribeQueue: files, their transcripts, edits and undo. */
|
|
303
|
+
queue: { type: Object, required: true },
|
|
304
|
+
},
|
|
225
305
|
setup: hosted((host, p) => mountTranscribeQueue(host, p.queue), (p) => [p.queue]),
|
|
226
306
|
});
|
|
227
307
|
/** Vue component that shows a recall trace as a table. */
|
|
228
308
|
export const MemoryInspector = defineComponent({
|
|
229
309
|
name: "MemoryInspector",
|
|
230
|
-
props: {
|
|
310
|
+
props: {
|
|
311
|
+
/** The last recall from @hackbuild/memory: its query, mode, hits and the trace of each memory scored. */
|
|
312
|
+
recall: { type: Object, default: null },
|
|
313
|
+
},
|
|
231
314
|
setup(props) {
|
|
232
315
|
const el = ref(null);
|
|
233
316
|
let m = null;
|
|
@@ -240,13 +323,25 @@ export const MemoryInspector = defineComponent({
|
|
|
240
323
|
/** Vue component for the chat list rail of a `chatList`. */
|
|
241
324
|
export const ChatList = defineComponent({
|
|
242
325
|
name: "ChatList",
|
|
243
|
-
props: {
|
|
326
|
+
props: {
|
|
327
|
+
/** The chats, from chatList: each a thread, one of them open. */
|
|
328
|
+
list: { type: Object, required: true },
|
|
329
|
+
/** The rail's accessible name. */
|
|
330
|
+
label: { type: String, default: "chats" },
|
|
331
|
+
},
|
|
244
332
|
setup: hosted((host, p) => mountChatList(host, p.list, { label: p.label }), (p) => [p.list]),
|
|
245
333
|
});
|
|
246
334
|
/** Vue component that shows what the next request carries against the context budget. */
|
|
247
335
|
export const ContextMeter = defineComponent({
|
|
248
336
|
name: "ContextMeter",
|
|
249
|
-
props: {
|
|
337
|
+
props: {
|
|
338
|
+
/** The thread whose next request is measured. */
|
|
339
|
+
thread: { type: Object, required: true },
|
|
340
|
+
/** The model's context window in tokens. */
|
|
341
|
+
budget: { type: Number, default: 4096 },
|
|
342
|
+
/** The system prompt that rides with every request. */
|
|
343
|
+
system: { type: String, default: "" },
|
|
344
|
+
},
|
|
250
345
|
setup: hosted((host, p) => mountContextMeter(host, p.thread, { budget: () => p.budget, system: () => p.system }), (p) => [p.thread]),
|
|
251
346
|
});
|
|
252
347
|
/**
|
|
@@ -256,8 +351,11 @@ export const ContextMeter = defineComponent({
|
|
|
256
351
|
export const FrameView = defineComponent({
|
|
257
352
|
name: "FrameView",
|
|
258
353
|
props: {
|
|
354
|
+
/** The picture: a URL, an image, a live video or a canvas. */
|
|
259
355
|
source: { type: [String, Object], default: null },
|
|
356
|
+
/** What to draw on it, in image pixels: boxes, landmarks, a caption and a corner tag. */
|
|
260
357
|
results: { type: Object, default: () => ({}) },
|
|
358
|
+
/** Flip it left to right, as a front camera reads. */
|
|
261
359
|
mirror: { type: Boolean, default: false },
|
|
262
360
|
},
|
|
263
361
|
emits: ["view"],
|
|
@@ -282,7 +380,10 @@ export const FrameView = defineComponent({
|
|
|
282
380
|
/** Vue component that opens the camera; emits `feed` with the feed and `frame` with the video at `fps`. */
|
|
283
381
|
export const CameraFeed = defineComponent({
|
|
284
382
|
name: "CameraFeed",
|
|
285
|
-
props: {
|
|
383
|
+
props: {
|
|
384
|
+
/** How many times a second the video goes out as `frame` while live. */
|
|
385
|
+
fps: { type: Number, default: 4 },
|
|
386
|
+
},
|
|
286
387
|
emits: ["feed", "frame"],
|
|
287
388
|
setup: hosted((host, p, emit) => {
|
|
288
389
|
const feed = mountCameraFeed(host, { fps: p.fps, onFrame: (v) => emit("frame", v) });
|
package/llms.md
CHANGED
|
@@ -1202,6 +1202,7 @@ Spoken lines in order, and the clone.
|
|
|
1202
1202
|
interface SpeakerOptions {
|
|
1203
1203
|
config?: () => VoiceConfig;
|
|
1204
1204
|
halt?: () => void;
|
|
1205
|
+
onError?: (err: unknown, text: string) => void;
|
|
1205
1206
|
onLine?: (text: string) => void;
|
|
1206
1207
|
play?: (line: SpokenLine) => Promise<void>;
|
|
1207
1208
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hackbuild/ai-views",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Views that bind the browser AI packages to hackbuild-ui: a model picker per job, a chat pane and composer, a drop first transcriber, a mask studio, a frame view and a camera feed. Each ships as a Vue component and a custom element.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|