synomem 0.6.11 → 0.7.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.
Files changed (49) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +92 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client.d.ts +22 -1
  5. package/dist/client.d.ts.map +1 -1
  6. package/dist/client.js +164 -3
  7. package/dist/client.js.map +1 -1
  8. package/dist/errors.d.ts +1 -1
  9. package/dist/errors.d.ts.map +1 -1
  10. package/dist/errors.js +2 -0
  11. package/dist/errors.js.map +1 -1
  12. package/dist/import.d.ts +83 -0
  13. package/dist/import.d.ts.map +1 -1
  14. package/dist/mcp/index.d.ts.map +1 -1
  15. package/dist/mcp/index.js +110 -2
  16. package/dist/mcp/index.js.map +1 -1
  17. package/dist/ports/repository.d.ts +10 -1
  18. package/dist/ports/repository.d.ts.map +1 -1
  19. package/dist/projections.d.ts.map +1 -1
  20. package/dist/projections.js +6 -0
  21. package/dist/projections.js.map +1 -1
  22. package/dist/remote.d.ts +10 -1
  23. package/dist/remote.d.ts.map +1 -1
  24. package/dist/remote.js +9 -0
  25. package/dist/remote.js.map +1 -1
  26. package/dist/schemas.d.ts +130 -0
  27. package/dist/schemas.d.ts.map +1 -1
  28. package/dist/schemas.js +77 -0
  29. package/dist/schemas.js.map +1 -1
  30. package/dist/service.d.ts +14 -1
  31. package/dist/service.d.ts.map +1 -1
  32. package/dist/storage.d.ts +12 -1
  33. package/dist/storage.d.ts.map +1 -1
  34. package/dist/storage.js +136 -19
  35. package/dist/storage.js.map +1 -1
  36. package/dist/types.d.ts +72 -1
  37. package/dist/types.d.ts.map +1 -1
  38. package/package.json +1 -1
  39. package/src/cli.ts +153 -0
  40. package/src/client.ts +184 -2
  41. package/src/errors.ts +2 -0
  42. package/src/mcp/index.ts +140 -1
  43. package/src/ports/repository.ts +8 -0
  44. package/src/projections.ts +6 -0
  45. package/src/remote.ts +45 -0
  46. package/src/schemas.ts +85 -0
  47. package/src/service.ts +18 -0
  48. package/src/storage.ts +167 -13
  49. package/src/types.ts +82 -2
package/src/types.ts CHANGED
@@ -117,6 +117,7 @@ export interface KudosGivenEvent extends BaseEvent {
117
117
  reason: string;
118
118
  evidence?: EvidenceReference[];
119
119
  tags?: string[];
120
+ topicIds?: string[];
120
121
  visibility: Visibility;
121
122
  }
