@vectorize-io/hindsight-client 0.4.20 → 0.4.22

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.
@@ -11,6 +11,9 @@ import type {
11
11
  AddBankBackgroundData,
12
12
  AddBankBackgroundErrors,
13
13
  AddBankBackgroundResponses,
14
+ AuditLogStatsData,
15
+ AuditLogStatsErrors,
16
+ AuditLogStatsResponses,
14
17
  CancelOperationData,
15
18
  CancelOperationErrors,
16
19
  CancelOperationResponses,
@@ -96,6 +99,9 @@ import type {
96
99
  GetVersionResponses,
97
100
  HealthEndpointHealthGetData,
98
101
  HealthEndpointHealthGetResponses,
102
+ ListAuditLogsData,
103
+ ListAuditLogsErrors,
104
+ ListAuditLogsResponses,
99
105
  ListBanksData,
100
106
  ListBanksErrors,
101
107
  ListBanksResponses,
@@ -1226,3 +1232,31 @@ export const fileRetain = <ThrowOnError extends boolean = false>(
1226
1232
  ...options.headers,
1227
1233
  },
1228
1234
  });
1235
+
1236
+ /**
1237
+ * List audit logs
1238
+ *
1239
+ * List audit log entries for a bank, ordered by most recent first.
1240
+ */
1241
+ export const listAuditLogs = <ThrowOnError extends boolean = false>(
1242
+ options: Options<ListAuditLogsData, ThrowOnError>,
1243
+ ) =>
1244
+ (options.client ?? client).get<
1245
+ ListAuditLogsResponses,
1246
+ ListAuditLogsErrors,
1247
+ ThrowOnError
1248
+ >({ url: "/v1/default/banks/{bank_id}/audit-logs", ...options });
1249
+
1250
+ /**
1251
+ * Audit log statistics
1252
+ *
1253
+ * Get audit log counts grouped by time bucket for charting.
1254
+ */
1255
+ export const auditLogStats = <ThrowOnError extends boolean = false>(
1256
+ options: Options<AuditLogStatsData, ThrowOnError>,
1257
+ ) =>
1258
+ (options.client ?? client).get<
1259
+ AuditLogStatsResponses,
1260
+ AuditLogStatsErrors,
1261
+ ThrowOnError
1262
+ >({ url: "/v1/default/banks/{bank_id}/audit-logs/stats", ...options });
@@ -40,6 +40,140 @@ export type AsyncOperationSubmitResponse = {
40
40
  status: string;
41
41
  };
42
42
 
43
+ /**
44
+ * AuditLogEntry
45
+ *
46
+ * A single audit log entry.
47
+ */
48
+ export type AuditLogEntry = {
49
+ /**
50
+ * Id
51
+ */
52
+ id: string;
53
+ /**
54
+ * Action
55
+ */
56
+ action: string;
57
+ /**
58
+ * Transport
59
+ */
60
+ transport: string;
61
+ /**
62
+ * Bank Id
63
+ */
64
+ bank_id: string | null;
65
+ /**
66
+ * Started At
67
+ */
68
+ started_at: string | null;
69
+ /**
70
+ * Ended At
71
+ */
72
+ ended_at: string | null;
73
+ /**
74
+ * Duration Ms
75
+ *
76
+ * Server-computed duration in milliseconds (started_at → ended_at). Null if not yet completed.
77
+ */
78
+ duration_ms?: number | null;
79
+ /**
80
+ * Request
81
+ */
82
+ request: {
83
+ [key: string]: unknown;
84
+ } | null;
85
+ /**
86
+ * Response
87
+ */
88
+ response: {
89
+ [key: string]: unknown;
90
+ } | null;
91
+ /**
92
+ * Metadata
93
+ */
94
+ metadata: {
95
+ [key: string]: unknown;
96
+ };
97
+ };
98
+
99
+ /**
100
+ * AuditLogListResponse
101
+ *
102
+ * Response model for list audit logs endpoint.
103
+ */
104
+ export type AuditLogListResponse = {
105
+ /**
106
+ * Bank Id
107
+ */
108
+ bank_id: string;
109
+ /**
110
+ * Total
111
+ */
112
+ total: number;
113
+ /**
114
+ * Limit
115
+ */
116
+ limit: number;
117
+ /**
118
+ * Offset
119
+ */
120
+ offset: number;
121
+ /**
122
+ * Items
123
+ */
124
+ items: Array<AuditLogEntry>;
125
+ };
126
+
127
+ /**
128
+ * AuditLogStatsBucket
129
+ *
130
+ * A single time bucket in audit log stats.
131
+ */
132
+ export type AuditLogStatsBucket = {
133
+ /**
134
+ * Time
135
+ */
136
+ time: string;
137
+ /**
138
+ * Actions
139
+ */
140
+ actions: {
141
+ [key: string]: number;
142
+ };
143
+ /**
144
+ * Total
145
+ */
146
+ total: number;
147
+ };
148
+
149
+ /**
150
+ * AuditLogStatsResponse
151
+ *
152
+ * Response model for audit log stats endpoint.
153
+ */
154
+ export type AuditLogStatsResponse = {
155
+ /**
156
+ * Bank Id
157
+ */
158
+ bank_id: string;
159
+ /**
160
+ * Period
161
+ */
162
+ period: string;
163
+ /**
164
+ * Trunc
165
+ */
166
+ trunc: string;
167
+ /**
168
+ * Start
169
+ */
170
+ start: string;
171
+ /**
172
+ * Buckets
173
+ */
174
+ buckets: Array<AuditLogStatsBucket>;
175
+ };
176
+
43
177
  /**
44
178
  * BackgroundResponse
45
179
  *
@@ -595,7 +729,7 @@ export type CreateMentalModelRequest = {
595
729
  /**
596
730
  * Trigger settings
597
731
  */
