@fenglimg/fabric-server 2.3.0-rc.15 → 2.3.0-rc.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +58 -12
  2. package/dist/index.js +2604 -1909
  3. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -160,7 +160,11 @@ interface AlwaysActiveBody {
160
160
  /** description.summary — the overflow-degrade fallback when the body cannot
161
161
  * fit the injection char budget (the budget is enforced hook-side, D10). */
162
162
  summary: string;
163
- /** frontmatter-stripped markdown body. */
163
+ /**
164
+ * ISS-20260713-014 / KT-DEC-0036: SessionStart wire is index-only.
165
+ * Body is empty on this path; full text via Read/fab_recall.
166
+ * Field retained for wire compatibility.
167
+ */
164
168
  body: string;
165
169
  }
166
170
  /**
@@ -666,6 +670,12 @@ declare function explainWhyNotSurfaced(projectRoot: string, query: string): Prom
666
670
  */
667
671
  declare function extractKnowledge(projectRoot: string, input: FabExtractKnowledgeInput): Promise<FabExtractKnowledgeOutput>;
668
672
 
673
+ /**
674
+ * fab_review / fab_pending facade (ISS-20260713-013).
675
+ * Action implementations live in review-write-actions / review-search;
676
+ * path/sandbox/list helpers in review-shared; frontmatter in review-frontmatter.
677
+ */
678
+
669
679
  /**
670
680
  * v2.0 rc.3 fab_review service (W3-K K2: WRITE-only).
671
681
  *
@@ -912,6 +922,26 @@ declare function readEventLedger(projectRoot: string, options?: ReadEventLedgerO
912
922
  */
913
923
  declare function flushAndSyncEventLedger(projectRoot: string): void;
914
924
 
