@squirrelnotes.app/mcp 2.8.0 → 2.9.0-test.403

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/README.md CHANGED
@@ -90,9 +90,9 @@ For a note over about 8,000 characters (about 2,000 tokens), an agent should not
90
90
 
91
91
  | Tool | Description |
92
92
  |------|-------------|
93
- | `share_note` | Publishes a note as a public link protected by a share passphrase, with optional `expiry` and `allowDownload` (default off). The note is decrypted here and re-encrypted under a key derived from the share passphrase, so the server never sees plaintext. Returns the share URL and token. The share passphrase is a tool argument, so it passes through your agent and its model provider; send it to recipients separately from the link. |
93
+ | `share_note` | Publishes a note as a public link protected by a share passphrase of at least 8 characters, with optional `expiry` and `allowDownload` (default off). The note is decrypted here and re-encrypted under a key derived from the share passphrase, so the server never sees plaintext. Returns the share URL and token. The share passphrase is a tool argument, so it passes through your agent and its model provider; send it to recipients separately from the link. |
94
94
  | `get_share_status` | Returns a note's share URL, view count, expiry and settings, or `null` if it is not shared. |
95
- | `republish_share` | Re-encrypts an existing share with the note's latest content. Needs the share passphrase (the same one or a new one). |
95
+ | `republish_share` | Re-encrypts an existing share with the note's latest content. Needs the share passphrase (the same one or a new one, at least 8 characters). |
96
96
  | `update_share_settings` | Changes a share's `expiry` and/or `allowDownload` without changing its content. |
97
97
  | `revoke_share` | Revokes a share link permanently; it stops working at once. The note is not affected. |
98
98
 
