mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-06 08:04:37 +00:00
feat(video): add video transcripts (#559)
* feat(video): generate transcripts with the local embedding server * feat(video): show saved transcripts in the player * fix(video): preserve transcript seek timestamps * fix(video): refine transcript viewing and generation * feat(video): resize transcripts and follow playback earlier * fix(video): animate transcript playback scrolling * fix(video): transcribe from the smallest full proxy * fix(video): refine the sync to playback button * feat(video): edit transcript segment text inline * fix(video): keep transcript segment highlighted over edit button * docs(video): note embedding server version for transcripts
This commit is contained in:
+10
@@ -137,6 +137,16 @@ export type AssetCommentReaction = Prisma.AssetCommentReactionModel
|
||||
*
|
||||
*/
|
||||
export type AssetEmbedding = Prisma.AssetEmbeddingModel
|
||||
/**
|
||||
* Model AssetTranscript
|
||||
*
|
||||
*/
|
||||
export type AssetTranscript = Prisma.AssetTranscriptModel
|
||||
/**
|
||||
* Model AssetTranscriptSegment
|
||||
*
|
||||
*/
|
||||
export type AssetTranscriptSegment = Prisma.AssetTranscriptSegmentModel
|
||||
/**
|
||||
* Model Invite
|
||||
*
|
||||
|
||||
+10
@@ -161,6 +161,16 @@ export type AssetCommentReaction = Prisma.AssetCommentReactionModel
|
||||
*
|
||||
*/
|
||||
export type AssetEmbedding = Prisma.AssetEmbeddingModel
|
||||
/**
|
||||
* Model AssetTranscript
|
||||
*
|
||||
*/
|
||||
export type AssetTranscript = Prisma.AssetTranscriptModel
|
||||
/**
|
||||
* Model AssetTranscriptSegment
|
||||
*
|
||||
*/
|
||||
export type AssetTranscriptSegment = Prisma.AssetTranscriptSegmentModel
|
||||
/**
|
||||
* Model Invite
|
||||
*
|
||||
|
||||
+1
@@ -158,6 +158,7 @@ export const WorkflowTaskType = {
|
||||
ai_metadata_autofill: 'ai_metadata_autofill',
|
||||
chat: 'chat',
|
||||
ai_embedding: 'ai_embedding',
|
||||
ai_transcription: 'ai_transcription',
|
||||
query_embedding_for_search: 'query_embedding_for_search',
|
||||
agent_tool_call: 'agent_tool_call',
|
||||
kanban_agent_run: 'kanban_agent_run',
|
||||
|
||||
+24
-4
File diff suppressed because one or more lines are too long
+178
-1
@@ -421,6 +421,8 @@ export const ModelName = {
|
||||
AssetCommentAttachment: 'AssetCommentAttachment',
|
||||
AssetCommentReaction: 'AssetCommentReaction',
|
||||
AssetEmbedding: 'AssetEmbedding',
|
||||
AssetTranscript: 'AssetTranscript',
|
||||
AssetTranscriptSegment: 'AssetTranscriptSegment',
|
||||
Invite: 'Invite',
|
||||
MetadataField: 'MetadataField',
|
||||
Notification: 'Notification',
|
||||
@@ -474,7 +476,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
omit: GlobalOmitOptions
|
||||
}
|
||||
meta: {
|
||||
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "runner" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "shareActivity" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetAgentMd" | "assetComment" | "assetCommentAttachment" | "assetCommentReaction" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "mcpServer" | "agentMcpServer" | "mcpServerCredential" | "agentSession" | "agentSessionCommit" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog" | "quotaRule" | "quotaRecord" | "kanbanGoal" | "kanbanTask" | "kanbanTaskLink" | "kanbanTaskAsset" | "kanbanTaskComment" | "kanbanTaskEvent" | "recentFileItem" | "jwks" | "oauthClient" | "oauthResource" | "oauthClientResource" | "oauthRefreshToken" | "oauthAccessToken" | "oauthConsent" | "oauthClientAssertion"
|
||||
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "runner" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "shareActivity" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetAgentMd" | "assetComment" | "assetCommentAttachment" | "assetCommentReaction" | "assetEmbedding" | "assetTranscript" | "assetTranscriptSegment" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "mcpServer" | "agentMcpServer" | "mcpServerCredential" | "agentSession" | "agentSessionCommit" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog" | "quotaRule" | "quotaRecord" | "kanbanGoal" | "kanbanTask" | "kanbanTaskLink" | "kanbanTaskAsset" | "kanbanTaskComment" | "kanbanTaskEvent" | "recentFileItem" | "jwks" | "oauthClient" | "oauthResource" | "oauthClientResource" | "oauthRefreshToken" | "oauthAccessToken" | "oauthConsent" | "oauthClientAssertion"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -2254,6 +2256,154 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
AssetTranscript: {
|
||||
payload: Prisma.$AssetTranscriptPayload<ExtArgs>
|
||||
fields: Prisma.AssetTranscriptFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.AssetTranscriptFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.AssetTranscriptFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.AssetTranscriptFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.AssetTranscriptFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.AssetTranscriptFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.AssetTranscriptCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.AssetTranscriptCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.AssetTranscriptCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.AssetTranscriptDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.AssetTranscriptUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.AssetTranscriptDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.AssetTranscriptUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.AssetTranscriptUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.AssetTranscriptUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.AssetTranscriptAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateAssetTranscript>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.AssetTranscriptGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AssetTranscriptGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.AssetTranscriptCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AssetTranscriptCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
AssetTranscriptSegment: {
|
||||
payload: Prisma.$AssetTranscriptSegmentPayload<ExtArgs>
|
||||
fields: Prisma.AssetTranscriptSegmentFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.AssetTranscriptSegmentFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.AssetTranscriptSegmentFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.AssetTranscriptSegmentFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.AssetTranscriptSegmentFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.AssetTranscriptSegmentFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.AssetTranscriptSegmentCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.AssetTranscriptSegmentCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.AssetTranscriptSegmentCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.AssetTranscriptSegmentDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.AssetTranscriptSegmentUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.AssetTranscriptSegmentDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.AssetTranscriptSegmentUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.AssetTranscriptSegmentUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.AssetTranscriptSegmentUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AssetTranscriptSegmentPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.AssetTranscriptSegmentAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateAssetTranscriptSegment>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.AssetTranscriptSegmentGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AssetTranscriptSegmentGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.AssetTranscriptSegmentCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AssetTranscriptSegmentCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
Invite: {
|
||||
payload: Prisma.$InvitePayload<ExtArgs>
|
||||
fields: Prisma.InviteFieldRefs
|
||||
@@ -5455,6 +5605,31 @@ export const AssetEmbeddingScalarFieldEnum = {
|
||||
export type AssetEmbeddingScalarFieldEnum = (typeof AssetEmbeddingScalarFieldEnum)[keyof typeof AssetEmbeddingScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetTranscriptScalarFieldEnum = {
|
||||
id: 'id',
|
||||
assetId: 'assetId',
|
||||
language: 'language',
|
||||
model: 'model',
|
||||
workflowTaskId: 'workflowTaskId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AssetTranscriptScalarFieldEnum = (typeof AssetTranscriptScalarFieldEnum)[keyof typeof AssetTranscriptScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetTranscriptSegmentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
transcriptId: 'transcriptId',
|
||||
position: 'position',
|
||||
startMs: 'startMs',
|
||||
endMs: 'endMs',
|
||||
text: 'text'
|
||||
} as const
|
||||
|
||||
export type AssetTranscriptSegmentScalarFieldEnum = (typeof AssetTranscriptSegmentScalarFieldEnum)[keyof typeof AssetTranscriptSegmentScalarFieldEnum]
|
||||
|
||||
|
||||
export const InviteScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
@@ -6747,6 +6922,8 @@ export type GlobalOmitConfig = {
|
||||
assetCommentAttachment?: Prisma.AssetCommentAttachmentOmit
|
||||
assetCommentReaction?: Prisma.AssetCommentReactionOmit
|
||||
assetEmbedding?: Prisma.AssetEmbeddingOmit
|
||||
assetTranscript?: Prisma.AssetTranscriptOmit
|
||||
assetTranscriptSegment?: Prisma.AssetTranscriptSegmentOmit
|
||||
invite?: Prisma.InviteOmit
|
||||
metadataField?: Prisma.MetadataFieldOmit
|
||||
notification?: Prisma.NotificationOmit
|
||||
|
||||
@@ -75,6 +75,8 @@ export const ModelName = {
|
||||
AssetCommentAttachment: 'AssetCommentAttachment',
|
||||
AssetCommentReaction: 'AssetCommentReaction',
|
||||
AssetEmbedding: 'AssetEmbedding',
|
||||
AssetTranscript: 'AssetTranscript',
|
||||
AssetTranscriptSegment: 'AssetTranscriptSegment',
|
||||
Invite: 'Invite',
|
||||
MetadataField: 'MetadataField',
|
||||
Notification: 'Notification',
|
||||
@@ -481,6 +483,31 @@ export const AssetEmbeddingScalarFieldEnum = {
|
||||
export type AssetEmbeddingScalarFieldEnum = (typeof AssetEmbeddingScalarFieldEnum)[keyof typeof AssetEmbeddingScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetTranscriptScalarFieldEnum = {
|
||||
id: 'id',
|
||||
assetId: 'assetId',
|
||||
language: 'language',
|
||||
model: 'model',
|
||||
workflowTaskId: 'workflowTaskId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AssetTranscriptScalarFieldEnum = (typeof AssetTranscriptScalarFieldEnum)[keyof typeof AssetTranscriptScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetTranscriptSegmentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
transcriptId: 'transcriptId',
|
||||
position: 'position',
|
||||
startMs: 'startMs',
|
||||
endMs: 'endMs',
|
||||
text: 'text'
|
||||
} as const
|
||||
|
||||
export type AssetTranscriptSegmentScalarFieldEnum = (typeof AssetTranscriptSegmentScalarFieldEnum)[keyof typeof AssetTranscriptSegmentScalarFieldEnum]
|
||||
|
||||
|
||||
export const InviteScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
|
||||
+2
@@ -32,6 +32,8 @@ export type * from './models/AssetComment.ts'
|
||||
export type * from './models/AssetCommentAttachment.ts'
|
||||
export type * from './models/AssetCommentReaction.ts'
|
||||
export type * from './models/AssetEmbedding.ts'
|
||||
export type * from './models/AssetTranscript.ts'
|
||||
export type * from './models/AssetTranscriptSegment.ts'
|
||||
export type * from './models/Invite.ts'
|
||||
export type * from './models/MetadataField.ts'
|
||||
export type * from './models/Notification.ts'
|
||||
|
||||
+346
File diff suppressed because it is too large
Load Diff
+1568
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,10 @@ export function registerWorkflowTrigger(cb: WorkflowTriggerCallback) {
|
||||
onWorkflowTaskCreated = cb
|
||||
}
|
||||
|
||||
export async function notifyWorkflowTaskCreated(task: WorkflowTask): Promise<void> {
|
||||
if (task.status === 'pending') await onWorkflowTaskCreated?.(task)
|
||||
}
|
||||
|
||||
// Global callback for workflow task cancellation (decouples db/core packages from workflow engine)
|
||||
type WorkflowCancelCallback = (taskId: string) => Promise<void>
|
||||
let onWorkflowTaskCancelled: WorkflowCancelCallback | null = null
|
||||
@@ -149,9 +153,7 @@ function createPrismaClient() {
|
||||
workflowTask: {
|
||||
async create({ args, query }) {
|
||||
const result = await query(args)
|
||||
if (onWorkflowTaskCreated && (result as WorkflowTask).status === 'pending') {
|
||||
onWorkflowTaskCreated(result as WorkflowTask).catch(console.error)
|
||||
}
|
||||
notifyWorkflowTaskCreated(result as WorkflowTask).catch(console.error)
|
||||
return result
|
||||
},
|
||||
},
|
||||
|
||||
@@ -377,6 +377,7 @@ declare global {
|
||||
imageAnnotation?: ImageAnnotationSpec
|
||||
pdfPages?: PdfPagesSpec
|
||||
videoChunks?: VideoChunksSpec
|
||||
transcription?: { language: string | null; model: string }
|
||||
/** Render that produced this result, if any (set by the read_asset pipeline). */
|
||||
assetRead?: AssetReadRequest
|
||||
watermark?: WatermarkTaskPayload
|
||||
@@ -403,6 +404,7 @@ declare global {
|
||||
|
||||
export interface WorkflowTaskOutput {
|
||||
error?: string
|
||||
transcription?: { transcriptId: string; language: string } | { noSpeech: true }
|
||||
recoveryAttempts?: number
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user