@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.
package/dist/index.d.mts CHANGED
@@ -32,6 +32,136 @@ type AsyncOperationSubmitResponse = {
32
32
  */
33
33
  status: string;
34
34
  };
35
+ /**
36
+ * AuditLogEntry
37
+ *
38
+ * A single audit log entry.
39
+ */
40
+ type AuditLogEntry = {
41
+ /**
42
+ * Id
43
+ */
44
+ id: string;
45
+ /**
46
+ * Action
47
+ */
48
+ action: string;
49
+ /**
50
+ * Transport
51
+ */
52
+ transport: string;
53
+ /**
54
+ * Bank Id
55
+ */
56
+ bank_id: string | null;
57
+ /**
58
+ * Started At
59
+ */
60
+ started_at: string | null;
61
+ /**
62
+ * Ended At
63
+ */
64
+ ended_at: string | null;
65
+ /**
66
+ * Duration Ms
67
+ *
68
+ * Server-computed duration in milliseconds (started_at → ended_at). Null if not yet completed.
69
+ */
70
+ duration_ms?: number | null;
71
+ /**
72
+ * Request
73
+ */
74
+ request: {
75
+ [key: string]: unknown;
76
+ } | null;
77
+ /**
78
+ * Response
79
+ */
80
+ response: {
81
+ [key: string]: unknown;
82
+ } | null;
83
+ /**
84
+ * Metadata
85
+ */
86
+ metadata: {
87
+ [key: string]: unknown;
88
+ };
89
+ };
90
+ /**
91
+ * AuditLogListResponse
92
+ *
93
+ * Response model for list audit logs endpoint.
94
+ */
95
+ type AuditLogListResponse = {
96
+ /**
97
+ * Bank Id
98
+ */
99
+ bank_id: string;
100
+ /**
101
+ * Total
102
+ */
103
+ total: number;
104
+ /**
105
+ * Limit
106
+ */
107
+ limit: number;
108
+ /**
109
+ * Offset
110
+ */
111
+ offset: number;
112
+ /**
113
+ * Items
114
+ */
115
+ items: Array<AuditLogEntry>;
116
+ };
117
+ /**
118
+ * AuditLogStatsBucket
119
+ *
120
+ * A single time bucket in audit log stats.
121
+ */
122
+ type AuditLogStatsBucket = {
123
+ /**
124
+ * Time
125
+ */
126
+ time: string;
127
+ /**
128
+ * Actions
129
+ */
130
+ actions: {
131
+ [key: string]: number;
132
+ };
133
+ /**
134
+ * Total
135
+ */
136
+ total: number;
137
+ };
138
+ /**
139
+ * AuditLogStatsResponse
140
+ *
141
+ * Response model for audit log stats endpoint.
142
+ */
143
+ type AuditLogStatsResponse = {
144
+ /**
145
+ * Bank Id
146
+ */
147
+ bank_id: string;
148
+ /**
149
+ * Period
150
+ */
151
+ period: string;
152
+ /**
153
+ * Trunc
154
+ */
155
+ trunc: string;
156
+ /**
157
+ * Start
158
+ */
159
+ start: string;
160
+ /**
161
+ * Buckets
162
+ */
163
+ buckets: Array<AuditLogStatsBucket>;
164
+ };
35
165
  /**
36
166
  * BackgroundResponse
37
167
  *
@@ -1272,6 +1402,24 @@ type MentalModelTrigger = {
1272
1402
  * If true, refresh this mental model after observations consolidation (real-time mode)
1273
1403
  */
1274
1404
  refresh_after_consolidation?: boolean;
1405
+ /**
1406
+ * Fact Types
1407
+ *
1408
+ * Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
1409
+ */
1410
+ fact_types?: Array<"world" | "experience" | "observation"> | null;
1411
+ /**
1412
+ * Exclude Mental Models
1413
+ *
1414
+ * If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
1415
+ */
1416
+ exclude_mental_models?: boolean;
1417
+ /**
1418
+ * Exclude Mental Model Ids
1419
+ *
1420
+ * Exclude specific mental models by ID from the reflect loop.
1421
+ */
1422
+ exclude_mental_model_ids?: Array<string> | null;
1275
1423
  };
