societyai 0.0.1
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/CHANGELOG.md +111 -0
- package/LICENSE +21 -0
- package/README.md +879 -0
- package/dist/builder.d.ts +181 -0
- package/dist/builder.d.ts.map +1 -0
- package/dist/builder.js +667 -0
- package/dist/builder.js.map +1 -0
- package/dist/config.d.ts +43 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +11 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +107 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +319 -0
- package/dist/context.js.map +1 -0
- package/dist/errors.d.ts +31 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +85 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +219 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +395 -0
- package/dist/events.js.map +1 -0
- package/dist/graph.d.ts +104 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +366 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +13 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +78 -0
- package/dist/logger.js.map +1 -0
- package/dist/memory.d.ts +146 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +353 -0
- package/dist/memory.js.map +1 -0
- package/dist/metrics.d.ts +143 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +271 -0
- package/dist/metrics.js.map +1 -0
- package/dist/middleware.d.ts +147 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +484 -0
- package/dist/middleware.js.map +1 -0
- package/dist/models.d.ts +32 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +211 -0
- package/dist/models.js.map +1 -0
- package/dist/patterns.d.ts +6 -0
- package/dist/patterns.d.ts.map +1 -0
- package/dist/patterns.js +68 -0
- package/dist/patterns.js.map +1 -0
- package/dist/pipeline.d.ts +84 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +569 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/retry.d.ts +5 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +70 -0
- package/dist/retry.js.map +1 -0
- package/dist/society.d.ts +94 -0
- package/dist/society.d.ts.map +1 -0
- package/dist/society.js +721 -0
- package/dist/society.js.map +1 -0
- package/dist/strategies.d.ts +55 -0
- package/dist/strategies.d.ts.map +1 -0
- package/dist/strategies.js +678 -0
- package/dist/strategies.js.map +1 -0
- package/dist/tools.d.ts +88 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +366 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +213 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/dist/validation.d.ts +64 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +334 -0
- package/dist/validation.js.map +1 -0
- package/dist/worker-pool.d.ts +17 -0
- package/dist/worker-pool.d.ts.map +1 -0
- package/dist/worker-pool.js +80 -0
- package/dist/worker-pool.js.map +1 -0
- package/docs/README.md +468 -0
- package/docs/advanced.md +616 -0
- package/docs/aggregation-strategies.md +926 -0
- package/docs/api-reference.md +771 -0
- package/docs/architecture.md +648 -0
- package/docs/context-system.md +642 -0
- package/docs/event-system.md +1047 -0
- package/docs/examples.md +576 -0
- package/docs/getting-started.md +564 -0
- package/docs/graph-execution.md +389 -0
- package/docs/memory-system.md +497 -0
- package/docs/metrics-observability.md +560 -0
- package/docs/middleware-system.md +1038 -0
- package/docs/migration.md +296 -0
- package/docs/pipeline-patterns.md +761 -0
- package/docs/structured-output.md +612 -0
- package/docs/tool-calling.md +491 -0
- package/docs/workflows.md +740 -0
- package/examples/README.md +234 -0
- package/examples/advanced-patterns.ts +115 -0
- package/examples/complete-integration.ts +327 -0
- package/examples/graph-workflow.ts +161 -0
- package/examples/memory-system.ts +155 -0
- package/examples/metrics-tracking.ts +243 -0
- package/examples/structured-output.ts +231 -0
- package/examples/tool-calling.ts +163 -0
- package/package.json +94 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project 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
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.0.1] - 2026-02-01
|
|
11
|
+
|
|
12
|
+
### Initial Release
|
|
13
|
+
|
|
14
|
+
This is the initial pre-release version of SocietyAI.
|
|
15
|
+
|
|
16
|
+
### Added - Major Features (Phase 1-3)
|
|
17
|
+
|
|
18
|
+
#### ๐ฏ Phase 1: Unified Execution Engine
|
|
19
|
+
|
|
20
|
+
- **SocietyGraph** - Graph-based execution engine with DAG/Cyclic support
|
|
21
|
+
- 8 node types: START, END, AGENT, PARALLEL, AGGREGATE, CONDITION, TRANSFORM, LOOP
|
|
22
|
+
- Conditional branching and dynamic routing
|
|
23
|
+
- Loop support with termination conditions
|
|
24
|
+
- Parallel execution optimization via WorkerPool
|
|
25
|
+
- Graph visualization for debugging
|
|
26
|
+
- **Streaming Support** - Added `stream()` method to AIModel interface for real-time output
|
|
27
|
+
- **GraphBuilder** - Fluent API for constructing complex execution graphs
|
|
28
|
+
|
|
29
|
+
#### ๐ ๏ธ Phase 2: Agent Capabilities
|
|
30
|
+
|
|
31
|
+
- **Tool Calling System** - Enable agents to interact with external functions
|
|
32
|
+
- ToolRegistry for centralized tool management
|
|
33
|
+
- ToolExecutor with automatic retry loop
|
|
34
|
+
- JSON Schema validation for parameters
|
|
35
|
+
- BuiltInTools: calculator, stringManipulation, storage
|
|
36
|
+
- Parallel tool execution support
|
|
37
|
+
- **Multi-Level Memory System** - Intelligent context management
|
|
38
|
+
- ShortTermMemory with auto-summarization and decay
|
|
39
|
+
- LongTermMemory with semantic search (RAG) support
|
|
40
|
+
- EntityMemory for tracking entities and facts
|
|
41
|
+
- MemorySystem unified interface
|
|
42
|
+
- Importance scoring and time-based decay
|
|
43
|
+
|
|
44
|
+
#### ๐ฏ Phase 3: Production Robustness
|
|
45
|
+
|
|
46
|
+
- **Structured Output Validation** - Ensure AI outputs conform to schemas
|
|
47
|
+
- JSON Schema validation with automatic retry
|
|
48
|
+
- Error feedback loop for self-correction
|
|
49
|
+
- Support for complex nested objects, arrays, patterns
|
|
50
|
+
- Helper functions: validateJSON(), createSchema()
|
|
51
|
+
- **Comprehensive Metrics & Observability** - Track performance and costs
|
|
52
|
+
- MetricsTracker for workflow execution tracking
|
|
53
|
+
- TokenCounter with estimation (~4 chars/token)
|
|
54
|
+
- Cost calculation for major models (GPT-4, Claude, etc.)
|
|
55
|
+
- PerformanceProfiler with mark/measure API
|
|
56
|
+
- OpenTelemetry export format support
|
|
57
|
+
- Custom metrics support
|
|
58
|
+
|
|
59
|
+
### Added - Examples & Documentation
|
|
60
|
+
|
|
61
|
+
- ๐ 6 comprehensive examples demonstrating all new features:
|
|
62
|
+
- graph-workflow.ts - Complex workflows with conditional logic
|
|
63
|
+
- tool-calling.ts - Agent function calling
|
|
64
|
+
- memory-system.ts - Multi-level context management
|
|
65
|
+
- structured-output.ts - Output validation with retry
|
|
66
|
+
- metrics-tracking.ts - Performance and cost tracking
|
|
67
|
+
- complete-integration.ts - Full integration example
|
|
68
|
+
- ๐ examples/README.md with setup instructions and troubleshooting
|
|
69
|
+
|
|
70
|
+
### Added - Testing
|
|
71
|
+
|
|
72
|
+
- โ
5 new test suites with 100+ test cases:
|
|
73
|
+
- graph.test.ts - Graph execution engine tests
|
|
74
|
+
- tools.test.ts - Tool calling system tests
|
|
75
|
+
- memory.test.ts - Memory system tests (30+ cases)
|
|
76
|
+
- validation.test.ts - Validation tests (25+ cases)
|
|
77
|
+
- metrics.test.ts - Metrics tracking tests (20+ cases)
|
|
78
|
+
- Total: 138 tests across 10 test suites
|
|
79
|
+
|
|
80
|
+
### Changed
|
|
81
|
+
|
|
82
|
+
- Updated exports in index.ts to include all new modules
|
|
83
|
+
- Improved tool extraction logic to handle JSON outputs correctly
|
|
84
|
+
|
|
85
|
+
## [0.0.1] - Unreleased
|
|
86
|
+
|
|
87
|
+
First public pre-release.
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
|
|
91
|
+
- ๐ Initial release of SocietyAI โ TypeScript multi-agent orchestration framework
|
|
92
|
+
- ๐ค Multi-agent execution patterns: sequential, parallel, collaborative, conditional
|
|
93
|
+
- ๐งฑ Workflow configuration builders: `RoleBuilder`, `AgentBuilder`, `StepBuilder`, `WorkflowConfigBuilder`
|
|
94
|
+
- ๐๏ธ Fluent Society builder (`Society.create()`) with pipeline helpers (`Pipelines`, `Strategies`)
|
|
95
|
+
- ๐ Model abstraction via `StandardModelBase` and adapter-style integrations
|
|
96
|
+
- โก Worker pool for parallel execution
|
|
97
|
+
- ๐ Retry with exponential backoff and jitter (`RetryExecutor`)
|
|
98
|
+
- โฑ๏ธ Cancellation/timeouts via `AbortSignal`
|
|
99
|
+
- ๐ Logging + observer hooks for lifecycle monitoring
|
|
100
|
+
- ๐ Middleware system for models and workflow steps
|
|
101
|
+
- ๐ Full documentation and API reference in `docs/`
|
|
102
|
+
- ๐งช Jest test suite (49 tests)
|
|
103
|
+
|
|
104
|
+
### Removed
|
|
105
|
+
|
|
106
|
+
- Legacy function-based API (`society()`, `societyCollaborative()`, `runSociety*()`, etc.) โ use the workflow/builder API instead.
|
|
107
|
+
|
|
108
|
+
### Fixed
|
|
109
|
+
|
|
110
|
+
- Documentation language consistency
|
|
111
|
+
- Builder API exports (`createRole()`, `createAgent()` helpers exposed)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SocietyAI Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|