@elsium-ai/app 0.2.3 → 0.3.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/dist/index.d.ts CHANGED
@@ -1,9 +1,12 @@
1
1
  export { createApp } from './app';
2
2
  export type { ElsiumApp } from './app';
3
- export type { AppConfig, ServerConfig, CorsConfig, AuthConfig, RateLimitConfig, ChatRequest, ChatResponse, CompleteRequest, HealthResponse, MetricsResponse, } from './types';
3
+ export type { AppConfig, ServerConfig, CorsConfig, AuthConfig, RateLimitConfig, ChatRequest, ChatResponse, CompleteRequest, HealthResponse, MetricsResponse, StreamChatEvent, StreamCompleteEvent, } from './types';
4
+ export { sseHeaders, formatSSE, streamResponse } from './sse';
4
5
  export { corsMiddleware, authMiddleware, rateLimitMiddleware, requestIdMiddleware, requestLoggerMiddleware, } from './middleware';
5
6
  export { createRoutes } from './routes';
6
7
  export type { RoutesDeps } from './routes';
7
8
  export { createRBAC } from './rbac';
8
9
  export type { Permission, Role, RBACConfig, RBAC } from './rbac';
10
+ export { tenantMiddleware, tenantRateLimitMiddleware } from './tenant';
11
+ export type { TenantMiddlewareConfig } from './tenant';
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,YAAY,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,UAAU,EACV,eAAe,EACf,WAAW,EACX,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,GACf,MAAM,SAAS,CAAA;AAGhB,OAAO,EACN,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,YAAY,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,UAAU,EACV,eAAe,EACf,WAAW,EACX,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,mBAAmB,GACnB,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG7D,OAAO,EACN,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAGhE,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AACtE,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA"}
package/dist/index.js CHANGED
@@ -389,6 +389,94 @@ function createLogger(options = {}) {
389
389
  }
390
390
  };
391
391
  }
392
+ // ../core/src/schema.ts
393
+ var log = createLogger();
394
+ function zodDefKind(def) {
395
+ return typeof def.type === "string" ? def.type : def.typeName;
396
+ }
397
+ function zodObjectToJsonSchema(schema, convert) {
398
+ const shape = typeof schema.shape === "function" ? schema.shape() : schema.shape;
399
+ const properties = {};
400
+ const required = [];
401
+ for (const [key, value] of Object.entries(shape)) {
402
+ const fieldSchema = value;
403
+ properties[key] = convert(fieldSchema);
404
+ const fieldDef = fieldSchema._def;
405
+ const fieldKind = zodDefKind(fieldDef);
406
+ if (fieldKind !== "optional" && fieldKind !== "ZodOptional" && fieldKind !== "default" && fieldKind !== "ZodDefault") {
407
+ required.push(key);
408
+ }
409
+ if (fieldDef.description) {
410
+ properties[key].description = fieldDef.description;
411
+ }
412
+ }
413
+ return { type: "object", properties, required };
414
+ }
415
+ function zodToJsonSchema(schema) {
416
+ if (!("_def" in schema))
417
+ return { type: "object" };
418
+ const def = schema._def;
419
+ const kind = zodDefKind(def);
420
+ switch (kind) {
421
+ case "object":
422
+ case "ZodObject":
423
+ return zodObjectToJsonSchema(def, zodToJsonSchema);
424
+ case "string":
425
+ case "ZodString":
426
+ return { type: "string" };
427
+ case "number":
428
+ case "ZodNumber":
429
+ return { type: "number" };
430
+ case "boolean":
431
+ case "ZodBoolean":
432
+ return { type: "boolean" };
433
+ case "array":
434
+ case "ZodArray":
435
+ return {
436
+ type: "array",
437
+ items: zodToJsonSchema(def.element ?? def.type)
438
+ };
439
+ case "enum":
440
+ case "ZodEnum": {
441
+ const values = def.values ?? (def.entries ? Object.values(def.entries) : []);
442
+ return { type: "string", enum: values };
443
+ }
444
+ case "optional":
445
+ case "ZodOptional":
446
+ return zodToJsonSchema(def.innerType);
447
+ case "default":
448
+ case "ZodDefault":
449
+ return zodToJsonSchema(def.innerType);
450
+ case "nullable":
451
+ case "ZodNullable": {
452
+ const inner = zodToJsonSchema(def.innerType);
453
+ return { ...inner, nullable: true };
454
+ }
455
+ case "ZodLiteral":
456
+ return { type: typeof def.value, const: def.value };
457
+ case "ZodUnion": {
458
+ const options = def.options.map(zodToJsonSchema);
459
+ return { anyOf: options };
460
+ }
461
+ case "ZodRecord":
462
+ return {
463
+ type: "object",
464
+ additionalProperties: def.valueType ? zodToJsonSchema(def.valueType) : { type: "string" }
465
+ };
466
+ case "ZodTuple": {
467
+ const items = (def.items ?? []).map(zodToJsonSchema);
468
+ return { type: "array", prefixItems: items, minItems: items.length, maxItems: items.length };
469
+ }
470
+ case "ZodDate":
471
+ return { type: "string", format: "date-time" };
472
+ default:
473
+ log.warn(`zodToJsonSchema: unsupported type ${kind}, defaulting to string`);
474
+ return { type: "string" };
475
+ }
476
+ }
477
+ // ../core/src/registry.ts
478
+ var log2 = createLogger();
479
+ var BLOCKED_KEYS = new Set(["__proto__", "constructor", "prototype"]);
392
480
  // ../core/src/shutdown.ts
