@dreamlake/dreamlake-cli 0.104.8 → 0.105.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.
- 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/help-examples.generated.js +6 -6
- 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/skill/index.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
package/dist/api/note-write.d.ts
CHANGED
|
@@ -1,110 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* all compile to this PATCH; nothing here reads process state. */
|
|
4
|
-
import { type Transport } from "./client.js";
|
|
5
|
-
import { type NotePatch, type NoteSource } from "./note-edits.js";
|
|
6
|
-
export { READING_VIEW_MARKER, READING_VIEW_HEADER, ReadingViewMarkerRefused, refuseReadingView, refuseNewReadingViewLines, refuseReadingViewPatch, applyInlineDff, applyUnifiedDiff } from "./note-edits.js";
|
|
7
|
-
/** Caller-stable command identity: 8–128 characters of `[A-Za-z0-9._:-]`, the server's rule. */
|
|
8
|
-
export declare const COMMAND_ID_PATTERN: RegExp;
|
|
9
|
-
export type NoteWriteMode = "merge" | "exact";
|
|
10
|
-
export type NoteWriteOutcome = "accepted" | "no-write";
|
|
11
|
-
export interface NotePatchRequest extends NotePatch {
|
|
12
|
-
/** Sent only when supplied; the receipt must echo it. */
|
|
13
|
-
commandId?: string;
|
|
14
|
-
}
|
|
15
|
-
/** The v2 write receipt. `outcome`, `commandId` and `replayed` are filled in for servers that predate them. */
|
|
16
|
-
export interface NoteWriteReceipt {
|
|
17
|
-
note: string;
|
|
18
|
-
hash: string;
|
|
19
|
-
revision: string;
|
|
20
|
-
baseRevision: string;
|
|
21
|
-
mode: NoteWriteMode;
|
|
22
|
-
outcome: NoteWriteOutcome;
|
|
23
|
-
commandId: string | null;
|
|
24
|
-
replayed: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface NoteCommandStatus {
|
|
27
|
-
commandId: string;
|
|
28
|
-
state: "pending" | "accepted" | "no-write" | "unknown";
|
|
29
|
-
outcome?: NoteWriteOutcome;
|
|
30
|
-
receipt?: NoteWriteReceipt;
|
|
31
|
-
error?: unknown;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
updatedAt: string;
|
|
34
|
-
}
|
|
35
|
-
export declare class InvalidCommandId extends Error {
|
|
36
|
-
readonly commandId: unknown;
|
|
37
|
-
constructor(commandId: unknown);
|
|
38
|
-
}
|
|
39
|
-
/** The server accepted the write but did not echo the command id: it predates command identity, so a retry is not deduplicated. */
|
|
40
|
-
export declare class CommandIdentityUnsupported extends Error {
|
|
41
|
-
readonly commandId: string;
|
|
42
|
-
readonly receipt: unknown;
|
|
43
|
-
constructor(commandId: string, receipt: unknown);
|
|
44
|
-
}
|
|
45
|
-
/** The request may or may not have been applied. Keep the original baseline and draft.
|
|
46
|
-
* `transport`: lost acknowledgment (network, 5xx, 503); `receipt`: the server
|
|
47
|
-
* answered but the receipt cannot be verified; `server`: the server recorded
|
|
48
|
-
* the command and reports its own outcome as unknown (409 command_outcome_unknown). */
|
|
49
|
-
export declare class UncertainOutcome extends Error {
|
|
50
|
-
readonly commandId: string | null;
|
|
51
|
-
readonly reason: "transport" | "receipt" | "server";
|
|
52
|
-
readonly status?: number;
|
|
53
|
-
constructor(commandId: string | null, reason: "transport" | "receipt" | "server", options?: {
|
|
54
|
-
cause?: unknown;
|
|
55
|
-
status?: number;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/** The server proved the edit never started (503 `rtc_unavailable` with the typed baseline marker): nothing to reconcile. */
|
|
59
|
-
export declare class NoteWriteNotSubmitted extends Error {
|
|
60
|
-
constructor(options?: {
|
|
61
|
-
cause?: unknown;
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
/** 409 `command_in_progress`: an earlier request with this id is still running. */
|
|
65
|
-
export declare class CommandInProgress extends Error {
|
|
66
|
-
readonly commandId: string | null;
|
|
67
|
-
constructor(commandId: string | null, options?: {
|
|
68
|
-
cause?: unknown;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/** 409 `command_intent_mismatch`: the id was already bound to a different note, baseline, mode, format or patch. */
|
|
72
|
-
export declare class CommandIntentMismatch extends Error {
|
|
73
|
-
readonly commandId: string | null;
|
|
74
|
-
constructor(commandId: string | null, options?: {
|
|
75
|
-
cause?: unknown;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
/** Status, stable code and parsed body of a transport failure, for either error class. */
|
|
79
|
-
export declare function failureInfo(error: unknown): {
|
|
80
|
-
status?: number;
|
|
81
|
-
code?: string;
|
|
82
|
-
body?: unknown;
|
|
83
|
-
};
|
|
84
|
-
/** Current API proof only: exactly `{apiVersion: 1, started: false, phase: "baseline_read"}`. Human text proves nothing. */
|
|
85
|
-
export declare function provenUnsubmitted(body: unknown): boolean;
|
|
86
|
-
export declare function validateCommandId(commandId: string): string;
|
|
87
|
-
/** The exact request body: `commandId` is present only when the caller supplied one. */
|
|
88
|
-
export declare function patchRequestBody(input: NotePatchRequest): NotePatchRequest;
|
|
89
|
-
/** Validate a receipt against the request it answers; older servers' receipts are normalized, never guessed beyond the empty-patch case. */
|
|
90
|
-
export declare function verifyNoteReceipt(raw: unknown, noteId: string, input: NotePatchRequest): NoteWriteReceipt;
|
|
91
|
-
/** PATCH one compiled edit set. Deterministic refusals pass through; a lost
|
|
92
|
-
* acknowledgment or an unverifiable receipt is an UncertainOutcome and is
|
|
93
|
-
* never retried here. The reading-view header check is exact when
|
|
94
|
-
* `options.baseline` is given and best-effort (payload inspection) for a
|
|
95
|
-
* read-free patch; the server is the authoritative enforcement point. */
|
|
96
|
-
export declare function submitNotePatch(t: Transport, bodyPath: string, noteId: string, input: NotePatchRequest, options?: {
|
|
97
|
-
ifMatch?: string;
|
|
98
|
-
baseline?: NoteSource;
|
|
99
|
-
}): Promise<NoteWriteReceipt>;
|
|
100
|
-
/** GET the durable record of one command; 404 `command_not_found` passes through as the transport's error. */
|
|
101
|
-
export declare function readNoteCommand(t: Transport, commandPath: string, commandId: string): Promise<NoteCommandStatus>;
|
|
102
|
-
/** Append is verbatim (Notes API contract): the given text, every intended
|
|
103
|
-
* newline included and nothing added, at the end of the retained source. An
|
|
104
|
-
* empty addition compiles to an empty patch — nothing to send. */
|
|
105
|
-
export declare function appendPlan(source: NoteSource, text: string, mode: NoteWriteMode): {
|
|
106
|
-
suffix: string;
|
|
107
|
-
request: NotePatch;
|
|
108
|
-
};
|
|
109
|
-
/** Replace the whole source: a code-point character diff against the retained snapshot, within the alignment limits. */
|
|
110
|
-
export declare function writePlan(source: NoteSource, content: string, mode: NoteWriteMode): NotePatch;
|
|
1
|
+
/** @deprecated Import the canonical Memo module. */
|
|
2
|
+
export * from "./memo-write.js";
|
package/dist/api/note-write.js
CHANGED
|
@@ -1,217 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* all compile to this PATCH; nothing here reads process state. */
|
|
4
|
-
import { ApiError } from "./client.js";
|
|
5
|
-
import { HttpError, RequestNotSent } from "./http.js";
|
|
6
|
-
import { characterDiff, NotePatchError, PATCH_LIMITS } from "./note-character-plan.js";
|
|
7
|
-
import { documentEdits, documentInsertion, refuseNewReadingViewLines, refuseReadingViewPatch } from "./note-edits.js";
|
|
8
|
-
export { READING_VIEW_MARKER, READING_VIEW_HEADER, ReadingViewMarkerRefused, refuseReadingView, refuseNewReadingViewLines, refuseReadingViewPatch, applyInlineDff, applyUnifiedDiff } from "./note-edits.js";
|
|
9
|
-
/** Caller-stable command identity: 8–128 characters of `[A-Za-z0-9._:-]`, the server's rule. */
|
|
10
|
-
export const COMMAND_ID_PATTERN = /^[A-Za-z0-9._:-]{8,128}$/;
|
|
11
|
-
/** Every 4xx is settled by the server (the write did not happen), except the
|
|
12
|
-
* command-identity 409s mapped below. 503 after the request left is the lost
|
|
13
|
-
* acknowledgment family; 5xx and network failures are uncertain. */
|
|
14
|
-
const UNCERTAIN_409 = ["command_outcome_unknown", "command_in_progress", "command_intent_mismatch"];
|
|
15
|
-
export class InvalidCommandId extends Error {
|
|
16
|
-
commandId;
|
|
17
|
-
constructor(commandId) {
|
|
18
|
-
super("commandId must be 8–128 characters of A-Z a-z 0-9 . _ : -");
|
|
19
|
-
this.commandId = commandId;
|
|
20
|
-
this.name = "InvalidCommandId";
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/** The server accepted the write but did not echo the command id: it predates command identity, so a retry is not deduplicated. */
|
|
24
|
-
export class CommandIdentityUnsupported extends Error {
|
|
25
|
-
commandId;
|
|
26
|
-
receipt;
|
|
27
|
-
constructor(commandId, receipt) {
|
|
28
|
-
super("server did not echo the command id; it does not support command identity, so this write cannot be retried safely");
|
|
29
|
-
this.commandId = commandId;
|
|
30
|
-
this.receipt = receipt;
|
|
31
|
-
this.name = "CommandIdentityUnsupported";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/** The request may or may not have been applied. Keep the original baseline and draft.
|
|
35
|
-
* `transport`: lost acknowledgment (network, 5xx, 503); `receipt`: the server
|
|
36
|
-
* answered but the receipt cannot be verified; `server`: the server recorded
|
|
37
|
-
* the command and reports its own outcome as unknown (409 command_outcome_unknown). */
|
|
38
|
-
export class UncertainOutcome extends Error {
|
|
39
|
-
commandId;
|
|
40
|
-
reason;
|
|
41
|
-
status;
|
|
42
|
-
constructor(commandId, reason, options = {}) {
|
|
43
|
-
const cause = options.cause instanceof Error ? options.cause.message : undefined;
|
|
44
|
-
super((reason === "receipt" ? "Memos write outcome unknown: invalid receipt"
|
|
45
|
-
: reason === "server" ? `Memos write outcome unknown: the server recorded command ${commandId} but could not settle it`
|
|
46
|
-
: options.status === 503 ? "the realtime acknowledgment is unavailable; the result may be ambiguous"
|
|
47
|
-
: "Memos write outcome unknown") +
|
|
48
|
-
(reason === "server"
|
|
49
|
-
? "; keep the original baseline and draft and query the command status before resubmitting; never resend it under a new id"
|
|
50
|
-
: "; keep the original baseline and draft, inspect the memo before resubmitting" +
|
|
51
|
-
(commandId ? `, or retry with the same commandId ${commandId} / query its command status` : "")) +
|
|
52
|
-
(options.status === 503 && cause ? ` (${cause})` : ""), options.cause === undefined ? undefined : { cause: options.cause });
|
|
53
|
-
this.commandId = commandId;
|
|
54
|
-
this.reason = reason;
|
|
55
|
-
this.name = "UncertainOutcome";
|
|
56
|
-
this.status = options.status;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/** The server proved the edit never started (503 `rtc_unavailable` with the typed baseline marker): nothing to reconcile. */
|
|
60
|
-
export class NoteWriteNotSubmitted extends Error {
|
|
61
|
-
constructor(options) {
|
|
62
|
-
super("patch not submitted: the requested edit did not start because its baseline is unavailable; preserve the original baseline and draft", options);
|
|
63
|
-
this.name = "NoteWriteNotSubmitted";
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/** 409 `command_in_progress`: an earlier request with this id is still running. */
|
|
67
|
-
export class CommandInProgress extends Error {
|
|
68
|
-
commandId;
|
|
69
|
-
constructor(commandId, options) {
|
|
70
|
-
super(`a write with commandId ${commandId} is still in progress on the server; wait, then query its command status before retrying with the same id`, options);
|
|
71
|
-
this.commandId = commandId;
|
|
72
|
-
this.name = "CommandInProgress";
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/** 409 `command_intent_mismatch`: the id was already bound to a different note, baseline, mode, format or patch. */
|
|
76
|
-
export class CommandIntentMismatch extends Error {
|
|
77
|
-
commandId;
|
|
78
|
-
constructor(commandId, options) {
|
|
79
|
-
super(`commandId ${commandId} was already used for a different edit (memo, baseline revision, mode, format or patch differ); a new command needs a new id`, options);
|
|
80
|
-
this.commandId = commandId;
|
|
81
|
-
this.name = "CommandIntentMismatch";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/** Status, stable code and parsed body of a transport failure, for either error class. */
|
|
85
|
-
export function failureInfo(error) {
|
|
86
|
-
if (error instanceof ApiError) {
|
|
87
|
-
const flat = error.body && typeof error.body === "object" ? error.body.error : undefined;
|
|
88
|
-
return { status: error.status, code: typeof flat === "string" ? flat : error.code, body: error.body };
|
|
89
|
-
}
|
|
90
|
-
if (error instanceof HttpError) {
|
|
91
|
-
let body;
|
|
92
|
-
try {
|
|
93
|
-
body = JSON.parse(error.body);
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
body = undefined;
|
|
97
|
-
}
|
|
98
|
-
const flat = body && typeof body === "object" ? body.error : undefined;
|
|
99
|
-
return { status: error.status, code: typeof flat === "string" ? flat : error.code, body };
|
|
100
|
-
}
|
|
101
|
-
return {};
|
|
102
|
-
}
|
|
103
|
-
/** Current API proof only: exactly `{apiVersion: 1, started: false, phase: "baseline_read"}`. Human text proves nothing. */
|
|
104
|
-
export function provenUnsubmitted(body) {
|
|
105
|
-
if (!body || typeof body !== "object" || Array.isArray(body))
|
|
106
|
-
return false;
|
|
107
|
-
const envelope = body, marker = envelope.mutation;
|
|
108
|
-
if (envelope.error !== "rtc_unavailable" || !marker || typeof marker !== "object" || Array.isArray(marker))
|
|
109
|
-
return false;
|
|
110
|
-
const value = marker;
|
|
111
|
-
return Object.keys(value).length === 3 && value.apiVersion === 1 && value.started === false && value.phase === "baseline_read";
|
|
112
|
-
}
|
|
113
|
-
export function validateCommandId(commandId) {
|
|
114
|
-
if (typeof commandId !== "string" || !COMMAND_ID_PATTERN.test(commandId))
|
|
115
|
-
throw new InvalidCommandId(commandId);
|
|
116
|
-
return commandId;
|
|
117
|
-
}
|
|
118
|
-
/** The exact request body: `commandId` is present only when the caller supplied one. */
|
|
119
|
-
export function patchRequestBody(input) {
|
|
120
|
-
const body = { format: input.format, patch: input.patch, baseRevision: input.baseRevision, mode: input.mode };
|
|
121
|
-
if (input.commandId !== undefined)
|
|
122
|
-
body.commandId = validateCommandId(input.commandId);
|
|
123
|
-
return body;
|
|
124
|
-
}
|
|
125
|
-
/** Validate a receipt against the request it answers; older servers' receipts are normalized, never guessed beyond the empty-patch case. */
|
|
126
|
-
export function verifyNoteReceipt(raw, noteId, input) {
|
|
127
|
-
const sent = input.commandId ?? null;
|
|
128
|
-
const receipt = raw;
|
|
129
|
-
const invalid = () => new UncertainOutcome(sent, "receipt");
|
|
130
|
-
if (!receipt || typeof receipt !== "object" || receipt.note !== noteId || !/^sha256:[a-f0-9]{64}$/.test(receipt.hash ?? "")
|
|
131
|
-
|| typeof receipt.revision !== "string" || !receipt.revision.trim() || /[\r\n]/.test(receipt.revision) || /^sha256:/i.test(receipt.revision)
|
|
132
|
-
|| receipt.mode !== input.mode || receipt.baseRevision !== input.baseRevision)
|
|
133
|
-
throw invalid();
|
|
134
|
-
if (receipt.outcome !== undefined && receipt.outcome !== "accepted" && receipt.outcome !== "no-write")
|
|
135
|
-
throw invalid();
|
|
136
|
-
if (receipt.replayed !== undefined && typeof receipt.replayed !== "boolean")
|
|
137
|
-
throw invalid();
|
|
138
|
-
const echoed = receipt.commandId ?? null;
|
|
139
|
-
if (sent !== null) {
|
|
140
|
-
if (echoed === null)
|
|
141
|
-
throw new CommandIdentityUnsupported(sent, raw);
|
|
142
|
-
if (echoed !== sent)
|
|
143
|
-
throw invalid();
|
|
144
|
-
}
|
|
145
|
-
else if (echoed !== null || receipt.replayed)
|
|
146
|
-
throw invalid();
|
|
147
|
-
return {
|
|
148
|
-
note: receipt.note, hash: receipt.hash, revision: receipt.revision, baseRevision: receipt.baseRevision, mode: receipt.mode,
|
|
149
|
-
outcome: receipt.outcome ?? (input.patch === "" ? "no-write" : "accepted"),
|
|
150
|
-
commandId: echoed, replayed: receipt.replayed ?? false,
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
/** PATCH one compiled edit set. Deterministic refusals pass through; a lost
|
|
154
|
-
* acknowledgment or an unverifiable receipt is an UncertainOutcome and is
|
|
155
|
-
* never retried here. The reading-view header check is exact when
|
|
156
|
-
* `options.baseline` is given and best-effort (payload inspection) for a
|
|
157
|
-
* read-free patch; the server is the authoritative enforcement point. */
|
|
158
|
-
export async function submitNotePatch(t, bodyPath, noteId, input, options = {}) {
|
|
159
|
-
const body = patchRequestBody(input);
|
|
160
|
-
refuseReadingViewPatch(body.patch, body.format, options.baseline?.revision === body.baseRevision ? options.baseline.content : undefined);
|
|
161
|
-
let raw;
|
|
162
|
-
try {
|
|
163
|
-
raw = await t.request("PATCH", bodyPath, {
|
|
164
|
-
json: body, redirect: "error",
|
|
165
|
-
headers: options.ifMatch === undefined ? {} : { "If-Match": options.ifMatch },
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
// The transport could not even build the request: nothing left the process, so nothing is uncertain.
|
|
170
|
-
if (error instanceof RequestNotSent)
|
|
171
|
-
throw error;
|
|
172
|
-
const commandId = body.commandId ?? null, failure = failureInfo(error);
|
|
173
|
-
if (failure.status === 503) {
|
|
174
|
-
if (provenUnsubmitted(failure.body))
|
|
175
|
-
throw new NoteWriteNotSubmitted({ cause: error });
|
|
176
|
-
throw new UncertainOutcome(commandId, "transport", { cause: error, status: 503 });
|
|
177
|
-
}
|
|
178
|
-
if (failure.status === 409 && failure.code !== undefined && UNCERTAIN_409.includes(failure.code)) {
|
|
179
|
-
if (failure.code === "command_outcome_unknown")
|
|
180
|
-
throw new UncertainOutcome(commandId, "server", { cause: error, status: 409 });
|
|
181
|
-
if (failure.code === "command_in_progress")
|
|
182
|
-
throw new CommandInProgress(commandId, { cause: error });
|
|
183
|
-
throw new CommandIntentMismatch(commandId, { cause: error });
|
|
184
|
-
}
|
|
185
|
-
if (failure.status !== undefined && failure.status >= 400 && failure.status < 500)
|
|
186
|
-
throw error;
|
|
187
|
-
throw new UncertainOutcome(commandId, "transport", { cause: error, status: failure.status });
|
|
188
|
-
}
|
|
189
|
-
return verifyNoteReceipt(raw, noteId, body);
|
|
190
|
-
}
|
|
191
|
-
/** GET the durable record of one command; 404 `command_not_found` passes through as the transport's error. */
|
|
192
|
-
export async function readNoteCommand(t, commandPath, commandId) {
|
|
193
|
-
const status = await t.request("GET", commandPath, { redirect: "error" });
|
|
194
|
-
if (!status || typeof status !== "object" || status.commandId !== commandId
|
|
195
|
-
|| !["pending", "accepted", "no-write", "unknown"].includes(status.state ?? "")
|
|
196
|
-
|| (status.outcome !== undefined && status.outcome !== "accepted" && status.outcome !== "no-write")
|
|
197
|
-
|| typeof status.createdAt !== "string" || typeof status.updatedAt !== "string")
|
|
198
|
-
throw new Error("invalid Memo command status");
|
|
199
|
-
return status;
|
|
200
|
-
}
|
|
201
|
-
/** Append is verbatim (Notes API contract): the given text, every intended
|
|
202
|
-
* newline included and nothing added, at the end of the retained source. An
|
|
203
|
-
* empty addition compiles to an empty patch — nothing to send. */
|
|
204
|
-
export function appendPlan(source, text, mode) {
|
|
205
|
-
return { suffix: text, request: documentInsertion(source, Array.from(source.content).length, text, mode === "exact") };
|
|
206
|
-
}
|
|
207
|
-
/** Replace the whole source: a code-point character diff against the retained snapshot, within the alignment limits. */
|
|
208
|
-
export function writePlan(source, content, mode) {
|
|
209
|
-
// Against the baseline, on whole lines: a character diff can split the header across edits, hiding it from documentEdits.
|
|
210
|
-
refuseNewReadingViewLines(source.content, content, "content");
|
|
211
|
-
const edits = characterDiff(source.content, content);
|
|
212
|
-
const request = documentEdits(source, edits.map(edit => ({ start: edit.start, end: edit.end, text: edit.replacementText })), mode === "exact");
|
|
213
|
-
if (edits.length > PATCH_LIMITS.maxEdits || new TextEncoder().encode(request.patch).length > PATCH_LIMITS.maxPatchBytes) {
|
|
214
|
-
throw new NotePatchError("Generated source patch exceeds the edit/byte limit", "LIMIT_EXCEEDED");
|
|
215
|
-
}
|
|
216
|
-
return request;
|
|
217
|
-
}
|
|
1
|
+
/** @deprecated Import the canonical Memo module. */
|
|
2
|
+
export * from "./memo-write.js";
|
package/dist/api/notes.d.ts
CHANGED
|
@@ -1,335 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { type NoteLingerOptions, type NoteLingerEvent } from "./note-linger.js";
|
|
4
|
-
import type { Query } from "./common.js";
|
|
5
|
-
import { type NoteSource, type NoteEdit } from "./note-edits.js";
|
|
6
|
-
export { noteEdits, type NoteSource, type NoteEdit, type NotePatch, } from "./note-edits.js";
|
|
7
|
-
import { type Transport } from "./client.js";
|
|
8
|
-
import { type NotePatchRequest, type NoteWriteReceipt, type NoteCommandStatus } from "./note-write.js";
|
|
9
|
-
export interface NoteSearchHit {
|
|
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 NoteSearchPage {
|
|
24
|
-
hits: NoteSearchHit[];
|
|
25
|
-
nextCursor: string | null;
|
|
26
|
-
truncated: boolean;
|
|
27
|
-
notesSearched: number;
|
|
28
|
-
partialNotes: string[];
|
|
29
|
-
staleNotes: number;
|
|
30
|
-
}
|
|
31
|
-
export interface NoteRow {
|
|
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 NoteReadResult {
|
|
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 NoteVersion {
|
|
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 NoteBody {
|
|
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 NoteMediaReceipt {
|
|
83
|
-
url: string;
|
|
84
|
-
contentType: string;
|
|
85
|
-
sizeBytes: number;
|
|
86
|
-
}
|
|
87
|
-
export declare function notesApi(t: Transport, namespace: string): {
|
|
88
|
-
linger: (noteId: string, options: NoteLingerOptions, receive: (event: NoteLingerEvent) => 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<NoteSource>;
|
|
102
|
-
patch: (noteId: string, input: NotePatchRequest, options?: {
|
|
103
|
-
ifMatch?: string;
|
|
104
|
-
baseline?: NoteSource;
|
|
105
|
-
}) => Promise<NoteWriteReceipt>;
|
|
106
|
-
replaceContent: (noteId: string, baseRevision: string, content: string, mode?: "exact" | "merge", options?: {
|
|
107
|
-
commandId?: string;
|
|
108
|
-
}) => Promise<NoteWriteReceipt>;
|
|
109
|
-
replace: (noteId: string, baseRevision: string, text: string, where: editing.Where, mode?: "exact" | "merge", options?: {
|
|
110
|
-
commandId?: string;
|
|
111
|
-
}) => Promise<NoteWriteReceipt>;
|
|
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<NoteWriteReceipt>;
|
|
118
|
-
removeText: (noteId: string, baseRevision: string, where: editing.Where, mode?: "exact" | "merge", options?: {
|
|
119
|
-
commandId?: string;
|
|
120
|
-
}) => Promise<NoteWriteReceipt>;
|
|
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("./note-toc.js").TocEntry[];
|
|
133
|
-
}>;
|
|
134
|
-
get: (noteId: string) => Promise<NoteRow & {
|
|
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<NoteRow>;
|
|
140
|
-
unarchive: (noteId: string) => Promise<NoteRow>;
|
|
141
|
-
delete: (noteId: string) => Promise<unknown>;
|
|
142
|
-
shared: (query?: {
|
|
143
|
-
includeArchived?: boolean;
|
|
144
|
-
}) => Promise<{
|
|
145
|
-
notes: NoteRow[];
|
|
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("./note-files.js").NoteFileListOptions) => Promise<import("./note-files.js").NoteFilePage>;
|
|
163
|
-
get: (id: string) => Promise<import("./note-files.js").NoteFile>;
|
|
164
|
-
resolve: (ref: string, includeTrashed?: boolean) => Promise<import("./note-files.js").NoteFile>;
|
|
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("./note-files.js").NoteFile>;
|
|
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("./note-files.js").NoteFileWriteReceipt>;
|
|
190
|
-
move: (ref: string, path: string, options?: {
|
|
191
|
-
overwrite?: boolean;
|
|
192
|
-
ifMatch?: string;
|
|
193
|
-
}) => Promise<import("./note-files.js").NoteFile>;
|
|
194
|
-
copy: (ref: string, path: string, options?: {
|
|
195
|
-
overwrite?: boolean;
|
|
196
|
-
idempotencyKey?: string;
|
|
197
|
-
}) => Promise<import("./note-files.js").NoteFileWriteReceipt>;
|
|
198
|
-
operation: (operationId: string, action?: "status" | "reconcile" | "cancel") => Promise<import("./note-files.js").NoteFileOperationReceipt>;
|
|
199
|
-
status: (id: string) => Promise<import("./note-files.js").NoteFileOperationReceipt>;
|
|
200
|
-
reconcile: (id: string) => Promise<import("./note-files.js").NoteFileOperationReceipt>;
|
|
201
|
-
cancel: (id: string) => Promise<import("./note-files.js").NoteFileOperationReceipt>;
|
|
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("./note-files.js").NoteFile>;
|
|
210
|
-
preview: (ref: string, share?: boolean) => Promise<import("./note-files.js").NoteFilePreview>;
|
|
211
|
-
revokePreview: (ref: string) => Promise<{
|
|
212
|
-
id: string;
|
|
213
|
-
shared: boolean;
|
|
214
|
-
}>;
|
|
215
|
-
};
|
|
216
|
-
media: (form: FormData) => Promise<NoteMediaReceipt>;
|
|
217
|
-
read: (noteId: string, query?: Query, options?: {
|
|
218
|
-
ifMatch?: string;
|
|
219
|
-
}) => Promise<NoteReadResult>;
|
|
220
|
-
readView: (noteId: string, options?: NoteReadingOptions) => Promise<import("./note-reading.js").NoteReadingPage>;
|
|
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<NoteSearchPage>;
|
|
257
|
-
create: (input: {
|
|
258
|
-
name: string;
|
|
259
|
-
summary?: string;
|
|
260
|
-
projects?: string[];
|
|
261
|
-
visibility?: "private" | "public";
|
|
262
|
-
}) => Promise<{
|
|
263
|
-
note: NoteRow;
|
|
264
|
-
rtc: {
|
|
265
|
-
rtcDocId: string;
|
|
266
|
-
};
|
|
267
|
-
}>;
|
|
268
|
-
edit: (noteId: string, baseRevision: string, edits: NoteEdit[], mode?: "merge" | "exact", options?: {
|
|
269
|
-
commandId?: string;
|
|
270
|
-
}) => Promise<NoteWriteReceipt>;
|
|
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<NoteCommandStatus>;
|
|
273
|
-
versions: (noteId: string, query?: {
|
|
274
|
-
before?: string;
|
|
275
|
-
}) => Promise<{
|
|
276
|
-
versions: NoteVersion[];
|
|
277
|
-
nextCursor?: string | null;
|
|
278
|
-
}>;
|
|
279
|
-
version: (noteId: string, versionId: string) => Promise<NoteVersion>;
|
|
280
|
-
list: (query?: {
|
|
281
|
-
q?: string;
|
|
282
|
-
limit?: number;
|
|
283
|
-
offset?: number;
|
|
284
|
-
includeArchived?: boolean;
|
|
285
|
-
}) => Promise<{
|
|
286
|
-
notes: NoteRow[];
|
|
287
|
-
}>;
|
|
288
|
-
search: (q: string, limit?: number, offset?: number, options?: {
|
|
289
|
-
includeArchived?: boolean;
|
|
290
|
-
}) => Promise<{
|
|
291
|
-
notes: NoteRow[];
|
|
292
|
-
total: number;
|
|
293
|
-
}>;
|
|
294
|
-
body: (noteId: string) => Promise<NoteBody>;
|
|
295
|
-
sections: (noteId: string) => Promise<{
|
|
296
|
-
sections: Section[];
|
|
297
|
-
etag: string;
|
|
298
|
-
}>;
|
|
299
|
-
section: (noteId: string, anchor: string) => Promise<NoteBody & 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("./note-presence.js").NoteContributorsPage>;
|
|
313
|
-
presence: {
|
|
314
|
-
(id: string): Promise<import("./note-presence.js").NotePresenceRoster>;
|
|
315
|
-
(id: string, input: Record<string, unknown>): Promise<import("./note-presence.js").NotePresenceReceipt>;
|
|
316
|
-
};
|
|
317
|
-
presenceText: (id: string) => Promise<string>;
|
|
318
|
-
updatePresence: (id: string, input: Record<string, unknown>, options?: import("./client.js").RequestOptions) => Promise<import("./note-presence.js").NotePresenceReceipt>;
|
|
319
|
-
visit: (id: string, options?: {
|
|
320
|
-
intent?: string;
|
|
321
|
-
}) => Promise<import("./note-presence.js").NotePresenceReceipt>;
|
|
322
|
-
activity: (id: string, options?: import("./client.js").RequestOptions) => Promise<{
|
|
323
|
-
activities: import("./note-presence.js").NoteActivity[];
|
|
324
|
-
}>;
|
|
325
|
-
events: (id: string, signal: AbortSignal, receive: (event: import("./note-events.js").NoteEvent) => void) => Promise<void>;
|
|
326
|
-
selectText: (id: string, options: import("./note-presence.js").NoteSelectionOptions) => Promise<import("./note-presence.js").NoteSelectionReceipt>;
|
|
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 NotesApi = ReturnType<typeof notesApi>;
|
|
1
|
+
/** @deprecated Import the canonical Memo module. */
|
|
2
|
+
export * from "./memos.js";
|