New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@agenteract/core

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agenteract/core - npm Package Compare versions

Comparing version
0.0.2
to
0.0.3
+18
dist/src/index.d.ts
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