@saasontools/strauss-kb 0.1.21 → 0.1.22

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
@@ -91,9 +91,9 @@ declare const kbAnchorSchema: z.ZodObject<{
91
91
  resolved_at: z.ZodOptional<z.ZodString>;
92
92
  lines: z.ZodOptional<z.ZodNumber>;
93
93
  resolver: z.ZodOptional<z.ZodEnum<{
94
- span: "span";
95
94
  "tree-sitter": "tree-sitter";
96
95
  regex: "regex";
96
+ span: "span";
97
97
  }>>;
98
98
  }, z.core.$strict>;
99
99
  /**
@@ -124,10 +124,30 @@ declare const kbAnchorWriteSchema: z.ZodObject<{
124
124
  resolved_at: z.ZodOptional<z.ZodString>;
125
125
  lines: z.ZodOptional<z.ZodNumber>;
126
126
  resolver: z.ZodOptional<z.ZodEnum<{
127
- span: "span";
128
127
  "tree-sitter": "tree-sitter";
129
128
  regex: "regex";
129
+ span: "span";
130
+ }>>;
131
+ }, z.core.$strict>;
132
+ /**
133
+ * An anchor's address, with none of the baseline a resolver stamps: a `hash`
134
+ * under a locator is an unknown key. Picked rather than respelled, so a new
135
+ * locator field on the anchor is one here too. See
136
+ * `contract.anchor-locator-is-the-address-half-of-an-anchor`.
137
+ */
138
+ declare const kbAnchorLocatorSchema: z.ZodObject<{
139
+ symbol: z.ZodOptional<z.ZodString>;
140
+ span: z.ZodOptional<z.ZodObject<{
141
+ start: z.ZodNumber;
142
+ end: z.ZodNumber;
143
+ }, z.core.$strict>>;
144
+ file: z.ZodString;
145
+ ref: z.ZodOptional<z.ZodString>;
146
+ side: z.ZodOptional<z.ZodEnum<{
147
+ old: "old";
148
+ new: "new";
130
149
  }>>;
150
+ repo: z.ZodOptional<z.ZodString>;
131
151
  }, z.core.$strict>;
