create-ragen-app 0.3.0 → 0.4.0
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/README.md +10 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +204 -1
- package/dist/cli.js.map +1 -1
- package/dist/config-file.d.ts +14 -0
- package/dist/config-file.d.ts.map +1 -0
- package/dist/config-file.js +21 -0
- package/dist/config-file.js.map +1 -0
- package/dist/config-template.d.ts +30 -0
- package/dist/config-template.d.ts.map +1 -0
- package/dist/config-template.js +126 -0
- package/dist/config-template.js.map +1 -0
- package/dist/encryption-provider.d.ts +35 -0
- package/dist/encryption-provider.d.ts.map +1 -0
- package/dist/encryption-provider.js +63 -0
- package/dist/encryption-provider.js.map +1 -0
- package/dist/llm-provider.d.ts +17 -0
- package/dist/llm-provider.d.ts.map +1 -1
- package/dist/llm-provider.js +31 -1
- package/dist/llm-provider.js.map +1 -1
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +22 -4
- package/dist/manifest.js.map +1 -1
- package/dist/manual-setup.d.ts.map +1 -1
- package/dist/manual-setup.js +85 -16
- package/dist/manual-setup.js.map +1 -1
- package/dist/route-table.d.ts +31 -0
- package/dist/route-table.d.ts.map +1 -0
- package/dist/route-table.js +53 -0
- package/dist/route-table.js.map +1 -0
- package/dist/storage-provider.d.ts +49 -0
- package/dist/storage-provider.d.ts.map +1 -0
- package/dist/storage-provider.js +84 -0
- package/dist/storage-provider.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Where uploaded documents live.
|
|
4
|
+
*
|
|
5
|
+
* The wizard skipped this until now and sent people to a manual guide, which
|
|
6
|
+
* is the one question where getting it wrong is expensive: `STORAGE_PROVIDER=s3`
|
|
7
|
+
* with a missing credential does not fail at boot in every app, it fails at
|
|
8
|
+
* the first upload, as a storage error three layers from the cause.
|
|
9
|
+
*
|
|
10
|
+
* The variable names and the config field names below mirror `STORAGE_SEAM` in
|
|
11
|
+
* `@ragenai/env`. They are copied rather than imported because this package is
|
|
12
|
+
* published to npm and `@ragenai/env` is private, so a dependency on it would
|
|
13
|
+
* make `npm create ragen-app` unresolvable. The copy is held to the original
|
|
14
|
+
* by `tests/architecture/create-ragen-app-knows-the-provider-seams.test.ts` —
|
|
15
|
+
* the same arrangement `manifest.ts` already has with the `.env.example`
|
|
16
|
+
* files.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.STORAGE_LABELS = void 0;
|
|
20
|
+
exports.resolveStorageSelection = resolveStorageSelection;
|
|
21
|
+
exports.STORAGE_LABELS = {
|
|
22
|
+
local: 'Local filesystem (default — no cloud account needed)',
|
|
23
|
+
s3: 'S3-compatible (AWS, Cloudflare R2, Scaleway, MinIO, Ceph)',
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A path-style endpoint is what Scaleway (dotted bucket names) and MinIO/Ceph
|
|
27
|
+
* need. Guessing it from the endpoint rather than asking keeps the wizard to
|
|
28
|
+
* one question per thing a person actually knows about their own storage.
|
|
29
|
+
*/
|
|
30
|
+
function needsPathStyle(endpoint) {
|
|
31
|
+
const host = endpoint.trim().toLowerCase();
|
|
32
|
+
if (!host) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return (!host.includes('amazonaws.com') &&
|
|
36
|
+
!host.includes('r2.cloudflarestorage.com'));
|
|
37
|
+
}
|
|
38
|
+
function resolveStorageSelection(provider, answers) {
|
|
39
|
+
if (provider === 'local' || !answers) {
|
|
40
|
+
return {
|
|
41
|
+
provider: 'local',
|
|
42
|
+
envUpdates: { STORAGE_PROVIDER: 'local' },
|
|
43
|
+
configFields: [
|
|
44
|
+
{ field: 'path', envVar: 'STORAGE_LOCAL_PATH', required: false },
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const endpoint = answers.endpoint.trim();
|
|
49
|
+
const envUpdates = {
|
|
50
|
+
STORAGE_PROVIDER: 's3',
|
|
51
|
+
S3_BUCKET_NAME: answers.bucket.trim(),
|
|
52
|
+
S3_REGION: answers.region.trim(),
|
|
53
|
+
S3_ACCESS_KEY_ID: answers.accessKeyId.trim(),
|
|
54
|
+
S3_SECRET_ACCESS_KEY: answers.secretAccessKey.trim(),
|
|
55
|
+
};
|
|
56
|
+
const configFields = [
|
|
57
|
+
{ field: 'bucketName', envVar: 'S3_BUCKET_NAME', required: true },
|
|
58
|
+
{ field: 'region', envVar: 'S3_REGION', required: true },
|
|
59
|
+
{ field: 'accessKeyId', envVar: 'S3_ACCESS_KEY_ID', required: true },
|
|
60
|
+
{
|
|
61
|
+
field: 'secretAccessKey',
|
|
62
|
+
envVar: 'S3_SECRET_ACCESS_KEY',
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
if (endpoint) {
|
|
67
|
+
envUpdates.S3_ENDPOINT_URL = endpoint;
|
|
68
|
+
configFields.push({
|
|
69
|
+
field: 'endpoint',
|
|
70
|
+
envVar: 'S3_ENDPOINT_URL',
|
|
71
|
+
required: false,
|
|
72
|
+
});
|
|
73
|
+
if (needsPathStyle(endpoint)) {
|
|
74
|
+
envUpdates.S3_FORCE_PATH_STYLE = 'true';
|
|
75
|
+
configFields.push({
|
|
76
|
+
field: 'forcePathStyle',
|
|
77
|
+
envVar: 'S3_FORCE_PATH_STYLE',
|
|
78
|
+
required: false,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { provider: 's3', envUpdates, configFields };
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=storage-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-provider.js","sourceRoot":"","sources":["../src/storage-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAyDH,0DAsDC;AA3EY,QAAA,c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AAQ,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxD,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpE;YACE,KAAK,EAAE,iBAAiB;YACxB,MAAM,EAAE,sBAAsB;YAC9B,QAAQ,EAAE,IAAI;SACf;KACF,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACb,UAAU,CAAC,eAAe,GAAG,QAAQ,CAAC;QACtC,YAAY,CAAC,IAAI,CAAC;YAChB,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,iBAAiB;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;QAEH,IAAI,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,UAAU,CAAC,mBAAmB,GAAG,MAAM,CAAC;YACxC,YAAY,CAAC,IAAI,CAAC;gBAChB,KAAK,EAAE,gBAAgB;gBACvB,MAAM,EAAE,qBAAqB;gBAC7B,QAAQ,EAAE,KAAK;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ragen-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Scaffold a self-hosted Ragen AI installation with one command",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc -p tsconfig.json",
|
|
24
24
|
"clean": "rm -rf dist",
|
|
25
|
-
"
|
|
25
|
+
"prepack": "npm run clean && npm run build",
|
|
26
26
|
"lint": "eslint",
|
|
27
27
|
"typecheck": "tsc --noEmit --incremental --tsBuildInfoFile ./typecheck.tsbuildinfo"
|
|
28
28
|
},
|