Skip to content

Commit ea9be4e

Browse files
Merge pull request #371 from microfox-ai/feat/gen-images-sets
feat:waveforms
2 parents 91c0a7e + 293a447 commit ea9be4e

File tree

263 files changed

+9955
-36850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+9955
-36850
lines changed

apps/mediamake/app/ai/agents/autofix/fixers/contextualFixer.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { loadTranscription } from '../middlewares/loadTranscription';
1919
const aiRouter = new AiRouter();
2020

2121
const contextualFixerAgent = aiRouter
22-
.use('/', loadTranscription)
22+
.before('/', loadTranscription)
2323
.agent('/', async ctx => {
2424
try {
2525
console.log('CONTEXTUAL FIXER: Starting...');
@@ -183,12 +183,7 @@ Apply the user's contextual corrections while preserving timing as much as possi
183183
}),
184184
metadata: {
185185
category: 'transcription',
186-
tags: [
187-
'transcription',
188-
'autofix',
189-
'transcription-autofix',
190-
'contextual',
191-
],
186+
tags: ['transcription', 'autofix', 'transcription-autofix', 'contextual'],
192187
icon: '🎯',
193188
title: 'Contextual Fixer',
194189
description: 'User-guided contextual corrections',
@@ -197,4 +192,3 @@ Apply the user's contextual corrections while preserving timing as much as possi
197192
});
198193

199194
export default contextualFixerAgent;
200-

apps/mediamake/app/ai/agents/autofix/fixers/punctuationFixer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { loadTranscription } from '../middlewares/loadTranscription';
1919
const aiRouter = new AiRouter();
2020

