zubo 0.1.15 → 0.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zubo",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Your AI agent that never forgets. Persistent memory, 25+ tools, 7 channels, 11+ LLM providers — runs entirely on your machine.",
5
5
  "license": "MIT",
6
6
  "author": "thomaskanze",
@@ -1,11 +1,5 @@
1
1
  const API = "https://gmail.googleapis.com/gmail/v1/users/me";
2
2
 
3
- /** RFC 2047 encode a header value if it contains non-ASCII characters (e.g. emojis) */
4
- function mimeEncode(value: string): string {
5
- if (/^[\x20-\x7E]*$/.test(value)) return value;
6
- return `=?UTF-8?B?${Buffer.from(value, "utf-8").toString("base64")}?=`;
7
- }
8
-
9
3
  async function getToken(): Promise<string> {
10
4
  // Try the new multi-provider OAuth system first
11
5
  try {
@@ -91,7 +85,7 @@ export default async function (input: Record<string, unknown>): Promise<string>
91
85
  case "send": {
92
86
  if (!to) return JSON.stringify({ error: "to is required" });
93
87
  if (!subject) return JSON.stringify({ error: "subject is required" });
94
- const raw = Buffer.from(`To: ${to}\r\nSubject: ${mimeEncode(subject)}\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n${body || ""}`).toString("base64url");
88
+ const raw = Buffer.from(`MIME-Version: 1.0\r\nTo: ${to}\r\nSubject: ${subject}\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n${body || ""}`).toString("base64url");
95
89
  const res = await fetch(`${API}/messages/send`, {
96
90
  method: "POST", headers,
97
91
  body: JSON.stringify({ raw }),
@@ -117,7 +111,7 @@ export default async function (input: Record<string, unknown>): Promise<string>
117
111
  const replyTo = getHeader("From");
118
112
  const subj = getHeader("Subject").startsWith("Re:") ? getHeader("Subject") : `Re: ${getHeader("Subject")}`;
119
113
  const msgId = getHeader("Message-ID");
120
- const raw = Buffer.from(`To: ${replyTo}\r\nSubject: ${mimeEncode(subj)}\r\nIn-Reply-To: ${msgId}\r\nReferences: ${msgId}\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n${body}`).toString("base64url");
114
+ const raw = Buffer.from(`MIME-Version: 1.0\r\nTo: ${replyTo}\r\nSubject: ${subj}\r\nIn-Reply-To: ${msgId}\r\nReferences: ${msgId}\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n${body}`).toString("base64url");
121
115
  const res = await fetch(`${API}/messages/send`, {
122
116
  method: "POST", headers,
123
117
  body: JSON.stringify({ raw, threadId: origData.threadId }),