1276
1424
  /**
1277
1425
  * OperationResponse
@@ -1748,6 +1896,24 @@ type ReflectRequest = {
1748
1896
  * 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: ...}.
1749
1897
  */
1750
1898
  tag_groups?: Array<TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot> | null;
1899
+ /**
1900
+ * Fact Types
1901
+ *
1902
+ * Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
1903
+ */
1904
+ fact_types?: Array<"world" | "experience" | "observation"> | null;
1905
+ /**
1906
+ * Exclude Mental Models
1907
+ *
1908
+ * If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
1909
+ */
1910
+ exclude_mental_models?: boolean;
1911
+ /**
1912
+ * Exclude Mental Model Ids
1913
+ *
1914
+ * Exclude specific mental models by ID from the reflect loop.
1915
+ */
1916
+ exclude_mental_model_ids?: Array<string> | null;
1751
1917
  };
1752
1918
  /**
1753
1919
  * ReflectResponse
@@ -2209,6 +2375,20 @@ type ValidationError = {
2209
2375
  * Error Type
2210
2376
  */
2211
2377
  type: string;
2378
+ /**
2379
+ * Input
2380
+ */
2381
+ input?: unknown;
2382
+ /**
2383
+ * Context
2384
+ */
2385
+ ctx?: {
2386
+ [key: string]: unknown;
2387
+ };
2388
+ /**
2389
+ * URL
2390
+ */
2391
+ url?: string;
2212
2392
  };
2213
2393
  /**
2214
2394
  * VersionResponse
@@ -4264,6 +4444,114 @@ type FileRetainResponses = {
4264
4444
  */
4265
4445
  200: FileRetainResponse;
4266
4446
  };
4447
+ type ListAuditLogsData = {
4448
+ body?: never;
4449
+ headers?: {
4450
+ /**
4451
+ * Authorization
4452
+ */
4453
+ authorization?: string | null;
4454
+ };
4455
+ path: {
4456
+ /**
4457
+ * Bank Id
4458
+ */
4459
+ bank_id: string;
4460
+ };
4461
+ query?: {
4462
+ /**
4463
+ * Action
4464
+ *
4465
+ * Filter by action type
4466
+ */
4467
+ action?: string | null;
4468
+ /**
4469
+ * Transport
4470
+ *
4471
+ * Filter by transport (http, mcp, system)
4472
+ */
4473
+ transport?: string | null;
4474
+ /**
4475
+ * Start Date
4476
+ *
4477
+ * Filter from this ISO datetime (inclusive)
4478
+ */
4479
+ start_date?: string | null;
4480
+ /**
4481
+ * End Date
4482
+ *
4483
+ * Filter until this ISO datetime (exclusive)
4484
+ */
4485
+ end_date?: string | null;
4486
+ /**
4487
+ * Limit
4488
+ *
4489
+ * Max items to return
4490
+ */
4491
+ limit?: number;
4492
+ /**
4493
+ * Offset
4494
+ *
4495
+ * Offset for pagination
4496
+ */
4497
+ offset?: number;
4498
+ };
4499
+ url: "/v1/default/banks/{bank_id}/audit-logs";
4500
+ };
4501
+ type ListAuditLogsErrors = {
4502
+ /**
4503
+ * Validation Error
4504
+ */
4505
+ 422: HttpValidationError;
4506
+ };
4507
+ type ListAuditLogsResponses = {
4508
+ /**
4509
+ * Successful Response
4510
+ */
4511
+ 200: AuditLogListResponse;
4512
+ };
4513
+ type AuditLogStatsData = {
4514
+ body?: never;
4515
+ headers?: {
4516
+ /**
4517
+ * Authorization
4518
+ */
4519
+ authorization?: string | null;
4520
+ };
4521
+ path: {
4522
+ /**
4523
+ * Bank Id
4524
+ */
4525
+ bank_id: string;
4526
+ };
4527
+ query?: {
4528
+ /**
4529
+ * Action
4530
+ *
4531
+ * Filter by action type
4532
+ */
4533
+ action?: string | null;
4534
+ /**
4535
+ * Period
4536
+ *
4537
+ * Time period: 1d, 7d, or 30d
4538
+ */
4539
+ period?: string;
4540
+ };
4541
+ url: "/v1/default/banks/{bank_id}/audit-logs/stats";
4542
+ };
4543
+ type AuditLogStatsErrors = {
4544
+ /**
4545
+ * Validation Error
4546
+ */
4547
+ 422: HttpValidationError;
4548
+ };
4549
+ type AuditLogStatsResponses = {
4550
+ /**
4551
+ * Successful Response
4552
+ */
4553
+ 200: AuditLogStatsResponse;
4554
+ };
4267
4555
 
