@ha-bits/cortex-core 0.1.0-next.69
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/README.md +50 -0
- package/index.cjs +8491 -0
- package/index.cjs.map +7 -0
- package/index.js +8412 -0
- package/index.js.map +7 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @ha-bits/cortex-core
|
|
2
|
+
|
|
3
|
+
Platform-agnostic workflow execution engine for Habits (workflows). This package contains the core execution logic without any server dependencies.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Platform-agnostic**: Works in browsers, Deno, Bun, and Node.js
|
|
8
|
+
- **No server dependencies**: No Express, Yargs, or Dotenv required
|
|
9
|
+
- **Multiple framework support**: Execute n8n, Activepieces, and Bits modules
|
|
10
|
+
- **Streaming support**: Real-time execution updates via callbacks
|
|
11
|
+
- **Security scanning**: Built-in DLP, PII, and moderation support
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { HabitsExecutor, WorkflowConfig, Workflow } from '@ha-bits/cortex-core';
|
|
17
|
+
|
|
18
|
+
// Create executor
|
|
19
|
+
const config: WorkflowConfig = {
|
|
20
|
+
version: '1.0',
|
|
21
|
+
workflows: [{ id: 'my-workflow', path: 'inline' }]
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const workflows = new Map<string, Workflow>([
|
|
25
|
+
['my-workflow', myWorkflowDefinition]
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
const executor = new HabitsExecutor(config, workflows, {
|
|
29
|
+
OPENAI_API_KEY: 'sk-...',
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Execute a workflow
|
|
33
|
+
const result = await executor.startWorkflow('my-workflow', {
|
|
34
|
+
initialContext: {
|
|
35
|
+
habits: {
|
|
36
|
+
input: { prompt: 'Hello' }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
console.log(result.output);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Server Package
|
|
45
|
+
|
|
46
|
+
For HTTP server functionality with Express, OpenAPI documentation, and webhook support, use `@ha-bits/cortex` which depends on this core package.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
Apache-2.0
|