@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/bin/{chunk-wbk33b0m.js → chunk-nt1573w8.js} +19 -4
- package/bin/shumai-transcode-app.js +39 -33
- package/package.json +8 -8
- package/prisma/migrations/20260728024147_add_agent_session_entry_columns/migration.sql +14 -0
- package/prisma/migrations/20260728024205_migrate_agent_session_entry_data/migration.sql +12 -0
- package/prisma/migrations/20260728031230_remove_agent_session_entry_legacy_entry_column/migration.sql +8 -0
- package/prisma/migrations/20260729073910_change_agent_session_asset_on_delete_to_set_null/migration.sql +5 -0
- package/prisma/migrations/20260729114346_asset_size_byte_bigint/migration.sql +2 -0
- package/prisma/migrations/20260729114659_ai_usage_tokens_bigint/migration.sql +5 -0
- package/prisma/schema.prisma +18 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shumai-one/shumai-transcode",
|
|
3
|
-
"version": "0.
|
|
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.
|
|
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.
|
|
31
|
-
"@shumai-one/shumai-transcode-darwin-x64": "0.
|
|
32
|
-
"@shumai-one/shumai-transcode-linux-arm64": "0.
|
|
33
|
-
"@shumai-one/shumai-transcode-linux-x64": "0.
|
|
34
|
-
"@shumai-one/shumai-transcode-win32-arm64": "0.
|
|
35
|
-
"@shumai-one/shumai-transcode-win32-x64": "0.
|
|
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,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;
|
package/prisma/schema.prisma
CHANGED
|
@@ -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
|
|
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:
|
|
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
|
|
726
|
-
sessionId String
|
|
727
|
-
session AgentSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
|
728
|
-
|
|
729
|
-
|
|
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
|
|
826
|
-
outputTokens
|
|
827
|
-
cacheReadTokens
|
|
828
|
-
totalTokens
|
|
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")
|