@dreamlake/dreamlake-cli 0.104.7 → 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.
Files changed (113) hide show
  1. package/dist/api/content.d.ts +4 -3
  2. package/dist/api/index.d.ts +33 -23
  3. package/dist/api/index.js +25 -16
  4. package/dist/api/memo-character-plan.d.ts +2 -0
  5. package/dist/api/memo-character-plan.js +2 -0
  6. package/dist/api/memo-editing.d.ts +2 -0
  7. package/dist/api/memo-editing.js +2 -0
  8. package/dist/api/memo-edits.d.ts +63 -0
  9. package/dist/api/memo-edits.js +206 -0
  10. package/dist/api/memo-events.d.ts +44 -0
  11. package/dist/api/memo-events.js +65 -0
  12. package/dist/api/memo-facade.d.ts +294 -0
  13. package/dist/api/memo-facade.js +382 -0
  14. package/dist/api/memo-files.d.ts +111 -0
  15. package/dist/api/memo-files.js +110 -0
  16. package/dist/api/memo-html-read.d.ts +2 -0
  17. package/dist/api/memo-html-read.js +2 -0
  18. package/dist/api/memo-html.d.ts +2 -0
  19. package/dist/api/memo-html.js +2 -0
  20. package/dist/api/memo-linger.d.ts +85 -0
  21. package/dist/api/memo-linger.js +271 -0
  22. package/dist/api/memo-presence.d.ts +109 -0
  23. package/dist/api/memo-presence.js +75 -0
  24. package/dist/api/memo-reading.d.ts +55 -0
  25. package/dist/api/memo-reading.js +43 -0
  26. package/dist/api/memo-toc.d.ts +2 -0
  27. package/dist/api/memo-toc.js +2 -0
  28. package/dist/api/memo-write.d.ts +119 -0
  29. package/dist/api/memo-write.js +221 -0
  30. package/dist/api/memos.d.ts +344 -0
  31. package/dist/api/memos.js +231 -0
  32. package/dist/api/note-character-plan.d.ts +2 -2
  33. package/dist/api/note-character-plan.js +2 -2
  34. package/dist/api/note-editing.d.ts +2 -2
  35. package/dist/api/note-editing.js +2 -2
  36. package/dist/api/note-edits.d.ts +2 -59
  37. package/dist/api/note-edits.js +2 -205
  38. package/dist/api/note-events.d.ts +2 -41
  39. package/dist/api/note-events.js +2 -64
  40. package/dist/api/note-facade.d.ts +2 -268
  41. package/dist/api/note-facade.js +2 -376
  42. package/dist/api/note-files.d.ts +2 -102
  43. package/dist/api/note-files.js +2 -107
  44. package/dist/api/note-html-read.d.ts +2 -2
  45. package/dist/api/note-html-read.js +2 -2
  46. package/dist/api/note-html.d.ts +2 -2
  47. package/dist/api/note-html.js +2 -2
  48. package/dist/api/note-linger.d.ts +2 -83
  49. package/dist/api/note-linger.js +2 -270
  50. package/dist/api/note-presence.d.ts +2 -100
  51. package/dist/api/note-presence.js +2 -73
  52. package/dist/api/note-reading.d.ts +2 -51
  53. package/dist/api/note-reading.js +2 -42
  54. package/dist/api/note-toc.d.ts +2 -2
  55. package/dist/api/note-toc.js +2 -2
  56. package/dist/api/note-write.d.ts +2 -110
  57. package/dist/api/note-write.js +2 -217
  58. package/dist/api/notes.d.ts +2 -335
  59. package/dist/api/notes.js +2 -230
  60. package/dist/api/open-resources.js +3 -3
  61. package/dist/api/workspace.d.ts +3 -2
  62. package/dist/api/workspace.js +7 -6
  63. package/dist/cli/artifact/index.js +3 -3
  64. package/dist/cli/folders/index.d.ts +1 -1
  65. package/dist/cli/folders/index.js +4 -4
  66. package/dist/cli/help-examples.generated.js +1 -1
  67. package/dist/cli/index.js +2 -2
  68. package/dist/cli/{notes → memos}/api-transport.d.ts +1 -1
  69. package/dist/cli/{notes → memos}/api-transport.js +1 -1
  70. package/dist/cli/{notes → memos}/archive-command.d.ts +1 -1
  71. package/dist/cli/{notes → memos}/archive-command.js +5 -5
  72. package/dist/cli/{notes → memos}/character-plan.d.ts +3 -1
  73. package/dist/cli/{notes → memos}/character-plan.js +7 -5
  74. package/dist/cli/{notes → memos}/document.d.ts +9 -9
  75. package/dist/cli/{notes → memos}/document.js +12 -12
  76. package/dist/cli/{notes → memos}/edit-commands.d.ts +8 -8
  77. package/dist/cli/{notes → memos}/edit-commands.js +14 -14
  78. package/dist/cli/{notes → memos}/events.d.ts +3 -3
  79. package/dist/cli/{notes → memos}/events.js +2 -2
  80. package/dist/cli/{notes → memos}/files-commands.d.ts +2 -2
  81. package/dist/cli/{notes → memos}/files-commands.js +5 -5
  82. package/dist/cli/{notes → memos}/index.d.ts +16 -16
  83. package/dist/cli/{notes → memos}/index.js +53 -53
  84. package/dist/cli/{notes → memos}/linger.d.ts +3 -3
  85. package/dist/cli/{notes → memos}/linger.js +5 -5
  86. package/dist/cli/{notes → memos}/move-command.d.ts +5 -5
  87. package/dist/cli/{notes → memos}/move-command.js +6 -6
  88. package/dist/cli/{notes → memos}/rm-command.d.ts +2 -2
  89. package/dist/cli/{notes → memos}/rm-command.js +2 -2
  90. package/dist/cli/{notes → memos}/select-command.d.ts +1 -1
  91. package/dist/cli/{notes → memos}/select-command.js +4 -4
  92. package/dist/cli/{notes → memos}/suggest-diff.d.ts +1 -1
  93. package/dist/cli/{notes → memos}/suggest-diff.js +2 -2
  94. package/dist/cli/{notes → memos}/transfer-command.d.ts +2 -2
  95. package/dist/cli/{notes → memos}/transfer-command.js +2 -2
  96. package/dist/cli/share.d.ts +1 -1
  97. package/dist/cli/share.js +10 -6
  98. package/dist/cli/update/index.js +3 -3
  99. package/dist/cli/version.d.ts +1 -1
  100. package/dist/cli/version.js +1 -1
  101. package/package.json +9 -9
  102. /package/dist/cli/{notes → memos}/editing.d.ts +0 -0
  103. /package/dist/cli/{notes → memos}/editing.js +0 -0
  104. /package/dist/cli/{notes → memos}/html-read.d.ts +0 -0
  105. /package/dist/cli/{notes → memos}/html-read.js +0 -0
  106. /package/dist/cli/{notes → memos}/html.d.ts +0 -0
  107. /package/dist/cli/{notes → memos}/html.js +0 -0
  108. /package/dist/cli/{notes → memos}/media-commands.d.ts +0 -0
  109. /package/dist/cli/{notes → memos}/media-commands.js +0 -0
  110. /package/dist/cli/{notes → memos}/toc.d.ts +0 -0
  111. /package/dist/cli/{notes → memos}/toc.js +0 -0
  112. /package/dist/cli/{notes → memos}/version-commands.d.ts +0 -0
  113. /package/dist/cli/{notes → memos}/version-commands.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { Command } from 'commander';
