@vectorize-io/hindsight-client 0.3.0 → 0.4.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.
@@ -12,15 +12,30 @@ import type {
12
12
  ClearBankMemoriesData,
13
13
  ClearBankMemoriesErrors,
14
14
  ClearBankMemoriesResponses,
15
+ ClearObservationsData,
16
+ ClearObservationsErrors,
17
+ ClearObservationsResponses,
18
+ CreateDirectiveData,
19
+ CreateDirectiveErrors,
20
+ CreateDirectiveResponses,
21
+ CreateMentalModelData,
22
+ CreateMentalModelErrors,
23
+ CreateMentalModelResponses,
15
24
  CreateOrUpdateBankData,
16
25
  CreateOrUpdateBankErrors,
17
26
  CreateOrUpdateBankResponses,
18
27
  DeleteBankData,
19
28
  DeleteBankErrors,
20
29
  DeleteBankResponses,
30
+ DeleteDirectiveData,
31
+ DeleteDirectiveErrors,
32
+ DeleteDirectiveResponses,
21
33
  DeleteDocumentData,
22
34
  DeleteDocumentErrors,
23
35
  DeleteDocumentResponses,
36
+ DeleteMentalModelData,
37
+ DeleteMentalModelErrors,
38
+ DeleteMentalModelResponses,
24
39
  GetAgentStatsData,
25
40
  GetAgentStatsErrors,
26
41
  GetAgentStatsResponses,
@@ -30,6 +45,9 @@ import type {
30
45
  GetChunkData,
31
46
  GetChunkErrors,
32
47
  GetChunkResponses,
48
+ GetDirectiveData,
49
+ GetDirectiveErrors,
50
+ GetDirectiveResponses,
33
51
  GetDocumentData,
34
52
  GetDocumentErrors,
35
53
  GetDocumentResponses,
@@ -42,11 +60,22 @@ import type {
42
60
  GetMemoryData,
43
61
  GetMemoryErrors,
44
62
  GetMemoryResponses,
63
+ GetMentalModelData,
64
+ GetMentalModelErrors,
65
+ GetMentalModelResponses,
66
+ GetOperationStatusData,
67
+ GetOperationStatusErrors,
68
+ GetOperationStatusResponses,
69
+ GetVersionData,
70
+ GetVersionResponses,
45
71
  HealthEndpointHealthGetData,
46
72
  HealthEndpointHealthGetResponses,
47
73
  ListBanksData,
48
74
  ListBanksErrors,
49
75
  ListBanksResponses,
76
+ ListDirectivesData,
77
+ ListDirectivesErrors,
78
+ ListDirectivesResponses,
50
79
  ListDocumentsData,
51
80
  ListDocumentsErrors,
52
81
  ListDocumentsResponses,
@@ -56,6 +85,9 @@ import type {
56
85
  ListMemoriesData,
57
86
  ListMemoriesErrors,
58
87
  ListMemoriesResponses,
88
+ ListMentalModelsData,
89
+ ListMentalModelsErrors,
90
+ ListMentalModelsResponses,
59
91
  ListOperationsData,
60
92
  ListOperationsErrors,
61
93
  ListOperationsResponses,
@@ -70,15 +102,30 @@ import type {
70
102
  ReflectData,
71
103
  ReflectErrors,
72
104
  ReflectResponses,
105
+ RefreshMentalModelData,
106
+ RefreshMentalModelErrors,
107
+ RefreshMentalModelResponses,
73
108
  RegenerateEntityObservationsData,
74
109
  RegenerateEntityObservationsErrors,
75
110
  RegenerateEntityObservationsResponses,
76
111
  RetainMemoriesData,
77
112
  RetainMemoriesErrors,
78
113
  RetainMemoriesResponses,
114
+ TriggerConsolidationData,
115
+ TriggerConsolidationErrors,
116
+ TriggerConsolidationResponses,
117
+ UpdateBankData,
79
118
  UpdateBankDispositionData,
80
119
  UpdateBankDispositionErrors,
81
120
  UpdateBankDispositionResponses,
121
+ UpdateBankErrors,
122
+ UpdateBankResponses,
123
+ UpdateDirectiveData,
124
+ UpdateDirectiveErrors,
125
+ UpdateDirectiveResponses,
126
+ UpdateMentalModelData,
127
+ UpdateMentalModelErrors,
128
+ UpdateMentalModelResponses,
82
129
  } from "./types.gen";
83
130
 
84
131
  export type Options<
@@ -112,6 +159,19 @@ export const healthEndpointHealthGet = <ThrowOnError extends boolean = false>(
112
159
  ThrowOnError
113
160
  >({ url: "/health", ...options });
114
161
 
162
+ /**
163
+ * Get API version and feature flags
164
+ *
165
+ * Returns API version information and enabled feature flags. Use this to check which capabilities are available in this deployment.
166
+ */
167
+ export const getVersion = <ThrowOnError extends boolean = false>(
168
+ options?: Options<GetVersionData, ThrowOnError>,
169
+ ) =>
170
+ (options?.client ?? client).get<GetVersionResponses, unknown, ThrowOnError>({
171
+ url: "/version",
172
+ ...options,
173
+ });
174
+
115
175
  /**
116
176
  * Prometheus metrics endpoint
117
177
  *
@@ -282,9 +342,11 @@ export const getEntity = <ThrowOnError extends boolean = false>(
282
342
  >({ url: "/v1/default/banks/{bank_id}/entities/{entity_id}", ...options });
283
343
 
284
344
  /**
285
- * Regenerate entity observations
345
+ * Regenerate entity observations (deprecated)
346
+ *
347
+ * This endpoint is deprecated. Entity observations have been replaced by mental models.
286
348
  *
287
- * Regenerate observations for an entity based on all facts mentioning it.
349
+ * @deprecated
288
350
  */
289
351
  export const regenerateEntityObservations = <
290
352
  ThrowOnError extends boolean = false,
@@ -300,6 +362,203 @@ export const regenerateEntityObservations = <
300
362
  ...options,
301
363
  });
302
364
 
365
+ /**
366
+ * List mental models
367
+ *
368
+ * List user-curated living documents that stay current.
369
+ */
370
+ export const listMentalModels = <ThrowOnError extends boolean = false>(
371
+ options: Options<ListMentalModelsData, ThrowOnError>,
372
+ ) =>
373
+ (options.client ?? client).get<
374
+ ListMentalModelsResponses,
375
+ ListMentalModelsErrors,
376
+ ThrowOnError
377
+ >({ url: "/v1/default/banks/{bank_id}/mental-models", ...options });
378
+
379
+ /**
380
+ * Create mental model
381
+ *
382
+ * Create a mental model by running reflect with the source query in the background. Returns an operation ID to track progress. The content is auto-generated by the reflect endpoint. Use the operations endpoint to check completion status.
383
+ */
384
+ export const createMentalModel = <ThrowOnError extends boolean = false>(
385
+ options: Options<CreateMentalModelData, ThrowOnError>,
386
+ ) =>
387
+ (options.client ?? client).post<
388
+ CreateMentalModelResponses,
389
+ CreateMentalModelErrors,
390
+ ThrowOnError
391
+ >({
392
+ url: "/v1/default/banks/{bank_id}/mental-models",
393
+ ...options,
394
+ headers: {
395
+ "Content-Type": "application/json",
396
+ ...options.headers,
397
+ },
398
+ });
399
+
400
+ /**
401
+ * Delete mental model
402
+ *
403
+ * Delete a mental model.
404
+ */
405
+ export const deleteMentalModel = <ThrowOnError extends boolean = false>(
406
+ options: Options<DeleteMentalModelData, ThrowOnError>,
407
+ ) =>
408
+ (options.client ?? client).delete<
409
+ DeleteMentalModelResponses,
410
+ DeleteMentalModelErrors,
411
+ ThrowOnError
412
+ >({
413
+ url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}",
414
+ ...options,
415
+ });
416
+
417
+ /**
418
+ * Get mental model
419
+ *
420
+ * Get a specific mental model by ID.
421
+ */
422
+ export const getMentalModel = <ThrowOnError extends boolean = false>(
423
+ options: Options<GetMentalModelData, ThrowOnError>,
424
+ ) =>
425
+ (options.client ?? client).get<
426
+ GetMentalModelResponses,
427
+ GetMentalModelErrors,
428
+ ThrowOnError
429
+ >({
430
+ url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}",
431
+ ...options,
432
+ });
433
+
434
+ /**
435
+ * Update mental model
436
+ *
437
+ * Update a mental model's name and/or source query.
438
+ */
439
+ export const updateMentalModel = <ThrowOnError extends boolean = false>(
440
+ options: Options<UpdateMentalModelData, ThrowOnError>,
441
+ ) =>
442
+ (options.client ?? client).patch<
443
+ UpdateMentalModelResponses,
444
+ UpdateMentalModelErrors,
445
+ ThrowOnError
446
+ >({
447
+ url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}",
448
+ ...options,
449
+ headers: {
450
+ "Content-Type": "application/json",
451
+ ...options.headers,
452
+ },
453
+ });
454
+
455
+ /**
456
+ * Refresh mental model
457
+ *
458
+ * Submit an async task to re-run the source query through reflect and update the content.
459
+ */
460
+ export const refreshMentalModel = <ThrowOnError extends boolean = false>(
461
+ options: Options<RefreshMentalModelData, ThrowOnError>,
462
+ ) =>
463
+ (options.client ?? client).post<
464
+ RefreshMentalModelResponses,
465
+ RefreshMentalModelErrors,
466
+ ThrowOnError
467
+ >({
468
+ url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}/refresh",
469
+ ...options,
470
+ });
471
+
472
+ /**
473
+ * List directives
474
+ *
475
+ * List hard rules that are injected into prompts.
476
+ */
477
+ export const listDirectives = <ThrowOnError extends boolean = false>(
478
+ options: Options<ListDirectivesData, ThrowOnError>,
479
+ ) =>
480
+ (options.client ?? client).get<
481
+ ListDirectivesResponses,
482
+ ListDirectivesErrors,
483
+ ThrowOnError
484
+ >({ url: "/v1/default/banks/{bank_id}/directives", ...options });
485
+
486
+ /**
487
+ * Create directive
488
+ *
489
+ * Create a hard rule that will be injected into prompts.
490
+ */
491
+ export const createDirective = <ThrowOnError extends boolean = false>(
492
+ options: Options<CreateDirectiveData, ThrowOnError>,
493
+ ) =>
494
+ (options.client ?? client).post<
495
+ CreateDirectiveResponses,
496
+ CreateDirectiveErrors,
497
+ ThrowOnError
498
+ >({
499
+ url: "/v1/default/banks/{bank_id}/directives",
500
+ ...options,
501
+ headers: {
502
+ "Content-Type": "application/json",
503
+ ...options.headers,
504
+ },
505
+ });
506
+
507
+ /**
508
+ * Delete directive
509
+ *
510
+ * Delete a directive.
511
+ */
512
+ export const deleteDirective = <ThrowOnError extends boolean = false>(
513
+ options: Options<DeleteDirectiveData, ThrowOnError>,
514
+ ) =>
515
+ (options.client ?? client).delete<
516
+ DeleteDirectiveResponses,
517
+ DeleteDirectiveErrors,
518
+ ThrowOnError
519
+ >({
520
+ url: "/v1/default/banks/{bank_id}/directives/{directive_id}",
521
+ ...options,
522
+ });
523
+
524
+ /**
525
+ * Get directive
526
+ *
527
+ * Get a specific directive by ID.
528
+ */
529
+ export const getDirective = <ThrowOnError extends boolean = false>(
530
+ options: Options<GetDirectiveData, ThrowOnError>,
531
+ ) =>
532
+ (options.client ?? client).get<
533
+ GetDirectiveResponses,
534
+ GetDirectiveErrors,
535
+ ThrowOnError
536
+ >({
537
+ url: "/v1/default/banks/{bank_id}/directives/{directive_id}",
538
+ ...options,
539
+ });
540
+
541
+ /**
542
+ * Update directive
543
+ *
544
+ * Update a directive's properties.
545
+ */
546
+ export const updateDirective = <ThrowOnError extends boolean = false>(
547
+ options: Options<UpdateDirectiveData, ThrowOnError>,
548
+ ) =>
549
+ (options.client ?? client).patch<
550
+ UpdateDirectiveResponses,
551
+ UpdateDirectiveErrors,
552
+ ThrowOnError
553
+ >({
554
+ url: "/v1/default/banks/{bank_id}/directives/{directive_id}",
555
+ ...options,
556
+ headers: {
557
+ "Content-Type": "application/json",
558
+ ...options.headers,
559
+ },
560
+ });
561
+
303
562
  /**
304
563
  * List documents
305
564
  *
@@ -380,7 +639,7 @@ export const getChunk = <ThrowOnError extends boolean = false>(
380
639
  /**
381
640
  * List async operations
382
641
  *
383
- * Get a list of all async operations (pending and failed) for a specific agent, including error messages for failed operations
642
+ * Get a list of async operations for a specific agent, with optional filtering by status. Results are sorted by most recent first.
384
643
  */
