@agentvalet/register 0.3.8 → 0.3.9
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/index.js +20 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -806,22 +806,17 @@ Dashboard: ${proxyUrl.replace("api.", "app.")}
|
|
|
806
806
|
}
|
|
807
807
|
async function writeGlobalFrameworkConfigs(params) {
|
|
808
808
|
const written = [];
|
|
809
|
-
const
|
|
810
|
-
const codexConfigPath = path4.join(
|
|
811
|
-
if (existsSync4(
|
|
809
|
+
const codexDir = path4.join(os.homedir(), ".codex");
|
|
810
|
+
const codexConfigPath = path4.join(codexDir, "config.toml");
|
|
811
|
+
if (existsSync4(codexDir)) {
|
|
812
812
|
try {
|
|
813
|
-
const existing = await readFile2(codexConfigPath, "utf8");
|
|
814
|
-
if (!existing.includes("[
|
|
813
|
+
const existing = existsSync4(codexConfigPath) ? await readFile2(codexConfigPath, "utf8") : "";
|
|
814
|
+
if (!existing.includes("[mcp_servers.agentvalet]")) {
|
|
815
815
|
const addition = `
|
|
816
|
-
[
|
|
816
|
+
[mcp_servers.agentvalet]
|
|
817
817
|
command = "npx"
|
|
818
|
-
args = ["-y", "@agentvalet/mcp-server"]
|
|
819
|
-
|
|
820
|
-
[mcp.servers.agentvalet.env]
|
|
821
|
-
AGENT_ID = "${params.agentId}"
|
|
822
|
-
OWNER_ID = "${params.ownerId}"
|
|
823
|
-
PROXY_URL = "${params.proxyUrl}"
|
|
824
|
-
AGENT_PRIVATE_KEY = "${privateKeyEscaped}"
|
|
818
|
+
args = ["-y", "@agentvalet/register", "mcp-server"]
|
|
819
|
+
env = { AGENT_ID = "${params.agentId}", OWNER_ID = "${params.ownerId}", PROXY_URL = "${params.proxyUrl}", AGENT_PRIVATE_KEY_PATH = "${params.keyPath.replace(/\\/g, "/")}" }
|
|
825
820
|
`;
|
|
826
821
|
await appendFile3(codexConfigPath, addition, "utf8");
|
|
827
822
|
written.push("~/.codex/config.toml");
|
|
@@ -878,6 +873,14 @@ import os2 from "os";
|
|
|
878
873
|
import path5 from "path";
|
|
879
874
|
import prompts2 from "prompts";
|
|
880
875
|
import chalk5 from "chalk";
|
|
876
|
+
function tryBinary(cmd) {
|
|
877
|
+
try {
|
|
878
|
+
execSync2(`${cmd} --version`, { stdio: "ignore", timeout: 3e3 });
|
|
879
|
+
return true;
|
|
880
|
+
} catch {
|
|
881
|
+
return false;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
881
884
|
function cursorInstalled() {
|
|
882
885
|
const home = os2.homedir();
|
|
883
886
|
const platform = process.platform;
|
|
@@ -891,21 +894,11 @@ function cursorInstalled() {
|
|
|
891
894
|
}
|
|
892
895
|
return existsSync5(path5.join(home, ".config", "Cursor")) || existsSync5("/usr/share/applications/cursor.desktop");
|
|
893
896
|
}
|
|
894
|
-
function claudeCodeInstalled() {
|
|
895
|
-
const home = os2.homedir();
|
|
896
|
-
if (existsSync5(path5.join(home, ".claude"))) return true;
|
|
897
|
-
try {
|
|
898
|
-
execSync2("claude --version", { stdio: "ignore", timeout: 3e3 });
|
|
899
|
-
return true;
|
|
900
|
-
} catch {
|
|
901
|
-
return false;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
897
|
function detectFrameworks() {
|
|
905
898
|
const home = os2.homedir();
|
|
906
899
|
return {
|
|
907
|
-
codex: existsSync5(path5.join(home, ".codex"
|
|
908
|
-
claudeCode:
|
|
900
|
+
codex: existsSync5(path5.join(home, ".codex")) || tryBinary("codex"),
|
|
901
|
+
claudeCode: existsSync5(path5.join(home, ".claude")) || tryBinary("claude"),
|
|
909
902
|
cursor: existsSync5(path5.join(process.cwd(), ".cursor")) || cursorInstalled(),
|
|
910
903
|
openclaw: existsSync5(path5.join(home, ".openclaw"))
|
|
911
904
|
};
|
|
@@ -1146,7 +1139,7 @@ async function registerAgentFlow(apiKey, ownerId) {
|
|
|
1146
1139
|
agentId: agent.agent_id,
|
|
1147
1140
|
ownerId,
|
|
1148
1141
|
proxyUrl: getStoredConfig().proxyUrl,
|
|
1149
|
-
|
|
1142
|
+
keyPath: path6.join(process.cwd(), ".agentvalet", "agent.key")
|
|
1150
1143
|
});
|
|
1151
1144
|
for (const r of globalResults) {
|
|
1152
1145
|
console.log(chalk6.green(` \u2713 ${r}`));
|
|
@@ -1199,7 +1192,7 @@ function collectScope(value, previous) {
|
|
|
1199
1192
|
return [...previous, value];
|
|
1200
1193
|
}
|
|
1201
1194
|
var program = new Command();
|
|
1202
|
-
program.name("agentvalet-register").description("Self-register an AI agent with AgentValet").version("0.3.
|
|
1195
|
+
program.name("agentvalet-register").description("Self-register an AI agent with AgentValet").version("0.3.9").option("--owner <uuid>", "Owner ID (or set AGENTVALET_OWNER env var)").option("--name <name>", "Agent name").option("--description <desc>", "Agent description").option("--scope <platform:scope>", "Requested scope, repeatable", collectScope, []).option("--api-url <url>", "AgentValet API base URL", "https://api.agentvalet.ai").option("--output <path>", "Path to write .env file", "./.env.agentvalet").option("--key-path <path>", "Path to write private key", "./agentvalet.key").option("--json", "Machine-readable JSON output").option("--no-wait", "Register only, do not wait for approval").option("--timeout <seconds>", "Approval wait timeout in seconds", "300").action(async (opts) => {
|
|
1203
1196
|
const isJson = !!opts.json;
|
|
1204
1197
|
let ownerId = opts.owner ?? process.env.AGENTVALET_OWNER ?? "";
|
|
1205
1198
|
let agentName = opts.name ?? "";
|