zubo 0.1.14 → 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,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(`
|
|
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(`
|
|
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 }),
|
package/src/tools/executor.ts
CHANGED
|
@@ -4,6 +4,18 @@ import { logger } from "../util/logger";
|
|
|
4
4
|
import { recordError } from "../util/error-buffer";
|
|
5
5
|
import { executeSandboxed } from "./sandbox";
|
|
6
6
|
|
|
7
|
+
/** Built-in integration tool names — these run in-process, NOT sandboxed,
|
|
8
|
+
* because they need access to Zubo.getGoogleToken and the OAuth module. */
|
|
9
|
+
const BUILTIN_INTEGRATION_TOOLS = new Set([
|
|
10
|
+
"gmail", "google_calendar", "google_sheets", "google_docs", "google_drive",
|
|
11
|
+
"github_issues", "github_prs", "github_repos",
|
|
12
|
+
"notion_pages", "notion_databases", "notion_search",
|
|
13
|
+
"linear_issues", "linear_projects",
|
|
14
|
+
"jira_issues", "jira_boards",
|
|
15
|
+
"slack_messages", "twitter_posts",
|
|
16
|
+
"claude_code_task", "codex_task",
|
|
17
|
+
]);
|
|
18
|
+
|
|
7
19
|
export interface ToolResult {
|
|
8
20
|
tool_use_id: string;
|
|
9
21
|
content: string;
|
|
@@ -31,6 +43,9 @@ async function shouldSandbox(
|
|
|
31
43
|
// Only sandbox tools that were loaded via the skill-loader from the user's skills directory
|
|
32
44
|
if (!isUserInstalledSkill(toolName)) return null;
|
|
33
45
|
|
|
46
|
+
// Built-in integrations run in-process — they need access to Zubo.getGoogleToken and OAuth
|
|
47
|
+
if (BUILTIN_INTEGRATION_TOOLS.has(toolName)) return null;
|
|
48
|
+
|
|
34
49
|
const { existsSync, readFileSync } = await import("fs");
|
|
35
50
|
const { join } = await import("path");
|
|
36
51
|
const { paths } = await import("../config/paths");
|