122
123
  export interface KudosAcknowledgedEvent extends BaseEvent {
@@ -139,6 +140,7 @@ export interface MemoSentEvent extends BaseEvent {
139
140
  subject: string;
140
141
  body: string;
141
142
  tags?: string[];
143
+ topicIds?: string[];
142
144
  visibility: Visibility;
143
145
  }
144
146
  export interface MemoReadEvent extends BaseEvent {
@@ -167,6 +169,7 @@ export interface PostCreatedEvent extends BaseEvent {
167
169
  title: string;
168
170
  body: string;
169
171
  tags?: string[];
172
+ topicIds?: string[];
170
173
  /** The post this replies to. A reply inherits its parent's workspace. */
171
174
  replyTo?: string;
172
175
  }
@@ -176,6 +179,7 @@ export interface PostEditedEvent extends BaseEvent {
176
179
  title: string;
177
180
  body: string;
178
181
  tags?: string[];
182
+ topicIds?: string[];
179
183
  }
180
184
  export interface PostArchivedEvent extends BaseEvent {
181
185
  type: 'post.archived';
@@ -207,6 +211,7 @@ export interface NoteCreatedEvent extends BaseEvent {
207
211
  title: string;
208
212
  body: string;
209
213
  tags?: string[];
214
+ topicIds?: string[];
210
215
  visibility: 'private';
211
216
  }
212
217
  export interface NoteRevisedEvent extends BaseEvent {
@@ -215,6 +220,7 @@ export interface NoteRevisedEvent extends BaseEvent {
215
220
  title: string;
216
221
  body: string;
217
222
  tags?: string[];
223
+ topicIds?: string[];
218
224
  visibility: 'private';
219
225
  }
220
226
  export interface NoteArchivedEvent extends BaseEvent {
@@ -234,6 +240,7 @@ export interface TaskCreatedEvent extends BaseEvent {
234
240
  priority: TaskPriority;
235
241
  due?: TaskDue;
236
242
  tags?: string[];
243
+ topicIds?: string[];
237
244
  visibility: Visibility;
238
245
  requiresAcceptance: boolean;
239
246
  }
@@ -245,6 +252,7 @@ export interface TaskUpdatedEvent extends BaseEvent {
245
252
  priority: TaskPriority;
246
253
  due?: TaskDue;
247
254
  tags?: string[];
255
+ topicIds?: string[];
248
256
  visibility: Visibility;
249
257
  }
250
258
  export interface TaskCompletedEvent extends BaseEvent {
@@ -302,6 +310,7 @@ export interface TodoCreatedEvent extends BaseEvent {
302
310
  priority: TaskPriority;
303
311
  due?: TaskDue;
304
312
  tags?: string[];
313
+ topicIds?: string[];
305
314
  }
306
315
  export interface TodoUpdatedEvent extends BaseEvent {
307
316
  type: 'todo.updated';
@@ -311,6 +320,7 @@ export interface TodoUpdatedEvent extends BaseEvent {
311
320
  priority: TaskPriority;
312
321
  due?: TaskDue;
313
322
  tags?: string[];
323
+ topicIds?: string[];
314
324
  }
315
325
  export interface TodoCompletedEvent extends BaseEvent {
316
326
  type: 'todo.completed';
@@ -342,6 +352,7 @@ export interface TodoRecord {
342
352
  priority: TaskPriority;
343
353
  due?: TaskDue;
344
354
  tags: string[];
355
+ topicIds: string[];
345
356
  version: number;
346
357
  };
347
358
  status: 'open' | 'completed' | 'canceled' | 'archived';
@@ -353,6 +364,7 @@ export interface CreateTodoInput extends MutationInput {
353
364
  priority?: TaskPriority;
354
365
  due?: TaskDue;
355
366
  tags?: string[];
367
+ topicIds?: string[];
356
368
  }
357
369
  export interface UpdateTodoInput extends MutationInput {
358
370
  todoId: string;
@@ -362,6 +374,7 @@ export interface UpdateTodoInput extends MutationInput {
362
374
  priority?: TaskPriority;
363
375
  due?: TaskDue | null;
364
376
  tags?: string[];
377
+ topicIds?: string[];
365
378
  }
366
379
  export type CreateTodoResult = MutationResult<TodoRecord>;
367
380
 
@@ -375,6 +388,39 @@ export interface AgentUpdatedEvent extends BaseEvent {
375
388
  changes: Partial<Omit<AgentProfile, 'id' | 'createdAt'>>;
376
389
  }
377
390
 
391
+ /**
392
+ * A controlled, reusable subject a record can be filed under — deliberately
393
+ * distinct from a tag. A tag is a loose label anyone spells however they
394
+ * like (`blocked`, `reporting`); a topic is a stable identity with one
395
+ * canonical display name and a set of aliases, so "all notes about
396
+ * Synomem" stays a coherent page even as the record count grows and even
397
+ * if the topic itself is renamed later. A record can carry several topics
398
+ * at once (§ `topicIds` on every create/update event) — a record picks a
399
+ * kind, not a single subject.
400
+ */
401
+ export interface Topic {
402
+ id: string;
403
+ displayName: string;
404
+ aliases?: string[];
405
+ status: 'active' | 'archived';
406
+ createdAt: string;
407
+ }
408
+ export interface TopicCreatedEvent extends BaseEvent {
409
+ type: 'topic.created';
410
+ topic: Topic;
411
+ }
412
+ export interface TopicUpdatedEvent extends BaseEvent {
413
+ type: 'topic.updated';
414
+ topicId: string;
415
+ changes: Partial<Omit<Topic, 'id' | 'createdAt'>>;
416
+ }
417
+ /** The outcome of resolving a topic name, which may legitimately name no one or several. */
418
+ export interface TopicResolution {
419
+ query: string;
420
+ match?: Topic;
421
+ candidates: Topic[];
422
+ }
423
+
378
424
  export type SynomemEvent =
379
425
  | KudosGivenEvent
380
426
  | KudosAcknowledgedEvent
@@ -404,7 +450,9 @@ export type SynomemEvent =
404
450
  | TodoCanceledEvent
405
451
  | TodoArchivedEvent
406
452
  | AgentCreatedEvent
407
- | AgentUpdatedEvent;
453
+ | AgentUpdatedEvent
454
+ | TopicCreatedEvent
455
+ | TopicUpdatedEvent;
408
456
 
409
457
  export type AcknowledgmentStatus = 'acknowledged' | 'unacknowledged';
410
458
  export type RevocationStatus = 'revoked' | 'active';
@@ -436,6 +484,7 @@ export interface PostRecord {
436
484
  title: string;
437
485
  body: string;
438
486
  tags?: string[];
487
+ topicIds?: string[];
439
488
  version: number;
440
489
  }
441
490
 
@@ -459,7 +508,14 @@ export interface NoteRecord {
459
508
  event: NoteCreatedEvent;
460
509
  revision?: NoteRevisedEvent;
461
510
  archived?: NoteArchivedEvent;
462
- current: { title: string; body: string; tags: string[]; visibility: Visibility; version: number };
511
+ current: {
512
+ title: string;
513
+ body: string;
514
+ tags: string[];
515
+ topicIds: string[];
516
+ visibility: Visibility;
517
+ version: number;
518
+ };
463
519
  status: 'active' | 'archived';
464
520
  }
465
521
  /**
@@ -491,6 +547,7 @@ export interface TaskRecord {
491
547
  priority: TaskPriority;
492
548
  due?: TaskDue;
493
549
  tags: string[];
550
+ topicIds: string[];
494
551
  visibility: Visibility;
495
552
  version: number;
496
553
  };
@@ -507,6 +564,7 @@ export interface ItemSummary {
507
564
  actor: ActorIdentity;
508
565
  title: string;
509
566
  tags: string[];
567
+ topicIds: string[];
510
568
  visibility: Visibility;
511
569
  status: string;
512
570
  recipientAgentId?: string;
@@ -535,6 +593,8 @@ export interface ItemListInput extends PaginationInput {
535
593
  actorId?: string;
536
594
  actorKind?: ActorKind;
537
595
  tag?: string;
596
+ /** Only records carrying this topic — the stable, cross-kind grouping tags do not give. */
597
+ topicId?: string;
538
598
  status?: string;
539
599
  visibility?: Visibility;
540
600
  from?: string;
@@ -563,6 +623,7 @@ export interface KudosListInput extends PaginationInput {
563
623
  actorId?: string;
564
624
  actorKind?: ActorKind;
565
625
  tag?: string;
626
+ topicId?: string;
566
627
  status?: AcknowledgmentStatus;
567
628
  visibility?: Visibility;
568
629
  revoked?: boolean;
@@ -623,6 +684,7 @@ export interface GiveKudosInput extends MutationInput {
623
684
  reason: string;
624
685
  evidence?: EvidenceReference[];
625
686
  tags?: string[];
687
+ topicIds?: string[];
626
688
  visibility?: Visibility;
627
689
  }
628
690
  export interface SendMemoInput extends MutationInput {
@@ -630,12 +692,14 @@ export interface SendMemoInput extends MutationInput {
630
692
  subject: string;
631
693
  body: string;
632
694
  tags?: string[];
695
+ topicIds?: string[];
633
696
  visibility?: Visibility;
634
697
  }
635
698
  export interface CreatePostInput extends MutationInput {
636
699
  title: string;
637
700
  body: string;
638
701
  tags?: string[];
702
+ topicIds?: string[];
639
703
  /** The post being replied to; a reply inherits its parent's workspace. */
640
704
  replyTo?: string;
641
705
  }
@@ -646,6 +710,7 @@ export interface UpdatePostInput {
646
710
  title?: string;
647
711
  body?: string;
648
712
  tags?: string[];
713
+ topicIds?: string[];
649
714
  idempotencyKey?: string;
650
715
  }
651
716
 
@@ -654,6 +719,7 @@ export interface CreateNoteInput extends MutationInput {
654
719
  title: string;
655
720
  body: string;
656
721
  tags?: string[];
722
+ topicIds?: string[];
657
723
  }
658
724
  export interface ReviseNoteInput extends MutationInput {
659
725
  noteId: string;
@@ -661,6 +727,7 @@ export interface ReviseNoteInput extends MutationInput {
661
727
  title?: string;
662
728
  body?: string;
663
729
  tags?: string[];
730
+ topicIds?: string[];
664
731
  }
665
732
  export interface CreateTaskInput extends MutationInput {
666
733
  assigneeAgentId?: string;
@@ -669,6 +736,7 @@ export interface CreateTaskInput extends MutationInput {
669
736
  priority?: TaskPriority;
670
737
  due?: TaskDue;
671
738
  tags?: string[];
739
+ topicIds?: string[];
672
740
  visibility?: Visibility;
673
741
  }
674
742
  export interface UpdateTaskInput extends MutationInput {
@@ -679,6 +747,7 @@ export interface UpdateTaskInput extends MutationInput {
679
747
  priority?: TaskPriority;
680
748
  due?: TaskDue | null;
681
749
  tags?: string[];
750
+ topicIds?: string[];
682
751
  visibility?: Visibility;
683
752
  }
684
753
  export interface MutationResult<T> {
@@ -714,6 +783,17 @@ export interface UpdateAgentInput {
714
783
  description?: string;
715
784
  metadata?: Record<string, JsonValue>;
716
785
  }
786
+ export interface CreateTopicInput {
787
+ displayName: string;
788
+ aliases?: string[];
789
+ }
790
+ export interface UpdateTopicInput {
791
+ displayName?: string;
792
+ aliases?: string[];
793
+ }
794
+ export interface TopicListInput {
795
+ status?: 'active' | 'archived';
796
+ }
717
797
  export interface KudosStats {
718
798
  total: number;
719
799
  active: number;