agentapprove 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +7 -12
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2318,7 +2318,7 @@ import { homedir, hostname, platform } from "os";
|
|
|
2318
2318
|
import { join, dirname, basename } from "path";
|
|
2319
2319
|
import { execSync, spawnSync } from "child_process";
|
|
2320
2320
|
import { randomBytes, createHash } from "crypto";
|
|
2321
|
-
var VERSION = "0.1.
|
|
2321
|
+
var VERSION = "0.1.4";
|
|
2322
2322
|
function getApiUrl() {
|
|
2323
2323
|
return process.env.AGENTAPPROVE_API || "https://api.agentapprove.com";
|
|
2324
2324
|
}
|
|
@@ -3085,12 +3085,8 @@ async function installHooksForAgent(agentId, hooksDir, mode = "approval") {
|
|
|
3085
3085
|
pluginArray.push("@agentapprove/opencode");
|
|
3086
3086
|
}
|
|
3087
3087
|
writeJsonConfig(agent.configPath, config);
|
|
3088
|
-
const
|
|
3089
|
-
const opencodePkgPath = join(opencodePkgDir, "package.json");
|
|
3088
|
+
const opencodePkgPath = join(getOpenCodeConfigDir(), "package.json");
|
|
3090
3089
|
try {
|
|
3091
|
-
if (!existsSync(opencodePkgDir)) {
|
|
3092
|
-
mkdirSync(opencodePkgDir, { recursive: true });
|
|
3093
|
-
}
|
|
3094
3090
|
let pkgJson = {};
|
|
3095
3091
|
if (existsSync(opencodePkgPath)) {
|
|
3096
3092
|
pkgJson = JSON.parse(readFileSync(opencodePkgPath, "utf-8"));
|
|
@@ -3103,7 +3099,7 @@ async function installHooksForAgent(agentId, hooksDir, mode = "approval") {
|
|
|
3103
3099
|
`);
|
|
3104
3100
|
} catch (err) {
|
|
3105
3101
|
if (err instanceof Error) {
|
|
3106
|
-
console.warn(`Warning: Could not update
|
|
3102
|
+
console.warn(`Warning: Could not update package.json: ${err.message}`);
|
|
3107
3103
|
}
|
|
3108
3104
|
}
|
|
3109
3105
|
installedHooks.push("agentapprove");
|
|
@@ -3429,7 +3425,7 @@ function getManualInstructions(agentId, hooksDir) {
|
|
|
3429
3425
|
"",
|
|
3430
3426
|
configJson,
|
|
3431
3427
|
"",
|
|
3432
|
-
"Then add the dependency to
|
|
3428
|
+
"Then add the dependency to your OpenCode package.json (same directory):",
|
|
3433
3429
|
"",
|
|
3434
3430
|
' { "dependencies": { "@agentapprove/opencode": "latest" } }',
|
|
3435
3431
|
"",
|
|
@@ -4059,7 +4055,7 @@ AGENTAPPROVE_E2E_MODE=${installMode}
|
|
|
4059
4055
|
const agent = AGENTS[agentId];
|
|
4060
4056
|
filesToModify.push(agent.configPath);
|
|
4061
4057
|
if (agentId === "opencode") {
|
|
4062
|
-
filesToModify.push(join(getOpenCodeConfigDir(), "
|
|
4058
|
+
filesToModify.push(join(getOpenCodeConfigDir(), "package.json"));
|
|
4063
4059
|
}
|
|
4064
4060
|
if (agentId === "vscode-agent") {
|
|
4065
4061
|
const vsCodeVariants = findInstalledVSCodeVariants();
|
|
@@ -4176,7 +4172,7 @@ async function statusCommand() {
|
|
|
4176
4172
|
const config = readJsonConfig(agent.configPath);
|
|
4177
4173
|
if (agentId === "opencode") {
|
|
4178
4174
|
const pluginConfig = config.plugin;
|
|
4179
|
-
if (Array.isArray(pluginConfig) && pluginConfig.some((entry) => entry === "@agentapprove/opencode")) {
|
|
4175
|
+
if (Array.isArray(pluginConfig) && pluginConfig.some((entry) => typeof entry === "string" && entry.includes("@agentapprove/opencode"))) {
|
|
4180
4176
|
console.log(` ${source_default.green("✓")} ${agent.name}: agentapprove plugin`);
|
|
4181
4177
|
}
|
|
4182
4178
|
continue;
|
|
@@ -4269,8 +4265,7 @@ async function uninstallCommand() {
|
|
|
4269
4265
|
modified = true;
|
|
4270
4266
|
}
|
|
4271
4267
|
}
|
|
4272
|
-
const
|
|
4273
|
-
const opencodePkgPath = join(opencodePkgDir, "package.json");
|
|
4268
|
+
const opencodePkgPath = join(getOpenCodeConfigDir(), "package.json");
|
|
4274
4269
|
try {
|
|
4275
4270
|
if (existsSync(opencodePkgPath)) {
|
|
4276
4271
|
const pkgJson = JSON.parse(readFileSync(opencodePkgPath, "utf-8"));
|