@dinoxx/dinox-cli 2.1.1 → 2.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.
Files changed (68) hide show
  1. package/dist/cli.js +4 -0
  2. package/dist/commands/domain/options.d.ts +10 -0
  3. package/dist/commands/domain/options.js +75 -0
  4. package/dist/commands/domain/run.d.ts +24 -0
  5. package/dist/commands/domain/run.js +137 -0
  6. package/dist/commands/notes/actions.js +72 -20
  7. package/dist/commands/notes/createFromTemplate.d.ts +35 -0
  8. package/dist/commands/notes/createFromTemplate.js +58 -0
  9. package/dist/commands/notes/descriptors.js +12 -5
  10. package/dist/commands/notes/dryRun.d.ts +1 -0
  11. package/dist/commands/notes/dryRun.js +8 -2
  12. package/dist/commands/notes/repo/read.js +4 -23
  13. package/dist/commands/notes/repo/shared.d.ts +2 -0
  14. package/dist/commands/notes/repo/write.d.ts +3 -0
  15. package/dist/commands/notes/repo/write.js +16 -5
  16. package/dist/commands/properties/index.d.ts +16 -0
  17. package/dist/commands/properties/index.js +640 -0
  18. package/dist/commands/properties/repo.d.ts +150 -0
  19. package/dist/commands/properties/repo.js +272 -0
  20. package/dist/commands/savedViews/fields.d.ts +28 -0
  21. package/dist/commands/savedViews/fields.js +87 -0
  22. package/dist/commands/savedViews/index.js +203 -164
  23. package/dist/commands/savedViews/model.d.ts +27 -69
  24. package/dist/commands/savedViews/model.js +63 -279
  25. package/dist/commands/savedViews/repo.d.ts +64 -62
  26. package/dist/commands/savedViews/repo.js +309 -428
  27. package/dist/commands/schema/renderSkills.js +29 -5
  28. package/dist/commands/schema/spec.js +4 -0
  29. package/dist/commands/templates/index.d.ts +4 -0
  30. package/dist/commands/templates/index.js +290 -0
  31. package/dist/commands/templates/model.d.ts +12 -34
  32. package/dist/commands/templates/model.js +39 -83
  33. package/dist/commands/templates/repo.d.ts +53 -0
  34. package/dist/commands/templates/repo.js +78 -0
  35. package/dist/skills/registry.js +7 -0
  36. package/dist/utils/errorCodes.d.ts +212 -0
  37. package/dist/utils/errorCodes.js +53 -0
  38. package/dist/vendor/electron/domain/note-templates.d.ts +3 -0
  39. package/dist/vendor/electron/domain/note-templates.js +232 -0
  40. package/dist/vendor/electron/domain/properties.d.ts +10 -0
  41. package/dist/vendor/electron/domain/properties.js +1538 -0
  42. package/dist/vendor/electron/domain/saved-view-analytics.d.ts +45 -0
  43. package/dist/vendor/electron/domain/saved-view-analytics.js +365 -0
  44. package/dist/vendor/electron/domain/saved-view-relative-date.d.ts +21 -0
  45. package/dist/vendor/electron/domain/saved-view-relative-date.js +153 -0
  46. package/dist/vendor/electron/domain/saved-views.d.ts +61 -0
  47. package/dist/vendor/electron/domain/saved-views.js +1117 -0
  48. package/dist/vendor/electron/rpc.d.ts +22 -0
  49. package/dist/vendor/electron/rpc.js +27 -0
  50. package/dist/vendor/electron/shared/ai-errors.d.ts +11 -0
  51. package/dist/vendor/electron/shared/ai-errors.js +107 -0
  52. package/dist/vendor/electron/shared/external-types.d.ts +2 -0
  53. package/dist/vendor/electron/shared/external-types.js +1 -0
  54. package/dist/vendor/electron/shared/index.d.ts +9 -0
  55. package/dist/vendor/electron/shared/index.js +7 -0
  56. package/dist/vendor/electron/shared/note-properties.d.ts +312 -0
  57. package/dist/vendor/electron/shared/note-properties.js +982 -0
  58. package/dist/vendor/electron/shared/note-templates.d.ts +82 -0
  59. package/dist/vendor/electron/shared/note-templates.js +84 -0
  60. package/dist/vendor/electron/shared/powersync-read-models.d.ts +1710 -0
  61. package/dist/vendor/electron/shared/powersync-read-models.js +1 -0
  62. package/dist/vendor/electron/shared/saved-views.d.ts +394 -0
  63. package/dist/vendor/electron/shared/saved-views.js +981 -0
  64. package/dist/vendor/electron/sql-utils.d.ts +5 -0
  65. package/dist/vendor/electron/sql-utils.js +32 -0
  66. package/package.json +6 -3
  67. package/dist/commands/savedViews/semantics.d.ts +0 -46
  68. package/dist/commands/savedViews/semantics.js +0 -738
