@ellyco/agentic 0.1.1 → 0.1.2
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 +12 -12
- package/dist/graphs/graph.js +1 -1
- package/dist/graphs/index.d.ts +9 -6
- package/dist/graphs/index.d.ts.map +1 -1
- package/dist/graphs/index.js +23 -12
- package/dist/graphs/index.js.map +1 -1
- package/dist/graphs/store/index.d.ts +4 -0
- package/dist/graphs/store/index.d.ts.map +1 -0
- package/dist/graphs/store/index.js +20 -0
- package/dist/graphs/store/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +20 -0
- package/dist/models/index.js.map +1 -0
- package/dist/nodes/index.d.ts +4 -3
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +18 -6
- package/dist/nodes/index.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ A powerful TypeScript framework for building stateful, agentic workflows with bu
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install ellyco
|
|
20
|
+
npm install @ellyco/agentic
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
### Dependencies
|
|
@@ -31,7 +31,7 @@ npm install ellyco-agentic
|
|
|
31
31
|
### 1. Define Your Messages
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
|
-
import { SystemMessage, UserMessage, AgentMessage } from 'ellyco
|
|
34
|
+
import { SystemMessage, UserMessage, AgentMessage } from '@ellyco/agentic';
|
|
35
35
|
|
|
36
36
|
const systemMsg = new SystemMessage(
|
|
37
37
|
"You are a helpful assistant that processes data."
|
|
@@ -46,7 +46,7 @@ userMsg.interpolate({ data: "important info" });
|
|
|
46
46
|
### 2. Define Your Tools
|
|
47
47
|
|
|
48
48
|
```typescript
|
|
49
|
-
import { defineTool, tool } from 'ellyco
|
|
49
|
+
import { defineTool, tool } from '@ellyco/agentic';
|
|
50
50
|
import { z } from 'zod';
|
|
51
51
|
|
|
52
52
|
const searchTool = defineTool(
|
|
@@ -70,7 +70,7 @@ const searchImplementation = tool(
|
|
|
70
70
|
### 3. Configure Your Model
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
|
-
import { BedrockModel } from 'ellyco
|
|
73
|
+
import { BedrockModel } from '@ellyco/agentic';
|
|
74
74
|
|
|
75
75
|
const model = new BedrockModel({
|
|
76
76
|
modelId: "anthropic.claude-3-sonnet-20240229-v1:0",
|
|
@@ -86,7 +86,7 @@ const response = await model.invoke([userMsg]);
|
|
|
86
86
|
### 4. Build a Graph
|
|
87
87
|
|
|
88
88
|
```typescript
|
|
89
|
-
import { StateMachine, makeNode } from 'ellyco
|
|
89
|
+
import { StateMachine, makeNode } from '@ellyco/agentic';
|
|
90
90
|
import { z } from 'zod';
|
|
91
91
|
|
|
92
92
|
const schema = z.object({
|
|
@@ -178,7 +178,7 @@ Nodes are the building blocks of graphs - they execute logic and return partial
|
|
|
178
178
|
Simple synchronous or asynchronous functions.
|
|
179
179
|
|
|
180
180
|
```typescript
|
|
181
|
-
import { makeNode } from 'ellyco
|
|
181
|
+
import { makeNode } from '@ellyco/agentic';
|
|
182
182
|
|
|
183
183
|
const node = makeNode((state, context) => ({
|
|
184
184
|
processed: true,
|
|
@@ -212,7 +212,7 @@ const confirmNode = new InterruptNode(
|
|
|
212
212
|
Messages represent communication in the system with different roles:
|
|
213
213
|
|
|
214
214
|
```typescript
|
|
215
|
-
import { SystemMessage, UserMessage, AgentMessage } from 'ellyco
|
|
215
|
+
import { SystemMessage, UserMessage, AgentMessage } from '@ellyco/agentic';
|
|
216
216
|
|
|
217
217
|
// System messages set context
|
|
218
218
|
const system = new SystemMessage("You are a data analyst");
|
|
@@ -230,7 +230,7 @@ const agent = new AgentMessage("The analysis shows...");
|
|
|
230
230
|
Tools enable models to request external operations:
|
|
231
231
|
|
|
232
232
|
```typescript
|
|
233
|
-
import { ToolRequest, ToolResponse, ToolError } from 'ellyco
|
|
233
|
+
import { ToolRequest, ToolResponse, ToolError } from '@ellyco/agentic';
|
|
234
234
|
|
|
235
235
|
// Model requests a tool
|
|
236
236
|
const request = new ToolRequest(
|
|
@@ -296,7 +296,7 @@ if (result.exitReason === "interrupt") {
|
|
|
296
296
|
Use SQLite to persist and resume runs across sessions:
|
|
297
297
|
|
|
298
298
|
```typescript
|
|
299
|
-
import { SQLiteStore } from 'ellyco
|
|
299
|
+
import { SQLiteStore } from '@ellyco/agentic';
|
|
300
300
|
import Database from 'better-sqlite3';
|
|
301
301
|
|
|
302
302
|
// Setup database
|
|
@@ -348,7 +348,7 @@ console.log(result.explanation); // string
|
|
|
348
348
|
Implement your own model provider:
|
|
349
349
|
|
|
350
350
|
```typescript
|
|
351
|
-
import { BaseModel, InvokeResponse, ModelMessages } from 'ellyco
|
|
351
|
+
import { BaseModel, InvokeResponse, ModelMessages } from '@ellyco/agentic';
|
|
352
352
|
|
|
353
353
|
class MyCustomModel extends BaseModel {
|
|
354
354
|
protected async runModel(
|
|
@@ -376,7 +376,7 @@ const model = new MyCustomModel({ temperature: 0.7 });
|
|
|
376
376
|
Use the mock model for testing without hitting real APIs:
|
|
377
377
|
|
|
378
378
|
```typescript
|
|
379
|
-
import { TestModel, TestResponseConfig } from 'ellyco
|
|
379
|
+
import { TestModel, TestResponseConfig } from '@ellyco/agentic';
|
|
380
380
|
|
|
381
381
|
const testModel = new TestModel({ temperature: 0.7 });
|
|
382
382
|
|
|
@@ -628,7 +628,7 @@ import {
|
|
|
628
628
|
SQLiteStore,
|
|
629
629
|
defineTool,
|
|
630
630
|
tool
|
|
631
|
-
} from 'ellyco
|
|
631
|
+
} from '@ellyco/agentic';
|
|
632
632
|
import { z } from 'zod';
|
|
633
633
|
import Database from 'better-sqlite3';
|
|
634
634
|
|
package/dist/graphs/graph.js
CHANGED
|
@@ -5,7 +5,7 @@ const runtime_context_1 = require("./runtime-context");
|
|
|
5
5
|
const cuid2_1 = require("@paralleldrive/cuid2");
|
|
6
6
|
const merge_state_1 = require("./merge-state");
|
|
7
7
|
const api_1 = require("@opentelemetry/api");
|
|
8
|
-
const tracer = api_1.trace.getTracer("@ellyco/agentic", "0.1.
|
|
8
|
+
const tracer = api_1.trace.getTracer("@ellyco/agentic", "0.1.2");
|
|
9
9
|
/**
|
|
10
10
|
* Special node name indicating the start of graph execution
|
|
11
11
|
*/
|
package/dist/graphs/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export * from "./store";
|
|
2
|
+
export * from "./graph";
|
|
3
|
+
export * from "./iterator";
|
|
4
|
+
export * from "./merge-state";
|
|
5
|
+
export * from "./node-sequence";
|
|
6
|
+
export * from "./registry";
|
|
7
|
+
export * from "./runtime-context";
|
|
8
|
+
export * from "./state-machine";
|
|
9
|
+
export * from "./types";
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graphs/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graphs/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
package/dist/graphs/index.js
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, "ContextLayer", { enumerable: true, get: function () { return runtime_context_1.ContextLayer; } });
|
|
13
|
-
var registry_1 = require("./registry");
|
|
14
|
-
Object.defineProperty(exports, "STATE_MERGE", { enumerable: true, get: function () { return registry_1.STATE_MERGE; } });
|
|
17
|
+
__exportStar(require("./store"), exports);
|
|
18
|
+
__exportStar(require("./graph"), exports);
|
|
19
|
+
__exportStar(require("./iterator"), exports);
|
|
20
|
+
__exportStar(require("./merge-state"), exports);
|
|
21
|
+
__exportStar(require("./node-sequence"), exports);
|
|
22
|
+
__exportStar(require("./registry"), exports);
|
|
23
|
+
__exportStar(require("./runtime-context"), exports);
|
|
24
|
+
__exportStar(require("./state-machine"), exports);
|
|
25
|
+
__exportStar(require("./types"), exports);
|
|
15
26
|
//# sourceMappingURL=index.js.map
|
package/dist/graphs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graphs/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graphs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,0CAAwB;AACxB,6CAA2B;AAC3B,gDAA8B;AAC9B,kDAAgC;AAChC,6CAA2B;AAC3B,oDAAkC;AAClC,kDAAgC;AAChC,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/graphs/store/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./base-store"), exports);
|
|
18
|
+
__exportStar(require("./sqlite-store"), exports);
|
|
19
|
+
__exportStar(require("./stored-run"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graphs/store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,iDAA+B;AAC/B,+CAA6B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./graphs"), exports);
|
|
18
|
+
__exportStar(require("./messages"), exports);
|
|
19
|
+
__exportStar(require("./models"), exports);
|
|
20
|
+
__exportStar(require("./nodes"), exports);
|
|
21
|
+
__exportStar(require("./tools"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./BaseModel"), exports);
|
|
18
|
+
__exportStar(require("./BedrockModel"), exports);
|
|
19
|
+
__exportStar(require("./TestModel"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,8CAA4B"}
|
package/dist/nodes/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from "./function-node";
|
|
2
|
+
export * from "./interrupt-node";
|
|
3
|
+
export * from "./model-node";
|
|
4
|
+
export * from "./types";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nodes/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
package/dist/nodes/index.js
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var interrupt_node_1 = require("./interrupt-node");
|
|
8
|
-
Object.defineProperty(exports, "InterruptNode", { enumerable: true, get: function () { return interrupt_node_1.InterruptNode; } });
|
|
17
|
+
__exportStar(require("./function-node"), exports);
|
|
18
|
+
__exportStar(require("./interrupt-node"), exports);
|
|
19
|
+
__exportStar(require("./model-node"), exports);
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
9
21
|
//# sourceMappingURL=index.js.map
|
package/dist/nodes/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nodes/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nodes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,mDAAiC;AACjC,+CAA6B;AAC7B,0CAAwB"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ellyco/agentic",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Simple AI Agent Library",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
8
10
|
"scripts": {
|
|
9
11
|
"test": "vitest",
|
|
10
12
|
"build": "tsc"
|