@shumai-one/shumai-transcode 0.2.2 → 0.3.0

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.2",
3
+ "version": "0.3.0",
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.2.2",
31
- "@shumai-one/shumai-transcode-darwin-x64": "0.2.2",
32
- "@shumai-one/shumai-transcode-linux-arm64": "0.2.2",
33
- "@shumai-one/shumai-transcode-linux-x64": "0.2.2",
34
- "@shumai-one/shumai-transcode-win32-arm64": "0.2.2",
35
- "@shumai-one/shumai-transcode-win32-x64": "0.2.2"
30
+ "@shumai-one/shumai-transcode-darwin-arm64": "0.3.0",
31
+ "@shumai-one/shumai-transcode-darwin-x64": "0.3.0",
32
+ "@shumai-one/shumai-transcode-linux-arm64": "0.3.0",
33
+ "@shumai-one/shumai-transcode-linux-x64": "0.3.0",
34
+ "@shumai-one/shumai-transcode-win32-arm64": "0.3.0",
35
+ "@shumai-one/shumai-transcode-win32-x64": "0.3.0"
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";
@@ -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 {