@@ -41683,8 +41683,9 @@ var init_note_text = __esm({
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.",
41684
41684
  // #668: update_note writes long content first, then the title; the server
41685
41685
  // refused only the title. `status` is the HTTP status, `reason` the
41686
- // refusal it maps to when it is one of the above (ADR-0460: no server text).
41687
- "title-not-saved": "The content was saved, but the title was not: the server refused it (status, and reason when it is a known refusal such as storage-full). Fix the cause, then retry update_note with the title alone."
41686
+ // refusal it maps to when it is one of the above (ADR-0460: no server text);
41687
+ // `cause` the network error's code when the title got no answer (#699).
41688
+ "title-not-saved": "The content was saved, but the title was not: the server refused it (status, and reason when it is a known refusal such as storage-full) or did not answer (cause, a network error code). A 429 means too many writes: wait a minute first. Fix the cause, then retry update_note with the title alone."
41688
41689
  };
41689
41690
  refuse2 = (error62, details) => details === void 0 ? { kind: "refused", error: error62 } : { kind: "refused", error: error62, details };
41690
41691
  isRefusal = (x) => "kind" in x && x.kind === "refused";
@@ -41723,12 +41724,14 @@ var init_note_text = __esm({
41723
41724
  function utf8Bytes(text) {
41724
41725
  return Buffer.byteLength(text, "utf8");
41725
41726
  }
41726
- var NOTE_BODY_MAX_BYTES, NOTE_TITLE_MAX_BYTES;
41727
+ var NOTE_BODY_MAX_BYTES, NOTE_TITLE_MAX_BYTES, SHARE_PASSPHRASE_MIN_LENGTH, SHARE_PBKDF2_ITERATIONS;
41727
41728
  var init_note_limits = __esm({
41728
41729
  "src/note-limits.ts"() {
41729
41730
  "use strict";
41730
41731
  NOTE_BODY_MAX_BYTES = 75e4;
41731
41732
  NOTE_TITLE_MAX_BYTES = 12e3;
41733
+ SHARE_PASSPHRASE_MIN_LENGTH = 8;
41734
+ SHARE_PBKDF2_ITERATIONS = 6e5;
41732
41735
  }
41733
41736
  });
41734
41737
 
@@ -42568,6 +42571,9 @@ function createMcpServer(creds, opts = {}) {
42568
42571
  try {
42569
42572
  await client.updateNote(id, dto);
42570
42573
  } catch (err) {
42574
+ if (err instanceof SquirrelNetworkError) {
42575
+ return refusalResult({ kind: "refused", error: "title-not-saved", details: err.code ? { cause: err.code } : {} });
42576
+ }
42571
42577
  if (!(err instanceof SquirrelApiError)) throw err;
42572
42578
  const reason = serverRefusal(err)?.error;
42573
42579
  return refusalResult({ kind: "refused", error: "title-not-saved", details: { ...reason ? { reason } : {}, status: err.status } });
@@ -43246,7 +43252,7 @@ function createMcpServer(creds, opts = {}) {
43246
43252
  "Publish a note as a public, passphrase-protected link. The note content is decrypted in this process and then re-encrypted with a share-specific key derived from the share passphrase \u2014 the server never sees plaintext. The share URL and token are returned. Pro tier required.",
43247
43253
  {
43248
43254
  noteId: external_exports.string().describe("ID of the note to share"),
43249
- sharePassphrase: external_exports.string().min(1).describe("Passphrase recipients must enter to read the note. Choose something memorable but not easily guessed."),
43255
+ sharePassphrase: external_exports.string().min(SHARE_PASSPHRASE_MIN_LENGTH).describe("Passphrase recipients must enter to read the note. Choose something memorable but not easily guessed."),
43250
43256
  expiry: expirySchema,
43251
43257
  allowDownload: external_exports.boolean().optional().describe('When true, viewers see a "Download as Markdown" button (default: false)')
43252
43258
  },
@@ -43258,7 +43264,7 @@ function createMcpServer(creds, opts = {}) {
43258
43264
  const tooLarge = bodyTooLong(content, "too-large-to-share");
43259
43265
  if (tooLarge) return refusalResult(tooLarge);
43260
43266
  const shareSalt = generateSalt();
43261
- const shareKey = await deriveKey(sharePassphrase, shareSalt);
43267
+ const shareKey = await deriveKey(sharePassphrase, shareSalt, SHARE_PBKDF2_ITERATIONS);
43262
43268
  const encTitle = encrypt(title, shareKey);
43263
43269
  const encContent = encrypt(content, shareKey);
43264
43270
  const status = await client.publishShare({
@@ -43267,7 +43273,7 @@ function createMcpServer(creds, opts = {}) {
43267
43273
  titleIv: encTitle.iv,
43268
43274
  ...inlineContentFields(encContent),
43269
43275
  salt: shareSalt,
43270
- pbkdf2Iterations: 6e5,
43276
+ pbkdf2Iterations: SHARE_PBKDF2_ITERATIONS,
43271
43277
  expiry,
43272
43278
  allowDownload: allowDownload ?? false
43273
43279
  });
@@ -43312,7 +43318,7 @@ function createMcpServer(creds, opts = {}) {
43312
43318
  {
43313
43319
  shareToken: external_exports.string().describe("Share token from get_share_status"),
43314
43320
  noteId: external_exports.string().describe("Note ID (needed to fetch the latest content)"),
43315
- sharePassphrase: external_exports.string().min(1).describe("Passphrase for the share (can be same as before or a new one)")
43321
+ sharePassphrase: external_exports.string().min(SHARE_PASSPHRASE_MIN_LENGTH).describe("Passphrase for the share (can be same as before or a new one)")
43316
43322
  },
43317
43323
  async ({ shareToken, noteId, sharePassphrase }) => {
43318
43324
  const { client, key } = await context.get();
@@ -43322,7 +43328,7 @@ function createMcpServer(creds, opts = {}) {
43322
43328
  const tooLarge = bodyTooLong(content, "too-large-to-share");
43323
43329
  if (tooLarge) return refusalResult(tooLarge);
43324
43330
  const shareSalt = generateSalt();
43325
- const shareKey = await deriveKey(sharePassphrase, shareSalt);
43331
+ const shareKey = await deriveKey(sharePassphrase, shareSalt, SHARE_PBKDF2_ITERATIONS);
43326
43332
  const encTitle = encrypt(title, shareKey);
43327
43333
  const encContent = encrypt(content, shareKey);
43328
43334
  const status = await client.republishShare(shareToken, {
@@ -43330,7 +43336,7 @@ function createMcpServer(creds, opts = {}) {
43330
43336
  titleIv: encTitle.iv,
43331
43337
  ...inlineContentFields(encContent),
43332
43338
  salt: shareSalt,
43333
- pbkdf2Iterations: 6e5
43339
+ pbkdf2Iterations: SHARE_PBKDF2_ITERATIONS
43334
43340
  });
43335
43341
  return {
43336
43342
  content: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squirrelnotes.app/mcp",
3
- "version": "2.8.0",
3
+ "version": "2.9.0-test.403",
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": {