@agentuity/cli 3.0.0-beta.1 → 3.0.0-beta.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.
Files changed (18) hide show
  1. package/dist/cmd/project/templates/services/storage/files/astro/src/pages/api/export.ts +2 -2
  2. package/dist/cmd/project/templates/services/storage/files/astro/src/storage/index.ts +8 -13
  3. package/dist/cmd/project/templates/services/storage/files/hono/src/storage/index.ts +8 -13
  4. package/dist/cmd/project/templates/services/storage/files/nextjs/src/app/api/export/route.ts +2 -2
  5. package/dist/cmd/project/templates/services/storage/files/nextjs/src/storage/index.ts +8 -13
  6. package/dist/cmd/project/templates/services/storage/files/nuxt/server/api/export.post.ts +2 -2
  7. package/dist/cmd/project/templates/services/storage/files/nuxt/server/storage/index.ts +8 -13
  8. package/dist/cmd/project/templates/services/storage/files/remix/app/routes/api.export.ts +2 -2
  9. package/dist/cmd/project/templates/services/storage/files/remix/app/storage/index.ts +8 -13
  10. package/dist/cmd/project/templates/services/storage/files/sveltekit/src/lib/server/storage/index.ts +8 -13
  11. package/dist/cmd/project/templates/services/storage/files/sveltekit/src/routes/api/export/+server.ts +2 -2
  12. package/dist/cmd/project/templates/services/storage/files/vite-react/server/storage/index.ts +8 -13
  13. package/dist/cmd/project/templates/services/storage/manifest.json +1 -1
  14. package/dist/cmd/project/templates/services/storage/snippets/hono/server.imports.ts +1 -1
  15. package/dist/cmd/project/templates/services/storage/snippets/hono/server.routes.ts +1 -1
  16. package/dist/cmd/project/templates/services/storage/snippets/vite-react/server.imports.ts +1 -1
  17. package/dist/cmd/project/templates/services/storage/snippets/vite-react/server.routes.ts +1 -1
  18. package/package.json +6 -6
@@ -1,7 +1,7 @@
1
1
  import type { APIRoute } from 'astro';
2
2
  import { desc } from 'drizzle-orm';
3
3
  import { db, translations } from '../../db';
4
- import { s3 } from '../../storage';
4
+ import { getS3 } from '../../storage';
5
5
 