925
+ /**
926
+ * ISS-20260713-011: selection_token mint / LRU cache for plan-context.
927
+ */
928
+ type SelectionTokenState = {
929
+ token: string;
930
+ revision_hash: string;
931
+ target_paths: string[];
932
+ required_stable_ids: string[];
933
+ ai_selectable_stable_ids: string[];
934
+ created_at: number;
935
+ expires_at: number;
936
+ };
937
+ declare function readSelectionToken(token: string, now?: number): SelectionTokenState | undefined;
938
+
939
+ /**
940
+ * planContext facade (ISS-20260713-011).
941
+ * Scoring / BM25 cache / selection-token live in dedicated modules;
942
+ * this file orchestrates the plan-context pipeline and re-exports the public API.
943
+ */
944
+
915
945
  type PlanContextInput = {
916
946
  paths: string[];
917
947
  intent?: string;
@@ -978,17 +1008,7 @@ type PlanContextResult = {
978
1008
  /** Internal service→tool signal; stripped before MCP output. */
979
1009
  payload_over_budget?: boolean;
980
1010
  };
981
- type SelectionTokenState = {
982
- token: string;
983
- revision_hash: string;
984
- target_paths: string[];
985
- required_stable_ids: string[];
986
- ai_selectable_stable_ids: string[];
987
- created_at: number;
988
- expires_at: number;
989
- };
990
1011
  declare function planContext(projectRoot: string, input: PlanContextInput): Promise<PlanContextResult>;
991
- declare function readSelectionToken(token: string, now?: number): SelectionTokenState | undefined;
992
1012
 
993
1013
  type RecallInput = PlanContextInput & {
994
1014
  /**
@@ -1153,7 +1173,33 @@ declare const AGENTS_MD_RESOURCE_URI = "fabric://bootstrap-readme";
1153
1173
  declare function formatPreexistingRootMessage(projectRoot: string): string | null;
1154
1174
 
1155
1175
  declare const FABRIC_SERVER_INSTRUCTIONS: string;
1176
+ declare function buildServerInstructions(projectRoot: string): string;
1156
1177
  declare function createFabricServer(tracker?: InFlightTracker): McpServer;
1178
+ /**
1179
+ * The slice of the MCP `Server` the roots adoption consumes — injectable so
1180
+ * tests can drive it without a live transport.
1181
+ */
1182
+ interface McpRootsSource {
1183
+ getClientCapabilities(): {
1184
+ roots?: unknown;
1185
+ } | undefined;
1186
+ listRoots(): Promise<{
1187
+ roots: Array<{
1188
+ uri?: string;
1189
+ }>;
1190
+ }>;
1191
+ }
1192
+ /**
1193
+ * ISS werewolf-minigame (rootless MCP spawn, KT-PIT-0046): fetch the client's
1194
+ * workspace roots (when the client declares the `roots` capability) and record
1195
+ * them as project-root candidates via `setMcpRootsHint`. Returns the accepted
1196
+ * absolute paths ([] when the capability is absent or the fetch fails —
1197
+ * best-effort, never sinks startup). Called from `oninitialized`; the
1198
+ * env > CLAUDE_PROJECT_DIR > roots > cwd priority lives in
1199
+ * `resolveProjectRoot`, which every tool call re-runs, so adoption heals
1200
+ * subsequent calls without a restart.
1201
+ */
1202
+ declare function adoptMcpClientRoots(source: McpRootsSource): Promise<string[]>;
1157
1203
  declare function startStdioServer(): Promise<void>;
1158
1204
  /**
1159
1205
  * Dependencies for the shutdown handler factory. Tests inject `exit` to assert
@@ -1179,4 +1225,4 @@ interface ShutdownHandlerDeps {
1179
1225
  */
1180
1226
  declare function createShutdownHandler(deps: ShutdownHandlerDeps): () => void;
1181
1227
 
1182
- export { AGENTS_MD_RESOURCE_URI, type AlwaysActiveBody, type ArchiveHistoryEntry, type ArchiveHistoryReport, type BacklogAgeMetric, COLD_EVAL_RUBRIC, type CiteCoverageReport, type ColdEvalBatch, type ColdEvalCandidate, type ColdEvalVerdict, type ConflictEntry, type ConflictJudge, type ConflictLintReport, type ConflictPair, type ConflictVerdict, type ConsumptionEntry, type ConsumptionInspection, type ConsumptionLintConfig, DEFAULT_CONFLICT_SIMILARITY_THRESHOLD, type DoctorApplyLintMutation, type DoctorApplyLintMutationKind, type DoctorApplyLintReport, type DoctorFixReport, type DoctorIssue, type DoctorReport, EVENT_LEDGER_PATH, type EnrichDescriptionsCandidate, type EnrichDescriptionsMode, type EnrichDescriptionsReport, FABRIC_SERVER_INSTRUCTIONS, type HistoryAllReport, type HistoryDayRow, type InFlightTracker, type KnowledgeCensus, LEDGER_PATH, LEGACY_LEDGER_PATH, METRICS_LEDGER_PATH, METRIC_COUNTER_NAMES, type MetricCounterName, type MetricsRow, OPTIONAL_EMBED_PACKAGE, type PlanContextInput, type PlanContextResult, type PrecheckResult, RETIRED_TOKENS, type RecallInput, type RecallResult, type RelatedBrokenLink, type RelatedGraphInspection, type RelatedGraphNode, type RelatedHubEntry, type RequirementProfile, type RetiredReferenceHit, type RetiredReferenceInspection, type RetiredToken, type SelectionTokenState, type ShutdownHandlerDeps, type StoreCanonicalEntry, type StoreReachability, type SurfaceVerdict, type UnboundProjectViolation, type WhyNotSurfacedResult, aggregateConsumption, appendEventLedgerEvent, buildAlwaysActiveBodies, buildColdEvalBatch, buildKnowledgeCensus, buildRelatedGraph, bumpCounter, checkBacklogAge, clearPrecheckCache, collectStoreCanonicalEntries, computeReadSetRevision, contextCache, createFabricServer, createInFlightTracker, createShutdownHandler, defaultEmbedCacheDir, detectUnboundProject, drainCounters, enrichDescriptions, evaluateStoreDir, explainWhyNotSurfaced, extractKnowledge, findConflictCandidates, flushAndSyncEventLedger, flushMetrics, formatPreexistingRootMessage, getEventLedgerPath, getLedgerPath, getLegacyLedgerPath, getMetricsLedgerPath, inspectConsumption, inspectRelatedGraph, inspectRetiredReferences, isEmbedderResolvable, lintConflicts, loadConflictEntries, loadEmbedder, pairSimilarity, planContext, precheckStoreReachability, readEmbedConfig, readEventLedger, readFusion, readLedger, readMetrics, readSelectionToken, recall, rehydrateAgentsMetaAt, renderBacklogAgeLine, resolveLedgerPaths, reviewKnowledge, reviewPending, runDoctorApplyLint, runDoctorArchiveHistory, runDoctorCiteCoverage, runDoctorConflictLint, runDoctorFix, runDoctorHistoryAll, runDoctorReport, startMetricsFlush, startRotationTick, startStdioServer, stopMetricsFlush, stopRotationTick };
1228
+ export { AGENTS_MD_RESOURCE_URI, type AlwaysActiveBody, type ArchiveHistoryEntry, type ArchiveHistoryReport, type BacklogAgeMetric, COLD_EVAL_RUBRIC, type CiteCoverageReport, type ColdEvalBatch, type ColdEvalCandidate, type ColdEvalVerdict, type ConflictEntry, type ConflictJudge, type ConflictLintReport, type ConflictPair, type ConflictVerdict, type ConsumptionEntry, type ConsumptionInspection, type ConsumptionLintConfig, DEFAULT_CONFLICT_SIMILARITY_THRESHOLD, type DoctorApplyLintMutation, type DoctorApplyLintMutationKind, type DoctorApplyLintReport, type DoctorFixReport, type DoctorIssue, type DoctorReport, EVENT_LEDGER_PATH, type EnrichDescriptionsCandidate, type EnrichDescriptionsMode, type EnrichDescriptionsReport, FABRIC_SERVER_INSTRUCTIONS, type HistoryAllReport, type HistoryDayRow, type InFlightTracker, type KnowledgeCensus, LEDGER_PATH, LEGACY_LEDGER_PATH, METRICS_LEDGER_PATH, METRIC_COUNTER_NAMES, type McpRootsSource, type MetricCounterName, type MetricsRow, OPTIONAL_EMBED_PACKAGE, type PlanContextInput, type PlanContextResult, type PrecheckResult, RETIRED_TOKENS, type RecallInput, type RecallResult, type RelatedBrokenLink, type RelatedGraphInspection, type RelatedGraphNode, type RelatedHubEntry, type RequirementProfile, type RetiredReferenceHit, type RetiredReferenceInspection, type RetiredToken, type SelectionTokenState, type ShutdownHandlerDeps, type StoreCanonicalEntry, type StoreReachability, type SurfaceVerdict, type UnboundProjectViolation, type WhyNotSurfacedResult, adoptMcpClientRoots, aggregateConsumption, appendEventLedgerEvent, buildAlwaysActiveBodies, buildColdEvalBatch, buildKnowledgeCensus, buildRelatedGraph, buildServerInstructions, bumpCounter, checkBacklogAge, clearPrecheckCache, collectStoreCanonicalEntries, computeReadSetRevision, contextCache, createFabricServer, createInFlightTracker, createShutdownHandler, defaultEmbedCacheDir, detectUnboundProject, drainCounters, enrichDescriptions, evaluateStoreDir, explainWhyNotSurfaced, extractKnowledge, findConflictCandidates, flushAndSyncEventLedger, flushMetrics, formatPreexistingRootMessage, getEventLedgerPath, getLedgerPath, getLegacyLedgerPath, getMetricsLedgerPath, inspectConsumption, inspectRelatedGraph, inspectRetiredReferences, isEmbedderResolvable, lintConflicts, loadConflictEntries, loadEmbedder, pairSimilarity, planContext, precheckStoreReachability, readEmbedConfig, readEventLedger, readFusion, readLedger, readMetrics, readSelectionToken, recall, rehydrateAgentsMetaAt, renderBacklogAgeLine, resolveLedgerPaths, reviewKnowledge, reviewPending, runDoctorApplyLint, runDoctorArchiveHistory, runDoctorCiteCoverage, runDoctorConflictLint, runDoctorFix, runDoctorHistoryAll, runDoctorReport, startMetricsFlush, startRotationTick, startStdioServer, stopMetricsFlush, stopRotationTick };