blokctl 0.6.6 → 0.6.8

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.6";
20
+ const GITHUB_REPO_RELEASE_TAG = "v0.6.8";
21
21
  fsExtra.ensureDirSync(HOME_DIR);
22
22
  const options = {
23
23
  baseDir: HOME_DIR,
@@ -478,7 +478,7 @@ export async function createProject(opts, version, currentPath = false, localRep
478
478
  "@blokjs/trigger-websocket": "triggers/websocket",
479
479
  "@blokjs/trigger-worker": "triggers/worker",
480
480
  };
481
- const BLOKJS_DEP_RANGE = "^0.6.6";
481
+ const BLOKJS_DEP_RANGE = "^0.6.8";
482
482
  for (const depGroup of ["dependencies", "devDependencies", "peerDependencies"]) {
483
483
  const deps = packageJsonContent[depGroup];
484
484
  if (!deps)
@@ -634,6 +634,16 @@ export async function createProject(opts, version, currentPath = false, localRep
634
634
  if (providerEnvVars) {
635
635
  fsExtra.appendFileSync(envLocal, providerEnvVars);
636
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
+ }
637
647
  if (examples) {
638
648
  packageJsonContent.dependencies = {
639
649
  ...packageJsonContent.dependencies,
@@ -5,13 +5,15 @@ declare const package_dependencies: {
5
5
  ejs: string;
6
6
  pg: string;
7
7
  mongodb: string;
8
+ openai: string;
9
+ ioredis: string;
8
10
  };
9
11
  declare const package_dev_dependencies: {
10
12
  "@types/ejs": string;
11
13
  "@types/pg": string;
12
14
  };
13
15
  declare const python3_file = "\nfrom core.blok import BlokService\nfrom core.types.context import Context\nfrom core.types.blok_response import BlokResponse\nfrom core.types.global_error import GlobalError\nfrom typing import Any, Dict\nimport traceback\n\nclass Node(BlokService):\n def __init__(self):\n BlokService.__init__(self)\n self.input_schema = {}\n self.output_schema = {}\n\n async def handle(self, ctx: Context, inputs: Dict[str, Any]) -> BlokResponse:\n response = BlokResponse()\n\n try:\n response.setSuccess({ \"message\": \"Hello World from Python3!\" })\n except Exception as error:\n err = GlobalError(error)\n err.setCode(500)\n err.setName(self.name)\n\n stack_trace = traceback.format_exc()\n err.setStack(stack_trace)\n response.success = False\n response.setError(err)\n\n return response\n";
14
- declare const examples_url = "\nExamples:\n1- Open \"workflow-docs.json\" in your browser at http://localhost:4000/workflow-docs\n2- Open \"db-manager.json\" in your browser at http://localhost:4000/db-manager\n3- Open \"dashboard-gen.json\" in your browser at http://localhost:4000/dashboard-gen\n4- Open \"countries.json\" in your browser at http://localhost:4000/countries\n\nFor more documentation, visit src/nodes/examples/README.md. The first three examples require a PostgreSQL database to function.\n";
16
+ declare const examples_url = "\nExamples:\n1- Open \"workflow-docs.json\" in your browser at http://localhost:4000/workflow-docs\n2- Open \"db-manager.json\" in your browser at http://localhost:4000/db-manager\n3- Open \"dashboard-gen.json\" in your browser at http://localhost:4000/dashboard-gen\n4- Open \"countries.json\" in your browser at http://localhost:4000/countries\n5- Open \"chat.json\" in your browser at http://localhost:4000/chat (set OPENROUTER_API_KEY first)\n6- Open \"chat-memory.json\" in your browser at http://localhost:4000/chat-memory (needs OPENROUTER_API_KEY + Redis at REDIS_URL)\n\nFor more documentation, visit src/nodes/examples/README.md. The first three examples require a PostgreSQL database to function.\n";
15
17
  declare const workflow_template = "\n{\n\t\"name\": \"My Workflow\",\n\t\"description\": \"What this workflow does\",\n\t\"version\": \"1.0.0\",\n\t\"trigger\": {\n\t\t\"http\": {\n\t\t\t\"method\": \"GET\",\n\t\t\t\"accept\": \"application/json\"\n\t\t}\n\t},\n\t\"steps\": [\n\t\t{\n\t\t\t\"id\": \"echo\",\n\t\t\t\"use\": \"@blokjs/respond\",\n\t\t\t\"inputs\": {\n\t\t\t\t\"body\": \"$.req.body\"\n\t\t\t}\n\t\t}\n\t]\n}\n";
16
18
  declare const supervisord_nodejs = "\n[supervisord]\nnodaemon=true\n\n[program:nodejs_app]\ncommand=npm start\ndirectory=/app\nautostart=true\nautorestart=true\nstderr_logfile=/var/log/nodejs.err.log\nstdout_logfile=/var/log/nodejs.out.log\n";
17
19
  declare const supervisord_python = "\n[program:python_app]\ncommand=python3 /app/.blok/runtimes/python3/server.py\ndirectory=/app\nautostart=true\nautorestart=true\nstderr_logfile=/var/log/python.err.log\nstdout_logfile=/var/log/python.out.log\n";
@@ -25,6 +25,8 @@ 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",
29
+ ioredis: "^5.10.1",
28
30
  };
29
31
  const package_dev_dependencies = {
30
32
  "@types/ejs": "^3.1.5",
@@ -67,6 +69,8 @@ Examples:
67
69
  2- Open "db-manager.json" in your browser at http://localhost:4000/db-manager
68
70
  3- Open "dashboard-gen.json" in your browser at http://localhost:4000/dashboard-gen
69
71
  4- Open "countries.json" in your browser at http://localhost:4000/countries
72
+ 5- Open "chat.json" in your browser at http://localhost:4000/chat (set OPENROUTER_API_KEY first)
73
+ 6- Open "chat-memory.json" in your browser at http://localhost:4000/chat-memory (needs OPENROUTER_API_KEY + Redis at REDIS_URL)
70
74
 
71
75
  For more documentation, visit src/nodes/examples/README.md. The first three examples require a PostgreSQL database to function.
72
76
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blokctl",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
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.6",
33
+ "@blokjs/runner": "^0.6.8",
34
34
  "@clack/prompts": "^1.0.0",
35
35
  "ai": "^4.3.16",
36
36
  "better-sqlite3": "^12.6.2",