393
481
  function createShutdownManager(config) {
394
482
  const drainTimeoutMs = config?.drainTimeoutMs ?? 30000;
@@ -615,7 +703,7 @@ function xrayMiddleware(options = {}) {
615
703
  }
616
704
 
617
705
  // ../gateway/src/pricing.ts
618
- var log = createLogger();
706
+ var log3 = createLogger();
619
707
  var PRICING = {
620
708
  "claude-opus-4-6": { inputPerMillion: 15, outputPerMillion: 75 },
621
709
  "claude-sonnet-4-6": { inputPerMillion: 3, outputPerMillion: 15 },
@@ -653,7 +741,7 @@ function resolveModelName(model) {
653
741
  function calculateCost(model, usage) {
654
742
  const pricing = PRICING[resolveModelName(model)];
655
743
  if (!pricing) {
656
- log.warn(`Unknown model "${model}" — cost will be reported as $0. Register pricing with registerPricing().`);
744
+ log3.warn(`Unknown model "${model}" — cost will be reported as $0. Register pricing with registerPricing().`);
657
745
  return {
658
746
  inputCost: 0,
659
747
  outputCost: 0,
@@ -747,15 +835,33 @@ function createAnthropicProvider(config) {
747
835
  if (part.type === "text")
748
836
  return { type: "text", text: part.text };
749
837
  if (part.type === "image" && part.source?.type === "base64") {
838
+ const src = part.source;
750
839
  return {
751
840
  type: "image",
752
841
  source: {
753
842
  type: "base64",
754
- media_type: part.source.mediaType,
755
- data: part.source.data
843
+ media_type: src.mediaType,
844
+ data: src.data
756
845
  }
757
846
  };
758
847
  }
848
+ if (part.type === "document" && part.source) {
849
+ if (part.source.type === "base64") {
850
+ const src = part.source;
851
+ return {
852
+ type: "document",
853
+ source: {
854
+ type: "base64",
855
+ media_type: src.mediaType,
856
+ data: src.data
857
+ }
858
+ };
859
+ }
860
+ return { type: "text", text: "[document: url source not supported by Anthropic]" };
861
+ }
862
+ if (part.type === "audio") {
863
+ return { type: "text", text: "[audio content not supported by this provider]" };
864
+ }
759
865
  return { type: "text", text: "[unsupported content]" };
760
866
  }
761
867
  function formatMultipartContent(msg, role) {
@@ -864,6 +970,16 @@ function createAnthropicProvider(config) {
864
970
  const tools = formatTools(req.tools);
865
971
  if (tools)
866
972
  body.tools = tools;
973
+ if (req.schema) {
974
+ const jsonSchema = zodToJsonSchema(req.schema);
975
+ const structuredTool = {
976
+ name: "_structured_output",
977
+ description: "Return structured output matching the required schema",
978
+ input_schema: jsonSchema
979
+ };
980
+ body.tools = [...tools ?? [], structuredTool];
981
+ body.tool_choice = { type: "tool", name: "_structured_output" };
982
+ }
867
983
  const startTime = performance.now();
868
984
  const raw = await retry(async () => {
869
985
  const controller = new AbortController;
@@ -1084,6 +1200,18 @@ function createGoogleProvider(config) {
1084
1200
  } else {
1085
1201
  parts.push({ fileData: { mimeType: "image/jpeg", fileUri: img.source.url } });
1086
1202
  }
1203
+ } else if (p.type === "audio" || p.type === "document") {
1204
+ const media = p;
1205
+ if (media.source.type === "base64") {
1206
+ parts.push({
1207
+ inlineData: { mimeType: media.source.mediaType, data: media.source.data }
1208
+ });
1209
+ } else {
1210
+ const urlSource = media.source;
1211
+ parts.push({
1212
+ fileData: { mimeType: "application/octet-stream", fileUri: urlSource.url }
1213
+ });
1214
+ }
1087
1215
  }
1088
1216
  }
1089
1217
  return { role, parts };
@@ -1182,6 +1310,10 @@ function createGoogleProvider(config) {
1182
1310
  config2.topP = req.topP;
1183
1311
  if (req.stopSequences?.length)
1184
1312
  config2.stopSequences = req.stopSequences;
1313
+ if (req.schema) {
1314
+ config2.responseMimeType = "application/json";
1315
+ config2.responseSchema = zodToJsonSchema(req.schema);
1316
+ }
1185
1317
  return config2;
1186
1318
  }
1187
1319
  function buildRequestBody(req) {
@@ -1461,6 +1593,25 @@ function createOpenAIProvider(config) {
1461
1593
  } else {
1462
1594
  parts.push({ type: "image_url", image_url: { url: part.source.url } });
1463
1595
  }
1596
+ } else if (part.type === "audio") {
1597
+ if (part.source.type === "base64") {
1598
+ const format = part.source.mediaType.split("/")[1] ?? "wav";
1599
+ parts.push({
1600
+ type: "input_audio",
1601
+ input_audio: { data: part.source.data, format }
1602
+ });
1603
+ } else {
1604
+ parts.push({ type: "text", text: "[audio: url source requires file upload]" });
1605
+ }
1606
+ } else if (part.type === "document") {
1607
+ if (part.source.type === "base64") {
1608
+ parts.push({
1609
+ type: "text",
1610
+ text: `[document: ${part.source.mediaType} content attached as base64]`
1611
+ });
1612
+ } else {
1613
+ parts.push({ type: "text", text: `[document: ${part.source.url}]` });
1614
+ }
1464
1615
  }
1465
1616
  }
1466
1617
  return parts;
@@ -1557,6 +1708,17 @@ function createOpenAIProvider(config) {
1557
1708
  const tools = formatTools(req.tools);
1558
1709
  if (tools)
1559
1710
  body.tools = tools;
1711
+ if (req.schema) {
1712
+ const jsonSchema = zodToJsonSchema(req.schema);
1713
+ body.response_format = {
1714
+ type: "json_schema",
1715
+ json_schema: {
1716
+ name: "structured_output",
1717
+ strict: true,
1718
+ schema: jsonSchema
1719
+ }
1720
+ };
1721
+ }
1560
1722
  const startTime = performance.now();
1561
1723
  const raw = await retry(async () => {
1562
1724
  const controller = new AbortController;
@@ -1867,107 +2029,52 @@ function gateway(config) {
1867
2029
  },
1868
2030
  async generate(request) {
1869
2031
  const { schema, ...rest } = request;
1870
- const jsonSchema = schemaToJsonSchema(schema);
1871
- const systemPrompt = [
1872
- rest.system ?? "",
1873
- "You MUST respond with valid JSON matching this schema:",
1874
- JSON.stringify(jsonSchema, null, 2),
1875
- "Respond ONLY with the JSON object, no markdown or explanation."
1876
- ].filter(Boolean).join(`
1877
-
1878
- `);
2032
+ const jsonSchema = zodToJsonSchema(schema);
1879
2033
  const response = await executeWithMiddleware({
1880
2034
  ...rest,
1881
- system: systemPrompt
2035
+ schema,
2036
+ system: [
2037
+ rest.system ?? "",
2038
+ "You MUST respond with valid JSON matching this schema:",
2039
+ JSON.stringify(jsonSchema, null, 2),
2040
+ "Respond ONLY with the JSON object, no markdown or explanation."
2041
+ ].filter(Boolean).join(`
2042
+
2043
+ `)
1882
2044
  });
1883
- const text = typeof response.message.content === "string" ? response.message.content : "";
1884
- const jsonMatch = text.match(/\{[\s\S]*\}/);
1885
- if (!jsonMatch) {
1886
- throw ElsiumError.validation("LLM response did not contain valid JSON", {
1887
- response: text
1888
- });
2045
+ let parsed;
2046
+ if (response.stopReason === "tool_use" && response.message.toolCalls?.length) {
2047
+ const structuredCall = response.message.toolCalls.find((tc) => tc.name === "_structured_output");
2048
+ if (structuredCall) {
2049
+ parsed = structuredCall.arguments;
2050
+ }
2051
+ }
2052
+ if (parsed === undefined) {
2053
+ const text = typeof response.message.content === "string" ? response.message.content : "";
2054
+ const jsonMatch = text.match(/\{[\s\S]*\}/);
2055
+ if (!jsonMatch) {
2056
+ throw ElsiumError.validation("LLM response did not contain valid JSON", {
2057
+ response: text
2058
+ });
2059
+ }
2060
+ parsed = JSON.parse(jsonMatch[0]);
1889
2061
  }
1890
- const parsed = JSON.parse(jsonMatch[0]);
1891
2062
  const result = schema.safeParse(parsed);
1892
2063
  if (!result.success) {
1893
2064
  throw ElsiumError.validation("LLM response did not match schema", {
1894
- errors: result.error.issues,
1895
- response: text
2065
+ errors: result.error.issues
1896
2066
  });
1897
2067
  }
1898
2068
  return { data: result.data, response };
1899
2069
  }
1900
2070
  };
1901
2071
  }
1902
- function schemaToJsonSchema(schema) {
1903
- try {
1904
- if ("_def" in schema) {
1905
- const def = schema._def;
1906
- const result = convertZodDef(def);
1907
- if (result)
1908
- return result;
1909
- }
1910
- } catch {}
1911
- return { type: "string" };
1912
- }
1913
- function zodDefKind(def) {
1914
- return typeof def.type === "string" ? def.type : def.typeName;
1915
- }
1916
- function convertZodDef(def) {
1917
- const kind = zodDefKind(def);
1918
- switch (kind) {
1919
- case "object":
1920
- case "ZodObject":
1921
- return convertZodObject(def);
1922
- case "string":
1923
- case "ZodString":
1924
- return { type: "string" };
1925
- case "number":
1926
- case "ZodNumber":
1927
- return { type: "number" };
1928
- case "boolean":
1929
- case "ZodBoolean":
1930
- return { type: "boolean" };
1931
- case "array":
1932
- case "ZodArray":
1933
- return convertZodArray(def);
1934
- case "enum":
1935
- case "ZodEnum": {
1936
- const values = def.values ?? (def.entries ? Object.values(def.entries) : []);
1937
- return { type: "string", enum: values };
1938
- }
1939
- case "optional":
1940
- case "ZodOptional":
1941
- return convertZodOptional(def);
1942
- default:
1943
- return null;
1944
- }
1945
- }
1946
- function convertZodObject(def) {
1947
- if (!def.shape)
1948
- return null;
1949
- const shape = typeof def.shape === "function" ? def.shape() : def.shape;
1950
- const properties = {};
1951
- const required = [];
1952
- for (const [key, value] of Object.entries(shape)) {
1953
- properties[key] = schemaToJsonSchema(value);
1954
- const valDef = value._def;
1955
- const valKind = zodDefKind(valDef);
1956
- if (valKind !== "optional" && valKind !== "ZodOptional") {
1957
- required.push(key);
1958
- }
1959
- }
1960
- return { type: "object", properties, required };
1961
- }
1962
- function convertZodArray(def) {
1963
- return {
1964
- type: "array",
1965
- items: schemaToJsonSchema(def.element ?? def.type)
1966
- };
1967
- }
1968
- function convertZodOptional(def) {
1969
- return schemaToJsonSchema(def.innerType ?? def.innerType);
1970
- }
2072
+ // ../gateway/src/cache.ts
2073
+ var log4 = createLogger();
2074
+ // ../gateway/src/output-guardrails.ts
2075
+ var log5 = createLogger();
2076
+ // ../gateway/src/batch.ts
2077
+ var log6 = createLogger();
1971
2078
  // ../observe/src/span.ts
1972
2079
  function createSpan(name, options = {}) {
1973
2080
  const id = generateId("spn");
@@ -2038,7 +2145,7 @@ function createSpan(name, options = {}) {
2038
2145
  }
2039
2146
  // ../observe/src/tracer.ts
2040
2147
  import { writeFileSync } from "node:fs";
2041
- var log2 = createLogger();
2148
+ var log7 = createLogger();
2042
2149
  function observe(config = {}) {
2043
2150
  const {
2044
2151
  output = ["console"],
@@ -2061,7 +2168,7 @@ function observe(config = {}) {
2061
2168
  try {
2062
2169
  writeFileSync(filename, JSON.stringify(spansToExport, null, 2));
2063
2170
  } catch (err2) {
2064
- log2.error("Failed to write trace file", {
2171
+ log7.error("Failed to write trace file", {
2065
2172
  error: err2 instanceof Error ? err2.message : String(err2)
2066
2173
  });
2067
2174
  }
@@ -2136,7 +2243,7 @@ function observe(config = {}) {
2136
2243
  function consoleHandler(span) {
2137
2244
  const duration = span.durationMs !== undefined ? `${span.durationMs}ms` : "running";
2138
2245
  const status = span.status === "error" ? "[ERROR]" : span.status === "ok" ? "[OK]" : "[...]";
2139
- log2.info("span", {
2246
+ log7.info("span", {
2140
2247
  trace: span.traceId,
2141
2248
  span: span.name,
2142
2249
  kind: span.kind,
@@ -2173,8 +2280,10 @@ function createNoopSpan(name, kind) {
2173
2280
  }
2174
2281
  };
2175
2282
  }
2283
+ // ../observe/src/experiment.ts
2284
+ var log8 = createLogger();
2176
2285
  // ../observe/src/otel.ts
2177
- var log3 = createLogger();
2286
+ var log9 = createLogger();
2178
2287
  // ../../node_modules/.bun/@hono+node-server@1.19.9/node_modules/@hono/node-server/dist/index.mjs
2179
2288
  import { createServer as createServerHTTP } from "http";
2180
2289
  import { Http2ServerRequest as Http2ServerRequest2 } from "http2";
@@ -4334,12 +4443,12 @@ function requestIdMiddleware() {
4334
4443
  };
4335
4444
  }
4336
4445
  function requestLoggerMiddleware(logger) {
4337
- const log4 = logger ?? createLogger();
4446
+ const log10 = logger ?? createLogger();
4338
4447
  return async (c, next) => {
4339
4448
  const start = Date.now();
4340
4449
  await next();
4341
4450
  const duration = Date.now() - start;
4342
- log4.info(`${c.req.method} ${c.req.path}`, {
4451
+ log10.info(`${c.req.method} ${c.req.path}`, {
4343
4452
  method: c.req.method,
4344
4453
  path: c.req.path,
4345
4454
  status: c.res.status,
@@ -4349,6 +4458,158 @@ function requestLoggerMiddleware(logger) {
4349
4458
  };
4350
4459
  }
4351
4460
 
4461
+ // ../../node_modules/.bun/hono@4.12.3/node_modules/hono/dist/utils/stream.js
4462
+ var StreamingApi = class {
4463
+ writer;
4464
+ encoder;
4465
+ writable;
4466
+ abortSubscribers = [];
4467
+ responseReadable;
4468
+ aborted = false;
4469
+ closed = false;
4470
+ constructor(writable, _readable) {
4471
+ this.writable = writable;
4472
+ this.writer = writable.getWriter();
4473
+ this.encoder = new TextEncoder;
4474
+ const reader = _readable.getReader();
4475
+ this.abortSubscribers.push(async () => {
4476
+ await reader.cancel();
4477
+ });
4478
+ this.responseReadable = new ReadableStream({
4479
+ async pull(controller) {
4480
+ const { done, value } = await reader.read();
4481
+ done ? controller.close() : controller.enqueue(value);
4482
+ },
4483
+ cancel: () => {
4484
+ this.abort();
4485
+ }
4486
+ });
4487
+ }
4488
+ async write(input) {
4489
+ try {
4490
+ if (typeof input === "string") {
4491
+ input = this.encoder.encode(input);
4492
+ }
4493
+ await this.writer.write(input);
4494
+ } catch {}
4495
+ return this;
4496
+ }
4497
+ async writeln(input) {
4498
+ await this.write(input + `
4499
+ `);
4500
+ return this;
4501
+ }
4502
+ sleep(ms) {
4503
+ return new Promise((res) => setTimeout(res, ms));
4504
+ }
4505
+ async close() {
4506
+ try {
4507
+ await this.writer.close();
4508
+ } catch {}
4509
+ this.closed = true;
4510
+ }
4511
+ async pipe(body) {
4512
+ this.writer.releaseLock();
4513
+ await body.pipeTo(this.writable, { preventClose: true });
4514
+ this.writer = this.writable.getWriter();
4515
+ }
4516
+ onAbort(listener) {
4517
+ this.abortSubscribers.push(listener);
4518
+ }
4519
+ abort() {
4520
+ if (!this.aborted) {
4521
+ this.aborted = true;
4522
+ this.abortSubscribers.forEach((subscriber) => subscriber());
4523
+ }
4524
+ }
4525
+ };
4526
+
4527
+ // ../../node_modules/.bun/hono@4.12.3/node_modules/hono/dist/helper/streaming/utils.js
4528
+ var isOldBunVersion = () => {
4529
+ const version = typeof Bun !== "undefined" ? Bun.version : undefined;
4530
+ if (version === undefined) {
4531
+ return false;
4532
+ }
4533
+ const result = version.startsWith("1.1") || version.startsWith("1.0") || version.startsWith("0.");
4534
+ isOldBunVersion = () => result;
4535
+ return result;
4536
+ };
4537
+
4538
+ // ../../node_modules/.bun/hono@4.12.3/node_modules/hono/dist/helper/streaming/stream.js
4539
+ var contextStash = /* @__PURE__ */ new WeakMap;
4540
+ var stream = (c, cb, onError) => {
4541
+ const { readable, writable } = new TransformStream;
4542
+ const stream2 = new StreamingApi(writable, readable);
4543
+ if (isOldBunVersion()) {
4544
+ c.req.raw.signal.addEventListener("abort", () => {
4545
+ if (!stream2.closed) {
4546
+ stream2.abort();
4547
+ }
4548
+ });
4549
+ }
4550
+ contextStash.set(stream2.responseReadable, c);
4551
+ (async () => {
4552
+ try {
4553
+ await cb(stream2);
4554
+ } catch (e) {
4555
+ if (e === undefined) {} else if (e instanceof Error && onError) {
4556
+ await onError(e, stream2);
4557
+ } else {
4558
+ console.error(e);
4559
+ }
4560
+ } finally {
4561
+ stream2.close();
4562
+ }
4563
+ })();
4564
+ return c.newResponse(stream2.responseReadable);
4565
+ };
4566
+
4567
+ // src/sse.ts
4568
+ function sseHeaders() {
4569
+ return {
4570
+ "Content-Type": "text/event-stream",
4571
+ "Cache-Control": "no-cache",
4572
+ Connection: "keep-alive",
4573
+ "X-Accel-Buffering": "no"
4574
+ };
4575
+ }
4576
+ function formatSSE(event, data) {
4577
+ const json = JSON.stringify(data);
4578
+ if (event === "message") {
4579
+ return `data: ${json}
4580
+
4581
+ `;
4582
+ }
4583
+ return `event: ${event}
4584
+ data: ${json}
4585
+
4586
+ `;
4587
+ }
4588
+ function streamResponse(c, source) {
4589
+ const headers = sseHeaders();
4590
+ for (const [key, value] of Object.entries(headers)) {
4591
+ c.header(key, value);
4592
+ }
4593
+ return stream(c, async (s) => {
4594
+ try {
4595
+ for await (const event of source) {
4596
+ const sseData = formatSSE("message", event);
4597
+ await s.write(sseData);
4598
+ }
4599
+ } catch (err2) {
4600
+ const errorEvent = {
4601
+ type: "error",
4602
+ error: err2 instanceof Error ? err2 : new Error(String(err2))
4603
+ };
4604
+ const sseData = formatSSE("error", {
4605
+ type: "error",
4606
+ message: errorEvent.error.message
4607
+ });
4608
+ await s.write(sseData);
4609
+ }
4610
+ });
4611
+ }
4612
+
4352
4613
  // src/routes.ts
4353
4614
  function parseJsonBody(raw2) {
4354
4615
  try {
@@ -4421,6 +4682,14 @@ function createRoutes(deps) {
4421
4682
  if ("error" in resolved) {
4422
4683
  return c.json({ error: resolved.error }, 404);
4423
4684
  }
4685
+ if (body.stream) {
4686
+ const stream2 = deps.gateway.stream({
4687
+ messages: [{ role: "user", content: body.message }],
4688
+ system: resolved.agent.config.system,
4689
+ model: resolved.agent.config.model
4690
+ });
4691
+ return streamResponse(c, stream2);
4692
+ }
4424
4693
  let result;
4425
4694
  try {
4426
4695
  result = await resolved.agent.run(body.message);
@@ -4467,6 +4736,16 @@ function createRoutes(deps) {
4467
4736
  role: m.role,
4468
4737
  content: m.content
4469
4738
  }));
4739
+ if (body.stream) {
4740
+ const stream2 = deps.gateway.stream({
4741
+ messages,
4742
+ model: body.model,
4743
+ system: body.system,
4744
+ maxTokens: body.maxTokens,
4745
+ temperature: body.temperature
4746
+ });
4747
+ return streamResponse(c, stream2);
4748
+ }
4470
4749
  let response;
4471
4750
  try {
4472
4751
  response = await deps.gateway.complete({
@@ -4507,13 +4786,13 @@ function createRoutes(deps) {
4507
4786
  }
4508
4787
 
4509
4788
  // src/app.ts
4510
- var log4 = createLogger();
4789
+ var log10 = createLogger();
4511
4790
  function createApp(config) {
4512
4791
  const app = new Hono2;
4513
4792
  app.onError((err2, c) => {
4514
4793
  const statusCode = err2 instanceof ElsiumError ? err2.statusCode ?? 500 : 500;
4515
4794
  const code = err2 instanceof ElsiumError ? err2.code : "UNKNOWN";
4516
- log4.error("Unhandled error", { error: err2.message, code, path: c.req.path });
4795
+ log10.error("Unhandled error", { error: err2.message, code, path: c.req.path });
4517
4796
  return c.json({ error: err2.message, code }, statusCode);
4518
4797
  });
4519
4798
  app.notFound((c) => {
@@ -4534,7 +4813,7 @@ function createApp(config) {
4534
4813
  });
4535
4814
  const serverConfig = config.server ?? {};
4536
4815
  app.use("*", requestIdMiddleware());
4537
- app.use("*", requestLoggerMiddleware(log4));
4816
+ app.use("*", requestLoggerMiddleware(log10));
4538
4817
  if (serverConfig.cors) {
4539
4818
  app.use("*", corsMiddleware(serverConfig.cors));
4540
4819
  }
@@ -4578,11 +4857,11 @@ function createApp(config) {
4578
4857
  const drainTimeoutMs = typeof serverConfig.gracefulShutdown === "object" ? serverConfig.gracefulShutdown.drainTimeoutMs : undefined;
4579
4858
  shutdownManager = createShutdownManager({
4580
4859
  drainTimeoutMs,
4581
- onDrainStart: () => log4.info("Draining connections..."),
4582
- onDrainComplete: () => log4.info("Drain complete")
4860
+ onDrainStart: () => log10.info("Draining connections..."),
4861
+ onDrainComplete: () => log10.info("Drain complete")
4583
4862
  });
4584
4863
  }
4585
- log4.info("ElsiumAI server started", {
4864
+ log10.info("ElsiumAI server started", {
4586
4865
  url: `http://${hostname}:${listenPort}`,
4587
4866
  routes: ["POST /chat", "POST /complete", "GET /health", "GET /metrics", "GET /agents"]
4588
4867
  });
@@ -4599,7 +4878,7 @@ function createApp(config) {
4599
4878
  };
4600
4879
  }
4601
4880
  // src/rbac.ts
4602
- var log5 = createLogger();
4881
+ var log11 = createLogger();
4603
4882
  var BUILT_IN_ROLES = [
4604
4883
  {
4605
4884
  name: "admin",
@@ -4637,7 +4916,7 @@ function matchPermission(granted, required) {
4637
4916
  }
4638
4917
  function createRBAC(config) {
4639
4918
  if (config.trustRoleHeader === true) {
4640
- log5.warn("RBAC: trustRoleHeader is enabled — any client can self-assign roles via the X-Role header. Only use this in development or behind a trusted reverse proxy.");
4919
+ log11.warn("RBAC: trustRoleHeader is enabled — any client can self-assign roles via the X-Role header. Only use this in development or behind a trusted reverse proxy.");
4641
4920
  }
4642
4921
  const roleMap = new Map;
4643
4922
  for (const role of BUILT_IN_ROLES) {
@@ -4693,10 +4972,62 @@ function createRBAC(config) {
4693
4972
  }
4694
4973
  };
4695
4974
  }
4975
+ // src/tenant.ts
4976
+ var log12 = createLogger();
4977
+ function tenantMiddleware(config) {
4978
+ const { extractTenant, onUnknownTenant = "reject", defaultTenant } = config;
4979
+ return async (c, next) => {
4980
+ const tenant = extractTenant(c);
4981
+ if (!tenant) {
4982
+ if (onUnknownTenant === "default" && defaultTenant) {
4983
+ c.set("tenant", defaultTenant);
4984
+ log12.debug("Using default tenant", { tenantId: defaultTenant.tenantId });
4985
+ } else {
4986
+ return c.json({ error: "Tenant identification required" }, 401);
4987
+ }
4988
+ } else {
4989
+ c.set("tenant", tenant);
4990
+ log12.debug("Tenant identified", { tenantId: tenant.tenantId });
4991
+ }
4992
+ await next();
4993
+ };
4994
+ }
4995
+ function tenantRateLimitMiddleware() {
4996
+ const windows = new Map;
4997
+ return async (c, next) => {
4998
+ const tenant = c.get("tenant");
4999
+ if (!tenant?.limits?.maxRequestsPerMinute) {
5000
+ await next();
5001
+ return;
5002
+ }
5003
+ const limit = tenant.limits.maxRequestsPerMinute;
5004
+ const now = Date.now();
5005
+ const windowMs = 60000;
5006
+ const key = tenant.tenantId;
5007
+ let entry = windows.get(key);
5008
+ if (!entry || now - entry.windowStart > windowMs) {
5009
+ entry = { count: 0, windowStart: now };
5010
+ windows.set(key, entry);
5011
+ }
5012
+ entry.count++;
5013
+ if (entry.count > limit) {
5014
+ return c.json({
5015
+ error: "Rate limit exceeded",
5016
+ retryAfterMs: windowMs - (now - entry.windowStart)
5017
+ }, 429);
5018
+ }
5019
+ await next();
5020
+ };
5021
+ }
4696
5022
  export {
5023
+ tenantRateLimitMiddleware,
5024
+ tenantMiddleware,
5025
+ streamResponse,
5026
+ sseHeaders,
4697
5027
  requestLoggerMiddleware,
4698
5028
  requestIdMiddleware,
4699
5029
  rateLimitMiddleware,
5030
+ formatSSE,
4700
5031
  createRoutes,
4701
5032
  createRBAC,
4702
5033
  createApp,
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAkC3B,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAyKnD"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAmC3B,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CA6LnD"}
package/dist/sse.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { ElsiumStream } from '@elsium-ai/core';
2
+ import type { Context } from 'hono';
3
+ export declare function sseHeaders(): Record<string, string>;
4
+ export declare function formatSSE(event: string, data: unknown): string;
5
+ export declare function streamResponse(c: Context, source: ElsiumStream): Response;
6
+ //# sourceMappingURL=sse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../src/sse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,iBAAiB,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOnD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAM9D;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,QAAQ,CAwBzE"}
@@ -0,0 +1,15 @@
1
+ import type { TenantContext } from '@elsium-ai/core';
2
+ import type { Context, Next } from 'hono';
3
+ export interface TenantMiddlewareConfig {
4
+ extractTenant: (c: Context) => TenantContext | null;
5
+ onUnknownTenant?: 'reject' | 'default';
6
+ defaultTenant?: TenantContext;
7
+ }
8
+ export declare function tenantMiddleware(config: TenantMiddlewareConfig): (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{
9
+ error: string;
10
+ }, 401, "json">) | undefined>;
11
+ export declare function tenantRateLimitMiddleware(): (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{
12
+ error: string;
13
+ retryAfterMs: number;
14
+ }, 429, "json">) | undefined>;
15
+ //# sourceMappingURL=tenant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../src/tenant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAIzC,MAAM,WAAW,sBAAsB;IACtC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,aAAa,GAAG,IAAI,CAAA;IACnD,eAAe,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IACtC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC7B;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,IAGhD,GAAG,OAAO,EAAE,MAAM,IAAI;;8BAiBpC;AAOD,wBAAgB,yBAAyB,KAG1B,GAAG,OAAO,EAAE,MAAM,IAAI;;;8BAiCpC"}
package/dist/types.d.ts CHANGED
@@ -86,4 +86,30 @@ export interface MetricsResponse {
86
86
  cost: number;
87
87
  }>;
88
88
  }
89
+ export interface StreamChatEvent {
90
+ type: 'text_delta' | 'message_end' | 'error';
91
+ text?: string;
92
+ usage?: {
93
+ inputTokens: number;
94
+ outputTokens: number;
95
+ totalTokens: number;
96
+ };
97
+ error?: string;
98
+ }
99
+ export interface StreamCompleteEvent {
100
+ type: 'text_delta' | 'tool_call_start' | 'tool_call_delta' | 'message_end' | 'error';
101
+ text?: string;
102
+ toolCall?: {
103
+ id: string;
104
+ name: string;
105
+ };
106
+ toolCallId?: string;
107
+ arguments?: string;
108
+ usage?: {
109
+ inputTokens: number;
110
+ outputTokens: number;
111
+ totalTokens: number;
112
+ };
113
+ error?: string;
114
+ }
89
115
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[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;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC3E;AAID,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,OAAO,CAAA;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,aAAa,GAAG,OAAO,CAAA;IACpF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACvC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAA;CACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elsium-ai/app",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "App bootstrap, HTTP server, and API routes for ElsiumAI",
5
5
  "license": "MIT",
6
6
  "author": "Eric Utrera <ebutrera9103@gmail.com>",
@@ -26,13 +26,13 @@
26
26
  "dev": "bun --watch src/index.ts"
27
27
  },
28
28
  "dependencies": {
29
- "@elsium-ai/core": "^0.2.3",
30
- "@elsium-ai/gateway": "^0.2.3",
31
- "@elsium-ai/agents": "^0.2.3",
32
- "@elsium-ai/tools": "^0.2.3",
33
- "@elsium-ai/observe": "^0.2.3",
34
- "@elsium-ai/rag": "^0.2.3",
35
- "@elsium-ai/workflows": "^0.2.3",
29
+ "@elsium-ai/core": "^0.3.0",
30
+ "@elsium-ai/gateway": "^0.3.0",
31
+ "@elsium-ai/agents": "^0.3.0",
32
+ "@elsium-ai/tools": "^0.3.0",
33
+ "@elsium-ai/observe": "^0.3.0",
34
+ "@elsium-ai/rag": "^0.3.0",
35
+ "@elsium-ai/workflows": "^0.3.0",
36
36
  "@hono/node-server": "^1.13.0",
37
37
  "hono": "^4.7.0",
38
38
  "zod": "^3.24.0"