@dreamlake/dreamlake-cli 0.104.8 → 0.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +27 -17
- package/dist/api/index.js +25 -16
- package/dist/api/memo-character-plan.d.ts +2 -0
- package/dist/api/memo-character-plan.js +2 -0
- package/dist/api/memo-editing.d.ts +2 -0
- package/dist/api/memo-editing.js +2 -0
- package/dist/api/memo-edits.d.ts +63 -0
- package/dist/api/memo-edits.js +206 -0
- package/dist/api/memo-events.d.ts +44 -0
- package/dist/api/memo-events.js +65 -0
- package/dist/api/memo-facade.d.ts +294 -0
- package/dist/api/memo-facade.js +382 -0
- package/dist/api/memo-files.d.ts +111 -0
- package/dist/api/memo-files.js +110 -0
- package/dist/api/memo-html-read.d.ts +2 -0
- package/dist/api/memo-html-read.js +2 -0
- package/dist/api/memo-html.d.ts +2 -0
- package/dist/api/memo-html.js +2 -0
- package/dist/api/memo-linger.d.ts +85 -0
- package/dist/api/memo-linger.js +271 -0
- package/dist/api/memo-presence.d.ts +109 -0
- package/dist/api/memo-presence.js +75 -0
- package/dist/api/memo-reading.d.ts +55 -0
- package/dist/api/memo-reading.js +43 -0
- package/dist/api/memo-toc.d.ts +2 -0
- package/dist/api/memo-toc.js +2 -0
- package/dist/api/memo-write.d.ts +119 -0
- package/dist/api/memo-write.js +221 -0
- package/dist/api/memos.d.ts +344 -0
- package/dist/api/memos.js +231 -0
- package/dist/api/note-character-plan.d.ts +2 -2
- package/dist/api/note-character-plan.js +2 -2
- package/dist/api/note-editing.d.ts +2 -2
- package/dist/api/note-editing.js +2 -2
- package/dist/api/note-edits.d.ts +2 -59
- package/dist/api/note-edits.js +2 -205
- package/dist/api/note-events.d.ts +2 -41
- package/dist/api/note-events.js +2 -64
- package/dist/api/note-facade.d.ts +2 -268
- package/dist/api/note-facade.js +2 -376
- package/dist/api/note-files.d.ts +2 -102
- package/dist/api/note-files.js +2 -107
- package/dist/api/note-html-read.d.ts +2 -2
- package/dist/api/note-html-read.js +2 -2
- package/dist/api/note-html.d.ts +2 -2
- package/dist/api/note-html.js +2 -2
- package/dist/api/note-linger.d.ts +2 -83
- package/dist/api/note-linger.js +2 -270
- package/dist/api/note-presence.d.ts +2 -100
- package/dist/api/note-presence.js +2 -73
- package/dist/api/note-reading.d.ts +2 -51
- package/dist/api/note-reading.js +2 -42
- package/dist/api/note-toc.d.ts +2 -2
- package/dist/api/note-toc.js +2 -2
- package/dist/api/note-write.d.ts +2 -110
- package/dist/api/note-write.js +2 -217
- package/dist/api/notes.d.ts +2 -335
- package/dist/api/notes.js +2 -230
- package/dist/api/open-resources.js +3 -3
- package/dist/cli/folders/index.d.ts +1 -1
- package/dist/cli/folders/index.js +4 -4
- package/dist/cli/index.js +2 -2
- package/dist/cli/{notes → memos}/api-transport.d.ts +1 -1
- package/dist/cli/{notes → memos}/api-transport.js +1 -1
- package/dist/cli/{notes → memos}/archive-command.d.ts +1 -1
- package/dist/cli/{notes → memos}/archive-command.js +5 -5
- package/dist/cli/{notes → memos}/character-plan.d.ts +3 -1
- package/dist/cli/{notes → memos}/character-plan.js +7 -5
- package/dist/cli/{notes → memos}/document.d.ts +9 -9
- package/dist/cli/{notes → memos}/document.js +12 -12
- package/dist/cli/{notes → memos}/edit-commands.d.ts +8 -8
- package/dist/cli/{notes → memos}/edit-commands.js +14 -14
- package/dist/cli/{notes → memos}/events.d.ts +3 -3
- package/dist/cli/{notes → memos}/events.js +2 -2
- package/dist/cli/{notes → memos}/files-commands.d.ts +2 -2
- package/dist/cli/{notes → memos}/files-commands.js +5 -5
- package/dist/cli/{notes → memos}/index.d.ts +16 -16
- package/dist/cli/{notes → memos}/index.js +53 -53
- package/dist/cli/{notes → memos}/linger.d.ts +3 -3
- package/dist/cli/{notes → memos}/linger.js +5 -5
- package/dist/cli/{notes → memos}/move-command.d.ts +5 -5
- package/dist/cli/{notes → memos}/move-command.js +6 -6
- package/dist/cli/{notes → memos}/rm-command.d.ts +2 -2
- package/dist/cli/{notes → memos}/rm-command.js +2 -2
- package/dist/cli/{notes → memos}/select-command.d.ts +1 -1
- package/dist/cli/{notes → memos}/select-command.js +4 -4
- package/dist/cli/{notes → memos}/suggest-diff.d.ts +1 -1
- package/dist/cli/{notes → memos}/suggest-diff.js +2 -2
- package/dist/cli/{notes → memos}/transfer-command.d.ts +2 -2
- package/dist/cli/{notes → memos}/transfer-command.js +2 -2
- package/dist/cli/share.d.ts +1 -1
- package/dist/cli/share.js +1 -1
- package/dist/cli/update/index.js +3 -3
- package/dist/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/package.json +9 -9
- /package/dist/cli/{notes → memos}/editing.d.ts +0 -0
- /package/dist/cli/{notes → memos}/editing.js +0 -0
- /package/dist/cli/{notes → memos}/html-read.d.ts +0 -0
- /package/dist/cli/{notes → memos}/html-read.js +0 -0
- /package/dist/cli/{notes → memos}/html.d.ts +0 -0
- /package/dist/cli/{notes → memos}/html.js +0 -0
- /package/dist/cli/{notes → memos}/media-commands.d.ts +0 -0
- /package/dist/cli/{notes → memos}/media-commands.js +0 -0
- /package/dist/cli/{notes → memos}/toc.d.ts +0 -0
- /package/dist/cli/{notes → memos}/toc.js +0 -0
- /package/dist/cli/{notes → memos}/version-commands.d.ts +0 -0
- /package/dist/cli/{notes → memos}/version-commands.js +0 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { type MemoReadingOptions } from "./memo-reading.js";
|
|
2
|
+
import * as editing from "./memo-editing.js";
|
|
3
|
+
import { type MemoLingerOptions, type MemoLingerEvent } from "./memo-linger.js";
|
|
4
|
+
import type { Query } from "./common.js";
|
|
5
|
+
import { type MemoSource, type MemoEdit } from "./memo-edits.js";
|
|
6
|
+
export { memoEdits, type MemoSource, type MemoEdit, type MemoPatch, noteEdits, type NoteSource, type NoteEdit, type NotePatch, } from "./memo-edits.js";
|
|
7
|
+
import { type Transport } from "./client.js";
|
|
8
|
+
import { type MemoPatchRequest, type MemoWriteReceipt, type MemoCommandStatus } from "./memo-write.js";
|
|
9
|
+
export interface MemoSearchHit {
|
|
10
|
+
noteId: string;
|
|
11
|
+
noteSlug: string;
|
|
12
|
+
noteName: string;
|
|
13
|
+
etag: string;
|
|
14
|
+
line: number;
|
|
15
|
+
column: number;
|
|
16
|
+
ind: [number, number];
|
|
17
|
+
text: string;
|
|
18
|
+
match: string;
|
|
19
|
+
before: string[];
|
|
20
|
+
after: string[];
|
|
21
|
+
anchor: string;
|
|
22
|
+
}
|
|
23
|
+
export interface MemoSearchPage {
|
|
24
|
+
hits: MemoSearchHit[];
|
|
25
|
+
nextCursor: string | null;
|
|
26
|
+
truncated: boolean;
|
|
27
|
+
notesSearched: number;
|
|
28
|
+
partialNotes: string[];
|
|
29
|
+
staleNotes: number;
|
|
30
|
+
}
|
|
31
|
+
export interface MemoRow {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
slug: string;
|
|
35
|
+
namespaceSlug?: string;
|
|
36
|
+
visibility?: string;
|
|
37
|
+
updatedAt?: string;
|
|
38
|
+
/** Independent lifecycle state; null/missing means active. */
|
|
39
|
+
archivedAt?: string | null;
|
|
40
|
+
matches?: {
|
|
41
|
+
anchor: string;
|
|
42
|
+
title: string;
|
|
43
|
+
snippet: string;
|
|
44
|
+
}[];
|
|
45
|
+
}
|
|
46
|
+
export interface MemoReadResult {
|
|
47
|
+
note: string;
|
|
48
|
+
hash: string;
|
|
49
|
+
revision: string;
|
|
50
|
+
content?: string;
|
|
51
|
+
base?: string;
|
|
52
|
+
patch?: string;
|
|
53
|
+
format?: "diff" | "inline-dff";
|
|
54
|
+
since?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface MemoVersion {
|
|
57
|
+
id: string;
|
|
58
|
+
hash: string;
|
|
59
|
+
tag: string;
|
|
60
|
+
summary: string;
|
|
61
|
+
parentId: string | null;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
text?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface MemoBody {
|
|
66
|
+
text: string;
|
|
67
|
+
etag: string;
|
|
68
|
+
sizeBytes: number;
|
|
69
|
+
}
|
|
70
|
+
export interface Section {
|
|
71
|
+
anchor: string;
|
|
72
|
+
title: string;
|
|
73
|
+
level: number;
|
|
74
|
+
start: number;
|
|
75
|
+
end: number;
|
|
76
|
+
}
|
|
77
|
+
export interface WriteReceipt {
|
|
78
|
+
etag: string;
|
|
79
|
+
sizeBytes: number;
|
|
80
|
+
sections?: Section[];
|
|
81
|
+
}
|
|
82
|
+
export interface MemoMediaReceipt {
|
|
83
|
+
url: string;
|
|
84
|
+
contentType: string;
|
|
85
|
+
sizeBytes: number;
|
|
86
|
+
}
|
|
87
|
+
export declare function memosApi(t: Transport, namespace: string): {
|
|
88
|
+
linger: (noteId: string, options: MemoLingerOptions, receive: (event: MemoLingerEvent) => void | Promise<void>) => Promise<void>;
|
|
89
|
+
namespace: string;
|
|
90
|
+
/** Resolve the same ID, exact slug or exact title accepted by the CLI in this namespace. */
|
|
91
|
+
resolve: (ref: string) => Promise<string>;
|
|
92
|
+
/** CSS inspection is read-only; selectText publishes a separate agent selection. */
|
|
93
|
+
selectElement: (noteId: string, css: string) => Promise<{
|
|
94
|
+
etag: string;
|
|
95
|
+
tag: string;
|
|
96
|
+
attrs: Record<string, string | null>;
|
|
97
|
+
outer: [number, number];
|
|
98
|
+
inner: [number, number];
|
|
99
|
+
text: string;
|
|
100
|
+
}>;
|
|
101
|
+
source: (noteId: string, at?: string) => Promise<MemoSource>;
|
|
102
|
+
patch: (noteId: string, input: MemoPatchRequest, options?: {
|
|
103
|
+
ifMatch?: string;
|
|
104
|
+
baseline?: MemoSource;
|
|
105
|
+
}) => Promise<MemoWriteReceipt>;
|
|
106
|
+
replaceContent: (noteId: string, baseRevision: string, content: string, mode?: "exact" | "merge", options?: {
|
|
107
|
+
commandId?: string;
|
|
108
|
+
}) => Promise<MemoWriteReceipt>;
|
|
109
|
+
replace: (noteId: string, baseRevision: string, text: string, where: editing.Where, mode?: "exact" | "merge", options?: {
|
|
110
|
+
commandId?: string;
|
|
111
|
+
}) => Promise<MemoWriteReceipt>;
|
|
112
|
+
insert: (noteId: string, baseRevision: string, text: string, where: {
|
|
113
|
+
line?: number;
|
|
114
|
+
ind?: number;
|
|
115
|
+
}, mode?: "exact" | "merge", options?: {
|
|
116
|
+
commandId?: string;
|
|
117
|
+
}) => Promise<MemoWriteReceipt>;
|
|
118
|
+
removeText: (noteId: string, baseRevision: string, where: editing.Where, mode?: "exact" | "merge", options?: {
|
|
119
|
+
commandId?: string;
|
|
120
|
+
}) => Promise<MemoWriteReceipt>;
|
|
121
|
+
findInSource: (noteId: string, at: string, query?: string, options?: editing.FindOpts) => Promise<{
|
|
122
|
+
matches: editing.Match[];
|
|
123
|
+
note: string;
|
|
124
|
+
content: string;
|
|
125
|
+
hash: string;
|
|
126
|
+
revision: string;
|
|
127
|
+
}>;
|
|
128
|
+
outline: (noteId: string, at?: string) => Promise<{
|
|
129
|
+
note: string;
|
|
130
|
+
revision: string;
|
|
131
|
+
hash: string;
|
|
132
|
+
entries: import("./memo-toc.js").TocEntry[];
|
|
133
|
+
}>;
|
|
134
|
+
get: (noteId: string) => Promise<MemoRow & {
|
|
135
|
+
namespaceSlug: string;
|
|
136
|
+
permissions: Record<string, boolean>;
|
|
137
|
+
}>;
|
|
138
|
+
/** Archive independently of delete/tags. A saved edit restores the note and its folder path. */
|
|
139
|
+
archive: (noteId: string) => Promise<MemoRow>;
|
|
140
|
+
unarchive: (noteId: string) => Promise<MemoRow>;
|
|
141
|
+
delete: (noteId: string) => Promise<unknown>;
|
|
142
|
+
shared: (query?: {
|
|
143
|
+
includeArchived?: boolean;
|
|
144
|
+
}) => Promise<{
|
|
145
|
+
notes: MemoRow[];
|
|
146
|
+
}>;
|
|
147
|
+
projects: (noteId: string, view?: "nodes") => Promise<unknown>;
|
|
148
|
+
move: (noteId: string, input: {
|
|
149
|
+
namespace: string;
|
|
150
|
+
projects: string[];
|
|
151
|
+
dryRun?: boolean;
|
|
152
|
+
}) => Promise<unknown>;
|
|
153
|
+
share: (noteId: string) => {
|
|
154
|
+
get: () => Promise<Record<string, unknown>>;
|
|
155
|
+
create: (role?: "read" | "write") => Promise<unknown>;
|
|
156
|
+
revoke: (revokeAccepted?: boolean) => Promise<unknown>;
|
|
157
|
+
visibility: (visibility: "private" | "public" | "team") => Promise<unknown>;
|
|
158
|
+
access: () => Promise<unknown>;
|
|
159
|
+
remove: (userId: string) => Promise<unknown>;
|
|
160
|
+
};
|
|
161
|
+
files: (noteId: string) => {
|
|
162
|
+
list: (query?: import("./memo-files.js").MemoFileListOptions) => Promise<import("./memo-files.js").MemoFilePage>;
|
|
163
|
+
get: (id: string) => Promise<import("./memo-files.js").MemoFile>;
|
|
164
|
+
resolve: (ref: string, includeTrashed?: boolean) => Promise<import("./memo-files.js").MemoFile>;
|
|
165
|
+
text: (ref: string) => Promise<{
|
|
166
|
+
text: string;
|
|
167
|
+
etag: string;
|
|
168
|
+
}>;
|
|
169
|
+
cat: (ref: string) => Promise<{
|
|
170
|
+
text: string;
|
|
171
|
+
etag: string;
|
|
172
|
+
}>;
|
|
173
|
+
download: (ref: string, signal?: AbortSignal) => Promise<Response>;
|
|
174
|
+
upload: (path: string, body: NonNullable<import("./client.js").RequestOptions["body"]> | import("stream").Readable, options?: {
|
|
175
|
+
contentType?: string;
|
|
176
|
+
overwrite?: boolean;
|
|
177
|
+
ifMatch?: string;
|
|
178
|
+
contentLength?: number;
|
|
179
|
+
signal?: AbortSignal;
|
|
180
|
+
}) => Promise<import("./memo-files.js").MemoFile>;
|
|
181
|
+
write: (input: {
|
|
182
|
+
path: string;
|
|
183
|
+
text: string;
|
|
184
|
+
overwrite?: boolean;
|
|
185
|
+
contentType?: string;
|
|
186
|
+
}, options?: {
|
|
187
|
+
ifMatch?: string;
|
|
188
|
+
idempotencyKey?: string;
|
|
189
|
+
}) => Promise<import("./memo-files.js").MemoFileWriteReceipt>;
|
|
190
|
+
move: (ref: string, path: string, options?: {
|
|
191
|
+
overwrite?: boolean;
|
|
192
|
+
ifMatch?: string;
|
|
193
|
+
}) => Promise<import("./memo-files.js").MemoFile>;
|
|
194
|
+
copy: (ref: string, path: string, options?: {
|
|
195
|
+
overwrite?: boolean;
|
|
196
|
+
idempotencyKey?: string;
|
|
197
|
+
}) => Promise<import("./memo-files.js").MemoFileWriteReceipt>;
|
|
198
|
+
operation: (operationId: string, action?: "status" | "reconcile" | "cancel") => Promise<import("./memo-files.js").MemoFileOperationReceipt>;
|
|
199
|
+
status: (id: string) => Promise<import("./memo-files.js").MemoFileOperationReceipt>;
|
|
200
|
+
reconcile: (id: string) => Promise<import("./memo-files.js").MemoFileOperationReceipt>;
|
|
201
|
+
cancel: (id: string) => Promise<import("./memo-files.js").MemoFileOperationReceipt>;
|
|
202
|
+
delete: (ref: string, options?: {
|
|
203
|
+
purge?: boolean;
|
|
204
|
+
ifMatch?: string;
|
|
205
|
+
}) => Promise<{
|
|
206
|
+
id: string;
|
|
207
|
+
purged: boolean;
|
|
208
|
+
}>;
|
|
209
|
+
restore: (ref: string, path?: string) => Promise<import("./memo-files.js").MemoFile>;
|
|
210
|
+
preview: (ref: string, share?: boolean) => Promise<import("./memo-files.js").MemoFilePreview>;
|
|
211
|
+
revokePreview: (ref: string) => Promise<{
|
|
212
|
+
id: string;
|
|
213
|
+
shared: boolean;
|
|
214
|
+
}>;
|
|
215
|
+
};
|
|
216
|
+
media: (form: FormData) => Promise<MemoMediaReceipt>;
|
|
217
|
+
read: (noteId: string, query?: Query, options?: {
|
|
218
|
+
ifMatch?: string;
|
|
219
|
+
}) => Promise<MemoReadResult>;
|
|
220
|
+
readView: (noteId: string, options?: MemoReadingOptions) => Promise<import("./memo-reading.js").MemoReadingPage>;
|
|
221
|
+
html: (noteId: string, options?: {
|
|
222
|
+
at?: string;
|
|
223
|
+
section?: string;
|
|
224
|
+
toc?: boolean;
|
|
225
|
+
tag?: string;
|
|
226
|
+
ifMatch?: string;
|
|
227
|
+
}) => Promise<{
|
|
228
|
+
note: string;
|
|
229
|
+
revision: string;
|
|
230
|
+
html: string;
|
|
231
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
232
|
+
}>;
|
|
233
|
+
diff: (noteId: string, query: {
|
|
234
|
+
from?: string;
|
|
235
|
+
to?: string;
|
|
236
|
+
since?: string;
|
|
237
|
+
format?: "diff" | "inline-dff";
|
|
238
|
+
}) => Promise<unknown>;
|
|
239
|
+
saveVersion: (noteId: string, input: {
|
|
240
|
+
hash: string;
|
|
241
|
+
tag?: string;
|
|
242
|
+
summary?: string;
|
|
243
|
+
parentId?: string;
|
|
244
|
+
}) => Promise<unknown>;
|
|
245
|
+
find: (query: {
|
|
246
|
+
q: string;
|
|
247
|
+
note?: string;
|
|
248
|
+
cursor?: string;
|
|
249
|
+
limit?: number;
|
|
250
|
+
includeArchived?: boolean;
|
|
251
|
+
caseSensitive?: boolean;
|
|
252
|
+
glob?: string;
|
|
253
|
+
regex?: string;
|
|
254
|
+
flags?: string;
|
|
255
|
+
context?: string;
|
|
256
|
+
}) => Promise<MemoSearchPage>;
|
|
257
|
+
create: (input: {
|
|
258
|
+
name: string;
|
|
259
|
+
summary?: string;
|
|
260
|
+
projects?: string[];
|
|
261
|
+
visibility?: "private" | "public";
|
|
262
|
+
}) => Promise<{
|
|
263
|
+
note: MemoRow;
|
|
264
|
+
rtc: {
|
|
265
|
+
rtcDocId: string;
|
|
266
|
+
};
|
|
267
|
+
}>;
|
|
268
|
+
edit: (noteId: string, baseRevision: string, edits: MemoEdit[], mode?: "merge" | "exact", options?: {
|
|
269
|
+
commandId?: string;
|
|
270
|
+
}) => Promise<MemoWriteReceipt>;
|
|
271
|
+
/** The durable record of one command id, scoped to the calling actor; 404 `command_not_found` when none. */
|
|
272
|
+
commandStatus: (noteId: string, commandId: string) => Promise<MemoCommandStatus>;
|
|
273
|
+
versions: (noteId: string, query?: {
|
|
274
|
+
before?: string;
|
|
275
|
+
}) => Promise<{
|
|
276
|
+
versions: MemoVersion[];
|
|
277
|
+
nextCursor?: string | null;
|
|
278
|
+
}>;
|
|
279
|
+
version: (noteId: string, versionId: string) => Promise<MemoVersion>;
|
|
280
|
+
list: (query?: {
|
|
281
|
+
q?: string;
|
|
282
|
+
limit?: number;
|
|
283
|
+
offset?: number;
|
|
284
|
+
includeArchived?: boolean;
|
|
285
|
+
}) => Promise<{
|
|
286
|
+
notes: MemoRow[];
|
|
287
|
+
}>;
|
|
288
|
+
search: (q: string, limit?: number, offset?: number, options?: {
|
|
289
|
+
includeArchived?: boolean;
|
|
290
|
+
}) => Promise<{
|
|
291
|
+
notes: MemoRow[];
|
|
292
|
+
total: number;
|
|
293
|
+
}>;
|
|
294
|
+
body: (noteId: string) => Promise<MemoBody>;
|
|
295
|
+
sections: (noteId: string) => Promise<{
|
|
296
|
+
sections: Section[];
|
|
297
|
+
etag: string;
|
|
298
|
+
}>;
|
|
299
|
+
section: (noteId: string, anchor: string) => Promise<MemoBody & Partial<Section>>;
|
|
300
|
+
/** Replace the whole body, refused with 412 `stale` unless `ifMatch` is the current etag. */
|
|
301
|
+
write: (noteId: string, text: string, ifMatch: string) => Promise<WriteReceipt>;
|
|
302
|
+
/** Read-then-conditional-write append; a concurrent edit refuses with 412 `stale` instead of being overwritten. */
|
|
303
|
+
append: (noteId: string, addition: string, ifMatch?: string) => Promise<WriteReceipt>;
|
|
304
|
+
addSection: (noteId: string, text: string, placement?: {
|
|
305
|
+
before?: string;
|
|
306
|
+
after?: string;
|
|
307
|
+
}, ifMatch?: string) => Promise<WriteReceipt>;
|
|
308
|
+
removeSection: (noteId: string, anchor: string, ifMatch?: string) => Promise<WriteReceipt>;
|
|
309
|
+
contributors: (id: string, options?: {
|
|
310
|
+
cursor?: string;
|
|
311
|
+
pageSize?: number;
|
|
312
|
+
}) => Promise<import("./memo-presence.js").MemoContributorsPage>;
|
|
313
|
+
presence: {
|
|
314
|
+
(id: string): Promise<import("./memo-presence.js").MemoPresenceRoster>;
|
|
315
|
+
(id: string, input: Record<string, unknown>): Promise<import("./memo-presence.js").MemoPresenceReceipt>;
|
|
316
|
+
};
|
|
317
|
+
presenceText: (id: string) => Promise<string>;
|
|
318
|
+
updatePresence: (id: string, input: Record<string, unknown>, options?: import("./client.js").RequestOptions) => Promise<import("./memo-presence.js").MemoPresenceReceipt>;
|
|
319
|
+
visit: (id: string, options?: {
|
|
320
|
+
intent?: string;
|
|
321
|
+
}) => Promise<import("./memo-presence.js").MemoPresenceReceipt>;
|
|
322
|
+
activity: (id: string, options?: import("./client.js").RequestOptions) => Promise<{
|
|
323
|
+
activities: import("./memo-presence.js").MemoActivity[];
|
|
324
|
+
}>;
|
|
325
|
+
events: (id: string, signal: AbortSignal, receive: (event: import("./memo-events.js").MemoEvent) => void) => Promise<void>;
|
|
326
|
+
selectText: (id: string, options: import("./memo-presence.js").MemoSelectionOptions) => Promise<import("./memo-presence.js").MemoSelectionReceipt>;
|
|
327
|
+
} & {
|
|
328
|
+
/** The full original span of one mapped element (`s1.p2`) at a revision: the scoped HTML read's absolute code-point range. */
|
|
329
|
+
addressRange: (noteId: string, address: string, at: string) => Promise<{
|
|
330
|
+
start: number;
|
|
331
|
+
end: number;
|
|
332
|
+
revision: string;
|
|
333
|
+
}>;
|
|
334
|
+
};
|
|
335
|
+
export type MemosApi = ReturnType<typeof memosApi>;
|
|
336
|
+
export type { MemoSearchHit as NoteSearchHit };
|
|
337
|
+
export type { MemoSearchPage as NoteSearchPage };
|
|
338
|
+
export type { MemoRow as NoteRow };
|
|
339
|
+
export type { MemoReadResult as NoteReadResult };
|
|
340
|
+
export type { MemoVersion as NoteVersion };
|
|
341
|
+
export type { MemoBody as NoteBody };
|
|
342
|
+
export type { MemoMediaReceipt as NoteMediaReceipt };
|
|
343
|
+
export { memosApi as notesApi };
|
|
344
|
+
export type { MemosApi as NotesApi };
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { readMemoView } from "./memo-reading.js";
|
|
2
|
+
import { validateHtmlSnapshot, scopedSourceRange } from "./memo-html-read.js";
|
|
3
|
+
import { characterDiff } from "./memo-character-plan.js";
|
|
4
|
+
import * as editing from "./memo-editing.js";
|
|
5
|
+
import { markdownToc as outline } from "./memo-toc.js";
|
|
6
|
+
import { parse as parseHtml, select as selectHtml, textPieces } from './memo-html.js';
|
|
7
|
+
/** Memos: search, read, sections, conditional writes. Mirrors the CLI `memos` group. */
|
|
8
|
+
import { memoFilesApi } from "./memo-files.js";
|
|
9
|
+
import { memoPresenceApi } from "./memo-presence.js";
|
|
10
|
+
import { watchMemo } from "./memo-linger.js";
|
|
11
|
+
import { sharingApi } from "./workspace.js";
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
import { memoEdits, } from "./memo-edits.js";
|
|
14
|
+
export { memoEdits, noteEdits, } from "./memo-edits.js";
|
|
15
|
+
import { ApiError, isObjectId, seg } from "./client.js";
|
|
16
|
+
import { submitMemoPatch, readMemoCommand, validateCommandId, refuseNewReadingViewLines } from "./memo-write.js";
|
|
17
|
+
export function memosApi(t, namespace) {
|
|
18
|
+
const base = `/namespaces/${seg(namespace)}/notes`;
|
|
19
|
+
const id = (value) => {
|
|
20
|
+
if (!isObjectId(value))
|
|
21
|
+
throw new Error("expected a 24-hex memo id");
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
const source = async (noteId, at) => {
|
|
25
|
+
const value = await t.request("GET", `${base}/${id(noteId)}/body`, { query: { contract: "v2", at }, redirect: "error" });
|
|
26
|
+
if (!value ||
|
|
27
|
+
value.note !== noteId ||
|
|
28
|
+
!/^sha256:[a-f0-9]{64}$/.test(value.hash ?? "") ||
|
|
29
|
+
typeof value.revision !== "string" ||
|
|
30
|
+
!value.revision.trim() ||
|
|
31
|
+
/[\r\n]/.test(value.revision) ||
|
|
32
|
+
/^sha256:/i.test(value.revision))
|
|
33
|
+
throw new Error("server did not return the Memos v2 contract; upgrade the server");
|
|
34
|
+
if (at !== undefined && value.revision !== at)
|
|
35
|
+
throw new Error("server did not return the requested pinned revision");
|
|
36
|
+
if (typeof value.content !== "string" ||
|
|
37
|
+
value.hash !==
|
|
38
|
+
`sha256:${createHash("sha256").update(value.content, "utf8").digest("hex")}`)
|
|
39
|
+
throw new Error("source does not match the returned hash");
|
|
40
|
+
return value;
|
|
41
|
+
};
|
|
42
|
+
/** The one v2 write. `commandId` is sent only when supplied and must be echoed; see note-write.ts. */
|
|
43
|
+
const patch = async (noteId, input, options = {}) => {
|
|
44
|
+
if (!input.baseRevision ||
|
|
45
|
+
/[\r\n]/.test(input.baseRevision) ||
|
|
46
|
+
!["exact", "merge"].includes(input.mode))
|
|
47
|
+
throw new Error("original baseRevision and mode required");
|
|
48
|
+
return submitMemoPatch(t, `${base}/${id(noteId)}/body`, noteId, input, options);
|
|
49
|
+
};
|
|
50
|
+
const withCommand = (request, options) => options?.commandId === undefined ? request : { ...request, commandId: options.commandId };
|
|
51
|
+
const api = {
|
|
52
|
+
...memoPresenceApi(t, base),
|
|
53
|
+
linger: (noteId, options, receive) => watchMemo(t, `${base}/${id(noteId)}`, noteId, options, receive),
|
|
54
|
+
namespace,
|
|
55
|
+
/** Resolve the same ID, exact slug or exact title accepted by the CLI in this namespace. */
|
|
56
|
+
resolve: async (ref) => {
|
|
57
|
+
if (/^[a-f0-9]{24}$/i.test(ref))
|
|
58
|
+
return ref;
|
|
59
|
+
let offset = 0;
|
|
60
|
+
for (;;) {
|
|
61
|
+
const result = await t.request('GET', base, { query: { limit: 200, offset, includeArchived: true } });
|
|
62
|
+
const hit = result.notes.find(row => row.slug === ref || row.id === ref || row.name === ref);
|
|
63
|
+
if (hit)
|
|
64
|
+
return hit.id;
|
|
65
|
+
offset += result.notes.length;
|
|
66
|
+
if (!result.notes.length || (result.total === undefined ? result.notes.length < 200 : offset >= result.total))
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
throw new ApiError(404, 'note_not_found', { namespace, ref });
|
|
70
|
+
},
|
|
71
|
+
/** CSS inspection is read-only; selectText publishes a separate agent selection. */
|
|
72
|
+
selectElement: async (noteId, css) => {
|
|
73
|
+
const body = await t.request('GET', `${base}/${id(noteId)}/body`);
|
|
74
|
+
const document = parseHtml(body.text), element = selectHtml(document, css);
|
|
75
|
+
return { etag: body.etag, tag: element.tag, attrs: element.attrs, outer: element.outer, inner: element.inner,
|
|
76
|
+
text: textPieces(document, element).map(piece => piece.decoded).join('') };
|
|
77
|
+
},
|
|
78
|
+
source,
|
|
79
|
+
patch,
|
|
80
|
+
replaceContent: async (noteId, baseRevision, content, mode = "exact", options) => {
|
|
81
|
+
const original = await source(noteId, baseRevision);
|
|
82
|
+
refuseNewReadingViewLines(original.content, content, "content");
|
|
83
|
+
return patch(noteId, withCommand(memoEdits(original, characterDiff(original.content, content).map((e) => ({
|
|
84
|
+
start: e.start,
|
|
85
|
+
end: e.end,
|
|
86
|
+
text: e.replacementText,
|
|
87
|
+
expected: e.expectedText,
|
|
88
|
+
})), mode), options));
|
|
89
|
+
},
|
|
90
|
+
replace: async (noteId, baseRevision, text, where, mode = "exact", options) => {
|
|
91
|
+
const original = await source(noteId, baseRevision), plan = editing.replacementPlan(original.content, text, where);
|
|
92
|
+
return patch(noteId, withCommand(memoEdits(original, plan.map(([start, end, text]) => ({ start, end, text })), mode), options));
|
|
93
|
+
},
|
|
94
|
+
insert: async (noteId, baseRevision, text, where, mode = "exact", options) => {
|
|
95
|
+
const original = await source(noteId, baseRevision), placement = editing.insertPlacement(original.content, text, where);
|
|
96
|
+
return patch(noteId, withCommand(memoEdits(original, [{ start: placement.at, end: placement.at, text: placement.text }], mode), options));
|
|
97
|
+
},
|
|
98
|
+
removeText: async (noteId, baseRevision, where, mode = "exact", options) => {
|
|
99
|
+
const original = await source(noteId, baseRevision), plan = editing.removalPlan(original.content, where);
|
|
100
|
+
return patch(noteId, withCommand(memoEdits(original, plan.map(([start, end, text]) => ({ start, end, text })), mode), options));
|
|
101
|
+
},
|
|
102
|
+
findInSource: async (noteId, at, query, options = {}) => {
|
|
103
|
+
const original = await source(noteId, at);
|
|
104
|
+
return {
|
|
105
|
+
...original,
|
|
106
|
+
matches: editing.find(original.content, query, options),
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
outline: async (noteId, at) => {
|
|
110
|
+
const original = await source(noteId, at);
|
|
111
|
+
return {
|
|
112
|
+
note: noteId,
|
|
113
|
+
revision: original.revision,
|
|
114
|
+
hash: original.hash,
|
|
115
|
+
entries: outline(original.content),
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
get: (noteId) => t.request("GET", `/notes/${id(noteId)}`),
|
|
119
|
+
/** Archive independently of delete/tags. A saved edit restores the note and its folder path. */
|
|
120
|
+
archive: (noteId) => t.request("PATCH", `${base}/${id(noteId)}`, { json: { archived: true } }),
|
|
121
|
+
unarchive: (noteId) => t.request("PATCH", `${base}/${id(noteId)}`, { json: { archived: false } }),
|
|
122
|
+
delete: (noteId) => t.request("DELETE", `${base}/${id(noteId)}`),
|
|
123
|
+
shared: (query = {}) => t.request("GET", "/me/notes/shared", { query }),
|
|
124
|
+
projects: (noteId, view) => t.request("GET", `/namespaces/${seg(namespace)}/resources/note/${id(noteId)}/projects`, { query: { view } }),
|
|
125
|
+
move: (noteId, input) => t.request("POST", `${base}/${id(noteId)}/move`, { json: input }),
|
|
126
|
+
share: (noteId) => sharingApi(t, namespace, "notes", id(noteId)),
|
|
127
|
+
files: (noteId) => memoFilesApi(t, `${base}/${id(noteId)}`),
|
|
128
|
+
media: async (form) => {
|
|
129
|
+
const receipt = await t.request('POST', '/notes/media', { body: form, redirect: 'error' });
|
|
130
|
+
if (!receipt || typeof receipt.url !== 'string' || !/^https?:\/\/[^\s]+$/.test(receipt.url) ||
|
|
131
|
+
!['http:', 'https:'].includes(new URL(receipt.url).protocol) || typeof receipt.contentType !== 'string' ||
|
|
132
|
+
!Number.isSafeInteger(receipt.sizeBytes) || receipt.sizeBytes < 0)
|
|
133
|
+
throw new Error('invalid media upload response: expected url, contentType and sizeBytes');
|
|
134
|
+
return receipt;
|
|
135
|
+
},
|
|
136
|
+
read: (noteId, query = {}, options = {}) => t.request("GET", `${base}/${id(noteId)}/body`, {
|
|
137
|
+
query: { contract: "v2", ...query },
|
|
138
|
+
...(options.ifMatch === undefined ? {} : { headers: { "If-Match": options.ifMatch } }),
|
|
139
|
+
}),
|
|
140
|
+
readView: (noteId, options = {}) => readMemoView(t, namespace, id(noteId), options),
|
|
141
|
+
html: async (noteId, options = {}) => {
|
|
142
|
+
if (!t.raw)
|
|
143
|
+
throw new Error("transport_does_not_support_streaming");
|
|
144
|
+
const response = await t.raw("GET", `${base}/${id(noteId)}/body`, {
|
|
145
|
+
query: {
|
|
146
|
+
contract: "v2",
|
|
147
|
+
view: "html",
|
|
148
|
+
contentFormat: "literal-markdown",
|
|
149
|
+
at: options.at,
|
|
150
|
+
section: options.section,
|
|
151
|
+
toc: options.toc,
|
|
152
|
+
tag: options.tag,
|
|
153
|
+
},
|
|
154
|
+
headers: {
|
|
155
|
+
Accept: "text/html",
|
|
156
|
+
...(options.ifMatch ? { "If-Match": options.ifMatch } : {}),
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
if (!/^text\/(?:html|plain)(?:;|$)/i.test(response.headers.get("content-type") ?? ""))
|
|
160
|
+
throw new Error("server did not return Memos HTML; upgrade the server");
|
|
161
|
+
const bytes = new Uint8Array(await response.arrayBuffer()), html = new TextDecoder("utf-8", {
|
|
162
|
+
fatal: true,
|
|
163
|
+
ignoreBOM: true,
|
|
164
|
+
}).decode(bytes);
|
|
165
|
+
const snapshot = validateHtmlSnapshot(html, noteId, options);
|
|
166
|
+
if (options.at && snapshot.revision !== options.at)
|
|
167
|
+
throw new Error("server did not return the requested pinned revision");
|
|
168
|
+
if (options.ifMatch && snapshot.revision !== options.ifMatch)
|
|
169
|
+
throw new ApiError(412, "stale", { note: noteId });
|
|
170
|
+
return { note: noteId, revision: snapshot.revision, html, bytes };
|
|
171
|
+
},
|
|
172
|
+
diff: (noteId, query) => t.request("GET", `${base}/${id(noteId)}/diff`, { query }),
|
|
173
|
+
saveVersion: (noteId, input) => t.request("POST", `${base}/${id(noteId)}/versions`, { json: input }),
|
|
174
|
+
find: (query) => t.request("GET", `${base}/search`, { query }),
|
|
175
|
+
create: (input) => t.request("POST", base, {
|
|
176
|
+
json: input,
|
|
177
|
+
}),
|
|
178
|
+
edit: async (noteId, baseRevision, edits, mode = "exact", options) => patch(noteId, withCommand(memoEdits(await source(noteId, baseRevision), edits, mode), options)),
|
|
179
|
+
/** The durable record of one command id, scoped to the calling actor; 404 `command_not_found` when none. */
|
|
180
|
+
commandStatus: async (noteId, commandId) => readMemoCommand(t, `${base}/${id(noteId)}/commands/${seg(validateCommandId(commandId))}`, commandId),
|
|
181
|
+
versions: (noteId, query = {}) => t.request("GET", `${base}/${id(noteId)}/versions`, { query }),
|
|
182
|
+
version: (noteId, versionId) => t.request("GET", `${base}/${id(noteId)}/versions/${seg(versionId)}`),
|
|
183
|
+
list: (query = {}) => t.request("GET", base, { query }),
|
|
184
|
+
search: (q, limit = 50, offset = 0, options = {}) => t.request("GET", base, {
|
|
185
|
+
query: { q, limit, offset, ...options },
|
|
186
|
+
}),
|
|
187
|
+
body: (noteId) => t.request("GET", `${base}/${id(noteId)}/body`),
|
|
188
|
+
sections: (noteId) => t.request("GET", `${base}/${id(noteId)}/sections`),
|
|
189
|
+
section: (noteId, anchor) => t.request("GET", `${base}/${id(noteId)}/sections/${encodeURIComponent(anchor)}`),
|
|
190
|
+
/** Replace the whole body, refused with 412 `stale` unless `ifMatch` is the current etag. */
|
|
191
|
+
write: (noteId, text, ifMatch) => t.request("PUT", `${base}/${id(noteId)}/body`, {
|
|
192
|
+
json: { text },
|
|
193
|
+
headers: { "If-Match": ifMatch },
|
|
194
|
+
}),
|
|
195
|
+
/** Read-then-conditional-write append; a concurrent edit refuses with 412 `stale` instead of being overwritten. */
|
|
196
|
+
append: async (noteId, addition, ifMatch) => {
|
|
197
|
+
const current = await t.request("GET", `${base}/${id(noteId)}/body`);
|
|
198
|
+
const text = (current.text && !current.text.endsWith("\n")
|
|
199
|
+
? current.text + "\n"
|
|
200
|
+
: current.text) + addition;
|
|
201
|
+
return t.request("PUT", `${base}/${id(noteId)}/body`, {
|
|
202
|
+
json: { text },
|
|
203
|
+
headers: { "If-Match": ifMatch ?? current.etag },
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
addSection: async (noteId, text, placement = {}, ifMatch) => {
|
|
207
|
+
const etag = ifMatch ??
|
|
208
|
+
(await t.request("GET", `${base}/${id(noteId)}/body`)).etag;
|
|
209
|
+
return t.request("POST", `${base}/${id(noteId)}/sections`, {
|
|
210
|
+
json: { text, ...placement },
|
|
211
|
+
headers: { "If-Match": etag },
|
|
212
|
+
});
|
|
213
|
+
},
|
|
214
|
+
removeSection: async (noteId, anchor, ifMatch) => {
|
|
215
|
+
const etag = ifMatch ??
|
|
216
|
+
(await t.request("GET", `${base}/${id(noteId)}/body`)).etag;
|
|
217
|
+
return t.request("DELETE", `${base}/${id(noteId)}/sections/${seg(anchor)}`, { headers: { "If-Match": etag } });
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
return Object.assign(api, {
|
|
221
|
+
/** The full original span of one mapped element (`s1.p2`) at a revision: the scoped HTML read's absolute code-point range. */
|
|
222
|
+
addressRange: async (noteId, address, at) => {
|
|
223
|
+
const scoped = await api.html(noteId, { tag: address, at });
|
|
224
|
+
const range = scopedSourceRange(scoped.html);
|
|
225
|
+
if (!range)
|
|
226
|
+
throw new Error(`address ${address} did not return a scoped source range`);
|
|
227
|
+
return { ...range, revision: scoped.revision };
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
export { memosApi as notesApi };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export * from "
|
|
1
|
+
/** @deprecated Import the canonical Memo module. */
|
|
2
|
+
export * from "./memo-character-plan.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export * from "
|
|
1
|
+
/** @deprecated Import the canonical Memo module. */
|
|
2
|
+
export * from "./memo-character-plan.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export * from "
|
|
1
|
+
/** @deprecated Import the canonical Memo module. */
|
|
2
|
+
export * from "./memo-editing.js";
|
package/dist/api/note-editing.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export * from "
|
|
1
|
+
/** @deprecated Import the canonical Memo module. */
|
|
2
|
+
export * from "./memo-editing.js";
|
package/dist/api/note-edits.d.ts
CHANGED
|
@@ -1,59 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export
|
|
3
|
-
note: string;
|
|
4
|
-
content: string;
|
|
5
|
-
hash: string;
|
|
6
|
-
revision: string;
|
|
7
|
-
}
|
|
8
|
-
export interface SourceEdit {
|
|
9
|
-
start: number;
|
|
10
|
-
end: number;
|
|
11
|
-
text: string;
|
|
12
|
-
}
|
|
13
|
-
export interface NoteEdit extends SourceEdit {
|
|
14
|
-
expected?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface NotePatch {
|
|
17
|
-
format: "inline-dff" | "diff";
|
|
18
|
-
patch: string;
|
|
19
|
-
baseRevision: string;
|
|
20
|
-
mode: "merge" | "exact";
|
|
21
|
-
}
|
|
22
|
-
/** The CLI's names for the same shapes; `src/cli/notes/document.ts` re-exports them. */
|
|
23
|
-
export type SourceSnapshot = NoteSource;
|
|
24
|
-
export type DocumentPatchPayload = NotePatch;
|
|
25
|
-
/** Generated reading-view annotations are never saved as source. What is
|
|
26
|
-
* forbidden is NEW text that carries the generated header line
|
|
27
|
-
* (`<!-- notes-reading-view revision=… hash=…`). Deleting such a line, keeping
|
|
28
|
-
* one the note already has, or mentioning the marker in prose or a code block
|
|
29
|
-
* is allowed. Checked on raw inserted text before compilation (escaping would
|
|
30
|
-
* hide it) and on the insertion payloads of a caller-supplied patch. */
|
|
31
|
-
export declare const READING_VIEW_MARKER = "<!-- notes-reading-view";
|
|
32
|
-
export declare const READING_VIEW_HEADER: RegExp;
|
|
33
|
-
export declare class ReadingViewMarkerRefused extends Error {
|
|
34
|
-
constructor(what: string);
|
|
35
|
-
}
|
|
36
|
-
/** Inserted or replacement text only, never deletions or unchanged context. */
|
|
37
|
-
export declare function refuseReadingView(text: string, what: string): void;
|
|
38
|
-
/** Whole-body replacement: only lines that are new relative to the baseline count, so a header the note already holds survives a write. */
|
|
39
|
-
export declare function refuseNewReadingViewLines(baseline: string, content: string, what: string): void;
|
|
40
|
-
/** Apply the inline-dff subset this client emits (`@@ chars s:e @@` + one `~` line of `[-old-]`/`{+new+}`
|
|
41
|
-
* segments) to a baseline. null when the patch is outside that subset or its old text does not match. */
|
|
42
|
-
export declare function applyInlineDff(baseline: string, patch: string): string | null;
|
|
43
|
-
/** Apply a unified diff to a baseline, verifying context and removed lines. null when it does not apply cleanly. */
|
|
44
|
-
export declare function applyUnifiedDiff(baseline: string, patch: string): string | null;
|
|
45
|
-
/** A caller-supplied patch. With the baseline it was written against, the target is reconstructed and
|
|
46
|
-
* checked like a whole-body write (so a header split across hunks is seen assembled, and one the note
|
|
47
|
-
* already has may be re-added). Without a baseline, or when the patch does not apply to it, the check is
|
|
48
|
-
* BEST-EFFORT on the insertion payloads: inline-dff `{+…+}` (escapes decoded), concatenated across hunks
|
|
49
|
-
* that are adjacent in the original (one's end offset is the next's start, so no baseline text lies
|
|
50
|
-
* between them), or unified-diff `+` lines. Authoritative enforcement belongs to the server. */
|
|
51
|
-
export declare function refuseReadingViewPatch(patch: string, format: "inline-dff" | "diff", baseline?: string): void;
|
|
52
|
-
/** Exact original-source spans, with untouched gaps omitted from the PATCH. The target the edits
|
|
53
|
-
* produce is reconstructed and checked against the baseline, so a generated header assembled from
|
|
54
|
-
* several spans is refused exactly as a whole-body write would be. */
|
|
55
|
-
export declare function documentEdits(source: SourceSnapshot, edits: SourceEdit[], exact?: boolean): DocumentPatchPayload;
|
|
56
|
-
/** One literal insertion at an original-source Unicode code-point boundary. */
|
|
57
|
-
export declare function documentInsertion(source: SourceSnapshot, at: number, text: string, exact?: boolean): DocumentPatchPayload;
|
|
58
|
-
/** Validate optional expected text, then use the same source-span compiler. */
|
|
59
|
-
export declare function noteEdits(source: NoteSource, edits: NoteEdit[], mode?: "merge" | "exact"): NotePatch;
|
|
1
|
+
/** @deprecated Import the canonical Memo module. */
|
|
2
|
+
export * from "./memo-edits.js";
|