Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openclaw.plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "clawflow",
"name": "ClawFlow",
"description": "The n8n for agents. Declarative, AI-native workflow engine — LLM-writable, Cloudflare-portable.",
"version": "1.2.1",
"version": "1.2.2",
"skills": ["./skills/flow"],
"contracts": {
"tools": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clawnify/clawflow",
"version": "1.2.1",
"version": "1.2.2",
"description": "The n8n for agents. A declarative, AI-native workflow format that agents can read, write, and run.",
"type": "module",
"main": "./dist/index.js",
Expand Down
8 changes: 3 additions & 5 deletions src/plugin/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import * as fs from "node:fs";
import * as path from "node:path";

import { FlowRunner, sendEvent } from "../core/runner.js";

import { startFlowServer } from "../core/serve.js";
Expand Down Expand Up @@ -156,7 +159,6 @@ function register(api: PluginApi) {

/** Resolve a file param to an absolute path using workspace conventions. */
function resolveFlowFile(file: string): string {
const path = require("path") as typeof import("path");
const base = workspace;
if (file.startsWith("/")) return file;
if (file.includes("/")) return path.join(base, file);
Expand All @@ -166,14 +168,12 @@ function register(api: PluginApi) {

/** Get the versions directory for a flow name. */
function versionsDir(flowName: string): string {
const path = require("path") as typeof import("path");
const base = workspace;
return path.join(base, ".clawflow", "versions", flowName);
}

/** List all published version numbers for a flow, sorted ascending. */
function listVersions(flowName: string): number[] {
const fs = require("fs") as typeof import("fs");
const dir = versionsDir(flowName);
if (!fs.existsSync(dir)) return [];
return fs.readdirSync(dir)
Expand All @@ -184,8 +184,6 @@ function register(api: PluginApi) {

/** Read a specific published version. Returns null if not found. */
function readVersion(flowName: string, version: number): FlowDefinition | null {
const fs = require("fs") as typeof import("fs");
const path = require("path") as typeof import("path");
const file = path.join(versionsDir(flowName), `${version}.json`);
if (!fs.existsSync(file)) return null;
return JSON.parse(fs.readFileSync(file, "utf-8")) as FlowDefinition;
Expand Down
Loading