@makemidas/cli 0.12.1 → 0.12.2
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/config.js +1 -1
- package/dist/words.js +24 -2
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
export const VERSION = '0.12.
|
|
4
|
+
export const VERSION = '0.12.2';
|
|
5
5
|
export const USER_AGENT = `makemidas-cli/${VERSION}`;
|
|
6
6
|
export const DEFAULT_BASE_URL = 'https://makemidas.com';
|
|
7
7
|
export function resolveBaseUrl(flag) {
|
package/dist/words.js
CHANGED
|
@@ -103,15 +103,37 @@ export function widenShortWords(words) {
|
|
|
103
103
|
return { ...word, start: round(word.start - Math.min(room, short)) };
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
+
const HYPHEN_PIECE = /^-[\p{L}\p{N}]/u;
|
|
107
|
+
const WORD_END = /[\p{L}\p{N}]$/u;
|
|
108
|
+
/**
|
|
109
|
+
* A piece starting with a hyphen joined to the word before it: Whisper
|
|
110
|
+
* transcripts can split "game-changer" into `game` and `-changer`.
|
|
111
|
+
*/
|
|
112
|
+
export function joinHyphenPieces(words) {
|
|
113
|
+
const joined = [];
|
|
114
|
+
for (const word of words) {
|
|
115
|
+
const last = joined.at(-1);
|
|
116
|
+
if (last && HYPHEN_PIECE.test(word.text) && WORD_END.test(last.text)) {
|
|
117
|
+
joined[joined.length - 1] = {
|
|
118
|
+
text: last.text + word.text,
|
|
119
|
+
start: last.start,
|
|
120
|
+
end: Math.max(last.end, word.end),
|
|
121
|
+
};
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
joined.push(word);
|
|
125
|
+
}
|
|
126
|
+
return joined;
|
|
127
|
+
}
|
|
106
128
|
/** Every word with its time: the transcript's own, or estimated. */
|
|
107
129
|
export function timedWords(t) {
|
|
108
130
|
const last = t.segments.at(-1)?.end ?? 0;
|
|
109
131
|
const duration = Math.max(t.durationSeconds || 0, last);
|
|
110
132
|
if (t.words?.length) {
|
|
111
133
|
return {
|
|
112
|
-
words: widenShortWords(t.words
|
|
134
|
+
words: widenShortWords(joinHyphenPieces(t.words
|
|
113
135
|
.map((w) => ({ text: w.word.trim(), start: w.start, end: w.end }))
|
|
114
|
-
.filter((w) => w.text && w.end >= w.start)),
|
|
136
|
+
.filter((w) => w.text && w.end >= w.start))),
|
|
115
137
|
estimated: false,
|
|
116
138
|
duration,
|
|
117
139
|
language: t.language,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makemidas/cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "AI image, video and audio generation CLI for AI agents (Claude Code, Cursor, Codex) and people: Nano Banana, GPT Image, Seedream, Seedance, Kling, Veo, Suno and more, plus talking avatars, HTML templates and short films, through MakeMidas.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-image-generator",
|