@loopstack/agent-example-workflow 0.1.2 → 0.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-example.module.d.ts","sourceRoot":"","sources":["../src/agent-example.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-example.module.d.ts","sourceRoot":"","sources":["../src/agent-example.module.ts"],"names":[],"mappings":"AAMA,qBAKa,kBAAkB;CAAG"}
|
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.AgentExampleModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const agent_1 = require("@loopstack/agent");
|
|
12
|
-
const core_1 = require("@loopstack/core");
|
|
13
12
|
const agent_example_workflow_1 = require("./agent-example.workflow");
|
|
14
13
|
const calculator_tool_1 = require("./tools/calculator.tool");
|
|
15
14
|
const weather_lookup_tool_1 = require("./tools/weather-lookup.tool");
|
|
@@ -18,7 +17,7 @@ let AgentExampleModule = class AgentExampleModule {
|
|
|
18
17
|
exports.AgentExampleModule = AgentExampleModule;
|
|
19
18
|
exports.AgentExampleModule = AgentExampleModule = __decorate([
|
|
20
19
|
(0, common_1.Module)({
|
|
21
|
-
imports: [
|
|
20
|
+
imports: [agent_1.AgentModule],
|
|
22
21
|
providers: [agent_example_workflow_1.AgentExampleWorkflow, calculator_tool_1.CalculatorTool, weather_lookup_tool_1.WeatherLookupTool],
|
|
23
22
|
exports: [agent_example_workflow_1.AgentExampleWorkflow, calculator_tool_1.CalculatorTool, weather_lookup_tool_1.WeatherLookupTool],
|
|
24
23
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-example.module.js","sourceRoot":"","sources":["../src/agent-example.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,4CAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"agent-example.module.js","sourceRoot":"","sources":["../src/agent-example.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,4CAA+C;AAC/C,qEAAgE;AAChE,6DAAyD;AACzD,qEAAgE;AAOzD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAL9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,mBAAW,CAAC;QACtB,SAAS,EAAE,CAAC,6CAAoB,EAAE,gCAAc,EAAE,uCAAiB,CAAC;QACpE,OAAO,EAAE,CAAC,6CAAoB,EAAE,gCAAc,EAAE,uCAAiB,CAAC;KACnE,CAAC;GACW,kBAAkB,CAAG"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"claude",
|
|
10
10
|
"sub-workflow"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.1
|
|
12
|
+
"version": "0.2.1",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "Jakob Klippel",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"compile": "tsc --noEmit",
|
|
27
27
|
"format": "prettier --write .",
|
|
28
28
|
"lint": "eslint .",
|
|
29
|
-
"test": "
|
|
29
|
+
"test": "vitest run",
|
|
30
30
|
"watch": "nest build --watch"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@loopstack/agent": "^0.
|
|
34
|
-
"@loopstack/common": "^0.
|
|
35
|
-
"@loopstack/core": "^0.
|
|
33
|
+
"@loopstack/agent": "^0.4.1",
|
|
34
|
+
"@loopstack/common": "^0.31.0",
|
|
35
|
+
"@loopstack/core": "^0.31.0",
|
|
36
36
|
"@nestjs/common": "^11.1.19",
|
|
37
37
|
"zod": "^4.3.6"
|
|
38
38
|
},
|
|
@@ -40,46 +40,9 @@
|
|
|
40
40
|
"dist",
|
|
41
41
|
"src"
|
|
42
42
|
],
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"transform": {
|
|
48
|
-
"^.+\\.ts$": "ts-jest"
|
|
49
|
-
},
|
|
50
|
-
"testTimeout": 10000,
|
|
51
|
-
"forceExit": true,
|
|
52
|
-
"maxWorkers": 1
|
|
53
|
-
},
|
|
54
|
-
"loopstack": {
|
|
55
|
-
"modules": [
|
|
56
|
-
{
|
|
57
|
-
"path": "src/agent-example.module.ts",
|
|
58
|
-
"className": "AgentExampleModule"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
"workflows": [
|
|
62
|
-
{
|
|
63
|
-
"path": "src/agent-example.workflow.ts",
|
|
64
|
-
"className": "AgentExampleWorkflow",
|
|
65
|
-
"propertyName": "agentExample"
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"tools": [
|
|
69
|
-
{
|
|
70
|
-
"path": "src/tools/calculator.tool.ts",
|
|
71
|
-
"className": "CalculatorTool",
|
|
72
|
-
"propertyName": "calculator"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"path": "src/tools/weather-lookup.tool.ts",
|
|
76
|
-
"className": "WeatherLookupTool",
|
|
77
|
-
"propertyName": "weatherLookup"
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
"installModes": [
|
|
81
|
-
"add",
|
|
82
|
-
"install"
|
|
83
|
-
]
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"vitest": "^4.1.6",
|
|
45
|
+
"@swc/core": "^1.15.33",
|
|
46
|
+
"unplugin-swc": "^1.5.9"
|
|
84
47
|
}
|
|
85
48
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TestingModule } from '@nestjs/testing';
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
3
|
import { AgentWorkflow } from '@loopstack/agent';
|
|
3
4
|
import { RunContext, WorkflowEntity } from '@loopstack/common';
|
|
4
|
-
import {
|
|
5
|
+
import { WorkflowProcessorService } from '@loopstack/core';
|
|
5
6
|
import { createStatelessContext, createWorkflowTest } from '@loopstack/testing';
|
|
6
7
|
import { AgentExampleWorkflow } from '../agent-example.workflow';
|
|
7
8
|
import { CalculatorTool } from '../tools/calculator.tool';
|
|
@@ -13,15 +14,14 @@ describe('AgentExampleWorkflow', () => {
|
|
|
13
14
|
let processor: WorkflowProcessorService;
|
|
14
15
|
|
|
15
16
|
const mockAgent = {
|
|
16
|
-
run:
|
|
17
|
+
run: vi.fn(),
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
beforeEach(async () => {
|
|
20
|
-
|
|
21
|
+
vi.clearAllMocks();
|
|
21
22
|
|
|
22
23
|
module = await createWorkflowTest()
|
|
23
24
|
.forWorkflow(AgentExampleWorkflow)
|
|
24
|
-
.withImports(LoopCoreModule)
|
|
25
25
|
.withProviders(CalculatorTool, WeatherLookupTool)
|
|
26
26
|
.withMock(AgentWorkflow, mockAgent)
|
|
27
27
|
.compile();
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Module } from '@nestjs/common';
|
|
2
2
|
import { AgentModule } from '@loopstack/agent';
|
|
3
|
-
import { LoopCoreModule } from '@loopstack/core';
|
|
4
3
|
import { AgentExampleWorkflow } from './agent-example.workflow';
|
|
5
4
|
import { CalculatorTool } from './tools/calculator.tool';
|
|
6
5
|
import { WeatherLookupTool } from './tools/weather-lookup.tool';
|
|
7
6
|
|
|
8
7
|
@Module({
|
|
9
|
-
imports: [
|
|
8
|
+
imports: [AgentModule],
|
|
10
9
|
providers: [AgentExampleWorkflow, CalculatorTool, WeatherLookupTool],
|
|
11
10
|
exports: [AgentExampleWorkflow, CalculatorTool, WeatherLookupTool],
|
|
12
11
|
})
|