@suss/extractor 0.13.0 → 0.13.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.
- package/dist/index.d.cts +215 -1
- package/dist/index.d.ts +215 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1715,6 +1715,220 @@ interface LanguageAdapter {
|
|
|
1715
1715
|
extractAll(): Promise<BehavioralSummary[]>;
|
|
1716
1716
|
}
|
|
1717
1717
|
|
|
1718
|
+
/**
|
|
1719
|
+
* The vocabulary a language adapter implements so that any declared
|
|
1720
|
+
* pack runs on it.
|
|
1721
|
+
*
|
|
1722
|
+
* A pack is data, so something has to turn "did this module declare the
|
|
1723
|
+
* method" into a yes or no about a particular program. That is the
|
|
1724
|
+
* adapter's job, and these interfaces are the whole of what a pack can
|
|
1725
|
+
* ask for. An adapter implements them once and every pack runs there,
|
|
1726
|
+
* which is what lets one pack drive several languages.
|
|
1727
|
+
*
|
|
1728
|
+
* They live here rather than beside the builders that produce them,
|
|
1729
|
+
* because an adapter needs this and none of the rest: the TypeScript
|
|
1730
|
+
* adapter imports these types and no runtime code from
|
|
1731
|
+
* `@suss/recognize`. Python and Ruby will want the same.
|
|
1732
|
+
*
|
|
1733
|
+
* Nothing here mentions a syntax tree. A pack that needs the tree goes
|
|
1734
|
+
* through `@suss/recognize/ast`, a separate import so that reaching for
|
|
1735
|
+
* it shows up in a diff and in the pack health report.
|
|
1736
|
+
*/
|
|
1737
|
+
/**
|
|
1738
|
+
* How a pack pins down the receiver a call is on.
|
|
1739
|
+
*
|
|
1740
|
+
* The migration plan for #542 lists four more: `factoryMade` (`app =
|
|
1741
|
+
* express()`), `imported`, `anchored` (a chain read from its anchor
|
|
1742
|
+
* call), `inherits` (a Ruby or Python receiver matched by ancestry) and
|
|
1743
|
+
* `global` (`process.env`, bare `fetch`). Each arrives as a member here
|
|
1744
|
+
* with an entry in every adapter's dispatch table. The README beside
|
|
1745
|
+
* this file says which starts are not receiver-shaped at all.
|
|
1746
|
+
*/
|
|
1747
|
+
type ReceiverOrigin = DeclaredBy | ConstructedFrom;
|
|
1748
|
+
/**
|
|
1749
|
+
* A receiver whose method one of these modules declared.
|
|
1750
|
+
*
|
|
1751
|
+
* This is the origin for a client the source never spells out. `const
|
|
1752
|
+
* redis = await this.getClient()` says nothing about ioredis, and the
|
|
1753
|
+
* declaration behind `redis.get` says everything.
|
|
1754
|
+
*/
|
|
1755
|
+
interface DeclaredBy {
|
|
1756
|
+
readonly origin: "declaredBy";
|
|
1757
|
+
/** The modules whose declarations settle the call. */
|
|
1758
|
+
readonly importedFrom: readonly string[];
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* A client made from a module's export, however the program caches it.
|
|
1762
|
+
* Asked of the receiver itself, so it still works where the method is untyped
|
|
1763
|
+
* and `declaredBy` finds nothing to read. A call that reaches for no
|
|
1764
|
+
* receiver, `new GetObjectCommand(...)`, is made by its own callee.
|
|
1765
|
+
*/
|
|
1766
|
+
interface ConstructedFrom {
|
|
1767
|
+
readonly origin: "constructed";
|
|
1768
|
+
/** The modules whose export the client was made from. */
|
|
1769
|
+
readonly importedFrom: readonly string[];
|
|
1770
|
+
/**
|
|
1771
|
+
* Which of those exports, when a pack has to tell two apart. Every
|
|
1772
|
+
* AWS SDK command comes from the one module and goes through the one
|
|
1773
|
+
* `send`, so the command class is what says which operation a call
|
|
1774
|
+
* performs. Unset matches whatever the module exports.
|
|
1775
|
+
*/
|
|
1776
|
+
readonly named?: readonly string[];
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* What a reader gives back for a name nothing in the source settles.
|
|
1780
|
+
* `"nothing"` gives null, `"reference"` gives the value to go and ask
|
|
1781
|
+
* about instead.
|
|
1782
|
+
*/
|
|
1783
|
+
type UnsettledName = "nothing" | "reference";
|
|
1784
|
+
/**
|
|
1785
|
+
* One value a call states, as the questions a pack can ask about it.
|
|
1786
|
+
*
|
|
1787
|
+
* `CallOps` reaches a call beside the one in hand, and this reaches the
|
|
1788
|
+
* values that are not calls. A library that takes one request object
|
|
1789
|
+
* puts everything the call is doing inside it, sometimes as a list and
|
|
1790
|
+
* sometimes as a string in a little language of the library's own, and
|
|
1791
|
+
* a pack that reads those is handed this rather than the adapter's own
|
|
1792
|
+
* node. So the rule it writes runs wherever the ops do.
|
|
1793
|
+
*/
|
|
1794
|
+
interface ValueOps {
|
|
1795
|
+
/** The text of the string the source wrote, or null for anything else. */
|
|
1796
|
+
text(): string | null;
|
|
1797
|
+
/**
|
|
1798
|
+
* What this value is called, when the source names it rather than
|
|
1799
|
+
* writing it out. A queue URL is nearly always
|
|
1800
|
+
* `process.env.ORDERS_QUEUE_URL`, so the value only exists at deploy
|
|
1801
|
+
* time and the env var's name is what both sides of the boundary
|
|
1802
|
+
* agree on. `"reference"` gives that name back, `"nothing"` gives
|
|
1803
|
+
* null for anything the source does not settle.
|
|
1804
|
+
*/
|
|
1805
|
+
name(unsettled: UnsettledName): string | null;
|
|
1806
|
+
/**
|
|
1807
|
+
* The yes or no the source wrote here, or null for anything else. A
|
|
1808
|
+
* library that asks which fields a call wants states them as a map of
|
|
1809
|
+
* flags, `{ name: 1, password: 0 }`, and a number and a boolean mean
|
|
1810
|
+
* the same thing in one of those.
|
|
1811
|
+
*/
|
|
1812
|
+
flag(): boolean | null;
|
|
1813
|
+
/** What this object states, entry by entry. Empty for anything else. */
|
|
1814
|
+
entries(unsettled: UnsettledName): readonly ValueEntry[];
|
|
1815
|
+
/** What this list states, item by item. Empty for anything else. */
|
|
1816
|
+
items(): readonly ValueOps[];
|
|
1817
|
+
/** What one named property of this object states, or null for none. */
|
|
1818
|
+
property(name: string): ValueOps | null;
|
|
1819
|
+
/**
|
|
1820
|
+
* The pieces of text the source wrote here, in order, with whatever
|
|
1821
|
+
* it interpolated between them left out. A string is one piece and a
|
|
1822
|
+
* template is one piece per hole plus one, so a reader that means to
|
|
1823
|
+
* put its own placeholders in the holes can. Null when the source
|
|
1824
|
+
* wrote neither.
|
|
1825
|
+
*/
|
|
1826
|
+
parts(): readonly string[] | null;
|
|
1827
|
+
/**
|
|
1828
|
+
* What the source interpolated between those pieces, in order, each
|
|
1829
|
+
* as the call it was written as. There is one per gap, one fewer than
|
|
1830
|
+
* `parts` gives, and a hole the source wrote as something other than
|
|
1831
|
+
* a call is null rather than being dropped, so the two lists stay in
|
|
1832
|
+
* step.
|
|
1833
|
+
*
|
|
1834
|
+
* What a hole comes to is the pack's to say. This says what was
|
|
1835
|
+
* there, so a query that hands over a table object can still be read.
|
|
1836
|
+
*/
|
|
1837
|
+
holes(): readonly (CallOps | null)[];
|
|
1838
|
+
}
|
|
1839
|
+
/** One entry of an object a call states. */
|
|
1840
|
+
interface ValueEntry {
|
|
1841
|
+
/**
|
|
1842
|
+
* What the entry is called. A key the source computes,
|
|
1843
|
+
* `{ [table]: ... }`, is read the way any other name is.
|
|
1844
|
+
*/
|
|
1845
|
+
readonly key: string | null;
|
|
1846
|
+
/** What the entry says. */
|
|
1847
|
+
readonly value: ValueOps;
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* One call site, as the questions a chain asks about it.
|
|
1851
|
+
*
|
|
1852
|
+
* An adapter builds one of these per call and hands it to the
|
|
1853
|
+
* recognizer through its context. Every member is about the call in
|
|
1854
|
+
* hand, so there is no node to pass around and no place for a pack to
|
|
1855
|
+
* reach past what it declared.
|
|
1856
|
+
*
|
|
1857
|
+
* Two members give back another `CallOps`, which is how these questions
|
|
1858
|
+
* reach a call next to this one. A chain of calls and a command object
|
|
1859
|
+
* are both these same questions asked one step along, so neither needed
|
|
1860
|
+
* a question of its own.
|
|
1861
|
+
*/
|
|
1862
|
+
interface CallOps {
|
|
1863
|
+
/** Which method the call reaches for, spelled as the source spells it. */
|
|
1864
|
+
method(): string | null;
|
|
1865
|
+
/** Whether the receiver came from where the origin says. */
|
|
1866
|
+
receiverIsFrom(origin: ReceiverOrigin): boolean;
|
|
1867
|
+
/**
|
|
1868
|
+
* Whether the call itself came from where the origin says, which is
|
|
1869
|
+
* the same question asked of the callee rather than of what it was
|
|
1870
|
+
* called on. `new GetCommand(...)` is the case: a pack that steps to
|
|
1871
|
+
* an argument asks this of it before reading anything, so it never
|
|
1872
|
+
* reads an argument that was never the one.
|
|
1873
|
+
*/
|
|
1874
|
+
isFrom(origin: ReceiverOrigin): boolean;
|
|
1875
|
+
/** How many arguments the call passes. */
|
|
1876
|
+
argumentCount(): number;
|
|
1877
|
+
/** The name the argument in this position gives. */
|
|
1878
|
+
nameAt(index: number, unsettled: UnsettledName): string | null;
|
|
1879
|
+
/** The callee, as the source writes it. */
|
|
1880
|
+
calleeText(): string;
|
|
1881
|
+
/**
|
|
1882
|
+
* The call the receiver is, or null when the receiver is not a call.
|
|
1883
|
+
* A receiver the source wrote into a variable comes back as the call
|
|
1884
|
+
* it was written as.
|
|
1885
|
+
*/
|
|
1886
|
+
receiver(): CallOps | null;
|
|
1887
|
+
/**
|
|
1888
|
+
* The call the argument in this position is, or null when that
|
|
1889
|
+
* argument is neither a call nor a construction. `new
|
|
1890
|
+
* GetObjectCommand(...)` comes back as a call whose callee is the
|
|
1891
|
+
* class, the same as any other call.
|
|
1892
|
+
*/
|
|
1893
|
+
argument(index: number): CallOps | null;
|
|
1894
|
+
/**
|
|
1895
|
+
* The call the callee itself was written as, or null when nothing
|
|
1896
|
+
* wrote it as one. A class a factory made is the case: `new
|
|
1897
|
+
* User({...})` says nothing about what `User` is, and the
|
|
1898
|
+
* `model("User", schema)` call it was declared as says everything.
|
|
1899
|
+
*/
|
|
1900
|
+
callee(): CallOps | null;
|
|
1901
|
+
/**
|
|
1902
|
+
* What a named property of the object an argument states says. A
|
|
1903
|
+
* property bag is not a call, so nothing else here reaches into one.
|
|
1904
|
+
*/
|
|
1905
|
+
propertyAt(index: number, property: string, unsettled: UnsettledName): string | null;
|
|
1906
|
+
/**
|
|
1907
|
+
* The value the argument in this position states, or null when the
|
|
1908
|
+
* call passes none. `propertyAt` reads one name out of a property
|
|
1909
|
+
* bag, which covers a pack that wants one; this hands the bag over
|
|
1910
|
+
* for a pack whose rule has to walk it.
|
|
1911
|
+
*/
|
|
1912
|
+
valueAt(index: number): ValueOps | null;
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* The property an adapter puts its ops on, in the context it hands a
|
|
1916
|
+
* recognizer. A context without it belongs to an adapter that has not
|
|
1917
|
+
* implemented the ops, and a declared pack matches nothing there.
|
|
1918
|
+
*/
|
|
1919
|
+
interface OpsCarrier {
|
|
1920
|
+
ops?: CallOps;
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* The ops an adapter implements when it can hand out its own nodes. The
|
|
1924
|
+
* extra member is here rather than on `CallOps` so that a pack reaching
|
|
1925
|
+
* for a node has to import this module first.
|
|
1926
|
+
*/
|
|
1927
|
+
interface AstCapableOps extends CallOps {
|
|
1928
|
+
/** The adapter's own node for the call in hand. */
|
|
1929
|
+
ast(): unknown;
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1718
1932
|
/**
|
|
1719
1933
|
* The assembly engine: a `RawCodeStructure` from a language adapter goes in,
|
|
1720
1934
|
* a `BehavioralSummary` comes out. The package README explains where that step
|
|
@@ -2004,4 +2218,4 @@ declare function terminalToOutput(terminal: RawTerminal): Output;
|
|
|
2004
2218
|
declare function effectToIR(effect: RawEffect): Effect;
|
|
2005
2219
|
declare function paramToInput(param: RawParameter): Input;
|
|
2006
2220
|
|
|
2007
|
-
export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DeclaredMatch, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, type FailureDelivery, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, type LoweredStatementParts, type PackDeclarations, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
|
|
2221
|
+
export { type AccessRecognizer, type AstCapableOps, type BindingExtraction, type BodyContent, type CallOps, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ConstructedFrom, type ContractPattern, type DeclaredBy, type DeclaredMatch, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, type FailureDelivery, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, type LoweredStatementParts, type OpsCarrier, type PackDeclarations, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ReceiverOrigin, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, type UnsettledName, type ValueEntry, type ValueOps, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
|
package/dist/index.d.ts
CHANGED
|
@@ -1715,6 +1715,220 @@ interface LanguageAdapter {
|
|
|
1715
1715
|
extractAll(): Promise<BehavioralSummary[]>;
|
|
1716
1716
|
}
|
|
1717
1717
|
|
|
1718
|
+
/**
|
|
1719
|
+
* The vocabulary a language adapter implements so that any declared
|
|
1720
|
+
* pack runs on it.
|
|
1721
|
+
*
|
|
1722
|
+
* A pack is data, so something has to turn "did this module declare the
|
|
1723
|
+
* method" into a yes or no about a particular program. That is the
|
|
1724
|
+
* adapter's job, and these interfaces are the whole of what a pack can
|
|
1725
|
+
* ask for. An adapter implements them once and every pack runs there,
|
|
1726
|
+
* which is what lets one pack drive several languages.
|
|
1727
|
+
*
|
|
1728
|
+
* They live here rather than beside the builders that produce them,
|
|
1729
|
+
* because an adapter needs this and none of the rest: the TypeScript
|
|
1730
|
+
* adapter imports these types and no runtime code from
|
|
1731
|
+
* `@suss/recognize`. Python and Ruby will want the same.
|
|
1732
|
+
*
|
|
1733
|
+
* Nothing here mentions a syntax tree. A pack that needs the tree goes
|
|
1734
|
+
* through `@suss/recognize/ast`, a separate import so that reaching for
|
|
1735
|
+
* it shows up in a diff and in the pack health report.
|
|
1736
|
+
*/
|
|
1737
|
+
/**
|
|
1738
|
+
* How a pack pins down the receiver a call is on.
|
|
1739
|
+
*
|
|
1740
|
+
* The migration plan for #542 lists four more: `factoryMade` (`app =
|
|
1741
|
+
* express()`), `imported`, `anchored` (a chain read from its anchor
|
|
1742
|
+
* call), `inherits` (a Ruby or Python receiver matched by ancestry) and
|
|
1743
|
+
* `global` (`process.env`, bare `fetch`). Each arrives as a member here
|
|
1744
|
+
* with an entry in every adapter's dispatch table. The README beside
|
|
1745
|
+
* this file says which starts are not receiver-shaped at all.
|
|
1746
|
+
*/
|
|
1747
|
+
type ReceiverOrigin = DeclaredBy | ConstructedFrom;
|
|
1748
|
+
/**
|
|
1749
|
+
* A receiver whose method one of these modules declared.
|
|
1750
|
+
*
|
|
1751
|
+
* This is the origin for a client the source never spells out. `const
|
|
1752
|
+
* redis = await this.getClient()` says nothing about ioredis, and the
|
|
1753
|
+
* declaration behind `redis.get` says everything.
|
|
1754
|
+
*/
|
|
1755
|
+
interface DeclaredBy {
|
|
1756
|
+
readonly origin: "declaredBy";
|
|
1757
|
+
/** The modules whose declarations settle the call. */
|
|
1758
|
+
readonly importedFrom: readonly string[];
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* A client made from a module's export, however the program caches it.
|
|
1762
|
+
* Asked of the receiver itself, so it still works where the method is untyped
|
|
1763
|
+
* and `declaredBy` finds nothing to read. A call that reaches for no
|
|
1764
|
+
* receiver, `new GetObjectCommand(...)`, is made by its own callee.
|
|
1765
|
+
*/
|
|
1766
|
+
interface ConstructedFrom {
|
|
1767
|
+
readonly origin: "constructed";
|
|
1768
|
+
/** The modules whose export the client was made from. */
|
|
1769
|
+
readonly importedFrom: readonly string[];
|
|
1770
|
+
/**
|
|
1771
|
+
* Which of those exports, when a pack has to tell two apart. Every
|
|
1772
|
+
* AWS SDK command comes from the one module and goes through the one
|
|
1773
|
+
* `send`, so the command class is what says which operation a call
|
|
1774
|
+
* performs. Unset matches whatever the module exports.
|
|
1775
|
+
*/
|
|
1776
|
+
readonly named?: readonly string[];
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* What a reader gives back for a name nothing in the source settles.
|
|
1780
|
+
* `"nothing"` gives null, `"reference"` gives the value to go and ask
|
|
1781
|
+
* about instead.
|
|
1782
|
+
*/
|
|
1783
|
+
type UnsettledName = "nothing" | "reference";
|
|
1784
|
+
/**
|
|
1785
|
+
* One value a call states, as the questions a pack can ask about it.
|
|
1786
|
+
*
|
|
1787
|
+
* `CallOps` reaches a call beside the one in hand, and this reaches the
|
|
1788
|
+
* values that are not calls. A library that takes one request object
|
|
1789
|
+
* puts everything the call is doing inside it, sometimes as a list and
|
|
1790
|
+
* sometimes as a string in a little language of the library's own, and
|
|
1791
|
+
* a pack that reads those is handed this rather than the adapter's own
|
|
1792
|
+
* node. So the rule it writes runs wherever the ops do.
|
|
1793
|
+
*/
|
|
1794
|
+
interface ValueOps {
|
|
1795
|
+
/** The text of the string the source wrote, or null for anything else. */
|
|
1796
|
+
text(): string | null;
|
|
1797
|
+
/**
|
|
1798
|
+
* What this value is called, when the source names it rather than
|
|
1799
|
+
* writing it out. A queue URL is nearly always
|
|
1800
|
+
* `process.env.ORDERS_QUEUE_URL`, so the value only exists at deploy
|
|
1801
|
+
* time and the env var's name is what both sides of the boundary
|
|
1802
|
+
* agree on. `"reference"` gives that name back, `"nothing"` gives
|
|
1803
|
+
* null for anything the source does not settle.
|
|
1804
|
+
*/
|
|
1805
|
+
name(unsettled: UnsettledName): string | null;
|
|
1806
|
+
/**
|
|
1807
|
+
* The yes or no the source wrote here, or null for anything else. A
|
|
1808
|
+
* library that asks which fields a call wants states them as a map of
|
|
1809
|
+
* flags, `{ name: 1, password: 0 }`, and a number and a boolean mean
|
|
1810
|
+
* the same thing in one of those.
|
|
1811
|
+
*/
|
|
1812
|
+
flag(): boolean | null;
|
|
1813
|
+
/** What this object states, entry by entry. Empty for anything else. */
|
|
1814
|
+
entries(unsettled: UnsettledName): readonly ValueEntry[];
|
|
1815
|
+
/** What this list states, item by item. Empty for anything else. */
|
|
1816
|
+
items(): readonly ValueOps[];
|
|
1817
|
+
/** What one named property of this object states, or null for none. */
|
|
1818
|
+
property(name: string): ValueOps | null;
|
|
1819
|
+
/**
|
|
1820
|
+
* The pieces of text the source wrote here, in order, with whatever
|
|
1821
|
+
* it interpolated between them left out. A string is one piece and a
|
|
1822
|
+
* template is one piece per hole plus one, so a reader that means to
|
|
1823
|
+
* put its own placeholders in the holes can. Null when the source
|
|
1824
|
+
* wrote neither.
|
|
1825
|
+
*/
|
|
1826
|
+
parts(): readonly string[] | null;
|
|
1827
|
+
/**
|
|
1828
|
+
* What the source interpolated between those pieces, in order, each
|
|
1829
|
+
* as the call it was written as. There is one per gap, one fewer than
|
|
1830
|
+
* `parts` gives, and a hole the source wrote as something other than
|
|
1831
|
+
* a call is null rather than being dropped, so the two lists stay in
|
|
1832
|
+
* step.
|
|
1833
|
+
*
|
|
1834
|
+
* What a hole comes to is the pack's to say. This says what was
|
|
1835
|
+
* there, so a query that hands over a table object can still be read.
|
|
1836
|
+
*/
|
|
1837
|
+
holes(): readonly (CallOps | null)[];
|
|
1838
|
+
}
|
|
1839
|
+
/** One entry of an object a call states. */
|
|
1840
|
+
interface ValueEntry {
|
|
1841
|
+
/**
|
|
1842
|
+
* What the entry is called. A key the source computes,
|
|
1843
|
+
* `{ [table]: ... }`, is read the way any other name is.
|
|
1844
|
+
*/
|
|
1845
|
+
readonly key: string | null;
|
|
1846
|
+
/** What the entry says. */
|
|
1847
|
+
readonly value: ValueOps;
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* One call site, as the questions a chain asks about it.
|
|
1851
|
+
*
|
|
1852
|
+
* An adapter builds one of these per call and hands it to the
|
|
1853
|
+
* recognizer through its context. Every member is about the call in
|
|
1854
|
+
* hand, so there is no node to pass around and no place for a pack to
|
|
1855
|
+
* reach past what it declared.
|
|
1856
|
+
*
|
|
1857
|
+
* Two members give back another `CallOps`, which is how these questions
|
|
1858
|
+
* reach a call next to this one. A chain of calls and a command object
|
|
1859
|
+
* are both these same questions asked one step along, so neither needed
|
|
1860
|
+
* a question of its own.
|
|
1861
|
+
*/
|
|
1862
|
+
interface CallOps {
|
|
1863
|
+
/** Which method the call reaches for, spelled as the source spells it. */
|
|
1864
|
+
method(): string | null;
|
|
1865
|
+
/** Whether the receiver came from where the origin says. */
|
|
1866
|
+
receiverIsFrom(origin: ReceiverOrigin): boolean;
|
|
1867
|
+
/**
|
|
1868
|
+
* Whether the call itself came from where the origin says, which is
|
|
1869
|
+
* the same question asked of the callee rather than of what it was
|
|
1870
|
+
* called on. `new GetCommand(...)` is the case: a pack that steps to
|
|
1871
|
+
* an argument asks this of it before reading anything, so it never
|
|
1872
|
+
* reads an argument that was never the one.
|
|
1873
|
+
*/
|
|
1874
|
+
isFrom(origin: ReceiverOrigin): boolean;
|
|
1875
|
+
/** How many arguments the call passes. */
|
|
1876
|
+
argumentCount(): number;
|
|
1877
|
+
/** The name the argument in this position gives. */
|
|
1878
|
+
nameAt(index: number, unsettled: UnsettledName): string | null;
|
|
1879
|
+
/** The callee, as the source writes it. */
|
|
1880
|
+
calleeText(): string;
|
|
1881
|
+
/**
|
|
1882
|
+
* The call the receiver is, or null when the receiver is not a call.
|
|
1883
|
+
* A receiver the source wrote into a variable comes back as the call
|
|
1884
|
+
* it was written as.
|
|
1885
|
+
*/
|
|
1886
|
+
receiver(): CallOps | null;
|
|
1887
|
+
/**
|
|
1888
|
+
* The call the argument in this position is, or null when that
|
|
1889
|
+
* argument is neither a call nor a construction. `new
|
|
1890
|
+
* GetObjectCommand(...)` comes back as a call whose callee is the
|
|
1891
|
+
* class, the same as any other call.
|
|
1892
|
+
*/
|
|
1893
|
+
argument(index: number): CallOps | null;
|
|
1894
|
+
/**
|
|
1895
|
+
* The call the callee itself was written as, or null when nothing
|
|
1896
|
+
* wrote it as one. A class a factory made is the case: `new
|
|
1897
|
+
* User({...})` says nothing about what `User` is, and the
|
|
1898
|
+
* `model("User", schema)` call it was declared as says everything.
|
|
1899
|
+
*/
|
|
1900
|
+
callee(): CallOps | null;
|
|
1901
|
+
/**
|
|
1902
|
+
* What a named property of the object an argument states says. A
|
|
1903
|
+
* property bag is not a call, so nothing else here reaches into one.
|
|
1904
|
+
*/
|
|
1905
|
+
propertyAt(index: number, property: string, unsettled: UnsettledName): string | null;
|
|
1906
|
+
/**
|
|
1907
|
+
* The value the argument in this position states, or null when the
|
|
1908
|
+
* call passes none. `propertyAt` reads one name out of a property
|
|
1909
|
+
* bag, which covers a pack that wants one; this hands the bag over
|
|
1910
|
+
* for a pack whose rule has to walk it.
|
|
1911
|
+
*/
|
|
1912
|
+
valueAt(index: number): ValueOps | null;
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* The property an adapter puts its ops on, in the context it hands a
|
|
1916
|
+
* recognizer. A context without it belongs to an adapter that has not
|
|
1917
|
+
* implemented the ops, and a declared pack matches nothing there.
|
|
1918
|
+
*/
|
|
1919
|
+
interface OpsCarrier {
|
|
1920
|
+
ops?: CallOps;
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* The ops an adapter implements when it can hand out its own nodes. The
|
|
1924
|
+
* extra member is here rather than on `CallOps` so that a pack reaching
|
|
1925
|
+
* for a node has to import this module first.
|
|
1926
|
+
*/
|
|
1927
|
+
interface AstCapableOps extends CallOps {
|
|
1928
|
+
/** The adapter's own node for the call in hand. */
|
|
1929
|
+
ast(): unknown;
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1718
1932
|
/**
|
|
1719
1933
|
* The assembly engine: a `RawCodeStructure` from a language adapter goes in,
|
|
1720
1934
|
* a `BehavioralSummary` comes out. The package README explains where that step
|
|
@@ -2004,4 +2218,4 @@ declare function terminalToOutput(terminal: RawTerminal): Output;
|
|
|
2004
2218
|
declare function effectToIR(effect: RawEffect): Effect;
|
|
2005
2219
|
declare function paramToInput(param: RawParameter): Input;
|
|
2006
2220
|
|
|
2007
|
-
export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DeclaredMatch, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, type FailureDelivery, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, type LoweredStatementParts, type PackDeclarations, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
|
|
2221
|
+
export { type AccessRecognizer, type AstCapableOps, type BindingExtraction, type BodyContent, type CallOps, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ConstructedFrom, type ContractPattern, type DeclaredBy, type DeclaredMatch, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, type FailureDelivery, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, type LoweredStatementParts, type OpsCarrier, type PackDeclarations, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ReceiverOrigin, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, type UnsettledName, type ValueEntry, type ValueOps, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suss/extractor",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Framework-agnostic extraction pipeline that turns raw extractions into suss behavioral summaries.",
|
|
6
6
|
"keywords": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typecheck": "tsc --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@suss/behavioral-ir": "0.13.
|
|
48
|
+
"@suss/behavioral-ir": "0.13.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsup": "*",
|