@alpic80/rivet-cli 1.24.2-aidon.4 → 1.24.2-aidon.6
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/bin/commands/serve.js +16 -4
- package/package.json +5 -5
package/bin/commands/serve.js
CHANGED
|
@@ -169,14 +169,24 @@ export async function serve(cliArgs = {}) {
|
|
|
169
169
|
}
|
|
170
170
|
return c.text('Configured with projects-root-dir which requires a project file to be specified in URL', 400);
|
|
171
171
|
}
|
|
172
|
+
// Capture all headers as an object
|
|
173
|
+
const headers = {};
|
|
174
|
+
c.req.raw.headers.forEach((value, key) => {
|
|
175
|
+
headers[key] = value;
|
|
176
|
+
});
|
|
172
177
|
const project = args.dev ? await loadProjectFromFile(projectFilePath) : initialProject;
|
|
173
178
|
const inputText = await c.req.text();
|
|
174
|
-
return await processGraph({ project, inputText });
|
|
179
|
+
return await processGraph({ project, headers, inputText });
|
|
175
180
|
});
|
|
176
181
|
if (args.allowSpecifyingGraphId || args.projectsRootDir) {
|
|
177
182
|
app.post('/*', async (c) => {
|
|
178
183
|
const full = decodeURIComponent(c.req.path.slice(1)); // remove leading slash
|
|
179
|
-
const parts = full.split('
|
|
184
|
+
const parts = full.split(':');
|
|
185
|
+
// Capture all headers as an object
|
|
186
|
+
const headers = {};
|
|
187
|
+
c.req.raw.headers.forEach((value, key) => {
|
|
188
|
+
headers[key] = value;
|
|
189
|
+
});
|
|
180
190
|
let graphId;
|
|
181
191
|
let graphFile;
|
|
182
192
|
if (parts.length === 1) {
|
|
@@ -213,7 +223,7 @@ export async function serve(cliArgs = {}) {
|
|
|
213
223
|
project = args.dev || args.projectsRootDir ? await loadProjectFromFile(projectFilePath) : initialProject;
|
|
214
224
|
}
|
|
215
225
|
const inputText = await c.req.text();
|
|
216
|
-
return await processGraph({ project, inputText, graphId });
|
|
226
|
+
return await processGraph({ project, headers, inputText, graphId });
|
|
217
227
|
});
|
|
218
228
|
}
|
|
219
229
|
const server = serveHono({
|
|
@@ -268,6 +278,8 @@ function createProcessGraph(ctx) {
|
|
|
268
278
|
if (typeof parsed !== 'object') {
|
|
269
279
|
throw new Error('Inputs must be an object');
|
|
270
280
|
}
|
|
281
|
+
//pass in the header if needed
|
|
282
|
+
inputs.headers = JSON.stringify(opts.headers);
|
|
271
283
|
if ('runParams' in parsed) {
|
|
272
284
|
runParams = parsed['runParams'];
|
|
273
285
|
delete parsed['runParams'];
|
|
@@ -283,7 +295,7 @@ function createProcessGraph(ctx) {
|
|
|
283
295
|
`Input:${JSON.stringify(inputs)}`,
|
|
284
296
|
localCtx.stream && `Stream:${chalk.bold.white(localCtx.stream)}`,
|
|
285
297
|
localCtx.streamNode && `StreamNode:${chalk.bold.white(localCtx.streamNode)}`,
|
|
286
|
-
localCtx.events && `
|
|
298
|
+
localCtx.events && `Events:${chalk.bold.white(localCtx.events)}`,
|
|
287
299
|
localCtx.exposeCost && `ExposeCost:${chalk.bold.white(localCtx.exposeCost)}`,
|
|
288
300
|
localCtx.exposeUsage && `ExposeUsage:${chalk.bold.white(localCtx.exposeUsage)}`,
|
|
289
301
|
localCtx.logTrace && `LogTrace:${chalk.bold.white(localCtx.logTrace)}`
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@alpic80/rivet-cli",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"repository": "https://github.com/castortech/rivet",
|
|
5
|
-
"version": "1.24.2-aidon.
|
|
5
|
+
"version": "1.24.2-aidon.6",
|
|
6
6
|
"src": "bin/cli.ts",
|
|
7
7
|
"bin": {
|
|
8
8
|
"rivet": "bin/cli.js"
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"dev:serve": "tsx src/cli.ts serve --projects-root-dir C:/temp/aidon/Rivet_Files"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@alpic80/rivet-core": "^1.24.2-aidon.
|
|
28
|
-
"@alpic80/rivet-node": "^1.24.2-aidon.
|
|
27
|
+
"@alpic80/rivet-core": "^1.24.2-aidon.6",
|
|
28
|
+
"@alpic80/rivet-node": "^1.24.2-aidon.6",
|
|
29
29
|
"@hono/node-server": "^1.13.8",
|
|
30
|
-
"@ironclad/rivet-core": "npm:@alpic80/rivet-core@1.24.2-aidon.
|
|
31
|
-
"@ironclad/rivet-node": "npm:@alpic80/rivet-node@1.24.2-aidon.
|
|
30
|
+
"@ironclad/rivet-core": "npm:@alpic80/rivet-core@1.24.2-aidon.6",
|
|
31
|
+
"@ironclad/rivet-node": "npm:@alpic80/rivet-node@1.24.2-aidon.6",
|
|
32
32
|
"@types/dotenv": "^8.2.3",
|
|
33
33
|
"chalk": "^5.4.1",
|
|
34
34
|
"didyoumean2": "^7.0.4",
|