watashi-db 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CLAUDE.md +36 -0
  2. package/LICENSE +1 -1
  3. package/README.md +33 -2
  4. package/cowork-plugin/skills/groom/SKILL.md +51 -15
  5. package/cowork-plugin/skills/recall/SKILL.md +5 -6
  6. package/cowork-plugin/skills/reflect/SKILL.md +4 -4
  7. package/cowork-plugin/skills/remember/SKILL.md +3 -3
  8. package/cowork-plugin/skills/session-start/SKILL.md +3 -3
  9. package/dist/config/schema.js +1 -1
  10. package/dist/constants.d.ts +5 -1
  11. package/dist/constants.js +19 -3
  12. package/dist/constants.js.map +1 -1
  13. package/dist/database/archive.js +6 -6
  14. package/dist/database/queries-core.d.ts +75 -1
  15. package/dist/database/queries-core.js +283 -12
  16. package/dist/database/queries-core.js.map +1 -1
  17. package/dist/database/queries.d.ts +71 -1
  18. package/dist/database/queries.js +29 -0
  19. package/dist/database/queries.js.map +1 -1
  20. package/dist/database/schema.d.ts +1 -0
  21. package/dist/database/schema.js +1915 -214
  22. package/dist/database/schema.js.map +1 -1
  23. package/dist/embedding/embed-on-write.d.ts +7 -1
  24. package/dist/embedding/embed-on-write.js +8 -3
  25. package/dist/embedding/embed-on-write.js.map +1 -1
  26. package/dist/hook.js +9 -6
  27. package/dist/hook.js.map +1 -1
  28. package/dist/index.js +3 -2
  29. package/dist/index.js.map +1 -1
  30. package/dist/resources/config-guide-content.d.ts +1 -1
  31. package/dist/resources/config-guide-content.js +2 -2
  32. package/dist/server-instructions.js +16 -17
  33. package/dist/server-instructions.js.map +1 -1
  34. package/dist/server.d.ts +4 -1
  35. package/dist/server.js +42 -18
  36. package/dist/server.js.map +1 -1
  37. package/dist/setup.js +5 -6
  38. package/dist/setup.js.map +1 -1
  39. package/dist/store/federation.d.ts +12 -1
  40. package/dist/store/federation.js +38 -0
  41. package/dist/store/federation.js.map +1 -1
  42. package/dist/store/sync-manager.d.ts +1 -1
  43. package/dist/store/sync-manager.js +9 -9
  44. package/dist/tools/claim-tools.d.ts +1 -1
  45. package/dist/tools/claim-tools.js +7 -7
  46. package/dist/tools/claim-tools.js.map +1 -1
  47. package/dist/tools/decision-tools.d.ts +1 -1
  48. package/dist/tools/decision-tools.js +2 -2
  49. package/dist/tools/decision-tools.js.map +1 -1
  50. package/dist/tools/episode-tools.d.ts +1 -1
  51. package/dist/tools/episode-tools.js +2 -2
  52. package/dist/tools/episode-tools.js.map +1 -1
  53. package/dist/tools/file-tools.d.ts +3 -0
  54. package/dist/tools/file-tools.js +347 -0
  55. package/dist/tools/file-tools.js.map +1 -0
  56. package/dist/tools/get-tools.d.ts +1 -1
  57. package/dist/tools/get-tools.js +39 -5
  58. package/dist/tools/get-tools.js.map +1 -1
  59. package/dist/tools/knowledge-tools.d.ts +1 -1
  60. package/dist/tools/knowledge-tools.js +2 -2
  61. package/dist/tools/knowledge-tools.js.map +1 -1
  62. package/dist/tools/maintenance-tools.d.ts +1 -1
  63. package/dist/tools/maintenance-tools.js +38 -6
  64. package/dist/tools/maintenance-tools.js.map +1 -1
  65. package/dist/tools/memo-tools.d.ts +7 -11
  66. package/dist/tools/memo-tools.js +499 -307
  67. package/dist/tools/memo-tools.js.map +1 -1
  68. package/dist/tools/query-tools.d.ts +1 -1
  69. package/dist/tools/query-tools.js +28 -5
  70. package/dist/tools/query-tools.js.map +1 -1
  71. package/dist/types.d.ts +370 -48
  72. package/dist/types.js +124 -16
  73. package/dist/types.js.map +1 -1
  74. package/misc/20260316_110841_groom-recipe.md +483 -0
  75. package/misc/20260316_xaml-testing-library-recipe.md +817 -0
  76. package/package.json +4 -2
  77. package/scripts/update-license-version.sh +7 -0
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { CLAIM_CATEGORIES, CLAIM_SCOPES, CLAIM_STATUSES, DECISION_STATUSES, THEORY_STATUSES, INSIGHT_STATUSES, MODEL_STATUSES, USER_MEMO_STATUSES, USER_MEMO_USAGE_POLICIES, USER_PLAN_STATUSES, USER_ISSUE_STATUSES, USER_ISSUE_PRIORITIES } from "./constants.js";
2
+ import { CLAIM_CATEGORIES, CLAIM_SCOPES, CLAIM_STATUSES, DECISION_STATUSES, THEORY_STATUSES, INSIGHT_STATUSES, MODEL_STATUSES, USER_MEMO_STATUSES, USER_MEMO_USAGE_POLICIES, USER_PLAN_STATUSES, USER_ISSUE_STATUSES, USER_ISSUE_PRIORITIES, USER_TOPIC_STATUSES, USER_TOPIC_PRIORITIES, USER_FILE_STATUSES } from "./constants.js";
3
3
  export declare const ScopeSchema: z.ZodEffects<z.ZodString, string, string>;
