@terreno/ai 0.11.1 → 0.11.3

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,96 +1,96 @@
1
1
  export interface ScoringFunction {
2
- name: string;
3
- description: string;
4
- scoreType: "numeric" | "categorical" | "boolean";
5
2
  categories?: string[];
3
+ description: string;
4
+ name: string;
6
5
  range?: {
7
- min: number;
8
6
  max: number;
7
+ min: number;
9
8
  };
9
+ scoreType: "numeric" | "categorical" | "boolean";
10
10
  }
11
11
  export interface LangfuseAppOptions {
12
- secretKey: string;
13
- publicKey: string;
14
- /** Organization slug in Langfuse (default: "flourish-health") */
15
- organization?: string;
16
- /** Project name/slug in Langfuse (default: "terreno") */
17
- project?: string;
18
- /** Langfuse project ID (UUID) for trace URLs; optional, keys usually imply project */
19
- projectId?: string;
20
- baseUrl?: string;
21
12
  adminPath?: string;
22
- enableAdminUI?: boolean;
23
- enableTracing?: boolean;
24
- serviceName?: string;
13
+ baseUrl?: string;
25
14
  cache?: {
26
15
  promptTtlSeconds?: number;
27
16
  traceTtlSeconds?: number;
28
17
  };
18
+ enableAdminUI?: boolean;
19
+ enableTracing?: boolean;
29
20
  evaluation?: {
30
21
  enabled?: boolean;
31
22
  scoringFunctions?: ScoringFunction[];
32
23
  };
24
+ /** Organization slug in Langfuse (default: "flourish-health") */
25
+ organization?: string;
26
+ /** Project name/slug in Langfuse (default: "terreno") */
27
+ project?: string;
28
+ /** Langfuse project ID (UUID) for trace URLs; optional, keys usually imply project */
29
+ projectId?: string;
30
+ publicKey: string;
31
+ secretKey: string;
32
+ serviceName?: string;
33
33
  }
34
34
  export interface ChatMessage {
35
- role: string;
36
35
  content: string;
36
+ role: string;
37
37
  }
38
38
  export interface LangfuseCachedPrompt {
39
- name: string;
40
- version: number;
41
- type: "text" | "chat";
42
- prompt: string | ChatMessage[];
43
39
  config: Record<string, unknown>;
44
40
  labels: string[];
41
+ name: string;
42
+ prompt: string | ChatMessage[];
45
43
  tags: string[];
44
+ type: "text" | "chat";
45
+ version: number;
46
46
  }
47
47
  export interface TelemetrySettings {
48
- isEnabled?: boolean;
49
48
  functionId?: string;
49
+ isEnabled?: boolean;
50
50
  metadata?: Record<string, string | number | boolean>;
51
51
  }
52
52
  export interface PreparePromptResult {
53
- prompt?: string;
54
- messages?: ChatMessage[];
55
53
  config: Record<string, unknown>;
54
+ messages?: ChatMessage[];
55
+ prompt?: string;
56
56
  telemetry: TelemetrySettings;
57
57
  }
58
58
  export interface GetPromptOptions {
59
59
  label?: string;
60
- variables?: Record<string, string>;
61
60
  userId?: string;
61
+ variables?: Record<string, string>;
62
62
  }
63
63
  export interface PromptListItem {
64
- name: string;
65
- version: number;
66
- type: "text" | "chat";
64
+ createdAt: string;
67
65
  labels: string[];
66
+ name: string;
68
67
  tags: string[];
69
- createdAt: string;
68
+ type: "text" | "chat";
69
+ version: number;
70
70
  }
71
71
  export interface TraceListItem {
72
72
  id: string;
73
+ input?: unknown;
74
+ metadata?: Record<string, unknown>;
73
75
  name: string;
74
- userId?: string;
76
+ output?: unknown;
75
77
  sessionId?: string;
76
78
  timestamp: string;
77
- input?: unknown;
78
- output?: unknown;
79
- metadata?: Record<string, unknown>;
79
+ userId?: string;
80
80
  }
81
81
  export interface PaginatedResult<T> {
82
82
  data: T[];
83
83
  meta: {
84
- page: number;
85
84
  limit: number;
85
+ page: number;
86
86
  total: number;
87
87
  totalPages: number;
88
88
  };
89
89
  }
90
90
  export interface ScoreSubmission {
91
- traceId: string;
92
- name: string;
93
- value: number | string;
94
91
  comment?: string;
95
92
  dataType?: "NUMERIC" | "CATEGORICAL" | "BOOLEAN";
93
+ name: string;
94
+ traceId: string;
95
+ value: number | string;
96
96
  }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "@langfuse/otel": "^5.0.1",
11
11
  "@opentelemetry/api": "^1.9.0",
12
12
  "@opentelemetry/sdk-node": "^0.213.0",
13
- "@terreno/api": "0.11.1",
13
+ "@terreno/api": "0.11.3",
14
14
  "ai": "^6.0.97",
15
15
  "multer": "^1.4.5-lts.1"
16
16
  },
@@ -30,8 +30,22 @@
30
30
  },
31
31
  "exports": {
32
32
  ".": {
33
- "default": "./dist/index.js",
34
- "types": "./dist/index.d.ts"
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.js",
35
+ "require": "./dist/index.js",
36
+ "default": "./dist/index.js"
37
+ },
38
+ "./langfuseClient": {
39
+ "types": "./dist/langfuseClient.d.ts",
40
+ "import": "./dist/langfuseClient.js",
41
+ "require": "./dist/langfuseClient.js",
42
+ "default": "./dist/langfuseClient.js"
43
+ },
44
+ "./langfuseApp": {
45
+ "types": "./dist/langfuseApp.d.ts",
46
+ "import": "./dist/langfuseApp.js",
47
+ "require": "./dist/langfuseApp.js",
48
+ "default": "./dist/langfuseApp.js"
35
49
  }
36
50
  },
