brainjar 0.3.1232 → 0.3.1234

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/brainjar.js +24 -1
  2. package/package.json +1 -1
package/brainjar.js CHANGED
@@ -107,7 +107,7 @@ var CLI_VERSION, CACHE, DAY;
107
107
  var init_version_check = __esm({
108
108
  "packages/cli/src/version-check.ts"() {
109
109
  "use strict";
110
- CLI_VERSION = "0.3.1232";
110
+ CLI_VERSION = "0.3.1234";
111
111
  CACHE = path.join(os.homedir(), ".brainjar", "version-check.json");
112
112
  DAY = 864e5;
113
113
  }
@@ -6565,6 +6565,11 @@ MCowBQYDK2VwAyEAKOUWx/Qgav+dKg78fIlckGby22CRKeuMWR5tkT1rYuw=
6565
6565
 
6566
6566
  // packages/db/src/plan.ts
6567
6567
  import { createPublicKey, sign, verify } from "node:crypto";
6568
+ function planLimits(plan, seats = 0) {
6569
+ if (plan === "pro") return { brains: Infinity, people: 10 };
6570
+ if (plan === "company") return { brains: Infinity, people: seats };
6571
+ return { brains: 1, people: 3 };
6572
+ }
6568
6573
  var trustedKeys, RENEW_AFTER_MS, PAID_STATUSES;
6569
6574
  var init_plan = __esm({
6570
6575
  "packages/db/src/plan.ts"() {
@@ -6580,6 +6585,18 @@ var init_plan = __esm({
6580
6585
  }
6581
6586
  });
6582
6587
 
6588
+ // packages/db/src/dormancy.ts
6589
+ var FREE;
6590
+ var init_dormancy = __esm({
6591
+ "packages/db/src/dormancy.ts"() {
6592
+ "use strict";
6593
+ init_src();
6594
+ init_pool();
6595
+ init_plan();
6596
+ FREE = planLimits("free");
6597
+ }
6598
+ });
6599
+
6583
6600
  // packages/db/src/repository.ts
6584
6601
  async function getBrain(id, pool2 = getPool()) {
6585
6602
  return (await pool2.query("SELECT * FROM brain WHERE id = $1", [id])).rows[0] ?? null;
@@ -6596,6 +6613,7 @@ var init_repository = __esm({
6596
6613
  init_audit_origin();
6597
6614
  init_vector();
6598
6615
  init_plan();
6616
+ init_dormancy();
6599
6617
  MO_COLUMNS = "id, brain_id, type, title, body, why, status, confidence, version, created_by, verified_by, created_at, occurred_at, updated_at, last_verified_at";
6600
6618
  MO_COLUMNS_MO = MO_COLUMNS.split(", ").map((c) => `mo.${c}`).join(", ");
6601
6619
  evAgg = (ref) => `(SELECT count(*)::int FROM evidence_link ev WHERE ev.memory_object_id = ${ref}.id) AS evidence_count, (SELECT bool_or(ev.artifact_uri IS NOT NULL AND ev.artifact_uri <> '') FROM evidence_link ev WHERE ev.memory_object_id = ${ref}.id) AS evidence_uri`;
@@ -7989,6 +8007,7 @@ var init_auth = __esm({
7989
8007
  init_src();
7990
8008
  init_pool();
7991
8009
  init_plan();
8010
+ init_dormancy();
7992
8011
  init_ratelimit();
7993
8012
  init_auth_event();
7994
8013
  init_email_token();
@@ -8059,6 +8078,7 @@ var init_team = __esm({
8059
8078
  init_pool();
8060
8079
  init_auth();
8061
8080
  init_plan();
8081
+ init_dormancy();
8062
8082
  }
8063
8083
  });
8064
8084
 
@@ -8069,6 +8089,7 @@ var init_rbac = __esm({
8069
8089
  init_pool();
8070
8090
  init_repository();
8071
8091
  init_team();
8092
+ init_dormancy();
8072
8093
  }
8073
8094
  });
8074
8095
 
@@ -8308,6 +8329,7 @@ var init_billing = __esm({
8308
8329
  init_pool();
8309
8330
  init_settings();
8310
8331
  init_plan();
8332
+ init_dormancy();
8311
8333
  isPaid = (status) => PAID_STATUSES.includes(status);
8312
8334
  }
8313
8335
  });
@@ -8437,6 +8459,7 @@ var init_src2 = __esm({
8437
8459
  init_spend();
8438
8460
  init_plan();
8439
8461
  init_billing();
8462
+ init_dormancy();
8440
8463
  init_provider_rate();
8441
8464
  init_ruleset();
8442
8465
  init_usage();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainjar",
3
- "version": "0.3.1232",
3
+ "version": "0.3.1234",
4
4
  "description": "BrainJar CLI: turn a repository into a live, self-documenting Brain.",
5
5
  "type": "module",
6
6
  "bin": {