From 2346a1058ddccfe4628c1e297e4474918041d470 Mon Sep 17 00:00:00 2001 From: Tyllen Bicakcic Date: Wed, 29 Jan 2025 22:19:11 -0800 Subject: [PATCH] feat: add payman --- libs/langchain-payman/.eslintrc.cjs | 74 ++++++++ libs/langchain-payman/.gitignore | 3 + libs/langchain-payman/.prettierrc | 19 ++ libs/langchain-payman/.release-it.json | 10 + libs/langchain-payman/LICENSE | 21 +++ libs/langchain-payman/jest.config.cjs | 21 +++ libs/langchain-payman/jest.env.cjs | 12 ++ libs/langchain-payman/langchain.config.js | 22 +++ libs/langchain-payman/package.json | 85 +++++++++ .../scripts/jest-setup-after-env.js | 12 ++ libs/langchain-payman/src/index.ts | 3 + .../src/tests/tools.int.test.ts | 129 +++++++++++++ libs/langchain-payman/src/tools.ts | 177 ++++++++++++++++++ libs/langchain-payman/src/utils.ts | 20 ++ libs/langchain-payman/tsconfig.cjs.json | 8 + libs/langchain-payman/tsconfig.json | 23 +++ libs/langchain-payman/turbo.json | 11 ++ 17 files changed, 650 insertions(+) create mode 100644 libs/langchain-payman/.eslintrc.cjs create mode 100644 libs/langchain-payman/.gitignore create mode 100644 libs/langchain-payman/.prettierrc create mode 100644 libs/langchain-payman/.release-it.json create mode 100644 libs/langchain-payman/LICENSE create mode 100644 libs/langchain-payman/jest.config.cjs create mode 100644 libs/langchain-payman/jest.env.cjs create mode 100644 libs/langchain-payman/langchain.config.js create mode 100644 libs/langchain-payman/package.json create mode 100644 libs/langchain-payman/scripts/jest-setup-after-env.js create mode 100644 libs/langchain-payman/src/index.ts create mode 100644 libs/langchain-payman/src/tests/tools.int.test.ts create mode 100644 libs/langchain-payman/src/tools.ts create mode 100644 libs/langchain-payman/src/utils.ts create mode 100644 libs/langchain-payman/tsconfig.cjs.json create mode 100644 libs/langchain-payman/tsconfig.json create mode 100644 libs/langchain-payman/turbo.json diff --git a/libs/langchain-payman/.eslintrc.cjs b/libs/langchain-payman/.eslintrc.cjs new file mode 100644 index 000000000000..e3033ac0160c --- /dev/null +++ b/libs/langchain-payman/.eslintrc.cjs @@ -0,0 +1,74 @@ +module.exports = { + extends: [ + "airbnb-base", + "eslint:recommended", + "prettier", + "plugin:@typescript-eslint/recommended", + ], + parserOptions: { + ecmaVersion: 12, + parser: "@typescript-eslint/parser", + project: "./tsconfig.json", + sourceType: "module", + }, + plugins: ["@typescript-eslint", "no-instanceof"], + ignorePatterns: [ + ".eslintrc.cjs", + "scripts", + "node_modules", + "dist", + "dist-cjs", + "*.js", + "*.cjs", + "*.d.ts", + ], + rules: { + "no-process-env": 2, + "no-instanceof/no-instanceof": 2, + "@typescript-eslint/explicit-module-boundary-types": 0, + "@typescript-eslint/no-empty-function": 0, + "@typescript-eslint/no-shadow": 0, + "@typescript-eslint/no-empty-interface": 0, + "@typescript-eslint/no-use-before-define": ["error", "nofunc"], + "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], + "@typescript-eslint/no-floating-promises": "error", + "@typescript-eslint/no-misused-promises": "error", + camelcase: 0, + "class-methods-use-this": 0, + "import/extensions": [2, "ignorePackages"], + "import/no-extraneous-dependencies": [ + "error", + { devDependencies: ["**/*.test.ts"] }, + ], + "import/no-unresolved": 0, + "import/prefer-default-export": 0, + "keyword-spacing": "error", + "max-classes-per-file": 0, + "max-len": 0, + "no-await-in-loop": 0, + "no-bitwise": 0, + "no-console": 0, + "no-restricted-syntax": 0, + "no-shadow": 0, + "no-continue": 0, + "no-void": 0, + "no-underscore-dangle": 0, + "no-use-before-define": 0, + "no-useless-constructor": 0, + "no-return-await": 0, + "consistent-return": 0, + "no-else-return": 0, + "func-names": 0, + "no-lonely-if": 0, + "prefer-rest-params": 0, + "new-cap": ["error", { properties: false, capIsNew: false }], + }, + overrides: [ + { + files: ["**/*.test.ts"], + rules: { + "@typescript-eslint/no-unused-vars": "off", + }, + }, + ], +}; diff --git a/libs/langchain-payman/.gitignore b/libs/langchain-payman/.gitignore new file mode 100644 index 000000000000..ae701c7fe705 --- /dev/null +++ b/libs/langchain-payman/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +.yarn diff --git a/libs/langchain-payman/.prettierrc b/libs/langchain-payman/.prettierrc new file mode 100644 index 000000000000..ba08ff04f677 --- /dev/null +++ b/libs/langchain-payman/.prettierrc @@ -0,0 +1,19 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": false, + "quoteProps": "as-needed", + "jsxSingleQuote": false, + "trailingComma": "es5", + "bracketSpacing": true, + "arrowParens": "always", + "requirePragma": false, + "insertPragma": false, + "proseWrap": "preserve", + "htmlWhitespaceSensitivity": "css", + "vueIndentScriptAndStyle": false, + "endOfLine": "lf" +} diff --git a/libs/langchain-payman/.release-it.json b/libs/langchain-payman/.release-it.json new file mode 100644 index 000000000000..522ee6abf705 --- /dev/null +++ b/libs/langchain-payman/.release-it.json @@ -0,0 +1,10 @@ +{ + "github": { + "release": true, + "autoGenerate": true, + "tokenRef": "GITHUB_TOKEN_RELEASE" + }, + "npm": { + "versionArgs": ["--workspaces-update=false"] + } +} diff --git a/libs/langchain-payman/LICENSE b/libs/langchain-payman/LICENSE new file mode 100644 index 000000000000..8cd8f501eb49 --- /dev/null +++ b/libs/langchain-payman/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2023 LangChain + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/libs/langchain-payman/jest.config.cjs b/libs/langchain-payman/jest.config.cjs new file mode 100644 index 000000000000..994826496bc5 --- /dev/null +++ b/libs/langchain-payman/jest.config.cjs @@ -0,0 +1,21 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: "ts-jest/presets/default-esm", + testEnvironment: "./jest.env.cjs", + modulePathIgnorePatterns: ["dist/", "docs/"], + moduleNameMapper: { + "^(\\.{1,2}/.*)\\.js$": "$1", + }, + transform: { + "^.+\\.tsx?$": ["@swc/jest"], + }, + transformIgnorePatterns: [ + "/node_modules/", + "\\.pnp\\.[^\\/]+$", + "./scripts/jest-setup-after-env.js", + ], + setupFiles: ["dotenv/config"], + testTimeout: 20_000, + passWithNoTests: true, + collectCoverageFrom: ["src/**/*.ts"], +}; diff --git a/libs/langchain-payman/jest.env.cjs b/libs/langchain-payman/jest.env.cjs new file mode 100644 index 000000000000..2ccedccb8672 --- /dev/null +++ b/libs/langchain-payman/jest.env.cjs @@ -0,0 +1,12 @@ +const { TestEnvironment } = require("jest-environment-node"); + +class AdjustedTestEnvironmentToSupportFloat32Array extends TestEnvironment { + constructor(config, context) { + // Make `instanceof Float32Array` return true in tests + // to avoid https://github.com/xenova/transformers.js/issues/57 and https://github.com/jestjs/jest/issues/2549 + super(config, context); + this.global.Float32Array = Float32Array; + } +} + +module.exports = AdjustedTestEnvironmentToSupportFloat32Array; diff --git a/libs/langchain-payman/langchain.config.js b/libs/langchain-payman/langchain.config.js new file mode 100644 index 000000000000..46b1a2b31264 --- /dev/null +++ b/libs/langchain-payman/langchain.config.js @@ -0,0 +1,22 @@ +import { resolve, dirname } from "node:path"; +import { fileURLToPath } from "node:url"; + +/** + * @param {string} relativePath + * @returns {string} + */ +function abs(relativePath) { + return resolve(dirname(fileURLToPath(import.meta.url)), relativePath); +} + +export const config = { + internals: [/node\:/, /@langchain\/core\//], + entrypoints: { + index: "index", + }, + requiresOptionalDependency: [], + tsConfigPath: resolve("./tsconfig.json"), + cjsSource: "./dist-cjs", + cjsDestination: "./dist", + abs, +}; diff --git a/libs/langchain-payman/package.json b/libs/langchain-payman/package.json new file mode 100644 index 000000000000..a2cff4b44c37 --- /dev/null +++ b/libs/langchain-payman/package.json @@ -0,0 +1,85 @@ +{ + "name": "my-langchain-integration", + "version": "0.0.0", + "description": "Sample INTEGRATION_SHORT_NAME integration for LangChain.js", + "type": "module", + "engines": { + "node": ">=18" + }, + "main": "./index.js", + "types": "./index.d.ts", + "repository": { + "type": "git", + "url": "git@github.com:langchain-ai/langchainjs.git" + }, + "homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/INTEGRATION_NAME/", + "scripts": { + "build": "yarn turbo:command build:internal --filter=@langchain/INTEGRATION_NAME", + "build:internal": "yarn lc_build --create-entrypoints --pre --tree-shaking", + "lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/", + "lint:dpdm": "dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts", + "lint": "yarn lint:eslint && yarn lint:dpdm", + "lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm", + "clean": "rm -rf .turbo dist/", + "prepack": "yarn build", + "test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%", + "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts", + "test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000", + "test:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%", + "format": "prettier --config .prettierrc --write \"src\"", + "format:check": "prettier --config .prettierrc --check \"src\"" + }, + "author": "LangChain", + "license": "MIT", + "peerDependencies": { + "@langchain/core": ">=0.3.0 <0.4.0" + }, + "devDependencies": { + "@jest/globals": "^29.5.0", + "@swc/core": "^1.3.90", + "@swc/jest": "^0.2.29", + "@langchain/core": "workspace:*", + "@langchain/scripts": ">=0.1.0 <0.2.0", + "@tsconfig/recommended": "^1.0.3", + "@typescript-eslint/eslint-plugin": "^6.12.0", + "@typescript-eslint/parser": "^6.12.0", + "dotenv": "^16.3.1", + "dpdm": "^3.12.0", + "release-it": "^15.10.1", + "eslint": "^8.33.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-no-instanceof": "^1.0.1", + "eslint-plugin-prettier": "^4.2.1", + "jest": "^29.5.0", + "jest-environment-node": "^29.6.4", + "prettier": "^2.8.3", + "rollup": "^4.5.2", + "ts-jest": "^29.1.0", + "typescript": "<5.2.0", + "paymanai": "^2.1.0" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + ".": { + "types": { + "import": "./index.d.ts", + "require": "./index.d.cts", + "default": "./index.d.ts" + }, + "import": "./index.js", + "require": "./index.cjs" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/", + "index.cjs", + "index.js", + "index.d.ts", + "index.d.cts" + ] +} diff --git a/libs/langchain-payman/scripts/jest-setup-after-env.js b/libs/langchain-payman/scripts/jest-setup-after-env.js new file mode 100644 index 000000000000..45c9c262838d --- /dev/null +++ b/libs/langchain-payman/scripts/jest-setup-after-env.js @@ -0,0 +1,12 @@ +import { awaitAllCallbacks } from "@langchain/core/callbacks/promises"; +import { afterAll, jest } from "@jest/globals"; + +// Set default test environment variables if not set +process.env.PAYMAN_ENVIRONMENT = process.env.PAYMAN_ENVIRONMENT || "sandbox"; + +afterAll(awaitAllCallbacks); + +// Allow console.log to be disabled in tests +if (process.env.DISABLE_CONSOLE_LOGS === "true") { + console.log = jest.fn(); +} diff --git a/libs/langchain-payman/src/index.ts b/libs/langchain-payman/src/index.ts new file mode 100644 index 000000000000..3a50fa36603a --- /dev/null +++ b/libs/langchain-payman/src/index.ts @@ -0,0 +1,3 @@ + +export * from "./tools.js"; +export * from "./utils.js"; diff --git a/libs/langchain-payman/src/tests/tools.int.test.ts b/libs/langchain-payman/src/tests/tools.int.test.ts new file mode 100644 index 000000000000..e8f63cca1c32 --- /dev/null +++ b/libs/langchain-payman/src/tests/tools.int.test.ts @@ -0,0 +1,129 @@ +import { test, expect } from "@jest/globals"; +import { Paymanai } from "paymanai"; +import { SendPaymentTool, SearchPayeesTool, GetBalanceTool, AddPayeeTool } from "../tools.js"; + +// Helper to create a test client +const getTestClient = () => { + const apiSecret = process.env.PAYMAN_API_SECRET; + if (!apiSecret) { + throw new Error("PAYMAN_API_SECRET required for tests"); + } + return new Paymanai({ + xPaymanAPISecret: apiSecret, + environment: process.env.PAYMAN_ENVIRONMENT + }); +}; + +test("GetBalanceTool can retrieve balance information", async () => { + const balanceTool = new GetBalanceTool({ + // @ts-expect-error type errors + client: getTestClient(), + }); + + const toolData = await balanceTool._call( + JSON.stringify({ currency: "USD" }) + ); + + expect(toolData).toContain("Balance info"); + const parsedData = JSON.parse(toolData.replace("Balance info: ", "")); + expect(parsedData).toBeDefined(); +}); + +test("SearchPayeesTool can search for existing payees", async () => { + const searchTool = new SearchPayeesTool({ + // @ts-expect-error type errors + client: getTestClient(), + }); + + const toolData = await searchTool._call( + JSON.stringify({ type: "CRYPTO_ADDRESS" }) + ); + + expect(toolData).toContain("Payees search returned"); + const parsedData = JSON.parse(toolData.replace("Payees search returned: ", "")); + expect(Array.isArray(parsedData)).toBeTruthy(); +}); + +test("SendPaymentTool can send a payment", async () => { + const sendTool = new SendPaymentTool({ + // @ts-expect-error type errors + client: getTestClient(), + }); + + // First create a test payee + const addTool = new AddPayeeTool({ + // @ts-expect-error type errors + client: getTestClient(), + }); + + // Create a test crypto payee + const payeeData = await addTool._call( + JSON.stringify({ + type: "CRYPTO_ADDRESS", + name: "Test Payee", + address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", // Example ETH address + currency: "ETH" + }) + ); + + const payee = JSON.parse(payeeData.replace("Payee created successfully. Response: ", "")); + + // Now try sending a payment to the created payee + const toolData = await sendTool._call( + JSON.stringify({ + amount_decimal: 0.0001, // Small test amount + payment_destination_id: payee.id, + memo: "Test payment" + }) + ); + + expect(toolData).toContain("Payment sent successfully"); + const parsedData = JSON.parse(toolData.replace("Payment sent successfully. Response: ", "")); + expect(parsedData).toBeDefined(); +}); + +test("AddPayeeTool can create a new crypto payee", async () => { + const addTool = new AddPayeeTool({ + // @ts-expect-error type errors + client: getTestClient(), + }); + + const toolData = await addTool._call( + JSON.stringify({ + type: "CRYPTO_ADDRESS", + name: "Test Crypto Payee", + address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", // Example ETH address + currency: "ETH", + tags: ["test"] + }) + ); + + expect(toolData).toContain("Payee created successfully"); + const parsedData = JSON.parse(toolData.replace("Payee created successfully. Response: ", "")); + expect(parsedData.type).toBe("CRYPTO_ADDRESS"); + expect(parsedData.name).toBe("Test Crypto Payee"); +}); + +test("AddPayeeTool can create a new ACH payee", async () => { + const addTool = new AddPayeeTool({ + // @ts-expect-error type errors + client: getTestClient(), + }); + + const toolData = await addTool._call( + JSON.stringify({ + type: "US_ACH", + name: "Test ACH Payee", + account_holder_name: "John Doe", + account_number: "123456789", + routing_number: "021000021", // Example routing number + account_type: "checking", + tags: ["test"] + }) + ); + + expect(toolData).toContain("Payee created successfully"); + const parsedData = JSON.parse(toolData.replace("Payee created successfully. Response: ", "")); + expect(parsedData.type).toBe("US_ACH"); + expect(parsedData.name).toBe("Test ACH Payee"); +}); diff --git a/libs/langchain-payman/src/tools.ts b/libs/langchain-payman/src/tools.ts new file mode 100644 index 000000000000..a47acbee4578 --- /dev/null +++ b/libs/langchain-payman/src/tools.ts @@ -0,0 +1,177 @@ +import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager"; +import { Tool, type ToolParams } from "@langchain/core/tools"; +import { Paymanai } from "paymanai"; + +// Base interface for Payman tool parameters +interface PaymanToolParams extends ToolParams { + client: Paymanai; +} + +/** + * Send Payment Tool + */ +export interface SendPaymentInput { + amount_decimal: number; + payment_destination_id?: string; + payment_destination?: Record; + customer_id?: string; + customer_email?: string; + customer_name?: string; + memo?: string; +} + +export class SendPaymentTool extends Tool { + static lc_name(): string { + return "SendPaymentTool"; + } + + name = "send_payment"; + description = "Send funds from an agent's wallet to a payee. Takes amount_decimal, payment_destination_id or payment_destination, customer info, etc."; + + private client: Paymanai; + + constructor(fields: PaymanToolParams) { + super(fields); + this.client = fields.client; + } + + protected async _call( + input: string, + _runManager?: CallbackManagerForToolRun + ): Promise { + try { + const params: SendPaymentInput = JSON.parse(input); + const response = await this.client.payments.send_payment(params); + return `Payment sent successfully. Response: ${JSON.stringify(response)}`; + } catch (e) { + return `Error in send_payment: ${e}`; + } + } +} + +/** + * Search Payees Tool + */ +export interface SearchPayeesInput { + name?: string; + contact_email?: string; + type?: string; +} + +export class SearchPayeesTool extends Tool { + static lc_name(): string { + return "SearchPayeesTool"; + } + + name = "search_payees"; + description = "Search for existing payment destinations (payees). Can filter by name, email, type, etc."; + + private client: Paymanai; + + constructor(fields: PaymanToolParams) { + super(fields); + this.client = fields.client; + } + + protected async _call( + input: string, + _runManager?: CallbackManagerForToolRun + ): Promise { + try { + const params: SearchPayeesInput = JSON.parse(input); + const response = await this.client.payments.search_payees(params); + return `Payees search returned: ${JSON.stringify(response)}`; + } catch (e) { + return `Error in search_payees: ${e}`; + } + } +} + +/** + * Add Payee Tool + */ +export interface AddPayeeInput { + type: "CRYPTO_ADDRESS" | "US_ACH"; + name?: string; + contact_details?: Record; + account_holder_name?: string; + account_number?: string; + account_type?: string; + routing_number?: string; + address?: string; + currency?: string; + tags?: string[]; +} + +export class AddPayeeTool extends Tool { + static lc_name(): string { + return "AddPayeeTool"; + } + + name = "add_payee"; + description = "Add a new payee (payment destination). Can be US_ACH or CRYPTO_ADDRESS with the appropriate fields."; + + private client: Paymanai; + + constructor(fields: PaymanToolParams) { + super(fields); + this.client = fields.client; + } + + protected async _call( + input: string, + _runManager?: CallbackManagerForToolRun + ): Promise { + try { + const params: AddPayeeInput = JSON.parse(input); + const response = await this.client.payments.create_payee(params); + return `Payee created successfully. Response: ${JSON.stringify(response)}`; + } catch (e) { + return `Error in add_payee: ${e}`; + } + } +} + +/** + * Get Balance Tool + */ +export interface GetBalanceInput { + customer_id?: string; + currency?: string; +} + +export class GetBalanceTool extends Tool { + static lc_name(): string { + return "GetBalanceTool"; + } + + name = "get_balance"; + description = "Get the spendable balance for either the agent (if customer_id not provided) or a specific customer (if customer_id provided)."; + + private client: Paymanai; + + constructor(fields: PaymanToolParams) { + super(fields); + this.client = fields.client; + } + + protected async _call( + input: string, + _runManager?: CallbackManagerForToolRun + ): Promise { + try { + const params: GetBalanceInput = JSON.parse(input); + const response = params.customer_id && params.customer_id.toLowerCase() !== "none" + ? await this.client.balances.get_customer_balance({ + customer_id: params.customer_id, + currency: params.currency || "USD" + }) + : await this.client.balances.get_spendable_balance({ + currency: params.currency || "USD" + }); + return `Balance info: ${JSON.stringify(response)}`; + } catch (e) { + return `Error in get_balance: ${e}`; + } + } +} diff --git a/libs/langchain-payman/src/utils.ts b/libs/langchain-payman/src/utils.ts new file mode 100644 index 000000000000..477910ac9601 --- /dev/null +++ b/libs/langchain-payman/src/utils.ts @@ -0,0 +1,20 @@ +import { Paymanai } from "paymanai"; + +/** + * Get the Payman client from environment variables or throw error if not found. + */ +export function getEnvironmentPayman(): Paymanai { + const apiSecret = process.env.PAYMAN_API_SECRET; + const environment = process.env.PAYMAN_ENVIRONMENT; + + if (!apiSecret) { + throw new Error( + "PAYMAN_API_SECRET not found in environment variables." + ); + } + + return new Paymanai({ + xPaymanAPISecret: apiSecret, + environment: environment + }); +} \ No newline at end of file diff --git a/libs/langchain-payman/tsconfig.cjs.json b/libs/langchain-payman/tsconfig.cjs.json new file mode 100644 index 000000000000..3b7026ea406c --- /dev/null +++ b/libs/langchain-payman/tsconfig.cjs.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "declaration": false + }, + "exclude": ["node_modules", "dist", "docs", "**/tests"] +} diff --git a/libs/langchain-payman/tsconfig.json b/libs/langchain-payman/tsconfig.json new file mode 100644 index 000000000000..bc85d83b6229 --- /dev/null +++ b/libs/langchain-payman/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "@tsconfig/recommended", + "compilerOptions": { + "outDir": "../dist", + "rootDir": "./src", + "target": "ES2021", + "lib": ["ES2021", "ES2022.Object", "DOM"], + "module": "ES2020", + "moduleResolution": "nodenext", + "esModuleInterop": true, + "declaration": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "useDefineForClassFields": true, + "strictPropertyInitialization": false, + "allowJs": true, + "strict": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "docs"] +} diff --git a/libs/langchain-payman/turbo.json b/libs/langchain-payman/turbo.json new file mode 100644 index 000000000000..d024cee15c81 --- /dev/null +++ b/libs/langchain-payman/turbo.json @@ -0,0 +1,11 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "outputs": ["**/dist/**"] + }, + "build:internal": { + "dependsOn": ["^build:internal"] + } + } +}