@guren/server 1.0.0-rc.13 → 1.0.0-rc.14

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.
@@ -1,8 +1,8 @@
1
1
  import * as hono_aws_lambda from 'hono/aws-lambda';
2
2
  export { APIGatewayProxyResult, LambdaEvent } from 'hono/aws-lambda';
3
- import { A as Application } from '../Application-DtWDHXr1.js';
3
+ import { A as Application } from '../Application-CsylYL26.js';
4
4
  import { S as Scheduler } from '../Scheduler-BstvSca7.js';
5
- import { C as ConsoleKernel } from '../ConsoleKernel-CqCVrdZs.js';
5
+ import { C as ConsoleKernel } from '../ConsoleKernel-BsbMQ38T.js';
6
6
  import 'hono';
7
7
  import '../api-token-JOif2CtG.js';
8
8
  import 'vite';
@@ -16,7 +16,7 @@ import '../index-9_Jzj5jo.js';
16
16
  import '../app-key-CsBfRC_Q.js';
17
17
  import '../StorageManager-oZTHqaza.js';
18
18
  import '../HealthManager-DUyMIzsZ.js';
19
- import '../Gate-CNkBYf8m.js';
19
+ import '../Gate-CynjZCtS.js';
20
20
 
21
21
  /**
22
22
  * SQS event record from AWS Lambda.
@@ -68,7 +68,7 @@ declare function createLambdaHandler(app: Application): <L extends hono_aws_lamb
68
68
  headers?: undefined;
69
69
  multiValueHeaders: Record<string, string[]>;
70
70
  } : {
71
- headers: Record<string, string>;
71
+ headers: Record<string, string | string[]>;
72
72
  multiValueHeaders?: undefined;
73
73
  })>;
74
74
  /**
@@ -244,6 +244,7 @@ declare class Mail {
244
244
  attach(attachment: MailAttachment): this;
245
245
  /**
246
246
  * Add a custom header.
247
+ * Rejects CR/LF characters to prevent SMTP header injection.
247
248
  */
248
249
  header(key: string, value: string): this;
249
250
  /**
@@ -599,8 +599,12 @@ var Mail = class {
599
599
  }
600
600
  /**
601
601
  * Add a custom header.
602
+ * Rejects CR/LF characters to prevent SMTP header injection.
602
603
  */
