Skip to content

Commit 46704d2

Browse files
authored
feat: update ai integration (#2422)
* init Signed-off-by: Innei <tukon479@gmail.com> * update Signed-off-by: Innei <tukon479@gmail.com> * chore: update package dependencies and remove unused code - Updated package manager version in package.json to pnpm@10.10.0. - Removed references to `@modelcontextprotocol/sdk` from core application files. - Deleted unused `mcp.controller.ts` and cleaned up related imports in `mcp.module.ts`. - Adjusted optional dependencies in pnpm-lock.yaml. Signed-off-by: Innei <tukon479@gmail.com> * refactor: update AI summary and writer services to use new tools parser - Replaced `JsonOutputFunctionsParser` with `JsonOutputToolsParser` in both `ai-summary.service.ts` and `ai-writer.service.ts`. - Updated function definitions to align with the new tools structure, including changes to how functions are defined and invoked. - Enhanced error handling to return empty objects when no results are found. Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com>
1 parent bb7e9a3 commit 46704d2

19 files changed

+1803
-1030
lines changed

apps/core/package.json

Lines changed: 114 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -52,121 +52,121 @@
5252
"redis-memory-server": "^0.12.1"
5353
},
5454
"dependencies": {
55-
"@algolia/client-search": "^4.22.1",
56-
"@antfu/install-pkg": "1.0.0",
57-
"@aws-sdk/client-s3": "3.802.0",
58-
"@babel/core": "7.27.1",
59-
"@babel/plugin-transform-modules-commonjs": "7.27.1",
60-
"@babel/plugin-transform-typescript": "7.27.1",
61-
"@babel/types": "^7.27.1",
62-
"@fastify/cookie": "11.0.2",
63-
"@fastify/multipart": "9.0.3",
64-
"@fastify/static": "8.1.1",
65-
"@innei/next-async": "0.3.0",
66-
"@innei/pretty-logger-nestjs": "0.3.3",
67-
"@keyv/redis": "4.4.0",
68-
"@langchain/openai": "0.5.10",
55+
"@algolia/client-search": "catalog:",
56+
"@antfu/install-pkg": "catalog:",
57+
"@aws-sdk/client-s3": "catalog:",
58+
"@babel/core": "catalog:",
59+
"@babel/plugin-transform-modules-commonjs": "catalog:",
60+
"@babel/plugin-transform-typescript": "catalog:",
61+
"@babel/types": "catalog:",
62+
"@fastify/cookie": "catalog:",
63+
"@fastify/multipart": "catalog:",
64+
"@fastify/static": "catalog:",
65+
"@innei/next-async": "catalog:",
66+
"@innei/pretty-logger-nestjs": "catalog:",
67+
"@keyv/redis": "catalog:",
68+
"@langchain/openai": "catalog:",
6969
"@mx-space/compiled": "workspace:*",
70-
"@nestjs/cache-manager": "3.0.1",
71-
"@nestjs/common": "11.1.0",
72-
"@nestjs/core": "11.1.0",
73-
"@nestjs/event-emitter": "3.0.1",
74-
"@nestjs/mapped-types": "^2.1.0",
75-
"@nestjs/platform-fastify": "11.1.0",
76-
"@nestjs/platform-socket.io": "11.1.0",
77-
"@nestjs/schedule": "6.0.0",
78-
"@nestjs/throttler": "6.4.0",
79-
"@nestjs/websockets": "11.1.0",
80-
"@simplewebauthn/server": "10.0.1",
81-
"@socket.io/redis-adapter": "8.3.0",
82-
"@socket.io/redis-emitter": "5.1.0",
83-
"@typegoose/auto-increment": "4.13.0",
84-
"@typegoose/typegoose": "12.15.0",
85-
"@types/jsonwebtoken": "9.0.9",
86-
"algoliasearch": "4.24.0",
87-
"axios": "^1.9.0",
88-
"axios-retry": "4.5.0",
89-
"bcryptjs": "^3.0.2",
90-
"blurhash": "2.0.5",
91-
"cache-manager": "6.4.2",
92-
"class-transformer": "0.5.1",
93-
"class-validator": "0.13.2",
94-
"class-validator-jsonschema": "npm:@innei/class-validator-jsonschema@3.1.2",
95-
"cls-hooked": "^4.2.2",
96-
"commander": "13.1.0",
97-
"dayjs": "1.11.13",
98-
"ejs": "3.1.10",
99-
"form-data": "4.0.2",
100-
"inquirer": "^10.2.2",
101-
"isbot": "5.1.27",
102-
"js-yaml": "^4.1.0",
103-
"json5": "2.2.3",
104-
"jsonwebtoken": "9.0.2",
105-
"jszip": "3.10.1",
106-
"keyv": "5.3.3",
107-
"langchain": "0.3.24",
108-
"linkedom": "0.18.10",
109-
"lodash": "^4.17.21",
110-
"lru-cache": "11.1.0",
111-
"marked": "15.0.11",
112-
"mime-types": "^3.0.1",
113-
"mkdirp": "^3.0.1",
114-
"mongoose": "8.14.1",
115-
"mongoose-aggregate-paginate-v2": "1.1.4",
116-
"mongoose-autopopulate": "1.1.0",
117-
"mongoose-lean-getters": "2.2.1",
118-
"mongoose-lean-virtuals": "1.1.0",
119-
"mongoose-paginate-v2": "1.9.0",
120-
"node-machine-id": "1.1.12",
121-
"nodemailer": "7.0.0",
122-
"openai": "4.97.0",
123-
"pluralize": "^8.0.0",
124-
"qs": "6.14.0",
125-
"reflect-metadata": "0.2.2",
126-
"remove-markdown": "0.6.2",
127-
"remove-md-codeblock": "0.0.4",
128-
"rxjs": "7.8.2",
129-
"semver": "7.7.1",
130-
"slugify": "1.6.6",
131-
"snakecase-keys": "6.0.0",
132-
"source-map-support": "^0.5.21",
133-
"ua-parser-js": "2.0.3",
134-
"vm2": "3.9.19",
135-
"wildcard-match": "5.1.4",
136-
"xss": "1.0.15",
137-
"zx-cjs": "7.0.7-0"
70+
"@nestjs/cache-manager": "catalog:",
71+
"@nestjs/common": "catalog:",
72+
"@nestjs/core": "catalog:",
73+
"@nestjs/event-emitter": "catalog:",
74+
"@nestjs/mapped-types": "catalog:",
75+
"@nestjs/platform-fastify": "catalog:",
76+
"@nestjs/platform-socket.io": "catalog:",
77+
"@nestjs/schedule": "catalog:",
78+
"@nestjs/throttler": "catalog:",
79+
"@nestjs/websockets": "catalog:",
80+
"@simplewebauthn/server": "catalog:",
81+
"@socket.io/redis-adapter": "catalog:",
82+
"@socket.io/redis-emitter": "catalog:",
83+
"@typegoose/auto-increment": "catalog:",
84+
"@typegoose/typegoose": "catalog:",
85+
"@types/jsonwebtoken": "catalog:",
86+
"algoliasearch": "catalog:",
87+
"axios": "catalog:",
88+
"axios-retry": "catalog:",
89+
"bcryptjs": "catalog:",
90+
"blurhash": "catalog:",
91+
"cache-manager": "catalog:",
92+
"class-transformer": "catalog:",
93+
"class-validator": "catalog:",
94+
"class-validator-jsonschema": "catalog:",
95+
"cls-hooked": "catalog:",
96+
"commander": "catalog:",
97+
"dayjs": "catalog:",
98+
"ejs": "catalog:",
99+
"form-data": "catalog:",
100+
"inquirer": "catalog:",
101+
"isbot": "catalog:",
102+
"js-yaml": "catalog:",
103+
"json5": "catalog:",
104+
"jsonwebtoken": "catalog:",
105+
"jszip": "catalog:",
106+
"keyv": "catalog:",
107+
"langchain": "catalog:",
108+
"linkedom": "catalog:",
109+
"lodash": "catalog:",
110+
"lru-cache": "catalog:",
111+
"marked": "catalog:",
112+
"mime-types": "catalog:",
113+
"mkdirp": "catalog:",
114+
"mongoose": "catalog:",
115+
"mongoose-aggregate-paginate-v2": "catalog:",
116+
"mongoose-autopopulate": "catalog:",
117+
"mongoose-lean-getters": "catalog:",
118+
"mongoose-lean-virtuals": "catalog:",
119+
"mongoose-paginate-v2": "catalog:",
120+
"node-machine-id": "catalog:",
121+
"nodemailer": "catalog:",
122+
"openai": "catalog:",
123+
"pluralize": "catalog:",
124+
"qs": "catalog:",
125+
"reflect-metadata": "catalog:",
126+
"remove-markdown": "catalog:",
127+
"remove-md-codeblock": "catalog:",
128+
"rxjs": "catalog:",
129+
"semver": "catalog:",
130+
"slugify": "catalog:",
131+
"snakecase-keys": "catalog:",
132+
"source-map-support": "catalog:",
133+
"ua-parser-js": "catalog:",
134+
"vm2": "catalog:",
135+
"wildcard-match": "catalog:",
136+
"xss": "catalog:",
137+
"zx-cjs": "catalog:"
138138
},
139139
"devDependencies": {
140-
"@langchain/core": "0.3.51",
141-
"@nestjs/cli": "11.0.7",
142-
"@nestjs/schematics": "11.0.5",
143-
"@nestjs/testing": "11.1.0",
144-
"@swc/core": "1.11.24",
145-
"@types/babel__core": "7.20.5",
146-
"@types/bcryptjs": "^3.0.0",
147-
"@types/cls-hooked": "^4.3.9",
148-
"@types/ejs": "3.1.5",
149-
"@types/get-image-colors": "4.0.5",
150-
"@types/js-yaml": "4.0.9",
151-
"@types/lodash": "4.17.16",
152-
"@types/mime-types": "2.1.4",
153-
"@types/mongoose-aggregate-paginate-v2": "1.0.12",
154-
"@types/node": "22.15.3",
155-
"@types/nodemailer": "6.4.17",
156-
"@types/qs": "6.9.18",
157-
"@types/remove-markdown": "0.3.4",
158-
"@types/semver": "7.7.0",
159-
"@types/ua-parser-js": "0.7.39",
160-
"@types/validator": "13.15.0",
161-
"@vercel/ncc": "0.38.3",
162-
"cron": "^3.5.0",
163-
"ioredis": "5.6.1",
164-
"sharp": "0.34.1",
165-
"socket.io": "^4.8.1",
166-
"unplugin-swc": "1.5.2",
167-
"vite": "5.4.10",
168-
"vite-tsconfig-paths": "5.1.4",
169-
"vitest": "1.5.2",
170-
"zx": "7.2.3"
140+
"@langchain/core": "catalog:",
141+
"@nestjs/cli": "catalog:",
142+
"@nestjs/schematics": "catalog:",
143+
"@nestjs/testing": "catalog:",
144+
"@swc/core": "catalog:",
145+
"@types/babel__core": "catalog:",
146+
"@types/bcryptjs": "catalog:",
147+
"@types/cls-hooked": "catalog:",
148+
"@types/ejs": "catalog:",
149+
"@types/get-image-colors": "catalog:",
150+
"@types/js-yaml": "catalog:",
151+
"@types/lodash": "catalog:",
152+
"@types/mime-types": "catalog:",
153+
"@types/mongoose-aggregate-paginate-v2": "catalog:",
154+
"@types/node": "catalog:",
155+
"@types/nodemailer": "catalog:",
156+
"@types/qs": "catalog:",
157+
"@types/remove-markdown": "catalog:",
158+
"@types/semver": "catalog:",
159+
"@types/ua-parser-js": "catalog:",
160+
"@types/validator": "catalog:",
161+
"@vercel/ncc": "catalog:",
162+
"cron": "catalog:",
163+
"ioredis": "catalog:",
164+
"sharp": "catalog:",
165+
"socket.io": "catalog:",
166+
"unplugin-swc": "catalog:",
167+
"vite": "catalog:",
168+
"vite-tsconfig-paths": "catalog:",
169+
"vitest": "catalog:",
170+
"zx": "catalog:"
171171
}
172-
}
172+
}