6
6
  export const POST: APIRoute = async () => {
7
7
  const rows = await db
@@ -10,7 +10,7 @@ export const POST: APIRoute = async () => {
10
10
  .orderBy(desc(translations.createdAt));
11
11
  const body = JSON.stringify(rows, null, 2);
12
12
  const filename = `translations-${Date.now()}.json`;
13
- await s3.write(filename, body, { type: 'application/json' });
13
+ await getS3().write(filename, body, { type: 'application/json' });
14
14
  return new Response(JSON.stringify({ filename, size: body.length }), {
15
15
  headers: { 'Content-Type': 'application/json' },
16
16
  });
@@ -1,15 +1,10 @@
1
- import { createS3Client, type BucketConfig } from '@agentuity/storage';
1
+ import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
2
2
 
3
- function bucketConfig(): BucketConfig {
4
- const endpoint = process.env.AGENTUITY_BUCKET_ENDPOINT;
5
- const access_key = process.env.AGENTUITY_BUCKET_ACCESS_KEY;
6
- const secret_key = process.env.AGENTUITY_BUCKET_SECRET_KEY;
7
- if (!endpoint || !access_key || !secret_key) {
8
- throw new Error(
9
- 'AGENTUITY_BUCKET_* env vars are not set. Provision an Agentuity bucket or set them manually.'
10
- );
11
- }
12
- return { endpoint, access_key, secret_key };
3
+ // Lazy singleton — defer createS3Client() until the first request so
4
+ // that build-time module evaluation (e.g. Next.js' static analysis
5
+ // pass) does not fail when env vars are absent.
6
+ let cached: S3ClientLike | undefined;
7
+ export function getS3(): S3ClientLike {
8
+ if (!cached) cached = createS3Client(bucketConfigFromEnv());
9
+ return cached;
13
10
  }
14
-
15
- export const s3 = createS3Client(bucketConfig());
@@ -1,15 +1,10 @@
1
- import { createS3Client, type BucketConfig } from '@agentuity/storage';
1
+ import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
2
2
 
3
- function bucketConfig(): BucketConfig {
4
- const endpoint = process.env.AGENTUITY_BUCKET_ENDPOINT;
5
- const access_key = process.env.AGENTUITY_BUCKET_ACCESS_KEY;
6
- const secret_key = process.env.AGENTUITY_BUCKET_SECRET_KEY;
7
- if (!endpoint || !access_key || !secret_key) {
8
- throw new Error(
9
- 'AGENTUITY_BUCKET_* env vars are not set. Provision an Agentuity bucket or set them manually.'
10
- );
11
- }
12
- return { endpoint, access_key, secret_key };
3
+ // Lazy singleton — defer createS3Client() until the first request so
4
+ // that build-time module evaluation (e.g. Next.js' static analysis
5
+ // pass) does not fail when env vars are absent.
6
+ let cached: S3ClientLike | undefined;
7
+ export function getS3(): S3ClientLike {
8
+ if (!cached) cached = createS3Client(bucketConfigFromEnv());
9
+ return cached;
13
10
  }
14
-
15
- export const s3 = createS3Client(bucketConfig());
@@ -1,7 +1,7 @@
1
1
  import { NextResponse } from 'next/server';
2
2
  import { desc } from 'drizzle-orm';
3
3
  import { db, translations } from '@/db';
4
- import { s3 } from '@/storage';
4
+ import { getS3 } from '@/storage';
5
5
 
6
6
  export async function POST() {
7
7
  const rows = await db
@@ -10,6 +10,6 @@ export async function POST() {
10
10
  .orderBy(desc(translations.createdAt));
11
11
  const body = JSON.stringify(rows, null, 2);
12
12
  const filename = `translations-${Date.now()}.json`;
13
- await s3.write(filename, body, { type: 'application/json' });
13
+ await getS3().write(filename, body, { type: 'application/json' });
14
14
  return NextResponse.json({ filename, size: body.length });
15
15
  }
@@ -1,15 +1,10 @@
1
- import { createS3Client, type BucketConfig } from '@agentuity/storage';
1
+ import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
2
2
 
3
- function bucketConfig(): BucketConfig {
4
- const endpoint = process.env.AGENTUITY_BUCKET_ENDPOINT;
5
- const access_key = process.env.AGENTUITY_BUCKET_ACCESS_KEY;
6
- const secret_key = process.env.AGENTUITY_BUCKET_SECRET_KEY;
7
- if (!endpoint || !access_key || !secret_key) {
8
- throw new Error(
9
- 'AGENTUITY_BUCKET_* env vars are not set. Provision an Agentuity bucket or set them manually.'
10
- );
11
- }
12
- return { endpoint, access_key, secret_key };
3
+ // Lazy singleton — defer createS3Client() until the first request so
4
+ // that build-time module evaluation (e.g. Next.js' static analysis
5
+ // pass) does not fail when env vars are absent.
6
+ let cached: S3ClientLike | undefined;
7
+ export function getS3(): S3ClientLike {
8
+ if (!cached) cached = createS3Client(bucketConfigFromEnv());
9
+ return cached;
13
10
  }
14
-
15
- export const s3 = createS3Client(bucketConfig());
@@ -1,6 +1,6 @@
1
1
  import { desc } from 'drizzle-orm';
2
2
  import { db, translations } from '../db';
3
- import { s3 } from '../storage';
3
+ import { getS3 } from '../storage';
4
4
 
5
5
  export default defineEventHandler(async () => {
6
6
  const rows = await db
@@ -9,6 +9,6 @@ export default defineEventHandler(async () => {
9
9
  .orderBy(desc(translations.createdAt));
10
10
  const body = JSON.stringify(rows, null, 2);
11
11
  const filename = `translations-${Date.now()}.json`;
12
- await s3.write(filename, body, { type: 'application/json' });
12
+ await getS3().write(filename, body, { type: 'application/json' });
13
13
  return { filename, size: body.length };
14
14
  });
@@ -1,15 +1,10 @@
1
- import { createS3Client, type BucketConfig } from '@agentuity/storage';
1
+ import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
2
2
 
3
- function bucketConfig(): BucketConfig {
4
- const endpoint = process.env.AGENTUITY_BUCKET_ENDPOINT;
5
- const access_key = process.env.AGENTUITY_BUCKET_ACCESS_KEY;
6
- const secret_key = process.env.AGENTUITY_BUCKET_SECRET_KEY;
7
- if (!endpoint || !access_key || !secret_key) {
8
- throw new Error(
9
- 'AGENTUITY_BUCKET_* env vars are not set. Provision an Agentuity bucket or set them manually.'
10
- );
11
- }
12
- return { endpoint, access_key, secret_key };
3
+ // Lazy singleton — defer createS3Client() until the first request so
4
+ // that build-time module evaluation (e.g. Next.js' static analysis
5
+ // pass) does not fail when env vars are absent.
6
+ let cached: S3ClientLike | undefined;
7
+ export function getS3(): S3ClientLike {
8
+ if (!cached) cached = createS3Client(bucketConfigFromEnv());
9
+ return cached;
13
10
  }
14
-
15
- export const s3 = createS3Client(bucketConfig());
@@ -1,7 +1,7 @@
1
1
  import { data } from 'react-router';
2
2
  import { desc } from 'drizzle-orm';
3
3
  import { db, translations } from '~/db';
4
- import { s3 } from '~/storage';
4
+ import { getS3 } from '~/storage';
5
5
 
6
6
  export async function action() {
7
7
  const rows = await db
@@ -10,6 +10,6 @@ export async function action() {
10
10
  .orderBy(desc(translations.createdAt));
11
11
  const body = JSON.stringify(rows, null, 2);
12
12
  const filename = `translations-${Date.now()}.json`;
13
- await s3.write(filename, body, { type: 'application/json' });
13
+ await getS3().write(filename, body, { type: 'application/json' });
14
14
  return data({ filename, size: body.length });
15
15
  }
@@ -1,15 +1,10 @@
1
- import { createS3Client, type BucketConfig } from '@agentuity/storage';
1
+ import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
2
2
 
3
- function bucketConfig(): BucketConfig {
4
- const endpoint = process.env.AGENTUITY_BUCKET_ENDPOINT;
5
- const access_key = process.env.AGENTUITY_BUCKET_ACCESS_KEY;
6
- const secret_key = process.env.AGENTUITY_BUCKET_SECRET_KEY;
7
- if (!endpoint || !access_key || !secret_key) {
8
- throw new Error(
9
- 'AGENTUITY_BUCKET_* env vars are not set. Provision an Agentuity bucket or set them manually.'
10
- );
11
- }
12
- return { endpoint, access_key, secret_key };
3
+ // Lazy singleton — defer createS3Client() until the first request so
4
+ // that build-time module evaluation (e.g. Next.js' static analysis
5
+ // pass) does not fail when env vars are absent.
6
+ let cached: S3ClientLike | undefined;
7
+ export function getS3(): S3ClientLike {
8
+ if (!cached) cached = createS3Client(bucketConfigFromEnv());
9
+ return cached;
13
10
  }
14
-
15
- export const s3 = createS3Client(bucketConfig());
@@ -1,15 +1,10 @@
1
- import { createS3Client, type BucketConfig } from '@agentuity/storage';
1
+ import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
2
2
 
3
- function bucketConfig(): BucketConfig {
4
- const endpoint = process.env.AGENTUITY_BUCKET_ENDPOINT;
5
- const access_key = process.env.AGENTUITY_BUCKET_ACCESS_KEY;
6
- const secret_key = process.env.AGENTUITY_BUCKET_SECRET_KEY;
7
- if (!endpoint || !access_key || !secret_key) {
8
- throw new Error(
9
- 'AGENTUITY_BUCKET_* env vars are not set. Provision an Agentuity bucket or set them manually.'
10
- );
11
- }
12
- return { endpoint, access_key, secret_key };
3
+ // Lazy singleton — defer createS3Client() until the first request so
4
+ // that build-time module evaluation (e.g. Next.js' static analysis
5
+ // pass) does not fail when env vars are absent.
6
+ let cached: S3ClientLike | undefined;
7
+ export function getS3(): S3ClientLike {
8
+ if (!cached) cached = createS3Client(bucketConfigFromEnv());
9
+ return cached;
13
10
  }
14
-
15
- export const s3 = createS3Client(bucketConfig());
@@ -1,7 +1,7 @@
1
1
  import { json } from '@sveltejs/kit';
2
2
  import { desc } from 'drizzle-orm';
3
3
  import { db, translations } from '$lib/server/db';
4
- import { s3 } from '$lib/server/storage';
4
+ import { getS3 } from '$lib/server/storage';
5
5
 
6
6
  export const POST = async () => {
7
7
  const rows = await db
@@ -10,6 +10,6 @@ export const POST = async () => {
10
10
  .orderBy(desc(translations.createdAt));
11
11
  const body = JSON.stringify(rows, null, 2);
12
12
  const filename = `translations-${Date.now()}.json`;
13
- await s3.write(filename, body, { type: 'application/json' });
13
+ await getS3().write(filename, body, { type: 'application/json' });
14
14
  return json({ filename, size: body.length });
15
15
  };
@@ -1,15 +1,10 @@
1
- import { createS3Client, type BucketConfig } from '@agentuity/storage';
1
+ import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
2
2
 
3
- function bucketConfig(): BucketConfig {
4
- const endpoint = process.env.AGENTUITY_BUCKET_ENDPOINT;
5
- const access_key = process.env.AGENTUITY_BUCKET_ACCESS_KEY;
6
- const secret_key = process.env.AGENTUITY_BUCKET_SECRET_KEY;
7
- if (!endpoint || !access_key || !secret_key) {
8
- throw new Error(
9
- 'AGENTUITY_BUCKET_* env vars are not set. Provision an Agentuity bucket or set them manually.'
10
- );
11
- }
12
- return { endpoint, access_key, secret_key };
3
+ // Lazy singleton — defer createS3Client() until the first request so
4
+ // that build-time module evaluation (e.g. Next.js' static analysis
5
+ // pass) does not fail when env vars are absent.
6
+ let cached: S3ClientLike | undefined;
7
+ export function getS3(): S3ClientLike {
8
+ if (!cached) cached = createS3Client(bucketConfigFromEnv());
9
+ return cached;
13
10
  }
14
-
15
- export const s3 = createS3Client(bucketConfig());
@@ -10,7 +10,7 @@
10
10
  {
11
11
  "name": "AGENTUITY_BUCKET_ENDPOINT",
12
12
  "placeholder": "your-bucket.agentuity.run",
13
- "comment": "Set automatically when an Agentuity bucket is provisioned"
13
+ "comment": "Set automatically when an Agentuity bucket is provisioned (or use AWS_ENDPOINT + AWS_BUCKET as a fallback)"
14
14
  },
15
15
  { "name": "AGENTUITY_BUCKET_ACCESS_KEY", "placeholder": "" },
16
16
  { "name": "AGENTUITY_BUCKET_SECRET_KEY", "placeholder": "" }
@@ -1 +1 @@
1
- import { s3 } from './storage';
1
+ import { getS3 } from './storage';
@@ -6,6 +6,6 @@ app.post('/api/export', async (c) => {
6
6
  .orderBy(desc(translations.createdAt));
7
7
  const body = JSON.stringify(rows, null, 2);
8
8
  const filename = `translations-${Date.now()}.json`;
9
- await s3.write(filename, body, { type: 'application/json' });
9
+ await getS3().write(filename, body, { type: 'application/json' });
10
10
  return c.json({ filename, size: body.length });
11
11
  });
@@ -1 +1 @@
1
- import { s3 } from './server/storage';
1
+ import { getS3 } from './server/storage';
@@ -5,6 +5,6 @@ if (url.pathname === '/api/export' && request.method === 'POST') {
5
5
  .orderBy(desc(translations.createdAt));
6
6
  const body = JSON.stringify(rows, null, 2);
7
7
  const filename = `translations-${Date.now()}.json`;
8
- await s3.write(filename, body, { type: 'application/json' });
8
+ await getS3().write(filename, body, { type: 'application/json' });
9
9
  return Response.json({ filename, size: body.length });
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentuity/cli",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Agentuity employees and contributors",
6
6
  "type": "module",
@@ -41,10 +41,10 @@
41
41
  "prepublishOnly": "bun run clean && bun run build"
42
42
  },
43
43
  "dependencies": {
44
- "@agentuity/coder-tui": "3.0.0-beta.1",
45
- "@agentuity/core": "3.0.0-beta.1",
46
- "@agentuity/server": "3.0.0-beta.1",
47
- "@agentuity/storage": "3.0.0-beta.1",
44
+ "@agentuity/coder-tui": "3.0.0-beta.2",
45
+ "@agentuity/core": "3.0.0-beta.2",
46
+ "@agentuity/server": "3.0.0-beta.2",
47
+ "@agentuity/storage": "3.0.0-beta.2",
48
48
  "archiver": "^7.0.1",
49
49
  "cli-table3": "^0.6.5",
50
50
  "commander": "^14.0.2",
@@ -59,7 +59,7 @@
59
59
  "zod": "^4.3.5"
60
60
  },
61
61
  "devDependencies": {
62
- "@agentuity/test-utils": "3.0.0-beta.1",
62
+ "@agentuity/test-utils": "3.0.0-beta.2",
63
63
  "@types/archiver": "^7.0.0",
64
64
  "@types/bun": "latest",
65
65
  "@types/node": "^22.0.0",