@p-sw/brainbox 0.2.3-beta.0 → 0.2.3-beta.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/dist/index.js +58 -57
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
2
3
|
|
|
3
4
|
// src/index.ts
|
|
4
5
|
import { Command } from "commander";
|
|
@@ -24,12 +25,12 @@ var LEVELS = {
|
|
|
24
25
|
fatal: { rank: 5, color: chalk.bgRed.white, stderr: true }
|
|
25
26
|
};
|
|
26
27
|
var ICONS = {
|
|
27
|
-
debug: "
|
|
28
|
-
info: "
|
|
29
|
-
success: "
|
|
30
|
-
warn: "
|
|
31
|
-
error: "
|
|
32
|
-
fatal: "
|
|
28
|
+
debug: "\u25C6",
|
|
29
|
+
info: "\u2139",
|
|
30
|
+
success: "\u2714",
|
|
31
|
+
warn: "\u26A0",
|
|
32
|
+
error: "\u2716",
|
|
33
|
+
fatal: "\u25B2"
|
|
33
34
|
};
|
|
34
35
|
function pad2(n) {
|
|
35
36
|
return n < 10 ? `0${n}` : `${n}`;
|
|
@@ -444,7 +445,7 @@ class BrainDBManager {
|
|
|
444
445
|
async isBrainAvailable(brainId) {
|
|
445
446
|
const item = await this.loadBrain(brainId);
|
|
446
447
|
const ok = item !== undefined && this.isBrainReady(item);
|
|
447
|
-
log.debug(`isBrainAvailable: id=${brainId}
|
|
448
|
+
log.debug(`isBrainAvailable: id=${brainId} \u2192 ${ok}`);
|
|
448
449
|
return ok;
|
|
449
450
|
}
|
|
450
451
|
isBrainReady(item) {
|
|
@@ -474,7 +475,7 @@ class BrainDBManager {
|
|
|
474
475
|
var brainManager = new BrainDBManager;
|
|
475
476
|
|
|
476
477
|
// src/brain/index.ts
|
|
477
|
-
import { randomUUID } from "
|
|
478
|
+
import { randomUUID } from "crypto";
|
|
478
479
|
import Supermemory from "supermemory";
|
|
479
480
|
|
|
480
481
|
// src/provider/llm.ts
|
|
@@ -1915,7 +1916,7 @@ class AnthropicExecutor extends LLMExecutor {
|
|
|
1915
1916
|
}
|
|
1916
1917
|
|
|
1917
1918
|
// src/provider/providers/bedrock.ts
|
|
1918
|
-
import { createHmac, createHash } from "
|
|
1919
|
+
import { createHmac, createHash } from "crypto";
|
|
1919
1920
|
var pad22 = (n) => n.toString().padStart(2, "0");
|
|
1920
1921
|
function amzDate(now) {
|
|
1921
1922
|
return {
|
|
@@ -2627,7 +2628,7 @@ async function loadPrompt(promptKey) {
|
|
|
2627
2628
|
const filePath = path.join(PROMPTS_DIR, fileName(promptKey));
|
|
2628
2629
|
log5.debug(`loadPrompt: ${promptKey} (${filePath})`);
|
|
2629
2630
|
const content = await readFile2(filePath, "utf-8");
|
|
2630
|
-
log5.debug(`loadPrompt: ${promptKey}
|
|
2631
|
+
log5.debug(`loadPrompt: ${promptKey} \u2192 ${content.length} chars`);
|
|
2631
2632
|
return content;
|
|
2632
2633
|
}
|
|
2633
2634
|
|
|
@@ -2775,7 +2776,7 @@ function formatTime(time) {
|
|
|
2775
2776
|
}
|
|
2776
2777
|
function translateMessageHistory(personaName, entries) {
|
|
2777
2778
|
return entries.map((entry) => {
|
|
2778
|
-
const label = entry.sender === "persona" ? personaName : "
|
|
2779
|
+
const label = entry.sender === "persona" ? personaName : "\uC0AC\uC6A9\uC790";
|
|
2779
2780
|
return `${label}@${formatTime(entry.time)}: ${entry.content}`;
|
|
2780
2781
|
}).join(`
|
|
2781
2782
|
`);
|
|
@@ -2962,7 +2963,7 @@ class Brain {
|
|
|
2962
2963
|
const nextMonth = new Date(today.getFullYear(), today.getMonth() + 1, today.getDate());
|
|
2963
2964
|
const monthly = await this.createMonthlySchedule(nextMonth);
|
|
2964
2965
|
if (!monthly) {
|
|
2965
|
-
log7.debug(`regenerateSchedules: skip daily
|
|
2966
|
+
log7.debug(`regenerateSchedules: skip daily \u2014 monthly schedule generation failed`);
|
|
2966
2967
|
return;
|
|
2967
2968
|
}
|
|
2968
2969
|
const tomorrow = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
|
|
@@ -3148,7 +3149,7 @@ class Brain {
|
|
|
3148
3149
|
return slice;
|
|
3149
3150
|
}
|
|
3150
3151
|
async deriveAvailabilityFromSchedule(schedule) {
|
|
3151
|
-
log7.debug(`deriveAvailabilityFromSchedule: ${schedule.items.length} slots
|
|
3152
|
+
log7.debug(`deriveAvailabilityFromSchedule: ${schedule.items.length} slots \u2192 model`);
|
|
3152
3153
|
try {
|
|
3153
3154
|
const instruction = await loadPrompt("SCHEDULE_AVAILABILITY");
|
|
3154
3155
|
const promptMessage = JSON.stringify({
|
|
@@ -3220,7 +3221,7 @@ class Brain {
|
|
|
3220
3221
|
`Conversation so far:`,
|
|
3221
3222
|
historyBlock.length > 0 ? historyBlock : "(no prior messages)",
|
|
3222
3223
|
`New user message(s) to which you must reply:`,
|
|
3223
|
-
newBlock.length > 0 ? newBlock : "(none
|
|
3224
|
+
newBlock.length > 0 ? newBlock : "(none \u2014 open turn)"
|
|
3224
3225
|
].join(`
|
|
3225
3226
|
|
|
3226
3227
|
`);
|
|
@@ -3614,12 +3615,12 @@ class BaseChannel {
|
|
|
3614
3615
|
if (!force) {
|
|
3615
3616
|
const availability = await this.brain.getAvailability();
|
|
3616
3617
|
if (availability.status !== "offline") {
|
|
3617
|
-
logger.debug(`sleepMemory cron: skip
|
|
3618
|
+
logger.debug(`sleepMemory cron: skip \u2014 availability=${availability.status}`);
|
|
3618
3619
|
return;
|
|
3619
3620
|
}
|
|
3620
3621
|
const existing = await this.brain.memory.get(`daily-journal:${dateKey2}`);
|
|
3621
3622
|
if (existing) {
|
|
3622
|
-
logger.debug(`sleepMemory cron: skip
|
|
3623
|
+
logger.debug(`sleepMemory cron: skip \u2014 journal for ${dateKey2} exists`);
|
|
3623
3624
|
return;
|
|
3624
3625
|
}
|
|
3625
3626
|
}
|
|
@@ -3633,11 +3634,11 @@ class BaseChannel {
|
|
|
3633
3634
|
}
|
|
3634
3635
|
async runStartConversation() {
|
|
3635
3636
|
if (!this.isReady) {
|
|
3636
|
-
logger.debug("startConversation: skip
|
|
3637
|
+
logger.debug("startConversation: skip \u2014 not ready");
|
|
3637
3638
|
return;
|
|
3638
3639
|
}
|
|
3639
3640
|
if (this.isChatting || this.startConversationTimeout) {
|
|
3640
|
-
logger.debug("startConversation: skip
|
|
3641
|
+
logger.debug("startConversation: skip \u2014 chat in progress");
|
|
3641
3642
|
return;
|
|
3642
3643
|
}
|
|
3643
3644
|
const availability = await this.brain.getAvailability();
|
|
@@ -3755,7 +3756,7 @@ class BaseChannel {
|
|
|
3755
3756
|
});
|
|
3756
3757
|
} catch (e) {
|
|
3757
3758
|
logger.error(`Error while sending message: ${e}`);
|
|
3758
|
-
logger.debug(`onMessage: sendMessage threw
|
|
3759
|
+
logger.debug(`onMessage: sendMessage threw \u2014 ${e instanceof Error ? e.stack : String(e)}`);
|
|
3759
3760
|
} finally {
|
|
3760
3761
|
this.isSending = false;
|
|
3761
3762
|
if (this.isSendingQueue.length > 0) {
|
|
@@ -3773,7 +3774,7 @@ class BaseChannel {
|
|
|
3773
3774
|
}
|
|
3774
3775
|
}, MESSAGE_DEBOUNCE_MS);
|
|
3775
3776
|
} else {
|
|
3776
|
-
logger.debug(`onMessage: isSending
|
|
3777
|
+
logger.debug(`onMessage: isSending \u2014 buffering into isSendingQueue (size=${this.isSendingQueue.length + 1})`);
|
|
3777
3778
|
this.isSendingQueue.push(message);
|
|
3778
3779
|
}
|
|
3779
3780
|
this.isChatting = true;
|
|
@@ -3799,7 +3800,7 @@ class BaseChannel {
|
|
|
3799
3800
|
const current = await this.brain.getAvailability();
|
|
3800
3801
|
const prev = this.previousAvailability;
|
|
3801
3802
|
this.previousAvailability = current.status;
|
|
3802
|
-
logger.debug(`availabilityWatcher: ${prev ?? "(initial)"}
|
|
3803
|
+
logger.debug(`availabilityWatcher: ${prev ?? "(initial)"} \u2192 ${current.status}`);
|
|
3803
3804
|
if (prev !== current.status) {
|
|
3804
3805
|
await this.setAvailability(current.status);
|
|
3805
3806
|
}
|
|
@@ -3815,7 +3816,7 @@ class BaseChannel {
|
|
|
3815
3816
|
}
|
|
3816
3817
|
const current = await this.brain.getAvailability();
|
|
3817
3818
|
if (current.status !== "online") {
|
|
3818
|
-
logger.debug(`flushDeferred: skip
|
|
3819
|
+
logger.debug(`flushDeferred: skip \u2014 still ${current.status} (deferred size=${this.deferredQueue.length})`);
|
|
3819
3820
|
return;
|
|
3820
3821
|
}
|
|
3821
3822
|
const drained = this.deferredQueue.splice(0, this.deferredQueue.length);
|
|
@@ -4135,7 +4136,7 @@ class DiscordChannel extends BaseChannel {
|
|
|
4135
4136
|
this.targetChannel = channel;
|
|
4136
4137
|
}
|
|
4137
4138
|
}
|
|
4138
|
-
logger.success(`Discord channel bound: ${this.brain.brainbase.displayName}
|
|
4139
|
+
logger.success(`Discord channel bound: ${this.brain.brainbase.displayName} \u2192 ${entry.channelId}`);
|
|
4139
4140
|
}
|
|
4140
4141
|
await super.completePairing(entry);
|
|
4141
4142
|
}
|
|
@@ -4160,7 +4161,7 @@ class DiscordChannel extends BaseChannel {
|
|
|
4160
4161
|
return;
|
|
4161
4162
|
}
|
|
4162
4163
|
const mapped = AVAILABILITY_STATUS_MAP[status];
|
|
4163
|
-
logger.debug(`setAvailability: ${status}
|
|
4164
|
+
logger.debug(`setAvailability: ${status} \u2192 ${mapped}`);
|
|
4164
4165
|
this.client.user.setStatus(mapped);
|
|
4165
4166
|
}
|
|
4166
4167
|
async resolveSendChannel() {
|
|
@@ -4282,7 +4283,7 @@ class TelegramChannel extends BaseChannel {
|
|
|
4282
4283
|
this.brain.brainbase.telegram.chatId = entry.chatId;
|
|
4283
4284
|
this.chatId = entry.chatId;
|
|
4284
4285
|
await this.brain.persistBrainBase();
|
|
4285
|
-
logger.success(`Telegram chat bound: ${this.brain.brainbase.displayName}
|
|
4286
|
+
logger.success(`Telegram chat bound: ${this.brain.brainbase.displayName} \u2192 ${entry.chatId}`);
|
|
4286
4287
|
}
|
|
4287
4288
|
await super.completePairing(entry);
|
|
4288
4289
|
}
|
|
@@ -4312,8 +4313,8 @@ class TelegramChannel extends BaseChannel {
|
|
|
4312
4313
|
}
|
|
4313
4314
|
|
|
4314
4315
|
// src/utils/daemonClient.ts
|
|
4315
|
-
import { connect } from "
|
|
4316
|
-
import { join as join5 } from "
|
|
4316
|
+
import { connect } from "net";
|
|
4317
|
+
import { join as join5 } from "path";
|
|
4317
4318
|
var DAEMON_SOCKET_PATH = join5(config.brainboxRoot, "daemon.sock");
|
|
4318
4319
|
async function sendToDaemon(payload) {
|
|
4319
4320
|
logger.debug(`sendToDaemon: command="${payload.command}" args=${JSON.stringify(payload.args) ?? "null"}`);
|
|
@@ -4374,9 +4375,9 @@ function exchangeOnce(payload) {
|
|
|
4374
4375
|
}
|
|
4375
4376
|
|
|
4376
4377
|
// src/commands/daemon.ts
|
|
4377
|
-
import { createServer } from "
|
|
4378
|
-
import { chmodSync, unlinkSync } from "
|
|
4379
|
-
import { join as join6 } from "
|
|
4378
|
+
import { createServer } from "net";
|
|
4379
|
+
import { chmodSync, unlinkSync } from "fs";
|
|
4380
|
+
import { join as join6 } from "path";
|
|
4380
4381
|
|
|
4381
4382
|
// src/commands/daemon/commands.ts
|
|
4382
4383
|
var log8 = logger.child("daemon-cmd");
|
|
@@ -4400,7 +4401,7 @@ async function dispatch(payload) {
|
|
|
4400
4401
|
log8.debug(`dispatch: unknown command "${command}"`);
|
|
4401
4402
|
return { ok: false, error: `unknown command: ${command}` };
|
|
4402
4403
|
}
|
|
4403
|
-
log8.debug(`dispatch: "${command}"
|
|
4404
|
+
log8.debug(`dispatch: "${command}" \u2192 handler (args type=${typeof args})`);
|
|
4404
4405
|
try {
|
|
4405
4406
|
return await entry.handler(args);
|
|
4406
4407
|
} catch (error) {
|
|
@@ -4646,7 +4647,7 @@ async function listBrains() {
|
|
|
4646
4647
|
}
|
|
4647
4648
|
}
|
|
4648
4649
|
async function setActivated(brainId, activated) {
|
|
4649
|
-
logger.debug(`setActivated: id=${brainId}
|
|
4650
|
+
logger.debug(`setActivated: id=${brainId} \u2192 ${activated}`);
|
|
4650
4651
|
const brain = await brainManager.loadBrain(brainId);
|
|
4651
4652
|
if (!brain) {
|
|
4652
4653
|
logger.error(`Brain not found: ${brainId}`);
|
|
@@ -4723,7 +4724,7 @@ async function viewThing(thing, brainId) {
|
|
|
4723
4724
|
args: { thing, brainId }
|
|
4724
4725
|
});
|
|
4725
4726
|
const name = response.result?.displayName ?? brainId;
|
|
4726
|
-
logger.info(`${thing}
|
|
4727
|
+
logger.info(`${thing} \u2014 "${name}" (${brainId})`);
|
|
4727
4728
|
console.log(JSON.stringify(response.result?.value ?? null, null, 2));
|
|
4728
4729
|
}
|
|
4729
4730
|
function register3(program) {
|
|
@@ -5293,7 +5294,7 @@ function ModelApp({
|
|
|
5293
5294
|
children: [
|
|
5294
5295
|
"Known providers: ",
|
|
5295
5296
|
listProviderNames().slice(0, 12).join(", "),
|
|
5296
|
-
"
|
|
5297
|
+
"\u2026"
|
|
5297
5298
|
]
|
|
5298
5299
|
}, undefined, true, undefined, this)
|
|
5299
5300
|
]
|
|
@@ -5511,7 +5512,7 @@ function RawSelect({
|
|
|
5511
5512
|
filtered.length,
|
|
5512
5513
|
"/",
|
|
5513
5514
|
items.length,
|
|
5514
|
-
")
|
|
5515
|
+
") \xB7 \u2191\u2193 \xB7 type to filter \xB7 enter"
|
|
5515
5516
|
]
|
|
5516
5517
|
}, undefined, true, undefined, this),
|
|
5517
5518
|
filtered.length === 0 ? /* @__PURE__ */ jsxDEV4(Text4, {
|
|
@@ -5521,7 +5522,7 @@ function RawSelect({
|
|
|
5521
5522
|
children: [
|
|
5522
5523
|
start > 0 && /* @__PURE__ */ jsxDEV4(Text4, {
|
|
5523
5524
|
dimColor: true,
|
|
5524
|
-
children: "
|
|
5525
|
+
children: " \u2026"
|
|
5525
5526
|
}, undefined, false, undefined, this),
|
|
5526
5527
|
visible.map((item, i) => {
|
|
5527
5528
|
const idx = start + i;
|
|
@@ -5536,7 +5537,7 @@ function RawSelect({
|
|
|
5536
5537
|
}),
|
|
5537
5538
|
start + visible.length < filtered.length && /* @__PURE__ */ jsxDEV4(Text4, {
|
|
5538
5539
|
dimColor: true,
|
|
5539
|
-
children: "
|
|
5540
|
+
children: " \u2026"
|
|
5540
5541
|
}, undefined, false, undefined, this)
|
|
5541
5542
|
]
|
|
5542
5543
|
}, undefined, true, undefined, this)
|
|
@@ -5558,7 +5559,7 @@ function Select(props) {
|
|
|
5558
5559
|
// src/commands/onboard.tsx
|
|
5559
5560
|
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
5560
5561
|
function ok(msg) {
|
|
5561
|
-
console.log(chalk3.green(
|
|
5562
|
+
console.log(chalk3.green(`\u2714 ${msg}`));
|
|
5562
5563
|
}
|
|
5563
5564
|
function info(msg) {
|
|
5564
5565
|
console.log(msg);
|
|
@@ -5583,12 +5584,12 @@ function ProviderApp({
|
|
|
5583
5584
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5584
5585
|
children: [
|
|
5585
5586
|
chalk3.bold("Step 1/4"),
|
|
5586
|
-
"
|
|
5587
|
+
" \u2014 Choose your first provider"
|
|
5587
5588
|
]
|
|
5588
5589
|
}, undefined, true, undefined, this),
|
|
5589
5590
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5590
5591
|
dimColor: true,
|
|
5591
|
-
children: "
|
|
5592
|
+
children: "\u2191\u2193 to move, type to filter, enter to select"
|
|
5592
5593
|
}, undefined, false, undefined, this),
|
|
5593
5594
|
/* @__PURE__ */ jsxDEV5(Select, {
|
|
5594
5595
|
prompt: "provider> ",
|
|
@@ -5613,7 +5614,7 @@ function ProviderApp({
|
|
|
5613
5614
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5614
5615
|
children: [
|
|
5615
5616
|
chalk3.bold("Step 1/4"),
|
|
5616
|
-
"
|
|
5617
|
+
" \u2014 ",
|
|
5617
5618
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5618
5619
|
color: "cyan",
|
|
5619
5620
|
children: stage.provider
|
|
@@ -5667,7 +5668,7 @@ function ProviderApp({
|
|
|
5667
5668
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5668
5669
|
children: [
|
|
5669
5670
|
chalk3.bold("Step 1/4"),
|
|
5670
|
-
"
|
|
5671
|
+
" \u2014 ",
|
|
5671
5672
|
stage.provider,
|
|
5672
5673
|
" extra:",
|
|
5673
5674
|
" ",
|
|
@@ -5713,7 +5714,7 @@ function ModelApp2({
|
|
|
5713
5714
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5714
5715
|
children: [
|
|
5715
5716
|
chalk3.bold("Step 1/4"),
|
|
5716
|
-
"
|
|
5717
|
+
" \u2014 Default model (both slots)"
|
|
5717
5718
|
]
|
|
5718
5719
|
}, undefined, true, undefined, this),
|
|
5719
5720
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
@@ -5727,7 +5728,7 @@ function ModelApp2({
|
|
|
5727
5728
|
"/"
|
|
5728
5729
|
]
|
|
5729
5730
|
}, undefined, true, undefined, this),
|
|
5730
|
-
"model
|
|
5731
|
+
"model \u2014 fine-tune later with ",
|
|
5731
5732
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5732
5733
|
color: "cyan",
|
|
5733
5734
|
children: "brainbox model"
|
|
@@ -5770,7 +5771,7 @@ function SuperMemoryApp({
|
|
|
5770
5771
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5771
5772
|
children: [
|
|
5772
5773
|
chalk3.bold("Step 2/4"),
|
|
5773
|
-
"
|
|
5774
|
+
" \u2014 Supermemory API key"
|
|
5774
5775
|
]
|
|
5775
5776
|
}, undefined, true, undefined, this),
|
|
5776
5777
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
@@ -5809,7 +5810,7 @@ function BrainApp({
|
|
|
5809
5810
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5810
5811
|
children: [
|
|
5811
5812
|
chalk3.bold("Step 3/4"),
|
|
5812
|
-
"
|
|
5813
|
+
" \u2014 Brain name"
|
|
5813
5814
|
]
|
|
5814
5815
|
}, undefined, true, undefined, this),
|
|
5815
5816
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
@@ -5842,7 +5843,7 @@ function BrainApp({
|
|
|
5842
5843
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5843
5844
|
children: [
|
|
5844
5845
|
chalk3.bold("Step 3/4"),
|
|
5845
|
-
"
|
|
5846
|
+
" \u2014 Language for",
|
|
5846
5847
|
" ",
|
|
5847
5848
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5848
5849
|
color: "cyan",
|
|
@@ -5852,7 +5853,7 @@ function BrainApp({
|
|
|
5852
5853
|
}, undefined, true, undefined, this),
|
|
5853
5854
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5854
5855
|
dimColor: true,
|
|
5855
|
-
children: "
|
|
5856
|
+
children: "\u2191\u2193 to move, type to filter, enter to select"
|
|
5856
5857
|
}, undefined, false, undefined, this),
|
|
5857
5858
|
/* @__PURE__ */ jsxDEV5(Select, {
|
|
5858
5859
|
prompt: "language> ",
|
|
@@ -5895,7 +5896,7 @@ function BrainApp({
|
|
|
5895
5896
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5896
5897
|
children: [
|
|
5897
5898
|
chalk3.bold("Step 3/4"),
|
|
5898
|
-
"
|
|
5899
|
+
" \u2014 Seed for",
|
|
5899
5900
|
" ",
|
|
5900
5901
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5901
5902
|
color: "cyan",
|
|
@@ -5918,7 +5919,7 @@ function BrainApp({
|
|
|
5918
5919
|
}, undefined, false, undefined, this),
|
|
5919
5920
|
busy ? /* @__PURE__ */ jsxDEV5(Text5, {
|
|
5920
5921
|
dimColor: true,
|
|
5921
|
-
children: "Creating brain
|
|
5922
|
+
children: "Creating brain\u2026 (This can take few minutes depending on the model's response speed)"
|
|
5922
5923
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV5(TextInput, {
|
|
5923
5924
|
prompt: "seed> ",
|
|
5924
5925
|
onSubmit: (raw) => {
|
|
@@ -5969,7 +5970,7 @@ function ChannelApp({
|
|
|
5969
5970
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5970
5971
|
children: [
|
|
5971
5972
|
chalk3.bold("Step 4/4"),
|
|
5972
|
-
"
|
|
5973
|
+
" \u2014 Channel for",
|
|
5973
5974
|
" ",
|
|
5974
5975
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5975
5976
|
color: "cyan",
|
|
@@ -5979,7 +5980,7 @@ function ChannelApp({
|
|
|
5979
5980
|
}, undefined, true, undefined, this),
|
|
5980
5981
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
5981
5982
|
dimColor: true,
|
|
5982
|
-
children: "
|
|
5983
|
+
children: "\u2191\u2193 to move, type to filter, enter to select"
|
|
5983
5984
|
}, undefined, false, undefined, this),
|
|
5984
5985
|
/* @__PURE__ */ jsxDEV5(Select, {
|
|
5985
5986
|
prompt: "channel> ",
|
|
@@ -6007,7 +6008,7 @@ function ChannelApp({
|
|
|
6007
6008
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
6008
6009
|
children: [
|
|
6009
6010
|
chalk3.bold("Step 4/4"),
|
|
6010
|
-
"
|
|
6011
|
+
" \u2014 ",
|
|
6011
6012
|
stage.kind_,
|
|
6012
6013
|
" bot token"
|
|
6013
6014
|
]
|
|
@@ -6037,7 +6038,7 @@ function ChannelApp({
|
|
|
6037
6038
|
/* @__PURE__ */ jsxDEV5(Text5, {
|
|
6038
6039
|
children: [
|
|
6039
6040
|
chalk3.bold("Step 4/4"),
|
|
6040
|
-
"
|
|
6041
|
+
" \u2014 Optional",
|
|
6041
6042
|
" ",
|
|
6042
6043
|
stage.kind_ === "discord" ? "channelId" : "chatId",
|
|
6043
6044
|
" (blank = pair later)"
|
|
@@ -6078,7 +6079,7 @@ function ChannelApp({
|
|
|
6078
6079
|
};
|
|
6079
6080
|
}
|
|
6080
6081
|
await brainManager.saveBrain(brainId, updated);
|
|
6081
|
-
onDone(`Bound ${displayName}
|
|
6082
|
+
onDone(`Bound ${displayName} \u2192 ${stage.kind_}${target ? ` (${target})` : " (pairing mode)"}`);
|
|
6082
6083
|
})();
|
|
6083
6084
|
}
|
|
6084
6085
|
}, undefined, false, undefined, this),
|
|
@@ -6091,7 +6092,7 @@ function ChannelApp({
|
|
|
6091
6092
|
}
|
|
6092
6093
|
async function runOnboard() {
|
|
6093
6094
|
console.clear();
|
|
6094
|
-
info(`Welcome
|
|
6095
|
+
info(`Welcome \u2014 let's get ${chalk3.bold("brainbox")} ready.`);
|
|
6095
6096
|
const providers = listProviderNames().slice().sort();
|
|
6096
6097
|
const { promise, resolve: resolve2 } = Promise.withResolvers();
|
|
6097
6098
|
const active = { current: null };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@p-sw/brainbox",
|
|
3
|
-
"version": "0.2.3-beta.
|
|
3
|
+
"version": "0.2.3-beta.1",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"cli": "bun run src/index.ts",
|
|
12
12
|
"format": "bun run prettier 'src/**/*.ts' -w",
|
|
13
|
-
"build": "rm -rf dist && bun build ./src/index.ts --outdir dist --target
|
|
13
|
+
"build": "rm -rf dist && bun build ./src/index.ts --outdir dist --target bun --packages external && sed -i '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js && cp -r prompts dist/prompts && chmod +x dist/index.js",
|
|
14
14
|
"prepack": "bun run build"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|