@standardagents/cli 0.41.20 → 0.41.23

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.
@@ -1,26 +1,41 @@
1
- import { defineConfig } from 'vite'
1
+ import { defineConfig, loadEnv } from 'vite'
2
2
  import react from '@vitejs/plugin-react'
3
3
  import tailwindcss from '@tailwindcss/vite'
4
4
  import path from 'path'
5
5
 
6
- export default defineConfig({
7
- root: __dirname,
8
- plugins: [
9
- react(),
10
- tailwindcss(),
11
- ],
12
- resolve: {
13
- alias: {
14
- '@': path.resolve(__dirname, '../src'),
6
+ export default defineConfig(({ mode }) => {
7
+ const env = { ...loadEnv(mode, __dirname, ''), ...process.env }
8
+ // Local AgentBuilder instances reject cross-origin requests, so the dev
9
+ // server proxies /api (HTTP and WebSocket) to keep the chat same-origin.
10
+ const target = env.VITE_AGENTBUILDER_URL || 'http://localhost:5173'
11
+
12
+ return {
13
+ root: __dirname,
14
+ plugins: [
15
+ react(),
16
+ tailwindcss(),
17
+ ],
18
+ resolve: {
19
+ alias: {
20
+ '@': path.resolve(__dirname, '../src'),
21
+ },
22
+ },
23
+ server: {
24
+ host: '0.0.0.0',
25
+ port: 5174,
26
+ strictPort: true,
27
+ allowedHosts: true,
28
+ proxy: {
29
+ '/api': {
30
+ target,
31
+ ws: true,
32
+ // Keep the browser's Host so the runtime sees a same-origin request.
33
+ changeOrigin: false,
34
+ },
35
+ },
36
+ },
37
+ build: {
38
+ outDir: '../dist/vite',
15
39
  },
16
- },
17
- server: {
18
- host: '0.0.0.0',
19
- port: 5174,
20
- strictPort: true,
21
- allowedHosts: true,
22
- },
23
- build: {
24
- outDir: '../dist/vite',
25
- },
40
+ }
26
41
  })
package/dist/index.js CHANGED
@@ -265,7 +265,7 @@ function getScaffoldStandardAgentsVersion() {
265
265
  if (process.env.STANDARDAGENTS_WORKSPACE === "1") {
266
266
  return "workspace:*";
267
267
  }
268
- return "0.41.20";
268
+ return "0.41.23";
269
269
  }
270
270
  function findViteConfig(cwd) {
271
271
  const candidates = ["vite.config.ts", "vite.config.js", "vite.config.mts", "vite.config.mjs"];
@@ -1567,7 +1567,7 @@ async function ensurePlatformAuth(options, quietLogs = false, context = {}) {
1567
1567
  return { connected: true, mode: "standardagents" };
1568
1568
  }
1569
1569
  function getCliVersion() {
1570
- return "0.41.20";
1570
+ return "0.41.23";
1571
1571
  }
1572
1572
  function getSipVersion() {
1573
1573
  return "1.0.1";
@@ -3525,13 +3525,32 @@ async function detectAgentbuilderInstance() {
3525
3525
  }
3526
3526
  return null;
3527
3527
  }
3528
+ var CHAT_BUILD_SCRIPT_DEPENDENCIES = ["esbuild", "sharp"];
3529
+ function applyChatBuildApprovals(pkg) {
3530
+ return {
3531
+ ...pkg,
3532
+ pnpm: { ...pkg.pnpm, onlyBuiltDependencies: [...CHAT_BUILD_SCRIPT_DEPENDENCIES] },
3533
+ allowScripts: Object.fromEntries(CHAT_BUILD_SCRIPT_DEPENDENCIES.map((name) => [name, true]))
3534
+ };
3535
+ }
3536
+ function renderChatPnpmWorkspaceYaml() {
3537
+ const list = CHAT_BUILD_SCRIPT_DEPENDENCIES.map((name) => ` - "${name}"`).join("\n");
3538
+ const map = CHAT_BUILD_SCRIPT_DEPENDENCIES.map((name) => ` "${name}": true`).join("\n");
3539
+ return `onlyBuiltDependencies:
3540
+ ${list}
3541
+ allowBuilds:
3542
+ ${map}
3543
+ minimumReleaseAgeExclude:
3544
+ - "@standardagents/*"
3545
+ `;
3546
+ }
3528
3547
  function copyDir(src, dest, skip = []) {
3529
3548
  if (!fs4.existsSync(dest)) {
3530
3549
  fs4.mkdirSync(dest, { recursive: true });
3531
3550
  }
3532
3551
  const entries = fs4.readdirSync(src, { withFileTypes: true });
3533
3552
  for (const entry of entries) {
3534
- if (skip.includes(entry.name)) continue;
3553
+ if (skip.includes(entry.name) || /\.test\.tsx?$/.test(entry.name)) continue;
3535
3554
  const srcPath = path7.join(src, entry.name);
3536
3555
  const destPath = path7.join(dest, entry.name);
3537
3556
  if (entry.isDirectory()) {
@@ -3663,16 +3682,28 @@ async function scaffoldVite(projectPath, chatSourceDir, projectName, serverUrl,
3663
3682
  logger.success("Created index.html");
3664
3683
  fs4.copyFileSync(path7.join(viteDir, "main.tsx"), path7.join(projectPath, "src", "main.tsx"));
3665
3684
  logger.success("Created src/main.tsx");
3666
- let viteConfig = fs4.readFileSync(path7.join(viteDir, "vite.config.ts"), "utf-8");
3667
- viteConfig = `import { defineConfig } from 'vite'
3685
+ const viteConfig = `import { defineConfig, loadEnv } from 'vite'
3668
3686
  import react from '@vitejs/plugin-react'
3669
3687
  import tailwindcss from '@tailwindcss/vite'
3670
3688
 
3671
- export default defineConfig({
3672
- plugins: [
3673
- react(),
3674
- tailwindcss(),
3675
- ],
3689
+ export default defineConfig(({ mode }) => {
3690
+ const env = { ...loadEnv(mode, process.cwd(), ''), ...process.env }
3691
+ return {
3692
+ plugins: [
3693
+ react(),
3694
+ tailwindcss(),
3695
+ ],
3696
+ server: {
3697
+ proxy: {
3698
+ '/api': {
3699
+ target: env.VITE_AGENTBUILDER_URL || 'http://localhost:5173',
3700
+ ws: true,
3701
+ // Keep the browser's Host so the runtime sees a same-origin request.
3702
+ changeOrigin: false,
3703
+ },
3704
+ },
3705
+ },
3706
+ }
3676
3707
  })
3677
3708
  `;
3678
3709
  fs4.writeFileSync(path7.join(projectPath, "vite.config.ts"), viteConfig, "utf-8");
@@ -3698,7 +3729,9 @@ export default defineConfig({
3698
3729
  delete pkg.dependencies?.["next"];
3699
3730
  delete pkg.devDependencies?.["@tailwindcss/postcss"];
3700
3731
  delete pkg.devDependencies?.["postcss"];
3701
- fs4.writeFileSync(path7.join(projectPath, "package.json"), JSON.stringify(pkg, null, 2) + "\n", "utf-8");
3732
+ delete pkg.devDependencies?.["vitest"];
3733
+ fs4.writeFileSync(path7.join(projectPath, "package.json"), JSON.stringify(applyChatBuildApprovals(pkg), null, 2) + "\n", "utf-8");
3734
+ fs4.writeFileSync(path7.join(projectPath, "pnpm-workspace.yaml"), renderChatPnpmWorkspaceYaml(), "utf-8");
3702
3735
  logger.success("Created package.json");
3703
3736
  const envContent = `# Agentbuilder connection
3704
3737
  VITE_AGENTBUILDER_URL=${serverUrl}
@@ -3767,7 +3800,9 @@ async function scaffoldNextjs(projectPath, chatSourceDir, projectName, serverUrl
3767
3800
  delete pkg.devDependencies?.["@tailwindcss/vite"];
3768
3801
  delete pkg.devDependencies?.["@vitejs/plugin-react"];
3769
3802
  delete pkg.devDependencies?.["vite"];
3770
- fs4.writeFileSync(path7.join(projectPath, "package.json"), JSON.stringify(pkg, null, 2) + "\n", "utf-8");
3803
+ delete pkg.devDependencies?.["vitest"];
3804
+ fs4.writeFileSync(path7.join(projectPath, "package.json"), JSON.stringify(applyChatBuildApprovals(pkg), null, 2) + "\n", "utf-8");
3805
+ fs4.writeFileSync(path7.join(projectPath, "pnpm-workspace.yaml"), renderChatPnpmWorkspaceYaml(), "utf-8");
3771
3806
  logger.success("Created package.json");
3772
3807
  const envContent = `# Agentbuilder connection
3773
3808
  NEXT_PUBLIC_AGENTBUILDER_URL=${serverUrl}
@@ -5780,7 +5815,7 @@ async function settleStdinForInitHandoff(stdin = process.stdin) {
5780
5815
  }
5781
5816
  }
5782
5817
  var program = new Command();
5783
- program.name("agents").description("CLI tool for Standard Agents / AgentBuilder").version("0.41.20");
5818
+ program.name("agents").description("CLI tool for Standard Agents / AgentBuilder").version("0.41.23");
5784
5819
  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);
5785
5820
  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);
5786
5821
  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);