create-ragen-app 0.4.0 → 0.6.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 +39 -31
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +206 -41
- package/dist/cli.js.map +1 -1
- package/dist/config-template.js +3 -3
- package/dist/llm-provider.d.ts +32 -10
- package/dist/llm-provider.d.ts.map +1 -1
- package/dist/llm-provider.js +52 -29
- package/dist/llm-provider.js.map +1 -1
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +0 -34
- package/dist/manifest.js.map +1 -1
- package/dist/manual-setup.d.ts.map +1 -1
- package/dist/manual-setup.js +16 -24
- package/dist/manual-setup.js.map +1 -1
- package/dist/pii-masking.d.ts +26 -0
- package/dist/pii-masking.d.ts.map +1 -0
- package/dist/pii-masking.js +36 -0
- package/dist/pii-masking.js.map +1 -0
- package/dist/route-table.d.ts +12 -4
- package/dist/route-table.d.ts.map +1 -1
- package/dist/route-table.js +6 -6
- package/dist/route-table.js.map +1 -1
- package/dist/tasks.d.ts +10 -1
- package/dist/tasks.d.ts.map +1 -1
- package/dist/tasks.js +13 -2
- package/dist/tasks.js.map +1 -1
- package/dist/worker-runtime.d.ts +101 -0
- package/dist/worker-runtime.d.ts.map +1 -0
- package/dist/worker-runtime.js +118 -0
- package/dist/worker-runtime.js.map +1 -0
- package/package.json +3 -3
- package/dist/litellm-config.d.ts +0 -17
- package/dist/litellm-config.d.ts.map +0 -1
- package/dist/litellm-config.js +0 -28
- package/dist/litellm-config.js.map +0 -1
package/dist/llm-provider.d.ts
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import type { LiteLLMModelEntry } from './litellm-config';
|
|
2
1
|
import type { RouteTableEntry } from './route-table';
|
|
3
2
|
/**
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* The route table shipped in the repo wires Azure OpenAI, AWS Bedrock, Google
|
|
4
|
+
* Vertex and Scaleway — accounts a new self-hoster mostly does not have. These
|
|
5
|
+
* entries let the wizard take one key and produce a working install instead.
|
|
6
|
+
*
|
|
7
|
+
* Ordered by how far one key gets you, which is not the same as how well known
|
|
8
|
+
* the vendor is:
|
|
9
|
+
*
|
|
10
|
+
* - `openrouter` — one key, most of the catalogue, and embeddings, so chat and
|
|
11
|
+
* the knowledge base both work.
|
|
12
|
+
* - `scaleway` — the same, on EU infrastructure, and the set Ragen's own demo
|
|
13
|
+
* runs. The reason it is offered here rather than left to the shipped table:
|
|
14
|
+
* it *is* in that table, but only as routes an installer has no key for, so
|
|
15
|
+
* a new install could see the models and reach none of them.
|
|
16
|
+
* - `openai` — the commonest key there is; chat and embeddings.
|
|
17
|
+
* - `anthropic` — chat only. Anthropic publishes no embeddings endpoint, so
|
|
18
|
+
* the knowledge base does not work on this key alone and the wizard says so.
|
|
8
19
|
*/
|
|
9
|
-
export type LlmProviderChoice = 'openai' | 'anthropic';
|
|
20
|
+
export type LlmProviderChoice = 'openrouter' | 'scaleway' | 'openai' | 'anthropic';
|
|
10
21
|
export interface LlmEmbeddingsConfig {
|
|
11
22
|
modelName: string;
|
|
12
|
-
litellmModel: string;
|
|
13
23
|
/** The upstream's own name, for the route table. */
|
|
14
24
|
upstreamModel: string;
|
|
15
25
|
/** Output dimensionality — must match `VECTOR_SIZE`, see rag-core's vector contract. */
|
|
@@ -19,7 +29,6 @@ export interface LlmProviderConfig {
|
|
|
19
29
|
label: string;
|
|
20
30
|
apiKeyEnvVar: string;
|
|
21
31
|
modelName: string;
|
|
22
|
-
litellmModel: string;
|
|
23
32
|
/**
|
|
24
33
|
* The `@ragenai/llm-gateway` provider that serves this key directly, and the
|
|
25
34
|
* upstream's own name for the model. Both providers the wizard offers have
|
|
@@ -28,6 +37,20 @@ export interface LlmProviderConfig {
|
|
|
28
37
|
* runs because the wizard configured one.
|
|
29
38
|
*/
|
|
30
39
|
gatewayProvider: string;
|
|
40
|
+
/** Passed through to the route, for an `openai-compatible` upstream. */
|
|
41
|
+
connection?: string;
|
|
42
|
+
/**
|
|
43
|
+
* A second value the provider cannot work without, asked for after the key.
|
|
44
|
+
*
|
|
45
|
+
* Scaleway is the case: its base URL carries the project id
|
|
46
|
+
* (`https://api.scaleway.ai/<project>/v1`), so a key alone produces an
|
|
47
|
+
* install that looks configured and 404s on the first turn. Providers whose
|
|
48
|
+
* endpoint is a constant leave this undefined and are still one prompt.
|
|
49
|
+
*/
|
|
50
|
+
baseUrl?: {
|
|
51
|
+
envVar: string;
|
|
52
|
+
prompt: string;
|
|
53
|
+
};
|
|
31
54
|
upstreamModel: string;
|
|
32
55
|
/**
|
|
33
56
|
* Undefined for a provider with no embeddings API of its own. Chat still
|
|
@@ -41,7 +64,6 @@ export interface LlmProviderConfig {
|
|
|
41
64
|
export declare const LLM_PROVIDERS: Record<LlmProviderChoice, LlmProviderConfig>;
|
|
42
65
|
export interface LlmProviderChoiceResult {
|
|
43
66
|
envUpdates: Record<string, string>;
|
|
44
|
-
liteLLMEntries: LiteLLMModelEntry[];
|
|
45
67
|
/**
|
|
46
68
|
* The route table this installation gets. Written over the one shipped in
|
|
47
69
|
* the repository, which names providers a new install has no keys for.
|
|
@@ -50,5 +72,5 @@ export interface LlmProviderChoiceResult {
|
|
|
50
72
|
/** False when the picked provider cannot serve embeddings — the caller warns. */
|
|
51
73
|
embeddingsConfigured: boolean;
|
|
52
74
|
}
|
|
53
|
-
export declare function resolveLlmProviderChoice(choice: LlmProviderChoice, apiKey: string): LlmProviderChoiceResult;
|
|
75
|
+
export declare function resolveLlmProviderChoice(choice: LlmProviderChoice, apiKey: string, baseUrl?: string): LlmProviderChoiceResult;
|
|
54
76
|
//# sourceMappingURL=llm-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-provider.d.ts","sourceRoot":"","sources":["../src/llm-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file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3,53 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LLM_PROVIDERS = void 0;
|
|
4
4
|
exports.resolveLlmProviderChoice = resolveLlmProviderChoice;
|
|
5
5
|
exports.LLM_PROVIDERS = {
|
|
6
|
+
openrouter: {
|
|
7
|
+
label: 'OpenRouter (one key, most models)',
|
|
8
|
+
apiKeyEnvVar: 'OPENROUTER_API_KEY',
|
|
9
|
+
// Namespaced upstream, plain here: the model id is what the application
|
|
10
|
+
// and the catalogue use, and `model` is the upstream's own name. Keeping
|
|
11
|
+
// the slash out of the key also keeps it out of URLs and log lines.
|
|
12
|
+
modelName: 'claude-haiku-4-5-openrouter',
|
|
13
|
+
gatewayProvider: 'openrouter',
|
|
14
|
+
upstreamModel: 'anthropic/claude-haiku-4.5',
|
|
15
|
+
embeddings: {
|
|
16
|
+
modelName: 'text-embedding-3-small-openrouter',
|
|
17
|
+
upstreamModel: 'openai/text-embedding-3-small',
|
|
18
|
+
vectorSize: 1536,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
scaleway: {
|
|
22
|
+
label: 'Scaleway (EU infrastructure)',
|
|
23
|
+
apiKeyEnvVar: 'SCW_API_KEY',
|
|
24
|
+
baseUrl: {
|
|
25
|
+
envVar: 'SCW_API_BASE',
|
|
26
|
+
prompt: 'Paste your Scaleway Generative APIs base URL (https://api.scaleway.ai/<project-id>/v1)',
|
|
27
|
+
},
|
|
28
|
+
// The set Ragen's own demo runs. Both ids already exist in the shipped
|
|
29
|
+
// route table under `connection: scaleway`, so this writes the same routes
|
|
30
|
+
// the repository ships rather than inventing names.
|
|
31
|
+
modelName: 'mistral-small-3.2',
|
|
32
|
+
gatewayProvider: 'openai-compatible',
|
|
33
|
+
connection: 'scaleway',
|
|
34
|
+
upstreamModel: 'mistral-small-3.2-24b-instruct-2506',
|
|
35
|
+
embeddings: {
|
|
36
|
+
modelName: 'bge-multilingual-gemma2',
|
|
37
|
+
upstreamModel: 'bge-multilingual-gemma2',
|
|
38
|
+
// 3584 is `DEFAULT_VECTOR_SIZE` in rag-core, and it is this model's.
|
|
39
|
+
// The one Scaleway choice that needs no VECTOR_SIZE override — every
|
|
40
|
+
// other provider here does, and getting it wrong makes Qdrant reject
|
|
41
|
+
// every upsert rather than degrade.
|
|
42
|
+
vectorSize: 3584,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
6
45
|
openai: {
|
|
7
46
|
label: 'OpenAI',
|
|
8
47
|
apiKeyEnvVar: 'OPENAI_API_KEY',
|
|
9
48
|
modelName: 'gpt-4o-mini',
|
|
10
|
-
litellmModel: 'openai/gpt-4o-mini',
|
|
11
49
|
gatewayProvider: 'openai',
|
|
12
50
|
upstreamModel: 'gpt-4o-mini',
|
|
13
51
|
embeddings: {
|
|
14
52
|
modelName: 'text-embedding-3-small',
|
|
15
|
-
litellmModel: 'openai/text-embedding-3-small',
|
|
16
53
|
upstreamModel: 'text-embedding-3-small',
|
|
17
54
|
vectorSize: 1536,
|
|
18
55
|
},
|
|
@@ -21,12 +58,11 @@ exports.LLM_PROVIDERS = {
|
|
|
21
58
|
label: 'Anthropic',
|
|
22
59
|
apiKeyEnvVar: 'ANTHROPIC_API_KEY',
|
|
23
60
|
// Not "claude-haiku-4-5" — packages/platform-contracts/src/llm/model-catalog.ts
|
|
24
|
-
// already uses that name for the
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
61
|
+
// already uses that name for the Bedrock deployment of the same model, and
|
|
62
|
+
// the route table is a map: a second entry under that key would silently
|
|
63
|
+
// replace the first, so a scaffolded install would take over a catalogue
|
|
64
|
+
// name it does not own and serve it from a different account.
|
|
28
65
|
modelName: 'claude-haiku-4-5-direct',
|
|
29
|
-
litellmModel: 'anthropic/claude-haiku-4-5-20251001',
|
|
30
66
|
gatewayProvider: 'anthropic',
|
|
31
67
|
upstreamModel: 'claude-haiku-4-5-20251001',
|
|
32
68
|
// Anthropic ships no embeddings endpoint, so there is nothing to point
|
|
@@ -36,16 +72,14 @@ exports.LLM_PROVIDERS = {
|
|
|
36
72
|
// EmbeddingsUnsupportedError rather than failing inside the AI SDK.
|
|
37
73
|
},
|
|
38
74
|
};
|
|
39
|
-
function resolveLlmProviderChoice(choice, apiKey) {
|
|
75
|
+
function resolveLlmProviderChoice(choice, apiKey, baseUrl) {
|
|
40
76
|
const config = exports.LLM_PROVIDERS[choice];
|
|
41
77
|
const envUpdates = {
|
|
42
78
|
[config.apiKeyEnvVar]: apiKey,
|
|
79
|
+
...(config.baseUrl && baseUrl ? { [config.baseUrl.envVar]: baseUrl } : {}),
|
|
43
80
|
DEFAULT_MODEL: config.modelName,
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
LLM_GATEWAY: 'native',
|
|
47
|
-
// Not the gateway. This names the pricing namespace `AiUsage` writes
|
|
48
|
-
// against, where the whole catalogue lives under `litellm`; the provider
|
|
81
|
+
// The pricing namespace `AiUsage` writes against, where the whole
|
|
82
|
+
// catalogue lives under `litellm` — not a gateway any more. The provider
|
|
49
83
|
// that actually served a turn is recorded separately as `servedBy`.
|
|
50
84
|
DEFAULT_MODEL_PROVIDER: 'litellm',
|
|
51
85
|
// .env.example ships gemini-2.5-flash here, which needs Vertex
|
|
@@ -54,21 +88,15 @@ function resolveLlmProviderChoice(choice, apiKey) {
|
|
|
54
88
|
// model the user just configured is ever reached.
|
|
55
89
|
REPHRASE_MODEL: config.modelName,
|
|
56
90
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
model: config.litellmModel,
|
|
61
|
-
apiKeyEnvVar: config.apiKeyEnvVar,
|
|
62
|
-
},
|
|
63
|
-
];
|
|
64
|
-
// Written as well as the route table, and deliberately: `docker compose up`
|
|
65
|
-
// starts LiteLLM whatever `LLM_GATEWAY` says, so configuring both makes
|
|
66
|
-
// `LLM_GATEWAY=litellm` a working rollback rather than a broken one.
|
|
91
|
+
// The route table is the whole configuration now. There is no second place
|
|
92
|
+
// to keep in step and no flag to roll back to — #1194 removed the proxy path
|
|
93
|
+
// and the variable that chose it.
|
|
67
94
|
const routes = [
|
|
68
95
|
{
|
|
69
96
|
modelName: config.modelName,
|
|
70
97
|
provider: config.gatewayProvider,
|
|
71
98
|
model: config.upstreamModel,
|
|
99
|
+
...(config.connection ? { connection: config.connection } : {}),
|
|
72
100
|
},
|
|
73
101
|
];
|
|
74
102
|
if (config.embeddings) {
|
|
@@ -77,20 +105,15 @@ function resolveLlmProviderChoice(choice, apiKey) {
|
|
|
77
105
|
// upsert — rag-core's vector contract says so, and its default (3584)
|
|
78
106
|
// belongs to the Scaleway model being replaced here.
|
|
79
107
|
envUpdates.VECTOR_SIZE = String(config.embeddings.vectorSize);
|
|
80
|
-
liteLLMEntries.push({
|
|
81
|
-
modelName: config.embeddings.modelName,
|
|
82
|
-
model: config.embeddings.litellmModel,
|
|
83
|
-
apiKeyEnvVar: config.apiKeyEnvVar,
|
|
84
|
-
});
|
|
85
108
|
routes.push({
|
|
86
109
|
modelName: config.embeddings.modelName,
|
|
87
110
|
provider: config.gatewayProvider,
|
|
88
111
|
model: config.embeddings.upstreamModel,
|
|
112
|
+
...(config.connection ? { connection: config.connection } : {}),
|
|
89
113
|
});
|
|
90
114
|
}
|
|
91
115
|
return {
|
|
92
116
|
envUpdates,
|
|
93
|
-
liteLLMEntries,
|
|
94
117
|
routes,
|
|
95
118
|
embeddingsConfigured: Boolean(config.embeddings),
|
|
96
119
|
};
|
package/dist/llm-provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-provider.js","sourceRoot":"","sources":["../src/llm-provider.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"llm-provider.js","sourceRoot":"","sources":["../src/llm-provider.ts"],"names":[],"mappings":";;;AAoJA,4DAqDC;AAxIY,QAAA,aAAa,GAAiD;IACzE,UAAU,EAAE;QACV,KAAK,EAAE,mCAAmC;QAC1C,YAAY,EAAE,oBAAoB;QAClC,wEAAwE;QACxE,yEAAyE;QAC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ChC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,aAAa;YACtC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChE,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,UAAU;QACV,MAAM;QACN,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;KACjD,CAAC;AACJ,CAAC"}
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,EAqDnC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,aAAa,EAAE,CAEnE"}
|
package/dist/manifest.js
CHANGED
|
@@ -63,40 +63,6 @@ exports.MANIFEST = [
|
|
|
63
63
|
targets: ['root', 'admin'],
|
|
64
64
|
},
|
|
65
65
|
// --- Local-dev defaults that correct a stale example value ---
|
|
66
|
-
{
|
|
67
|
-
// The baseline, and `resolveLlmProviderChoice` overrides it with `native`
|
|
68
|
-
// whenever a provider key is actually configured — which is both branches
|
|
69
|
-
// the wizard offers.
|
|
70
|
-
//
|
|
71
|
-
// What is left is the third path: "I'll configure LiteLLM myself". That
|
|
72
|
-
// one writes no route table, and the table shipped in the repository names
|
|
73
|
-
// Azure, Bedrock, Vertex and Scaleway — providers a fresh install has no
|
|
74
|
-
// credentials for. Inheriting the `native` default there would make every
|
|
75
|
-
// model call fail on the first question, so this pins the proxy the manual
|
|
76
|
-
// guide then tells them to configure.
|
|
77
|
-
key: 'LLM_GATEWAY',
|
|
78
|
-
strategy: 'local-default',
|
|
79
|
-
targets: ['root'],
|
|
80
|
-
value: 'litellm',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
// Ships commented out, which leaves apps/web sending no Authorization
|
|
84
|
-
// header while docker-compose.yml starts the proxy *with* a master key
|
|
85
|
-
// (`${LITELLM_MASTER_KEY:-sk-litellm-dev-key}`) — so every call to the
|
|
86
|
-
// proxy came back 401 and the model picker silently fell back to a
|
|
87
|
-
// static list.
|
|
88
|
-
//
|
|
89
|
-
// This is deliberately the same literal as the compose default rather
|
|
90
|
-
// than a generated secret: Compose interpolates `${LITELLM_MASTER_KEY}`
|
|
91
|
-
// from the shell or a root `.env`, and never from `.env.local`. A
|
|
92
|
-
// generated value here would land in the app and not in the container,
|
|
93
|
-
// which is the 401 again with a harder-to-see cause. It is a local-dev
|
|
94
|
-
// credential on a loopback port; a deployed install sets its own.
|
|
95
|
-
key: 'LITELLM_MASTER_KEY',
|
|
96
|
-
strategy: 'local-default',
|
|
97
|
-
targets: ['root'],
|
|
98
|
-
value: 'sk-litellm-dev-key',
|
|
99
|
-
},
|
|
100
66
|
{
|
|
101
67
|
// docker-compose.yml maps Postgres to host port 55432. A native or other
|
|
102
68
|
// Postgres on 5432 would otherwise silently answer instead of the
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AA0EH,4CAEC;AAzDY,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,kEAAkE;QAClE,gEAAgE;QAChE,wEAAwE;QACxE,6EAA6E;QAC7E,0CAA0C;QAC1C,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manual-setup.d.ts","sourceRoot":"","sources":["../src/manual-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manual-setup.d.ts","sourceRoot":"","sources":["../src/manual-setup.ts"],"names":[],"mappings":"AAkIA,wBAAgB,0BAA0B,IAAI,MAAM,CAsCnD"}
|
package/dist/manual-setup.js
CHANGED
|
@@ -16,28 +16,31 @@ function providerSection(choice) {
|
|
|
16
16
|
const config = llm_provider_1.LLM_PROVIDERS[choice];
|
|
17
17
|
const envLines = [
|
|
18
18
|
`${config.apiKeyEnvVar}=<your ${config.label} key>`,
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
|
|
19
|
+
// A provider whose endpoint is per-project needs its base URL named here
|
|
20
|
+
// too, or the key reaches nothing. Scaleway is the one that does.
|
|
21
|
+
...(config.baseUrl
|
|
22
|
+
? [`${config.baseUrl.envVar}=<https://api.scaleway.ai/<project-id>/v1>`]
|
|
23
|
+
: []),
|
|
24
|
+
// Not a gateway selector: `litellm` is the pricing namespace `AiUsage`
|
|
25
|
+
// writes against, and the provider that actually served a turn is recorded
|
|
26
|
+
// separately as `servedBy`. The flag that used to sit here went with the
|
|
27
|
+
// proxy in #1194.
|
|
22
28
|
'DEFAULT_MODEL_PROVIDER=litellm',
|
|
23
29
|
`DEFAULT_MODEL=${config.modelName}`,
|
|
24
30
|
`REPHRASE_MODEL=${config.modelName}`,
|
|
25
31
|
];
|
|
32
|
+
const connectionLine = config.connection
|
|
33
|
+
? [` connection: ${config.connection}`]
|
|
34
|
+
: [];
|
|
26
35
|
const routeLines = [
|
|
27
36
|
` ${config.modelName}:`,
|
|
28
37
|
` provider: ${config.gatewayProvider}`,
|
|
38
|
+
...connectionLine,
|
|
29
39
|
` model: ${config.upstreamModel}`,
|
|
30
40
|
];
|
|
31
|
-
const yamlLines = [
|
|
32
|
-
` - model_name: ${config.modelName}`,
|
|
33
|
-
' litellm_params:',
|
|
34
|
-
` model: ${config.litellmModel}`,
|
|
35
|
-
` api_key: os.environ/${config.apiKeyEnvVar}`,
|
|
36
|
-
];
|
|
37
41
|
if (config.embeddings) {
|
|
38
42
|
envLines.push(`EMBEDDINGS_MODEL=${config.embeddings.modelName}`, `VECTOR_SIZE=${config.embeddings.vectorSize}`);
|
|
39
|
-
|
|
40
|
-
routeLines.push(` ${config.embeddings.modelName}:`, ` provider: ${config.gatewayProvider}`, ` model: ${config.embeddings.upstreamModel}`);
|
|
43
|
+
routeLines.push(` ${config.embeddings.modelName}:`, ` provider: ${config.gatewayProvider}`, ...connectionLine, ` model: ${config.embeddings.upstreamModel}`);
|
|
41
44
|
}
|
|
42
45
|
return [
|
|
43
46
|
`### ${config.label}`,
|
|
@@ -58,19 +61,6 @@ function providerSection(choice) {
|
|
|
58
61
|
'The table shipped in the repository routes to Azure, Bedrock, Vertex and',
|
|
59
62
|
'Scaleway. Those entries are not wrong, they are simply not yours.',
|
|
60
63
|
'',
|
|
61
|
-
`<details><summary>Prefer to run a proxy instead?</summary>`,
|
|
62
|
-
'',
|
|
63
|
-
'Set `LLM_GATEWAY=litellm` rather than `native`, leave the route table',
|
|
64
|
-
'alone, and add this under the existing `model_list:` key in',
|
|
65
|
-
'`infra/litellm/config.yaml`:',
|
|
66
|
-
'',
|
|
67
|
-
'```yaml',
|
|
68
|
-
...yamlLines,
|
|
69
|
-
'```',
|
|
70
|
-
'',
|
|
71
|
-
'Then `docker compose restart litellm`.',
|
|
72
|
-
'',
|
|
73
|
-
'</details>',
|
|
74
64
|
...(config.embeddings ? [] : secondProviderForEmbeddings(config.label)),
|
|
75
65
|
'',
|
|
76
66
|
];
|
|
@@ -134,6 +124,8 @@ function manualLlmSetupInstructions() {
|
|
|
134
124
|
'`.env.local` and the route table. Pick one provider, apply both edits,',
|
|
135
125
|
'and restart the apps.',
|
|
136
126
|
'',
|
|
127
|
+
...providerSection('openrouter'),
|
|
128
|
+
...providerSection('scaleway'),
|
|
137
129
|
...providerSection('openai'),
|
|
138
130
|
...providerSection('anthropic'),
|
|
139
131
|
'## Before you upload anything',
|
package/dist/manual-setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manual-setup.js","sourceRoot":"","sources":["../src/manual-setup.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"manual-setup.js","sourceRoot":"","sources":["../src/manual-setup.ts"],"names":[],"mappings":";;AAkIA,gEAsCC;AAxKD,iDAAuE;AAEvE;;;;;;;;GAQG;AAEH,MAAM,iBAAiB,GAAG,yCAAyC,CAAC;AAEpE,SAAS,eAAe,CAAC,MAAyB;IAChD,MAAM,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Ae,CAAC,YAAY,CAAC;QAChC,GAAG,eAAe,CAAC,UAAU,CAAC;QAC9B,GAAG,eAAe,CAAC,QAAQ,CAAC;QAC5B,GAAG,eAAe,CAAC,WAAW,CAAC;QAC/B,+BAA+B;QAC/B,EAAE;QACF,mEAAmE;QACnE,yEAAyE;QACzE,qEAAqE;QACrE,yBAAyB;QACzB,EAAE;QACF,oBAAoB;QACpB,EAAE;QACF,iEAAiE;QACjE,EAAE;QACF,SAAS;QACT,sCAAsC;QACtC,KAAK;QACL,EAAE;QACF,mEAAmE;QACnE,4DAA4D;QAC5D,EAAE;QACF,oEAAoE;QACpE,iCAAiC,iBAAiB,GAAG;QACrD,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PII masking, which is off unless an install asks for it.
|
|
3
|
+
*
|
|
4
|
+
* Presidio is two containers behind compose's `pii` profile, and the analyzer
|
|
5
|
+
* alone is the largest single memory consumer in the stack — 959 MB idle,
|
|
6
|
+
* more than Docling. So "everyone gets it" would nearly double the machine a
|
|
7
|
+
* trial install needs, for a feature most evaluations do not exercise.
|
|
8
|
+
*
|
|
9
|
+
* **Availability follows the two URLs**, not a flag: `@ragenai/env`'s
|
|
10
|
+
* `isPiiMaskingConfigured()` reads them, and `FEATURE_FLAG_PII_MASKING=1` no
|
|
11
|
+
* longer turns anything on. So declining writes nothing and masking is off by
|
|
12
|
+
* construction — there is no "enabled but unconfigured" state for this wizard
|
|
13
|
+
* to create.
|
|
14
|
+
*/
|
|
15
|
+
export declare const PRESIDIO_ANALYZER_URL = "http://localhost:5002";
|
|
16
|
+
export declare const PRESIDIO_ANONYMIZER_URL = "http://localhost:5003";
|
|
17
|
+
/** The compose profile the two services sit behind. */
|
|
18
|
+
export declare const PII_COMPOSE_PROFILE = "pii";
|
|
19
|
+
export interface PiiMaskingSelection {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
envUpdates: Record<string, string>;
|
|
22
|
+
/** Passed to `docker compose --profile …`, so choosing it starts it. */
|
|
23
|
+
composeProfiles: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare function resolvePiiMaskingSelection(enabled: boolean): PiiMaskingSelection;
|
|
26
|
+
//# sourceMappingURL=pii-masking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pii-masking.d.ts","sourceRoot":"","sources":["../src/pii-masking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAC7D,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAE/D,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,wEAAwE;IACxE,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,GACf,mBAAmB,CAarB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* PII masking, which is off unless an install asks for it.
|
|
4
|
+
*
|
|
5
|
+
* Presidio is two containers behind compose's `pii` profile, and the analyzer
|
|
6
|
+
* alone is the largest single memory consumer in the stack — 959 MB idle,
|
|
7
|
+
* more than Docling. So "everyone gets it" would nearly double the machine a
|
|
8
|
+
* trial install needs, for a feature most evaluations do not exercise.
|
|
9
|
+
*
|
|
10
|
+
* **Availability follows the two URLs**, not a flag: `@ragenai/env`'s
|
|
11
|
+
* `isPiiMaskingConfigured()` reads them, and `FEATURE_FLAG_PII_MASKING=1` no
|
|
12
|
+
* longer turns anything on. So declining writes nothing and masking is off by
|
|
13
|
+
* construction — there is no "enabled but unconfigured" state for this wizard
|
|
14
|
+
* to create.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.PII_COMPOSE_PROFILE = exports.PRESIDIO_ANONYMIZER_URL = exports.PRESIDIO_ANALYZER_URL = void 0;
|
|
18
|
+
exports.resolvePiiMaskingSelection = resolvePiiMaskingSelection;
|
|
19
|
+
exports.PRESIDIO_ANALYZER_URL = 'http://localhost:5002';
|
|
20
|
+
exports.PRESIDIO_ANONYMIZER_URL = 'http://localhost:5003';
|
|
21
|
+
/** The compose profile the two services sit behind. */
|
|
22
|
+
exports.PII_COMPOSE_PROFILE = 'pii';
|
|
23
|
+
function resolvePiiMaskingSelection(enabled) {
|
|
24
|
+
if (!enabled) {
|
|
25
|
+
return { enabled: false, envUpdates: {}, composeProfiles: [] };
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
enabled: true,
|
|
29
|
+
envUpdates: {
|
|
30
|
+
PRESIDIO_ANALYZER_URL: exports.PRESIDIO_ANALYZER_URL,
|
|
31
|
+
PRESIDIO_ANONYMIZER_URL: exports.PRESIDIO_ANONYMIZER_URL,
|
|
32
|
+
},
|
|
33
|
+
composeProfiles: [exports.PII_COMPOSE_PROFILE],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=pii-masking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pii-masking.js","sourceRoot":"","sources":["../src/pii-masking.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAeH,gEAeC;AA5BY,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAChD,QAAA,uBAAuB,GAAG,uBAAuB,CAAC;AAE/D,uDAAuD;AAC1C,QAAA,mBAAmB,GAAG,KAAK,CAAC;AASzC,SAAgB,0BAA0B,CACxC,OAAgB;IAEhB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC;IACjE,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV,qBAAqB,EAArB,6BAAqB;YACrB,uBAAuB,EAAvB,+BAAuB;SACxB;QACD,eAAe,EAAE,CAAC,2BAAmB,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
package/dist/route-table.d.ts
CHANGED
|
@@ -7,14 +7,22 @@ export interface RouteTableEntry {
|
|
|
7
7
|
provider: string;
|
|
8
8
|
/** The upstream's own name for the model, which may differ from the id. */
|
|
9
9
|
model: string;
|
|
10
|
+
/**
|
|
11
|
+
* Which credentials an `openai-compatible` route uses, and therefore which
|
|
12
|
+
* `LLM_<NAME>_*` variables it reads. Omitted for providers with one upstream.
|
|
13
|
+
* An `openai-compatible` route is not optional about it: resolving one with
|
|
14
|
+
* no connection throws `MissingCredentialsError` naming "a `connection` on
|
|
15
|
+
* the route", before any `LLM_*` variable is read. So omitting it scaffolds
|
|
16
|
+
* an install that refuses to serve the model at all, rather than one that
|
|
17
|
+
* reaches the wrong upstream.
|
|
18
|
+
*/
|
|
19
|
+
connection?: string;
|
|
10
20
|
}
|
|
11
21
|
/**
|
|
12
22
|
* The route table for a scaffolded installation.
|
|
13
23
|
*
|
|
14
|
-
* Written **over** the table shipped in the repository rather than beside it
|
|
15
|
-
*
|
|
16
|
-
* `infra/litellm/config.yaml`. Two reasons, and the second is the one that
|
|
17
|
-
* decides it:
|
|
24
|
+
* Written **over** the table shipped in the repository rather than beside it.
|
|
25
|
+
* Two reasons, and the second is the one that decides it:
|
|
18
26
|
*
|
|
19
27
|
* - The shipped table names Azure, Bedrock, Vertex and Scaleway. A new
|
|
20
28
|
* installation has credentials for none of them, so every entry in it is a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-table.d.ts","sourceRoot":"","sources":["../src/route-table.ts"],"names":[],"mappings":"AAGA,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,kCAAkC,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"route-table.d.ts","sourceRoot":"","sources":["../src/route-table.ts"],"names":[],"mappings":"AAGA,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,kCAAkC,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CA2B5E;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,IAAI,CAEN"}
|
package/dist/route-table.js
CHANGED
|
@@ -10,10 +10,8 @@ exports.ROUTE_TABLE_PATH = 'infra/llm-gateway/routes.yaml';
|
|
|
10
10
|
/**
|
|
11
11
|
* The route table for a scaffolded installation.
|
|
12
12
|
*
|
|
13
|
-
* Written **over** the table shipped in the repository rather than beside it
|
|
14
|
-
*
|
|
15
|
-
* `infra/litellm/config.yaml`. Two reasons, and the second is the one that
|
|
16
|
-
* decides it:
|
|
13
|
+
* Written **over** the table shipped in the repository rather than beside it.
|
|
14
|
+
* Two reasons, and the second is the one that decides it:
|
|
17
15
|
*
|
|
18
16
|
* - The shipped table names Azure, Bedrock, Vertex and Scaleway. A new
|
|
19
17
|
* installation has credentials for none of them, so every entry in it is a
|
|
@@ -27,12 +25,14 @@ exports.ROUTE_TABLE_PATH = 'infra/llm-gateway/routes.yaml';
|
|
|
27
25
|
*/
|
|
28
26
|
function renderRouteTable(entries) {
|
|
29
27
|
const routes = entries
|
|
30
|
-
.map(({ modelName, provider, model }) => ` ${modelName}:\n provider: ${provider}\n
|
|
28
|
+
.map(({ modelName, provider, model, connection }) => ` ${modelName}:\n provider: ${provider}\n` +
|
|
29
|
+
(connection ? ` connection: ${connection}\n` : '') +
|
|
30
|
+
` model: ${model}\n`)
|
|
31
31
|
.join('');
|
|
32
32
|
return `# Written by create-ragen-app for this installation.
|
|
33
33
|
#
|
|
34
34
|
# Which upstream serves each model id the application asks for. Ragen calls
|
|
35
|
-
# these providers itself
|
|
35
|
+
# these providers itself, with no proxy in the path.
|
|
36
36
|
#
|
|
37
37
|
# This replaced the table shipped in the repository, which routes to Azure,
|
|
38
38
|
# Bedrock, Vertex and Scaleway. Those entries are not wrong, they are simply
|
package/dist/route-table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-table.js","sourceRoot":"","sources":["../src/route-table.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"route-table.js","sourceRoot":"","sources":["../src/route-table.ts"],"names":[],"mappings":";;;AAyCA,4CA2BC;AAED,0CAKC;AA3ED,qCAAwC;AACxC,yCAAiC;AAEjC,iFAAiF;AACpE,QAAA,gBAAgB,GAAG,+BAA+B,CAAC;AAqBhE;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,gBAAgB,CAAC,OAAmC;IAClE,MAAM,MAAM,GAAG,OAAO;SACnB,GAAG,CACF,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,CAC7C,KAAK,SAAS,oBAAoB,QAAQ,IAAI;QAC9C,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,cAAc,KAAK,IAAI,CAC1B;SACA,IAAI,CAAC,EAAE,CAAC,CAAC;IAEZ,OAAO;;;;;;;;;;;;;;;;EAgBP,MAAM,EAAE,CAAC;AACX,CAAC;AAED,SAAgB,eAAe,CAC7B,SAAiB,EACjB,OAAmC;IAEnC,IAAA,uBAAa,EAAC,IAAA,gBAAI,EAAC,SAAS,EAAE,wBAAgB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/tasks.d.ts
CHANGED
|
@@ -29,7 +29,16 @@ export declare function isDockerAvailable(): Promise<boolean>;
|
|
|
29
29
|
* machine is clear, and collide with it.
|
|
30
30
|
*/
|
|
31
31
|
export declare function ragenStackVolumeExists(): Promise<boolean>;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* `profiles` names compose profiles to add to the default set.
|
|
34
|
+
*
|
|
35
|
+
* Without it, choosing PII masking would write the two Presidio URLs and start
|
|
36
|
+
* nothing behind them: those services sit behind compose's `pii` profile, so a
|
|
37
|
+
* plain `up -d` skips them and the app would point at containers nobody ran.
|
|
38
|
+
*/
|
|
39
|
+
export declare function startDockerServices({ cwd, profiles, }: RunOptions & {
|
|
40
|
+
profiles?: string[];
|
|
41
|
+
}): Promise<void>;
|
|
33
42
|
export declare function installDependencies({ cwd }: RunOptions): Promise<void>;
|
|
34
43
|
export declare function generatePrismaClient({ cwd, env, }: RunOptions): Promise<void>;
|
|
35
44
|
export declare function seedDatabase({ cwd, env }: RunOptions): Promise<void>;
|
package/dist/tasks.d.ts.map
CHANGED
|
@@ -1 +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,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E,OAAW,EAAE,YAAmB,EAAE,GAAE,cAAmB,GACxD,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|
package/dist/tasks.js
CHANGED
|
@@ -47,8 +47,19 @@ async function ragenStackVolumeExists() {
|
|
|
47
47
|
return false;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
/**
|
|
51
|
+
* `profiles` names compose profiles to add to the default set.
|
|
52
|
+
*
|
|
53
|
+
* Without it, choosing PII masking would write the two Presidio URLs and start
|
|
54
|
+
* nothing behind them: those services sit behind compose's `pii` profile, so a
|
|
55
|
+
* plain `up -d` skips them and the app would point at containers nobody ran.
|
|
56
|
+
*/
|
|
57
|
+
async function startDockerServices({ cwd, profiles = [], }) {
|
|
58
|
+
const args = profiles.flatMap((profile) => ['--profile', profile]);
|
|
59
|
+
await (0, execa_1.execa)('docker', ['compose', ...args, 'up', '-d'], {
|
|
60
|
+
cwd,
|
|
61
|
+
stdio: 'inherit',
|
|
62
|
+
});
|
|
52
63
|
}
|
|
53
64
|
async function installDependencies({ cwd }) {
|
|
54
65
|
await (0, execa_1.execa)('npm', ['install'], { cwd, stdio: 'inherit' });
|
package/dist/tasks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":";;AAmBA,8CAUC;AAgBD,wDAgBC;
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":";;AAmBA,8CAUC;AAgBD,wDAgBC;AASD,kDASC;AAED,kDAEC;AAED,oDAKC;AAED,oCAEC;AAOD,0CAyBC;AA9HD,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,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