@agenteract/core
Advanced tools
| export interface AgentCommand { | ||
| action: string; | ||
| [key: string]: any; | ||
| } | ||
| export interface AgentResponse { | ||
| status: 'success' | 'error' | 'received'; | ||
| [key: string]: any; | ||
| } | ||
| export declare const AGENTERACT_PROTOCOL_VERSION = "1.0.0"; | ||
| export declare function encodeMessage(obj: object): string; | ||
| export declare function decodeMessage<T>(json: string): T; | ||
| export declare function sendCommand(command: AgentCommand): Promise<AgentResponse>; | ||
| export declare function receiveResponse(response: AgentResponse): Promise<AgentCommand>; | ||
| export declare function detectInvoker(): { | ||
| pkgManager: string; | ||
| isNpx: boolean; | ||
| isPnpmDlx: boolean; | ||
| }; |
| export const AGENTERACT_PROTOCOL_VERSION = '1.0.0'; | ||
| export function encodeMessage(obj) { | ||
| return JSON.stringify({ ...obj, _v: AGENTERACT_PROTOCOL_VERSION }); | ||
| } | ||
| export function decodeMessage(json) { | ||
| return JSON.parse(json); | ||
| } | ||
| export function sendCommand(command) { | ||
| return Promise.resolve({ status: 'success', response: 'Command sent' }); | ||
| } | ||
| export function receiveResponse(response) { | ||
| return Promise.resolve({ action: 'response', response: response }); | ||
| } | ||
| export function detectInvoker() { | ||
| const ua = process.env.npm_config_user_agent || ''; | ||
| const execPath = process.env.npm_execpath || ''; | ||
| const pkgManager = ua.startsWith('pnpm/') ? 'pnpm' : | ||
| ua.startsWith('yarn/') ? 'yarn' : | ||
| ua.startsWith('npm/') ? 'npm' : | ||
| 'unknown'; | ||
| const isNpx = execPath.includes('npx-cli.js'); | ||
| const isPnpmDlx = pkgManager === 'pnpm' && process.argv[1]?.includes('dlx'); | ||
| return { pkgManager, isNpx, isPnpmDlx }; | ||
| } |
Sorry, the diff of this file is not supported yet
+3
-2
| { | ||
| "name": "@agenteract/core", | ||
| "version": "0.0.2", | ||
| "version": "0.0.3", | ||
| "description": "Core message schema, bridge protocol, and shared utilities for Agenteract", | ||
@@ -37,3 +37,4 @@ "main": "./dist/cjs/src/index.js", | ||
| "scripts": { | ||
| "build": "npm run build:cjs && npm run build:esm && npm run build:post", | ||
| "build": "npm run build:types && npm run build:cjs && npm run build:esm && npm run build:post", | ||
| "build:types": "tsc -p tsconfig.json", | ||
| "build:cjs": "tsc -p tsconfig.cjs.json", | ||
@@ -40,0 +41,0 @@ "build:esm": "tsc -p tsconfig.esm.json", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
18
20%191
28.19%137895
-29.52%8
33.33%