2
2
  import { type MetadataTransferOptions } from '../ownership/metadata-transfer.js';
3
- export type NoteTransferOptions = MetadataTransferOptions;
3
+ export type MemoTransferOptions = MetadataTransferOptions;
4
4
  /** The Note convenience command uses the same capability-bound metadata protocol. */
5
- export declare function runNotesTransfer(noteId: string, opts: NoteTransferOptions): Promise<number>;
5
+ export declare function runMemosTransfer(noteId: string, opts: MemoTransferOptions): Promise<number>;
6
6
  export declare function registerTransferCommand(notes: Command): void;
@@ -1,9 +1,9 @@
1
1
  import { metadataTransferFlags, runMetadataTransfer } from '../ownership/metadata-transfer.js';
2
2
  /** The Note convenience command uses the same capability-bound metadata protocol. */
3
- export function runNotesTransfer(noteId, opts) {
3
+ export function runMemosTransfer(noteId, opts) {
4
4
  return runMetadataTransfer('note', noteId, opts);
5
5
  }
6
6
  export function registerTransferCommand(notes) {
7
7
  metadataTransferFlags(notes.command('transfer <note-id>').description('Request a recipient-accepted, metadata-only Memo ownership transfer'))
8
- .action(async (noteId, opts) => { process.exitCode = await runNotesTransfer(noteId, opts); });
8
+ .action(async (noteId, opts) => { process.exitCode = await runMemosTransfer(noteId, opts); });
9
9
  }
@@ -1,6 +1,6 @@
1
1
  /** Share management uses catalog metadata only; it never reads or rewrites content. */
2
2
  import type { Command } from "commander";
3
- import { type ConnOpts } from "./notes/index.js";
3
+ import { type ConnOpts } from "./memos/index.js";
4
4
  type Kind = "notes" | "artifact";
5
5
  type Operation = "get" | "create" | "revoke" | "access" | "remove" | "visibility";
6
6
  interface ShareOptions extends ConnOpts {
package/dist/cli/share.js CHANGED
@@ -3,15 +3,16 @@ import { resolveCtx } from "./compat/ctx.js";
3
3
  import { withConnFlags } from "./compat/flags.js";
4
4
  import { requireNamespace, requireToken } from "./compat/http.js";
5
5
  import { emitJson, fail, renderTable } from "./helpers.js";
6
- import { resolveNote } from "./notes/index.js";
6
+ import { resolveNote } from "./memos/index.js";
7
7
  import { webBase } from "./workflow/index.js";
8
8
  export async function runShare(kind, operation, ref, opts) {
9
9
  if (operation === "create" && kind === "notes" && !["read", "write"].includes(opts.role ?? "read")) {
10
10
  fail("--role must be read or write");
11
11
  return 1;
12
12
  }
13
- if (operation === "visibility" && !["private", "public"].includes(opts.visibility ?? "")) {
14
- fail("visibility must be private or public");
13
+ const visibilities = kind === "artifact" ? ["private", "public", "unlisted"] : ["private", "public"];
14
+ if (operation === "visibility" && !visibilities.includes(opts.visibility ?? "")) {
15
+ fail(`visibility must be ${visibilities.join(", ")}`);
15
16
  return 1;
16
17
  }
17
18
  const c = resolveCtx(opts);
@@ -45,6 +46,9 @@ export async function runShare(kind, operation, ref, opts) {
45
46
  return 1;
46
47
  row = await requestJson(c.remote, `/namespaces/${encodeURIComponent(ns)}/artifacts/${encodeURIComponent(id)}`, { token });
47
48
  }
49
+ const urlId = kind === "artifact" ? row.slug ?? ref : id;
50
+ if (kind === "artifact" && typeof row.artifactId === "string")
51
+ id = row.artifactId;
48
52
  const base = `/namespaces/${encodeURIComponent(ns)}/${kind === "notes" ? "notes" : "artifacts"}/${encodeURIComponent(id)}`;
49
53
  const canManage = kind === "notes" ? row.permissions?.share : row.viewerCanManage;
50
54
  // The artifact mutation endpoint is an upsert: preflight avoids creating a
@@ -89,10 +93,10 @@ export async function runShare(kind, operation, ref, opts) {
89
93
  : { json: { share: operation === "create" } }),
90
94
  });
91
95
  }
92
- const url = `${webBase(c.remote)}/${encodeURIComponent(ns)}/${kind === "notes" ? "notes" : "artifacts"}/${encodeURIComponent(id)}`;
96
+ const url = `${webBase(c.remote)}/${encodeURIComponent(ns)}/${kind === "notes" ? "notes" : "artifacts"}/${encodeURIComponent(urlId)}`;
93
97
  const result = {
94
98
  url, visibility: row.visibility,
95
- publicUrl: row.visibility === "public" ? url : null,
99
+ publicUrl: row.visibility === "public" || (kind === "artifact" && row.visibility === "unlisted") ? url : null,
96
100
  shareUrl: row.shareToken ? `${url}?share=${encodeURIComponent(row.shareToken)}` : null,
97
101
  shareRole: kind === "notes" ? row.shareRole ?? null : row.shareToken ? "read" : null,
98
102
  // An omitted token is redacted, not evidence that sharing is disabled.
@@ -132,7 +136,7 @@ export function registerShareCommands(parent, kind) {
132
136
  else
133
137
  cmd.action(async (ref, opts) => { process.exit(await runShare(kind, operation, ref, opts)); });
134
138
  }
135
- withConnFlags(parent.command("visibility").argument("<resource>").argument("<visibility>", "private or public")
139
+ withConnFlags(parent.command("visibility").argument("<resource>").argument("<visibility>", kind === "artifact" ? "private, public or unlisted" : "private or public")
136
140
  .description("set read visibility; does not revoke share links or accepted access")
137
141
  .option("--namespace <slug>", "namespace").option("--json", "emit structured JSON"))
138
142
  .action(async (ref, visibility, opts) => { process.exit(await runShare(kind, "visibility", ref, { ...opts, visibility })); });
@@ -8,8 +8,8 @@
8
8
  import { HttpError, requestJson } from "../client.js";
9
9
  import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
10
10
  import { fail, ok, splitCsv } from "../helpers.js";
11
- import { resolveNote, seg } from "../notes/index.js";
12
- import { noteProjectNode } from "../notes/move-command.js";
11
+ import { resolveNote, seg } from "../memos/index.js";
12
+ import { memoProjectNode } from "../memos/move-command.js";
13
13
  import { fetchAllBindrs, fetchAllEpisodes, matchBindrs, matchEpisodes, resolveProjectCtx, } from "../resources.js";
14
14
  import { formatProject } from "../target.js";
15
15
  function nothingToDo(opts) {
@@ -62,7 +62,7 @@ export async function runUpdateBindr(name, opts) {
62
62
  const noteId = await resolveNote({ remote, token, ns: s.namespace }, opts.addNote);
63
63
  if (!noteId)
64
64
  return 1;
65
- const node = await noteProjectNode(remote, token, s.namespace, noteId, s.project);
65
+ const node = await memoProjectNode(remote, token, s.namespace, noteId, s.project);
66
66
  // Idempotent on the server: re-tagging an already-tagged node changes nothing.
67
67
  const res = await requestJson(remote, `/bindrs/${seg(bindr.id)}/members`, {
68
68
  method: "POST",
@@ -1 +1 @@
1
- export declare const VERSION = "0.104.7";
1
+ export declare const VERSION = "0.105.0";
@@ -6,4 +6,4 @@
6
6
  // value means a binary that re-installs the same version forever.
7
7
  //
8
8
  // Editing this by hand does nothing for a release; bump package.json.
9
- export const VERSION = "0.104.7";
9
+ export const VERSION = "0.105.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamlake/dreamlake-cli",
3
- "version": "0.104.7",
3
+ "version": "0.105.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dreamlake-ai/dreamlake-cli.git"
@@ -36,13 +36,13 @@
36
36
  "node": ">=18"
37
37
  },
38
38
  "optionalDependencies": {
39
- "@dreamlake/dreamlake-cli-darwin-arm64": "0.104.7",
40
- "@dreamlake/dreamlake-cli-darwin-x64": "0.104.7",
41
- "@dreamlake/dreamlake-cli-linux-x64": "0.104.7",
42
- "@dreamlake/dreamlake-cli-linux-arm64": "0.104.7",
43
- "@dreamlake/dreamlake-cli-linux-x64-musl": "0.104.7",
44
- "@dreamlake/dreamlake-cli-linux-arm64-musl": "0.104.7",
45
- "@dreamlake/dreamlake-cli-win32-x64": "0.104.7",
46
- "@dreamlake/dreamlake-cli-win32-arm64": "0.104.7"
39
+ "@dreamlake/dreamlake-cli-darwin-arm64": "0.105.0",
40
+ "@dreamlake/dreamlake-cli-darwin-x64": "0.105.0",
41
+ "@dreamlake/dreamlake-cli-linux-x64": "0.105.0",
42
+ "@dreamlake/dreamlake-cli-linux-arm64": "0.105.0",
43
+ "@dreamlake/dreamlake-cli-linux-x64-musl": "0.105.0",
44
+ "@dreamlake/dreamlake-cli-linux-arm64-musl": "0.105.0",
45
+ "@dreamlake/dreamlake-cli-win32-x64": "0.105.0",
46
+ "@dreamlake/dreamlake-cli-win32-arm64": "0.105.0"
47
47
  }
48
48
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes