@limo-labs/deity 0.1.0-alpha.2 → 0.1.1-alpha.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/README.md +829 -134
  3. package/STREAMING_IMPLEMENTATION.md +318 -0
  4. package/docs/tool-error-handling.md +396 -0
  5. package/examples/conversation-manager-example.ts +478 -0
  6. package/examples/schema-conversion-example.ts +184 -0
  7. package/examples/simple-state-store-examples.ts +374 -0
  8. package/examples/streaming-example.ts +375 -0
  9. package/examples/tool-error-recovery.ts +245 -0
  10. package/package.json +10 -4
  11. package/src/__tests__/conversation.test.ts +597 -0
  12. package/src/__tests__/loop-iteration.test.ts +759 -0
  13. package/src/__tests__/primitives.test.ts +226 -3
  14. package/src/__tests__/schema-converter.test.ts +684 -0
  15. package/src/__tests__/simple-state-store.test.ts +620 -0
  16. package/src/__tests__/streaming.test.ts +558 -0
  17. package/src/adapters/base.ts +12 -20
  18. package/src/adapters/index.ts +9 -2
  19. package/src/adapters/openai.ts +250 -1
  20. package/src/adapters/types.ts +57 -0
  21. package/src/adapters/vscode.ts +8 -4
  22. package/src/core/index.ts +1 -0
  23. package/src/core/types.ts +40 -0
  24. package/src/execution/graph.ts +5 -1
  25. package/src/execution/primitives.ts +12 -1
  26. package/src/execution/scheduler.ts +4 -9
  27. package/src/execution/types.ts +7 -4
  28. package/src/guidance/README.md +170 -0
  29. package/src/guidance/helpers.ts +149 -0
  30. package/src/guidance/index.ts +4 -0
  31. package/src/helpers/README.md +271 -0
  32. package/src/helpers/conversation.ts +513 -0
  33. package/src/helpers/index.ts +38 -0
  34. package/src/helpers/schema-converter.ts +366 -0
  35. package/src/helpers/types.ts +0 -1
  36. package/src/index.ts +194 -3
  37. package/src/primitives/action.ts +97 -5
  38. package/src/primitives/index.ts +7 -1
  39. package/src/primitives/primitives.test.ts +5 -3
  40. package/src/state/adapter.ts +284 -0
  41. package/src/state/file-store.ts +376 -0
  42. package/src/state/helpers.ts +1 -1
  43. package/src/state/index.ts +17 -0
  44. package/src/state/memory-store.ts +339 -0
  45. package/src/state/simple-store.ts +146 -0
  46. package/src/tools/detection.ts +0 -1
  47. package/src/tools/fallback.ts +0 -1
  48. package/src/tools/warnings.ts +4 -1
  49. package/src/workflow/execution.ts +2 -2
  50. package/src/workflow/runtime.ts +67 -20
  51. package/tsup.config.ts +6 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,184 @@
1
+ # Changelog
2
+
3
+ All notable changes to Deity 3.0 will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0-alpha.3] - 2026-02-17
9
+
10
+ ### Added
11
+
12
+ #### Workflow Runtime Export (Task #1 - P0 Critical)
13
+ - **Exported Workflow API** - `defineWorkflow`, `runWorkflow`, `WorkflowBuilder` now available at top level
14
+ - **Exported Execution Primitives** - `Step`, `Sequence`, `Parallel`, `Conditional`, `Loop` for composable workflows
15
+ - **Exported Core Types** - `AgentComponent`, `ExecutionContext`, `Tool`, `Message`, `LLMAdapter` as first-class exports
16
+ - **Module Organization** - 8 organized namespace modules: `workflow`, `execution`, `primitives`, `guidance`, `adapters`, `state`, `tools`, `helpers`
17
+ - **Flat Imports** - Convenience imports for commonly used APIs
18
+ - **Namespace Imports** - Alternative `import * as deity from '@limo-labs/deity-3.0'` style supported
19
+
20
+ #### Tool Error Handling (Task #2 - P0 Critical)
21
+ - **Tool Result Type** - New `ToolResult<T>` interface for returning success/error instead of throwing
22
+ - **ActionConfig** - New configuration for `DefaultAction` with `onError` and `validateBeforeExecute` options
23
+ - **Auto-Retry on Tool Errors** - New `retryOnToolError` option in component retry config
24
+ - **LLM Error Feedback** - New `feedbackErrorToLLM` option to send tool errors back to LLM for correction
25
+ - **Pre-Execution Validation** - Tools now validate input schema before execution
26
+ - **Graceful Error Handling** - Tools can return errors instead of throwing, enabling automatic recovery
27
+
28
+ #### Documentation (Task #3 - P1 High)
29
+ - **Updated README.md** - Complete rewrite with working examples using actual exported API
30
+ - **API Guide** - New `doc/api-guide.md` with side-by-side API comparisons
31
+ - **Migration Guide** - New `doc/migration.md` with migration paths from 2.x and manual implementations
32
+ - **Stability Matrix** - Clear indication of stable vs experimental modules
33
+ - **When to Use What** - Decision trees and comparison tables for choosing the right API
34
+
35
+ ### Changed
36
+
37
+ #### API Organization
38
+ - **Renamed Pipeline → Workflow** - Terminology update throughout codebase
39
+ - **Module Exports** - Organized exports into 8 distinct modules instead of flat structure
40
+ - **Import Patterns** - Support both flat imports and namespace imports
41
+
42
+ #### Tool System
43
+ - **Tool Interface** - Tools can now return `ToolResult<T>` or throw (both supported)
44
+ - **Error Handling** - Changed from "throw only" to "return or throw" model
45
+ - **Validation** - Added pre-execution validation layer
46
+
47
+ #### Retry System
48
+ - **Default Behavior** - `feedbackOnError` now defaults to `true`
49
+ - **Tool Retry** - Added `retryOnToolError` option (defaults to `true`)
50
+ - **Error Feedback** - Added `feedbackErrorToLLM` option (defaults to `true`)
51
+
52
+ ### Fixed
53
+ - **API Documentation Mismatch** - README examples now use actually exported APIs
54
+ - **Tool Validation Crashes** - Tool parameter errors no longer crash entire workflow
55
+ - **Missing Exports** - Workflow runtime and execution primitives now properly exported
56
+ - **Type Safety** - Core types now exported at top level to avoid conflicts
57
+
58
+ ### Documentation
59
+ - **README.md** - Complete rewrite with accurate API examples
60
+ - **doc/api-guide.md** - New comprehensive API comparison guide
61
+ - **doc/migration.md** - New migration guide for 2.x and manual implementations
62
+ - **CHANGELOG.md** - This file
63
+
64
+ ---
65
+
66
+ ## [0.1.0-alpha.2] - 2026-02-16
67
+
68
+ ### Added
69
+ - Initial workflow system implementation
70
+ - Execution primitives (Step, Sequence, Parallel, Conditional, Loop)
71
+ - Biological primitives (Perception, Action, Memory, Feedback, Communication)
72
+ - Adaptive tool calling system
73
+ - State management with event sourcing
74
+ - Validation and guidance system
75
+ - OpenAI and VS Code adapters
76
+
77
+ ### Known Issues
78
+ - Workflow API not exported (fixed in 0.1.0-alpha.3)
79
+ - Tool error handling crashes on validation failure (fixed in 0.1.0-alpha.3)
80
+ - Documentation examples use non-exported APIs (fixed in 0.1.0-alpha.3)
81
+
82
+ ---
83
+
84
+ ## [0.1.0-alpha.1] - 2026-02-15
85
+
86
+ ### Added
87
+ - Initial alpha release
88
+ - Core type system
89
+ - Basic primitives implementation
90
+ - LLM adapter interface
91
+
92
+ ---
93
+
94
+ ## Version History
95
+
96
+ | Version | Date | Key Changes |
97
+ |---------|------|-------------|
98
+ | 0.1.0-alpha.3 | 2026-02-17 | Workflow runtime export, tool error handling, documentation update |
99
+ | 0.1.0-alpha.2 | 2026-02-16 | Workflow system, execution primitives, adaptive tools |
100
+ | 0.1.0-alpha.1 | 2026-02-15 | Initial alpha release |
101
+
102
+ ---
103
+
104
+ ## Upgrade Guide
105
+
106
+ ### From 0.1.0-alpha.2 to 0.1.0-alpha.3
107
+
108
+ **No breaking changes** - This is a feature addition release.
109
+
110
+ #### New Features to Adopt
111
+
112
+ 1. **Use exported Workflow API:**
113
+
114
+ ```typescript
115
+ // Now available!
116
+ import {
117
+ defineWorkflow,
118
+ runWorkflow,
119
+ type AgentComponent
120
+ } from '@limo-labs/deity-3.0';
121
+ ```
122
+
123
+ 2. **Enable tool error handling:**
124
+
125
+ ```typescript
126
+ const Component: AgentComponent = {
127
+ // ... other fields ...
128
+ retry: {
129
+ maxAttempts: 3,
130
+ feedbackOnError: true, // ✅ Default true in alpha.3
131
+ retryOnToolError: true, // ✅ NEW: Retry on tool errors
132
+ feedbackErrorToLLM: true // ✅ NEW: Send errors to LLM
133
+ }
134
+ };
135
+ ```
136
+
137
+ 3. **Use execution primitives:**
138
+
139
+ ```typescript
140
+ import { Sequence, Parallel, Loop, Step } from '@limo-labs/deity-3.0/execution';
141
+
142
+ const workflow = defineWorkflow({
143
+ stages: Sequence([
144
+ Step(Component1),
145
+ Parallel([Step(Component2), Step(Component3)]),
146
+ Step(Component4)
147
+ ])
148
+ });
149
+ ```
150
+
151
+ ---
152
+
153
+ ## Roadmap
154
+
155
+ ### v0.1.0-beta.1 (Planned)
156
+ - [ ] Streaming support for LLM responses
157
+ - [ ] Progressive guidance integration
158
+ - [ ] Loop iteration context
159
+ - [ ] ConversationManager helper
160
+ - [ ] Memory system integration with workflow runtime
161
+
162
+ ### v0.1.0 (Planned)
163
+ - [ ] Full test coverage (>90%)
164
+ - [ ] Performance benchmarks
165
+ - [ ] Production examples
166
+ - [ ] Complete API documentation
167
+
168
+ ### v0.2.0 (Planned)
169
+ - [ ] Distributed execution
170
+ - [ ] Advanced state management
171
+ - [ ] Plugin system
172
+ - [ ] UI dashboard
173
+
174
+ ---
175
+
176
+ ## Contributing
177
+
178
+ See [CONTRIBUTING.md](../../CONTRIBUTING.md) for development guidelines.
179
+
180
+ ---
181
+
182
+ ## License
183
+
184
+ MIT © Limo Labs