@loopstack/meeting-notes-example-workflow 0.18.0 → 0.19.0-rc.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +23 -0
- package/README.md +19 -54
- package/dist/documents/meeting-notes-document.d.ts +3 -2
- package/dist/documents/meeting-notes-document.d.ts.map +1 -0
- package/dist/documents/meeting-notes-document.js +2 -3
- package/dist/documents/meeting-notes-document.js.map +1 -1
- package/dist/documents/optimized-notes-document.d.ts +3 -2
- package/dist/documents/optimized-notes-document.d.ts.map +1 -0
- package/dist/documents/optimized-notes-document.js +2 -3
- package/dist/documents/optimized-notes-document.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/meeting-notes-example.module.d.ts +1 -0
- package/dist/meeting-notes-example.module.d.ts.map +1 -0
- package/dist/meeting-notes-example.module.js +1 -2
- package/dist/meeting-notes-example.module.js.map +1 -1
- package/dist/meeting-notes.workflow.d.ts +2 -2
- package/dist/meeting-notes.workflow.d.ts.map +1 -0
- package/dist/meeting-notes.workflow.js +11 -10
- package/dist/meeting-notes.workflow.js.map +1 -1
- package/loopstack-module.json +4 -0
- package/package.json +4 -5
- package/src/__tests__/meeting-notes.workflow.spec.ts +10 -15
- package/src/documents/meeting-notes-document.ts +3 -4
- package/src/documents/optimized-notes-document.ts +3 -4
- package/src/meeting-notes-example.module.ts +1 -2
- package/src/meeting-notes.workflow.ts +9 -8
- package/tsconfig.build.json +1 -0
- package/tsconfig.json +4 -15
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @loopstack/meeting-notes-example-workflow
|
|
2
2
|
|
|
3
|
+
## 0.19.0-rc.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#44](https://github.com/loopstack-ai/loopstack/pull/44) [`b20801c`](https://github.com/loopstack-ai/loopstack/commit/b20801ce956557dbd2eae22ae02c8d45954f8bf8) Thanks [@jakobklippel](https://github.com/jakobklippel)! - Replace abstract block classes with interfaces, various bugfixes
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`b20801c`](https://github.com/loopstack-ai/loopstack/commit/b20801ce956557dbd2eae22ae02c8d45954f8bf8)]:
|
|
12
|
+
- @loopstack/core-ui-module@0.19.0-rc.0
|
|
13
|
+
- @loopstack/ai-module@0.19.0-rc.0
|
|
14
|
+
- @loopstack/common@0.19.0-rc.0
|
|
15
|
+
|
|
16
|
+
## 0.18.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#36](https://github.com/loopstack-ai/loopstack/pull/36) [`1af9cd4`](https://github.com/loopstack-ai/loopstack/commit/1af9cd4edb37b60e3df677ba450ad22a936f447d) Thanks [@jakobklippel](https://github.com/jakobklippel)! - Add loopstack-module config and update readme files
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`1af9cd4`](https://github.com/loopstack-ai/loopstack/commit/1af9cd4edb37b60e3df677ba450ad22a936f447d)]:
|
|
23
|
+
- @loopstack/core-ui-module@0.18.1
|
|
24
|
+
- @loopstack/ai-module@0.18.1
|
|
25
|
+
|
|
3
26
|
## 0.18.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -20,82 +20,47 @@ This example is essential for developers building workflows that require human o
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
You can add this module using the `loopstack` cli or via `npm`.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### a) Add Sources via `loopstack add` (recommended)
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
|
|
29
|
-
cd my-project
|
|
28
|
+
loopstack add @loopstack/meeting-notes-example-workflow
|
|
30
29
|
```
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
This command copies the source files into your `src` directory.
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
docker compose up -d
|
|
37
|
-
```
|
|
33
|
+
- It is a great way to explore the code to learn new concepts or add own customizations
|
|
34
|
+
- It will set up the module for you, so you do not need to manually update your application
|
|
38
35
|
|
|
39
|
-
###
|
|
36
|
+
### b) Install via `npm install`
|
|
40
37
|
|
|
41
38
|
```bash
|
|
42
|
-
|
|
39
|
+
npm install --save @loopstack/meeting-notes-example-workflow
|
|
43
40
|
```
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
Use npm install if you want to use and maintain the module as node dependency.
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
- Use this, if you do not need to make changes to the code or want to review the source code.
|
|
48
45
|
|
|
49
46
|
## Setup
|
|
50
47
|
|
|
51
|
-
### 1.
|
|
48
|
+
### 1. Configure API Key
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
Set your OpenAI API key as an environment variable:
|
|
54
51
|
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
import { AiModule } from '@loopstack/ai-module';
|
|
58
|
-
import { LoopCoreModule } from '@loopstack/core';
|
|
59
|
-
import { CoreUiModule } from '@loopstack/core-ui-module';
|
|
60
|
-
import { MeetingNotesExampleModule } from './@loopstack/meeting-notes-example-workflow';
|
|
61
|
-
import { DefaultWorkspace } from './default.workspace';
|
|
62
|
-
|
|
63
|
-
@Module({
|
|
64
|
-
imports: [LoopCoreModule, MeetingNotesExampleModule],
|
|
65
|
-
providers: [DefaultWorkspace],
|
|
66
|
-
})
|
|
67
|
-
export class DefaultModule {}
|
|
52
|
+
```bash
|
|
53
|
+
OPENAI_API_KEY=sk-...
|
|
68
54
|
```
|
|
69
55
|
|
|
70
|
-
### 2.
|
|
56
|
+
### 2. Manual setup (optional)
|
|
71
57
|
|
|
72
|
-
|
|
58
|
+
> This step is automatically done for you when using the `loopstack add` command.
|
|
73
59
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
import { BlockConfig, Workflow } from '@loopstack/common';
|
|
77
|
-
import { WorkspaceBase } from '@loopstack/core';
|
|
78
|
-
import { MeetingNotesWorkflow } from './@loopstack/meeting-notes-example-workflow';
|
|
79
|
-
|
|
80
|
-
@Injectable()
|
|
81
|
-
@BlockConfig({
|
|
82
|
-
config: {
|
|
83
|
-
title: 'My Workspace',
|
|
84
|
-
description: 'A workspace with the meeting notes example workflow',
|
|
85
|
-
},
|
|
86
|
-
})
|
|
87
|
-
export class MyWorkspace extends WorkspaceBase {
|
|
88
|
-
@Workflow() meetingNotesWorkflow: MeetingNotesWorkflow;
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### 3. Configure API Key
|
|
93
|
-
|
|
94
|
-
Set your OpenAI API key as an environment variable:
|
|
60
|
+
- Add `MeetingNotesExampleModule` to the imports of `default.module.ts` or any other custom module.
|
|
61
|
+
- Inject the `MeetingNotesWorkflow` workflow to your workspace class using the `@InjectWorkflow()` decorator.
|
|
95
62
|
|
|
96
|
-
|
|
97
|
-
OPENAI_API_KEY=sk-...
|
|
98
|
-
```
|
|
63
|
+
See here for more information about working with [Modules](https://loopstack.ai/docs/building-with-loopstack/creating-a-module) and [Workspaces](https://loopstack.ai/docs/building-with-loopstack/creating-workspaces)
|
|
99
64
|
|
|
100
65
|
## How It Works
|
|
101
66
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { DocumentInterface } from '@loopstack/common';
|
|
3
3
|
export declare const MeetingNotesDocumentSchema: z.ZodObject<{
|
|
4
4
|
text: z.ZodString;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
export declare class MeetingNotesDocument
|
|
6
|
+
export declare class MeetingNotesDocument implements DocumentInterface {
|
|
7
7
|
}
|
|
8
|
+
//# sourceMappingURL=meeting-notes-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meeting-notes-document.d.ts","sourceRoot":"","sources":["../../src/documents/meeting-notes-document.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAY,iBAAiB,EAAiB,MAAM,mBAAmB,CAAC;AAE/E,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,qBAKa,oBAAqB,YAAW,iBAAiB;CAAG"}
|
|
@@ -10,16 +10,15 @@ exports.MeetingNotesDocument = exports.MeetingNotesDocumentSchema = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const zod_1 = require("zod");
|
|
12
12
|
const common_2 = require("@loopstack/common");
|
|
13
|
-
const core_1 = require("@loopstack/core");
|
|
14
13
|
exports.MeetingNotesDocumentSchema = zod_1.z.object({
|
|
15
14
|
text: zod_1.z.string(),
|
|
16
15
|
});
|
|
17
|
-
let MeetingNotesDocument = class MeetingNotesDocument
|
|
16
|
+
let MeetingNotesDocument = class MeetingNotesDocument {
|
|
18
17
|
};
|
|
19
18
|
exports.MeetingNotesDocument = MeetingNotesDocument;
|
|
20
19
|
exports.MeetingNotesDocument = MeetingNotesDocument = __decorate([
|
|
21
20
|
(0, common_1.Injectable)(),
|
|
22
|
-
(0, common_2.
|
|
21
|
+
(0, common_2.Document)({
|
|
23
22
|
configFile: __dirname + '/meeting-notes-document.yaml',
|
|
24
23
|
}),
|
|
25
24
|
(0, common_2.WithArguments)(exports.MeetingNotesDocumentSchema)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meeting-notes-document.js","sourceRoot":"","sources":["../../src/documents/meeting-notes-document.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,6BAAwB;AACxB,8CAA+
|
|
1
|
+
{"version":3,"file":"meeting-notes-document.js","sourceRoot":"","sources":["../../src/documents/meeting-notes-document.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,6BAAwB;AACxB,8CAA+E;AAElE,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAOI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAgC,CAAA;AAApD,oDAAoB;+BAApB,oBAAoB;IALhC,IAAA,mBAAU,GAAE;IACZ,IAAA,iBAAQ,EAAC;QACR,UAAU,EAAE,SAAS,GAAG,8BAA8B;KACvD,CAAC;IACD,IAAA,sBAAa,EAAC,kCAA0B,CAAC;GAC7B,oBAAoB,CAAgC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { DocumentInterface } from '@loopstack/common';
|
|
3
3
|
export declare const OptimizedMeetingNotesDocumentSchema: z.ZodObject<{
|
|
4
4
|
date: z.ZodString;
|
|
5
5
|
summary: z.ZodString;
|
|
@@ -7,5 +7,6 @@ export declare const OptimizedMeetingNotesDocumentSchema: z.ZodObject<{
|
|
|
7
7
|
decisions: z.ZodArray<z.ZodString>;
|
|
8
8
|
actionItems: z.ZodArray<z.ZodString>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
|
-
export declare class OptimizedNotesDocument
|
|
10
|
+
export declare class OptimizedNotesDocument implements DocumentInterface {
|
|
11
11
|
}
|
|
12
|
+
//# sourceMappingURL=optimized-notes-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optimized-notes-document.d.ts","sourceRoot":"","sources":["../../src/documents/optimized-notes-document.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAY,iBAAiB,EAAiB,MAAM,mBAAmB,CAAC;AAE/E,eAAO,MAAM,mCAAmC;;;;;;iBAM9C,CAAC;AAEH,qBAKa,sBAAuB,YAAW,iBAAiB;CAAG"}
|
|
@@ -10,7 +10,6 @@ exports.OptimizedNotesDocument = exports.OptimizedMeetingNotesDocumentSchema = v
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const zod_1 = require("zod");
|
|
12
12
|
const common_2 = require("@loopstack/common");
|
|
13
|
-
const core_1 = require("@loopstack/core");
|
|
14
13
|
exports.OptimizedMeetingNotesDocumentSchema = zod_1.z.object({
|
|
15
14
|
date: zod_1.z.string(),
|
|
16
15
|
summary: zod_1.z.string(),
|
|
@@ -18,12 +17,12 @@ exports.OptimizedMeetingNotesDocumentSchema = zod_1.z.object({
|
|
|
18
17
|
decisions: zod_1.z.array(zod_1.z.string()),
|
|
19
18
|
actionItems: zod_1.z.array(zod_1.z.string()),
|
|
20
19
|
});
|
|
21
|
-
let OptimizedNotesDocument = class OptimizedNotesDocument
|
|
20
|
+
let OptimizedNotesDocument = class OptimizedNotesDocument {
|
|
22
21
|
};
|
|
23
22
|
exports.OptimizedNotesDocument = OptimizedNotesDocument;
|
|
24
23
|
exports.OptimizedNotesDocument = OptimizedNotesDocument = __decorate([
|
|
25
24
|
(0, common_1.Injectable)(),
|
|
26
|
-
(0, common_2.
|
|
25
|
+
(0, common_2.Document)({
|
|
27
26
|
configFile: __dirname + '/optimized-notes-document.yaml',
|
|
28
27
|
}),
|
|
29
28
|
(0, common_2.WithArguments)(exports.OptimizedMeetingNotesDocumentSchema)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimized-notes-document.js","sourceRoot":"","sources":["../../src/documents/optimized-notes-document.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,6BAAwB;AACxB,8CAA+
|
|
1
|
+
{"version":3,"file":"optimized-notes-document.js","sourceRoot":"","sources":["../../src/documents/optimized-notes-document.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,6BAAwB;AACxB,8CAA+E;AAElE,QAAA,mCAAmC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1D,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IACjC,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;CACjC,CAAC,CAAC;AAOI,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAAgC,CAAA;AAAtD,wDAAsB;iCAAtB,sBAAsB;IALlC,IAAA,mBAAU,GAAE;IACZ,IAAA,iBAAQ,EAAC;QACR,UAAU,EAAE,SAAS,GAAG,gCAAgC;KACzD,CAAC;IACD,IAAA,sBAAa,EAAC,2CAAmC,CAAC;GACtC,sBAAsB,CAAgC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meeting-notes-example.module.d.ts","sourceRoot":"","sources":["../src/meeting-notes-example.module.ts"],"names":[],"mappings":"AAOA,qBAKa,yBAAyB;CAAG"}
|
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.MeetingNotesExampleModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const ai_module_1 = require("@loopstack/ai-module");
|
|
12
|
-
const core_1 = require("@loopstack/core");
|
|
13
12
|
const core_ui_module_1 = require("@loopstack/core-ui-module");
|
|
14
13
|
const meeting_notes_document_1 = require("./documents/meeting-notes-document");
|
|
15
14
|
const optimized_notes_document_1 = require("./documents/optimized-notes-document");
|
|
@@ -19,7 +18,7 @@ let MeetingNotesExampleModule = class MeetingNotesExampleModule {
|
|
|
19
18
|
exports.MeetingNotesExampleModule = MeetingNotesExampleModule;
|
|
20
19
|
exports.MeetingNotesExampleModule = MeetingNotesExampleModule = __decorate([
|
|
21
20
|
(0, common_1.Module)({
|
|
22
|
-
imports: [
|
|
21
|
+
imports: [core_ui_module_1.CoreUiModule, ai_module_1.AiModule],
|
|
23
22
|
providers: [meeting_notes_workflow_1.MeetingNotesWorkflow, meeting_notes_document_1.MeetingNotesDocument, optimized_notes_document_1.OptimizedNotesDocument],
|
|
24
23
|
exports: [meeting_notes_workflow_1.MeetingNotesWorkflow],
|
|
25
24
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meeting-notes-example.module.js","sourceRoot":"","sources":["../src/meeting-notes-example.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,oDAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"meeting-notes-example.module.js","sourceRoot":"","sources":["../src/meeting-notes-example.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,oDAAgD;AAChD,8DAAyD;AACzD,+EAA0E;AAC1E,mFAA8E;AAC9E,qEAAgE;AAOzD,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAAG,CAAA;AAA5B,8DAAyB;oCAAzB,yBAAyB;IALrC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,6BAAY,EAAE,oBAAQ,CAAC;QACjC,SAAS,EAAE,CAAC,6CAAoB,EAAE,6CAAoB,EAAE,iDAAsB,CAAC;QAC/E,OAAO,EAAE,CAAC,6CAAoB,CAAC;KAChC,CAAC;GACW,yBAAyB,CAAG"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AiGenerateDocument } from '@loopstack/ai-module';
|
|
2
|
-
import { WorkflowBase } from '@loopstack/core';
|
|
3
2
|
import { CreateDocument } from '@loopstack/core-ui-module';
|
|
4
3
|
import { MeetingNotesDocument } from './documents/meeting-notes-document';
|
|
5
4
|
import { OptimizedNotesDocument } from './documents/optimized-notes-document';
|
|
6
|
-
export declare class MeetingNotesWorkflow
|
|
5
|
+
export declare class MeetingNotesWorkflow {
|
|
7
6
|
aiGenerateDocument: AiGenerateDocument;
|
|
8
7
|
createDocument: CreateDocument;
|
|
9
8
|
meetingNotesDocument: MeetingNotesDocument;
|
|
10
9
|
optimizedNotesDocument: OptimizedNotesDocument;
|
|
11
10
|
}
|
|
11
|
+
//# sourceMappingURL=meeting-notes.workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meeting-notes.workflow.d.ts","sourceRoot":"","sources":["../src/meeting-notes.workflow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAA8B,MAAM,oCAAoC,CAAC;AACtG,OAAO,EAAuC,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnH,qBAmBa,oBAAoB;IACjB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,cAAc,EAAE,cAAc,CAAC;IAC3B,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,sBAAsB,EAAE,sBAAsB,CAAC;CAClE"}
|
|
@@ -10,14 +10,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MeetingNotesWorkflow = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
13
14
|
const zod_1 = require("zod");
|
|
14
15
|
const ai_module_1 = require("@loopstack/ai-module");
|
|
15
|
-
const
|
|
16
|
-
const core_1 = require("@loopstack/core");
|
|
16
|
+
const common_2 = require("@loopstack/common");
|
|
17
17
|
const core_ui_module_1 = require("@loopstack/core-ui-module");
|
|
18
18
|
const meeting_notes_document_1 = require("./documents/meeting-notes-document");
|
|
19
19
|
const optimized_notes_document_1 = require("./documents/optimized-notes-document");
|
|
20
|
-
let MeetingNotesWorkflow = class MeetingNotesWorkflow
|
|
20
|
+
let MeetingNotesWorkflow = class MeetingNotesWorkflow {
|
|
21
21
|
aiGenerateDocument;
|
|
22
22
|
createDocument;
|
|
23
23
|
meetingNotesDocument;
|
|
@@ -25,31 +25,32 @@ let MeetingNotesWorkflow = class MeetingNotesWorkflow extends core_1.WorkflowBas
|
|
|
25
25
|
};
|
|
26
26
|
exports.MeetingNotesWorkflow = MeetingNotesWorkflow;
|
|
27
27
|
__decorate([
|
|
28
|
-
(0,
|
|
28
|
+
(0, common_2.InjectTool)(),
|
|
29
29
|
__metadata("design:type", ai_module_1.AiGenerateDocument)
|
|
30
30
|
], MeetingNotesWorkflow.prototype, "aiGenerateDocument", void 0);
|
|
31
31
|
__decorate([
|
|
32
|
-
(0,
|
|
32
|
+
(0, common_2.InjectTool)(),
|
|
33
33
|
__metadata("design:type", core_ui_module_1.CreateDocument)
|
|
34
34
|
], MeetingNotesWorkflow.prototype, "createDocument", void 0);
|
|
35
35
|
__decorate([
|
|
36
|
-
(0,
|
|
36
|
+
(0, common_2.InjectDocument)(),
|
|
37
37
|
__metadata("design:type", meeting_notes_document_1.MeetingNotesDocument)
|
|
38
38
|
], MeetingNotesWorkflow.prototype, "meetingNotesDocument", void 0);
|
|
39
39
|
__decorate([
|
|
40
|
-
(0,
|
|
40
|
+
(0, common_2.InjectDocument)(),
|
|
41
41
|
__metadata("design:type", optimized_notes_document_1.OptimizedNotesDocument)
|
|
42
42
|
], MeetingNotesWorkflow.prototype, "optimizedNotesDocument", void 0);
|
|
43
43
|
exports.MeetingNotesWorkflow = MeetingNotesWorkflow = __decorate([
|
|
44
|
-
(0, common_1.
|
|
44
|
+
(0, common_1.Injectable)(),
|
|
45
|
+
(0, common_2.Workflow)({
|
|
45
46
|
configFile: __dirname + '/meeting-notes.workflow.yaml',
|
|
46
47
|
}),
|
|
47
|
-
(0,
|
|
48
|
+
(0, common_2.WithArguments)(zod_1.z.object({
|
|
48
49
|
inputText: zod_1.z
|
|
49
50
|
.string()
|
|
50
51
|
.default('- meeting 1.1.2025\n- budget: need 2 cut costs sarah said\n- hire new person?? --> marketing\n- vendor pricing - follow up needed by anna'),
|
|
51
52
|
})),
|
|
52
|
-
(0,
|
|
53
|
+
(0, common_2.WithState)(zod_1.z.object({
|
|
53
54
|
meetingNotes: meeting_notes_document_1.MeetingNotesDocumentSchema.optional(),
|
|
54
55
|
optimizedNotes: optimized_notes_document_1.OptimizedMeetingNotesDocumentSchema.optional(),
|
|
55
56
|
}))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meeting-notes.workflow.js","sourceRoot":"","sources":["../src/meeting-notes.workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAAwB;AACxB,oDAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"meeting-notes.workflow.js","sourceRoot":"","sources":["../src/meeting-notes.workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6BAAwB;AACxB,oDAA0D;AAC1D,8CAAmG;AACnG,8DAA2D;AAC3D,+EAAsG;AACtG,mFAAmH;AAqB5G,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACjB,kBAAkB,CAAqB;IACvC,cAAc,CAAiB;IAC3B,oBAAoB,CAAuB;IAC3C,sBAAsB,CAAyB;CAClE,CAAA;AALY,oDAAoB;AACjB;IAAb,IAAA,mBAAU,GAAE;8BAAqB,8BAAkB;gEAAC;AACvC;IAAb,IAAA,mBAAU,GAAE;8BAAiB,+BAAc;4DAAC;AAC3B;IAAjB,IAAA,uBAAc,GAAE;8BAAuB,6CAAoB;kEAAC;AAC3C;IAAjB,IAAA,uBAAc,GAAE;8BAAyB,iDAAsB;oEAAC;+BAJtD,oBAAoB;IAnBhC,IAAA,mBAAU,GAAE;IACZ,IAAA,iBAAQ,EAAC;QACR,UAAU,EAAE,SAAS,GAAG,8BAA8B;KACvD,CAAC;IACD,IAAA,sBAAa,EACZ,OAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,OAAC;aACT,MAAM,EAAE;aACR,OAAO,CACN,2IAA2I,CAC5I;KACJ,CAAC,CACH;IACA,IAAA,kBAAS,EACR,OAAC,CAAC,MAAM,CAAC;QACP,YAAY,EAAE,mDAA0B,CAAC,QAAQ,EAAE;QACnD,cAAc,EAAE,8DAAmC,CAAC,QAAQ,EAAE;KAC/D,CAAC,CACH;GACY,oBAAoB,CAKhC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@loopstack/meeting-notes-example-workflow",
|
|
3
3
|
"displayName": "Loopstack Meeting Notes Example Worflow",
|
|
4
4
|
"description": "A complete workflow demonstrating how to create a workflow in loopstack based on a meeting notes summary use case.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.19.0-rc.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Jakob Klippel",
|
|
8
8
|
"url": "https://www.linkedin.com/in/jakob-klippel/"
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
"watch": "nest build --watch"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@loopstack/ai-module": "^0.
|
|
34
|
-
"@loopstack/common": "^0.
|
|
35
|
-
"@loopstack/core": "^0.
|
|
36
|
-
"@loopstack/core-ui-module": "^0.18.0",
|
|
33
|
+
"@loopstack/ai-module": "^0.19.0-rc.0",
|
|
34
|
+
"@loopstack/common": "^0.19.0-rc.0",
|
|
35
|
+
"@loopstack/core-ui-module": "^0.19.0-rc.0",
|
|
37
36
|
"@nestjs/common": "^11.1.12",
|
|
38
37
|
"zod": "^4.3.5"
|
|
39
38
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TestingModule } from '@nestjs/testing';
|
|
2
2
|
import { AiGenerateDocument, AiModule } from '@loopstack/ai-module';
|
|
3
|
-
import { generateObjectFingerprint } from '@loopstack/common';
|
|
4
|
-
import {
|
|
3
|
+
import { BlockExecutionContextDto, generateObjectFingerprint, getBlockTools } from '@loopstack/common';
|
|
4
|
+
import { WorkflowProcessorService } from '@loopstack/core';
|
|
5
5
|
import { CoreUiModule, CreateDocument } from '@loopstack/core-ui-module';
|
|
6
6
|
import { ToolMock, createWorkflowTest } from '@loopstack/testing';
|
|
7
7
|
import { MeetingNotesDocument } from '../documents/meeting-notes-document';
|
|
@@ -26,7 +26,7 @@ describe('MeetingNotesWorkflow', () => {
|
|
|
26
26
|
beforeEach(async () => {
|
|
27
27
|
module = await createWorkflowTest()
|
|
28
28
|
.forWorkflow(MeetingNotesWorkflow)
|
|
29
|
-
.withImports(
|
|
29
|
+
.withImports(CoreUiModule, AiModule)
|
|
30
30
|
.withProvider(MeetingNotesDocument)
|
|
31
31
|
.withProvider(OptimizedNotesDocument)
|
|
32
32
|
.withToolOverride(CreateDocument)
|
|
@@ -46,13 +46,8 @@ describe('MeetingNotesWorkflow', () => {
|
|
|
46
46
|
describe('initialization', () => {
|
|
47
47
|
it('should be defined with correct tools', () => {
|
|
48
48
|
expect(workflow).toBeDefined();
|
|
49
|
-
expect(workflow
|
|
50
|
-
expect(workflow
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should apply default argument value', () => {
|
|
54
|
-
const result = workflow.validate({});
|
|
55
|
-
expect(result.inputText).toContain('meeting 1.1.2025');
|
|
49
|
+
expect(getBlockTools(workflow)).toContain('createDocument');
|
|
50
|
+
expect(getBlockTools(workflow)).toContain('aiGenerateDocument');
|
|
56
51
|
});
|
|
57
52
|
});
|
|
58
53
|
|
|
@@ -86,7 +81,7 @@ describe('MeetingNotesWorkflow', () => {
|
|
|
86
81
|
);
|
|
87
82
|
|
|
88
83
|
// Verify history contains expected places
|
|
89
|
-
const history = result.state.
|
|
84
|
+
const history = result.state.getHistory();
|
|
90
85
|
const places = history.map((h) => h.metadata?.place);
|
|
91
86
|
expect(places).toContain('waiting_for_response');
|
|
92
87
|
});
|
|
@@ -114,7 +109,7 @@ describe('MeetingNotesWorkflow', () => {
|
|
|
114
109
|
// Create module with existing workflow state
|
|
115
110
|
const moduleWithState = await createWorkflowTest()
|
|
116
111
|
.forWorkflow(MeetingNotesWorkflow)
|
|
117
|
-
.withImports(
|
|
112
|
+
.withImports(CoreUiModule, AiModule)
|
|
118
113
|
.withProvider(MeetingNotesDocument)
|
|
119
114
|
.withProvider(OptimizedNotesDocument)
|
|
120
115
|
.withToolOverride(CreateDocument)
|
|
@@ -182,7 +177,7 @@ describe('MeetingNotesWorkflow', () => {
|
|
|
182
177
|
);
|
|
183
178
|
|
|
184
179
|
// Verify history contains expected places
|
|
185
|
-
const history = result.state.
|
|
180
|
+
const history = result.state.getHistory();
|
|
186
181
|
const places = history.map((h) => h.metadata?.place);
|
|
187
182
|
expect(places).toContain('response_received');
|
|
188
183
|
expect(places).toContain('notes_optimized');
|
|
@@ -206,7 +201,7 @@ describe('MeetingNotesWorkflow', () => {
|
|
|
206
201
|
// Create module with existing workflow state after AI optimization
|
|
207
202
|
const moduleWithState = await createWorkflowTest()
|
|
208
203
|
.forWorkflow(MeetingNotesWorkflow)
|
|
209
|
-
.withImports(
|
|
204
|
+
.withImports(CoreUiModule, AiModule)
|
|
210
205
|
.withProvider(MeetingNotesDocument)
|
|
211
206
|
.withProvider(OptimizedNotesDocument)
|
|
212
207
|
.withToolOverride(CreateDocument)
|
|
@@ -250,7 +245,7 @@ describe('MeetingNotesWorkflow', () => {
|
|
|
250
245
|
expect(mockCreateDocumentWithState.execute).toHaveBeenCalledTimes(1);
|
|
251
246
|
|
|
252
247
|
// Verify history contains expected places including end
|
|
253
|
-
const history = result.state.
|
|
248
|
+
const history = result.state.getHistory();
|
|
254
249
|
const places = history.map((h) => h.metadata?.place);
|
|
255
250
|
expect(places).toContain('end');
|
|
256
251
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import { DocumentBase } from '@loopstack/core';
|
|
3
|
+
import { Document, DocumentInterface, WithArguments } from '@loopstack/common';
|
|
5
4
|
|
|
6
5
|
export const MeetingNotesDocumentSchema = z.object({
|
|
7
6
|
text: z.string(),
|
|
8
7
|
});
|
|
9
8
|
|
|
10
9
|
@Injectable()
|
|
11
|
-
@
|
|
10
|
+
@Document({
|
|
12
11
|
configFile: __dirname + '/meeting-notes-document.yaml',
|
|
13
12
|
})
|
|
14
13
|
@WithArguments(MeetingNotesDocumentSchema)
|
|
15
|
-
export class MeetingNotesDocument
|
|
14
|
+
export class MeetingNotesDocument implements DocumentInterface {}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import { DocumentBase } from '@loopstack/core';
|
|
3
|
+
import { Document, DocumentInterface, WithArguments } from '@loopstack/common';
|
|
5
4
|
|
|
6
5
|
export const OptimizedMeetingNotesDocumentSchema = z.object({
|
|
7
6
|
date: z.string(),
|
|
@@ -12,8 +11,8 @@ export const OptimizedMeetingNotesDocumentSchema = z.object({
|
|
|
12
11
|
});
|
|
13
12
|
|
|
14
13
|
@Injectable()
|
|
15
|
-
@
|
|
14
|
+
@Document({
|
|
16
15
|
configFile: __dirname + '/optimized-notes-document.yaml',
|
|
17
16
|
})
|
|
18
17
|
@WithArguments(OptimizedMeetingNotesDocumentSchema)
|
|
19
|
-
export class OptimizedNotesDocument
|
|
18
|
+
export class OptimizedNotesDocument implements DocumentInterface {}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Module } from '@nestjs/common';
|
|
2
2
|
import { AiModule } from '@loopstack/ai-module';
|
|
3
|
-
import { LoopCoreModule } from '@loopstack/core';
|
|
4
3
|
import { CoreUiModule } from '@loopstack/core-ui-module';
|
|
5
4
|
import { MeetingNotesDocument } from './documents/meeting-notes-document';
|
|
6
5
|
import { OptimizedNotesDocument } from './documents/optimized-notes-document';
|
|
7
6
|
import { MeetingNotesWorkflow } from './meeting-notes.workflow';
|
|
8
7
|
|
|
9
8
|
@Module({
|
|
10
|
-
imports: [
|
|
9
|
+
imports: [CoreUiModule, AiModule],
|
|
11
10
|
providers: [MeetingNotesWorkflow, MeetingNotesDocument, OptimizedNotesDocument],
|
|
12
11
|
exports: [MeetingNotesWorkflow],
|
|
13
12
|
})
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { AiGenerateDocument } from '@loopstack/ai-module';
|
|
3
|
-
import {
|
|
4
|
-
import { WorkflowBase } from '@loopstack/core';
|
|
4
|
+
import { InjectDocument, InjectTool, WithArguments, WithState, Workflow } from '@loopstack/common';
|
|
5
5
|
import { CreateDocument } from '@loopstack/core-ui-module';
|
|
6
6
|
import { MeetingNotesDocument, MeetingNotesDocumentSchema } from './documents/meeting-notes-document';
|
|
7
7
|
import { OptimizedMeetingNotesDocumentSchema, OptimizedNotesDocument } from './documents/optimized-notes-document';
|
|
8
8
|
|
|
9
|
-
@
|
|
9
|
+
@Injectable()
|
|
10
|
+
@Workflow({
|
|
10
11
|
configFile: __dirname + '/meeting-notes.workflow.yaml',
|
|
11
12
|
})
|
|
12
13
|
@WithArguments(
|
|
@@ -24,9 +25,9 @@ import { OptimizedMeetingNotesDocumentSchema, OptimizedNotesDocument } from './d
|
|
|
24
25
|
optimizedNotes: OptimizedMeetingNotesDocumentSchema.optional(),
|
|
25
26
|
}),
|
|
26
27
|
)
|
|
27
|
-
export class MeetingNotesWorkflow
|
|
28
|
-
@
|
|
29
|
-
@
|
|
30
|
-
@
|
|
31
|
-
@
|
|
28
|
+
export class MeetingNotesWorkflow {
|
|
29
|
+
@InjectTool() aiGenerateDocument: AiGenerateDocument;
|
|
30
|
+
@InjectTool() createDocument: CreateDocument;
|
|
31
|
+
@InjectDocument() meetingNotesDocument: MeetingNotesDocument;
|
|
32
|
+
@InjectDocument() optimizedNotesDocument: OptimizedNotesDocument;
|
|
32
33
|
}
|
package/tsconfig.build.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "../../../tsconfig.base.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"target": "ES2023",
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"removeComments": true,
|
|
7
|
-
"emitDecoratorMetadata": true,
|
|
8
|
-
"experimentalDecorators": true,
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
4
|
"outDir": "./dist",
|
|
12
5
|
"rootDir": "./src",
|
|
13
|
-
"
|
|
14
|
-
"strictNullChecks": true,
|
|
15
|
-
"forceConsistentCasingInFileNames": true,
|
|
16
|
-
"noImplicitAny": false,
|
|
17
|
-
"strictBindCallApply": false,
|
|
18
|
-
"noFallthroughCasesInSwitch": false
|
|
6
|
+
"baseUrl": "."
|
|
19
7
|
},
|
|
20
|
-
"
|
|
8
|
+
"exclude": ["node_modules", "dist"],
|
|
9
|
+
"include": ["./src", "./test"]
|
|
21
10
|
}
|