@allbaseai/openclaw-allbase 0.1.0
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/LICENSE +21 -0
- package/README.md +77 -0
- package/index.ts +350 -0
- package/openclaw.plugin.json +43 -0
- package/package.json +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Allbase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# OpenClaw Allbase Plugin
|
|
2
|
+
|
|
3
|
+
Connect OpenClaw agents to Allbase profiles (workspace/agent/api key), with per-agent mapping.
|
|
4
|
+
|
|
5
|
+
## What it supports
|
|
6
|
+
|
|
7
|
+
- Map each OpenClaw agent to a different Allbase profile
|
|
8
|
+
- Or map all OpenClaw agents to the same Allbase profile
|
|
9
|
+
- Tools exposed in agent runtime:
|
|
10
|
+
- `allbase` with actions:
|
|
11
|
+
- `status`
|
|
12
|
+
- `save_memory`
|
|
13
|
+
- `save_knowledge`
|
|
14
|
+
- `search_memories`
|
|
15
|
+
- `upload_document`
|
|
16
|
+
- `search_documents`
|
|
17
|
+
|
|
18
|
+
## Install (npm)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
openclaw plugins install @allbase/openclaw-allbase
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Install (local path)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cd /home/jason/Documents/botscripts/skills/openclaw-allbase-plugin
|
|
28
|
+
npm install
|
|
29
|
+
openclaw plugins install -l /home/jason/Documents/botscripts/skills/openclaw-allbase-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then restart gateway.
|
|
33
|
+
|
|
34
|
+
## Config example
|
|
35
|
+
|
|
36
|
+
Put this under `plugins.entries.allbase.config`:
|
|
37
|
+
|
|
38
|
+
```json5
|
|
39
|
+
{
|
|
40
|
+
baseUrl: "https://allbase.ai",
|
|
41
|
+
tokenPath: "/token",
|
|
42
|
+
defaultProfile: "team",
|
|
43
|
+
profiles: {
|
|
44
|
+
team: {
|
|
45
|
+
workspaceId: "ws-TEAM",
|
|
46
|
+
agentId: "team-agent",
|
|
47
|
+
apiKey: "abk_..."
|
|
48
|
+
},
|
|
49
|
+
personal: {
|
|
50
|
+
workspaceId: "ws-PERSONAL",
|
|
51
|
+
agentId: "jason-agent",
|
|
52
|
+
apiKey: "abk_..."
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
mapByOpenclawAgent: {
|
|
56
|
+
"alan-allbase": "team",
|
|
57
|
+
"assistant-personal": "personal"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Usage examples
|
|
63
|
+
|
|
64
|
+
- Check mapping/health:
|
|
65
|
+
- tool call: `allbase` with `action: "status"`
|
|
66
|
+
- Save memory:
|
|
67
|
+
- `action: "save_memory"`, `content`, optional `category`, `tags`
|
|
68
|
+
- Search memory:
|
|
69
|
+
- `action: "search_memories"`, `query`
|
|
70
|
+
|
|
71
|
+
Optional `profile` parameter overrides automatic mapping for one call.
|
|
72
|
+
|
|
73
|
+
## Notes
|
|
74
|
+
|
|
75
|
+
- Keep API keys private.
|
|
76
|
+
- If token exchange fails, verify workspace_id + agent_id + api_key belong together.
|
|
77
|
+
- `upload_document` requires local file path available to the gateway host.
|
package/index.ts
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import type { AnyAgentTool, OpenClawPluginApi, OpenClawPluginToolContext } from "openclaw/plugin-sdk";
|
|
3
|
+
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import { basename } from "node:path";
|
|
6
|
+
|
|
7
|
+
type AgentResult = { content: Array<{ type: string; text: string }>; details?: unknown };
|
|
8
|
+
|
|
9
|
+
type AllbaseProfile = {
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
agentId: string;
|
|
12
|
+
apiKey: string;
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type AllbasePluginConfig = {
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
tokenPath?: string;
|
|
19
|
+
defaultProfile?: string;
|
|
20
|
+
profiles?: Record<string, AllbaseProfile>;
|
|
21
|
+
mapByOpenclawAgent?: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const TOOL_ACTIONS = [
|
|
25
|
+
"status",
|
|
26
|
+
"save_memory",
|
|
27
|
+
"save_knowledge",
|
|
28
|
+
"search_memories",
|
|
29
|
+
"upload_document",
|
|
30
|
+
"search_documents",
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
const AllbaseToolSchema = Type.Object(
|
|
34
|
+
{
|
|
35
|
+
action: Type.Unsafe<(typeof TOOL_ACTIONS)[number]>({ type: "string", enum: [...TOOL_ACTIONS] }),
|
|
36
|
+
profile: Type.Optional(Type.String({ description: "Optional profile override" })),
|
|
37
|
+
|
|
38
|
+
content: Type.Optional(Type.String({ description: "Memory content" })),
|
|
39
|
+
category: Type.Optional(Type.String({ description: "decision|research|preference|plan|knowledge" })),
|
|
40
|
+
tags: Type.Optional(Type.String({ description: "Comma-separated tags" })),
|
|
41
|
+
visibility: Type.Optional(Type.String({ description: "private|public" })),
|
|
42
|
+
|
|
43
|
+
query: Type.Optional(Type.String({ description: "Search query" })),
|
|
44
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 50 })),
|
|
45
|
+
scope: Type.Optional(Type.String({ description: "private|public|all" })),
|
|
46
|
+
tag: Type.Optional(Type.String({ description: "Single tag filter" })),
|
|
47
|
+
|
|
48
|
+
filePath: Type.Optional(Type.String({ description: "Local file path to upload" })),
|
|
49
|
+
title: Type.Optional(Type.String({ description: "Optional document title" }))
|
|
50
|
+
},
|
|
51
|
+
{ additionalProperties: false },
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const tokenCache = new Map<string, { token: string; exp: number }>();
|
|
55
|
+
|
|
56
|
+
function json(payload: unknown): AgentResult {
|
|
57
|
+
return {
|
|
58
|
+
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
|
|
59
|
+
details: payload,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function parseTags(tags?: string): string[] {
|
|
64
|
+
if (!tags) return [];
|
|
65
|
+
return tags
|
|
66
|
+
.split(",")
|
|
67
|
+
.map((x) => x.trim())
|
|
68
|
+
.filter(Boolean);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function getConfig(api: OpenClawPluginApi): AllbasePluginConfig {
|
|
72
|
+
return (api.pluginConfig ?? {}) as AllbasePluginConfig;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function resolveBaseUrl(cfg: AllbasePluginConfig, profile?: AllbaseProfile): string {
|
|
76
|
+
const base = (profile?.baseUrl || cfg.baseUrl || "https://allbase.ai").trim();
|
|
77
|
+
return base.replace(/\/+$/, "");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function resolveProfile(
|
|
81
|
+
api: OpenClawPluginApi,
|
|
82
|
+
ctx: OpenClawPluginToolContext,
|
|
83
|
+
profileOverride?: string,
|
|
84
|
+
): { profileName: string; profile: AllbaseProfile; baseUrl: string; tokenPath: string } {
|
|
85
|
+
const cfg = getConfig(api);
|
|
86
|
+
const profiles = cfg.profiles ?? {};
|
|
87
|
+
|
|
88
|
+
const selectedName =
|
|
89
|
+
(profileOverride && profileOverride.trim()) ||
|
|
90
|
+
(ctx.agentId ? cfg.mapByOpenclawAgent?.[ctx.agentId] : undefined) ||
|
|
91
|
+
cfg.defaultProfile ||
|
|
92
|
+
Object.keys(profiles)[0];
|
|
93
|
+
|
|
94
|
+
if (!selectedName) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
"No Allbase profile resolved. Configure plugins.entries.allbase.config.profiles and defaultProfile.",
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const profile = profiles[selectedName];
|
|
101
|
+
if (!profile) {
|
|
102
|
+
throw new Error(`Configured profile not found: ${selectedName}`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!profile.workspaceId || !profile.agentId || !profile.apiKey) {
|
|
106
|
+
throw new Error(`Profile ${selectedName} is missing workspaceId/agentId/apiKey`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const baseUrl = resolveBaseUrl(cfg, profile);
|
|
110
|
+
const tokenPath = (cfg.tokenPath || "/token").trim() || "/token";
|
|
111
|
+
|
|
112
|
+
return { profileName: selectedName, profile, baseUrl, tokenPath };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function getAccessToken(
|
|
116
|
+
api: OpenClawPluginApi,
|
|
117
|
+
ctx: OpenClawPluginToolContext,
|
|
118
|
+
profileOverride?: string,
|
|
119
|
+
): Promise<{ token: string; resolved: ReturnType<typeof resolveProfile> }> {
|
|
120
|
+
const resolved = resolveProfile(api, ctx, profileOverride);
|
|
121
|
+
const { profile, baseUrl, tokenPath } = resolved;
|
|
122
|
+
const cacheKey = `${baseUrl}|${profile.workspaceId}|${profile.agentId}|${profile.apiKey}`;
|
|
123
|
+
const now = Date.now();
|
|
124
|
+
const cached = tokenCache.get(cacheKey);
|
|
125
|
+
if (cached && cached.exp > now + 30_000) {
|
|
126
|
+
return { token: cached.token, resolved };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const url = new URL(`${baseUrl}${tokenPath}`);
|
|
130
|
+
url.searchParams.set("workspace_id", profile.workspaceId);
|
|
131
|
+
url.searchParams.set("agent_id", profile.agentId);
|
|
132
|
+
url.searchParams.set("api_key", profile.apiKey);
|
|
133
|
+
|
|
134
|
+
const response = await fetch(url, { method: "POST" });
|
|
135
|
+
if (!response.ok) {
|
|
136
|
+
throw new Error(`Token exchange failed (${response.status}): ${await response.text()}`);
|
|
137
|
+
}
|
|
138
|
+
const data = (await response.json()) as { access_token?: string; expires_in?: number };
|
|
139
|
+
if (!data.access_token) {
|
|
140
|
+
throw new Error("Token exchange did not return access_token");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const ttlMs = Math.max(60_000, (data.expires_in ?? 3600) * 1000);
|
|
144
|
+
tokenCache.set(cacheKey, { token: data.access_token, exp: now + ttlMs });
|
|
145
|
+
return { token: data.access_token, resolved };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async function callAllbase(
|
|
149
|
+
api: OpenClawPluginApi,
|
|
150
|
+
ctx: OpenClawPluginToolContext,
|
|
151
|
+
profileOverride: string | undefined,
|
|
152
|
+
path: string,
|
|
153
|
+
init: RequestInit,
|
|
154
|
+
) {
|
|
155
|
+
const { token, resolved } = await getAccessToken(api, ctx, profileOverride);
|
|
156
|
+
const response = await fetch(`${resolved.baseUrl}${path}`, {
|
|
157
|
+
...init,
|
|
158
|
+
headers: {
|
|
159
|
+
Authorization: `Bearer ${token}`,
|
|
160
|
+
...(init.headers || {}),
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const text = await response.text();
|
|
165
|
+
let body: unknown = text;
|
|
166
|
+
try {
|
|
167
|
+
body = text ? JSON.parse(text) : {};
|
|
168
|
+
} catch {
|
|
169
|
+
// keep text body
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return { ok: response.ok, status: response.status, body, resolved };
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
async function executeAllbaseTool(
|
|
176
|
+
api: OpenClawPluginApi,
|
|
177
|
+
ctx: OpenClawPluginToolContext,
|
|
178
|
+
_toolCallId: string,
|
|
179
|
+
params: {
|
|
180
|
+
action: (typeof TOOL_ACTIONS)[number];
|
|
181
|
+
profile?: string;
|
|
182
|
+
content?: string;
|
|
183
|
+
category?: string;
|
|
184
|
+
tags?: string;
|
|
185
|
+
visibility?: string;
|
|
186
|
+
query?: string;
|
|
187
|
+
limit?: number;
|
|
188
|
+
scope?: string;
|
|
189
|
+
tag?: string;
|
|
190
|
+
filePath?: string;
|
|
191
|
+
title?: string;
|
|
192
|
+
},
|
|
193
|
+
): Promise<AgentResult> {
|
|
194
|
+
try {
|
|
195
|
+
const action = params.action;
|
|
196
|
+
const profileOverride = params.profile?.trim();
|
|
197
|
+
|
|
198
|
+
if (action === "status") {
|
|
199
|
+
const cfg = getConfig(api);
|
|
200
|
+
const resolved = resolveProfile(api, ctx, profileOverride);
|
|
201
|
+
const healthResp = await fetch(`${resolveBaseUrl(cfg, resolved.profile)}/healthz`);
|
|
202
|
+
const health = await healthResp.json().catch(() => ({}));
|
|
203
|
+
return json({
|
|
204
|
+
ok: true,
|
|
205
|
+
profile: resolved.profileName,
|
|
206
|
+
openclawAgentId: ctx.agentId || null,
|
|
207
|
+
workspaceId: resolved.profile.workspaceId,
|
|
208
|
+
allbaseAgentId: resolved.profile.agentId,
|
|
209
|
+
baseUrl: resolved.baseUrl,
|
|
210
|
+
health,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (action === "save_memory" || action === "save_knowledge") {
|
|
215
|
+
const content = (params.content || "").trim();
|
|
216
|
+
if (!content) throw new Error("content is required");
|
|
217
|
+
|
|
218
|
+
const payload = {
|
|
219
|
+
content,
|
|
220
|
+
category: action === "save_knowledge" ? "knowledge" : (params.category || "knowledge"),
|
|
221
|
+
tags: parseTags(params.tags),
|
|
222
|
+
visibility: params.visibility === "public" ? "public" : "private",
|
|
223
|
+
is_verified: false,
|
|
224
|
+
metadata: { source: "openclaw-plugin", plugin: "allbase" },
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const result = await callAllbase(api, ctx, profileOverride, "/memories", {
|
|
228
|
+
method: "POST",
|
|
229
|
+
headers: { "Content-Type": "application/json" },
|
|
230
|
+
body: JSON.stringify(payload),
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
return json(result);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (action === "search_memories") {
|
|
237
|
+
const query = (params.query || "").trim();
|
|
238
|
+
if (!query) throw new Error("query is required");
|
|
239
|
+
|
|
240
|
+
const payload = {
|
|
241
|
+
query,
|
|
242
|
+
limit: Math.max(1, Math.min(50, Number(params.limit || 8))),
|
|
243
|
+
scope: params.scope === "public" || params.scope === "all" ? params.scope : "private",
|
|
244
|
+
...(params.category ? { category: params.category } : {}),
|
|
245
|
+
...(params.tag ? { tag: params.tag } : {}),
|
|
246
|
+
search_mode: "hybrid",
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const result = await callAllbase(api, ctx, profileOverride, "/memories/search", {
|
|
250
|
+
method: "POST",
|
|
251
|
+
headers: { "Content-Type": "application/json" },
|
|
252
|
+
body: JSON.stringify(payload),
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
return json(result);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (action === "search_documents") {
|
|
259
|
+
const query = (params.query || "").trim();
|
|
260
|
+
if (!query) throw new Error("query is required");
|
|
261
|
+
const payload = {
|
|
262
|
+
query,
|
|
263
|
+
limit: Math.max(1, Math.min(50, Number(params.limit || 8))),
|
|
264
|
+
};
|
|
265
|
+
const result = await callAllbase(api, ctx, profileOverride, "/documents/search", {
|
|
266
|
+
method: "POST",
|
|
267
|
+
headers: { "Content-Type": "application/json" },
|
|
268
|
+
body: JSON.stringify(payload),
|
|
269
|
+
});
|
|
270
|
+
return json(result);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (action === "upload_document") {
|
|
274
|
+
const filePath = (params.filePath || "").trim();
|
|
275
|
+
if (!filePath) throw new Error("filePath is required");
|
|
276
|
+
|
|
277
|
+
const fileData = readFileSync(filePath);
|
|
278
|
+
const form = new FormData();
|
|
279
|
+
form.append("file", new Blob([fileData]), basename(filePath));
|
|
280
|
+
if (params.title?.trim()) form.append("title", params.title.trim());
|
|
281
|
+
|
|
282
|
+
const { token, resolved } = await getAccessToken(api, ctx, profileOverride);
|
|
283
|
+
const response = await fetch(`${resolved.baseUrl}/documents/upload`, {
|
|
284
|
+
method: "POST",
|
|
285
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
286
|
+
body: form,
|
|
287
|
+
});
|
|
288
|
+
const text = await response.text();
|
|
289
|
+
let body: unknown = text;
|
|
290
|
+
try {
|
|
291
|
+
body = text ? JSON.parse(text) : {};
|
|
292
|
+
} catch {
|
|
293
|
+
// keep text
|
|
294
|
+
}
|
|
295
|
+
return json({ ok: response.ok, status: response.status, body, resolved });
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
throw new Error(`Unsupported action: ${String(action)}`);
|
|
299
|
+
} catch (error) {
|
|
300
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
301
|
+
api.logger.warn(`[allbase] tool error: ${message}`);
|
|
302
|
+
return json({ ok: false, error: message });
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const plugin = {
|
|
307
|
+
id: "allbase",
|
|
308
|
+
name: "Allbase",
|
|
309
|
+
description: "Allbase memory/document tools with per-agent profile mapping",
|
|
310
|
+
configSchema: emptyPluginConfigSchema(),
|
|
311
|
+
register(api: OpenClawPluginApi) {
|
|
312
|
+
api.registerTool(
|
|
313
|
+
((ctx: OpenClawPluginToolContext) => {
|
|
314
|
+
return {
|
|
315
|
+
name: "allbase",
|
|
316
|
+
label: "Allbase",
|
|
317
|
+
description:
|
|
318
|
+
"Allbase memory + document tools with per-OpenClaw-agent profile mapping. Actions: status, save_memory, save_knowledge, search_memories, upload_document, search_documents.",
|
|
319
|
+
parameters: AllbaseToolSchema,
|
|
320
|
+
execute: (toolCallId: string, params: any) => executeAllbaseTool(api, ctx, toolCallId, params),
|
|
321
|
+
} as AnyAgentTool;
|
|
322
|
+
}),
|
|
323
|
+
{ optional: true },
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
api.registerCommand({
|
|
327
|
+
name: "allbase-status",
|
|
328
|
+
description: "Show resolved Allbase profile for this agent",
|
|
329
|
+
acceptsArgs: true,
|
|
330
|
+
requireAuth: true,
|
|
331
|
+
handler: (cmdCtx) => {
|
|
332
|
+
const profileOverride = (cmdCtx.args || "").trim() || undefined;
|
|
333
|
+
try {
|
|
334
|
+
const resolved = resolveProfile(api, { agentId: cmdCtx.config.defaultAgentId }, profileOverride);
|
|
335
|
+
return {
|
|
336
|
+
text:
|
|
337
|
+
`Allbase profile: ${resolved.profileName}\n` +
|
|
338
|
+
`Base URL: ${resolved.baseUrl}\n` +
|
|
339
|
+
`Workspace: ${resolved.profile.workspaceId}\n` +
|
|
340
|
+
`Allbase Agent: ${resolved.profile.agentId}`,
|
|
341
|
+
};
|
|
342
|
+
} catch (err) {
|
|
343
|
+
return { text: `Allbase profile resolution failed: ${err instanceof Error ? err.message : String(err)}` };
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
});
|
|
347
|
+
},
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
export default plugin;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "allbase",
|
|
3
|
+
"name": "Allbase",
|
|
4
|
+
"description": "Allbase memory/document tools with per-OpenClaw-agent profile mapping.",
|
|
5
|
+
"uiHints": {
|
|
6
|
+
"baseUrl": { "label": "Allbase Base URL", "placeholder": "https://allbase.ai" },
|
|
7
|
+
"tokenPath": { "label": "Token Path", "advanced": true },
|
|
8
|
+
"defaultProfile": { "label": "Default Profile" },
|
|
9
|
+
"profiles": { "label": "Allbase Profiles" },
|
|
10
|
+
"mapByOpenclawAgent": { "label": "Map OpenClaw Agent ID -> Profile" },
|
|
11
|
+
"profiles.*.workspaceId": { "label": "Workspace ID" },
|
|
12
|
+
"profiles.*.agentId": { "label": "Allbase Agent ID" },
|
|
13
|
+
"profiles.*.apiKey": { "label": "Allbase API Key", "sensitive": true },
|
|
14
|
+
"profiles.*.baseUrl": { "label": "Profile Base URL", "advanced": true }
|
|
15
|
+
},
|
|
16
|
+
"configSchema": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"baseUrl": { "type": "string" },
|
|
21
|
+
"tokenPath": { "type": "string" },
|
|
22
|
+
"defaultProfile": { "type": "string" },
|
|
23
|
+
"profiles": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["workspaceId", "agentId", "apiKey"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"workspaceId": { "type": "string" },
|
|
31
|
+
"agentId": { "type": "string" },
|
|
32
|
+
"apiKey": { "type": "string" },
|
|
33
|
+
"baseUrl": { "type": "string" }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"mapByOpenclawAgent": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": { "type": "string" }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@allbaseai/openclaw-allbase",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "OpenClaw plugin to map OpenClaw agents to Allbase agent/workspace profiles.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.ts",
|
|
12
|
+
"openclaw.plugin.json",
|
|
13
|
+
"README.md",
|
|
14
|
+
"package.json",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"openclaw": {
|
|
18
|
+
"extensions": [
|
|
19
|
+
"./index.ts"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@sinclair/typebox": "^0.34.41"
|
|
24
|
+
}
|
|
25
|
+
}
|