@p-sw/brainbox 0.1.2-alpha.5 → 0.1.2-alpha.6

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -295,7 +295,7 @@ function removeProviderAuth(provider) {
295
295
  // src/config/index.ts
296
296
  var config = {
297
297
  get debug() {
298
- return readRootFile().debug;
298
+ return process.env.DEBUG_MODE ? process.env.DEBUG_MODE.toLowerCase() === "true" : readRootFile().debug;
299
299
  },
300
300
  brainboxRoot,
301
301
  get supermemoryApiKey() {
@@ -2567,13 +2567,13 @@ class Brain {
2567
2567
  db;
2568
2568
  space;
2569
2569
  brainbase;
2570
- memory;
2571
2570
  availabilityCache = new Map;
2572
- constructor(db, space, brainbase, memory = new Memory(this.db, this.space)) {
2571
+ memory;
2572
+ constructor(db, space, brainbase, memory) {
2573
2573
  this.db = db;
2574
2574
  this.space = space;
2575
2575
  this.brainbase = brainbase;
2576
- this.memory = memory;
2576
+ this.memory = memory ?? new Memory(this.db, this.space);
2577
2577
  log7.debug(`Brain constructed: id=${brainbase.brainId} name=${brainbase.displayName} space=${space.name}`);
2578
2578
  }
2579
2579
  async createDailySchedule(datetime) {
@@ -4342,6 +4342,9 @@ function RawInput({
4342
4342
  onSubmit
4343
4343
  }) {
4344
4344
  const [value, setValue] = useState(initialValue);
4345
+ useEffect(() => {
4346
+ setValue(initialValue);
4347
+ }, [prompt, initialValue]);
4345
4348
  useInput((input, key) => {
4346
4349
  if (key.return) {
4347
4350
  onSubmit(value);
@@ -5199,7 +5202,7 @@ function ModelApp2({
5199
5202
  /* @__PURE__ */ jsxDEV5(Text5, {
5200
5203
  dimColor: true,
5201
5204
  children: [
5202
- "e.g. ",
5205
+ "model name, or ",
5203
5206
  /* @__PURE__ */ jsxDEV5(Text5, {
5204
5207
  color: "cyan",
5205
5208
  children: [
@@ -5207,7 +5210,7 @@ function ModelApp2({
5207
5210
  "/"
5208
5211
  ]
5209
5212
  }, undefined, true, undefined, this),
5210
- "model-name — fine-tune later with ",
5213
+ "model — fine-tune later with ",
5211
5214
  /* @__PURE__ */ jsxDEV5(Text5, {
5212
5215
  color: "cyan",
5213
5216
  children: "brainbox model"
@@ -5222,13 +5225,15 @@ function ModelApp2({
5222
5225
  setError("Model cannot be empty");
5223
5226
  return;
5224
5227
  }
5225
- if (!value.startsWith(`${provider}/`)) {
5226
- setError(`Must start with "${provider}/"`);
5228
+ const prefix = `${provider}/`;
5229
+ const full = value.startsWith(prefix) ? value : `${prefix}${value}`;
5230
+ if (full === prefix) {
5231
+ setError("Model cannot be empty");
5227
5232
  return;
5228
5233
  }
5229
- setModelSlot("identity", value);
5230
- setModelSlot("conversation", value);
5231
- onDone(value);
5234
+ setModelSlot("identity", full);
5235
+ setModelSlot("conversation", full);
5236
+ onDone(full);
5232
5237
  }
5233
5238
  }, undefined, false, undefined, this),
5234
5239
  error && /* @__PURE__ */ jsxDEV5(Text5, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@p-sw/brainbox",
3
- "version": "0.1.2-alpha.5",
3
+ "version": "0.1.2-alpha.6",
4
4
  "module": "dist/index.js",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",