@standardagents/cli 0.25.0 → 0.25.2
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 +28 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -239,7 +239,7 @@ function getScaffoldStandardAgentsVersion() {
|
|
|
239
239
|
if (process.env.STANDARDAGENTS_WORKSPACE === "1") {
|
|
240
240
|
return "workspace:*";
|
|
241
241
|
}
|
|
242
|
-
return "0.25.
|
|
242
|
+
return "0.25.2";
|
|
243
243
|
}
|
|
244
244
|
function findViteConfig(cwd) {
|
|
245
245
|
const candidates = ["vite.config.ts", "vite.config.js", "vite.config.mts", "vite.config.mjs"];
|
|
@@ -983,6 +983,11 @@ async function selectInitAuthModeWithInk(context = {}) {
|
|
|
983
983
|
|
|
984
984
|
// src/commands/init.ts
|
|
985
985
|
var DEFAULT_PLATFORM_ENDPOINT = "https://api.standardagents.ai";
|
|
986
|
+
var DEFAULT_ONBOARDING_URL = "https://platform.standardagents.ai/projects/new";
|
|
987
|
+
var KNOWN_PLATFORM_ONBOARDING_URLS = {
|
|
988
|
+
"https://api.standardagents.ai": DEFAULT_ONBOARDING_URL,
|
|
989
|
+
"https://platform.standardagents.ai": DEFAULT_ONBOARDING_URL
|
|
990
|
+
};
|
|
986
991
|
var INIT_TUI_ENV_VAR = "STANDARDAGENTS_INIT_TUI";
|
|
987
992
|
var GENERATED_STANDARD_AGENTS_PACKAGES = [
|
|
988
993
|
"@standardagents/builder",
|
|
@@ -1529,7 +1534,7 @@ async function ensurePlatformAuth(options, quietLogs = false, context = {}) {
|
|
|
1529
1534
|
return { connected: true, mode: "standardagents" };
|
|
1530
1535
|
}
|
|
1531
1536
|
function getCliVersion() {
|
|
1532
|
-
return "0.25.
|
|
1537
|
+
return "0.25.2";
|
|
1533
1538
|
}
|
|
1534
1539
|
function getSipVersion() {
|
|
1535
1540
|
return "1.0.1";
|
|
@@ -1715,13 +1720,28 @@ function isBootstrapConsumeSuccess(body) {
|
|
|
1715
1720
|
const candidate = body;
|
|
1716
1721
|
return !!(candidate && candidate.user && typeof candidate.user.id === "string" && typeof candidate.user.email === "string" && typeof candidate.user.role === "string" && candidate.account && typeof candidate.account.id === "string");
|
|
1717
1722
|
}
|
|
1718
|
-
function
|
|
1723
|
+
function onboardingUrlForEndpoint(endpoint) {
|
|
1724
|
+
if (!endpoint) return DEFAULT_ONBOARDING_URL;
|
|
1725
|
+
try {
|
|
1726
|
+
const origin = new URL(endpoint).origin;
|
|
1727
|
+
return KNOWN_PLATFORM_ONBOARDING_URLS[origin] ?? DEFAULT_ONBOARDING_URL;
|
|
1728
|
+
} catch {
|
|
1729
|
+
return DEFAULT_ONBOARDING_URL;
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
function isBootstrapCodeFailureMessage(message) {
|
|
1733
|
+
return /bootstrap code/i.test(message);
|
|
1734
|
+
}
|
|
1735
|
+
function formatBootstrapExchangeError(status, body, endpoint) {
|
|
1719
1736
|
const payload = body;
|
|
1720
1737
|
const message = payload?.error?.message || payload?.message;
|
|
1721
|
-
|
|
1722
|
-
|
|
1738
|
+
const base = message ? `Bootstrap exchange failed (${status}): ${message}` : `Bootstrap exchange failed (${status})`;
|
|
1739
|
+
if (message && isBootstrapCodeFailureMessage(message)) {
|
|
1740
|
+
const url = onboardingUrlForEndpoint(endpoint);
|
|
1741
|
+
return `${base}
|
|
1742
|
+
Bootstrap codes are single-use and expire quickly. Grab a fresh one from ${url} and run the command again.`;
|
|
1723
1743
|
}
|
|
1724
|
-
return
|
|
1744
|
+
return base;
|
|
1725
1745
|
}
|
|
1726
1746
|
function extractSessionCookie(response) {
|
|
1727
1747
|
const headersWithSetCookie = response.headers;
|
|
@@ -1758,7 +1778,7 @@ async function exchangeBootstrapCode(endpoint, code, fetchImpl = fetch) {
|
|
|
1758
1778
|
body = {};
|
|
1759
1779
|
}
|
|
1760
1780
|
if (!response.ok) {
|
|
1761
|
-
throw new Error(formatBootstrapExchangeError(response.status, body));
|
|
1781
|
+
throw new Error(formatBootstrapExchangeError(response.status, body, endpoint));
|
|
1762
1782
|
}
|
|
1763
1783
|
if (!isBootstrapConsumeSuccess(body)) {
|
|
1764
1784
|
throw new Error("Bootstrap exchange failed: invalid response payload");
|
|
@@ -5237,7 +5257,7 @@ async function settleStdinForInitHandoff(stdin = process.stdin) {
|
|
|
5237
5257
|
}
|
|
5238
5258
|
}
|
|
5239
5259
|
var program = new Command();
|
|
5240
|
-
program.name("agents").description("CLI tool for Standard Agents / AgentBuilder").version("0.25.
|
|
5260
|
+
program.name("agents").description("CLI tool for Standard Agents / AgentBuilder").version("0.25.2");
|
|
5241
5261
|
program.command("init [project-name]").description("Create a new Standard Agents project").option("-y, --yes", "Skip prompts and use defaults").option("--local", "Use local project scaffolding instead of browser platform onboarding").option("--cli", "Use classic line-by-line CLI prompts instead of the TUI wizard").option("--api-url <url>", "Standard Agents platform API URL").option("--endpoint <url>", "Platform API endpoint for auth/bootstrap exchange").option("--package-manager <manager>", "Package manager for generated project: npm, pnpm, yarn, or bun").option("--template <template>", "Vite template to use", "vanilla-ts").option("--workspace", "Install @standardagents packages as workspace:* (local pnpm workspace development)").option("--no-dev", "Clone and configure the project without starting the dev server").addOption(new Option("--bootstrap <code>", "Exchange a web onboarding bootstrap code")).action(init);
|
|
5242
5262
|
program.command("login").description("Authenticate this machine (or use --bootstrap for project bootstrap auth)").option("--bootstrap <code>", "Bootstrap code from web onboarding").option("--endpoint <url>", "Platform API endpoint (default: https://api.standardagents.ai)").option("--no-open", "Do not auto-open browser URL").action(login);
|
|
5243
5263
|
program.command("logout").description("Clear stored StandardAgents auth and local org-scoped project auth").option("--org <org-id-or-slug>", "Org ID or slug to logout (defaults to active org)").option("--endpoint <url>", "Platform API endpoint (default: https://api.standardagents.ai)").action(logout);
|