@vectorize-io/hindsight-client 0.4.14 → 0.4.16

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.
@@ -618,6 +618,42 @@ export type CreateMentalModelResponse = {
618
618
  operation_id: string;
619
619
  };
620
620
 
621
+ /**
622
+ * CreateWebhookRequest
623
+ *
624
+ * Request model for registering a webhook.
625
+ */
626
+ export type CreateWebhookRequest = {
627
+ /**
628
+ * Url
629
+ *
630
+ * HTTP(S) endpoint URL to deliver events to
631
+ */
632
+ url: string;
633
+ /**
634
+ * Secret
635
+ *
636
+ * HMAC-SHA256 signing secret (optional)
637
+ */
638
+ secret?: string | null;
639
+ /**
640
+ * Event Types
641
+ *
642
+ * List of event types to deliver. Currently supported: 'consolidation.completed'
643
+ */
644
+ event_types?: Array<string>;
645
+ /**
646
+ * Enabled
647
+ *
648
+ * Whether this webhook is active
649
+ */
650
+ enabled?: boolean;
651
+ /**
652
+ * HTTP delivery configuration (method, timeout, headers, params)
653
+ */
654
+ http_config?: WebhookHttpConfig;
655
+ };
656
+
621
657
  /**
622
658
  * DeleteDocumentResponse
623
659
  *
@@ -1165,6 +1201,8 @@ export type MemoryItem = {
1165
1201
  content: string;
1166
1202
  /**
1167
1203
  * Timestamp
1204
+ *
1205
+ * When the content occurred. Accepts an ISO 8601 datetime string (e.g. '2024-01-15T10:30:00Z'), null/omitted (defaults to now), or the special string 'unset' to explicitly store without any timestamp (use this for timeless content such as fictional documents or static reference material).
1168
1206
  */
1169
1207
  timestamp?: string | null;
1170
1208
  /**
@@ -1195,6 +1233,17 @@ export type MemoryItem = {
1195
1233
  * Optional tags for visibility scoping. Memories with tags can be filtered during recall.
1196
1234
  */
1197
1235
  tags?: Array<string> | null;
1236
+ /**
1237
+ * ObservationScopes
1238
+ *
1239
+ * How to scope observations during consolidation. 'per_tag' runs one consolidation pass per individual tag, creating separate observations for each tag. 'combined' (default) runs a single pass with all tags together. A list of tag lists runs one pass per inner list, giving full control over which combinations to use.
1240
+ */
1241
+ observation_scopes?:
1242
+ | "per_tag"
1243
+ | "combined"
1244
+ | "all_combinations"
1245
+ | Array<Array<string>>
1246
+ | null;
1198
1247
  };
1199
1248
 
1200
1249
  /**
@@ -2062,6 +2111,42 @@ export type UpdateMentalModelRequest = {
2062
2111
  trigger?: MentalModelTrigger | null;
2063
2112
  };
2064
2113
 
2114
+ /**
2115
+ * UpdateWebhookRequest
2116
+ *
2117
+ * Request model for updating a webhook. Only provided fields are updated.
2118
+ */
2119
+ export type UpdateWebhookRequest = {
2120
+ /**
2121
+ * Url
2122
+ *
2123
+ * HTTP(S) endpoint URL
2124
+ */
2125
+ url?: string | null;
2126
+ /**
2127
+ * Secret
2128
+ *
2129
+ * HMAC-SHA256 signing secret. Omit to keep existing; send null to clear.
2130
+ */
2131
+ secret?: string | null;
2132
+ /**
2133
+ * Event Types
2134
+ *
2135
+ * List of event types
2136
+ */
2137
+ event_types?: Array<string> | null;
2138
+ /**
2139
+ * Enabled
2140
+ *
2141
+ * Whether this webhook is active
2142
+ */
2143
+ enabled?: boolean | null;
2144
+ /**
2145
+ * HTTP delivery configuration
2146
+ */
2147
+ http_config?: WebhookHttpConfig | null;
2148
+ };
2149
+
2065
2150
  /**
2066
2151
  * ValidationError
2067
2152
  */
@@ -2098,6 +2183,173 @@ export type VersionResponse = {
2098
2183
  features: FeaturesInfo;
2099
2184
  };
2100
2185
 