2121
const punctuationFixerAgent = aiRouter
22-
.use('/', loadTranscription)
22+
.before('/', loadTranscription)
2323
.agent('/', async ctx => {
2424
try {
2525
console.log('PUNCTUATION FIXER: Starting...');
@@ -178,4 +178,3 @@ Add and fix punctuation while preserving all timing and word content.`;
178178
});
179179

180180
export default punctuationFixerAgent;
181-

apps/mediamake/app/ai/agents/autofix/fixers/sentenceStructureFixer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { loadTranscription } from '../middlewares/loadTranscription';
1919
const aiRouter = new AiRouter();
2020

2121
const sentenceStructureFixerAgent = aiRouter
22-
.use('/', loadTranscription)
22+
.before('/', loadTranscription)
2323
.agent('/', async ctx => {
2424
try {
2525
console.log('SENTENCE STRUCTURE FIXER: Starting...');
@@ -183,4 +183,3 @@ Optimize sentence structure for subtitle display while preserving all timing.`;
183183
});
184184

185185
export default sentenceStructureFixerAgent;
186-

apps/mediamake/app/ai/agents/autofix/fixers/spellingFixer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { loadTranscription } from '../middlewares/loadTranscription';
1919
const aiRouter = new AiRouter();
2020

2121
const spellingFixerAgent = aiRouter
22-
.use('/', loadTranscription)
22+
.before('/', loadTranscription)
2323
.agent('/', async ctx => {
2424
try {
2525
console.log('SPELLING FIXER: Starting...');
@@ -167,4 +167,3 @@ Fix ONLY spelling errors while preserving all timing and structure.`;
167167
});
168168

169169
export default spellingFixerAgent;
170-

apps/mediamake/app/ai/agents/autofix/fixers/timingOptimizer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { loadTranscription } from '../middlewares/loadTranscription';
1919
const aiRouter = new AiRouter();
2020

2121
const timingOptimizerAgent = aiRouter
22-
.use('/', loadTranscription)
22+
.before('/', loadTranscription)
2323
.agent('/', async ctx => {
2424
try {
2525
console.log('TIMING OPTIMIZER: Starting...');
@@ -173,4 +173,3 @@ Optimize timing values for better subtitle display without changing any text.`;
173173
});
174174

175175
export default timingOptimizerAgent;
176-

apps/mediamake/app/ai/agents/autofix/fixers/wordBoundaryFixer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { loadTranscription } from '../middlewares/loadTranscription';
1919
const aiRouter = new AiRouter();
2020

2121
const wordBoundaryFixerAgent = aiRouter
22-
.use('/', loadTranscription)
22+
.before('/', loadTranscription)
2323
.agent('/', async ctx => {
2424
try {
2525
console.log('WORD BOUNDARY FIXER: Starting...');
@@ -179,4 +179,3 @@ Fix ONLY word boundary issues (merged/split words) while preserving timing.`;
179179
});
180180

181181
export default wordBoundaryFixerAgent;
182-

apps/mediamake/app/ai/agents/autofix/index.ts

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ const aiRouter = new AiRouter();
1515
* Coordinates multiple specialized autofix agents
1616
*/
1717
export const autofixOrchestrator = aiRouter
18-
.use('/', async (ctx, next) => {
18+
.before('/', async (ctx, next) => {
1919
ctx.response.writeMessageMetadata({
2020
loader: 'Orchestrating autofix agents...',
2121
});
2222
return next();
2323
})
24-
.use('/', loadTranscription)
24+
.before('/', loadTranscription)
2525
.agent('/spelling', spellingFixerAgent)
2626
.agent('/word-boundary', wordBoundaryFixerAgent)
2727
.agent('/sentence-structure', sentenceStructureFixerAgent)
@@ -122,9 +122,7 @@ export const autofixOrchestrator = aiRouter
122122
for (const agentName of agentsToRun) {
123123
try {
124124
const agentPath = `/${agentName}`;
125-
console.log(
126-
`AUTOFIX ORCHESTRATOR: Running agent ${agentPath}...`,
127-
);
125+
console.log(`AUTOFIX ORCHESTRATOR: Running agent ${agentPath}...`);
128126

129127
const response = await ctx.next.callAgent(agentPath, {
130128
transcriptionId,
@@ -133,11 +131,16 @@ export const autofixOrchestrator = aiRouter
133131
});
134132

135133
// Handle both wrapped and direct responses
136-
const result = (response as any).ok
137-
? (response as any).data
134+
const result = (response as any).ok
135+
? (response as any).data
138136
: response;
139137

140-
if (result && result.success && result.changes && result.changes.length > 0) {
138+
if (
139+
result &&
140+
result.success &&
141+
result.changes &&
142+
result.changes.length > 0
143+
) {
141144
// Update current transcription with fixes
142145
currentTranscription = result.transcription;
143146
allChanges.push({
@@ -214,7 +217,7 @@ export const autofixOrchestrator = aiRouter
214217
.string()
215218
.optional()
216219
.describe(
217-
"Your written version - if provided, uses contextual fixer for best results",
220+
'Your written version - if provided, uses contextual fixer for best results',
218221
),
219222
agents: z
220223
.array(
@@ -228,7 +231,9 @@ export const autofixOrchestrator = aiRouter
228231
)
229232
.optional()
230233
.default(['spelling', 'word-boundary', 'punctuation'])
231-
.describe('Specific agents to run (default: spelling, word-boundary, punctuation)'),
234+
.describe(
235+
'Specific agents to run (default: spelling, word-boundary, punctuation)',
236+
),
232237
applyToDatabase: z
233238
.boolean()
234239
.optional()
@@ -249,10 +254,14 @@ export const autofixOrchestrator = aiRouter
249254
title: 'Autofix Orchestrator',
250255
description: 'Run multiple autofix agents',
251256
category: 'transcription',
252-
tags: ['transcription', 'autofix', 'transcription-autofix', 'orchestrator'],
257+
tags: [
258+
'transcription',
259+
'autofix',
260+
'transcription-autofix',
261+
'orchestrator',
262+
],
253263
hideUI: false,
254264
},
255265
});
256266

257267
export default autofixOrchestrator;
258-

apps/mediamake/app/ai/agents/midjourney/captionBasedPrompting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async function downloadImageAsBase64(url: string): Promise<string> {
9999
}
100100

101101
export const midjourneyPromptingAgent = aiRouter
102-
.use('/', loadTranscription)
102+
.before('/', loadTranscription)
103103
.agent('/', async ctx => {
104104
try {
105105
ctx.response.writeMessageMetadata({

apps/mediamake/app/ai/agents/midjourney/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { pipeline2Agent } from './pipeline2';
1111
const aiRouter = new AiRouter();
1212

1313
export const midjourneyOrchestrator = aiRouter
14-
.use('/', async (ctx, next) => {
14+
.before('/', async (ctx, next) => {
1515
ctx.response.writeMessageMetadata({
1616
loader: 'Orchestrating Midjourney prompt generation...',
1717
});

apps/mediamake/app/ai/agents/presetPrompts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import promptGeneratorAgent from './promptGeneratorAgent';
55
const aiRouter = new AiRouter();
66

77
export const presetPromptsOrchestrator = aiRouter
8-
.use('/', async (ctx, next) => {
8+
.before('/', async (ctx, next) => {
99
ctx.response.writeMessageMetadata({
1010
loader: 'Orchestrating preset prompt generation...',
1111
});

0 commit comments

Comments
 (0)