132
152
  /**
133
153
  * One typed causal edge, as the frontmatter stores it.
@@ -211,9 +231,9 @@ declare const kbRecordFrontmatterSchema: z.ZodObject<{
211
231
  resolved_at: z.ZodOptional<z.ZodString>;
212
232
  lines: z.ZodOptional<z.ZodNumber>;
213
233
  resolver: z.ZodOptional<z.ZodEnum<{
214
- span: "span";
215
234
  "tree-sitter": "tree-sitter";
216
235
  regex: "regex";
236
+ span: "span";
217
237
  }>>;
218
238
  }, z.core.$strict>>>;
219
239
  strauss_verify: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -222,11 +242,11 @@ declare const kbRecordFrontmatterSchema: z.ZodObject<{
222
242
  rel: z.ZodString;
223
243
  }, z.core.$loose>>>;
224
244
  strauss_status: z.ZodDefault<z.ZodEnum<{
245
+ resolved: "resolved";
225
246
  draft: "draft";
226
247
  proposed: "proposed";
227
248
  accepted: "accepted";
228
249
  open: "open";
229
- resolved: "resolved";
230
250
  rejected: "rejected";
231
251
  superseded: "superseded";
232
252
  }>>;
@@ -254,6 +274,7 @@ type KbActorStamp = z.infer<typeof kbActorStampSchema>;
254
274
  type KbVerifiedEvent = z.infer<typeof kbVerifiedEventSchema>;
255
275
  type KbAnchorSpan = z.infer<typeof kbAnchorSpanSchema>;
256
276
  type KbAnchor = z.infer<typeof kbAnchorSchema>;
277
+ type KbAnchorLocator = z.infer<typeof kbAnchorLocatorSchema>;
257
278
  type KbLink = z.infer<typeof kbLinkSchema>;
258
279
  type KbRecordFrontmatter = z.infer<typeof kbRecordFrontmatterSchema>;
259
280
  type KbRecord = {
@@ -1032,14 +1053,187 @@ declare function impact(targetId: string, bundle: KbRecord[], options?: KbImpact
1032
1053
  declare function inboundIndex(bundle: KbRecord[]): Map<string, KbInboundEdge[]>;
1033
1054
 
1034
1055
  declare const LOG_FILE = "log.jsonl";
1056
+ /**
1057
+ * One pointer change, as an `anchor-set` entry records it: `from` for a move or
1058
+ * a drop, `to` for a move or an addition. Locators only — the log says which
1059
+ * pointer moved, never what it was hashed against. Derived from the record
1060
+ * before and after, so it reports what happened rather than what was asked.
1061
+ */
1062
+ declare const kbLogAnchorChangeSchema: z.ZodObject<{
1063
+ op: z.ZodEnum<{
1064
+ move: "move";
1065
+ add: "add";
1066
+ drop: "drop";
1067
+ }>;
1068
+ from: z.ZodOptional<z.ZodObject<{
1069
+ symbol: z.ZodOptional<z.ZodString>;
1070
+ span: z.ZodOptional<z.ZodObject<{
1071
+ start: z.ZodNumber;
1072
+ end: z.ZodNumber;
1073
+ }, z.core.$strict>>;
1074
+ file: z.ZodString;
1075
+ ref: z.ZodOptional<z.ZodString>;
1076
+ side: z.ZodOptional<z.ZodEnum<{
1077
+ old: "old";
1078
+ new: "new";
1079
+ }>>;
1080
+ repo: z.ZodOptional<z.ZodString>;
1081
+ }, z.core.$strict>>;
1082
+ to: z.ZodOptional<z.ZodObject<{
1083
+ symbol: z.ZodOptional<z.ZodString>;
1084
+ span: z.ZodOptional<z.ZodObject<{
1085
+ start: z.ZodNumber;
1086
+ end: z.ZodNumber;
1087
+ }, z.core.$strict>>;
1088
+ file: z.ZodString;
1089
+ ref: z.ZodOptional<z.ZodString>;
1090
+ side: z.ZodOptional<z.ZodEnum<{
1091
+ old: "old";
1092
+ new: "new";
1093
+ }>>;
1094
+ repo: z.ZodOptional<z.ZodString>;
1095
+ }, z.core.$strict>>;
1096
+ }, z.core.$strict>;
1097
+ declare const kbLogEntryFields: z.ZodObject<{
1098
+ at: z.ZodISODateTime;
1099
+ by: z.ZodString;
1100
+ operation: z.ZodString;
1101
+ conceptId: z.ZodString;
1102
+ target: z.ZodOptional<z.ZodString>;
1103
+ reason: z.ZodOptional<z.ZodString>;
1104
+ anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1105
+ op: z.ZodEnum<{
1106
+ move: "move";
1107
+ add: "add";
1108
+ drop: "drop";
1109
+ }>;
1110
+ from: z.ZodOptional<z.ZodObject<{
1111
+ symbol: z.ZodOptional<z.ZodString>;
1112
+ span: z.ZodOptional<z.ZodObject<{
1113
+ start: z.ZodNumber;
1114
+ end: z.ZodNumber;
1115
+ }, z.core.$strict>>;
1116
+ file: z.ZodString;
1117
+ ref: z.ZodOptional<z.ZodString>;
1118
+ side: z.ZodOptional<z.ZodEnum<{
1119
+ old: "old";
1120
+ new: "new";
1121
+ }>>;
1122
+ repo: z.ZodOptional<z.ZodString>;
1123
+ }, z.core.$strict>>;
1124
+ to: z.ZodOptional<z.ZodObject<{
1125
+ symbol: z.ZodOptional<z.ZodString>;
1126
+ span: z.ZodOptional<z.ZodObject<{
1127
+ start: z.ZodNumber;
1128
+ end: z.ZodNumber;
1129
+ }, z.core.$strict>>;
1130
+ file: z.ZodString;
1131
+ ref: z.ZodOptional<z.ZodString>;
1132
+ side: z.ZodOptional<z.ZodEnum<{
1133
+ old: "old";
1134
+ new: "new";
1135
+ }>>;
1136
+ repo: z.ZodOptional<z.ZodString>;
1137
+ }, z.core.$strict>>;
1138
+ }, z.core.$strict>>>;
1139
+ }, z.core.$strip>;
1140
+ /**
1141
+ * Read-side, and tolerant of a key it has never heard of: one base is read by
1142
+ * every version that touches the repository, so a log has to read *forward*.
1143
+ * Under `.strict()` the first version to add a field turned its own entries
1144
+ * into `malformed` for every older reader — the entries an audit most needs
1145
+ * were the only ones that vanished. A line missing a required field, or
1146
+ * carrying an `at` that is not an ISO datetime, is still malformed.
1147
+ */
1035
1148
  declare const kbLogEntrySchema: z.ZodObject<{
1036
1149
  at: z.ZodISODateTime;
1037
1150
  by: z.ZodString;
1038
1151
  operation: z.ZodString;
1039
1152
  conceptId: z.ZodString;
1040
1153
  target: z.ZodOptional<z.ZodString>;
1154
+ reason: z.ZodOptional<z.ZodString>;
1155
+ anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1156
+ op: z.ZodEnum<{
1157
+ move: "move";
1158
+ add: "add";
1159
+ drop: "drop";
1160
+ }>;
1161
+ from: z.ZodOptional<z.ZodObject<{
1162
+ symbol: z.ZodOptional<z.ZodString>;
1163
+ span: z.ZodOptional<z.ZodObject<{
1164
+ start: z.ZodNumber;
1165
+ end: z.ZodNumber;
1166
+ }, z.core.$strict>>;
1167
+ file: z.ZodString;
1168
+ ref: z.ZodOptional<z.ZodString>;
1169
+ side: z.ZodOptional<z.ZodEnum<{
1170
+ old: "old";
1171
+ new: "new";
1172
+ }>>;
1173
+ repo: z.ZodOptional<z.ZodString>;
1174
+ }, z.core.$strict>>;
1175
+ to: z.ZodOptional<z.ZodObject<{
1176
+ symbol: z.ZodOptional<z.ZodString>;
1177
+ span: z.ZodOptional<z.ZodObject<{
1178
+ start: z.ZodNumber;
1179
+ end: z.ZodNumber;
1180
+ }, z.core.$strict>>;
1181
+ file: z.ZodString;
1182
+ ref: z.ZodOptional<z.ZodString>;
1183
+ side: z.ZodOptional<z.ZodEnum<{
1184
+ old: "old";
1185
+ new: "new";
1186
+ }>>;
1187
+ repo: z.ZodOptional<z.ZodString>;
1188
+ }, z.core.$strict>>;
1189
+ }, z.core.$strict>>>;
1190
+ }, z.core.$loose>;
1191
+ /** Write-side: this package controls exactly what it appends. */
1192
+ declare const kbLogEntryWriteSchema: z.ZodObject<{
1193
+ at: z.ZodISODateTime;
1194
+ by: z.ZodString;
1195
+ operation: z.ZodString;
1196
+ conceptId: z.ZodString;
1197
+ target: z.ZodOptional<z.ZodString>;
1198
+ reason: z.ZodOptional<z.ZodString>;
1199
+ anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1200
+ op: z.ZodEnum<{
1201
+ move: "move";
1202
+ add: "add";
1203
+ drop: "drop";
1204
+ }>;
1205
+ from: z.ZodOptional<z.ZodObject<{
1206
+ symbol: z.ZodOptional<z.ZodString>;
1207
+ span: z.ZodOptional<z.ZodObject<{
1208
+ start: z.ZodNumber;
1209
+ end: z.ZodNumber;
1210
+ }, z.core.$strict>>;
1211
+ file: z.ZodString;
1212
+ ref: z.ZodOptional<z.ZodString>;
1213
+ side: z.ZodOptional<z.ZodEnum<{
1214
+ old: "old";
1215
+ new: "new";
1216
+ }>>;
1217
+ repo: z.ZodOptional<z.ZodString>;
1218
+ }, z.core.$strict>>;
1219
+ to: z.ZodOptional<z.ZodObject<{
1220
+ symbol: z.ZodOptional<z.ZodString>;
1221
+ span: z.ZodOptional<z.ZodObject<{
1222
+ start: z.ZodNumber;
1223
+ end: z.ZodNumber;
1224
+ }, z.core.$strict>>;
1225
+ file: z.ZodString;
1226
+ ref: z.ZodOptional<z.ZodString>;
1227
+ side: z.ZodOptional<z.ZodEnum<{
1228
+ old: "old";
1229
+ new: "new";
1230
+ }>>;
1231
+ repo: z.ZodOptional<z.ZodString>;
1232
+ }, z.core.$strict>>;
1233
+ }, z.core.$strict>>>;
1041
1234
  }, z.core.$strict>;
