@inetafrica/open-claudia 2.14.0 → 2.14.1
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/CHANGELOG.md +4 -0
- package/core/channel-wizard.js +5 -18
- package/core/config.js +7 -1
- package/package.json +1 -1
- package/setup.js +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v2.14.1
|
|
4
|
+
- **The Kazee host URL is no longer asked — it's fixed infrastructure, like Telegram's `api.telegram.org`.** v2.14.0 fixed the probe but still made Step 1 ask the operator to type the host; the Kazee host never varies, so prompting for it is pure friction (and a chance to get it wrong). `core/config.js` now defines `KAZEE_DEFAULT_URL = "https://chat.inet.africa"` and `loadChannels` falls back to it whenever `KAZEE_URL` is unset. `/channel add kazee` is now **two steps, token-first**: Step 1 asks only for the bot token, Step 2 is the listen-to-capture owner flow. `setup.js` likewise drops its URL prompt (default inlined, since `config.js` exits before an `.env` exists). An explicit `KAZEE_URL` in `.env` still overrides, so nothing breaks for a deployment that set one.
|
|
5
|
+
- **Agent-space / OpenClaw:** no new deps, no new required env, no schema change; Docker image builds identically. Pure UX fix to the onboarding wizard.
|
|
6
|
+
|
|
3
7
|
## v2.14.0
|
|
4
8
|
- **`/channel add kazee` now finishes cleanly — the validation step was probing the wrong path.** The live adapter mounts every REST route under `{root}/api`, but the setup probe hit `{root}/me`. So the correct host (`https://chat.example.com`) always 404'd at validation, while the only URL that *passed* (`…/api`) then made the adapter build `…/api/api` and break. There was no single URL a user could type to succeed. `kazee-probe` now normalises either form to the root and probes the real `{root}/api/me` (new exported `normalizeKazeeRoot`); the wizard and `setup.js` both store the normalised root. Step 1 now asks for the host and states "I add the /api path myself."
|
|
5
9
|
- **The bot's own user id is no longer thrown away.** Validation already fetches it from `/me`, but the wizard never persisted `KAZEE_BOT_USER_ID` or passed it to the adapter — so a wizard-added channel booted without self-echo filtering or slash-command registration (and `loadChannels` warned on every restart). The wizard and `setup.js` now save it and hand it to the adapter.
|
package/core/channel-wizard.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// validateKazee() is exported separately so setup.js can reuse the same
|
|
16
16
|
// /me probe without going through the chat-driven flow.
|
|
17
17
|
|
|
18
|
-
const { saveEnvKey, config } = require("./config");
|
|
18
|
+
const { saveEnvKey, config, KAZEE_DEFAULT_URL } = require("./config");
|
|
19
19
|
const { send, deleteMessage } = require("./io");
|
|
20
20
|
const { publicCommands } = require("./commands");
|
|
21
21
|
const registry = require("./adapter-registry");
|
|
@@ -59,9 +59,10 @@ async function start(canonicalUserId, kind, envelope) {
|
|
|
59
59
|
const origin = envelope?.adapter && envelope?.channelId
|
|
60
60
|
? { adapter: envelope.adapter, channelId: envelope.channelId }
|
|
61
61
|
: null;
|
|
62
|
-
|
|
62
|
+
const url = config.KAZEE_URL || KAZEE_DEFAULT_URL;
|
|
63
|
+
sessions.set(canonicalUserId, { kind: "kazee", step: "awaiting-token", data: { url }, origin });
|
|
63
64
|
await send(
|
|
64
|
-
"Add a Kazee channel.\n\nStep 1 of
|
|
65
|
+
"Add a Kazee channel.\n\nStep 1 of 2: paste the Kazee bot token. I'll delete your message after reading it.",
|
|
65
66
|
{ keyboard: cancelKeyboard },
|
|
66
67
|
);
|
|
67
68
|
}
|
|
@@ -84,20 +85,6 @@ async function handleText(envelope) {
|
|
|
84
85
|
if (!session) return;
|
|
85
86
|
const text = (envelope.text || "").trim();
|
|
86
87
|
|
|
87
|
-
if (session.step === "awaiting-url") {
|
|
88
|
-
if (!/^https?:\/\//i.test(text)) {
|
|
89
|
-
await send("That doesn't look like a URL. Try again, or hit Cancel.", { keyboard: cancelKeyboard });
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
session.data.url = text;
|
|
93
|
-
session.step = "awaiting-token";
|
|
94
|
-
await send(
|
|
95
|
-
"Step 2 of 3: Kazee bot token. I'll delete your message after reading.",
|
|
96
|
-
{ keyboard: cancelKeyboard },
|
|
97
|
-
);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
88
|
if (session.step === "awaiting-token") {
|
|
102
89
|
await deleteMessage(envelope.messageId);
|
|
103
90
|
if (!text) {
|
|
@@ -125,7 +112,7 @@ async function handleText(envelope) {
|
|
|
125
112
|
}
|
|
126
113
|
session.step = "awaiting-owner-message";
|
|
127
114
|
await send(
|
|
128
|
-
"Connected to Kazee ✅\n\nStep
|
|
115
|
+
"Connected to Kazee ✅\n\nStep 2 of 2: open Kazee and send me any message — I'll grab your account and confirm it here.\n\n(Or send \"skip\" to leave the owner unset.)",
|
|
129
116
|
{ keyboard: cancelKeyboard },
|
|
130
117
|
);
|
|
131
118
|
return;
|
package/core/config.js
CHANGED
|
@@ -163,6 +163,11 @@ const FULL_PATH = [
|
|
|
163
163
|
),
|
|
164
164
|
].filter(Boolean).join(path.delimiter);
|
|
165
165
|
|
|
166
|
+
// Kazee runs on one fixed host — like Telegram's api.telegram.org it's
|
|
167
|
+
// infrastructure, not a per-user setting. Hard-coded so onboarding only asks
|
|
168
|
+
// for the bot token (the actual secret). Override with KAZEE_URL if ever needed.
|
|
169
|
+
const KAZEE_DEFAULT_URL = "https://chat.inet.africa";
|
|
170
|
+
|
|
166
171
|
// Channels: declarative list of {id, type, opts}. Defaults to telegram for
|
|
167
172
|
// backwards compat with installs predating CHANNELS.
|
|
168
173
|
function loadChannels() {
|
|
@@ -185,7 +190,7 @@ function loadChannels() {
|
|
|
185
190
|
opts: { token: TOKEN, ownerChatId: CHAT_ID || "", chatIds: CHAT_IDS },
|
|
186
191
|
});
|
|
187
192
|
} else if (type === "kazee") {
|
|
188
|
-
const url = config.KAZEE_URL;
|
|
193
|
+
const url = config.KAZEE_URL || KAZEE_DEFAULT_URL;
|
|
189
194
|
const token = config.KAZEE_BOT_TOKEN;
|
|
190
195
|
const ownerUserId = config.KAZEE_OWNER_USER_ID || "";
|
|
191
196
|
const botUserId = config.KAZEE_BOT_USER_ID || "";
|
|
@@ -238,6 +243,7 @@ module.exports = {
|
|
|
238
243
|
saveEnvKey,
|
|
239
244
|
loadChannels,
|
|
240
245
|
botSubprocessEnv,
|
|
246
|
+
KAZEE_DEFAULT_URL,
|
|
241
247
|
BOT_DIR,
|
|
242
248
|
CONFIG_DIR,
|
|
243
249
|
TOKEN, CHAT_IDS, CHAT_ID,
|
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -492,6 +492,10 @@ const STEPS = ["prerequisites", "telegram", "auth", "channels", "workspace", "va
|
|
|
492
492
|
|
|
493
493
|
const { validateKazee } = require("./core/kazee-probe");
|
|
494
494
|
|
|
495
|
+
// Fixed Kazee host — mirrors KAZEE_DEFAULT_URL in core/config.js. Kept inline
|
|
496
|
+
// because config.js exits when no .env exists yet (setup runs before that).
|
|
497
|
+
const KAZEE_DEFAULT_URL = "https://chat.inet.africa";
|
|
498
|
+
|
|
495
499
|
async function main() {
|
|
496
500
|
// Check if this is an auth subcommand
|
|
497
501
|
const args = process.argv.slice(2);
|
|
@@ -673,9 +677,8 @@ async function main() {
|
|
|
673
677
|
console.log("\n Extra Channels (optional)\n");
|
|
674
678
|
const addKazee = await ask(" Add a Kazee channel now? (y/n) [n]: ");
|
|
675
679
|
if (addKazee.toLowerCase() === "y") {
|
|
680
|
+
const url = KAZEE_DEFAULT_URL; // fixed host — never prompted, like Telegram's api host
|
|
676
681
|
while (true) {
|
|
677
|
-
const url = (await ask(" Kazee host URL (e.g. https://chat.example.com — I add /api myself): ")).trim();
|
|
678
|
-
if (!/^https?:\/\//i.test(url)) { console.log(" That doesn't look like a URL."); continue; }
|
|
679
682
|
const token = (await ask(" Kazee bot token: ")).trim();
|
|
680
683
|
if (!token) { console.log(" Empty token."); continue; }
|
|
681
684
|
console.log(" Validating against Kazee /api/me…");
|