@sudocode-ai/local-server 0.1.6 → 0.1.7
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/execution/process/builders/claude.d.ts +1 -1
- package/dist/execution/process/builders/claude.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -11
- package/dist/index.js.map +1 -1
- package/dist/public/assets/index-B3SEMufD.js +580 -0
- package/dist/public/assets/{index-BvlblDHK.js.map → index-B3SEMufD.js.map} +1 -1
- package/dist/public/assets/index-D2YGL3gX.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/routes/feedback.d.ts.map +1 -1
- package/dist/routes/feedback.js +20 -12
- package/dist/routes/feedback.js.map +1 -1
- package/dist/services/db.d.ts.map +1 -1
- package/dist/services/db.js +19 -14
- package/dist/services/db.js.map +1 -1
- package/dist/services/execution-service.d.ts.map +1 -1
- package/dist/services/execution-service.js +43 -22
- package/dist/services/execution-service.js.map +1 -1
- package/dist/services/executions.d.ts.map +1 -1
- package/dist/services/executions.js +15 -0
- package/dist/services/executions.js.map +1 -1
- package/dist/services/feedback.d.ts +16 -0
- package/dist/services/feedback.d.ts.map +1 -1
- package/dist/services/feedback.js +25 -1
- package/dist/services/feedback.js.map +1 -1
- package/dist/services/repo-info.d.ts +17 -0
- package/dist/services/repo-info.d.ts.map +1 -0
- package/dist/services/repo-info.js +53 -0
- package/dist/services/repo-info.js.map +1 -0
- package/dist/services/websocket.d.ts +25 -3
- package/dist/services/websocket.d.ts.map +1 -1
- package/dist/services/websocket.js +71 -7
- package/dist/services/websocket.js.map +1 -1
- package/package.json +4 -3
- package/dist/execution/engine/engine.d.ts +0 -103
- package/dist/execution/engine/engine.d.ts.map +0 -1
- package/dist/execution/engine/engine.js +0 -10
- package/dist/execution/engine/engine.js.map +0 -1
- package/dist/execution/engine/simple-engine.d.ts +0 -190
- package/dist/execution/engine/simple-engine.d.ts.map +0 -1
- package/dist/execution/engine/simple-engine.js +0 -611
- package/dist/execution/engine/simple-engine.js.map +0 -1
- package/dist/execution/engine/types.d.ts +0 -116
- package/dist/execution/engine/types.d.ts.map +0 -1
- package/dist/execution/engine/types.js +0 -10
- package/dist/execution/engine/types.js.map +0 -1
- package/dist/execution/process/index.d.ts +0 -15
- package/dist/execution/process/index.d.ts.map +0 -1
- package/dist/execution/process/index.js +0 -15
- package/dist/execution/process/index.js.map +0 -1
- package/dist/execution/process/manager.d.ts +0 -133
- package/dist/execution/process/manager.d.ts.map +0 -1
- package/dist/execution/process/manager.js +0 -10
- package/dist/execution/process/manager.js.map +0 -1
- package/dist/execution/process/simple-manager.d.ts +0 -102
- package/dist/execution/process/simple-manager.d.ts.map +0 -1
- package/dist/execution/process/simple-manager.js +0 -336
- package/dist/execution/process/simple-manager.js.map +0 -1
- package/dist/execution/process/types.d.ts +0 -105
- package/dist/execution/process/types.d.ts.map +0 -1
- package/dist/execution/process/types.js +0 -10
- package/dist/execution/process/types.js.map +0 -1
- package/dist/execution/process/utils.d.ts +0 -53
- package/dist/execution/process/utils.d.ts.map +0 -1
- package/dist/execution/process/utils.js +0 -97
- package/dist/execution/process/utils.js.map +0 -1
- package/dist/execution/resilience/circuit-breaker.d.ts +0 -170
- package/dist/execution/resilience/circuit-breaker.d.ts.map +0 -1
- package/dist/execution/resilience/circuit-breaker.js +0 -291
- package/dist/execution/resilience/circuit-breaker.js.map +0 -1
- package/dist/execution/resilience/executor.d.ts +0 -109
- package/dist/execution/resilience/executor.d.ts.map +0 -1
- package/dist/execution/resilience/executor.js +0 -10
- package/dist/execution/resilience/executor.js.map +0 -1
- package/dist/execution/resilience/index.d.ts +0 -14
- package/dist/execution/resilience/index.d.ts.map +0 -1
- package/dist/execution/resilience/index.js +0 -15
- package/dist/execution/resilience/index.js.map +0 -1
- package/dist/execution/resilience/resilient-executor.d.ts +0 -86
- package/dist/execution/resilience/resilient-executor.d.ts.map +0 -1
- package/dist/execution/resilience/resilient-executor.js +0 -261
- package/dist/execution/resilience/resilient-executor.js.map +0 -1
- package/dist/execution/resilience/retry.d.ts +0 -161
- package/dist/execution/resilience/retry.d.ts.map +0 -1
- package/dist/execution/resilience/retry.js +0 -234
- package/dist/execution/resilience/retry.js.map +0 -1
- package/dist/execution/resilience/types.d.ts +0 -226
- package/dist/execution/resilience/types.d.ts.map +0 -1
- package/dist/execution/resilience/types.js +0 -30
- package/dist/execution/resilience/types.js.map +0 -1
- package/dist/execution/workflow/index.d.ts +0 -13
- package/dist/execution/workflow/index.d.ts.map +0 -1
- package/dist/execution/workflow/index.js +0 -13
- package/dist/execution/workflow/index.js.map +0 -1
- package/dist/execution/workflow/linear-orchestrator.d.ts +0 -216
- package/dist/execution/workflow/linear-orchestrator.d.ts.map +0 -1
- package/dist/execution/workflow/linear-orchestrator.js +0 -683
- package/dist/execution/workflow/linear-orchestrator.js.map +0 -1
- package/dist/execution/workflow/memory-storage.d.ts +0 -54
- package/dist/execution/workflow/memory-storage.d.ts.map +0 -1
- package/dist/execution/workflow/memory-storage.js +0 -68
- package/dist/execution/workflow/memory-storage.js.map +0 -1
- package/dist/execution/workflow/orchestrator.d.ts +0 -158
- package/dist/execution/workflow/orchestrator.d.ts.map +0 -1
- package/dist/execution/workflow/orchestrator.js +0 -9
- package/dist/execution/workflow/orchestrator.js.map +0 -1
- package/dist/execution/workflow/types.d.ts +0 -172
- package/dist/execution/workflow/types.d.ts.map +0 -1
- package/dist/execution/workflow/types.js +0 -9
- package/dist/execution/workflow/types.js.map +0 -1
- package/dist/execution/workflow/utils.d.ts +0 -89
- package/dist/execution/workflow/utils.d.ts.map +0 -1
- package/dist/execution/workflow/utils.js +0 -152
- package/dist/execution/workflow/utils.js.map +0 -1
- package/dist/public/assets/index-BvlblDHK.js +0 -570
- package/dist/public/assets/index-BwuKdLgN.css +0 -1
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow Utility Functions
|
|
3
|
-
*
|
|
4
|
-
* Helper functions for template rendering, path extraction, and ID generation.
|
|
5
|
-
*
|
|
6
|
-
* @module execution/workflow/utils
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Generate a unique ID with a given prefix
|
|
10
|
-
*
|
|
11
|
-
* @param prefix - Prefix for the ID (e.g., 'execution', 'checkpoint')
|
|
12
|
-
* @returns Unique ID string
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* const id = generateId('execution');
|
|
17
|
-
* // Returns: 'execution-1234567890-abc123'
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export function generateId(prefix = 'id') {
|
|
21
|
-
const timestamp = Date.now();
|
|
22
|
-
const random = Math.random().toString(36).substring(2, 9);
|
|
23
|
-
return `${prefix}-${timestamp}-${random}`;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Render a template string by replacing {{variable}} placeholders with context values
|
|
27
|
-
*
|
|
28
|
-
* @param template - Template string with {{variable}} placeholders
|
|
29
|
-
* @param context - Context object containing variable values
|
|
30
|
-
* @returns Rendered string with variables replaced
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const context = { name: 'World', greeting: 'Hello' };
|
|
35
|
-
* const result = renderTemplate('{{greeting}} {{name}}!', context);
|
|
36
|
-
* // Returns: 'Hello World!'
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export function renderTemplate(template, context) {
|
|
40
|
-
let rendered = template;
|
|
41
|
-
// Replace all {{variable}} placeholders with values from context
|
|
42
|
-
const placeholderRegex = /\{\{(\w+(?:\.\w+)*)\}\}/g;
|
|
43
|
-
rendered = rendered.replace(placeholderRegex, (match, path) => {
|
|
44
|
-
const value = extractValue(context, path);
|
|
45
|
-
// If value is undefined or null, leave placeholder as-is
|
|
46
|
-
if (value === undefined || value === null) {
|
|
47
|
-
return match;
|
|
48
|
-
}
|
|
49
|
-
// Convert value to string
|
|
50
|
-
return String(value);
|
|
51
|
-
});
|
|
52
|
-
return rendered;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Extract a value from an object using a dot-notation path
|
|
56
|
-
*
|
|
57
|
-
* @param obj - Object to extract value from
|
|
58
|
-
* @param path - Dot-notation path (e.g., 'user.profile.name')
|
|
59
|
-
* @returns Extracted value or undefined if path doesn't exist
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```typescript
|
|
63
|
-
* const obj = { user: { profile: { name: 'Alice' } } };
|
|
64
|
-
* const name = extractValue(obj, 'user.profile.name');
|
|
65
|
-
* // Returns: 'Alice'
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
export function extractValue(obj, path) {
|
|
69
|
-
if (obj === null || obj === undefined) {
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
// Handle simple paths (no dots)
|
|
73
|
-
if (!path.includes('.')) {
|
|
74
|
-
return obj[path];
|
|
75
|
-
}
|
|
76
|
-
// Split path and traverse
|
|
77
|
-
const parts = path.split('.');
|
|
78
|
-
let value = obj;
|
|
79
|
-
for (const part of parts) {
|
|
80
|
-
if (value === null || value === undefined) {
|
|
81
|
-
return undefined;
|
|
82
|
-
}
|
|
83
|
-
value = value[part];
|
|
84
|
-
}
|
|
85
|
-
return value;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Merge two context objects, with the second overriding the first
|
|
89
|
-
*
|
|
90
|
-
* @param base - Base context object
|
|
91
|
-
* @param updates - Updates to merge into base
|
|
92
|
-
* @returns New merged context object
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```typescript
|
|
96
|
-
* const base = { a: 1, b: 2 };
|
|
97
|
-
* const updates = { b: 3, c: 4 };
|
|
98
|
-
* const merged = mergeContext(base, updates);
|
|
99
|
-
* // Returns: { a: 1, b: 3, c: 4 }
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
export function mergeContext(base, updates) {
|
|
103
|
-
return {
|
|
104
|
-
...base,
|
|
105
|
-
...updates,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Evaluate a condition string in the context
|
|
110
|
-
*
|
|
111
|
-
* @param condition - Condition string to evaluate (e.g., '{{isEnabled}}')
|
|
112
|
-
* @param context - Context object
|
|
113
|
-
* @returns Boolean result of condition
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```typescript
|
|
117
|
-
* const context = { isEnabled: true };
|
|
118
|
-
* const result = evaluateCondition('{{isEnabled}}', context);
|
|
119
|
-
* // Returns: true
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
export function evaluateCondition(condition, context) {
|
|
123
|
-
// Render the condition template
|
|
124
|
-
const rendered = renderTemplate(condition, context);
|
|
125
|
-
// If template still contains placeholders, variables are missing - treat as false (fail-safe)
|
|
126
|
-
if (rendered.includes('{{') && rendered.includes('}}')) {
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
// Simple boolean evaluation
|
|
130
|
-
// True if: 'true', '1', non-empty string
|
|
131
|
-
// False if: 'false', '0', '', or falsy value
|
|
132
|
-
if (rendered === 'true' || rendered === '1') {
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
if (rendered === 'false' || rendered === '0' || rendered === '') {
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
// For other values, check if they're truthy
|
|
139
|
-
return Boolean(rendered);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Create initial workflow context
|
|
143
|
-
*
|
|
144
|
-
* @param initialValues - Initial context values
|
|
145
|
-
* @returns New context object
|
|
146
|
-
*/
|
|
147
|
-
export function createContext(initialValues = {}) {
|
|
148
|
-
return {
|
|
149
|
-
...initialValues,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/exec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