blokctl 0.6.9 → 0.6.10
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.
|
|
20
|
+
const GITHUB_REPO_RELEASE_TAG = "v0.6.10";
|
|
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.
|
|
481
|
+
const BLOKJS_DEP_RANGE = "^0.6.10";
|
|
482
482
|
for (const depGroup of ["dependencies", "devDependencies", "peerDependencies"]) {
|
|
483
483
|
const deps = packageJsonContent[depGroup];
|
|
484
484
|
if (!deps)
|
|
@@ -646,6 +646,23 @@ export async function createProject(opts, version, currentPath = false, localRep
|
|
|
646
646
|
"# The plain /chat demo works without Redis; only /chat-memory needs it.",
|
|
647
647
|
"REDIS_URL=redis://127.0.0.1:6379",
|
|
648
648
|
"",
|
|
649
|
+
"# Webhook router demo (--examples + --triggers webhook) — secrets per provider.",
|
|
650
|
+
"# Stripe: copy from https://dashboard.stripe.com/webhooks (`whsec_…`).",
|
|
651
|
+
"# GitHub: set in repo Settings → Webhooks → secret field.",
|
|
652
|
+
"# Linear: workspace settings → API → Webhooks → signing secret.",
|
|
653
|
+
"# Until set, signature verification fails with 401 — that's the gate working.",
|
|
654
|
+
"STRIPE_WEBHOOK_SECRET=",
|
|
655
|
+
"GITHUB_WEBHOOK_SECRET=",
|
|
656
|
+
"LINEAR_WEBHOOK_SECRET=",
|
|
657
|
+
"",
|
|
658
|
+
"# Worker fan-out demo (--examples + --triggers worker) — POST /fanout/jobs with",
|
|
659
|
+
"# `{items: [...], tenantId?: '...'}` enqueues N worker jobs onto `fanout-jobs`.",
|
|
660
|
+
"# in-memory adapter works single-process; for cross-process set BLOK_WORKER_ADAPTER",
|
|
661
|
+
"# to nats / redis / bullmq / rabbitmq / sqs / pg-boss / kafka and supply the matching",
|
|
662
|
+
"# connection env (e.g. NATS_SERVERS=nats://127.0.0.1:4222, or REDIS_URL above).",
|
|
663
|
+
"BLOK_WORKER_ADAPTER=in-memory",
|
|
664
|
+
"NATS_SERVERS=nats://127.0.0.1:4222",
|
|
665
|
+
"",
|
|
649
666
|
].join("\n");
|
|
650
667
|
fsExtra.appendFileSync(envLocal, chatEnvBlock);
|
|
651
668
|
}
|
|
@@ -13,7 +13,7 @@ declare const package_dev_dependencies: {
|
|
|
13
13
|
"@types/pg": string;
|
|
14
14
|
};
|
|
15
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";
|
|
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";
|
|
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)\n7- Webhook router: POST /webhooks/{stripe,github,linear} with signed bodies \u2014 set the matching *_WEBHOOK_SECRET env vars (needs --triggers webhook)\n8- LLM agent w/ tool calls: open http://localhost:4000/agent \u2014 model picks between get_weather and calculate tools (needs OPENROUTER_API_KEY + Redis)\n9- Worker fan-out: POST /fanout/jobs with body '{items:[...], tenantId?:\"...\"}' to enqueue N worker jobs (needs --triggers worker; BLOK_WORKER_ADAPTER=in-memory works single-process)\n\nFor more documentation, visit src/nodes/examples/README.md. The first three examples require a PostgreSQL database to function.\n";
|
|
17
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";
|
|
18
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";
|
|
19
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";
|
|
@@ -71,6 +71,9 @@ Examples:
|
|
|
71
71
|
4- Open "countries.json" in your browser at http://localhost:4000/countries
|
|
72
72
|
5- Open "chat.json" in your browser at http://localhost:4000/chat (set OPENROUTER_API_KEY first)
|
|
73
73
|
6- Open "chat-memory.json" in your browser at http://localhost:4000/chat-memory (needs OPENROUTER_API_KEY + Redis at REDIS_URL)
|
|
74
|
+
7- Webhook router: POST /webhooks/{stripe,github,linear} with signed bodies — set the matching *_WEBHOOK_SECRET env vars (needs --triggers webhook)
|
|
75
|
+
8- LLM agent w/ tool calls: open http://localhost:4000/agent — model picks between get_weather and calculate tools (needs OPENROUTER_API_KEY + Redis)
|
|
76
|
+
9- Worker fan-out: POST /fanout/jobs with body '{items:[...], tenantId?:"..."}' to enqueue N worker jobs (needs --triggers worker; BLOK_WORKER_ADAPTER=in-memory works single-process)
|
|
74
77
|
|
|
75
78
|
For more documentation, visit src/nodes/examples/README.md. The first three examples require a PostgreSQL database to function.
|
|
76
79
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blokctl",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
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.
|
|
33
|
+
"@blokjs/runner": "^0.6.10",
|
|
34
34
|
"@clack/prompts": "^1.0.0",
|
|
35
35
|
"ai": "^4.3.16",
|
|
36
36
|
"better-sqlite3": "^12.6.2",
|