@inetafrica/open-claudia 3.5.79 → 3.5.80
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 +8 -0
- package/bin/owner-setup.js +2 -1
- package/core/loopback.js +6 -3
- package/core/owner-setup.js +17 -6
- package/package.json +1 -1
- package/test-provider-language.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.5.80
|
|
4
|
+
|
|
5
|
+
3.5.79 plus one fix (Sumeet 13 Nov 14:05 EAT: "why was that on the main chat not on the thread? Is that a bug?").
|
|
6
|
+
|
|
7
|
+
- **The switch-on card lands in the thread that asked for it** (`core/owner-setup.js`, `core/loopback.js`): `open-claudia owner-setup` run from a thread of the owner's own direct chat now posts the one-tap card (or its text fallback) in that thread, not on the main timeline. The thread comes from the running turn, never the request. A turn anywhere else (a group, another person's chat) still sends it to her direct chat's main timeline, and the bot's own refusal and renew notices are unchanged.
|
|
8
|
+
|
|
9
|
+
Tests: three new cases in `test-bot-acts-for-owner.js` (fail without the fix).
|
|
10
|
+
|
|
3
11
|
## 3.5.79
|
|
4
12
|
|
|
5
13
|
3.5.78 plus one change (Sumeet 13 Nov 13:17 EAT, during Anthropic's Claude Code sign-in incident that began 09:58 UTC: "set up wake ups to keep retrying").
|
package/bin/owner-setup.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// open-claudia owner-setup — send a personal bot's owner the one-tap card that opens
|
|
2
2
|
// Central at the form to switch the bot on (or renew it). See
|
|
3
|
-
// core/owner-setup.js. The running bot sends it to the owner's direct Kazee chat
|
|
3
|
+
// core/owner-setup.js. The running bot sends it to the owner's direct Kazee chat
|
|
4
|
+
// (in the asking thread when this turn runs in a thread of that chat).
|
|
4
5
|
|
|
5
6
|
const path = require("path");
|
|
6
7
|
|
package/core/loopback.js
CHANGED
|
@@ -568,8 +568,10 @@ async function handleJson(req, res, url, kind) {
|
|
|
568
568
|
}
|
|
569
569
|
// `open-claudia owner-setup` (core/owner-setup.js): the one-tap card that
|
|
570
570
|
// lets a personal bot's owner switch it on or renew it. It always goes to
|
|
571
|
-
// HER direct chat, never this room
|
|
572
|
-
//
|
|
571
|
+
// HER direct chat, never this room: in the asking turn's own thread when
|
|
572
|
+
// that turn runs there, else the main timeline (the run decides, never the
|
|
573
|
+
// payload). The bot decides what it says from its own profile. A run that
|
|
574
|
+
// is not hers sends each card at most once a day.
|
|
573
575
|
if (kind === "owner-setup") {
|
|
574
576
|
const caller = callerOf(payload);
|
|
575
577
|
if (!caller.attributed) return reply(res, 403, { error: "owner-setup can only be used from a live, attributed run" });
|
|
@@ -578,7 +580,8 @@ async function handleJson(req, res, url, kind) {
|
|
|
578
580
|
if (planned.refused) return reply(res, 400, { error: planned.refused });
|
|
579
581
|
if (planned.nothing) return reply(res, 200, { ok: true, sent: null, nothing: planned.nothing });
|
|
580
582
|
try {
|
|
581
|
-
const
|
|
583
|
+
const from = { adapterType: caller.adapterType, channelId: caller.channelId, threadId: caller.threadId || null };
|
|
584
|
+
const sent = await ownerSetup.tellOwnerAsked(planned, { owner: caller.owner === true, from });
|
|
582
585
|
if (!sent) return reply(res, 502, { error: "could not reach the owner's direct chat in Kazee" });
|
|
583
586
|
return reply(res, 200, { ok: true, sent, title: planned.card ? planned.card.title : null });
|
|
584
587
|
} catch (e) {
|
package/core/owner-setup.js
CHANGED
|
@@ -153,33 +153,44 @@ function kazeeAdapter() {
|
|
|
153
153
|
catch (_) { return null; }
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
// The thread to post in: the asking turn's own thread when that turn runs in
|
|
157
|
+
// her direct chat (Sumeet, 13 Nov 2026: "why was that on the main chat not on
|
|
158
|
+
// the thread?"). A turn anywhere else (a group, another person's chat) gets
|
|
159
|
+
// her direct chat's main timeline, as before.
|
|
160
|
+
function threadIn(chatId, from) {
|
|
161
|
+
if (!from || from.adapterType !== "kazee" || !from.threadId) return null;
|
|
162
|
+
return String(from.channelId || "") === String(chatId) ? String(from.threadId) : null;
|
|
163
|
+
}
|
|
164
|
+
|
|
156
165
|
// Send { card, text } to the owner's direct Kazee chat: the card, else the
|
|
157
|
-
// text.
|
|
158
|
-
|
|
166
|
+
// text. `from` is the asking turn ({ adapterType, channelId, threadId }).
|
|
167
|
+
// Resolves "card", "text" or null (no Kazee, no owner, nothing sent).
|
|
168
|
+
async function tellOwner({ card, text }, { adapter = kazeeAdapter(), from = null } = {}) {
|
|
159
169
|
const ownerId = botProfile.ownerUserId();
|
|
160
170
|
if (!ownerId || !adapter || typeof adapter.directChatFor !== "function") return null;
|
|
161
171
|
const chatId = await adapter.directChatFor(ownerId);
|
|
162
172
|
if (!chatId) return null;
|
|
173
|
+
const threadId = threadIn(chatId, from);
|
|
163
174
|
if (card && typeof adapter.sendCard === "function") {
|
|
164
175
|
try {
|
|
165
|
-
if (await adapter.sendCard(chatId, card, { content: text })) return "card";
|
|
176
|
+
if (await adapter.sendCard(chatId, card, { content: text, threadId })) return "card";
|
|
166
177
|
console.error("owner-setup: Kazee Chat returned no message id for the card; sending the text");
|
|
167
178
|
} catch (e) {
|
|
168
179
|
console.error("owner-setup: card not sent, sending the text:", e.message);
|
|
169
180
|
}
|
|
170
181
|
}
|
|
171
182
|
if (!text) return null;
|
|
172
|
-
await adapter.send(chatId, text);
|
|
183
|
+
await adapter.send(chatId, text, threadId ? { threadId } : {});
|
|
173
184
|
return "text";
|
|
174
185
|
}
|
|
175
186
|
|
|
176
187
|
// A run that is not the owner's asks at most once a day per card, so nobody
|
|
177
188
|
// else can fill her chat with cards.
|
|
178
|
-
async function tellOwnerAsked(sending, { owner = false, now = Date.now(), adapter } = {}) {
|
|
189
|
+
async function tellOwnerAsked(sending, { owner = false, now = Date.now(), adapter, from = null } = {}) {
|
|
179
190
|
const key = sending.key || sending.text;
|
|
180
191
|
if (!owner && now - (sentAt.get(key) || 0) < SEND_EVERY_MS) return "already-sent";
|
|
181
192
|
sentAt.set(key, now);
|
|
182
|
-
return tellOwner(sending, adapter ? { adapter } :
|
|
193
|
+
return tellOwner(sending, adapter ? { adapter, from } : { from });
|
|
183
194
|
}
|
|
184
195
|
|
|
185
196
|
// The renew card, once a day while Central says renewDue.
|
package/package.json
CHANGED
|
@@ -669,6 +669,8 @@ assert.match(pkg.description, /provider-agnostic coding-agent harness/i);
|
|
|
669
669
|
// one-tap switch-on card (from the Maia build: plan v2 of 25 Oct, SEC-28 of 30 Oct).
|
|
670
670
|
// 3.5.77 = 3.5.76 + Fable 5.2 in the picker and prices, call --help never dials
|
|
671
671
|
// (Sumeet 12 Nov 07:53 EAT, card 6af54622: "Build 3.5.77 with the 3 pieces, test on one bot, roll on your word").
|
|
672
|
+
// 3.5.80 = 3.5.79 + the owner switch-on card lands in the thread that asked for it
|
|
673
|
+
// (Sumeet 13 Nov 14:05 EAT: "why was that on the main chat not on the thread? Is that a bug?").
|
|
672
674
|
// 3.5.79 = 3.5.78 + a reply refused as signed out is tried again every minute, quietly,
|
|
673
675
|
// up to 30 times (Sumeet 13 Nov 13:17 EAT, during Anthropic's sign-in incident:
|
|
674
676
|
// "set up wake ups to keep retrying").
|
|
@@ -681,7 +683,7 @@ assert.match(pkg.description, /provider-agnostic coding-agent harness/i);
|
|
|
681
683
|
// 3.5.72 = 3.5.71 + the Mac memory fixes of 22-28 Oct:
|
|
682
684
|
// topic lessons ride with their pack, .env recall pins, prompt fixes, past
|
|
683
685
|
// chats reach recall, settled decisions, /engine x|mem0, nightly retry.
|
|
684
|
-
assert.strictEqual(pkg.version, "3.5.
|
|
686
|
+
assert.strictEqual(pkg.version, "3.5.80", "release version must remain unchanged without explicit approval");
|
|
685
687
|
for (const keyword of ["claude", "codex", "coding-agent", "provider-agnostic"]) {
|
|
686
688
|
assert.ok(pkg.keywords.includes(keyword), `package keyword missing: ${keyword}`);
|
|
687
689
|
}
|