@soulcraft/brainy 5.3.1 → 5.3.2

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.
@@ -221,9 +221,20 @@ export class BaseStorage extends BaseStorageAdapter {
221
221
  // Check if main branch exists, create if not
222
222
  const mainRef = await this.refManager.getRef('main');
223
223
  if (!mainRef) {
224
- // Create initial commit (empty tree)
224
+ // Create initial commit with empty tree
225
225
  const emptyTreeHash = '0000000000000000000000000000000000000000000000000000000000000000';
226
- await this.refManager.createBranch('main', emptyTreeHash, {
226
+ // Import CommitBuilder
227
+ const { CommitBuilder } = await import('./cow/CommitObject.js');
228
+ // Create initial commit object
229
+ const initialCommitHash = await CommitBuilder.create(this.blobStorage)
230
+ .tree(emptyTreeHash)
231
+ .parent(null)
232
+ .message('Initial commit')
233
+ .author('system')
234
+ .timestamp(Date.now())
235
+ .build();
236
+ // Create main branch pointing to initial commit
237
+ await this.refManager.createBranch('main', initialCommitHash, {
227
238
  description: 'Initial branch',
228
239
  author: 'system'
229
240
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "5.3.1",
3
+ "version": "5.3.2",
4
4
  "description": "Universal Knowledge Protocol™ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. 31 nouns × 40 verbs for infinite expressiveness.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",