@dinoxx/dinox-cli 1.0.20 → 1.0.21
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 +72 -139
- package/dist/auth/userInfo.d.ts +8 -1
- package/dist/auth/userInfo.js +38 -6
- package/dist/cli.js +0 -2
- package/dist/commands/auth/index.js +11 -4
- package/dist/commands/boxes/index.js +272 -52
- package/dist/commands/boxes/model.d.ts +34 -0
- package/dist/commands/boxes/model.js +78 -0
- package/dist/commands/boxes/operations.d.ts +86 -0
- package/dist/commands/boxes/operations.js +415 -0
- package/dist/commands/boxes/repo.d.ts +13 -6
- package/dist/commands/boxes/repo.js +272 -149
- package/dist/commands/boxes/store.d.ts +22 -0
- package/dist/commands/boxes/store.js +143 -0
- package/dist/commands/graph/index.js +2 -36
- package/dist/commands/mcp/noteContentTools.d.ts +222 -0
- package/dist/commands/mcp/noteContentTools.js +390 -0
- package/dist/commands/mcp/server.d.ts +3 -0
- package/dist/commands/mcp/server.js +43 -15
- package/dist/commands/mcp/tools.js +3 -1
- package/dist/commands/mcp/types.d.ts +6 -2
- package/dist/commands/meta/index.js +6 -22
- package/dist/commands/meta/repo.d.ts +0 -3
- package/dist/commands/meta/repo.js +1 -4
- package/dist/commands/notes/actions.d.ts +2 -0
- package/dist/commands/notes/actions.js +149 -55
- package/dist/commands/notes/bulk.d.ts +34 -0
- package/dist/commands/notes/bulk.js +204 -0
- package/dist/commands/notes/contentEngine.d.ts +95 -0
- package/dist/commands/notes/contentEngine.js +652 -0
- package/dist/commands/notes/contentPatch.d.ts +84 -0
- package/dist/commands/notes/contentPatch.js +337 -0
- package/dist/commands/notes/contentPatchCommand.d.ts +3 -0
- package/dist/commands/notes/contentPatchCommand.js +126 -0
- package/dist/commands/notes/descriptors.js +192 -40
- package/dist/commands/notes/export.d.ts +21 -0
- package/dist/commands/notes/export.js +224 -0
- package/dist/commands/notes/metadataMutation.d.ts +28 -0
- package/dist/commands/notes/metadataMutation.js +127 -0
- package/dist/commands/notes/repo.d.ts +20 -0
- package/dist/commands/notes/repo.js +135 -18
- package/dist/commands/notes/runtime.d.ts +3 -12
- package/dist/commands/notes/runtime.js +4 -30
- package/dist/commands/notes/searchSql.js +1 -1
- package/dist/commands/prompt/index.js +15 -45
- package/dist/commands/prompt/repo.js +2 -2
- package/dist/commands/runtime.d.ts +26 -0
- package/dist/commands/runtime.js +76 -0
- package/dist/commands/schema/renderSkills.js +20 -7
- package/dist/commands/schema/spec.d.ts +1 -2
- package/dist/commands/schema/spec.js +2 -3
- package/dist/commands/schema/types.d.ts +0 -13
- package/dist/commands/storage/index.js +30 -60
- package/dist/commands/sync.js +4 -2
- package/dist/commands/tags/content.d.ts +32 -0
- package/dist/commands/tags/content.js +243 -0
- package/dist/commands/tags/index.js +285 -49
- package/dist/commands/tags/model.d.ts +38 -0
- package/dist/commands/tags/model.js +100 -0
- package/dist/commands/tags/operations.d.ts +105 -0
- package/dist/commands/tags/operations.js +438 -0
- package/dist/commands/tags/repo.d.ts +5 -1
- package/dist/commands/tags/repo.js +142 -218
- package/dist/commands/tags/store.d.ts +28 -0
- package/dist/commands/tags/store.js +166 -0
- package/dist/commands/todo/index.js +30 -61
- package/dist/commands/writeDryRun.d.ts +25 -0
- package/dist/commands/writeDryRun.js +31 -1
- package/dist/config/resolve.js +2 -2
- package/dist/daemon/index.d.ts +2 -0
- package/dist/daemon/index.js +176 -58
- package/dist/powersync/runtime.d.ts +1 -0
- package/dist/powersync/runtime.js +10 -0
- package/dist/powersync/schema/content.d.ts +2 -0
- package/dist/powersync/schema/content.js +2 -0
- package/dist/powersync/schema/index.d.ts +2 -0
- package/dist/skills/check.d.ts +1 -1
- package/dist/skills/check.js +27 -2
- package/dist/utils/authToken.d.ts +2 -0
- package/dist/utils/authToken.js +7 -2
- package/dist/utils/noteContentEngine.d.ts +333 -0
- package/dist/utils/noteContentEngine.js +740 -0
- package/dist/utils/tiptapMarkdownSchema.js +31 -0
- package/package.json +4 -8
package/dist/skills/check.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export type SkillCheckIssue = {
|
|
|
2
2
|
skill: string;
|
|
3
3
|
message: string;
|
|
4
4
|
};
|
|
5
|
-
export declare function checkSkillContent(skill: string, content: string, skillDir?: string): SkillCheckIssue[];
|
|
5
|
+
export declare function checkSkillContent(skill: string, content: string, skillDir?: string, expectedVersion?: string): SkillCheckIssue[];
|
|
6
6
|
export declare function checkSkillsDirectory(skillsDir: string): SkillCheckIssue[];
|
package/dist/skills/check.js
CHANGED
|
@@ -5,6 +5,7 @@ const EXEMPT_SHARED_REFERENCE = new Set(['dino-dinox', 'dino-shared']);
|
|
|
5
5
|
const SHARED_REFERENCE_PATTERN = /\.\.\/dino-shared\/SKILL\.md/;
|
|
6
6
|
const BINS_PATTERN = /^metadata:\s*[\s\S]*?^ requires:\s*[\s\S]*?^ bins:\s*\[(.*?)\]\s*$/m;
|
|
7
7
|
const CLI_HELP_PATTERN = /^metadata:\s*[\s\S]*?^ cliHelp:\s*.+$/m;
|
|
8
|
+
const SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
|
|
8
9
|
const commandSchemas = listCommandSchemas();
|
|
9
10
|
const commandSchemaPrefixes = commandSchemas
|
|
10
11
|
.map((schema) => ({
|
|
@@ -166,7 +167,7 @@ function checkMarkdownDocument(skill, content, relativePath, skillDir) {
|
|
|
166
167
|
}
|
|
167
168
|
return issues;
|
|
168
169
|
}
|
|
169
|
-
export function checkSkillContent(skill, content, skillDir) {
|
|
170
|
+
export function checkSkillContent(skill, content, skillDir, expectedVersion) {
|
|
170
171
|
const issues = [];
|
|
171
172
|
const parsed = parseFrontmatter(content);
|
|
172
173
|
if (!parsed) {
|
|
@@ -183,6 +184,19 @@ export function checkSkillContent(skill, content, skillDir) {
|
|
|
183
184
|
if (!/^description:\s*/m.test(frontmatter)) {
|
|
184
185
|
issues.push({ skill, message: "Frontmatter is missing 'description'." });
|
|
185
186
|
}
|
|
187
|
+
const versionMatch = frontmatter.match(/^version:\s*(.+)$/m);
|
|
188
|
+
if (!versionMatch) {
|
|
189
|
+
issues.push({ skill, message: "Frontmatter is missing 'version'." });
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
const version = versionMatch[1]?.trim() ?? '';
|
|
193
|
+
if (!SEMVER_PATTERN.test(version)) {
|
|
194
|
+
issues.push({ skill, message: "Frontmatter 'version' must be a semver string." });
|
|
195
|
+
}
|
|
196
|
+
if (expectedVersion && version !== expectedVersion) {
|
|
197
|
+
issues.push({ skill, message: `Frontmatter version must match skills/VERSION (${expectedVersion}).` });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
186
200
|
if (!/^metadata:\s*$/m.test(frontmatter)) {
|
|
187
201
|
issues.push({ skill, message: "Frontmatter is missing 'metadata'." });
|
|
188
202
|
}
|
|
@@ -230,6 +244,17 @@ export function checkSkillContent(skill, content, skillDir) {
|
|
|
230
244
|
}
|
|
231
245
|
export function checkSkillsDirectory(skillsDir) {
|
|
232
246
|
const issues = [];
|
|
247
|
+
const versionFile = path.join(skillsDir, 'VERSION');
|
|
248
|
+
let expectedVersion;
|
|
249
|
+
if (!fs.existsSync(versionFile)) {
|
|
250
|
+
issues.push({ skill: 'VERSION', message: 'Missing skills/VERSION.' });
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
expectedVersion = fs.readFileSync(versionFile, 'utf8').trim();
|
|
254
|
+
if (!SEMVER_PATTERN.test(expectedVersion)) {
|
|
255
|
+
issues.push({ skill: 'VERSION', message: 'skills/VERSION must contain a semver string.' });
|
|
256
|
+
}
|
|
257
|
+
}
|
|
233
258
|
const entries = fs.readdirSync(skillsDir, { withFileTypes: true })
|
|
234
259
|
.filter((entry) => entry.isDirectory())
|
|
235
260
|
.map((entry) => entry.name)
|
|
@@ -241,7 +266,7 @@ export function checkSkillsDirectory(skillsDir) {
|
|
|
241
266
|
continue;
|
|
242
267
|
}
|
|
243
268
|
const content = fs.readFileSync(skillFile, 'utf8');
|
|
244
|
-
issues.push(...checkSkillContent(skill, content, path.dirname(skillFile)));
|
|
269
|
+
issues.push(...checkSkillContent(skill, content, path.dirname(skillFile), expectedVersion));
|
|
245
270
|
const markdownFiles = walkMarkdownFiles(path.dirname(skillFile))
|
|
246
271
|
.filter((file) => file !== skillFile);
|
|
247
272
|
for (const markdownFile of markdownFiles) {
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export declare const DINOX_TOKEN_ENV_VAR = "DINOX_TOKEN";
|
|
1
2
|
export declare function normalizeAuthToken(value: unknown): string | undefined;
|
|
3
|
+
export declare function readEnvAuthToken(env?: NodeJS.ProcessEnv): string | undefined;
|
|
2
4
|
export declare function toAuthorizationHeaderValue(token: string): string;
|
package/dist/utils/authToken.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export const DINOX_TOKEN_ENV_VAR = 'DINOX_TOKEN';
|
|
1
2
|
export function normalizeAuthToken(value) {
|
|
2
3
|
if (typeof value !== 'string') {
|
|
3
4
|
return undefined;
|
|
@@ -6,12 +7,16 @@ export function normalizeAuthToken(value) {
|
|
|
6
7
|
if (!trimmed) {
|
|
7
8
|
return undefined;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const bearerMatch = trimmed.match(/^bearer(?:\s+(.+))?$/i);
|
|
11
|
+
if (bearerMatch) {
|
|
12
|
+
const withoutPrefix = bearerMatch[1]?.trim();
|
|
11
13
|
return withoutPrefix || undefined;
|
|
12
14
|
}
|
|
13
15
|
return trimmed;
|
|
14
16
|
}
|
|
17
|
+
export function readEnvAuthToken(env = process.env) {
|
|
18
|
+
return normalizeAuthToken(env[DINOX_TOKEN_ENV_VAR]);
|
|
19
|
+
}
|
|
15
20
|
export function toAuthorizationHeaderValue(token) {
|
|
16
21
|
// Backend expects a standard Authorization header. Be defensive: callers may pass
|
|
17
22
|
// a full "Bearer ..." header value or a raw token.
|
|
@@ -0,0 +1,333 @@
|
|
|
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 {};
|