@@ -0,0 +1,1710 @@
1
+ import type { ChatMessageAnchorFields } from './external-types.js';
2
+ import type { ActivePropertyType, NoteProperties, NotePropertiesPatch, NotePropertySlotOperation, PropertyDefConfig, PropertyDefSource, PropertyOptionInput } from './note-properties.js';
3
+ import type { SystemAgentKey } from './external-types.js';
4
+ export interface ResourceUserListInput {
5
+ userId: string;
6
+ limit?: number;
7
+ }
8
+ /** Keyset cursor for the resource list page — mirrors the note list cursor. */
9
+ export interface ResourceListPageCursor {
10
+ id: string;
11
+ sortKey: string;
12
+ }
13
+ /**
14
+ * Resource type buckets, mirroring the renderer's `resolveResourceKind` (mime type
15
+ * first, then category). Used by {@link ResourceListPageInput.kind} to filter by type.
16
+ */
17
+ export type ResourceListPageKind = "image" | "video" | "audio" | "pdf" | "file";
18
+ export interface ResourceListPageInput {
19
+ userId: string;
20
+ limit?: number;
21
+ cursor?: ResourceListPageCursor | null;
22
+ /** Optional category filter (e.g. "images"); omit for all resources. */
23
+ category?: string | null;
24
+ /**
25
+ * Optional zettel-box filter. Restricts to resources referenced by a note in
26
+ * this box (via `resource_ref`, with a legacy `c_note.resource_id` fallback).
27
+ */
28
+ boxId?: string | null;
29
+ /** Optional tag-path filter, matched the same way as {@link boxId}. */
30
+ tagPath?: string | null;
31
+ /** Optional resource-type filter; omit for all types. */
32
+ kind?: ResourceListPageKind | null;
33
+ }
34
+ /** A resource row plus its keyset `sort_key`, used to derive the next cursor. */
35
+ export type ResourceListPageReadModelRow = ResourceUserListReadModelRow & {
36
+ sort_key: string | null;
37
+ };
38
+ export interface ResourceUserListReadModelRow {
39
+ id: string;
40
+ user_id: string | null;
41
+ name: string | null;
42
+ mime_type: string | null;
43
+ size_bytes: number | null;
44
+ storage_config_id: string | null;
45
+ storage_key: string | null;
46
+ storage_url: string | null;
47
+ storage_provider: string | null;
48
+ bucket: string | null;
49
+ is_public: number | null;
50
+ created_at: string | null;
51
+ updated_at: string | null;
52
+ is_del: number | null;
53
+ status: string | null;
54
+ uploaded_at: string | null;
55
+ etag: string | null;
56
+ checksum: string | null;
57
+ category: string | null;
58
+ width: number | null;
59
+ height: number | null;
60
+ duration: number | null;
61
+ endpoint: string | null;
62
+ domain: string | null;
63
+ extra_data: string | null;
64
+ deleted_at: string | null;
65
+ content_sha256: string | null;
66
+ content: string | null;
67
+ content_md: string | null;
68
+ summary: string | null;
69
+ }
70
+ export interface ResourceByIdInput {
71
+ id: string;
72
+ }
73
+ export type ResourceByIdReadModelRow = ResourceUserListReadModelRow;
74
+ export interface ResourceVisibleListInput {
75
+ userId?: string | null;
76
+ limit?: number;
77
+ }
78
+ export type ResourceVisibleListReadModelRow = ResourceUserListReadModelRow;
79
+ export interface ResourceByUrlsOrChecksumsInput {
80
+ candidates: string[];
81
+ userId?: string | null;
82
+ limit?: number;
83
+ }
84
+ export type ResourceByUrlsOrChecksumsReadModelRow = ResourceUserListReadModelRow;
85
+ export interface ResourceByStorageKeyInput {
86
+ storageKey: string;
87
+ userId?: string | null;
88
+ }
89
+ export type ResourceByStorageKeyReadModelRow = ResourceUserListReadModelRow;
90
+ export interface ResourceByReferencesInput {
91
+ ids?: string[];
92
+ storageKeys?: string[];
93
+ urlsOrChecksums?: string[];
94
+ userId?: string | null;
95
+ limit?: number;
96
+ }
97
+ export type ResourceByReferencesReadModelRow = ResourceUserListReadModelRow;
98
+ export interface ResourcePendingListInput {
99
+ userId?: string | null;
100
+ limit?: number;
101
+ }
102
+ export type ResourcePendingListReadModelRow = ResourceUserListReadModelRow;
103
+ export interface ResourceCreatePendingInput {
104
+ id: string;
105
+ name: string;
106
+ mimeType: string;
107
+ sizeBytes: number;
108
+ storageConfigId?: string | null;
109
+ storageKey: string;
110
+ storageUrl: string;
111
+ storageProvider: string;
112
+ bucket: string;
113
+ category: string;
114
+ endpoint: string;
115
+ domain: string;
116
+ extraData: string;
117
+ userId?: string | null;
118
+ createdAt: string;
119
+ }
120
+ export interface ResourceSoftDeleteInput {
121
+ id: string;
122
+ deletedAt: string;
123
+ }
124
+ export interface ResourceChecksumUpdateInput {
125
+ id: string;
126
+ checksum: string;
127
+ updatedAt: string;
128
+ }
129
+ export interface ResourceUploadedMarkInput {
130
+ id: string;
131
+ etag: string;
132
+ storageUrl: string;
133
+ uploadedAt: string;
134
+ }
135
+ export interface ResourceFailedMarkInput {
136
+ id: string;
137
+ errorMessage: string;
138
+ updatedAt: string;
139
+ }
140
+ export interface StorageConfigUserListInput {
141
+ userId: string;
142
+ limit?: number;
143
+ }
144
+ export interface StorageConfigUserListReadModelRow {
145
+ id: string;
146
+ user_id: string | null;
147
+ alias_name: string | null;
148
+ protocol: string | null;
149
+ provider: string | null;
150
+ is_active: number | null;
151
+ sort_rank: number | null;
152
+ endpoint: string | null;
153
+ bucket: string | null;
154
+ region: string | null;
155
+ access_key_id: string | null;
156
+ secret_access_key: string | null;
157
+ force_path_style: number | null;
158
+ path_prefix: string | null;
159
+ custom_domain: string | null;
160
+ legacy_domains: string | null;
161
+ is_private: number | null;
162
+ extra_config: string | null;
163
+ created_at: string | null;
164
+ updated_at: string | null;
165
+ deleted_at: string | null;
166
+ }
167
+ export interface StorageConfigCommandItem {
168
+ id: string;
169
+ aliasName?: string | null;
170
+ provider: string;
171
+ endpoint: string;
172
+ bucket: string;
173
+ region?: string | null;
174
+ accessKeyId?: string | null;
175
+ secretAccessKey?: string | null;
176
+ forcePathStyle?: boolean | null;
177
+ pathPrefix?: string | null;
178
+ customDomain?: string | null;
179
+ isPrivate?: boolean | null;
180
+ legacyDomains?: string[];
181
+ }
182
+ export interface StorageConfigReplaceListInput {
183
+ list: StorageConfigCommandItem[];
184
+ userId?: string | null;
185
+ activeCustomConfigId?: string | null;
186
+ updatedAt: string;
187
+ }
188
+ export interface McpServerUserListInput {
189
+ userId: string;
190
+ limit?: number;
191
+ }
192
+ export interface McpServerUserListReadModelRow {
193
+ id: string;
194
+ user_id: string | null;
195
+ name: string | null;
196
+ description: string | null;
197
+ registry_id: string | null;
198
+ schema_version: number | null;
199
+ config: string | null;
200
+ enabled: number | null;
201
+ sort_rank: number | null;
202
+ properties: string | null;
203
+ created_at: string | null;
204
+ updated_at: string | null;
205
+ is_del: number | null;
206
+ }
207
+ export interface McpServerSaveInput {
208
+ mode: "create" | "update";
209
+ id: string;
210
+ userId: string;
211
+ name: string;
212
+ config: string;
213
+ enabled: boolean;
214
+ sortRank: number;
215
+ updatedAt: string;
216
+ }
217
+ export interface McpServerEnabledSetInput {
218
+ id: string;
219
+ userId: string;
220
+ enabled: boolean;
221
+ updatedAt: string;
222
+ }
223
+ export interface McpServerSoftDeleteInput {
224
+ id: string;
225
+ userId: string;
226
+ updatedAt: string;
227
+ }
228
+ export interface McpServerInsertManyInput {
229
+ rows: Array<{
230
+ id: string;
231
+ userId: string;
232
+ name: string;
233
+ config: string;
234
+ enabled: boolean;
235
+ sortRank: number;
236
+ createdAt: string;
237
+ updatedAt: string;
238
+ }>;
239
+ }
240
+ export interface SyncErrorOpenListInput {
241
+ limit?: number;
242
+ }
243
+ export interface SyncErrorOpenListReadModelRow {
244
+ id: string;
245
+ transaction_id: number | null;
246
+ error_code: string | null;
247
+ message: string | null;
248
+ first_table: string | null;
249
+ first_row_id: string | null;
250
+ operation_count: number | null;
251
+ payload_json: string | null;
252
+ created_at: string | null;
253
+ updated_at: string | null;
254
+ resolved_at: string | null;
255
+ status: string | null;
256
+ }
257
+ export interface SyncErrorResolveInput {
258
+ ids: string[];
259
+ }
260
+ export interface NoteCommentUpdateInput {
261
+ noteId: string;
262
+ commentId: string;
263
+ content: string;
264
+ updatedAt: string;
265
+ }
266
+ export interface NoteAudioDetailUpdateInput {
267
+ noteId: string;
268
+ audioDetail: string;
269
+ updatedAt: string;
270
+ }
271
+ export interface NoteMetadataUpdateInput {
272
+ noteId: string;
273
+ title?: string | null;
274
+ tags?: string | null;
275
+ zettelBoxes?: string | null;
276
+ updatedAt: string;
277
+ }
278
+ export interface NoteTypeUpdateInput {
279
+ noteId: string;
280
+ type: "note" | "crawl";
281
+ updatedAt: string;
282
+ }
283
+ export interface NoteSoftDeleteInput {
284
+ noteId: string;
285
+ updatedAt: string;
286
+ }
287
+ export interface NoteCommentsReplaceInput {
288
+ noteId: string;
289
+ comments: string;
290
+ updatedAt: string;
291
+ }
292
+ export interface NoteTranscriptionUpdateInput {
293
+ noteId: string;
294
+ transcript: string;
295
+ audioDetail: string;
296
+ storeTranscriptInContent: boolean;
297
+ contentJson?: string | null;
298
+ updatedAt: string;
299
+ }
300
+ export interface NoteContentRestoreInput {
301
+ noteId: string;
302
+ contentJson: string;
303
+ contentText?: string | null;
304
+ contentMd?: string | null;
305
+ updatedAt: string;
306
+ }
307
+ export interface ConfigPropertyListInput {
308
+ userId?: string | null;
309
+ keys?: string[];
310
+ includeAllUsers?: boolean;
311
+ limit?: number;
312
+ }
313
+ export interface ConfigPropertyListReadModelRow {
314
+ id: string;
315
+ c_key: string | null;
316
+ c_value: string | null;
317
+ created_at: string | null;
318
+ updated_at: string | null;
319
+ is_del: number | null;
320
+ user_id: string | null;
321
+ description: string | null;
322
+ }
323
+ export interface ConfigPropertyUpsertInput {
324
+ id?: string | null;
325
+ cKey: string;
326
+ cValue: string;
327
+ userId?: string | null;
328
+ description?: string | null;
329
+ updatedAt: string;
330
+ }
331
+ export interface ConfigPropertySoftDeleteInput {
332
+ id?: string | null;
333
+ cKey?: string | null;
334
+ userId?: string | null;
335
+ updatedAt: string;
336
+ }
337
+ export interface UserConfigHotWordsUpdateInput {
338
+ id: string;
339
+ hotWords: string;
340
+ }
341
+ export interface UserConfigUpdateConfigInput {
342
+ id?: string | null;
343
+ config: string;
344
+ }
345
+ export interface UserConfigActiveInput {
346
+ limit?: number;
347
+ }
348
+ export interface UserConfigActiveReadModelRow {
349
+ id: string;
350
+ config: string | null;
351
+ memory: string | null;
352
+ extra_data: string | null;
353
+ is_del: number | null;
354
+ hot_words: string | null;
355
+ }
356
+ export interface UserConfigAdvancedActiveInput {
357
+ userId: string;
358
+ limit?: number;
359
+ }
360
+ export interface UserConfigAdvancedActiveReadModelRow {
361
+ id: string;
362
+ created_at: string | null;
363
+ updated_at: string | null;
364
+ extra_data: string | null;
365
+ s3_config: string | null;
366
+ global_memory_config: string | null;
367
+ mcp_servers: string | null;
368
+ is_del: number | null;
369
+ user_id: string | null;
370
+ }
371
+ export interface UserConfigAdvancedUpdateGlobalMemoryInput {
372
+ id?: string | null;
373
+ userId: string;
374
+ globalMemoryConfig: string;
375
+ updatedAt: string;
376
+ }
377
+ export interface AiProviderUserListInput {
378
+ userId: string;
379
+ limit?: number;
380
+ }
381
+ export interface AiProviderUserListReadModelRow {
382
+ id: string;
383
+ user_id: string | null;
384
+ name: string | null;
385
+ preset_key: string | null;
386
+ catalog_provider_id: string | null;
387
+ sdk_provider_id: string | null;
388
+ npm_package: string | null;
389
+ base_url: string | null;
390
+ api_key: string | null;
391
+ enabled: number | null;
392
+ sort_rank: number | null;
393
+ properties: string | null;
394
+ created_at: string | null;
395
+ updated_at: string | null;
396
+ is_del: number | null;
397
+ }
398
+ export interface AiProviderModelUserListInput {
399
+ userId: string;
400
+ limit?: number;
401
+ }
402
+ export interface AiProviderModelUserListReadModelRow {
403
+ id: string;
404
+ user_id: string | null;
405
+ provider_id: string | null;
406
+ model_id: string | null;
407
+ display_name: string | null;
408
+ enabled: number | null;
409
+ sort_rank: number | null;
410
+ context_window: number | null;
411
+ max_output_tokens: number | null;
412
+ source: string | null;
413
+ cost: string | null;
414
+ properties: string | null;
415
+ synced_at: string | null;
416
+ created_at: string | null;
417
+ updated_at: string | null;
418
+ is_del: number | null;
419
+ }
420
+ export interface LegacyAiProviderModelConfig {
421
+ modelAlias?: string;
422
+ modelId?: string;
423
+ isOpen?: boolean;
424
+ hasSearch?: boolean;
425
+ hasReasoning?: boolean;
426
+ }
427
+ export interface LegacyAiProviderConfig {
428
+ id?: string;
429
+ presetKey?: string;
430
+ type?: string;
431
+ name?: string;
432
+ apiHost?: string;
433
+ apiKey?: string;
434
+ provider?: string;
435
+ enabled?: boolean;
436
+ models?: LegacyAiProviderModelConfig[];
437
+ }
438
+ export interface UpsertAiProviderWithModelsInput {
439
+ providerId?: string | null;
440
+ userId: string;
441
+ name: string;
442
+ presetKey?: string | null;
443
+ catalogProviderId?: string | null;
444
+ sdkProviderId: string;
445
+ npmPackage?: string | null;
446
+ baseUrl?: string | null;
447
+ apiKey?: string | null;
448
+ enabled?: boolean;
449
+ sortRank?: number;
450
+ properties?: Record<string, unknown> | null;
451
+ models: Array<{
452
+ id?: string | null;
453
+ modelId: string;
454
+ displayName?: string | null;
455
+ enabled?: boolean;
456
+ sortRank?: number;
457
+ contextWindow?: number | null;
458
+ maxOutputTokens?: number | null;
459
+ source?: string | null;
460
+ cost?: Record<string, unknown> | null;
461
+ properties?: Record<string, unknown> | null;
462
+ syncedAt?: string | null;
463
+ }>;
464
+ }
465
+ export interface UpsertAiProviderWithModelsResult {
466
+ providerId: string;
467
+ createdProvider: boolean;
468
+ }
469
+ export interface AiProviderMigrateLegacyInput {
470
+ userId: string;
471
+ providers: LegacyAiProviderConfig[];
472
+ }
473
+ export interface AiProviderMigrateLegacyResult {
474
+ providerCount: number;
475
+ modelCount: number;
476
+ }
477
+ export interface AiProviderSoftDeleteInput {
478
+ providerId: string;
479
+ userId: string;
480
+ }
481
+ export interface ModelCacheReadModelRow {
482
+ id: string;
483
+ row_kind: string | null;
484
+ cache_version: number | null;
485
+ provider_id: string | null;
486
+ provider_name: string | null;
487
+ npm_package: string | null;
488
+ api_url: string | null;
489
+ doc_url: string | null;
490
+ model_id: string | null;
491
+ display_name: string | null;
492
+ family: string | null;
493
+ context_window: number | null;
494
+ max_output_tokens: number | null;
495
+ release_date: string | null;
496
+ last_updated: string | null;
497
+ provider_count: number | null;
498
+ model_count: number | null;
499
+ cost: string | null;
500
+ properties: string | null;
501
+ etag: string | null;
502
+ fetched_at: string | null;
503
+ updated_at: string | null;
504
+ }
505
+ export interface ModelCacheRowsInput {
506
+ limit?: number;
507
+ }
508
+ export interface ModelCacheProviderModelsInput {
509
+ providerIds: string[];
510
+ limit?: number;
511
+ }
512
+ export interface ModelCacheModelByIdInput {
513
+ modelId: string;
514
+ preferredProviderId?: string | null;
515
+ }
516
+ export interface ModelCacheRowInput {
517
+ id: string;
518
+ rowKind: string;
519
+ cacheVersion: number;
520
+ providerId?: string | null;
521
+ providerName?: string | null;
522
+ npmPackage?: string | null;
523
+ apiUrl?: string | null;
524
+ docUrl?: string | null;
525
+ modelId?: string | null;
526
+ displayName?: string | null;
527
+ family?: string | null;
528
+ contextWindow?: number | null;
529
+ maxOutputTokens?: number | null;
530
+ releaseDate?: string | null;
531
+ lastUpdated?: string | null;
532
+ providerCount?: number | null;
533
+ modelCount?: number | null;
534
+ cost?: string | null;
535
+ properties?: string | null;
536
+ etag?: string | null;
537
+ fetchedAt?: string | null;
538
+ updatedAt: string;
539
+ }
540
+ export interface ModelCacheReplaceRowsInput {
541
+ rows: ModelCacheRowInput[];
542
+ }
543
+ export interface ModelCacheTouchMetaInput {
544
+ cacheVersion: number;
545
+ providerCount: number;
546
+ modelCount: number;
547
+ providerIds: string[];
548
+ etag?: string | null;
549
+ updatedAt: string;
550
+ }
551
+ export interface ModelCacheDeleteRowsInput {
552
+ ids: string[];
553
+ }
554
+ export interface ModelCacheDeleteStaleInput {
555
+ latestIds: string[];
556
+ }
557
+ export interface RuntimeModelUserListInput {
558
+ userId: string;
559
+ limit?: number;
560
+ }
561
+ export interface RuntimeModelUserListReadModelRow {
562
+ id: string;
563
+ user_id: string | null;
564
+ provider_id: string | null;
565
+ provider_kind: string | null;
566
+ catalog_provider_id: string | null;
567
+ exposed_model_id: string | null;
568
+ canonical_model_key: string | null;
569
+ matched_catalog_provider_id: string | null;
570
+ matched_catalog_model_id: string | null;
571
+ display_name: string | null;
572
+ context_window: number | null;
573
+ input_token_limit: number | null;
574
+ max_output_tokens: number | null;
575
+ capabilities: string | null;
576
+ cost: string | null;
577
+ resolution_source: string | null;
578
+ confidence: string | null;
579
+ user_overridden_fields: string | null;
580
+ source_updated_at: string | null;
581
+ created_at: string | null;
582
+ updated_at: string | null;
583
+ }
584
+ export interface RuntimeModelRowInput {
585
+ id: string;
586
+ userId: string;
587
+ providerId: string;
588
+ providerKind: string;
589
+ catalogProviderId?: string | null;
590
+ exposedModelId: string;
591
+ canonicalModelKey?: string | null;
592
+ matchedCatalogProviderId?: string | null;
593
+ matchedCatalogModelId?: string | null;
594
+ displayName: string;
595
+ contextWindow?: number | null;
596
+ inputTokenLimit?: number | null;
597
+ maxOutputTokens?: number | null;
598
+ capabilities: string;
599
+ cost: string;
600
+ resolutionSource: string;
601
+ confidence: string;
602
+ userOverriddenFields: string;
603
+ sourceUpdatedAt?: string | null;
604
+ createdAt: string;
605
+ updatedAt: string;
606
+ }
607
+ export interface RuntimeModelReplaceForUserInput {
608
+ userId: string;
609
+ rows: RuntimeModelRowInput[];
610
+ }
611
+ export interface SkillIndexListInput {
612
+ limit?: number;
613
+ enabledOnly?: boolean;
614
+ }
615
+ export interface SkillIndexListReadModelRow {
616
+ id: string;
617
+ skill_key: string | null;
618
+ logical_key: string | null;
619
+ name: string | null;
620
+ description: string | null;
621
+ skill_file: string | null;
622
+ skill_dir: string | null;
623
+ real_skill_file: string | null;
624
+ real_skill_dir: string | null;
625
+ source: string | null;
626
+ root_path: string | null;
627
+ mounts_json: string | null;
628
+ frontmatter_json: string | null;
629
+ enabled: number | null;
630
+ source_available: number | null;
631
+ sort_order: number | null;
632
+ disable_model_invocation: number | null;
633
+ status: string | null;
634
+ content_sha256: string | null;
635
+ file_mtime_ms: number | null;
636
+ error_message: string | null;
637
+ discovered_at: string | null;
638
+ last_seen_at: string | null;
639
+ scan_generation: string | null;
640
+ updated_at: string | null;
641
+ }
642
+ export interface MemoryUserListInput {
643
+ userId?: string | null;
644
+ scope?: "global" | "project" | "thread" | null;
645
+ limit?: number;
646
+ }
647
+ export interface MemoryUserListReadModelRow {
648
+ id: string;
649
+ scope: string | null;
650
+ scope_id: string | null;
651
+ content: string | null;
652
+ category: string | null;
653
+ source: string | null;
654
+ source_thread_id: string | null;
655
+ status: string | null;
656
+ created_at: string | null;
657
+ updated_at: string | null;
658
+ access_count: number | null;
659
+ is_pinned: number | null;
660
+ is_del: number | null;
661
+ user_id: string | null;
662
+ }
663
+ export interface MemoryInsertInput {
664
+ id: string;
665
+ scope: string;
666
+ scopeId?: string | null;
667
+ content: string;
668
+ category?: string | null;
669
+ source: string;
670
+ sourceThreadId?: string | null;
671
+ createdAt: string;
672
+ updatedAt: string;
673
+ isPinned?: boolean;
674
+ userId: string;
675
+ }
676
+ export interface MemoryInsertManyInput {
677
+ rows: MemoryInsertInput[];
678
+ }
679
+ export interface NoteHistorySnapshotInput {
680
+ id: string;
681
+ noteId: string;
682
+ title?: string | null;
683
+ contentJson?: string | null;
684
+ contentText?: string | null;
685
+ contentMd?: string | null;
686
+ tags?: string | null;
687
+ zettelBoxes?: string | null;
688
+ images?: string | null;
689
+ snapshotReason: string;
690
+ snapshotHash: string;
691
+ clientId: string;
692
+ userId?: string | null;
693
+ createdAt: string;
694
+ meta?: string | null;
695
+ trimIds: string[];
696
+ }
697
+ export interface CommandActiveListInput {
698
+ userId?: string | null;
699
+ limit?: number;
700
+ }
701
+ export interface CommandReadModelRow {
702
+ id: string;
703
+ zone: string | null;
704
+ type: string | null;
705
+ cmd: string | null;
706
+ name: string | null;
707
+ priority: number | null;
708
+ is_show: number | null;
709
+ description: string | null;
710
+ extra_data: string | null;
711
+ user_id: string | null;
712
+ insert_at: string | null;
713
+ update_at: string | null;
714
+ is_del: number | null;
715
+ template_id: string | null;
716
+ meta_data: string | null;
717
+ output: string | null;
718
+ output_param: string | null;
719
+ category: string | null;
720
+ }
721
+ export interface ProjectCardNotesInput {
722
+ projectId: string;
723
+ limit?: number;
724
+ }
725
+ export interface ProjectCreateInput {
726
+ id: string;
727
+ defaultThreadId: string;
728
+ defaultThreadCmdId: string;
729
+ userId: string;
730
+ name: string;
731
+ description: string;
732
+ agentMd: string;
733
+ references: string;
734
+ tools: string;
735
+ emoji: string | null;
736
+ createdAt: string;
737
+ updatedAt: string;
738
+ }
739
+ export interface ProjectSystemAgentInput {
740
+ userId: string;
741
+ systemAgentKey: string;
742
+ }
743
+ export interface ProjectEnsureSystemAgentInput {
744
+ userId: string;
745
+ systemAgentKey: SystemAgentKey | string;
746
+ createdAt: string;
747
+ updatedAt: string;
748
+ }
749
+ export interface ProjectEnsureSystemAgentResult {
750
+ projectId: string;
751
+ systemAgentKey: SystemAgentKey;
752
+ created: boolean;
753
+ repaired: boolean;
754
+ }
755
+ export interface ProjectProfileUpdateInput {
756
+ projectId: string;
757
+ name?: string;
758
+ description?: string | null;
759
+ agentMd?: string | null;
760
+ references?: string | null;
761
+ tools?: string | null;
762
+ emoji?: string | null;
763
+ updatedAt: string;
764
+ }
765
+ export interface ProjectSoftDeleteInput {
766
+ projectId: string;
767
+ updatedAt: string;
768
+ }
769
+ export interface CardNotesByCommandInput {
770
+ commandId: string;
771
+ limit?: number;
772
+ }
773
+ export interface CardNoteByIdInput {
774
+ id: string;
775
+ }
776
+ export interface CardNoteReadModelRow {
777
+ id: string;
778
+ box_id: string | null;
779
+ content: string | null;
780
+ created_at: string | null;
781
+ updated_at: string | null;
782
+ extra_data: string | null;
783
+ user_no: string | null;
784
+ is_del: number | null;
785
+ origin_note_id: string | null;
786
+ origin_type: string | null;
787
+ output_type: string | null;
788
+ is_array: number | null;
789
+ }
790
+ export interface ProjectCardNoteReadModelRow extends CardNoteReadModelRow {
791
+ command_name: string | null;
792
+ command_description: string | null;
793
+ command_cmd: string | null;
794
+ }
795
+ export interface ProjectCardOutputCreateInput {
796
+ projectId: string;
797
+ userId: string;
798
+ commandType: string;
799
+ commandOutput: string;
800
+ commandName: string;
801
+ commandZone: string | null;
802
+ commandCmd: string;
803
+ commandDescription: string | null;
804
+ content: string;
805
+ extraData: string;
806
+ isArray: boolean;
807
+ }
808
+ export interface ProjectCardOutputCreateResult {
809
+ boxId: string;
810
+ cardNoteId: string;
811
+ }
812
+ export interface CommandPriorityUpdateInput {
813
+ updates: Array<{
814
+ id: string;
815
+ priority: number;
816
+ }>;
817
+ updatedAt: string;
818
+ }
819
+ export interface CommandSaveInput {
820
+ mode: "create" | "update";
821
+ id: string;
822
+ userId: string;
823
+ name: string;
824
+ zone: string | null;
825
+ cmd: string;
826
+ description: string | null;
827
+ type: string;
828
+ output: string;
829
+ isShow: boolean;
830
+ priority: number;
831
+ extraData: string;
832
+ metaData: string;
833
+ outputParam?: string | null;
834
+ updatedAt: string;
835
+ }
836
+ export interface CommandSoftDeleteInput {
837
+ id: string;
838
+ updatedAt: string;
839
+ }
840
+ export interface ZettelBoxCreateInput {
841
+ id: string;
842
+ name: string;
843
+ path: string;
844
+ parentId?: string | null;
845
+ description?: string | null;
846
+ color?: string | null;
847
+ userNo: string;
848
+ createdAt: string;
849
+ updatedAt: string;
850
+ }
851
+ export interface ZettelBoxUpdateInput {
852
+ id: string;
853
+ name?: string | null;
854
+ path?: string | null;
855
+ description?: string | null;
856
+ color?: string | null;
857
+ pinnedAt?: string | null;
858
+ userNo?: string | null;
859
+ updatedAt: string;
860
+ descendantPathUpdates?: Array<{
861
+ id: string;
862
+ path: string;
863
+ }>;
864
+ }
865
+ export interface ZettelBoxSoftDeleteInput {
866
+ id: string;
867
+ updatedAt: string;
868
+ }
869
+ export interface ZettelBoxRemoveFromNotesInput {
870
+ boxId: string;
871
+ updatedAt: string;
872
+ }
873
+ export interface ZettelBoxReorderInput {
874
+ parentId?: string | null;
875
+ updates: Array<{
876
+ id: string;
877
+ priority: number;
878
+ }>;
879
+ updatedAt: string;
880
+ }
881
+ export interface ChatThreadListInput {
882
+ userId?: string | null;
883
+ limit?: number;
884
+ }
885
+ export interface ChatThreadListReadModelRow {
886
+ id: string;
887
+ name: string | null;
888
+ kind: string | null;
889
+ messages: string | null;
890
+ user_id: string | null;
891
+ project_id: string | null;
892
+ last_opened_at: string | null;
893
+ created_at: string | null;
894
+ updated_at: string | null;
895
+ pinned_at: string | null;
896
+ sort_order: number | null;
897
+ meta_data: string | null;
898
+ cmd_id: string | null;
899
+ filter_condition: string | null;
900
+ config: string | null;
901
+ snapshot: string | null;
902
+ memory: string | null;
903
+ is_del: number | null;
904
+ robot_session_id: string | null;
905
+ compact_context: string | null;
906
+ parent_thread_id: string | null;
907
+ parent_message_id: string | null;
908
+ }
909
+ export interface ThreadByIdInput {
910
+ id: string;
911
+ }
912
+ export type ThreadByIdReadModelRow = ChatThreadListReadModelRow;
913
+ export interface ThreadBranchFamilyInput {
914
+ threadId: string;
915
+ userId: string;
916
+ limit?: number;
917
+ }
918
+ export interface ThreadBranchFamilyReadModelRow {
919
+ id: string;
920
+ name: string | null;
921
+ parent_thread_id: string | null;
922
+ parent_message_id: string | null;
923
+ created_at: string | null;
924
+ meta_data: string | null;
925
+ }
926
+ export interface ThreadBranchFromMessageInput {
927
+ sourceThreadId: string;
928
+ messageId: string;
929
+ userId: string;
930
+ }
931
+ export interface ThreadBranchFromMessageResult {
932
+ threadId: string;
933
+ threadName: string;
934
+ createdAt: string;
935
+ copiedMessageCount: number;
936
+ summarizedMessageCount: number;
937
+ }
938
+ export interface ThreadCreateInput {
939
+ id: string;
940
+ name: string;
941
+ kind: string;
942
+ userId: string;
943
+ projectId?: string | null;
944
+ cmdId: string;
945
+ metaData: string;
946
+ config: string;
947
+ createdAt: string;
948
+ updatedAt: string;
949
+ }
950
+ export interface ThreadUpdateInput {
951
+ threadId: string;
952
+ name?: string | null;
953
+ kind?: string | null;
954
+ userId?: string | null;
955
+ projectId?: string | null;
956
+ cmdId?: string | null;
957
+ lastOpenedAt?: string | null;
958
+ pinnedAt?: string | null;
959
+ sortOrder?: number | null;
960
+ config?: string | null;
961
+ isDel?: number | null;
962
+ updatedAt: string;
963
+ }
964
+ export interface ThreadReorderInput {
965
+ updates: Array<{
966
+ id: string;
967
+ sortOrder: number;
968
+ }>;
969
+ updatedAt: string;
970
+ }
971
+ export interface ThreadSoftDeleteInput {
972
+ threadId: string;
973
+ updatedAt: string;
974
+ }
975
+ export interface ThreadMessagesByThreadInput {
976
+ threadId: string;
977
+ limit?: number;
978
+ /**
979
+ * Which end of the thread to take when `limit` is smaller than the total.
980
+ * Defaults to "oldest" (unbounded/full-thread callers). "newest" returns the
981
+ * most recent `limit` rows in ascending order, powering the windowed chat view
982
+ * that pages older messages on demand instead of loading the whole thread.
983
+ */
984
+ anchor?: "oldest" | "newest";
985
+ }
986
+ export interface ThreadMessagesByAnchorInput {
987
+ anchorType: string;
988
+ anchorId: string;
989
+ anchorSource?: string | null;
990
+ limit?: number;
991
+ }
992
+ export interface ThreadsByMessageAnchorInput extends ThreadMessagesByAnchorInput {
993
+ userId?: string | null;
994
+ }
995
+ export interface ThreadByMessageAnchorReadModelRow extends ChatThreadListReadModelRow {
996
+ latest_anchor_message_at: string | null;
997
+ latest_anchor_message_id: string | null;
998
+ anchor_message_count: number | null;
999
+ }
1000
+ export interface ThreadMessageReadModelRow {
1001
+ id: string;
1002
+ role: string | null;
1003
+ type: string | null;
1004
+ entry_type: string | null;
1005
+ source_id: string | null;
1006
+ parent_id: string | null;
1007
+ content: string | null;
1008
+ created_at: string | null;
1009
+ updated_at: string | null;
1010
+ order_index: number | null;
1011
+ deleted_at: string | null;
1012
+ meta_data: string | null;
1013
+ anchor_type: string | null;
1014
+ anchor_id: string | null;
1015
+ anchor_source: string | null;
1016
+ anchor_meta_data: string | null;
1017
+ version: string | null;
1018
+ user_id: string | null;
1019
+ }
1020
+ export interface ChatMessagePersistTurnInput extends ChatMessageAnchorFields {
1021
+ type: string;
1022
+ sourceId: string;
1023
+ userId: string;
1024
+ parentId?: string | null;
1025
+ userMessageId: string;
1026
+ userMessageRole: string;
1027
+ userMessageContent: string;
1028
+ userCreatedAt: string;
1029
+ assistantMessageId: string;
1030
+ assistantMessageRole: string;
1031
+ assistantMessageContent: string;
1032
+ assistantCreatedAt: string;
1033
+ metaData?: string | null;
1034
+ }
1035
+ export interface ChatMessagesDeleteAndRelinkInput {
1036
+ messageId: string;
1037
+ childIds: string[];
1038
+ nextParentId?: string | null;
1039
+ deletedAt: string;
1040
+ }
1041
+ export interface ChatMessagesDeleteByIdsInput {
1042
+ ids: string[];
1043
+ deletedAt: string;
1044
+ }
1045
+ export interface ThreadChatMessageInsertInput extends ChatMessageAnchorFields {
1046
+ id: string;
1047
+ role: string;
1048
+ threadId: string;
1049
+ parentId?: string | null;
1050
+ content: string;
1051
+ createdAt: string;
1052
+ updatedAt: string;
1053
+ orderIndex: number;
1054
+ userId: string;
1055
+ }
1056
+ export interface ThreadChatMessageUpdateInput extends ChatMessageAnchorFields {
1057
+ id: string;
1058
+ parentId?: string | null;
1059
+ content?: string | null;
1060
+ entryType?: string | null;
1061
+ orderIndex?: number | null;
1062
+ deletedAt?: string | null;
1063
+ updatedAt: string;
1064
+ }
1065
+ export interface ThreadChatLegacyClearInput {
1066
+ threadId: string;
1067
+ updatedAt: string;
1068
+ }
1069
+ export interface ThreadChatApplyMutationsInput {
1070
+ inserts: ThreadChatMessageInsertInput[];
1071
+ updates: ThreadChatMessageUpdateInput[];
1072
+ clearLegacyThreads: ThreadChatLegacyClearInput[];
1073
+ }
1074
+ export interface ThreadChatClearInput {
1075
+ threadId: string;
1076
+ userId: string;
1077
+ updatedAt: string;
1078
+ }
1079
+ export interface ThreadChatClearResult {
1080
+ clearedEntryCount: number;
1081
+ clearedCheckpointCount: number;
1082
+ clearedLegacyMessages: boolean;
1083
+ }
1084
+ export interface ThreadChatPointerInput {
1085
+ threadId: string;
1086
+ }
1087
+ export interface ThreadChatPointerByIdInput {
1088
+ threadId: string;
1089
+ messageId: string;
1090
+ }
1091
+ export interface ThreadChatPointerReadModelRow {
1092
+ id: string;
1093
+ created_at: string | null;
1094
+ order_index: number | null;
1095
+ }
1096
+ export interface ThreadChatOrderStateInput {
1097
+ threadId: string;
1098
+ }
1099
+ export interface ThreadChatOrderStateReadModelRow {
1100
+ max_order_index: number | null;
1101
+ active_message_count: number | null;
1102
+ }
1103
+ export interface ThreadChatNextOrderIndexInput {
1104
+ threadId: string;
1105
+ afterOrderIndex: number;
1106
+ }
1107
+ export interface ThreadChatNextOrderIndexReadModelRow {
1108
+ next_order_index: number | null;
1109
+ }
1110
+ export interface NoteChatContextUpdateInput {
1111
+ noteId: string;
1112
+ chatContext: string;
1113
+ updatedAt: string;
1114
+ }
1115
+ export interface NoteFieldsUpdateInput {
1116
+ noteId: string;
1117
+ title?: string | null;
1118
+ contentJson?: string | null;
1119
+ contentText?: string | null;
1120
+ contentMd?: string | null;
1121
+ tags?: string | null;
1122
+ zettelBoxes?: string | null;
1123
+ images?: string | null;
1124
+ bidLinks?: string | null;
1125
+ audioDetail?: string | null;
1126
+ audios?: string | null;
1127
+ updatedAt: string;
1128
+ }
1129
+ export interface NoteFieldsUpdateBatchInput {
1130
+ updates: NoteFieldsUpdateInput[];
1131
+ }
1132
+ export interface PropertyDefCatalogInput {
1133
+ userId: string;
1134
+ limit?: number;
1135
+ }
1136
+ export interface PropertyDefEnsureInput {
1137
+ key: string;
1138
+ name?: string | null;
1139
+ type?: ActivePropertyType | null;
1140
+ /** Stable option configuration used by create/ensure flows. */
1141
+ optionItems?: PropertyOptionInput[];
1142
+ /** Prefix for a new `unique_id` counter. Empty falls back to the property name. */
1143
+ uniqueIdPrefix?: string | null;
1144
+ config?: PropertyDefConfig;
1145
+ description?: string | null;
1146
+ icon?: string | null;
1147
+ source?: PropertyDefSource | null;
1148
+ userId: string;
1149
+ updatedAt: string;
1150
+ }
1151
+ export interface PropertyDefConfigureInput {
1152
+ id: string;
1153
+ userId: string;
1154
+ name?: string | null;
1155
+ description?: string | null;
1156
+ icon?: string | null;
1157
+ showOnCard?: boolean | null;
1158
+ sortRank?: number | null;
1159
+ options?: PropertyOptionInput[];
1160
+ /** Replace the `unique_id` prefix while keeping the issued counter. */
1161
+ uniqueIdPrefix?: string | null;
1162
+ /** Explicitly replace malformed/unsupported option storage with new ID-less items. */
1163
+ repairInvalidOptions?: boolean;
1164
+ /** null removes the companion row and restores the legacy default. */
1165
+ config?: PropertyDefConfig | null;
1166
+ updatedAt: string;
1167
+ }
1168
+ export interface PropertyDefMigrateLegacyOptionsInput {
1169
+ userId: string;
1170
+ updatedAt: string;
1171
+ }
1172
+ export interface PropertyDefMigrateLegacyOptionsResult {
1173
+ definitionsMigrated: number;
1174
+ optionsCreated: number;
1175
+ notesUpdated: number;
1176
+ savedViewsUpdated: number;
1177
+ }
1178
+ export interface PropertyDefUpdateInput {
1179
+ id: string;
1180
+ userId: string;
1181
+ name?: string | null;
1182
+ description?: string | null;
1183
+ icon?: string | null;
1184
+ showOnCard?: boolean | null;
1185
+ sortRank?: number | null;
1186
+ updatedAt: string;
1187
+ }
1188
+ export interface PropertyDefSoftDeleteInput {
1189
+ id: string;
1190
+ userId: string;
1191
+ updatedAt: string;
1192
+ }
1193
+ export interface NotePropertiesUpdateInput {
1194
+ noteId: string;
1195
+ userId: string;
1196
+ /** Legacy value patch; null removes a key. New slot changes use NotePropertySlotsUpdateInput. */
1197
+ patch: NotePropertiesPatch;
1198
+ updatedAt: string;
1199
+ }
1200
+ export interface NotePropertySlotsUpdateInput {
1201
+ noteId: string;
1202
+ userId: string;
1203
+ operation: NotePropertySlotOperation;
1204
+ keys: string[];
1205
+ updatedAt: string;
1206
+ }
1207
+ export interface NotePropertySlotsReorderInput {
1208
+ noteId: string;
1209
+ userId: string;
1210
+ /** Complete preferred order of the currently visible property slots. */
1211
+ orderedKeys: string[];
1212
+ updatedAt: string;
1213
+ }
1214
+ /** Conditionally fill only properties that are still explicitly declared null. */
1215
+ export interface NotePropertiesFillEmptyInput {
1216
+ noteId: string;
1217
+ userId: string;
1218
+ values: NoteProperties;
1219
+ updatedAt: string;
1220
+ }
1221
+ export interface NotePropertiesFillEmptyResult {
1222
+ appliedKeys: string[];
1223
+ skippedKeys: string[];
1224
+ }
1225
+ export interface NoteLinkInsertInput {
1226
+ id: string;
1227
+ userId: string;
1228
+ srcNoteId: string;
1229
+ srcBlockId?: string | null;
1230
+ dstNoteId: string;
1231
+ dstBlockId?: string | null;
1232
+ relation: string;
1233
+ metaData: string;
1234
+ createdAt: string;
1235
+ updatedAt: string;
1236
+ }
1237
+ export interface NoteLinkUpdateInput {
1238
+ id: string;
1239
+ isDel: number;
1240
+ updatedAt: string;
1241
+ }
1242
+ export interface NoteLinkApplyMutationsInput {
1243
+ inserts: NoteLinkInsertInput[];
1244
+ updates: NoteLinkUpdateInput[];
1245
+ }
1246
+ export interface NoteCreateInput {
1247
+ id: string;
1248
+ title: string;
1249
+ type: string;
1250
+ userNo: string;
1251
+ isPub: number;
1252
+ createdAt: string;
1253
+ updatedAt: string;
1254
+ isDel: number;
1255
+ status: number;
1256
+ starredAt?: string | null;
1257
+ version: number;
1258
+ content: string;
1259
+ contentJson: string;
1260
+ contentText: string;
1261
+ contentMd: string;
1262
+ summary?: string | null;
1263
+ tags: string;
1264
+ zettelBoxes: string;
1265
+ images: string;
1266
+ files: string;
1267
+ audios: string;
1268
+ audioDetail: string;
1269
+ imageDetail: string;
1270
+ source: string;
1271
+ resourceId?: string | null;
1272
+ noteIds: string;
1273
+ extraData: string;
1274
+ formatType: string;
1275
+ comments: string;
1276
+ isTop: number;
1277
+ pinnedAt: string;
1278
+ chatContext: string;
1279
+ bidLinks: string;
1280
+ }
1281
+ export interface LocalThreadRunsByThreadInput {
1282
+ threadId: string;
1283
+ limit?: number;
1284
+ }
1285
+ export interface LocalThreadRunReadModelRow {
1286
+ id: string;
1287
+ thread_id: string | null;
1288
+ user_id: string | null;
1289
+ status: string | null;
1290
+ trigger: string | null;
1291
+ user_message_id: string | null;
1292
+ assistant_message_id: string | null;
1293
+ parent_message_id: string | null;
1294
+ queued_at: string | null;
1295
+ started_at: string | null;
1296
+ finished_at: string | null;
1297
+ error_text: string | null;
1298
+ model_ref: string | null;
1299
+ cmd_id: string | null;
1300
+ permission_mode: string | null;
1301
+ request_payload_json: string | null;
1302
+ assistant_snapshot_json: string | null;
1303
+ tool_approval_id: string | null;
1304
+ queue_index: number | null;
1305
+ usage_json: string | null;
1306
+ created_at: string | null;
1307
+ updated_at: string | null;
1308
+ }
1309
+ export interface ProjectByIdsInput {
1310
+ ids: string[];
1311
+ }
1312
+ export interface ProjectByIdsReadModelRow {
1313
+ id: string;
1314
+ name: string | null;
1315
+ description: string | null;
1316
+ created_at: string | null;
1317
+ updated_at: string | null;
1318
+ user_id: string | null;
1319
+ agent_md: string | null;
1320
+ memory: string | null;
1321
+ meta_data: string | null;
1322
+ priority: number | null;
1323
+ is_del: number | null;
1324
+ is_default: number | null;
1325
+ type: string | null;
1326
+ system_agent_key: string | null;
1327
+ skills: string | null;
1328
+ references: string | null;
1329
+ robot_id: string | null;
1330
+ emoji: string | null;
1331
+ tools: string | null;
1332
+ }
1333
+ export interface ProjectCheckedContextInput {
1334
+ projectId: string;
1335
+ userId?: string | null;
1336
+ limit?: number;
1337
+ }
1338
+ export interface ProjectCheckedContextReadModelRow {
1339
+ id: string;
1340
+ project_id: string | null;
1341
+ kind: string | null;
1342
+ ref_id: string | null;
1343
+ rank: number | null;
1344
+ is_check: number | null;
1345
+ payload: string | null;
1346
+ dedupe_key: string | null;
1347
+ is_del: number | null;
1348
+ note_id: string | null;
1349
+ note_title: string | null;
1350
+ note_summary: string | null;
1351
+ note_content_text: string | null;
1352
+ note_content_md: string | null;
1353
+ resource_id: string | null;
1354
+ resource_name: string | null;
1355
+ resource_mime_type: string | null;
1356
+ }
1357
+ export interface TagRegistryActiveInput {
1358
+ userId: string;
1359
+ limit?: number;
1360
+ }
1361
+ export interface TagRegistryActiveReadModelRow {
1362
+ id: string;
1363
+ user_id: string | null;
1364
+ emoji: string | null;
1365
+ full_path: string | null;
1366
+ path_key: string | null;
1367
+ parent_id: string | null;
1368
+ depth: number | null;
1369
+ is_actual: number | null;
1370
+ is_del: number | null;
1371
+ created_at: string | null;
1372
+ updated_at: string | null;
1373
+ meta: string | null;
1374
+ preference_id: string | null;
1375
+ tag_id: string | null;
1376
+ is_favorite: number | null;
1377
+ is_expanded: number | null;
1378
+ pinned_at: string | null;
1379
+ sort_rank: number | null;
1380
+ pinned_rank: number | null;
1381
+ preference_created_at: string | null;
1382
+ preference_updated_at: string | null;
1383
+ }
1384
+ export interface TagEnsurePathInput {
1385
+ userId: string;
1386
+ fullPath: string;
1387
+ parentId?: string | null;
1388
+ isActual?: boolean;
1389
+ }
1390
+ export interface TagEnsurePathResult {
1391
+ fullPath: string;
1392
+ tagId: string;
1393
+ }
1394
+ export interface TagEnsurePathsInput {
1395
+ userId: string;
1396
+ tags: string[];
1397
+ }
1398
+ export interface TagEnsurePathsResult {
1399
+ missing: string[];
1400
+ changed: boolean;
1401
+ }
1402
+ export interface TagCalibrationInput {
1403
+ userId: string;
1404
+ dryRun?: boolean;
1405
+ }
1406
+ export interface TagCalibrationResult {
1407
+ status: "preview" | "calibrated" | "skipped";
1408
+ reason: "ok" | "no_user" | "no_note_tags" | "unchanged" | "editor_close_failed" | "conflicts";
1409
+ dryRun: boolean;
1410
+ noteCount: number;
1411
+ discoveredTagCount: number;
1412
+ inlineHashtagCount: number;
1413
+ addedTagCount: number;
1414
+ restoredTagCount: number;
1415
+ ignoredMissingTagCount: number;
1416
+ deduplicatedTagCount: number;
1417
+ repairedTagCount: number;
1418
+ normalizedNoteCount: number;
1419
+ normalizedTagArrayCount: number;
1420
+ rewrittenHashtagCount: number;
1421
+ migratedPreferenceCount: number;
1422
+ removedPreferenceCount: number;
1423
+ invalidNoteCount: number;
1424
+ unresolvedHashtagCount: number;
1425
+ conflictCount: number;
1426
+ openEditorCount: number;
1427
+ closedEditorCount: number;
1428
+ failedEditorCount: number;
1429
+ }
1430
+ export interface TagRecoveryPreviewInput {
1431
+ userId: string;
1432
+ }
1433
+ export interface TagRecoveryCandidate {
1434
+ path: string;
1435
+ pathKey: string;
1436
+ tagArrayNoteCount: number;
1437
+ inlineOnlyNoteCount: number;
1438
+ inlineNoteCount: number;
1439
+ noteCount: number;
1440
+ parentPathsToCreate: string[];
1441
+ deletedPathConflicts: string[];
1442
+ action: "create" | "promote";
1443
+ blockedReason: "invalid_tags" | "invalid_content" | "duplicate_active" | null;
1444
+ }
1445
+ export interface TagRecoveryPreview {
1446
+ version: string;
1447
+ candidates: TagRecoveryCandidate[];
1448
+ noteCount: number;
1449
+ invalidNoteCount: number;
1450
+ unresolvedHashtagCount: number;
1451
+ }
1452
+ export interface TagRecoverMissingFromNotesInput {
1453
+ userId: string;
1454
+ version: string;
1455
+ approvedPathKeys: string[];
1456
+ approvedDeletedConflictKeys: string[];
1457
+ }
1458
+ export interface TagRecoverMissingFromNotesResult {
1459
+ status: "recovered" | "stale" | "editor_close_failed" | "no_selection";
1460
+ createdNodeCount: number;
1461
+ promotedNodeCount: number;
1462
+ updatedNoteCount: number;
1463
+ rewrittenHashtagCount: number;
1464
+ addedNoteTagCount: number;
1465
+ closedEditorCount: number;
1466
+ failedEditorCount: number;
1467
+ remainingApprovedMissingCount: number;
1468
+ auditEventId: string | null;
1469
+ }
1470
+ export interface TagRenameInput {
1471
+ userId: string;
1472
+ tagId: string;
1473
+ nextName: string;
1474
+ }
1475
+ export interface TagRenameResult {
1476
+ oldFullPath: string;
1477
+ fullPath: string;
1478
+ changed: boolean;
1479
+ }
1480
+ export interface TagDeleteInput {
1481
+ userId: string;
1482
+ tagId: string;
1483
+ }
1484
+ export interface TagDeleteResult {
1485
+ fullPath: string;
1486
+ tagIds: string[];
1487
+ }
1488
+ export interface TagExpandedSetInput {
1489
+ userId: string;
1490
+ tagId: string;
1491
+ expanded: boolean;
1492
+ }
1493
+ export interface TagPinnedSetInput {
1494
+ userId: string;
1495
+ tagId: string;
1496
+ pinned: boolean;
1497
+ }
1498
+ export interface TagReorderInput {
1499
+ userId: string;
1500
+ parentId?: string | null;
1501
+ updates: Array<{
1502
+ tagId: string;
1503
+ sortRank: number;
1504
+ }>;
1505
+ updatedAt: string;
1506
+ }
1507
+ export interface TagMergeInput {
1508
+ userId: string;
1509
+ fromPath: string;
1510
+ toPath: string;
1511
+ updatedAt: string;
1512
+ }
1513
+ export interface TagMergeResult {
1514
+ fromPath: string;
1515
+ toPath: string;
1516
+ notesUpdated: number;
1517
+ /** Audit event id for the note batch — pass to undoChanges to roll back notes. */
1518
+ undoEventId: string | null;
1519
+ }
1520
+ export interface TagMoveInput {
1521
+ userId: string;
1522
+ fromPath: string;
1523
+ /** New parent tag full-path; null moves the tag to the root. */
1524
+ newParentPath?: string | null;
1525
+ updatedAt: string;
1526
+ }
1527
+ export interface TagMoveResult {
1528
+ fromPath: string;
1529
+ toPath: string;
1530
+ notesUpdated: number;
1531
+ /** Audit event id for the note batch — pass to undoChanges to roll back notes. */
1532
+ undoEventId: string | null;
1533
+ }
1534
+ export type AuditableTableName = "c_note" | "c_memory" | "c_scheduled_task" | "c_inbox_item";
1535
+ export interface AuditNoteRowChangesInput {
1536
+ tableName: AuditableTableName;
1537
+ rowId: string;
1538
+ limit?: number;
1539
+ }
1540
+ export interface AuditNoteChangesInput {
1541
+ query?: string | null;
1542
+ limit?: number;
1543
+ offset?: number;
1544
+ }
1545
+ export interface AuditNoteChangesCountInput {
1546
+ query?: string | null;
1547
+ }
1548
+ export interface AuditNoteChangesCountRow {
1549
+ count: number;
1550
+ }
1551
+ export interface AuditNoteChangeByIdInput {
1552
+ id: string;
1553
+ }
1554
+ export interface AuditNoteChangeReadModelRow {
1555
+ id: string;
1556
+ event_id: string | null;
1557
+ thread_id: string | null;
1558
+ note_id: string | null;
1559
+ operation: string | null;
1560
+ before_blob_id: string | null;
1561
+ after_blob_id: string | null;
1562
+ before_hash: string | null;
1563
+ after_hash: string | null;
1564
+ changed_columns_json: string | null;
1565
+ summary: string | null;
1566
+ status: string | null;
1567
+ created_at: string | null;
1568
+ restored_at: string | null;
1569
+ display_title: string | null;
1570
+ display_summary: string | null;
1571
+ }
1572
+ export interface AuditRowChangesByEventIdsInput {
1573
+ eventIds: string[];
1574
+ tableName?: AuditableTableName | null;
1575
+ rowId?: string | null;
1576
+ limit?: number;
1577
+ }
1578
+ export interface AuditRowChangeReadModelRow {
1579
+ id: string;
1580
+ event_id: string | null;
1581
+ thread_id: string | null;
1582
+ table_name: string | null;
1583
+ row_id: string | null;
1584
+ operation: string | null;
1585
+ before_blob_id: string | null;
1586
+ after_blob_id: string | null;
1587
+ before_hash: string | null;
1588
+ after_hash: string | null;
1589
+ changed_columns_json: string | null;
1590
+ summary: string | null;
1591
+ status: string | null;
1592
+ created_at: string | null;
1593
+ restored_at: string | null;
1594
+ }
1595
+ export interface AuditEventsByIdsOrToolCallInput {
1596
+ eventIds?: string[];
1597
+ toolCallId?: string | null;
1598
+ limit?: number;
1599
+ }
1600
+ export interface AuditEventsByThreadInput {
1601
+ threadId: string;
1602
+ limit?: number;
1603
+ }
1604
+ export interface AuditEventReadModelRow {
1605
+ id: string;
1606
+ thread_id: string | null;
1607
+ actor_type: string | null;
1608
+ actor_id: string | null;
1609
+ source: string | null;
1610
+ tool_name: string | null;
1611
+ tool_call_id: string | null;
1612
+ title: string | null;
1613
+ status: string | null;
1614
+ coalesce_key: string | null;
1615
+ started_at: string | null;
1616
+ ended_at: string | null;
1617
+ created_at: string | null;
1618
+ applied_at: string | null;
1619
+ metadata_json: string | null;
1620
+ }
1621
+ export interface AuditBlobsByIdsInput {
1622
+ ids: string[];
1623
+ }
1624
+ export interface AuditBlobReadModelRow {
1625
+ id: string;
1626
+ content_hash: string | null;
1627
+ content_type: string | null;
1628
+ storage_kind: string | null;
1629
+ inline_text: string | null;
1630
+ object_path: string | null;
1631
+ byte_size: number | null;
1632
+ created_at: string | null;
1633
+ }
1634
+ export interface LocalStoreRowsInput {
1635
+ namespaces: string[];
1636
+ keys?: string[];
1637
+ includeExpired?: boolean;
1638
+ limit?: number;
1639
+ }
1640
+ export interface LocalStoreReadModelRow {
1641
+ id: string;
1642
+ namespace: string | null;
1643
+ key: string | null;
1644
+ value: string | null;
1645
+ value_type: string | null;
1646
+ expires_at: string | null;
1647
+ metadata: string | null;
1648
+ updated_at: string | null;
1649
+ }
1650
+ export interface LocalStoreSetInput {
1651
+ namespace: string;
1652
+ key: string;
1653
+ value: string;
1654
+ valueType?: string | null;
1655
+ expiresAt?: string | null;
1656
+ metadata?: string | null;
1657
+ updatedAt: string;
1658
+ }
1659
+ export interface LocalStoreDeleteInput {
1660
+ namespace: string;
1661
+ key: string;
1662
+ }
1663
+ export interface LocalStoreClearNamespaceInput {
1664
+ namespace: string;
1665
+ }
1666
+ export interface LocalStorePurgeExpiredInput {
1667
+ now: string;
1668
+ }
1669
+ export type AuditActorType = "user" | "agent" | "system";
1670
+ export type AuditSource = "editor" | "ai_tool" | "shortcut" | "import" | "restore" | "system";
1671
+ export interface AuditContext {
1672
+ threadId?: string | null;
1673
+ actorType: AuditActorType;
1674
+ actorId?: string | null;
1675
+ source: AuditSource;
1676
+ toolName?: string | null;
1677
+ toolCallId?: string | null;
1678
+ title?: string | null;
1679
+ coalesceKey?: string | null;
1680
+ metadata?: Record<string, unknown> | null;
1681
+ }
1682
+ export type AuditedRowOperation = {
1683
+ op: "insert";
1684
+ tableName: AuditableTableName;
1685
+ row: Record<string, unknown>;
1686
+ } | {
1687
+ op: "update";
1688
+ tableName: AuditableTableName;
1689
+ rowId: string;
1690
+ changes: Record<string, unknown>;
1691
+ } | {
1692
+ op: "delete";
1693
+ tableName: AuditableTableName;
1694
+ rowId: string;
1695
+ };
1696
+ export interface AuditEventResult {
1697
+ eventId: string | null;
1698
+ rowChangeIds: string[];
1699
+ }
1700
+ export interface AuditApplyRowBatchInput {
1701
+ context: AuditContext;
1702
+ operations: AuditedRowOperation[];
1703
+ }
1704
+ export interface AuditRestoreRowChangeInput {
1705
+ context: AuditContext;
1706
+ rowChangeId: string;
1707
+ }
1708
+ export interface AuditFinalizeOpenEventsInput {
1709
+ coalesceKey?: string | null;
1710
+ }