@elsium-ai/workflows 0.2.3 → 0.3.0
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.
- package/dist/index.js +48 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -91,6 +91,54 @@ class ElsiumError extends Error {
|
|
|
91
91
|
async function sleep(ms) {
|
|
92
92
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
93
93
|
}
|
|
94
|
+
// ../core/src/logger.ts
|
|
95
|
+
var LOG_LEVELS = {
|
|
96
|
+
debug: 0,
|
|
97
|
+
info: 1,
|
|
98
|
+
warn: 2,
|
|
99
|
+
error: 3
|
|
100
|
+
};
|
|
101
|
+
function createLogger(options = {}) {
|
|
102
|
+
const { level = "info", pretty = false, context = {} } = options;
|
|
103
|
+
const minLevel = LOG_LEVELS[level];
|
|
104
|
+
function log(logLevel, message, data) {
|
|
105
|
+
if (LOG_LEVELS[logLevel] < minLevel)
|
|
106
|
+
return;
|
|
107
|
+
const entry = {
|
|
108
|
+
...context,
|
|
109
|
+
level: logLevel,
|
|
110
|
+
message,
|
|
111
|
+
timestamp: new Date().toISOString(),
|
|
112
|
+
...data ? { data } : {}
|
|
113
|
+
};
|
|
114
|
+
const output = pretty ? JSON.stringify(entry, null, 2) : JSON.stringify(entry);
|
|
115
|
+
if (logLevel === "error") {
|
|
116
|
+
console.error(output);
|
|
117
|
+
} else if (logLevel === "warn") {
|
|
118
|
+
console.warn(output);
|
|
119
|
+
} else {
|
|
120
|
+
console.log(output);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
debug: (msg, data) => log("debug", msg, data),
|
|
125
|
+
info: (msg, data) => log("info", msg, data),
|
|
126
|
+
warn: (msg, data) => log("warn", msg, data),
|
|
127
|
+
error: (msg, data) => log("error", msg, data),
|
|
128
|
+
child(childContext) {
|
|
129
|
+
return createLogger({
|
|
130
|
+
level,
|
|
131
|
+
pretty,
|
|
132
|
+
context: { ...context, ...childContext }
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
// ../core/src/schema.ts
|
|
138
|
+
var log = createLogger();
|
|
139
|
+
// ../core/src/registry.ts
|
|
140
|
+
var log2 = createLogger();
|
|
141
|
+
var BLOCKED_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
94
142
|
// src/step.ts
|
|
95
143
|
function step(name, config) {
|
|
96
144
|
return { name, ...config };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elsium-ai/workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Multi-step workflow pipelines and DAG execution for ElsiumAI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Eric Utrera <ebutrera9103@gmail.com>",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dev": "bun --watch src/index.ts"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@elsium-ai/core": "^0.
|
|
29
|
+
"@elsium-ai/core": "^0.3.0",
|
|
30
30
|
"zod": "^3.24.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|