@dinoxx/dinox-cli 1.0.22 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +33 -10
  2. package/dist/auth/userInfo.d.ts +2 -0
  3. package/dist/auth/userInfo.js +55 -14
  4. package/dist/cli.js +36 -2
  5. package/dist/commands/auth/index.d.ts +35 -0
  6. package/dist/commands/auth/index.js +382 -83
  7. package/dist/commands/boxes/index.js +2 -6
  8. package/dist/commands/boxes/model.d.ts +3 -0
  9. package/dist/commands/boxes/model.js +16 -1
  10. package/dist/commands/boxes/operations.js +18 -8
  11. package/dist/commands/boxes/repo.js +13 -11
  12. package/dist/commands/boxes/store.js +1 -1
  13. package/dist/commands/config/index.js +7 -5
  14. package/dist/commands/descriptor/register.js +9 -0
  15. package/dist/commands/doctor.d.ts +123 -0
  16. package/dist/commands/doctor.js +539 -0
  17. package/dist/commands/graph/index.d.ts +1 -1
  18. package/dist/commands/graph/index.js +35 -21
  19. package/dist/commands/graph/repo.js +92 -17
  20. package/dist/commands/meta/index.js +4 -4
  21. package/dist/commands/meta/repo.js +4 -3
  22. package/dist/commands/notes/actions.d.ts +1 -1
  23. package/dist/commands/notes/actions.js +121 -78
  24. package/dist/commands/notes/bulk.d.ts +1 -0
  25. package/dist/commands/notes/bulk.js +23 -17
  26. package/dist/commands/notes/contentEngine.js +69 -11
  27. package/dist/commands/notes/contentPatch.d.ts +4 -1
  28. package/dist/commands/notes/contentPatch.js +105 -41
  29. package/dist/commands/notes/contentPatchCommand.js +28 -11
  30. package/dist/commands/notes/descriptors.js +50 -20
  31. package/dist/commands/notes/dryRun.d.ts +1 -0
  32. package/dist/commands/notes/dryRun.js +4 -7
  33. package/dist/commands/notes/export.d.ts +6 -0
  34. package/dist/commands/notes/export.js +26 -6
  35. package/dist/commands/notes/metadataMutation.d.ts +1 -0
  36. package/dist/commands/notes/metadataMutation.js +14 -3
  37. package/dist/commands/notes/repo.d.ts +46 -4
  38. package/dist/commands/notes/repo.js +113 -28
  39. package/dist/commands/notes/runtime.d.ts +2 -1
  40. package/dist/commands/notes/runtime.js +17 -1
  41. package/dist/commands/notes/searchSql.js +13 -6
  42. package/dist/commands/notes/writeReceipt.d.ts +20 -0
  43. package/dist/commands/notes/writeReceipt.js +82 -0
  44. package/dist/commands/prompt/index.js +3 -3
  45. package/dist/commands/prompt/repo.d.ts +4 -1
  46. package/dist/commands/prompt/repo.js +17 -7
  47. package/dist/commands/runtime.d.ts +14 -2
  48. package/dist/commands/runtime.js +89 -19
  49. package/dist/commands/schema/renderSkills.js +5 -2
  50. package/dist/commands/schema/spec.js +4 -0
  51. package/dist/commands/storage/index.js +8 -2
  52. package/dist/commands/storage/repo.d.ts +4 -0
  53. package/dist/commands/storage/repo.js +356 -92
  54. package/dist/commands/sync.d.ts +23 -1
  55. package/dist/commands/sync.js +105 -60
  56. package/dist/commands/tags/content.js +9 -0
  57. package/dist/commands/tags/index.js +2 -6
  58. package/dist/commands/tags/operations.js +15 -10
  59. package/dist/commands/tags/repo.d.ts +2 -0
  60. package/dist/commands/tags/repo.js +18 -5
  61. package/dist/commands/tags/store.js +1 -1
  62. package/dist/commands/todo/contentModel.d.ts +4 -3
  63. package/dist/commands/todo/contentModel.js +78 -28
  64. package/dist/commands/todo/dryRun.d.ts +1 -0
  65. package/dist/commands/todo/dryRun.js +17 -13
  66. package/dist/commands/todo/index.d.ts +6 -0
  67. package/dist/commands/todo/index.js +89 -123
  68. package/dist/commands/todo/repo.d.ts +36 -1
  69. package/dist/commands/todo/repo.js +146 -37
  70. package/dist/commands/todo/taskIdentity.d.ts +2 -0
  71. package/dist/commands/todo/taskIdentity.js +64 -0
  72. package/dist/commands/todo/taskModel.js +27 -17
  73. package/dist/commands/update.d.ts +13 -1
  74. package/dist/commands/update.js +135 -23
  75. package/dist/commands/writeDryRun.d.ts +3 -2
  76. package/dist/commands/writeDryRun.js +4 -3
  77. package/dist/commands/writeDurability.d.ts +5 -0
  78. package/dist/commands/writeDurability.js +22 -0
  79. package/dist/config/paths.js +6 -1
  80. package/dist/config/resolve.d.ts +2 -0
  81. package/dist/config/resolve.js +23 -9
  82. package/dist/config/store.d.ts +3 -0
  83. package/dist/config/store.js +61 -14
  84. package/dist/config/types.d.ts +4 -0
  85. package/dist/daemon/client.d.ts +26 -1
  86. package/dist/daemon/client.js +236 -12
  87. package/dist/daemon/ensure.js +74 -12
  88. package/dist/daemon/index.d.ts +42 -0
  89. package/dist/daemon/index.js +202 -52
  90. package/dist/daemon/lifecycle.d.ts +44 -0
  91. package/dist/daemon/lifecycle.js +118 -0
  92. package/dist/daemon/pid.d.ts +19 -6
  93. package/dist/daemon/pid.js +147 -13
  94. package/dist/daemon/route.d.ts +14 -0
  95. package/dist/daemon/route.js +40 -0
  96. package/dist/daemon/server.d.ts +11 -0
  97. package/dist/daemon/server.js +201 -50
  98. package/dist/daemon/types.d.ts +29 -1
  99. package/dist/daemon/types.js +1 -0
  100. package/dist/dinox.js +25 -1
  101. package/dist/powersync/connector.js +31 -16
  102. package/dist/powersync/exclusiveRuntime.d.ts +20 -0
  103. package/dist/powersync/exclusiveRuntime.js +48 -0
  104. package/dist/powersync/runtime.d.ts +25 -4
  105. package/dist/powersync/runtime.js +255 -35
  106. package/dist/powersync/syncGate.d.ts +4 -1
  107. package/dist/powersync/syncGate.js +11 -2
  108. package/dist/powersync/syncPass.d.ts +2 -0
  109. package/dist/powersync/syncPass.js +15 -4
  110. package/dist/powersync/tokenIndex.d.ts +13 -0
  111. package/dist/powersync/tokenIndex.js +216 -37
  112. package/dist/powersync/uploader.js +107 -52
  113. package/dist/utils/abort.js +0 -4
  114. package/dist/utils/asyncRelease.d.ts +2 -0
  115. package/dist/utils/asyncRelease.js +25 -0
  116. package/dist/utils/bidlinkCanonicalization.js +3 -0
  117. package/dist/utils/dryRun.d.ts +1 -1
  118. package/dist/utils/errors.d.ts +15 -1
  119. package/dist/utils/errors.js +223 -5
  120. package/dist/utils/output.d.ts +1 -0
  121. package/dist/utils/output.js +51 -15
  122. package/dist/utils/redact.js +1 -1
  123. package/dist/utils/sqliteLease.d.ts +8 -0
  124. package/dist/utils/sqliteLease.js +59 -0
  125. package/dist/utils/syncTimeout.d.ts +7 -1
  126. package/dist/utils/syncTimeout.js +8 -7
  127. package/dist/utils/terminalSanitization.js +6 -2
  128. package/dist/utils/tiptapMarkdown.js +49 -3
  129. package/dist/utils/tiptapMarkdownSyntax.d.ts +9 -0
  130. package/dist/utils/tiptapMarkdownSyntax.js +249 -0
  131. package/dist/utils/tokenize.js +24 -2
  132. package/dist/utils/updateNotice.js +60 -12
  133. package/package.json +14 -10
  134. package/dist/commands/mcp/auth.d.ts +0 -4
  135. package/dist/commands/mcp/auth.js +0 -75
  136. package/dist/commands/mcp/index.d.ts +0 -2
  137. package/dist/commands/mcp/index.js +0 -86
  138. package/dist/commands/mcp/noteContentTools.d.ts +0 -222
  139. package/dist/commands/mcp/noteContentTools.js +0 -390
  140. package/dist/commands/mcp/server.d.ts +0 -34
  141. package/dist/commands/mcp/server.js +0 -424
  142. package/dist/commands/mcp/tools.d.ts +0 -2
  143. package/dist/commands/mcp/tools.js +0 -32
  144. package/dist/commands/mcp/types.d.ts +0 -39
  145. package/dist/commands/mcp/types.js +0 -1
  146. package/dist/utils/noteContentEngine.d.ts +0 -333
  147. package/dist/utils/noteContentEngine.js +0 -740
