@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.
- package/dist/cmd/project/templates/services/storage/files/astro/src/pages/api/export.ts +2 -2
- package/dist/cmd/project/templates/services/storage/files/astro/src/storage/index.ts +8 -13
- package/dist/cmd/project/templates/services/storage/files/hono/src/storage/index.ts +8 -13
- package/dist/cmd/project/templates/services/storage/files/nextjs/src/app/api/export/route.ts +2 -2
- package/dist/cmd/project/templates/services/storage/files/nextjs/src/storage/index.ts +8 -13
- package/dist/cmd/project/templates/services/storage/files/nuxt/server/api/export.post.ts +2 -2
- package/dist/cmd/project/templates/services/storage/files/nuxt/server/storage/index.ts +8 -13
- package/dist/cmd/project/templates/services/storage/files/remix/app/routes/api.export.ts +2 -2
- package/dist/cmd/project/templates/services/storage/files/remix/app/storage/index.ts +8 -13
- package/dist/cmd/project/templates/services/storage/files/sveltekit/src/lib/server/storage/index.ts +8 -13
- package/dist/cmd/project/templates/services/storage/files/sveltekit/src/routes/api/export/+server.ts +2 -2
- package/dist/cmd/project/templates/services/storage/files/vite-react/server/storage/index.ts +8 -13
- package/dist/cmd/project/templates/services/storage/manifest.json +1 -1
- package/dist/cmd/project/templates/services/storage/snippets/hono/server.imports.ts +1 -1
- package/dist/cmd/project/templates/services/storage/snippets/hono/server.routes.ts +1 -1
- package/dist/cmd/project/templates/services/storage/snippets/vite-react/server.imports.ts +1 -1
- package/dist/cmd/project/templates/services/storage/snippets/vite-react/server.routes.ts +1 -1
- 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 {
|
|
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
|
|
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
|
|
1
|
+
import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
1
|
+
import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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());
|
package/dist/cmd/project/templates/services/storage/files/nextjs/src/app/api/export/route.ts
CHANGED
|
@@ -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 {
|
|
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
|
|
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
|
|
1
|
+
import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 {
|
|
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
|
|
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
|
|
1
|
+
import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 {
|
|
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
|
|
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
|
|
1
|
+
import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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());
|
package/dist/cmd/project/templates/services/storage/files/sveltekit/src/lib/server/storage/index.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { createS3Client, type
|
|
1
|
+
import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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());
|
package/dist/cmd/project/templates/services/storage/files/sveltekit/src/routes/api/export/+server.ts
CHANGED
|
@@ -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 {
|
|
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
|
|
13
|
+
await getS3().write(filename, body, { type: 'application/json' });
|
|
14
14
|
return json({ filename, size: body.length });
|
|
15
15
|
};
|
package/dist/cmd/project/templates/services/storage/files/vite-react/server/storage/index.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { createS3Client, type
|
|
1
|
+
import { bucketConfigFromEnv, createS3Client, type S3ClientLike } from '@agentuity/storage';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 {
|
|
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
|
|
9
|
+
await getS3().write(filename, body, { type: 'application/json' });
|
|
10
10
|
return c.json({ filename, size: body.length });
|
|
11
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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.
|
|
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.
|
|
45
|
-
"@agentuity/core": "3.0.0-beta.
|
|
46
|
-
"@agentuity/server": "3.0.0-beta.
|
|
47
|
-
"@agentuity/storage": "3.0.0-beta.
|
|
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.
|
|
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",
|