@owloops/browserbird 1.4.7 → 1.4.8
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/dist/index.mjs +14 -23
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -122,8 +122,8 @@ function unknownSubcommand(subcommand, command, validCommands) {
|
|
|
122
122
|
/** @fileoverview ASCII banner displayed on daemon startup and in help text. */
|
|
123
123
|
const pkg = createRequire(import.meta.url)("../package.json");
|
|
124
124
|
const buildInfo = [];
|
|
125
|
-
buildInfo.push(`commit: ${"
|
|
126
|
-
buildInfo.push(`built: 2026-03-11T23:
|
|
125
|
+
buildInfo.push(`commit: ${"9201c051a7435e6c942b52adcfd897a7272c8b81".substring(0, 7)}`);
|
|
126
|
+
buildInfo.push(`built: 2026-03-11T23:51:21+04:00`);
|
|
127
127
|
const buildString = buildInfo.length > 0 ? ` (${buildInfo.join(", ")})` : "";
|
|
128
128
|
const VERSION = `browserbird ${pkg.version}${buildString}`;
|
|
129
129
|
const BIRD = [
|
|
@@ -2764,18 +2764,6 @@ function sessionTimeoutBlocks(timeoutMs, opts) {
|
|
|
2764
2764
|
});
|
|
2765
2765
|
return blocks;
|
|
2766
2766
|
}
|
|
2767
|
-
function sessionStopBlocks(sessionKey) {
|
|
2768
|
-
return [{
|
|
2769
|
-
type: "actions",
|
|
2770
|
-
elements: [{
|
|
2771
|
-
type: "button",
|
|
2772
|
-
text: plain("Stop Session"),
|
|
2773
|
-
action_id: "session_stop",
|
|
2774
|
-
value: sessionKey,
|
|
2775
|
-
style: "danger"
|
|
2776
|
-
}]
|
|
2777
|
-
}];
|
|
2778
|
-
}
|
|
2779
2767
|
function busyBlocks(activeCount, maxConcurrent) {
|
|
2780
2768
|
return [section("*Too many active sessions*"), context(`${activeCount}/${maxConcurrent} slots in use. Try again shortly.`)];
|
|
2781
2769
|
}
|
|
@@ -3172,12 +3160,7 @@ function createHandler(client, getConfig, signal, getTeamId) {
|
|
|
3172
3160
|
}).join("\n");
|
|
3173
3161
|
}
|
|
3174
3162
|
async function streamToChannel(events, channelId, threadTs, sessionUid, teamId, userId, meta) {
|
|
3175
|
-
|
|
3176
|
-
channelId,
|
|
3177
|
-
threadTs,
|
|
3178
|
-
teamId,
|
|
3179
|
-
userId
|
|
3180
|
-
});
|
|
3163
|
+
let streamer = null;
|
|
3181
3164
|
let streamDead = false;
|
|
3182
3165
|
let fullText = "";
|
|
3183
3166
|
let completion;
|
|
@@ -3188,10 +3171,19 @@ function createHandler(client, getConfig, signal, getTeamId) {
|
|
|
3188
3171
|
const msg = err instanceof Error ? err.message : String(err);
|
|
3189
3172
|
return msg.includes("not_in_streaming_state") || msg.includes("streaming");
|
|
3190
3173
|
}
|
|
3174
|
+
function ensureStream() {
|
|
3175
|
+
if (!streamer) streamer = client.startStream({
|
|
3176
|
+
channelId,
|
|
3177
|
+
threadTs,
|
|
3178
|
+
teamId,
|
|
3179
|
+
userId
|
|
3180
|
+
});
|
|
3181
|
+
return streamer;
|
|
3182
|
+
}
|
|
3191
3183
|
async function safeAppend(content) {
|
|
3192
3184
|
if (streamDead) return;
|
|
3193
3185
|
try {
|
|
3194
|
-
await
|
|
3186
|
+
await ensureStream().append(content);
|
|
3195
3187
|
} catch (err) {
|
|
3196
3188
|
if (isStreamExpired(err)) {
|
|
3197
3189
|
streamDead = true;
|
|
@@ -3200,7 +3192,7 @@ function createHandler(client, getConfig, signal, getTeamId) {
|
|
|
3200
3192
|
}
|
|
3201
3193
|
}
|
|
3202
3194
|
async function safeStop(opts) {
|
|
3203
|
-
if (streamDead) return;
|
|
3195
|
+
if (!streamer || streamDead) return;
|
|
3204
3196
|
try {
|
|
3205
3197
|
await streamer.stop(opts);
|
|
3206
3198
|
} catch (err) {
|
|
@@ -3321,7 +3313,6 @@ function createHandler(client, getConfig, signal, getTeamId) {
|
|
|
3321
3313
|
}, signal);
|
|
3322
3314
|
lock.killCurrent = kill;
|
|
3323
3315
|
client.setStatus?.(channelId, threadTs, "is thinking...").catch(() => {});
|
|
3324
|
-
client.postEphemeral(channelId, threadTs, userId, "Session running.", { blocks: sessionStopBlocks(key) }).catch(() => {});
|
|
3325
3316
|
if (isNew) {
|
|
3326
3317
|
const title = prompt.length > 60 ? prompt.slice(0, 57) + "..." : prompt;
|
|
3327
3318
|
client.setTitle?.(channelId, threadTs, title).catch(() => {});
|