@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
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { AmbiguousMatch, EditError, NoMatch, find, insert, insertPlacement, replacementPlan, removalPlan, applyEditPlan, remove, replace, } from "./editing.js";
|
|
24
24
|
import { readDocumentSnapshot, documentInsertion, documentEdits, submitDocumentPatch, printPatchReceipt, documentWriteError, commandIdFlag, withCommandId, parseLines } from "./document.js";
|
|
25
|
-
import {
|
|
26
|
-
import { lineRange, InvalidLineRange } from "../../api/
|
|
27
|
-
import {
|
|
25
|
+
import { memosApi } from "../../api/memos.js";
|
|
26
|
+
import { lineRange, InvalidLineRange } from "../../api/memo-reading.js";
|
|
27
|
+
import { memoTransport } from "./api-transport.js";
|
|
28
28
|
import { markdownToc, htmlToc } from "./toc.js";
|
|
29
29
|
// The connection plumbing lives in the main notes module; importing it keeps
|
|
30
30
|
// one definition of "how do I reach the server".
|
|
@@ -182,7 +182,7 @@ function reportEdit(err) {
|
|
|
182
182
|
return report(err);
|
|
183
183
|
}
|
|
184
184
|
// ── Commands ─────────────────────────────────────────────────────────────────
|
|
185
|
-
export async function
|
|
185
|
+
export async function runMemosFind(query, opts) {
|
|
186
186
|
const ref = requireNote(opts);
|
|
187
187
|
if (!ref)
|
|
188
188
|
return 1;
|
|
@@ -217,7 +217,7 @@ export async function runNotesFind(query, opts) {
|
|
|
217
217
|
return reportEdit(e);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
export async function
|
|
220
|
+
export async function runMemosToc(opts) {
|
|
221
221
|
const ref = requireNote(opts);
|
|
222
222
|
if (!ref)
|
|
223
223
|
return 1;
|
|
@@ -306,12 +306,12 @@ async function editText(opts) {
|
|
|
306
306
|
}
|
|
307
307
|
/** A mapped address names the full original span of that element at the snapshot's revision. */
|
|
308
308
|
async function addressSpan(c, id, source, address) {
|
|
309
|
-
const range = await
|
|
309
|
+
const range = await memosApi(memoTransport(c), c.ns).addressRange(id, address, source.revision);
|
|
310
310
|
return [range.start, range.end];
|
|
311
311
|
}
|
|
312
312
|
/** `notes replace|delete NOTE_ID --lines a:b …`: with a span selector and no --note, a
|
|
313
313
|
* 24-hex positional is the note, not a query (Notes API: IDs are primary). */
|
|
314
|
-
export function
|
|
314
|
+
export function positionalMemo(query, opts) {
|
|
315
315
|
const selector = opts.lines !== undefined || opts.line !== undefined || opts.address !== undefined || opts.ind !== undefined;
|
|
316
316
|
if (query !== undefined && opts.note === undefined && selector && /^[a-f0-9]{24}$/i.test(query))
|
|
317
317
|
return [undefined, { ...opts, note: query }];
|
|
@@ -401,8 +401,8 @@ function modernFlagsCompatible(opts) {
|
|
|
401
401
|
}
|
|
402
402
|
return true;
|
|
403
403
|
}
|
|
404
|
-
export async function
|
|
405
|
-
[query, opts] =
|
|
404
|
+
export async function runMemosReplace(query, opts) {
|
|
405
|
+
[query, opts] = positionalMemo(query, opts);
|
|
406
406
|
if (!modernFlagsCompatible(opts))
|
|
407
407
|
return 1;
|
|
408
408
|
const text = await editText(opts);
|
|
@@ -444,8 +444,8 @@ export async function runNotesReplace(query, opts) {
|
|
|
444
444
|
: replacementPlan(source.content, opts.text, whereFrom(query, opts)));
|
|
445
445
|
}
|
|
446
446
|
/** `notes delete` and its contract alias `notes remove`: delete selected source, never the Note. */
|
|
447
|
-
export async function
|
|
448
|
-
[query, opts] =
|
|
447
|
+
export async function runMemosDelete(query, opts) {
|
|
448
|
+
[query, opts] = positionalMemo(query, opts);
|
|
449
449
|
if (!modernFlagsCompatible(opts))
|
|
450
450
|
return 1;
|
|
451
451
|
if (opts.legacy || opts.force || opts.ifMatch !== undefined)
|
|
@@ -498,7 +498,7 @@ export function setElementHtml(source, css, html) {
|
|
|
498
498
|
return applyEditPlan(source, elementHtmlPlan(source, css, html));
|
|
499
499
|
}
|
|
500
500
|
/** `notes insert [NOTE] --before|--after ADDRESS | --cursor N | --line N | --ind N | --selector CSS`; the note may be positional (IDs are primary). */
|
|
501
|
-
export async function
|
|
501
|
+
export async function runMemosInsert(noteOrOpts, maybeOpts) {
|
|
502
502
|
let opts = typeof noteOrOpts === "object" && noteOrOpts !== null ? noteOrOpts : (maybeOpts ?? {});
|
|
503
503
|
if (typeof noteOrOpts === "string") {
|
|
504
504
|
if (opts.note !== undefined && opts.note !== noteOrOpts) {
|
|
@@ -630,7 +630,7 @@ async function runLegacyNotesDelete(query, opts) {
|
|
|
630
630
|
: remove(src, whereFrom(query, opts)));
|
|
631
631
|
}
|
|
632
632
|
/** `dreamlake notes select "#contact" --note NOTE` */
|
|
633
|
-
export async function
|
|
633
|
+
export async function runMemosSelect(css, opts) {
|
|
634
634
|
const ref = requireNote(opts);
|
|
635
635
|
if (!ref)
|
|
636
636
|
return 1;
|
|
@@ -663,7 +663,7 @@ export async function runNotesSelect(css, opts) {
|
|
|
663
663
|
return reportEdit(e);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
export async function
|
|
666
|
+
export async function runMemosGrep(query, opts) {
|
|
667
667
|
const c = await ctx(opts);
|
|
668
668
|
if (!c)
|
|
669
669
|
return 1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** CLI adapter: the parser lives in `src/api/note-events.ts`; this supplies the CLI's request. */
|
|
2
2
|
import { requestRaw } from '../client.js';
|
|
3
|
-
import { type
|
|
4
|
-
export type { Selection, Participant,
|
|
3
|
+
import { type MemoEvent } from '../../api/memo-events.js';
|
|
4
|
+
export type { Selection, Participant, MemoEvent } from '../../api/memo-events.js';
|
|
5
5
|
/** Fetch SSE with auth headers, abort/idle bounds, and no automatic replay across gaps. */
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function readMemoEvents(url: string, token: string, note: string, signal: AbortSignal, receive: (event: MemoEvent) => void, request?: typeof requestRaw): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** CLI adapter: the parser lives in `src/api/note-events.ts`; this supplies the CLI's request. */
|
|
2
2
|
import { requestRaw } from '../client.js';
|
|
3
|
-
import {
|
|
3
|
+
import { readMemoEvents as readEvents } from '../../api/memo-events.js';
|
|
4
4
|
/** Fetch SSE with auth headers, abort/idle bounds, and no automatic replay across gaps. */
|
|
5
|
-
export function
|
|
5
|
+
export function readMemoEvents(url, token, note, signal, receive, request = requestRaw) {
|
|
6
6
|
return readEvents(url, token, note, signal, receive, request);
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type MemoFile } from '../../api/memo-files.js';
|
|
2
2
|
import { type ConnOpts, ctx } from "./index.js";
|
|
3
|
-
export type FileRow =
|
|
3
|
+
export type FileRow = MemoFile;
|
|
4
4
|
/** Exit code for "the file or path was wrong", distinct from a transport failure. */
|
|
5
5
|
export declare const EXIT_NO_FILE = 6;
|
|
6
6
|
/** Exit code for a refused overwrite — a script can branch on it and retry. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { memoFilesApi, memoFileOperationId, validateMemoFileKey } from '../../api/memo-files.js';
|
|
2
|
+
import { memoTransport } from './api-transport.js';
|
|
3
3
|
/**
|
|
4
4
|
* `dreamlake notes files …` — list, upload, download, move, copy, trash.
|
|
5
5
|
*
|
|
@@ -89,11 +89,11 @@ function reportFile(err, recovery) {
|
|
|
89
89
|
return report(err);
|
|
90
90
|
}
|
|
91
91
|
function operationIdOf(value) {
|
|
92
|
-
return
|
|
92
|
+
return memoFileOperationId(value);
|
|
93
93
|
}
|
|
94
94
|
function keyValid(key) {
|
|
95
95
|
try {
|
|
96
|
-
|
|
96
|
+
validateMemoFileKey(key);
|
|
97
97
|
return true;
|
|
98
98
|
}
|
|
99
99
|
catch (error) {
|
|
@@ -490,7 +490,7 @@ export async function runFilesRestore(ref, opts) {
|
|
|
490
490
|
*/
|
|
491
491
|
export async function resolveFile(c, noteId, ref, opts = {}) {
|
|
492
492
|
try {
|
|
493
|
-
return await
|
|
493
|
+
return await memoFilesApi(memoTransport(c), `/namespaces/${seg(c.ns)}/notes/${seg(noteId)}`).resolve(ref, opts.includeTrashed);
|
|
494
494
|
}
|
|
495
495
|
catch (error) {
|
|
496
496
|
if (error.status !== 404)
|
|
@@ -46,23 +46,23 @@ export declare function bodyFrom(opts: {
|
|
|
46
46
|
file?: string;
|
|
47
47
|
text?: string;
|
|
48
48
|
}, nativeSourceStdin?: boolean): Promise<string | null>;
|
|
49
|
-
export declare function
|
|
50
|
-
export declare function
|
|
49
|
+
export declare function registerMemosCommand(program: Command): void;
|
|
50
|
+
export declare function runMemosList(opts: ConnOpts & {
|
|
51
51
|
limit?: string;
|
|
52
52
|
offset?: string;
|
|
53
53
|
shared?: boolean;
|
|
54
54
|
includeArchived?: boolean;
|
|
55
55
|
json?: boolean;
|
|
56
56
|
}): Promise<number>;
|
|
57
|
-
export declare function
|
|
57
|
+
export declare function runMemosSearch(query: string, opts: ConnOpts & {
|
|
58
58
|
limit?: string;
|
|
59
59
|
includeArchived?: boolean;
|
|
60
60
|
json?: boolean;
|
|
61
61
|
}): Promise<number>;
|
|
62
|
-
export declare function
|
|
62
|
+
export declare function runMemosSections(ref: string, opts: ConnOpts & {
|
|
63
63
|
json?: boolean;
|
|
64
64
|
}): Promise<number>;
|
|
65
|
-
export declare function
|
|
65
|
+
export declare function runMemosWrite(ref: string, opts: ConnOpts & {
|
|
66
66
|
section?: string;
|
|
67
67
|
file?: string;
|
|
68
68
|
text?: string;
|
|
@@ -75,7 +75,7 @@ export declare function runNotesWrite(ref: string, opts: ConnOpts & {
|
|
|
75
75
|
dryRun?: boolean;
|
|
76
76
|
commandId?: string;
|
|
77
77
|
}): Promise<number>;
|
|
78
|
-
export declare function
|
|
78
|
+
export declare function runMemosAppend(ref: string, opts: ConnOpts & {
|
|
79
79
|
file?: string;
|
|
80
80
|
text?: string;
|
|
81
81
|
force?: boolean;
|
|
@@ -86,14 +86,14 @@ export declare function runNotesAppend(ref: string, opts: ConnOpts & {
|
|
|
86
86
|
dryRun?: boolean;
|
|
87
87
|
commandId?: string;
|
|
88
88
|
}): Promise<number>;
|
|
89
|
-
export declare function
|
|
89
|
+
export declare function runMemosCreate(name: string | undefined, opts: ConnOpts & {
|
|
90
90
|
file?: string;
|
|
91
91
|
text?: string;
|
|
92
92
|
public?: boolean;
|
|
93
93
|
json?: boolean;
|
|
94
94
|
project?: string[];
|
|
95
95
|
}): Promise<number>;
|
|
96
|
-
export declare function
|
|
96
|
+
export declare function runMemosAddSection(ref: string, opts: ConnOpts & {
|
|
97
97
|
before?: string;
|
|
98
98
|
after?: string;
|
|
99
99
|
file?: string;
|
|
@@ -103,25 +103,25 @@ export declare function runNotesAddSection(ref: string, opts: ConnOpts & {
|
|
|
103
103
|
json?: boolean;
|
|
104
104
|
dryRun?: boolean;
|
|
105
105
|
}): Promise<number>;
|
|
106
|
-
export declare function
|
|
106
|
+
export declare function runMemosRmSection(ref: string, anchor: string, opts: ConnOpts & {
|
|
107
107
|
ifMatch?: string;
|
|
108
108
|
force?: boolean;
|
|
109
109
|
json?: boolean;
|
|
110
110
|
dryRun?: boolean;
|
|
111
111
|
}): Promise<number>;
|
|
112
112
|
/** Explicit compatibility keeps legacy body-only output and ETag semantics available. */
|
|
113
|
-
export declare function
|
|
114
|
-
export declare function
|
|
113
|
+
export declare function runMemosRead(ref: string | undefined, opts: DocumentReadOptions): Promise<number>;
|
|
114
|
+
export declare function runMemosDiff(ref: string | undefined, opts: DocumentReadOptions & {
|
|
115
115
|
context?: string;
|
|
116
116
|
}): Promise<number>;
|
|
117
|
-
export declare function
|
|
117
|
+
export declare function runMemosPatch(ref: string, opts: DocumentPatchOptions): Promise<number>;
|
|
118
118
|
/** Reading the roster never registers presence or maintains a session. */
|
|
119
|
-
export declare function
|
|
119
|
+
export declare function runMemosContributors(ref: string, opts: ConnOpts & {
|
|
120
120
|
json?: boolean;
|
|
121
121
|
cursor?: string;
|
|
122
122
|
}): Promise<number>;
|
|
123
123
|
/** Reading the roster never registers presence or maintains a session. */
|
|
124
|
-
export declare function
|
|
124
|
+
export declare function runMemosPresence(ref: string, opts: ConnOpts & {
|
|
125
125
|
json?: boolean;
|
|
126
126
|
}): Promise<number>;
|
|
127
127
|
/** The agent's self-reported purpose, validated before any presence request.
|
|
@@ -130,10 +130,10 @@ export declare function presenceIntent(value: string | undefined): {
|
|
|
130
130
|
summary: string;
|
|
131
131
|
} | undefined;
|
|
132
132
|
/** One-shot participation; linger owns its own maintained lease. */
|
|
133
|
-
export declare function
|
|
133
|
+
export declare function runMemosVisit(ref: string, opts: ConnOpts & {
|
|
134
134
|
json?: boolean;
|
|
135
135
|
intent?: string;
|
|
136
136
|
}): Promise<number>;
|
|
137
137
|
/** Metadata only: no body read, RTC activation, mount, or ownership mutation. */
|
|
138
|
-
export declare function
|
|
138
|
+
export declare function runMemosProjects(id: string, opts: ConnOpts): Promise<number>;
|
|
139
139
|
export {};
|