Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@agentuity/postgres

Package Overview
Dependencies
Maintainers
3
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentuity/postgres - npm Package Compare versions

Comparing version
2.0.8
to
2.0.9-v3.cdab389
+2
-2
dist/registry.d.ts

@@ -10,4 +10,4 @@ /**

*
* When @agentuity/runtime is available, this module automatically registers
* a shutdown hook so all postgres clients/pools are closed during graceful shutdown.
* Automatically registers process shutdown hooks (beforeExit, SIGTERM, SIGINT)
* so all postgres clients/pools are closed during graceful shutdown.
*/

@@ -14,0 +14,0 @@ /**

@@ -10,4 +10,4 @@ /**

*
* When @agentuity/runtime is available, this module automatically registers
* a shutdown hook so all postgres clients/pools are closed during graceful shutdown.
* Automatically registers process shutdown hooks (beforeExit, SIGTERM, SIGINT)
* so all postgres clients/pools are closed during graceful shutdown.
*/

@@ -145,10 +145,10 @@ /**

/**
* Attempts to register a shutdown hook with @agentuity/runtime if available.
* This is called automatically when the first client is registered.
* Registers a process shutdown hook to gracefully close all connections.
* Uses standard Node.js/Bun process events instead of framework-specific hooks.
*
* @internal
*/
function tryRegisterRuntimeHook() {
function registerProcessShutdownHook() {
const global = globalThis;
// Only try once
// Only register once
if (global[RUNTIME_HOOK_REGISTERED]) {

@@ -158,21 +158,11 @@ return;

global[RUNTIME_HOOK_REGISTERED] = true;
// Try to dynamically import the runtime and register our shutdown hook
// This is done asynchronously to avoid blocking client creation
// and to handle the case where runtime is not available
// Using Function constructor to avoid TypeScript trying to resolve the module at build time
const dynamicImport = new Function('specifier', 'return import(specifier)');
dynamicImport('@agentuity/runtime')
.then((runtime) => {
if (typeof runtime.registerShutdownHook === 'function') {
runtime.registerShutdownHook(async () => {
await shutdownAll(5000); // 5 second timeout for graceful shutdown
});
}
})
.catch(() => {
// Runtime not available - that's fine, user can call shutdownAll manually
});
const shutdown = () => {
shutdownAll(5000).catch(() => { });
};
process.on('beforeExit', shutdown);
process.on('SIGTERM', shutdown);
process.on('SIGINT', shutdown);
}
// Try to register with runtime when this module is first loaded
tryRegisterRuntimeHook();
// Register shutdown hook when this module is first loaded
registerProcessShutdownHook();
//# sourceMappingURL=registry.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuBH;;GAEG;AACH,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;AAE1F;;GAEG;AACH,SAAS,WAAW;IACnB,MAAM,MAAM,GAAG,UAA8C,CAAC;IAC9D,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,UAAuB;IACrD,WAAW,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAuB;IACvD,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC7B,OAAO,WAAW,EAAE,CAAC,IAAI,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU;IACzB,OAAO,WAAW,EAAE,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAkB;IACnD,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC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C,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,0DAA0D;AAC1D,2BAA2B,EAAE,CAAC"}
{
"name": "@agentuity/postgres",
"version": "2.0.8",
"license": "Apache-2.0",
"author": "Agentuity employees and contributors",
"type": "module",
"description": "Resilient PostgreSQL client with automatic reconnection for Agentuity projects",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"AGENTS.md",
"README.md",
"src",
"dist"
],
"exports": {
".": "./dist/index.js"
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
]
}
},
"scripts": {
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"build": "bunx tsc --build --force",
"typecheck": "bunx tsc --noEmit",
"prepublishOnly": "bun run clean && bun run build"
},
"dependencies": {
"@agentuity/core": "2.0.8",
"pg": "^8.13.1"
},
"peerDependencies": {
"@agentuity/runtime": "2.0.8"
},
"peerDependenciesMeta": {
"@agentuity/runtime": {
"optional": true
}
},
"devDependencies": {
"@agentuity/runtime": "2.0.8",
"@agentuity/test-utils": "2.0.8",
"@types/bun": "latest",
"@types/pg": "^8.11.14",
"bun-types": "latest",
"kysely": "^0.27.6",
"typescript": "^5.9.0"
},
"publishConfig": {
"access": "public"
},
"sideEffects": false
"name": "@agentuity/postgres",
"version": "2.0.9-v3.cdab389",
"license": "Apache-2.0",
"author": "Agentuity employees and contributors",
"type": "module",
"description": "Resilient PostgreSQL client with automatic reconnection for Agentuity projects",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"AGENTS.md",
"README.md",
"src",
"dist"
],
"exports": {
".": "./dist/index.js"
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
]
}
},
"scripts": {
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"build": "bunx tsc --build --force",
"typecheck": "bunx tsc --noEmit",
"prepublishOnly": "bun run clean && bun run build"
},
"dependencies": {
"@agentuity/core": "2.0.9-v3.cdab389",
"pg": "^8.13.1"
},
"devDependencies": {
"@agentuity/test-utils": "2.0.9-v3.cdab389",
"@types/bun": "latest",
"@types/pg": "^8.11.14",
"bun-types": "latest",
"kysely": "^0.27.6",
"typescript": "^5.9.0"
},
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/agentuity/sdk.git",
"directory": "packages/postgres"
}
}

@@ -10,4 +10,4 @@ /**

*
* When @agentuity/runtime is available, this module automatically registers
* a shutdown hook so all postgres clients/pools are closed during graceful shutdown.
* Automatically registers process shutdown hooks (beforeExit, SIGTERM, SIGINT)
* so all postgres clients/pools are closed during graceful shutdown.
*/

@@ -178,11 +178,11 @@

/**
* Attempts to register a shutdown hook with @agentuity/runtime if available.
* This is called automatically when the first client is registered.
* Registers a process shutdown hook to gracefully close all connections.
* Uses standard Node.js/Bun process events instead of framework-specific hooks.
*
* @internal
*/
function tryRegisterRuntimeHook(): void {
function registerProcessShutdownHook(): void {
const global = globalThis as Record<symbol, boolean>;
// Only try once
// Only register once
if (global[RUNTIME_HOOK_REGISTERED]) {

@@ -193,24 +193,12 @@ return;

// Try to dynamically import the runtime and register our shutdown hook
// This is done asynchronously to avoid blocking client creation
// and to handle the case where runtime is not available
// Using Function constructor to avoid TypeScript trying to resolve the module at build time
const dynamicImport = new Function('specifier', 'return import(specifier)') as (
specifier: string
) => Promise<{ registerShutdownHook?: (hook: () => Promise<void> | void) => void }>;
const shutdown = () => {
shutdownAll(5000).catch(() => {});
};
dynamicImport('@agentuity/runtime')
.then((runtime) => {
if (typeof runtime.registerShutdownHook === 'function') {
runtime.registerShutdownHook(async () => {
await shutdownAll(5000); // 5 second timeout for graceful shutdown
});
}
})
.catch(() => {
// Runtime not available - that's fine, user can call shutdownAll manually
});
process.on('beforeExit', shutdown);
process.on('SIGTERM', shutdown);
process.on('SIGINT', shutdown);
}
// Try to register with runtime when this module is first loaded
tryRegisterRuntimeHook();
// Register shutdown hook when this module is first loaded
registerProcessShutdownHook();