@shumai-one/shumai-transcode 0.3.9 → 0.3.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai-transcode",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "Media transcoding worker for the shumai media workspace",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,12 +27,12 @@
27
27
  "zod": "4.4.3"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@shumai-one/shumai-transcode-darwin-arm64": "0.3.9",
31
- "@shumai-one/shumai-transcode-darwin-x64": "0.3.9",
32
- "@shumai-one/shumai-transcode-linux-arm64": "0.3.9",
33
- "@shumai-one/shumai-transcode-linux-x64": "0.3.9",
34
- "@shumai-one/shumai-transcode-win32-arm64": "0.3.9",
35
- "@shumai-one/shumai-transcode-win32-x64": "0.3.9"
30
+ "@shumai-one/shumai-transcode-darwin-arm64": "0.3.11",
31
+ "@shumai-one/shumai-transcode-darwin-x64": "0.3.11",
32
+ "@shumai-one/shumai-transcode-linux-arm64": "0.3.11",
33
+ "@shumai-one/shumai-transcode-linux-x64": "0.3.11",
34
+ "@shumai-one/shumai-transcode-win32-arm64": "0.3.11",
35
+ "@shumai-one/shumai-transcode-win32-x64": "0.3.11"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -0,0 +1,164 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "KanbanTaskStatus" AS ENUM ('TODO', 'READY', 'IN_PROGRESS', 'BLOCKED', 'IN_REVIEW', 'DONE', 'CANCELLED');
3
+
4
+ -- CreateEnum
5
+ CREATE TYPE "KanbanTaskPriority" AS ENUM ('LOW', 'MEDIUM', 'HIGH', 'URGENT');
6
+
7
+ -- CreateEnum
8
+ CREATE TYPE "KanbanTaskEventType" AS ENUM ('CREATED', 'STATUS_CHANGED', 'ASSIGNED', 'UNASSIGNED', 'COMMENTED', 'CHANGES_REQUESTED', 'BLOCKED', 'UNBLOCKED', 'PRIORITY_CHANGED', 'GOAL_CHANGED', 'DEPENDENCY_ADDED', 'DEPENDENCY_REMOVED', 'CANCELLED');
9
+
10
+ -- CreateTable
11
+ CREATE TABLE "kanban_goals" (
12
+ "id" TEXT NOT NULL,
13
+ "title" TEXT NOT NULL,
14
+ "description" TEXT,
15
+ "team_id" TEXT NOT NULL,
16
+ "creator_id" TEXT,
17
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
18
+ "updated_at" TIMESTAMP(3) NOT NULL,
19
+
20
+ CONSTRAINT "kanban_goals_pkey" PRIMARY KEY ("id")
21
+ );
22
+
23
+ -- CreateTable
24
+ CREATE TABLE "kanban_tasks" (
25
+ "id" TEXT NOT NULL,
26
+ "title" TEXT NOT NULL,
27
+ "description" TEXT,
28
+ "is_agent_task" BOOLEAN NOT NULL DEFAULT false,
29
+ "status" "KanbanTaskStatus" NOT NULL DEFAULT 'TODO',
30
+ "priority" "KanbanTaskPriority" NOT NULL DEFAULT 'MEDIUM',
31
+ "start_date" TIMESTAMP(3),
32
+ "due_date" TIMESTAMP(3),
33
+ "started_at" TIMESTAMP(3),
34
+ "completed_at" TIMESTAMP(3),
35
+ "goal_id" TEXT,
36
+ "team_id" TEXT NOT NULL,
37
+ "project_id" TEXT,
38
+ "creator_id" TEXT NOT NULL,
39
+ "reporter_id" TEXT,
40
+ "assignee_id" TEXT,
41
+ "target_folder_id" TEXT,
42
+ "sort_index" TEXT,
43
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
44
+ "updated_at" TIMESTAMP(3) NOT NULL,
45
+
46
+ CONSTRAINT "kanban_tasks_pkey" PRIMARY KEY ("id")
47
+ );
48
+
49
+ -- CreateTable
50
+ CREATE TABLE "kanban_task_links" (
51
+ "parent_id" TEXT NOT NULL,
52
+ "child_id" TEXT NOT NULL,
53
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
54
+
55
+ CONSTRAINT "kanban_task_links_pkey" PRIMARY KEY ("parent_id","child_id")
56
+ );
57
+
58
+ -- CreateTable
59
+ CREATE TABLE "kanban_task_comments" (
60
+ "id" TEXT NOT NULL,
61
+ "task_id" TEXT NOT NULL,
62
+ "author_id" TEXT NOT NULL,
63
+ "body" TEXT NOT NULL,
64
+ "attachments" JSONB,
65
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
66
+ "updated_at" TIMESTAMP(3) NOT NULL,
67
+
68
+ CONSTRAINT "kanban_task_comments_pkey" PRIMARY KEY ("id")
69
+ );
70
+
71
+ -- CreateTable
72
+ CREATE TABLE "kanban_task_events" (
73
+ "id" TEXT NOT NULL,
74
+ "task_id" TEXT NOT NULL,
75
+ "actor_id" TEXT,
76
+ "type" "KanbanTaskEventType" NOT NULL,
77
+ "from_status" "KanbanTaskStatus",
78
+ "to_status" "KanbanTaskStatus",
79
+ "data" JSONB,
80
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
81
+
82
+ CONSTRAINT "kanban_task_events_pkey" PRIMARY KEY ("id")
83
+ );
84
+
85
+ -- CreateIndex
86
+ CREATE INDEX "kanban_goals_team_id_idx" ON "kanban_goals"("team_id");
87
+
88
+ -- CreateIndex
89
+ CREATE INDEX "kanban_tasks_team_id_status_idx" ON "kanban_tasks"("team_id", "status");
90
+
91
+ -- CreateIndex
92
+ CREATE INDEX "kanban_tasks_team_id_status_sort_index_idx" ON "kanban_tasks"("team_id", "status", "sort_index");
93
+
94
+ -- CreateIndex
95
+ CREATE INDEX "kanban_tasks_team_id_is_agent_task_status_idx" ON "kanban_tasks"("team_id", "is_agent_task", "status");
96
+
97
+ -- CreateIndex
98
+ CREATE INDEX "kanban_tasks_team_id_goal_id_status_idx" ON "kanban_tasks"("team_id", "goal_id", "status");
99
+
100
+ -- CreateIndex
101
+ CREATE INDEX "kanban_tasks_team_id_assignee_id_status_idx" ON "kanban_tasks"("team_id", "assignee_id", "status");
102
+
103
+ -- CreateIndex
104
+ CREATE INDEX "kanban_tasks_project_id_status_idx" ON "kanban_tasks"("project_id", "status");
105
+
106
+ -- CreateIndex
107
+ CREATE INDEX "kanban_tasks_sort_index_idx" ON "kanban_tasks"("sort_index");
108
+
109
+ -- CreateIndex
110
+ CREATE INDEX "kanban_task_links_child_id_idx" ON "kanban_task_links"("child_id");
111
+
112
+ -- CreateIndex
113
+ CREATE INDEX "kanban_task_comments_task_id_created_at_idx" ON "kanban_task_comments"("task_id", "created_at");
114
+
115
+ -- CreateIndex
116
+ CREATE INDEX "kanban_task_events_task_id_created_at_idx" ON "kanban_task_events"("task_id", "created_at");
117
+
118
+ -- CreateIndex
119
+ CREATE INDEX "kanban_task_events_actor_id_created_at_idx" ON "kanban_task_events"("actor_id", "created_at");
120
+
121
+ -- AddForeignKey
122
+ ALTER TABLE "kanban_goals" ADD CONSTRAINT "kanban_goals_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
123
+
124
+ -- AddForeignKey
125
+ ALTER TABLE "kanban_goals" ADD CONSTRAINT "kanban_goals_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
126
+
127
+ -- AddForeignKey
128
+ ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_goal_id_fkey" FOREIGN KEY ("goal_id") REFERENCES "kanban_goals"("id") ON DELETE SET NULL ON UPDATE CASCADE;
129
+
130
+ -- AddForeignKey
131
+ ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
132
+
133
+ -- AddForeignKey
134
+ ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
135
+
136
+ -- AddForeignKey
137
+ ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
138
+
139
+ -- AddForeignKey
140
+ ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_reporter_id_fkey" FOREIGN KEY ("reporter_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
141
+
142
+ -- AddForeignKey
143
+ ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_assignee_id_fkey" FOREIGN KEY ("assignee_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
144
+
145
+ -- AddForeignKey
146
+ ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_target_folder_id_fkey" FOREIGN KEY ("target_folder_id") REFERENCES "assets"("id") ON DELETE SET NULL ON UPDATE CASCADE;
147
+
148
+ -- AddForeignKey
149
+ ALTER TABLE "kanban_task_links" ADD CONSTRAINT "kanban_task_links_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
150
+
151
+ -- AddForeignKey
152
+ ALTER TABLE "kanban_task_links" ADD CONSTRAINT "kanban_task_links_child_id_fkey" FOREIGN KEY ("child_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
153
+
154
+ -- AddForeignKey
155
+ ALTER TABLE "kanban_task_comments" ADD CONSTRAINT "kanban_task_comments_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
156
+
157
+ -- AddForeignKey
158
+ ALTER TABLE "kanban_task_comments" ADD CONSTRAINT "kanban_task_comments_author_id_fkey" FOREIGN KEY ("author_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
159
+
160
+ -- AddForeignKey
161
+ ALTER TABLE "kanban_task_events" ADD CONSTRAINT "kanban_task_events_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
162
+
163
+ -- AddForeignKey
164
+ ALTER TABLE "kanban_task_events" ADD CONSTRAINT "kanban_task_events_actor_id_fkey" FOREIGN KEY ("actor_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,26 @@
1
+ -- AlterEnum
2
+ -- This migration adds more than one value to an enum.
3
+ -- With PostgreSQL versions 11 and earlier, this is not possible
4
+ -- in a single migration. This can be worked around by creating
5
+ -- multiple migrations, each migration adding only one value to
6
+ -- the enum.
7
+
8
+
9
+ ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_created';
10
+ ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_assigned';
11
+ ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_status_updated';
12
+ ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_updated';
13
+ ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_deleted';
14
+ ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_comment_created';
15
+
16
+ -- AlterEnum
17
+ ALTER TYPE "WorkflowTaskType" ADD VALUE 'kanban_agent_run';
18
+
19
+ -- AlterTable
20
+ ALTER TABLE "notifications" ADD COLUMN "kanban_task_id" TEXT;
21
+
22
+ -- CreateIndex
23
+ CREATE INDEX "notifications_kanban_task_id_idx" ON "notifications"("kanban_task_id");
24
+
25
+ -- AddForeignKey
26
+ ALTER TABLE "notifications" ADD CONSTRAINT "notifications_kanban_task_id_fkey" FOREIGN KEY ("kanban_task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,10 @@
1
+ -- AlterTable: Change sort_index column collation to "C" on kanban_tasks
2
+ ALTER TABLE "kanban_tasks" ALTER COLUMN "sort_index" TYPE TEXT COLLATE "C";
3
+
4
+ -- Recreate index on sort_index with "C" collation
5
+ DROP INDEX IF EXISTS "kanban_tasks_sort_index_idx";
6
+ CREATE INDEX "kanban_tasks_sort_index_idx" ON "kanban_tasks" ("sort_index" COLLATE "C");
7
+
8
+ -- Recreate compound index with "C" collation
9
+ DROP INDEX IF EXISTS "kanban_tasks_team_id_status_sort_index_idx";
10
+ CREATE INDEX "kanban_tasks_team_id_status_sort_index_idx" ON "kanban_tasks" ("team_id", "status", "sort_index" COLLATE "C");
@@ -0,0 +1,17 @@
1
+ -- CreateTable
2
+ CREATE TABLE "kanban_task_assets" (
3
+ "task_id" TEXT NOT NULL,
4
+ "asset_id" TEXT NOT NULL,
5
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
6
+
7
+ CONSTRAINT "kanban_task_assets_pkey" PRIMARY KEY ("task_id","asset_id")
8
+ );
9
+
10
+ -- CreateIndex
11
+ CREATE INDEX "kanban_task_assets_asset_id_idx" ON "kanban_task_assets"("asset_id");
12
+
13
+ -- AddForeignKey
14
+ ALTER TABLE "kanban_task_assets" ADD CONSTRAINT "kanban_task_assets_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
15
+
16
+ -- AddForeignKey
17
+ ALTER TABLE "kanban_task_assets" ADD CONSTRAINT "kanban_task_assets_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,28 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - The values [CANCELLED] on the enum `KanbanTaskEventType` will be removed. If these variants are still used in the database, this will fail.
5
+ - The values [CANCELLED] on the enum `KanbanTaskStatus` will be removed. If these variants are still used in the database, this will fail.
6
+
7
+ */
8
+ -- AlterEnum
9
+ BEGIN;
10
+ CREATE TYPE "KanbanTaskEventType_new" AS ENUM ('CREATED', 'STATUS_CHANGED', 'ASSIGNED', 'UNASSIGNED', 'COMMENTED', 'CHANGES_REQUESTED', 'BLOCKED', 'UNBLOCKED', 'PRIORITY_CHANGED', 'GOAL_CHANGED', 'DEPENDENCY_ADDED', 'DEPENDENCY_REMOVED');
11
+ ALTER TABLE "kanban_task_events" ALTER COLUMN "type" TYPE "KanbanTaskEventType_new" USING ("type"::text::"KanbanTaskEventType_new");
12
+ ALTER TYPE "KanbanTaskEventType" RENAME TO "KanbanTaskEventType_old";
13
+ ALTER TYPE "KanbanTaskEventType_new" RENAME TO "KanbanTaskEventType";
14
+ DROP TYPE "public"."KanbanTaskEventType_old";
15
+ COMMIT;
16
+
17
+ -- AlterEnum
18
+ BEGIN;
19
+ CREATE TYPE "KanbanTaskStatus_new" AS ENUM ('TODO', 'READY', 'IN_PROGRESS', 'BLOCKED', 'IN_REVIEW', 'DONE');
20
+ ALTER TABLE "public"."kanban_tasks" ALTER COLUMN "status" DROP DEFAULT;
21
+ ALTER TABLE "kanban_tasks" ALTER COLUMN "status" TYPE "KanbanTaskStatus_new" USING ("status"::text::"KanbanTaskStatus_new");
22
+ ALTER TABLE "kanban_task_events" ALTER COLUMN "from_status" TYPE "KanbanTaskStatus_new" USING ("from_status"::text::"KanbanTaskStatus_new");
23
+ ALTER TABLE "kanban_task_events" ALTER COLUMN "to_status" TYPE "KanbanTaskStatus_new" USING ("to_status"::text::"KanbanTaskStatus_new");
24
+ ALTER TYPE "KanbanTaskStatus" RENAME TO "KanbanTaskStatus_old";
25
+ ALTER TYPE "KanbanTaskStatus_new" RENAME TO "KanbanTaskStatus";
26
+ DROP TYPE "public"."KanbanTaskStatus_old";
27
+ ALTER TABLE "kanban_tasks" ALTER COLUMN "status" SET DEFAULT 'TODO';
28
+ COMMIT;
@@ -0,0 +1,28 @@
1
+ -- CreateTable
2
+ CREATE TABLE "recent_file_items" (
3
+ "id" TEXT NOT NULL,
4
+ "user_id" TEXT NOT NULL,
5
+ "project_id" TEXT NOT NULL,
6
+ "asset_id" TEXT NOT NULL,
7
+ "viewed_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
8
+
9
+ CONSTRAINT "recent_file_items_pkey" PRIMARY KEY ("id")
10
+ );
11
+
12
+ -- CreateIndex
13
+ CREATE INDEX "recent_file_items_user_id_project_id_viewed_at_idx" ON "recent_file_items"("user_id", "project_id", "viewed_at" DESC);
14
+
15
+ -- CreateIndex
16
+ CREATE INDEX "recent_file_items_asset_id_idx" ON "recent_file_items"("asset_id");
17
+
18
+ -- CreateIndex
19
+ CREATE UNIQUE INDEX "recent_file_items_user_id_project_id_asset_id_key" ON "recent_file_items"("user_id", "project_id", "asset_id");
20
+
21
+ -- AddForeignKey
22
+ ALTER TABLE "recent_file_items" ADD CONSTRAINT "recent_file_items_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
23
+
24
+ -- AddForeignKey
25
+ ALTER TABLE "recent_file_items" ADD CONSTRAINT "recent_file_items_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
26
+
27
+ -- AddForeignKey
28
+ ALTER TABLE "recent_file_items" ADD CONSTRAINT "recent_file_items_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -68,6 +68,12 @@ enum NotificationType {
68
68
  metadata_field_updated_status
69
69
  new_user_join_team
70
70
  new_user_join_project
71
+ kanban_task_created
72
+ kanban_task_assigned
73
+ kanban_task_status_updated
74
+ kanban_task_updated
75
+ kanban_task_deleted
76
+ kanban_task_comment_created
71
77
  }
72
78
 
73
79
  enum ProjectMemberRole {
@@ -112,6 +118,7 @@ enum WorkflowTaskType {
112
118
  ai_embedding
113
119
  query_embedding_for_search
114
120
  agent_tool_call
121
+ kanban_agent_run
115
122
  }
116
123
 
117
124
  enum WorkflowTaskStatus {
@@ -156,6 +163,37 @@ enum QuotaResourceType {
156
163
  agent_tool_call_count
157
164
  }
158
165
 
166
+ enum KanbanTaskStatus {
167
+ TODO
168
+ READY
169
+ IN_PROGRESS
170
+ BLOCKED
171
+ IN_REVIEW
172
+ DONE
173
+ }
174
+
175
+ enum KanbanTaskPriority {
176
+ LOW
177
+ MEDIUM
178
+ HIGH
179
+ URGENT
180
+ }
181
+
182
+ enum KanbanTaskEventType {
183
+ CREATED
184
+ STATUS_CHANGED
185
+ ASSIGNED
186
+ UNASSIGNED
187
+ COMMENTED
188
+ CHANGES_REQUESTED
189
+ BLOCKED
190
+ UNBLOCKED
191
+ PRIORITY_CHANGED
192
+ GOAL_CHANGED
193
+ DEPENDENCY_ADDED
194
+ DEPENDENCY_REMOVED
195
+ }
196
+
159
197
  // ----------------------------------------------------------------------
160
198
  // Models
161
199
  // ----------------------------------------------------------------------
@@ -194,6 +232,13 @@ model User {
194
232
  aiUsages AiUsage[] @relation("UserToAiUsage")
195
233
  auditLogs AuditLog[] @relation("UserToAuditLog")
196
234
  quotaRecords QuotaRecord[] @relation("UserToQuotaRecord")
235
+ kanbanTasksCreated KanbanTask[] @relation("KanbanTaskCreator")
236
+ kanbanTasksReported KanbanTask[] @relation("KanbanTaskReporter")
237
+ kanbanTasksAssigned KanbanTask[] @relation("KanbanTaskAssignee")
238
+ kanbanGoalsCreated KanbanGoal[] @relation("UserToKanbanGoal")
239
+ kanbanTaskComments KanbanTaskComment[]
240
+ kanbanTaskEvents KanbanTaskEvent[]
241
+ recentFiles RecentFileItem[]
197
242
 
198
243
  @@map("users")
199
244
  }
@@ -282,6 +327,8 @@ model Team {
282
327
  watermarkTemplates WatermarkTemplate[] @relation("TeamToWatermarkTemplate")
283
328
  quotaRules QuotaRule[] @relation("TeamToQuotaRule")
284
329
  quotaRecords QuotaRecord[] @relation("TeamToQuotaRecord")
330
+ kanbanGoals KanbanGoal[] @relation("TeamToKanbanGoal")
331
+ kanbanTasks KanbanTask[] @relation("TeamToKanbanTask")
285
332
 
286
333
  @@map("teams")
287
334
  }
@@ -367,6 +414,8 @@ model Project {
367
414
  shareLinks ShareLink[] @relation("ProjectToShareLink")
368
415
  collections Collection[] @relation("ProjectToCollection")
369
416
  auditLogs AuditLog[] @relation("ProjectToAuditLog")
417
+ kanbanTasks KanbanTask[] @relation("ProjectToKanbanTask")
418
+ recentFiles RecentFileItem[]
370
419
 
371
420
  @@map("projects")
372
421
  @@index([createdAt])
@@ -515,6 +564,9 @@ model Asset {
515
564
  agentSessions AgentSession[] @relation("AssetToAgentSession")
516
565
  watermarkFiles WatermarkFile[] @relation("AssetToWatermarkFile")
517
566
  agentMd AssetAgentMd? @relation("AssetToAgentMd")
567
+ kanbanTargetTasks KanbanTask[] @relation("KanbanTaskTargetFolder")
568
+ kanbanTasks KanbanTaskAsset[]
569
+ recentFiles RecentFileItem[]
518
570
 
519
571
  @@map("assets")
520
572
  @@index([type])
@@ -691,11 +743,15 @@ model Notification {
691
743
  taskId String? @map("task_id")
692
744
  task Task? @relation("TaskToNotification", fields: [taskId], references: [id])
693
745
 
746
+ kanbanTaskId String? @map("kanban_task_id")
747
+ kanbanTask KanbanTask? @relation("KanbanTaskToNotification", fields: [kanbanTaskId], references: [id], onDelete: Cascade)
748
+
694
749
  userId String? @map("user_id")
695
750
  user User? @relation("UserToNotification", fields: [userId], references: [id])
696
751
 
697
752
  readByMembers TeamMember? @relation("TeamMemberToLastReadNotification")
698
753
 
754
+ @@index([kanbanTaskId])
699
755
  @@map("notifications")
700
756
  }
701
757
 
@@ -1087,4 +1143,155 @@ model QuotaRecord {
1087
1143
  @@map("quota_records")
1088
1144
  }
1089
1145
 
1146
+ model KanbanGoal {
1147
+ id String @id @default(ulid())
1148
+ title String
1149
+ description String? @db.Text
1150
+ teamId String @map("team_id")
1151
+ team Team @relation("TeamToKanbanGoal", fields: [teamId], references: [id], onDelete: Cascade)
1152
+ creatorId String? @map("creator_id")
1153
+ creator User? @relation("UserToKanbanGoal", fields: [creatorId], references: [id], onDelete: SetNull)
1154
+ tasks KanbanTask[]
1155
+
1156
+ createdAt DateTime @default(now()) @map("created_at")
1157
+ updatedAt DateTime @updatedAt @map("updated_at")
1158
+
1159
+ @@index([teamId])
1160
+ @@map("kanban_goals")
1161
+ }
1162
+
1163
+ model KanbanTask {
1164
+ id String @id @default(ulid())
1165
+ title String
1166
+ description String? @db.Text
1167
+ isAgentTask Boolean @default(false) @map("is_agent_task")
1168
+ status KanbanTaskStatus @default(TODO)
1169
+ priority KanbanTaskPriority @default(MEDIUM)
1170
+
1171
+ startDate DateTime? @map("start_date")
1172
+ dueDate DateTime? @map("due_date")
1173
+ startedAt DateTime? @map("started_at")
1174
+ completedAt DateTime? @map("completed_at")
1175
+
1176
+ goalId String? @map("goal_id")
1177
+ goal KanbanGoal? @relation(fields: [goalId], references: [id], onDelete: SetNull)
1178
+
1179
+ teamId String @map("team_id")
1180
+ team Team @relation("TeamToKanbanTask", fields: [teamId], references: [id], onDelete: Cascade)
1181
+ projectId String? @map("project_id")
1182
+ project Project? @relation("ProjectToKanbanTask", fields: [projectId], references: [id], onDelete: Cascade)
1183
+
1184
+ creatorId String @map("creator_id")
1185
+ creator User @relation("KanbanTaskCreator", fields: [creatorId], references: [id])
1186
+ reporterId String? @map("reporter_id")
1187
+ reporter User? @relation("KanbanTaskReporter", fields: [reporterId], references: [id])
1188
+ assigneeId String? @map("assignee_id")
1189
+ assignee User? @relation("KanbanTaskAssignee", fields: [assigneeId], references: [id])
1190
+
1191
+ targetFolderId String? @map("target_folder_id")
1192
+ targetFolder Asset? @relation("KanbanTaskTargetFolder", fields: [targetFolderId], references: [id], onDelete: SetNull)
1193
+
1194
+ dependencies KanbanTaskLink[] @relation("ChildLinks")
1195
+ dependents KanbanTaskLink[] @relation("ParentLinks")
1196
+ assets KanbanTaskAsset[]
1197
+
1198
+ comments KanbanTaskComment[]
1199
+ events KanbanTaskEvent[]
1200
+ notifications Notification[] @relation("KanbanTaskToNotification")
1201
+
1202
+ sortIndex String? @map("sort_index")
1203
+
1204
+ createdAt DateTime @default(now()) @map("created_at")
1205
+ updatedAt DateTime @updatedAt @map("updated_at")
1206
+
1207
+ @@index([teamId, status])
1208
+ @@index([teamId, status, sortIndex])
1209
+ @@index([teamId, isAgentTask, status])
1210
+ @@index([teamId, goalId, status])
1211
+ @@index([teamId, assigneeId, status])
1212
+ @@index([projectId, status])
1213
+ @@index([sortIndex])
1214
+ @@map("kanban_tasks")
1215
+ }
1216
+
1217
+ model KanbanTaskLink {
1218
+ parentId String @map("parent_id")
1219
+ childId String @map("child_id")
1220
+ parent KanbanTask @relation("ParentLinks", fields: [parentId], references: [id], onDelete: Cascade)
1221
+ child KanbanTask @relation("ChildLinks", fields: [childId], references: [id], onDelete: Cascade)
1222
+
1223
+ createdAt DateTime @default(now()) @map("created_at")
1224
+
1225
+ @@id([parentId, childId])
1226
+ @@index([childId])
1227
+ @@map("kanban_task_links")
1228
+ }
1229
+
1230
+ model KanbanTaskAsset {
1231
+ taskId String @map("task_id")
1232
+ assetId String @map("asset_id")
1233
+ task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
1234
+ asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
1235
+
1236
+ createdAt DateTime @default(now()) @map("created_at")
1237
+
1238
+ @@id([taskId, assetId])
1239
+ @@index([assetId])
1240
+ @@map("kanban_task_assets")
1241
+ }
1242
+
1243
+ model KanbanTaskComment {
1244
+ id String @id @default(ulid())
1245
+ taskId String @map("task_id")
1246
+ task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
1247
+ authorId String @map("author_id")
1248
+ author User @relation(fields: [authorId], references: [id])
1249
+ body String @db.Text
1250
+ /// [KanbanCommentAttachmentList]
1251
+ attachments Json?
1252
+
1253
+ createdAt DateTime @default(now()) @map("created_at")
1254
+ updatedAt DateTime @updatedAt @map("updated_at")
1255
+
1256
+ @@index([taskId, createdAt])
1257
+ @@map("kanban_task_comments")
1258
+ }
1259
+
1260
+ model KanbanTaskEvent {
1261
+ id String @id @default(ulid())
1262
+ taskId String @map("task_id")
1263
+ task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
1264
+ actorId String? @map("actor_id")
1265
+ actor User? @relation(fields: [actorId], references: [id])
1266
+ type KanbanTaskEventType
1267
+ fromStatus KanbanTaskStatus? @map("from_status")
1268
+ toStatus KanbanTaskStatus? @map("to_status")
1269
+ /// [KanbanEventPayload]
1270
+ data Json?
1271
+
1272
+ createdAt DateTime @default(now()) @map("created_at")
1273
+
1274
+ @@index([taskId, createdAt])
1275
+ @@index([actorId, createdAt])
1276
+ @@map("kanban_task_events")
1277
+ }
1278
+
1279
+ model RecentFileItem {
1280
+ id String @id @default(ulid())
1281
+ userId String @map("user_id")
1282
+ projectId String @map("project_id")
1283
+ assetId String @map("asset_id")
1284
+ viewedAt DateTime @default(now()) @map("viewed_at")
1285
+
1286
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1287
+ project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
1288
+ asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
1289
+
1290
+ @@unique([userId, projectId, assetId], name: "userIdProjectIdAssetId")
1291
+ @@index([userId, projectId, viewedAt(sort: Desc)])
1292
+ @@index([assetId])
1293
+ @@map("recent_file_items")
1294
+ }
1295
+
1296
+
1090
1297