@@ -1,333 +0,0 @@
1
- export type TiptapJsonNode = {
2
- type: string;
3
- attrs?: Record<string, unknown>;
4
- content?: TiptapJsonNode[];
5
- marks?: Array<Record<string, unknown>>;
6
- text?: string;
7
- [key: string]: unknown;
8
- };
9
- export type NoteContentEditErrorCode = 'invalid_plan' | 'invalid_content' | 'content_conflict' | 'target_not_found' | 'target_conflict';
10
- export declare class NoteContentEditError extends Error {
11
- readonly code: NoteContentEditErrorCode;
12
- readonly details?: unknown | undefined;
13
- constructor(code: NoteContentEditErrorCode, message: string, details?: unknown | undefined);
14
- }
15
- export declare const NOTE_CONTENT_EDIT_OPERATION_TYPES: readonly ["insertBlocksAfter", "insertBlocksBefore", "replaceBlocks", "deleteBlocks", "replaceText", "updateBlockAttrs", "replaceContainerContent"];
16
- type InlineSpec = {
17
- type: 'text';
18
- text: string;
19
- } | {
20
- type: 'hardBreak';
21
- } | {
22
- type: 'hashtag';
23
- id?: string | null;
24
- label?: string | null;
25
- path?: string | null;
26
- fullPath?: string | null;
27
- } | {
28
- type: 'bidlink';
29
- id: string;
30
- label?: string | null;
31
- href?: string | null;
32
- linkType?: string | null;
33
- } | {
34
- type: 'inlineMath';
35
- text: string;
36
- };
37
- export type NoteBlockSpec = {
38
- type: 'paragraph' | 'blockquote';
39
- text?: string;
40
- inline?: InlineSpec[];
41
- } | {
42
- type: 'heading';
43
- level: 1 | 2 | 3 | 4 | 5 | 6;
44
- text?: string;
45
- inline?: InlineSpec[];
46
- } | {
47
- type: 'bulletList' | 'orderedList';
48
- items: string[];
49
- } | {
50
- type: 'taskList';
51
- items: Array<string | {
52
- text: string;
53
- checked?: boolean | null;
54
- }>;
55
- } | {
56
- type: 'codeBlock';
57
- language?: string | null;
58
- text: string;
59
- } | {
60
- type: 'horizontalRule';
61
- } | {
62
- type: 'image';
63
- src?: string | null;
64
- alt?: string | null;
65
- title?: string | null;
66
- resourceId?: string | null;
67
- storageKey?: string | null;
68
- caption?: string | null;
69
- showCaption?: boolean | null;
70
- } | {
71
- type: 'video' | 'audio';
72
- src?: string | null;
73
- title?: string | null;
74
- poster?: string | null;
75
- preload?: string | null;
76
- resourceId?: string | null;
77
- storageKey?: string | null;
78
- autoplay?: boolean | null;
79
- loop?: boolean | null;
80
- muted?: boolean | null;
81
- playsInline?: boolean | null;
82
- } | {
83
- type: 'file';
84
- id?: string | null;
85
- src?: string | null;
86
- name?: string | null;
87
- mimeType?: string | null;
88
- size?: number | null;
89
- resourceId?: string | null;
90
- storageKey?: string | null;
91
- } | {
92
- type: 'table';
93
- rows: Array<{
94
- cells: string[];
95
- header?: boolean | null;
96
- }>;
97
- } | {
98
- type: 'mermaid';
99
- code: string;
100
- } | {
101
- type: 'mindgraph';
102
- markdown: string;
103
- };
104
- export type NoteEditTarget = {
105
- anchorId?: string;
106
- anchorIds?: string[];
107
- nodeIndex?: number;
108
- nodeRange?: string;
109
- expectedTextHash?: string;
110
- expectedNodeHash?: string;
111
- expectedTextSnippet?: string;
112
- textMatch?: string;
113
- };
114
- export type NoteEditOperation = {
115
- op: 'insertBlocksAfter' | 'insertBlocksBefore';
116
- target: NoteEditTarget;
117
- blocks: NoteBlockSpec[];
118
- reason?: string;
119
- } | {
120
- op: 'replaceBlocks';
121
- target: NoteEditTarget;
122
- blocks: NoteBlockSpec[];
123
- allowProtectedReplace?: boolean;
124
- reason?: string;
125
- } | {
126
- op: 'deleteBlocks';
127
- target: NoteEditTarget;
128
- allowProtectedDelete?: boolean;
129
- reason?: string;
130
- } | {
131
- op: 'replaceText';
132
- target: NoteEditTarget;
133
- matchText: string;
134
- replacementText: string;
135
- replaceAll?: boolean;
136
- reason?: string;
137
- } | {
138
- op: 'updateBlockAttrs';
139
- target: NoteEditTarget;
140
- attrs: Record<string, unknown>;
141
- reason?: string;
142
- } | {
143
- op: 'replaceContainerContent';
144
- target: NoteEditTarget;
145
- blocks: NoteBlockSpec[];
146
- reason?: string;
147
- };
148
- export type NoteEditPatch = {
149
- base: {
150
- contentHash: string;
151
- updatedAt?: string | null;
152
- version?: number | null;
153
- };
154
- operations: NoteEditOperation[];
155
- };
156
- export type NoteBlockDescriptor = {
157
- anchorId: string;
158
- hasStableAnchor: boolean;
159
- nodeIndex: number;
160
- nodeRange: string;
161
- type: string;
162
- editMode: string;
163
- level: number | null;
164
- text: string;
165
- textPreview: string;
166
- textHash: string;
167
- nodeHash: string;
168
- charCount: number;
169
- attrs?: Record<string, unknown>;
170
- };
171
- export declare function normalizeTiptapDocument(value: unknown): TiptapJsonNode;
172
- export declare function buildNoteEditContext(input: {
173
- noteId: string;
174
- title?: string | null;
175
- contentJson?: unknown;
176
- document?: unknown;
177
- updatedAt?: string | null;
178
- version?: number | null;
179
- }): {
180
- noteId: string;
181
- title: string;
182
- contentHash: string;
183
- updatedAt: string | null;
184
- version: number | null;
185
- document: TiptapJsonNode;
186
- blocks: {
187
- anchorId: string;
188
- hasStableAnchor: boolean;
189
- nodeIndex: number;
190
- nodeRange: string;
191
- type: string;
192
- editMode: string;
193
- level: number | null;
194
- text: string;
195
- textPreview: string;
196
- textHash: string;
197
- nodeHash: string;
198
- charCount: number;
199
- attrs: Record<string, unknown> | undefined;
200
- }[];
201
- chunks: {
202
- index: number;
203
- nodeRange: string;
204
- anchorIds: string[];
205
- textPreview: string;
206
- charCount: number;
207
- estimatedTokens: number;
208
- }[];
209
- totalCharCount: number;
210
- estimatedTokens: number;
211
- };
212
- export declare function applyNoteEditPatch(input: {
213
- noteId: string;
214
- title?: string | null;
215
- contentJson?: unknown;
216
- updatedAt?: string | null;
217
- version?: number | null;
218
- createAnchorId?: (node: TiptapJsonNode, index: number) => string;
219
- patch: NoteEditPatch;
220
- }): {
221
- noteId: string;
222
- changed: boolean;
223
- before: {
224
- noteId: string;
225
- title: string;
226
- contentHash: string;
227
- updatedAt: string | null;
228
- version: number | null;
229
- document: TiptapJsonNode;
230
- blocks: {
231
- anchorId: string;
232
- hasStableAnchor: boolean;
233
- nodeIndex: number;
234
- nodeRange: string;
235
- type: string;
236
- editMode: string;
237
- level: number | null;
238
- text: string;
239
- textPreview: string;
240
- textHash: string;
241
- nodeHash: string;
242
- charCount: number;
243
- attrs: Record<string, unknown> | undefined;
244
- }[];
245
- chunks: {
246
- index: number;
247
- nodeRange: string;
248
- anchorIds: string[];
249
- textPreview: string;
250
- charCount: number;
251
- estimatedTokens: number;
252
- }[];
253
- totalCharCount: number;
254
- estimatedTokens: number;
255
- };
256
- after: {
257
- noteId: string;
258
- title: string;
259
- contentHash: string;
260
- updatedAt: string | null;
261
- version: number | null;
262
- document: TiptapJsonNode;
263
- blocks: {
264
- anchorId: string;
265
- hasStableAnchor: boolean;
266
- nodeIndex: number;
267
- nodeRange: string;
268
- type: string;
269
- editMode: string;
270
- level: number | null;
271
- text: string;
272
- textPreview: string;
273
- textHash: string;
274
- nodeHash: string;
275
- charCount: number;
276
- attrs: Record<string, unknown> | undefined;
277
- }[];
278
- chunks: {
279
- index: number;
280
- nodeRange: string;
281
- anchorIds: string[];
282
- textPreview: string;
283
- charCount: number;
284
- estimatedTokens: number;
285
- }[];
286
- totalCharCount: number;
287
- estimatedTokens: number;
288
- };
289
- projection: {
290
- document: TiptapJsonNode;
291
- content_json: string;
292
- content_text: string;
293
- content_md: string;
294
- images: string;
295
- bid_links: string;
296
- contentHash: string;
297
- };
298
- appliedOperations: number;
299
- operationResults: {
300
- operationIndex: number;
301
- type: "insertBlocksAfter" | "insertBlocksBefore" | "replaceBlocks" | "deleteBlocks" | "replaceText" | "updateBlockAttrs" | "replaceContainerContent";
302
- success: boolean;
303
- target: string;
304
- nodeRange: string;
305
- error: null;
306
- }[];
307
- };
308
- export declare function projectNoteContent(document: TiptapJsonNode): {
309
- document: TiptapJsonNode;
310
- content_json: string;
311
- content_text: string;
312
- content_md: string;
313
- images: string;
314
- bid_links: string;
315
- contentHash: string;
316
- };
317
- export declare function topNodes(document: TiptapJsonNode): TiptapJsonNode[];
318
- export declare function parseNodeRangeString(spec: string, total: number): {
319
- start: number;
320
- end: number;
321
- };
322
- export declare function serializeAnchoredMarkdown(nodes: TiptapJsonNode[], blocks: NoteBlockDescriptor[], startIndex?: number): string;
323
- export declare function serializeAnchoredShorthand(nodes: TiptapJsonNode[], blocks: NoteBlockDescriptor[], startIndex?: number): string;
324
- export declare function blockTextHash(blocks: NoteBlockDescriptor[], start: number, end: number): string;
325
- export declare function blockNodeHash(blocks: NoteBlockDescriptor[], start: number, end: number): string;
326
- export declare function getNoteContentReadInstructions(): string;
327
- export declare function getNoteContentSchemaSummary(): {
328
- version: string;
329
- readFormat: string;
330
- editProtocol: string;
331
- operations: ("insertBlocksAfter" | "insertBlocksBefore" | "replaceBlocks" | "deleteBlocks" | "replaceText" | "updateBlockAttrs" | "replaceContainerContent")[];
332
- };
333
- export {};