🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

agent-powerups

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agent-powerups - npm Package Compare versions

Comparing version
0.4.3
to
0.5.0
+31
-4
dist/src/cli/utils/plugins.js
import fs from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
const PLUGINS_DIR = "plugins";
const BUNDLES_FILE = "plugin-bundles.json";
async function findPluginRoot(startDir) {
let current = path.resolve(startDir);
while (true) {
try {
await fs.stat(path.join(current, BUNDLES_FILE));
return current;
}
catch {
const parent = path.dirname(current);
if (parent === current)
return null;
current = parent;
}
}
}
async function resolvePluginRoot(cwd) {
// Walk up from cwd first, then from the installed package location.
const fromCwd = await findPluginRoot(cwd);
if (fromCwd)
return fromCwd;
const fromPkg = await findPluginRoot(path.dirname(fileURLToPath(import.meta.url)));
return fromPkg ?? cwd;
}
export async function getPluginBundles(cwd) {
const root = await resolvePluginRoot(cwd);
try {
const data = await fs.readFile(path.join(cwd, BUNDLES_FILE), "utf8");
const data = await fs.readFile(path.join(root, BUNDLES_FILE), "utf8");
const parsed = JSON.parse(data);
return Array.isArray(parsed.plugins) ? parsed.plugins : [];
}
catch (error) {
catch {
return [];

@@ -16,2 +41,3 @@ }

export async function listPlugins(cwd) {
const root = await resolvePluginRoot(cwd);
const bundles = await getPluginBundles(cwd);

@@ -22,3 +48,3 @@ const result = [];

continue;
const pluginPath = path.join(cwd, PLUGINS_DIR, bundle.name);
const pluginPath = path.join(root, PLUGINS_DIR, bundle.name);
try {

@@ -49,2 +75,3 @@ await fs.stat(pluginPath);

const errors = [];
const root = await resolvePluginRoot(cwd);
const bundles = await getPluginBundles(cwd);

@@ -55,3 +82,3 @@ const bundle = bundles.find(b => b.name === name);

}
const pluginPath = path.join(cwd, PLUGINS_DIR, name);
const pluginPath = path.join(root, PLUGINS_DIR, name);
try {

@@ -58,0 +85,0 @@ await fs.stat(pluginPath);

+6
-6
{
"name": "agent-powerups",
"version": "0.4.3",
"version": "0.5.0",
"description": "Local-first CLI for browsing, validating, running, and explicitly writing agent powerups.",

@@ -23,7 +23,7 @@ "license": "Apache-2.0",

"cli",
"gemini-cli",
"gemini",
"skill-pack",
"plugin",
"gemini-cli-extension"
"gemini-cli",
"gemini",
"skill-pack",
"plugin",
"gemini-cli-extension"
],

@@ -30,0 +30,0 @@ "bin": {