@oni.bot/core 0.6.3 → 0.8.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/CHANGELOG.md +111 -0
- package/README.md +315 -200
- package/SECURITY.md +71 -0
- package/dist/checkpointers/sqlite.d.ts.map +1 -1
- package/dist/checkpointers/sqlite.js +20 -18
- package/dist/checkpointers/sqlite.js.map +1 -1
- package/dist/circuit-breaker.d.ts +20 -0
- package/dist/circuit-breaker.d.ts.map +1 -0
- package/dist/circuit-breaker.js +58 -0
- package/dist/circuit-breaker.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +32 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +17 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/templates.d.ts +8 -0
- package/dist/cli/templates.d.ts.map +1 -0
- package/dist/cli/templates.js +119 -0
- package/dist/cli/templates.js.map +1 -0
- package/dist/dlq.d.ts +17 -0
- package/dist/dlq.d.ts.map +1 -0
- package/dist/dlq.js +41 -0
- package/dist/dlq.js.map +1 -0
- package/dist/errors.d.ts +36 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +163 -7
- package/dist/errors.js.map +1 -1
- package/dist/graph.d.ts +17 -0
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +13 -2
- package/dist/graph.js.map +1 -1
- package/dist/harness/agent-loop.d.ts +8 -0
- package/dist/harness/agent-loop.d.ts.map +1 -0
- package/dist/harness/agent-loop.js +327 -0
- package/dist/harness/agent-loop.js.map +1 -0
- package/dist/harness/context-compactor.d.ts +73 -0
- package/dist/harness/context-compactor.d.ts.map +1 -0
- package/dist/harness/context-compactor.js +162 -0
- package/dist/harness/context-compactor.js.map +1 -0
- package/dist/harness/harness.d.ts +41 -0
- package/dist/harness/harness.d.ts.map +1 -0
- package/dist/harness/harness.js +140 -0
- package/dist/harness/harness.js.map +1 -0
- package/dist/harness/hooks-engine.d.ts +71 -0
- package/dist/harness/hooks-engine.d.ts.map +1 -0
- package/dist/harness/hooks-engine.js +232 -0
- package/dist/harness/hooks-engine.js.map +1 -0
- package/dist/harness/index.d.ts +16 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +19 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/safety-gate.d.ts +29 -0
- package/dist/harness/safety-gate.d.ts.map +1 -0
- package/dist/harness/safety-gate.js +72 -0
- package/dist/harness/safety-gate.js.map +1 -0
- package/dist/harness/skill-loader.d.ts +63 -0
- package/dist/harness/skill-loader.d.ts.map +1 -0
- package/dist/harness/skill-loader.js +214 -0
- package/dist/harness/skill-loader.js.map +1 -0
- package/dist/harness/todo-module.d.ts +39 -0
- package/dist/harness/todo-module.d.ts.map +1 -0
- package/dist/harness/todo-module.js +179 -0
- package/dist/harness/todo-module.js.map +1 -0
- package/dist/harness/types.d.ts +78 -0
- package/dist/harness/types.d.ts.map +1 -0
- package/dist/harness/types.js +9 -0
- package/dist/harness/types.js.map +1 -0
- package/dist/hitl/interrupt.d.ts.map +1 -1
- package/dist/hitl/interrupt.js +7 -6
- package/dist/hitl/interrupt.js.map +1 -1
- package/dist/index.d.ts +14 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/models/google.d.ts.map +1 -1
- package/dist/models/google.js +7 -6
- package/dist/models/google.js.map +1 -1
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -1
- package/dist/models/openai.js +6 -1
- package/dist/models/openai.js.map +1 -1
- package/dist/models/openrouter.d.ts +13 -0
- package/dist/models/openrouter.d.ts.map +1 -0
- package/dist/models/openrouter.js +322 -0
- package/dist/models/openrouter.js.map +1 -0
- package/dist/prebuilt/tool-node.d.ts.map +1 -1
- package/dist/prebuilt/tool-node.js +0 -1
- package/dist/prebuilt/tool-node.js.map +1 -1
- package/dist/pregel.d.ts +11 -1
- package/dist/pregel.d.ts.map +1 -1
- package/dist/pregel.js +88 -7
- package/dist/pregel.js.map +1 -1
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +6 -1
- package/dist/retry.js.map +1 -1
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +7 -1
- package/dist/store/index.js.map +1 -1
- package/dist/stream-events.js +2 -2
- package/dist/stream-events.js.map +1 -1
- package/dist/streaming.d.ts +10 -0
- package/dist/streaming.d.ts.map +1 -1
- package/dist/streaming.js +28 -0
- package/dist/streaming.js.map +1 -1
- package/dist/swarm/graph.d.ts.map +1 -1
- package/dist/swarm/graph.js +0 -4
- package/dist/swarm/graph.js.map +1 -1
- package/dist/swarm/supervisor.d.ts.map +1 -1
- package/dist/swarm/supervisor.js +0 -4
- package/dist/swarm/supervisor.js.map +1 -1
- package/dist/telemetry.d.ts +41 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +69 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/testing/index.d.ts +33 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +95 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +38 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to @oni.bot/core are documented here.
|
|
4
|
+
|
|
5
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.7.0] - 2026-03-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Structured error codes with `ONI_<CATEGORY>_<NAME>` taxonomy — every error carries code, category, recoverable flag, suggestion, and context
|
|
12
|
+
- Per-node timeouts via `addNode(name, fn, { timeout: ms })` with `NodeTimeoutError`
|
|
13
|
+
- Global default timeout via `compile({ defaults: { nodeTimeout: ms } })`
|
|
14
|
+
- Circuit breaker pattern: `addNode(name, fn, { circuitBreaker: { threshold, resetAfter, fallback? } })`
|
|
15
|
+
- Dead letter queue: `compile({ deadLetterQueue: true })` captures failed node inputs for recovery
|
|
16
|
+
- OpenTelemetry tracing adapter (`ONITracer`) — zero-dep, user brings own tracer
|
|
17
|
+
- Backpressure streaming with `BoundedBuffer` (drop-oldest and error strategies)
|
|
18
|
+
- Testing utilities: `mockModel()`, `assertGraph()`, `createTestHarness()` via `@oni.bot/core/testing`
|
|
19
|
+
- `oni init` CLI command for project scaffolding
|
|
20
|
+
- 7 new error types: `NodeTimeoutError`, `CircuitBreakerOpenError`, `SwarmDeadlockError`, `ModelRateLimitError`, `ModelContextLengthError`, `CheckpointCorruptError`, `StoreKeyNotFoundError`
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- `ONIError` now accepts optional `ONIErrorOptions` as second constructor parameter
|
|
24
|
+
- All existing error classes enhanced with structured codes (backward compatible)
|
|
25
|
+
|
|
26
|
+
## [0.6.3] - 2026-03-05
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- `set()` alias for `put()` on `InMemoryStore` and `NamespacedStore`
|
|
30
|
+
|
|
31
|
+
## [0.6.2] - 2026-03-05
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- `createReactAgent` now accepts `ONIModel` (auto-adapts chat to invoke)
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- Package renamed from `@oni-bot/core` to `@oni.bot/core`
|
|
38
|
+
|
|
39
|
+
## [0.6.1] - 2026-03-05
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
- Removed all external framework references from codebase and documentation
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
- Resolved TypeScript strict errors in swarm template `Send` casts
|
|
46
|
+
|
|
47
|
+
## [0.6.0] - 2026-03-04
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
- `SwarmGraph` builder for multi-agent orchestration
|
|
51
|
+
- `SwarmGraph.hierarchical()` template — supervisor-workers pattern
|
|
52
|
+
- `SwarmGraph.fanOut()` template — parallel agent execution with reducer
|
|
53
|
+
- `SwarmGraph.pipeline()` template — linear chain with conditional transitions
|
|
54
|
+
- `SwarmGraph.peerNetwork()` template — decentralized agent handoffs
|
|
55
|
+
- `SwarmGraph.mapReduce()` template — parallel map with reducer
|
|
56
|
+
- `SwarmGraph.debate()` template — multi-round parallel debate with judge
|
|
57
|
+
- `SwarmGraph.hierarchicalMesh()` template — nested team coordination
|
|
58
|
+
- Lazy coordination auto-wiring (broker and pubsub) on `SwarmGraph`
|
|
59
|
+
- Handoff execution — agent `Handoff` returns converted to `Command` routing
|
|
60
|
+
- Retry-then-fallback — agents retry on failure, fall back to supervisor
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
- Replaced `SwarmLLM` with `ONIModel` in supervisor routing
|
|
64
|
+
|
|
65
|
+
## [0.5.0] - 2026-03-04
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
- `ONIModel` interface and core LLM types
|
|
69
|
+
- Anthropic LLM adapter
|
|
70
|
+
- OpenAI LLM adapter
|
|
71
|
+
- Ollama LLM adapter
|
|
72
|
+
- Google Gemini LLM adapter
|
|
73
|
+
- Models export path and re-exports
|
|
74
|
+
- Tool framework with `defineTool()` and `ToolContext`
|
|
75
|
+
- `AgentContext` and agent types
|
|
76
|
+
- `defineAgent()` declarative agent factory
|
|
77
|
+
- `agent()` functional agent factory
|
|
78
|
+
- `addAgent()` on `StateGraph` to wire agent nodes
|
|
79
|
+
- Request/response and pub/sub coordination patterns
|
|
80
|
+
- Tool permission guardrails
|
|
81
|
+
- Budget tracking and cost control guardrails
|
|
82
|
+
- Content filtering guardrails
|
|
83
|
+
- Audit trail and guardrails exports
|
|
84
|
+
- `EventBus` for structured lifecycle events
|
|
85
|
+
- Guardrails and event bus wired into compile/execution pipeline
|
|
86
|
+
- Integration tests for agents, tools, and guardrails
|
|
87
|
+
|
|
88
|
+
### Removed
|
|
89
|
+
- Direct `openai` dependency (adapters are now bring-your-own-client)
|
|
90
|
+
|
|
91
|
+
## [0.4.0] - 2026-03-04
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
- `StateGraph` builder with `addNode()`, `addEdge()`, `addConditionalEdges()`
|
|
95
|
+
- Pregel execution engine (`ONIPregelRunner`) with parallel superstep execution
|
|
96
|
+
- `Command` and `Send` primitives for dynamic routing
|
|
97
|
+
- Subgraph support via `addSubgraph()`
|
|
98
|
+
- Functional API (`entrypoint`, `task`)
|
|
99
|
+
- `MemoryCheckpointer` and `NoopCheckpointer`
|
|
100
|
+
- `InMemoryStore` and `NamespacedStore` for shared key-value state
|
|
101
|
+
- Human-in-the-loop via `interrupt()` and `getUserInput()`
|
|
102
|
+
- Token streaming with `emitToken()` and `TokenStreamWriter`
|
|
103
|
+
- Stream modes: `values`, `updates`, `events`, `messages`, `custom`
|
|
104
|
+
- Graph inspection via `getGraphDef()`
|
|
105
|
+
- `createReactAgent` prebuilt for tool-calling loops
|
|
106
|
+
- `ToolNode` prebuilt for automatic tool dispatch
|
|
107
|
+
- Messages reducer (`messagesReducer`, `addMessages`, `removeMessages`)
|
|
108
|
+
- Retry policies with configurable backoff
|
|
109
|
+
- Swarm primitives: `AgentRegistry`, `AgentPool`, `Mailbox`, `Supervisor`
|
|
110
|
+
- Ephemeral channel support
|
|
111
|
+
- Map-reduce parallel fan-out pattern
|