create-ragen-app 0.6.1 → 0.7.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 +41 -9
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +240 -42
- package/dist/cli.js.map +1 -1
- package/dist/config-template.d.ts.map +1 -1
- package/dist/config-template.js +15 -3
- package/dist/config-template.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/llm-provider.d.ts +2 -0
- package/dist/llm-provider.d.ts.map +1 -1
- package/dist/llm-provider.js +4 -0
- package/dist/llm-provider.js.map +1 -1
- package/dist/manual-setup.d.ts.map +1 -1
- package/dist/manual-setup.js +1 -0
- package/dist/manual-setup.js.map +1 -1
- package/dist/node-version.d.ts +71 -11
- package/dist/node-version.d.ts.map +1 -1
- package/dist/node-version.js +155 -19
- package/dist/node-version.js.map +1 -1
- package/dist/route-table.d.ts +7 -0
- package/dist/route-table.d.ts.map +1 -1
- package/dist/route-table.js +3 -2
- package/dist/route-table.js.map +1 -1
- package/dist/secrets.d.ts +17 -0
- package/dist/secrets.d.ts.map +1 -1
- package/dist/secrets.js +23 -0
- package/dist/secrets.js.map +1 -1
- package/dist/storage-provider.d.ts +88 -3
- package/dist/storage-provider.d.ts.map +1 -1
- package/dist/storage-provider.js +138 -4
- package/dist/storage-provider.js.map +1 -1
- package/dist/tasks.d.ts +138 -11
- package/dist/tasks.d.ts.map +1 -1
- package/dist/tasks.js +196 -19
- package/dist/tasks.js.map +1 -1
- package/package.json +3 -3
package/dist/llm-provider.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export interface LlmProviderConfig {
|
|
|
39
39
|
gatewayProvider: string;
|
|
40
40
|
/** Passed through to the route, for an `openai-compatible` upstream. */
|
|
41
41
|
connection?: string;
|
|
42
|
+
/** The chat route's upstream takes a JSON Schema response format. */
|
|
43
|
+
structuredOutputs?: boolean;
|
|
42
44
|
/**
|
|
43
45
|
* A second value the provider cannot work without, asked for after the key.
|
|
44
46
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-provider.d.ts","sourceRoot":"","sources":["../src/llm-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,iBAAiB,GAC3B,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"llm-provider.d.ts","sourceRoot":"","sources":["../src/llm-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,iBAAiB,GAC3B,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,CAyEtE,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;;OAGG;IACH,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,iFAAiF;IACjF,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,uBAAuB,CAkDzB"}
|
package/dist/llm-provider.js
CHANGED
|
@@ -31,6 +31,9 @@ exports.LLM_PROVIDERS = {
|
|
|
31
31
|
modelName: 'mistral-small-3.2',
|
|
32
32
|
gatewayProvider: 'openai-compatible',
|
|
33
33
|
connection: 'scaleway',
|
|
34
|
+
// Scaleway serves a JSON Schema response format for this model; without
|
|
35
|
+
// the flag every Brain extraction failed validation on the demo.
|
|
36
|
+
structuredOutputs: true,
|
|
34
37
|
upstreamModel: 'mistral-small-3.2-24b-instruct-2506',
|
|
35
38
|
embeddings: {
|
|
36
39
|
modelName: 'bge-multilingual-gemma2',
|
|
@@ -97,6 +100,7 @@ function resolveLlmProviderChoice(choice, apiKey, baseUrl) {
|
|
|
97
100
|
provider: config.gatewayProvider,
|
|
98
101
|
model: config.upstreamModel,
|
|
99
102
|
...(config.connection ? { connection: config.connection } : {}),
|
|
103
|
+
...(config.structuredOutputs ? { structuredOutputs: true } : {}),
|
|
100
104
|
},
|
|
101
105
|
];
|
|
102
106
|
if (config.embeddings) {
|
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":";;;AAyJA,4DAsDC;AA5IY,QAAA,aAAa,GAAiD;IACzE,UAAU,EAAE;QACV,KAAK,EAAE,mCAAmC;QAC1C,YAAY,EAAE,oBAAoB;QAClC,wEAAwE;QACxE,yEAAyE;QACzE,oEAAoE;QACpE,SAAS,EAAE,6BAA6B;QACxC,eAAe,EAAE,YAAY;QAC7B,aAAa,EAAE,4BAA4B;QAC3C,UAAU,EAAE;YACV,SAAS,EAAE,mCAAmC;YAC9C,aAAa,EAAE,+BAA+B;YAC9C,UAAU,EAAE,IAAI;SACjB;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,8BAA8B;QACrC,YAAY,EAAE,aAAa;QAC3B,OAAO,EAAE;YACP,MAAM,EAAE,cAAc;YACtB,MAAM,EACJ,wFAAwF;SAC3F;QACD,uEAAuE;QACvE,2EAA2E;QAC3E,oDAAoD;QACpD,SAAS,EAAE,mBAAmB;QAC9B,eAAe,EAAE,mBAAmB;QACpC,UAAU,EAAE,UAAU;QACtB,wEAAwE;QACxE,iEAAiE;QACjE,iBAAiB,EAAE,IAAI;QACvB,aA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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":"AAmIA,wBAAgB,0BAA0B,IAAI,MAAM,CAsCnD"}
|
package/dist/manual-setup.js
CHANGED
|
@@ -37,6 +37,7 @@ function providerSection(choice) {
|
|
|
37
37
|
` provider: ${config.gatewayProvider}`,
|
|
38
38
|
...connectionLine,
|
|
39
39
|
` model: ${config.upstreamModel}`,
|
|
40
|
+
...(config.structuredOutputs ? [' structuredOutputs: true'] : []),
|
|
40
41
|
];
|
|
41
42
|
if (config.embeddings) {
|
|
42
43
|
envLines.push(`EMBEDDINGS_MODEL=${config.embeddings.modelName}`, `VECTOR_SIZE=${config.embeddings.vectorSize}`);
|
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":";;AAmIA,gEAsCC;AAzKD,iDAAuE;AAEvE;;;;;;;;GAQG;AAEH,MAAM,iBAAiB,GAAG,yCAAyC,CAAC;AAEpE,SAAS,eAAe,CAAC,MAAyB;IAChD,MAAM,MAAM,GAAG,4BAAa,CAAC,MAAM,CAAC,CAAC;IAErC,MAAM,QAAQ,GAAG;QACf,GAAG,MAAM,CAAC,YAAY,UAAU,MAAM,CAAC,KAAK,OAAO;QACnD,yEAAyE;QACzE,kEAAkE;QAClE,GAAG,CAAC,MAAM,CAAC,OAAO;YAChB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,4CAA4C,CAAC;YACxE,CAAC,CAAC,EAAE,CAAC;QACP,uEAAuE;QACvE,2EAA2E;QAC3E,yEAAyE;QACzE,kBAAkB;QAClB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AE;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"}
|
package/dist/node-version.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Whether this Node can be used to create a Ragen installation.
|
|
3
3
|
*
|
|
4
|
-
* The distinction that matters: **the installation** needs Node
|
|
5
|
-
* CLI. The CLI itself runs happily on older majors — it was published and
|
|
4
|
+
* The distinction that matters: **the installation** needs a recent Node, not
|
|
5
|
+
* this CLI. The CLI itself runs happily on older majors — it was published and
|
|
6
6
|
* verified on Node 22 by accident — so refusing on the grounds that "this
|
|
7
7
|
* tool requires Node 24" would be both untrue and unhelpfully broad.
|
|
8
8
|
*
|
|
@@ -18,17 +18,52 @@
|
|
|
18
18
|
*
|
|
19
19
|
* - running the setup steps → refuse, before anything is cloned
|
|
20
20
|
* - `--skip-install` → proceed, because nothing runs here; warn instead,
|
|
21
|
-
* since the scaffolded app still needs Node
|
|
21
|
+
* since the scaffolded app still needs a supported Node to start
|
|
22
22
|
*
|
|
23
23
|
* `--yes` deliberately does not bypass it. That flag means "accept the
|
|
24
24
|
* defaults", not "ignore a requirement".
|
|
25
25
|
*/
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* What the install actually runs on — a set of ranges, not a floor, and both
|
|
28
|
+
* the patch digit and the gap are load-bearing.
|
|
29
|
+
*
|
|
30
|
+
* A bare major used to be enough, and stopped being enough when a transitive
|
|
31
|
+
* dependency narrowed its own range mid-line. `jsdom@30.0.1` requires
|
|
32
|
+
* `^22.22.2 || ^24.15.0 || >=26.0.0`, and the repository sets
|
|
33
|
+
* `engine-strict=true`, so npm *stops* on a mismatch rather than warning.
|
|
34
|
+
* Two consequences, and only the first was obvious:
|
|
35
|
+
*
|
|
36
|
+
* - **Node 24.0–24.14 fail `npm install`.** The old `>=24` check waved them
|
|
37
|
+
* through, so someone on 24.13 got a cloned tree, a written `.env.local`, a
|
|
38
|
+
* running docker compose, and then EBADENGINE.
|
|
39
|
+
* - **Node 25 fails too, and a floor cannot say that.** `>=24.15.0` accepts
|
|
40
|
+
* 25.x, which that range skips entirely. Odd-numbered Node lines are never
|
|
41
|
+
* LTS and libraries routinely omit them, so the gap is normal rather than an
|
|
42
|
+
* oversight — and a single minimum version cannot express it.
|
|
43
|
+
*
|
|
44
|
+
* Node 22 is inside jsdom's range and deliberately *not* here: the repository
|
|
45
|
+
* has required 24 since long before this, and widening support is a decision,
|
|
46
|
+
* not a consequence of a dependency's range.
|
|
47
|
+
*
|
|
48
|
+
* Kept in step with `engines.node` across the root and every workspace by
|
|
49
|
+
* `tests/architecture/the-node-floor-is-one-number.test.ts`, with this
|
|
50
|
+
* package's own `engines` by `src/__tests__/node-version.test.ts`, and proved
|
|
51
|
+
* against real Nodes by `.github/workflows/installer.yml`, which pins 24.14
|
|
52
|
+
* (must refuse), 25 (must refuse) and 24.15 (must scaffold).
|
|
53
|
+
*/
|
|
54
|
+
export declare const SUPPORTED_NODE_RANGES: readonly [{
|
|
55
|
+
readonly from: "24.15.0";
|
|
56
|
+
readonly belowMajor: 25;
|
|
57
|
+
}, {
|
|
58
|
+
readonly from: "26.0.0";
|
|
59
|
+
}];
|
|
60
|
+
/** The oldest Node the install accepts — the first range's start. */
|
|
61
|
+
export declare const REQUIRED_NODE_VERSION: "24.15.0";
|
|
62
|
+
/**
|
|
63
|
+
* The same thing in the notation `engines.node` uses, so one constant can be
|
|
64
|
+
* compared against twenty-one manifests instead of being retyped into them.
|
|
30
65
|
*/
|
|
31
|
-
export declare const
|
|
66
|
+
export declare const SUPPORTED_NODE_ENGINES_RANGE: string;
|
|
32
67
|
export type NodeVersionVerdict = {
|
|
33
68
|
kind: 'ok';
|
|
34
69
|
} | {
|
|
@@ -39,16 +74,41 @@ export type NodeVersionVerdict = {
|
|
|
39
74
|
message: string;
|
|
40
75
|
};
|
|
41
76
|
export interface NodeVersionCheck {
|
|
42
|
-
/** As `process.version` gives it, e.g. `
|
|
77
|
+
/** As `process.version` gives it, e.g. `v24.13.0`. */
|
|
43
78
|
version: string;
|
|
44
79
|
/** False when `--skip-install` means the wizard runs nothing itself. */
|
|
45
80
|
willRunSetup: boolean;
|
|
46
81
|
}
|
|
82
|
+
export interface NodeVersion {
|
|
83
|
+
major: number;
|
|
84
|
+
minor: number;
|
|
85
|
+
patch: number;
|
|
86
|
+
/**
|
|
87
|
+
* The `-nightly`/`-rc.1` tail, without its dash. Kept because dropping it
|
|
88
|
+
* would make a prerelease compare equal to the release it precedes, and
|
|
89
|
+
* semver puts it *below*: `24.15.0-nightly` does not satisfy `^24.15.0`.
|
|
90
|
+
* npm checks engines with `includePrerelease: true`, which changes which
|
|
91
|
+
* prereleases pass but not that one — so ignoring the tail would accept a
|
|
92
|
+
* Node whose `npm install` fails, which is this whole exercise again.
|
|
93
|
+
*/
|
|
94
|
+
prerelease?: string;
|
|
95
|
+
}
|
|
47
96
|
/**
|
|
48
97
|
* Returns undefined for anything that is not a recognisable Node version, so
|
|
49
|
-
* an unexpected format cannot be read as
|
|
50
|
-
* would have worked.
|
|
98
|
+
* an unexpected format cannot be read as unsupported and block an install that
|
|
99
|
+
* would have worked. A version missing its patch digit counts as unreadable
|
|
100
|
+
* for the same reason: guessing `.0` would refuse a release that may be fine.
|
|
101
|
+
*/
|
|
102
|
+
export declare function parseNodeVersion(version: string): NodeVersion | undefined;
|
|
103
|
+
export declare function formatNodeVersion({ major, minor, patch, prerelease, }: NodeVersion): string;
|
|
104
|
+
/**
|
|
105
|
+
* Whether a version falls inside any supported range.
|
|
106
|
+
*
|
|
107
|
+
* A range with `belowMajor` is closed at that major (`^24.15.0`); one without
|
|
108
|
+
* is open above (`>=26.0.0`). An unparseable range entry cannot happen — the
|
|
109
|
+
* table is a literal in this file — but it fails *open* if it ever does,
|
|
110
|
+
* matching `parseNodeVersion`.
|
|
51
111
|
*/
|
|
52
|
-
export declare function
|
|
112
|
+
export declare function isSupportedNodeVersion(version: NodeVersion): boolean;
|
|
53
113
|
export declare function checkNodeVersion({ version, willRunSetup, }: NodeVersionCheck): NodeVersionVerdict;
|
|
54
114
|
//# sourceMappingURL=node-version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-version.d.ts","sourceRoot":"","sources":["../src/node-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH
|
|
1
|
+
{"version":3,"file":"node-version.d.ts","sourceRoot":"","sources":["../src/node-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,qBAAqB;;;;;EAGxB,CAAC;AAEX,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,WAAgC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAE3B,CAAC;AAWf,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAazE;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAU,GACX,EAAE,WAAW,GAAG,MAAM,CAGtB;AAqBD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAWpE;AA6CD,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,YAAY,GACb,EAAE,gBAAgB,GAAG,kBAAkB,CA4CvC"}
|
package/dist/node-version.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Whether this Node can be used to create a Ragen installation.
|
|
4
4
|
*
|
|
5
|
-
* The distinction that matters: **the installation** needs Node
|
|
6
|
-
* CLI. The CLI itself runs happily on older majors — it was published and
|
|
5
|
+
* The distinction that matters: **the installation** needs a recent Node, not
|
|
6
|
+
* this CLI. The CLI itself runs happily on older majors — it was published and
|
|
7
7
|
* verified on Node 22 by accident — so refusing on the grounds that "this
|
|
8
8
|
* tool requires Node 24" would be both untrue and unhelpfully broad.
|
|
9
9
|
*
|
|
@@ -19,43 +19,172 @@
|
|
|
19
19
|
*
|
|
20
20
|
* - running the setup steps → refuse, before anything is cloned
|
|
21
21
|
* - `--skip-install` → proceed, because nothing runs here; warn instead,
|
|
22
|
-
* since the scaffolded app still needs Node
|
|
22
|
+
* since the scaffolded app still needs a supported Node to start
|
|
23
23
|
*
|
|
24
24
|
* `--yes` deliberately does not bypass it. That flag means "accept the
|
|
25
25
|
* defaults", not "ignore a requirement".
|
|
26
26
|
*/
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
28
|
+
exports.SUPPORTED_NODE_ENGINES_RANGE = exports.REQUIRED_NODE_VERSION = exports.SUPPORTED_NODE_RANGES = void 0;
|
|
29
|
+
exports.parseNodeVersion = parseNodeVersion;
|
|
30
|
+
exports.formatNodeVersion = formatNodeVersion;
|
|
31
|
+
exports.isSupportedNodeVersion = isSupportedNodeVersion;
|
|
30
32
|
exports.checkNodeVersion = checkNodeVersion;
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
34
|
+
* What the install actually runs on — a set of ranges, not a floor, and both
|
|
35
|
+
* the patch digit and the gap are load-bearing.
|
|
36
|
+
*
|
|
37
|
+
* A bare major used to be enough, and stopped being enough when a transitive
|
|
38
|
+
* dependency narrowed its own range mid-line. `jsdom@30.0.1` requires
|
|
39
|
+
* `^22.22.2 || ^24.15.0 || >=26.0.0`, and the repository sets
|
|
40
|
+
* `engine-strict=true`, so npm *stops* on a mismatch rather than warning.
|
|
41
|
+
* Two consequences, and only the first was obvious:
|
|
42
|
+
*
|
|
43
|
+
* - **Node 24.0–24.14 fail `npm install`.** The old `>=24` check waved them
|
|
44
|
+
* through, so someone on 24.13 got a cloned tree, a written `.env.local`, a
|
|
45
|
+
* running docker compose, and then EBADENGINE.
|
|
46
|
+
* - **Node 25 fails too, and a floor cannot say that.** `>=24.15.0` accepts
|
|
47
|
+
* 25.x, which that range skips entirely. Odd-numbered Node lines are never
|
|
48
|
+
* LTS and libraries routinely omit them, so the gap is normal rather than an
|
|
49
|
+
* oversight — and a single minimum version cannot express it.
|
|
50
|
+
*
|
|
51
|
+
* Node 22 is inside jsdom's range and deliberately *not* here: the repository
|
|
52
|
+
* has required 24 since long before this, and widening support is a decision,
|
|
53
|
+
* not a consequence of a dependency's range.
|
|
54
|
+
*
|
|
55
|
+
* Kept in step with `engines.node` across the root and every workspace by
|
|
56
|
+
* `tests/architecture/the-node-floor-is-one-number.test.ts`, with this
|
|
57
|
+
* package's own `engines` by `src/__tests__/node-version.test.ts`, and proved
|
|
58
|
+
* against real Nodes by `.github/workflows/installer.yml`, which pins 24.14
|
|
59
|
+
* (must refuse), 25 (must refuse) and 24.15 (must scaffold).
|
|
60
|
+
*/
|
|
61
|
+
exports.SUPPORTED_NODE_RANGES = [
|
|
62
|
+
{ from: '24.15.0', belowMajor: 25 },
|
|
63
|
+
{ from: '26.0.0' },
|
|
64
|
+
];
|
|
65
|
+
/** The oldest Node the install accepts — the first range's start. */
|
|
66
|
+
exports.REQUIRED_NODE_VERSION = exports.SUPPORTED_NODE_RANGES[0].from;
|
|
67
|
+
/**
|
|
68
|
+
* The same thing in the notation `engines.node` uses, so one constant can be
|
|
69
|
+
* compared against twenty-one manifests instead of being retyped into them.
|
|
70
|
+
*/
|
|
71
|
+
exports.SUPPORTED_NODE_ENGINES_RANGE = exports.SUPPORTED_NODE_RANGES.map((range) => ('belowMajor' in range ? `^${range.from}` : `>=${range.from}`)).join(' || ');
|
|
72
|
+
/**
|
|
73
|
+
* Why the range is shaped the way it is. Named in the refusal, because
|
|
74
|
+
* "you need 24.15" read by someone who *has* Node 24 is a riddle, not an
|
|
75
|
+
* instruction — and "you need 24.15 or newer" read by someone on Node 25 is
|
|
76
|
+
* simply wrong.
|
|
35
77
|
*/
|
|
36
|
-
|
|
78
|
+
const REQUIRED_NODE_REASON = 'jsdom, a transitive dependency, requires ^22.22.2 || ^24.15.0 || >=26.0.0, and this repository sets engine-strict=true — so npm stops rather than warns.';
|
|
37
79
|
/**
|
|
38
80
|
* Returns undefined for anything that is not a recognisable Node version, so
|
|
39
|
-
* an unexpected format cannot be read as
|
|
40
|
-
* would have worked.
|
|
81
|
+
* an unexpected format cannot be read as unsupported and block an install that
|
|
82
|
+
* would have worked. A version missing its patch digit counts as unreadable
|
|
83
|
+
* for the same reason: guessing `.0` would refuse a release that may be fine.
|
|
41
84
|
*/
|
|
42
|
-
function
|
|
43
|
-
const match = /^v?(\d+)
|
|
85
|
+
function parseNodeVersion(version) {
|
|
86
|
+
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(version.trim());
|
|
44
87
|
if (!match) {
|
|
45
88
|
return undefined;
|
|
46
89
|
}
|
|
47
|
-
return
|
|
90
|
+
return {
|
|
91
|
+
major: Number(match[1]),
|
|
92
|
+
minor: Number(match[2]),
|
|
93
|
+
patch: Number(match[3]),
|
|
94
|
+
...(match[4] === undefined ? {} : { prerelease: match[4] }),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function formatNodeVersion({ major, minor, patch, prerelease, }) {
|
|
98
|
+
const base = `${major}.${minor}.${patch}`;
|
|
99
|
+
return prerelease === undefined ? base : `${base}-${prerelease}`;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Negative when `a` is older than `b`, positive when newer, 0 when equal.
|
|
103
|
+
*
|
|
104
|
+
* Prereleases follow semver: `24.15.0-rc.1` is *older* than `24.15.0`, which
|
|
105
|
+
* is the rule that matters here — it is what makes a prerelease of a range's
|
|
106
|
+
* starting version fall outside that range, exactly as npm finds it.
|
|
107
|
+
* Prereleases are not ordered against each other, because nothing here needs
|
|
108
|
+
* it: a version either reaches a range's start or it does not.
|
|
109
|
+
*/
|
|
110
|
+
function compareNodeVersions(a, b) {
|
|
111
|
+
const numeric = a.major - b.major || a.minor - b.minor || a.patch - b.patch;
|
|
112
|
+
if (numeric !== 0) {
|
|
113
|
+
return numeric;
|
|
114
|
+
}
|
|
115
|
+
const aPre = a.prerelease === undefined ? 0 : -1;
|
|
116
|
+
const bPre = b.prerelease === undefined ? 0 : -1;
|
|
117
|
+
return aPre - bPre;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Whether a version falls inside any supported range.
|
|
121
|
+
*
|
|
122
|
+
* A range with `belowMajor` is closed at that major (`^24.15.0`); one without
|
|
123
|
+
* is open above (`>=26.0.0`). An unparseable range entry cannot happen — the
|
|
124
|
+
* table is a literal in this file — but it fails *open* if it ever does,
|
|
125
|
+
* matching `parseNodeVersion`.
|
|
126
|
+
*/
|
|
127
|
+
function isSupportedNodeVersion(version) {
|
|
128
|
+
return exports.SUPPORTED_NODE_RANGES.some((range) => {
|
|
129
|
+
const from = parseNodeVersion(range.from);
|
|
130
|
+
if (!from) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
if (compareNodeVersions(version, from) < 0) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
return !('belowMajor' in range) || version.major < range.belowMajor;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* One deliberate difference from npm, in the safe direction.
|
|
141
|
+
*
|
|
142
|
+
* npm passes `includePrerelease: true`, under which `25.0.0-rc.1` satisfies
|
|
143
|
+
* `^24.15.0` — it sorts below the `<25.0.0` bound. The check here refuses it,
|
|
144
|
+
* because the *released* 25 line is unsupported and scaffolding onto a release
|
|
145
|
+
* candidate of it would work today and stop working at 25.0.0 final. The cases
|
|
146
|
+
* that matter agree with npm exactly: a prerelease of a range's own starting
|
|
147
|
+
* version (`24.15.0-nightly`, `26.0.0-rc.1`) is refused by both, and one above
|
|
148
|
+
* it (`24.16.0-rc.1`, `27.0.0-nightly`) is accepted by both.
|
|
149
|
+
*/
|
|
150
|
+
/**
|
|
151
|
+
* A line the caller can paste. `nvm install`, not `nvm use`: someone in this
|
|
152
|
+
* position usually has *some* Node of that major already, and `nvm use 24`
|
|
153
|
+
* would select exactly the one that does not work.
|
|
154
|
+
*/
|
|
155
|
+
const REMEDY = ` nvm install ${exports.REQUIRED_NODE_VERSION} # or fnm, volta, asdf, …`;
|
|
156
|
+
/**
|
|
157
|
+
* Whether this Node is below every supported range, or inside a gap between
|
|
158
|
+
* two of them. The distinction is the whole message: "too old" is actionable
|
|
159
|
+
* and "unsupported release line" is a different instruction.
|
|
160
|
+
*/
|
|
161
|
+
function describeUnsupported(version) {
|
|
162
|
+
const floor = parseNodeVersion(exports.REQUIRED_NODE_VERSION);
|
|
163
|
+
const tooOld = floor ? compareNodeVersions(version, floor) < 0 : false;
|
|
164
|
+
const current = formatNodeVersion(version);
|
|
165
|
+
// A prerelease reads as a supported version to the eye, so the message has
|
|
166
|
+
// to say which part of it is the problem — otherwise the number in the
|
|
167
|
+
// refusal looks identical to the number in the requirement.
|
|
168
|
+
if (version.prerelease !== undefined) {
|
|
169
|
+
return `Node ${current} is a prerelease, and a Ragen installation needs ${exports.SUPPORTED_NODE_ENGINES_RANGE}. semver sorts a prerelease below the release it precedes, so ${current} does not satisfy that range and npm will refuse it — use a released Node.`;
|
|
170
|
+
}
|
|
171
|
+
if (tooOld) {
|
|
172
|
+
return `A Ragen installation needs Node ${exports.SUPPORTED_NODE_ENGINES_RANGE}, and this is Node ${current}.`;
|
|
173
|
+
}
|
|
174
|
+
return `Node ${current} is newer than the minimum and still not supported: a Ragen installation needs ${exports.SUPPORTED_NODE_ENGINES_RANGE}, which skips the ${version.major}.x line. Odd-numbered Node lines never become LTS, and libraries routinely omit them.`;
|
|
48
175
|
}
|
|
49
176
|
function checkNodeVersion({ version, willRunSetup, }) {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
177
|
+
const current = parseNodeVersion(version);
|
|
178
|
+
if (current === undefined || isSupportedNodeVersion(current)) {
|
|
52
179
|
return { kind: 'ok' };
|
|
53
180
|
}
|
|
181
|
+
const headline = describeUnsupported(current);
|
|
54
182
|
if (!willRunSetup) {
|
|
55
183
|
return {
|
|
56
184
|
kind: 'warn',
|
|
57
185
|
message: [
|
|
58
|
-
|
|
186
|
+
headline,
|
|
187
|
+
REQUIRED_NODE_REASON,
|
|
59
188
|
'Nothing is being installed here, so the files will be written anyway —',
|
|
60
189
|
'but switch before running npm install or the app in the new directory.',
|
|
61
190
|
].join(' '),
|
|
@@ -64,14 +193,21 @@ function checkNodeVersion({ version, willRunSetup, }) {
|
|
|
64
193
|
return {
|
|
65
194
|
kind: 'refuse',
|
|
66
195
|
message: [
|
|
67
|
-
|
|
196
|
+
headline,
|
|
197
|
+
'',
|
|
198
|
+
// The reason comes second and in full, because the interesting cases are
|
|
199
|
+
// someone who already has the right major and someone on a *newer* Node,
|
|
200
|
+
// both of whom read the line above as nonsense without it.
|
|
201
|
+
`Why: ${REQUIRED_NODE_REASON}`,
|
|
202
|
+
'On this Node, npm install fails with EBADENGINE partway through the',
|
|
203
|
+
'setup below.',
|
|
68
204
|
'',
|
|
69
205
|
'Stopping before anything is written: the setup this runs for you —',
|
|
70
206
|
'npm install, prisma generate, migrate and seed — would run under this',
|
|
71
207
|
'Node and leave a tree that fails later, somewhere that does not point',
|
|
72
208
|
'back here.',
|
|
73
209
|
'',
|
|
74
|
-
|
|
210
|
+
REMEDY,
|
|
75
211
|
'',
|
|
76
212
|
'Or pass --skip-install to write the files now and run the setup',
|
|
77
213
|
'yourself on a supported Node.',
|
package/dist/node-version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-version.js","sourceRoot":"","sources":["../src/node-version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;
|
|
1
|
+
{"version":3,"file":"node-version.js","sourceRoot":"","sources":["../src/node-version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;AAwFH,4CAaC;AAED,8CAQC;AA6BD,wDAWC;AA6CD,4CA+CC;AAjPD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,qBAAqB,GAAG;IACnC,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;IACnC,EAAE,IAAI,EAAE,QAAQ,EAAE;CACV,CAAC;AAEX,qEAAqE;AACxD,QAAA,qBAAqB,GAAG,6BAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAEnE;;;GAGG;AACU,QAAA,4BAA4B,GAAG,6BAAqB,CAAC,GAAG,CACnE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI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.ts
CHANGED
|
@@ -17,6 +17,13 @@ export interface RouteTableEntry {
|
|
|
17
17
|
* reaches the wrong upstream.
|
|
18
18
|
*/
|
|
19
19
|
connection?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The chat route's upstream accepts a JSON Schema response format. Without
|
|
22
|
+
* it the gateway sends no schema, and structured calls — Brain extraction,
|
|
23
|
+
* RAG scoring — get a shape the model guessed. See the gateway's
|
|
24
|
+
* `Route.structuredOutputs`.
|
|
25
|
+
*/
|
|
26
|
+
structuredOutputs?: boolean;
|
|
20
27
|
}
|
|
21
28
|
/**
|
|
22
29
|
* The route table for a scaffolded installation.
|
|
@@ -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;IACd;;;;;;;;OAQG;IACH,UAAU,CAAC,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;IACpB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CA4B5E;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,IAAI,CAEN"}
|
package/dist/route-table.js
CHANGED
|
@@ -25,9 +25,10 @@ exports.ROUTE_TABLE_PATH = 'infra/llm-gateway/routes.yaml';
|
|
|
25
25
|
*/
|
|
26
26
|
function renderRouteTable(entries) {
|
|
27
27
|
const routes = entries
|
|
28
|
-
.map(({ modelName, provider, model, connection }) => ` ${modelName}:\n provider: ${provider}\n` +
|
|
28
|
+
.map(({ modelName, provider, model, connection, structuredOutputs }) => ` ${modelName}:\n provider: ${provider}\n` +
|
|
29
29
|
(connection ? ` connection: ${connection}\n` : '') +
|
|
30
|
-
` model: ${model}\n`
|
|
30
|
+
` model: ${model}\n` +
|
|
31
|
+
(structuredOutputs ? ` structuredOutputs: true\n` : ''))
|
|
31
32
|
.join('');
|
|
32
33
|
return `# Written by create-ragen-app for this installation.
|
|
33
34
|
#
|
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":";;;AAgDA,4CA4BC;AAED,0CAKC;AAnFD,qCAAwC;AACxC,yCAAiC;AAEjC,iFAAiF;AACpE,QAAA,gBAAgB,GAAG,+BAA+B,CAAC;AA4BhE;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,gBAAgB,CAAC,OAAmC;IAClE,MAAM,MAAM,GAAG,OAAO;SACnB,GAAG,CACF,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAChE,KAAK,SAAS,oBAAoB,QAAQ,IAAI;QAC9C,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,cAAc,KAAK,IAAI;QACvB,CAAC,iBAAiB,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,CAAC,CAC7D;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/secrets.d.ts
CHANGED
|
@@ -4,4 +4,21 @@
|
|
|
4
4
|
* one-liners.
|
|
5
5
|
*/
|
|
6
6
|
export declare function generateSecret(): string;
|
|
7
|
+
/**
|
|
8
|
+
* An S3 access key id for a store this install runs itself (RustFS).
|
|
9
|
+
*
|
|
10
|
+
* Twenty characters, upper-case hex: the length AWS uses, and the upper bound
|
|
11
|
+
* MinIO enforces (3–20). RustFS is built as a drop-in for MinIO, so staying
|
|
12
|
+
* inside MinIO's bounds costs nothing and removes the question —
|
|
13
|
+
* `generateSecret()`'s 64 characters could be refused, and a store that
|
|
14
|
+
* refuses its root key does not start at all. Hex because an access key id travels in a signed header and in URLs; nothing
|
|
15
|
+
* outside `[0-9A-F]` needs thinking about there.
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateS3AccessKeyId(): string;
|
|
18
|
+
/**
|
|
19
|
+
* The matching secret: forty hex characters, 160 bits. Forty is again the
|
|
20
|
+
* length AWS uses and the ceiling MinIO enforces (8–40), which is why this is
|
|
21
|
+
* not `generateSecret()`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateS3SecretAccessKey(): string;
|
|
7
24
|
//# sourceMappingURL=secrets.d.ts.map
|
package/dist/secrets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD"}
|
package/dist/secrets.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateSecret = generateSecret;
|
|
4
|
+
exports.generateS3AccessKeyId = generateS3AccessKeyId;
|
|
5
|
+
exports.generateS3SecretAccessKey = generateS3SecretAccessKey;
|
|
4
6
|
const node_crypto_1 = require("node:crypto");
|
|
5
7
|
/**
|
|
6
8
|
* Matches every "Generate with: node -e ... randomBytes(32)" instruction
|
|
@@ -10,4 +12,25 @@ const node_crypto_1 = require("node:crypto");
|
|
|
10
12
|
function generateSecret() {
|
|
11
13
|
return (0, node_crypto_1.randomBytes)(32).toString('hex');
|
|
12
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* An S3 access key id for a store this install runs itself (RustFS).
|
|
17
|
+
*
|
|
18
|
+
* Twenty characters, upper-case hex: the length AWS uses, and the upper bound
|
|
19
|
+
* MinIO enforces (3–20). RustFS is built as a drop-in for MinIO, so staying
|
|
20
|
+
* inside MinIO's bounds costs nothing and removes the question —
|
|
21
|
+
* `generateSecret()`'s 64 characters could be refused, and a store that
|
|
22
|
+
* refuses its root key does not start at all. Hex because an access key id travels in a signed header and in URLs; nothing
|
|
23
|
+
* outside `[0-9A-F]` needs thinking about there.
|
|
24
|
+
*/
|
|
25
|
+
function generateS3AccessKeyId() {
|
|
26
|
+
return (0, node_crypto_1.randomBytes)(10).toString('hex').toUpperCase();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The matching secret: forty hex characters, 160 bits. Forty is again the
|
|
30
|
+
* length AWS uses and the ceiling MinIO enforces (8–40), which is why this is
|
|
31
|
+
* not `generateSecret()`.
|
|
32
|
+
*/
|
|
33
|
+
function generateS3SecretAccessKey() {
|
|
34
|
+
return (0, node_crypto_1.randomBytes)(20).toString('hex');
|
|
35
|
+
}
|
|
13
36
|
//# sourceMappingURL=secrets.js.map
|
package/dist/secrets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":";;AAOA,wCAEC;
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":";;AAOA,wCAEC;AAYD,sDAEC;AAOD,8DAEC;AAhCD,6CAA0C;AAE1C;;;;GAIG;AACH,SAAgB,cAAc;IAC5B,OAAO,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,qBAAqB;IACnC,OAAO,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,SAAgB,yBAAyB;IACvC,OAAO,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC"}
|