diff --git a/.github/workflows/publish-python-sdk.yml b/.github/workflows/publish-python-sdk.yml index fdd208075ae..f5c1181f1b4 100644 --- a/.github/workflows/publish-python-sdk.yml +++ b/.github/workflows/publish-python-sdk.yml @@ -84,6 +84,6 @@ jobs: ``` ### Documentation - See the [README](https://github.com/simstudio/sim/tree/main/packages/python-sdk) for usage instructions. + See the [README](https://github.com/simstudioai/sim/tree/main/packages/python-sdk) or the [docs](https://docs.sim.ai/sdks/python) for more information. draft: false prerelease: false \ No newline at end of file diff --git a/.github/workflows/publish-ts-sdk.yml b/.github/workflows/publish-ts-sdk.yml index b1e733355e8..cf6c53972fc 100644 --- a/.github/workflows/publish-ts-sdk.yml +++ b/.github/workflows/publish-ts-sdk.yml @@ -25,7 +25,6 @@ jobs: registry-url: 'https://registry.npmjs.org/' - name: Install dependencies - working-directory: packages/ts-sdk run: bun install - name: Run tests @@ -80,6 +79,6 @@ jobs: ``` ### Documentation - See the [README](https://github.com/simstudio/sim/tree/main/packages/ts-sdk) for usage instructions. + See the [README](https://github.com/simstudioai/sim/tree/main/packages/ts-sdk) or the [docs](https://docs.sim.ai/sdks/typescript) for more information. draft: false prerelease: false \ No newline at end of file diff --git a/apps/sim/socket-server/database/operations.ts b/apps/sim/socket-server/database/operations.ts index 8502d14ae07..3e550917199 100644 --- a/apps/sim/socket-server/database/operations.ts +++ b/apps/sim/socket-server/database/operations.ts @@ -13,15 +13,15 @@ const connectionString = env.DATABASE_URL const socketDb = drizzle( postgres(connectionString, { prepare: false, - idle_timeout: 10, - connect_timeout: 20, - max: 15, + idle_timeout: 20, + connect_timeout: 10, + max: 5, onnotice: () => {}, }), { schema } ) -// Use dedicated connection for socket operations, fallback to shared db for compatibility +// Use dedicated connection for socket operations const db = socketDb // Constants diff --git a/apps/sim/socket-server/rooms/manager.ts b/apps/sim/socket-server/rooms/manager.ts index b4362113853..74f16f9ecfb 100644 --- a/apps/sim/socket-server/rooms/manager.ts +++ b/apps/sim/socket-server/rooms/manager.ts @@ -11,8 +11,8 @@ const connectionString = env.DATABASE_URL const db = drizzle( postgres(connectionString, { prepare: false, - idle_timeout: 15, - connect_timeout: 20, + idle_timeout: 20, + connect_timeout: 10, max: 3, onnotice: () => {}, }), diff --git a/packages/db/index.ts b/packages/db/index.ts index 62c00a8a682..6c7567a0040 100644 --- a/packages/db/index.ts +++ b/packages/db/index.ts @@ -10,28 +10,11 @@ if (!connectionString) { throw new Error('Missing DATABASE_URL environment variable') } -console.log( - '[DB Pool Init]', - JSON.stringify({ - timestamp: new Date().toISOString(), - nodeEnv: process.env.NODE_ENV, - action: 'CREATING_CONNECTION_POOL', - poolConfig: { - max: 30, - idle_timeout: 20, - connect_timeout: 30, - prepare: false, - }, - pid: process.pid, - isProduction: process.env.NODE_ENV === 'production', - }) -) - const postgresClient = postgres(connectionString, { prepare: false, idle_timeout: 20, - connect_timeout: 30, - max: 30, + connect_timeout: 10, + max: 20, onnotice: () => {}, }) diff --git a/packages/ts-sdk/package.json b/packages/ts-sdk/package.json index 41e040b5a3f..ee814211e26 100644 --- a/packages/ts-sdk/package.json +++ b/packages/ts-sdk/package.json @@ -2,14 +2,14 @@ "name": "simstudio-ts-sdk", "version": "0.1.0", "description": "Sim SDK - Execute workflows programmatically", + "type": "module", "main": "dist/index.js", "module": "dist/index.js", "types": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.js" + "import": "./dist/index.js" } }, "scripts": { diff --git a/packages/ts-sdk/tsconfig.json b/packages/ts-sdk/tsconfig.json index 465038368d9..a2d0612dd70 100644 --- a/packages/ts-sdk/tsconfig.json +++ b/packages/ts-sdk/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "ES2020", - "module": "commonjs", + "module": "ES2020", "lib": ["ES2020"], "outDir": "./dist", "rootDir": "./src", diff --git a/packages/ts-sdk/vitest.config.ts b/packages/ts-sdk/vitest.config.ts index 3e442d37705..66e210cbe4e 100644 --- a/packages/ts-sdk/vitest.config.ts +++ b/packages/ts-sdk/vitest.config.ts @@ -8,4 +8,7 @@ export default defineConfig({ include: ['src/**/*.test.{ts,tsx}', 'tests/**/*.test.{ts,tsx}'], exclude: ['**/node_modules/**', '**/dist/**'], }, + resolve: { + conditions: ['node', 'default'], + }, })