385
644
  export const listOperations = <ThrowOnError extends boolean = false>(
386
645
  options: Options<ListOperationsData, ThrowOnError>,
@@ -408,10 +667,27 @@ export const cancelOperation = <ThrowOnError extends boolean = false>(
408
667
  ...options,
409
668
  });
410
669
 
670
+ /**
671
+ * Get operation status
672
+ *
673
+ * Get the status of a specific async operation. Returns 'pending', 'completed', or 'failed'. Completed operations are removed from storage, so 'completed' means the operation finished successfully.
674
+ */
675
+ export const getOperationStatus = <ThrowOnError extends boolean = false>(
676
+ options: Options<GetOperationStatusData, ThrowOnError>,
677
+ ) =>
678
+ (options.client ?? client).get<
679
+ GetOperationStatusResponses,
680
+ GetOperationStatusErrors,
681
+ ThrowOnError
682
+ >({
683
+ url: "/v1/default/banks/{bank_id}/operations/{operation_id}",
684
+ ...options,
685
+ });
686
+
411
687
  /**
412
688
  * Get memory bank profile
413
689
  *
414
- * Get disposition traits and background for a memory bank. Auto-creates agent with defaults if not exists.
690
+ * Get disposition traits and mission for a memory bank. Auto-creates agent with defaults if not exists.
415
691
  */