37
51
  "homepage": "https://github.com/FlourishHealth/terreno#readme",
@@ -48,7 +62,7 @@
48
62
  "access": "public"
49
63
  },
50
64
  "peerDependencies": {
51
- "@terreno/api": "0.11.1",
65
+ "@terreno/api": "0.11.3",
52
66
  "mongoose": "^8.0.0"
53
67
  },
54
68
  "repository": {
@@ -67,5 +81,5 @@
67
81
  "test:coverage": "bun run ../scripts/check-coverage.ts"
68
82
  },
69
83
  "types": "dist/index.d.ts",
70
- "version": "0.11.1"
84
+ "version": "0.11.3"
71
85
  }
@@ -1,103 +1,103 @@
1
1
  export interface ScoringFunction {
2
- name: string;
2
+ categories?: string[];
3
3
  description: string;
4
+ name: string;
5
+ range?: {max: number; min: number};
4
6
  scoreType: "numeric" | "categorical" | "boolean";
5
- categories?: string[];
6
- range?: {min: number; max: number};
7
7
  }
8
8
 
9
9
  export interface LangfuseAppOptions {
10
- secretKey: string;
11
- publicKey: string;
12
- /** Organization slug in Langfuse (default: "flourish-health") */
13
- organization?: string;
14
- /** Project name/slug in Langfuse (default: "terreno") */
15
- project?: string;
16
- /** Langfuse project ID (UUID) for trace URLs; optional, keys usually imply project */
17
- projectId?: string;
18
- baseUrl?: string;
19
10
  adminPath?: string;
20
- enableAdminUI?: boolean;
21
- enableTracing?: boolean;
22
- serviceName?: string;
11
+ baseUrl?: string;
23
12
  cache?: {
24
13
  promptTtlSeconds?: number;
25
14
  traceTtlSeconds?: number;
26
15
  };
16
+ enableAdminUI?: boolean;
17
+ enableTracing?: boolean;
27
18
  evaluation?: {
28
19
  enabled?: boolean;
29
20
  scoringFunctions?: ScoringFunction[];
30
21
  };
22
+ /** Organization slug in Langfuse (default: "flourish-health") */
23
+ organization?: string;
24
+ /** Project name/slug in Langfuse (default: "terreno") */
25
+ project?: string;
26
+ /** Langfuse project ID (UUID) for trace URLs; optional, keys usually imply project */
27
+ projectId?: string;
28
+ publicKey: string;
29
+ secretKey: string;
30
+ serviceName?: string;
31
31
  }
32
32
 
33
33
  export interface ChatMessage {
34
- role: string;
35
34
  content: string;
35
+ role: string;
36
36
  }
37
37
 
38
38
  export interface LangfuseCachedPrompt {
39
- name: string;
40
- version: number;
41
- type: "text" | "chat";
42
- prompt: string | ChatMessage[];
43
39
  config: Record<string, unknown>;
44
40
  labels: string[];
41
+ name: string;
42
+ prompt: string | ChatMessage[];
45
43
  tags: string[];
44
+ type: "text" | "chat";
45
+ version: number;
46
46
  }
47
47
 
48
48
  export interface TelemetrySettings {
49
- isEnabled?: boolean;
50
49
  functionId?: string;
50
+ isEnabled?: boolean;
51
51
  metadata?: Record<string, string | number | boolean>;
52
52
  }
53
53
 
54
54
  export interface PreparePromptResult {
55
- prompt?: string;
56
- messages?: ChatMessage[];
57
55
  config: Record<string, unknown>;
56
+ messages?: ChatMessage[];
57
+ prompt?: string;
58
58
  telemetry: TelemetrySettings;
59
59
  }
60
60
 
61
61
  export interface GetPromptOptions {
62
62
  label?: string;
63
- variables?: Record<string, string>;
64
63
  userId?: string;
64
+ variables?: Record<string, string>;
65
65
  }
66
66
 
67
67
  export interface PromptListItem {
68
- name: string;
69
- version: number;
70
- type: "text" | "chat";
68
+ createdAt: string;
71
69
  labels: string[];
70
+ name: string;
72
71
  tags: string[];
73
- createdAt: string;
72
+ type: "text" | "chat";
73
+ version: number;
74
74
  }
75
75
 
76
76
  export interface TraceListItem {
77
77
  id: string;
78
+ input?: unknown;
79
+ metadata?: Record<string, unknown>;
78
80
  name: string;
79
- userId?: string;
81
+ output?: unknown;
80
82
  sessionId?: string;
81
83
  timestamp: string;
82
- input?: unknown;
83
- output?: unknown;
84
- metadata?: Record<string, unknown>;
84
+ userId?: string;
85
85
  }
86
86
 
87
87
  export interface PaginatedResult<T> {
88
88
  data: T[];
89
89
  meta: {
90
- page: number;
91
90
  limit: number;
91
+ page: number;
92
92
  total: number;
93
93
  totalPages: number;
94
94
  };
95
95
  }
96
96
 
97
97
  export interface ScoreSubmission {
98
- traceId: string;
99
- name: string;
100
- value: number | string;
101
98
  comment?: string;
102
99
  dataType?: "NUMERIC" | "CATEGORICAL" | "BOOLEAN";
100
+ name: string;
101
+ traceId: string;
102
+ value: number | string;
103
103
  }