create-ragen-app 0.1.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 +49 -0
- package/dist/args.d.ts +11 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +31 -0
- package/dist/args.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +298 -0
- package/dist/cli.js.map +1 -0
- package/dist/clone.d.ts +8 -0
- package/dist/clone.d.ts.map +1 -0
- package/dist/clone.js +19 -0
- package/dist/clone.js.map +1 -0
- package/dist/env-file.d.ts +24 -0
- package/dist/env-file.d.ts.map +1 -0
- package/dist/env-file.js +35 -0
- package/dist/env-file.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/litellm-config.d.ts +17 -0
- package/dist/litellm-config.d.ts.map +1 -0
- package/dist/litellm-config.js +28 -0
- package/dist/litellm-config.js.map +1 -0
- package/dist/llm-provider.d.ts +21 -0
- package/dist/llm-provider.d.ts.map +1 -0
- package/dist/llm-provider.js +39 -0
- package/dist/llm-provider.js.map +1 -0
- package/dist/manifest.d.ts +38 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +80 -0
- package/dist/manifest.js.map +1 -0
- package/dist/secrets.d.ts +7 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +13 -0
- package/dist/secrets.js.map +1 -0
- package/dist/tasks.d.ts +27 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +64 -0
- package/dist/tasks.js.map +1 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# create-ragen-app
|
|
2
|
+
|
|
3
|
+
Scaffolds a self-hosted [Ragen AI](https://github.com/webamigos/RagenAI)
|
|
4
|
+
installation with one command.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npx create-ragen-app my-ragen-app
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
It clones the repo, generates every secret it safely can, lets you paste a
|
|
11
|
+
plain OpenAI or Anthropic API key instead of configuring an enterprise model
|
|
12
|
+
provider, starts the backing services (Postgres, Qdrant, Temporal, LiteLLM,
|
|
13
|
+
Redis, …) in Docker, and runs the app's own first-run setup (Prisma client,
|
|
14
|
+
migrations, seed data) — leaving `cd my-ragen-app && npm run web:dev` as the
|
|
15
|
+
only remaining step.
|
|
16
|
+
|
|
17
|
+
## Flags
|
|
18
|
+
|
|
19
|
+
| Flag | Effect |
|
|
20
|
+
| ----------------- | --------------------------------------------------- |
|
|
21
|
+
| `--ref=<branch>` | Clone a branch/tag other than `main` |
|
|
22
|
+
| `--skip-docker` | Write the `.env.local` files but don't start Docker |
|
|
23
|
+
| `--skip-install` | Skip `npm install` / Prisma / seed |
|
|
24
|
+
| `--yes` | Accept every default without prompting |
|
|
25
|
+
|
|
26
|
+
Anything the wizard doesn't ask about (S3 storage, encryption at rest,
|
|
27
|
+
Stripe, email, MCP connectors) ships exactly as documented in the repo's own
|
|
28
|
+
`.env.example` files — see
|
|
29
|
+
[docs/self-hosting](https://docs.ragen.ai/docs/self-hosting).
|
|
30
|
+
|
|
31
|
+
## What it changes, and how it decides
|
|
32
|
+
|
|
33
|
+
`src/manifest.ts` is the single list of which env vars get a generated
|
|
34
|
+
secret or a corrected local-dev default, and which files receive them. It is
|
|
35
|
+
deliberately an *overrides* list — anything not in it is left exactly as the
|
|
36
|
+
cloned repo's own `.env.example` already has it. See the file's own comments
|
|
37
|
+
for the sharing rules (some secrets are the same value in two files, most are
|
|
38
|
+
independent).
|
|
39
|
+
|
|
40
|
+
## Publishing (manual for now)
|
|
41
|
+
|
|
42
|
+
There is no CI job wired up yet (see the project plan's non-goals). To cut a
|
|
43
|
+
new version:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm version <patch|minor|major> --workspace=create-ragen-app
|
|
47
|
+
npm run build --workspace=create-ragen-app
|
|
48
|
+
npm publish --workspace=create-ragen-app
|
|
49
|
+
```
|
package/dist/args.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CliArgs {
|
|
2
|
+
/** Undefined when the user gave no positional argument — the CLI prompts. */
|
|
3
|
+
targetDir: string | undefined;
|
|
4
|
+
ref: string;
|
|
5
|
+
skipDocker: boolean;
|
|
6
|
+
skipInstall: boolean;
|
|
7
|
+
yes: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEFAULT_TARGET_DIR = "./ragen-app";
|
|
10
|
+
export declare function parseArgs(argv: string[]): CliArgs;
|
|
11
|
+
//# sourceMappingURL=args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,6EAA6E;IAC7E,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAGhD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CA4BjD"}
|
package/dist/args.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_TARGET_DIR = void 0;
|
|
4
|
+
exports.parseArgs = parseArgs;
|
|
5
|
+
exports.DEFAULT_TARGET_DIR = './ragen-app';
|
|
6
|
+
const DEFAULT_REF = 'main';
|
|
7
|
+
function parseArgs(argv) {
|
|
8
|
+
const positionals = argv.filter((arg) => !arg.startsWith('--'));
|
|
9
|
+
if (positionals.length > 1) {
|
|
10
|
+
// Every flag here takes `--name=value`, not a separate token — a second
|
|
11
|
+
// bare token (e.g. `--ref main`) would otherwise silently become
|
|
12
|
+
// targetDir instead of erroring.
|
|
13
|
+
throw new Error(`Unexpected extra arguments: ${positionals.slice(1).join(' ')}. Flag values must use --name=value.`);
|
|
14
|
+
}
|
|
15
|
+
const hasFlag = (name) => argv.includes(`--${name}`);
|
|
16
|
+
const valueOf = (name) => {
|
|
17
|
+
const prefix = `--${name}=`;
|
|
18
|
+
const value = argv
|
|
19
|
+
.find((arg) => arg.startsWith(prefix))
|
|
20
|
+
?.slice(prefix.length);
|
|
21
|
+
return value || undefined;
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
targetDir: positionals[0],
|
|
25
|
+
ref: valueOf('ref') ?? DEFAULT_REF,
|
|
26
|
+
skipDocker: hasFlag('skip-docker'),
|
|
27
|
+
skipInstall: hasFlag('skip-install'),
|
|
28
|
+
yes: hasFlag('yes'),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=args.js.map
|
package/dist/args.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":";;;AAYA,8BA4BC;AA/BY,QAAA,kBAAkB,GAAG,aAAa,CAAC;AAChD,MAAM,WAAW,GAAG,MAAM,CAAC;AAE3B,SAAgB,SAAS,CAAC,IAAc;IACtC,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,wEAAwE;QACxE,iEAAiE;QACjE,iCAAiC;QACjC,MAAM,IAAI,KAAK,CACb,+BAA+B,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,sCAAsC,CACpG,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAEtE,MAAM,OAAO,GAAG,CAAC,IAAY,EAAsB,EAAE;QACnD,MAAM,MAAM,GAAG,KAAK,IAAI,GAAG,CAAC;QAC5B,MAAM,KAAK,GAAG,IAAI;aACf,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACtC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,KAAK,IAAI,SAAS,CAAC;IAC5B,CAAC,CAAC;IAEF,OAAO;QACL,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;QACzB,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW;QAClC,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC;QAClC,WAAW,EAAE,OAAO,CAAC,cAAc,CAAC;QACpC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC;KACpB,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAuDA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8FvD"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.run = run;
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const node_path_1 = require("node:path");
|
|
39
|
+
const clack = __importStar(require("@clack/prompts"));
|
|
40
|
+
const dotenv_1 = require("dotenv");
|
|
41
|
+
const args_1 = require("./args");
|
|
42
|
+
const clone_1 = require("./clone");
|
|
43
|
+
const env_file_1 = require("./env-file");
|
|
44
|
+
const litellm_config_1 = require("./litellm-config");
|
|
45
|
+
const llm_provider_1 = require("./llm-provider");
|
|
46
|
+
const manifest_1 = require("./manifest");
|
|
47
|
+
const secrets_1 = require("./secrets");
|
|
48
|
+
const tasks_1 = require("./tasks");
|
|
49
|
+
const ENV_PATHS = {
|
|
50
|
+
root: { example: '.env.example', local: '.env.local' },
|
|
51
|
+
admin: { example: 'apps/admin/.env.example', local: 'apps/admin/.env.local' },
|
|
52
|
+
};
|
|
53
|
+
async function run(argv) {
|
|
54
|
+
const args = (0, args_1.parseArgs)(argv);
|
|
55
|
+
clack.intro('create-ragen-app');
|
|
56
|
+
const targetDir = await resolveTargetDir(args.targetDir, args.yes);
|
|
57
|
+
if (!targetDir) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const cloneSpinner = clack.spinner();
|
|
61
|
+
cloneSpinner.start(`Cloning Ragen into ${targetDir}`);
|
|
62
|
+
try {
|
|
63
|
+
await (0, clone_1.cloneRagenApp)(targetDir, args.ref);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
cloneSpinner.stop('Clone failed.', 1);
|
|
67
|
+
clack.cancel(`Could not download ${args.ref} from the Ragen repository: ${String(error)}`);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
cloneSpinner.stop('Cloned.');
|
|
71
|
+
const resolvedValues = resolveManifestValues();
|
|
72
|
+
const rootOverrides = overridesForTarget('root', resolvedValues);
|
|
73
|
+
const adminOverrides = overridesForTarget('admin', resolvedValues);
|
|
74
|
+
const llmPrompt = args.yes
|
|
75
|
+
? { cancelled: false, choice: undefined }
|
|
76
|
+
: await promptLlmProvider();
|
|
77
|
+
if (llmPrompt.cancelled) {
|
|
78
|
+
clack.cancel('Cancelled.');
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const llmChoice = llmPrompt.choice;
|
|
82
|
+
if (llmChoice) {
|
|
83
|
+
Object.assign(rootOverrides, llmChoice.envUpdates);
|
|
84
|
+
}
|
|
85
|
+
const rootWrite = writeEnvFile(targetDir, 'root', rootOverrides);
|
|
86
|
+
const adminWrite = writeEnvFile(targetDir, 'admin', adminOverrides);
|
|
87
|
+
const missingKeys = [...rootWrite.missingKeys, ...adminWrite.missingKeys];
|
|
88
|
+
if (missingKeys.length > 0) {
|
|
89
|
+
clack.cancel([
|
|
90
|
+
`Wrote what could be matched, but these keys have no line in the cloned repo's .env.example: ${missingKeys.join(', ')}.`,
|
|
91
|
+
"That usually means create-ragen-app's manifest and the repo have drifted — fix them by hand in .env.local before starting the app. Stopping before Docker/migrations, since they'd run against an incomplete config.",
|
|
92
|
+
].join('\n'));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (llmChoice) {
|
|
96
|
+
patchLiteLLMConfig(targetDir, llmChoice.liteLLMEntry);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
clack.log.warn('No LLM provider configured — chat will not work until infra/litellm/config.yaml has a model and a matching API key. See docs/model-routing.md.');
|
|
100
|
+
}
|
|
101
|
+
if (!args.skipDocker) {
|
|
102
|
+
if (!(await maybeStartDocker(targetDir, args.yes))) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (!args.skipInstall) {
|
|
107
|
+
// prisma.config.ts reads DATABASE_URL from process.env directly, and
|
|
108
|
+
// unlike `npm run db:seed` (tsx --env-file=.env.local), plain
|
|
109
|
+
// `npm run generate:types` / `npx prisma migrate deploy` don't load
|
|
110
|
+
// .env.local themselves — so the values just written have to be passed
|
|
111
|
+
// through explicitly.
|
|
112
|
+
const rootEnv = (0, dotenv_1.parse)(rootWrite.content);
|
|
113
|
+
if (!(await maybeRunFirstTimeSetup(targetDir, args.yes, rootEnv))) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
clack.outro([
|
|
118
|
+
'Done. Next steps:',
|
|
119
|
+
` cd ${targetDir}`,
|
|
120
|
+
' npm run web:dev',
|
|
121
|
+
'',
|
|
122
|
+
'App: http://localhost:3000',
|
|
123
|
+
'Admin: http://localhost:3200 (npm run admin:dev)',
|
|
124
|
+
'',
|
|
125
|
+
'Anything skipped above (S3 storage, encryption, Stripe, email, MCP',
|
|
126
|
+
'connectors) is documented in docs/self-hosting.',
|
|
127
|
+
].join('\n'));
|
|
128
|
+
}
|
|
129
|
+
async function resolveTargetDir(given, yes) {
|
|
130
|
+
let targetDir = given;
|
|
131
|
+
if (!targetDir) {
|
|
132
|
+
if (yes) {
|
|
133
|
+
targetDir = args_1.DEFAULT_TARGET_DIR;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
const answer = await clack.text({
|
|
137
|
+
message: 'Where should Ragen be created?',
|
|
138
|
+
placeholder: args_1.DEFAULT_TARGET_DIR,
|
|
139
|
+
defaultValue: args_1.DEFAULT_TARGET_DIR,
|
|
140
|
+
});
|
|
141
|
+
if (clack.isCancel(answer)) {
|
|
142
|
+
clack.cancel('Cancelled.');
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
targetDir = answer || args_1.DEFAULT_TARGET_DIR;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if ((0, node_fs_1.existsSync)(targetDir)) {
|
|
149
|
+
const stats = (0, node_fs_1.statSync)(targetDir);
|
|
150
|
+
if (!stats.isDirectory()) {
|
|
151
|
+
clack.cancel(`${targetDir} already exists and is not a directory.`);
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
if ((0, node_fs_1.readdirSync)(targetDir).length > 0) {
|
|
155
|
+
clack.cancel(`${targetDir} already exists and is not empty.`);
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return targetDir;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Resolves each manifest entry once, so an entry listing more than one
|
|
163
|
+
* target (e.g. INTERNAL_API_SECRET, shared by root and apps/admin) writes
|
|
164
|
+
* the same value to all of them, while two independent entries for the same
|
|
165
|
+
* key (BETTER_AUTH_SECRET in root vs. admin) resolve independently.
|
|
166
|
+
*/
|
|
167
|
+
function resolveManifestValues() {
|
|
168
|
+
const resolved = new Map();
|
|
169
|
+
for (const entry of manifest_1.MANIFEST) {
|
|
170
|
+
resolved.set(entry, entry.strategy === 'generate-secret' ? (0, secrets_1.generateSecret)() : entry.value);
|
|
171
|
+
}
|
|
172
|
+
return resolved;
|
|
173
|
+
}
|
|
174
|
+
function overridesForTarget(target, resolved) {
|
|
175
|
+
const overrides = {};
|
|
176
|
+
for (const entry of (0, manifest_1.entriesForTarget)(target)) {
|
|
177
|
+
overrides[entry.key] = resolved.get(entry);
|
|
178
|
+
}
|
|
179
|
+
return overrides;
|
|
180
|
+
}
|
|
181
|
+
function writeEnvFile(targetDir, target, overrides) {
|
|
182
|
+
const paths = ENV_PATHS[target];
|
|
183
|
+
const examplePath = (0, node_path_1.join)(targetDir, paths.example);
|
|
184
|
+
const localPath = (0, node_path_1.join)(targetDir, paths.local);
|
|
185
|
+
const template = (0, node_fs_1.readFileSync)(examplePath, 'utf8');
|
|
186
|
+
const { content, missingKeys } = (0, env_file_1.applyEnvOverrides)(template, overrides);
|
|
187
|
+
// Holds every generated secret plus any pasted API key — owner-only.
|
|
188
|
+
(0, node_fs_1.writeFileSync)(localPath, content, { mode: 0o600 });
|
|
189
|
+
return { content, missingKeys };
|
|
190
|
+
}
|
|
191
|
+
async function promptLlmProvider() {
|
|
192
|
+
const choice = await clack.select({
|
|
193
|
+
message: 'Which LLM provider should power chat?',
|
|
194
|
+
options: [
|
|
195
|
+
{ value: 'openai', label: llm_provider_1.LLM_PROVIDERS.openai.label },
|
|
196
|
+
{ value: 'anthropic', label: llm_provider_1.LLM_PROVIDERS.anthropic.label },
|
|
197
|
+
{ value: 'skip', label: "I'll configure LiteLLM myself" },
|
|
198
|
+
],
|
|
199
|
+
});
|
|
200
|
+
if (clack.isCancel(choice)) {
|
|
201
|
+
return { cancelled: true };
|
|
202
|
+
}
|
|
203
|
+
if (choice === 'skip') {
|
|
204
|
+
return { cancelled: false, choice: undefined };
|
|
205
|
+
}
|
|
206
|
+
const apiKey = await clack.password({
|
|
207
|
+
message: `Paste your ${llm_provider_1.LLM_PROVIDERS[choice].label} API key`,
|
|
208
|
+
});
|
|
209
|
+
if (clack.isCancel(apiKey)) {
|
|
210
|
+
return { cancelled: true };
|
|
211
|
+
}
|
|
212
|
+
if (!apiKey) {
|
|
213
|
+
return { cancelled: false, choice: undefined };
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
cancelled: false,
|
|
217
|
+
choice: (0, llm_provider_1.resolveLlmProviderChoice)(choice, apiKey),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function patchLiteLLMConfig(targetDir, entry) {
|
|
221
|
+
const configPath = (0, node_path_1.join)(targetDir, 'infra/litellm/config.yaml');
|
|
222
|
+
const original = (0, node_fs_1.readFileSync)(configPath, 'utf8');
|
|
223
|
+
(0, node_fs_1.writeFileSync)(configPath, (0, litellm_config_1.addLiteLLMModel)(original, entry));
|
|
224
|
+
}
|
|
225
|
+
async function confirmOrSkip(message, yes) {
|
|
226
|
+
if (yes) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
const answer = await clack.confirm({ message });
|
|
230
|
+
return !clack.isCancel(answer) && answer;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Runs one setup step under a spinner, turning a rejection into a stopped
|
|
234
|
+
* spinner plus a clean `clack.cancel()` instead of letting it reach
|
|
235
|
+
* `src/index.ts`'s generic catch — which would leave the spinner "running"
|
|
236
|
+
* forever and print a raw stack trace. Returns whether the caller should
|
|
237
|
+
* keep going.
|
|
238
|
+
*/
|
|
239
|
+
async function runStep(spinner, label, successMessage, task) {
|
|
240
|
+
spinner.start(label);
|
|
241
|
+
try {
|
|
242
|
+
await task();
|
|
243
|
+
}
|
|
244
|
+
catch (error) {
|
|
245
|
+
spinner.stop(`${label} — failed.`, 1);
|
|
246
|
+
clack.cancel(String(error));
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
spinner.stop(successMessage);
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
async function maybeStartDocker(targetDir, yes) {
|
|
253
|
+
const proceed = await confirmOrSkip('Start the backing services now? (Postgres, Qdrant, Temporal, LiteLLM, Redis, …)', yes);
|
|
254
|
+
if (!proceed) {
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
if (!(await (0, tasks_1.isDockerAvailable)())) {
|
|
258
|
+
clack.log.warn('Docker does not seem to be available — skipping. Install Docker and run `docker compose up -d` yourself.');
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
return runStep(clack.spinner(), 'Starting docker compose (Postgres, Qdrant, Temporal, LiteLLM, Redis, …)', 'Backing services started.', () => (0, tasks_1.startDockerServices)({ cwd: targetDir }));
|
|
262
|
+
}
|
|
263
|
+
async function maybeRunFirstTimeSetup(targetDir, yes, env) {
|
|
264
|
+
const proceed = await confirmOrSkip('Install dependencies and run first-time setup (prisma generate, migrate, seed)?', yes);
|
|
265
|
+
if (!proceed) {
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
const spinner = clack.spinner();
|
|
269
|
+
const steps = [
|
|
270
|
+
[
|
|
271
|
+
'npm install',
|
|
272
|
+
'Dependencies installed.',
|
|
273
|
+
() => (0, tasks_1.installDependencies)({ cwd: targetDir }),
|
|
274
|
+
],
|
|
275
|
+
[
|
|
276
|
+
'Generating the Prisma client',
|
|
277
|
+
'Prisma client generated.',
|
|
278
|
+
() => (0, tasks_1.generatePrismaClient)({ cwd: targetDir, env }),
|
|
279
|
+
],
|
|
280
|
+
[
|
|
281
|
+
'Applying database migrations',
|
|
282
|
+
'Migrations applied.',
|
|
283
|
+
() => (0, tasks_1.migrateDatabase)({ cwd: targetDir, env }),
|
|
284
|
+
],
|
|
285
|
+
[
|
|
286
|
+
'Seeding the database',
|
|
287
|
+
'Database seeded.',
|
|
288
|
+
() => (0, tasks_1.seedDatabase)({ cwd: targetDir, env }),
|
|
289
|
+
],
|
|
290
|
+
];
|
|
291
|
+
for (const [label, successMessage, task] of steps) {
|
|
292
|
+
if (!(await runStep(spinner, label, successMessage, task))) {
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,kBA8FC;AArJD,qCAMiB;AACjB,yCAAiC;AAEjC,sDAAwC;AACxC,mCAA8C;AAE9C,iCAAuD;AACvD,mCAAwC;AACxC,yCAA+C;AAC/C,qDAA2E;AAC3E,iDAKwB;AACxB,yCAKoB;AACpB,uCAA2C;AAC3C,mCAOiB;AAEjB,MAAM,SAAS,GAA0D;IACvE,IAAI,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE;IACtD,KAAK,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,uBAAuB,EAAE;CAC9E,CAAC;AAcK,KAAK,UAAU,GAAG,CAAC,IAAc;IACtC,MAAM,IAAI,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,CAAC;IAE7B,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAEhC,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACnE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IACrC,YAAY,CAAC,KAAK,CAAC,sBAAsB,SAAS,EAAE,CAAC,CAAC;IACtD,IAAI,CAAC;QACH,MAAM,IAAA,qBAAa,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,K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,sBAAsB,CACnC,SAAiB,EACjB,GAAY,EACZ,GAAsB;IAEtB,MAAM,OAAO,GAAG,MAAM,aAAa,CACjC,iFAAiF,EACjF,GAAG,CACJ,CAAC;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IAEhC,MAAM,KAAK,GAAiD;QAC1D;YACE,aAAa;YACb,yBAAyB;YACzB,GAAG,EAAE,CAAC,IAAA,2BAAmB,EAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;SAC9C;QACD;YACE,8BAA8B;YAC9B,0BAA0B;YAC1B,GAAG,EAAE,CAAC,IAAA,4BAAoB,EAAC,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;SACpD;QACD;YACE,8BAA8B;YAC9B,qBAAqB;YACrB,GAAG,EAAE,CAAC,IAAA,uBAAe,EAAC,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;SAC/C;QACD;YACE,sBAAsB;YACtB,kBAAkB;YAClB,GAAG,EAAE,CAAC,IAAA,oBAAY,EAAC,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;SAC5C;KACF,CAAC;IAEF,KAAK,MAAM,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;QAClD,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/clone.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kept as one constant so the org/repo path is a one-line change if the
|
|
3
|
+
* public location differs from this by launch time — see the create-ragen-app
|
|
4
|
+
* plan's non-goals.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RAGEN_APP_REPO = "webamigos/RagenAI";
|
|
7
|
+
export declare function cloneRagenApp(targetDir: string, ref: string): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=clone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../src/clone.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,cAAc,sBAAsB,CAAC;AAElD,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
package/dist/clone.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RAGEN_APP_REPO = void 0;
|
|
4
|
+
exports.cloneRagenApp = cloneRagenApp;
|
|
5
|
+
const giget_1 = require("giget");
|
|
6
|
+
/**
|
|
7
|
+
* Kept as one constant so the org/repo path is a one-line change if the
|
|
8
|
+
* public location differs from this by launch time — see the create-ragen-app
|
|
9
|
+
* plan's non-goals.
|
|
10
|
+
*/
|
|
11
|
+
exports.RAGEN_APP_REPO = 'webamigos/RagenAI';
|
|
12
|
+
async function cloneRagenApp(targetDir, ref) {
|
|
13
|
+
await (0, giget_1.downloadTemplate)(`github:${exports.RAGEN_APP_REPO}#${ref}`, {
|
|
14
|
+
dir: targetDir,
|
|
15
|
+
forceClean: false,
|
|
16
|
+
install: false,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=clone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clone.js","sourceRoot":"","sources":["../src/clone.ts"],"names":[],"mappings":";;;AASA,sCASC;AAlBD,iCAAyC;AAEzC;;;;GAIG;AACU,QAAA,cAAc,GAAG,mBAAmB,CAAC;AAE3C,KAAK,UAAU,aAAa,CACjC,SAAiB,EACjB,GAAW;IAEX,MAAM,IAAA,wBAAgB,EAAC,UAAU,sBAAc,IAAI,GAAG,EAAE,EAAE;QACxD,GAAG,EAAE,SAAS;QACd,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns a `.env.example` template into a working `.env.local` by replacing
|
|
3
|
+
* only the `KEY=` lines named in `values`, leaving every comment, blank line
|
|
4
|
+
* and untouched default exactly as the cloned repo shipped it. Matches both
|
|
5
|
+
* commented (`# KEY=`) and uncommented (`KEY=...`) lines, so a generated
|
|
6
|
+
* secret also uncomments a line that started out disabled.
|
|
7
|
+
*
|
|
8
|
+
* `missingKeys` reports any requested key that never matched a line in the
|
|
9
|
+
* template — surfaced to the user rather than silently dropped, since it
|
|
10
|
+
* usually means the manifest and the cloned repo's `.env.example` have
|
|
11
|
+
* drifted.
|
|
12
|
+
*
|
|
13
|
+
* Only the first matching line per key is rewritten — some vars
|
|
14
|
+
* (`AWS_BEDROCK_REGION`, `S3_REGION`, `FEATURE_FLAG_RERANKING`, …) appear
|
|
15
|
+
* more than once in `.env.example`, documented in different sections, and a
|
|
16
|
+
* second rewrite would duplicate an active assignment or uncomment an
|
|
17
|
+
* example that was meant to stay a comment.
|
|
18
|
+
*/
|
|
19
|
+
export interface ApplyEnvOverridesResult {
|
|
20
|
+
content: string;
|
|
21
|
+
missingKeys: string[];
|
|
22
|
+
}
|
|
23
|
+
export declare function applyEnvOverrides(template: string, values: Record<string, string>): ApplyEnvOverridesResult;
|
|
24
|
+
//# sourceMappingURL=env-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-file.d.ts","sourceRoot":"","sources":["../src/env-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,uBAAuB,CAazB"}
|
package/dist/env-file.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Turns a `.env.example` template into a working `.env.local` by replacing
|
|
4
|
+
* only the `KEY=` lines named in `values`, leaving every comment, blank line
|
|
5
|
+
* and untouched default exactly as the cloned repo shipped it. Matches both
|
|
6
|
+
* commented (`# KEY=`) and uncommented (`KEY=...`) lines, so a generated
|
|
7
|
+
* secret also uncomments a line that started out disabled.
|
|
8
|
+
*
|
|
9
|
+
* `missingKeys` reports any requested key that never matched a line in the
|
|
10
|
+
* template — surfaced to the user rather than silently dropped, since it
|
|
11
|
+
* usually means the manifest and the cloned repo's `.env.example` have
|
|
12
|
+
* drifted.
|
|
13
|
+
*
|
|
14
|
+
* Only the first matching line per key is rewritten — some vars
|
|
15
|
+
* (`AWS_BEDROCK_REGION`, `S3_REGION`, `FEATURE_FLAG_RERANKING`, …) appear
|
|
16
|
+
* more than once in `.env.example`, documented in different sections, and a
|
|
17
|
+
* second rewrite would duplicate an active assignment or uncomment an
|
|
18
|
+
* example that was meant to stay a comment.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.applyEnvOverrides = applyEnvOverrides;
|
|
22
|
+
const ENV_LINE = /^#?\s*([A-Z][A-Z0-9_]*)=/;
|
|
23
|
+
function applyEnvOverrides(template, values) {
|
|
24
|
+
const remaining = new Set(Object.keys(values));
|
|
25
|
+
const lines = template.split('\n').map((line) => {
|
|
26
|
+
const key = ENV_LINE.exec(line)?.[1];
|
|
27
|
+
if (!key || !remaining.has(key)) {
|
|
28
|
+
return line;
|
|
29
|
+
}
|
|
30
|
+
remaining.delete(key);
|
|
31
|
+
return `${key}=${values[key]}`;
|
|
32
|
+
});
|
|
33
|
+
return { content: lines.join('\n'), missingKeys: [...remaining] };
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=env-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-file.js","sourceRoot":"","sources":["../src/env-file.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AASH,8CAgBC;AAvBD,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AAO5C,SAAgB,iBAAiB,CAC/B,QAAgB,EAChB,MAA8B;IAE9B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE/C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtB,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;AACpE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const cli_1 = require("./cli");
|
|
5
|
+
(0, cli_1.run)(process.argv.slice(2)).catch((error) => {
|
|
6
|
+
console.error(error instanceof Error ? error.message : error);
|
|
7
|
+
process.exitCode = 1;
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,IAAA,SAAG,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAClD,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC9D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wires a plain OpenAI or Anthropic API key into `infra/litellm/config.yaml`
|
|
3
|
+
* by inserting a new `model_list` entry as text, not by parsing and
|
|
4
|
+
* re-serializing the YAML. The shipped config is heavily hand-commented
|
|
5
|
+
* (rationale for every model, dated notes, links) and a round-trip through a
|
|
6
|
+
* YAML library would collapse or reorder all of that — a text splice right
|
|
7
|
+
* after the `model_list:` key preserves everything else byte-for-byte.
|
|
8
|
+
*/
|
|
9
|
+
export interface LiteLLMModelEntry {
|
|
10
|
+
modelName: string;
|
|
11
|
+
/** LiteLLM provider-prefixed model id, e.g. "openai/gpt-4o-mini". */
|
|
12
|
+
model: string;
|
|
13
|
+
/** Name of the env var holding the API key, e.g. "OPENAI_API_KEY". */
|
|
14
|
+
apiKeyEnvVar: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function addLiteLLMModel(configText: string, entry: LiteLLMModelEntry): string;
|
|
17
|
+
//# sourceMappingURL=litellm-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"litellm-config.d.ts","sourceRoot":"","sources":["../src/litellm-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,iBAAiB,GACvB,MAAM,CAoBR"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Wires a plain OpenAI or Anthropic API key into `infra/litellm/config.yaml`
|
|
4
|
+
* by inserting a new `model_list` entry as text, not by parsing and
|
|
5
|
+
* re-serializing the YAML. The shipped config is heavily hand-commented
|
|
6
|
+
* (rationale for every model, dated notes, links) and a round-trip through a
|
|
7
|
+
* YAML library would collapse or reorder all of that — a text splice right
|
|
8
|
+
* after the `model_list:` key preserves everything else byte-for-byte.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.addLiteLLMModel = addLiteLLMModel;
|
|
12
|
+
function addLiteLLMModel(configText, entry) {
|
|
13
|
+
const lines = configText.split('\n');
|
|
14
|
+
const anchorIndex = lines.findIndex((line) => line.trim() === 'model_list:');
|
|
15
|
+
if (anchorIndex === -1) {
|
|
16
|
+
throw new Error('infra/litellm/config.yaml has no `model_list:` key — cannot insert a model entry.');
|
|
17
|
+
}
|
|
18
|
+
const entryLines = [
|
|
19
|
+
` - model_name: ${entry.modelName}`,
|
|
20
|
+
' litellm_params:',
|
|
21
|
+
` model: ${entry.model}`,
|
|
22
|
+
` api_key: os.environ/${entry.apiKeyEnvVar}`,
|
|
23
|
+
'',
|
|
24
|
+
];
|
|
25
|
+
lines.splice(anchorIndex + 1, 0, ...entryLines);
|
|
26
|
+
return lines.join('\n');
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=litellm-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"litellm-config.js","sourceRoot":"","sources":["../src/litellm-config.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAUH,0CAuBC;AAvBD,SAAgB,eAAe,CAC7B,UAAkB,EAClB,KAAwB;IAExB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,aAAa,CAAC,CAAC;IAE7E,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG;QACjB,mBAAmB,KAAK,CAAC,SAAS,EAAE;QACpC,qBAAqB;QACrB,gBAAgB,KAAK,CAAC,KAAK,EAAE;QAC7B,6BAA6B,KAAK,CAAC,YAAY,EAAE;QACjD,EAAE;KACH,CAAC;IAEF,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC;IAChD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LiteLLMModelEntry } from './litellm-config';
|
|
2
|
+
/**
|
|
3
|
+
* The `infra/litellm/config.yaml` shipped in the repo only wires Azure
|
|
4
|
+
* OpenAI, AWS Bedrock, Google Vertex and Scaleway — none of which a new
|
|
5
|
+
* self-hoster can use in five minutes. These two entries let the wizard
|
|
6
|
+
* paste a plain OpenAI or Anthropic key and get a working model instead.
|
|
7
|
+
*/
|
|
8
|
+
export type LlmProviderChoice = 'openai' | 'anthropic';
|
|
9
|
+
export interface LlmProviderConfig {
|
|
10
|
+
label: string;
|
|
11
|
+
apiKeyEnvVar: string;
|
|
12
|
+
modelName: string;
|
|
13
|
+
litellmModel: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const LLM_PROVIDERS: Record<LlmProviderChoice, LlmProviderConfig>;
|
|
16
|
+
export interface LlmProviderChoiceResult {
|
|
17
|
+
envUpdates: Record<string, string>;
|
|
18
|
+
liteLLMEntry: LiteLLMModelEntry;
|
|
19
|
+
}
|
|
20
|
+
export declare function resolveLlmProviderChoice(choice: LlmProviderChoice, apiKey: string): LlmProviderChoiceResult;
|
|
21
|
+
//# sourceMappingURL=llm-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-provider.d.ts","sourceRoot":"","sources":["../src/llm-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,CAkBtE,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,MAAM,GACb,uBAAuB,CAezB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LLM_PROVIDERS = void 0;
|
|
4
|
+
exports.resolveLlmProviderChoice = resolveLlmProviderChoice;
|
|
5
|
+
exports.LLM_PROVIDERS = {
|
|
6
|
+
openai: {
|
|
7
|
+
label: 'OpenAI',
|
|
8
|
+
apiKeyEnvVar: 'OPENAI_API_KEY',
|
|
9
|
+
modelName: 'gpt-4o-mini',
|
|
10
|
+
litellmModel: 'openai/gpt-4o-mini',
|
|
11
|
+
},
|
|
12
|
+
anthropic: {
|
|
13
|
+
label: 'Anthropic',
|
|
14
|
+
apiKeyEnvVar: 'ANTHROPIC_API_KEY',
|
|
15
|
+
// Not "claude-haiku-4-5" — packages/platform-contracts/src/llm/model-catalog.ts
|
|
16
|
+
// already uses that name for the (commented) Bedrock deployment of the
|
|
17
|
+
// same model. Two model_list entries sharing a model_name become one
|
|
18
|
+
// load-balanced pool in LiteLLM, silently mixing direct-Anthropic and
|
|
19
|
+
// Bedrock traffic under Bedrock's catalog metadata.
|
|
20
|
+
modelName: 'claude-haiku-4-5-direct',
|
|
21
|
+
litellmModel: 'anthropic/claude-haiku-4-5-20251001',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
function resolveLlmProviderChoice(choice, apiKey) {
|
|
25
|
+
const config = exports.LLM_PROVIDERS[choice];
|
|
26
|
+
return {
|
|
27
|
+
envUpdates: {
|
|
28
|
+
[config.apiKeyEnvVar]: apiKey,
|
|
29
|
+
DEFAULT_MODEL: config.modelName,
|
|
30
|
+
DEFAULT_MODEL_PROVIDER: 'litellm',
|
|
31
|
+
},
|
|
32
|
+
liteLLMEntry: {
|
|
33
|
+
modelName: config.modelName,
|
|
34
|
+
model: config.litellmModel,
|
|
35
|
+
apiKeyEnvVar: config.apiKeyEnvVar,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=llm-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-provider.js","sourceRoot":"","sources":["../src/llm-provider.ts"],"names":[],"mappings":";;;AA0CA,4DAkBC;AA3CY,QAAA,aAAa,GAAiD;IACzE,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE,gBAAgB;QAC9B,SAAS,EAAE,aAAa;QACxB,YAAY,EAAE,oBAAoB;KACnC;IACD,SAAS,EAAE;QACT,KAAK,EAAE,WAAW;QAClB,YAAY,EAAE,mBAAmB;QACjC,gFAAgF;QAChF,uEAAuE;QACvE,qEAAqE;QACrE,sEAAsE;QACtE,oDAAoD;QACpD,SAAS,EAAE,yBAAyB;QACpC,YAAY,EAAE,qCAAqC;KACpD;CACF,CAAC;AAOF,SAAgB,wBAAwB,CACtC,MAAyB,EACzB,MAAc;IAEd,MAAM,MAAM,GAAG,qBAAa,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO;QACL,UAAU,EAAE;YACV,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM;YAC7B,aAAa,EAAE,MAAM,CAAC,SAAS;YAC/B,sBAAsB,EAAE,SAAS;SAClC;QACD,YAAY,EAAE;YACZ,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,KAAK,EAAE,MAAM,CAAC,YAAY;YAC1B,YAAY,EAAE,MAAM,CAAC,YAAY;SAClC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What create-ragen-app changes in the two `.env.example` templates it ships
|
|
3
|
+
* as `.env.local` (root and apps/admin) to turn a fresh clone into a working
|
|
4
|
+
* local install, without asking a question for every variable.
|
|
5
|
+
*
|
|
6
|
+
* This is deliberately an *overrides* list, not a full inventory of every env
|
|
7
|
+
* var: anything not listed here is left exactly as the cloned repo's own
|
|
8
|
+
* `.env.example` already has it (a comment, a blank, or a working default).
|
|
9
|
+
* Only vars that need a generated secret or a corrected local-dev value show
|
|
10
|
+
* up below.
|
|
11
|
+
*
|
|
12
|
+
* `targets` lists every `.env.local` file that must receive this key. When an
|
|
13
|
+
* entry has more than one target, the *same* generated value is written to
|
|
14
|
+
* each of them — that is what makes it "shared" rather than "this key exists
|
|
15
|
+
* in more than one file with independent values" (BETTER_AUTH_SECRET is the
|
|
16
|
+
* latter: root and apps/admin each get their own entry, each scoped to one
|
|
17
|
+
* target, so they resolve to different secrets).
|
|
18
|
+
*
|
|
19
|
+
* Keeping this file in sync with `packages/env/src/fragments.ts` and the two
|
|
20
|
+
* `.env.example` files is enforced by
|
|
21
|
+
* tests/architecture/create-ragen-app-manifest-is-current.test.ts.
|
|
22
|
+
*/
|
|
23
|
+
export type EnvTarget = 'root' | 'admin';
|
|
24
|
+
export interface GenerateSecretEntry {
|
|
25
|
+
key: string;
|
|
26
|
+
strategy: 'generate-secret';
|
|
27
|
+
targets: EnvTarget[];
|
|
28
|
+
}
|
|
29
|
+
export interface LocalDefaultEntry {
|
|
30
|
+
key: string;
|
|
31
|
+
strategy: 'local-default';
|
|
32
|
+
targets: EnvTarget[];
|
|
33
|
+
value: string;
|
|
34
|
+
}
|
|
35
|
+
export type ManifestEntry = GenerateSecretEntry | LocalDefaultEntry;
|
|
36
|
+
export declare const MANIFEST: ManifestEntry[];
|
|
37
|
+
export declare function entriesForTarget(target: EnvTarget): ManifestEntry[];
|
|
38
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAEpE,eAAO,MAAM,QAAQ,EAAE,aAAa,EAmDnC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,aAAa,EAAE,CAEnE"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* What create-ragen-app changes in the two `.env.example` templates it ships
|
|
4
|
+
* as `.env.local` (root and apps/admin) to turn a fresh clone into a working
|
|
5
|
+
* local install, without asking a question for every variable.
|
|
6
|
+
*
|
|
7
|
+
* This is deliberately an *overrides* list, not a full inventory of every env
|
|
8
|
+
* var: anything not listed here is left exactly as the cloned repo's own
|
|
9
|
+
* `.env.example` already has it (a comment, a blank, or a working default).
|
|
10
|
+
* Only vars that need a generated secret or a corrected local-dev value show
|
|
11
|
+
* up below.
|
|
12
|
+
*
|
|
13
|
+
* `targets` lists every `.env.local` file that must receive this key. When an
|
|
14
|
+
* entry has more than one target, the *same* generated value is written to
|
|
15
|
+
* each of them — that is what makes it "shared" rather than "this key exists
|
|
16
|
+
* in more than one file with independent values" (BETTER_AUTH_SECRET is the
|
|
17
|
+
* latter: root and apps/admin each get their own entry, each scoped to one
|
|
18
|
+
* target, so they resolve to different secrets).
|
|
19
|
+
*
|
|
20
|
+
* Keeping this file in sync with `packages/env/src/fragments.ts` and the two
|
|
21
|
+
* `.env.example` files is enforced by
|
|
22
|
+
* tests/architecture/create-ragen-app-manifest-is-current.test.ts.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.MANIFEST = void 0;
|
|
26
|
+
exports.entriesForTarget = entriesForTarget;
|
|
27
|
+
exports.MANIFEST = [
|
|
28
|
+
// --- Generated secrets, independent per target ---
|
|
29
|
+
{ key: 'SECRET_KEY', strategy: 'generate-secret', targets: ['root'] },
|
|
30
|
+
{ key: 'BETTER_AUTH_SECRET', strategy: 'generate-secret', targets: ['root'] },
|
|
31
|
+
{
|
|
32
|
+
key: 'PUBLIC_LINK_TOKEN_SECRET',
|
|
33
|
+
strategy: 'generate-secret',
|
|
34
|
+
targets: ['root'],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'SESSION_AUTH_SECRET',
|
|
38
|
+
strategy: 'generate-secret',
|
|
39
|
+
targets: ['root'],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
// Replaces the "worker-secret-key" placeholder that ships in
|
|
43
|
+
// .env.example — apps/worker reads the same var from the root env via
|
|
44
|
+
// scripts/load-root-env.mjs, so one value here is enough.
|
|
45
|
+
key: 'WORKER_SECRET_KEY',
|
|
46
|
+
strategy: 'generate-secret',
|
|
47
|
+
targets: ['root'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: 'BETTER_AUTH_SECRET',
|
|
51
|
+
strategy: 'generate-secret',
|
|
52
|
+
targets: ['admin'],
|
|
53
|
+
},
|
|
54
|
+
// --- Generated secrets, shared value across targets ---
|
|
55
|
+
{
|
|
56
|
+
// Read by apps/web, apps/api and apps/admin (apps/api gap-fills from the
|
|
57
|
+
// root .env.local when it has none of its own, per
|
|
58
|
+
// scripts/load-root-env.mjs, so it never needs a third copy of this
|
|
59
|
+
// value). apps/admin keeps a fully separate env file, so it needs its own
|
|
60
|
+
// copy of the same value.
|
|
61
|
+
key: 'INTERNAL_API_SECRET',
|
|
62
|
+
strategy: 'generate-secret',
|
|
63
|
+
targets: ['root', 'admin'],
|
|
64
|
+
},
|
|
65
|
+
// --- Local-dev defaults that correct a stale example value ---
|
|
66
|
+
{
|
|
67
|
+
// docker-compose.yml maps Postgres to host port 55432, not the 5432 that
|
|
68
|
+
// both .env.example files show — a native/other Postgres on 5432 would
|
|
69
|
+
// otherwise silently answer instead of the container. See
|
|
70
|
+
// docs/lessons.md.
|
|
71
|
+
key: 'DATABASE_URL',
|
|
72
|
+
strategy: 'local-default',
|
|
73
|
+
targets: ['root', 'admin'],
|
|
74
|
+
value: 'postgresql://postgres:pass123@localhost:55432/ragen',
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
function entriesForTarget(target) {
|
|
78
|
+
return exports.MANIFEST.filter((entry) => entry.targets.includes(target));
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAwEH,4CAEC;AAvDY,QAAA,QAAQ,GAAoB;IACvC,oDAAoD;IACpD,EAAE,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE;IACrE,EAAE,GAAG,EAAE,oBAAoB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE;IAC7E;QACE,GAAG,EAAE,0BAA0B;QAC/B,QAAQ,EAAE,iBAAiB;QAC3B,OAAO,EAAE,CAAC,MAAM,CAAC;KAClB;IACD;QACE,GAAG,EAAE,qBAAqB;QAC1B,QAAQ,EAAE,iBAAiB;QAC3B,OAAO,EAAE,CAAC,MAAM,CAAC;KAClB;IACD;QACE,6DAA6D;QAC7D,sEAAsE;QACtE,0DAA0D;QAC1D,GAAG,EAAE,mBAAmB;QACxB,QAAQ,EAAE,iBAAiB;QAC3B,OAAO,EAAE,CAAC,MAAM,CAAC;KAClB;IACD;QACE,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,iBAAiB;QAC3B,OAAO,EAAE,CAAC,OAAO,CAAC;KACnB;IAED,yDAAyD;IACzD;QACE,yEAAyE;QACzE,mDAAmD;QACnD,oEAAoE;QACpE,0EAA0E;QAC1E,0BAA0B;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,QAAQ,EAAE,iBAAiB;QAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;KAC3B;IAED,gEAAgE;IAChE;QACE,yEAAyE;QACzE,uEAAuE;QACvE,0DAA0D;QAC1D,mBAAmB;QACnB,GAAG,EAAE,cAAc;QACnB,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1B,KAAK,EAAE,qDAAqD;KAC7D;CACF,CAAC;AAEF,SAAgB,gBAAgB,CAAC,MAAiB;IAChD,OAAO,gBAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
|
package/dist/secrets.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSecret = generateSecret;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
/**
|
|
6
|
+
* Matches every "Generate with: node -e ... randomBytes(32)" instruction
|
|
7
|
+
* scattered across .env.example — one helper instead of five copy-pasted
|
|
8
|
+
* one-liners.
|
|
9
|
+
*/
|
|
10
|
+
function generateSecret() {
|
|
11
|
+
return (0, node_crypto_1.randomBytes)(32).toString('hex');
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=secrets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":";;AAOA,wCAEC;AATD,6CAA0C;AAE1C;;;;GAIG;AACH,SAAgB,cAAc;IAC5B,OAAO,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/tasks.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface RunOptions {
|
|
2
|
+
cwd: string;
|
|
3
|
+
/**
|
|
4
|
+
* Extra env vars for the child process — needed for `generate:types` and
|
|
5
|
+
* `migrate deploy`, which read `DATABASE_URL` from `process.env` directly
|
|
6
|
+
* (see prisma.config.ts) and do not load `.env.local` themselves the way
|
|
7
|
+
* `npm run db:seed` does (`tsx --env-file=.env.local`). execa merges this
|
|
8
|
+
* with the parent's own `process.env` automatically.
|
|
9
|
+
*/
|
|
10
|
+
env?: NodeJS.ProcessEnv;
|
|
11
|
+
}
|
|
12
|
+
export interface MigrateOptions {
|
|
13
|
+
retries?: number;
|
|
14
|
+
retryDelayMs?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function isDockerAvailable(): Promise<boolean>;
|
|
17
|
+
export declare function startDockerServices({ cwd }: RunOptions): Promise<void>;
|
|
18
|
+
export declare function installDependencies({ cwd }: RunOptions): Promise<void>;
|
|
19
|
+
export declare function generatePrismaClient({ cwd, env, }: RunOptions): Promise<void>;
|
|
20
|
+
export declare function seedDatabase({ cwd, env }: RunOptions): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Postgres needs a moment to accept connections right after
|
|
23
|
+
* `docker compose up -d`, so a first `migrate deploy` failing is expected —
|
|
24
|
+
* retry with a short backoff instead of surfacing that as a hard error.
|
|
25
|
+
*/
|
|
26
|
+
export declare function migrateDatabase({ cwd, env }: RunOptions, { retries, retryDelayMs }?: MigrateOptions): Promise<void>;
|
|
27
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAU1D;AAED,wBAAsB,mBAAmB,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5E;AAED,wBAAsB,mBAAmB,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5E;AAED,wBAAsB,oBAAoB,CAAC,EACzC,GAAG,EACH,GAAG,GACJ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5B;AAED,wBAAsB,YAAY,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EACxB,EAAE,OAAW,EAAE,YAAmB,EAAE,GAAE,cAAmB,GACxD,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|
package/dist/tasks.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDockerAvailable = isDockerAvailable;
|
|
4
|
+
exports.startDockerServices = startDockerServices;
|
|
5
|
+
exports.installDependencies = installDependencies;
|
|
6
|
+
exports.generatePrismaClient = generatePrismaClient;
|
|
7
|
+
exports.seedDatabase = seedDatabase;
|
|
8
|
+
exports.migrateDatabase = migrateDatabase;
|
|
9
|
+
const execa_1 = require("execa");
|
|
10
|
+
async function isDockerAvailable() {
|
|
11
|
+
try {
|
|
12
|
+
// A stuck `docker info` (e.g. Docker Desktop still starting up) would
|
|
13
|
+
// otherwise block forever instead of falling through to the "Docker not
|
|
14
|
+
// available" path.
|
|
15
|
+
await (0, execa_1.execa)('docker', ['info'], { timeout: 10_000 });
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async function startDockerServices({ cwd }) {
|
|
23
|
+
await (0, execa_1.execa)('docker', ['compose', 'up', '-d'], { cwd, stdio: 'inherit' });
|
|
24
|
+
}
|
|
25
|
+
async function installDependencies({ cwd }) {
|
|
26
|
+
await (0, execa_1.execa)('npm', ['install'], { cwd, stdio: 'inherit' });
|
|
27
|
+
}
|
|
28
|
+
async function generatePrismaClient({ cwd, env, }) {
|
|
29
|
+
await (0, execa_1.execa)('npm', ['run', 'generate:types'], { cwd, env, stdio: 'inherit' });
|
|
30
|
+
}
|
|
31
|
+
async function seedDatabase({ cwd, env }) {
|
|
32
|
+
await (0, execa_1.execa)('npm', ['run', 'db:seed'], { cwd, env, stdio: 'inherit' });
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Postgres needs a moment to accept connections right after
|
|
36
|
+
* `docker compose up -d`, so a first `migrate deploy` failing is expected —
|
|
37
|
+
* retry with a short backoff instead of surfacing that as a hard error.
|
|
38
|
+
*/
|
|
39
|
+
async function migrateDatabase({ cwd, env }, { retries = 5, retryDelayMs = 3000 } = {}) {
|
|
40
|
+
let lastError;
|
|
41
|
+
for (let attempt = 1; attempt <= retries; attempt += 1) {
|
|
42
|
+
try {
|
|
43
|
+
await (0, execa_1.execa)('npx', ['prisma', 'migrate', 'deploy'], {
|
|
44
|
+
cwd,
|
|
45
|
+
env,
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
lastError = error;
|
|
52
|
+
if (attempt < retries) {
|
|
53
|
+
await delay(retryDelayMs);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
throw new Error(`prisma migrate deploy failed after ${retries} attempts — is Postgres reachable? ${String(lastError)}`);
|
|
58
|
+
}
|
|
59
|
+
function delay(ms) {
|
|
60
|
+
return new Promise((resolve) => {
|
|
61
|
+
setTimeout(resolve, ms);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":";;AAmBA,8CAUC;AAED,kDAEC;AAED,kDAEC;AAED,oDAKC;AAED,oCAEC;AAOD,0CAyBC;AAhFD,iCAA8B;AAmBvB,KAAK,UAAU,iBAAiB;IACrC,IAAI,CAAC;QACH,sEAAsE;QACtE,wEAAwE;QACxE,mBAAmB;QACnB,MAAM,IAAA,aAAK,EAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,mBAAmB,CAAC,EAAE,GAAG,EAAc;IAC3D,MAAM,IAAA,aAAK,EAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC5E,CAAC;AAEM,KAAK,UAAU,mBAAmB,CAAC,EAAE,GAAG,EAAc;IAC3D,MAAM,IAAA,aAAK,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,G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ACJ,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-ragen-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Scaffold a self-hosted Ragen AI installation with one command",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-ragen-app": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/webamigos/RagenAI.git",
|
|
20
|
+
"directory": "packages/create-ragen-app"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p tsconfig.json",
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"prepare": "npm run build",
|
|
26
|
+
"lint": "eslint",
|
|
27
|
+
"typecheck": "tsc --noEmit --incremental --tsBuildInfoFile ./typecheck.tsbuildinfo"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@clack/prompts": "^0.9.1",
|
|
31
|
+
"dotenv": "^17.4.2",
|
|
32
|
+
"execa": "^9.5.2",
|
|
33
|
+
"giget": "^1.2.3"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@ragenai/eslint-config": "*",
|
|
37
|
+
"@types/node": "^22.0.0",
|
|
38
|
+
"eslint": "^9.39.5",
|
|
39
|
+
"typescript": "~5.7.0"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=24"
|
|
43
|
+
}
|
|
44
|
+
}
|