Skip to content

Commit 970ee70

Browse files
committed
fix(ai-bot): restore es build
1 parent 2599fec commit 970ee70

File tree

9 files changed

+18
-52
lines changed

9 files changed

+18
-52
lines changed

services/ai-bot/config/ai-bot.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"api": { "url": "http://api.liexp.dev/v1" },
33
"localAi": {
4-
"url": "https://ai.lies.exposed",
4+
"url": "https://ai.lies.exposed/v1",
55
"apiKey": "no-key-is-a-good-key",
66
"models": {
77
"summarize": "gpt-4o",

services/ai-bot/esbuild.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { build } from "esbuild";
22

33
await build({
44
format: "cjs",
5-
target: "node20",
5+
target: "node24",
66
platform: "node",
77
bundle: true,
88
external: [
@@ -11,7 +11,7 @@ await build({
1111
"puppeteer-extra-plugin-stealth",
1212
],
1313
entryPoints: ["build/run.js"],
14-
outfile: "./build/run-esbuild.js",
14+
outfile: "./build/run-esbuild.cjs",
1515
inject: ["./import-meta-url.js"],
1616
define: {
1717
"import.meta.url": "import_meta_url",

services/ai-bot/import-meta-url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import path from 'path';
22
import { fileURLToPath } from 'url';
33

4-
export const import_meta_url = fileURLToPath(`file://${path.resolve(process.cwd(), './build/run-esbuild.js')}`);
4+
export const import_meta_url = fileURLToPath(`file://${path.resolve(process.cwd(), './build/run-esbuild.cjs')}`);

services/ai-bot/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"license": "MIT",
66
"author": "Andrea Ascari <dev.ascariandrea@gmail.com>",
7-
"main": "build/run-esbuild.js",
7+
"main": "build/run-esbuild.cjs",
88
"type": "module",
99
"imports": {
1010
"#common/*": "./build/common/*",
@@ -19,8 +19,8 @@
1919
"typecheck": "tsc --noEmit",
2020
"build:tsc": "tsc -b tsconfig.build.json",
2121
"build:es": "node --import tsx/esm ./esbuild.config.mjs",
22-
"build": "pnpm build:tsc",
23-
"dev": "node --watch-path=./build ./build/run.js --trace-warnings",
22+
"build": "pnpm build:tsc && pnpm build:es",
23+
"dev": "node --watch ./build/run-esbuild.cjs --trace-warnings",
2424
"docker:dev": "pnpm dev",
2525
"cli:dev": "node --import tsx/esm src/cli/index.ts",
2626
"lint": "eslint src",
@@ -30,8 +30,8 @@
3030
"dependencies": {
3131
"@aws-sdk/client-sso-oidc": "^3.812.0",
3232
"@aws-sdk/client-sts": "^3.812.0",
33-
"@langchain/community": "^0.3.53",
34-
"@langchain/core": "^0.3.72",
33+
"@langchain/community": "^0.3.43",
34+
"@langchain/core": "^0.3.56",
3535
"@liexp/backend": "workspace:*",
3636
"@liexp/core": "workspace:*",
3737
"@liexp/shared": "workspace:*",
@@ -53,7 +53,7 @@
5353
"@esbuild/aix-ppc64": "^0.25.4",
5454
"@types/node": "^24.3.0",
5555
"@types/prompts": "^2.4.9",
56-
"esbuild": "^0.25.2",
56+
"esbuild": "^0.25.9",
5757
"eslint": "^9.28.0",
5858
"tsx": "^4.19.4",
5959
"typescript": "^5.8.3"

services/ai-bot/sea-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"main": "./build/run.js",
2+
"main": "./build/run-esbuild.cjs",
33
"output": "./build/ai-bot.blob",
44
"disableExperimentalSEAWarning": true,
55
"useCodeCache": true

services/ai-bot/src/common/langchain/VanillaPuppeteerWebLoader.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import type { DocumentLoader } from "@langchain/core/document_loaders/base";
2-
import { BaseDocumentLoader } from "@langchain/core/document_loaders/base";
1+
import {
2+
type DocumentLoader,
3+
BaseDocumentLoader,
4+
} from "@langchain/core/document_loaders/base";
35
import { Document } from "@langchain/core/documents";
46
import type { Browser, Page, WaitForOptions } from "puppeteer-core";
57

services/ai-bot/src/flows/ai/common/loadLinkWithPuppeteer.flow.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

services/ai-bot/src/flows/ai/common/loadLinksWithPuppeteer.flow.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { type ClientContextRTE } from "../../../types.js";
88

99
export const loadLinksWithPuppeteer = (
1010
urls: URL[],
11-
): ClientContextRTE<readonly Document[][]> => {
11+
): ClientContextRTE<Document[][]> => {
1212
return pipe(
1313
fp.RTE.ask<ClientContext>(),
1414
fp.RTE.chainTaskEitherK((ctx) =>
@@ -45,5 +45,6 @@ export const loadLinksWithPuppeteer = (
4545
),
4646
),
4747
),
48+
fp.RTE.map((arr) => [...arr]),
4849
);
4950
};

services/ai-bot/src/load-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const loadContext = (
8282
Cookie: `token=${env.LOCALAI_API_KEY}`,
8383
}),
8484
),
85-
fp.TE.bind("langchain", ({ config, localAIURL, localaiHeaders, env }) =>
85+
fp.TE.bind("langchain", ({ config, localAIURL, localaiHeaders }) =>
8686
fp.TE.right(
8787
GetLangchainProvider({
8888
baseURL: localAIURL,

0 commit comments

Comments
 (0)