@andespindola/brainlink 1.5.0 → 1.6.0

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.6.0
4
+
5
+ - **Declarative vault git remote (`vaultRemote`).** New optional config field naming the git remote used to version the vault. When set and `autoVersion` is `true`, Brainlink ensures the vault git repo exists and its `origin` points to that remote before the auto-version push (init + add/update origin, idempotent). When unset, versioning uses whatever `origin` already exists and stays a no-op if there is none — Brainlink never provisions a remote on its own. `autoVersion` still defaults to `false`; inline-credential URLs are rejected.
6
+
3
7
  ## 1.5.0
4
8
 
5
9
  - **Graph shows every node at any zoom.** The viewport stream previously replaced nodes with per-context clusters below a zoom threshold, so nodes vanished when you zoomed out and reappeared on approach. Graphs that fit a cap (6000 nodes) now render every node in near mode at all zoom levels; larger graphs keep the far/mid/near level-of-detail.
package/README.md CHANGED
@@ -1156,6 +1156,8 @@ If no `vault` is configured and no `--vault` flag is passed, Brainlink uses `$HO
1156
1156
  "defaultAgent": "shared",
1157
1157
  "autoIndexOnWrite": true,
1158
1158
  "autoCanonicalContextLinks": true,
1159
+ "autoVersion": false,
1160
+ "vaultRemote": "git@github.com:you/brainlink-vault.git",
1159
1161
  "autoUpdateCheck": true,
1160
1162
  "updateCheckIntervalMs": 86400000,
1161
1163
  "defaultSearchLimit": 8,
@@ -1190,6 +1192,7 @@ If no `vault` is configured and no `--vault` flag is passed, Brainlink uses `$HO
1190
1192
 
1191
1193
  `autoIndexOnWrite` is optional and defaults to `true`. Set it to `false` to defer indexing after writes.
1192
1194
  `autoVersion` is optional and defaults to `false`. When enabled (e.g. by `blink vault-provision` / `brainlink_vault_provision`), a successful index that changed Markdown commits and pushes the vault to its git remote automatically, best-effort — a git or network failure is logged and never breaks indexing. It is a no-op unless the vault is a git repo with an `origin` remote.
1195
+ `vaultRemote` is optional. When set and `autoVersion` is `true`, Brainlink ensures the vault git repo exists and its `origin` points to this remote before pushing (initializing the repo and adding/updating `origin` as needed). When it is unset, versioning uses whatever `origin` the vault git repo already has, and stays a no-op if there is none — Brainlink never provisions a remote on its own. Inline-credential URLs (e.g. `https://user:token@…`) are rejected; use SSH or a git credential helper.
1193
1196
  `vaultEncryption` is optional and defaults to `false`. When enabled, vault versioning commits AES-256-GCM ciphertext (`<note>.md.enc`) and git-ignores the plaintext Markdown, so the repository is opaque to anyone without the key — only a Brainlink instance holding the per-vault key can decrypt it. The key lives at `$BRAINLINK_HOME/keys/vault-versioning-<hash>.key` (outside the vault, never committed) or can be supplied via `BRAINLINK_VAULT_KEY` to restore an encrypted vault on another machine. Pull, restore and clone decrypt back to Markdown before reindexing; encryption is deterministic per note, so unchanged notes add no git churn. `blink vault-provision` enables this by default.
1194
1197
  `autoCanonicalContextLinks` is optional and defaults to `true`. When enabled, `blink add`, `brainlink_add_note` and `brainlink_add_file` add a canonical `## Context Links` entry to the inferred context hub, creating that hub when needed.
1195
1198
  `autoUpdateCheck` is optional and defaults to `true`. Brainlink checks the npm registry no more often than `updateCheckIntervalMs` and prints an update notice to `stderr`; it never installs updates automatically.
@@ -5,7 +5,7 @@ import { ensureVault, readMarkdownFileSummaries } from '../infrastructure/file-s
5
5
  import { readIndexState, writeIndexState } from '../infrastructure/index-state.js';
6
6
  import { ensureSearchPackManifest } from '../infrastructure/search-packs.js';
7
7
  import { openKnowledgeStore } from '../infrastructure/knowledge-store/index.js';
8
- import { autoVersionVault } from './vault-git-core.js';
8
+ import { autoVersionVault, initVaultGit } from './vault-git-core.js';
9
9
  import { assembleIndexedDocuments, createTitleMaps, decidePackRebuild, detectChanges, embedChangedDocuments, rebuildSearchPacksIfNeeded } from './index-vault-phases.js';
10
10
  const toIndexResult = (documents) => ({
11
11
  documentCount: documents.length,
@@ -177,6 +177,12 @@ export const indexVaultWithOptions = async (vaultPath, options) => {
177
177
  // origin remote — commitVault itself skips when nothing is staged.
178
178
  if (config.autoVersion && changedDocumentsByPath.size > 0) {
179
179
  try {
180
+ // When a remote is configured, ensure the vault git repo exists and its
181
+ // origin points there before pushing. Without it, autoVersionVault falls
182
+ // back to whatever origin already exists (no-op if none).
183
+ if (config.vaultRemote) {
184
+ await initVaultGit(absoluteVaultPath, { remote: config.vaultRemote });
185
+ }
180
186
  await autoVersionVault(absoluteVaultPath, `chore(vault): update ${new Date().toISOString()}`);
181
187
  }
182
188
  catch (error) {
@@ -16,6 +16,7 @@ export const defaultBrainlinkConfig = {
16
16
  autoIndexOnWrite: true,
17
17
  autoCanonicalContextLinks: true,
18
18
  autoVersion: false,
19
+ vaultRemote: undefined,
19
20
  vaultEncryption: false,
20
21
  autoUpdateCheck: true,
21
22
  updateCheckIntervalMs: 86_400_000,
@@ -218,6 +219,9 @@ const sanitizeConfig = (value) => ({
218
219
  ? value.autoCanonicalContextLinks
219
220
  : defaultBrainlinkConfig.autoCanonicalContextLinks,
220
221
  autoVersion: typeof value.autoVersion === 'boolean' ? value.autoVersion : defaultBrainlinkConfig.autoVersion,
222
+ vaultRemote: typeof value.vaultRemote === 'string' && value.vaultRemote.trim().length > 0
223
+ ? value.vaultRemote.trim()
224
+ : defaultBrainlinkConfig.vaultRemote,
221
225
  vaultEncryption: typeof value.vaultEncryption === 'boolean' ? value.vaultEncryption : defaultBrainlinkConfig.vaultEncryption,
222
226
  autoUpdateCheck: typeof value.autoUpdateCheck === 'boolean' ? value.autoUpdateCheck : defaultBrainlinkConfig.autoUpdateCheck,
223
227
  updateCheckIntervalMs: typeof value.updateCheckIntervalMs === 'number' && Number.isFinite(value.updateCheckIntervalMs) && value.updateCheckIntervalMs > 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andespindola/brainlink",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Local-first knowledge memory for agents with Markdown, backlinks, indexing and context retrieval.",
5
5
  "type": "module",
6
6
  "license": "MIT",