@hackbuild/ai-views 0.1.0 → 0.1.1
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 +228 -80
- package/dist/chat.d.ts +18 -2
- package/dist/chat.js +7 -1
- package/dist/elements.d.ts +6 -0
- package/dist/frame.d.ts +2 -0
- package/dist/jobs.d.ts +6 -1
- package/dist/jobs.js +4 -1
- package/dist/memory.d.ts +9 -0
- package/dist/memory.js +3 -0
- package/dist/mount-chat.d.ts +4 -1
- package/dist/mount-chat.js +2 -1
- package/dist/mount-frame.d.ts +13 -1
- package/dist/mount-frame.js +3 -1
- package/dist/mount-mask.d.ts +19 -1
- package/dist/mount-mask.js +5 -1
- package/dist/mount-model.d.ts +1 -0
- package/dist/mount-transcribe.d.ts +11 -2
- package/dist/mount-transcribe.js +2 -2
- package/dist/pick.d.ts +17 -0
- package/dist/pick.js +6 -0
- package/dist/rows.d.ts +6 -0
- package/dist/rows.js +2 -0
- package/dist/single/elements.iife.js +81 -50
- package/dist/single/elements.js +81 -50
- package/dist/single/index.iife.js +74 -45
- package/dist/single/index.js +74 -45
- package/dist/single/vue.iife.js +87 -45
- package/dist/single/vue.js +88 -45
- package/dist/transcribe.d.ts +14 -2
- package/dist/transcribe.js +2 -2
- package/dist/vue.d.ts +22 -0
- package/dist/vue.js +22 -0
- package/llms.md +1133 -0
- package/package.json +12 -11
package/dist/transcribe.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The state behind TranscribeDrop and TranscriptView,
|
|
3
|
-
* transcription tool: drop files, they queue as channels, run one at a
|
|
2
|
+
* The state behind TranscribeDrop and TranscriptView: drop files, they queue as channels, run one at a
|
|
4
3
|
* time, and each becomes a transcript with timestamps that a person can
|
|
5
4
|
* edit (with undo) and export as txt, srt, vtt or json. The engine is a
|
|
6
5
|
* function the page passes, so a stub runs the view with no weights.
|
|
@@ -8,6 +7,7 @@
|
|
|
8
7
|
import { asJson, asSrt, asTxt, asVtt, baseName } from "@hackbuild/transcribe";
|
|
9
8
|
import { stripMeta } from "@virgilvox/hackbuild-ui/vanilla";
|
|
10
9
|
const TYPES = { txt: "text/plain", srt: "application/x-subrip", vtt: "text/vtt", json: "application/json" };
|
|
10
|
+
/** Creates a transcribe queue that runs each file through `run`, one at a time. */
|
|
11
11
|
export function transcribeQueue(o) {
|
|
12
12
|
let run = o.run;
|
|
13
13
|
let channels = [];
|
package/dist/vue.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { TranscribeQueue as Queue } from "./transcribe.js";
|
|
|
13
13
|
import type { FrameResults } from "./frame.js";
|
|
14
14
|
import { type MaskModels, type MaskStudio as Studio } from "./mount-mask.js";
|
|
15
15
|
import { type RecallLike } from "./memory.js";
|
|
16
|
+
/** Vue component for a model picker of one job; emits `pick`, `choose`, `loaded` and `failed`. */
|
|
16
17
|
export declare const ModelSelect: import("vue").DefineComponent<{
|
|
17
18
|
job: Job;
|
|
18
19
|
pick?: ModelPick | undefined;
|
|
@@ -42,6 +43,7 @@ export declare const ModelSelect: import("vue").DefineComponent<{
|
|
|
42
43
|
env: Env;
|
|
43
44
|
loader: Loader;
|
|
44
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
46
|
+
/** Vue component for the turns of a chat thread. */
|
|
45
47
|
export declare const ChatPane: import("vue").DefineComponent<{
|
|
46
48
|
thread: ChatThread;
|
|
47
49
|
name: string;
|
|
@@ -59,6 +61,7 @@ export declare const ChatPane: import("vue").DefineComponent<{
|
|
|
59
61
|
emptyName: string;
|
|
60
62
|
emptyNote: string;
|
|
61
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
|
+
/** Vue component for the message box of a chat thread. */
|
|
62
65
|
export declare const Composer: import("vue").DefineComponent<{
|
|
63
66
|
thread: ChatThread;
|
|
64
67
|
placeholder: string;
|
|
@@ -70,6 +73,7 @@ export declare const Composer: import("vue").DefineComponent<{
|
|
|
70
73
|
}> & Readonly<{}>, {
|
|
71
74
|
placeholder: string;
|
|
72
75
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
76
|
+
/** Vue component for the drop zone that becomes the transcript; emits `sample`. */
|
|
73
77
|
export declare const TranscribeDrop: import("vue").DefineComponent<{
|
|
74
78
|
queue: Queue;
|
|
75
79
|
accept: string;
|
|
@@ -86,6 +90,7 @@ export declare const TranscribeDrop: import("vue").DefineComponent<{
|
|
|
86
90
|
accept: string;
|
|
87
91
|
sampleLabel: string;
|
|
88
92
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
93
|
+
/** Vue component for the selected transcript, or its export buttons when `exports` is set. */
|
|
89
94
|
export declare const TranscriptView: import("vue").DefineComponent<{
|
|
90
95
|
queue: Queue;
|
|
91
96
|
exports: boolean;
|
|
@@ -97,6 +102,10 @@ export declare const TranscriptView: import("vue").DefineComponent<{
|
|
|
97
102
|
}> & Readonly<{}>, {
|
|
98
103
|
exports: boolean;
|
|
99
104
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
105
|
+
/**
|
|
106
|
+
* Vue component for a mask studio; emits `studio` with the mounted studio and `sample` when the
|
|
107
|
+
* sample button is pressed.
|
|
108
|
+
*/
|
|
100
109
|
export declare const MaskStudio: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
101
110
|
models: {
|
|
102
111
|
type: PropType<MaskModels>;
|
|
@@ -124,6 +133,7 @@ export declare const MaskStudio: import("vue").DefineComponent<import("vue").Ext
|
|
|
124
133
|
models: MaskModels;
|
|
125
134
|
sampleLabel: string;
|
|
126
135
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
136
|
+
/** Vue component for the tool rail of a mask studio. */
|
|
127
137
|
export declare const MaskTools: import("vue").DefineComponent<{
|
|
128
138
|
studio: Studio;
|
|
129
139
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -131,6 +141,7 @@ export declare const MaskTools: import("vue").DefineComponent<{
|
|
|
131
141
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
132
142
|
studio: Studio;
|
|
133
143
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
144
|
+
/** Vue component for the undo, redo and zoom row of a mask studio. */
|
|
134
145
|
export declare const MaskVerbs: import("vue").DefineComponent<{
|
|
135
146
|
studio: Studio;
|
|
136
147
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -138,6 +149,7 @@ export declare const MaskVerbs: import("vue").DefineComponent<{
|
|
|
138
149
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
139
150
|
studio: Studio;
|
|
140
151
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
152
|
+
/** Vue component for one rack part of a mask studio: found, mask, saved or export. */
|
|
141
153
|
export declare const MaskRack: import("vue").DefineComponent<{
|
|
142
154
|
studio: Studio;
|
|
143
155
|
part: "found" | "mask" | "saved" | "export";
|
|
@@ -152,6 +164,7 @@ export declare const MaskRack: import("vue").DefineComponent<{
|
|
|
152
164
|
part: "export" | "found" | "mask" | "saved";
|
|
153
165
|
name: string;
|
|
154
166
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
167
|
+
/** Vue component for a jobs rack: a line per job, presets and load all. */
|
|
155
168
|
export declare const ModelJobs: import("vue").DefineComponent<{
|
|
156
169
|
jobs: JobsPick;
|
|
157
170
|
go: boolean;
|
|
@@ -163,6 +176,7 @@ export declare const ModelJobs: import("vue").DefineComponent<{
|
|
|
163
176
|
}> & Readonly<{}>, {
|
|
164
177
|
go: boolean;
|
|
165
178
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
179
|
+
/** Vue component for the file list of a transcribe queue. */
|
|
166
180
|
export declare const TranscribeQueue: import("vue").DefineComponent<{
|
|
167
181
|
queue: Queue;
|
|
168
182
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -170,6 +184,7 @@ export declare const TranscribeQueue: import("vue").DefineComponent<{
|
|
|
170
184
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
171
185
|
queue: Queue;
|
|
172
186
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
187
|
+
/** Vue component that shows a recall trace as a table. */
|
|
173
188
|
export declare const MemoryInspector: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
174
189
|
recall: {
|
|
175
190
|
type: PropType<RecallLike | null>;
|
|
@@ -185,6 +200,7 @@ export declare const MemoryInspector: import("vue").DefineComponent<import("vue"
|
|
|
185
200
|
}>> & Readonly<{}>, {
|
|
186
201
|
recall: RecallLike | null;
|
|
187
202
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
203
|
+
/** Vue component for the chat list rail of a `chatList`. */
|
|
188
204
|
export declare const ChatList: import("vue").DefineComponent<{
|
|
189
205
|
list: ChatListState;
|
|
190
206
|
label: string;
|
|
@@ -196,6 +212,7 @@ export declare const ChatList: import("vue").DefineComponent<{
|
|
|
196
212
|
}> & Readonly<{}>, {
|
|
197
213
|
label: string;
|
|
198
214
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
215
|
+
/** Vue component that shows what the next request carries against the context budget. */
|
|
199
216
|
export declare const ContextMeter: import("vue").DefineComponent<{
|
|
200
217
|
thread: ChatThread;
|
|
201
218
|
budget: number;
|
|
@@ -210,6 +227,10 @@ export declare const ContextMeter: import("vue").DefineComponent<{
|
|
|
210
227
|
budget: number;
|
|
211
228
|
system: string;
|
|
212
229
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
230
|
+
/**
|
|
231
|
+
* Vue component that draws a frame with boxes, landmarks and a caption; emits `view` with the
|
|
232
|
+
* mounted view.
|
|
233
|
+
*/
|
|
213
234
|
export declare const FrameView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
214
235
|
source: {
|
|
215
236
|
type: PropType<string | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null>;
|
|
@@ -245,6 +266,7 @@ export declare const FrameView: import("vue").DefineComponent<import("vue").Extr
|
|
|
245
266
|
results: FrameResults;
|
|
246
267
|
mirror: boolean;
|
|
247
268
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
269
|
+
/** Vue component that opens the camera; emits `feed` with the feed and `frame` with the video at `fps`. */
|
|
248
270
|
export declare const CameraFeed: import("vue").DefineComponent<{
|
|
249
271
|
fps: number;
|
|
250
272
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
package/dist/vue.js
CHANGED
|
@@ -29,6 +29,7 @@ function hosted(setupMount, deps = () => []) {
|
|
|
29
29
|
return () => h("div", { ...contents, ref: el });
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
/** Vue component for a model picker of one job; emits `pick`, `choose`, `loaded` and `failed`. */
|
|
32
33
|
export const ModelSelect = defineComponent({
|
|
33
34
|
name: "ModelSelect",
|
|
34
35
|
props: {
|
|
@@ -58,6 +59,7 @@ export const ModelSelect = defineComponent({
|
|
|
58
59
|
return { dispose: () => (off(), m.dispose()) };
|
|
59
60
|
}, (p) => [p.job, p.pick, p.variant, p.go]),
|
|
60
61
|
});
|
|
62
|
+
/** Vue component for the turns of a chat thread. */
|
|
61
63
|
export const ChatPane = defineComponent({
|
|
62
64
|
name: "ChatPane",
|
|
63
65
|
props: {
|
|
@@ -68,11 +70,13 @@ export const ChatPane = defineComponent({
|
|
|
68
70
|
},
|
|
69
71
|
setup: hosted((host, p) => mountChatPane(host, p.thread, { name: p.name, emptyName: p.emptyName, emptyNote: p.emptyNote }), (p) => [p.thread]),
|
|
70
72
|
});
|
|
73
|
+
/** Vue component for the message box of a chat thread. */
|
|
71
74
|
export const Composer = defineComponent({
|
|
72
75
|
name: "Composer",
|
|
73
76
|
props: { thread: { type: Object, required: true }, placeholder: { type: String, default: "say something" } },
|
|
74
77
|
setup: hosted((host, p) => mountComposer(host, p.thread, { placeholder: p.placeholder }), (p) => [p.thread]),
|
|
75
78
|
});
|
|
79
|
+
/** Vue component for the drop zone that becomes the transcript; emits `sample`. */
|
|
76
80
|
export const TranscribeDrop = defineComponent({
|
|
77
81
|
name: "TranscribeDrop",
|
|
78
82
|
props: {
|
|
@@ -83,11 +87,16 @@ export const TranscribeDrop = defineComponent({
|
|
|
83
87
|
emits: ["sample"],
|
|
84
88
|
setup: hosted((host, p, emit) => mountTranscribeDrop(host, p.queue, { accept: p.accept, ...(p.sampleLabel ? { sampleLabel: p.sampleLabel, onSample: () => emit("sample") } : {}) }), (p) => [p.queue]),
|
|
85
89
|
});
|
|
90
|
+
/** Vue component for the selected transcript, or its export buttons when `exports` is set. */
|
|
86
91
|
export const TranscriptView = defineComponent({
|
|
87
92
|
name: "TranscriptView",
|
|
88
93
|
props: { queue: { type: Object, required: true }, exports: { type: Boolean, default: false } },
|
|
89
94
|
setup: hosted((host, p) => (p.exports ? mountTranscriptExports(host, p.queue) : mountTranscriptView(host, p.queue)), (p) => [p.queue, p.exports]),
|
|
90
95
|
});
|
|
96
|
+
/**
|
|
97
|
+
* Vue component for a mask studio; emits `studio` with the mounted studio and `sample` when the
|
|
98
|
+
* sample button is pressed.
|
|
99
|
+
*/
|
|
91
100
|
export const MaskStudio = defineComponent({
|
|
92
101
|
name: "MaskStudio",
|
|
93
102
|
props: { models: { type: Object, default: () => ({}) }, sampleLabel: { type: String, default: "" } },
|
|
@@ -107,16 +116,19 @@ export const MaskStudio = defineComponent({
|
|
|
107
116
|
return () => h("div", { ...contents, ref: el });
|
|
108
117
|
},
|
|
109
118
|
});
|
|
119
|
+
/** Vue component for the tool rail of a mask studio. */
|
|
110
120
|
export const MaskTools = defineComponent({
|
|
111
121
|
name: "MaskTools",
|
|
112
122
|
props: { studio: { type: Object, required: true } },
|
|
113
123
|
setup: hosted((host, p) => mountMaskTools(host, p.studio), (p) => [p.studio]),
|
|
114
124
|
});
|
|
125
|
+
/** Vue component for the undo, redo and zoom row of a mask studio. */
|
|
115
126
|
export const MaskVerbs = defineComponent({
|
|
116
127
|
name: "MaskVerbs",
|
|
117
128
|
props: { studio: { type: Object, required: true } },
|
|
118
129
|
setup: hosted((host, p) => mountMaskVerbs(host, p.studio), (p) => [p.studio]),
|
|
119
130
|
});
|
|
131
|
+
/** Vue component for one rack part of a mask studio: found, mask, saved or export. */
|
|
120
132
|
export const MaskRack = defineComponent({
|
|
121
133
|
name: "MaskRack",
|
|
122
134
|
props: {
|
|
@@ -126,6 +138,7 @@ export const MaskRack = defineComponent({
|
|
|
126
138
|
},
|
|
127
139
|
setup: hosted((host, p) => mountMaskRack(host, p.studio, p.part, { name: p.name }), (p) => [p.studio, p.part]),
|
|
128
140
|
});
|
|
141
|
+
/** Vue component for a jobs rack: a line per job, presets and load all. */
|
|
129
142
|
export const ModelJobs = defineComponent({
|
|
130
143
|
name: "ModelJobs",
|
|
131
144
|
props: {
|
|
@@ -134,11 +147,13 @@ export const ModelJobs = defineComponent({
|
|
|
134
147
|
},
|
|
135
148
|
setup: hosted((host, p) => mountModelJobs(host, p.jobs, { go: p.go }), (p) => [p.jobs, p.go]),
|
|
136
149
|
});
|
|
150
|
+
/** Vue component for the file list of a transcribe queue. */
|
|
137
151
|
export const TranscribeQueue = defineComponent({
|
|
138
152
|
name: "TranscribeQueue",
|
|
139
153
|
props: { queue: { type: Object, required: true } },
|
|
140
154
|
setup: hosted((host, p) => mountTranscribeQueue(host, p.queue), (p) => [p.queue]),
|
|
141
155
|
});
|
|
156
|
+
/** Vue component that shows a recall trace as a table. */
|
|
142
157
|
export const MemoryInspector = defineComponent({
|
|
143
158
|
name: "MemoryInspector",
|
|
144
159
|
props: { recall: { type: Object, default: null } },
|
|
@@ -151,16 +166,22 @@ export const MemoryInspector = defineComponent({
|
|
|
151
166
|
return () => h("div", { ...contents, ref: el });
|
|
152
167
|
},
|
|
153
168
|
});
|
|
169
|
+
/** Vue component for the chat list rail of a `chatList`. */
|
|
154
170
|
export const ChatList = defineComponent({
|
|
155
171
|
name: "ChatList",
|
|
156
172
|
props: { list: { type: Object, required: true }, label: { type: String, default: "chats" } },
|
|
157
173
|
setup: hosted((host, p) => mountChatList(host, p.list, { label: p.label }), (p) => [p.list]),
|
|
158
174
|
});
|
|
175
|
+
/** Vue component that shows what the next request carries against the context budget. */
|
|
159
176
|
export const ContextMeter = defineComponent({
|
|
160
177
|
name: "ContextMeter",
|
|
161
178
|
props: { thread: { type: Object, required: true }, budget: { type: Number, default: 4096 }, system: { type: String, default: "" } },
|
|
162
179
|
setup: hosted((host, p) => mountContextMeter(host, p.thread, { budget: () => p.budget, system: () => p.system }), (p) => [p.thread]),
|
|
163
180
|
});
|
|
181
|
+
/**
|
|
182
|
+
* Vue component that draws a frame with boxes, landmarks and a caption; emits `view` with the
|
|
183
|
+
* mounted view.
|
|
184
|
+
*/
|
|
164
185
|
export const FrameView = defineComponent({
|
|
165
186
|
name: "FrameView",
|
|
166
187
|
props: {
|
|
@@ -187,6 +208,7 @@ export const FrameView = defineComponent({
|
|
|
187
208
|
return () => h("div", { ...contents, ref: el });
|
|
188
209
|
},
|
|
189
210
|
});
|
|
211
|
+
/** Vue component that opens the camera; emits `feed` with the feed and `frame` with the video at `fps`. */
|
|
190
212
|
export const CameraFeed = defineComponent({
|
|
191
213
|
name: "CameraFeed",
|
|
192
214
|
props: { fps: { type: Number, default: 4 } },
|