@standardagents/cli 0.16.0 → 0.16.1-next.1e58032
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 +24 -56
- 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.16.
|
|
242
|
+
return "0.16.1-next.1e58032";
|
|
243
243
|
}
|
|
244
244
|
function findViteConfig(cwd) {
|
|
245
245
|
const candidates = ["vite.config.ts", "vite.config.js", "vite.config.mts", "vite.config.mjs"];
|
|
@@ -989,9 +989,7 @@ var GENERATED_STANDARD_AGENTS_PACKAGES = [
|
|
|
989
989
|
"@standardagents/spec",
|
|
990
990
|
...FIRST_PARTY_PROVIDER_PACKAGES
|
|
991
991
|
];
|
|
992
|
-
var PLATFORM_RUNTIME_PACKAGE = "@standardagents/platform-runtime";
|
|
993
992
|
var PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
|
|
994
|
-
var DEFAULT_PLATFORM_GIT_HELPER_COMMAND = "!npx -y @standardagents/cli@latest git-credential";
|
|
995
993
|
var MISSING_PLATFORM_PROJECT_NAME_MESSAGE = "The platform did not return a project name. Please run the init command again to start a new project setup.";
|
|
996
994
|
var LEGACY_BOOTSTRAP_RESPONSE_MESSAGE = "The platform returned an older onboarding response. Please run the init command again to start a new project setup.";
|
|
997
995
|
var INIT_WIZARD_RETURN_TO_HOME_EXIT_CODE = 90;
|
|
@@ -1538,7 +1536,7 @@ async function ensurePlatformAuth(options, quietLogs = false, context = {}) {
|
|
|
1538
1536
|
return { connected: true, mode: "standardagents" };
|
|
1539
1537
|
}
|
|
1540
1538
|
function getCliVersion() {
|
|
1541
|
-
return "0.16.
|
|
1539
|
+
return "0.16.1-next.1e58032";
|
|
1542
1540
|
}
|
|
1543
1541
|
function getSipVersion() {
|
|
1544
1542
|
return "1.0.1";
|
|
@@ -1621,18 +1619,14 @@ function validateWorkspacePackageDir(packageName, packageDir) {
|
|
|
1621
1619
|
);
|
|
1622
1620
|
}
|
|
1623
1621
|
}
|
|
1624
|
-
function rewriteStandardAgentsDependenciesForWorkspace(projectPath, workspaceRoot
|
|
1622
|
+
function rewriteStandardAgentsDependenciesForWorkspace(projectPath, workspaceRoot) {
|
|
1625
1623
|
const packageJsonPath = path7.join(projectPath, "package.json");
|
|
1626
1624
|
const packageJson = JSON.parse(fs3.readFileSync(packageJsonPath, "utf-8"));
|
|
1627
1625
|
const dependencies = packageJson.dependencies ?? {};
|
|
1628
1626
|
const linkedPackages = [];
|
|
1629
|
-
const
|
|
1630
|
-
...GENERATED_STANDARD_AGENTS_PACKAGES,
|
|
1631
|
-
...Object.keys(extraPackageDirs)
|
|
1632
|
-
];
|
|
1633
|
-
for (const packageName of packageNames) {
|
|
1627
|
+
for (const packageName of GENERATED_STANDARD_AGENTS_PACKAGES) {
|
|
1634
1628
|
if (!(packageName in dependencies)) continue;
|
|
1635
|
-
const packageDir =
|
|
1629
|
+
const packageDir = workspacePackageDir(workspaceRoot, packageName);
|
|
1636
1630
|
validateWorkspacePackageDir(packageName, packageDir);
|
|
1637
1631
|
dependencies[packageName] = `link:${packageDir}`;
|
|
1638
1632
|
linkedPackages.push(packageName);
|
|
@@ -1644,40 +1638,6 @@ function rewriteStandardAgentsDependenciesForWorkspace(projectPath, workspaceRoo
|
|
|
1644
1638
|
}
|
|
1645
1639
|
return linkedPackages;
|
|
1646
1640
|
}
|
|
1647
|
-
function resolvePlatformRuntimePackageDir() {
|
|
1648
|
-
const explicitRoot = process.env.STANDARDAGENTS_PLATFORM_RUNTIME_ROOT?.trim();
|
|
1649
|
-
if (!explicitRoot) return null;
|
|
1650
|
-
const packageDir = path7.resolve(explicitRoot);
|
|
1651
|
-
validateWorkspacePackageDir(PLATFORM_RUNTIME_PACKAGE, packageDir);
|
|
1652
|
-
return packageDir;
|
|
1653
|
-
}
|
|
1654
|
-
function addProjectDependency(projectPath, packageName, version) {
|
|
1655
|
-
const packageJsonPath = path7.join(projectPath, "package.json");
|
|
1656
|
-
const packageJson = JSON.parse(fs3.readFileSync(packageJsonPath, "utf-8"));
|
|
1657
|
-
packageJson.dependencies = {
|
|
1658
|
-
...packageJson.dependencies ?? {},
|
|
1659
|
-
[packageName]: packageJson.dependencies?.[packageName] ?? version
|
|
1660
|
-
};
|
|
1661
|
-
fs3.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}
|
|
1662
|
-
`, "utf-8");
|
|
1663
|
-
}
|
|
1664
|
-
function ensurePlatformRuntimeRegistration(projectPath) {
|
|
1665
|
-
const workerIndexPath = path7.join(projectPath, "worker", "index.ts");
|
|
1666
|
-
if (!fs3.existsSync(workerIndexPath)) return false;
|
|
1667
|
-
const source = fs3.readFileSync(workerIndexPath, "utf-8");
|
|
1668
|
-
if (source.includes(`from "${PLATFORM_RUNTIME_PACKAGE}"`) || source.includes(`from '${PLATFORM_RUNTIME_PACKAGE}'`)) {
|
|
1669
|
-
return false;
|
|
1670
|
-
}
|
|
1671
|
-
const registration = [
|
|
1672
|
-
`import { ProviderRegistry } from "@standardagents/builder/runtime"`,
|
|
1673
|
-
`import { createProviderFromEnv } from "${PLATFORM_RUNTIME_PACKAGE}"`,
|
|
1674
|
-
"",
|
|
1675
|
-
"ProviderRegistry.setProviderOverride(createProviderFromEnv)",
|
|
1676
|
-
""
|
|
1677
|
-
].join("\n");
|
|
1678
|
-
fs3.writeFileSync(workerIndexPath, `${registration}${source}`, "utf-8");
|
|
1679
|
-
return true;
|
|
1680
|
-
}
|
|
1681
1641
|
function preparePlatformProjectDependencies(projectPath, packageManager) {
|
|
1682
1642
|
if (process.env.STANDARDAGENTS_WORKSPACE !== "1") {
|
|
1683
1643
|
return [];
|
|
@@ -1689,14 +1649,7 @@ function preparePlatformProjectDependencies(projectPath, packageManager) {
|
|
|
1689
1649
|
if (!workspaceRoot) {
|
|
1690
1650
|
throw new Error("STANDARDAGENTS_WORKSPACE=1 was set, but no Standard Agents workspace root was found");
|
|
1691
1651
|
}
|
|
1692
|
-
|
|
1693
|
-
const platformRuntimePackageDir = resolvePlatformRuntimePackageDir();
|
|
1694
|
-
if (platformRuntimePackageDir) {
|
|
1695
|
-
addProjectDependency(projectPath, PLATFORM_RUNTIME_PACKAGE, "workspace:*");
|
|
1696
|
-
ensurePlatformRuntimeRegistration(projectPath);
|
|
1697
|
-
extraPackageDirs[PLATFORM_RUNTIME_PACKAGE] = platformRuntimePackageDir;
|
|
1698
|
-
}
|
|
1699
|
-
return rewriteStandardAgentsDependenciesForWorkspace(projectPath, workspaceRoot, extraPackageDirs);
|
|
1652
|
+
return rewriteStandardAgentsDependenciesForWorkspace(projectPath, workspaceRoot);
|
|
1700
1653
|
}
|
|
1701
1654
|
function shellQuote(value) {
|
|
1702
1655
|
return `"${value.replace(/(["\\$`])/g, "\\$1")}"`;
|
|
@@ -1913,7 +1866,13 @@ function platformGitCredentialHelperCommand(cliEntry = process.argv[1] ?? "") {
|
|
|
1913
1866
|
if (process.env.STANDARDAGENTS_WORKSPACE === "1" && cliEntry && fs3.existsSync(cliEntry)) {
|
|
1914
1867
|
return `!node ${shellQuote(path7.resolve(cliEntry))} git-credential`;
|
|
1915
1868
|
}
|
|
1916
|
-
|
|
1869
|
+
if (process.env.STANDARD_AGENTS_GIT_HELPER?.trim()) {
|
|
1870
|
+
return process.env.STANDARD_AGENTS_GIT_HELPER.trim();
|
|
1871
|
+
}
|
|
1872
|
+
const cliVersion = getCliVersion();
|
|
1873
|
+
{
|
|
1874
|
+
return `!npx -y @standardagents/cli@${cliVersion} git-credential`;
|
|
1875
|
+
}
|
|
1917
1876
|
}
|
|
1918
1877
|
async function configurePlatformGitCredentialHelper(projectPath) {
|
|
1919
1878
|
await runCommand("git", ["config", "credential.helper", platformGitCredentialHelperCommand()], projectPath);
|
|
@@ -2029,7 +1988,11 @@ function writeStandardAgentsSupportFiles(projectPath, params) {
|
|
|
2029
1988
|
const written = [];
|
|
2030
1989
|
for (const supportFile of renderAgentBuilderSupportFiles({
|
|
2031
1990
|
projectName: params.projectName,
|
|
2032
|
-
packageManager: params.packageManager
|
|
1991
|
+
packageManager: params.packageManager,
|
|
1992
|
+
versions: {
|
|
1993
|
+
standardAgents: getCliVersion(),
|
|
1994
|
+
sip: getSipVersion()
|
|
1995
|
+
}
|
|
2033
1996
|
})) {
|
|
2034
1997
|
const targetPath = path7.join(projectPath, supportFile.path);
|
|
2035
1998
|
if (fs3.existsSync(targetPath)) continue;
|
|
@@ -2048,6 +2011,11 @@ function writeStandardAgentsSupportFiles(projectPath, params) {
|
|
|
2048
2011
|
"node_modules"
|
|
2049
2012
|
]);
|
|
2050
2013
|
}
|
|
2014
|
+
appendGitignoreEntries(projectPath, "# Standard Agents local dev state", [
|
|
2015
|
+
".agents",
|
|
2016
|
+
".wrangler",
|
|
2017
|
+
"dist"
|
|
2018
|
+
]);
|
|
2051
2019
|
return written;
|
|
2052
2020
|
}
|
|
2053
2021
|
function supportFiles(options = {}) {
|
|
@@ -5194,7 +5162,7 @@ async function settleStdinForInitHandoff(stdin = process.stdin) {
|
|
|
5194
5162
|
}
|
|
5195
5163
|
}
|
|
5196
5164
|
var program = new Command();
|
|
5197
|
-
program.name("agents").description("CLI tool for Standard Agents / AgentBuilder").version("0.16.
|
|
5165
|
+
program.name("agents").description("CLI tool for Standard Agents / AgentBuilder").version("0.16.1-next.1e58032");
|
|
5198
5166
|
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);
|
|
5199
5167
|
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);
|
|
5200
5168
|
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);
|