apps/core/src/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { HelperModule as BizHelperModule } from './modules/helper/helper.module'
4242
import { InitModule } from './modules/init/init.module'
4343
import { LinkModule } from './modules/link/link.module'
4444
import { MarkdownModule } from './modules/markdown/markdown.module'
45+
import { McpModule } from './modules/mcp/mcp.module'
4546
import { NoteModule } from './modules/note/note.module'
4647
import { OptionModule } from './modules/option/option.module'
4748
import { PageModule } from './modules/page/page.module'
@@ -94,6 +95,7 @@ import { RedisModule } from './processors/redis/redis.module'
9495
HealthModule,
9596
LinkModule,
9697
MarkdownModule,
98+
McpModule,
9799
NoteModule,
98100
OptionModule,
99101
PageModule,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { forwardRef, Module } from '@nestjs/common'
2+
3+
import { McpModule } from '../../mcp/mcp.module'
4+
import { AiModule } from '../ai.module'
5+
import { AIAgentService } from './ai-agent.service'
6+
import { TestController } from './test.controller'
7+
8+
@Module({
9+
imports: [McpModule, forwardRef(() => AiModule)],
10+
providers: [AIAgentService],
11+
controllers: isDev ? [TestController] : [],
12+
})
13+
export class AiAgentModule {}

0 commit comments

Comments
 (0)