@suss/extractor 0.34.1 → 0.35.1
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.cjs +786 -178
- package/dist/index.d.cts +97 -15
- package/dist/index.d.ts +97 -15
- package/dist/index.js +779 -174
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1008,6 +1008,12 @@ type TerminalMatch = {
|
|
|
1008
1008
|
*/
|
|
1009
1009
|
type: "parameterCall";
|
|
1010
1010
|
parameterPosition: number;
|
|
1011
|
+
/**
|
|
1012
|
+
* The parameter belongs to the function this unit is written
|
|
1013
|
+
* inside, the way a wrapper factory's closure calls the handler
|
|
1014
|
+
* the factory was given.
|
|
1015
|
+
*/
|
|
1016
|
+
ofEnclosingFunction?: boolean;
|
|
1011
1017
|
};
|
|
1012
1018
|
interface TerminalExtraction {
|
|
1013
1019
|
statusCode?: {
|
|
@@ -2605,17 +2611,45 @@ interface LanguageAdapter {
|
|
|
2605
2611
|
extractAll(): Promise<BehavioralSummary[]>;
|
|
2606
2612
|
}
|
|
2607
2613
|
|
|
2614
|
+
/**
|
|
2615
|
+
* The code hash a cache key uses for an adapter or a pack: a hash of its
|
|
2616
|
+
* built file and of every file that file loads from suss's own packages.
|
|
2617
|
+
*
|
|
2618
|
+
* An adapter runs the value evaluator and the resolution rules, and a pack
|
|
2619
|
+
* runs the compiler for its declarations, so the hash follows the import
|
|
2620
|
+
* statements in the built files outward and a rebuild of any package it
|
|
2621
|
+
* reaches changes it. A chunk the bundler split out is a relative import
|
|
2622
|
+
* and is followed too. Imports of other libraries are not followed.
|
|
2623
|
+
*
|
|
2624
|
+
* A package is resolved from the file that imports it, with the export
|
|
2625
|
+
* conditions of that import, so the hash covers the build the process
|
|
2626
|
+
* loaded and not its CommonJS twin.
|
|
2627
|
+
*/
|
|
2628
|
+
interface CodeHasher {
|
|
2629
|
+
/** The files the code hash reads for `entryFile`, that file first. */
|
|
2630
|
+
codeFiles(entryFile: string): string[];
|
|
2631
|
+
/** Empty when `entryFile` cannot be read, the same as a run from source. */
|
|
2632
|
+
codeHash(entryFile: string): string;
|
|
2633
|
+
}
|
|
2634
|
+
/** A hasher reads each file once and keeps what it found. */
|
|
2635
|
+
declare function createCodeHasher(): CodeHasher;
|
|
2636
|
+
/**
|
|
2637
|
+
* The hasher an adapter and the packs of one process share. A process
|
|
2638
|
+
* loads each module once, so what it read stays true for the process.
|
|
2639
|
+
*/
|
|
2640
|
+
declare const processCodeHasher: CodeHasher;
|
|
2641
|
+
|
|
2608
2642
|
/**
|
|
2609
2643
|
* The language-neutral half of an adapter's cache key.
|
|
2610
2644
|
*
|
|
2611
2645
|
* Each adapter calls `createAdapterStamp` once, with its own
|
|
2612
2646
|
* `import.meta.url` and its hand-bumped version, and keeps the result for
|
|
2613
2647
|
* the life of the process. The stamp hashes the adapter's dist file and
|
|
2614
|
-
* every
|
|
2615
|
-
*
|
|
2616
|
-
*
|
|
2617
|
-
*
|
|
2618
|
-
*
|
|
2648
|
+
* every file it loads from suss's own packages, found by following its
|
|
2649
|
+
* imports. A release that changes any of them invalidates an older cache,
|
|
2650
|
+
* and so does a local rebuild, with no version bump. Running from source
|
|
2651
|
+
* leaves no dist file to hash, so that mode turns the cache off. This
|
|
2652
|
+
* package's DESIGN.md describes the cache.
|
|
2619
2653
|
*/
|
|
2620
2654
|
|
|
2621
2655
|
/**
|
|
@@ -2659,11 +2693,11 @@ declare function createAdapterStamp(config: {
|
|
|
2659
2693
|
version: string;
|
|
2660
2694
|
}): AdapterStamp;
|
|
2661
2695
|
/**
|
|
2662
|
-
* The hash for a bundle directory: the bundle itself plus every
|
|
2663
|
-
*
|
|
2696
|
+
* The hash for a bundle directory: the bundle itself plus every file it
|
|
2697
|
+
* loads from suss's packages. Empty when the directory has no bundle in
|
|
2664
2698
|
* it, as happens when running from source.
|
|
2665
2699
|
*/
|
|
2666
|
-
declare function computeDistHashFrom(dir: string): string;
|
|
2700
|
+
declare function computeDistHashFrom(dir: string, hasher?: CodeHasher): string;
|
|
2667
2701
|
/**
|
|
2668
2702
|
* Content hash of the given files, in the order they arrive. Empty when
|
|
2669
2703
|
* the list is empty or a file cannot be read, so a caller that could not
|
|
@@ -2728,12 +2762,12 @@ declare function runDigest(packsDigest: string, packs: ReadonlyArray<{
|
|
|
2728
2762
|
* A run reuses the previous run's summaries whole when nothing changed,
|
|
2729
2763
|
* and per file when some files did. The entry directory's name is a hash
|
|
2730
2764
|
* of the schema version, the adapter and packs digest, and the config
|
|
2731
|
-
* path
|
|
2732
|
-
*
|
|
2733
|
-
*
|
|
2734
|
-
*
|
|
2735
|
-
*
|
|
2736
|
-
* design notes describe the cache in full.
|
|
2765
|
+
* path. The manifest inside records a stamp and content hash per file,
|
|
2766
|
+
* the files each summary belongs to, and the other files each walk read.
|
|
2767
|
+
* The summaries are in one shard per source file, beside an index of the
|
|
2768
|
+
* boundaries and calls in each. An adapter's own data on a file's record,
|
|
2769
|
+
* `meta`, goes in a file of its own, and the cache never reads it. The
|
|
2770
|
+
* package's design notes describe the cache in full.
|
|
2737
2771
|
*/
|
|
2738
2772
|
|
|
2739
2773
|
/**
|
|
@@ -2885,6 +2919,12 @@ interface CacheInput {
|
|
|
2885
2919
|
*/
|
|
2886
2920
|
configPath?: string;
|
|
2887
2921
|
}
|
|
2922
|
+
/**
|
|
2923
|
+
* Each summary owned by the walked file it is written in, or by no file
|
|
2924
|
+
* when it is written outside every walked file. For an adapter that
|
|
2925
|
+
* replays its own per-file records rather than calling `reuse`.
|
|
2926
|
+
*/
|
|
2927
|
+
declare function ownersWhereWritten(summaries: readonly BehavioralSummary[], walkedFileOf: (locationFile: string) => string | undefined): string[][];
|
|
2888
2928
|
/**
|
|
2889
2929
|
* A cache layer rooted at `cacheDir`. With `null`, every lookup misses and
|
|
2890
2930
|
* `write` does nothing, for a one-shot extract where the cache would only
|
|
@@ -2892,6 +2932,28 @@ interface CacheInput {
|
|
|
2892
2932
|
*/
|
|
2893
2933
|
declare function createCacheLayer<Meta = unknown, UnitData = unknown>(cacheDir: string | null): CacheLayer<Meta, UnitData>;
|
|
2894
2934
|
|
|
2935
|
+
/**
|
|
2936
|
+
* Where suss keeps the files it writes for itself while it reads a
|
|
2937
|
+
* project: the extraction cache, and the record the MCP server leaves for
|
|
2938
|
+
* the plugin's hooks.
|
|
2939
|
+
*
|
|
2940
|
+
* By default they go under `.suss` in the project, which fails in a
|
|
2941
|
+
* checkout the process may only read. `SUSS_CACHE_DIR` moves them
|
|
2942
|
+
* somewhere else. The `--cache-dir` flag and the MCP server's argument
|
|
2943
|
+
* set the same variable for the process, so one setting reaches every
|
|
2944
|
+
* adapter and a flag wins over the variable already in the environment.
|
|
2945
|
+
*
|
|
2946
|
+
* Several projects can share one chosen directory, so each project gets a
|
|
2947
|
+
* subdirectory whose name is a hash of its path.
|
|
2948
|
+
*/
|
|
2949
|
+
declare const CACHE_DIR_ENV = "SUSS_CACHE_DIR";
|
|
2950
|
+
/** The directory the environment names, made absolute, or null when it names none. */
|
|
2951
|
+
declare function chosenCacheRoot(): string | null;
|
|
2952
|
+
/** The extraction cache for the files read under `projectDir`. */
|
|
2953
|
+
declare function extractionCacheDirFor(projectDir: string): string;
|
|
2954
|
+
/** The file where the server for `projectDir` says how to reach it. */
|
|
2955
|
+
declare function liveRecordFor(projectDir: string): string;
|
|
2956
|
+
|
|
2895
2957
|
/**
|
|
2896
2958
|
* Whether a write after `statAt` could leave this file's mtime and size
|
|
2897
2959
|
* where the stat saw them, because its last change was that recent.
|
|
@@ -3215,6 +3277,26 @@ interface PackGradient {
|
|
|
3215
3277
|
}
|
|
3216
3278
|
/** The gradient for every pack in a run that declared anything. */
|
|
3217
3279
|
declare function packGradients(report: ExtractionReport): PackGradient[];
|
|
3280
|
+
/**
|
|
3281
|
+
* A pack the run asked for that reads nothing until a project option is
|
|
3282
|
+
* set, such as the directory a GraphQL pack looks classes up under.
|
|
3283
|
+
* `example` is a config file's JSON text with a value that works for a
|
|
3284
|
+
* project laid out the way the library's generator leaves it.
|
|
3285
|
+
*/
|
|
3286
|
+
interface PackConfigNeed {
|
|
3287
|
+
pack: string;
|
|
3288
|
+
option: string;
|
|
3289
|
+
example: string;
|
|
3290
|
+
}
|
|
3291
|
+
/**
|
|
3292
|
+
* Packs the run left out because their option was missing.
|
|
3293
|
+
*
|
|
3294
|
+
* Without the option the pack has no way to find anything, and the rest
|
|
3295
|
+
* of the run looks the same as it would for a project the pack has
|
|
3296
|
+
* nothing to say about. The pack is not part of the extraction report,
|
|
3297
|
+
* since it never ran, so the caller passes these in.
|
|
3298
|
+
*/
|
|
3299
|
+
declare function packConfigCheck(needs: ReadonlyArray<PackConfigNeed>): HealthCheck;
|
|
3218
3300
|
/**
|
|
3219
3301
|
* Run every health check over one extraction report and return what
|
|
3220
3302
|
* fired, grouped by which check caught it.
|
|
@@ -3907,4 +3989,4 @@ declare function rawConditionToPredicate(c: RawCondition): Predicate;
|
|
|
3907
3989
|
declare function effectToIR(effect: RawEffect): Effect;
|
|
3908
3990
|
declare function paramToInput(param: RawParameter): Input;
|
|
3909
3991
|
|
|
3910
|
-
export { type AccessRecognizer, type AdapterCodeStamp, type AdapterStamp, type ArgumentParser, type AstCapableOps, type BindingExtraction, type BodyContent, type CacheAttribution, type CacheDiagnostic, type CacheInput, type CacheLayer, type CacheLookup, type CallOps, type CaseGroup, type ChannelSource, type ChildrenOf, type ChosenReading, type ClassOps, type ConditionHandle, type ConditionInfo, type ConditionSource, type ConstructedFrom, type ContractPattern, type DeclaredBinding, type DeclaredBy, type DeclaredMatch, type DeclaredModule, type DeclaredStatusDecorators, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type EmptyStage, EnclosingNodes, type ExitKind, type ExtractionConfig, type ExtractionReport, type ExtractorOptions, type FailureDelivery, type GlobalPrefixCall, type HandOffSite, type HealthCheck, type HealthViolation, type HelperDeclarations, type HelperSearch, type HelperSink, type HelperValue, IdMap, IdSet, type Identified, type InputMappingPattern, type InputRead, type InvocationRecognizer, type KeepsArms, KeptParses, type LanguageAdapter, type LoweredStatementParts, MAX_ENTRIES, MAX_HELPER_PATHS, MAX_PATHS, MODULE_SURFACE_RECOGNITION, type ModuleInitOptions, type NodeVisitor, type OpsCarrier, type PackDeclarations, type PackFailure, type PackFunnel, type PackGradient, type PackTally, type ParameterSupplier, type ParsedNode, type PartialPlan, PathBudgetExceeded, type PatternPack, type ProjectHelper, type ProjectHelpers, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawProvenance, type RawTerminal, type Reading, type ReceiverOrigin, type RedirectDelivery, type RedirectOption, type RegistrationHelper, type ResponsePropertyMapping, type ResponsePropertyMeaning, type RootRecord, type RouteVersioning, SKIP_CHILDREN, type SettledModule, type SourceRange, type SourceSpelling, type StatedSlot, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TestCaseMatch, type Timer, type TimingReport, type TransparentWrapper, type UnitRecord, UnmodeledFlow, type UnsettledName, type ValueEntry, type ValueOps, type VersionPlacement, type WalkEnd, type WrapperMethodRegistration, type WrapperOptionRegistration, type WrapperRegistration, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, buildUngatedExtractionReport, commonDirectoryOf, composeWrappers, computeContentHash, computeDistHashFrom, configuredCallOption, createAdapterStamp, createCacheLayer, createPackTallies, createTimer, detectGaps, effectToIR, emptyTally, enumerateOrDegrade, enumerateStructuredPaths, evaluatePackHealth, extractionConfigStamp, firstWrittenReading, formatPackHealth, guardsHoldOn, helperPathsOnVariables, httpRouteDiscovery, isListedTestFile, makeIgnoredDirectory, makeTransitionId, mapReading, markReturnsAsExitCode, matchesTestFileName, mergeReadShapes, moduleInitStructure, moduleOfFile, noopTimer, packGradients, paramToInput, projectFileStamp, rawConditionToPredicate, recordPackFailure, redirectDeliveryWhenSet, registrationHelperDiscovery, routeHelperIndex, runDigest, runsBefore, scopeOption, settleModules, sharedGatingConditions, sourceRefsOf, splitAtHandOffs, stampMayMissAWrite, stampModuleImports, stampModules, storageSystemOption, summaryCountsByPack, tallyUnit, terminalToOutput, throughHelper, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, walkDescendants, wrapperDiscovery, writtenReading };
|
|
3992
|
+
export { type AccessRecognizer, type AdapterCodeStamp, type AdapterStamp, type ArgumentParser, type AstCapableOps, type BindingExtraction, type BodyContent, CACHE_DIR_ENV, type CacheAttribution, type CacheDiagnostic, type CacheInput, type CacheLayer, type CacheLookup, type CallOps, type CaseGroup, type ChannelSource, type ChildrenOf, type ChosenReading, type ClassOps, type CodeHasher, type ConditionHandle, type ConditionInfo, type ConditionSource, type ConstructedFrom, type ContractPattern, type DeclaredBinding, type DeclaredBy, type DeclaredMatch, type DeclaredModule, type DeclaredStatusDecorators, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type EmptyStage, EnclosingNodes, type ExitKind, type ExtractionConfig, type ExtractionReport, type ExtractorOptions, type FailureDelivery, type GlobalPrefixCall, type HandOffSite, type HealthCheck, type HealthViolation, type HelperDeclarations, type HelperSearch, type HelperSink, type HelperValue, IdMap, IdSet, type Identified, type InputMappingPattern, type InputRead, type InvocationRecognizer, type KeepsArms, KeptParses, type LanguageAdapter, type LoweredStatementParts, MAX_ENTRIES, MAX_HELPER_PATHS, MAX_PATHS, MODULE_SURFACE_RECOGNITION, type ModuleInitOptions, type NodeVisitor, type OpsCarrier, type PackConfigNeed, type PackDeclarations, type PackFailure, type PackFunnel, type PackGradient, type PackTally, type ParameterSupplier, type ParsedNode, type PartialPlan, PathBudgetExceeded, type PatternPack, type ProjectHelper, type ProjectHelpers, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawProvenance, type RawTerminal, type Reading, type ReceiverOrigin, type RedirectDelivery, type RedirectOption, type RegistrationHelper, type ResponsePropertyMapping, type ResponsePropertyMeaning, type RootRecord, type RouteVersioning, SKIP_CHILDREN, type SettledModule, type SourceRange, type SourceSpelling, type StatedSlot, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TestCaseMatch, type Timer, type TimingReport, type TransparentWrapper, type UnitRecord, UnmodeledFlow, type UnsettledName, type ValueEntry, type ValueOps, type VersionPlacement, type WalkEnd, type WrapperMethodRegistration, type WrapperOptionRegistration, type WrapperRegistration, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, buildUngatedExtractionReport, chosenCacheRoot, commonDirectoryOf, composeWrappers, computeContentHash, computeDistHashFrom, configuredCallOption, createAdapterStamp, createCacheLayer, createCodeHasher, createPackTallies, createTimer, detectGaps, effectToIR, emptyTally, enumerateOrDegrade, enumerateStructuredPaths, evaluatePackHealth, extractionCacheDirFor, extractionConfigStamp, firstWrittenReading, formatPackHealth, guardsHoldOn, helperPathsOnVariables, httpRouteDiscovery, isListedTestFile, liveRecordFor, makeIgnoredDirectory, makeTransitionId, mapReading, markReturnsAsExitCode, matchesTestFileName, mergeReadShapes, moduleInitStructure, moduleOfFile, noopTimer, ownersWhereWritten, packConfigCheck, packGradients, paramToInput, processCodeHasher, projectFileStamp, rawConditionToPredicate, recordPackFailure, redirectDeliveryWhenSet, registrationHelperDiscovery, routeHelperIndex, runDigest, runsBefore, scopeOption, settleModules, sharedGatingConditions, sourceRefsOf, splitAtHandOffs, stampMayMissAWrite, stampModuleImports, stampModules, storageSystemOption, summaryCountsByPack, tallyUnit, terminalToOutput, throughHelper, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, walkDescendants, wrapperDiscovery, writtenReading };
|
package/dist/index.d.ts
CHANGED
|
@@ -1008,6 +1008,12 @@ type TerminalMatch = {
|
|
|
1008
1008
|
*/
|
|
1009
1009
|
type: "parameterCall";
|
|
1010
1010
|
parameterPosition: number;
|
|
1011
|
+
/**
|
|
1012
|
+
* The parameter belongs to the function this unit is written
|
|
1013
|
+
* inside, the way a wrapper factory's closure calls the handler
|
|
1014
|
+
* the factory was given.
|
|
1015
|
+
*/
|
|
1016
|
+
ofEnclosingFunction?: boolean;
|
|
1011
1017
|
};
|
|
1012
1018
|
interface TerminalExtraction {
|
|
1013
1019
|
statusCode?: {
|
|
@@ -2605,17 +2611,45 @@ interface LanguageAdapter {
|
|
|
2605
2611
|
extractAll(): Promise<BehavioralSummary[]>;
|
|
2606
2612
|
}
|
|
2607
2613
|
|
|
2614
|
+
/**
|
|
2615
|
+
* The code hash a cache key uses for an adapter or a pack: a hash of its
|
|
2616
|
+
* built file and of every file that file loads from suss's own packages.
|
|
2617
|
+
*
|
|
2618
|
+
* An adapter runs the value evaluator and the resolution rules, and a pack
|
|
2619
|
+
* runs the compiler for its declarations, so the hash follows the import
|
|
2620
|
+
* statements in the built files outward and a rebuild of any package it
|
|
2621
|
+
* reaches changes it. A chunk the bundler split out is a relative import
|
|
2622
|
+
* and is followed too. Imports of other libraries are not followed.
|
|
2623
|
+
*
|
|
2624
|
+
* A package is resolved from the file that imports it, with the export
|
|
2625
|
+
* conditions of that import, so the hash covers the build the process
|
|
2626
|
+
* loaded and not its CommonJS twin.
|
|
2627
|
+
*/
|
|
2628
|
+
interface CodeHasher {
|
|
2629
|
+
/** The files the code hash reads for `entryFile`, that file first. */
|
|
2630
|
+
codeFiles(entryFile: string): string[];
|
|
2631
|
+
/** Empty when `entryFile` cannot be read, the same as a run from source. */
|
|
2632
|
+
codeHash(entryFile: string): string;
|
|
2633
|
+
}
|
|
2634
|
+
/** A hasher reads each file once and keeps what it found. */
|
|
2635
|
+
declare function createCodeHasher(): CodeHasher;
|
|
2636
|
+
/**
|
|
2637
|
+
* The hasher an adapter and the packs of one process share. A process
|
|
2638
|
+
* loads each module once, so what it read stays true for the process.
|
|
2639
|
+
*/
|
|
2640
|
+
declare const processCodeHasher: CodeHasher;
|
|
2641
|
+
|
|
2608
2642
|
/**
|
|
2609
2643
|
* The language-neutral half of an adapter's cache key.
|
|
2610
2644
|
*
|
|
2611
2645
|
* Each adapter calls `createAdapterStamp` once, with its own
|
|
2612
2646
|
* `import.meta.url` and its hand-bumped version, and keeps the result for
|
|
2613
2647
|
* the life of the process. The stamp hashes the adapter's dist file and
|
|
2614
|
-
* every
|
|
2615
|
-
*
|
|
2616
|
-
*
|
|
2617
|
-
*
|
|
2618
|
-
*
|
|
2648
|
+
* every file it loads from suss's own packages, found by following its
|
|
2649
|
+
* imports. A release that changes any of them invalidates an older cache,
|
|
2650
|
+
* and so does a local rebuild, with no version bump. Running from source
|
|
2651
|
+
* leaves no dist file to hash, so that mode turns the cache off. This
|
|
2652
|
+
* package's DESIGN.md describes the cache.
|
|
2619
2653
|
*/
|
|
2620
2654
|
|
|
2621
2655
|
/**
|
|
@@ -2659,11 +2693,11 @@ declare function createAdapterStamp(config: {
|
|
|
2659
2693
|
version: string;
|
|
2660
2694
|
}): AdapterStamp;
|
|
2661
2695
|
/**
|
|
2662
|
-
* The hash for a bundle directory: the bundle itself plus every
|
|
2663
|
-
*
|
|
2696
|
+
* The hash for a bundle directory: the bundle itself plus every file it
|
|
2697
|
+
* loads from suss's packages. Empty when the directory has no bundle in
|
|
2664
2698
|
* it, as happens when running from source.
|
|
2665
2699
|
*/
|
|
2666
|
-
declare function computeDistHashFrom(dir: string): string;
|
|
2700
|
+
declare function computeDistHashFrom(dir: string, hasher?: CodeHasher): string;
|
|
2667
2701
|
/**
|
|
2668
2702
|
* Content hash of the given files, in the order they arrive. Empty when
|
|
2669
2703
|
* the list is empty or a file cannot be read, so a caller that could not
|
|
@@ -2728,12 +2762,12 @@ declare function runDigest(packsDigest: string, packs: ReadonlyArray<{
|
|
|
2728
2762
|
* A run reuses the previous run's summaries whole when nothing changed,
|
|
2729
2763
|
* and per file when some files did. The entry directory's name is a hash
|
|
2730
2764
|
* of the schema version, the adapter and packs digest, and the config
|
|
2731
|
-
* path
|
|
2732
|
-
*
|
|
2733
|
-
*
|
|
2734
|
-
*
|
|
2735
|
-
*
|
|
2736
|
-
* design notes describe the cache in full.
|
|
2765
|
+
* path. The manifest inside records a stamp and content hash per file,
|
|
2766
|
+
* the files each summary belongs to, and the other files each walk read.
|
|
2767
|
+
* The summaries are in one shard per source file, beside an index of the
|
|
2768
|
+
* boundaries and calls in each. An adapter's own data on a file's record,
|
|
2769
|
+
* `meta`, goes in a file of its own, and the cache never reads it. The
|
|
2770
|
+
* package's design notes describe the cache in full.
|
|
2737
2771
|
*/
|
|
2738
2772
|
|
|
2739
2773
|
/**
|
|
@@ -2885,6 +2919,12 @@ interface CacheInput {
|
|
|
2885
2919
|
*/
|
|
2886
2920
|
configPath?: string;
|
|
2887
2921
|
}
|
|
2922
|
+
/**
|
|
2923
|
+
* Each summary owned by the walked file it is written in, or by no file
|
|
2924
|
+
* when it is written outside every walked file. For an adapter that
|
|
2925
|
+
* replays its own per-file records rather than calling `reuse`.
|
|
2926
|
+
*/
|
|
2927
|
+
declare function ownersWhereWritten(summaries: readonly BehavioralSummary[], walkedFileOf: (locationFile: string) => string | undefined): string[][];
|
|
2888
2928
|
/**
|
|
2889
2929
|
* A cache layer rooted at `cacheDir`. With `null`, every lookup misses and
|
|
2890
2930
|
* `write` does nothing, for a one-shot extract where the cache would only
|
|
@@ -2892,6 +2932,28 @@ interface CacheInput {
|
|
|
2892
2932
|
*/
|
|
2893
2933
|
declare function createCacheLayer<Meta = unknown, UnitData = unknown>(cacheDir: string | null): CacheLayer<Meta, UnitData>;
|
|
2894
2934
|
|
|
2935
|
+
/**
|
|
2936
|
+
* Where suss keeps the files it writes for itself while it reads a
|
|
2937
|
+
* project: the extraction cache, and the record the MCP server leaves for
|
|
2938
|
+
* the plugin's hooks.
|
|
2939
|
+
*
|
|
2940
|
+
* By default they go under `.suss` in the project, which fails in a
|
|
2941
|
+
* checkout the process may only read. `SUSS_CACHE_DIR` moves them
|
|
2942
|
+
* somewhere else. The `--cache-dir` flag and the MCP server's argument
|
|
2943
|
+
* set the same variable for the process, so one setting reaches every
|
|
2944
|
+
* adapter and a flag wins over the variable already in the environment.
|
|
2945
|
+
*
|
|
2946
|
+
* Several projects can share one chosen directory, so each project gets a
|
|
2947
|
+
* subdirectory whose name is a hash of its path.
|
|
2948
|
+
*/
|
|
2949
|
+
declare const CACHE_DIR_ENV = "SUSS_CACHE_DIR";
|
|
2950
|
+
/** The directory the environment names, made absolute, or null when it names none. */
|
|
2951
|
+
declare function chosenCacheRoot(): string | null;
|
|
2952
|
+
/** The extraction cache for the files read under `projectDir`. */
|
|
2953
|
+
declare function extractionCacheDirFor(projectDir: string): string;
|
|
2954
|
+
/** The file where the server for `projectDir` says how to reach it. */
|
|
2955
|
+
declare function liveRecordFor(projectDir: string): string;
|
|
2956
|
+
|
|
2895
2957
|
/**
|
|
2896
2958
|
* Whether a write after `statAt` could leave this file's mtime and size
|
|
2897
2959
|
* where the stat saw them, because its last change was that recent.
|
|
@@ -3215,6 +3277,26 @@ interface PackGradient {
|
|
|
3215
3277
|
}
|
|
3216
3278
|
/** The gradient for every pack in a run that declared anything. */
|
|
3217
3279
|
declare function packGradients(report: ExtractionReport): PackGradient[];
|
|
3280
|
+
/**
|
|
3281
|
+
* A pack the run asked for that reads nothing until a project option is
|
|
3282
|
+
* set, such as the directory a GraphQL pack looks classes up under.
|
|
3283
|
+
* `example` is a config file's JSON text with a value that works for a
|
|
3284
|
+
* project laid out the way the library's generator leaves it.
|
|
3285
|
+
*/
|
|
3286
|
+
interface PackConfigNeed {
|
|
3287
|
+
pack: string;
|
|
3288
|
+
option: string;
|
|
3289
|
+
example: string;
|
|
3290
|
+
}
|
|
3291
|
+
/**
|
|
3292
|
+
* Packs the run left out because their option was missing.
|
|
3293
|
+
*
|
|
3294
|
+
* Without the option the pack has no way to find anything, and the rest
|
|
3295
|
+
* of the run looks the same as it would for a project the pack has
|
|
3296
|
+
* nothing to say about. The pack is not part of the extraction report,
|
|
3297
|
+
* since it never ran, so the caller passes these in.
|
|
3298
|
+
*/
|
|
3299
|
+
declare function packConfigCheck(needs: ReadonlyArray<PackConfigNeed>): HealthCheck;
|
|
3218
3300
|
/**
|
|
3219
3301
|
* Run every health check over one extraction report and return what
|
|
3220
3302
|
* fired, grouped by which check caught it.
|
|
@@ -3907,4 +3989,4 @@ declare function rawConditionToPredicate(c: RawCondition): Predicate;
|
|
|
3907
3989
|
declare function effectToIR(effect: RawEffect): Effect;
|
|
3908
3990
|
declare function paramToInput(param: RawParameter): Input;
|
|
3909
3991
|
|
|
3910
|
-
export { type AccessRecognizer, type AdapterCodeStamp, type AdapterStamp, type ArgumentParser, type AstCapableOps, type BindingExtraction, type BodyContent, type CacheAttribution, type CacheDiagnostic, type CacheInput, type CacheLayer, type CacheLookup, type CallOps, type CaseGroup, type ChannelSource, type ChildrenOf, type ChosenReading, type ClassOps, type ConditionHandle, type ConditionInfo, type ConditionSource, type ConstructedFrom, type ContractPattern, type DeclaredBinding, type DeclaredBy, type DeclaredMatch, type DeclaredModule, type DeclaredStatusDecorators, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type EmptyStage, EnclosingNodes, type ExitKind, type ExtractionConfig, type ExtractionReport, type ExtractorOptions, type FailureDelivery, type GlobalPrefixCall, type HandOffSite, type HealthCheck, type HealthViolation, type HelperDeclarations, type HelperSearch, type HelperSink, type HelperValue, IdMap, IdSet, type Identified, type InputMappingPattern, type InputRead, type InvocationRecognizer, type KeepsArms, KeptParses, type LanguageAdapter, type LoweredStatementParts, MAX_ENTRIES, MAX_HELPER_PATHS, MAX_PATHS, MODULE_SURFACE_RECOGNITION, type ModuleInitOptions, type NodeVisitor, type OpsCarrier, type PackDeclarations, type PackFailure, type PackFunnel, type PackGradient, type PackTally, type ParameterSupplier, type ParsedNode, type PartialPlan, PathBudgetExceeded, type PatternPack, type ProjectHelper, type ProjectHelpers, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawProvenance, type RawTerminal, type Reading, type ReceiverOrigin, type RedirectDelivery, type RedirectOption, type RegistrationHelper, type ResponsePropertyMapping, type ResponsePropertyMeaning, type RootRecord, type RouteVersioning, SKIP_CHILDREN, type SettledModule, type SourceRange, type SourceSpelling, type StatedSlot, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TestCaseMatch, type Timer, type TimingReport, type TransparentWrapper, type UnitRecord, UnmodeledFlow, type UnsettledName, type ValueEntry, type ValueOps, type VersionPlacement, type WalkEnd, type WrapperMethodRegistration, type WrapperOptionRegistration, type WrapperRegistration, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, buildUngatedExtractionReport, commonDirectoryOf, composeWrappers, computeContentHash, computeDistHashFrom, configuredCallOption, createAdapterStamp, createCacheLayer, createPackTallies, createTimer, detectGaps, effectToIR, emptyTally, enumerateOrDegrade, enumerateStructuredPaths, evaluatePackHealth, extractionConfigStamp, firstWrittenReading, formatPackHealth, guardsHoldOn, helperPathsOnVariables, httpRouteDiscovery, isListedTestFile, makeIgnoredDirectory, makeTransitionId, mapReading, markReturnsAsExitCode, matchesTestFileName, mergeReadShapes, moduleInitStructure, moduleOfFile, noopTimer, packGradients, paramToInput, projectFileStamp, rawConditionToPredicate, recordPackFailure, redirectDeliveryWhenSet, registrationHelperDiscovery, routeHelperIndex, runDigest, runsBefore, scopeOption, settleModules, sharedGatingConditions, sourceRefsOf, splitAtHandOffs, stampMayMissAWrite, stampModuleImports, stampModules, storageSystemOption, summaryCountsByPack, tallyUnit, terminalToOutput, throughHelper, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, walkDescendants, wrapperDiscovery, writtenReading };
|
|
3992
|
+
export { type AccessRecognizer, type AdapterCodeStamp, type AdapterStamp, type ArgumentParser, type AstCapableOps, type BindingExtraction, type BodyContent, CACHE_DIR_ENV, type CacheAttribution, type CacheDiagnostic, type CacheInput, type CacheLayer, type CacheLookup, type CallOps, type CaseGroup, type ChannelSource, type ChildrenOf, type ChosenReading, type ClassOps, type CodeHasher, type ConditionHandle, type ConditionInfo, type ConditionSource, type ConstructedFrom, type ContractPattern, type DeclaredBinding, type DeclaredBy, type DeclaredMatch, type DeclaredModule, type DeclaredStatusDecorators, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type EmptyStage, EnclosingNodes, type ExitKind, type ExtractionConfig, type ExtractionReport, type ExtractorOptions, type FailureDelivery, type GlobalPrefixCall, type HandOffSite, type HealthCheck, type HealthViolation, type HelperDeclarations, type HelperSearch, type HelperSink, type HelperValue, IdMap, IdSet, type Identified, type InputMappingPattern, type InputRead, type InvocationRecognizer, type KeepsArms, KeptParses, type LanguageAdapter, type LoweredStatementParts, MAX_ENTRIES, MAX_HELPER_PATHS, MAX_PATHS, MODULE_SURFACE_RECOGNITION, type ModuleInitOptions, type NodeVisitor, type OpsCarrier, type PackConfigNeed, type PackDeclarations, type PackFailure, type PackFunnel, type PackGradient, type PackTally, type ParameterSupplier, type ParsedNode, type PartialPlan, PathBudgetExceeded, type PatternPack, type ProjectHelper, type ProjectHelpers, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawProvenance, type RawTerminal, type Reading, type ReceiverOrigin, type RedirectDelivery, type RedirectOption, type RegistrationHelper, type ResponsePropertyMapping, type ResponsePropertyMeaning, type RootRecord, type RouteVersioning, SKIP_CHILDREN, type SettledModule, type SourceRange, type SourceSpelling, type StatedSlot, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TestCaseMatch, type Timer, type TimingReport, type TransparentWrapper, type UnitRecord, UnmodeledFlow, type UnsettledName, type ValueEntry, type ValueOps, type VersionPlacement, type WalkEnd, type WrapperMethodRegistration, type WrapperOptionRegistration, type WrapperRegistration, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, buildUngatedExtractionReport, chosenCacheRoot, commonDirectoryOf, composeWrappers, computeContentHash, computeDistHashFrom, configuredCallOption, createAdapterStamp, createCacheLayer, createCodeHasher, createPackTallies, createTimer, detectGaps, effectToIR, emptyTally, enumerateOrDegrade, enumerateStructuredPaths, evaluatePackHealth, extractionCacheDirFor, extractionConfigStamp, firstWrittenReading, formatPackHealth, guardsHoldOn, helperPathsOnVariables, httpRouteDiscovery, isListedTestFile, liveRecordFor, makeIgnoredDirectory, makeTransitionId, mapReading, markReturnsAsExitCode, matchesTestFileName, mergeReadShapes, moduleInitStructure, moduleOfFile, noopTimer, ownersWhereWritten, packConfigCheck, packGradients, paramToInput, processCodeHasher, projectFileStamp, rawConditionToPredicate, recordPackFailure, redirectDeliveryWhenSet, registrationHelperDiscovery, routeHelperIndex, runDigest, runsBefore, scopeOption, settleModules, sharedGatingConditions, sourceRefsOf, splitAtHandOffs, stampMayMissAWrite, stampModuleImports, stampModules, storageSystemOption, summaryCountsByPack, tallyUnit, terminalToOutput, throughHelper, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, walkDescendants, wrapperDiscovery, writtenReading };
|