@squirrelnotes.app/mcp 2.7.1-test.383 → 2.7.1-test.386

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.
@@ -41677,7 +41677,7 @@ var init_note_text = __esm({
41677
41677
  // stored in parts that does not verify is never shown in part or written
41678
41678
  // over; a write that lost a race to another writer writes nothing.
41679
41679
  unreadable: "This note could not be read in full. Nothing has been changed.",
41680
- "write-conflict": "The note changed on the server while this was being written, so nothing was written. Read it again and retry.",
41680
+ "write-conflict": "The note changed on the server since it was read, so nothing was written. Read it again and retry.",
41681
41681
  // ADR-0523 §7, §8: the account's storage (notes, files and the Trash
41682
41682
  // until it is emptied) is full. The server's answer carries no size.
41683
41683
  "storage-full": "The account's storage is full, so nothing was written. Ask the user to free space: delete notes or files, or empty the Trash."
@@ -42113,10 +42113,10 @@ function readNoteContent(note, key) {
42113
42113
  if (!note.body) throw new NoteBodyUnreadableError();
42114
42114
  const chunked = readChunkedBody(key, note.id, note.body);
42115
42115
  if (note.encryptedContent) throw new NoteBodyUnreadableError();
42116
- return { text: chunked.text, chunked };
42116
+ return { text: chunked.text, chunked, inlineIv: null };
42117
42117
  }
42118
42118
  const text = note.encryptedContent && note.contentIv ? decrypt(note.encryptedContent, note.contentIv, key) : "";
42119
- return { text, chunked: null };
42119
+ return { text, chunked: null, inlineIv: note.contentIv ?? null };
42120
42120
  }
42121
42121
  function refused(error62, details) {
42122
42122
  return details === void 0 ? { kind: "refused", error: error62 } : { kind: "refused", error: error62, details };
@@ -42124,9 +42124,6 @@ function refused(error62, details) {
42124
42124
  function lostRace(err) {
42125
42125
  return err instanceof SquirrelApiError && err.status === 409 && /NOTE_BODY_(CONFLICT|CHUNKED)/.test(err.responseBody);
42126
42126
  }
42127
- function conversionsOff(err) {
42128
- return err instanceof SquirrelApiError && err.status === 409 && err.responseBody.includes("NOTE_BODY_CONVERSIONS_OFF");
42129
- }
42130
42127
  function codeOf(err) {
42131
42128
  try {
42132
42129
  const body = JSON.parse(err.responseBody);
@@ -42163,14 +42160,14 @@ async function writeNoteContent(client, key, noteId, text, current) {
42163
42160
  if (lostRace(err)) return refused("write-conflict");
42164
42161
  const refusal = serverRefusal(err, bytes);
42165
42162
  if (refusal) return refusal;
42166
- if (current.chunked || !conversionsOff(err)) throw err;
42163
+ throw err;
42167
42164
  }
42168
42165
  }
42169
42166
  const capped = overInlineCap(bytes);
42170
42167
  if (capped) return capped;
42171
42168
  const enc = encrypt(text, key);
42172
42169
  try {
42173
- const saved = await client.updateNote(noteId, inlineContentFields(enc));
42170
+ const saved = await client.updateNote(noteId, { ...inlineContentFields(enc), baseContentIv: current.inlineIv });
42174
42171
  return { kind: "written", updatedAt: saved.updatedAt };
42175
42172
  } catch (err) {
42176
42173
  if (lostRace(err)) return refused("write-conflict");
@@ -42190,20 +42187,18 @@ async function createNoteWithContent(client, key, fields, text) {
42190
42187
  const bytes = utf8Bytes(text);
42191
42188
  if (overThreshold(bytes)) {
42192
42189
  const id = randomUUID3();
42193
- let note = null;
42190
+ let note;
42194
42191
  try {
42195
42192
  note = await client.createNote({ ...fields, id, body: buildChunkedCommit(key, id, text).commit });
42196
42193
  } catch (err) {
42197
42194
  const refusal = serverRefusal(err, bytes);
42198
42195
  if (refusal) return refusal;
42199
- if (!conversionsOff(err)) throw err;
42196
+ throw err;
42200
42197
  }
42201
- if (note?.bodyFormat === NOTE_BODY_FORMAT_CHUNKS) return { kind: "created", note };
42198
+ if (note.bodyFormat === NOTE_BODY_FORMAT_CHUNKS) return { kind: "created", note };
42202
42199
  const capped = overInlineCap(bytes);
42203
42200
  if (capped) return capped;
42204
- if (note) {
42205
- return { kind: "created", note: await client.updateNote(note.id, inlineContentFields(encrypt(text, key))) };
42206
- }
42201
+ return { kind: "created", note: await client.updateNote(note.id, inlineContentFields(encrypt(text, key))) };
42207
42202
  }
42208
42203
  try {
42209
42204
  return { kind: "created", note: await client.createNote({ ...fields, ...inlineContentFields(encrypt(text, key)) }) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squirrelnotes.app/mcp",
3
- "version": "2.7.1-test.383",
3
+ "version": "2.7.1-test.386",
4
4
  "description": "MCP stdio CLI for Squirrel Notes — bridges AI agents to the encrypted note-taking API",
5
5
  "type": "module",
6
6
  "repository": {