@suss/resolution 0.35.1 → 0.37.0
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 +1396 -1208
- package/dist/index.d.cts +61 -1
- package/dist/index.d.ts +61 -1
- package/dist/index.js +1382 -1204
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -497,6 +497,19 @@ declare function renderExplanation(explanation: ResolutionExplanation, describe:
|
|
|
497
497
|
/** Each importing file's imported files, both spelled by `displayPathOf`. */
|
|
498
498
|
declare function importedFilesByFile(db: Database, displayPathOf: (file: string) => string): Map<string, string[]>;
|
|
499
499
|
|
|
500
|
+
/**
|
|
501
|
+
* The method a class has under a name, its bases' included, for a walk
|
|
502
|
+
* that looks a method up on a subclass the call was sent to rather than
|
|
503
|
+
* on the class the calling method is written in.
|
|
504
|
+
*/
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The member a class has under a name, its bases' included, once the
|
|
508
|
+
* members a nearer one overrides are set aside. Null when there is none,
|
|
509
|
+
* or more than one, as with two bases that both write it.
|
|
510
|
+
*/
|
|
511
|
+
declare function memberOf(db: Database, classKey: string, name: string, program: OnDemandRules): string | null;
|
|
512
|
+
|
|
500
513
|
/**
|
|
501
514
|
* Mount composition, shared between adapters. An adapter states one
|
|
502
515
|
* fact per mount call, `mounted(child, parent, prefix)`, however its
|
|
@@ -866,6 +879,53 @@ declare function underQuestionSpend(db: Database): Readonly<UnderSpend>;
|
|
|
866
879
|
*/
|
|
867
880
|
declare function askResolutionUnder(db: Database, pairs: Iterable<readonly [string, string]>, program?: OnDemandRules, questionBudget?: number, runBudget?: number): UnderOutcome;
|
|
868
881
|
|
|
882
|
+
/** The form a receiver takes when the method runs on the class itself. */
|
|
883
|
+
declare const SELF_AS_CLASS_NAME = "class";
|
|
884
|
+
declare const SELF_AS_CLASS: _suss_datalog.Term;
|
|
885
|
+
/** The form a receiver takes when the method runs on an instance. */
|
|
886
|
+
declare const SELF_AS_INSTANCE_NAME = "instance";
|
|
887
|
+
declare const SELF_AS_INSTANCE: _suss_datalog.Term;
|
|
888
|
+
type SelfForm = typeof SELF_AS_CLASS_NAME | typeof SELF_AS_INSTANCE_NAME;
|
|
889
|
+
/**
|
|
890
|
+
* The receiver a call was sent to when the method it ran returns that
|
|
891
|
+
* receiver, or one made from it, and the form it returns. Null when the
|
|
892
|
+
* key is no such call, or could be more than one.
|
|
893
|
+
*/
|
|
894
|
+
declare function selfResultOf(db: Database, key: string): {
|
|
895
|
+
readonly receiver: string;
|
|
896
|
+
readonly form: SelfForm;
|
|
897
|
+
} | null;
|
|
898
|
+
/**
|
|
899
|
+
* The form in which a key asked about with `wanted` comes from this
|
|
900
|
+
* receiver, or null when it does not, or when it comes from it both as
|
|
901
|
+
* the class and as an instance.
|
|
902
|
+
*/
|
|
903
|
+
declare function selfFormOf(db: Database, key: string, receiver: string): SelfForm | null;
|
|
904
|
+
/** A class that inherits a method, by a file that declares it and its name. */
|
|
905
|
+
interface SubclassPlace {
|
|
906
|
+
readonly file: string;
|
|
907
|
+
readonly name: string;
|
|
908
|
+
}
|
|
909
|
+
/** The walk's key for a method running on a subclass. */
|
|
910
|
+
declare function variantKey(key: string, subclass: SubclassPlace): string;
|
|
911
|
+
/** The method's own key, from its key or one of its variants' keys. */
|
|
912
|
+
declare function plainKeyOf(key: string): string;
|
|
913
|
+
/** A method a walk reached on a subclass, as one of the walk's bodies. */
|
|
914
|
+
interface ReceiverVariant {
|
|
915
|
+
readonly key: string;
|
|
916
|
+
/** Whether one of its calls goes somewhere else on the subclass than on the class the method is written in. */
|
|
917
|
+
readonly differs: boolean;
|
|
918
|
+
/** The keys of the bodies its calls reach. */
|
|
919
|
+
readonly calls: readonly string[];
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* The variants worth a summary of their own: one whose calls go
|
|
923
|
+
* somewhere else on the subclass, and one that calls such a variant. Any
|
|
924
|
+
* other variant does what the method does on its own class, so its
|
|
925
|
+
* callers link to that summary instead.
|
|
926
|
+
*/
|
|
927
|
+
declare function keptVariants(variants: readonly ReceiverVariant[]): Set<string>;
|
|
928
|
+
|
|
869
929
|
/**
|
|
870
930
|
* The result shape a why session hands back, shared by every language
|
|
871
931
|
* adapter so the CLI reads one type regardless of which adapter
|
|
@@ -1287,4 +1347,4 @@ declare const ANSWER_RELATIONS: string[];
|
|
|
1287
1347
|
*/
|
|
1288
1348
|
declare const UNDER_ANSWER_RELATIONS: string[];
|
|
1289
1349
|
|
|
1290
|
-
export { ANSWER_RELATIONS, ASKING_RELATIONS, type AddRow, type AskUnder, type AssociationConstructor, BASE_CLASS_RULE, type CalleeOutcome, type CaseFiles, type ChainReads, type Changes, type ContractCase, type ContractOptions, DEFAULT_IMPORT_NAME, DISPATCH_QUESTION, type Dependencies, DependencyLedger, type DescribeAtom, type DispatchOutcome, type EntersAsSelf, EntryReuse, type ExplainOptions, type ExplainResolvedKeyOptions, type ExplainStats, FACT_CONTRACT_CASES, FactLog, type FactsOf, GLOBAL_MODULE, type GivesBackOne, type GivesBackOneOfArgument, type GivesBackOneOfImport, INSTANCE_STEP, type KeySpan, type MountEdge, type MountEdges, NAMED_STORE_NAME, NAMESPACE_IMPORT, NAMESPACE_IMPORT_NAME, NAMESPACE_MEMBER_RULE, NAME_HOP_RULE, NO_CONTEXT, NO_CONTEXT_NAME, type NameReads, type NameWrite, type OrderedWrite, type PackWords, RECEIVER_STORE_NAME, RESOLUTION_QUESTIONS, RESOLUTION_RULES, RESULT_STEP, type ReadNode, type ResolutionExplanation, type ResolutionStep, SPREAD_ENTRY, type SourceEnd, type SourceLeaf, type SourceQuestion, type SpannedNode, type StepContext, type StepPhrase, type StoredDependencies, type StoredFacts, type StoredFileRecord, type StoredWalkRecord, type SuppliesParameter, type TemplatePiece, UNDER_ANSWER_RELATIONS, UNDER_QUESTION_ROW_BUDGET, UNDER_RUN_ROW_BUDGET, UNPLACED_STORE_NAME, USES_QUESTION, type UnderOutcome, type UnwrapsByName, VALUE_ENTRY, VALUE_STEP, type ValueLocation, type ValueUses, WatchedMap, type WhyExplained, type WrittenEntry, addEntryRows, addPackWords, addTemplateRows, agreedMountPrefix, allocationSitesOf, alsoSteps, answersFor, answersFromTestsLeftOut, askResolution, askResolutionUnder, askSources, calleeOutcomeOf, calleeOutcomes, checkFactContract, classMemberName, classMemberOf, comesToUnder, couldBeSettled, declaredTypesOf, dispatchOutcomes, exitCodeFunctions, explainResolutionProof, explainResolvedKey, fallbackWrittenAs, fileOfKey, hashString, importedFilesByFile, isObserved, isWrittenAsUnder, joinMountedPath, mergeStoredDependencies, mountPathsOf, noDependencies, nodeOfKey, noteKeyRead, noteLookup, objectOfUnder, observeDemand, packHashes, proofRules, queryFacts, readDispatchOutcomes, readUses, recordsToReplay, renderExplanation, resolutionProgram, resolutionUnderProgram, resolvedFunctions, settledFunction, sourceLeavesOf, spanOfKey, startsAtName, staysInItsFunction, stillValid, underQuestionSpend, unpackHashes, valueLeftByWrites, walkRecordsByFile, writesRunInOrder, writtenAnswersFor, writtenSourcesOf, writtenValueOf, writtenValueUnder, writtenValuesByKey, writtenValuesOf };
|
|
1350
|
+
export { ANSWER_RELATIONS, ASKING_RELATIONS, type AddRow, type AskUnder, type AssociationConstructor, BASE_CLASS_RULE, type CalleeOutcome, type CaseFiles, type ChainReads, type Changes, type ContractCase, type ContractOptions, DEFAULT_IMPORT_NAME, DISPATCH_QUESTION, type Dependencies, DependencyLedger, type DescribeAtom, type DispatchOutcome, type EntersAsSelf, EntryReuse, type ExplainOptions, type ExplainResolvedKeyOptions, type ExplainStats, FACT_CONTRACT_CASES, FactLog, type FactsOf, GLOBAL_MODULE, type GivesBackOne, type GivesBackOneOfArgument, type GivesBackOneOfImport, INSTANCE_STEP, type KeySpan, type MountEdge, type MountEdges, NAMED_STORE_NAME, NAMESPACE_IMPORT, NAMESPACE_IMPORT_NAME, NAMESPACE_MEMBER_RULE, NAME_HOP_RULE, NO_CONTEXT, NO_CONTEXT_NAME, type NameReads, type NameWrite, type OrderedWrite, type PackWords, RECEIVER_STORE_NAME, RESOLUTION_QUESTIONS, RESOLUTION_RULES, RESULT_STEP, type ReadNode, type ReceiverVariant, type ResolutionExplanation, type ResolutionStep, SELF_AS_CLASS, SELF_AS_CLASS_NAME, SELF_AS_INSTANCE, SELF_AS_INSTANCE_NAME, SPREAD_ENTRY, type SelfForm, type SourceEnd, type SourceLeaf, type SourceQuestion, type SpannedNode, type StepContext, type StepPhrase, type StoredDependencies, type StoredFacts, type StoredFileRecord, type StoredWalkRecord, type SubclassPlace, type SuppliesParameter, type TemplatePiece, UNDER_ANSWER_RELATIONS, UNDER_QUESTION_ROW_BUDGET, UNDER_RUN_ROW_BUDGET, UNPLACED_STORE_NAME, USES_QUESTION, type UnderOutcome, type UnwrapsByName, VALUE_ENTRY, VALUE_STEP, type ValueLocation, type ValueUses, WatchedMap, type WhyExplained, type WrittenEntry, addEntryRows, addPackWords, addTemplateRows, agreedMountPrefix, allocationSitesOf, alsoSteps, answersFor, answersFromTestsLeftOut, askResolution, askResolutionUnder, askSources, calleeOutcomeOf, calleeOutcomes, checkFactContract, classMemberName, classMemberOf, comesToUnder, couldBeSettled, declaredTypesOf, dispatchOutcomes, exitCodeFunctions, explainResolutionProof, explainResolvedKey, fallbackWrittenAs, fileOfKey, hashString, importedFilesByFile, isObserved, isWrittenAsUnder, joinMountedPath, keptVariants, memberOf, mergeStoredDependencies, mountPathsOf, noDependencies, nodeOfKey, noteKeyRead, noteLookup, objectOfUnder, observeDemand, packHashes, plainKeyOf, proofRules, queryFacts, readDispatchOutcomes, readUses, recordsToReplay, renderExplanation, resolutionProgram, resolutionUnderProgram, resolvedFunctions, selfFormOf, selfResultOf, settledFunction, sourceLeavesOf, spanOfKey, startsAtName, staysInItsFunction, stillValid, underQuestionSpend, unpackHashes, valueLeftByWrites, variantKey, walkRecordsByFile, writesRunInOrder, writtenAnswersFor, writtenSourcesOf, writtenValueOf, writtenValueUnder, writtenValuesByKey, writtenValuesOf };
|
package/dist/index.d.ts
CHANGED
|
@@ -497,6 +497,19 @@ declare function renderExplanation(explanation: ResolutionExplanation, describe:
|
|
|
497
497
|
/** Each importing file's imported files, both spelled by `displayPathOf`. */
|
|
498
498
|
declare function importedFilesByFile(db: Database, displayPathOf: (file: string) => string): Map<string, string[]>;
|
|
499
499
|
|
|
500
|
+
/**
|
|
501
|
+
* The method a class has under a name, its bases' included, for a walk
|
|
502
|
+
* that looks a method up on a subclass the call was sent to rather than
|
|
503
|
+
* on the class the calling method is written in.
|
|
504
|
+
*/
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The member a class has under a name, its bases' included, once the
|
|
508
|
+
* members a nearer one overrides are set aside. Null when there is none,
|
|
509
|
+
* or more than one, as with two bases that both write it.
|
|
510
|
+
*/
|
|
511
|
+
declare function memberOf(db: Database, classKey: string, name: string, program: OnDemandRules): string | null;
|
|
512
|
+
|
|
500
513
|
/**
|
|
501
514
|
* Mount composition, shared between adapters. An adapter states one
|
|
502
515
|
* fact per mount call, `mounted(child, parent, prefix)`, however its
|
|
@@ -866,6 +879,53 @@ declare function underQuestionSpend(db: Database): Readonly<UnderSpend>;
|
|
|
866
879
|
*/
|
|
867
880
|
declare function askResolutionUnder(db: Database, pairs: Iterable<readonly [string, string]>, program?: OnDemandRules, questionBudget?: number, runBudget?: number): UnderOutcome;
|
|
868
881
|
|
|
882
|
+
/** The form a receiver takes when the method runs on the class itself. */
|
|
883
|
+
declare const SELF_AS_CLASS_NAME = "class";
|
|
884
|
+
declare const SELF_AS_CLASS: _suss_datalog.Term;
|
|
885
|
+
/** The form a receiver takes when the method runs on an instance. */
|
|
886
|
+
declare const SELF_AS_INSTANCE_NAME = "instance";
|
|
887
|
+
declare const SELF_AS_INSTANCE: _suss_datalog.Term;
|
|
888
|
+
type SelfForm = typeof SELF_AS_CLASS_NAME | typeof SELF_AS_INSTANCE_NAME;
|
|
889
|
+
/**
|
|
890
|
+
* The receiver a call was sent to when the method it ran returns that
|
|
891
|
+
* receiver, or one made from it, and the form it returns. Null when the
|
|
892
|
+
* key is no such call, or could be more than one.
|
|
893
|
+
*/
|
|
894
|
+
declare function selfResultOf(db: Database, key: string): {
|
|
895
|
+
readonly receiver: string;
|
|
896
|
+
readonly form: SelfForm;
|
|
897
|
+
} | null;
|
|
898
|
+
/**
|
|
899
|
+
* The form in which a key asked about with `wanted` comes from this
|
|
900
|
+
* receiver, or null when it does not, or when it comes from it both as
|
|
901
|
+
* the class and as an instance.
|
|
902
|
+
*/
|
|
903
|
+
declare function selfFormOf(db: Database, key: string, receiver: string): SelfForm | null;
|
|
904
|
+
/** A class that inherits a method, by a file that declares it and its name. */
|
|
905
|
+
interface SubclassPlace {
|
|
906
|
+
readonly file: string;
|
|
907
|
+
readonly name: string;
|
|
908
|
+
}
|
|
909
|
+
/** The walk's key for a method running on a subclass. */
|
|
910
|
+
declare function variantKey(key: string, subclass: SubclassPlace): string;
|
|
911
|
+
/** The method's own key, from its key or one of its variants' keys. */
|
|
912
|
+
declare function plainKeyOf(key: string): string;
|
|
913
|
+
/** A method a walk reached on a subclass, as one of the walk's bodies. */
|
|
914
|
+
interface ReceiverVariant {
|
|
915
|
+
readonly key: string;
|
|
916
|
+
/** Whether one of its calls goes somewhere else on the subclass than on the class the method is written in. */
|
|
917
|
+
readonly differs: boolean;
|
|
918
|
+
/** The keys of the bodies its calls reach. */
|
|
919
|
+
readonly calls: readonly string[];
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* The variants worth a summary of their own: one whose calls go
|
|
923
|
+
* somewhere else on the subclass, and one that calls such a variant. Any
|
|
924
|
+
* other variant does what the method does on its own class, so its
|
|
925
|
+
* callers link to that summary instead.
|
|
926
|
+
*/
|
|
927
|
+
declare function keptVariants(variants: readonly ReceiverVariant[]): Set<string>;
|
|
928
|
+
|
|
869
929
|
/**
|
|
870
930
|
* The result shape a why session hands back, shared by every language
|
|
871
931
|
* adapter so the CLI reads one type regardless of which adapter
|
|
@@ -1287,4 +1347,4 @@ declare const ANSWER_RELATIONS: string[];
|
|
|
1287
1347
|
*/
|
|
1288
1348
|
declare const UNDER_ANSWER_RELATIONS: string[];
|
|
1289
1349
|
|
|
1290
|
-
export { ANSWER_RELATIONS, ASKING_RELATIONS, type AddRow, type AskUnder, type AssociationConstructor, BASE_CLASS_RULE, type CalleeOutcome, type CaseFiles, type ChainReads, type Changes, type ContractCase, type ContractOptions, DEFAULT_IMPORT_NAME, DISPATCH_QUESTION, type Dependencies, DependencyLedger, type DescribeAtom, type DispatchOutcome, type EntersAsSelf, EntryReuse, type ExplainOptions, type ExplainResolvedKeyOptions, type ExplainStats, FACT_CONTRACT_CASES, FactLog, type FactsOf, GLOBAL_MODULE, type GivesBackOne, type GivesBackOneOfArgument, type GivesBackOneOfImport, INSTANCE_STEP, type KeySpan, type MountEdge, type MountEdges, NAMED_STORE_NAME, NAMESPACE_IMPORT, NAMESPACE_IMPORT_NAME, NAMESPACE_MEMBER_RULE, NAME_HOP_RULE, NO_CONTEXT, NO_CONTEXT_NAME, type NameReads, type NameWrite, type OrderedWrite, type PackWords, RECEIVER_STORE_NAME, RESOLUTION_QUESTIONS, RESOLUTION_RULES, RESULT_STEP, type ReadNode, type ResolutionExplanation, type ResolutionStep, SPREAD_ENTRY, type SourceEnd, type SourceLeaf, type SourceQuestion, type SpannedNode, type StepContext, type StepPhrase, type StoredDependencies, type StoredFacts, type StoredFileRecord, type StoredWalkRecord, type SuppliesParameter, type TemplatePiece, UNDER_ANSWER_RELATIONS, UNDER_QUESTION_ROW_BUDGET, UNDER_RUN_ROW_BUDGET, UNPLACED_STORE_NAME, USES_QUESTION, type UnderOutcome, type UnwrapsByName, VALUE_ENTRY, VALUE_STEP, type ValueLocation, type ValueUses, WatchedMap, type WhyExplained, type WrittenEntry, addEntryRows, addPackWords, addTemplateRows, agreedMountPrefix, allocationSitesOf, alsoSteps, answersFor, answersFromTestsLeftOut, askResolution, askResolutionUnder, askSources, calleeOutcomeOf, calleeOutcomes, checkFactContract, classMemberName, classMemberOf, comesToUnder, couldBeSettled, declaredTypesOf, dispatchOutcomes, exitCodeFunctions, explainResolutionProof, explainResolvedKey, fallbackWrittenAs, fileOfKey, hashString, importedFilesByFile, isObserved, isWrittenAsUnder, joinMountedPath, mergeStoredDependencies, mountPathsOf, noDependencies, nodeOfKey, noteKeyRead, noteLookup, objectOfUnder, observeDemand, packHashes, proofRules, queryFacts, readDispatchOutcomes, readUses, recordsToReplay, renderExplanation, resolutionProgram, resolutionUnderProgram, resolvedFunctions, settledFunction, sourceLeavesOf, spanOfKey, startsAtName, staysInItsFunction, stillValid, underQuestionSpend, unpackHashes, valueLeftByWrites, walkRecordsByFile, writesRunInOrder, writtenAnswersFor, writtenSourcesOf, writtenValueOf, writtenValueUnder, writtenValuesByKey, writtenValuesOf };
|
|
1350
|
+
export { ANSWER_RELATIONS, ASKING_RELATIONS, type AddRow, type AskUnder, type AssociationConstructor, BASE_CLASS_RULE, type CalleeOutcome, type CaseFiles, type ChainReads, type Changes, type ContractCase, type ContractOptions, DEFAULT_IMPORT_NAME, DISPATCH_QUESTION, type Dependencies, DependencyLedger, type DescribeAtom, type DispatchOutcome, type EntersAsSelf, EntryReuse, type ExplainOptions, type ExplainResolvedKeyOptions, type ExplainStats, FACT_CONTRACT_CASES, FactLog, type FactsOf, GLOBAL_MODULE, type GivesBackOne, type GivesBackOneOfArgument, type GivesBackOneOfImport, INSTANCE_STEP, type KeySpan, type MountEdge, type MountEdges, NAMED_STORE_NAME, NAMESPACE_IMPORT, NAMESPACE_IMPORT_NAME, NAMESPACE_MEMBER_RULE, NAME_HOP_RULE, NO_CONTEXT, NO_CONTEXT_NAME, type NameReads, type NameWrite, type OrderedWrite, type PackWords, RECEIVER_STORE_NAME, RESOLUTION_QUESTIONS, RESOLUTION_RULES, RESULT_STEP, type ReadNode, type ReceiverVariant, type ResolutionExplanation, type ResolutionStep, SELF_AS_CLASS, SELF_AS_CLASS_NAME, SELF_AS_INSTANCE, SELF_AS_INSTANCE_NAME, SPREAD_ENTRY, type SelfForm, type SourceEnd, type SourceLeaf, type SourceQuestion, type SpannedNode, type StepContext, type StepPhrase, type StoredDependencies, type StoredFacts, type StoredFileRecord, type StoredWalkRecord, type SubclassPlace, type SuppliesParameter, type TemplatePiece, UNDER_ANSWER_RELATIONS, UNDER_QUESTION_ROW_BUDGET, UNDER_RUN_ROW_BUDGET, UNPLACED_STORE_NAME, USES_QUESTION, type UnderOutcome, type UnwrapsByName, VALUE_ENTRY, VALUE_STEP, type ValueLocation, type ValueUses, WatchedMap, type WhyExplained, type WrittenEntry, addEntryRows, addPackWords, addTemplateRows, agreedMountPrefix, allocationSitesOf, alsoSteps, answersFor, answersFromTestsLeftOut, askResolution, askResolutionUnder, askSources, calleeOutcomeOf, calleeOutcomes, checkFactContract, classMemberName, classMemberOf, comesToUnder, couldBeSettled, declaredTypesOf, dispatchOutcomes, exitCodeFunctions, explainResolutionProof, explainResolvedKey, fallbackWrittenAs, fileOfKey, hashString, importedFilesByFile, isObserved, isWrittenAsUnder, joinMountedPath, keptVariants, memberOf, mergeStoredDependencies, mountPathsOf, noDependencies, nodeOfKey, noteKeyRead, noteLookup, objectOfUnder, observeDemand, packHashes, plainKeyOf, proofRules, queryFacts, readDispatchOutcomes, readUses, recordsToReplay, renderExplanation, resolutionProgram, resolutionUnderProgram, resolvedFunctions, selfFormOf, selfResultOf, settledFunction, sourceLeavesOf, spanOfKey, startsAtName, staysInItsFunction, stillValid, underQuestionSpend, unpackHashes, valueLeftByWrites, variantKey, walkRecordsByFile, writesRunInOrder, writtenAnswersFor, writtenSourcesOf, writtenValueOf, writtenValueUnder, writtenValuesByKey, writtenValuesOf };
|