File tree Expand file tree Collapse file tree 4 files changed +40
-16
lines changed Expand file tree Collapse file tree 4 files changed +40
-16
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ grlz 'new version'
13
13
pnpm release
14
14
pnpm update-examples
15
15
```
16
+
16
17
## Testing locally
17
18
18
19
To test the changes locally, you can run the following command:
19
20
20
- - Use an example like the Next.js one
21
+ - Navigate to an example's folder like the Next.js one in ` examples/nextjs ` .
22
+
21
23
- Change the ` package.json ` to point to the local package for ` baseai ` and ` @baseai/core ` packages.
22
24
23
25
``` json
@@ -31,9 +33,26 @@ To test the changes locally, you can run the following command:
31
33
}
32
34
```
33
35
34
- Now run in the root ` pnpm clean-all && pnpm install ` and then run ` pnpm dev ` to start the development server.
36
+ - Now run in the root:
37
+
38
+ ``` bash
39
+ pnpm clean-all && pnpm install
40
+ ```
41
+
42
+ Then run the development server:
43
+
44
+ ``` bash
45
+ pnpm dev
46
+ ```
47
+
48
+ - Run the BaseAI local server from the example's folder without using the @latest flag:
49
+
50
+ ``` bash
51
+ # In examples/nextjs folder
52
+ npx baseai dev
53
+ ```
35
54
36
- By doing this, the Next.js app will use the local packages instead of the published ones.
55
+ By doing this, the Next.js example will use the local packages instead of the published ones.
37
56
38
57
---
39
58
Original file line number Diff line number Diff line change @@ -54,9 +54,8 @@ async function deploy({
54
54
const pipes = await readPipesDirectory ( { spinner, pipesDir } ) ;
55
55
if ( ! pipes ) {
56
56
p . outro (
57
- `No pipes found. Skipping deployment. \nAdd a pipe by running: ${ cyan ( `npx baseai@latest pipe` ) } command`
57
+ `No pipes found. Skipping deployment of pipes . \nAdd a pipe by running: ${ cyan ( `npx baseai@latest pipe` ) } command`
58
58
) ;
59
- process . exit ( 1 ) ;
60
59
}
61
60
62
61
const memoryDir = path . join ( buildDir , 'memory' ) ;
@@ -85,8 +84,7 @@ async function deploy({
85
84
overwrite
86
85
} ) ;
87
86
}
88
-
89
- await deployPipes ( { spinner, pipes, pipesDir, account } ) ;
87
+ if ( pipes ) await deployPipes ( { spinner, pipes, pipesDir, account } ) ;
90
88
91
89
p . outro (
92
90
heading ( { text : 'DEPLOYED' , sub : 'successfully' , green : true } )
@@ -100,7 +98,7 @@ async function deploy({
100
98
101
99
p . log . info (
102
100
`${ dim ( `Successfully deployed:` ) }
103
- ${ dim ( `- ${ green ( pipes ?. length ) } pipe${ pipes . length !== 1 ? 's' : '' }
101
+ ${ dim ( `- ${ green ( pipes ?. length ) } pipe${ pipes ? .length !== 1 ? 's' : '' }
104
102
- ${ green ( tools ?. length ?? 0 ) } tool${ tools ?. length !== 1 ? 's' : '' }
105
103
- ${ green ( memory ?. length ?? 0 ) } memory${ memory ?. length !== 1 ? 'sets' : '' } ` ) } `
106
104
) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const execAsync = promisify(exec);
16
16
17
17
const defaultConfig = {
18
18
name : 'ai-agent-memory' ,
19
- description : 'My list of docs for an AI agent pipe'
19
+ description : 'My list of docs as memory for an AI agent pipe'
20
20
} ;
21
21
22
22
const MEMORY_CONSTANTS = {
@@ -45,7 +45,7 @@ export async function createMemory() {
45
45
} ) ,
46
46
description : ( ) =>
47
47
p . text ( {
48
- message : 'Description of the pipe ' ,
48
+ message : 'Description of the memory ' ,
49
49
placeholder : defaultConfig . description
50
50
} ) ,
51
51
useGitRepo : ( ) =>
@@ -78,6 +78,7 @@ export async function createMemory() {
78
78
memoryFilesDir = ( await p . text ( {
79
79
message :
80
80
'Enter the path to the directory to track (relative to current directory):' ,
81
+ initialValue : '.' ,
81
82
validate : value => {
82
83
if ( ! value . trim ( ) ) {
83
84
return 'The path cannot be empty.' ;
@@ -174,7 +175,7 @@ export default ${memoryNameCamelCase};
174
175
p . outro (
175
176
heading ( {
176
177
text : memoryNameCamelCase ,
177
- sub : `created as a new pipe \n ${ dim ( figures . pointer ) } ${ dimItalic ( ` ${ filePath } ` ) } ` ,
178
+ sub : `created as a new memory \n ${ dim ( figures . pointer ) } ${ dimItalic ( ` ${ filePath } ` ) } ` ,
178
179
green : true
179
180
} )
180
181
) ;
Original file line number Diff line number Diff line change @@ -24,13 +24,19 @@ export async function handleGitSyncMemories({
24
24
25
25
// Check for uncommitted changes
26
26
try {
27
- execSync ( 'git diff-index --quiet HEAD --' ) ;
27
+ const hasChanges = execSync ( 'git status --porcelain' ) . toString ( ) . trim ( ) ;
28
+ if ( hasChanges ) {
29
+ p . log . error (
30
+ `There are uncommitted changes in the Git repository for ${ isEmbed ? 'embedding' : 'deploying' } git-synced memory "${ memoryName } ".`
31
+ ) ;
32
+ p . log . info (
33
+ `Please commit these changes before ${ isEmbed ? 'embedding' : 'deploying' } . Aborting.`
34
+ ) ;
35
+ process . exit ( 1 ) ;
36
+ }
28
37
} catch ( error ) {
29
38
p . log . error (
30
- `There are uncommitted changes in the Git repository for ${ isEmbed ? 'embedding' : 'deploying' } git-synced memory "${ memoryName } ".`
31
- ) ;
32
- p . log . info (
33
- `Please commit these changes before ${ isEmbed ? 'embedding' : 'deploying' } . Aborting.`
39
+ `Failed to check if there are uncommitted changes: ${ error } `
34
40
) ;
35
41
process . exit ( 1 ) ;
36
42
}
You canβt perform that action at this time.
0 commit comments