@agentvalet/register 0.3.2 → 0.3.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/index.js +18 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ async function runWizard(prefilled) {
|
|
|
14
14
|
questions.push({
|
|
15
15
|
type: "text",
|
|
16
16
|
name: "ownerId",
|
|
17
|
-
message: "Owner ID (from https://agentvalet.ai/settings):",
|
|
17
|
+
message: "Owner ID (from https://app.agentvalet.ai/settings):",
|
|
18
18
|
validate: (v) => v.trim() ? true : "Owner ID is required"
|
|
19
19
|
});
|
|
20
20
|
}
|
|
@@ -289,7 +289,7 @@ function ensureMcpServer() {
|
|
|
289
289
|
}
|
|
290
290
|
function generatePermissionsFile(agentId, ownerId, permissions) {
|
|
291
291
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
292
|
-
const platformSections = permissions.length === 0 ? "_No platforms approved yet. Visit https://agentvalet.ai to connect platforms._" : permissions.map((p) => {
|
|
292
|
+
const platformSections = permissions.length === 0 ? "_No platforms approved yet. Visit https://app.agentvalet.ai to connect platforms._" : permissions.map((p) => {
|
|
293
293
|
const scopeList = p.scopes.map((s) => ` - \`${s}\``).join("\n");
|
|
294
294
|
const approvalNote = p.requireApproval ? "\n > Requires human approval before executing.\n" : "";
|
|
295
295
|
return `### ${p.platformName} (\`${p.platformId}\`)
|
|
@@ -534,7 +534,7 @@ import prompts3 from "prompts";
|
|
|
534
534
|
import { createOAuthDeviceAuth } from "@octokit/auth-oauth-device";
|
|
535
535
|
import open from "open";
|
|
536
536
|
import chalk3 from "chalk";
|
|
537
|
-
var GITHUB_CLIENT_ID = process.env.AGENTVALET_GITHUB_CLIENT_ID ?? "
|
|
537
|
+
var GITHUB_CLIENT_ID = process.env.AGENTVALET_GITHUB_CLIENT_ID ?? "Ov23liQcaW0HcqJxmLfF";
|
|
538
538
|
async function authenticateWithGitHub() {
|
|
539
539
|
const auth = createOAuthDeviceAuth({
|
|
540
540
|
clientType: "oauth-app",
|
|
@@ -586,20 +586,26 @@ async function getGitHubUser(token) {
|
|
|
586
586
|
}
|
|
587
587
|
|
|
588
588
|
// src/api/agentvalet.ts
|
|
589
|
-
var
|
|
589
|
+
var SUPABASE_URL = "https://jmodblrolfoavrxqgbps.supabase.co";
|
|
590
|
+
var SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imptb2RibHJvbGZvYXZyeHFnYnBzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQwODIzNzYsImV4cCI6MjA4OTY1ODM3Nn0.xQQiYHXbDsHyiTd5TsAfXtNWBUGkT4eO7Ew9UH8n6UE";
|
|
591
|
+
var FUNCTIONS_URL = `${SUPABASE_URL}/functions/v1`;
|
|
592
|
+
var baseHeaders = {
|
|
593
|
+
"Content-Type": "application/json",
|
|
594
|
+
"apikey": SUPABASE_ANON_KEY
|
|
595
|
+
};
|
|
590
596
|
async function createOrFindAccount(params) {
|
|
591
597
|
const controller = new AbortController();
|
|
592
598
|
const timeout = setTimeout(() => controller.abort(), 1e4);
|
|
593
599
|
try {
|
|
594
|
-
const response = await fetch(`${
|
|
600
|
+
const response = await fetch(`${FUNCTIONS_URL}/cli-account`, {
|
|
595
601
|
method: "POST",
|
|
596
|
-
headers:
|
|
602
|
+
headers: baseHeaders,
|
|
597
603
|
body: JSON.stringify(params),
|
|
598
604
|
signal: controller.signal
|
|
599
605
|
});
|
|
600
606
|
if (!response.ok) {
|
|
601
607
|
const error = await response.json().catch(() => ({}));
|
|
602
|
-
throw new Error(`Account
|
|
608
|
+
throw new Error(`Account setup failed: ${response.status} ${error.error ?? ""}`);
|
|
603
609
|
}
|
|
604
610
|
return response.json();
|
|
605
611
|
} catch (err) {
|
|
@@ -614,10 +620,10 @@ async function registerAgent2(params, apiKey) {
|
|
|
614
620
|
const controller = new AbortController();
|
|
615
621
|
const timeout = setTimeout(() => controller.abort(), 1e4);
|
|
616
622
|
try {
|
|
617
|
-
const response = await fetch(`${
|
|
623
|
+
const response = await fetch(`${FUNCTIONS_URL}/cli-register-agent`, {
|
|
618
624
|
method: "POST",
|
|
619
625
|
headers: {
|
|
620
|
-
|
|
626
|
+
...baseHeaders,
|
|
621
627
|
"Authorization": `Bearer ${apiKey}`
|
|
622
628
|
},
|
|
623
629
|
body: JSON.stringify(params),
|
|
@@ -625,7 +631,7 @@ async function registerAgent2(params, apiKey) {
|
|
|
625
631
|
});
|
|
626
632
|
if (!response.ok) {
|
|
627
633
|
const error = await response.json().catch(() => ({}));
|
|
628
|
-
throw new Error(`Agent registration failed: ${response.status} ${error.
|
|
634
|
+
throw new Error(`Agent registration failed: ${response.status} ${error.error ?? ""}`);
|
|
629
635
|
}
|
|
630
636
|
return response.json();
|
|
631
637
|
} catch (err) {
|
|
@@ -872,7 +878,7 @@ import path6 from "path";
|
|
|
872
878
|
async function runOnboard() {
|
|
873
879
|
console.log("");
|
|
874
880
|
console.log(chalk6.bold(" AgentValet \u2014 Agent Registration"));
|
|
875
|
-
console.log(chalk6.dim(" agentvalet.ai"));
|
|
881
|
+
console.log(chalk6.dim(" app.agentvalet.ai"));
|
|
876
882
|
console.log("");
|
|
877
883
|
if (isAuthenticated()) {
|
|
878
884
|
const stored = getStoredConfig();
|
|
@@ -1135,7 +1141,7 @@ program.name("agentvalet-register").description("Self-register an AI agent with
|
|
|
1135
1141
|
}
|
|
1136
1142
|
if (!isJson) {
|
|
1137
1143
|
console.log(chalk7.cyan(`
|
|
1138
|
-
Approve at: https://agentvalet.ai/
|
|
1144
|
+
Approve at: https://app.agentvalet.ai/agents
|
|
1139
1145
|
`));
|
|
1140
1146
|
}
|
|
1141
1147
|
if (!opts.wait) {
|