1042
- type KbLogEntry = z.infer<typeof kbLogEntrySchema>;
1235
+ type KbLogEntry = z.infer<typeof kbLogEntryFields>;
1236
+ type KbLogAnchorChange = z.infer<typeof kbLogAnchorChangeSchema>;
1043
1237
  /**
1044
1238
  * The log is the bundle's only primary artifact, and the reason it is handled
1045
1239
  * unlike `INDEX.md`.
@@ -1156,6 +1350,14 @@ type KbWriteInput = {
1156
1350
  /** Replace an existing record rather than failing on the collision. */
1157
1351
  overwrite?: boolean;
1158
1352
  };
1353
+ /**
1354
+ * What a patching caller hands `updateAnchors`. Omitting `log` keeps the
1355
+ * default `anchor-resolve` entry.
1356
+ */
1357
+ type KbAnchorWrite = {
1358
+ anchors: KbAnchor[];
1359
+ log?: Omit<KbLogEntry, "at" | "conceptId" | "by">;
1360
+ };
1159
1361
  /** What a record had to still be for `deleteRecord` to remove it. */
1160
1362
  type KbDeleteExpectation = {
1161
1363
  tag: string;
@@ -1220,16 +1422,12 @@ declare class KbStore {
1220
1422
  */
1221
1423
  setStatus(bundlePath: string, conceptId: string, status: KbRecordStatus, actor?: string): Promise<KbRecord>;
1222
1424
  /**
1223
- * Replaces a record's anchors wholesale, preserving everything else.
1224
- *
1225
- * Wholesale rather than merged: the caller just resolved the anchors it is
1226
- * writing, so it holds the complete current set, and a merge would keep
1227
- * stale entries the resolution pass deliberately dropped.
1228
- *
1229
- * Through the write schema: this is a write, and a defect a hand-edit put in
1230
- * the frontmatter must not be published back out under an actor stamp.
1425
+ * Replaces a record's anchors, preserving everything else. An array is the
1426
+ * whole set; a function is a patch and runs inside the mutation, against
1427
+ * the anchors the record holds then see
1428
+ * `decision.anchor-update-patch-inside-mutation`.
1231
1429
  */
1232
- updateAnchors(bundlePath: string, conceptId: string, anchors: KbAnchor[], actor?: string): Promise<KbRecord>;
1430
+ updateAnchors(bundlePath: string, conceptId: string, anchors: KbAnchor[] | ((current: KbAnchor[]) => KbAnchorWrite), actor?: string): Promise<KbRecord>;
1233
1431
  /**
1234
1432
  * Appends one `verified[]` event: who checked the record, when, and what the
1235
1433
  * check found. Append-only — prior events are history, and are spread into
@@ -1500,6 +1698,7 @@ declare enum Fault {
1500
1698
  /** Machine-readable discriminant, stable across message rewording. */
1501
1699
  declare enum ErrorTypes {
1502
1700
  KbRecordAlreadyExists = "KbRecordAlreadyExists",
1701
+ KbAnchorSetDuplicate = "KbAnchorSetDuplicate",
1503
1702
  KbClassifyInput = "KbClassifyInput",
1504
1703
  KbFlagConflict = "KbFlagConflict",
1505
1704
  KbInvalidActor = "KbInvalidActor",
@@ -1826,9 +2025,9 @@ declare const composeInputSchema: z.ZodObject<{
1826
2025
  resolved_at: z.ZodOptional<z.ZodString>;
1827
2026
  lines: z.ZodOptional<z.ZodNumber>;
1828
2027
  resolver: z.ZodOptional<z.ZodEnum<{
1829
- span: "span";
1830
2028
  "tree-sitter": "tree-sitter";
1831
2029
  regex: "regex";
2030
+ span: "span";
1832
2031
  }>>;
1833
2032
  }, z.core.$strict>>>;
1834
2033
  sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2634,9 +2833,9 @@ declare const decisionInputSchema: z.ZodObject<{
2634
2833
  resolved_at: z.ZodOptional<z.ZodString>;
2635
2834
  lines: z.ZodOptional<z.ZodNumber>;
2636
2835
  resolver: z.ZodOptional<z.ZodEnum<{
2637
- span: "span";
2638
2836
  "tree-sitter": "tree-sitter";
2639
2837
  regex: "regex";
2838
+ span: "span";
2640
2839
  }>>;
2641
2840
  }, z.core.$strict>>>;
2642
2841
  verify: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -2693,6 +2892,83 @@ declare function selectDecisions(records: KbRecord[]): KbRecord[];
2693
2892
  declare const KB_COMMANDS: KbCommand[];
2694
2893
  declare const KB_COMMANDS_BY_NAME: Map<string, KbCommand>;
2695
2894
 
2895
+ /** One change the write made, as the result and the log entry report it. */
2896
+ type KbAnchorChange = {
2897
+ /** `move` keeps a baseline under a new address; `add` and `drop` are plain. */
2898
+ op: "move" | "add" | "drop";
2899
+ from?: KbAnchorLocator;
2900
+ to?: KbAnchorLocator;
2901
+ };
2902
+ type KbAnchorSetOutcome = {
2903
+ anchors: KbAnchor[];
2904
+ changes: KbAnchorChange[];
2905
+ };
2906
+ /**
2907
+ * Checks a proposed anchor set and says what changed against the current one.
2908
+ * Accepted as given — whether the code behind a pointer was read is the
2909
+ * caller's claim, recorded in the log, not something this can check. Refuses
2910
+ * only two anchors at one address.
2911
+ */
2912
+ declare function applyAnchorSet(current: KbAnchor[], incoming: KbAnchor[]): KbAnchorSetOutcome;
2913
+ /** An anchor's address, without the baseline a resolver stamped onto it. */
2914
+ declare function locatorOf(anchor: KbAnchor): KbAnchorLocator;
2915
+
2916
+ /** Two anchors at one address: they would drift and rebaseline as a pair. */
2917
+ declare class KbAnchorSetDuplicateError extends BaseError {
2918
+ readonly locator: string;
2919
+ constructor(locator: string);
2920
+ }
2921
+
2922
+ /**
2923
+ * The record's anchors, as the caller means them to end up.
2924
+ *
2925
+ * A whole set rather than a patch: the caller has just read the record, so it
2926
+ * holds every anchor including its baseline, and carrying one forward under a
2927
+ * new symbol is a field edit rather than an operation to name.
2928
+ */
2929
+ declare const anchorSetInputSchema: z.ZodObject<{
2930
+ reason: z.ZodString;
2931
+ anchors: z.ZodArray<z.ZodObject<{
2932
+ file: z.ZodString;
2933
+ symbol: z.ZodOptional<z.ZodString>;
2934
+ span: z.ZodOptional<z.ZodObject<{
2935
+ start: z.ZodNumber;
2936
+ end: z.ZodNumber;
2937
+ }, z.core.$strict>>;
2938
+ side: z.ZodOptional<z.ZodEnum<{
2939
+ old: "old";
2940
+ new: "new";
2941
+ }>>;
2942
+ repo: z.ZodOptional<z.ZodString>;
2943
+ ref: z.ZodOptional<z.ZodString>;
2944
+ hash: z.ZodOptional<z.ZodString>;
2945
+ hash_kind: z.ZodOptional<z.ZodEnum<{
2946
+ raw: "raw";
2947
+ ast: "ast";
2948
+ }>>;
2949
+ resolved_at: z.ZodOptional<z.ZodString>;
2950
+ lines: z.ZodOptional<z.ZodNumber>;
2951
+ resolver: z.ZodOptional<z.ZodEnum<{
2952
+ "tree-sitter": "tree-sitter";
2953
+ regex: "regex";
2954
+ span: "span";
2955
+ }>>;
2956
+ }, z.core.$strict>>;
2957
+ }, z.core.$strict>;
2958
+ type AnchorSetInput = z.infer<typeof anchorSetInputSchema>;
2959
+ type KbAnchorSetResult = {
2960
+ conceptId: string;
2961
+ reason: string;
2962
+ /** Unchanged anchors are not listed; a no-op write reports nothing. */
2963
+ changes: KbAnchorChange[];
2964
+ anchors: KbAnchor[];
2965
+ /** `stamped` when `resolve` ran; `unchanged` otherwise. */
2966
+ baseline: "unchanged" | "stamped";
2967
+ /** anchor-resolve's per-anchor results, when `resolve` ran. */
2968
+ resolved?: unknown[];
2969
+ note: string;
2970
+ };
2971
+
2696
2972
  /**
2697
2973
  * Listing candidates and promoting share one input, and the two need different
2698
2974
  * arguments. The rule lives here rather than in `run` so both surfaces refuse
@@ -3082,4 +3358,4 @@ declare function parseMarkdownWithFrontmatter<S extends z.ZodType>(text: string,
3082
3358
  frontmatter: ReturnType<S["safeParse"]>;
3083
3359
  };
3084
3360
 
3085
- export { type AnchorResolution, type AnchorResolver, type AnchorResolverName, BaseError, CONTEXT_BEGIN, CONTEXT_END, CONTEXT_PROFILES, type ClassifiedAnchor, type ComposeInput, type ComposeLink, type ComposedRecord, DECISION_TYPE, DEFAULT_AGING_DAYS, DEFAULT_EXPIRING_DAYS, DEFAULT_LOAD_BUDGET, DEFAULT_PACK_HOPS, DEFAULT_PACK_MAX_NODES, DEFAULT_THRESHOLDS, DEFAULT_TYPED_LINK_RELS, DEFAULT_UNVERIFIED_DAYS, type DecisionInput, type DiffFile, type DiffHunk, type DiffMatch, type ErrorDetails, type ErrorProps, ErrorTypes, Fault, type Grammar, type GrammarManifest, type GrammarOptions, INDEX_FILE, KB_CAUSAL_LINK_RELS, KB_CLASSES, KB_COMMANDS, KB_COMMANDS_BY_NAME, KB_CONCEPT_ID_PATTERN, KB_CONFIDENCES, KB_DIR, KB_DOCTOR_CHECKS, KB_EDGE_KINDS, KB_LINK_RELS, KB_MATERIALITIES, KB_RECORD_STATUSES, KB_RECORD_TYPES, KB_SLUG_PATTERN, type KbActorStamp, type KbAdjudicated, type KbAnchor, type KbAnchorDriftEntry, type KbAnchorSpan, type KbBacklink, type KbBacklinksResult, KbBaseFrozenError, type KbCatalogEntry, type KbCatalogResult, type KbClass, type KbClassifiedFile, type KbClassifiedHunk, type KbClassifyFile, KbClassifyInputError, type KbClassifyOptions, type KbClassifyResult, type KbClassifyThresholds, type KbCommand, type KbCommandContext, type KbContextBudgets, type KbContextOptions, type KbContextResult, type KbDoctorCheck, type KbDoctorFinding, type KbDoctorGroup, type KbDoctorOptions, type KbDoctorReport, type KbDoctorThresholds, type KbDroppedLink, type KbEdgeKind, type KbExportForeignFile, type KbExportResult, type KbExportedDecision, type KbImpactOptions, type KbImpactResult, type KbImpactedRecord, type KbInboundEdge, KbInvalidConceptIdError, type KbLink, type KbLinkEdge, type KbLinkRel, type KbLinkRelSpec, type KbLoadResult, type KbLogEntry, type KbLogReadResult, type KbLogger, type KbMatch, type KbMatchRecord, type KbMergedPin, type KbMergedPins, KbMissingFlagValueError, type KbNeighbour, KbPackBudgetExceededError, type KbPackOptions, type KbPackResult, type KbPackedRecord, type KbPin, type KbPinLayer, type KbPinOptions, type KbPinResult, type KbPinStatus, KbPinsMalformedError, type KbPinsManifest, type KbPromoteCandidate, KbPromoteCollisionError, type KbPromoteResult, KbPromoteSelfError, KbPromoteStandingError, KbPromoteStoppedError, type KbPromotedRecord, type KbReassessAnchor, type KbReassessDefault, type KbReassessDiff, type KbReassessPacket, type KbRecord, KbRecordAlreadyExistsError, type KbRecordFrontmatter, KbRecordNotFoundError, type KbRecordStatus, type KbRecordType, type KbRecordTypeSpec, type KbSearchLogger, KbSelfVerificationError, type KbSource, type KbStanding, KbStore, type KbSupersededStub, type KbSyncResult, type KbTagFilter, type KbTraceEdge, type KbTraceOptions, type KbTraceStep, KbUnknownLinkRelError, type KbValidationProblem, type KbValidationSeverity, type KbVerdict, type KbVerifiedEvent, type KbWarning, KbWriteConflictError, type KbWriteInput, LINK_RELS, LOG_FILE, type MatchOptions, NO_DECISION_SLUG, PINS_FILE, PINS_LOCAL_FILE, PIN_LAYERS, PROMOTION_SOURCE_ID, type QmdModule, RECORD_TYPES, type RemoteAnchorState, type RemoteOptions, type RemoteRead, type ResolvedSymbol, type ResolverAttempt, type ResolverAttemptOptions, SEARCH_INDEX_FILE, type SearchHit, type SearchOptions, type SymbolRange, type SymbolRangeIndex, TRACE_EDGES, TreeSitterResolver, adjudicate, anchorFilePath, anchorOnHunk, assertBaseNotFrozen, backlinks, buildContext, carry, catalog, classifyDiff, classifyDrift, composeDecisionRecord, composeInputSchema, composeLinkSchema, composeNoDecisionRecord, composeRecord, contextProfileBudgets, createKbMcpServer, decisionInputSchema, defaultAnchorResolvers, detectAnchorDrift, doctor, edgeNeighbours, ensureGrammar, grammarHints, grammarManifest, grammarsCacheRoot, hashAnchorText, impact, inboundIndex, indexIsStale, isCanonicalRepoUrl, isKbLinkRel, isKbRecordType, isNoDecisionRecord, isReviewTag, kbActorStampSchema, kbAnchorSchema, kbAnchorSpanSchema, kbAnchorWriteSchema, kbConceptIdSchema, kbJsonSchemas, kbLinkSchema, kbLogEntrySchema, kbRecordFrontmatterSchema, kbSourceSchema, kbVerifiedEventSchema, languageForFile, listPins, loadQmd, matchToDiff, matchesTags, mergedContextBudgets, neighbours, pack, parseLog, parseMarkdownWithFrontmatter, pinBase, prepareResolvers, promoteCandidates, promoteInputSchema, readMergedPins, readPinsLayer, readRemoteAnchors, reassessPacket, regexResolver, renderCatalogLine, renderIndex, renderIndexLine, renderLogEntry, repoCacheDir, resolveAnchor, resolveAnchorSpan, resolveHeads, resolveHits, resolvePinPath, runKbCli, runKbMcpServer, searchBase, selectDecisions, splitMarkdownFrontmatter, stringifyMarkdownWithFrontmatter, symbolRangeIndex, syncInstructions, toHookJson, trace, treeSitterLanguages, unifiedDiff, unpinBase, validateBundle };
3361
+ export { type AnchorResolution, type AnchorResolver, type AnchorResolverName, type AnchorSetInput, BaseError, CONTEXT_BEGIN, CONTEXT_END, CONTEXT_PROFILES, type ClassifiedAnchor, type ComposeInput, type ComposeLink, type ComposedRecord, DECISION_TYPE, DEFAULT_AGING_DAYS, DEFAULT_EXPIRING_DAYS, DEFAULT_LOAD_BUDGET, DEFAULT_PACK_HOPS, DEFAULT_PACK_MAX_NODES, DEFAULT_THRESHOLDS, DEFAULT_TYPED_LINK_RELS, DEFAULT_UNVERIFIED_DAYS, type DecisionInput, type DiffFile, type DiffHunk, type DiffMatch, type ErrorDetails, type ErrorProps, ErrorTypes, Fault, type Grammar, type GrammarManifest, type GrammarOptions, INDEX_FILE, KB_CAUSAL_LINK_RELS, KB_CLASSES, KB_COMMANDS, KB_COMMANDS_BY_NAME, KB_CONCEPT_ID_PATTERN, KB_CONFIDENCES, KB_DIR, KB_DOCTOR_CHECKS, KB_EDGE_KINDS, KB_LINK_RELS, KB_MATERIALITIES, KB_RECORD_STATUSES, KB_RECORD_TYPES, KB_SLUG_PATTERN, type KbActorStamp, type KbAdjudicated, type KbAnchor, type KbAnchorChange, type KbAnchorDriftEntry, type KbAnchorLocator, KbAnchorSetDuplicateError, type KbAnchorSetOutcome, type KbAnchorSetResult, type KbAnchorSpan, type KbAnchorWrite, type KbBacklink, type KbBacklinksResult, KbBaseFrozenError, type KbCatalogEntry, type KbCatalogResult, type KbClass, type KbClassifiedFile, type KbClassifiedHunk, type KbClassifyFile, KbClassifyInputError, type KbClassifyOptions, type KbClassifyResult, type KbClassifyThresholds, type KbCommand, type KbCommandContext, type KbContextBudgets, type KbContextOptions, type KbContextResult, type KbDoctorCheck, type KbDoctorFinding, type KbDoctorGroup, type KbDoctorOptions, type KbDoctorReport, type KbDoctorThresholds, type KbDroppedLink, type KbEdgeKind, type KbExportForeignFile, type KbExportResult, type KbExportedDecision, type KbImpactOptions, type KbImpactResult, type KbImpactedRecord, type KbInboundEdge, KbInvalidConceptIdError, type KbLink, type KbLinkEdge, type KbLinkRel, type KbLinkRelSpec, type KbLoadResult, type KbLogAnchorChange, type KbLogEntry, type KbLogReadResult, type KbLogger, type KbMatch, type KbMatchRecord, type KbMergedPin, type KbMergedPins, KbMissingFlagValueError, type KbNeighbour, KbPackBudgetExceededError, type KbPackOptions, type KbPackResult, type KbPackedRecord, type KbPin, type KbPinLayer, type KbPinOptions, type KbPinResult, type KbPinStatus, KbPinsMalformedError, type KbPinsManifest, type KbPromoteCandidate, KbPromoteCollisionError, type KbPromoteResult, KbPromoteSelfError, KbPromoteStandingError, KbPromoteStoppedError, type KbPromotedRecord, type KbReassessAnchor, type KbReassessDefault, type KbReassessDiff, type KbReassessPacket, type KbRecord, KbRecordAlreadyExistsError, type KbRecordFrontmatter, KbRecordNotFoundError, type KbRecordStatus, type KbRecordType, type KbRecordTypeSpec, type KbSearchLogger, KbSelfVerificationError, type KbSource, type KbStanding, KbStore, type KbSupersededStub, type KbSyncResult, type KbTagFilter, type KbTraceEdge, type KbTraceOptions, type KbTraceStep, KbUnknownLinkRelError, type KbValidationProblem, type KbValidationSeverity, type KbVerdict, type KbVerifiedEvent, type KbWarning, KbWriteConflictError, type KbWriteInput, LINK_RELS, LOG_FILE, type MatchOptions, NO_DECISION_SLUG, PINS_FILE, PINS_LOCAL_FILE, PIN_LAYERS, PROMOTION_SOURCE_ID, type QmdModule, RECORD_TYPES, type RemoteAnchorState, type RemoteOptions, type RemoteRead, type ResolvedSymbol, type ResolverAttempt, type ResolverAttemptOptions, SEARCH_INDEX_FILE, type SearchHit, type SearchOptions, type SymbolRange, type SymbolRangeIndex, TRACE_EDGES, TreeSitterResolver, adjudicate, anchorFilePath, anchorOnHunk, anchorSetInputSchema, applyAnchorSet, assertBaseNotFrozen, backlinks, buildContext, carry, catalog, classifyDiff, classifyDrift, composeDecisionRecord, composeInputSchema, composeLinkSchema, composeNoDecisionRecord, composeRecord, contextProfileBudgets, createKbMcpServer, decisionInputSchema, defaultAnchorResolvers, detectAnchorDrift, doctor, edgeNeighbours, ensureGrammar, grammarHints, grammarManifest, grammarsCacheRoot, hashAnchorText, impact, inboundIndex, indexIsStale, isCanonicalRepoUrl, isKbLinkRel, isKbRecordType, isNoDecisionRecord, isReviewTag, kbActorStampSchema, kbAnchorLocatorSchema, kbAnchorSchema, kbAnchorSpanSchema, kbAnchorWriteSchema, kbConceptIdSchema, kbJsonSchemas, kbLinkSchema, kbLogAnchorChangeSchema, kbLogEntrySchema, kbLogEntryWriteSchema, kbRecordFrontmatterSchema, kbSourceSchema, kbVerifiedEventSchema, languageForFile, listPins, loadQmd, locatorOf, matchToDiff, matchesTags, mergedContextBudgets, neighbours, pack, parseLog, parseMarkdownWithFrontmatter, pinBase, prepareResolvers, promoteCandidates, promoteInputSchema, readMergedPins, readPinsLayer, readRemoteAnchors, reassessPacket, regexResolver, renderCatalogLine, renderIndex, renderIndexLine, renderLogEntry, repoCacheDir, resolveAnchor, resolveAnchorSpan, resolveHeads, resolveHits, resolvePinPath, runKbCli, runKbMcpServer, searchBase, selectDecisions, splitMarkdownFrontmatter, stringifyMarkdownWithFrontmatter, symbolRangeIndex, syncInstructions, toHookJson, trace, treeSitterLanguages, unifiedDiff, unpinBase, validateBundle };
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  runKbCli
3
- } from "./chunk-VXWN62HT.js";
3
+ } from "./chunk-DVSPHL4B.js";
4
4
  import {
5
5
  createKbMcpServer,
6
6
  runKbMcpServer
7
- } from "./chunk-WVJULVGY.js";
7
+ } from "./chunk-TSE4YQEG.js";
8
8
  import {
9
9
  BaseError,
10
10
  CONTEXT_BEGIN,
@@ -36,6 +36,7 @@ import {
36
36
  KB_RECORD_STATUSES,
37
37
  KB_RECORD_TYPES,
38
38
  KB_SLUG_PATTERN,
39
+ KbAnchorSetDuplicateError,
39
40
  KbBaseFrozenError,
40
41
  KbClassifyInputError,
41
42
  KbInvalidConceptIdError,
@@ -66,6 +67,8 @@ import {
66
67
  adjudicate,
67
68
  anchorFilePath,
68
69
  anchorOnHunk,
70
+ anchorSetInputSchema,
71
+ applyAnchorSet,
69
72
  assertBaseNotFrozen,
70
73
  backlinks,
71
74
  buildContext,
@@ -98,19 +101,23 @@ import {
98
101
  isNoDecisionRecord,
99
102
  isReviewTag,
100
103
  kbActorStampSchema,
104
+ kbAnchorLocatorSchema,
101
105
  kbAnchorSchema,
102
106
  kbAnchorSpanSchema,
103
107
  kbAnchorWriteSchema,
104
108
  kbConceptIdSchema,
105
109
  kbJsonSchemas,
106
110
  kbLinkSchema,
111
+ kbLogAnchorChangeSchema,
107
112
  kbLogEntrySchema,
113
+ kbLogEntryWriteSchema,
108
114
  kbRecordFrontmatterSchema,
109
115
  kbSourceSchema,
110
116
  kbVerifiedEventSchema,
111
117
  languageForFile,
112
118
  listPins,
113
119
  loadQmd,
120
+ locatorOf,
114
121
  matchToDiff,
115
122
  matchesTags,
116
123
  mergedContextBudgets,
@@ -149,7 +156,7 @@ import {
149
156
  unifiedDiff,
150
157
  unpinBase,
151
158
  validateBundle
152
- } from "./chunk-XBZ7G5R5.js";
159
+ } from "./chunk-AEO5U42S.js";
153
160
  export {
154
161
  BaseError,
155
162
  CONTEXT_BEGIN,
@@ -181,6 +188,7 @@ export {
181
188
  KB_RECORD_STATUSES,
182
189
  KB_RECORD_TYPES,
183
190
  KB_SLUG_PATTERN,
191
+ KbAnchorSetDuplicateError,
184
192
  KbBaseFrozenError,
185
193
  KbClassifyInputError,
186
194
  KbInvalidConceptIdError,
@@ -211,6 +219,8 @@ export {
211
219
  adjudicate,
212
220
  anchorFilePath,
213
221
  anchorOnHunk,
222
+ anchorSetInputSchema,
223
+ applyAnchorSet,
214
224
  assertBaseNotFrozen,
215
225
  backlinks,
216
226
  buildContext,
@@ -244,19 +254,23 @@ export {
244
254
  isNoDecisionRecord,
245
255
  isReviewTag,
246
256
  kbActorStampSchema,
257
+ kbAnchorLocatorSchema,
247
258
  kbAnchorSchema,
248
259
  kbAnchorSpanSchema,
249
260
  kbAnchorWriteSchema,
250
261
  kbConceptIdSchema,
251
262
  kbJsonSchemas,
252
263
  kbLinkSchema,
264
+ kbLogAnchorChangeSchema,
253
265
  kbLogEntrySchema,
266
+ kbLogEntryWriteSchema,
254
267
  kbRecordFrontmatterSchema,
255
268
  kbSourceSchema,
256
269
  kbVerifiedEventSchema,
257
270
  languageForFile,
258
271
  listPins,
259
272
  loadQmd,
273
+ locatorOf,
260
274
  matchToDiff,
261
275
  matchesTags,
262
276
  mergedContextBudgets,