@elevasis/core 0.46.0 → 0.47.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.
@@ -0,0 +1,12 @@
1
+ export {
2
+ PublicAgentChatSlugParamSchema,
3
+ PublicAgentChatSessionParamSchema,
4
+ PublicAgentChatAuthorizeSchema,
5
+ PublicAgentChatCreateSessionSchema,
6
+ PublicAgentChatCapabilityQuerySchema,
7
+ type PublicAgentChatSlugParams,
8
+ type PublicAgentChatSessionParams,
9
+ type PublicAgentChatAuthorizeInput,
10
+ type PublicAgentChatCreateSessionInput,
11
+ type PublicAgentChatCapabilityQuery
12
+ } from './api-schemas'
@@ -113,13 +113,32 @@ export const ExecuteTurnSchema = z
113
113
  * - resourceId validated as string (resource identifiers)
114
114
  * - Limit bounded (prevents DoS via large result sets)
115
115
  */
116
- export const ListSessionsQuerySchema = z
117
- .object({
118
- userId: UuidSchema.optional(),
119
- resourceId: z.string().optional(),
120
- limit: z.coerce.number().int().min(1).max(100).default(20)
121
- })
122
- .strict()
116
+ export const ListSessionsQuerySchema = z
117
+ .object({
118
+ userId: UuidSchema.optional(),
119
+ resourceId: z.string().optional(),
120
+ limit: z.coerce.number().int().min(1).max(100).default(20)
121
+ })
122
+ .strict()
123
+
124
+ /**
125
+ * Get session messages with cursor pagination
126
+ * GET /sessions/:sessionId/messages
127
+ *
128
+ * Cursor:
129
+ * - cursor is the last seen message_index
130
+ * - next page returns rows where message_index > cursor
131
+ *
132
+ * Security:
133
+ * - Limit bounded to prevent unbounded transcript reads
134
+ * - Cursor coerced and validated as a non-negative integer
135
+ */
136
+ export const SessionMessagesQuerySchema = z
137
+ .object({
138
+ limit: z.coerce.number().int().min(1).max(100).default(100),
139
+ cursor: z.coerce.number().int().min(0).optional()
140
+ })
141
+ .strict()
123
142
 
124
143
  // ============================================================================
125
144
  // WebSocket Messages
@@ -160,7 +179,8 @@ export const WebSocketSessionTurnSchema = z
160
179
  // ============================================================================
161
180
 
162
181
  // Export inferred types for use in route handlers
163
- export type CreateSessionInput = z.infer<typeof CreateSessionSchema>
164
- export type ExecuteTurnInput = z.infer<typeof ExecuteTurnSchema>
165
- export type ListSessionsQuery = z.infer<typeof ListSessionsQuerySchema>
166
- export type WebSocketSessionTurnMessage = z.infer<typeof WebSocketSessionTurnSchema>
182
+ export type CreateSessionInput = z.infer<typeof CreateSessionSchema>
183
+ export type ExecuteTurnInput = z.infer<typeof ExecuteTurnSchema>
184
+ export type ListSessionsQuery = z.infer<typeof ListSessionsQuerySchema>
185
+ export type SessionMessagesQuery = z.infer<typeof SessionMessagesQuerySchema>
186
+ export type WebSocketSessionTurnMessage = z.infer<typeof WebSocketSessionTurnSchema>
@@ -12,15 +12,17 @@ export type {
12
12
 
13
13
  // Export validation schemas
14
14
  export {
15
- CreateSessionSchema,
16
- ExecuteTurnSchema,
17
- ListSessionsQuerySchema,
18
- SessionIdParamSchema,
19
- ExecutionIdParamsSchema,
20
- WebSocketSessionTurnSchema,
21
- UuidSchema,
22
- type CreateSessionInput,
23
- type ExecuteTurnInput,
24
- type ListSessionsQuery,
25
- type WebSocketSessionTurnMessage
26
- } from './api-schemas'
15
+ CreateSessionSchema,
16
+ ExecuteTurnSchema,
17
+ ListSessionsQuerySchema,
18
+ SessionMessagesQuerySchema,
19
+ SessionIdParamSchema,
20
+ ExecutionIdParamsSchema,
21
+ WebSocketSessionTurnSchema,
22
+ UuidSchema,
23
+ type CreateSessionInput,
24
+ type ExecuteTurnInput,
25
+ type ListSessionsQuery,
26
+ type SessionMessagesQuery,
27
+ type WebSocketSessionTurnMessage
28
+ } from './api-schemas'
@@ -1,3 +1,3 @@
1
1
  export const VERSION = {
2
- CURRENT: '1.12.19'
2
+ CURRENT: '1.13.4'
3
3
  }
