@vectorize-io/hindsight-client 0.4.13 → 0.4.14

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/src/index.ts CHANGED
@@ -39,6 +39,7 @@ import type {
39
39
  FileRetainResponse,
40
40
  ListMemoryUnitsResponse,
41
41
  BankProfileResponse,
42
+ BankConfigResponse,
42
43
  CreateBankRequest,
43
44
  Budget,
44
45
  } from '../generated/types.gen';
@@ -347,25 +348,73 @@ export class HindsightClient {
347
348
  }
348
349
 
349
350
  /**
350
- * Create or update a bank with disposition and background.
351
+ * Create or update a bank with disposition, missions, and operational configuration.
351
352
  */
352
353
  async createBank(
353
354
  bankId: string,
354
- options: { name?: string; background?: string; disposition?: any }
355
+ options: {
356
+ /** @deprecated Display label only. */
357
+ name?: string;
358
+ /** @deprecated Use reflectMission instead. */
359
+ mission?: string;
360
+ /** Mission/context for Reflect operations. */
361
+ reflectMission?: string;
362
+ /** @deprecated Alias for mission. */
363
+ background?: string;
364
+ /** @deprecated Use dispositionSkepticism, dispositionLiteralism, dispositionEmpathy instead. */
365
+ disposition?: { skepticism: number; literalism: number; empathy: number };
366
+ /** @deprecated Use updateBankConfig({ dispositionSkepticism }) instead. */
367
+ dispositionSkepticism?: number;
368
+ /** @deprecated Use updateBankConfig({ dispositionLiteralism }) instead. */
369
+ dispositionLiteralism?: number;
370
+ /** @deprecated Use updateBankConfig({ dispositionEmpathy }) instead. */
371
+ dispositionEmpathy?: number;
372
+ /** Steers what gets extracted during retain(). Injected alongside built-in rules. */
373
+ retainMission?: string;
374
+ /** Fact extraction mode: 'concise' (default), 'verbose', or 'custom'. */
375
+ retainExtractionMode?: string;
376
+ /** Custom extraction prompt (only active when retainExtractionMode is 'custom'). */
377
+ retainCustomInstructions?: string;
378
+ /** Maximum token size for each content chunk during retain. */
379
+ retainChunkSize?: number;
380
+ /** Toggle automatic observation consolidation after retain(). */
381
+ enableObservations?: boolean;
382
+ /** Controls what gets synthesised into observations. Replaces built-in rules. */
383
+ observationsMission?: string;
384
+ } = {}
355
385
  ): Promise<BankProfileResponse> {
356
386
  const response = await sdk.createOrUpdateBank({
357
387
  client: this.client,
358
388
  path: { bank_id: bankId },
359
389
  body: {
360
390
  name: options.name,
391
+ mission: options.mission,
392
+ reflect_mission: options.reflectMission,
361
393
  background: options.background,
362
394
  disposition: options.disposition,
395
+ disposition_skepticism: options.dispositionSkepticism,
396
+ disposition_literalism: options.dispositionLiteralism,
397
+ disposition_empathy: options.dispositionEmpathy,
398
+ retain_mission: options.retainMission,
399
+ retain_extraction_mode: options.retainExtractionMode,
400
+ retain_custom_instructions: options.retainCustomInstructions,
401
+ retain_chunk_size: options.retainChunkSize,
402
+ enable_observations: options.enableObservations,
403
+ observations_mission: options.observationsMission,
363
404
  },
364
405
  });
365
406
 
366
407
  return this.validateResponse(response, 'createBank');
367
408
  }
368
409
 
410
+ /**
411
+ * Set or update the reflect mission for a memory bank.
412
+ * @deprecated Use createBank({ reflectMission: '...' }) instead.
413
+ */
414
+ async setMission(bankId: string, mission: string): Promise<BankProfileResponse> {
415
+ return this.createBank(bankId, { reflectMission: mission });
416
+ }
417
+
369
418
  /**
370
419
  * Get a bank's profile.
371
420
  */
@@ -378,17 +427,81 @@ export class HindsightClient {
378
427
  return this.validateResponse(response, 'getBankProfile');
379
428
  }
