@agenticmail/enterprise 0.5.83 → 0.5.85
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/dist/browser-tool-KJMHSNK3.js +3997 -0
- package/dist/chunk-4DXQQPEC.js +15441 -0
- package/dist/chunk-AQH4DFYV.js +142 -0
- package/dist/chunk-CETB63LZ.js +15813 -0
- package/dist/chunk-LOA5LNXR.js +898 -0
- package/dist/chunk-PHZS6OIO.js +2191 -0
- package/dist/chunk-QISZRTVR.js +2154 -0
- package/dist/chunk-SEGTMIPI.js +2191 -0
- package/dist/chunk-TGOSFAYW.js +194 -0
- package/dist/chunk-ZTOVB5OQ.js +898 -0
- package/dist/cli.js +1 -1
- package/dist/environment-L6BN6KGK.js +11 -0
- package/dist/index.js +5 -3
- package/dist/pw-ai-IRORDXFW.js +2212 -0
- package/dist/routes-4NHH2DJW.js +6849 -0
- package/dist/routes-VIK7WDVW.js +6859 -0
- package/dist/runtime-DAVEFGHR.js +47 -0
- package/dist/runtime-NEO2ZB6O.js +49 -0
- package/dist/server-F6GBGLJY.js +12 -0
- package/dist/server-ZIB4HUUC.js +12 -0
- package/dist/setup-NKJBKCEG.js +20 -0
- package/dist/setup-YD3LJ6DT.js +20 -0
- package/package.json +1 -1
- package/scripts/vm-setup.sh +309 -0
- package/src/agent-tools/index.ts +70 -3
- package/src/agent-tools/tools/google/index.ts +4 -1
- package/src/agent-tools/tools/google/meetings.ts +468 -0
- package/src/agent-tools/tools/meeting-lifecycle.ts +437 -0
- package/src/engine/agent-routes.ts +19 -0
- package/src/runtime/agent-loop.ts +1 -1
- package/src/runtime/environment.ts +290 -0
- package/src/runtime/index.ts +3 -3
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// src/agent-tools/common.ts
|
|
2
|
+
var ToolInputError = class extends Error {
|
|
3
|
+
status = 400;
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = "ToolInputError";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
function readStringParam(params, key, options = {}) {
|
|
10
|
+
var { required = false, trim = true, label = key, allowEmpty = false } = options;
|
|
11
|
+
var raw = params[key];
|
|
12
|
+
if (typeof raw !== "string") {
|
|
13
|
+
if (required) throw new ToolInputError(label + " required");
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
16
|
+
var value = trim ? raw.trim() : raw;
|
|
17
|
+
if (!value && !allowEmpty) {
|
|
18
|
+
if (required) throw new ToolInputError(label + " required");
|
|
19
|
+
return void 0;
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
function readNumberParam(params, key, options = {}) {
|
|
24
|
+
var { required = false, label = key, integer = false } = options;
|
|
25
|
+
var raw = params[key];
|
|
26
|
+
var value;
|
|
27
|
+
if (typeof raw === "number" && Number.isFinite(raw)) {
|
|
28
|
+
value = raw;
|
|
29
|
+
} else if (typeof raw === "string") {
|
|
30
|
+
var trimmed = raw.trim();
|
|
31
|
+
if (trimmed) {
|
|
32
|
+
var parsed = Number.parseFloat(trimmed);
|
|
33
|
+
if (Number.isFinite(parsed)) value = parsed;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (value === void 0) {
|
|
37
|
+
if (required) throw new ToolInputError(label + " required");
|
|
38
|
+
return void 0;
|
|
39
|
+
}
|
|
40
|
+
return integer ? Math.trunc(value) : value;
|
|
41
|
+
}
|
|
42
|
+
function readBooleanParam(params, key, defaultValue = false) {
|
|
43
|
+
var raw = params[key];
|
|
44
|
+
if (typeof raw === "boolean") return raw;
|
|
45
|
+
if (raw === "true") return true;
|
|
46
|
+
if (raw === "false") return false;
|
|
47
|
+
return defaultValue;
|
|
48
|
+
}
|
|
49
|
+
function readStringArrayParam(params, key, options = {}) {
|
|
50
|
+
var { required = false, label = key } = options;
|
|
51
|
+
var raw = params[key];
|
|
52
|
+
if (Array.isArray(raw)) {
|
|
53
|
+
var values = raw.filter(function(entry) {
|
|
54
|
+
return typeof entry === "string";
|
|
55
|
+
}).map(function(entry) {
|
|
56
|
+
return entry.trim();
|
|
57
|
+
}).filter(Boolean);
|
|
58
|
+
if (values.length === 0) {
|
|
59
|
+
if (required) throw new ToolInputError(label + " required");
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
return values;
|
|
63
|
+
}
|
|
64
|
+
if (typeof raw === "string") {
|
|
65
|
+
var value = raw.trim();
|
|
66
|
+
if (!value) {
|
|
67
|
+
if (required) throw new ToolInputError(label + " required");
|
|
68
|
+
return void 0;
|
|
69
|
+
}
|
|
70
|
+
return [value];
|
|
71
|
+
}
|
|
72
|
+
if (required) throw new ToolInputError(label + " required");
|
|
73
|
+
return void 0;
|
|
74
|
+
}
|
|
75
|
+
function jsonResult(payload) {
|
|
76
|
+
return {
|
|
77
|
+
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
|
|
78
|
+
details: payload
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function textResult(text) {
|
|
82
|
+
return {
|
|
83
|
+
content: [{ type: "text", text }]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function errorResult(message) {
|
|
87
|
+
return {
|
|
88
|
+
content: [{ type: "text", text: "Error: " + message }],
|
|
89
|
+
details: { error: message }
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function imageResult(params) {
|
|
93
|
+
return {
|
|
94
|
+
content: [
|
|
95
|
+
{ type: "text", text: params.extraText ?? params.label },
|
|
96
|
+
{ type: "image", data: params.base64, mimeType: params.mimeType }
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function wrapExternalContent(content, source) {
|
|
101
|
+
return '<external-content source="' + source + '">\n' + content + "\n</external-content>";
|
|
102
|
+
}
|
|
103
|
+
function wrapWebContent(content, source = "web") {
|
|
104
|
+
return '<web-content source="' + source + '" untrusted="true">\n' + content + "\n</web-content>";
|
|
105
|
+
}
|
|
106
|
+
function normalizeSecretInput(value) {
|
|
107
|
+
if (typeof value !== "string") return "";
|
|
108
|
+
var trimmed = value.trim();
|
|
109
|
+
if (!trimmed || trimmed === "undefined" || trimmed === "null") return "";
|
|
110
|
+
return trimmed;
|
|
111
|
+
}
|
|
112
|
+
async function imageResultFromFile(params) {
|
|
113
|
+
const fs = await import("fs/promises");
|
|
114
|
+
const buf = await fs.readFile(params.path);
|
|
115
|
+
const ext = params.path.split(".").pop()?.toLowerCase();
|
|
116
|
+
const mimeMap = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", webp: "image/webp", svg: "image/svg+xml" };
|
|
117
|
+
const mimeType = mimeMap[ext || ""] || "image/png";
|
|
118
|
+
return imageResult({
|
|
119
|
+
label: params.label,
|
|
120
|
+
path: params.path,
|
|
121
|
+
base64: buf.toString("base64"),
|
|
122
|
+
mimeType,
|
|
123
|
+
extraText: params.extraText,
|
|
124
|
+
details: params.details
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
ToolInputError,
|
|
130
|
+
readStringParam,
|
|
131
|
+
readNumberParam,
|
|
132
|
+
readBooleanParam,
|
|
133
|
+
readStringArrayParam,
|
|
134
|
+
jsonResult,
|
|
135
|
+
textResult,
|
|
136
|
+
errorResult,
|
|
137
|
+
imageResult,
|
|
138
|
+
wrapExternalContent,
|
|
139
|
+
wrapWebContent,
|
|
140
|
+
normalizeSecretInput,
|
|
141
|
+
imageResultFromFile
|
|
142
|
+
};
|