getzero11 commited on
Commit
0b04989
·
verified ·
1 Parent(s): db3a10c

Create src/index.js

Browse files
Files changed (1) hide show
  1. src/index.js +33 -0
src/index.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { marketResearchAgent } from "./marketResearchAgent.js";
2
+
3
+ function readStdin() {
4
+ return new Promise(resolve => {
5
+ let data = "";
6
+ process.stdin.on("data", chunk => data += chunk);
7
+ process.stdin.on("end", () => resolve(data));
8
+ });
9
+ }
10
+
11
+ (async () => {
12
+ try {
13
+ const input = JSON.parse(await readStdin());
14
+
15
+ const result = await marketResearchAgent({
16
+ input,
17
+ provider: process.env.OPENCLAW_PROVIDER,
18
+ model: process.env.OPENCLAW_MODEL
19
+ });
20
+
21
+ // CRITICAL: JSON ONLY
22
+ console.log(JSON.stringify(result));
23
+ } catch (e) {
24
+ console.log(JSON.stringify({
25
+ meta: {
26
+ status: "failed",
27
+ error: e.message
28
+ },
29
+ dashboard_view: {},
30
+ report_view: {}
31
+ }));
32
+ }
33
+ })();