@shumai-one/shumai-transcode 0.2.3 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai-transcode",
3
- "version": "0.2.3",
3
+ "version": "0.3.1",
4
4
  "description": "Media transcoding worker for the shumai media workspace",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,7 @@
15
15
  "@prisma/client": "7.8.0",
16
16
  "@prisma/adapter-pg": "7.8.0",
17
17
  "pg": "8.21.0",
18
- "sharp": "0.35.3",
18
+ "sharp": "0.34.5",
19
19
  "pino": "10.3.1",
20
20
  "pino-pretty": "13.1.3",
21
21
  "@temporalio/activity": "1.17.2",
@@ -27,12 +27,12 @@
27
27
  "zod": "4.4.3"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@shumai-one/shumai-transcode-darwin-arm64": "0.2.3",
31
- "@shumai-one/shumai-transcode-darwin-x64": "0.2.3",
32
- "@shumai-one/shumai-transcode-linux-arm64": "0.2.3",
33
- "@shumai-one/shumai-transcode-linux-x64": "0.2.3",
34
- "@shumai-one/shumai-transcode-win32-arm64": "0.2.3",
35
- "@shumai-one/shumai-transcode-win32-x64": "0.2.3"
30
+ "@shumai-one/shumai-transcode-darwin-arm64": "0.3.1",
31
+ "@shumai-one/shumai-transcode-darwin-x64": "0.3.1",
32
+ "@shumai-one/shumai-transcode-linux-arm64": "0.3.1",
33
+ "@shumai-one/shumai-transcode-linux-x64": "0.3.1",
34
+ "@shumai-one/shumai-transcode-win32-arm64": "0.3.1",
35
+ "@shumai-one/shumai-transcode-win32-x64": "0.3.1"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -0,0 +1,14 @@
1
+ -- AlterTable
2
+ ALTER TABLE "agent_session_entries" ADD COLUMN "asset_id" TEXT,
3
+ ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
4
+ ADD COLUMN "data" JSONB,
5
+ ADD COLUMN "parent_id" TEXT,
6
+ ADD COLUMN "type" TEXT,
7
+ ALTER COLUMN "session_id" DROP NOT NULL,
8
+ ALTER COLUMN "entry" DROP NOT NULL;
9
+
10
+ -- CreateIndex
11
+ CREATE INDEX "agent_session_entries_parent_id_idx" ON "agent_session_entries"("parent_id");
12
+
13
+ -- CreateIndex
14
+ CREATE INDEX "agent_session_entries_asset_id_idx" ON "agent_session_entries"("asset_id");
@@ -0,0 +1,12 @@
1
+ -- Migrate existing entry JSON data to new columns
2
+ UPDATE agent_session_entries
3
+ SET
4
+ type = entry->>'type',
5
+ parent_id = entry->>'parentId',
6
+ asset_id = (SELECT s.asset_id FROM agent_sessions s WHERE s.id = agent_session_entries.session_id),
7
+ created_at = CASE
8
+ WHEN entry->>'timestamp' IS NOT NULL THEN (entry->>'timestamp')::timestamptz
9
+ ELSE created_at
10
+ END,
11
+ data = (entry::jsonb - 'id' - 'type' - 'parentId' - 'timestamp')::text::json
12
+ WHERE entry IS NOT NULL;
@@ -0,0 +1,8 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `entry` on the `agent_session_entries` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "agent_session_entries" DROP COLUMN "entry";
@@ -0,0 +1,5 @@
1
+ -- DropForeignKey
2
+ ALTER TABLE "agent_sessions" DROP CONSTRAINT "agent_sessions_asset_id_fkey";
3
+
4
+ -- AddForeignKey
5
+ ALTER TABLE "agent_sessions" ADD CONSTRAINT "agent_sessions_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "assets" ALTER COLUMN "size_byte" SET DATA TYPE BIGINT;
@@ -0,0 +1,5 @@
1
+ -- AlterTable
2
+ ALTER TABLE "ai_usages" ALTER COLUMN "input_tokens" SET DATA TYPE BIGINT,
3
+ ALTER COLUMN "output_tokens" SET DATA TYPE BIGINT,
4
+ ALTER COLUMN "cache_read_tokens" SET DATA TYPE BIGINT,
5
+ ALTER COLUMN "total_tokens" SET DATA TYPE BIGINT;
@@ -374,7 +374,7 @@ model Asset {
374
374
  type AssetType
375
375
  mediaType String? @map("media_type")
376
376
  fileCount Int @default(0) @map("file_count")
377
- sizeByte Int @default(0) @map("size_byte")
377
+ sizeByte BigInt @default(0) @map("size_byte")
378
378
  status AssetStatus
379
379
  transcodeTaskId String? @map("transcode_task_id")
380
380
  /// [MediaInfo]
@@ -708,7 +708,7 @@ model AgentSession {
708
708
  cwd String
709
709
  leafId String? @map("leaf_id")
710
710
  assetId String? @map("asset_id")
711
- asset Asset? @relation("AssetToAgentSession", fields: [assetId], references: [id], onDelete: Cascade)
711
+ asset Asset? @relation("AssetToAgentSession", fields: [assetId], references: [id], onDelete: SetNull)
712
712
  userCommentId String? @map("user_comment_id")
713
713
  type AgentSessionType @default(comment)
714
714
  name String?
@@ -722,14 +722,20 @@ model AgentSession {
722
722
  }
723
723
 
724
724
  model AgentSessionEntry {
725
- id String @id // Uses ULID generated by pi-coding-agent
726
- sessionId String @map("session_id")
727
- session AgentSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
728
- /// [PiSessionEntry]
729
- entry Json
725
+ id String @id // Uses ULID generated by pi-coding-agent
726
+ sessionId String? @map("session_id")
727
+ session AgentSession? @relation(fields: [sessionId], references: [id], onDelete: Cascade)
728
+ assetId String? @map("asset_id")
729
+ type String?
730
+ parentId String? @map("parent_id")
731
+ /// [PiSessionEntryData]
732
+ data Json?
733
+ createdAt DateTime @default(now()) @map("created_at")
730
734
 
731
- @@map("agent_session_entries")
732
735
  @@index([sessionId])
736
+ @@index([parentId])
737
+ @@index([assetId])
738
+ @@map("agent_session_entries")
733
739
  }
734
740
 
735
741
  model UserMetadata {
@@ -822,10 +828,10 @@ model AiUsage {
822
828
  teamId String @map("team_id")
823
829
  userId String? @map("user_id")
824
830
  periodStart DateTime @map("period_start")
825
- inputTokens Int @default(0) @map("input_tokens")
826
- outputTokens Int @default(0) @map("output_tokens")
827
- cacheReadTokens Int @default(0) @map("cache_read_tokens")
828
- totalTokens Int @default(0) @map("total_tokens")
831
+ inputTokens BigInt @default(0) @map("input_tokens")
832
+ outputTokens BigInt @default(0) @map("output_tokens")
833
+ cacheReadTokens BigInt @default(0) @map("cache_read_tokens")
834
+ totalTokens BigInt @default(0) @map("total_tokens")
829
835
  cost Float @default(0) @map("cost")
830
836
  createdAt DateTime @default(now()) @map("created_at")
831
837
  updatedAt DateTime @updatedAt @map("updated_at")