4268
4556
  type AuthToken = string | undefined;
4269
4557
  interface Auth {
@@ -5011,9 +5299,22 @@ declare const retainMemories: <ThrowOnError extends boolean = false>(options: Op
5011
5299
  * - Only parsers enabled on the server may be requested; others return HTTP 400.
5012
5300
  */
5013
5301
  declare const fileRetain: <ThrowOnError extends boolean = false>(options: Options<FileRetainData, ThrowOnError>) => RequestResult<FileRetainResponses, FileRetainErrors, ThrowOnError, "fields">;
5302
+ /**
5303
+ * List audit logs
5304
+ *
5305
+ * List audit log entries for a bank, ordered by most recent first.
5306
+ */
5307
+ declare const listAuditLogs: <ThrowOnError extends boolean = false>(options: Options<ListAuditLogsData, ThrowOnError>) => RequestResult<ListAuditLogsResponses, ListAuditLogsErrors, ThrowOnError, "fields">;
5308
+ /**
5309
+ * Audit log statistics
5310
+ *
5311
+ * Get audit log counts grouped by time bucket for charting.
5312
+ */
5313
+ declare const auditLogStats: <ThrowOnError extends boolean = false>(options: Options<AuditLogStatsData, ThrowOnError>) => RequestResult<AuditLogStatsResponses, AuditLogStatsErrors, ThrowOnError, "fields">;
5014
5314
 
5015
5315
  type sdk_gen_Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options<TData, ThrowOnError>;
5016
5316
  declare const sdk_gen_addBankBackground: typeof addBankBackground;
5317
+ declare const sdk_gen_auditLogStats: typeof auditLogStats;
5017
5318
  declare const sdk_gen_cancelOperation: typeof cancelOperation;
5018
5319
  declare const sdk_gen_clearBankMemories: typeof clearBankMemories;
5019
5320
  declare const sdk_gen_clearMemoryObservations: typeof clearMemoryObservations;
@@ -5043,6 +5344,7 @@ declare const sdk_gen_getObservationHistory: typeof getObservationHistory;
5043
5344
  declare const sdk_gen_getOperationStatus: typeof getOperationStatus;
5044
5345
  declare const sdk_gen_getVersion: typeof getVersion;
5045
5346
  declare const sdk_gen_healthEndpointHealthGet: typeof healthEndpointHealthGet;
5347
+ declare const sdk_gen_listAuditLogs: typeof listAuditLogs;
5046
5348
  declare const sdk_gen_listBanks: typeof listBanks;
5047
5349
  declare const sdk_gen_listDirectives: typeof listDirectives;
5048
5350
  declare const sdk_gen_listDocuments: typeof listDocuments;
@@ -5071,7 +5373,7 @@ declare const sdk_gen_updateDocument: typeof updateDocument;
5071
5373
  declare const sdk_gen_updateMentalModel: typeof updateMentalModel;
5072
5374
  declare const sdk_gen_updateWebhook: typeof updateWebhook;
5073
5375
  declare namespace sdk_gen {
5074
- export { type sdk_gen_Options as Options, sdk_gen_addBankBackground as addBankBackground, sdk_gen_cancelOperation as cancelOperation, sdk_gen_clearBankMemories as clearBankMemories, sdk_gen_clearMemoryObservations as clearMemoryObservations, sdk_gen_clearObservations as clearObservations, sdk_gen_createDirective as createDirective, sdk_gen_createMentalModel as createMentalModel, sdk_gen_createOrUpdateBank as createOrUpdateBank, sdk_gen_createWebhook as createWebhook, sdk_gen_deleteBank as deleteBank, sdk_gen_deleteDirective as deleteDirective, sdk_gen_deleteDocument as deleteDocument, sdk_gen_deleteMentalModel as deleteMentalModel, sdk_gen_deleteWebhook as deleteWebhook, sdk_gen_fileRetain as fileRetain, sdk_gen_getAgentStats as getAgentStats, sdk_gen_getBankConfig as getBankConfig, sdk_gen_getBankProfile as getBankProfile, sdk_gen_getChunk as getChunk, sdk_gen_getDirective as getDirective, sdk_gen_getDocument as getDocument, sdk_gen_getEntity as getEntity, sdk_gen_getGraph as getGraph, sdk_gen_getMemory as getMemory, sdk_gen_getMentalModel as getMentalModel, sdk_gen_getMentalModelHistory as getMentalModelHistory, sdk_gen_getObservationHistory as getObservationHistory, sdk_gen_getOperationStatus as getOperationStatus, sdk_gen_getVersion as getVersion, sdk_gen_healthEndpointHealthGet as healthEndpointHealthGet, sdk_gen_listBanks as listBanks, sdk_gen_listDirectives as listDirectives, sdk_gen_listDocuments as listDocuments, sdk_gen_listEntities as listEntities, sdk_gen_listMemories as listMemories, sdk_gen_listMentalModels as listMentalModels, sdk_gen_listOperations as listOperations, sdk_gen_listTags as listTags, sdk_gen_listWebhookDeliveries as listWebhookDeliveries, sdk_gen_listWebhooks as listWebhooks, sdk_gen_metricsEndpointMetricsGet as metricsEndpointMetricsGet, sdk_gen_recallMemories as recallMemories, sdk_gen_recoverConsolidation as recoverConsolidation, sdk_gen_reflect as reflect, sdk_gen_refreshMentalModel as refreshMentalModel, sdk_gen_regenerateEntityObservations as regenerateEntityObservations, sdk_gen_resetBankConfig as resetBankConfig, sdk_gen_retainMemories as retainMemories, sdk_gen_retryOperation as retryOperation, sdk_gen_triggerConsolidation as triggerConsolidation, sdk_gen_updateBank as updateBank, sdk_gen_updateBankConfig as updateBankConfig, sdk_gen_updateBankDisposition as updateBankDisposition, sdk_gen_updateDirective as updateDirective, sdk_gen_updateDocument as updateDocument, sdk_gen_updateMentalModel as updateMentalModel, sdk_gen_updateWebhook as updateWebhook };
5376
+ export { type sdk_gen_Options as Options, sdk_gen_addBankBackground as addBankBackground, sdk_gen_auditLogStats as auditLogStats, sdk_gen_cancelOperation as cancelOperation, sdk_gen_clearBankMemories as clearBankMemories, sdk_gen_clearMemoryObservations as clearMemoryObservations, sdk_gen_clearObservations as clearObservations, sdk_gen_createDirective as createDirective, sdk_gen_createMentalModel as createMentalModel, sdk_gen_createOrUpdateBank as createOrUpdateBank, sdk_gen_createWebhook as createWebhook, sdk_gen_deleteBank as deleteBank, sdk_gen_deleteDirective as deleteDirective, sdk_gen_deleteDocument as deleteDocument, sdk_gen_deleteMentalModel as deleteMentalModel, sdk_gen_deleteWebhook as deleteWebhook, sdk_gen_fileRetain as fileRetain, sdk_gen_getAgentStats as getAgentStats, sdk_gen_getBankConfig as getBankConfig, sdk_gen_getBankProfile as getBankProfile, sdk_gen_getChunk as getChunk, sdk_gen_getDirective as getDirective, sdk_gen_getDocument as getDocument, sdk_gen_getEntity as getEntity, sdk_gen_getGraph as getGraph, sdk_gen_getMemory as getMemory, sdk_gen_getMentalModel as getMentalModel, sdk_gen_getMentalModelHistory as getMentalModelHistory, sdk_gen_getObservationHistory as getObservationHistory, sdk_gen_getOperationStatus as getOperationStatus, sdk_gen_getVersion as getVersion, sdk_gen_healthEndpointHealthGet as healthEndpointHealthGet, sdk_gen_listAuditLogs as listAuditLogs, sdk_gen_listBanks as listBanks, sdk_gen_listDirectives as listDirectives, sdk_gen_listDocuments as listDocuments, sdk_gen_listEntities as listEntities, sdk_gen_listMemories as listMemories, sdk_gen_listMentalModels as listMentalModels, sdk_gen_listOperations as listOperations, sdk_gen_listTags as listTags, sdk_gen_listWebhookDeliveries as listWebhookDeliveries, sdk_gen_listWebhooks as listWebhooks, sdk_gen_metricsEndpointMetricsGet as metricsEndpointMetricsGet, sdk_gen_recallMemories as recallMemories, sdk_gen_recoverConsolidation as recoverConsolidation, sdk_gen_reflect as reflect, sdk_gen_refreshMentalModel as refreshMentalModel, sdk_gen_regenerateEntityObservations as regenerateEntityObservations, sdk_gen_resetBankConfig as resetBankConfig, sdk_gen_retainMemories as retainMemories, sdk_gen_retryOperation as retryOperation, sdk_gen_triggerConsolidation as triggerConsolidation, sdk_gen_updateBank as updateBank, sdk_gen_updateBankConfig as updateBankConfig, sdk_gen_updateBankDisposition as updateBankDisposition, sdk_gen_updateDirective as updateDirective, sdk_gen_updateDocument as updateDocument, sdk_gen_updateMentalModel as updateMentalModel, sdk_gen_updateWebhook as updateWebhook };
5075
5377
  }
5076
5378
 
5077
5379
  /**
@@ -5343,6 +5645,7 @@ declare class HindsightClient {
5343
5645
  * Create a mental model (runs reflect in background).
5344
5646
  */
5345
5647
  createMentalModel(bankId: string, name: string, sourceQuery: string, options?: {
5648
+ id?: string;
5346
5649
  tags?: string[];
5347
5650
  maxTokens?: number;
5348
5651
  trigger?: {
@@ -5379,6 +5682,10 @@ declare class HindsightClient {
5379
5682
  * Delete a mental model.
5380
5683
  */
5381
5684
  deleteMentalModel(bankId: string, mentalModelId: string): Promise<void>;
5685
+ /**
5686
+ * Get the change history of a mental model.
5687
+ */
5688
+ getMentalModelHistory(bankId: string, mentalModelId: string): Promise<any>;
5382
5689
  }
5383
5690
 
5384
5691
  export { type BankConfigResponse, type BankProfileResponse, type Budget, type Client, type CreateBankRequest, type EntityInput, type FileRetainResponse, HindsightClient, type HindsightClientOptions, HindsightError, type ListMemoryUnitsResponse, type MemoryItemInput, type RecallRequest, type RecallResponse, type RecallResult, type ReflectRequest, type ReflectResponse, type RetainRequest, type RetainResponse, createClient, createConfig, sdk_gen as sdk };