@terreno/ai 57.3.0 → 57.4.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.
@@ -53,7 +53,13 @@ var LangfuseApp = /** @class */ (function () {
53
53
  var _a, _b, _c, _d, _e;
54
54
  var organization = (_a = this.options.organization) !== null && _a !== void 0 ? _a : "flourish-health";
55
55
  var project = (_b = this.options.project) !== null && _b !== void 0 ? _b : "terreno";
56
- (0, langfuseClient_1.initLangfuseClient)(this.options);
56
+ try {
57
+ (0, langfuseClient_1.initLangfuseClient)(this.options);
58
+ }
59
+ catch (err) {
60
+ api_1.logger.warn("Langfuse client initialization failed; continuing without Langfuse: ".concat(err));
61
+ return;
62
+ }
57
63
  if (this.options.enableTracing !== false) {
58
64
  try {
59
65
  (0, langfuseTracing_1.initTracing)(this.options);
package/package.json CHANGED
@@ -18,43 +18,43 @@
18
18
  "description": "Provider-agnostic AI service with streaming chat, request logging, and admin tools — part of Terreno, the batteries-included TypeScript framework for universal apps.",
19
19
  "devDependencies": {
20
20
  "@biomejs/biome": "^2.3.6",
21
- "@terreno/api": "57.3.0",
22
- "@terreno/test": "57.3.0",
21
+ "@terreno/api": "57.4.0",
22
+ "@terreno/test": "57.4.0",
23
23
  "@types/bun": "^1.4.0",
24
24
  "@types/express": "^5.0.6",
25
25
  "@types/luxon": "^3.7.1",
26
26
  "@types/multer": "^1.4.12",
27
27
  "@types/supertest": "^7.2.0",
28
+ "express": "^5.2.1",
28
29
  "mongoose": "9.7.4",
29
30
  "passport-local-mongoose": "^9.0.1",
30
31
  "supertest": "^7.2.2",
31
- "typescript": "~6.0.3",
32
- "winston": "^3.18.3"
32
+ "typescript": "~6.0.3"
33
33
  },
34
34
  "exports": {
35
35
  ".": {
36
- "types": "./dist/index.d.ts",
36
+ "default": "./dist/index.js",
37
37
  "import": "./dist/index.js",
38
38
  "require": "./dist/index.js",
39
- "default": "./dist/index.js"
40
- },
41
- "./langfuseClient": {
42
- "types": "./dist/langfuseClient.d.ts",
43
- "import": "./dist/langfuseClient.js",
44
- "require": "./dist/langfuseClient.js",
45
- "default": "./dist/langfuseClient.js"
39
+ "types": "./dist/index.d.ts"
46
40
  },
47
41
  "./langfuseApp": {
48
- "types": "./dist/langfuseApp.d.ts",
42
+ "default": "./dist/langfuseApp.js",
49
43
  "import": "./dist/langfuseApp.js",
50
44
  "require": "./dist/langfuseApp.js",
51
- "default": "./dist/langfuseApp.js"
45
+ "types": "./dist/langfuseApp.d.ts"
46
+ },
47
+ "./langfuseClient": {
48
+ "default": "./dist/langfuseClient.js",
49
+ "import": "./dist/langfuseClient.js",
50
+ "require": "./dist/langfuseClient.js",
51
+ "types": "./dist/langfuseClient.d.ts"
52
52
  },
53
53
  "./parseAiJson": {
54
- "types": "./dist/service/parseAiJson.d.ts",
54
+ "default": "./dist/service/parseAiJson.js",
55
55
  "import": "./dist/service/parseAiJson.js",
56
56
  "require": "./dist/service/parseAiJson.js",
57
- "default": "./dist/service/parseAiJson.js"
57
+ "types": "./dist/service/parseAiJson.d.ts"
58
58
  }
59
59
  },
60
60
  "homepage": "https://github.com/FlourishHealth/terreno#readme",
@@ -67,13 +67,19 @@
67
67
  "license": "MIT",
68
68
  "main": "dist/index.js",
69
69
  "name": "@terreno/ai",
70
- "publishConfig": {
71
- "access": "public"
72
- },
73
70
  "peerDependencies": {
74
- "@terreno/api": "57.3.0",
71
+ "@ai-sdk/google-vertex": "^4.0.142",
72
+ "@terreno/api": "57.4.0",
75
73
  "mongoose": "^8.0.0 || ^9.0.0"
76
74
  },
75
+ "peerDependenciesMeta": {
76
+ "@ai-sdk/google-vertex": {
77
+ "optional": true
78
+ }
79
+ },
80
+ "publishConfig": {
81
+ "access": "public"
82
+ },
77
83
  "repository": {
78
84
  "type": "git",
79
85
  "url": "git+ssh://git@github.com/FlourishHealth/terreno.git"
@@ -91,5 +97,5 @@
91
97
  "test:coverage": "bun run ../scripts/check-coverage.ts"
92
98
  },
93
99
  "types": "dist/index.d.ts",
94
- "version": "57.3.0"
100
+ "version": "57.4.0"
95
101
  }
@@ -20,7 +20,12 @@ export class LangfuseApp implements TerrenoPlugin {
20
20
  register(app: express.Application): void {
21
21
  const organization = this.options.organization ?? "flourish-health";
22
22
  const project = this.options.project ?? "terreno";
23
- initLangfuseClient(this.options);
23
+ try {
24
+ initLangfuseClient(this.options);
25
+ } catch (err) {
26
+ logger.warn(`Langfuse client initialization failed; continuing without Langfuse: ${err}`);
27
+ return;
28
+ }
24
29
 
25
30
  if (this.options.enableTracing !== false) {
26
31
  try {
@@ -5,7 +5,7 @@ import mongoose, {type Model} from "mongoose";
5
5
  import passportLocalMongoose from "passport-local-mongoose";
6
6
  import type TestAgent from "supertest/lib/agent";
7
7
 
8
- export type PasswordedUser = {setPassword: (password: string) => Promise<void>};
8
+ type PasswordedUser = {setPassword: (password: string) => Promise<void>};
9
9
 
10
10
  export interface AiTestUser {
11
11
  admin?: boolean;
@@ -20,7 +20,7 @@ export interface AiTestUserDoc {
20
20
  name?: string;
21
21
  }
22
22
 
23
- export const createTestUserModel = (): Model<AiTestUserDoc> => {
23
+ const createTestUserModel = (): Model<AiTestUserDoc> => {
24
24
  if (mongoose.models.User) {
25
25
  return mongoose.models.User as Model<AiTestUserDoc>;
26
26
  }
@@ -43,7 +43,7 @@ export const createTestUserModel = (): Model<AiTestUserDoc> => {
43
43
 
44
44
  export const UserModel = createTestUserModel();
45
45
 
46
- export const STANDARD_AI_TEST_USERS = {
46
+ const STANDARD_AI_TEST_USERS = {
47
47
  admin: {admin: true, email: "admin@example.com", name: "Admin", password: "securePassword"},
48
48
  notAdmin: {admin: false, email: "notAdmin@example.com", name: "User", password: "password"},
49
49
  } as const;