416
692
  export const getBankProfile = <ThrowOnError extends boolean = false>(
417
693
  options: Options<GetBankProfileData, ThrowOnError>,
@@ -444,9 +720,11 @@ export const updateBankDisposition = <ThrowOnError extends boolean = false>(
444
720
  });
445
721
 
446
722
  /**
447
- * Add/merge memory bank background
723
+ * Add/merge memory bank background (deprecated)
724
+ *
725
+ * Deprecated: Use PUT /mission instead. This endpoint now updates the mission field.
448
726
  *
449
- * Add new background information or merge with existing. LLM intelligently resolves conflicts, normalizes to first person, and optionally infers disposition traits.
727
+ * @deprecated
450
728
  */
451
729
  export const addBankBackground = <ThrowOnError extends boolean = false>(
452
730
  options: Options<AddBankBackgroundData, ThrowOnError>,
@@ -478,10 +756,31 @@ export const deleteBank = <ThrowOnError extends boolean = false>(
478
756
  ThrowOnError
479
757
  >({ url: "/v1/default/banks/{bank_id}", ...options });
480
758
 
759
+ /**
760
+ * Partial update memory bank
761
+ *
762
+ * Partially update an agent's profile. Only provided fields will be updated.
763
+ */
764
+ export const updateBank = <ThrowOnError extends boolean = false>(
765
+ options: Options<UpdateBankData, ThrowOnError>,
766
+ ) =>
767
+ (options.client ?? client).patch<
768
+ UpdateBankResponses,
769
+ UpdateBankErrors,
770
+ ThrowOnError
771
+ >({
772
+ url: "/v1/default/banks/{bank_id}",
773
+ ...options,
774
+ headers: {
775
+ "Content-Type": "application/json",
776
+ ...options.headers,
777
+ },
778
+ });
779
+
481
780
  /**
482
781
  * Create or update memory bank
483
782
  *
484
- * Create a new agent or update existing agent with disposition and background. Auto-fills missing fields with defaults.
783
+ * Create a new agent or update existing agent with disposition and mission. Auto-fills missing fields with defaults.
485
784
  */
486
785
  export const createOrUpdateBank = <ThrowOnError extends boolean = false>(
487
786
  options: Options<CreateOrUpdateBankData, ThrowOnError>,
@@ -499,6 +798,34 @@ export const createOrUpdateBank = <ThrowOnError extends boolean = false>(
499
798
  },
500
799
  });
501
800
 
801
+ /**
802
+ * Clear all observations
803
+ *
804
+ * Delete all observations for a memory bank. This is useful for resetting the consolidated knowledge.
805
+ */
806
+ export const clearObservations = <ThrowOnError extends boolean = false>(
807
+ options: Options<ClearObservationsData, ThrowOnError>,
808
+ ) =>
809
+ (options.client ?? client).delete<
810
+ ClearObservationsResponses,
811
+ ClearObservationsErrors,
812
+ ThrowOnError
813
+ >({ url: "/v1/default/banks/{bank_id}/observations", ...options });
814
+
815
+ /**
816
+ * Trigger consolidation
817
+ *
818
+ * Run memory consolidation to create/update observations from recent memories.
819
+ */
820
+ export const triggerConsolidation = <ThrowOnError extends boolean = false>(
821
+ options: Options<TriggerConsolidationData, ThrowOnError>,
822
+ ) =>
823
+ (options.client ?? client).post<
824
+ TriggerConsolidationResponses,
825
+ TriggerConsolidationErrors,
826
+ ThrowOnError
827
+ >({ url: "/v1/default/banks/{bank_id}/consolidate", ...options });
828
+
502
829
  /**
503
830
  * Clear memory bank memories
504
831
  *