@vectorize-io/hindsight-client 0.4.19 → 0.4.21

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
  *
@@ -1331,6 +1465,24 @@ export type MentalModelTrigger = {
1331
1465
  * If true, refresh this mental model after observations consolidation (real-time mode)
1332
1466
  */
1333
1467
  refresh_after_consolidation?: boolean;
1468
+ /**
1469
+ * Fact Types
1470
+ *
1471
+ * Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
1472
+ */
1473
+ fact_types?: Array<"world" | "experience" | "observation"> | null;
1474
+ /**
1475
+ * Exclude Mental Models
1476
+ *
1477
+ * If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
1478
+ */
1479
+ exclude_mental_models?: boolean;
1480
+ /**
1481
+ * Exclude Mental Model Ids
1482
+ *
1483
+ * Exclude specific mental models by ID from the reflect loop.
1484
+ */
1485
+ exclude_mental_model_ids?: Array<string> | null;
1334
1486
  };
1335
1487
 
1336
1488
  /**
@@ -1825,6 +1977,24 @@ export type ReflectRequest = {
1825
1977
  tag_groups?: Array<
1826
1978
  TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot
1827
1979
  > | null;
1980
+ /**
1981
+ * Fact Types
1982
+ *
1983
+ * Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
1984
+ */
1985
+ fact_types?: Array<"world" | "experience" | "observation"> | null;
1986
+ /**
1987
+ * Exclude Mental Models
1988
+ *
1989
+ * If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
1990
+ */
1991
+ exclude_mental_models?: boolean;
1992
+ /**
1993
+ * Exclude Mental Model Ids
1994
+ *
1995
+ * Exclude specific mental models by ID from the reflect loop.
1996
+ */
1997
+ exclude_mental_model_ids?: Array<string> | null;
1828
1998
  };
1829
1999
 
1830
2000
  /**
@@ -2307,6 +2477,20 @@ export type ValidationError = {
2307
2477
  * Error Type
2308
2478
  */
2309
2479
  type: string;
2480
+ /**
2481
+ * Input
2482
+ */
2483
+ input?: unknown;
2484
+ /**
2485
+ * Context
2486
+ */
2487
+ ctx?: {
2488
+ [key: string]: unknown;
2489
+ };
2490
+ /**
2491
+ * URL
2492
+ */
2493
+ url?: string;
2310
2494
  };
2311
2495
 
2312
2496
  /**
@@ -4818,3 +5002,127 @@ export type FileRetainResponses = {
4818
5002
 
4819
5003
  export type FileRetainResponse2 =
4820
5004
  FileRetainResponses[keyof FileRetainResponses];
5005
+
5006
+ export type ListAuditLogsData = {
5007
+ body?: never;
5008
+ headers?: {
5009
+ /**
5010
+ * Authorization
5011
+ */
5012
+ authorization?: string | null;
5013
+ };
5014
+ path: {
5015
+ /**
5016
+ * Bank Id
5017
+ */
5018
+ bank_id: string;
5019
+ };
5020
+ query?: {
5021
+ /**
5022
+ * Action
5023
+ *
5024
+ * Filter by action type
5025
+ */
5026
+ action?: string | null;
5027
+ /**
5028
+ * Transport
5029
+ *
5030
+ * Filter by transport (http, mcp, system)
5031
+ */
5032
+ transport?: string | null;
5033
+ /**
5034
+ * Start Date
5035
+ *
5036
+ * Filter from this ISO datetime (inclusive)
5037
+ */
5038
+ start_date?: string | null;
5039
+ /**
5040
+ * End Date
5041
+ *
5042
+ * Filter until this ISO datetime (exclusive)
5043
+ */
5044
+ end_date?: string | null;
5045
+ /**
5046
+ * Limit
5047
+ *
5048
+ * Max items to return
5049
+ */
5050
+ limit?: number;
5051
+ /**
5052
+ * Offset
5053
+ *
5054
+ * Offset for pagination
5055
+ */
5056
+ offset?: number;
5057
+ };
5058
+ url: "/v1/default/banks/{bank_id}/audit-logs";
5059
+ };
5060
+
5061
+ export type ListAuditLogsErrors = {
5062
+ /**
5063
+ * Validation Error
5064
+ */
5065
+ 422: HttpValidationError;
5066
+ };
5067
+
5068
+ export type ListAuditLogsError = ListAuditLogsErrors[keyof ListAuditLogsErrors];
5069
+
5070
+ export type ListAuditLogsResponses = {
5071
+ /**
5072
+ * Successful Response
5073
+ */
5074
+ 200: AuditLogListResponse;
5075
+ };
5076
+
5077
+ export type ListAuditLogsResponse =
5078
+ ListAuditLogsResponses[keyof ListAuditLogsResponses];
5079
+
5080
+ export type AuditLogStatsData = {
5081
+ body?: never;
5082
+ headers?: {
5083
+ /**
5084
+ * Authorization
5085
+ */
5086
+ authorization?: string | null;
5087
+ };
5088
+ path: {
5089
+ /**
5090
+ * Bank Id
5091
+ */
5092
+ bank_id: string;
5093
+ };
5094
+ query?: {
5095
+ /**
5096
+ * Action
5097
+ *
5098
+ * Filter by action type
5099
+ */
5100
+ action?: string | null;
5101
+ /**
5102
+ * Period
5103
+ *
5104
+ * Time period: 1d, 7d, or 30d
5105
+ */
5106
+ period?: string;
5107
+ };
5108
+ url: "/v1/default/banks/{bank_id}/audit-logs/stats";
5109
+ };
5110
+
5111
+ export type AuditLogStatsErrors = {
5112
+ /**
5113
+ * Validation Error
5114
+ */
5115
+ 422: HttpValidationError;
5116
+ };
5117
+
5118
+ export type AuditLogStatsError = AuditLogStatsErrors[keyof AuditLogStatsErrors];
5119
+
5120
+ export type AuditLogStatsResponses = {
5121
+ /**
5122
+ * Successful Response
5123
+ */
5124
+ 200: AuditLogStatsResponse;
5125
+ };
5126
+
5127
+ export type AuditLogStatsResponse2 =
5128
+ AuditLogStatsResponses[keyof AuditLogStatsResponses];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectorize-io/hindsight-client",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
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",
package/src/index.ts CHANGED
@@ -628,6 +628,7 @@ export class HindsightClient {
628
628
  name: string,
629
629
  sourceQuery: string,
630
630
  options?: {
631
+ id?: string;
631
632
  tags?: string[];
632
633
  maxTokens?: number;
633
634
  trigger?: { refreshAfterConsolidation?: boolean };
@@ -637,6 +638,7 @@ export class HindsightClient {
637
638
  client: this.client,
638
639
  path: { bank_id: bankId },
639
640
  body: {
641
+ id: options?.id,
640
642
  name,
641
643
  source_query: sourceQuery,
642
644
  tags: options?.tags,
@@ -726,6 +728,18 @@ export class HindsightClient {
726
728
  throw new Error(`deleteMentalModel failed: ${JSON.stringify(response.error)}`);
727
729
  }
728
730
  }
731
+
732
+ /**
733
+ * Get the change history of a mental model.
734
+ */
735
+ async getMentalModelHistory(bankId: string, mentalModelId: string): Promise<any> {
736
+ const response = await sdk.getMentalModelHistory({
737
+ client: this.client,
738
+ path: { bank_id: bankId, mental_model_id: mentalModelId },
739
+ });
740
+
741
+ return this.validateResponse(response, 'getMentalModelHistory');
742
+ }
729
743
  }
730
744
 
731
745
  // Re-export types for convenience