@fortemi/core 2026.7.8 → 2026.7.9

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
@@ -458,6 +458,11 @@ interface BlobStore {
458
458
  read(checksum: string): Promise<Uint8Array | null>;
459
459
  /** True when the bytes for this checksum are physically present. */
460
460
  has(checksum: string): Promise<boolean>;
461
+ /**
462
+ * Physically remove one checksum. Import staging uses this only to roll back
463
+ * content that was absent before promotion.
464
+ */
465
+ delete?(checksum: string): Promise<boolean>;
461
466
  /**
462
467
  * Reconcile stored bytes against the authoritative live-checksum set
463
468
  * derived from canonical attachment manifests (ADR-013 D4).
@@ -476,6 +481,7 @@ declare class MemoryBlobStore implements BlobStore {
476
481
  put(bytes: Uint8Array): Promise<string>;
477
482
  read(checksum: string): Promise<Uint8Array | null>;
478
483
  has(checksum: string): Promise<boolean>;
484
+ delete(checksum: string): Promise<boolean>;
479
485
  reconcile(liveChecksums: Iterable<string>, opts?: BlobReconcileOptions): Promise<BlobReconcileResult>;
480
486
  gc(opts?: BlobGcOptions): Promise<BlobGcResult>;
481
487
  diagnostics(): Promise<BlobStoreDiagnostics>;
@@ -624,12 +630,55 @@ declare function signShard(input: SignShardInput): Promise<Uint8Array>;
624
630
  *
625
631
  * A shard is a gzip-compressed tar archive (.shard) containing serialized
626
632
  * knowledge data with a manifest for integrity verification.
633
+ *
634
+ * @implements @.aiwg/adrs/ADR-011-shard-server-conformance-and-version-negotiation.md
635
+ * @schema @packages/core/schemas/knowledge-shard.schema.receipt.json
636
+ * @created 2026-07-17
637
+ * @agent Codex
627
638
  */
628
639
 
629
- declare const CURRENT_SHARD_VERSION = "1.0.0";
640
+ declare const CURRENT_SHARD_VERSION = "1.2.0";
630
641
  declare const SHARD_FORMAT = "matric-shard";
631
642
  /** Components that can appear in a shard archive. */
632
- type ShardComponent = 'notes' | 'collections' | 'tags' | 'templates' | 'links' | 'embedding_sets' | 'embedding_configs' | 'embedding_set_members' | 'embeddings' | 'skos_schemes' | 'skos_concepts' | 'skos_relations' | 'note_skos_tags' | 'provenance_edges' | 'community_assignments' | 'communities' | 'graph_edges' | 'graph_sources';
643
+ type ShardComponent = 'notes' | 'collections' | 'tags' | 'templates' | 'links' | 'note_originals' | 'note_original_history' | 'note_revised_current' | 'note_revisions' | 'embedding_sets' | 'embedding_configs' | 'embedding_set_members' | 'embeddings' | 'provenance_activities' | 'named_locations' | 'provenance_locations' | 'provenance_devices' | 'provenance_records' | 'skos_schemes' | 'skos_concepts' | 'skos_labels' | 'skos_notes' | 'skos_relations' | 'skos_mapping_relations' | 'skos_scheme_memberships' | 'note_skos_tags' | 'skos_collections' | 'skos_collection_members' | 'provenance_edges' | 'community_assignments' | 'communities' | 'graph_edges' | 'graph_sources';
644
+ type KnowledgeShardProfile = 'core-v1' | 'full-v1' | 'record-v1';
645
+ type ShardBackend = 'pglite' | 'record-store';
646
+ type ShardOperation = 'export' | 'import';
647
+ type ShardAuthorityStatus = 'supported' | 'candidate' | 'reserved' | 'unknown' | 'unprofiled';
648
+ interface ShardProfileRegistryEntry {
649
+ profile: KnowledgeShardProfile;
650
+ authority_status: 'supported' | 'candidate' | 'reserved';
651
+ components: ShardComponent[];
652
+ }
653
+ interface ShardLossEntry {
654
+ code: string;
655
+ message: string;
656
+ component?: ShardComponent;
657
+ count?: number;
658
+ }
659
+ interface ShardCapabilityReport {
660
+ schema_version: 'fortemi.shard.capability-report.v1';
661
+ backend: ShardBackend;
662
+ operation: ShardOperation;
663
+ requested_profile: string | null;
664
+ authority_status: ShardAuthorityStatus;
665
+ backend_supported: boolean;
666
+ portable: boolean;
667
+ authority: {
668
+ repository: string;
669
+ commit: string;
670
+ contract_sha256: string;
671
+ contract_revision: string;
672
+ schema_version: string;
673
+ schema_bundle_sha256: string;
674
+ };
675
+ advertised_profiles: KnowledgeShardProfile[];
676
+ supported_components: ShardComponent[];
677
+ declared_components: ShardComponent[];
678
+ unsupported_components: ShardComponent[];
679
+ omitted_components: ShardComponent[];
680
+ losses: ShardLossEntry[];
681
+ }
633
682
  interface ShardAttachmentReference {
634
683
  id: string;
635
684
  path: string;
@@ -639,6 +688,12 @@ interface ShardAttachmentReference {
639
688
  }
640
689
  interface ShardAttachmentProjection {
641
690
  extracted_text: string | null;
691
+ /** Legacy unprofiled relationship timestamp; outside core-v1. */
692
+ created_at?: string;
693
+ /** Legacy unprofiled attachment tombstone; outside core-v1. */
694
+ deleted_at?: string | null;
695
+ extraction_status?: 'extracted' | 'pending' | 'failed' | 'blocked' | 'deferred';
696
+ reason?: null | 'extraction_pending' | 'extractor_failed' | 'quarantined' | 'large_binary' | 'unsupported_mime' | 'no_extracted_text';
642
697
  attachment: ShardAttachmentReference;
643
698
  }
644
699
  /** @deprecated Legacy React shard field name. Server shards use `attachments`. */
@@ -669,9 +724,19 @@ interface ShardMigrationHistoryEntry {
669
724
  changes: string[];
670
725
  }
671
726
  /** Manifest included in every shard as manifest.json. */
727
+ interface ShardProducer {
728
+ name: string;
729
+ version: string;
730
+ revision?: string;
731
+ }
672
732
  interface ShardManifest {
673
733
  version: string;
674
- matric_version: string;
734
+ /** Named server-owned portability profile. Required for canonical interchange. */
735
+ profile?: string;
736
+ /** Structured producer identity used by canonical profiles. */
737
+ producer?: ShardProducer;
738
+ /** @deprecated Legacy producer release field. */
739
+ matric_version?: string;
675
740
  format: typeof SHARD_FORMAT;
676
741
  created_at: string;
677
742
  components: ShardComponent[];
@@ -685,6 +750,11 @@ interface ShardManifest {
685
750
  }
686
751
  /** Options for shard export. */
687
752
  interface ExportOptions {
753
+ /**
754
+ * Explicit portability profile. Only profiles advertised by the selected
755
+ * producer are accepted. Omit to retain the legacy unprofiled React archive.
756
+ */
757
+ profile?: string;
688
758
  includeEmbeddings?: boolean;
689
759
  /** Filter to specific collection (export only notes in this collection). */
690
760
  collectionId?: string;
@@ -728,9 +798,10 @@ interface ImportOptions {
728
798
  /**
729
799
  * Destination for hydrating attachment bytes from a portable `blobs/<hex>`
730
800
  * sidecar (Fortemi/fortemi#1046). When provided, sidecar entries whose bare
731
- * hex matches an imported attachment's `content_hash` are written to this
732
- * store after the import transaction commits, so `getBlob()` returns real
733
- * bytes. Absent attachments import as reference-only metadata (unchanged).
801
+ * hex matches an imported attachment's `content_hash` are promoted before
802
+ * the logical transaction. A transaction failure removes only bytes that
803
+ * were absent before promotion. Stores without the optional `delete`
804
+ * capability fail before promotion. Absent → reference-only metadata.
734
805
  */
735
806
  blobStore?: BlobStore;
736
807
  /**
@@ -783,6 +854,13 @@ interface ImportResult {
783
854
  warnings: string[];
784
855
  errors: string[];
785
856
  duration_ms: number;
857
+ capability_report: ShardCapabilityReport;
858
+ }
859
+ interface ShardExportResult {
860
+ success: boolean;
861
+ archive: Uint8Array | null;
862
+ errors: string[];
863
+ capability_report: ShardCapabilityReport;
786
864
  }
787
865
  /** Note as serialized in the shard JSONL. */
788
866
  interface ShardNote {
@@ -802,7 +880,8 @@ interface ShardNote {
802
880
  tags: string[];
803
881
  created_at: string;
804
882
  updated_at: string;
805
- deleted_at: string | null;
883
+ /** Schema 1.1 core-v1 tombstone; legacy unprofiled archives also carry it. */
884
+ deleted_at?: string | null;
806
885
  }
807
886
  /** Collection as serialized in the shard JSON array. */
808
887
  interface ShardCollection {
@@ -811,6 +890,9 @@ interface ShardCollection {
811
890
  description: string | null;
812
891
  parent_id: string | null;
813
892
  created_at: string;
893
+ /** Legacy unprofiled fields; outside core-v1. */
894
+ updated_at?: string;
895
+ deleted_at?: string | null;
814
896
  note_count?: number;
815
897
  }
816
898
  /** Tag as serialized in the shard JSON array. */
@@ -980,6 +1062,11 @@ interface ShardArtifactFreshness {
980
1062
  *
981
1063
  * The browser uses different field names than the server shard format.
982
1064
  * This module handles all rename transforms bidirectionally.
1065
+ *
1066
+ * @implements @.aiwg/adrs/ADR-011-shard-server-conformance-and-version-negotiation.md
1067
+ * @schema @packages/core/schemas/knowledge-shard.schema.receipt.json
1068
+ * @created 2026-07-17
1069
+ * @agent Codex
983
1070
  */
984
1071
 
985
1072
  /** Browser-format note row from the export query (denormalized). */
@@ -1012,6 +1099,8 @@ declare function linkToShard(link: {
1012
1099
  link_type: string;
1013
1100
  confidence: number | null;
1014
1101
  created_at: Date | string;
1102
+ updated_at?: Date | string | null;
1103
+ deleted_at?: Date | string | null;
1015
1104
  }): ShardLink;
1016
1105
  /** Convert a browser URL-target link row to shard format. */
1017
1106
  declare function urlLinkToShard(link: {
@@ -1022,6 +1111,8 @@ declare function urlLinkToShard(link: {
1022
1111
  confidence: number | null;
1023
1112
  metadata_json?: Record<string, unknown> | string | null;
1024
1113
  created_at: Date | string;
1114
+ updated_at?: Date | string | null;
1115
+ deleted_at?: Date | string | null;
1025
1116
  }): ShardLink;
1026
1117
  /** Convert a shard link back to browser-insertable format. */
1027
1118
  declare function linkFromShard(shard: ShardLink): {
@@ -1032,6 +1123,8 @@ declare function linkFromShard(shard: ShardLink): {
1032
1123
  link_type: string;
1033
1124
  confidence: number | null;
1034
1125
  created_at: string;
1126
+ updated_at: string | null;
1127
+ deleted_at: string | null;
1035
1128
  metadata: Record<string, unknown> | null;
1036
1129
  };
1037
1130
  /** Convert a browser collection to shard format (accepts SQL rows or canonical ISO-string records). */
@@ -1041,6 +1134,8 @@ declare function collectionToShard(collection: {
1041
1134
  description: string | null;
1042
1135
  parent_id: string | null;
1043
1136
  created_at: Date | string;
1137
+ updated_at?: Date | string;
1138
+ deleted_at?: Date | string | null;
1044
1139
  }, noteCount?: number): ShardCollection;
1045
1140
  /** Convert a shard collection back to browser-insertable format. */
1046
1141
  declare function collectionFromShard(shard: ShardCollection): {
@@ -1049,6 +1144,8 @@ declare function collectionFromShard(shard: ShardCollection): {
1049
1144
  description: string | null;
1050
1145
  parent_id: string | null;
1051
1146
  created_at: string;
1147
+ updated_at: string;
1148
+ deleted_at: string | null;
1052
1149
  };
1053
1150
  /**
1054
1151
  * Convert SKOS concepts + note_tag associations into shard flat tag format.
@@ -2884,19 +2981,19 @@ declare const CaptureKnowledgeInputSchema: z.ZodObject<{
2884
2981
  }, {
2885
2982
  content: string;
2886
2983
  title?: string | undefined;
2887
- tags?: string[] | undefined;
2888
2984
  format?: "markdown" | "plain" | "html" | undefined;
2985
+ tags?: string[] | undefined;
2889
2986
  }>, "many">>;
2890
2987
  template: z.ZodOptional<z.ZodString>;
2891
2988
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2892
2989
  }, "strip", z.ZodTypeAny, {
2893
2990
  source: string;
2894
2991
  format: "markdown" | "plain" | "html";
2895
- visibility: "private" | "public" | "shared";
2992
+ visibility: "private" | "shared" | "public";
2896
2993
  action: "create" | "bulk_create" | "from_template";
2897
2994
  title?: string | undefined;
2898
- tags?: string[] | undefined;
2899
2995
  archive_id?: string | undefined;
2996
+ tags?: string[] | undefined;
2900
2997
  content?: string | undefined;
2901
2998
  notes?: {
2902
2999
  format: "markdown" | "plain" | "html";
@@ -2910,16 +3007,16 @@ declare const CaptureKnowledgeInputSchema: z.ZodObject<{
2910
3007
  action: "create" | "bulk_create" | "from_template";
2911
3008
  source?: string | undefined;
2912
3009
  title?: string | undefined;
2913
- tags?: string[] | undefined;
2914
- format?: "markdown" | "plain" | "html" | undefined;
2915
3010
  archive_id?: string | undefined;
2916
- visibility?: "private" | "public" | "shared" | undefined;
3011
+ format?: "markdown" | "plain" | "html" | undefined;
3012
+ visibility?: "private" | "shared" | "public" | undefined;
3013
+ tags?: string[] | undefined;
2917
3014
  content?: string | undefined;
2918
3015
  notes?: {
2919
3016
  content: string;
2920
3017
  title?: string | undefined;
2921
- tags?: string[] | undefined;
2922
3018
  format?: "markdown" | "plain" | "html" | undefined;
3019
+ tags?: string[] | undefined;
2923
3020
  }[] | undefined;
2924
3021
  template?: string | undefined;
2925
3022
  variables?: Record<string, string> | undefined;
@@ -2969,14 +3066,14 @@ declare const SearchInputSchema: z.ZodObject<{
2969
3066
  limit: number;
2970
3067
  offset: number;
2971
3068
  include_facets: boolean;
2972
- mode: "text" | "auto" | "semantic" | "hybrid";
3069
+ mode: "auto" | "text" | "semantic" | "hybrid";
2973
3070
  query: string;
2974
3071
  source?: string | undefined;
2975
- tags?: string[] | undefined;
2976
3072
  format?: "markdown" | "plain" | "html" | undefined;
2977
- visibility?: "private" | "public" | "shared" | undefined;
3073
+ visibility?: "private" | "shared" | "public" | undefined;
2978
3074
  is_starred?: boolean | undefined;
2979
3075
  is_archived?: boolean | undefined;
3076
+ tags?: string[] | undefined;
2980
3077
  collection_id?: string | undefined;
2981
3078
  date_from?: Date | undefined;
2982
3079
  date_to?: Date | undefined;
@@ -2985,18 +3082,18 @@ declare const SearchInputSchema: z.ZodObject<{
2985
3082
  }, {
2986
3083
  query: string;
2987
3084
  source?: string | undefined;
2988
- tags?: string[] | undefined;
2989
3085
  format?: "markdown" | "plain" | "html" | undefined;
2990
- visibility?: "private" | "public" | "shared" | undefined;
3086
+ visibility?: "private" | "shared" | "public" | undefined;
2991
3087
  is_starred?: boolean | undefined;
2992
3088
  is_archived?: boolean | undefined;
3089
+ tags?: string[] | undefined;
2993
3090
  limit?: number | undefined;
2994
3091
  offset?: number | undefined;
2995
3092
  collection_id?: string | undefined;
2996
3093
  date_from?: Date | undefined;
2997
3094
  date_to?: Date | undefined;
2998
3095
  include_facets?: boolean | undefined;
2999
- mode?: "text" | "auto" | "semantic" | "hybrid" | undefined;
3096
+ mode?: "auto" | "text" | "semantic" | "hybrid" | undefined;
3000
3097
  embeddingSetId?: string | undefined;
3001
3098
  query_embedding?: number[] | undefined;
3002
3099
  }>;
@@ -3076,20 +3173,20 @@ declare const ListNotesInputSchema: z.ZodObject<{
3076
3173
  collection_id: z.ZodOptional<z.ZodString>;
3077
3174
  include_deleted: z.ZodOptional<z.ZodBoolean>;
3078
3175
  }, "strip", z.ZodTypeAny, {
3079
- sort: "updated_at" | "title" | "created_at";
3176
+ sort: "created_at" | "updated_at" | "title";
3080
3177
  limit: number;
3081
3178
  offset: number;
3082
3179
  order: "asc" | "desc";
3083
- tags?: string[] | undefined;
3084
3180
  is_starred?: boolean | undefined;
3085
3181
  is_archived?: boolean | undefined;
3182
+ tags?: string[] | undefined;
3086
3183
  include_deleted?: boolean | undefined;
3087
3184
  collection_id?: string | undefined;
3088
3185
  }, {
3089
- tags?: string[] | undefined;
3090
- sort?: "updated_at" | "title" | "created_at" | undefined;
3186
+ sort?: "created_at" | "updated_at" | "title" | undefined;
3091
3187
  is_starred?: boolean | undefined;
3092
3188
  is_archived?: boolean | undefined;
3189
+ tags?: string[] | undefined;
3093
3190
  limit?: number | undefined;
3094
3191
  offset?: number | undefined;
3095
3192
  order?: "asc" | "desc" | undefined;
@@ -3132,16 +3229,16 @@ declare const ManageCollectionsInputSchema: z.ZodObject<{
3132
3229
  note_id: z.ZodOptional<z.ZodString>;
3133
3230
  }, "strip", z.ZodTypeAny, {
3134
3231
  action: "create" | "delete" | "list" | "assign" | "unassign" | "list_tree";
3135
- name?: string | undefined;
3136
3232
  collection_id?: string | undefined;
3137
3233
  note_id?: string | undefined;
3234
+ name?: string | undefined;
3138
3235
  description?: string | undefined;
3139
3236
  parent_id?: string | undefined;
3140
3237
  }, {
3141
3238
  action: "create" | "delete" | "list" | "assign" | "unassign" | "list_tree";
3142
- name?: string | undefined;
3143
3239
  collection_id?: string | undefined;
3144
3240
  note_id?: string | undefined;
3241
+ name?: string | undefined;
3145
3242
  description?: string | undefined;
3146
3243
  parent_id?: string | undefined;
3147
3244
  }>;
@@ -4104,6 +4201,28 @@ declare function appendPluginScript(descriptor: PluginScriptDescriptor, policy:
4104
4201
  declare function parseCspReport(body: unknown): CspViolationReport;
4105
4202
  declare function createCspReportHandler(onReport: (report: CspViolationReport) => void | Promise<void>): (request: Request) => Promise<Response>;
4106
4203
 
4204
+ /**
4205
+ * Knowledge Shard portability profiles derived from the pinned Fortemi receipt.
4206
+ *
4207
+ * @implements @.aiwg/adrs/ADR-011-shard-server-conformance-and-version-negotiation.md
4208
+ * @schema @packages/core/schemas/knowledge-shard/upstream-contract.json
4209
+ * @created 2026-07-17
4210
+ * @agent Codex
4211
+ */
4212
+
4213
+ declare const CORE_V1_COMPONENTS: readonly ["notes", "collections", "tags", "templates", "links"];
4214
+ declare function getKnowledgeShardProfileRegistry(): ShardProfileRegistryEntry[];
4215
+ interface CreateShardCapabilityReportInput {
4216
+ backend: ShardBackend;
4217
+ operation: ShardOperation;
4218
+ requestedProfile: string | null;
4219
+ declaredComponents?: readonly ShardComponent[];
4220
+ omittedComponents?: readonly ShardComponent[];
4221
+ losses?: readonly ShardLossEntry[];
4222
+ }
4223
+ declare function createShardCapabilityReport(input: CreateShardCapabilityReportInput): ShardCapabilityReport;
4224
+ declare function profileSupportError(report: ShardCapabilityReport): string | null;
4225
+
4107
4226
  /**
4108
4227
  * Minimal tar + gzip packing/unpacking for shard archives.
4109
4228
  *
@@ -4174,8 +4293,17 @@ declare function validateChecksums(checksums: Record<string, string>, files: Map
4174
4293
  * Shard export pipeline — query all entities, serialize, pack into .shard archive.
4175
4294
  *
4176
4295
  * Pipeline: query DB → field-map → serialize (JSONL/JSON) → compute checksums → build manifest → tar.gz
4296
+ *
4297
+ * @implements @.aiwg/adrs/ADR-011-shard-server-conformance-and-version-negotiation.md
4298
+ * @depends @packages/core/src/shard/profile-registry.ts
4299
+ * @schema @packages/core/schemas/knowledge-shard.schema.receipt.json
4300
+ * @created 2026-07-17
4301
+ * @agent Codex
4177
4302
  */
4178
4303
 
4304
+ declare function exportShardWithReport(db: DatabaseClient, options: ExportOptions & {
4305
+ profile: string;
4306
+ }): Promise<ShardExportResult>;
4179
4307
  /**
4180
4308
  * Export knowledge data from the database as a .shard archive (Uint8Array).
4181
4309
  *
@@ -4190,6 +4318,11 @@ declare function exportShard(db: DatabaseClient, options?: ExportOptions): Promi
4190
4318
  *
4191
4319
  * Pipeline: ArrayBuffer → gunzip → untar → parse manifest → validate checksums →
4192
4320
  * parse components → field-map → BEGIN transaction → INSERT all → COMMIT
4321
+ *
4322
+ * @implements @.aiwg/adrs/ADR-011-shard-server-conformance-and-version-negotiation.md
4323
+ * @depends @packages/core/src/shard/schema-validator.ts
4324
+ * @created 2026-07-17
4325
+ * @agent Codex
4193
4326
  */
4194
4327
 
4195
4328
  /**
@@ -4210,11 +4343,16 @@ interface ShardSchemaValidationResult {
4210
4343
  errors: string[];
4211
4344
  }
4212
4345
  type ShardFiles = Map<string, Uint8Array>;
4346
+ type CoreV1SchemaVersion = '1.0.0' | '1.1.0' | '1.2.0';
4213
4347
  declare function getKnowledgeShardSchema(): unknown;
4348
+ declare function getKnowledgeShardContractReceipt(): unknown;
4214
4349
  declare function validateShardManifest(value: unknown): ShardSchemaValidationResult;
4215
4350
  declare function validateShardArchive(input: Uint8Array | ArrayBuffer | ShardFiles): ShardSchemaValidationResult;
4216
- declare function validateShardComponentRecord(component: ShardComponent | 'templates', value: unknown): ShardSchemaValidationResult;
4217
- declare function assertShardComponentRecord(component: ShardComponent | 'templates', value: unknown): void;
4351
+ declare function validateCoreV1ShardArchive(input: Uint8Array | ArrayBuffer | ShardFiles): Promise<ShardSchemaValidationResult>;
4352
+ declare function validateRecordV1ShardArchive(input: Uint8Array | ArrayBuffer | ShardFiles): Promise<ShardSchemaValidationResult>;
4353
+ declare function validateFullV1ShardArchive(input: Uint8Array | ArrayBuffer | ShardFiles): Promise<ShardSchemaValidationResult>;
4354
+ declare function validateShardComponentRecord(component: ShardComponent | 'templates', value: unknown, profile?: 'core-v1' | 'record-v1' | 'full-v1', version?: CoreV1SchemaVersion): ShardSchemaValidationResult;
4355
+ declare function assertShardComponentRecord(component: ShardComponent | 'templates', value: unknown, profile?: 'core-v1' | 'record-v1' | 'full-v1', version?: CoreV1SchemaVersion): void;
4218
4356
 
4219
4357
  /**
4220
4358
  * Pluggable semantic providers for the in-place shard reader (issue #189).
@@ -4562,9 +4700,8 @@ interface AiwgKnowledgeShardOptions {
4562
4700
  createdAt?: string;
4563
4701
  matricVersion?: string;
4564
4702
  /**
4565
- * Include React-native SKOS and provenance component files. The default
4566
- * portable profile keeps those projections in lossless note metadata so the
4567
- * shard remains importable by the current Fortemi server.
4703
+ * Reserved for a future full-v1 converter. Passing true currently fails
4704
+ * closed because a partial rich-component inventory is not a valid profile.
4568
4705
  */
4569
4706
  includeNativeRichComponents?: boolean;
4570
4707
  }
@@ -4904,7 +5041,7 @@ interface NoteOriginalRecord {
4904
5041
  interface NoteRevisedCurrentRecord {
4905
5042
  /** Keyed by note id (mirrors the SQL PK `note_id`). */
4906
5043
  id: string;
4907
- content: string;
5044
+ content: string | null;
4908
5045
  ai_metadata: unknown | null;
4909
5046
  generation_count: number;
4910
5047
  model: string | null;
@@ -4996,6 +5133,8 @@ interface JournalEntry {
4996
5133
  interface RecordStoreCapabilities {
4997
5134
  crud: true;
4998
5135
  journal: true;
5136
+ /** Multi-collection record and journal mutations commit atomically. */
5137
+ atomicBatch?: true;
4999
5138
  /** Bounded substring scan over titles/content — not ranked FTS. */
5000
5139
  boundedTextScan: true;
5001
5140
  fullTextSearch: false;
@@ -5007,6 +5146,17 @@ interface RecordListOptions {
5007
5146
  /** Maximum records returned (applied after filtering). */
5008
5147
  limit?: number;
5009
5148
  }
5149
+ type RecordMutation = {
5150
+ [C in RecordCollectionName]: {
5151
+ op: 'put';
5152
+ collection: C;
5153
+ record: RecordCollections[C];
5154
+ };
5155
+ }[RecordCollectionName] | {
5156
+ op: 'delete';
5157
+ collection: RecordCollectionName;
5158
+ id: string;
5159
+ };
5010
5160
  /**
5011
5161
  * The writable canonical structured-record store. Implementations MUST make
5012
5162
  * each `put`/`remove` an atomic commit of the record mutation plus its
@@ -5019,6 +5169,11 @@ interface RecordStore {
5019
5169
  put<C extends RecordCollectionName>(collection: C, record: RecordCollections[C]): Promise<JournalEntry>;
5020
5170
  /** Hard-remove one record, journaled atomically (soft-delete is a field upstream). */
5021
5171
  remove(collection: RecordCollectionName, id: string): Promise<JournalEntry>;
5172
+ /**
5173
+ * Commit all record mutations and their journal entries as one transaction.
5174
+ * An error leaves both record state and the journal unchanged.
5175
+ */
5176
+ applyBatch?(mutations: readonly RecordMutation[]): Promise<JournalEntry[]>;
5022
5177
  /** All records of a collection (insertion order not guaranteed). */
5023
5178
  list<C extends RecordCollectionName>(collection: C, opts?: RecordListOptions): Promise<RecordCollections[C][]>;
5024
5179
  /** Journal entries with `seq > sinceSeq`, ascending. */
@@ -5043,6 +5198,7 @@ declare class MemoryRecordStore implements RecordStore {
5043
5198
  get<C extends RecordCollectionName>(collection: C, id: string): Promise<RecordCollections[C] | null>;
5044
5199
  put<C extends RecordCollectionName>(collection: C, record: RecordCollections[C]): Promise<JournalEntry>;
5045
5200
  remove(collection: RecordCollectionName, id: string): Promise<JournalEntry>;
5201
+ applyBatch(mutations: readonly RecordMutation[]): Promise<JournalEntry[]>;
5046
5202
  list<C extends RecordCollectionName>(collection: C, opts?: RecordListOptions): Promise<RecordCollections[C][]>;
5047
5203
  journalSince(sinceSeq: number, limit?: number): Promise<JournalEntry[]>;
5048
5204
  headSeq(): Promise<number>;
@@ -5082,6 +5238,7 @@ declare class IdbRecordStore implements RecordStore {
5082
5238
  get<C extends RecordCollectionName>(collection: C, id: string): Promise<RecordCollections[C] | null>;
5083
5239
  put<C extends RecordCollectionName>(collection: C, record: RecordCollections[C]): Promise<JournalEntry>;
5084
5240
  remove(collection: RecordCollectionName, id: string): Promise<JournalEntry>;
5241
+ applyBatch(mutations: readonly RecordMutation[]): Promise<JournalEntry[]>;
5085
5242
  list<C extends RecordCollectionName>(collection: C, opts?: RecordListOptions): Promise<RecordCollections[C][]>;
5086
5243
  journalSince(sinceSeq: number, limit?: number): Promise<JournalEntry[]>;
5087
5244
  headSeq(): Promise<number>;
@@ -5324,13 +5481,19 @@ declare function createRecordBackend(store: RecordStore, options?: RecordBackend
5324
5481
  * warnings, and are never emitted on export.
5325
5482
  *
5326
5483
  * Atomicity: manifest, version, signature (ADR-014 verify-before-persist),
5327
- * and checksum validation all run BEFORE any record or byte is written, and
5328
- * `error`-strategy conflicts are pre-scanned so a conflicting archive writes
5329
- * nothing. Each record commit is then individually atomic and journaled; an
5330
- * interrupted import leaves a recoverable prefix that a re-import with
5331
- * `conflictStrategy: 'skip'` completes idempotently.
5484
+ * and checksum validation all run before mutation. Verified sidecar bytes are
5485
+ * promoted with rollback, then every record and journal mutation commits in
5486
+ * one multi-collection RecordStore batch.
5487
+ *
5488
+ * @implements @.aiwg/adrs/ADR-011-shard-server-conformance-and-version-negotiation.md
5489
+ * @depends @packages/core/src/shard/schema-validator.ts
5490
+ * @created 2026-07-17
5491
+ * @agent Codex
5332
5492
  */
5333
5493
 
5494
+ declare function exportShardFromRecordsWithReport(store: RecordStore, options: ExportOptions & {
5495
+ profile: string;
5496
+ }): Promise<ShardExportResult>;
5334
5497
  /**
5335
5498
  * Export canonical records as a `.shard` archive (Uint8Array), format-parity
5336
5499
  * with the PGlite `exportShard`. Honored options: `collectionId` / `tag`
@@ -5351,6 +5514,12 @@ declare function exportShardFromRecords(store: RecordStore, options?: ExportOpti
5351
5514
  */
5352
5515
  declare function importShardToRecords(store: RecordStore, data: Uint8Array | ArrayBuffer, options?: ImportOptions): Promise<ImportResult>;
5353
5516
 
5354
- declare const VERSION = "2026.7.8";
5517
+ /**
5518
+ * @implements @.aiwg/adrs/ADR-011-shard-server-conformance-and-version-negotiation.md
5519
+ * @source @packages/core/src/shard/schema-validator.ts
5520
+ * @created 2026-07-17
5521
+ * @agent Codex
5522
+ */
5523
+ declare const VERSION = "2026.7.9";
5355
5524
 
5356
- export { AIWG_SCAN_REQUIRED_FIELDS, type AiwgChunkedIndexBuildOptions, type AiwgChunkedIndexBuildResult, type AiwgChunkedIndexDetailLoader, type AiwgChunkedIndexLoadOptions, type AiwgChunkedIndexLoader, type AiwgChunkedIndexProgress, type AiwgChunkedIndexProgressPhase, type AiwgChunkedIndexQueryOptions, type AiwgChunkedIndexQueryResult, type AiwgChunkedIndexValidationResult, type AiwgFortemiAttachmentReference, type AiwgFortemiBinarySource, type AiwgFortemiChunk, type AiwgFortemiChunkDetailRef, type AiwgFortemiChunkManifest, type AiwgFortemiChunkPart, type AiwgFortemiChunkPartRef, type AiwgFortemiIndexExport, type AiwgFortemiIndexExportSchemaVersion, type AiwgFortemiProjectedRecord, type AiwgFortemiProvenance, type AiwgFortemiProvenanceEvent, type AiwgFortemiRecord, type AiwgFortemiRecordEmbedding, type AiwgFortemiRecordSchemaVersion, type AiwgFortemiRecordSource, type AiwgFortemiRecordType, type AiwgFortemiRelationship, type AiwgFortemiRelationshipDirection, type AiwgFortemiSearchProjection, type AiwgFortemiSkosConcept, type AiwgFortemiSkosRelation, type AiwgFortemiSkosRelationType, type AiwgHeadlessEmbeddingBackend, type AiwgIndexController, type AiwgIndexControllerListener, type AiwgIndexControllerSnapshot, type AiwgIndexGraphOptions, type AiwgIndexQueryMatch, type AiwgIndexQueryOptions, type AiwgIndexQueryRankedItem, type AiwgIndexQueryResult, type AiwgIndexQueryWeights, type AiwgIndexValidationResult, type AiwgKnowledgeShardOptions, type AiwgPrivacyClassification, type AiwgPrivacyFilterOptions, type AiwgProvenanceConfidence, type AiwgRelationshipDirection, type AiwgRelationshipEdgeSummary, type AiwgRelationshipNodeSummary, type AiwgRelationshipQueryOptions, type AiwgRelationshipSetOperation, type AiwgRelationshipSetOptions, type AiwgRelationshipSetResult, type AiwgRelationshipTraversalOptions, type AiwgRelationshipTraversalResult, type AiwgReviewAction, type AiwgReviewDecision, type AiwgReviewDecisionExport, type AiwgReviewInput, type AiwgStaticDuplicatePair, type AiwgStaticEmbeddingRecord, type AiwgStaticEmbeddingSet, type AiwgStaticHybridQueryOptions, type AiwgStaticSemanticQueryOptions, type AiwgStaticSemanticResult, AllowlistTrustStore, type ArchiveInfo, ArchiveManager, type AttachInput, type AttachmentBlobRecord, type AttachmentBlobRow, type AttachmentProjectionResult, type AttachmentRecord, type AttachmentRow, AttachmentsRepository, type BackendCandidate, type BackendCapabilities, type BackendConcept, type BackendLink, type BackendListOptions, type BackendNote, type BackendNoteFull, type BackendProvenanceEdge, type BackendRequest, type BackendSearchHit, type BackendSearchQueryOptions, type BackendSearchResult, type BackendSelection, type BackendSemanticTier, type BackendStartupCost, type BlobBackendKind, type BlobGcOptions, type BlobGcResult, type BlobReconcileOptions, type BlobReconcileResult, type BlobStore, type BlobStoreDiagnostics, type BridgeCapability, type BridgeProviderInfo, type BrowserNoteExport, type BuildAiwgStaticEmbeddingSetOptions, CURRENT_MIGRATION_HEAD, CURRENT_SHARD_VERSION, type CanonicalAttachInput, CanonicalAttachmentsRepository, type CanonicalNoteCreateInput, type CanonicalNoteUpdateInput, type CanonicalNoteView, CanonicalNotesRepository, type CapabilityInfo, CapabilityManager, type CapabilityName, type CapabilityState, type CaptureKnowledgeInput, CaptureKnowledgeInputSchema, type CaptureKnowledgeResult, type CollectionCreateInput, type CollectionNoteRecord, type CollectionRecord, type CollectionRow, CollectionsRepository, CommunitiesRepository, type CommunityAssignmentView, type CommunityCreateInput, type CommunityFilterDefinition, type CommunityGraph, type CommunityOptions, type CommunitySourceDescriptor, type CommunitySourceType, type CommunitySummary, type CompletionRequest, type CompletionResponse, type ConditionResult, type ConflictStrategy, type CooldownConfig, type CooldownEvent, type CosineSemanticProviderOptions, type CreateBlobStoreOptions, type CreatePGliteOptions, type CreateRecordStoreOptions, type CspDirectiveName, type CspDirectives, type CspViolationReport, DB_SNAPSHOT_SCHEMA_VERSION, type DataBackend, type DatabaseClient, type DbSnapshot, type DbSnapshotCompat, type DbSnapshotCompression, type DbSnapshotExpectations, type DbSnapshotMeta, type DbSnapshotSource, DbSnapshotVersionError, type DiscoveredProvider, type DiscoveryOptions, type DumpDbSnapshotOptions, type DumpableDb, EMBED_REQUEST_KIND, EMBED_RESPONSE_KIND, type EmbedFunction, type EmbedRequest, type EmbedRequestMessage, type EmbedResponse, type EmbedResponseMessage, type EmbedTransportPort, type EmbedWorkerOptions, type EmbeddingCompatibilityPolicy, type EmbeddingSetCreateInput, type EmbeddingSetCriteria, type EmbeddingSetDescriptor, type EmbeddingSetEmbeddingInput, type EmbeddingSetFreshness, type EmbeddingSetKind, type EmbeddingSetMode, type EmbeddingSetRow, type EmbeddingSetSelector, EmbeddingSetsRepository, type EnqueueJobInput, type ErrorCategory, type EventMap, type ExportOptions, FORTEMI_COMPATIBILITY_PATH, FORTEMI_COMPATIBILITY_STATES, FORTEMI_REQUIRED_COMPATIBILITY_CAPABILITIES, type FallbackEvent, FallbackRouter, type FallbackRouterConfig, type FetchFortemiCompatibilityOptions, type FortemiBridge, type FortemiBridgeCapabilities, type FortemiBridgeHost, type FortemiCompatibilityCapability, type FortemiCompatibilityResponse, type FortemiCompatibilityState, type FortemiCompatibilityValidationResult, type FortemiConfig, type FortemiCore, type FortemiInferenceRouter, type FortemiRequiredCompatibilityCapability, type FortemiSecretStore, type FortemiToolDefinition, FortemiToolManifest, type GetNoteInput, GetNoteInputSchema, type GpuCapabilities, type GraphCommunity, type GraphEdge, type GraphNode, GraphRepository, type IDisposable, IdbRecordStore, type ImportCounts, type ImportOptions, type ImportProgress, type ImportProgressPhase, type ImportResult, type InferenceCapabilities, type InferenceProvider, JOB_CAPABILITIES, JOB_PRIORITIES, type JobQueueOptions, JobQueueWorker, type JobStatus, type JobType, type JournalEntry, LOCAL_ENDPOINTS, type LegacyMigrationReport, type LinkRecord0, type LinkRow, LinksRepository, type ListNotesInput, ListNotesInputSchema, type LlmCapabilityOptions, type LlmCompleteFn, type LoadedPluginScript, type LocalEndpoint, type ManageArchiveInput, ManageArchiveInputSchema, type ManageArchiveResult, type ManageAttachmentsInput, ManageAttachmentsInputSchema, type ManageAttachmentsResult, type ManageCapabilitiesInput, ManageCapabilitiesInputSchema, type ManageCapabilitiesResult, type ManageCollectionsInput, ManageCollectionsInputSchema, type ManageCollectionsResult, type ManageLinksInput, ManageLinksInputSchema, type ManageLinksResult, type ManageNoteInput, ManageNoteInputSchema, type ManageNoteResult, type ManageTagsInput, ManageTagsInputSchema, type ManageTagsResult, MemoryBlobStore, MemoryRecordStore, type Migration, MigrationRunner, type ModelCategory, type ModelFitResult, type ModelInfo, type NoteCreateInput, type NoteFull, type NoteListOptions, type NoteOriginalRecord, type NoteProjectionResult, type NoteRecord0, type NoteRevisedCurrentRecord, type NoteRevision, type NoteSkosTag, type NoteSummary, type NoteTagRecord, type NoteUpdateInput, NotesRepository, OpenAICompatibleProvider, type OpenAIProviderConfig, type OpenShardOptions, type PGliteBackendOptions, PGliteStorageBackend, PGliteStorageBackendFactory, PGliteWorkerClient, PGliteWorkerStorageBackend, PGliteWorkerStorageBackendFactory, type PGliteWorkerStorageBackendFactoryOptions, type PaginatedResult, type PersistenceMode, type PluginCspOptions, type PluginScriptDescriptor, type PluginScriptPolicy, type PrefetchOptions, type PrefetchResult, type ProbeResult, type ProbeStatus, type ProvenanceEdge, ProvenanceRepository, type ProviderCapabilities, ProviderRegistry, type ProviderTier, type QueryExecutor, type QueryResult, RECORD_COLLECTIONS, RECORD_SCHEMA_VERSION, RECORD_STORE_CAPABILITIES, type RecommendedTier, type RecordBackendManageNoteResult, type RecordBackendOptions, type RecordCollectionName, type RecordCollections, type RecordListOptions, type RecordProjectionResult, type RecordProvenanceInput, type RecordStore, type RecordStoreCapabilities, type RemoteBackendConfig, type RemoteBackendPaths, type ResolvedEmbeddingRow, type ResolvedEmbeddingSet, type RestoreDbSnapshotOptions, type RouteHandler, SHARD_FORMAT, SIGNATURE_ENTRY, SIGNING_ENVELOPE_VERSION, SUPPORTED_PGLITE_VERSION, type SWRegistrationResult, type SearchFacets, type SearchInput, SearchInputSchema, type SearchOptions, SearchRepository, type SearchResponse, type SearchResult, type ShardBackendOptions, type ShardClusterRef, type ShardCollection, type ShardComponent, type ShardComponentStore, type ShardEmbedding, type ShardEmbeddingConfig, type ShardEmbeddingSet, type ShardEmbeddingSetMember, type ShardLayout, type ShardLink, type ShardListOptions, type ShardManifest, type ShardNote, type ShardNoteFull, type ShardNoteSkosTag, type ShardProvenanceEdge, type ShardReader, type ShardReaderNote, type ShardReaderSource, type ShardSchemaValidationResult, type ShardSearchOptions, type ShardSearchRankedNote, type ShardSearchResult, type ShardSearchWeights, type ShardSignatureEnvelope, type ShardSignatureVerdict, type ShardSigner, type ShardSigningPayload, type ShardSkosConcept, type ShardSkosRelation, type ShardSkosScheme, type ShardTag, type ShardTemplate, type ShardTrustStore, type SignShardInput, type SimilarityGraphCacheKey, type SimilarityGraphOptions, type SimilarityGraphRequest, type SimilarityGraphResult, type SkosConcept, type SkosRelation, SkosRepository, type SkosScheme, type StaticSemanticProvider, type StorageBackend, type StorageBackendFactory, type StorageOpenRequest, type StorageTopology, type StreamChunk, TagsRepository, TransactionProxy, type TrustedKey, TypedEventBus, VERSION, type VectorEntry, type VerifyShardSignatureInput, type VirtualEmbeddingSetDefinition, type VirtualEmbeddingSetSource, type VirtualEmbeddingSetValidationError, type VirtualMaterializationPolicy, type VramTier, type WorkerRequest, type WorkerResponse, aiRevisionHandler, aiwgFortemiIndexFromKnowledgeShard, aiwgFortemiIndexToCommunityGraph, aiwgFortemiIndexToKnowledgeShard, allMigrations, appendPluginScript, assertAiwgFortemiChunkManifest, assertAiwgFortemiChunkPart, assertAiwgFortemiIndexExport, assertAiwgStaticEmbeddingSet, assertShardComponentRecord, buildAiwgChunkedIndex, buildAiwgStaticEmbeddingSet, buildNoteConditions, buildPluginCsp, captureKnowledge, chunkText, classifyError, classifyModel, clearPrefetchedShard, collectionFromShard, collectionToShard, computeBlobHash, computeHash, computeSri, conceptTaggingHandler, cosineSimilarity, createAiwgFetchChunkLoader, createAiwgFetchDetailLoader, createAiwgIndexController, createAiwgReviewDecisionExport, createBlobStore, createCosineSemanticProvider, createCspReportHandler, createFortemi, createLazyBlobStore, createLegacyProvider, createPGliteBackend, createPGliteInstance, createRecordBackend, createRecordStore, createRemoteBackend, createRoutes, createShardBackend, createWorkerEmbedFunction, defaultStorageBackendFactory, detectCommunities, detectGpuCapabilities, detectInferenceCapabilities, discoverLocalProviders, dropAttachmentProjection, dropNoteProjection, dumpDbSnapshot, embeddingConfigToShard, embeddingFromShard, embeddingGenerationHandler, embeddingSetFromShard, embeddingSetMemberToShard, embeddingSetToShard, embeddingToShard, enqueueFullWorkflow, enqueueJob, enqueueNoteCreationJobs, estimateModelFit, estimateVramMB, estimateVramTier, exportShard, exportShardFromRecords, fetchAndValidateFortemiCompatibility, fetchPluginScript, filterAiwgRecordsByPrivacy, findAiwgStaticDuplicatePairs, formatFortemiCompatibilitySummary, fortemiCompatibilityUrl, fortemiManifest, fromPrefetched, generateId, getAiwgFortemiFacets, getEmbedFunction, getFortemiBridge, getFortemiSecretStore, getJobQueueStatus, getKnowledgeShardSchema, getLlmFunction, getNote, getPrefetchedSha256, handleEmbedRequests, hasFortemiSecureSecrets, importShard, importShardToRecords, isPluginScriptAllowed, isShardPrefetched, isShardSigningSupported, linkFromShard, linkToShard, linkingHandler, listNotes, manageArchive, manageAttachments, manageCapabilities, manageCollections, manageLinks, manageNote, manageTags, matchRoute, migrateLegacyBlobStore, noteFromShard, noteSkosTagToShard, noteToShard, openShard, packTarGz, parseCspReport, prefetchShard, projectAttachments, projectNotes, projectRecords, provenanceEdgeToShard, queryAiwgFortemiIndex, queryAiwgHybridIndex, queryAiwgSemanticIndex, registerLlmCapability, registerSemanticCapability, registerSemanticCapabilityWorker, registerServiceWorker, restoreDbSnapshot, searchTool, selectBackend, selectLlmModel, setEmbedFunction, setLlmFunction, sha256Hex, sidecarBlobDigests, signShard, skosConceptToShard, skosRelationToShard, skosSchemeToShard, suggestTags, tagsToShard, templateToShard, titleGenerationHandler, unpackTarGz, unregisterLlmCapability, unregisterSemanticCapability, urlLinkToShard, validateAiwgFortemiChunkManifest, validateAiwgFortemiChunkPart, validateAiwgFortemiIndexExport, validateAiwgStaticEmbeddingSet, validateChecksums, validateFortemiCompatibilityResponse, validateShardArchive, validateShardComponentRecord, validateShardManifest, verifyDbSnapshotMeta, verifyShardSignature, verifySri };
5525
+ export { AIWG_SCAN_REQUIRED_FIELDS, type AiwgChunkedIndexBuildOptions, type AiwgChunkedIndexBuildResult, type AiwgChunkedIndexDetailLoader, type AiwgChunkedIndexLoadOptions, type AiwgChunkedIndexLoader, type AiwgChunkedIndexProgress, type AiwgChunkedIndexProgressPhase, type AiwgChunkedIndexQueryOptions, type AiwgChunkedIndexQueryResult, type AiwgChunkedIndexValidationResult, type AiwgFortemiAttachmentReference, type AiwgFortemiBinarySource, type AiwgFortemiChunk, type AiwgFortemiChunkDetailRef, type AiwgFortemiChunkManifest, type AiwgFortemiChunkPart, type AiwgFortemiChunkPartRef, type AiwgFortemiIndexExport, type AiwgFortemiIndexExportSchemaVersion, type AiwgFortemiProjectedRecord, type AiwgFortemiProvenance, type AiwgFortemiProvenanceEvent, type AiwgFortemiRecord, type AiwgFortemiRecordEmbedding, type AiwgFortemiRecordSchemaVersion, type AiwgFortemiRecordSource, type AiwgFortemiRecordType, type AiwgFortemiRelationship, type AiwgFortemiRelationshipDirection, type AiwgFortemiSearchProjection, type AiwgFortemiSkosConcept, type AiwgFortemiSkosRelation, type AiwgFortemiSkosRelationType, type AiwgHeadlessEmbeddingBackend, type AiwgIndexController, type AiwgIndexControllerListener, type AiwgIndexControllerSnapshot, type AiwgIndexGraphOptions, type AiwgIndexQueryMatch, type AiwgIndexQueryOptions, type AiwgIndexQueryRankedItem, type AiwgIndexQueryResult, type AiwgIndexQueryWeights, type AiwgIndexValidationResult, type AiwgKnowledgeShardOptions, type AiwgPrivacyClassification, type AiwgPrivacyFilterOptions, type AiwgProvenanceConfidence, type AiwgRelationshipDirection, type AiwgRelationshipEdgeSummary, type AiwgRelationshipNodeSummary, type AiwgRelationshipQueryOptions, type AiwgRelationshipSetOperation, type AiwgRelationshipSetOptions, type AiwgRelationshipSetResult, type AiwgRelationshipTraversalOptions, type AiwgRelationshipTraversalResult, type AiwgReviewAction, type AiwgReviewDecision, type AiwgReviewDecisionExport, type AiwgReviewInput, type AiwgStaticDuplicatePair, type AiwgStaticEmbeddingRecord, type AiwgStaticEmbeddingSet, type AiwgStaticHybridQueryOptions, type AiwgStaticSemanticQueryOptions, type AiwgStaticSemanticResult, AllowlistTrustStore, type ArchiveInfo, ArchiveManager, type AttachInput, type AttachmentBlobRecord, type AttachmentBlobRow, type AttachmentProjectionResult, type AttachmentRecord, type AttachmentRow, AttachmentsRepository, type BackendCandidate, type BackendCapabilities, type BackendConcept, type BackendLink, type BackendListOptions, type BackendNote, type BackendNoteFull, type BackendProvenanceEdge, type BackendRequest, type BackendSearchHit, type BackendSearchQueryOptions, type BackendSearchResult, type BackendSelection, type BackendSemanticTier, type BackendStartupCost, type BlobBackendKind, type BlobGcOptions, type BlobGcResult, type BlobReconcileOptions, type BlobReconcileResult, type BlobStore, type BlobStoreDiagnostics, type BridgeCapability, type BridgeProviderInfo, type BrowserNoteExport, type BuildAiwgStaticEmbeddingSetOptions, CORE_V1_COMPONENTS, CURRENT_MIGRATION_HEAD, CURRENT_SHARD_VERSION, type CanonicalAttachInput, CanonicalAttachmentsRepository, type CanonicalNoteCreateInput, type CanonicalNoteUpdateInput, type CanonicalNoteView, CanonicalNotesRepository, type CapabilityInfo, CapabilityManager, type CapabilityName, type CapabilityState, type CaptureKnowledgeInput, CaptureKnowledgeInputSchema, type CaptureKnowledgeResult, type CollectionCreateInput, type CollectionNoteRecord, type CollectionRecord, type CollectionRow, CollectionsRepository, CommunitiesRepository, type CommunityAssignmentView, type CommunityCreateInput, type CommunityFilterDefinition, type CommunityGraph, type CommunityOptions, type CommunitySourceDescriptor, type CommunitySourceType, type CommunitySummary, type CompletionRequest, type CompletionResponse, type ConditionResult, type ConflictStrategy, type CooldownConfig, type CooldownEvent, type CosineSemanticProviderOptions, type CreateBlobStoreOptions, type CreatePGliteOptions, type CreateRecordStoreOptions, type CspDirectiveName, type CspDirectives, type CspViolationReport, DB_SNAPSHOT_SCHEMA_VERSION, type DataBackend, type DatabaseClient, type DbSnapshot, type DbSnapshotCompat, type DbSnapshotCompression, type DbSnapshotExpectations, type DbSnapshotMeta, type DbSnapshotSource, DbSnapshotVersionError, type DiscoveredProvider, type DiscoveryOptions, type DumpDbSnapshotOptions, type DumpableDb, EMBED_REQUEST_KIND, EMBED_RESPONSE_KIND, type EmbedFunction, type EmbedRequest, type EmbedRequestMessage, type EmbedResponse, type EmbedResponseMessage, type EmbedTransportPort, type EmbedWorkerOptions, type EmbeddingCompatibilityPolicy, type EmbeddingSetCreateInput, type EmbeddingSetCriteria, type EmbeddingSetDescriptor, type EmbeddingSetEmbeddingInput, type EmbeddingSetFreshness, type EmbeddingSetKind, type EmbeddingSetMode, type EmbeddingSetRow, type EmbeddingSetSelector, EmbeddingSetsRepository, type EnqueueJobInput, type ErrorCategory, type EventMap, type ExportOptions, FORTEMI_COMPATIBILITY_PATH, FORTEMI_COMPATIBILITY_STATES, FORTEMI_REQUIRED_COMPATIBILITY_CAPABILITIES, type FallbackEvent, FallbackRouter, type FallbackRouterConfig, type FetchFortemiCompatibilityOptions, type FortemiBridge, type FortemiBridgeCapabilities, type FortemiBridgeHost, type FortemiCompatibilityCapability, type FortemiCompatibilityResponse, type FortemiCompatibilityState, type FortemiCompatibilityValidationResult, type FortemiConfig, type FortemiCore, type FortemiInferenceRouter, type FortemiRequiredCompatibilityCapability, type FortemiSecretStore, type FortemiToolDefinition, FortemiToolManifest, type GetNoteInput, GetNoteInputSchema, type GpuCapabilities, type GraphCommunity, type GraphEdge, type GraphNode, GraphRepository, type IDisposable, IdbRecordStore, type ImportCounts, type ImportOptions, type ImportProgress, type ImportProgressPhase, type ImportResult, type InferenceCapabilities, type InferenceProvider, JOB_CAPABILITIES, JOB_PRIORITIES, type JobQueueOptions, JobQueueWorker, type JobStatus, type JobType, type JournalEntry, type KnowledgeShardProfile, LOCAL_ENDPOINTS, type LegacyMigrationReport, type LinkRecord0, type LinkRow, LinksRepository, type ListNotesInput, ListNotesInputSchema, type LlmCapabilityOptions, type LlmCompleteFn, type LoadedPluginScript, type LocalEndpoint, type ManageArchiveInput, ManageArchiveInputSchema, type ManageArchiveResult, type ManageAttachmentsInput, ManageAttachmentsInputSchema, type ManageAttachmentsResult, type ManageCapabilitiesInput, ManageCapabilitiesInputSchema, type ManageCapabilitiesResult, type ManageCollectionsInput, ManageCollectionsInputSchema, type ManageCollectionsResult, type ManageLinksInput, ManageLinksInputSchema, type ManageLinksResult, type ManageNoteInput, ManageNoteInputSchema, type ManageNoteResult, type ManageTagsInput, ManageTagsInputSchema, type ManageTagsResult, MemoryBlobStore, MemoryRecordStore, type Migration, MigrationRunner, type ModelCategory, type ModelFitResult, type ModelInfo, type NoteCreateInput, type NoteFull, type NoteListOptions, type NoteOriginalRecord, type NoteProjectionResult, type NoteRecord0, type NoteRevisedCurrentRecord, type NoteRevision, type NoteSkosTag, type NoteSummary, type NoteTagRecord, type NoteUpdateInput, NotesRepository, OpenAICompatibleProvider, type OpenAIProviderConfig, type OpenShardOptions, type PGliteBackendOptions, PGliteStorageBackend, PGliteStorageBackendFactory, PGliteWorkerClient, PGliteWorkerStorageBackend, PGliteWorkerStorageBackendFactory, type PGliteWorkerStorageBackendFactoryOptions, type PaginatedResult, type PersistenceMode, type PluginCspOptions, type PluginScriptDescriptor, type PluginScriptPolicy, type PrefetchOptions, type PrefetchResult, type ProbeResult, type ProbeStatus, type ProvenanceEdge, ProvenanceRepository, type ProviderCapabilities, ProviderRegistry, type ProviderTier, type QueryExecutor, type QueryResult, RECORD_COLLECTIONS, RECORD_SCHEMA_VERSION, RECORD_STORE_CAPABILITIES, type RecommendedTier, type RecordBackendManageNoteResult, type RecordBackendOptions, type RecordCollectionName, type RecordCollections, type RecordListOptions, type RecordMutation, type RecordProjectionResult, type RecordProvenanceInput, type RecordStore, type RecordStoreCapabilities, type RemoteBackendConfig, type RemoteBackendPaths, type ResolvedEmbeddingRow, type ResolvedEmbeddingSet, type RestoreDbSnapshotOptions, type RouteHandler, SHARD_FORMAT, SIGNATURE_ENTRY, SIGNING_ENVELOPE_VERSION, SUPPORTED_PGLITE_VERSION, type SWRegistrationResult, type SearchFacets, type SearchInput, SearchInputSchema, type SearchOptions, SearchRepository, type SearchResponse, type SearchResult, type ShardAuthorityStatus, type ShardBackend, type ShardBackendOptions, type ShardCapabilityReport, type ShardClusterRef, type ShardCollection, type ShardComponent, type ShardComponentStore, type ShardEmbedding, type ShardEmbeddingConfig, type ShardEmbeddingSet, type ShardEmbeddingSetMember, type ShardExportResult, type ShardLayout, type ShardLink, type ShardListOptions, type ShardLossEntry, type ShardManifest, type ShardNote, type ShardNoteFull, type ShardNoteSkosTag, type ShardOperation, type ShardProfileRegistryEntry, type ShardProvenanceEdge, type ShardReader, type ShardReaderNote, type ShardReaderSource, type ShardSchemaValidationResult, type ShardSearchOptions, type ShardSearchRankedNote, type ShardSearchResult, type ShardSearchWeights, type ShardSignatureEnvelope, type ShardSignatureVerdict, type ShardSigner, type ShardSigningPayload, type ShardSkosConcept, type ShardSkosRelation, type ShardSkosScheme, type ShardTag, type ShardTemplate, type ShardTrustStore, type SignShardInput, type SimilarityGraphCacheKey, type SimilarityGraphOptions, type SimilarityGraphRequest, type SimilarityGraphResult, type SkosConcept, type SkosRelation, SkosRepository, type SkosScheme, type StaticSemanticProvider, type StorageBackend, type StorageBackendFactory, type StorageOpenRequest, type StorageTopology, type StreamChunk, TagsRepository, TransactionProxy, type TrustedKey, TypedEventBus, VERSION, type VectorEntry, type VerifyShardSignatureInput, type VirtualEmbeddingSetDefinition, type VirtualEmbeddingSetSource, type VirtualEmbeddingSetValidationError, type VirtualMaterializationPolicy, type VramTier, type WorkerRequest, type WorkerResponse, aiRevisionHandler, aiwgFortemiIndexFromKnowledgeShard, aiwgFortemiIndexToCommunityGraph, aiwgFortemiIndexToKnowledgeShard, allMigrations, appendPluginScript, assertAiwgFortemiChunkManifest, assertAiwgFortemiChunkPart, assertAiwgFortemiIndexExport, assertAiwgStaticEmbeddingSet, assertShardComponentRecord, buildAiwgChunkedIndex, buildAiwgStaticEmbeddingSet, buildNoteConditions, buildPluginCsp, captureKnowledge, chunkText, classifyError, classifyModel, clearPrefetchedShard, collectionFromShard, collectionToShard, computeBlobHash, computeHash, computeSri, conceptTaggingHandler, cosineSimilarity, createAiwgFetchChunkLoader, createAiwgFetchDetailLoader, createAiwgIndexController, createAiwgReviewDecisionExport, createBlobStore, createCosineSemanticProvider, createCspReportHandler, createFortemi, createLazyBlobStore, createLegacyProvider, createPGliteBackend, createPGliteInstance, createRecordBackend, createRecordStore, createRemoteBackend, createRoutes, createShardBackend, createShardCapabilityReport, createWorkerEmbedFunction, defaultStorageBackendFactory, detectCommunities, detectGpuCapabilities, detectInferenceCapabilities, discoverLocalProviders, dropAttachmentProjection, dropNoteProjection, dumpDbSnapshot, embeddingConfigToShard, embeddingFromShard, embeddingGenerationHandler, embeddingSetFromShard, embeddingSetMemberToShard, embeddingSetToShard, embeddingToShard, enqueueFullWorkflow, enqueueJob, enqueueNoteCreationJobs, estimateModelFit, estimateVramMB, estimateVramTier, exportShard, exportShardFromRecords, exportShardFromRecordsWithReport, exportShardWithReport, fetchAndValidateFortemiCompatibility, fetchPluginScript, filterAiwgRecordsByPrivacy, findAiwgStaticDuplicatePairs, formatFortemiCompatibilitySummary, fortemiCompatibilityUrl, fortemiManifest, fromPrefetched, generateId, getAiwgFortemiFacets, getEmbedFunction, getFortemiBridge, getFortemiSecretStore, getJobQueueStatus, getKnowledgeShardContractReceipt, getKnowledgeShardProfileRegistry, getKnowledgeShardSchema, getLlmFunction, getNote, getPrefetchedSha256, handleEmbedRequests, hasFortemiSecureSecrets, importShard, importShardToRecords, isPluginScriptAllowed, isShardPrefetched, isShardSigningSupported, linkFromShard, linkToShard, linkingHandler, listNotes, manageArchive, manageAttachments, manageCapabilities, manageCollections, manageLinks, manageNote, manageTags, matchRoute, migrateLegacyBlobStore, noteFromShard, noteSkosTagToShard, noteToShard, openShard, packTarGz, parseCspReport, prefetchShard, profileSupportError, projectAttachments, projectNotes, projectRecords, provenanceEdgeToShard, queryAiwgFortemiIndex, queryAiwgHybridIndex, queryAiwgSemanticIndex, registerLlmCapability, registerSemanticCapability, registerSemanticCapabilityWorker, registerServiceWorker, restoreDbSnapshot, searchTool, selectBackend, selectLlmModel, setEmbedFunction, setLlmFunction, sha256Hex, sidecarBlobDigests, signShard, skosConceptToShard, skosRelationToShard, skosSchemeToShard, suggestTags, tagsToShard, templateToShard, titleGenerationHandler, unpackTarGz, unregisterLlmCapability, unregisterSemanticCapability, urlLinkToShard, validateAiwgFortemiChunkManifest, validateAiwgFortemiChunkPart, validateAiwgFortemiIndexExport, validateAiwgStaticEmbeddingSet, validateChecksums, validateCoreV1ShardArchive, validateFortemiCompatibilityResponse, validateFullV1ShardArchive, validateRecordV1ShardArchive, validateShardArchive, validateShardComponentRecord, validateShardManifest, verifyDbSnapshotMeta, verifyShardSignature, verifySri };