380
429
 
430
+
381
431
  /**
382
- * Set or update the mission for a memory bank.
432
+ * Get the resolved configuration for a bank, including any bank-level overrides.
433
+ *
434
+ * Can be disabled on the server by setting `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false`.
383
435
  */
384
- async setMission(bankId: string, mission: string): Promise<BankProfileResponse> {
385
- const response = await sdk.createOrUpdateBank({
436
+ async getBankConfig(bankId: string): Promise<BankConfigResponse> {
437
+ const response = await sdk.getBankConfig({
438
+ client: this.client,
439
+ path: { bank_id: bankId },
440
+ });
441
+
442
+ return this.validateResponse(response, 'getBankConfig');
443
+ }
444
+
445
+ /**
446
+ * Update configuration overrides for a bank.
447
+ *
448
+ * Can be disabled on the server by setting `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false`.
449
+ *
450
+ * @param bankId - The memory bank ID
451
+ * @param options - Fields to override
452
+ */
453
+ async updateBankConfig(
454
+ bankId: string,
455
+ options: {
456
+ reflectMission?: string;
457
+ retainMission?: string;
458
+ retainExtractionMode?: string;
459
+ retainCustomInstructions?: string;
460
+ retainChunkSize?: number;
461
+ enableObservations?: boolean;
462
+ observationsMission?: string;
463
+ /** How skeptical vs trusting (1=trusting, 5=skeptical). */
464
+ dispositionSkepticism?: number;
465
+ /** How literally to interpret information (1=flexible, 5=literal). */
466
+ dispositionLiteralism?: number;
467
+ /** How much to consider emotional context (1=detached, 5=empathetic). */
468
+ dispositionEmpathy?: number;
469
+ },
470
+ ): Promise<BankConfigResponse> {
471
+ const updates: Record<string, unknown> = {};
472
+ if (options.reflectMission !== undefined) updates.reflect_mission = options.reflectMission;
473
+ if (options.retainMission !== undefined) updates.retain_mission = options.retainMission;
474
+ if (options.retainExtractionMode !== undefined) updates.retain_extraction_mode = options.retainExtractionMode;
475
+ if (options.retainCustomInstructions !== undefined)
476
+ updates.retain_custom_instructions = options.retainCustomInstructions;
477
+ if (options.retainChunkSize !== undefined) updates.retain_chunk_size = options.retainChunkSize;
478
+ if (options.enableObservations !== undefined) updates.enable_observations = options.enableObservations;
479
+ if (options.observationsMission !== undefined) updates.observations_mission = options.observationsMission;
480
+ if (options.dispositionSkepticism !== undefined) updates.disposition_skepticism = options.dispositionSkepticism;
481
+ if (options.dispositionLiteralism !== undefined) updates.disposition_literalism = options.dispositionLiteralism;
482
+ if (options.dispositionEmpathy !== undefined) updates.disposition_empathy = options.dispositionEmpathy;
483
+
484
+ const response = await sdk.updateBankConfig({
485
+ client: this.client,
486
+ path: { bank_id: bankId },
487
+ body: { updates },
488
+ });
489
+
490
+ return this.validateResponse(response, 'updateBankConfig');
491
+ }
492
+
493
+ /**
494
+ * Reset all bank-level configuration overrides, reverting to server defaults.
495
+ *
496
+ * Can be disabled on the server by setting `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false`.
497
+ */
498
+ async resetBankConfig(bankId: string): Promise<BankConfigResponse> {
499
+ const response = await sdk.resetBankConfig({
386
500
  client: this.client,
387
501
  path: { bank_id: bankId },
388
- body: { mission },
389
502
  });
390
503
 
391
- return this.validateResponse(response, 'setMission');
504
+ return this.validateResponse(response, 'resetBankConfig');
392
505
  }
393
506
 
394
507
  /**
@@ -623,6 +736,7 @@ export type {
623
736
  FileRetainResponse,
624
737
  ListMemoryUnitsResponse,
625
738
  BankProfileResponse,
739
+ BankConfigResponse,
626
740
  CreateBankRequest,
627
741
  Budget,
628
742
  };