@@ -2118,6 +2118,138 @@ export type Database = {
2118
2118
  }
2119
2119
  Relationships: []
2120
2120
  }
2121
+ agent_access_grants: {
2122
+ Row: {
2123
+ allowed_origins: string[]
2124
+ branding: Json
2125
+ capture_fields: Json
2126
+ code_hash: string | null
2127
+ code_salt: string | null
2128
+ created_at: string
2129
+ disabled_at: string | null
2130
+ expires_at: string | null
2131
+ id: string
2132
+ max_sessions_per_visitor: number
2133
+ max_turns_per_session: number
2134
+ mode: string
2135
+ organization_id: string
2136
+ resource_id: string
2137
+ slug: string
2138
+ tool_policy: Json
2139
+ updated_at: string
2140
+ }
2141
+ Insert: {
2142
+ allowed_origins?: string[]
2143
+ branding?: Json
2144
+ capture_fields?: Json
2145
+ code_hash?: string | null
2146
+ code_salt?: string | null
2147
+ created_at?: string
2148
+ disabled_at?: string | null
2149
+ expires_at?: string | null
2150
+ id?: string
2151
+ max_sessions_per_visitor?: number
2152
+ max_turns_per_session?: number
2153
+ mode?: string
2154
+ organization_id: string
2155
+ resource_id: string
2156
+ slug: string
2157
+ tool_policy?: Json
2158
+ updated_at?: string
2159
+ }
2160
+ Update: {
2161
+ allowed_origins?: string[]
2162
+ branding?: Json
2163
+ capture_fields?: Json
2164
+ code_hash?: string | null
2165
+ code_salt?: string | null
2166
+ created_at?: string
2167
+ disabled_at?: string | null
2168
+ expires_at?: string | null
2169
+ id?: string
2170
+ max_sessions_per_visitor?: number
2171
+ max_turns_per_session?: number
2172
+ mode?: string
2173
+ organization_id?: string
2174
+ resource_id?: string
2175
+ slug?: string
2176
+ tool_policy?: Json
2177
+ updated_at?: string
2178
+ }
2179
+ Relationships: [
2180
+ {
2181
+ foreignKeyName: "agent_access_grants_organization_id_fkey"
2182
+ columns: ["organization_id"]
2183
+ isOneToOne: false
2184
+ referencedRelation: "organizations"
2185
+ referencedColumns: ["id"]
2186
+ },
2187
+ ]
2188
+ }
2189
+ agent_chat_capabilities: {
2190
+ Row: {
2191
+ created_at: string
2192
+ expires_at: string
2193
+ grant_id: string
2194
+ id: string
2195
+ organization_id: string
2196
+ origin: string | null
2197
+ resource_id: string
2198
+ revoked_at: string | null
2199
+ session_id: string | null
2200
+ token_hash: string
2201
+ visitor_id: string | null
2202
+ }
2203
+ Insert: {
2204
+ created_at?: string
2205
+ expires_at: string
2206
+ grant_id: string
2207
+ id?: string
2208
+ organization_id: string
2209
+ origin?: string | null
2210
+ resource_id: string
2211
+ revoked_at?: string | null
2212
+ session_id?: string | null
2213
+ token_hash: string
2214
+ visitor_id?: string | null
2215
+ }
2216
+ Update: {
2217
+ created_at?: string
2218
+ expires_at?: string
2219
+ grant_id?: string
2220
+ id?: string
2221
+ organization_id?: string
2222
+ origin?: string | null
2223
+ resource_id?: string
2224
+ revoked_at?: string | null
2225
+ session_id?: string | null
2226
+ token_hash?: string
2227
+ visitor_id?: string | null
2228
+ }
2229
+ Relationships: [
2230
+ {
2231
+ foreignKeyName: "agent_chat_capabilities_grant_id_fkey"
2232
+ columns: ["grant_id"]
2233
+ isOneToOne: false
2234
+ referencedRelation: "agent_access_grants"
2235
+ referencedColumns: ["id"]
2236
+ },
2237
+ {
2238
+ foreignKeyName: "agent_chat_capabilities_organization_id_fkey"
2239
+ columns: ["organization_id"]
2240
+ isOneToOne: false
2241
+ referencedRelation: "organizations"
2242
+ referencedColumns: ["id"]
2243
+ },
2244
+ {
2245
+ foreignKeyName: "agent_chat_capabilities_session_id_fkey"
2246
+ columns: ["session_id"]
2247
+ isOneToOne: false
2248
+ referencedRelation: "sessions"
2249
+ referencedColumns: ["session_id"]
2250
+ },
2251
+ ]
2252
+ }
2121
2253
  organizations: {
2122
2254
  Row: {
2123
2255
  config: Json