@agenticmail/openclaw 0.5.40 → 0.5.42
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 +32 -0
- package/dist/index.cjs +3520 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.js +148 -0
- package/package.json +6 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare function activate(api: any): void;
|
|
2
|
+
/**
|
|
3
|
+
* OpenClaw plugin module export.
|
|
4
|
+
* Must export an object with `id` and `register` — OpenClaw reads `id` for identification
|
|
5
|
+
* and calls `register(api)` during plugin activation.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
id: string;
|
|
9
|
+
register: typeof activate;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { _default as default };
|
package/dist/index.js
CHANGED
|
@@ -2152,6 +2152,154 @@ The agent must have browser access and a Google Voice session (logged into Googl
|
|
|
2152
2152
|
}
|
|
2153
2153
|
}
|
|
2154
2154
|
});
|
|
2155
|
+
reg("agenticmail_storage", {
|
|
2156
|
+
description: `Full database management for agents. Create/alter/drop tables, CRUD rows, manage indexes, run aggregations, import/export data, execute raw SQL, optimize & analyze \u2014 all on whatever database the user deployed (SQLite, Postgres, MySQL, Turso).
|
|
2157
|
+
|
|
2158
|
+
Tables are sandboxed per-agent (agt_ prefix) or shared (shared_ prefix). Column types: text, integer, real, boolean, json, blob, timestamp. Auto-adds id + timestamps by default.
|
|
2159
|
+
|
|
2160
|
+
WHERE filters support operators: {column: value} for equality, {column: {$gt: 5, $lt: 10}} for comparisons, {column: {$like: "%foo%"}} for pattern matching, {column: {$in: [1,2,3]}} for IN, {column: {$between: [lo, hi]}} for ranges, {column: {$is_null: true}} for null checks. Also: $gte, $lte, $ne, $ilike, $not_like, $not_in.`,
|
|
2161
|
+
parameters: {
|
|
2162
|
+
action: { type: "string", required: true, description: "create_table, list_tables, describe_table, insert, upsert, query, aggregate, update, delete_rows, truncate, drop_table, clone_table, rename_table, rename_column, add_column, drop_column, create_index, list_indexes, drop_index, reindex, archive_table, unarchive_table, export, import, sql, stats, vacuum, analyze, explain" },
|
|
2163
|
+
table: { type: "string", description: "Table name (display name or internal prefixed name)" },
|
|
2164
|
+
description: { type: "string", description: "For create_table: human-readable description" },
|
|
2165
|
+
columns: { type: "array", description: "For create_table: [{name, type, required?, default?, unique?, primaryKey?, references?: {table, column, onDelete?}, check?}]" },
|
|
2166
|
+
indexes: { type: "array", description: "For create_table/create_index: [{columns: string[], unique?: boolean, name?: string, where?: string}]" },
|
|
2167
|
+
shared: { type: "boolean", description: "For create_table: accessible by all agents (default: false)" },
|
|
2168
|
+
timestamps: { type: "boolean", description: "For create_table: auto-add created_at/updated_at (default: true)" },
|
|
2169
|
+
rows: { type: "array", description: "For insert/upsert/import: array of row objects" },
|
|
2170
|
+
where: { type: "object", description: "For query/update/delete_rows/export: filter conditions. Supports operators: {$gt, $gte, $lt, $lte, $ne, $like, $ilike, $not_like, $in, $not_in, $is_null, $between}" },
|
|
2171
|
+
set: { type: "object", description: "For update: {column: newValue}" },
|
|
2172
|
+
orderBy: { type: "string", description: "For query: ORDER BY clause" },
|
|
2173
|
+
limit: { type: "number", description: "For query/export: max rows" },
|
|
2174
|
+
offset: { type: "number", description: "For query: skip N rows" },
|
|
2175
|
+
selectColumns: { type: "array", description: "For query: specific columns to select" },
|
|
2176
|
+
distinct: { type: "boolean", description: "For query: SELECT DISTINCT" },
|
|
2177
|
+
groupBy: { type: "string", description: "For query/aggregate: GROUP BY clause" },
|
|
2178
|
+
having: { type: "string", description: "For query: HAVING clause" },
|
|
2179
|
+
operations: { type: "array", description: 'For aggregate: [{fn: "count"|"sum"|"avg"|"min"|"max"|"count_distinct", column?, alias?}]' },
|
|
2180
|
+
column: { type: "object", description: "For add_column: {name, type, required?, default?, references?, check?}" },
|
|
2181
|
+
columnName: { type: "string", description: "For drop_column: column name to drop" },
|
|
2182
|
+
indexName: { type: "string", description: "For drop_index: index name" },
|
|
2183
|
+
indexColumns: { type: "array", description: "For create_index: column names" },
|
|
2184
|
+
indexUnique: { type: "boolean", description: "For create_index: unique index" },
|
|
2185
|
+
indexWhere: { type: "string", description: "For create_index: partial index condition" },
|
|
2186
|
+
newName: { type: "string", description: "For rename_table/rename_column: new name" },
|
|
2187
|
+
oldName: { type: "string", description: "For rename_column: old column name" },
|
|
2188
|
+
conflictColumn: { type: "string", description: "For upsert/import: column to detect conflicts on" },
|
|
2189
|
+
onConflict: { type: "string", description: 'For import: "skip"|"replace"|"error"' },
|
|
2190
|
+
includeData: { type: "boolean", description: "For clone_table: include data (default: true)" },
|
|
2191
|
+
format: { type: "string", description: 'For export: "json"|"csv"' },
|
|
2192
|
+
sql: { type: "string", description: "For sql/explain: raw SQL query" },
|
|
2193
|
+
params: { type: "array", description: "For sql/explain: query parameters" },
|
|
2194
|
+
includeShared: { type: "boolean", description: "For list_tables: include shared (default: true)" },
|
|
2195
|
+
includeArchived: { type: "boolean", description: "For list_tables: include archived" }
|
|
2196
|
+
},
|
|
2197
|
+
handler: async (params) => {
|
|
2198
|
+
try {
|
|
2199
|
+
const c = await ctxForParams(ctx, params);
|
|
2200
|
+
const action = params.action;
|
|
2201
|
+
const tbl = params.table ? encodeURIComponent(params.table) : "";
|
|
2202
|
+
switch (action) {
|
|
2203
|
+
// ── DDL: Schema Definition ──
|
|
2204
|
+
case "create_table":
|
|
2205
|
+
return await apiRequest(c, "POST", "/storage/tables", {
|
|
2206
|
+
name: params.table,
|
|
2207
|
+
columns: params.columns,
|
|
2208
|
+
indexes: params.indexes,
|
|
2209
|
+
shared: params.shared,
|
|
2210
|
+
description: params.description,
|
|
2211
|
+
timestamps: params.timestamps
|
|
2212
|
+
});
|
|
2213
|
+
case "list_tables":
|
|
2214
|
+
return await apiRequest(c, "GET", `/storage/tables?includeShared=${params.includeShared !== false}&includeArchived=${params.includeArchived === true}`);
|
|
2215
|
+
case "describe_table":
|
|
2216
|
+
return await apiRequest(c, "GET", `/storage/tables/${tbl}/describe`);
|
|
2217
|
+
case "add_column":
|
|
2218
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/columns`, { column: params.column });
|
|
2219
|
+
case "drop_column":
|
|
2220
|
+
return await apiRequest(c, "DELETE", `/storage/tables/${tbl}/columns/${encodeURIComponent(params.columnName)}`);
|
|
2221
|
+
case "rename_table":
|
|
2222
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/rename`, { newName: params.newName });
|
|
2223
|
+
case "rename_column":
|
|
2224
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/rename-column`, { oldName: params.oldName, newName: params.newName });
|
|
2225
|
+
case "drop_table":
|
|
2226
|
+
return await apiRequest(c, "DELETE", `/storage/tables/${tbl}`);
|
|
2227
|
+
case "clone_table":
|
|
2228
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/clone`, { newName: params.newName, includeData: params.includeData });
|
|
2229
|
+
case "truncate":
|
|
2230
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/truncate`);
|
|
2231
|
+
// ── Index Management ──
|
|
2232
|
+
case "create_index":
|
|
2233
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/indexes`, {
|
|
2234
|
+
columns: params.indexColumns || params.columns,
|
|
2235
|
+
unique: params.indexUnique,
|
|
2236
|
+
name: params.indexName,
|
|
2237
|
+
where: params.indexWhere
|
|
2238
|
+
});
|
|
2239
|
+
case "list_indexes":
|
|
2240
|
+
return await apiRequest(c, "GET", `/storage/tables/${tbl}/indexes`);
|
|
2241
|
+
case "drop_index":
|
|
2242
|
+
return await apiRequest(c, "DELETE", `/storage/tables/${tbl}/indexes/${encodeURIComponent(params.indexName)}`);
|
|
2243
|
+
case "reindex":
|
|
2244
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/reindex`);
|
|
2245
|
+
// ── DML: Data Manipulation ──
|
|
2246
|
+
case "insert":
|
|
2247
|
+
return await apiRequest(c, "POST", "/storage/insert", { table: params.table, rows: params.rows });
|
|
2248
|
+
case "upsert":
|
|
2249
|
+
return await apiRequest(c, "POST", "/storage/upsert", { table: params.table, rows: params.rows, conflictColumn: params.conflictColumn });
|
|
2250
|
+
case "query":
|
|
2251
|
+
return await apiRequest(c, "POST", "/storage/query", {
|
|
2252
|
+
table: params.table,
|
|
2253
|
+
where: params.where,
|
|
2254
|
+
orderBy: params.orderBy,
|
|
2255
|
+
limit: params.limit,
|
|
2256
|
+
offset: params.offset,
|
|
2257
|
+
columns: params.selectColumns,
|
|
2258
|
+
distinct: params.distinct,
|
|
2259
|
+
groupBy: params.groupBy,
|
|
2260
|
+
having: params.having
|
|
2261
|
+
});
|
|
2262
|
+
case "aggregate":
|
|
2263
|
+
return await apiRequest(c, "POST", "/storage/aggregate", {
|
|
2264
|
+
table: params.table,
|
|
2265
|
+
where: params.where,
|
|
2266
|
+
operations: params.operations,
|
|
2267
|
+
groupBy: params.groupBy
|
|
2268
|
+
});
|
|
2269
|
+
case "update":
|
|
2270
|
+
return await apiRequest(c, "POST", "/storage/update", { table: params.table, where: params.where, set: params.set });
|
|
2271
|
+
case "delete_rows":
|
|
2272
|
+
return await apiRequest(c, "POST", "/storage/delete-rows", { table: params.table, where: params.where });
|
|
2273
|
+
// ── Archive & Lifecycle ──
|
|
2274
|
+
case "archive_table":
|
|
2275
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/archive`);
|
|
2276
|
+
case "unarchive_table":
|
|
2277
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/unarchive`);
|
|
2278
|
+
// ── Import / Export ──
|
|
2279
|
+
case "export":
|
|
2280
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/export`, { format: params.format, where: params.where, limit: params.limit });
|
|
2281
|
+
case "import":
|
|
2282
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/import`, { rows: params.rows, onConflict: params.onConflict, conflictColumn: params.conflictColumn });
|
|
2283
|
+
// ── Raw SQL ──
|
|
2284
|
+
case "sql":
|
|
2285
|
+
return await apiRequest(c, "POST", "/storage/sql", { sql: params.sql, params: params.params });
|
|
2286
|
+
case "explain":
|
|
2287
|
+
return await apiRequest(c, "POST", "/storage/explain", { sql: params.sql, params: params.params });
|
|
2288
|
+
// ── Maintenance ──
|
|
2289
|
+
case "stats":
|
|
2290
|
+
return await apiRequest(c, "GET", "/storage/stats");
|
|
2291
|
+
case "vacuum":
|
|
2292
|
+
return await apiRequest(c, "POST", "/storage/vacuum");
|
|
2293
|
+
case "analyze":
|
|
2294
|
+
return await apiRequest(c, "POST", `/storage/tables/${tbl}/analyze`);
|
|
2295
|
+
default:
|
|
2296
|
+
return { error: `Unknown action "${action}". Valid actions: create_table, list_tables, describe_table, insert, upsert, query, aggregate, update, delete_rows, truncate, drop_table, clone_table, rename_table, rename_column, add_column, drop_column, create_index, list_indexes, drop_index, reindex, archive_table, unarchive_table, export, import, sql, stats, vacuum, analyze, explain` };
|
|
2297
|
+
}
|
|
2298
|
+
} catch (err) {
|
|
2299
|
+
return { success: false, error: err.message };
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
});
|
|
2155
2303
|
reg("agenticmail_sms_config", {
|
|
2156
2304
|
description: "Get the current SMS/phone number configuration for this agent. Shows whether SMS is enabled, the phone number, and forwarding email.",
|
|
2157
2305
|
parameters: {},
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticmail/openclaw",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "OpenClaw plugin for AgenticMail
|
|
3
|
+
"version": "0.5.42",
|
|
4
|
+
"description": "OpenClaw plugin for AgenticMail — email, SMS, and phone number access for OpenClaw agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"default": "./dist/index.js",
|
|
11
13
|
"types": "./dist/index.d.ts"
|
|
12
14
|
}
|
|
13
15
|
},
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
]
|
|
27
29
|
},
|
|
28
30
|
"scripts": {
|
|
29
|
-
"build": "tsup index.ts --format esm --dts --clean",
|
|
31
|
+
"build": "tsup index.ts --format esm,cjs --dts --clean",
|
|
30
32
|
"test": "vitest run --passWithNoTests",
|
|
31
33
|
"preuninstall": "node scripts/uninstall.mjs",
|
|
32
34
|
"prepublishOnly": "npm run build"
|
|
@@ -66,4 +68,4 @@
|
|
|
66
68
|
},
|
|
67
69
|
"author": "Ope Olatunji",
|
|
68
70
|
"license": "MIT"
|
|
69
|
-
}
|
|
71
|
+
}
|