blokctl 0.6.5 → 0.6.7

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.
@@ -17,7 +17,7 @@ const exec = util.promisify(child_process.exec);
17
17
  const HOME_DIR = `${os.homedir()}/.blok`;
18
18
  const GITHUB_REPO_LOCAL = `${HOME_DIR}/blok`;
19
19
  const GITHUB_REPO_REMOTE = "https://github.com/well-prado/blok.git";
20
- const GITHUB_REPO_RELEASE_TAG = "v0.6.5";
20
+ const GITHUB_REPO_RELEASE_TAG = "v0.6.7";
21
21
  fsExtra.ensureDirSync(HOME_DIR);
22
22
  const options = {
23
23
  baseDir: HOME_DIR,
@@ -403,6 +403,12 @@ export async function createProject(opts, version, currentPath = false, localRep
403
403
  fsExtra.copySync(triggerNodesDir, `${dirPath}/src/nodes`);
404
404
  }
405
405
  }
406
+ if (examples && !selectedTriggers.includes("http")) {
407
+ const httpNodesDir = `${repoSource}/triggers/http/src/nodes`;
408
+ if (fsExtra.existsSync(httpNodesDir)) {
409
+ fsExtra.copySync(httpNodesDir, `${dirPath}/src/nodes`);
410
+ }
411
+ }
406
412
  if (!skipPrompts) {
407
413
  s.message("Installing example workflows and nodes");
408
414
  }
@@ -437,7 +443,13 @@ export async function createProject(opts, version, currentPath = false, localRep
437
443
  fsExtra.ensureDirSync(`${dirPath}/infra/milvus`);
438
444
  fsExtra.copySync(`${repoSource}/infra/development`, `${dirPath}/infra/postgresql`);
439
445
  fsExtra.copySync(`${repoSource}/infra/milvus`, `${dirPath}/infra/milvus`);
440
- fsExtra.writeFileSync(`${dirPath}/src/Nodes.ts`, node_file);
446
+ const needsHelpers = selectedTriggers.includes("sse") || selectedTriggers.includes("websocket");
447
+ const examplesNodesContent = needsHelpers
448
+ ? node_file
449
+ .replace(`import type { NodeBase } from "@blokjs/shared";`, `import type { NodeBase } from "@blokjs/shared";\nimport { HELPER_NODES } from "@blokjs/helpers";`)
450
+ .replace(`} = {\n\t"@blokjs/api-call": ApiCall,`, `} = {\n\t...HELPER_NODES,\n\t"@blokjs/api-call": ApiCall,`)
451
+ : node_file;
452
+ fsExtra.writeFileSync(`${dirPath}/src/Nodes.ts`, examplesNodesContent);
441
453
  fsExtra.copySync(`${repoSource}/sdk`, `${dirPath}/public/sdk`);
442
454
  }
443
455
  const envExample = `${dirPath}/.env.example`;
@@ -466,7 +478,7 @@ export async function createProject(opts, version, currentPath = false, localRep
466
478
  "@blokjs/trigger-websocket": "triggers/websocket",
467
479
  "@blokjs/trigger-worker": "triggers/worker",
468
480
  };
469
- const BLOKJS_DEP_RANGE = "^0.6.5";
481
+ const BLOKJS_DEP_RANGE = "^0.6.7";
470
482
  for (const depGroup of ["dependencies", "devDependencies", "peerDependencies"]) {
471
483
  const deps = packageJsonContent[depGroup];
472
484
  if (!deps)
@@ -622,6 +634,16 @@ export async function createProject(opts, version, currentPath = false, localRep
622
634
  if (providerEnvVars) {
623
635
  fsExtra.appendFileSync(envLocal, providerEnvVars);
624
636
  }
637
+ if (examples) {
638
+ const chatEnvBlock = [
639
+ "",
640
+ "# Chat demo (--examples) — get a free OpenRouter key at https://openrouter.ai/keys",
641
+ "OPENROUTER_API_KEY=",
642
+ "OPENROUTER_MODEL=openai/gpt-4o-mini",
643
+ "",
644
+ ].join("\n");
645
+ fsExtra.appendFileSync(envLocal, chatEnvBlock);
646
+ }
625
647
  if (examples) {
626
648
  packageJsonContent.dependencies = {
627
649
  ...packageJsonContent.dependencies,
@@ -5,6 +5,7 @@ declare const package_dependencies: {
5
5
  ejs: string;
6
6
  pg: string;
7
7
  mongodb: string;
8
+ openai: string;
8
9
  };
9
10
  declare const package_dev_dependencies: {
10
11
  "@types/ejs": string;
@@ -25,6 +25,7 @@ const package_dependencies = {
25
25
  ejs: "^3.1.10",
26
26
  pg: "^8.13.3",
27
27
  mongodb: "^6.14.2",
28
+ openai: "^4.77.0",
28
29
  };
29
30
  const package_dev_dependencies = {
30
31
  "@types/ejs": "^3.1.5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blokctl",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "author": "Deskree Technologies Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "description": "cli for blok",
@@ -30,7 +30,7 @@
30
30
  "keywords": ["blokctl", "cli", "blok", "blok"],
31
31
  "dependencies": {
32
32
  "@ai-sdk/openai": "^1.3.22",
33
- "@blokjs/runner": "^0.6.5",
33
+ "@blokjs/runner": "^0.6.7",
34
34
  "@clack/prompts": "^1.0.0",
35
35
  "ai": "^4.3.16",
36
36
  "better-sqlite3": "^12.6.2",