@poolzin/pool-bot 2026.4.21 → 2026.4.22
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-generate-tool.d.ts","sourceRoot":"","sources":["../../../src/agents/tools/image-generate-tool.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"image-generate-tool.d.ts","sourceRoot":"","sources":["../../../src/agents/tools/image-generate-tool.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAsQhD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE;IAChD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,YAAY,GAAG,IAAI,CAkFtB"}
|
|
@@ -7,6 +7,8 @@ import { resolveEnvApiKey } from "../model-auth.js";
|
|
|
7
7
|
import { imageResult, readStringParam } from "./common.js";
|
|
8
8
|
// Z.AI image generation models
|
|
9
9
|
const ZAI_BASE_URL = "https://open.bigmodel.cn/api/paas/v4";
|
|
10
|
+
// MiniMax image generation
|
|
11
|
+
const MINIMAX_BASE_URL = "https://api.minimaxi.chat/v1";
|
|
10
12
|
const ImageGenerateSchema = Type.Object({
|
|
11
13
|
prompt: Type.String({
|
|
12
14
|
description: "Description of the image to generate. Be descriptive — include subject, style, lighting, mood, composition, and artistic direction.",
|
|
@@ -130,6 +132,56 @@ async function generateImage(params) {
|
|
|
130
132
|
revisedPrompt: imageData.revised_prompt,
|
|
131
133
|
};
|
|
132
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Resolve the MiniMax API key from environment or auth profiles.
|
|
137
|
+
*/
|
|
138
|
+
function _resolveMinimaxApiKey(agentDir) {
|
|
139
|
+
const envKey = resolveEnvApiKey("minimax");
|
|
140
|
+
if (envKey?.apiKey)
|
|
141
|
+
return envKey.apiKey;
|
|
142
|
+
const store = ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false });
|
|
143
|
+
const profileIds = listProfilesForProvider(store, "minimax");
|
|
144
|
+
for (const id of profileIds) {
|
|
145
|
+
const cred = store.profiles[id];
|
|
146
|
+
if (!cred)
|
|
147
|
+
continue;
|
|
148
|
+
if (cred.type === "api_key")
|
|
149
|
+
return cred.key;
|
|
150
|
+
if (cred.type === "token")
|
|
151
|
+
return cred.token;
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Call the MiniMax image generation API.
|
|
157
|
+
*/
|
|
158
|
+
async function _generateMinimaxImage(params) {
|
|
159
|
+
const body = {
|
|
160
|
+
model: params.model,
|
|
161
|
+
prompt: params.prompt,
|
|
162
|
+
};
|
|
163
|
+
if (params.aspectRatio) {
|
|
164
|
+
body.aspect_ratio = params.aspectRatio;
|
|
165
|
+
}
|
|
166
|
+
const response = await fetch(`${MINIMAX_BASE_URL}/image_generation`, {
|
|
167
|
+
method: "POST",
|
|
168
|
+
headers: {
|
|
169
|
+
Authorization: `Bearer ${params.apiKey}`,
|
|
170
|
+
"Content-Type": "application/json",
|
|
171
|
+
},
|
|
172
|
+
body: JSON.stringify(body),
|
|
173
|
+
});
|
|
174
|
+
if (!response.ok) {
|
|
175
|
+
const errorText = await response.text().catch(() => "unknown error");
|
|
176
|
+
throw new Error(`MiniMax image generation failed (HTTP ${response.status}): ${errorText}`);
|
|
177
|
+
}
|
|
178
|
+
const result = (await response.json());
|
|
179
|
+
const imageUrl = result.data?.url;
|
|
180
|
+
if (!imageUrl) {
|
|
181
|
+
throw new Error("MiniMax image generation returned no image URL.");
|
|
182
|
+
}
|
|
183
|
+
return { imageUrl };
|
|
184
|
+
}
|
|
133
185
|
/**
|
|
134
186
|
* Download an image from URL and return its buffer.
|
|
135
187
|
*/
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-cli.d.ts","sourceRoot":"","sources":["../../src/cli/config-cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,OAAO,EAAE,KAAK,UAAU,EAAkB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"config-cli.d.ts","sourceRoot":"","sources":["../../src/cli/config-cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,OAAO,EAAE,KAAK,UAAU,EAAkB,MAAM,eAAe,CAAC;AA+WhE,wBAAsB,YAAY,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,UAAU,CAAA;CAAE,iBA4B9F;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,UAAU,CAAA;CAAE,iBAqBhF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,QAiOjD"}
|
package/dist/cli/config-cli.js
CHANGED
|
@@ -6,6 +6,189 @@ import { formatDocsLink } from "../terminal/links.js";
|
|
|
6
6
|
import { formatCliCommand } from "./command-format.js";
|
|
7
7
|
import { theme } from "../terminal/theme.js";
|
|
8
8
|
import { shortenHomePath } from "../utils.js";
|
|
9
|
+
function generateConfigJsonSchema() {
|
|
10
|
+
return {
|
|
11
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
12
|
+
title: "PoolBot Config",
|
|
13
|
+
description: "PoolBot configuration file (poolbot.json)",
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: {
|
|
16
|
+
gateway: {
|
|
17
|
+
type: "object",
|
|
18
|
+
description: "Gateway connection and security settings",
|
|
19
|
+
properties: {
|
|
20
|
+
mode: { type: "string", enum: ["local", "remote"], default: "local" },
|
|
21
|
+
port: { type: "number", default: 18789 },
|
|
22
|
+
auth: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
mode: { type: "string", enum: ["token", "password"] },
|
|
26
|
+
token: { type: "string" },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
agents: {
|
|
32
|
+
type: "object",
|
|
33
|
+
description: "Agent configuration per agent ID",
|
|
34
|
+
properties: {
|
|
35
|
+
defaults: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
model: { type: "string", description: "Default model identifier" },
|
|
39
|
+
provider: { type: "string", description: "Default provider (anthropic, openai, etc.)" },
|
|
40
|
+
thinking: { type: "string", enum: ["off", "minimal", "low", "medium", "high"] },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
channels: {
|
|
46
|
+
type: "object",
|
|
47
|
+
description: "Messaging channel configurations",
|
|
48
|
+
properties: {
|
|
49
|
+
telegram: { $ref: "#/$defs/channelTelegram" },
|
|
50
|
+
discord: { $ref: "#/$defs/channelDiscord" },
|
|
51
|
+
slack: { $ref: "#/$defs/channelSlack" },
|
|
52
|
+
signal: { $ref: "#/$defs/channelSignal" },
|
|
53
|
+
whatsapp: { $ref: "#/$defs/channelWhatsApp" },
|
|
54
|
+
imessage: { $ref: "#/$defs/channelIMessage" },
|
|
55
|
+
nostr: { $ref: "#/$defs/channelNostr" },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
auth: {
|
|
59
|
+
type: "object",
|
|
60
|
+
description: "Authentication profile configuration",
|
|
61
|
+
properties: {
|
|
62
|
+
cooldowns: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
billingBackoffHours: { type: "number", default: 5 },
|
|
66
|
+
billingMaxHours: { type: "number", default: 24 },
|
|
67
|
+
failureWindowHours: { type: "number", default: 24 },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
cron: {
|
|
73
|
+
type: "object",
|
|
74
|
+
description: "Cron job scheduler configuration",
|
|
75
|
+
properties: {
|
|
76
|
+
enabled: { type: "boolean", default: true },
|
|
77
|
+
store: { type: "string", description: "Path to cron jobs store file" },
|
|
78
|
+
maxConcurrentRuns: { type: "number", default: 1 },
|
|
79
|
+
defaultJobTimeoutSeconds: { type: "number", default: 7200, description: "Default timeout in seconds (0 = no timeout)" },
|
|
80
|
+
sessionRetention: { type: ["string", "boolean"], description: "Session retention duration (e.g. '24h', '7d', false to disable)" },
|
|
81
|
+
webhook: { type: "string", description: "Legacy webhook URL" },
|
|
82
|
+
webhookToken: { type: "string", description: "Bearer token for webhook delivery" },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
session: {
|
|
86
|
+
type: "object",
|
|
87
|
+
description: "Session management settings",
|
|
88
|
+
properties: {
|
|
89
|
+
store: { type: "string", description: "Session store path" },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
plugins: {
|
|
93
|
+
type: "object",
|
|
94
|
+
description: "Plugin configuration",
|
|
95
|
+
properties: {
|
|
96
|
+
enabled: { type: "boolean", default: false },
|
|
97
|
+
allow: { type: "array", items: { type: "string" }, description: "Allowed plugin IDs" },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
skills: {
|
|
101
|
+
type: "object",
|
|
102
|
+
description: "Skill configuration",
|
|
103
|
+
properties: {
|
|
104
|
+
auto: { type: "boolean", default: true },
|
|
105
|
+
deny: { type: "array", items: { type: "string" } },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
voiceCall: {
|
|
109
|
+
type: "object",
|
|
110
|
+
description: "Voice call provider settings",
|
|
111
|
+
properties: {
|
|
112
|
+
provider: { type: "string", enum: ["elevenlabs", "deepgram"] },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
$defs: {
|
|
117
|
+
channelTelegram: {
|
|
118
|
+
type: "object",
|
|
119
|
+
properties: {
|
|
120
|
+
enabled: { type: "boolean", default: true },
|
|
121
|
+
accounts: {
|
|
122
|
+
type: "object",
|
|
123
|
+
additionalProperties: {
|
|
124
|
+
type: "object",
|
|
125
|
+
properties: {
|
|
126
|
+
token: { type: "string", description: "Bot token" },
|
|
127
|
+
enabled: { type: "boolean" },
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
commands: {
|
|
132
|
+
type: "object",
|
|
133
|
+
properties: {
|
|
134
|
+
native: { type: "boolean", default: true },
|
|
135
|
+
nativeSkills: { type: "boolean", default: true },
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
channelDiscord: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: {
|
|
143
|
+
enabled: { type: "boolean", default: true },
|
|
144
|
+
accounts: {
|
|
145
|
+
type: "object",
|
|
146
|
+
additionalProperties: {
|
|
147
|
+
type: "object",
|
|
148
|
+
properties: {
|
|
149
|
+
token: { type: "string" },
|
|
150
|
+
enabled: { type: "boolean" },
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
channelSlack: {
|
|
157
|
+
type: "object",
|
|
158
|
+
properties: {
|
|
159
|
+
enabled: { type: "boolean", default: true },
|
|
160
|
+
appToken: { type: "string", description: "App-level token (xapp-...)" },
|
|
161
|
+
botToken: { type: "string", description: "Bot token (xoxb-...)" },
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
channelSignal: {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: {
|
|
167
|
+
enabled: { type: "boolean" },
|
|
168
|
+
accounts: { type: "object" },
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
channelWhatsApp: {
|
|
172
|
+
type: "object",
|
|
173
|
+
properties: {
|
|
174
|
+
enabled: { type: "boolean" },
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
channelIMessage: {
|
|
178
|
+
type: "object",
|
|
179
|
+
properties: {
|
|
180
|
+
enabled: { type: "boolean" },
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
channelNostr: {
|
|
184
|
+
type: "object",
|
|
185
|
+
properties: {
|
|
186
|
+
enabled: { type: "boolean" },
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
}
|
|
9
192
|
function isIndexSegment(raw) {
|
|
10
193
|
return /^[0-9]+$/.test(raw);
|
|
11
194
|
}
|
|
@@ -424,4 +607,20 @@ export function registerConfigCli(program) {
|
|
|
424
607
|
defaultRuntime.exit(1);
|
|
425
608
|
}
|
|
426
609
|
});
|
|
610
|
+
cmd
|
|
611
|
+
.command("schema")
|
|
612
|
+
.description("Print the generated JSON Schema for poolbot.json")
|
|
613
|
+
.option("--minify", "Output compact JSON without indentation", false)
|
|
614
|
+
.action(async (opts) => {
|
|
615
|
+
try {
|
|
616
|
+
const schema = generateConfigJsonSchema();
|
|
617
|
+
const json = opts.minify ? JSON.stringify(schema) : JSON.stringify(schema, null, 2);
|
|
618
|
+
defaultRuntime.log(json);
|
|
619
|
+
defaultRuntime.exit(0);
|
|
620
|
+
}
|
|
621
|
+
catch (err) {
|
|
622
|
+
defaultRuntime.error(danger(String(err)));
|
|
623
|
+
defaultRuntime.exit(1);
|
|
624
|
+
}
|
|
625
|
+
});
|
|
427
626
|
}
|