@ghostpaw/affinity 0.4.1 → 0.6.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.
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ declare abstract class AffinityError extends Error {
17
17
 
18
18
  /** Uniqueness, routing, or ownership collision. */
19
19
  declare class AffinityConflictError extends AffinityError {
20
+ existingContactId?: number;
20
21
  readonly code: "CONFLICT";
21
22
  }
22
23
 
@@ -137,6 +138,7 @@ interface AttributeEntry {
137
138
 
138
139
  /** Attribute row for mutation receipts — stable id + target + payload. */
139
140
  interface AttributeRecord {
141
+ eventId?: number;
140
142
  id: number;
141
143
  contactId: number | null;
142
144
  linkId: number | null;
@@ -145,7 +147,7 @@ interface AttributeRecord {
145
147
  }
146
148
 
147
149
  /**
148
- * Write target for attributes — exactly one of contact or link (CONCEPT.md).
150
+ * Write target for attributes — exactly one of contact, link or event (CONCEPT.md).
149
151
  */
150
152
  type AttributeTarget = {
151
153
  kind: "contact";
@@ -153,6 +155,9 @@ type AttributeTarget = {
153
155
  } | {
154
156
  kind: "link";
155
157
  id: number;
158
+ } | {
159
+ kind: "event";
160
+ eventId: number;
156
161
  };
157
162
 
158
163
  /** Open commitment lifecycle on reads — CONCEPT.md CommitmentRecord. */
@@ -167,11 +172,14 @@ interface EventParticipantView {
167
172
 
168
173
  /** Promise/agreement projection — CONCEPT.md CommitmentRecord. */
169
174
  interface CommitmentRecord {
175
+ dueAtIso?: string | null;
176
+ overdue?: boolean;
170
177
  eventId: number;
171
178
  type: EventType;
172
179
  summary: string;
173
180
  participants: readonly EventParticipantView[];
174
181
  dueAt?: number | null;
182
+ dueOn?: string | null;
175
183
  resolutionState: CommitmentResolutionState;
176
184
  }
177
185
 
@@ -193,6 +201,7 @@ declare const AFFINITY_DEFAULT_LIST_LIMIT = 50;
193
201
  declare const AFFINITY_MAX_LIST_LIMIT = 250;
194
202
  /** Shared list-style read controls — CONCEPT.md Global query contract. */
195
203
  interface AffinityListReadOptions {
204
+ now?: number;
196
205
  limit?: number;
197
206
  offset?: number;
198
207
  sort?: string;
@@ -206,17 +215,22 @@ interface AffinityListReadOptions {
206
215
 
207
216
  /** Options for `read.getContactJournal` / `read.getLinkTimeline`. */
208
217
  type ContactJournalReadOptions = AffinityListReadOptions & {
218
+ includeContent?: boolean;
219
+ channel?: string;
209
220
  eventTypes?: readonly EventType[];
210
221
  };
211
222
 
212
223
  /** Options for `read.getContactProfile`. */
213
224
  interface ContactProfileReadOptions {
214
225
  /** Cap on relational links returned in `topLinks` (default 8). */
226
+ recentEventsLimit?: number;
227
+ now?: number;
215
228
  topLinksLimit?: number;
216
229
  }
217
230
 
218
231
  /** Compact portfolio row — CONCEPT.md ContactListItem. */
219
232
  interface ContactListItem {
233
+ matchedOn?: string[];
220
234
  id: number;
221
235
  name: string;
222
236
  kind: ContactKind;
@@ -226,6 +240,63 @@ interface ContactListItem {
226
240
  lastMeaningfulEventAt?: number | null;
227
241
  }
228
242
 
243
+ /** Shared participant row for evidence writes — CONCEPT.md SocialEventInput. */
244
+ interface SocialEventParticipantInput {
245
+ contactId: number;
246
+ role: EventParticipantRole;
247
+ directionality?: undefined | "owner_initiated" | "other_initiated" | "mutual" | "observed";
248
+ }
249
+ /** Evidence intake shape shared by interaction-style writes — CONCEPT.md. */
250
+ interface SocialEventInput {
251
+ occurredAt: number;
252
+ occurredOn?: string;
253
+ summary?: string;
254
+ content?: string;
255
+ affectsBond?: boolean;
256
+ externalRef?: ExternalRef;
257
+ channel?: string;
258
+ parentRef?: ExternalRef;
259
+ parentEventId?: number;
260
+ threadRef?: ExternalRef;
261
+ momentKind?: EventMomentKind;
262
+ /** Significance 1..10 — enforced at write layer. */
263
+ significance: number;
264
+ participants: readonly SocialEventParticipantInput[];
265
+ provenance?: unknown;
266
+ }
267
+ /** Stable external event identity. */
268
+ interface ExternalRef {
269
+ source: string;
270
+ id: string;
271
+ }
272
+
273
+ /** Journal entry with explicit participants — CONCEPT.md EventRecord. */
274
+ interface EventRecord {
275
+ content?: string;
276
+ externalRef?: ExternalRef;
277
+ channel?: string;
278
+ parentRef?: ExternalRef;
279
+ parentEventId?: number;
280
+ threadRef?: ExternalRef;
281
+ attributes?: AttributeRecord[];
282
+ id: number;
283
+ affectsBond?: boolean;
284
+ type: EventType;
285
+ occurredAt: number;
286
+ occurredOn?: string;
287
+ dueAt?: number | null;
288
+ dueOn?: string | null;
289
+ summary: string;
290
+ significance: number;
291
+ momentKind: EventMomentKind | null;
292
+ participants: readonly EventParticipantView[];
293
+ recurrenceKind?: EventRecurrenceKind | null;
294
+ anchorMonth?: number | null;
295
+ anchorDay?: number | null;
296
+ anchorContactId?: number | null;
297
+ anchorLinkId?: number | null;
298
+ }
299
+
229
300
  /** One routing identity on a contact — CONCEPT.md IdentityRecord. */
230
301
  interface IdentityRecord {
231
302
  id: number;
@@ -241,6 +312,7 @@ interface IdentityRecord {
241
312
  /** Compact link row for lists — CONCEPT.md LinkListItem. */
242
313
  interface LinkListItem {
243
314
  id: number;
315
+ counterpartyName?: string;
244
316
  fromContactId: number;
245
317
  toContactId: number;
246
318
  kind: LinkKind;
@@ -289,6 +361,8 @@ interface UpcomingDateRecord {
289
361
  recurrenceKind: EventRecurrenceKind;
290
362
  /** Epoch milliseconds for the materialized next occurrence (sorting key). */
291
363
  occursOn: number;
364
+ /** Calendar date; occursOn retains its existing numeric sorting key. */
365
+ occursOnDate?: string;
292
366
  summary: string;
293
367
  significance: number;
294
368
  }
@@ -296,6 +370,21 @@ interface UpcomingDateRecord {
296
370
  /** Full contact detail — CONCEPT.md ContactProfileRecord. */
297
371
  interface ContactProfileRecord {
298
372
  contact: ContactCore;
373
+ recentEvents?: readonly (EventRecord & {
374
+ occurredAtIso: string;
375
+ })[];
376
+ openCommitments?: readonly CommitmentRecord[];
377
+ ties?: readonly {
378
+ id: number;
379
+ kind: string;
380
+ role: string | null;
381
+ contactId: number;
382
+ name: string;
383
+ }[];
384
+ mergedInto?: {
385
+ id: number;
386
+ name: string;
387
+ };
299
388
  identities: readonly IdentityRecord[];
300
389
  attributes: readonly AttributeEntry[];
301
390
  topLinks: readonly LinkListItem[];
@@ -339,6 +428,7 @@ interface AddDateAnchorInput {
339
428
 
340
429
  /** Arguments for `write.addIdentity`. */
341
430
  interface AddIdentityInput {
431
+ ifExists?: "error" | "return";
342
432
  type: string;
343
433
  value: string;
344
434
  label?: string | null;
@@ -352,6 +442,8 @@ interface CreateContactInput {
352
442
  name: string;
353
443
  kind: ContactKind;
354
444
  now?: number;
445
+ identities?: AddIdentityInput[];
446
+ ifExists?: "error" | "return";
355
447
  /**
356
448
  * When true, marks this row as the sole owner contact.
357
449
  * Allowed only while no other live owner exists.
@@ -401,26 +493,11 @@ interface SetStructuralTieInput {
401
493
  now?: number;
402
494
  }
403
495
 
404
- /** Shared participant row for evidence writes — CONCEPT.md SocialEventInput. */
405
- interface SocialEventParticipantInput {
406
- contactId: number;
407
- role: EventParticipantRole;
408
- directionality?: "owner_initiated" | "other_initiated" | "mutual" | "observed";
409
- }
410
- /** Evidence intake shape shared by interaction-style writes — CONCEPT.md. */
411
- interface SocialEventInput {
412
- occurredAt: number;
413
- summary: string;
414
- /** Significance 1..10 — enforced at write layer. */
415
- significance: number;
416
- participants: readonly SocialEventParticipantInput[];
417
- provenance?: unknown;
418
- }
419
-
420
496
  /** Arguments for `write.recordCommitment`. */
421
497
  interface RecordCommitmentInput extends SocialEventInput {
422
498
  commitmentType: "promise" | "agreement";
423
499
  dueAt?: number | null;
500
+ dueOn?: string | null;
424
501
  now?: number;
425
502
  }
426
503
 
@@ -450,6 +527,7 @@ interface RecordTransactionInput extends SocialEventInput {
450
527
  interface ResolveCommitmentEventInput {
451
528
  type?: Exclude<EventType, "date_anchor">;
452
529
  occurredAt?: number;
530
+ occurredOn?: string;
453
531
  summary?: string;
454
532
  significance?: number;
455
533
  participants?: readonly SocialEventParticipantInput[];
@@ -479,6 +557,7 @@ interface ReviseDateAnchorOptions {
479
557
 
480
558
  /** Arguments for `write.seedSocialLink`. */
481
559
  interface SeedSocialLinkInput {
560
+ ifExists?: "error" | "return";
482
561
  fromContactId: number;
483
562
  toContactId: number;
484
563
  kind: RelationalLinkKind;
@@ -550,27 +629,24 @@ interface DismissedDuplicateRecord {
550
629
  dismissedAt: number;
551
630
  }
552
631
 
553
- /** Journal entry with explicit participants — CONCEPT.md EventRecord. */
554
- interface EventRecord {
555
- id: number;
556
- type: EventType;
557
- occurredAt: number;
558
- summary: string;
559
- significance: number;
560
- momentKind: EventMomentKind | null;
561
- participants: readonly EventParticipantView[];
562
- recurrenceKind?: EventRecurrenceKind | null;
563
- anchorMonth?: number | null;
564
- anchorDay?: number | null;
565
- anchorContactId?: number | null;
566
- anchorLinkId?: number | null;
567
- }
568
-
569
632
  /** Raw `events` row from SQLite (snake_case columns). */
570
633
  interface EventRow {
634
+ content?: string | null;
635
+ external_source?: string | null;
636
+ external_id?: string | null;
637
+ channel?: string | null;
638
+ parent_source?: string | null;
639
+ parent_ref_id?: string | null;
640
+ parent_event_id?: number | null;
641
+ thread_source?: string | null;
642
+ thread_id?: string | null;
643
+ provenance_json?: string | null;
571
644
  id: number;
572
645
  type: string;
573
646
  occurred_at: number;
647
+ occurred_on?: string | null;
648
+ due_at?: number | null;
649
+ due_on?: string | null;
574
650
  summary: string;
575
651
  significance: number;
576
652
  moment_kind: string | null;
@@ -590,6 +666,7 @@ interface MomentRecord {
590
666
  linkId: number;
591
667
  momentKind: EventMomentKind;
592
668
  occurredAt: number;
669
+ occurredOn?: string;
593
670
  summary: string;
594
671
  impactScore: number;
595
672
  }
@@ -612,6 +689,7 @@ interface LinkDetailReadOptions {
612
689
 
613
690
  /** Common filters for link list reads — CONCEPT.md. */
614
691
  interface LinkListReadFilters {
692
+ includeLost?: boolean;
615
693
  kind?: LinkKind;
616
694
  state?: LinkState;
617
695
  }
@@ -643,6 +721,9 @@ interface LinkRow {
643
721
 
644
722
  /** Filters for `read.listContacts` — CONCEPT.md portfolio list. */
645
723
  interface ListContactsFilters {
724
+ attribute?: string | string[];
725
+ tag?: string | string[];
726
+ includeLost?: boolean;
646
727
  kind?: ContactKind;
647
728
  lifecycleState?: ContactLifecycleState;
648
729
  includeOwner?: boolean;
@@ -700,6 +781,10 @@ interface MergePrimary {
700
781
  */
701
782
  interface MutationReceipt<TPrimary> {
702
783
  primary: TPrimary;
784
+ warnings?: {
785
+ code: "future_event";
786
+ message: string;
787
+ }[];
703
788
  created: EntityRef[];
704
789
  updated: EntityRef[];
705
790
  archived: EntityRef[];
@@ -707,16 +792,22 @@ interface MutationReceipt<TPrimary> {
707
792
  affectedLinks: number[];
708
793
  derivedEffects: DerivedLinkEffect[];
709
794
  }
710
- type ContactMutationReceipt = MutationReceipt<ContactListItem>;
795
+ type ContactMutationReceipt = MutationReceipt<ContactListItem> & {
796
+ outcome?: "success" | "no_op";
797
+ matchedIdentities?: AddIdentityInput[];
798
+ };
711
799
  type IdentityMutationReceipt = MutationReceipt<IdentityRecord>;
712
800
  type LinkMutationReceipt = MutationReceipt<LinkListItem>;
713
- type EventMutationReceipt = MutationReceipt<EventRecord>;
801
+ type EventMutationReceipt = MutationReceipt<EventRecord> & {
802
+ outcome?: "success" | "no_op";
803
+ };
714
804
  type AttributeMutationReceipt = MutationReceipt<AttributeRecord>;
715
805
  type MergeReceipt = MutationReceipt<MergePrimary>;
716
806
  type DismissalMutationReceipt = MutationReceipt<DismissedPairRef>;
717
807
 
718
808
  /** Maintenance radar row — CONCEPT.md RadarRecord. */
719
809
  interface RadarRecord {
810
+ reasons?: string[];
720
811
  linkId: number;
721
812
  contactId: number;
722
813
  driftPriority: number;
@@ -740,6 +831,67 @@ interface MergeHistoryRecord {
740
831
  manual: boolean;
741
832
  }
742
833
 
834
+ interface EventSearchItem {
835
+ [key: string]: unknown;
836
+ kind: "event";
837
+ id: number;
838
+ occurredOn: string;
839
+ type: string;
840
+ title: string;
841
+ matchedOn: string[];
842
+ externalRef?: ExternalRef;
843
+ }
844
+ declare function searchEvents(db: AffinityDb, query: string, options?: {
845
+ limit?: number;
846
+ offset?: number;
847
+ }): EventSearchItem[];
848
+ declare function getEventThread(db: AffinityDb, source: string, id: string, options?: {
849
+ includeContent?: boolean;
850
+ channel?: string;
851
+ limit?: number;
852
+ offset?: number;
853
+ }): EventRecord[];
854
+
855
+ declare function getContactJournal(db: AffinityDb, contactId: number, options?: ContactJournalReadOptions): EventRecord[];
856
+
857
+ declare function listMoments(db: AffinityDb, filters?: ListMomentsFilters, options?: AffinityListReadOptions & {
858
+ channel?: string;
859
+ }): MomentRecord[];
860
+
861
+ declare function listOpenCommitments(db: AffinityDb, filters?: ListOpenCommitmentsFilters, options?: AffinityListReadOptions & {
862
+ channel?: string;
863
+ }): CommitmentRecord[];
864
+
865
+ declare function recordCommitment(db: AffinityDb, input: RecordCommitmentInput): EventMutationReceipt;
866
+
867
+ declare function recordInteraction(db: AffinityDb, input: RecordInteractionInput): EventMutationReceipt;
868
+
869
+ declare function recordMilestone(db: AffinityDb, input: RecordMilestoneInput): EventMutationReceipt;
870
+
871
+ declare function recordObservation(db: AffinityDb, input: RecordObservationInput): EventMutationReceipt;
872
+
873
+ declare function recordTransaction(db: AffinityDb, input: RecordTransactionInput): EventMutationReceipt;
874
+
875
+ declare function resolveCommitment(db: AffinityDb, commitmentEventId: number, resolution: CommitmentResolutionKind, options?: ResolveCommitmentOptions): EventMutationReceipt;
876
+
877
+ type EventTarget = number | {
878
+ eventId?: number;
879
+ ref?: ExternalRef;
880
+ };
881
+ interface ReviseEventPatch {
882
+ summary?: string;
883
+ content?: string;
884
+ occurredAt?: number;
885
+ significance?: number;
886
+ channel?: string;
887
+ type?: EventType;
888
+ externalRef?: ExternalRef;
889
+ }
890
+ declare function reviseEvent(db: AffinityDb, target: EventTarget, patch: ReviseEventPatch): EventMutationReceipt;
891
+ declare function deleteEvent(db: AffinityDb, target: EventTarget, options: {
892
+ confirm: boolean;
893
+ }): EventMutationReceipt;
894
+
743
895
  declare const types_AFFINITY_DEFAULT_LIST_LIMIT: typeof AFFINITY_DEFAULT_LIST_LIMIT;
744
896
  declare const types_AFFINITY_MAX_LIST_LIMIT: typeof AFFINITY_MAX_LIST_LIMIT;
745
897
  type types_AddDateAnchorInput = AddDateAnchorInput;
@@ -781,7 +933,10 @@ type types_EventParticipantView = EventParticipantView;
781
933
  type types_EventRecord = EventRecord;
782
934
  type types_EventRecurrenceKind = EventRecurrenceKind;
783
935
  type types_EventRow = EventRow;
936
+ type types_EventSearchItem = EventSearchItem;
937
+ type types_EventTarget = EventTarget;
784
938
  type types_EventType = EventType;
939
+ type types_ExternalRef = ExternalRef;
785
940
  type types_IdentityMutationReceipt = IdentityMutationReceipt;
786
941
  type types_IdentityRecord = IdentityRecord;
787
942
  type types_IdentityRow = IdentityRow;
@@ -820,6 +975,7 @@ type types_ResolveCommitmentOptions = ResolveCommitmentOptions;
820
975
  type types_ReviseContactPatch = ReviseContactPatch;
821
976
  type types_ReviseDateAnchorOptions = ReviseDateAnchorOptions;
822
977
  type types_ReviseDateAnchorPatch = ReviseDateAnchorPatch;
978
+ type types_ReviseEventPatch = ReviseEventPatch;
823
979
  type types_ReviseIdentityPatch = ReviseIdentityPatch;
824
980
  type types_SeedSocialLinkInput = SeedSocialLinkInput;
825
981
  type types_SetContactLifecycleOptions = SetContactLifecycleOptions;
@@ -831,7 +987,7 @@ type types_UpcomingDateRecord = UpcomingDateRecord;
831
987
  type types_UpcomingDateTargetRef = UpcomingDateTargetRef;
832
988
  declare const types_resolveAffinityListLimit: typeof resolveAffinityListLimit;
833
989
  declare namespace types {
834
- export { types_AFFINITY_DEFAULT_LIST_LIMIT as AFFINITY_DEFAULT_LIST_LIMIT, types_AFFINITY_MAX_LIST_LIMIT as AFFINITY_MAX_LIST_LIMIT, type types_AddDateAnchorInput as AddDateAnchorInput, type types_AddIdentityInput as AddIdentityInput, type types_AffinityChartEdge as AffinityChartEdge, type types_AffinityChartNode as AffinityChartNode, type types_AffinityChartReadOptions as AffinityChartReadOptions, type types_AffinityChartRecord as AffinityChartRecord, type types_AffinityListReadOptions as AffinityListReadOptions, type types_AttributeEntry as AttributeEntry, type types_AttributeMutationReceipt as AttributeMutationReceipt, type types_AttributeName as AttributeName, type types_AttributeRecord as AttributeRecord, type types_AttributeTarget as AttributeTarget, type types_CommitmentRecord as CommitmentRecord, type types_CommitmentResolutionKind as CommitmentResolutionKind, type types_CommitmentResolutionState as CommitmentResolutionState, type types_ContactCore as ContactCore, type types_ContactJournalReadOptions as ContactJournalReadOptions, type types_ContactKind as ContactKind, type types_ContactLifecycleState as ContactLifecycleState, type types_ContactListItem as ContactListItem, type types_ContactMutationReceipt as ContactMutationReceipt, type types_ContactProfileReadOptions as ContactProfileReadOptions, type types_ContactProfileRecord as ContactProfileRecord, type types_ContactRow as ContactRow, type types_CreateContactInput as CreateContactInput, type types_DateAnchorTarget as DateAnchorTarget, type types_DerivedLinkEffect as DerivedLinkEffect, type types_DismissalMutationReceipt as DismissalMutationReceipt, type types_DismissedDuplicateRecord as DismissedDuplicateRecord, type types_DismissedPairRef as DismissedPairRef, type types_DuplicateCandidateRecord as DuplicateCandidateRecord, type types_EntityRef as EntityRef, type types_EventMomentKind as EventMomentKind, type types_EventMutationReceipt as EventMutationReceipt, type types_EventParticipantRole as EventParticipantRole, type types_EventParticipantView as EventParticipantView, type types_EventRecord as EventRecord, type types_EventRecurrenceKind as EventRecurrenceKind, type types_EventRow as EventRow, type types_EventType as EventType, type types_IdentityMutationReceipt as IdentityMutationReceipt, type types_IdentityRecord as IdentityRecord, type types_IdentityRow as IdentityRow, type types_IdentityType as IdentityType, type types_InteractionEventType as InteractionEventType, type types_LinkDetailReadOptions as LinkDetailReadOptions, type types_LinkDetailRecord as LinkDetailRecord, type types_LinkKind as LinkKind, type types_LinkListItem as LinkListItem, type types_LinkListReadFilters as LinkListReadFilters, type types_LinkMutationOptions as LinkMutationOptions, type types_LinkMutationReceipt as LinkMutationReceipt, type types_LinkRow as LinkRow, type types_LinkState as LinkState, type types_ListContactsFilters as ListContactsFilters, type types_ListDuplicateCandidatesFilters as ListDuplicateCandidatesFilters, type types_ListMomentsFilters as ListMomentsFilters, type types_ListOpenCommitmentsFilters as ListOpenCommitmentsFilters, type types_ListUpcomingDatesFilters as ListUpcomingDatesFilters, type types_MergeContactsInput as MergeContactsInput, type types_MergeHistoryRecord as MergeHistoryRecord, type types_MergePrimary as MergePrimary, type types_MergeReceipt as MergeReceipt, type types_MomentRecord as MomentRecord, type types_MutationReceipt as MutationReceipt, type types_OpaqueDerivation as OpaqueDerivation, type types_OpaqueRollup as OpaqueRollup, type types_RadarRecord as RadarRecord, type types_RecordCommitmentInput as RecordCommitmentInput, type types_RecordInteractionInput as RecordInteractionInput, type types_RecordMilestoneInput as RecordMilestoneInput, type types_RecordObservationInput as RecordObservationInput, type types_RecordTransactionInput as RecordTransactionInput, type types_RelationalLinkKind as RelationalLinkKind, type types_ResolveCommitmentOptions as ResolveCommitmentOptions, type types_ReviseContactPatch as ReviseContactPatch, type types_ReviseDateAnchorOptions as ReviseDateAnchorOptions, type types_ReviseDateAnchorPatch as ReviseDateAnchorPatch, type types_ReviseIdentityPatch as ReviseIdentityPatch, type types_SeedSocialLinkInput as SeedSocialLinkInput, type types_SetContactLifecycleOptions as SetContactLifecycleOptions, type types_SetStructuralTieInput as SetStructuralTieInput, type types_SocialEventInput as SocialEventInput, type types_SocialEventParticipantInput as SocialEventParticipantInput, type types_StructuralLinkKind as StructuralLinkKind, type types_UpcomingDateRecord as UpcomingDateRecord, type types_UpcomingDateTargetRef as UpcomingDateTargetRef, types_resolveAffinityListLimit as resolveAffinityListLimit };
990
+ export { types_AFFINITY_DEFAULT_LIST_LIMIT as AFFINITY_DEFAULT_LIST_LIMIT, types_AFFINITY_MAX_LIST_LIMIT as AFFINITY_MAX_LIST_LIMIT, type types_AddDateAnchorInput as AddDateAnchorInput, type types_AddIdentityInput as AddIdentityInput, type types_AffinityChartEdge as AffinityChartEdge, type types_AffinityChartNode as AffinityChartNode, type types_AffinityChartReadOptions as AffinityChartReadOptions, type types_AffinityChartRecord as AffinityChartRecord, type types_AffinityListReadOptions as AffinityListReadOptions, type types_AttributeEntry as AttributeEntry, type types_AttributeMutationReceipt as AttributeMutationReceipt, type types_AttributeName as AttributeName, type types_AttributeRecord as AttributeRecord, type types_AttributeTarget as AttributeTarget, type types_CommitmentRecord as CommitmentRecord, type types_CommitmentResolutionKind as CommitmentResolutionKind, type types_CommitmentResolutionState as CommitmentResolutionState, type types_ContactCore as ContactCore, type types_ContactJournalReadOptions as ContactJournalReadOptions, type types_ContactKind as ContactKind, type types_ContactLifecycleState as ContactLifecycleState, type types_ContactListItem as ContactListItem, type types_ContactMutationReceipt as ContactMutationReceipt, type types_ContactProfileReadOptions as ContactProfileReadOptions, type types_ContactProfileRecord as ContactProfileRecord, type types_ContactRow as ContactRow, type types_CreateContactInput as CreateContactInput, type types_DateAnchorTarget as DateAnchorTarget, type types_DerivedLinkEffect as DerivedLinkEffect, type types_DismissalMutationReceipt as DismissalMutationReceipt, type types_DismissedDuplicateRecord as DismissedDuplicateRecord, type types_DismissedPairRef as DismissedPairRef, type types_DuplicateCandidateRecord as DuplicateCandidateRecord, type types_EntityRef as EntityRef, type types_EventMomentKind as EventMomentKind, type types_EventMutationReceipt as EventMutationReceipt, type types_EventParticipantRole as EventParticipantRole, type types_EventParticipantView as EventParticipantView, type types_EventRecord as EventRecord, type types_EventRecurrenceKind as EventRecurrenceKind, type types_EventRow as EventRow, type types_EventSearchItem as EventSearchItem, type types_EventTarget as EventTarget, type types_EventType as EventType, type types_ExternalRef as ExternalRef, type types_IdentityMutationReceipt as IdentityMutationReceipt, type types_IdentityRecord as IdentityRecord, type types_IdentityRow as IdentityRow, type types_IdentityType as IdentityType, type types_InteractionEventType as InteractionEventType, type types_LinkDetailReadOptions as LinkDetailReadOptions, type types_LinkDetailRecord as LinkDetailRecord, type types_LinkKind as LinkKind, type types_LinkListItem as LinkListItem, type types_LinkListReadFilters as LinkListReadFilters, type types_LinkMutationOptions as LinkMutationOptions, type types_LinkMutationReceipt as LinkMutationReceipt, type types_LinkRow as LinkRow, type types_LinkState as LinkState, type types_ListContactsFilters as ListContactsFilters, type types_ListDuplicateCandidatesFilters as ListDuplicateCandidatesFilters, type types_ListMomentsFilters as ListMomentsFilters, type types_ListOpenCommitmentsFilters as ListOpenCommitmentsFilters, type types_ListUpcomingDatesFilters as ListUpcomingDatesFilters, type types_MergeContactsInput as MergeContactsInput, type types_MergeHistoryRecord as MergeHistoryRecord, type types_MergePrimary as MergePrimary, type types_MergeReceipt as MergeReceipt, type types_MomentRecord as MomentRecord, type types_MutationReceipt as MutationReceipt, type types_OpaqueDerivation as OpaqueDerivation, type types_OpaqueRollup as OpaqueRollup, type types_RadarRecord as RadarRecord, type types_RecordCommitmentInput as RecordCommitmentInput, type types_RecordInteractionInput as RecordInteractionInput, type types_RecordMilestoneInput as RecordMilestoneInput, type types_RecordObservationInput as RecordObservationInput, type types_RecordTransactionInput as RecordTransactionInput, type types_RelationalLinkKind as RelationalLinkKind, type types_ResolveCommitmentOptions as ResolveCommitmentOptions, type types_ReviseContactPatch as ReviseContactPatch, type types_ReviseDateAnchorOptions as ReviseDateAnchorOptions, type types_ReviseDateAnchorPatch as ReviseDateAnchorPatch, type types_ReviseEventPatch as ReviseEventPatch, type types_ReviseIdentityPatch as ReviseIdentityPatch, type types_SeedSocialLinkInput as SeedSocialLinkInput, type types_SetContactLifecycleOptions as SetContactLifecycleOptions, type types_SetStructuralTieInput as SetStructuralTieInput, type types_SocialEventInput as SocialEventInput, type types_SocialEventParticipantInput as SocialEventParticipantInput, type types_StructuralLinkKind as StructuralLinkKind, type types_UpcomingDateRecord as UpcomingDateRecord, type types_UpcomingDateTargetRef as UpcomingDateTargetRef, types_resolveAffinityListLimit as resolveAffinityListLimit };
835
991
  }
836
992
 
837
993
  declare function createContact(db: AffinityDb, input: CreateContactInput): ContactMutationReceipt;
@@ -900,27 +1056,51 @@ declare function undismissDuplicate(db: AffinityDb, leftContactId: number, right
900
1056
 
901
1057
  declare function listDismissedDuplicates(db: AffinityDb, options?: AffinityListReadOptions): DismissedDuplicateRecord[];
902
1058
 
903
- declare function getContactJournal(db: AffinityDb, contactId: number, options?: ContactJournalReadOptions): EventRecord[];
904
-
905
- declare function listMoments(db: AffinityDb, filters?: ListMomentsFilters, options?: AffinityListReadOptions): MomentRecord[];
906
-
907
- declare function listOpenCommitments(db: AffinityDb, filters?: ListOpenCommitmentsFilters, options?: AffinityListReadOptions): CommitmentRecord[];
908
-
909
- declare function recordCommitment(db: AffinityDb, input: RecordCommitmentInput): EventMutationReceipt;
910
-
911
- declare function recordInteraction(db: AffinityDb, input: RecordInteractionInput): EventMutationReceipt;
912
-
913
- declare function recordMilestone(db: AffinityDb, input: RecordMilestoneInput): EventMutationReceipt;
914
-
915
- declare function recordObservation(db: AffinityDb, input: RecordObservationInput): EventMutationReceipt;
1059
+ /** Export all stored records belonging to a contact, including archived history. */
1060
+ declare function exportContact(db: AffinityDb, id: number): {
1061
+ contact: Record<string, unknown>;
1062
+ identities: Record<string, unknown>[];
1063
+ attributes: Record<string, unknown>[];
1064
+ links: Record<string, unknown>[];
1065
+ events: (Record<string, unknown> & {
1066
+ participants: Record<string, unknown>[];
1067
+ })[];
1068
+ commitments: Record<string, unknown>[];
1069
+ dates: Record<string, unknown>[];
1070
+ mergeHistory: Record<string, unknown>[];
1071
+ };
916
1072
 
917
- declare function recordTransaction(db: AffinityDb, input: RecordTransactionInput): EventMutationReceipt;
1073
+ /** Export every contact, including merged and lost records. Version is the export format version. */
1074
+ declare function exportAffinity(db: AffinityDb): {
1075
+ version: number;
1076
+ exportedAt: number;
1077
+ exportedAtIso: string;
1078
+ events: (Record<string, unknown> & {
1079
+ participants: Record<string, unknown>[];
1080
+ })[];
1081
+ contacts: {
1082
+ eventIds: unknown[];
1083
+ dateIds: unknown[];
1084
+ contact: Record<string, unknown>;
1085
+ identities: Record<string, unknown>[];
1086
+ attributes: Record<string, unknown>[];
1087
+ links: Record<string, unknown>[];
1088
+ commitments: Record<string, unknown>[];
1089
+ mergeHistory: Record<string, unknown>[];
1090
+ }[];
1091
+ };
918
1092
 
919
- declare function resolveCommitment(db: AffinityDb, commitmentEventId: number, resolution: CommitmentResolutionKind, options?: ResolveCommitmentOptions): EventMutationReceipt;
1093
+ declare function getEventById(db: AffinityDb, eventId: number): EventRecord | null;
1094
+ declare function getEventByExternalRef(db: AffinityDb, source: string, id: string): EventRecord | null;
920
1095
 
1096
+ declare const read_exportAffinity: typeof exportAffinity;
1097
+ declare const read_exportContact: typeof exportContact;
921
1098
  declare const read_getAffinityChart: typeof getAffinityChart;
922
1099
  declare const read_getContactJournal: typeof getContactJournal;
923
1100
  declare const read_getContactProfile: typeof getContactProfile;
1101
+ declare const read_getEventByExternalRef: typeof getEventByExternalRef;
1102
+ declare const read_getEventById: typeof getEventById;
1103
+ declare const read_getEventThread: typeof getEventThread;
924
1104
  declare const read_getLinkDetail: typeof getLinkDetail;
925
1105
  declare const read_getLinkTimeline: typeof getLinkTimeline;
926
1106
  declare const read_getLinksBetween: typeof getLinksBetween;
@@ -937,8 +1117,9 @@ declare const read_listProgressionReadiness: typeof listProgressionReadiness;
937
1117
  declare const read_listRadar: typeof listRadar;
938
1118
  declare const read_listUpcomingDates: typeof listUpcomingDates;
939
1119
  declare const read_searchContacts: typeof searchContacts;
1120
+ declare const read_searchEvents: typeof searchEvents;
940
1121
  declare namespace read {
941
- export { read_getAffinityChart as getAffinityChart, read_getContactJournal as getContactJournal, read_getContactProfile as getContactProfile, read_getLinkDetail as getLinkDetail, read_getLinkTimeline as getLinkTimeline, read_getLinksBetween as getLinksBetween, read_getMergeHistory as getMergeHistory, read_getOwnerProfile as getOwnerProfile, read_listContacts as listContacts, read_listDismissedDuplicates as listDismissedDuplicates, read_listDuplicateCandidates as listDuplicateCandidates, read_listMoments as listMoments, read_listObservedLinks as listObservedLinks, read_listOpenCommitments as listOpenCommitments, read_listOwnerSocialLinks as listOwnerSocialLinks, read_listProgressionReadiness as listProgressionReadiness, read_listRadar as listRadar, read_listUpcomingDates as listUpcomingDates, read_searchContacts as searchContacts };
1122
+ export { read_exportAffinity as exportAffinity, read_exportContact as exportContact, read_getAffinityChart as getAffinityChart, read_getContactJournal as getContactJournal, read_getContactProfile as getContactProfile, read_getEventByExternalRef as getEventByExternalRef, read_getEventById as getEventById, read_getEventThread as getEventThread, read_getLinkDetail as getLinkDetail, read_getLinkTimeline as getLinkTimeline, read_getLinksBetween as getLinksBetween, read_getMergeHistory as getMergeHistory, read_getOwnerProfile as getOwnerProfile, read_listContacts as listContacts, read_listDismissedDuplicates as listDismissedDuplicates, read_listDuplicateCandidates as listDuplicateCandidates, read_listMoments as listMoments, read_listObservedLinks as listObservedLinks, read_listOpenCommitments as listOpenCommitments, read_listOwnerSocialLinks as listOwnerSocialLinks, read_listProgressionReadiness as listProgressionReadiness, read_listRadar as listRadar, read_listUpcomingDates as listUpcomingDates, read_searchContacts as searchContacts, read_searchEvents as searchEvents };
942
1123
  }
943
1124
 
944
1125
  interface AffinitySoulTrait {
@@ -1081,7 +1262,7 @@ type ToolEntityKind = "contact" | "identity" | "link" | "event" | "attribute";
1081
1262
  type ToolOutcomeKind = "success" | "no_op" | "needs_clarification" | "error";
1082
1263
  type ToolErrorCode = "clarification_needed" | "conflict" | "constraint_violation" | "invalid_input" | "invalid_state" | "not_found" | "system_error" | "unsupported_target";
1083
1264
  type ToolErrorKind = "domain" | "protocol" | "system";
1084
- type ToolWarningCode = "already_in_state" | "derived_value_used" | "empty_result" | "partial_match" | "unchanged";
1265
+ type ToolWarningCode = "already_in_state" | "derived_value_used" | "empty_result" | "future_event" | "possible_duplicate" | "partial_match" | "unchanged";
1085
1266
  type ToolClarificationCode = "ambiguous_target" | "missing_required_choice" | "multiple_plausible_matches";
1086
1267
  type ToolNextStepHintKind = "ask_user" | "inspect_item" | "review_view" | "retry_with" | "use_tool";
1087
1268
  interface ToolEntityRef {
@@ -1092,9 +1273,12 @@ interface ToolEntityRef {
1092
1273
  state?: ContactLifecycleState | EventType | LinkKind | LinkState | ContactKind | string | null | undefined;
1093
1274
  }
1094
1275
  interface ToolListItem extends ToolEntityRef {
1276
+ [key: string]: unknown;
1095
1277
  snippet?: string | undefined;
1096
1278
  }
1097
1279
  interface ToolWarning {
1280
+ contactId?: number;
1281
+ score?: number;
1098
1282
  code: ToolWarningCode;
1099
1283
  message: string;
1100
1284
  }
@@ -1131,6 +1315,9 @@ interface ToolNeedsClarification extends ToolBaseResult {
1131
1315
  };
1132
1316
  }
1133
1317
  interface ToolFailure extends ToolBaseResult {
1318
+ data?: {
1319
+ existingContactId: number;
1320
+ };
1134
1321
  ok: false;
1135
1322
  outcome: "error";
1136
1323
  error: {
@@ -1206,6 +1393,11 @@ declare function objectSchema(properties: Record<string, JsonSchema>, required:
1206
1393
  declare function nullableStringSchema(description: string): JsonSchema;
1207
1394
  declare function oneOfSchema(schemas: ReadonlyArray<JsonSchema>, description?: string): JsonSchema;
1208
1395
 
1396
+ type TimeInputs<T> = T extends readonly (infer U)[] ? readonly TimeInputs<U>[] : T extends object ? {
1397
+ [K in keyof T]: K extends `${string}At` | "now" | "asOf" | "since" | "until" ? T[K] | string : TimeInputs<T[K]>;
1398
+ } : T;
1399
+ declare function parseTimeInput(value: number | string, field?: string, now?: number): number;
1400
+
1209
1401
  type ContactLocator = {
1210
1402
  contactId: number;
1211
1403
  } | {
@@ -1232,17 +1424,22 @@ type ResolvedTarget<T> = {
1232
1424
  ok: false;
1233
1425
  result: ToolFailure | ToolNeedsClarification;
1234
1426
  };
1235
- declare function resolveContactLocator(db: AffinityDb, locator: ContactLocator, field?: string): ResolvedTarget<ContactRow>;
1427
+ declare function resolveContactLocator(db: AffinityDb, locator: ContactLocator, field?: string, allowMerged?: boolean): ResolvedTarget<ContactRow>;
1236
1428
  declare function resolveLinkLocator(db: AffinityDb, locator: LinkLocator, field?: string): ResolvedTarget<LinkRow>;
1237
1429
  declare function mapErrorToToolFailure(error: unknown, summary?: string): ToolFailure;
1238
1430
  declare function withToolHandling<TData>(operation: () => ToolResult<TData>, summary?: string): ToolResult<TData>;
1239
1431
 
1240
1432
  type InspectAffinityItemToolInput = {
1433
+ kind: "event";
1434
+ eventId?: number;
1435
+ ref?: ExternalRef;
1436
+ } | {
1241
1437
  kind: "owner_profile";
1242
1438
  topLinksLimit?: number;
1243
1439
  } | {
1244
1440
  kind: "contact_profile";
1245
1441
  contact: ContactLocator;
1442
+ recentEventsLimit?: number;
1246
1443
  topLinksLimit?: number;
1247
1444
  } | {
1248
1445
  kind: "link";
@@ -1250,6 +1447,9 @@ type InspectAffinityItemToolInput = {
1250
1447
  recentEventsLimit?: number;
1251
1448
  };
1252
1449
  type InspectAffinityItemToolData = {
1450
+ kind: "event";
1451
+ detail: EventRecord;
1452
+ } | {
1253
1453
  kind: "owner_profile";
1254
1454
  detail: ContactProfileRecord;
1255
1455
  } | {
@@ -1260,12 +1460,19 @@ type InspectAffinityItemToolData = {
1260
1460
  detail: LinkDetailRecord;
1261
1461
  };
1262
1462
  type InspectAffinityItemToolResult = ToolResult<InspectAffinityItemToolData>;
1263
- declare function inspectAffinityItemToolHandler(db: AffinityDb, input: InspectAffinityItemToolInput): InspectAffinityItemToolResult;
1264
- declare const inspectAffinityItemTool: AffinityToolDefinition<InspectAffinityItemToolInput, InspectAffinityItemToolResult>;
1463
+ declare function inspectAffinityItemToolHandler(db: AffinityDb, rawInput: TimeInputs<InspectAffinityItemToolInput>): InspectAffinityItemToolResult;
1464
+ declare const inspectAffinityItemTool: AffinityToolDefinition<TimeInputs<InspectAffinityItemToolInput>, InspectAffinityItemToolResult>;
1265
1465
 
1266
1466
  interface MutationToolData<TPrimary> {
1467
+ changes: {
1468
+ entity: string;
1469
+ id: number;
1470
+ action: string;
1471
+ fields?: string[];
1472
+ }[];
1267
1473
  action: string;
1268
1474
  primary: TPrimary;
1475
+ matchedIdentities?: AddIdentityInput[];
1269
1476
  created: MutationReceipt<TPrimary>["created"];
1270
1477
  updated: MutationReceipt<TPrimary>["updated"];
1271
1478
  archived: MutationReceipt<TPrimary>["archived"];
@@ -1273,7 +1480,7 @@ interface MutationToolData<TPrimary> {
1273
1480
  affectedLinks: number[];
1274
1481
  derivedEffects: MutationReceipt<TPrimary>["derivedEffects"];
1275
1482
  }
1276
- declare function mutationToolResult<TPrimary>(action: string, receipt: MutationReceipt<TPrimary>, entitySummary: string): ToolResult<MutationToolData<TPrimary>>;
1483
+ declare function mutationToolResult<TPrimary>(action: string, receipt: MutationReceipt<TPrimary>, entitySummary: string, fields?: string[]): ToolResult<MutationToolData<TPrimary>>;
1277
1484
 
1278
1485
  type AttributeTargetInput = {
1279
1486
  kind: "contact";
@@ -1281,6 +1488,9 @@ type AttributeTargetInput = {
1281
1488
  } | {
1282
1489
  kind: "link";
1283
1490
  link: LinkLocator;
1491
+ } | {
1492
+ kind: "event";
1493
+ eventId: number;
1284
1494
  };
1285
1495
  type ManageAttributeToolInput = {
1286
1496
  action: "set";
@@ -1298,8 +1508,8 @@ type ManageAttributeToolInput = {
1298
1508
  entries: AttributeEntry[];
1299
1509
  };
1300
1510
  type ManageAttributeToolResult = ToolResult<MutationToolData<AttributeRecord>>;
1301
- declare function manageAttributeToolHandler(db: AffinityDb, input: ManageAttributeToolInput): ManageAttributeToolResult;
1302
- declare const manageAttributeTool: AffinityToolDefinition<ManageAttributeToolInput, ManageAttributeToolResult>;
1511
+ declare function manageAttributeToolHandler(db: AffinityDb, rawInput: TimeInputs<ManageAttributeToolInput>): ManageAttributeToolResult;
1512
+ declare const manageAttributeTool: AffinityToolDefinition<TimeInputs<ManageAttributeToolInput>, ManageAttributeToolResult>;
1303
1513
 
1304
1514
  type ManageCommitmentToolInput = {
1305
1515
  action: "record";
@@ -1311,12 +1521,34 @@ type ManageCommitmentToolInput = {
1311
1521
  options?: ResolveCommitmentOptions;
1312
1522
  };
1313
1523
  type ManageCommitmentToolResult = ToolResult<MutationToolData<EventRecord>>;
1314
- declare function manageCommitmentToolHandler(db: AffinityDb, input: ManageCommitmentToolInput): ManageCommitmentToolResult;
1315
- declare const manageCommitmentTool: AffinityToolDefinition<ManageCommitmentToolInput, ManageCommitmentToolResult>;
1524
+ declare function manageCommitmentToolHandler(db: AffinityDb, rawInput: TimeInputs<ManageCommitmentToolInput>): ManageCommitmentToolResult;
1525
+ declare const manageCommitmentTool: AffinityToolDefinition<TimeInputs<ManageCommitmentToolInput>, ManageCommitmentToolResult>;
1526
+
1527
+ /** Permanently erase a contact and dependent records. The owner cannot be erased. */
1528
+ declare function deleteContact(db: AffinityDb, locatorId: number, options: {
1529
+ confirm?: boolean;
1530
+ }): {
1531
+ contactId: number;
1532
+ removed: {
1533
+ entity: string;
1534
+ count: number;
1535
+ ids: number[];
1536
+ }[];
1537
+ affectedLinks: number[];
1538
+ };
1316
1539
 
1317
1540
  type ManageContactToolInput = {
1541
+ action: "export";
1542
+ contact?: ContactLocator;
1543
+ } | {
1544
+ action: "delete";
1545
+ contact: ContactLocator;
1546
+ confirm?: boolean;
1547
+ } | {
1318
1548
  action: "create";
1319
- input: CreateContactInput;
1549
+ input: CreateContactInput & {
1550
+ identities?: AddIdentityInput[];
1551
+ };
1320
1552
  } | {
1321
1553
  action: "revise";
1322
1554
  contact: ContactLocator;
@@ -1327,9 +1559,23 @@ type ManageContactToolInput = {
1327
1559
  lifecycleState: ContactLifecycleState;
1328
1560
  options?: SetContactLifecycleOptions;
1329
1561
  };
1330
- type ManageContactToolResult = ToolResult<MutationToolData<ContactListItem>>;
1331
- declare function manageContactToolHandler(db: AffinityDb, input: ManageContactToolInput): ManageContactToolResult;
1332
- declare const manageContactTool: AffinityToolDefinition<ManageContactToolInput, ManageContactToolResult>;
1562
+ type ManageContactToolResult = ToolResult<MutationToolData<ContactListItem> | {
1563
+ action: "export";
1564
+ export: ReturnType<typeof exportContact> | ReturnType<typeof exportAffinity>;
1565
+ } | {
1566
+ action: "delete";
1567
+ deletion: ReturnType<typeof deleteContact>;
1568
+ changes: {
1569
+ entity: string;
1570
+ id: number;
1571
+ action: string;
1572
+ }[];
1573
+ }>;
1574
+ declare function manageContactToolHandler(db: AffinityDb, input: TimeInputs<Exclude<ManageContactToolInput, {
1575
+ action: "export" | "delete";
1576
+ }>>): ToolResult<MutationToolData<ContactListItem>>;
1577
+ declare function manageContactToolHandler(db: AffinityDb, input: TimeInputs<ManageContactToolInput>): ManageContactToolResult;
1578
+ declare const manageContactTool: AffinityToolDefinition<TimeInputs<ManageContactToolInput>, ManageContactToolResult>;
1333
1579
 
1334
1580
  interface ManageDuplicateDismissalToolInput {
1335
1581
  action: "dismiss" | "undismiss";
@@ -1337,13 +1583,36 @@ interface ManageDuplicateDismissalToolInput {
1337
1583
  right: ContactLocator;
1338
1584
  reason?: string | null;
1339
1585
  }
1340
- interface DismissalToolData {
1341
- action: string;
1342
- primary: DismissedPairRef;
1343
- }
1586
+ type DismissalToolData = Omit<MutationToolData<DismissedPairRef>, "changes"> & {
1587
+ changes: {
1588
+ entity: "duplicate_dismissal";
1589
+ leftContactId: number;
1590
+ rightContactId: number;
1591
+ action: string;
1592
+ }[];
1593
+ };
1344
1594
  type ManageDuplicateDismissalToolResult = ToolResult<DismissalToolData>;
1345
- declare function manageDuplicateDismissalToolHandler(db: AffinityDb, input: ManageDuplicateDismissalToolInput): ManageDuplicateDismissalToolResult;
1346
- declare const manageDuplicateDismissalTool: AffinityToolDefinition<ManageDuplicateDismissalToolInput, ManageDuplicateDismissalToolResult>;
1595
+ declare function manageDuplicateDismissalToolHandler(db: AffinityDb, rawInput: TimeInputs<ManageDuplicateDismissalToolInput>): ManageDuplicateDismissalToolResult;
1596
+ declare const manageDuplicateDismissalTool: AffinityToolDefinition<{
1597
+ action: "dismiss" | "undismiss";
1598
+ left: {
1599
+ contactId: number;
1600
+ } | {
1601
+ identity: {
1602
+ type: string;
1603
+ value: string;
1604
+ };
1605
+ };
1606
+ right: {
1607
+ contactId: number;
1608
+ } | {
1609
+ identity: {
1610
+ type: string;
1611
+ value: string;
1612
+ };
1613
+ };
1614
+ reason?: string | null;
1615
+ }, ManageDuplicateDismissalToolResult>;
1347
1616
 
1348
1617
  type DateAnchorTargetInput = {
1349
1618
  kind: "contact";
@@ -1368,8 +1637,8 @@ type ManageDateAnchorToolInput = {
1368
1637
  removedAt?: number;
1369
1638
  };
1370
1639
  type ManageDateAnchorToolResult = ToolResult<MutationToolData<EventRecord>>;
1371
- declare function manageDateAnchorToolHandler(db: AffinityDb, input: ManageDateAnchorToolInput): ManageDateAnchorToolResult;
1372
- declare const manageDateAnchorTool: AffinityToolDefinition<ManageDateAnchorToolInput, ManageDateAnchorToolResult>;
1640
+ declare function manageDateAnchorToolHandler(db: AffinityDb, rawInput: TimeInputs<ManageDateAnchorToolInput>): ManageDateAnchorToolResult;
1641
+ declare const manageDateAnchorTool: AffinityToolDefinition<TimeInputs<ManageDateAnchorToolInput>, ManageDateAnchorToolResult>;
1373
1642
 
1374
1643
  type ManageIdentityToolInput = {
1375
1644
  action: "add";
@@ -1389,8 +1658,8 @@ type ManageIdentityToolInput = {
1389
1658
  removedAt?: number;
1390
1659
  };
1391
1660
  type ManageIdentityToolResult = ToolResult<MutationToolData<IdentityRecord>>;
1392
- declare function manageIdentityToolHandler(db: AffinityDb, input: ManageIdentityToolInput): ManageIdentityToolResult;
1393
- declare const manageIdentityTool: AffinityToolDefinition<ManageIdentityToolInput, ManageIdentityToolResult>;
1661
+ declare function manageIdentityToolHandler(db: AffinityDb, rawInput: TimeInputs<ManageIdentityToolInput>): ManageIdentityToolResult;
1662
+ declare const manageIdentityTool: AffinityToolDefinition<TimeInputs<ManageIdentityToolInput>, ManageIdentityToolResult>;
1394
1663
 
1395
1664
  type ManageRelationshipToolInput = {
1396
1665
  action: "seed_social_link";
@@ -1422,8 +1691,8 @@ type ManageRelationshipToolInput = {
1422
1691
  removedAt?: number;
1423
1692
  };
1424
1693
  type ManageRelationshipToolResult = ToolResult<MutationToolData<LinkListItem>>;
1425
- declare function manageRelationshipToolHandler(db: AffinityDb, input: ManageRelationshipToolInput): ManageRelationshipToolResult;
1426
- declare const manageRelationshipTool: AffinityToolDefinition<ManageRelationshipToolInput, ManageRelationshipToolResult>;
1694
+ declare function manageRelationshipToolHandler(db: AffinityDb, rawInput: TimeInputs<ManageRelationshipToolInput>): ManageRelationshipToolResult;
1695
+ declare const manageRelationshipTool: AffinityToolDefinition<TimeInputs<ManageRelationshipToolInput>, ManageRelationshipToolResult>;
1427
1696
 
1428
1697
  interface MergeContactsToolInput {
1429
1698
  winner: ContactLocator;
@@ -1432,35 +1701,70 @@ interface MergeContactsToolInput {
1432
1701
  now?: number;
1433
1702
  }
1434
1703
  type MergeContactsToolResult = ToolResult<MutationToolData<MergePrimary>>;
1435
- declare function mergeContactsToolHandler(db: AffinityDb, input: MergeContactsToolInput): MergeContactsToolResult;
1436
- declare const mergeContactsTool: AffinityToolDefinition<MergeContactsToolInput, MergeContactsToolResult>;
1704
+ declare function mergeContactsToolHandler(db: AffinityDb, rawInput: TimeInputs<MergeContactsToolInput>): MergeContactsToolResult;
1705
+ declare const mergeContactsTool: AffinityToolDefinition<{
1706
+ winner: {
1707
+ contactId: number;
1708
+ } | {
1709
+ identity: {
1710
+ type: string;
1711
+ value: string;
1712
+ };
1713
+ };
1714
+ loser: {
1715
+ contactId: number;
1716
+ } | {
1717
+ identity: {
1718
+ type: string;
1719
+ value: string;
1720
+ };
1721
+ };
1722
+ reasonSummary?: string | null;
1723
+ now?: string | number;
1724
+ }, MergeContactsToolResult>;
1437
1725
 
1726
+ type ToolEvidence<T extends {
1727
+ participants: readonly SocialEventParticipantInput[];
1728
+ }> = Omit<T, "participants"> & {
1729
+ participants: readonly (SocialEventParticipantInput | {
1730
+ contact: ContactLocator;
1731
+ role: SocialEventParticipantInput["role"];
1732
+ directionality?: SocialEventParticipantInput["directionality"];
1733
+ })[];
1734
+ };
1438
1735
  type RecordEventToolInput = {
1439
1736
  kind: "interaction";
1440
- input: RecordInteractionInput;
1737
+ input: ToolEvidence<RecordInteractionInput>;
1441
1738
  } | {
1442
1739
  kind: "observation";
1443
- input: RecordObservationInput;
1740
+ input: ToolEvidence<RecordObservationInput>;
1444
1741
  } | {
1445
1742
  kind: "milestone";
1446
- input: RecordMilestoneInput;
1743
+ input: ToolEvidence<RecordMilestoneInput>;
1447
1744
  } | {
1448
1745
  kind: "transaction";
1449
- input: RecordTransactionInput;
1746
+ input: ToolEvidence<RecordTransactionInput>;
1450
1747
  };
1451
1748
  type RecordEventToolResult = ToolResult<MutationToolData<EventRecord>>;
1452
- declare function recordEventToolHandler(db: AffinityDb, input: RecordEventToolInput): RecordEventToolResult;
1453
- declare const recordEventTool: AffinityToolDefinition<RecordEventToolInput, RecordEventToolResult>;
1749
+ declare function recordEventToolHandler(db: AffinityDb, rawInput: TimeInputs<RecordEventToolInput>): RecordEventToolResult;
1750
+ declare const recordEventTool: AffinityToolDefinition<TimeInputs<RecordEventToolInput>, RecordEventToolResult>;
1454
1751
 
1455
- type ReviewAffinityToolView = "contacts.list" | "contacts.duplicates" | "events.contact_journal" | "events.link_timeline" | "events.moments" | "commitments.open" | "links.owner" | "links.observed" | "links.progression_readiness" | "links.radar" | "dates.upcoming" | "graph.chart" | "merges.history" | "merges.dismissed";
1752
+ type ReviewAffinityToolView = "contacts.list" | "contacts.duplicates" | "events.thread" | "events.contact_journal" | "events.link_timeline" | "events.moments" | "commitments.open" | "links.owner" | "links.observed" | "links.progression_readiness" | "links.radar" | "dates.upcoming" | "graph.chart" | "merges.history" | "merges.dismissed";
1456
1753
  interface ReviewAffinityToolInput {
1754
+ ref?: ExternalRef;
1755
+ includeContent?: boolean;
1756
+ channel?: string;
1457
1757
  view: ReviewAffinityToolView;
1758
+ now?: number;
1458
1759
  contact?: ContactLocator;
1459
1760
  link?: LinkLocator;
1460
1761
  contactIds?: number[];
1461
1762
  kind?: ContactKind | LinkKind;
1462
1763
  lifecycleState?: ContactLifecycleState;
1463
1764
  linkState?: LinkState;
1765
+ attribute?: string | string[];
1766
+ tag?: string | string[];
1767
+ includeLost?: boolean;
1464
1768
  includeOwner?: boolean;
1465
1769
  includeDormant?: boolean;
1466
1770
  includeArchived?: boolean;
@@ -1482,12 +1786,65 @@ interface ReviewAffinityToolData {
1482
1786
  view: ReviewAffinityToolView;
1483
1787
  items: ToolListItem[];
1484
1788
  count: number;
1789
+ total?: number;
1790
+ hasMore?: boolean;
1485
1791
  appliedFilters: Record<string, unknown>;
1486
1792
  chart?: AffinityChartRecord | undefined;
1487
1793
  }
1488
1794
  type ReviewAffinityToolResult = ToolResult<ReviewAffinityToolData>;
1489
- declare function reviewAffinityToolHandler(db: AffinityDb, input: ReviewAffinityToolInput): ReviewAffinityToolResult;
1490
- declare const reviewAffinityTool: AffinityToolDefinition<ReviewAffinityToolInput, ReviewAffinityToolResult>;
1795
+ declare function reviewAffinityToolHandler(db: AffinityDb, rawInput: TimeInputs<ReviewAffinityToolInput>): ReviewAffinityToolResult;
1796
+ declare const reviewAffinityTool: AffinityToolDefinition<{
1797
+ ref?: {
1798
+ source: string;
1799
+ id: string;
1800
+ };
1801
+ includeContent?: boolean;
1802
+ channel?: string;
1803
+ view: ReviewAffinityToolView;
1804
+ now?: string | number;
1805
+ contact?: {
1806
+ contactId: number;
1807
+ } | {
1808
+ identity: {
1809
+ type: string;
1810
+ value: string;
1811
+ };
1812
+ };
1813
+ link?: {
1814
+ linkId: number;
1815
+ } | {
1816
+ endpoints: {
1817
+ fromContactId: number;
1818
+ toContactId: number;
1819
+ kind?: string | undefined | undefined;
1820
+ role?: string | null | undefined | undefined;
1821
+ isStructural?: boolean | undefined | undefined;
1822
+ };
1823
+ };
1824
+ contactIds?: readonly number[];
1825
+ kind?: ContactKind | LinkKind;
1826
+ lifecycleState?: ContactLifecycleState;
1827
+ linkState?: LinkState;
1828
+ attribute?: string | readonly string[];
1829
+ tag?: string | readonly string[];
1830
+ includeLost?: boolean;
1831
+ includeOwner?: boolean;
1832
+ includeDormant?: boolean;
1833
+ includeArchived?: boolean;
1834
+ includeObserved?: boolean;
1835
+ eventTypes?: readonly EventType[];
1836
+ momentKind?: EventMomentKind;
1837
+ commitmentType?: "promise" | "agreement";
1838
+ recurrenceKind?: EventRecurrenceKind;
1839
+ horizonDays?: number;
1840
+ exactOnly?: boolean;
1841
+ minScore?: number;
1842
+ includeDismissed?: boolean;
1843
+ since?: string | number;
1844
+ until?: string | number;
1845
+ limit?: number;
1846
+ offset?: number;
1847
+ }, ReviewAffinityToolResult>;
1491
1848
 
1492
1849
  declare function toContactEntityRef(value: ContactCore | ContactListItem | ContactRow): ToolEntityRef;
1493
1850
  declare function toContactListToolItem(value: ContactCore | ContactListItem | ContactRow): ToolListItem;
@@ -1503,9 +1860,13 @@ declare function toMutationRefEntity(ref: EntityRef): ToolEntityRef;
1503
1860
  declare function toReceiptEntityRefs<TPrimary>(receipt: MutationReceipt<TPrimary>): ToolEntityRef[];
1504
1861
 
1505
1862
  interface SearchAffinityToolInput {
1863
+ scope?: "contacts" | "events" | "all";
1506
1864
  query: string;
1507
1865
  kind?: ContactKind;
1508
1866
  lifecycleState?: ContactLifecycleState;
1867
+ attribute?: string | string[];
1868
+ tag?: string | string[];
1869
+ includeLost?: boolean;
1509
1870
  includeOwner?: boolean;
1510
1871
  includeDormant?: boolean;
1511
1872
  limit?: number;
@@ -1515,14 +1876,422 @@ interface SearchAffinityToolData {
1515
1876
  query: string;
1516
1877
  items: ReturnType<typeof toContactListToolItem>[];
1517
1878
  count: number;
1879
+ total?: number;
1880
+ hasMore?: boolean;
1518
1881
  }
1519
1882
  type SearchAffinityToolResult = ToolResult<SearchAffinityToolData>;
1520
- declare function searchAffinityToolHandler(db: AffinityDb, input: SearchAffinityToolInput): SearchAffinityToolResult;
1521
- declare const searchAffinityTool: AffinityToolDefinition<SearchAffinityToolInput, SearchAffinityToolResult>;
1883
+ declare function searchAffinityToolHandler(db: AffinityDb, rawInput: TimeInputs<SearchAffinityToolInput>): SearchAffinityToolResult;
1884
+ declare const searchAffinityTool: AffinityToolDefinition<{
1885
+ scope?: "contacts" | "events" | "all";
1886
+ query: string;
1887
+ kind?: ContactKind;
1888
+ lifecycleState?: ContactLifecycleState;
1889
+ attribute?: string | readonly string[];
1890
+ tag?: string | readonly string[];
1891
+ includeLost?: boolean;
1892
+ includeOwner?: boolean;
1893
+ includeDormant?: boolean;
1894
+ limit?: number;
1895
+ offset?: number;
1896
+ }, SearchAffinityToolResult>;
1897
+
1898
+ interface ManageEventToolInput {
1899
+ action: "revise" | "delete";
1900
+ eventId?: number;
1901
+ ref?: ExternalRef;
1902
+ patch?: ReviseEventPatch;
1903
+ confirm?: boolean;
1904
+ }
1905
+ type ManageEventToolResult = ToolResult<MutationToolData<EventRecord>>;
1906
+ declare function manageEventToolHandler(db: AffinityDb, raw: TimeInputs<ManageEventToolInput>): ManageEventToolResult;
1907
+ declare const manageEventTool: AffinityToolDefinition<{
1908
+ action: "revise" | "delete";
1909
+ eventId?: number;
1910
+ ref?: {
1911
+ source: string;
1912
+ id: string;
1913
+ };
1914
+ patch?: {
1915
+ summary?: string;
1916
+ content?: string;
1917
+ occurredAt?: string | number;
1918
+ significance?: number;
1919
+ channel?: string;
1920
+ type?: EventType;
1921
+ externalRef?: {
1922
+ source: string;
1923
+ id: string;
1924
+ };
1925
+ };
1926
+ confirm?: boolean;
1927
+ }, ManageEventToolResult>;
1522
1928
 
1523
- declare const affinityTools: (AffinityToolDefinition<InspectAffinityItemToolInput, InspectAffinityItemToolResult> | AffinityToolDefinition<ManageAttributeToolInput, ManageAttributeToolResult> | AffinityToolDefinition<ManageCommitmentToolInput, ManageCommitmentToolResult> | AffinityToolDefinition<ManageContactToolInput, ManageContactToolResult> | AffinityToolDefinition<ManageDuplicateDismissalToolInput, ManageDuplicateDismissalToolResult> | AffinityToolDefinition<ManageDateAnchorToolInput, ManageDateAnchorToolResult> | AffinityToolDefinition<ManageIdentityToolInput, ManageIdentityToolResult> | AffinityToolDefinition<ManageRelationshipToolInput, ManageRelationshipToolResult> | AffinityToolDefinition<MergeContactsToolInput, MergeContactsToolResult> | AffinityToolDefinition<RecordEventToolInput, RecordEventToolResult> | AffinityToolDefinition<ReviewAffinityToolInput, ReviewAffinityToolResult> | AffinityToolDefinition<SearchAffinityToolInput, SearchAffinityToolResult>)[];
1524
- declare function listAffinityToolDefinitions(): (AffinityToolDefinition<InspectAffinityItemToolInput, InspectAffinityItemToolResult> | AffinityToolDefinition<ManageAttributeToolInput, ManageAttributeToolResult> | AffinityToolDefinition<ManageCommitmentToolInput, ManageCommitmentToolResult> | AffinityToolDefinition<ManageContactToolInput, ManageContactToolResult> | AffinityToolDefinition<ManageDuplicateDismissalToolInput, ManageDuplicateDismissalToolResult> | AffinityToolDefinition<ManageDateAnchorToolInput, ManageDateAnchorToolResult> | AffinityToolDefinition<ManageIdentityToolInput, ManageIdentityToolResult> | AffinityToolDefinition<ManageRelationshipToolInput, ManageRelationshipToolResult> | AffinityToolDefinition<MergeContactsToolInput, MergeContactsToolResult> | AffinityToolDefinition<RecordEventToolInput, RecordEventToolResult> | AffinityToolDefinition<ReviewAffinityToolInput, ReviewAffinityToolResult> | AffinityToolDefinition<SearchAffinityToolInput, SearchAffinityToolResult>)[];
1525
- declare function getAffinityToolByName(name: string): AffinityToolDefinition<InspectAffinityItemToolInput, InspectAffinityItemToolResult> | AffinityToolDefinition<ManageAttributeToolInput, ManageAttributeToolResult> | AffinityToolDefinition<ManageCommitmentToolInput, ManageCommitmentToolResult> | AffinityToolDefinition<ManageContactToolInput, ManageContactToolResult> | AffinityToolDefinition<ManageDuplicateDismissalToolInput, ManageDuplicateDismissalToolResult> | AffinityToolDefinition<ManageDateAnchorToolInput, ManageDateAnchorToolResult> | AffinityToolDefinition<ManageIdentityToolInput, ManageIdentityToolResult> | AffinityToolDefinition<ManageRelationshipToolInput, ManageRelationshipToolResult> | AffinityToolDefinition<MergeContactsToolInput, MergeContactsToolResult> | AffinityToolDefinition<RecordEventToolInput, RecordEventToolResult> | AffinityToolDefinition<ReviewAffinityToolInput, ReviewAffinityToolResult> | AffinityToolDefinition<SearchAffinityToolInput, SearchAffinityToolResult> | null;
1929
+ declare const affinityTools: (AffinityToolDefinition<TimeInputs<InspectAffinityItemToolInput>, InspectAffinityItemToolResult> | AffinityToolDefinition<TimeInputs<ManageAttributeToolInput>, ManageAttributeToolResult> | AffinityToolDefinition<TimeInputs<ManageCommitmentToolInput>, ManageCommitmentToolResult> | AffinityToolDefinition<TimeInputs<ManageContactToolInput>, ManageContactToolResult> | AffinityToolDefinition<{
1930
+ action: "dismiss" | "undismiss";
1931
+ left: {
1932
+ contactId: number;
1933
+ } | {
1934
+ identity: {
1935
+ type: string;
1936
+ value: string;
1937
+ };
1938
+ };
1939
+ right: {
1940
+ contactId: number;
1941
+ } | {
1942
+ identity: {
1943
+ type: string;
1944
+ value: string;
1945
+ };
1946
+ };
1947
+ reason?: string | null;
1948
+ }, ManageDuplicateDismissalToolResult> | AffinityToolDefinition<TimeInputs<ManageDateAnchorToolInput>, ManageDateAnchorToolResult> | AffinityToolDefinition<TimeInputs<ManageIdentityToolInput>, ManageIdentityToolResult> | AffinityToolDefinition<TimeInputs<ManageRelationshipToolInput>, ManageRelationshipToolResult> | AffinityToolDefinition<{
1949
+ winner: {
1950
+ contactId: number;
1951
+ } | {
1952
+ identity: {
1953
+ type: string;
1954
+ value: string;
1955
+ };
1956
+ };
1957
+ loser: {
1958
+ contactId: number;
1959
+ } | {
1960
+ identity: {
1961
+ type: string;
1962
+ value: string;
1963
+ };
1964
+ };
1965
+ reasonSummary?: string | null;
1966
+ now?: string | number;
1967
+ }, MergeContactsToolResult> | AffinityToolDefinition<TimeInputs<RecordEventToolInput>, RecordEventToolResult> | AffinityToolDefinition<{
1968
+ ref?: {
1969
+ source: string;
1970
+ id: string;
1971
+ };
1972
+ includeContent?: boolean;
1973
+ channel?: string;
1974
+ view: ReviewAffinityToolView;
1975
+ now?: string | number;
1976
+ contact?: {
1977
+ contactId: number;
1978
+ } | {
1979
+ identity: {
1980
+ type: string;
1981
+ value: string;
1982
+ };
1983
+ };
1984
+ link?: {
1985
+ linkId: number;
1986
+ } | {
1987
+ endpoints: {
1988
+ fromContactId: number;
1989
+ toContactId: number;
1990
+ kind?: string | undefined | undefined;
1991
+ role?: string | null | undefined | undefined;
1992
+ isStructural?: boolean | undefined | undefined;
1993
+ };
1994
+ };
1995
+ contactIds?: readonly number[];
1996
+ kind?: ContactKind | LinkKind;
1997
+ lifecycleState?: ContactLifecycleState;
1998
+ linkState?: LinkState;
1999
+ attribute?: string | readonly string[];
2000
+ tag?: string | readonly string[];
2001
+ includeLost?: boolean;
2002
+ includeOwner?: boolean;
2003
+ includeDormant?: boolean;
2004
+ includeArchived?: boolean;
2005
+ includeObserved?: boolean;
2006
+ eventTypes?: readonly EventType[];
2007
+ momentKind?: EventMomentKind;
2008
+ commitmentType?: "promise" | "agreement";
2009
+ recurrenceKind?: EventRecurrenceKind;
2010
+ horizonDays?: number;
2011
+ exactOnly?: boolean;
2012
+ minScore?: number;
2013
+ includeDismissed?: boolean;
2014
+ since?: string | number;
2015
+ until?: string | number;
2016
+ limit?: number;
2017
+ offset?: number;
2018
+ }, ReviewAffinityToolResult> | AffinityToolDefinition<{
2019
+ scope?: "contacts" | "events" | "all";
2020
+ query: string;
2021
+ kind?: ContactKind;
2022
+ lifecycleState?: ContactLifecycleState;
2023
+ attribute?: string | readonly string[];
2024
+ tag?: string | readonly string[];
2025
+ includeLost?: boolean;
2026
+ includeOwner?: boolean;
2027
+ includeDormant?: boolean;
2028
+ limit?: number;
2029
+ offset?: number;
2030
+ }, SearchAffinityToolResult> | AffinityToolDefinition<{
2031
+ action: "revise" | "delete";
2032
+ eventId?: number;
2033
+ ref?: {
2034
+ source: string;
2035
+ id: string;
2036
+ };
2037
+ patch?: {
2038
+ summary?: string;
2039
+ content?: string;
2040
+ occurredAt?: string | number;
2041
+ significance?: number;
2042
+ channel?: string;
2043
+ type?: EventType;
2044
+ externalRef?: {
2045
+ source: string;
2046
+ id: string;
2047
+ };
2048
+ };
2049
+ confirm?: boolean;
2050
+ }, ManageEventToolResult>)[];
2051
+ declare function listAffinityToolDefinitions(): (AffinityToolDefinition<TimeInputs<InspectAffinityItemToolInput>, InspectAffinityItemToolResult> | AffinityToolDefinition<TimeInputs<ManageAttributeToolInput>, ManageAttributeToolResult> | AffinityToolDefinition<TimeInputs<ManageCommitmentToolInput>, ManageCommitmentToolResult> | AffinityToolDefinition<TimeInputs<ManageContactToolInput>, ManageContactToolResult> | AffinityToolDefinition<{
2052
+ action: "dismiss" | "undismiss";
2053
+ left: {
2054
+ contactId: number;
2055
+ } | {
2056
+ identity: {
2057
+ type: string;
2058
+ value: string;
2059
+ };
2060
+ };
2061
+ right: {
2062
+ contactId: number;
2063
+ } | {
2064
+ identity: {
2065
+ type: string;
2066
+ value: string;
2067
+ };
2068
+ };
2069
+ reason?: string | null;
2070
+ }, ManageDuplicateDismissalToolResult> | AffinityToolDefinition<TimeInputs<ManageDateAnchorToolInput>, ManageDateAnchorToolResult> | AffinityToolDefinition<TimeInputs<ManageIdentityToolInput>, ManageIdentityToolResult> | AffinityToolDefinition<TimeInputs<ManageRelationshipToolInput>, ManageRelationshipToolResult> | AffinityToolDefinition<{
2071
+ winner: {
2072
+ contactId: number;
2073
+ } | {
2074
+ identity: {
2075
+ type: string;
2076
+ value: string;
2077
+ };
2078
+ };
2079
+ loser: {
2080
+ contactId: number;
2081
+ } | {
2082
+ identity: {
2083
+ type: string;
2084
+ value: string;
2085
+ };
2086
+ };
2087
+ reasonSummary?: string | null;
2088
+ now?: string | number;
2089
+ }, MergeContactsToolResult> | AffinityToolDefinition<TimeInputs<RecordEventToolInput>, RecordEventToolResult> | AffinityToolDefinition<{
2090
+ ref?: {
2091
+ source: string;
2092
+ id: string;
2093
+ };
2094
+ includeContent?: boolean;
2095
+ channel?: string;
2096
+ view: ReviewAffinityToolView;
2097
+ now?: string | number;
2098
+ contact?: {
2099
+ contactId: number;
2100
+ } | {
2101
+ identity: {
2102
+ type: string;
2103
+ value: string;
2104
+ };
2105
+ };
2106
+ link?: {
2107
+ linkId: number;
2108
+ } | {
2109
+ endpoints: {
2110
+ fromContactId: number;
2111
+ toContactId: number;
2112
+ kind?: string | undefined | undefined;
2113
+ role?: string | null | undefined | undefined;
2114
+ isStructural?: boolean | undefined | undefined;
2115
+ };
2116
+ };
2117
+ contactIds?: readonly number[];
2118
+ kind?: ContactKind | LinkKind;
2119
+ lifecycleState?: ContactLifecycleState;
2120
+ linkState?: LinkState;
2121
+ attribute?: string | readonly string[];
2122
+ tag?: string | readonly string[];
2123
+ includeLost?: boolean;
2124
+ includeOwner?: boolean;
2125
+ includeDormant?: boolean;
2126
+ includeArchived?: boolean;
2127
+ includeObserved?: boolean;
2128
+ eventTypes?: readonly EventType[];
2129
+ momentKind?: EventMomentKind;
2130
+ commitmentType?: "promise" | "agreement";
2131
+ recurrenceKind?: EventRecurrenceKind;
2132
+ horizonDays?: number;
2133
+ exactOnly?: boolean;
2134
+ minScore?: number;
2135
+ includeDismissed?: boolean;
2136
+ since?: string | number;
2137
+ until?: string | number;
2138
+ limit?: number;
2139
+ offset?: number;
2140
+ }, ReviewAffinityToolResult> | AffinityToolDefinition<{
2141
+ scope?: "contacts" | "events" | "all";
2142
+ query: string;
2143
+ kind?: ContactKind;
2144
+ lifecycleState?: ContactLifecycleState;
2145
+ attribute?: string | readonly string[];
2146
+ tag?: string | readonly string[];
2147
+ includeLost?: boolean;
2148
+ includeOwner?: boolean;
2149
+ includeDormant?: boolean;
2150
+ limit?: number;
2151
+ offset?: number;
2152
+ }, SearchAffinityToolResult> | AffinityToolDefinition<{
2153
+ action: "revise" | "delete";
2154
+ eventId?: number;
2155
+ ref?: {
2156
+ source: string;
2157
+ id: string;
2158
+ };
2159
+ patch?: {
2160
+ summary?: string;
2161
+ content?: string;
2162
+ occurredAt?: string | number;
2163
+ significance?: number;
2164
+ channel?: string;
2165
+ type?: EventType;
2166
+ externalRef?: {
2167
+ source: string;
2168
+ id: string;
2169
+ };
2170
+ };
2171
+ confirm?: boolean;
2172
+ }, ManageEventToolResult>)[];
2173
+ declare function getAffinityToolByName(name: string): AffinityToolDefinition<TimeInputs<InspectAffinityItemToolInput>, InspectAffinityItemToolResult> | AffinityToolDefinition<TimeInputs<ManageAttributeToolInput>, ManageAttributeToolResult> | AffinityToolDefinition<TimeInputs<ManageCommitmentToolInput>, ManageCommitmentToolResult> | AffinityToolDefinition<TimeInputs<ManageContactToolInput>, ManageContactToolResult> | AffinityToolDefinition<{
2174
+ action: "dismiss" | "undismiss";
2175
+ left: {
2176
+ contactId: number;
2177
+ } | {
2178
+ identity: {
2179
+ type: string;
2180
+ value: string;
2181
+ };
2182
+ };
2183
+ right: {
2184
+ contactId: number;
2185
+ } | {
2186
+ identity: {
2187
+ type: string;
2188
+ value: string;
2189
+ };
2190
+ };
2191
+ reason?: string | null;
2192
+ }, ManageDuplicateDismissalToolResult> | AffinityToolDefinition<TimeInputs<ManageDateAnchorToolInput>, ManageDateAnchorToolResult> | AffinityToolDefinition<TimeInputs<ManageIdentityToolInput>, ManageIdentityToolResult> | AffinityToolDefinition<TimeInputs<ManageRelationshipToolInput>, ManageRelationshipToolResult> | AffinityToolDefinition<{
2193
+ winner: {
2194
+ contactId: number;
2195
+ } | {
2196
+ identity: {
2197
+ type: string;
2198
+ value: string;
2199
+ };
2200
+ };
2201
+ loser: {
2202
+ contactId: number;
2203
+ } | {
2204
+ identity: {
2205
+ type: string;
2206
+ value: string;
2207
+ };
2208
+ };
2209
+ reasonSummary?: string | null;
2210
+ now?: string | number;
2211
+ }, MergeContactsToolResult> | AffinityToolDefinition<TimeInputs<RecordEventToolInput>, RecordEventToolResult> | AffinityToolDefinition<{
2212
+ ref?: {
2213
+ source: string;
2214
+ id: string;
2215
+ };
2216
+ includeContent?: boolean;
2217
+ channel?: string;
2218
+ view: ReviewAffinityToolView;
2219
+ now?: string | number;
2220
+ contact?: {
2221
+ contactId: number;
2222
+ } | {
2223
+ identity: {
2224
+ type: string;
2225
+ value: string;
2226
+ };
2227
+ };
2228
+ link?: {
2229
+ linkId: number;
2230
+ } | {
2231
+ endpoints: {
2232
+ fromContactId: number;
2233
+ toContactId: number;
2234
+ kind?: string | undefined | undefined;
2235
+ role?: string | null | undefined | undefined;
2236
+ isStructural?: boolean | undefined | undefined;
2237
+ };
2238
+ };
2239
+ contactIds?: readonly number[];
2240
+ kind?: ContactKind | LinkKind;
2241
+ lifecycleState?: ContactLifecycleState;
2242
+ linkState?: LinkState;
2243
+ attribute?: string | readonly string[];
2244
+ tag?: string | readonly string[];
2245
+ includeLost?: boolean;
2246
+ includeOwner?: boolean;
2247
+ includeDormant?: boolean;
2248
+ includeArchived?: boolean;
2249
+ includeObserved?: boolean;
2250
+ eventTypes?: readonly EventType[];
2251
+ momentKind?: EventMomentKind;
2252
+ commitmentType?: "promise" | "agreement";
2253
+ recurrenceKind?: EventRecurrenceKind;
2254
+ horizonDays?: number;
2255
+ exactOnly?: boolean;
2256
+ minScore?: number;
2257
+ includeDismissed?: boolean;
2258
+ since?: string | number;
2259
+ until?: string | number;
2260
+ limit?: number;
2261
+ offset?: number;
2262
+ }, ReviewAffinityToolResult> | AffinityToolDefinition<{
2263
+ scope?: "contacts" | "events" | "all";
2264
+ query: string;
2265
+ kind?: ContactKind;
2266
+ lifecycleState?: ContactLifecycleState;
2267
+ attribute?: string | readonly string[];
2268
+ tag?: string | readonly string[];
2269
+ includeLost?: boolean;
2270
+ includeOwner?: boolean;
2271
+ includeDormant?: boolean;
2272
+ limit?: number;
2273
+ offset?: number;
2274
+ }, SearchAffinityToolResult> | AffinityToolDefinition<{
2275
+ action: "revise" | "delete";
2276
+ eventId?: number;
2277
+ ref?: {
2278
+ source: string;
2279
+ id: string;
2280
+ };
2281
+ patch?: {
2282
+ summary?: string;
2283
+ content?: string;
2284
+ occurredAt?: string | number;
2285
+ significance?: number;
2286
+ channel?: string;
2287
+ type?: EventType;
2288
+ externalRef?: {
2289
+ source: string;
2290
+ id: string;
2291
+ };
2292
+ };
2293
+ confirm?: boolean;
2294
+ }, ManageEventToolResult> | null;
1526
2295
 
1527
2296
  interface AffinityToolMapping {
1528
2297
  source: string;
@@ -1545,6 +2314,7 @@ declare const recordEventToolName = "record_event";
1545
2314
  declare const manageCommitmentToolName = "manage_commitment";
1546
2315
  declare const manageDateAnchorToolName = "manage_date_anchor";
1547
2316
  declare const manageAttributeToolName = "manage_attribute";
2317
+ declare const manageEventToolName = "manage_event";
1548
2318
 
1549
2319
  declare function summarizeCount(count: number, singular: string): string;
1550
2320
 
@@ -1554,6 +2324,8 @@ type index_ContactLocator = ContactLocator;
1554
2324
  type index_JsonSchema = JsonSchema;
1555
2325
  type index_JsonSchemaType = JsonSchemaType;
1556
2326
  type index_LinkLocator = LinkLocator;
2327
+ type index_ManageEventToolInput = ManageEventToolInput;
2328
+ type index_ManageEventToolResult = ManageEventToolResult;
1557
2329
  type index_MutationToolData<TPrimary> = MutationToolData<TPrimary>;
1558
2330
  type index_ResolvedTarget<T> = ResolvedTarget<T>;
1559
2331
  type index_ToolBaseResult = ToolBaseResult;
@@ -1599,6 +2371,9 @@ declare const index_manageDateAnchorToolName: typeof manageDateAnchorToolName;
1599
2371
  declare const index_manageDuplicateDismissalTool: typeof manageDuplicateDismissalTool;
1600
2372
  declare const index_manageDuplicateDismissalToolHandler: typeof manageDuplicateDismissalToolHandler;
1601
2373
  declare const index_manageDuplicateDismissalToolName: typeof manageDuplicateDismissalToolName;
2374
+ declare const index_manageEventTool: typeof manageEventTool;
2375
+ declare const index_manageEventToolHandler: typeof manageEventToolHandler;
2376
+ declare const index_manageEventToolName: typeof manageEventToolName;
1602
2377
  declare const index_manageIdentityTool: typeof manageIdentityTool;
1603
2378
  declare const index_manageIdentityToolHandler: typeof manageIdentityToolHandler;
1604
2379
  declare const index_manageIdentityToolName: typeof manageIdentityToolName;
@@ -1614,6 +2389,7 @@ declare const index_nullableStringSchema: typeof nullableStringSchema;
1614
2389
  declare const index_numberSchema: typeof numberSchema;
1615
2390
  declare const index_objectSchema: typeof objectSchema;
1616
2391
  declare const index_oneOfSchema: typeof oneOfSchema;
2392
+ declare const index_parseTimeInput: typeof parseTimeInput;
1617
2393
  declare const index_recordEventTool: typeof recordEventTool;
1618
2394
  declare const index_recordEventToolHandler: typeof recordEventToolHandler;
1619
2395
  declare const index_recordEventToolName: typeof recordEventToolName;
@@ -1646,7 +2422,7 @@ declare const index_toolSuccess: typeof toolSuccess;
1646
2422
  declare const index_toolWarning: typeof toolWarning;
1647
2423
  declare const index_withToolHandling: typeof withToolHandling;
1648
2424
  declare namespace index {
1649
- export { type index_AffinityToolDefinition as AffinityToolDefinition, type index_AffinityToolMapping as AffinityToolMapping, type index_ContactLocator as ContactLocator, type index_JsonSchema as JsonSchema, type index_JsonSchemaType as JsonSchemaType, type index_LinkLocator as LinkLocator, type index_MutationToolData as MutationToolData, type index_ResolvedTarget as ResolvedTarget, type index_ToolBaseResult as ToolBaseResult, type index_ToolDefinitionRegistry as ToolDefinitionRegistry, type index_ToolEntityKind as ToolEntityKind, type index_ToolEntityRef as ToolEntityRef, type index_ToolFailure as ToolFailure, type index_ToolInputDescriptions as ToolInputDescriptions, type index_ToolListItem as ToolListItem, type index_ToolNeedsClarification as ToolNeedsClarification, type index_ToolNextStepHint as ToolNextStepHint, type index_ToolOutcomeKind as ToolOutcomeKind, type index_ToolOutputDescription as ToolOutputDescription, type index_ToolResult as ToolResult, type index_ToolSideEffects as ToolSideEffects, type index_ToolSuccess as ToolSuccess, type index_ToolWarning as ToolWarning, index_affinityToolMappings as affinityToolMappings, index_affinityTools as affinityTools, index_arraySchema as arraySchema, index_booleanSchema as booleanSchema, index_defineAffinityTool as defineAffinityTool, index_enumSchema as enumSchema, index_getAffinityToolByName as getAffinityToolByName, index_inspectAffinityItemTool as inspectAffinityItemTool, index_inspectAffinityItemToolHandler as inspectAffinityItemToolHandler, index_inspectAffinityItemToolName as inspectAffinityItemToolName, index_integerSchema as integerSchema, index_listAffinityToolDefinitions as listAffinityToolDefinitions, index_literalSchema as literalSchema, index_manageAttributeTool as manageAttributeTool, index_manageAttributeToolHandler as manageAttributeToolHandler, index_manageAttributeToolName as manageAttributeToolName, index_manageCommitmentTool as manageCommitmentTool, index_manageCommitmentToolHandler as manageCommitmentToolHandler, index_manageCommitmentToolName as manageCommitmentToolName, index_manageContactTool as manageContactTool, index_manageContactToolHandler as manageContactToolHandler, index_manageContactToolName as manageContactToolName, index_manageDateAnchorTool as manageDateAnchorTool, index_manageDateAnchorToolHandler as manageDateAnchorToolHandler, index_manageDateAnchorToolName as manageDateAnchorToolName, index_manageDuplicateDismissalTool as manageDuplicateDismissalTool, index_manageDuplicateDismissalToolHandler as manageDuplicateDismissalToolHandler, index_manageDuplicateDismissalToolName as manageDuplicateDismissalToolName, index_manageIdentityTool as manageIdentityTool, index_manageIdentityToolHandler as manageIdentityToolHandler, index_manageIdentityToolName as manageIdentityToolName, index_manageRelationshipTool as manageRelationshipTool, index_manageRelationshipToolHandler as manageRelationshipToolHandler, index_manageRelationshipToolName as manageRelationshipToolName, index_mapErrorToToolFailure as mapErrorToToolFailure, index_mergeContactsTool as mergeContactsTool, index_mergeContactsToolHandler as mergeContactsToolHandler, index_mergeContactsToolName as mergeContactsToolName, index_mutationToolResult as mutationToolResult, index_nullableStringSchema as nullableStringSchema, index_numberSchema as numberSchema, index_objectSchema as objectSchema, index_oneOfSchema as oneOfSchema, index_recordEventTool as recordEventTool, index_recordEventToolHandler as recordEventToolHandler, index_recordEventToolName as recordEventToolName, index_resolveContactLocator as resolveContactLocator, index_resolveLinkLocator as resolveLinkLocator, index_reviewAffinityTool as reviewAffinityTool, index_reviewAffinityToolHandler as reviewAffinityToolHandler, index_reviewAffinityToolName as reviewAffinityToolName, index_searchAffinityTool as searchAffinityTool, index_searchAffinityToolHandler as searchAffinityToolHandler, index_searchAffinityToolName as searchAffinityToolName, index_stringSchema as stringSchema, index_summarizeCount as summarizeCount, index_toAttributeEntityRef as toAttributeEntityRef, index_toAttributeListToolItem as toAttributeListToolItem, index_toContactEntityRef as toContactEntityRef, index_toContactListToolItem as toContactListToolItem, index_toEventEntityRef as toEventEntityRef, index_toEventListToolItem as toEventListToolItem, index_toIdentityEntityRef as toIdentityEntityRef, index_toIdentityListToolItem as toIdentityListToolItem, index_toLinkEntityRef as toLinkEntityRef, index_toLinkListToolItem as toLinkListToolItem, index_toMutationRefEntity as toMutationRefEntity, index_toReceiptEntityRefs as toReceiptEntityRefs, index_toolFailure as toolFailure, index_toolNeedsClarification as toolNeedsClarification, index_toolNoOp as toolNoOp, index_toolSuccess as toolSuccess, index_toolWarning as toolWarning, index_withToolHandling as withToolHandling };
2425
+ export { type index_AffinityToolDefinition as AffinityToolDefinition, type index_AffinityToolMapping as AffinityToolMapping, type index_ContactLocator as ContactLocator, type index_JsonSchema as JsonSchema, type index_JsonSchemaType as JsonSchemaType, type index_LinkLocator as LinkLocator, type index_ManageEventToolInput as ManageEventToolInput, type index_ManageEventToolResult as ManageEventToolResult, type index_MutationToolData as MutationToolData, type index_ResolvedTarget as ResolvedTarget, type index_ToolBaseResult as ToolBaseResult, type index_ToolDefinitionRegistry as ToolDefinitionRegistry, type index_ToolEntityKind as ToolEntityKind, type index_ToolEntityRef as ToolEntityRef, type index_ToolFailure as ToolFailure, type index_ToolInputDescriptions as ToolInputDescriptions, type index_ToolListItem as ToolListItem, type index_ToolNeedsClarification as ToolNeedsClarification, type index_ToolNextStepHint as ToolNextStepHint, type index_ToolOutcomeKind as ToolOutcomeKind, type index_ToolOutputDescription as ToolOutputDescription, type index_ToolResult as ToolResult, type index_ToolSideEffects as ToolSideEffects, type index_ToolSuccess as ToolSuccess, type index_ToolWarning as ToolWarning, index_affinityToolMappings as affinityToolMappings, index_affinityTools as affinityTools, index_arraySchema as arraySchema, index_booleanSchema as booleanSchema, index_defineAffinityTool as defineAffinityTool, index_enumSchema as enumSchema, index_getAffinityToolByName as getAffinityToolByName, index_inspectAffinityItemTool as inspectAffinityItemTool, index_inspectAffinityItemToolHandler as inspectAffinityItemToolHandler, index_inspectAffinityItemToolName as inspectAffinityItemToolName, index_integerSchema as integerSchema, index_listAffinityToolDefinitions as listAffinityToolDefinitions, index_literalSchema as literalSchema, index_manageAttributeTool as manageAttributeTool, index_manageAttributeToolHandler as manageAttributeToolHandler, index_manageAttributeToolName as manageAttributeToolName, index_manageCommitmentTool as manageCommitmentTool, index_manageCommitmentToolHandler as manageCommitmentToolHandler, index_manageCommitmentToolName as manageCommitmentToolName, index_manageContactTool as manageContactTool, index_manageContactToolHandler as manageContactToolHandler, index_manageContactToolName as manageContactToolName, index_manageDateAnchorTool as manageDateAnchorTool, index_manageDateAnchorToolHandler as manageDateAnchorToolHandler, index_manageDateAnchorToolName as manageDateAnchorToolName, index_manageDuplicateDismissalTool as manageDuplicateDismissalTool, index_manageDuplicateDismissalToolHandler as manageDuplicateDismissalToolHandler, index_manageDuplicateDismissalToolName as manageDuplicateDismissalToolName, index_manageEventTool as manageEventTool, index_manageEventToolHandler as manageEventToolHandler, index_manageEventToolName as manageEventToolName, index_manageIdentityTool as manageIdentityTool, index_manageIdentityToolHandler as manageIdentityToolHandler, index_manageIdentityToolName as manageIdentityToolName, index_manageRelationshipTool as manageRelationshipTool, index_manageRelationshipToolHandler as manageRelationshipToolHandler, index_manageRelationshipToolName as manageRelationshipToolName, index_mapErrorToToolFailure as mapErrorToToolFailure, index_mergeContactsTool as mergeContactsTool, index_mergeContactsToolHandler as mergeContactsToolHandler, index_mergeContactsToolName as mergeContactsToolName, index_mutationToolResult as mutationToolResult, index_nullableStringSchema as nullableStringSchema, index_numberSchema as numberSchema, index_objectSchema as objectSchema, index_oneOfSchema as oneOfSchema, index_parseTimeInput as parseTimeInput, index_recordEventTool as recordEventTool, index_recordEventToolHandler as recordEventToolHandler, index_recordEventToolName as recordEventToolName, index_resolveContactLocator as resolveContactLocator, index_resolveLinkLocator as resolveLinkLocator, index_reviewAffinityTool as reviewAffinityTool, index_reviewAffinityToolHandler as reviewAffinityToolHandler, index_reviewAffinityToolName as reviewAffinityToolName, index_searchAffinityTool as searchAffinityTool, index_searchAffinityToolHandler as searchAffinityToolHandler, index_searchAffinityToolName as searchAffinityToolName, index_stringSchema as stringSchema, index_summarizeCount as summarizeCount, index_toAttributeEntityRef as toAttributeEntityRef, index_toAttributeListToolItem as toAttributeListToolItem, index_toContactEntityRef as toContactEntityRef, index_toContactListToolItem as toContactListToolItem, index_toEventEntityRef as toEventEntityRef, index_toEventListToolItem as toEventListToolItem, index_toIdentityEntityRef as toIdentityEntityRef, index_toIdentityListToolItem as toIdentityListToolItem, index_toLinkEntityRef as toLinkEntityRef, index_toLinkListToolItem as toLinkListToolItem, index_toMutationRefEntity as toMutationRefEntity, index_toReceiptEntityRefs as toReceiptEntityRefs, index_toolFailure as toolFailure, index_toolNeedsClarification as toolNeedsClarification, index_toolNoOp as toolNoOp, index_toolSuccess as toolSuccess, index_toolWarning as toolWarning, index_withToolHandling as withToolHandling };
1650
2426
  }
1651
2427
 
1652
2428
  declare function addIdentity(db: AffinityDb, contactId: number, input: AddIdentityInput): IdentityMutationReceipt;
@@ -1666,6 +2442,8 @@ declare function unsetAttribute(db: AffinityDb, target: AttributeTarget, name: s
1666
2442
  declare const write_addDateAnchor: typeof addDateAnchor;
1667
2443
  declare const write_addIdentity: typeof addIdentity;
1668
2444
  declare const write_createContact: typeof createContact;
2445
+ declare const write_deleteContact: typeof deleteContact;
2446
+ declare const write_deleteEvent: typeof deleteEvent;
1669
2447
  declare const write_dismissDuplicate: typeof dismissDuplicate;
1670
2448
  declare const write_mergeContacts: typeof mergeContacts;
1671
2449
  declare const write_overrideLinkState: typeof overrideLinkState;
@@ -1682,6 +2460,7 @@ declare const write_resolveCommitment: typeof resolveCommitment;
1682
2460
  declare const write_reviseBond: typeof reviseBond;
1683
2461
  declare const write_reviseContact: typeof reviseContact;
1684
2462
  declare const write_reviseDateAnchor: typeof reviseDateAnchor;
2463
+ declare const write_reviseEvent: typeof reviseEvent;
1685
2464
  declare const write_reviseIdentity: typeof reviseIdentity;
1686
2465
  declare const write_seedSocialLink: typeof seedSocialLink;
1687
2466
  declare const write_setAttribute: typeof setAttribute;
@@ -1691,7 +2470,7 @@ declare const write_undismissDuplicate: typeof undismissDuplicate;
1691
2470
  declare const write_unsetAttribute: typeof unsetAttribute;
1692
2471
  declare const write_verifyIdentity: typeof verifyIdentity;
1693
2472
  declare namespace write {
1694
- export { write_addDateAnchor as addDateAnchor, write_addIdentity as addIdentity, write_createContact as createContact, write_dismissDuplicate as dismissDuplicate, write_mergeContacts as mergeContacts, write_overrideLinkState as overrideLinkState, write_recordCommitment as recordCommitment, write_recordInteraction as recordInteraction, write_recordMilestone as recordMilestone, write_recordObservation as recordObservation, write_recordTransaction as recordTransaction, write_removeDateAnchor as removeDateAnchor, write_removeIdentity as removeIdentity, write_removeStructuralTie as removeStructuralTie, write_replaceAttributes as replaceAttributes, write_resolveCommitment as resolveCommitment, write_reviseBond as reviseBond, write_reviseContact as reviseContact, write_reviseDateAnchor as reviseDateAnchor, write_reviseIdentity as reviseIdentity, write_seedSocialLink as seedSocialLink, write_setAttribute as setAttribute, write_setContactLifecycle as setContactLifecycle, write_setStructuralTie as setStructuralTie, write_undismissDuplicate as undismissDuplicate, write_unsetAttribute as unsetAttribute, write_verifyIdentity as verifyIdentity };
2473
+ export { write_addDateAnchor as addDateAnchor, write_addIdentity as addIdentity, write_createContact as createContact, write_deleteContact as deleteContact, write_deleteEvent as deleteEvent, write_dismissDuplicate as dismissDuplicate, write_mergeContacts as mergeContacts, write_overrideLinkState as overrideLinkState, write_recordCommitment as recordCommitment, write_recordInteraction as recordInteraction, write_recordMilestone as recordMilestone, write_recordObservation as recordObservation, write_recordTransaction as recordTransaction, write_removeDateAnchor as removeDateAnchor, write_removeIdentity as removeIdentity, write_removeStructuralTie as removeStructuralTie, write_replaceAttributes as replaceAttributes, write_resolveCommitment as resolveCommitment, write_reviseBond as reviseBond, write_reviseContact as reviseContact, write_reviseDateAnchor as reviseDateAnchor, write_reviseEvent as reviseEvent, write_reviseIdentity as reviseIdentity, write_seedSocialLink as seedSocialLink, write_setAttribute as setAttribute, write_setContactLifecycle as setContactLifecycle, write_setStructuralTie as setStructuralTie, write_undismissDuplicate as undismissDuplicate, write_unsetAttribute as unsetAttribute, write_verifyIdentity as verifyIdentity };
1695
2474
  }
1696
2475
 
1697
2476
  export { AffinityConflictError, AffinityError, type AffinityErrorCode, AffinityInvariantError, AffinityMergeError, AffinityNotFoundError, type AffinitySkill, type AffinitySkillRegistry, type AffinitySoul, type AffinitySoulTrait, AffinityStateError, AffinityValidationError, affinitySkills, affinitySoul, affinitySoulEssence, affinitySoulTraits, bootstrapAndColdStartSkill, captureTransactionsAndCommercialEventsSkill, defineAffinitySkill, errors, getAffinitySkillByName, identifyAndLocateContactsSkill, importHistoryWithoutFakingEvidenceSkill, initAffinityTables, isAffinityError, listAffinitySkills, managePromisesAndAgreementsSkill, manageRecurringDatesAndRemindersSkill, modelStructureOrgsAndHouseholdsSkill, read, reconcileDuplicatesAndMergeSafelySkill, recordDirectEvidenceWellSkill, recordObservationsAndReferralsSkill, renderAffinitySoulPromptFoundation, reviewRadarProgressionAndGraphSkill, index$1 as skills, soul, index as tools, types, write };