598
- trigger?: MentalModelTrigger;
732
+ trigger?: MentalModelTriggerInput;
599
733
  };
600
734
 
601
735
  /**
@@ -820,6 +954,22 @@ export type DocumentResponse = {
820
954
  * Tags associated with this document
821
955
  */
822
956
  tags?: Array<string>;
957
+ /**
958
+ * Document Metadata
959
+ *
960
+ * Document metadata
961
+ */
962
+ document_metadata?: {
963
+ [key: string]: unknown;
964
+ } | null;
965
+ /**
966
+ * Retain Params
967
+ *
968
+ * Parameters used during retain
969
+ */
970
+ retain_params?: {
971
+ [key: string]: unknown;
972
+ } | null;
823
973
  };
824
974
 
825
975
  /**
@@ -1300,7 +1450,7 @@ export type MentalModelResponse = {
1300
1450
  * Max Tokens
1301
1451
  */
1302
1452
  max_tokens?: number;
1303
- trigger?: MentalModelTrigger;
1453
+ trigger?: MentalModelTriggerOutput;
1304
1454
  /**
1305
1455
  * Last Refreshed At
1306
1456
  */
@@ -1324,7 +1474,7 @@ export type MentalModelResponse = {
1324
1474
  *
1325
1475
  * Trigger settings for a mental model.
1326
1476
  */
1327
- export type MentalModelTrigger = {
1477
+ export type MentalModelTriggerInput = {
1328
1478
  /**
1329
1479
  * Refresh After Consolidation
1330
1480
  *
@@ -1349,6 +1499,66 @@ export type MentalModelTrigger = {
1349
1499
  * Exclude specific mental models by ID from the reflect loop.
1350
1500
  */
1351
1501
  exclude_mental_model_ids?: Array<string> | null;
1502
+ /**
1503
+ * Tags Match
1504
+ *
1505
+ * Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh.
1506
+ */
1507
+ tags_match?: "any" | "all" | "any_strict" | "all_strict" | null;
1508
+ /**
1509
+ * Tag Groups
1510
+ *
1511
+ * Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping.
1512
+ */
1513
+ tag_groups?: Array<
1514
+ TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
1515
+ > | null;
1516
+ };
1517
+
1518
+ /**
1519
+ * MentalModelTrigger
1520
+ *
1521
+ * Trigger settings for a mental model.
1522
+ */
1523
+ export type MentalModelTriggerOutput = {
1524
+ /**
1525
+ * Refresh After Consolidation
1526
+ *
1527
+ * If true, refresh this mental model after observations consolidation (real-time mode)
1528
+ */
1529
+ refresh_after_consolidation?: boolean;
1530
+ /**
1531
+ * Fact Types
1532
+ *
1533
+ * Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
1534
+ */
1535
+ fact_types?: Array<"world" | "experience" | "observation"> | null;
1536
+ /**
1537
+ * Exclude Mental Models
1538
+ *
1539
+ * If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
1540
+ */
1541
+ exclude_mental_models?: boolean;
1542
+ /**
1543
+ * Exclude Mental Model Ids
1544
+ *
1545
+ * Exclude specific mental models by ID from the reflect loop.
1546
+ */
1547
+ exclude_mental_model_ids?: Array<string> | null;
1548
+ /**
1549
+ * Tags Match
1550
+ *
1551
+ * Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh.
1552
+ */
1553
+ tags_match?: "any" | "all" | "any_strict" | "all_strict" | null;
1554
+ /**
1555
+ * Tag Groups
1556
+ *
1557
+ * Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping.
1558
+ */
1559
+ tag_groups?: Array<
1560
+ TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
1561
+ > | null;
1352
1562
  };
1353
1563
 
1354
1564
  /**
@@ -1518,7 +1728,7 @@ export type RecallRequest = {
1518
1728
  * Compound tag filter using boolean groups. Groups in the list are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}.
1519
1729
  */
1520
1730
  tag_groups?: Array<
1521
- TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot
1731
+ TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
1522
1732
  > | null;
1523
1733
  };
1524
1734
 
@@ -1841,7 +2051,7 @@ export type ReflectRequest = {
1841
2051
  * Compound tag filter using boolean groups. Groups in the list are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}.
1842
2052
  */
1843
2053
  tag_groups?: Array<
1844
- TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot
2054
+ TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
1845
2055
  > | null;
1846
2056
  /**
1847
2057
  * Fact Types
@@ -2072,11 +2282,27 @@ export type SourceFactsIncludeOptions = {
2072
2282
  *
2073
2283
  * Compound AND group: all child filters must match.
2074
2284
  */
2075
- export type TagGroupAnd = {
2285
+ export type TagGroupAndInput = {
2286
+ /**
2287
+ * And
2288
+ */
2289
+ and: Array<
2290
+ TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
2291
+ >;
2292
+ };
2293
+
2294
+ /**
2295
+ * TagGroupAnd
2296
+ *
2297
+ * Compound AND group: all child filters must match.
2298
+ */
2299
+ export type TagGroupAndOutput = {
2076
2300
  /**
2077
2301
  * And
2078
2302
  */
2079
- and: Array<TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot>;
2303
+ and: Array<
2304
+ TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
2305
+ >;
2080
2306
  };
2081
2307
 
2082
2308
  /**
@@ -2100,11 +2326,23 @@ export type TagGroupLeaf = {
2100
2326
  *
2101
2327
  * Compound NOT group: child filter must NOT match.
2102
2328
  */
2103
- export type TagGroupNot = {
2329
+ export type TagGroupNotInput = {
2330
+ /**
2331
+ * Not
2332
+ */
2333
+ not: TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput;
2334
+ };
2335
+
2336
+ /**
2337
+ * TagGroupNot
2338
+ *
2339
+ * Compound NOT group: child filter must NOT match.
2340
+ */
2341
+ export type TagGroupNotOutput = {
2104
2342
  /**
2105
2343
  * Not
2106
2344
  */
2107
- not: TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot;
2345
+ not: TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput;
2108
2346
  };
2109
2347
 
2110
2348
  /**
@@ -2112,11 +2350,27 @@ export type TagGroupNot = {
2112
2350
  *
2113
2351
  * Compound OR group: at least one child filter must match.
2114
2352
  */
2115
- export type TagGroupOr = {
2353
+ export type TagGroupOrInput = {
2116
2354
  /**
2117
2355
  * Or
2118
2356
  */
2119
- or: Array<TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot>;
2357
+ or: Array<
2358
+ TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
2359
+ >;
2360
+ };
2361
+
2362
+ /**
2363
+ * TagGroupOr
2364
+ *
2365
+ * Compound OR group: at least one child filter must match.
2366
+ */
2367
+ export type TagGroupOrOutput = {
2368
+ /**
2369
+ * Or
2370
+ */
2371
+ or: Array<
2372
+ TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
2373
+ >;
2120
2374
  };
2121
2375
 
2122
2376
  /**
@@ -2288,7 +2542,7 @@ export type UpdateMentalModelRequest = {
2288
2542
  /**
2289
2543
  * Trigger settings
2290
2544
  */
2291
- trigger?: MentalModelTrigger | null;
2545
+ trigger?: MentalModelTriggerInput | null;
2292
2546
  };
2293
2547
 
2294
2548
  /**
@@ -2343,6 +2597,20 @@ export type ValidationError = {
2343
2597
  * Error Type
2344
2598
  */
2345
2599
  type: string;
2600
+ /**
2601
+ * Input
2602
+ */
2603
+ input?: unknown;
2604
+ /**
2605
+ * Context
2606
+ */
2607
+ ctx?: {
2608
+ [key: string]: unknown;
2609
+ };
2610
+ /**
2611
+ * URL
2612
+ */
2613
+ url?: string;
2346
2614
  };
2347
2615
 
2348
2616
  /**
@@ -4854,3 +5122,127 @@ export type FileRetainResponses = {
4854
5122
 
4855
5123
  export type FileRetainResponse2 =
4856
5124
  FileRetainResponses[keyof FileRetainResponses];
5125
+
5126
+ export type ListAuditLogsData = {
5127
+ body?: never;
5128
+ headers?: {
5129
+ /**
5130
+ * Authorization
5131
+ */
5132
+ authorization?: string | null;
5133
+ };
5134
+ path: {
5135
+ /**
5136
+ * Bank Id
5137
+ */
5138
+ bank_id: string;
5139
+ };
5140
+ query?: {
5141
+ /**
5142
+ * Action
5143
+ *
5144
+ * Filter by action type
5145
+ */
5146
+ action?: string | null;
5147
+ /**
5148
+ * Transport
5149
+ *
5150
+ * Filter by transport (http, mcp, system)
5151
+ */
5152
+ transport?: string | null;
5153
+ /**
5154
+ * Start Date
5155
+ *
5156
+ * Filter from this ISO datetime (inclusive)
5157
+ */
5158
+ start_date?: string | null;
5159
+ /**
5160
+ * End Date
5161
+ *
5162
+ * Filter until this ISO datetime (exclusive)
5163
+ */
5164
+ end_date?: string | null;
5165
+ /**
5166
+ * Limit
5167
+ *
5168
+ * Max items to return
5169
+ */
5170
+ limit?: number;
5171
+ /**
5172
+ * Offset
5173
+ *
5174
+ * Offset for pagination
5175
+ */
5176
+ offset?: number;
5177
+ };
5178
+ url: "/v1/default/banks/{bank_id}/audit-logs";
5179
+ };
5180
+
5181
+ export type ListAuditLogsErrors = {
5182
+ /**
5183
+ * Validation Error
5184
+ */
5185
+ 422: HttpValidationError;
5186
+ };
5187
+
5188
+ export type ListAuditLogsError = ListAuditLogsErrors[keyof ListAuditLogsErrors];
5189
+
5190
+ export type ListAuditLogsResponses = {
5191
+ /**
5192
+ * Successful Response
5193
+ */
5194
+ 200: AuditLogListResponse;
5195
+ };
5196
+
5197
+ export type ListAuditLogsResponse =
5198
+ ListAuditLogsResponses[keyof ListAuditLogsResponses];
5199
+
5200
+ export type AuditLogStatsData = {
5201
+ body?: never;
5202
+ headers?: {
5203
+ /**
5204
+ * Authorization
5205
+ */
5206
+ authorization?: string | null;
5207
+ };
5208
+ path: {
5209
+ /**
5210
+ * Bank Id
5211
+ */
5212
+ bank_id: string;
5213
+ };
5214
+ query?: {
5215
+ /**
5216
+ * Action
5217
+ *
5218
+ * Filter by action type
5219
+ */
5220
+ action?: string | null;
5221
+ /**
5222
+ * Period
5223
+ *
5224
+ * Time period: 1d, 7d, or 30d
5225
+ */
5226
+ period?: string;
5227
+ };
5228
+ url: "/v1/default/banks/{bank_id}/audit-logs/stats";
5229
+ };
5230
+
5231
+ export type AuditLogStatsErrors = {
5232
+ /**
5233
+ * Validation Error
5234
+ */
5235
+ 422: HttpValidationError;
5236
+ };
5237
+
5238
+ export type AuditLogStatsError = AuditLogStatsErrors[keyof AuditLogStatsErrors];
5239
+
5240
+ export type AuditLogStatsResponses = {
5241
+ /**
5242
+ * Successful Response
5243
+ */
5244
+ 200: AuditLogStatsResponse;
5245
+ };
5246
+
5247
+ export type AuditLogStatsResponse2 =
5248
+ AuditLogStatsResponses[keyof AuditLogStatsResponses];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectorize-io/hindsight-client",
3
- "version": "0.4.20",
3
+ "version": "0.4.22",
4
4
  "description": "TypeScript client for Hindsight - Semantic memory system with personality-driven thinking",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",