4
4
  export declare const StoreClaimSchema: z.ZodObject<{
5
5
  subject: z.ZodString;
@@ -287,7 +287,7 @@ export interface AuditLogRow {
287
287
  client_version: string | null;
288
288
  session_id: string | null;
289
289
  source_tool: string | null;
290
- client_id: string | null;
290
+ device_id: string | null;
291
291
  created_at: string;
292
292
  }
293
293
  export declare const EPISODE_STATUSES: readonly ["active", "archived", "promoted"];
@@ -453,6 +453,7 @@ export interface TopicSummary {
453
453
  activeInsights: number;
454
454
  activeModels: number;
455
455
  activeMemos: number;
456
+ activeFiles: number;
456
457
  };
457
458
  }
458
459
  export interface GroomingEpisodeRow extends EpisodeRow {
@@ -593,7 +594,6 @@ export interface UserMemoRow {
593
594
  store_name?: string;
594
595
  }
595
596
  export declare const StoreUserMemoSchema: z.ZodObject<{
596
- kind: z.ZodDefault<z.ZodEnum<["memo", "plan", "issue", "discussion"]>>;
597
597
  title: z.ZodString;
598
598
  l1_content: z.ZodString;
599
599
  usage_policy: z.ZodOptional<z.ZodEnum<["auto", "on_request", "human_directed"]>>;
@@ -602,9 +602,141 @@ export declare const StoreUserMemoSchema: z.ZodObject<{
602
602
  search_summary: z.ZodOptional<z.ZodString>;
603
603
  user_input: z.ZodOptional<z.ZodString>;
604
604
  source_tool: z.ZodOptional<z.ZodString>;
605
+ }, "strip", z.ZodTypeAny, {
606
+ scope: string;
607
+ tags: string[];
608
+ l1_content: string;
609
+ title: string;
610
+ search_summary?: string | undefined;
611
+ user_input?: string | undefined;
612
+ source_tool?: string | undefined;
613
+ usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
614
+ }, {
615
+ l1_content: string;
616
+ title: string;
617
+ scope?: string | undefined;
618
+ search_summary?: string | undefined;
619
+ user_input?: string | undefined;
620
+ tags?: string | string[] | undefined;
621
+ source_tool?: string | undefined;
622
+ usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
623
+ }>;
624
+ export declare const UpdateUserMemoSchema: z.ZodObject<{
625
+ id: z.ZodString;
626
+ title: z.ZodOptional<z.ZodString>;
627
+ l1_content: z.ZodOptional<z.ZodString>;
628
+ usage_policy: z.ZodOptional<z.ZodEnum<["auto", "on_request", "human_directed"]>>;
629
+ tags: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
630
+ scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
631
+ search_summary: z.ZodOptional<z.ZodString>;
632
+ status: z.ZodOptional<z.ZodEnum<["active", "archived"]>>;
633
+ reason: z.ZodString;
634
+ }, "strip", z.ZodTypeAny, {
635
+ id: string;
636
+ reason: string;
637
+ scope?: string | undefined;
638
+ search_summary?: string | undefined;
639
+ tags?: string[] | undefined;
640
+ status?: "active" | "archived" | undefined;
641
+ l1_content?: string | undefined;
642
+ title?: string | undefined;
643
+ usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
644
+ }, {
645
+ id: string;
646
+ reason: string;
647
+ scope?: string | undefined;
648
+ search_summary?: string | undefined;
649
+ tags?: string | string[] | undefined;
650
+ status?: "active" | "archived" | undefined;
651
+ l1_content?: string | undefined;
652
+ title?: string | undefined;
653
+ usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
654
+ }>;
655
+ export declare const StoreUserPlanSchema: z.ZodObject<{
656
+ title: z.ZodString;
657
+ l1_content: z.ZodString;
658
+ usage_policy: z.ZodOptional<z.ZodEnum<["auto", "on_request", "human_directed"]>>;
659
+ tags: z.ZodDefault<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
660
+ scope: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
661
+ search_summary: z.ZodOptional<z.ZodString>;
662
+ user_input: z.ZodOptional<z.ZodString>;
663
+ source_tool: z.ZodOptional<z.ZodString>;
664
+ }, "strip", z.ZodTypeAny, {
665
+ scope: string;
666
+ tags: string[];
667
+ l1_content: string;
668
+ title: string;
669
+ search_summary?: string | undefined;
670
+ user_input?: string | undefined;
671
+ source_tool?: string | undefined;
672
+ usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
673
+ }, {
674
+ l1_content: string;
675
+ title: string;
676
+ scope?: string | undefined;
677
+ search_summary?: string | undefined;
678
+ user_input?: string | undefined;
679
+ tags?: string | string[] | undefined;
680
+ source_tool?: string | undefined;
681
+ usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
682
+ }>;
683
+ export declare const UpdateUserPlanSchema: z.ZodObject<{
684
+ id: z.ZodString;
685
+ title: z.ZodOptional<z.ZodString>;
686
+ l1_content: z.ZodOptional<z.ZodString>;
687
+ usage_policy: z.ZodOptional<z.ZodEnum<["auto", "on_request", "human_directed"]>>;
688
+ tags: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
689
+ scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
690
+ search_summary: z.ZodOptional<z.ZodString>;
691
+ status: z.ZodOptional<z.ZodEnum<["active", "completed", "archived"]>>;
692
+ reason: z.ZodString;
693
+ }, "strip", z.ZodTypeAny, {
694
+ id: string;
695
+ reason: string;
696
+ scope?: string | undefined;
697
+ search_summary?: string | undefined;
698
+ tags?: string[] | undefined;
699
+ status?: "active" | "archived" | "completed" | undefined;
700
+ l1_content?: string | undefined;
701
+ title?: string | undefined;
702
+ usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
703
+ }, {
704
+ id: string;
705
+ reason: string;
706
+ scope?: string | undefined;
707
+ search_summary?: string | undefined;
708
+ tags?: string | string[] | undefined;
709
+ status?: "active" | "archived" | "completed" | undefined;
710
+ l1_content?: string | undefined;
711
+ title?: string | undefined;
712
+ usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
713
+ }>;
714
+ export declare const CheckUserPlanSchema: z.ZodObject<{
715
+ id: z.ZodString;
716
+ item: z.ZodOptional<z.ZodString>;
717
+ index: z.ZodOptional<z.ZodNumber>;
718
+ }, "strip", z.ZodTypeAny, {
719
+ id: string;
720
+ item?: string | undefined;
721
+ index?: number | undefined;
722
+ }, {
723
+ id: string;
724
+ item?: string | undefined;
725
+ index?: number | undefined;
726
+ }>;
727
+ export declare const StoreUserIssueSchema: z.ZodObject<{
728
+ title: z.ZodString;
729
+ l1_content: z.ZodString;
730
+ kind: z.ZodDefault<z.ZodEnum<["issue", "discussion"]>>;
605
731
  priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
732
+ usage_policy: z.ZodOptional<z.ZodEnum<["auto", "on_request", "human_directed"]>>;
733
+ tags: z.ZodDefault<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
734
+ scope: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
735
+ search_summary: z.ZodOptional<z.ZodString>;
736
+ user_input: z.ZodOptional<z.ZodString>;
737
+ source_tool: z.ZodOptional<z.ZodString>;
606
738
  }, "strip", z.ZodTypeAny, {
607
- kind: "memo" | "plan" | "issue" | "discussion";
739
+ kind: "issue" | "discussion";
608
740
  scope: string;
609
741
  tags: string[];
610
742
  l1_content: string;
@@ -617,7 +749,7 @@ export declare const StoreUserMemoSchema: z.ZodObject<{
617
749
  }, {
618
750
  l1_content: string;
619
751
  title: string;
620
- kind?: "memo" | "plan" | "issue" | "discussion" | undefined;
752
+ kind?: "issue" | "discussion" | undefined;
621
753
  scope?: string | undefined;
622
754
  search_summary?: string | undefined;
623
755
  user_input?: string | undefined;
@@ -626,40 +758,24 @@ export declare const StoreUserMemoSchema: z.ZodObject<{
626
758
  usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
627
759
  priority?: "low" | "medium" | "high" | "critical" | undefined;
628
760
  }>;
629
- export declare const UpdateUserMemoSchema: z.ZodObject<{
630
- kind: z.ZodDefault<z.ZodEnum<["memo", "plan", "issue", "discussion"]>>;
761
+ export declare const UpdateUserIssueSchema: z.ZodObject<{
631
762
  id: z.ZodString;
632
763
  title: z.ZodOptional<z.ZodString>;
633
764
  l1_content: z.ZodOptional<z.ZodString>;
765
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
634
766
  usage_policy: z.ZodOptional<z.ZodEnum<["auto", "on_request", "human_directed"]>>;
635
767
  tags: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
636
768
  scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
637
769
  search_summary: z.ZodOptional<z.ZodString>;
638
- status: z.ZodOptional<z.ZodString>;
770
+ status: z.ZodOptional<z.ZodEnum<["open", "closed", "archived"]>>;
639
771
  reason: z.ZodString;
640
- priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
641
- entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
642
- author: z.ZodString;
643
- content: z.ZodString;
644
- }, "strip", z.ZodTypeAny, {
645
- author: string;
646
- content: string;
647
- }, {
648
- author: string;
649
- content: string;
650
- }>, "many">>;
651
772
  }, "strip", z.ZodTypeAny, {
652
- kind: "memo" | "plan" | "issue" | "discussion";
653
773
  id: string;
654
774
  reason: string;
655
775
  scope?: string | undefined;
656
776
  search_summary?: string | undefined;
657
777
  tags?: string[] | undefined;
658
- entries?: {
659
- author: string;
660
- content: string;
661
- }[] | undefined;
662
- status?: string | undefined;
778
+ status?: "archived" | "open" | "closed" | undefined;
663
779
  l1_content?: string | undefined;
664
780
  title?: string | undefined;
665
781
  usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
@@ -667,20 +783,25 @@ export declare const UpdateUserMemoSchema: z.ZodObject<{
667
783
  }, {
668
784
  id: string;
669
785
  reason: string;
670
- kind?: "memo" | "plan" | "issue" | "discussion" | undefined;
671
786
  scope?: string | undefined;
672
787
  search_summary?: string | undefined;
673
788
  tags?: string | string[] | undefined;
674
- entries?: {
675
- author: string;
676
- content: string;
677
- }[] | undefined;
678
- status?: string | undefined;
789
+ status?: "archived" | "open" | "closed" | undefined;
679
790
  l1_content?: string | undefined;
680
791
  title?: string | undefined;
681
792
  usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
682
793
  priority?: "low" | "medium" | "high" | "critical" | undefined;
683
794
  }>;
795
+ export declare const CommentUserIssueSchema: z.ZodObject<{
796
+ id: z.ZodString;
797
+ comment: z.ZodString;
798
+ }, "strip", z.ZodTypeAny, {
799
+ id: string;
800
+ comment: string;
801
+ }, {
802
+ id: string;
803
+ comment: string;
804
+ }>;
684
805
  export type UserPlanStatus = typeof USER_PLAN_STATUSES[number];
685
806
  export interface UserPlanRow {
686
807
  id: string;
@@ -723,7 +844,205 @@ export interface UserIssueRow {
723
844
  updated_at: string;
724
845
  store_name?: string;
725
846
  }
726
- export declare const UNIFIED_ENTITY_TYPE_VALUES: readonly ["claim", "episode", "decision", "theory", "insight", "model", "user_memo", "user_plan", "user_issue"];
847
+ export type UserTopicStatus = typeof USER_TOPIC_STATUSES[number];
848
+ export type UserTopicPriority = typeof USER_TOPIC_PRIORITIES[number];
849
+ export interface UserTopicRow {
850
+ id: string;
851
+ title: string;
852
+ summary: string;
853
+ device_id: string | null;
854
+ cwd: string | null;
855
+ conversation_id: string | null;
856
+ priority: UserTopicPriority;
857
+ tags: string;
858
+ scope: string;
859
+ search_summary: string | null;
860
+ status: UserTopicStatus;
861
+ l1_embedding: Buffer | null;
862
+ client_name: string | null;
863
+ client_version: string | null;
864
+ source_tool: string | null;
865
+ created_at: string;
866
+ updated_at: string;
867
+ store_name?: string;
868
+ }
869
+ export declare const StoreUserTopicSchema: z.ZodObject<{
870
+ title: z.ZodString;
871
+ summary: z.ZodString;
872
+ conversation_id: z.ZodString;
873
+ cwd: z.ZodString;
874
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
875
+ tags: z.ZodDefault<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
876
+ scope: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
877
+ search_summary: z.ZodOptional<z.ZodString>;
878
+ }, "strip", z.ZodTypeAny, {
879
+ scope: string;
880
+ tags: string[];
881
+ title: string;
882
+ summary: string;
883
+ conversation_id: string;
884
+ cwd: string;
885
+ search_summary?: string | undefined;
886
+ priority?: "low" | "medium" | "high" | "critical" | undefined;
887
+ }, {
888
+ title: string;
889
+ summary: string;
890
+ conversation_id: string;
891
+ cwd: string;
892
+ scope?: string | undefined;
893
+ search_summary?: string | undefined;
894
+ tags?: string | string[] | undefined;
895
+ priority?: "low" | "medium" | "high" | "critical" | undefined;
896
+ }>;
897
+ export declare const UpdateUserTopicSchema: z.ZodObject<{
898
+ id: z.ZodString;
899
+ title: z.ZodOptional<z.ZodString>;
900
+ summary: z.ZodOptional<z.ZodString>;
901
+ conversation_id: z.ZodOptional<z.ZodString>;
902
+ cwd: z.ZodOptional<z.ZodString>;
903
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
904
+ tags: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
905
+ scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
906
+ search_summary: z.ZodOptional<z.ZodString>;
907
+ status: z.ZodOptional<z.ZodEnum<["active", "closed", "archived"]>>;
908
+ reason: z.ZodString;
909
+ }, "strip", z.ZodTypeAny, {
910
+ id: string;
911
+ reason: string;
912
+ scope?: string | undefined;
913
+ search_summary?: string | undefined;
914
+ tags?: string[] | undefined;
915
+ status?: "active" | "archived" | "closed" | undefined;
916
+ title?: string | undefined;
917
+ priority?: "low" | "medium" | "high" | "critical" | undefined;
918
+ summary?: string | undefined;
919
+ conversation_id?: string | undefined;
920
+ cwd?: string | undefined;
921
+ }, {
922
+ id: string;
923
+ reason: string;
924
+ scope?: string | undefined;
925
+ search_summary?: string | undefined;
926
+ tags?: string | string[] | undefined;
927
+ status?: "active" | "archived" | "closed" | undefined;
928
+ title?: string | undefined;
929
+ priority?: "low" | "medium" | "high" | "critical" | undefined;
930
+ summary?: string | undefined;
931
+ conversation_id?: string | undefined;
932
+ cwd?: string | undefined;
933
+ }>;
934
+ export type UserFileStatus = typeof USER_FILE_STATUSES[number];
935
+ export interface UserFileRow {
936
+ id: string;
937
+ title: string;
938
+ description: string | null;
939
+ original_filename: string;
940
+ original_encoding: string;
941
+ file_data: string;
942
+ file_hash: string;
943
+ file_size: number;
944
+ tags: string;
945
+ scope: string;
946
+ search_summary: string | null;
947
+ status: UserFileStatus;
948
+ l1_embedding: Buffer | null;
949
+ client_name: string | null;
950
+ client_version: string | null;
951
+ source_tool: string | null;
952
+ created_at: string;
953
+ updated_at: string;
954
+ store_name?: string;
955
+ }
956
+ export declare const StoreUserFileSchema: z.ZodObject<{
957
+ source_path: z.ZodString;
958
+ title: z.ZodString;
959
+ description: z.ZodOptional<z.ZodString>;
960
+ original_encoding: z.ZodDefault<z.ZodString>;
961
+ tags: z.ZodDefault<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
962
+ scope: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
963
+ search_summary: z.ZodOptional<z.ZodString>;
964
+ }, "strip", z.ZodTypeAny, {
965
+ scope: string;
966
+ tags: string[];
967
+ title: string;
968
+ source_path: string;
969
+ original_encoding: string;
970
+ search_summary?: string | undefined;
971
+ description?: string | undefined;
972
+ }, {
973
+ title: string;
974
+ source_path: string;
975
+ scope?: string | undefined;
976
+ search_summary?: string | undefined;
977
+ tags?: string | string[] | undefined;
978
+ description?: string | undefined;
979
+ original_encoding?: string | undefined;
980
+ }>;
981
+ export declare const RestoreUserFileSchema: z.ZodObject<{
982
+ id: z.ZodOptional<z.ZodString>;
983
+ title: z.ZodOptional<z.ZodString>;
984
+ dest_path: z.ZodString;
985
+ overwrite: z.ZodDefault<z.ZodBoolean>;
986
+ dry_run: z.ZodDefault<z.ZodBoolean>;
987
+ }, "strip", z.ZodTypeAny, {
988
+ dest_path: string;
989
+ overwrite: boolean;
990
+ dry_run: boolean;
991
+ id?: string | undefined;
992
+ title?: string | undefined;
993
+ }, {
994
+ dest_path: string;
995
+ id?: string | undefined;
996
+ title?: string | undefined;
997
+ overwrite?: boolean | undefined;
998
+ dry_run?: boolean | undefined;
999
+ }>;
1000
+ export declare const UpdateUserFileSchema: z.ZodObject<{
1001
+ id: z.ZodString;
1002
+ source_path: z.ZodOptional<z.ZodString>;
1003
+ title: z.ZodOptional<z.ZodString>;
1004
+ description: z.ZodOptional<z.ZodString>;
1005
+ tags: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
1006
+ scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1007
+ search_summary: z.ZodOptional<z.ZodString>;
1008
+ status: z.ZodOptional<z.ZodEnum<["active", "archived"]>>;
1009
+ reason: z.ZodString;
1010
+ }, "strip", z.ZodTypeAny, {
1011
+ id: string;
1012
+ reason: string;
1013
+ scope?: string | undefined;
1014
+ search_summary?: string | undefined;
1015
+ tags?: string[] | undefined;
1016
+ status?: "active" | "archived" | undefined;
1017
+ title?: string | undefined;
1018
+ description?: string | undefined;
1019
+ source_path?: string | undefined;
1020
+ }, {
1021
+ id: string;
1022
+ reason: string;
1023
+ scope?: string | undefined;
1024
+ search_summary?: string | undefined;
1025
+ tags?: string | string[] | undefined;
1026
+ status?: "active" | "archived" | undefined;
1027
+ title?: string | undefined;
1028
+ description?: string | undefined;
1029
+ source_path?: string | undefined;
1030
+ }>;
1031
+ export declare const ListUserFilesSchema: z.ZodObject<{
1032
+ scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1033
+ tags: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>>;
1034
+ status: z.ZodDefault<z.ZodEnum<["active", "archived"]>>;
1035
+ }, "strip", z.ZodTypeAny, {
1036
+ status: "active" | "archived";
1037
+ scope?: string | undefined;
1038
+ tags?: string[] | undefined;
1039
+ }, {
1040
+ scope?: string | undefined;
1041
+ tags?: string | string[] | undefined;
1042
+ status?: "active" | "archived" | undefined;
1043
+ }>;
1044
+ export declare const UNIFIED_ENTITY_TYPE_VALUES: readonly ["claim", "episode", "decision", "theory", "insight", "model", "user_memo", "user_plan", "user_issue", "user_topic", "user_file"];
1045
+ export declare const DEFAULT_SEARCH_ENTITY_TYPES: readonly UnifiedEntityType[];
727
1046
  export type UnifiedEntityType = typeof UNIFIED_ENTITY_TYPE_VALUES[number];
728
1047
  export interface UnifiedSearchRow {
729
1048
  entity_type: UnifiedEntityType;
@@ -743,11 +1062,12 @@ export interface UnifiedSearchRow {
743
1062
  export declare const UnifiedSearchSchema: z.ZodObject<{
744
1063
  query: z.ZodOptional<z.ZodString>;
745
1064
  scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
746
- entity_types: z.ZodOptional<z.ZodArray<z.ZodEnum<["claim", "episode", "decision", "theory", "insight", "model", "user_memo", "user_plan", "user_issue"]>, "many">>;
1065
+ entity_types: z.ZodOptional<z.ZodArray<z.ZodEnum<["claim", "episode", "decision", "theory", "insight", "model", "user_memo", "user_plan", "user_issue", "user_topic", "user_file"]>, "many">>;
747
1066
  status: z.ZodOptional<z.ZodString>;
748
1067
  tag: z.ZodOptional<z.ZodString>;
749
1068
  category: z.ZodOptional<z.ZodEnum<["preference", "identity", "skill", "value", "workflow", "knowledge", "custom"]>>;
750
1069
  usage_policy: z.ZodOptional<z.ZodEnum<["auto", "on_request", "human_directed"]>>;
1070
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
751
1071
  limit: z.ZodDefault<z.ZodNumber>;
752
1072
  }, "strip", z.ZodTypeAny, {
753
1073
  limit: number;
@@ -755,31 +1075,33 @@ export declare const UnifiedSearchSchema: z.ZodObject<{
755
1075
  status?: string | undefined;
756
1076
  category?: "preference" | "identity" | "skill" | "value" | "workflow" | "knowledge" | "custom" | undefined;
757
1077
  usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
1078
+ priority?: "low" | "medium" | "high" | "critical" | undefined;
758
1079
  query?: string | undefined;
759
- entity_types?: ("claim" | "episode" | "decision" | "theory" | "insight" | "model" | "user_memo" | "user_plan" | "user_issue")[] | undefined;
1080
+ entity_types?: ("theory" | "insight" | "model" | "claim" | "episode" | "decision" | "user_memo" | "user_plan" | "user_issue" | "user_topic" | "user_file")[] | undefined;
760
1081
  tag?: string | undefined;
761
1082
  }, {
762
1083
  scope?: string | undefined;
763
1084
  status?: string | undefined;
764
1085
  category?: "preference" | "identity" | "skill" | "value" | "workflow" | "knowledge" | "custom" | undefined;
765
1086
  usage_policy?: "auto" | "on_request" | "human_directed" | undefined;
1087
+ priority?: "low" | "medium" | "high" | "critical" | undefined;
766
1088
  query?: string | undefined;
767
- entity_types?: ("claim" | "episode" | "decision" | "theory" | "insight" | "model" | "user_memo" | "user_plan" | "user_issue")[] | undefined;
1089
+ entity_types?: ("theory" | "insight" | "model" | "claim" | "episode" | "decision" | "user_memo" | "user_plan" | "user_issue" | "user_topic" | "user_file")[] | undefined;
768
1090
  tag?: string | undefined;
769
1091
  limit?: number | undefined;
770
1092
  }>;
771
1093
  export declare const GetEntitySchema: z.ZodObject<{
772
- entity_type: z.ZodOptional<z.ZodEnum<["claim", "episode", "decision", "theory", "insight", "model", "user_memo", "user_plan", "user_issue", "profile"]>>;
1094
+ entity_type: z.ZodOptional<z.ZodEnum<["claim", "episode", "decision", "theory", "insight", "model", "user_memo", "user_plan", "user_issue", "user_topic", "profile"]>>;
773
1095
  id: z.ZodOptional<z.ZodString>;
774
1096
  scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
775
1097
  }, "strip", z.ZodTypeAny, {
776
1098
  scope?: string | undefined;
777
1099
  id?: string | undefined;
778
- entity_type?: "claim" | "episode" | "decision" | "theory" | "insight" | "model" | "user_memo" | "user_plan" | "user_issue" | "profile" | undefined;
1100
+ entity_type?: "theory" | "insight" | "model" | "claim" | "episode" | "decision" | "user_memo" | "user_plan" | "user_issue" | "user_topic" | "profile" | undefined;
779
1101
  }, {
780
1102
  scope?: string | undefined;
781
1103
  id?: string | undefined;
782
- entity_type?: "claim" | "episode" | "decision" | "theory" | "insight" | "model" | "user_memo" | "user_plan" | "user_issue" | "profile" | undefined;
1104
+ entity_type?: "theory" | "insight" | "model" | "claim" | "episode" | "decision" | "user_memo" | "user_plan" | "user_issue" | "user_topic" | "profile" | undefined;
783
1105
  }>;
784
1106
  export declare const StoreKnowledgeSchema: z.ZodObject<{
785
1107
  kind: z.ZodEnum<["theory", "insight", "model"]>;
@@ -849,7 +1171,7 @@ export declare const MaintainSchema: z.ZodObject<{
849
1171
  older_than_days: z.ZodDefault<z.ZodNumber>;
850
1172
  tables: z.ZodDefault<z.ZodArray<z.ZodEnum<["audit_log", "claim_history"]>, "many">>;
851
1173
  dry_run: z.ZodDefault<z.ZodBoolean>;
852
- entity_type: z.ZodOptional<z.ZodEnum<["claim", "decision", "episode", "theory", "insight", "model", "user_memo", "user_plan", "user_issue"]>>;
1174
+ entity_type: z.ZodOptional<z.ZodEnum<["claim", "decision", "episode", "theory", "insight", "model", "user_memo", "user_plan", "user_issue", "user_topic"]>>;
853
1175
  batch_size: z.ZodDefault<z.ZodNumber>;
854
1176
  scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
855
1177
  category: z.ZodOptional<z.ZodEnum<["preference", "identity", "skill", "value", "workflow", "knowledge", "custom"]>>;
@@ -872,17 +1194,17 @@ export declare const MaintainSchema: z.ZodObject<{
872
1194
  search_summary_entity_id: z.ZodOptional<z.ZodString>;
873
1195
  search_summary: z.ZodOptional<z.ZodString>;
874
1196
  delete_entity_id: z.ZodOptional<z.ZodString>;
875
- delete_entity_type: z.ZodOptional<z.ZodEnum<["claim", "decision", "episode", "theory", "insight", "model", "user_memo", "user_plan", "user_issue"]>>;
1197
+ delete_entity_type: z.ZodOptional<z.ZodEnum<["claim", "decision", "episode", "theory", "insight", "model", "user_memo", "user_plan", "user_issue", "user_topic"]>>;
876
1198
  delete_reason: z.ZodOptional<z.ZodString>;
877
1199
  limit: z.ZodDefault<z.ZodNumber>;
878
1200
  }, "strip", z.ZodTypeAny, {
1201
+ dry_run: boolean;
879
1202
  limit: number;
880
1203
  action: "promote" | "stats" | "archive_logs" | "backfill_embeddings" | "groom_claims" | "groom_episodes" | "mark_groomed" | "review_stale" | "check_retraction_impact" | "archive_episodes" | "archive_decisions" | "backup" | "export_json" | "list_stores" | "switch_context" | "sync_status" | "update_search_summary" | "delete";
881
1204
  vacuum: boolean;
882
1205
  optimize: boolean;
883
1206
  older_than_days: number;
884
1207
  tables: ("audit_log" | "claim_history")[];
885
- dry_run: boolean;
886
1208
  batch_size: number;
887
1209
  include_groomed: boolean;
888
1210
  max_depth: number;
@@ -893,11 +1215,11 @@ export declare const MaintainSchema: z.ZodObject<{
893
1215
  category?: "preference" | "identity" | "skill" | "value" | "workflow" | "knowledge" | "custom" | undefined;
894
1216
  claim_id?: string | undefined;
895
1217
  tag?: string | undefined;
896
- entity_type?: "claim" | "episode" | "decision" | "theory" | "insight" | "model" | "user_memo" | "user_plan" | "user_issue" | undefined;
1218
+ entity_type?: "theory" | "insight" | "model" | "claim" | "episode" | "decision" | "user_memo" | "user_plan" | "user_issue" | "user_topic" | undefined;
897
1219
  episode_ids?: string[] | undefined;
898
1220
  archive_entity_ids?: string[] | undefined;
899
1221
  archive_keep_latest?: number | undefined;
900
- promote_entity_type?: "claim" | "episode" | "decision" | "theory" | "insight" | "model" | undefined;
1222
+ promote_entity_type?: "theory" | "insight" | "model" | "claim" | "episode" | "decision" | undefined;
901
1223
  promote_entity_id?: string | undefined;
902
1224
  source_store?: string | undefined;
903
1225
  target_store?: string | undefined;
@@ -906,7 +1228,7 @@ export declare const MaintainSchema: z.ZodObject<{
906
1228
  store_name?: string | undefined;
907
1229
  search_summary_entity_id?: string | undefined;
908
1230
  delete_entity_id?: string | undefined;
909
- delete_entity_type?: "claim" | "episode" | "decision" | "theory" | "insight" | "model" | "user_memo" | "user_plan" | "user_issue" | undefined;
1231
+ delete_entity_type?: "theory" | "insight" | "model" | "claim" | "episode" | "decision" | "user_memo" | "user_plan" | "user_issue" | "user_topic" | undefined;
910
1232
  delete_reason?: string | undefined;
911
1233
  }, {
912
1234
  action: "promote" | "stats" | "archive_logs" | "backfill_embeddings" | "groom_claims" | "groom_episodes" | "mark_groomed" | "review_stale" | "check_retraction_impact" | "archive_episodes" | "archive_decisions" | "backup" | "export_json" | "list_stores" | "switch_context" | "sync_status" | "update_search_summary" | "delete";
@@ -915,14 +1237,14 @@ export declare const MaintainSchema: z.ZodObject<{
915
1237
  destination?: string | undefined;
916
1238
  category?: "preference" | "identity" | "skill" | "value" | "workflow" | "knowledge" | "custom" | undefined;
917
1239
  claim_id?: string | undefined;
1240
+ dry_run?: boolean | undefined;
918
1241
  tag?: string | undefined;
919
1242
  limit?: number | undefined;
920
- entity_type?: "claim" | "episode" | "decision" | "theory" | "insight" | "model" | "user_memo" | "user_plan" | "user_issue" | undefined;
1243
+ entity_type?: "theory" | "insight" | "model" | "claim" | "episode" | "decision" | "user_memo" | "user_plan" | "user_issue" | "user_topic" | undefined;
921
1244
  vacuum?: boolean | undefined;
922
1245
  optimize?: boolean | undefined;
923
1246
  older_than_days?: number | undefined;
924
1247
  tables?: ("audit_log" | "claim_history")[] | undefined;
925
- dry_run?: boolean | undefined;
926
1248
  batch_size?: number | undefined;
927
1249
  include_groomed?: boolean | undefined;
928
1250
  episode_ids?: string[] | undefined;
@@ -930,7 +1252,7 @@ export declare const MaintainSchema: z.ZodObject<{
930
1252
  archive_keep_latest?: number | undefined;
931
1253
  max_depth?: number | undefined;
932
1254
  include_retracted?: boolean | undefined;
933
- promote_entity_type?: "claim" | "episode" | "decision" | "theory" | "insight" | "model" | undefined;
1255
+ promote_entity_type?: "theory" | "insight" | "model" | "claim" | "episode" | "decision" | undefined;
934
1256
  promote_entity_id?: string | undefined;
935
1257
  source_store?: string | undefined;
936
1258
  target_store?: string | undefined;
@@ -939,7 +1261,7 @@ export declare const MaintainSchema: z.ZodObject<{
939
1261
  store_name?: string | undefined;
940
1262
  search_summary_entity_id?: string | undefined;
941
1263
  delete_entity_id?: string | undefined;
942
- delete_entity_type?: "claim" | "episode" | "decision" | "theory" | "insight" | "model" | "user_memo" | "user_plan" | "user_issue" | undefined;
1264
+ delete_entity_type?: "theory" | "insight" | "model" | "claim" | "episode" | "decision" | "user_memo" | "user_plan" | "user_issue" | "user_topic" | undefined;
943
1265
  delete_reason?: string | undefined;
944
1266
  }>;
945
1267
  export declare const ManageClaimSchema: z.ZodObject<{