@dinoxx/dinox-cli 1.1.1 → 2.0.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/README.md +44 -3
- package/dist/cli.js +4 -0
- package/dist/commands/auth/index.js +1 -2
- package/dist/commands/boxes/index.js +37 -13
- package/dist/commands/boxes/operations.d.ts +3 -3
- package/dist/commands/boxes/operations.js +51 -28
- package/dist/commands/info/index.js +30 -5
- package/dist/commands/meta/repo.js +2 -1
- package/dist/commands/notes/actions.js +20 -37
- package/dist/commands/notes/bulk.d.ts +2 -2
- package/dist/commands/notes/bulk.js +3 -18
- package/dist/commands/notes/contentPatch.d.ts +5 -1
- package/dist/commands/notes/contentPatch.js +12 -1
- package/dist/commands/notes/contentPatchCommand.d.ts +3 -0
- package/dist/commands/notes/contentPatchCommand.js +29 -8
- package/dist/commands/notes/descriptors.js +19 -16
- package/dist/commands/notes/export.js +3 -0
- package/dist/commands/notes/repo.d.ts +9 -0
- package/dist/commands/notes/repo.js +65 -15
- package/dist/commands/notes/searchOutput.d.ts +2 -1
- package/dist/commands/notes/searchOutput.js +2 -1
- package/dist/commands/notes/searchSql.js +9 -3
- package/dist/commands/prompt/index.d.ts +1 -0
- package/dist/commands/prompt/index.js +26 -11
- package/dist/commands/savedViews/index.d.ts +7 -0
- package/dist/commands/savedViews/index.js +458 -0
- package/dist/commands/savedViews/model.d.ts +87 -0
- package/dist/commands/savedViews/model.js +306 -0
- package/dist/commands/savedViews/repo.d.ts +123 -0
- package/dist/commands/savedViews/repo.js +512 -0
- package/dist/commands/savedViews/semantics.d.ts +46 -0
- package/dist/commands/savedViews/semantics.js +738 -0
- package/dist/commands/schema/renderSkills.d.ts +2 -0
- package/dist/commands/schema/renderSkills.js +69 -10
- package/dist/commands/schema/spec.js +4 -0
- package/dist/commands/skills/index.d.ts +54 -0
- package/dist/commands/skills/index.js +468 -0
- package/dist/commands/storage/index.js +2 -2
- package/dist/commands/sync.js +2 -1
- package/dist/commands/tags/index.js +30 -11
- package/dist/commands/tags/operations.d.ts +3 -3
- package/dist/commands/tags/operations.js +45 -20
- package/dist/commands/templates/model.d.ts +50 -0
- package/dist/commands/templates/model.js +239 -0
- package/dist/commands/todo/index.js +3 -3
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.js +46 -9
- package/dist/commands/writeConfirmation.d.ts +13 -0
- package/dist/commands/writeConfirmation.js +54 -0
- package/dist/config/resolve.js +5 -10
- package/dist/config/types.d.ts +3 -6
- package/dist/constants/links.d.ts +18 -1
- package/dist/constants/links.js +26 -1
- package/dist/daemon/client.d.ts +2 -2
- package/dist/daemon/client.js +106 -52
- package/dist/daemon/index.d.ts +5 -3
- package/dist/daemon/index.js +28 -5
- package/dist/daemon/lifecycle.d.ts +7 -2
- package/dist/daemon/lifecycle.js +53 -13
- package/dist/daemon/pid.d.ts +1 -1
- package/dist/daemon/pid.js +6 -3
- package/dist/dinox.js +9 -1
- package/dist/powersync/exclusiveRuntime.d.ts +1 -0
- package/dist/powersync/exclusiveRuntime.js +26 -8
- package/dist/powersync/runtime.d.ts +3 -2
- package/dist/powersync/runtime.js +19 -3
- package/dist/powersync/schema/content.d.ts +1 -78
- package/dist/powersync/schema/content.js +1 -78
- package/dist/powersync/schema/electronCanonical.d.ts +1561 -0
- package/dist/powersync/schema/electronCanonical.js +1154 -0
- package/dist/powersync/schema/index.d.ts +573 -129
- package/dist/powersync/schema/index.js +3 -32
- package/dist/powersync/schema/local.d.ts +1 -56
- package/dist/powersync/schema/local.js +1 -60
- package/dist/powersync/schema/note.d.ts +1 -35
- package/dist/powersync/schema/note.js +1 -35
- package/dist/powersync/schema/notesExtras.d.ts +1 -62
- package/dist/powersync/schema/notesExtras.js +1 -71
- package/dist/powersync/schema/projects.d.ts +1 -104
- package/dist/powersync/schema/projects.js +1 -104
- package/dist/powersync/schema/savedViews.d.ts +1 -0
- package/dist/powersync/schema/savedViews.js +1 -0
- package/dist/powersync/schema/storage.d.ts +1 -24
- package/dist/powersync/schema/storage.js +1 -24
- package/dist/powersync/schema/tags.d.ts +1 -37
- package/dist/powersync/schema/tags.js +1 -37
- package/dist/powersync/syncGate.d.ts +20 -2
- package/dist/powersync/uploader.d.ts +16 -2
- package/dist/powersync/uploader.js +152 -158
- package/dist/skills/check.d.ts +1 -0
- package/dist/skills/check.js +538 -70
- package/dist/skills/retired.d.ts +60 -0
- package/dist/skills/retired.js +58 -0
- package/dist/utils/deadline.d.ts +8 -0
- package/dist/utils/deadline.js +31 -0
- package/dist/utils/dryRun.d.ts +20 -1
- package/dist/utils/dryRun.js +22 -3
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/errors.js +2 -0
- package/dist/utils/processExit.d.ts +1 -0
- package/dist/utils/processExit.js +33 -0
- package/dist/utils/updateNotice.d.ts +1 -0
- package/dist/utils/updateNotice.js +1 -1
- package/package.json +8 -5
|
@@ -0,0 +1,1154 @@
|
|
|
1
|
+
// Generated by scripts/sync-electron-powersync-schema.ts. Do not edit manually.
|
|
2
|
+
import { column, Table } from '@powersync/common';
|
|
3
|
+
export const c_note = new Table({
|
|
4
|
+
content: column.text,
|
|
5
|
+
audios: column.text,
|
|
6
|
+
images: column.text,
|
|
7
|
+
created_at: column.text,
|
|
8
|
+
updated_at: column.text,
|
|
9
|
+
title: column.text,
|
|
10
|
+
type: column.text,
|
|
11
|
+
audio_detail: column.text,
|
|
12
|
+
image_detail: column.text,
|
|
13
|
+
source: column.text,
|
|
14
|
+
resource_id: column.text,
|
|
15
|
+
note_ids: column.text,
|
|
16
|
+
tags: column.text,
|
|
17
|
+
extra_data: column.text,
|
|
18
|
+
properties: column.text,
|
|
19
|
+
user_no: column.text,
|
|
20
|
+
is_pub: column.integer,
|
|
21
|
+
is_del: column.integer,
|
|
22
|
+
content_json: column.text,
|
|
23
|
+
content_text: column.text,
|
|
24
|
+
content_md: column.text,
|
|
25
|
+
format_type: column.text,
|
|
26
|
+
zettel_boxes: column.text,
|
|
27
|
+
status: column.integer,
|
|
28
|
+
comments: column.text,
|
|
29
|
+
is_top: column.integer,
|
|
30
|
+
pinned_at: column.text,
|
|
31
|
+
starred_at: column.text,
|
|
32
|
+
chat_context: column.text,
|
|
33
|
+
bid_links: column.text,
|
|
34
|
+
version: column.integer,
|
|
35
|
+
files: column.text,
|
|
36
|
+
summary: column.text,
|
|
37
|
+
}, {
|
|
38
|
+
indexes: {
|
|
39
|
+
note_home_order: ["is_del", "type", "is_top", "updated_at", "created_at", "id"],
|
|
40
|
+
note_active_updated_order: ["is_del", "updated_at", "created_at", "id"],
|
|
41
|
+
note_active_created_order: ["is_del", "created_at", "updated_at", "id"],
|
|
42
|
+
note_resource_active_updated: ["resource_id", "is_del", "updated_at", "id"],
|
|
43
|
+
note_starred_drawer_order: ["is_del", "starred_at", "updated_at", "created_at", "id"],
|
|
44
|
+
note_pinned_order: ["is_del", "is_top", "pinned_at", "updated_at", "created_at", "id"],
|
|
45
|
+
},
|
|
46
|
+
trackPrevious: { columns: ["title", "content_md", "tags", "zettel_boxes", "properties", "extra_data", "summary", "comments", "type", "status", "is_del", "is_top", "pinned_at", "starred_at"], onlyWhenChanged: true },
|
|
47
|
+
});
|
|
48
|
+
export const c_note_embed = new Table({
|
|
49
|
+
note_id: column.text,
|
|
50
|
+
type: column.integer,
|
|
51
|
+
content: column.text,
|
|
52
|
+
chunk_index: column.integer,
|
|
53
|
+
zettelbox_ids: column.text,
|
|
54
|
+
user_id: column.text,
|
|
55
|
+
tags: column.text,
|
|
56
|
+
created_at: column.text,
|
|
57
|
+
updated_at: column.text,
|
|
58
|
+
}, {
|
|
59
|
+
indexes: {
|
|
60
|
+
note_embed_note_chunk: ["note_id", "type", "chunk_index", "id"],
|
|
61
|
+
note_embed_user_updated: ["user_id", "updated_at", "id"],
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
export const c_card_box = new Table({
|
|
65
|
+
name: column.text,
|
|
66
|
+
type: column.text,
|
|
67
|
+
cover_url: column.text,
|
|
68
|
+
prompt: column.text,
|
|
69
|
+
headers: column.text,
|
|
70
|
+
priority: column.integer,
|
|
71
|
+
created_at: column.text,
|
|
72
|
+
updated_at: column.text,
|
|
73
|
+
extra_data: column.text,
|
|
74
|
+
user_no: column.text,
|
|
75
|
+
is_del: column.integer,
|
|
76
|
+
template_id: column.text,
|
|
77
|
+
}, {
|
|
78
|
+
indexes: {
|
|
79
|
+
card_box_user_active_priority: ["user_no", "is_del", "priority", "updated_at", "id"],
|
|
80
|
+
card_box_template_lookup: ["template_id", "is_del", "id"],
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
export const c_card_note = new Table({
|
|
84
|
+
box_id: column.text,
|
|
85
|
+
content: column.text,
|
|
86
|
+
created_at: column.text,
|
|
87
|
+
updated_at: column.text,
|
|
88
|
+
extra_data: column.text,
|
|
89
|
+
user_no: column.text,
|
|
90
|
+
is_del: column.integer,
|
|
91
|
+
origin_note_id: column.text,
|
|
92
|
+
origin_type: column.text,
|
|
93
|
+
output_type: column.text,
|
|
94
|
+
is_array: column.integer,
|
|
95
|
+
}, {
|
|
96
|
+
indexes: {
|
|
97
|
+
card_note_box_updated: ["box_id", "is_del", "updated_at", "id"],
|
|
98
|
+
card_note_origin: ["origin_note_id", "origin_type", "is_del", "updated_at", "id"],
|
|
99
|
+
card_note_user_updated: ["user_no", "is_del", "updated_at", "id"],
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
export const c_cmd = new Table({
|
|
103
|
+
zone: column.text,
|
|
104
|
+
type: column.text,
|
|
105
|
+
cmd: column.text,
|
|
106
|
+
name: column.text,
|
|
107
|
+
priority: column.integer,
|
|
108
|
+
is_show: column.integer,
|
|
109
|
+
description: column.text,
|
|
110
|
+
extra_data: column.text,
|
|
111
|
+
user_id: column.text,
|
|
112
|
+
insert_at: column.text,
|
|
113
|
+
update_at: column.text,
|
|
114
|
+
is_del: column.integer,
|
|
115
|
+
template_id: column.text,
|
|
116
|
+
meta_data: column.text,
|
|
117
|
+
output: column.text,
|
|
118
|
+
output_param: column.text,
|
|
119
|
+
category: column.text,
|
|
120
|
+
}, {
|
|
121
|
+
indexes: {
|
|
122
|
+
cmd_user_zone_priority: ["user_id", "zone", "is_del", "priority", "id"],
|
|
123
|
+
cmd_zone_show_priority: ["zone", "is_show", "is_del", "priority", "id"],
|
|
124
|
+
cmd_category_priority: ["category", "is_del", "priority", "id"],
|
|
125
|
+
cmd_template_lookup: ["template_id", "is_del", "id"],
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
export const c_note_template = new Table({
|
|
129
|
+
content: column.text,
|
|
130
|
+
name: column.text,
|
|
131
|
+
priority: column.integer,
|
|
132
|
+
is_show: column.integer,
|
|
133
|
+
extra_data: column.text,
|
|
134
|
+
property_def: column.text,
|
|
135
|
+
user_id: column.text,
|
|
136
|
+
insert_at: column.text,
|
|
137
|
+
update_at: column.text,
|
|
138
|
+
is_del: column.integer,
|
|
139
|
+
}, {
|
|
140
|
+
indexes: {
|
|
141
|
+
note_template_user_show_priority: ["user_id", "is_show", "is_del", "priority", "id"],
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
export const c_tag_node = new Table({
|
|
145
|
+
user_id: column.text,
|
|
146
|
+
emoji: column.text,
|
|
147
|
+
full_path: column.text,
|
|
148
|
+
path_key: column.text,
|
|
149
|
+
parent_id: column.text,
|
|
150
|
+
depth: column.integer,
|
|
151
|
+
is_actual: column.integer,
|
|
152
|
+
is_del: column.integer,
|
|
153
|
+
created_at: column.text,
|
|
154
|
+
updated_at: column.text,
|
|
155
|
+
meta: column.text,
|
|
156
|
+
}, {
|
|
157
|
+
indexes: {
|
|
158
|
+
tag_node_user_active: ["user_id", "is_del", "updated_at", "id"],
|
|
159
|
+
tag_node_path_lookup: ["user_id", "path_key", "is_del", "id"],
|
|
160
|
+
tag_node_parent_order: ["user_id", "parent_id", "is_del", "depth", "full_path", "id"],
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
export const c_tag_preference = new Table({
|
|
164
|
+
user_id: column.text,
|
|
165
|
+
tag_id: column.text,
|
|
166
|
+
is_favorite: column.integer,
|
|
167
|
+
is_expanded: column.integer,
|
|
168
|
+
pinned_at: column.text,
|
|
169
|
+
sort_rank: column.integer,
|
|
170
|
+
pinned_rank: column.integer,
|
|
171
|
+
created_at: column.text,
|
|
172
|
+
updated_at: column.text,
|
|
173
|
+
}, {
|
|
174
|
+
indexes: {
|
|
175
|
+
tag_preference_user_tag: ["user_id", "tag_id", "id"],
|
|
176
|
+
tag_preference_favorite: ["user_id", "is_favorite", "pinned_rank", "pinned_at", "id"],
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
export const c_user_config = new Table({
|
|
180
|
+
config: column.text,
|
|
181
|
+
memory: column.text,
|
|
182
|
+
extra_data: column.text,
|
|
183
|
+
is_del: column.integer,
|
|
184
|
+
hot_words: column.text,
|
|
185
|
+
}, {
|
|
186
|
+
indexes: {
|
|
187
|
+
user_config_active: ["is_del", "id"],
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
export const c_hotword = new Table({
|
|
191
|
+
user_id: column.text,
|
|
192
|
+
word: column.text,
|
|
193
|
+
normalized_word: column.text,
|
|
194
|
+
created_at: column.text,
|
|
195
|
+
updated_at: column.text,
|
|
196
|
+
deleted_at: column.text,
|
|
197
|
+
}, {
|
|
198
|
+
indexes: {
|
|
199
|
+
hotword_user_active: ["user_id", "deleted_at", "updated_at", "id"],
|
|
200
|
+
hotword_user_word_lookup: ["user_id", "deleted_at", "word", "id"],
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
export const c_zettel_box = new Table({
|
|
204
|
+
name: column.text,
|
|
205
|
+
path: column.text,
|
|
206
|
+
parent_id: column.text,
|
|
207
|
+
description: column.text,
|
|
208
|
+
color: column.text,
|
|
209
|
+
priority: column.integer,
|
|
210
|
+
is_show: column.integer,
|
|
211
|
+
cover_url: column.text,
|
|
212
|
+
created_at: column.text,
|
|
213
|
+
updated_at: column.text,
|
|
214
|
+
pinned_at: column.text,
|
|
215
|
+
extra_data: column.text,
|
|
216
|
+
user_no: column.text,
|
|
217
|
+
is_del: column.integer,
|
|
218
|
+
}, {
|
|
219
|
+
indexes: {
|
|
220
|
+
zettel_box_user_active_priority: ["user_no", "is_del", "pinned_at", "priority", "updated_at", "id"],
|
|
221
|
+
zettel_box_parent_priority: ["parent_id", "is_del", "priority", "id"],
|
|
222
|
+
zettel_box_path_lookup: ["path", "is_del", "id"],
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
export const c_project = new Table({
|
|
226
|
+
name: column.text,
|
|
227
|
+
description: column.text,
|
|
228
|
+
created_at: column.text,
|
|
229
|
+
updated_at: column.text,
|
|
230
|
+
user_id: column.text,
|
|
231
|
+
agent_md: column.text,
|
|
232
|
+
memory: column.text,
|
|
233
|
+
meta_data: column.text,
|
|
234
|
+
priority: column.integer,
|
|
235
|
+
is_del: column.integer,
|
|
236
|
+
is_default: column.integer,
|
|
237
|
+
type: column.text,
|
|
238
|
+
system_agent_key: column.text,
|
|
239
|
+
skills: column.text,
|
|
240
|
+
references: column.text,
|
|
241
|
+
robot_id: column.text,
|
|
242
|
+
emoji: column.text,
|
|
243
|
+
tools: column.text,
|
|
244
|
+
}, {
|
|
245
|
+
indexes: {
|
|
246
|
+
project_user_active_updated: ["user_id", "is_del", "updated_at", "id"],
|
|
247
|
+
project_default_user: ["user_id", "is_default", "is_del", "updated_at", "id"],
|
|
248
|
+
project_system_agent_lookup: ["user_id", "system_agent_key", "is_del", "updated_at", "id"],
|
|
249
|
+
project_robot_lookup: ["robot_id", "is_del", "updated_at", "id"],
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
export const c_project_item = new Table({
|
|
253
|
+
project_id: column.text,
|
|
254
|
+
kind: column.text,
|
|
255
|
+
ref_id: column.text,
|
|
256
|
+
rank: column.integer,
|
|
257
|
+
is_check: column.integer,
|
|
258
|
+
created_at: column.text,
|
|
259
|
+
updated_at: column.text,
|
|
260
|
+
user_id: column.text,
|
|
261
|
+
meta_data: column.text,
|
|
262
|
+
payload: column.text,
|
|
263
|
+
pinned_at: column.text,
|
|
264
|
+
dedupe_key: column.text,
|
|
265
|
+
is_del: column.integer,
|
|
266
|
+
}, {
|
|
267
|
+
indexes: {
|
|
268
|
+
project_item_checked_rank: ["project_id", "is_check", "is_del", "rank", "updated_at", "id"],
|
|
269
|
+
project_item_ref_lookup: ["kind", "ref_id", "is_del", "project_id"],
|
|
270
|
+
project_item_dedupe: ["project_id", "kind", "dedupe_key", "is_del"],
|
|
271
|
+
project_item_user_updated: ["user_id", "is_del", "updated_at", "id"],
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
export const c_thread = new Table({
|
|
275
|
+
name: column.text,
|
|
276
|
+
kind: column.text,
|
|
277
|
+
messages: column.text,
|
|
278
|
+
user_id: column.text,
|
|
279
|
+
project_id: column.text,
|
|
280
|
+
last_opened_at: column.text,
|
|
281
|
+
created_at: column.text,
|
|
282
|
+
updated_at: column.text,
|
|
283
|
+
pinned_at: column.text,
|
|
284
|
+
sort_order: column.integer,
|
|
285
|
+
meta_data: column.text,
|
|
286
|
+
cmd_id: column.text,
|
|
287
|
+
filter_condition: column.text,
|
|
288
|
+
config: column.text,
|
|
289
|
+
snapshot: column.text,
|
|
290
|
+
memory: column.text,
|
|
291
|
+
is_del: column.integer,
|
|
292
|
+
robot_session_id: column.text,
|
|
293
|
+
compact_context: column.text,
|
|
294
|
+
}, {
|
|
295
|
+
indexes: {
|
|
296
|
+
thread_project: ["project_id", "is_del"],
|
|
297
|
+
thread_user: ["user_id", "is_del"],
|
|
298
|
+
thread_active_updated_order: ["is_del", "kind", "updated_at", "created_at", "id"],
|
|
299
|
+
thread_pinned_updated_order: ["is_del", "pinned_at", "updated_at", "created_at", "id"],
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
export const c_chat_message = new Table({
|
|
303
|
+
role: column.text,
|
|
304
|
+
type: column.text,
|
|
305
|
+
entry_type: column.text,
|
|
306
|
+
source_id: column.text,
|
|
307
|
+
parent_id: column.text,
|
|
308
|
+
content: column.text,
|
|
309
|
+
responser_id: column.text,
|
|
310
|
+
created_at: column.text,
|
|
311
|
+
updated_at: column.text,
|
|
312
|
+
order_index: column.integer,
|
|
313
|
+
deleted_at: column.text,
|
|
314
|
+
meta_data: column.text,
|
|
315
|
+
anchor_type: column.text,
|
|
316
|
+
anchor_id: column.text,
|
|
317
|
+
anchor_source: column.text,
|
|
318
|
+
anchor_meta_data: column.text,
|
|
319
|
+
version: column.text,
|
|
320
|
+
user_id: column.text,
|
|
321
|
+
}, {
|
|
322
|
+
indexes: {
|
|
323
|
+
chat_message_thread_parent: ["type", "source_id", "parent_id", "deleted_at", "created_at", "id"],
|
|
324
|
+
chat_message_thread_order: ["type", "source_id", "deleted_at", "order_index", "created_at", "id"],
|
|
325
|
+
chat_message_type_deleted_updated: ["type", "deleted_at", "updated_at", "id"],
|
|
326
|
+
chat_message_type_deleted_source: ["type", "deleted_at", "source_id", "id"],
|
|
327
|
+
chat_message_anchor_lookup: ["anchor_type", "anchor_id", "deleted_at", "updated_at", "id"],
|
|
328
|
+
},
|
|
329
|
+
});
|
|
330
|
+
export const c_resource = new Table({
|
|
331
|
+
user_id: column.text,
|
|
332
|
+
name: column.text,
|
|
333
|
+
mime_type: column.text,
|
|
334
|
+
size_bytes: column.integer,
|
|
335
|
+
storage_config_id: column.text,
|
|
336
|
+
storage_key: column.text,
|
|
337
|
+
storage_url: column.text,
|
|
338
|
+
storage_provider: column.text,
|
|
339
|
+
bucket: column.text,
|
|
340
|
+
is_public: column.integer,
|
|
341
|
+
created_at: column.text,
|
|
342
|
+
updated_at: column.text,
|
|
343
|
+
is_del: column.integer,
|
|
344
|
+
status: column.text,
|
|
345
|
+
uploaded_at: column.text,
|
|
346
|
+
etag: column.text,
|
|
347
|
+
checksum: column.text,
|
|
348
|
+
category: column.text,
|
|
349
|
+
width: column.integer,
|
|
350
|
+
height: column.integer,
|
|
351
|
+
duration: column.integer,
|
|
352
|
+
endpoint: column.text,
|
|
353
|
+
domain: column.text,
|
|
354
|
+
extra_data: column.text,
|
|
355
|
+
deleted_at: column.text,
|
|
356
|
+
content_sha256: column.text,
|
|
357
|
+
content: column.text,
|
|
358
|
+
content_md: column.text,
|
|
359
|
+
summary: column.text,
|
|
360
|
+
}, {
|
|
361
|
+
indexes: {
|
|
362
|
+
resource_storage_key: ["storage_key", "is_del", "id"],
|
|
363
|
+
resource_storage_url: ["storage_url", "id"],
|
|
364
|
+
resource_checksum: ["checksum", "id"],
|
|
365
|
+
resource_pending_created: ["status", "is_del", "created_at", "id"],
|
|
366
|
+
resource_active_updated: ["is_del", "deleted_at", "updated_at", "created_at", "id"],
|
|
367
|
+
resource_category_updated: ["category", "is_del", "deleted_at", "updated_at", "id"],
|
|
368
|
+
},
|
|
369
|
+
});
|
|
370
|
+
export const c_note_link = new Table({
|
|
371
|
+
user_id: column.text,
|
|
372
|
+
src_note_id: column.text,
|
|
373
|
+
src_block_id: column.text,
|
|
374
|
+
dst_note_id: column.text,
|
|
375
|
+
dst_block_id: column.text,
|
|
376
|
+
relation: column.text,
|
|
377
|
+
meta_data: column.text,
|
|
378
|
+
created_at: column.text,
|
|
379
|
+
updated_at: column.text,
|
|
380
|
+
is_del: column.integer,
|
|
381
|
+
}, {
|
|
382
|
+
indexes: {
|
|
383
|
+
note_link_src_user: ["src_note_id", "user_id", "is_del", "relation", "updated_at", "id"],
|
|
384
|
+
note_link_dst_user: ["dst_note_id", "user_id", "is_del", "relation", "updated_at", "id"],
|
|
385
|
+
},
|
|
386
|
+
});
|
|
387
|
+
export const c_robot = new Table({
|
|
388
|
+
name: column.text,
|
|
389
|
+
device_id: column.text,
|
|
390
|
+
device_name: column.text,
|
|
391
|
+
agent_type: column.text,
|
|
392
|
+
cwd: column.text,
|
|
393
|
+
config: column.text,
|
|
394
|
+
meta_data: column.text,
|
|
395
|
+
created_at: column.text,
|
|
396
|
+
updated_at: column.text,
|
|
397
|
+
user_id: column.text,
|
|
398
|
+
is_del: column.integer,
|
|
399
|
+
}, {
|
|
400
|
+
indexes: {
|
|
401
|
+
robot_device: ["device_id", "is_del"],
|
|
402
|
+
robot_user: ["user_id", "is_del"],
|
|
403
|
+
robot_agent: ["agent_type", "is_del"],
|
|
404
|
+
},
|
|
405
|
+
});
|
|
406
|
+
export const c_note_history = new Table({
|
|
407
|
+
note_id: column.text,
|
|
408
|
+
version: column.integer,
|
|
409
|
+
title: column.text,
|
|
410
|
+
content_html: column.text,
|
|
411
|
+
content_md: column.text,
|
|
412
|
+
content_json: column.text,
|
|
413
|
+
tags: column.text,
|
|
414
|
+
zettel_boxes: column.text,
|
|
415
|
+
content_hash: column.text,
|
|
416
|
+
source: column.text,
|
|
417
|
+
meta_data: column.text,
|
|
418
|
+
created_at: column.text,
|
|
419
|
+
updated_at: column.text,
|
|
420
|
+
is_del: column.integer,
|
|
421
|
+
}, {
|
|
422
|
+
localOnly: true,
|
|
423
|
+
indexes: {
|
|
424
|
+
note_history_note_version: ["note_id", "version", "created_at", "id"],
|
|
425
|
+
note_history_note_created: ["note_id", "created_at", "id"],
|
|
426
|
+
},
|
|
427
|
+
});
|
|
428
|
+
export const note_local_history = new Table({
|
|
429
|
+
note_id: column.text,
|
|
430
|
+
title: column.text,
|
|
431
|
+
content_json: column.text,
|
|
432
|
+
content_text: column.text,
|
|
433
|
+
content_md: column.text,
|
|
434
|
+
tags: column.text,
|
|
435
|
+
zettel_boxes: column.text,
|
|
436
|
+
images: column.text,
|
|
437
|
+
snapshot_reason: column.text,
|
|
438
|
+
snapshot_hash: column.text,
|
|
439
|
+
client_id: column.text,
|
|
440
|
+
user_id: column.text,
|
|
441
|
+
created_at: column.text,
|
|
442
|
+
expires_at: column.text,
|
|
443
|
+
restored_at: column.text,
|
|
444
|
+
meta: column.text,
|
|
445
|
+
}, {
|
|
446
|
+
localOnly: true,
|
|
447
|
+
indexes: {
|
|
448
|
+
note_local_history_note_created: ["note_id", "created_at", "id"],
|
|
449
|
+
note_local_history_expires: ["expires_at", "id"],
|
|
450
|
+
},
|
|
451
|
+
});
|
|
452
|
+
export const c_sync_error_local = new Table({
|
|
453
|
+
transaction_id: column.integer,
|
|
454
|
+
error_code: column.text,
|
|
455
|
+
message: column.text,
|
|
456
|
+
first_table: column.text,
|
|
457
|
+
first_row_id: column.text,
|
|
458
|
+
operation_count: column.integer,
|
|
459
|
+
payload_json: column.text,
|
|
460
|
+
created_at: column.text,
|
|
461
|
+
updated_at: column.text,
|
|
462
|
+
resolved_at: column.text,
|
|
463
|
+
status: column.text,
|
|
464
|
+
}, {
|
|
465
|
+
localOnly: true,
|
|
466
|
+
indexes: {
|
|
467
|
+
sync_error_created_lookup: ["created_at", "id"],
|
|
468
|
+
sync_error_status_lookup: ["status", "updated_at", "id"],
|
|
469
|
+
sync_error_table_lookup: ["first_table", "created_at", "id"],
|
|
470
|
+
},
|
|
471
|
+
});
|
|
472
|
+
export const c_user_config_advanced = new Table({
|
|
473
|
+
created_at: column.text,
|
|
474
|
+
updated_at: column.text,
|
|
475
|
+
extra_data: column.text,
|
|
476
|
+
s3_config: column.text,
|
|
477
|
+
global_memory_config: column.text,
|
|
478
|
+
mcp_servers: column.text,
|
|
479
|
+
is_del: column.integer,
|
|
480
|
+
user_id: column.text,
|
|
481
|
+
}, {
|
|
482
|
+
indexes: {
|
|
483
|
+
user_config_advanced_user_active: ["user_id", "is_del", "updated_at", "id"],
|
|
484
|
+
},
|
|
485
|
+
});
|
|
486
|
+
export const c_mcp_server = new Table({
|
|
487
|
+
user_id: column.text,
|
|
488
|
+
name: column.text,
|
|
489
|
+
description: column.text,
|
|
490
|
+
registry_id: column.text,
|
|
491
|
+
schema_version: column.integer,
|
|
492
|
+
config: column.text,
|
|
493
|
+
enabled: column.integer,
|
|
494
|
+
sort_rank: column.integer,
|
|
495
|
+
properties: column.text,
|
|
496
|
+
created_at: column.text,
|
|
497
|
+
updated_at: column.text,
|
|
498
|
+
is_del: column.integer,
|
|
499
|
+
}, {
|
|
500
|
+
indexes: {
|
|
501
|
+
mcp_server_user_enabled: ["user_id", "is_del", "enabled", "sort_rank", "updated_at", "id"],
|
|
502
|
+
mcp_server_user_registry: ["user_id", "is_del", "registry_id", "id"],
|
|
503
|
+
mcp_server_user_updated: ["user_id", "is_del", "updated_at", "id"],
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
export const c_config_property = new Table({
|
|
507
|
+
c_key: column.text,
|
|
508
|
+
c_value: column.text,
|
|
509
|
+
created_at: column.text,
|
|
510
|
+
updated_at: column.text,
|
|
511
|
+
is_del: column.integer,
|
|
512
|
+
user_id: column.text,
|
|
513
|
+
description: column.text,
|
|
514
|
+
}, {
|
|
515
|
+
indexes: {
|
|
516
|
+
config_key_lookup: ["c_key", "is_del", "updated_at"],
|
|
517
|
+
config_key_user_lookup: ["c_key", "user_id", "is_del", "updated_at", "id"],
|
|
518
|
+
},
|
|
519
|
+
});
|
|
520
|
+
export const c_property_def = new Table({
|
|
521
|
+
user_id: column.text,
|
|
522
|
+
key: column.text,
|
|
523
|
+
name: column.text,
|
|
524
|
+
type: column.text,
|
|
525
|
+
options: column.text,
|
|
526
|
+
description: column.text,
|
|
527
|
+
icon: column.text,
|
|
528
|
+
sort_rank: column.integer,
|
|
529
|
+
show_on_card: column.integer,
|
|
530
|
+
source: column.text,
|
|
531
|
+
created_at: column.text,
|
|
532
|
+
updated_at: column.text,
|
|
533
|
+
is_del: column.integer,
|
|
534
|
+
}, {
|
|
535
|
+
indexes: {
|
|
536
|
+
property_def_user_order: ["user_id", "is_del", "sort_rank", "created_at", "id"],
|
|
537
|
+
property_def_user_key: ["user_id", "key", "is_del", "updated_at", "id"],
|
|
538
|
+
},
|
|
539
|
+
});
|
|
540
|
+
export const c_saved_view = new Table({
|
|
541
|
+
user_id: column.text,
|
|
542
|
+
name: column.text,
|
|
543
|
+
emoji: column.text,
|
|
544
|
+
filter_json: column.text,
|
|
545
|
+
view_type: column.text,
|
|
546
|
+
config_json: column.text,
|
|
547
|
+
template_id: column.text,
|
|
548
|
+
group_id: column.text,
|
|
549
|
+
sort_rank: column.integer,
|
|
550
|
+
pinned_at: column.text,
|
|
551
|
+
created_at: column.text,
|
|
552
|
+
updated_at: column.text,
|
|
553
|
+
is_del: column.integer,
|
|
554
|
+
}, {
|
|
555
|
+
indexes: {
|
|
556
|
+
saved_view_user_order: ["user_id", "is_del", "sort_rank", "created_at", "id"],
|
|
557
|
+
saved_view_user_pinned: ["user_id", "is_del", "pinned_at", "sort_rank", "id"],
|
|
558
|
+
saved_view_user_group: ["user_id", "group_id", "is_del", "sort_rank", "id"],
|
|
559
|
+
},
|
|
560
|
+
});
|
|
561
|
+
export const c_local_config = new Table({
|
|
562
|
+
local_key: column.text,
|
|
563
|
+
local_value: column.text,
|
|
564
|
+
created_at: column.text,
|
|
565
|
+
updated_at: column.text,
|
|
566
|
+
is_del: column.integer,
|
|
567
|
+
description: column.text,
|
|
568
|
+
}, {
|
|
569
|
+
localOnly: true,
|
|
570
|
+
indexes: {
|
|
571
|
+
local_config_key_active: ["local_key", "is_del", "updated_at", "id"],
|
|
572
|
+
},
|
|
573
|
+
});
|
|
574
|
+
export const app_local_store = new Table({
|
|
575
|
+
namespace: column.text,
|
|
576
|
+
key: column.text,
|
|
577
|
+
value: column.text,
|
|
578
|
+
value_type: column.text,
|
|
579
|
+
expires_at: column.text,
|
|
580
|
+
metadata: column.text,
|
|
581
|
+
updated_at: column.text,
|
|
582
|
+
}, {
|
|
583
|
+
localOnly: true,
|
|
584
|
+
indexes: {
|
|
585
|
+
app_local_store_namespace_key: ["namespace", "key", "updated_at", "id"],
|
|
586
|
+
app_local_store_namespace: ["namespace", "updated_at", "id"],
|
|
587
|
+
app_local_store_expires: ["expires_at", "id"],
|
|
588
|
+
},
|
|
589
|
+
});
|
|
590
|
+
export const local_channel_account = new Table({
|
|
591
|
+
user_id: column.text,
|
|
592
|
+
platform: column.text,
|
|
593
|
+
account_id: column.text,
|
|
594
|
+
display_name: column.text,
|
|
595
|
+
status: column.text,
|
|
596
|
+
secret_ref: column.text,
|
|
597
|
+
capabilities_json: column.text,
|
|
598
|
+
state_json: column.text,
|
|
599
|
+
created_at: column.text,
|
|
600
|
+
updated_at: column.text,
|
|
601
|
+
is_del: column.integer,
|
|
602
|
+
}, {
|
|
603
|
+
localOnly: true,
|
|
604
|
+
indexes: {
|
|
605
|
+
channel_account_platform: ["platform", "account_id", "is_del"],
|
|
606
|
+
channel_account_user: ["user_id", "platform", "is_del"],
|
|
607
|
+
channel_account_user_platform_account: ["user_id", "platform", "account_id", "is_del", "updated_at", "id"],
|
|
608
|
+
},
|
|
609
|
+
});
|
|
610
|
+
export const local_channel_binding = new Table({
|
|
611
|
+
user_id: column.text,
|
|
612
|
+
platform: column.text,
|
|
613
|
+
account_id: column.text,
|
|
614
|
+
scope: column.text,
|
|
615
|
+
chat_id: column.text,
|
|
616
|
+
chat_type: column.text,
|
|
617
|
+
display_name: column.text,
|
|
618
|
+
thread_id: column.text,
|
|
619
|
+
routing_mode: column.text,
|
|
620
|
+
enabled: column.integer,
|
|
621
|
+
secret_ref: column.text,
|
|
622
|
+
state_json: column.text,
|
|
623
|
+
created_at: column.text,
|
|
624
|
+
updated_at: column.text,
|
|
625
|
+
is_del: column.integer,
|
|
626
|
+
}, {
|
|
627
|
+
localOnly: true,
|
|
628
|
+
indexes: {
|
|
629
|
+
channel_binding_account_scope: ["platform", "account_id", "scope", "is_del"],
|
|
630
|
+
channel_binding_chat: ["platform", "account_id", "chat_id", "is_del"],
|
|
631
|
+
channel_binding_thread: ["thread_id", "is_del"],
|
|
632
|
+
channel_binding_user_scope_chat: ["user_id", "platform", "account_id", "scope", "chat_id", "enabled", "is_del", "updated_at", "id"],
|
|
633
|
+
},
|
|
634
|
+
});
|
|
635
|
+
export const c_memory = new Table({
|
|
636
|
+
scope: column.text,
|
|
637
|
+
scope_id: column.text,
|
|
638
|
+
content: column.text,
|
|
639
|
+
category: column.text,
|
|
640
|
+
status: column.text,
|
|
641
|
+
source: column.text,
|
|
642
|
+
source_thread_id: column.text,
|
|
643
|
+
created_at: column.text,
|
|
644
|
+
updated_at: column.text,
|
|
645
|
+
access_count: column.integer,
|
|
646
|
+
is_pinned: column.integer,
|
|
647
|
+
is_del: column.integer,
|
|
648
|
+
user_id: column.text,
|
|
649
|
+
}, {
|
|
650
|
+
indexes: {
|
|
651
|
+
memory_scope_lookup: ["scope", "scope_id", "is_del", "is_pinned"],
|
|
652
|
+
memory_user_source_created: ["user_id", "source", "is_del", "created_at", "id"],
|
|
653
|
+
memory_user_scope_pinned: ["user_id", "scope", "is_del", "is_pinned", "updated_at", "id"],
|
|
654
|
+
memory_scope_updated: ["scope", "is_del", "updated_at", "id"],
|
|
655
|
+
},
|
|
656
|
+
});
|
|
657
|
+
export const c_storage = new Table({
|
|
658
|
+
user_id: column.text,
|
|
659
|
+
alias_name: column.text,
|
|
660
|
+
protocol: column.text,
|
|
661
|
+
provider: column.text,
|
|
662
|
+
is_active: column.integer,
|
|
663
|
+
sort_rank: column.integer,
|
|
664
|
+
endpoint: column.text,
|
|
665
|
+
bucket: column.text,
|
|
666
|
+
region: column.text,
|
|
667
|
+
access_key_id: column.text,
|
|
668
|
+
secret_access_key: column.text,
|
|
669
|
+
force_path_style: column.integer,
|
|
670
|
+
path_prefix: column.text,
|
|
671
|
+
custom_domain: column.text,
|
|
672
|
+
legacy_domains: column.text,
|
|
673
|
+
is_private: column.integer,
|
|
674
|
+
extra_config: column.text,
|
|
675
|
+
created_at: column.text,
|
|
676
|
+
updated_at: column.text,
|
|
677
|
+
deleted_at: column.text,
|
|
678
|
+
}, {
|
|
679
|
+
indexes: {
|
|
680
|
+
storage_user_protocol: ["user_id", "protocol", "deleted_at", "sort_rank"],
|
|
681
|
+
storage_protocol_active_rank: ["protocol", "deleted_at", "sort_rank", "updated_at", "id"],
|
|
682
|
+
storage_user_active_rank: ["user_id", "deleted_at", "is_active", "sort_rank", "id"],
|
|
683
|
+
},
|
|
684
|
+
});
|
|
685
|
+
export const c_scheduled_task = new Table({
|
|
686
|
+
user_id: column.text,
|
|
687
|
+
agent_id: column.text,
|
|
688
|
+
name: column.text,
|
|
689
|
+
description: column.text,
|
|
690
|
+
instruction: column.text,
|
|
691
|
+
status: column.text,
|
|
692
|
+
schedule_type: column.text,
|
|
693
|
+
schedule_config: column.text,
|
|
694
|
+
timezone: column.text,
|
|
695
|
+
next_run_at: column.text,
|
|
696
|
+
last_run_at: column.text,
|
|
697
|
+
last_run_id: column.text,
|
|
698
|
+
overlap_policy: column.text,
|
|
699
|
+
retry_limit: column.integer,
|
|
700
|
+
timeout_seconds: column.integer,
|
|
701
|
+
output_mode: column.text,
|
|
702
|
+
execution_config: column.text,
|
|
703
|
+
meta_data: column.text,
|
|
704
|
+
is_del: column.integer,
|
|
705
|
+
created_at: column.text,
|
|
706
|
+
updated_at: column.text,
|
|
707
|
+
deleted_at: column.text,
|
|
708
|
+
}, {
|
|
709
|
+
indexes: {
|
|
710
|
+
scheduled_task_user_status_next_run: ["user_id", "status", "next_run_at", "id"],
|
|
711
|
+
scheduled_task_agent_status: ["agent_id", "status", "updated_at", "id"],
|
|
712
|
+
scheduled_task_user_updated: ["user_id", "is_del", "updated_at", "id"],
|
|
713
|
+
},
|
|
714
|
+
});
|
|
715
|
+
export const c_inbox_item = new Table({
|
|
716
|
+
user_id: column.text,
|
|
717
|
+
source_type: column.text,
|
|
718
|
+
source_id: column.text,
|
|
719
|
+
content: column.text,
|
|
720
|
+
status: column.text,
|
|
721
|
+
meta_data: column.text,
|
|
722
|
+
note_id: column.text,
|
|
723
|
+
seen_at: column.text,
|
|
724
|
+
read_at: column.text,
|
|
725
|
+
created_at: column.text,
|
|
726
|
+
updated_at: column.text,
|
|
727
|
+
deleted_at: column.text,
|
|
728
|
+
}, {
|
|
729
|
+
indexes: {
|
|
730
|
+
inbox_item_user_status_created: ["user_id", "status", "created_at", "id"],
|
|
731
|
+
inbox_item_user_seen_created: ["user_id", "seen_at", "deleted_at", "created_at", "id"],
|
|
732
|
+
inbox_item_user_read_created: ["user_id", "read_at", "deleted_at", "created_at", "id"],
|
|
733
|
+
inbox_item_source_lookup: ["source_type", "source_id", "user_id", "id"],
|
|
734
|
+
inbox_item_note_lookup: ["note_id", "updated_at", "id"],
|
|
735
|
+
},
|
|
736
|
+
});
|
|
737
|
+
export const c_model_cache = new Table({
|
|
738
|
+
row_kind: column.text,
|
|
739
|
+
cache_version: column.integer,
|
|
740
|
+
provider_id: column.text,
|
|
741
|
+
provider_name: column.text,
|
|
742
|
+
npm_package: column.text,
|
|
743
|
+
api_url: column.text,
|
|
744
|
+
doc_url: column.text,
|
|
745
|
+
model_id: column.text,
|
|
746
|
+
display_name: column.text,
|
|
747
|
+
family: column.text,
|
|
748
|
+
context_window: column.integer,
|
|
749
|
+
max_output_tokens: column.integer,
|
|
750
|
+
release_date: column.text,
|
|
751
|
+
last_updated: column.text,
|
|
752
|
+
provider_count: column.integer,
|
|
753
|
+
model_count: column.integer,
|
|
754
|
+
cost: column.text,
|
|
755
|
+
properties: column.text,
|
|
756
|
+
etag: column.text,
|
|
757
|
+
fetched_at: column.text,
|
|
758
|
+
updated_at: column.text,
|
|
759
|
+
}, {
|
|
760
|
+
localOnly: true,
|
|
761
|
+
indexes: {
|
|
762
|
+
model_cache_kind_lookup: ["row_kind", "updated_at", "id"],
|
|
763
|
+
model_cache_provider_lookup: ["row_kind", "provider_id", "updated_at", "id"],
|
|
764
|
+
model_cache_model_lookup: ["row_kind", "provider_id", "model_id", "updated_at", "id"],
|
|
765
|
+
model_cache_kind_fetched: ["row_kind", "fetched_at", "provider_name", "display_name", "id"],
|
|
766
|
+
model_cache_model_fetched_provider: ["row_kind", "fetched_at", "provider_id", "release_date", "display_name", "model_id"],
|
|
767
|
+
},
|
|
768
|
+
});
|
|
769
|
+
export const c_runtime_model = new Table({
|
|
770
|
+
user_id: column.text,
|
|
771
|
+
provider_id: column.text,
|
|
772
|
+
provider_kind: column.text,
|
|
773
|
+
catalog_provider_id: column.text,
|
|
774
|
+
exposed_model_id: column.text,
|
|
775
|
+
canonical_model_key: column.text,
|
|
776
|
+
matched_catalog_provider_id: column.text,
|
|
777
|
+
matched_catalog_model_id: column.text,
|
|
778
|
+
display_name: column.text,
|
|
779
|
+
context_window: column.integer,
|
|
780
|
+
input_token_limit: column.integer,
|
|
781
|
+
max_output_tokens: column.integer,
|
|
782
|
+
capabilities: column.text,
|
|
783
|
+
cost: column.text,
|
|
784
|
+
resolution_source: column.text,
|
|
785
|
+
confidence: column.text,
|
|
786
|
+
user_overridden_fields: column.text,
|
|
787
|
+
source_updated_at: column.text,
|
|
788
|
+
created_at: column.text,
|
|
789
|
+
updated_at: column.text,
|
|
790
|
+
}, {
|
|
791
|
+
localOnly: true,
|
|
792
|
+
indexes: {
|
|
793
|
+
runtime_model_provider_lookup: ["user_id", "provider_id", "exposed_model_id", "updated_at", "id"],
|
|
794
|
+
runtime_model_catalog_lookup: ["matched_catalog_provider_id", "matched_catalog_model_id", "updated_at"],
|
|
795
|
+
runtime_model_confidence_lookup: ["user_id", "confidence", "updated_at"],
|
|
796
|
+
runtime_model_user_exposed_lookup: ["user_id", "exposed_model_id", "confidence", "updated_at", "id"],
|
|
797
|
+
},
|
|
798
|
+
});
|
|
799
|
+
export const c_ai_provider = new Table({
|
|
800
|
+
user_id: column.text,
|
|
801
|
+
name: column.text,
|
|
802
|
+
preset_key: column.text,
|
|
803
|
+
catalog_provider_id: column.text,
|
|
804
|
+
sdk_provider_id: column.text,
|
|
805
|
+
npm_package: column.text,
|
|
806
|
+
base_url: column.text,
|
|
807
|
+
api_key: column.text,
|
|
808
|
+
enabled: column.integer,
|
|
809
|
+
sort_rank: column.integer,
|
|
810
|
+
properties: column.text,
|
|
811
|
+
created_at: column.text,
|
|
812
|
+
updated_at: column.text,
|
|
813
|
+
is_del: column.integer,
|
|
814
|
+
}, {
|
|
815
|
+
indexes: {
|
|
816
|
+
ai_provider_user_enabled: ["user_id", "is_del", "enabled", "sort_rank", "updated_at", "id"],
|
|
817
|
+
ai_provider_user_updated: ["user_id", "is_del", "updated_at", "id"],
|
|
818
|
+
ai_provider_sdk_lookup: ["sdk_provider_id", "is_del", "updated_at", "id"],
|
|
819
|
+
ai_provider_npm_lookup: ["npm_package", "is_del", "updated_at", "id"],
|
|
820
|
+
},
|
|
821
|
+
});
|
|
822
|
+
export const c_ai_provider_model = new Table({
|
|
823
|
+
user_id: column.text,
|
|
824
|
+
provider_id: column.text,
|
|
825
|
+
model_id: column.text,
|
|
826
|
+
display_name: column.text,
|
|
827
|
+
enabled: column.integer,
|
|
828
|
+
sort_rank: column.integer,
|
|
829
|
+
context_window: column.integer,
|
|
830
|
+
max_output_tokens: column.integer,
|
|
831
|
+
source: column.text,
|
|
832
|
+
cost: column.text,
|
|
833
|
+
properties: column.text,
|
|
834
|
+
synced_at: column.text,
|
|
835
|
+
created_at: column.text,
|
|
836
|
+
updated_at: column.text,
|
|
837
|
+
is_del: column.integer,
|
|
838
|
+
}, {
|
|
839
|
+
indexes: {
|
|
840
|
+
ai_provider_model_provider_enabled: ["provider_id", "is_del", "enabled", "sort_rank", "updated_at", "id"],
|
|
841
|
+
ai_provider_model_user_updated: ["user_id", "is_del", "updated_at", "id"],
|
|
842
|
+
ai_provider_model_identity: ["provider_id", "model_id", "is_del"],
|
|
843
|
+
},
|
|
844
|
+
});
|
|
845
|
+
export const c_skill_index = new Table({
|
|
846
|
+
skill_key: column.text,
|
|
847
|
+
name: column.text,
|
|
848
|
+
description: column.text,
|
|
849
|
+
skill_file: column.text,
|
|
850
|
+
skill_dir: column.text,
|
|
851
|
+
real_skill_file: column.text,
|
|
852
|
+
real_skill_dir: column.text,
|
|
853
|
+
source: column.text,
|
|
854
|
+
root_path: column.text,
|
|
855
|
+
mounts_json: column.text,
|
|
856
|
+
frontmatter_json: column.text,
|
|
857
|
+
enabled: column.integer,
|
|
858
|
+
sort_order: column.integer,
|
|
859
|
+
allow_implicit_invocation: column.integer,
|
|
860
|
+
status: column.text,
|
|
861
|
+
content_sha256: column.text,
|
|
862
|
+
file_mtime_ms: column.integer,
|
|
863
|
+
error_message: column.text,
|
|
864
|
+
discovered_at: column.text,
|
|
865
|
+
last_seen_at: column.text,
|
|
866
|
+
updated_at: column.text,
|
|
867
|
+
}, {
|
|
868
|
+
localOnly: true,
|
|
869
|
+
indexes: {
|
|
870
|
+
skill_index_key: ["skill_key", "status", "updated_at"],
|
|
871
|
+
skill_index_status: ["status", "enabled", "sort_order", "name"],
|
|
872
|
+
skill_index_source: ["source", "status", "name"],
|
|
873
|
+
},
|
|
874
|
+
});
|
|
875
|
+
export const local_project_skill = new Table({
|
|
876
|
+
project_id: column.text,
|
|
877
|
+
skill_key: column.text,
|
|
878
|
+
sort_order: column.integer,
|
|
879
|
+
created_at: column.text,
|
|
880
|
+
updated_at: column.text,
|
|
881
|
+
}, {
|
|
882
|
+
localOnly: true,
|
|
883
|
+
indexes: {
|
|
884
|
+
local_project_skill_project: ["project_id", "sort_order", "skill_key", "id"],
|
|
885
|
+
local_project_skill_dedupe: ["project_id", "skill_key"],
|
|
886
|
+
local_project_skill_key: ["skill_key", "project_id"],
|
|
887
|
+
},
|
|
888
|
+
});
|
|
889
|
+
export const local_audit_event = new Table({
|
|
890
|
+
thread_id: column.text,
|
|
891
|
+
actor_type: column.text,
|
|
892
|
+
actor_id: column.text,
|
|
893
|
+
source: column.text,
|
|
894
|
+
tool_name: column.text,
|
|
895
|
+
tool_call_id: column.text,
|
|
896
|
+
title: column.text,
|
|
897
|
+
status: column.text,
|
|
898
|
+
coalesce_key: column.text,
|
|
899
|
+
started_at: column.text,
|
|
900
|
+
ended_at: column.text,
|
|
901
|
+
created_at: column.text,
|
|
902
|
+
applied_at: column.text,
|
|
903
|
+
metadata_json: column.text,
|
|
904
|
+
}, {
|
|
905
|
+
localOnly: true,
|
|
906
|
+
indexes: {
|
|
907
|
+
audit_event_thread_created: ["thread_id", "created_at", "id"],
|
|
908
|
+
audit_event_coalesce: ["coalesce_key", "status", "ended_at", "id"],
|
|
909
|
+
audit_event_source_created: ["source", "created_at", "id"],
|
|
910
|
+
audit_event_status_applied: ["status", "applied_at", "id"],
|
|
911
|
+
},
|
|
912
|
+
});
|
|
913
|
+
export const local_audit_row_change = new Table({
|
|
914
|
+
event_id: column.text,
|
|
915
|
+
thread_id: column.text,
|
|
916
|
+
table_name: column.text,
|
|
917
|
+
row_id: column.text,
|
|
918
|
+
operation: column.text,
|
|
919
|
+
before_blob_id: column.text,
|
|
920
|
+
after_blob_id: column.text,
|
|
921
|
+
before_hash: column.text,
|
|
922
|
+
after_hash: column.text,
|
|
923
|
+
changed_columns_json: column.text,
|
|
924
|
+
summary: column.text,
|
|
925
|
+
status: column.text,
|
|
926
|
+
created_at: column.text,
|
|
927
|
+
restored_at: column.text,
|
|
928
|
+
}, {
|
|
929
|
+
localOnly: true,
|
|
930
|
+
indexes: {
|
|
931
|
+
audit_row_change_event: ["event_id", "created_at", "id"],
|
|
932
|
+
audit_row_change_row: ["table_name", "row_id", "created_at", "id"],
|
|
933
|
+
audit_row_change_table_created: ["table_name", "created_at", "id"],
|
|
934
|
+
audit_row_change_thread: ["thread_id", "created_at", "id"],
|
|
935
|
+
audit_row_change_created: ["created_at", "id"],
|
|
936
|
+
audit_row_change_before_blob: ["before_blob_id", "id"],
|
|
937
|
+
audit_row_change_after_blob: ["after_blob_id", "id"],
|
|
938
|
+
},
|
|
939
|
+
});
|
|
940
|
+
export const local_audit_blob = new Table({
|
|
941
|
+
content_hash: column.text,
|
|
942
|
+
content_type: column.text,
|
|
943
|
+
storage_kind: column.text,
|
|
944
|
+
inline_text: column.text,
|
|
945
|
+
object_path: column.text,
|
|
946
|
+
byte_size: column.integer,
|
|
947
|
+
created_at: column.text,
|
|
948
|
+
}, {
|
|
949
|
+
localOnly: true,
|
|
950
|
+
indexes: {
|
|
951
|
+
audit_blob_hash: ["content_hash", "created_at", "id"],
|
|
952
|
+
audit_blob_created: ["created_at", "id"],
|
|
953
|
+
},
|
|
954
|
+
});
|
|
955
|
+
export const local_thread_run = new Table({
|
|
956
|
+
thread_id: column.text,
|
|
957
|
+
user_id: column.text,
|
|
958
|
+
status: column.text,
|
|
959
|
+
trigger: column.text,
|
|
960
|
+
user_message_id: column.text,
|
|
961
|
+
assistant_message_id: column.text,
|
|
962
|
+
parent_message_id: column.text,
|
|
963
|
+
queued_at: column.text,
|
|
964
|
+
started_at: column.text,
|
|
965
|
+
finished_at: column.text,
|
|
966
|
+
error_text: column.text,
|
|
967
|
+
model_ref: column.text,
|
|
968
|
+
cmd_id: column.text,
|
|
969
|
+
permission_mode: column.text,
|
|
970
|
+
request_payload_json: column.text,
|
|
971
|
+
assistant_snapshot_json: column.text,
|
|
972
|
+
tool_approval_id: column.text,
|
|
973
|
+
queue_index: column.integer,
|
|
974
|
+
finalizing_at: column.text,
|
|
975
|
+
last_heartbeat_at: column.text,
|
|
976
|
+
expires_at: column.text,
|
|
977
|
+
cleanup_after_at: column.text,
|
|
978
|
+
stream_finish_reason: column.text,
|
|
979
|
+
interrupted_by_message_id: column.text,
|
|
980
|
+
usage_json: column.text,
|
|
981
|
+
context_trace_json: column.text,
|
|
982
|
+
created_at: column.text,
|
|
983
|
+
updated_at: column.text,
|
|
984
|
+
}, {
|
|
985
|
+
localOnly: true,
|
|
986
|
+
indexes: {
|
|
987
|
+
local_thread_run_thread_status: ["thread_id", "status", "queue_index", "id"],
|
|
988
|
+
local_thread_run_status_queue: ["status", "queued_at", "queue_index", "id"],
|
|
989
|
+
local_thread_run_status_finished: ["status", "finished_at", "id"],
|
|
990
|
+
local_thread_run_thread_finished: ["thread_id", "status", "finished_at", "id"],
|
|
991
|
+
local_thread_run_assistant_message: ["assistant_message_id", "id"],
|
|
992
|
+
local_thread_run_thread_approval: ["thread_id", "status", "tool_approval_id", "queue_index", "queued_at", "id"],
|
|
993
|
+
local_thread_run_status_heartbeat: ["status", "last_heartbeat_at", "id"],
|
|
994
|
+
local_thread_run_status_cleanup: ["status", "cleanup_after_at", "updated_at", "id"],
|
|
995
|
+
local_thread_run_status_expires: ["status", "expires_at", "id"],
|
|
996
|
+
},
|
|
997
|
+
});
|
|
998
|
+
export const local_thread_tool_approval = new Table({
|
|
999
|
+
run_id: column.text,
|
|
1000
|
+
thread_id: column.text,
|
|
1001
|
+
user_id: column.text,
|
|
1002
|
+
assistant_message_id: column.text,
|
|
1003
|
+
approval_id: column.text,
|
|
1004
|
+
tool_call_id: column.text,
|
|
1005
|
+
tool_name: column.text,
|
|
1006
|
+
tool_id: column.text,
|
|
1007
|
+
input_hash: column.text,
|
|
1008
|
+
input_json: column.text,
|
|
1009
|
+
session_json: column.text,
|
|
1010
|
+
status: column.text,
|
|
1011
|
+
reason: column.text,
|
|
1012
|
+
requested_at: column.text,
|
|
1013
|
+
expires_at: column.text,
|
|
1014
|
+
decided_at: column.text,
|
|
1015
|
+
consumed_at: column.text,
|
|
1016
|
+
created_at: column.text,
|
|
1017
|
+
updated_at: column.text,
|
|
1018
|
+
}, {
|
|
1019
|
+
localOnly: true,
|
|
1020
|
+
indexes: {
|
|
1021
|
+
local_thread_tool_approval_run_status: ["run_id", "status", "approval_id", "id"],
|
|
1022
|
+
local_thread_tool_approval_thread_status: ["thread_id", "status", "expires_at", "id"],
|
|
1023
|
+
local_thread_tool_approval_approval_status: ["approval_id", "status", "run_id", "id"],
|
|
1024
|
+
local_thread_tool_approval_tool_call: ["run_id", "tool_call_id", "id"],
|
|
1025
|
+
},
|
|
1026
|
+
});
|
|
1027
|
+
export const local_tool_permission_grant = new Table({
|
|
1028
|
+
user_id: column.text,
|
|
1029
|
+
tool_id: column.text,
|
|
1030
|
+
tool_name: column.text,
|
|
1031
|
+
scope: column.text,
|
|
1032
|
+
thread_id: column.text,
|
|
1033
|
+
project_id: column.text,
|
|
1034
|
+
granted_at: column.text,
|
|
1035
|
+
revoked_at: column.text,
|
|
1036
|
+
created_at: column.text,
|
|
1037
|
+
updated_at: column.text,
|
|
1038
|
+
}, {
|
|
1039
|
+
localOnly: true,
|
|
1040
|
+
indexes: {
|
|
1041
|
+
local_tool_permission_grant_lookup: ["user_id", "tool_id", "scope", "revoked_at", "id"],
|
|
1042
|
+
local_tool_permission_grant_thread: ["user_id", "tool_id", "thread_id", "revoked_at", "id"],
|
|
1043
|
+
local_tool_permission_grant_project: ["user_id", "tool_id", "project_id", "revoked_at", "id"],
|
|
1044
|
+
},
|
|
1045
|
+
});
|
|
1046
|
+
export const local_background_task = new Table({
|
|
1047
|
+
kind: column.text,
|
|
1048
|
+
version: column.integer,
|
|
1049
|
+
status: column.text,
|
|
1050
|
+
priority: column.integer,
|
|
1051
|
+
queue_index: column.integer,
|
|
1052
|
+
user_id: column.text,
|
|
1053
|
+
thread_id: column.text,
|
|
1054
|
+
run_id: column.text,
|
|
1055
|
+
assistant_message_id: column.text,
|
|
1056
|
+
tool_call_id: column.text,
|
|
1057
|
+
parent_task_id: column.text,
|
|
1058
|
+
group_id: column.text,
|
|
1059
|
+
idempotency_key: column.text,
|
|
1060
|
+
input_json: column.text,
|
|
1061
|
+
output_json: column.text,
|
|
1062
|
+
resource_ids_json: column.text,
|
|
1063
|
+
error_code: column.text,
|
|
1064
|
+
error_text: column.text,
|
|
1065
|
+
attempt_count: column.integer,
|
|
1066
|
+
max_attempts: column.integer,
|
|
1067
|
+
available_at: column.text,
|
|
1068
|
+
locked_by: column.text,
|
|
1069
|
+
locked_at: column.text,
|
|
1070
|
+
lease_until: column.text,
|
|
1071
|
+
queued_at: column.text,
|
|
1072
|
+
started_at: column.text,
|
|
1073
|
+
finished_at: column.text,
|
|
1074
|
+
cancelled_at: column.text,
|
|
1075
|
+
created_at: column.text,
|
|
1076
|
+
updated_at: column.text,
|
|
1077
|
+
}, {
|
|
1078
|
+
localOnly: true,
|
|
1079
|
+
indexes: {
|
|
1080
|
+
local_background_task_queue: ["status", "available_at", "priority", "queue_index", "id"],
|
|
1081
|
+
local_background_task_thread: ["thread_id", "status", "created_at", "id"],
|
|
1082
|
+
local_background_task_run: ["run_id", "status", "created_at", "id"],
|
|
1083
|
+
local_background_task_assistant: ["assistant_message_id", "id"],
|
|
1084
|
+
local_background_task_kind_status: ["kind", "status", "created_at", "id"],
|
|
1085
|
+
local_background_task_group: ["group_id", "created_at", "id"],
|
|
1086
|
+
local_background_task_idempotency: ["idempotency_key", "created_at", "id"],
|
|
1087
|
+
},
|
|
1088
|
+
});
|
|
1089
|
+
export const local_artifact = new Table({
|
|
1090
|
+
thread_id: column.text,
|
|
1091
|
+
message_id: column.text,
|
|
1092
|
+
kind: column.text,
|
|
1093
|
+
title: column.text,
|
|
1094
|
+
entry: column.text,
|
|
1095
|
+
root: column.text,
|
|
1096
|
+
manifest: column.text,
|
|
1097
|
+
created_at: column.text,
|
|
1098
|
+
updated_at: column.text,
|
|
1099
|
+
is_del: column.integer,
|
|
1100
|
+
}, {
|
|
1101
|
+
indexes: {
|
|
1102
|
+
artifact_by_thread: ["thread_id", "is_del", "updated_at", "id"],
|
|
1103
|
+
},
|
|
1104
|
+
});
|
|
1105
|
+
export const ELECTRON_CANONICAL_TABLES = {
|
|
1106
|
+
c_note,
|
|
1107
|
+
c_note_embed,
|
|
1108
|
+
c_card_box,
|
|
1109
|
+
c_card_note,
|
|
1110
|
+
c_cmd,
|
|
1111
|
+
c_note_template,
|
|
1112
|
+
c_tag_node,
|
|
1113
|
+
c_tag_preference,
|
|
1114
|
+
c_user_config,
|
|
1115
|
+
c_hotword,
|
|
1116
|
+
c_zettel_box,
|
|
1117
|
+
c_project,
|
|
1118
|
+
c_project_item,
|
|
1119
|
+
c_thread,
|
|
1120
|
+
c_chat_message,
|
|
1121
|
+
c_resource,
|
|
1122
|
+
c_note_link,
|
|
1123
|
+
c_robot,
|
|
1124
|
+
c_note_history,
|
|
1125
|
+
note_local_history,
|
|
1126
|
+
c_sync_error_local,
|
|
1127
|
+
c_user_config_advanced,
|
|
1128
|
+
c_mcp_server,
|
|
1129
|
+
c_config_property,
|
|
1130
|
+
c_property_def,
|
|
1131
|
+
c_saved_view,
|
|
1132
|
+
c_local_config,
|
|
1133
|
+
app_local_store,
|
|
1134
|
+
local_channel_account,
|
|
1135
|
+
local_channel_binding,
|
|
1136
|
+
c_memory,
|
|
1137
|
+
c_storage,
|
|
1138
|
+
c_scheduled_task,
|
|
1139
|
+
c_inbox_item,
|
|
1140
|
+
c_model_cache,
|
|
1141
|
+
c_runtime_model,
|
|
1142
|
+
c_ai_provider,
|
|
1143
|
+
c_ai_provider_model,
|
|
1144
|
+
c_skill_index,
|
|
1145
|
+
local_project_skill,
|
|
1146
|
+
local_audit_event,
|
|
1147
|
+
local_audit_row_change,
|
|
1148
|
+
local_audit_blob,
|
|
1149
|
+
local_thread_run,
|
|
1150
|
+
local_thread_tool_approval,
|
|
1151
|
+
local_tool_permission_grant,
|
|
1152
|
+
local_background_task,
|
|
1153
|
+
local_artifact,
|
|
1154
|
+
};
|