The best way to control Claude Code, Codex and more from any computer or phone

main
ts 176 lines 5.93 KB
Raw
1 /**
2 * Rows recorded from an isolated `@opencode/cli@2.1.2` data directory: one imported
3 * session with a single assistant reply, a fork of it, and a fork of that fork
4 * moved to another directory. No model request was made after the import, so
5 * every assistant row here describes the same provider request.
6 */
7 export const openCodeForkSchema = [
8 // Recorded verbatim, except the project foreign key, whose table the reader never reads.
9 `CREATE TABLE \`session_v2\` (
10 \`id\` text PRIMARY KEY,
11 \`project_id\` text NOT NULL,
12 \`workspace_id\` text,
13 \`parent_id\` text,
14 \`fork_session_id\` text,
15 \`fork_boundary\` text,
16 \`slug\` text NOT NULL,
17 \`directory\` text NOT NULL,
18 \`path\` text,
19 \`title\` text,
20 \`version\` text NOT NULL,
21 \`share_url\` text,
22 \`summary_additions\` integer,
23 \`summary_deletions\` integer,
24 \`summary_files\` integer,
25 \`summary_diffs\` text,
26 \`metadata\` text,
27 \`cost\` real DEFAULT 0 NOT NULL,
28 \`tokens_input\` integer DEFAULT 0 NOT NULL,
29 \`tokens_output\` integer DEFAULT 0 NOT NULL,
30 \`tokens_reasoning\` integer DEFAULT 0 NOT NULL,
31 \`tokens_cache_read\` integer DEFAULT 0 NOT NULL,
32 \`tokens_cache_write\` integer DEFAULT 0 NOT NULL,
33 \`revert\` text,
34 \`permission\` text,
35 \`agent\` text,
36 \`model\` text,
37 \`time_created\` integer NOT NULL,
38 \`time_updated\` integer NOT NULL,
39 \`time_idle\` integer,
40 \`time_viewed\` integer,
41 \`idle_outcome\` text,
42 \`time_compacting\` integer,
43 \`time_archived\` integer,
44 \`time_suspended\` integer,
45 \`resume_attempts\` integer DEFAULT 0 NOT NULL
46 )`,
47 `CREATE TABLE \`session_message\` (
48 \`id\` text PRIMARY KEY,
49 \`session_id\` text NOT NULL,
50 \`type\` text NOT NULL,
51 \`seq\` integer NOT NULL,
52 \`time_created\` integer NOT NULL,
53 \`time_updated\` integer NOT NULL,
54 \`data\` text NOT NULL,
55 CONSTRAINT \`fk_session_message_session_id_session_v2_id_fk\` FOREIGN KEY (\`session_id\`) REFERENCES \`session_v2\`(\`id\`) ON DELETE CASCADE
56 )`,
57 ] as const;
58
59 export const openCodeForkSourceSessionId = "ses_e9f85baeeffec3vOG8D972DJeK";
60 export const openCodeForkSourceAssistantId = "msg_usageproofassistant0000001";
61 export const openCodeForkContinuationSessionId = "ses_e9f847594ffetYJnuLwILjFktF";
62
63 export const openCodeForkSessions = [
64 {
65 id: openCodeForkSourceSessionId,
66 project_id: "66c815350f7a94ca31c5664e5e983b8692210bdc",
67 fork_session_id: null,
68 fork_boundary: null,
69 slug: "mighty-engine",
70 directory: "/home/ubuntu/wt/issue-23104",
71 version: "2.1.2",
72 time_created: 1792619988283,
73 time_updated: 1792620016405,
74 },
75 {
76 id: "ses_e9f854c73ffezSCt9xY4yA99bP",
77 project_id: "66c815350f7a94ca31c5664e5e983b8692210bdc",
78 fork_session_id: openCodeForkSourceSessionId,
79 fork_boundary: `{"type":"through","messageID":"${openCodeForkSourceAssistantId}"}`,
80 slug: "silent-meadow",
81 directory: "/home/ubuntu/wt/issue-23104",
82 version: "2.1.2",
83 time_created: 1792620016526,
84 time_updated: 1792620016526,
85 },
86 {
87 id: openCodeForkContinuationSessionId,
88 project_id: "98021609e205cae99a3b3545f6e3643a33b807b5",
89 fork_session_id: "ses_e9f854c73ffezSCt9xY4yA99bP",
90 fork_boundary: '{"type":"through","messageID":"msg_1607ab38e001GxURO0NU4GY4Az_2"}',
91 slug: "playful-star",
92 directory: "/tmp/triage-23104",
93 version: "2.1.2",
94 time_created: 1792620071533,
95 time_updated: 1792620071833,
96 },
97 ] as const;
98
99 const userData = '{"time":{"created":1792619988283},"text":"Say usage proof"}';
100 const assistantData =
101 '{"time":{"created":1792619988284,"completed":1792619988285},"agent":"build","model":{"id":"claude-sonnet-4-5","providerID":"anthropic"},"content":[{"type":"text","text":"usage proof"}],"finish":"stop","cost":0.01,"tokens":{"input":1000,"output":200,"reasoning":0,"cache":{"read":300,"write":0}}}';
102
103 export const openCodeForkMessages = [
104 {
105 id: "msg_usageproofuser0000000000001",
106 session_id: openCodeForkSourceSessionId,
107 type: "user",
108 seq: 1,
109 time_created: 1792619988283,
110 time_updated: 1792620016408,
111 data: userData,
112 },
113 {
114 id: openCodeForkSourceAssistantId,
115 session_id: openCodeForkSourceSessionId,
116 type: "assistant",
117 seq: 2,
118 time_created: 1792619988284,
119 time_updated: 1792620016408,
120 data: assistantData,
121 },
122 {
123 id: "msg_1607ab38e001GxURO0NU4GY4Az_1",
124 session_id: "ses_e9f854c73ffezSCt9xY4yA99bP",
125 type: "user",
126 seq: 1,
127 time_created: 1792619988283,
128 time_updated: 1792620016408,
129 data: userData,
130 },
131 {
132 id: "msg_1607ab38e001GxURO0NU4GY4Az_2",
133 session_id: "ses_e9f854c73ffezSCt9xY4yA99bP",
134 type: "assistant",
135 seq: 2,
136 time_created: 1792619988284,
137 time_updated: 1792620016408,
138 data: assistantData,
139 },
140 {
141 id: "msg_1607b8a6d001MA7a5GgmyUywMf_1",
142 session_id: openCodeForkContinuationSessionId,
143 type: "user",
144 seq: 1,
145 time_created: 1792619988283,
146 time_updated: 1792620016408,
147 data: userData,
148 },
149 {
150 id: "msg_1607b8a6d001MA7a5GgmyUywMf_2",
151 session_id: openCodeForkContinuationSessionId,
152 type: "assistant",
153 seq: 2,
154 time_created: 1792619988284,
155 time_updated: 1792620016408,
156 data: assistantData,
157 },
158 {
159 id: "msg_1607b8b990025w0634bKiaIXmD",
160 session_id: openCodeForkContinuationSessionId,
161 type: "location-switched",
162 seq: 6,
163 time_created: 1792620071833,
164 time_updated: 1792620071838,
165 data: '{"time":{"created":1792620071833},"location":{"directory":"/tmp/triage-23104"},"projectID":"98021609e205cae99a3b3545f6e3643a33b807b5","subpath":"","previous":{"location":{"directory":"/home/ubuntu/wt/issue-23104"},"projectID":"66c815350f7a94ca31c5664e5e983b8692210bdc","subpath":""}}',
166 },
167 {
168 id: "msg_1607b8ba5001oCiDSgDjIcR3Nc",
169 session_id: openCodeForkContinuationSessionId,
170 type: "idle",
171 seq: 7,
172 time_created: 1792620071845,
173 time_updated: 1792620071846,
174 data: '{"time":{"created":1792620071845},"outcome":"succeeded"}',
175 },
176 ] as const;