603
604
  header(key, value) {
605
+ if (/[\r\n]/.test(key) || /[\r\n]/.test(value)) {
606
+ throw new Error("Mail: header names and values cannot contain newline characters.");
607
+ }
604
608
  if (!this.message.headers) {
605
609
  this.message.headers = {};
606
610
  }
@@ -1,5 +1,5 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { S as ServiceProvider } from '../Application-DtWDHXr1.js';
2
+ import { S as ServiceProvider } from '../Application-CsylYL26.js';
3
3
  import 'hono';
4
4
  import '../api-token-JOif2CtG.js';
5
5
  import 'vite';
@@ -14,7 +14,7 @@ import '../app-key-CsBfRC_Q.js';
14
14
  import '../StorageManager-oZTHqaza.js';
15
15
  import '../HealthManager-DUyMIzsZ.js';
16
16
  import '../Scheduler-BstvSca7.js';
17
- import '../Gate-CNkBYf8m.js';
17
+ import '../Gate-CynjZCtS.js';
18
18
 
19
19
  /**
20
20
  * CLI functions that the MCP server wraps.
@@ -1,5 +1,5 @@
1
- import { _ as NotificationChannel, X as Notifiable, Y as Notification, q as DatabaseNotification, p as DatabaseChannelOptions, as as SlackMessage, ai as SentNotification } from '../Application-DtWDHXr1.js';
2
- export { Z as NotificationAttachment, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, N as NotificationManager, a2 as NotificationManagerOptions, aq as SlackAttachment, ar as SlackBlock, aG as createNotificationManager, aP as getNotificationManager, a_ as setNotificationManager } from '../Application-DtWDHXr1.js';
1
+ import { _ as NotificationChannel, X as Notifiable, Y as Notification, q as DatabaseNotification, p as DatabaseChannelOptions, as as SlackMessage, ai as SentNotification } from '../Application-CsylYL26.js';
2
+ export { Z as NotificationAttachment, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, N as NotificationManager, a2 as NotificationManagerOptions, aq as SlackAttachment, ar as SlackBlock, aG as createNotificationManager, aP as getNotificationManager, a_ as setNotificationManager } from '../Application-CsylYL26.js';
3
3
  import { M as MailManager } from '../MailManager-DpMvYiP9.js';
4
4
  import 'hono';
5
5
  import '../api-token-JOif2CtG.js';
@@ -14,7 +14,7 @@ import '../app-key-CsBfRC_Q.js';
14
14
  import '../StorageManager-oZTHqaza.js';
15
15
  import '../HealthManager-DUyMIzsZ.js';
16
16
  import '../Scheduler-BstvSca7.js';
17
- import '../Gate-CNkBYf8m.js';
17
+ import '../Gate-CynjZCtS.js';
18
18
 
19
19
  /**
20
20
  * Mail notification channel.
@@ -1,5 +1,5 @@
1
- import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-DtWDHXr1.js';
2
- export { R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, a4 as QueueConfig, a6 as QueueDriverFactory, Q as QueueManager, aA as clearJobRegistry, aH as createQueueManager, aO as getJob, aQ as getQueueDriver, aR as getRegisteredJobs, aV as registerJob, a$ as setQueueDriver } from '../Application-DtWDHXr1.js';
1
+ import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-CsylYL26.js';
2
+ export { R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, a4 as QueueConfig, a6 as QueueDriverFactory, Q as QueueManager, aA as clearJobRegistry, aH as createQueueManager, aO as getJob, aQ as getQueueDriver, aR as getRegisteredJobs, aV as registerJob, a$ as setQueueDriver } from '../Application-CsylYL26.js';
3
3
  import { Redis } from 'ioredis';
4
4
  import 'hono';
5
5
  import '../api-token-JOif2CtG.js';
@@ -15,7 +15,7 @@ import '../app-key-CsBfRC_Q.js';
15
15
  import '../StorageManager-oZTHqaza.js';
16
16
  import '../HealthManager-DUyMIzsZ.js';
17
17
  import '../Scheduler-BstvSca7.js';
18
- import '../Gate-CNkBYf8m.js';
18
+ import '../Gate-CynjZCtS.js';
19
19
 
20
20
  /**
21
21
  * In-memory queue driver for development and testing.
@@ -1,5 +1,5 @@
1
- import { A as Application } from '../Application-DtWDHXr1.js';
2
- export { D as DevBannerOptions, G as GUREN_ASCII_ART, a as StartViteDevServerOptions, b as StartedViteDevServer, l as logDevServerBanner, s as startViteDevServer } from '../Application-DtWDHXr1.js';
1
+ import { A as Application } from '../Application-CsylYL26.js';
2
+ export { D as DevBannerOptions, G as GUREN_ASCII_ART, a as StartViteDevServerOptions, b as StartedViteDevServer, l as logDevServerBanner, s as startViteDevServer } from '../Application-CsylYL26.js';
3
3
  import 'hono';
4
4
  import '../api-token-JOif2CtG.js';
5
5
  import 'vite';
@@ -14,7 +14,7 @@ import '../app-key-CsBfRC_Q.js';
14
14
  import '../StorageManager-oZTHqaza.js';
15
15
  import '../HealthManager-DUyMIzsZ.js';
16
16
  import '../Scheduler-BstvSca7.js';
17
- import '../Gate-CNkBYf8m.js';
17
+ import '../Gate-CynjZCtS.js';
18
18
 
19
19
  type RootPublicAssetsConfig = boolean | RootPublicAssetsOptions;
20
20
  interface RootPublicAssetsOptions {
@@ -315,6 +315,20 @@ function parseImportMap(value, options = {}) {
315
315
  }
316
316
  }
317
317
 
318
+ // src/encryption/Hash.ts
319
+ import {
320
+ createHash,
321
+ createHmac,
322
+ randomBytes,
323
+ scrypt,
324
+ timingSafeEqual
325
+ } from "crypto";
326
+ import { promisify } from "util";
327
+ var scryptAsync = promisify(scrypt);
328
+ function hash(value, algorithm = "sha256", encoding = "hex") {
329
+ return createHash(algorithm).update(value).digest(encoding);
330
+ }
331
+
318
332
  // src/http/inertia-assets.ts
319
333
  var DEFAULT_STYLES_ENTRY = "/public/assets/app.css";
320
334
  var DEFAULT_DEV_STYLES_ENTRY = "/resources/css/app.css";
@@ -460,6 +474,12 @@ function autoConfigureInertiaAssets(app, options) {
460
474
  const clientEntry = clientManifest?.["resources/js/app.tsx"];
461
475
  const clientEntryFile = getManifestFile(clientEntry);
462
476
  const clientCssFiles = getManifestCss(clientEntry);
477
+ if (clientManifest?.__raw__) {
478
+ setEnvIfUserDidNotProvide(
479
+ "GUREN_INERTIA_VERSION",
480
+ hash(clientManifest.__raw__, "sha1").slice(0, 12)
481
+ );
482
+ }
463
483
  if (clientEntryFile) {
464
484
  setEnvIfUserDidNotProvide("GUREN_INERTIA_ENTRY", `/public/assets/${clientEntryFile.replace(/^\//u, "")}`);
465
485
  }
@@ -513,7 +533,8 @@ function captureInertiaEnvFlags() {
513
533
  GUREN_INERTIA_ENTRY: process.env.GUREN_INERTIA_ENTRY !== void 0,
514
534
  GUREN_INERTIA_STYLES: process.env.GUREN_INERTIA_STYLES !== void 0,
515
535
  GUREN_INERTIA_SSR_ENTRY: process.env.GUREN_INERTIA_SSR_ENTRY !== void 0,
516
- GUREN_INERTIA_SSR_MANIFEST: process.env.GUREN_INERTIA_SSR_MANIFEST !== void 0
536
+ GUREN_INERTIA_SSR_MANIFEST: process.env.GUREN_INERTIA_SSR_MANIFEST !== void 0,
537
+ GUREN_INERTIA_VERSION: process.env.GUREN_INERTIA_VERSION !== void 0
517
538
  };
518
539
  }
519
540
  function resolveDevSsrEntry(options) {
@@ -552,6 +573,10 @@ function loadViteManifest(candidatePaths, label) {
552
573
  value: manifestPath,
553
574
  enumerable: false
554
575
  });
576
+ Object.defineProperty(manifest, "__raw__", {
577
+ value: raw,
578
+ enumerable: false
579
+ });
555
580
  return manifest;
556
581
  } catch (error) {
557
582
  if (error.code !== "ENOENT") {
@@ -615,7 +640,7 @@ import standard from "figlet/importable-fonts/Standard.js";
615
640
  // package.json
616
641
  var package_default = {
617
642
  name: "@guren/server",
618
- version: "1.0.0-rc.13",
643
+ version: "1.0.0-rc.14",
619
644
  type: "module",
620
645
  license: "MIT",
621
646
  repository: {
@@ -720,14 +745,14 @@ var package_default = {
720
745
  test: "bun test"
721
746
  },
722
747
  dependencies: {
723
- "@guren/inertia-client": "^1.0.0-rc.12",
748
+ "@guren/inertia-client": "^1.0.0-rc.13",
724
749
  "@modelcontextprotocol/sdk": "^1.27.1",
725
750
  chalk: "^5.3.0",
726
751
  consola: "^3.4.2",
727
752
  figlet: "^1.7.0",
728
- hono: "^4.12.8",
753
+ hono: "^4.12.18",
729
754
  ioredis: "^5.9.1",
730
- nodemailer: "^7.0.12"
755
+ nodemailer: "^8.0.4"
731
756
  },
732
757
  peerDependencies: {
733
758
  "@aws-sdk/client-s3": "^3.0.0",
@@ -749,7 +774,7 @@ var package_default = {
749
774
  devDependencies: {
750
775
  "@types/ioredis": "^5.0.0",
751
776
  "@types/node": "^20.14.10",
752
- "@types/nodemailer": "^7.0.5",
777
+ "@types/nodemailer": "^8.0.1",
753
778
  tsup: "^8.5.0",
754
779
  typescript: "^5.4.0",
755
780
  vite: "^8.0.0"
@@ -22,6 +22,7 @@ declare class LocalDriver implements StorageDriver {
22
22
  constructor(options: LocalDriverOptions);
23
23
  /**
24
24
  * Get the full path for a file.
25
+ * Rejects paths that resolve outside the storage root (e.g. via `../`).
25
26
  */
26
27
  private fullPath;
27
28
  /**
@@ -11,7 +11,7 @@ import {
11
11
  rename
12
12
  } from "fs/promises";
13
13
  import { existsSync } from "fs";
14
- import { join, dirname } from "path";
14
+ import { join, dirname, resolve, sep } from "path";
15
15
  var LocalDriver = class {
16
16
  root;
17
17
  baseUrl;
@@ -23,9 +23,15 @@ var LocalDriver = class {
23
23
  }
24
24
  /**
25
25
  * Get the full path for a file.
26
+ * Rejects paths that resolve outside the storage root (e.g. via `../`).
26
27
  */
27
28
  fullPath(path) {
28
- return join(this.root, path);
29
+ const root = resolve(this.root);
30
+ const candidate = resolve(root, path);
31
+ if (candidate !== root && !candidate.startsWith(root + sep)) {
32
+ throw new Error(`LocalDriver: path escapes the storage root: "${path}"`);
33
+ }
34
+ return candidate;
29
35
  }
30
36
  /**
31
37
  * Ensure the directory exists.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/server",
3
- "version": "1.0.0-rc.13",
3
+ "version": "1.0.0-rc.14",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -105,14 +105,14 @@
105
105
  "test": "bun test"
106
106
  },
107
107
  "dependencies": {
108
- "@guren/inertia-client": "^1.0.0-rc.12",
108
+ "@guren/inertia-client": "^1.0.0-rc.13",
109
109
  "@modelcontextprotocol/sdk": "^1.27.1",
110
110
  "chalk": "^5.3.0",
111
111
  "consola": "^3.4.2",
112
112
  "figlet": "^1.7.0",
113
- "hono": "^4.12.8",
113
+ "hono": "^4.12.18",
114
114
  "ioredis": "^5.9.1",
115
- "nodemailer": "^7.0.12"
115
+ "nodemailer": "^8.0.4"
116
116
  },
117
117
  "peerDependencies": {
118
118
  "@aws-sdk/client-s3": "^3.0.0",
@@ -134,7 +134,7 @@
134
134
  "devDependencies": {
135
135
  "@types/ioredis": "^5.0.0",
136
136
  "@types/node": "^20.14.10",
137
- "@types/nodemailer": "^7.0.5",
137
+ "@types/nodemailer": "^8.0.1",
138
138
  "tsup": "^8.5.0",
139
139
  "typescript": "^5.4.0",
140
140
  "vite": "^8.0.0"