@hazeljs/cli 0.5.3 → 0.5.4

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazeljs-ai-native-app",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "A HazelJS AI-native application with agents, RAG, and chat",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -11,12 +11,12 @@ datasource db {
11
11
  }
12
12
 
13
13
  model Document {
14
- id String @id @default(cuid())
14
+ id String @id @default(cuid())
15
15
  content String
16
16
  metadata Json?
17
- embedding Float[] // Vector embedding for RAG
18
- createdAt DateTime @default(now())
19
- updatedAt DateTime @updatedAt
17
+ embedding Unsupported("vector(1536)") // pgvector type for embeddings
18
+ createdAt DateTime @default(now())
19
+ updatedAt DateTime @updatedAt
20
20
 
21
21
  @@map("documents")
22
22
  // Vector indexes will be created by Prisma when pgvector extension is available
@@ -67,14 +67,18 @@ async function main() {
67
67
  // Generate embedding for the document
68
68
  const embedding = await embeddings.embed(doc.content);
69
69
 
70
- // Create document with embedding
71
- await prisma.document.create({
72
- data: {
73
- content: doc.content,
74
- metadata: doc.metadata,
75
- embedding: embedding,
76
- },
77
- });
70
+ // Use raw SQL to insert document with vector embedding
71
+ await prisma.$executeRaw`
72
+ INSERT INTO documents (id, content, metadata, embedding, "createdAt", "updatedAt")
73
+ VALUES (
74
+ gen_random_uuid()::text,
75
+ ${doc.content},
76
+ ${JSON.stringify(doc.metadata)}::jsonb,
77
+ ${embedding}::vector,
78
+ NOW(),
79
+ NOW()
80
+ )
81
+ `;
78
82
 
79
83
  console.log(`✅ Created document: ${doc.metadata.source}`);
80
84
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hazeljs/cli",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Command-line interface for scaffolding and generating HazelJS applications and components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -70,5 +70,5 @@
70
70
  "type": "opencollective",
71
71
  "url": "https://opencollective.com/hazeljs"
72
72
  },
73
- "gitHead": "dd6ca4e3f2221c07b3b2c80c649ae8018b9c2526"
73
+ "gitHead": "92397b089e9afd5b985f10c365861891dcd700b8"
74
74
  }