2186
+ /**
2187
+ * WebhookDeliveryListResponse
2188
+ *
2189
+ * Response model for listing webhook deliveries.
2190
+ */
2191
+ export type WebhookDeliveryListResponse = {
2192
+ /**
2193
+ * Items
2194
+ */
2195
+ items: Array<WebhookDeliveryResponse>;
2196
+ /**
2197
+ * Next Cursor
2198
+ */
2199
+ next_cursor?: string | null;
2200
+ };
2201
+
2202
+ /**
2203
+ * WebhookDeliveryResponse
2204
+ *
2205
+ * Response model for a webhook delivery record.
2206
+ */
2207
+ export type WebhookDeliveryResponse = {
2208
+ /**
2209
+ * Id
2210
+ */
2211
+ id: string;
2212
+ /**
2213
+ * Webhook Id
2214
+ */
2215
+ webhook_id: string | null;
2216
+ /**
2217
+ * Url
2218
+ */
2219
+ url: string;
2220
+ /**
2221
+ * Event Type
2222
+ */
2223
+ event_type: string;
2224
+ /**
2225
+ * Status
2226
+ */
2227
+ status: string;
2228
+ /**
2229
+ * Attempts
2230
+ */
2231
+ attempts: number;
2232
+ /**
2233
+ * Next Retry At
2234
+ */
2235
+ next_retry_at?: string | null;
2236
+ /**
2237
+ * Last Error
2238
+ */
2239
+ last_error?: string | null;
2240
+ /**
2241
+ * Last Response Status
2242
+ */
2243
+ last_response_status?: number | null;
2244
+ /**
2245
+ * Last Response Body
2246
+ */
2247
+ last_response_body?: string | null;
2248
+ /**
2249
+ * Last Attempt At
2250
+ */
2251
+ last_attempt_at?: string | null;
2252
+ /**
2253
+ * Created At
2254
+ */
2255
+ created_at?: string | null;
2256
+ /**
2257
+ * Updated At
2258
+ */
2259
+ updated_at?: string | null;
2260
+ };
2261
+
2262
+ /**
2263
+ * WebhookHttpConfig
2264
+ *
2265
+ * HTTP delivery configuration for a webhook.
2266
+ */
2267
+ export type WebhookHttpConfig = {
2268
+ /**
2269
+ * Method
2270
+ *
2271
+ * HTTP method: GET or POST
2272
+ */
2273
+ method?: string;
2274
+ /**
2275
+ * Timeout Seconds
2276
+ *
2277
+ * HTTP request timeout in seconds
2278
+ */
2279
+ timeout_seconds?: number;
2280
+ /**
2281
+ * Headers
2282
+ *
2283
+ * Custom HTTP headers
2284
+ */
2285
+ headers?: {
2286
+ [key: string]: string;
2287
+ };
2288
+ /**
2289
+ * Params
2290
+ *
2291
+ * Custom HTTP query parameters
2292
+ */
2293
+ params?: {
2294
+ [key: string]: string;
2295
+ };
2296
+ };
2297
+
2298
+ /**
2299
+ * WebhookListResponse
2300
+ *
2301
+ * Response model for listing webhooks.
2302
+ */
2303
+ export type WebhookListResponse = {
2304
+ /**
2305
+ * Items
2306
+ */
2307
+ items: Array<WebhookResponse>;
2308
+ };
2309
+
2310
+ /**
2311
+ * WebhookResponse
2312
+ *
2313
+ * Response model for a webhook.
2314
+ */
2315
+ export type WebhookResponse = {
2316
+ /**
2317
+ * Id
2318
+ */
2319
+ id: string;
2320
+ /**
2321
+ * Bank Id
2322
+ */
2323
+ bank_id: string | null;
2324
+ /**
2325
+ * Url
2326
+ */
2327
+ url: string;
2328
+ /**
2329
+ * Secret
2330
+ *
2331
+ * Signing secret (redacted in responses)
2332
+ */
2333
+ secret?: string | null;
2334
+ /**
2335
+ * Event Types
2336
+ */
2337
+ event_types: Array<string>;
2338
+ /**
2339
+ * Enabled
2340
+ */
2341
+ enabled: boolean;
2342
+ http_config?: WebhookHttpConfig;
2343
+ /**
2344
+ * Created At
2345
+ */
2346
+ created_at?: string | null;
2347
+ /**
2348
+ * Updated At
2349
+ */
2350
+ updated_at?: string | null;
2351
+ };
2352
+
2101
2353
  export type HealthEndpointHealthGetData = {
2102
2354
  body?: never;
2103
2355
  path?: never;
@@ -3069,8 +3321,22 @@ export type ListDocumentsData = {
3069
3321
  query?: {
3070
3322
  /**
3071
3323
  * Q
3324
+ *
3325
+ * Case-insensitive substring filter on document ID (e.g. 'report' matches 'report-2024')
3072
3326
  */
3073
3327
  q?: string | null;
3328
+ /**
3329
+ * Tags
3330
+ *
3331
+ * Filter documents by tags
3332
+ */
3333
+ tags?: Array<string> | null;
3334
+ /**
3335
+ * Tags Match
3336
+ *
3337
+ * How to match tags: 'any', 'all', 'any_strict', 'all_strict'
3338
+ */
3339
+ tags_match?: string;
3074
3340
  /**
3075
3341
  * Limit
3076
3342
  */
@@ -3872,6 +4138,217 @@ export type TriggerConsolidationResponses = {
3872
4138
  export type TriggerConsolidationResponse =
3873
4139
  TriggerConsolidationResponses[keyof TriggerConsolidationResponses];
3874
4140
 
4141
+ export type ListWebhooksData = {
4142
+ body?: never;
4143
+ headers?: {
4144
+ /**
4145
+ * Authorization
4146
+ */
4147
+ authorization?: string | null;
4148
+ };
4149
+ path: {
4150
+ /**
4151
+ * Bank Id
4152
+ */
4153
+ bank_id: string;
4154
+ };
4155
+ query?: never;
4156
+ url: "/v1/default/banks/{bank_id}/webhooks";
4157
+ };
4158
+
4159
+ export type ListWebhooksErrors = {
4160
+ /**
4161
+ * Validation Error
4162
+ */
4163
+ 422: HttpValidationError;
4164
+ };
4165
+
4166
+ export type ListWebhooksError = ListWebhooksErrors[keyof ListWebhooksErrors];
4167
+
4168
+ export type ListWebhooksResponses = {
4169
+ /**
4170
+ * Successful Response
4171
+ */
4172
+ 200: WebhookListResponse;
4173
+ };
4174
+
4175
+ export type ListWebhooksResponse =
4176
+ ListWebhooksResponses[keyof ListWebhooksResponses];
4177
+
4178
+ export type CreateWebhookData = {
4179
+ body: CreateWebhookRequest;
4180
+ headers?: {
4181
+ /**
4182
+ * Authorization
4183
+ */
4184
+ authorization?: string | null;
4185
+ };
4186
+ path: {
4187
+ /**
4188
+ * Bank Id
4189
+ */
4190
+ bank_id: string;
4191
+ };
4192
+ query?: never;
4193
+ url: "/v1/default/banks/{bank_id}/webhooks";
4194
+ };
4195
+
4196
+ export type CreateWebhookErrors = {
4197
+ /**
4198
+ * Validation Error
4199
+ */
4200
+ 422: HttpValidationError;
4201
+ };
4202
+
4203
+ export type CreateWebhookError = CreateWebhookErrors[keyof CreateWebhookErrors];
4204
+
4205
+ export type CreateWebhookResponses = {
4206
+ /**
4207
+ * Successful Response
4208
+ */
4209
+ 201: WebhookResponse;
4210
+ };
4211
+
4212
+ export type CreateWebhookResponse =
4213
+ CreateWebhookResponses[keyof CreateWebhookResponses];
4214
+
4215
+ export type DeleteWebhookData = {
4216
+ body?: never;
4217
+ headers?: {
4218
+ /**
4219
+ * Authorization
4220
+ */
4221
+ authorization?: string | null;
4222
+ };
4223
+ path: {
4224
+ /**
4225
+ * Bank Id
4226
+ */
4227
+ bank_id: string;
4228
+ /**
4229
+ * Webhook Id
4230
+ */
4231
+ webhook_id: string;
4232
+ };
4233
+ query?: never;
4234
+ url: "/v1/default/banks/{bank_id}/webhooks/{webhook_id}";
4235
+ };
4236
+
4237
+ export type DeleteWebhookErrors = {
4238
+ /**
4239
+ * Validation Error
4240
+ */
4241
+ 422: HttpValidationError;
4242
+ };
4243
+
4244
+ export type DeleteWebhookError = DeleteWebhookErrors[keyof DeleteWebhookErrors];
4245
+
4246
+ export type DeleteWebhookResponses = {
4247
+ /**
4248
+ * Successful Response
4249
+ */
4250
+ 200: DeleteResponse;
4251
+ };
4252
+
4253
+ export type DeleteWebhookResponse =
4254
+ DeleteWebhookResponses[keyof DeleteWebhookResponses];
4255
+
4256
+ export type UpdateWebhookData = {
4257
+ body: UpdateWebhookRequest;
4258
+ headers?: {
4259
+ /**
4260
+ * Authorization
4261
+ */
4262
+ authorization?: string | null;
4263
+ };
4264
+ path: {
4265
+ /**
4266
+ * Bank Id
4267
+ */
4268
+ bank_id: string;
4269
+ /**
4270
+ * Webhook Id
4271
+ */
4272
+ webhook_id: string;
4273
+ };
4274
+ query?: never;
4275
+ url: "/v1/default/banks/{bank_id}/webhooks/{webhook_id}";
4276
+ };
4277
+
4278
+ export type UpdateWebhookErrors = {
4279
+ /**
4280
+ * Validation Error
4281
+ */
4282
+ 422: HttpValidationError;
4283
+ };
4284
+
4285
+ export type UpdateWebhookError = UpdateWebhookErrors[keyof UpdateWebhookErrors];
4286
+
4287
+ export type UpdateWebhookResponses = {
4288
+ /**
4289
+ * Successful Response
4290
+ */
4291
+ 200: WebhookResponse;
4292
+ };
4293
+
4294
+ export type UpdateWebhookResponse =
4295
+ UpdateWebhookResponses[keyof UpdateWebhookResponses];
4296
+
4297
+ export type ListWebhookDeliveriesData = {
4298
+ body?: never;
4299
+ headers?: {
4300
+ /**
4301
+ * Authorization
4302
+ */
4303
+ authorization?: string | null;
4304
+ };
4305
+ path: {
4306
+ /**
4307
+ * Bank Id
4308
+ */
4309
+ bank_id: string;
4310
+ /**
4311
+ * Webhook Id
4312
+ */
4313
+ webhook_id: string;
4314
+ };
4315
+ query?: {
4316
+ /**
4317
+ * Limit
4318
+ *
4319
+ * Maximum number of deliveries to return
4320
+ */
4321
+ limit?: number;
4322
+ /**
4323
+ * Cursor
4324
+ *
4325
+ * Pagination cursor (created_at of last item)
4326
+ */
4327
+ cursor?: string | null;
4328
+ };
4329
+ url: "/v1/default/banks/{bank_id}/webhooks/{webhook_id}/deliveries";
4330
+ };
4331
+
4332
+ export type ListWebhookDeliveriesErrors = {
4333
+ /**
4334
+ * Validation Error
4335
+ */
4336
+ 422: HttpValidationError;
4337
+ };
4338
+
4339
+ export type ListWebhookDeliveriesError =
4340
+ ListWebhookDeliveriesErrors[keyof ListWebhookDeliveriesErrors];
4341
+
4342
+ export type ListWebhookDeliveriesResponses = {
4343
+ /**
4344
+ * Successful Response
4345
+ */
4346
+ 200: WebhookDeliveryListResponse;
4347
+ };
4348
+
4349
+ export type ListWebhookDeliveriesResponse =
4350
+ ListWebhookDeliveriesResponses[keyof ListWebhookDeliveriesResponses];
4351
+
3875
4352
  export type ClearBankMemoriesData = {
3876
4353
  body?: never;
3877
4354
  headers?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectorize-io/hindsight-client",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "description": "TypeScript client for Hindsight - Semantic memory system with personality-driven thinking",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
package/src/index.ts CHANGED
@@ -81,6 +81,7 @@ export interface MemoryItemInput {
81
81
  document_id?: string;
82
82
  entities?: EntityInput[];
83
83
  tags?: string[];
84
+ observation_scopes?: "per_tag" | "combined" | "all_combinations" | string[][];
84
85
  }
85
86
 
86
87
  export class HindsightClient {
@@ -188,6 +189,7 @@ export class HindsightClient {
188
189
  document_id: item.document_id,
189
190
  entities: item.entities,
190
191
  tags: item.tags,
192
+ observation_scopes: item.observation_scopes,
191
193
  timestamp:
192
194
  item.timestamp instanceof Date
193
195
  ? item.timestamp.toISOString()
@@ -284,7 +286,7 @@ export class HindsightClient {
284
286
  trace: options?.trace,
285
287
  query_timestamp: options?.queryTimestamp,
286
288
  include: {
287
- entities: options?.includeEntities ? { max_tokens: options?.maxEntityTokens ?? 500 } : undefined,
289
+ entities: options?.includeEntities === false ? null : options?.includeEntities ? { max_tokens: options?.maxEntityTokens ?? 500 } : undefined,
288
290
  chunks: options?.includeChunks ? { max_tokens: options?.maxChunkTokens ?? 8192 } : undefined,
289
291
  source_facts: options?.includeSourceFacts ? { max_tokens: options?.maxSourceFactsTokens ?? 4096 } : undefined,
290
292
  },