@fenglimg/fabric-shared 2.2.0 → 2.3.0-rc.2

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.
@@ -1,425 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- type AgentsTopologyType = "mirror" | "cross-cutting" | "domain" | "local" | "global";
4
- type AgentsIdentitySource = "declared" | "derived";
5
- interface RuleDescription {
6
- summary: string;
7
- intent_clues: string[];
8
- tech_stack: string[];
9
- impact: string[];
10
- must_read_if: string;
11
- entities?: string[];
12
- id?: string;
13
- knowledge_type?: "models" | "decisions" | "guidelines" | "pitfalls" | "processes";
14
- maturity?: "draft" | "verified" | "proven";
15
- knowledge_layer?: "personal" | "team";
16
- semantic_scope?: string;
17
- layer_reason?: string;
18
- created_at?: string;
19
- tags?: string[];
20
- relevance_scope?: "narrow" | "broad";
21
- relevance_paths?: string[];
22
- related?: string[];
23
- }
24
- interface RuleDescriptionIndexItem {
25
- stable_id: string;
26
- description: RuleDescription;
27
- always_active?: boolean;
28
- }
29
- interface AgentsMetaNode {
30
- file: string;
31
- content_ref?: string;
32
- scope_glob: string;
33
- hash: string;
34
- stable_id?: string;
35
- identity_source?: AgentsIdentitySource;
36
- description?: RuleDescription;
37
- sections?: string[];
38
- deps?: string[];
39
- priority?: "high" | "medium" | "low";
40
- topology_type?: AgentsTopologyType;
41
- }
42
- interface AgentsMetaKnowledgeTypeCounters {
43
- MOD: number;
44
- DEC: number;
45
- GLD: number;
46
- PIT: number;
47
- PRO: number;
48
- }
49
- interface AgentsMetaCountersEnvelope {
50
- KP: AgentsMetaKnowledgeTypeCounters;
51
- KT: AgentsMetaKnowledgeTypeCounters;
52
- }
53
- interface AgentsMeta {
54
- revision: string;
55
- nodes: Record<string, AgentsMetaNode>;
56
- counters?: AgentsMetaCountersEnvelope;
57
- }
58
-
59
- interface AiLedgerEntry {
60
- id?: string;
61
- ts: number;
62
- source: "ai";
63
- commit_sha?: string;
64
- intent: string;
65
- affected_paths: string[];
66
- }
67
- interface HumanLedgerEntry {
68
- id?: string;
69
- ts: number;
70
- source: "human";
71
- parent_sha: string;
72
- parent_ledger_entry_id?: string;
73
- intent: string;
74
- affected_paths: string[];
75
- diff_stat: string;
76
- annotation?: string;
77
- }
78
- type LedgerEntry = AiLedgerEntry | HumanLedgerEntry;
79
- interface HumanLockEntry {
80
- file: string;
81
- start_line: number;
82
- end_line: number;
83
- hash: string;
84
- }
85
-
86
- declare const auditModeSchema: z.ZodEnum<["strict", "warn", "off"]>;
87
- declare const clientPathsSchema: z.ZodObject<{
88
- claudeCodeCLI: z.ZodOptional<z.ZodString>;
89
- claudeCodeDesktop: z.ZodOptional<z.ZodString>;
90
- codexCLI: z.ZodOptional<z.ZodString>;
91
- }, "strict", z.ZodTypeAny, {
92
- claudeCodeCLI?: string | undefined;
93
- claudeCodeDesktop?: string | undefined;
94
- codexCLI?: string | undefined;
95
- }, {
96
- claudeCodeCLI?: string | undefined;
97
- claudeCodeDesktop?: string | undefined;
98
- codexCLI?: string | undefined;
99
- }>;
100
- declare const mcpPayloadLimitsSchema: z.ZodOptional<z.ZodObject<{
101
- warnBytes: z.ZodOptional<z.ZodNumber>;
102
- hardBytes: z.ZodOptional<z.ZodNumber>;
103
- }, "strip", z.ZodTypeAny, {
104
- warnBytes?: number | undefined;
105
- hardBytes?: number | undefined;
106
- }, {
107
- warnBytes?: number | undefined;
108
- hardBytes?: number | undefined;
109
- }>>;
110
- declare const selectionTokenTtlMsSchema: z.ZodNumber;
111
- declare const planContextTopKSchema: z.ZodNumber;
112
- declare const fabricLanguageSchema: z.ZodEnum<["zh-CN", "en"]>;
113
- declare const defaultLayerFilterSchema: z.ZodEnum<["team", "personal", "both"]>;
114
- declare const nudgeModeSchema: z.ZodEnum<["silent", "minimal", "normal", "verbose"]>;
115
- declare const observeConfigSchema: z.ZodObject<{
116
- session_start: z.ZodOptional<z.ZodBoolean>;
117
- pre_tool_use: z.ZodOptional<z.ZodBoolean>;
118
- stop: z.ZodOptional<z.ZodBoolean>;
119
- }, "strict", z.ZodTypeAny, {
120
- session_start?: boolean | undefined;
121
- pre_tool_use?: boolean | undefined;
122
- stop?: boolean | undefined;
123
- }, {
124
- session_start?: boolean | undefined;
125
- pre_tool_use?: boolean | undefined;
126
- stop?: boolean | undefined;
127
- }>;
128
- declare const writeRouteSchema: z.ZodObject<{
129
- scope: z.ZodString;
130
- store: z.ZodString;
131
- }, "strict", z.ZodTypeAny, {
132
- scope: string;
133
- store: string;
134
- }, {
135
- scope: string;
136
- store: string;
137
- }>;
138
- declare const fabricConfigSchema: z.ZodObject<{
139
- clientPaths: z.ZodOptional<z.ZodObject<{
140
- claudeCodeCLI: z.ZodOptional<z.ZodString>;
141
- claudeCodeDesktop: z.ZodOptional<z.ZodString>;
142
- codexCLI: z.ZodOptional<z.ZodString>;
143
- }, "strict", z.ZodTypeAny, {
144
- claudeCodeCLI?: string | undefined;
145
- claudeCodeDesktop?: string | undefined;
146
- codexCLI?: string | undefined;
147
- }, {
148
- claudeCodeCLI?: string | undefined;
149
- claudeCodeDesktop?: string | undefined;
150
- codexCLI?: string | undefined;
151
- }>>;
152
- project_id: z.ZodOptional<z.ZodString>;
153
- workspace_binding_id: z.ZodOptional<z.ZodString>;
154
- required_stores: z.ZodOptional<z.ZodArray<z.ZodObject<{
155
- id: z.ZodString;
156
- suggested_remote: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"$personal">]>>;
157
- }, "strict", z.ZodTypeAny, {
158
- id: string;
159
- suggested_remote?: string | undefined;
160
- }, {
161
- id: string;
162
- suggested_remote?: string | undefined;
163
- }>, "many">>;
164
- active_write_store: z.ZodOptional<z.ZodString>;
165
- active_project: z.ZodOptional<z.ZodString>;
166
- write_routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
167
- scope: z.ZodString;
168
- store: z.ZodString;
169
- }, "strict", z.ZodTypeAny, {
170
- scope: string;
171
- store: string;
172
- }, {
173
- scope: string;
174
- store: string;
175
- }>, "many">>;
176
- default_write_store: z.ZodOptional<z.ZodString>;
177
- scanIgnores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
178
- audit_mode: z.ZodOptional<z.ZodEnum<["strict", "warn", "off"]>>;
179
- mcpPayloadLimits: z.ZodOptional<z.ZodObject<{
180
- warnBytes: z.ZodOptional<z.ZodNumber>;
181
- hardBytes: z.ZodOptional<z.ZodNumber>;
182
- }, "strip", z.ZodTypeAny, {
183
- warnBytes?: number | undefined;
184
- hardBytes?: number | undefined;
185
- }, {
186
- warnBytes?: number | undefined;
187
- hardBytes?: number | undefined;
188
- }>>;
189
- default_layer_filter: z.ZodDefault<z.ZodOptional<z.ZodEnum<["team", "personal", "both"]>>>;
190
- nudge_mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["silent", "minimal", "normal", "verbose"]>>>;
191
- observe: z.ZodOptional<z.ZodObject<{
192
- session_start: z.ZodOptional<z.ZodBoolean>;
193
- pre_tool_use: z.ZodOptional<z.ZodBoolean>;
194
- stop: z.ZodOptional<z.ZodBoolean>;
195
- }, "strict", z.ZodTypeAny, {
196
- session_start?: boolean | undefined;
197
- pre_tool_use?: boolean | undefined;
198
- stop?: boolean | undefined;
199
- }, {
200
- session_start?: boolean | undefined;
201
- pre_tool_use?: boolean | undefined;
202
- stop?: boolean | undefined;
203
- }>>;
204
- archive_hint_cooldown_hours: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
205
- underseed_node_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
206
- archive_edit_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
207
- archive_hint_hours: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
208
- review_hint_pending_count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
209
- review_hint_pending_age_days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
210
- maintenance_hint_days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
211
- maintenance_hint_cooldown_days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
212
- import_window_first_run_months: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
213
- import_window_rerun_months: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
214
- import_max_pending_per_run: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
215
- import_max_commits_scan: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
216
- import_skip_canonical_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
217
- archive_max_candidates_per_batch: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
218
- archive_max_recent_paths: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
219
- archive_digest_max_sessions: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
220
- review_topic_result_cap: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
221
- review_stale_pending_days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
222
- reverse_unarchive_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
223
- reverse_unarchive_dry_run: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
224
- cite_evict_interval: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
225
- cite_recall_nudge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
226
- cite_recall_window_minutes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
227
- cite_nudge_ignore_globs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
228
- conflict_lint_similarity_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
229
- fabric_event_retention_days: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<7>, z.ZodLiteral<30>, z.ZodLiteral<90>]>>;
230
- onboard_slots_opted_out: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
231
- hint_broad_top_k: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
232
- broad_index_backstop: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
233
- hint_dismiss_signals: z.ZodOptional<z.ZodArray<z.ZodEnum<["archive", "review", "import", "maintenance"]>, "many">>;
234
- cite_policy_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
235
- self_archive_policy_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
236
- hint_narrow_top_k: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
237
- hint_narrow_dedup_window_turns: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
238
- hint_broad_cooldown_hours: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
239
- hint_narrow_cooldown_hours: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
240
- orphan_demote_proven_days: z.ZodOptional<z.ZodNumber>;
241
- orphan_demote_verified_days: z.ZodOptional<z.ZodNumber>;
242
- orphan_demote_draft_days: z.ZodOptional<z.ZodNumber>;
243
- hint_summary_max_len: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
244
- hint_reminder_to_context: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
245
- selection_token_ttl_ms: z.ZodOptional<z.ZodNumber>;
246
- plan_context_top_k: z.ZodOptional<z.ZodNumber>;
247
- recall_relevance_ratio: z.ZodOptional<z.ZodNumber>;
248
- embed_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
249
- embed_weight: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
250
- embed_model: z.ZodDefault<z.ZodOptional<z.ZodEnum<["fast-bge-small-zh-v1.5", "fast-multilingual-e5-large", "fast-bge-small-en-v1.5", "fast-bge-small-en", "fast-bge-base-en-v1.5", "fast-bge-base-en", "fast-all-MiniLM-L6-v2"]>>>;
251
- }, "strip", z.ZodTypeAny, {
252
- default_layer_filter: "personal" | "team" | "both";
253
- nudge_mode: "silent" | "minimal" | "normal" | "verbose";
254
- archive_hint_cooldown_hours: number;
255
- underseed_node_threshold: number;
256
- archive_edit_threshold: number;
257
- archive_hint_hours: number;
258
- review_hint_pending_count: number;
259
- review_hint_pending_age_days: number;
260
- maintenance_hint_days: number;
261
- maintenance_hint_cooldown_days: number;
262
- import_window_first_run_months: number;
263
- import_window_rerun_months: number;
264
- import_max_pending_per_run: number;
265
- import_max_commits_scan: number;
266
- import_skip_canonical_threshold: number;
267
- archive_max_candidates_per_batch: number;
268
- archive_max_recent_paths: number;
269
- archive_digest_max_sessions: number;
270
- review_topic_result_cap: number;
271
- review_stale_pending_days: number;
272
- reverse_unarchive_enabled: boolean;
273
- reverse_unarchive_dry_run: boolean;
274
- cite_evict_interval: number;
275
- cite_recall_nudge: boolean;
276
- cite_recall_window_minutes: number;
277
- conflict_lint_similarity_threshold: number;
278
- onboard_slots_opted_out: string[];
279
- hint_broad_top_k: number;
280
- broad_index_backstop: number;
281
- cite_policy_enabled: boolean;
282
- self_archive_policy_enabled: boolean;
283
- hint_narrow_top_k: number;
284
- hint_narrow_dedup_window_turns: number;
285
- hint_broad_cooldown_hours: number;
286
- hint_narrow_cooldown_hours: number;
287
- hint_summary_max_len: number;
288
- hint_reminder_to_context: boolean;
289
- embed_enabled: boolean;
290
- embed_weight: number;
291
- embed_model: "fast-bge-small-zh-v1.5" | "fast-multilingual-e5-large" | "fast-bge-small-en-v1.5" | "fast-bge-small-en" | "fast-bge-base-en-v1.5" | "fast-bge-base-en" | "fast-all-MiniLM-L6-v2";
292
- clientPaths?: {
293
- claudeCodeCLI?: string | undefined;
294
- claudeCodeDesktop?: string | undefined;
295
- codexCLI?: string | undefined;
296
- } | undefined;
297
- project_id?: string | undefined;
298
- workspace_binding_id?: string | undefined;
299
- required_stores?: {
300
- id: string;
301
- suggested_remote?: string | undefined;
302
- }[] | undefined;
303
- active_write_store?: string | undefined;
304
- active_project?: string | undefined;
305
- write_routes?: {
306
- scope: string;
307
- store: string;
308
- }[] | undefined;
309
- default_write_store?: string | undefined;
310
- scanIgnores?: string[] | undefined;
311
- audit_mode?: "strict" | "warn" | "off" | undefined;
312
- mcpPayloadLimits?: {
313
- warnBytes?: number | undefined;
314
- hardBytes?: number | undefined;
315
- } | undefined;
316
- observe?: {
317
- session_start?: boolean | undefined;
318
- pre_tool_use?: boolean | undefined;
319
- stop?: boolean | undefined;
320
- } | undefined;
321
- cite_nudge_ignore_globs?: string[] | undefined;
322
- fabric_event_retention_days?: 7 | 30 | 90 | undefined;
323
- hint_dismiss_signals?: ("archive" | "review" | "import" | "maintenance")[] | undefined;
324
- orphan_demote_proven_days?: number | undefined;
325
- orphan_demote_verified_days?: number | undefined;
326
- orphan_demote_draft_days?: number | undefined;
327
- selection_token_ttl_ms?: number | undefined;
328
- plan_context_top_k?: number | undefined;
329
- recall_relevance_ratio?: number | undefined;
330
- }, {
331
- clientPaths?: {
332
- claudeCodeCLI?: string | undefined;
333
- claudeCodeDesktop?: string | undefined;
334
- codexCLI?: string | undefined;
335
- } | undefined;
336
- project_id?: string | undefined;
337
- workspace_binding_id?: string | undefined;
338
- required_stores?: {
339
- id: string;
340
- suggested_remote?: string | undefined;
341
- }[] | undefined;
342
- active_write_store?: string | undefined;
343
- active_project?: string | undefined;
344
- write_routes?: {
345
- scope: string;
346
- store: string;
347
- }[] | undefined;
348
- default_write_store?: string | undefined;
349
- scanIgnores?: string[] | undefined;
350
- audit_mode?: "strict" | "warn" | "off" | undefined;
351
- mcpPayloadLimits?: {
352
- warnBytes?: number | undefined;
353
- hardBytes?: number | undefined;
354
- } | undefined;
355
- default_layer_filter?: "personal" | "team" | "both" | undefined;
356
- nudge_mode?: "silent" | "minimal" | "normal" | "verbose" | undefined;
357
- observe?: {
358
- session_start?: boolean | undefined;
359
- pre_tool_use?: boolean | undefined;
360
- stop?: boolean | undefined;
361
- } | undefined;
362
- archive_hint_cooldown_hours?: number | undefined;
363
- underseed_node_threshold?: number | undefined;
364
- archive_edit_threshold?: number | undefined;
365
- archive_hint_hours?: number | undefined;
366
- review_hint_pending_count?: number | undefined;
367
- review_hint_pending_age_days?: number | undefined;
368
- maintenance_hint_days?: number | undefined;
369
- maintenance_hint_cooldown_days?: number | undefined;
370
- import_window_first_run_months?: number | undefined;
371
- import_window_rerun_months?: number | undefined;
372
- import_max_pending_per_run?: number | undefined;
373
- import_max_commits_scan?: number | undefined;
374
- import_skip_canonical_threshold?: number | undefined;
375
- archive_max_candidates_per_batch?: number | undefined;
376
- archive_max_recent_paths?: number | undefined;
377
- archive_digest_max_sessions?: number | undefined;
378
- review_topic_result_cap?: number | undefined;
379
- review_stale_pending_days?: number | undefined;
380
- reverse_unarchive_enabled?: boolean | undefined;
381
- reverse_unarchive_dry_run?: boolean | undefined;
382
- cite_evict_interval?: number | undefined;
383
- cite_recall_nudge?: boolean | undefined;
384
- cite_recall_window_minutes?: number | undefined;
385
- cite_nudge_ignore_globs?: string[] | undefined;
386
- conflict_lint_similarity_threshold?: number | undefined;
387
- fabric_event_retention_days?: 7 | 30 | 90 | undefined;
388
- onboard_slots_opted_out?: string[] | undefined;
389
- hint_broad_top_k?: number | undefined;
390
- broad_index_backstop?: number | undefined;
391
- hint_dismiss_signals?: ("archive" | "review" | "import" | "maintenance")[] | undefined;
392
- cite_policy_enabled?: boolean | undefined;
393
- self_archive_policy_enabled?: boolean | undefined;
394
- hint_narrow_top_k?: number | undefined;
395
- hint_narrow_dedup_window_turns?: number | undefined;
396
- hint_broad_cooldown_hours?: number | undefined;
397
- hint_narrow_cooldown_hours?: number | undefined;
398
- orphan_demote_proven_days?: number | undefined;
399
- orphan_demote_verified_days?: number | undefined;
400
- orphan_demote_draft_days?: number | undefined;
401
- hint_summary_max_len?: number | undefined;
402
- hint_reminder_to_context?: boolean | undefined;
403
- selection_token_ttl_ms?: number | undefined;
404
- plan_context_top_k?: number | undefined;
405
- recall_relevance_ratio?: number | undefined;
406
- embed_enabled?: boolean | undefined;
407
- embed_weight?: number | undefined;
408
- embed_model?: "fast-bge-small-zh-v1.5" | "fast-multilingual-e5-large" | "fast-bge-small-en-v1.5" | "fast-bge-small-en" | "fast-bge-base-en-v1.5" | "fast-bge-base-en" | "fast-all-MiniLM-L6-v2" | undefined;
409
- }>;
410
-
411
- interface ClientPaths {
412
- claudeCodeCLI?: string;
413
- claudeCodeDesktop?: string;
414
- codexCLI?: string;
415
- }
416
- type AuditMode = "strict" | "warn" | "off";
417
- interface McpPayloadLimits {
418
- warnBytes?: number;
419
- hardBytes?: number;
420
- }
421
- type FabricLanguage = "match-existing" | "zh-CN" | "en" | "zh-CN-hybrid";
422
- type DefaultLayerFilter = "team" | "personal" | "both";
423
- type FabricConfig = z.input<typeof fabricConfigSchema>;
424
-
425
- export { type AgentsMetaNode as A, type ClientPaths as C, type DefaultLayerFilter as D, type FabricConfig as F, type HumanLockEntry as H, type LedgerEntry as L, type McpPayloadLimits as M, type RuleDescription as R, type AgentsIdentitySource as a, type AgentsTopologyType as b, type AgentsMeta as c, type AgentsMetaCountersEnvelope as d, type AgentsMetaKnowledgeTypeCounters as e, fabricConfigSchema as f, type AiLedgerEntry as g, type AuditMode as h, type FabricLanguage as i, type HumanLedgerEntry as j, type RuleDescriptionIndexItem as k, auditModeSchema as l, clientPathsSchema as m, defaultLayerFilterSchema as n, fabricLanguageSchema as o, mcpPayloadLimitsSchema as p, nudgeModeSchema as q, observeConfigSchema as r, planContextTopKSchema as s, selectionTokenTtlMsSchema as t, writeRouteSchema as w };