create-bubblelab-app 0.1.13 → 0.1.15
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-bubblelab-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Create BubbleLab AI agent applications with one command",
|
|
@@ -31,6 +31,20 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^20.12.12",
|
|
34
|
-
"@types/prompts": "^2.4.9"
|
|
34
|
+
"@types/prompts": "^2.4.9",
|
|
35
|
+
"@vitest/ui": "^3.2.4",
|
|
36
|
+
"dotenv": "^16.4.5",
|
|
37
|
+
"tsx": "^4.20.3",
|
|
38
|
+
"typescript": "^5.8.3",
|
|
39
|
+
"vitest": "^3.2.4",
|
|
40
|
+
"@bubblelab/bubble-core": "0.1.11",
|
|
41
|
+
"@bubblelab/shared-schemas": "0.1.11",
|
|
42
|
+
"@bubblelab/ts-scope-manager": "0.1.11",
|
|
43
|
+
"@bubblelab/bubble-runtime": "0.1.15"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"test:watch": "vitest",
|
|
48
|
+
"test:coverage": "vitest run --coverage"
|
|
35
49
|
}
|
|
36
50
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { BubbleRunner } from '@bubblelab/bubble-runtime';
|
|
13
|
-
import { BubbleFactory } from '@bubblelab/bubble-core';
|
|
13
|
+
import { BubbleFactory, LogLevel } from '@bubblelab/bubble-core';
|
|
14
14
|
import { readFileSync } from 'fs';
|
|
15
15
|
import { fileURLToPath } from 'url';
|
|
16
16
|
import { dirname, join } from 'path';
|
|
@@ -34,14 +34,21 @@ async function main() {
|
|
|
34
34
|
const flowCode = readFileSync(join(__dirname, 'weather-flow.ts'), 'utf-8');
|
|
35
35
|
|
|
36
36
|
// Step 3: Create a BubbleRunner with your flow code
|
|
37
|
-
const runner = new BubbleRunner(flowCode, bubbleFactory
|
|
37
|
+
const runner = new BubbleRunner(flowCode, bubbleFactory, {
|
|
38
|
+
pricingTable: {},
|
|
39
|
+
useWebhookLogger: true,
|
|
40
|
+
logLevel: LogLevel.INFO,
|
|
41
|
+
streamCallback: (event) => {
|
|
42
|
+
console.log('🔥 Streaming log event:', event);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
38
45
|
|
|
39
46
|
// Step 4: (Optional) Modify bubble parameters dynamically
|
|
40
47
|
const bubbles = runner.getParsedBubbles();
|
|
41
48
|
const bubbleIds = Object.keys(bubbles).map(Number);
|
|
49
|
+
const city = process.env.CITY || 'New York';
|
|
42
50
|
|
|
43
51
|
if (bubbleIds.length > 0) {
|
|
44
|
-
const city = process.env.CITY || 'New York';
|
|
45
52
|
console.log(`🌍 Researching weather for: ${city}\n`);
|
|
46
53
|
|
|
47
54
|
runner.injector.changeBubbleParameters(
|
|
@@ -51,14 +58,14 @@ async function main() {
|
|
|
51
58
|
);
|
|
52
59
|
}
|
|
53
60
|
// Inject the credentials
|
|
54
|
-
runner.injector.injectCredentials(
|
|
61
|
+
runner.injector.injectCredentials([], {
|
|
55
62
|
[CredentialType.GOOGLE_GEMINI_CRED]: process.env.GOOGLE_API_KEY,
|
|
56
63
|
[CredentialType.FIRECRAWL_API_KEY]: process.env.FIRECRAWL_API_KEY,
|
|
57
64
|
});
|
|
58
65
|
|
|
59
66
|
// Step 5: Execute the flow
|
|
60
67
|
console.log('🤖 Running AI agent...\n');
|
|
61
|
-
const result = await runner.runAll();
|
|
68
|
+
const result = await runner.runAll({ city: city });
|
|
62
69
|
|
|
63
70
|
// Step 6: Display results
|
|
64
71
|
console.log('📊 Results:');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BubbleRunner } from '@bubblelab/bubble-runtime';
|
|
2
|
-
import { BubbleFactory } from '@bubblelab/bubble-core';
|
|
2
|
+
import { BubbleFactory, LogLevel } from '@bubblelab/bubble-core';
|
|
3
3
|
import { readFileSync } from 'fs';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { dirname, join } from 'path';
|
|
@@ -22,13 +22,20 @@ async function main() {
|
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
// Step 3: Create a BubbleRunner with your flow code
|
|
25
|
-
const runner = new BubbleRunner(flowCode, bubbleFactory
|
|
25
|
+
const runner = new BubbleRunner(flowCode, bubbleFactory, {
|
|
26
|
+
pricingTable: {},
|
|
27
|
+
useWebhookLogger: true,
|
|
28
|
+
logLevel: LogLevel.INFO,
|
|
29
|
+
streamCallback: (event) => {
|
|
30
|
+
console.log('🔥 Streaming log event:', event);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
26
33
|
// Step 4: (Optional) Modify bubble parameters dynamically
|
|
27
34
|
const subreddit = 'worldnews';
|
|
28
35
|
const limit = 10;
|
|
29
36
|
|
|
30
37
|
// Step 5: Set the credentials
|
|
31
|
-
runner.injector.injectCredentials(
|
|
38
|
+
runner.injector.injectCredentials([], {
|
|
32
39
|
[CredentialType.GOOGLE_GEMINI_CRED]: process.env.GOOGLE_API_KEY,
|
|
33
40
|
});
|
|
34
41
|
|