@ohos-perf/core 0.20.0 → 0.22.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.d.ts +518 -97
- package/dist/index.js +840 -267
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4850,6 +4850,21 @@ interface RunOptions {
|
|
|
4850
4850
|
/** Injected clock, for tests. */
|
|
4851
4851
|
readonly now?: () => number;
|
|
4852
4852
|
}
|
|
4853
|
+
/**
|
|
4854
|
+
* Evaluate a step's `expect` block against one dump.
|
|
4855
|
+
*
|
|
4856
|
+
* Every clause is evaluated even after one fails: a reader looking at a
|
|
4857
|
+
* failed step wants to know that the screen also lost the toolbar, not just
|
|
4858
|
+
* that it lost the first thing checked. `foreground` comes last so the
|
|
4859
|
+
* clauses an author wrote in order appear in that order, and a screenshot
|
|
4860
|
+
* showing the launcher explains the `present` misses above it.
|
|
4861
|
+
*
|
|
4862
|
+
* `foreground` means the app owns at least one node. A system dialog drawn
|
|
4863
|
+
* over the app is still the app's screen — the title bar and the window frame
|
|
4864
|
+
* belong to it — so requiring the app to own *every* node would fail on the
|
|
4865
|
+
* one case an author most wants to assert.
|
|
4866
|
+
*/
|
|
4867
|
+
declare function evaluateExpectation(expect: StepExpectation, nodes: readonly UiNode[], app: string): ExpectationOutcome[];
|
|
4853
4868
|
/**
|
|
4854
4869
|
* Run a scenario: every selected (round, step) pair, one scene each.
|
|
4855
4870
|
*
|
|
@@ -4889,6 +4904,508 @@ declare class ScenarioRunner {
|
|
|
4889
4904
|
*/
|
|
4890
4905
|
declare function writeRunFiles(outDir: string, result: RunResult): void;
|
|
4891
4906
|
|
|
4907
|
+
/**
|
|
4908
|
+
* The model-driven UI agent (HapRay parity row 5).
|
|
4909
|
+
*
|
|
4910
|
+
* HapRay's `gui-agent` wraps the external `phone_agent` package: the model is
|
|
4911
|
+
* shown a screenshot, answers with one action, and says `finished` when it
|
|
4912
|
+
* believes the task is done. Three things make that unusable as a measurement
|
|
4913
|
+
* tool, and each is fixed here rather than reproduced.
|
|
4914
|
+
*
|
|
4915
|
+
* 1. **`finished` is taken on faith.** A model that taps a button which does
|
|
4916
|
+
* nothing and then declares success is recorded as a success. Here a
|
|
4917
|
+
* completion claim carries an expectation, the expectation is evaluated
|
|
4918
|
+
* against a fresh dump, and a claim the screen contradicts is recorded as
|
|
4919
|
+
* `unverified` — a failure with the clause that failed named.
|
|
4920
|
+
* 2. **The safety rule lives only in the prompt.** HapRay tells the model to
|
|
4921
|
+
* avoid payment, ordering and transfers; a model that ignores the sentence
|
|
4922
|
+
* acts anyway. Here the guard reads the node the tap lands on and refuses
|
|
4923
|
+
* the gesture outright. An irreversible action stops the run: a model that
|
|
4924
|
+
* reached for a payment button has lost the thread of the task, and asking
|
|
4925
|
+
* it again spends steps on the one thing that must not happen.
|
|
4926
|
+
* 3. **The log cannot be replayed.** HapRay records `{action, thinking,
|
|
4927
|
+
* message}` as prose, so two runs of the same task are two unrelated logs.
|
|
4928
|
+
* Here every step records the gesture and the screen hash either side of
|
|
4929
|
+
* it, so {@link replayAgent} can walk the same path on another build
|
|
4930
|
+
* without a model, and stop at the first screen that is not the recorded
|
|
4931
|
+
* one.
|
|
4932
|
+
*
|
|
4933
|
+
* The model is injected, never bundled: {@link AgentModel} is one method, so a
|
|
4934
|
+
* caller supplies whatever client it has, and the loop is tested without a
|
|
4935
|
+
* network or a device.
|
|
4936
|
+
*/
|
|
4937
|
+
|
|
4938
|
+
/** The device surface the loop needs. `Device` satisfies it structurally. */
|
|
4939
|
+
interface AgentDevice {
|
|
4940
|
+
readonly id: string;
|
|
4941
|
+
/** A fresh flattened dump, as `Device.uiTree` returns. */
|
|
4942
|
+
uiTree(): Promise<readonly UiNode[]>;
|
|
4943
|
+
gesture(g: Gesture): Promise<GestureResult>;
|
|
4944
|
+
}
|
|
4945
|
+
/** What the model answers: one gesture, or a claim that the task is done. */
|
|
4946
|
+
type AgentDecision = {
|
|
4947
|
+
readonly action: Gesture;
|
|
4948
|
+
readonly reason: string;
|
|
4949
|
+
} | {
|
|
4950
|
+
readonly done: true;
|
|
4951
|
+
readonly reason: string;
|
|
4952
|
+
readonly expect?: StepExpectation;
|
|
4953
|
+
};
|
|
4954
|
+
/** One earlier step, as the model sees it when deciding the next. */
|
|
4955
|
+
interface AgentHistoryEntry {
|
|
4956
|
+
readonly step: number;
|
|
4957
|
+
readonly status: AgentStepStatus;
|
|
4958
|
+
readonly reason: string;
|
|
4959
|
+
/** What the step did, as `describeDecision` renders it. */
|
|
4960
|
+
readonly did?: string;
|
|
4961
|
+
readonly detail?: string;
|
|
4962
|
+
}
|
|
4963
|
+
/** Everything a model is shown. A client renders this into its own prompt. */
|
|
4964
|
+
interface AgentTurn {
|
|
4965
|
+
readonly task: string;
|
|
4966
|
+
readonly app: string;
|
|
4967
|
+
/** Zero-based index of the step being decided. */
|
|
4968
|
+
readonly step: number;
|
|
4969
|
+
readonly maxSteps: number;
|
|
4970
|
+
/** The current screen, one line per node. */
|
|
4971
|
+
readonly screen: string;
|
|
4972
|
+
/** The steps already taken, oldest first. */
|
|
4973
|
+
readonly history: readonly AgentHistoryEntry[];
|
|
4974
|
+
}
|
|
4975
|
+
/** The injected client. One method, so any endpoint fits. */
|
|
4976
|
+
interface AgentModel {
|
|
4977
|
+
decide(request: AgentTurn): Promise<AgentDecision>;
|
|
4978
|
+
}
|
|
4979
|
+
/**
|
|
4980
|
+
* How a step ended.
|
|
4981
|
+
*
|
|
4982
|
+
* `acted` is a gesture the device accepted, `failed` one it rejected,
|
|
4983
|
+
* `refused` one the guard stopped before it reached the device, `verified` a
|
|
4984
|
+
* completion claim the screen confirmed, and `unverified` one it did not.
|
|
4985
|
+
*/
|
|
4986
|
+
type AgentStepStatus = 'acted' | 'failed' | 'refused' | 'verified' | 'unverified';
|
|
4987
|
+
interface AgentStep {
|
|
4988
|
+
readonly index: number;
|
|
4989
|
+
readonly status: AgentStepStatus;
|
|
4990
|
+
readonly reason: string;
|
|
4991
|
+
/** The gesture performed or attempted; absent for a refusal or a claim. */
|
|
4992
|
+
readonly action?: Gesture;
|
|
4993
|
+
/** Why the step ended that way, when the status alone does not say. */
|
|
4994
|
+
readonly detail?: string;
|
|
4995
|
+
/** The screen hash before the step. */
|
|
4996
|
+
readonly before: string;
|
|
4997
|
+
/** The screen hash after it; equal to `before` when nothing moved. */
|
|
4998
|
+
readonly after: string;
|
|
4999
|
+
readonly navigated: boolean;
|
|
5000
|
+
}
|
|
5001
|
+
type AgentStatus = 'completed' | 'unverified' | 'refused' | 'exhausted';
|
|
5002
|
+
/** A run, complete enough to replay and to compare against another run. */
|
|
5003
|
+
interface AgentTranscript {
|
|
5004
|
+
readonly version: 1;
|
|
5005
|
+
readonly task: string;
|
|
5006
|
+
readonly app: string;
|
|
5007
|
+
readonly steps: readonly AgentStep[];
|
|
5008
|
+
readonly status: AgentStatus;
|
|
5009
|
+
/** Distinct screen hashes reached, including the one it started on. */
|
|
5010
|
+
readonly statesReached: number;
|
|
5011
|
+
}
|
|
5012
|
+
type AgentResult = AgentTranscript;
|
|
5013
|
+
interface AgentOptions {
|
|
5014
|
+
readonly task: string;
|
|
5015
|
+
readonly app: string;
|
|
5016
|
+
/** Hard cap on model turns. HapRay's default is 50. */
|
|
5017
|
+
readonly maxSteps: number;
|
|
5018
|
+
/** Let the guard's refusals through. Off by default. */
|
|
5019
|
+
readonly allowIrreversible?: boolean;
|
|
5020
|
+
}
|
|
5021
|
+
/** One irreversible action the guard recognises. */
|
|
5022
|
+
interface IrreversiblePattern {
|
|
5023
|
+
readonly pattern: RegExp;
|
|
5024
|
+
/** Why the action is refused; the text a refusal records. */
|
|
5025
|
+
readonly why: string;
|
|
5026
|
+
/** A label that matches `pattern`, so a test can prove the row is live. */
|
|
5027
|
+
readonly sample: string;
|
|
5028
|
+
}
|
|
5029
|
+
/**
|
|
5030
|
+
* The actions the guard refuses.
|
|
5031
|
+
*
|
|
5032
|
+
* Each pattern names an act, not a topic: `Payment settings` is a screen a
|
|
5033
|
+
* walk may legitimately open, while `立即支付` is money leaving an account.
|
|
5034
|
+
* Matching on a bare substring would block the settings page a task needs.
|
|
5035
|
+
*/
|
|
5036
|
+
declare const IRREVERSIBLE_PATTERNS: readonly IrreversiblePattern[];
|
|
5037
|
+
/** Why tapping this node is irreversible, or `undefined` when it is safe. */
|
|
5038
|
+
declare function irreversibleReason(node: UiNode): string | undefined;
|
|
5039
|
+
/** One line naming what a decision does, for a transcript or a history entry. */
|
|
5040
|
+
declare function describeDecision(decision: AgentDecision): string;
|
|
5041
|
+
/**
|
|
5042
|
+
* Render a dump for a model prompt: one line per node, in tree order.
|
|
5043
|
+
*
|
|
5044
|
+
* The fields are the ones a decision is made from — what it says, what it is,
|
|
5045
|
+
* what it is called, where it is, and whether it can be tapped. A node that
|
|
5046
|
+
* cannot be tapped is marked so the model does not spend a step on it, which
|
|
5047
|
+
* is the single most common wasted turn in HapRay's runs.
|
|
5048
|
+
*/
|
|
5049
|
+
declare function renderTree(tree: readonly UiNode[]): string;
|
|
5050
|
+
/**
|
|
5051
|
+
* The prompt for one decision.
|
|
5052
|
+
*
|
|
5053
|
+
* A plain string, not a message list: whatever client a caller brings turns
|
|
5054
|
+
* this into its own request shape. It states the answer format literally
|
|
5055
|
+
* because a model that invents a gesture name fails far from the answer that
|
|
5056
|
+
* caused it, and it shows the history because a model that cannot see its own
|
|
5057
|
+
* steps repeats them.
|
|
5058
|
+
*/
|
|
5059
|
+
declare function agentPrompt(request: AgentTurn): string;
|
|
5060
|
+
/**
|
|
5061
|
+
* Read a model's answer.
|
|
5062
|
+
*
|
|
5063
|
+
* The answer is data from outside this package, so every field is checked
|
|
5064
|
+
* here: an unknown gesture name, a malformed expectation, or an object that is
|
|
5065
|
+
* both an action and a completion is a refusal naming what was wrong. A
|
|
5066
|
+
* refusal now beats a confusing failure inside the gesture driver or the
|
|
5067
|
+
* expectation evaluator, where the cause is no longer visible.
|
|
5068
|
+
*/
|
|
5069
|
+
declare function parseDecision(text: string): AgentDecision;
|
|
5070
|
+
/**
|
|
5071
|
+
* Run the loop until the model's claim is verified, the guard refuses, or the
|
|
5072
|
+
* step budget runs out.
|
|
5073
|
+
*
|
|
5074
|
+
* The order of checks matters: an irreversible target is refused *before* the
|
|
5075
|
+
* gesture reaches the device, and a completion claim is evaluated against the
|
|
5076
|
+
* screen the model was shown rather than a fresh one — the model has to be
|
|
5077
|
+
* judged on what it saw.
|
|
5078
|
+
*/
|
|
5079
|
+
declare function runAgent(device: AgentDevice, model: AgentModel, options: AgentOptions): Promise<AgentResult>;
|
|
5080
|
+
/** What a replay did. */
|
|
5081
|
+
interface ReplayResult {
|
|
5082
|
+
/** Steps whose gesture reached the device. */
|
|
5083
|
+
readonly performed: number;
|
|
5084
|
+
/** Steps skipped because they never touched the device. */
|
|
5085
|
+
readonly skipped: number;
|
|
5086
|
+
/** The step whose recorded screen did not match; absent when it matched. */
|
|
5087
|
+
readonly divergedAt?: number;
|
|
5088
|
+
}
|
|
5089
|
+
/**
|
|
5090
|
+
* Walk a recorded transcript again, without a model.
|
|
5091
|
+
*
|
|
5092
|
+
* The recorded gesture is a coordinate, so it only means what it meant on the
|
|
5093
|
+
* screen it was recorded against. Each step re-dumps, compares the hash to the
|
|
5094
|
+
* recorded `before`, and stops at the first mismatch: continuing would send
|
|
5095
|
+
* taps into whatever the new build put in those places.
|
|
5096
|
+
*
|
|
5097
|
+
* A step with no gesture (a refusal, or a completion claim) is skipped: it
|
|
5098
|
+
* never touched the device, so there is nothing to replay.
|
|
5099
|
+
*/
|
|
5100
|
+
declare function replayAgent(device: AgentDevice, transcript: AgentTranscript): Promise<ReplayResult>;
|
|
5101
|
+
|
|
5102
|
+
/**
|
|
5103
|
+
* A reader for the ELF headers, sections and symbols of an OHOS native binary.
|
|
5104
|
+
*
|
|
5105
|
+
* This exists for HapRay parity row 27. HapRay's `opt-detector` answers "what
|
|
5106
|
+
* optimization level was this built at, and was LTO on?" by feeding raw
|
|
5107
|
+
* `.text` bytes to a ~2 GB LSTM and a 551-feature SVM and printing the guess
|
|
5108
|
+
* as a percentage. An ELF records much of that directly — LTO leaves
|
|
5109
|
+
* `lto_priv.*` symbols and `.gnu.lto_*` sections, `-O0` leaves debug
|
|
5110
|
+
* sections, and the instruction mix is a fact about the bytes — so the
|
|
5111
|
+
* analyzer built on this reader reports what the file says and labels the
|
|
5112
|
+
* parts that are inference.
|
|
5113
|
+
*
|
|
5114
|
+
* What is here is deliberately narrow: the section header table, the two
|
|
5115
|
+
* symbol tables, and a decoder for the AArch64 instruction classes whose
|
|
5116
|
+
* density differs across optimization levels. There is no program-header
|
|
5117
|
+
* walk, no relocation processing, no dynamic-section parsing and no
|
|
5118
|
+
* disassembly — nothing this reader does not have a caller for.
|
|
5119
|
+
*
|
|
5120
|
+
* ## Refusals
|
|
5121
|
+
*
|
|
5122
|
+
* Every read is bounds-checked against the buffer, because a `.so` shipped
|
|
5123
|
+
* inside an app is attacker-controlled input as far as this package is
|
|
5124
|
+
* concerned. A bad magic, a short header, an unsupported class and a section
|
|
5125
|
+
* table pointing past the end are typed refusals naming the field, not bare
|
|
5126
|
+
* `RangeError`s from a `DataView`.
|
|
5127
|
+
*/
|
|
5128
|
+
/** `e_machine` for AArch64, the only machine an OHOS app ships. */
|
|
5129
|
+
declare const EM_AARCH64 = 183;
|
|
5130
|
+
/** One section header, as much of it as a caller here needs. */
|
|
5131
|
+
interface ElfSection {
|
|
5132
|
+
readonly name: string;
|
|
5133
|
+
readonly type: number;
|
|
5134
|
+
readonly flags: number;
|
|
5135
|
+
/** Offset of the payload in the file. */
|
|
5136
|
+
readonly offset: number;
|
|
5137
|
+
/** Declared size. A `NOBITS` section declares one but occupies no bytes. */
|
|
5138
|
+
readonly size: number;
|
|
5139
|
+
/** Entry size for a table section (`sh_entsize`), else 0. */
|
|
5140
|
+
readonly entrySize: number;
|
|
5141
|
+
}
|
|
5142
|
+
/** One symbol, with the binding and type decoded from `st_info`. */
|
|
5143
|
+
interface ElfSymbol {
|
|
5144
|
+
readonly name: string;
|
|
5145
|
+
readonly bind: 'local' | 'global' | 'weak' | 'other';
|
|
5146
|
+
readonly type: 'notype' | 'func' | 'object' | 'section' | 'file' | 'other';
|
|
5147
|
+
readonly size: number;
|
|
5148
|
+
/**
|
|
5149
|
+
* `st_value`: the symbol's address. In a shared object this is the file
|
|
5150
|
+
* offset of the code, which is what a `libfoo.so+0xoffset` reference names.
|
|
5151
|
+
*/
|
|
5152
|
+
readonly value: number;
|
|
5153
|
+
/** Section index the symbol belongs to; 0 for undefined, 0xfff1 for absolute. */
|
|
5154
|
+
readonly sectionIndex: number;
|
|
5155
|
+
}
|
|
5156
|
+
interface ElfFile {
|
|
5157
|
+
readonly bits: 32 | 64;
|
|
5158
|
+
readonly endian: 'little' | 'big';
|
|
5159
|
+
readonly machine: number;
|
|
5160
|
+
/** `e_type`: 1 relocatable, 2 executable, 3 shared object, 4 core. */
|
|
5161
|
+
readonly type: number;
|
|
5162
|
+
readonly sections: readonly ElfSection[];
|
|
5163
|
+
readonly symbols: readonly ElfSymbol[];
|
|
5164
|
+
/** The section with this name, or `undefined`. */
|
|
5165
|
+
readonly section: (name: string) => ElfSection | undefined;
|
|
5166
|
+
/** The payload of a section; empty for `NOBITS` and for a missing section. */
|
|
5167
|
+
readonly bytesOf: (name: string) => Uint8Array;
|
|
5168
|
+
}
|
|
5169
|
+
/**
|
|
5170
|
+
* Read an ELF's headers, sections and symbols.
|
|
5171
|
+
*
|
|
5172
|
+
* Only 64-bit little-endian is decoded. The class and endianness are read
|
|
5173
|
+
* first and refused by name, so a 32-bit or big-endian file gets a message
|
|
5174
|
+
* saying which shape was unsupported rather than a nonsensical section table.
|
|
5175
|
+
*/
|
|
5176
|
+
declare function readElf(bytes: Uint8Array): ElfFile;
|
|
5177
|
+
/** The instruction classes whose density differs across optimization levels. */
|
|
5178
|
+
type InstructionClass = 'ret' | 'blr' | 'br' | 'bl' | 'b' | 'bcond' | 'cbz' | 'tbz' | 'adrp' | 'adr' | 'ldr' | 'str' | 'add' | 'vector' | 'other';
|
|
5179
|
+
/** Per-class instruction counts over a `.text` payload. */
|
|
5180
|
+
type InstructionCounts = Record<InstructionClass, number> & {
|
|
5181
|
+
total: number;
|
|
5182
|
+
};
|
|
5183
|
+
/**
|
|
5184
|
+
* Classify one AArch64 instruction word.
|
|
5185
|
+
*
|
|
5186
|
+
* The masks are the ARM ARM's fixed-field encodings for the classes whose
|
|
5187
|
+
* frequency a compiler changes: `ret`/`blr`/`br` (branch-register), `bl`/`b`
|
|
5188
|
+
* (immediate branch), `b.cond`, `cbz`/`cbnz`, `tbz`/`tbnz`, `adrp`/`adr`, and
|
|
5189
|
+
* the SIMD group. `other` covers everything else, which is most arithmetic.
|
|
5190
|
+
*
|
|
5191
|
+
* The order matters: `br`/`blr`/`ret` share a mask and are separated by their
|
|
5192
|
+
* `opc` field, and `b`/`bl` share a mask separated by bit 31.
|
|
5193
|
+
*/
|
|
5194
|
+
declare function classifyInstruction(word: number): InstructionClass;
|
|
5195
|
+
/**
|
|
5196
|
+
* Count instruction classes over a payload.
|
|
5197
|
+
*
|
|
5198
|
+
* A trailing partial word is not an instruction and is not counted; a section
|
|
5199
|
+
* whose size is not a multiple of four is legal padding.
|
|
5200
|
+
*/
|
|
5201
|
+
declare function countInstructions(payload: Uint8Array): InstructionCounts;
|
|
5202
|
+
|
|
5203
|
+
/**
|
|
5204
|
+
* Symbol recovery (HapRay parity row 28).
|
|
5205
|
+
*
|
|
5206
|
+
* HapRay's `symbol_recovery` tool answers "which function is
|
|
5207
|
+
* `libquick.so+0xc8a7c`?" by shelling out to radare2: `aflj` for the function
|
|
5208
|
+
* list, `afij` for boundaries, `pdfj` for disassembly, a decompiler plugin for
|
|
5209
|
+
* pseudo-C, then an LLM prompt built from the strings and call sites. Its own
|
|
5210
|
+
* documentation records the shape of the heuristic it is built on — a function
|
|
5211
|
+
* over 100 KB is "unreasonable, skip", and a function that cannot be found
|
|
5212
|
+
* gets a default size of 2000 bytes. Nothing in the tool measures whether the
|
|
5213
|
+
* name it prints is right.
|
|
5214
|
+
*
|
|
5215
|
+
* An ELF already answers the first half exactly. Every `STT_FUNC` symbol
|
|
5216
|
+
* carries an address (`st_value`) and a size (`st_size`), so "which function
|
|
5217
|
+
* contains this offset" is a lookup over sorted symbols — not a disassembly,
|
|
5218
|
+
* not a boundary heuristic, and not a guess when the lookup misses.
|
|
5219
|
+
*
|
|
5220
|
+
* The second half — naming a function whose symbol was stripped — is what the
|
|
5221
|
+
* model is for. What HapRay has no answer for is whether the model is any
|
|
5222
|
+
* good: it never compares a recovered name to a known one. This module adds
|
|
5223
|
+
* that. {@link measureNaming} holds out names the file *does* record, asks the
|
|
5224
|
+
* model to infer them from the same evidence it would have on a stripped file,
|
|
5225
|
+
* and reports the accuracy — so a run says "this model named 12 of 20 held-out
|
|
5226
|
+
* functions correctly" rather than "these are the names".
|
|
5227
|
+
*/
|
|
5228
|
+
|
|
5229
|
+
/** One function body, as the symbols describe it. */
|
|
5230
|
+
interface FunctionRange {
|
|
5231
|
+
readonly name: string;
|
|
5232
|
+
/** Address of the first byte, from `st_value`. */
|
|
5233
|
+
readonly start: number;
|
|
5234
|
+
/** Address one past the last byte (`start + st_size`). */
|
|
5235
|
+
readonly end: number;
|
|
5236
|
+
readonly size: number;
|
|
5237
|
+
readonly bind: ElfSymbol['bind'];
|
|
5238
|
+
}
|
|
5239
|
+
/** A `libfoo.so+0xoffset` reference, split into its two halves. */
|
|
5240
|
+
interface AddressRef {
|
|
5241
|
+
readonly library: string;
|
|
5242
|
+
readonly offset: number;
|
|
5243
|
+
}
|
|
5244
|
+
/** A recovered name, and what it was recovered from. */
|
|
5245
|
+
interface RecoveredSymbol {
|
|
5246
|
+
readonly address: string;
|
|
5247
|
+
readonly offset: number;
|
|
5248
|
+
readonly name: string;
|
|
5249
|
+
readonly start: number;
|
|
5250
|
+
readonly end: number;
|
|
5251
|
+
/**
|
|
5252
|
+
* `recorded` when the ELF's own symbol table named it. There is no
|
|
5253
|
+
* `inferred` yet: inference is the model's job and its result is a
|
|
5254
|
+
* {@link NamingCase}, not a recovered symbol.
|
|
5255
|
+
*/
|
|
5256
|
+
readonly basis: 'recorded';
|
|
5257
|
+
}
|
|
5258
|
+
/** An address this module could not locate, with the reason. */
|
|
5259
|
+
interface UnresolvedAddress {
|
|
5260
|
+
readonly address: string;
|
|
5261
|
+
readonly reason: string;
|
|
5262
|
+
}
|
|
5263
|
+
interface RecoveryResult {
|
|
5264
|
+
readonly recovered: readonly RecoveredSymbol[];
|
|
5265
|
+
readonly unresolved: readonly UnresolvedAddress[];
|
|
5266
|
+
}
|
|
5267
|
+
/**
|
|
5268
|
+
* Split a `libfoo.so+0x1cce24` reference.
|
|
5269
|
+
*
|
|
5270
|
+
* `undefined` for anything else: a resolved symbol is a name, and treating it
|
|
5271
|
+
* as an address would put a name in the library column and invent an offset.
|
|
5272
|
+
*/
|
|
5273
|
+
declare function addressOfOffset(symbol: string): AddressRef | undefined;
|
|
5274
|
+
/**
|
|
5275
|
+
* The function ranges an ELF records, sorted by start address.
|
|
5276
|
+
*
|
|
5277
|
+
* A zero-size symbol is dropped: it marks a boundary (an alias, or a label the
|
|
5278
|
+
* compiler emitted) and has no extent, so treating it as a function would
|
|
5279
|
+
* claim every address after it.
|
|
5280
|
+
*/
|
|
5281
|
+
declare function symbolIndex(elf: ElfFile): FunctionRange[];
|
|
5282
|
+
/**
|
|
5283
|
+
* The function containing `offset`, or `undefined`.
|
|
5284
|
+
*
|
|
5285
|
+
* The size a symbol records is authoritative: a function can be followed by
|
|
5286
|
+
* padding or by another section, and extending it to the next symbol would
|
|
5287
|
+
* claim bytes that are not its body.
|
|
5288
|
+
*/
|
|
5289
|
+
declare function functionAt(index: readonly FunctionRange[], offset: number): FunctionRange | undefined;
|
|
5290
|
+
/**
|
|
5291
|
+
* Name every unresolved address the ELF can locate.
|
|
5292
|
+
*
|
|
5293
|
+
* Addresses are processed in sorted order so the same input in a different
|
|
5294
|
+
* order produces the same document — the determinism rule the rest of this
|
|
5295
|
+
* package follows.
|
|
5296
|
+
*/
|
|
5297
|
+
declare function recoverSymbols(bytes: Uint8Array, unresolved: readonly string[]): RecoveryResult;
|
|
5298
|
+
/** One held-out function, and what the model answered for it. */
|
|
5299
|
+
interface NamingCase {
|
|
5300
|
+
readonly truth: string;
|
|
5301
|
+
readonly answer: string;
|
|
5302
|
+
readonly correct: boolean;
|
|
5303
|
+
readonly start: number;
|
|
5304
|
+
readonly size: number;
|
|
5305
|
+
}
|
|
5306
|
+
interface NamingReport {
|
|
5307
|
+
/** Functions the model was asked to name. */
|
|
5308
|
+
readonly heldOut: number;
|
|
5309
|
+
readonly correct: number;
|
|
5310
|
+
/** `correct / heldOut`, or `undefined` when nothing was held out. */
|
|
5311
|
+
readonly accuracy: number | undefined;
|
|
5312
|
+
readonly cases: readonly NamingCase[];
|
|
5313
|
+
}
|
|
5314
|
+
/** What the model is given about one function it must name. */
|
|
5315
|
+
interface NamingQuestion {
|
|
5316
|
+
/** The name being held out — the model must not see this. */
|
|
5317
|
+
readonly truth: string;
|
|
5318
|
+
readonly start: number;
|
|
5319
|
+
readonly size: number;
|
|
5320
|
+
readonly bind: ElfSymbol['bind'];
|
|
5321
|
+
/**
|
|
5322
|
+
* The function's own bytes, so the model has evidence rather than a prompt
|
|
5323
|
+
* asking it to guess. HapRay gets this from radare2's disassembly; here it
|
|
5324
|
+
* is the `.text` slice the symbol points at.
|
|
5325
|
+
*/
|
|
5326
|
+
readonly body: Uint8Array;
|
|
5327
|
+
/** The instruction classes in the body, which is what a reader sees first. */
|
|
5328
|
+
readonly counts: InstructionCounts;
|
|
5329
|
+
}
|
|
5330
|
+
/** The model, as this module needs it: one function in, one name out. */
|
|
5331
|
+
type NamingAnswer = (question: NamingQuestion) => Promise<string>;
|
|
5332
|
+
/**
|
|
5333
|
+
* Reduce a name to what it means, so formatting does not score as a mistake.
|
|
5334
|
+
*
|
|
5335
|
+
* `sym.parseExpression`, `parseExpression(int)` and `_Z12parseExpressionv`
|
|
5336
|
+
* are the same function. Counting them wrong would measure a model's
|
|
5337
|
+
* punctuation habits rather than its understanding.
|
|
5338
|
+
*/
|
|
5339
|
+
declare function normaliseName(name: string): string;
|
|
5340
|
+
/**
|
|
5341
|
+
* Measure how well a model names functions whose names are known.
|
|
5342
|
+
*
|
|
5343
|
+
* Every nameable function is held out in turn: the model is asked for a name
|
|
5344
|
+
* from the same evidence it would have on a stripped file, and its answer is
|
|
5345
|
+
* compared to the truth. The result is an accuracy over a stated number of
|
|
5346
|
+
* cases — the number HapRay's tool never reports, which is what makes its
|
|
5347
|
+
* output impossible to trust or to compare between models.
|
|
5348
|
+
*
|
|
5349
|
+
* A file with nothing to hold out reports `accuracy: undefined` rather than
|
|
5350
|
+
* zero: 0% over zero cases reads as a broken model when the truth is that
|
|
5351
|
+
* there was nothing to measure.
|
|
5352
|
+
*/
|
|
5353
|
+
declare function measureNaming(bytes: Uint8Array, answer: NamingAnswer): Promise<NamingReport>;
|
|
5354
|
+
|
|
5355
|
+
/**
|
|
5356
|
+
* The HTTP model client for the GUI agent (HapRay parity row 5).
|
|
5357
|
+
*
|
|
5358
|
+
* HapRay's `gui-agent` imports the external `phone_agent` package, whose client
|
|
5359
|
+
* reads `GLM_BASE_URL` / `GLM_API_KEY` / `GLM_MODEL` and posts to an
|
|
5360
|
+
* OpenAI-compatible `/chat/completions` endpoint. This is that protocol,
|
|
5361
|
+
* written here so the package does not depend on `phone_agent`, and with
|
|
5362
|
+
* `fetch` injected so a test never opens a socket and a caller can point it at
|
|
5363
|
+
* any endpoint that speaks the same shape.
|
|
5364
|
+
*
|
|
5365
|
+
* Two things differ from HapRay's client:
|
|
5366
|
+
*
|
|
5367
|
+
* - **An unparseable answer is refused here.** HapRay passes the model's prose
|
|
5368
|
+
* through to the loop, so a formatting mistake surfaces as an agent failure.
|
|
5369
|
+
* Here {@link parseDecision} runs inside the client, so the error names the
|
|
5370
|
+
* answer that caused it.
|
|
5371
|
+
* - **Nothing is defaulted silently.** No base URL is guessed and no key is
|
|
5372
|
+
* invented: a host with no configuration gets a refusal naming the variables
|
|
5373
|
+
* to set, not a request to a host the user never named.
|
|
5374
|
+
*/
|
|
5375
|
+
|
|
5376
|
+
/** The slice of `fetch` this client needs. Injected, never imported. */
|
|
5377
|
+
type AgentFetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
5378
|
+
interface HttpAgentModelOptions {
|
|
5379
|
+
/** The endpoint root, without `/chat/completions`. */
|
|
5380
|
+
readonly baseUrl: string;
|
|
5381
|
+
readonly apiKey: string;
|
|
5382
|
+
readonly model: string;
|
|
5383
|
+
readonly fetch: AgentFetch;
|
|
5384
|
+
/** Request timeout in ms. Defaults to 60 s. */
|
|
5385
|
+
readonly timeoutMs?: number;
|
|
5386
|
+
}
|
|
5387
|
+
interface AgentConfig {
|
|
5388
|
+
readonly baseUrl: string;
|
|
5389
|
+
readonly apiKey: string;
|
|
5390
|
+
readonly model: string;
|
|
5391
|
+
}
|
|
5392
|
+
/**
|
|
5393
|
+
* Read the client configuration from the environment.
|
|
5394
|
+
*
|
|
5395
|
+
* `undefined` when no endpoint is configured: a caller then refuses with a
|
|
5396
|
+
* message naming the variables, which is better than a request to a guessed
|
|
5397
|
+
* host. A base URL without a key is also `undefined` — half a configuration is
|
|
5398
|
+
* a mistake, not a default.
|
|
5399
|
+
*/
|
|
5400
|
+
declare function readAgentConfig(env: Record<string, string | undefined>): AgentConfig | undefined;
|
|
5401
|
+
/**
|
|
5402
|
+
* A model client over an OpenAI-compatible endpoint.
|
|
5403
|
+
*
|
|
5404
|
+
* The options are validated once, at construction, so a misconfiguration fails
|
|
5405
|
+
* before a device is touched rather than on the first decision.
|
|
5406
|
+
*/
|
|
5407
|
+
declare function httpAgentModel(options: HttpAgentModelOptions): AgentModel;
|
|
5408
|
+
|
|
4892
5409
|
/**
|
|
4893
5410
|
* One `native_hook` row with camelCase field names.
|
|
4894
5411
|
*
|
|
@@ -6185,102 +6702,6 @@ declare function isZip(bytes: Uint8Array): boolean;
|
|
|
6185
6702
|
/** Read the central directory and return an archive over `bytes`. */
|
|
6186
6703
|
declare function openZip(bytes: Uint8Array): ZipArchive;
|
|
6187
6704
|
|
|
6188
|
-
/**
|
|
6189
|
-
* A reader for the ELF headers, sections and symbols of an OHOS native binary.
|
|
6190
|
-
*
|
|
6191
|
-
* This exists for HapRay parity row 27. HapRay's `opt-detector` answers "what
|
|
6192
|
-
* optimization level was this built at, and was LTO on?" by feeding raw
|
|
6193
|
-
* `.text` bytes to a ~2 GB LSTM and a 551-feature SVM and printing the guess
|
|
6194
|
-
* as a percentage. An ELF records much of that directly — LTO leaves
|
|
6195
|
-
* `lto_priv.*` symbols and `.gnu.lto_*` sections, `-O0` leaves debug
|
|
6196
|
-
* sections, and the instruction mix is a fact about the bytes — so the
|
|
6197
|
-
* analyzer built on this reader reports what the file says and labels the
|
|
6198
|
-
* parts that are inference.
|
|
6199
|
-
*
|
|
6200
|
-
* What is here is deliberately narrow: the section header table, the two
|
|
6201
|
-
* symbol tables, and a decoder for the AArch64 instruction classes whose
|
|
6202
|
-
* density differs across optimization levels. There is no program-header
|
|
6203
|
-
* walk, no relocation processing, no dynamic-section parsing and no
|
|
6204
|
-
* disassembly — nothing this reader does not have a caller for.
|
|
6205
|
-
*
|
|
6206
|
-
* ## Refusals
|
|
6207
|
-
*
|
|
6208
|
-
* Every read is bounds-checked against the buffer, because a `.so` shipped
|
|
6209
|
-
* inside an app is attacker-controlled input as far as this package is
|
|
6210
|
-
* concerned. A bad magic, a short header, an unsupported class and a section
|
|
6211
|
-
* table pointing past the end are typed refusals naming the field, not bare
|
|
6212
|
-
* `RangeError`s from a `DataView`.
|
|
6213
|
-
*/
|
|
6214
|
-
/** `e_machine` for AArch64, the only machine an OHOS app ships. */
|
|
6215
|
-
declare const EM_AARCH64 = 183;
|
|
6216
|
-
/** One section header, as much of it as a caller here needs. */
|
|
6217
|
-
interface ElfSection {
|
|
6218
|
-
readonly name: string;
|
|
6219
|
-
readonly type: number;
|
|
6220
|
-
readonly flags: number;
|
|
6221
|
-
/** Offset of the payload in the file. */
|
|
6222
|
-
readonly offset: number;
|
|
6223
|
-
/** Declared size. A `NOBITS` section declares one but occupies no bytes. */
|
|
6224
|
-
readonly size: number;
|
|
6225
|
-
/** Entry size for a table section (`sh_entsize`), else 0. */
|
|
6226
|
-
readonly entrySize: number;
|
|
6227
|
-
}
|
|
6228
|
-
/** One symbol, with the binding and type decoded from `st_info`. */
|
|
6229
|
-
interface ElfSymbol {
|
|
6230
|
-
readonly name: string;
|
|
6231
|
-
readonly bind: 'local' | 'global' | 'weak' | 'other';
|
|
6232
|
-
readonly type: 'notype' | 'func' | 'object' | 'section' | 'file' | 'other';
|
|
6233
|
-
readonly size: number;
|
|
6234
|
-
/** Section index the symbol belongs to; 0 for undefined, 0xfff1 for absolute. */
|
|
6235
|
-
readonly sectionIndex: number;
|
|
6236
|
-
}
|
|
6237
|
-
interface ElfFile {
|
|
6238
|
-
readonly bits: 32 | 64;
|
|
6239
|
-
readonly endian: 'little' | 'big';
|
|
6240
|
-
readonly machine: number;
|
|
6241
|
-
/** `e_type`: 1 relocatable, 2 executable, 3 shared object, 4 core. */
|
|
6242
|
-
readonly type: number;
|
|
6243
|
-
readonly sections: readonly ElfSection[];
|
|
6244
|
-
readonly symbols: readonly ElfSymbol[];
|
|
6245
|
-
/** The section with this name, or `undefined`. */
|
|
6246
|
-
readonly section: (name: string) => ElfSection | undefined;
|
|
6247
|
-
/** The payload of a section; empty for `NOBITS` and for a missing section. */
|
|
6248
|
-
readonly bytesOf: (name: string) => Uint8Array;
|
|
6249
|
-
}
|
|
6250
|
-
/**
|
|
6251
|
-
* Read an ELF's headers, sections and symbols.
|
|
6252
|
-
*
|
|
6253
|
-
* Only 64-bit little-endian is decoded. The class and endianness are read
|
|
6254
|
-
* first and refused by name, so a 32-bit or big-endian file gets a message
|
|
6255
|
-
* saying which shape was unsupported rather than a nonsensical section table.
|
|
6256
|
-
*/
|
|
6257
|
-
declare function readElf(bytes: Uint8Array): ElfFile;
|
|
6258
|
-
/** The instruction classes whose density differs across optimization levels. */
|
|
6259
|
-
type InstructionClass = 'ret' | 'blr' | 'br' | 'bl' | 'b' | 'bcond' | 'cbz' | 'tbz' | 'adrp' | 'adr' | 'ldr' | 'str' | 'add' | 'vector' | 'other';
|
|
6260
|
-
/** Per-class instruction counts over a `.text` payload. */
|
|
6261
|
-
type InstructionCounts = Record<InstructionClass, number> & {
|
|
6262
|
-
total: number;
|
|
6263
|
-
};
|
|
6264
|
-
/**
|
|
6265
|
-
* Classify one AArch64 instruction word.
|
|
6266
|
-
*
|
|
6267
|
-
* The masks are the ARM ARM's fixed-field encodings for the classes whose
|
|
6268
|
-
* frequency a compiler changes: `ret`/`blr`/`br` (branch-register), `bl`/`b`
|
|
6269
|
-
* (immediate branch), `b.cond`, `cbz`/`cbnz`, `tbz`/`tbnz`, `adrp`/`adr`, and
|
|
6270
|
-
* the SIMD group. `other` covers everything else, which is most arithmetic.
|
|
6271
|
-
*
|
|
6272
|
-
* The order matters: `br`/`blr`/`ret` share a mask and are separated by their
|
|
6273
|
-
* `opc` field, and `b`/`bl` share a mask separated by bit 31.
|
|
6274
|
-
*/
|
|
6275
|
-
declare function classifyInstruction(word: number): InstructionClass;
|
|
6276
|
-
/**
|
|
6277
|
-
* Count instruction classes over a payload.
|
|
6278
|
-
*
|
|
6279
|
-
* A trailing partial word is not an instruction and is not counted; a section
|
|
6280
|
-
* whose size is not a multiple of four is legal padding.
|
|
6281
|
-
*/
|
|
6282
|
-
declare function countInstructions(payload: Uint8Array): InstructionCounts;
|
|
6283
|
-
|
|
6284
6705
|
/**
|
|
6285
6706
|
* Optimization-level and LTO detection for an OHOS native binary (HapRay
|
|
6286
6707
|
* parity row 27).
|
|
@@ -6655,4 +7076,4 @@ interface FlamegraphPageInput {
|
|
|
6655
7076
|
*/
|
|
6656
7077
|
declare function renderFlamegraphHtml(input: FlamegraphPageInput): string;
|
|
6657
7078
|
|
|
6658
|
-
export { ANIMATION_BANDS, type ActionContext, type ActionDevice, type ActionOutcome, type ActiveAlloc, type AnalyzeContext, type AnalyzeResult, type Analyzer, type AnalyzerRun, type AnalyzerSection, type AnimationAnalysis, type AnimationLabel, type AnimationSeverity, type AppIdentity, BUNDLE_RENDERED_FILES, type BaselineComparison, type BelowThresholdPattern, type BinaryFacts, type BinaryInput, type BinaryReport, type BinderAnalysis, BinderAnalyzer, type BinderEndpoint, type BinderEvent, type BinderInterfaceStat, type BinderProcessStat, BinderQuery, type BinderThreadStat, type BinderTransaction, type BundleRerenderInput, CATEGORY_EXTENSIONS, CATEGORY_MAX_BYTES, COLLECTOR_NAMES, type CallchainSample, type CallstackEvent, type CallstackEventWithArgs, CallstackQuery, type CapabilityId, type CapabilityInputs, CapabilityMatrix, type CapabilityState, type CaseLoad, type CategoryTotal, type CollectOptions, type CollectSession, type Collector, type CollectorName, type CompiledRule, type ComponentReuse, ComponentReuseAnalyzer, type ConnectOptions, type ContentPattern, CoverageAnalyzer, type CoverageCounts, type CoverageFile, type CoverageRatio, type CoverageReport, type CreateEmulatorRequest, DEFAULT_HILOG_RULES, DEFAULT_QUERY_LIMIT, DEVICE_PERF_PATH, DEVICE_SCREENSHOT_PATH, DEVICE_UI_PATH, type DeltaStatus, type DepGraph, type DepGraphEdge, type DepGraphFile, Device, type DeviceDeps, type DeviceIdentity, DeviceNotFoundError, type DiscoveredCase, type DrillDownHandle, type DuplicateGroup, EM_AARCH64, EXCLUDE_PATTERNS, type ElfFile, type ElfSection, type ElfSymbol, EmptyFrameAnalyzer, type EmptyFrameFilter, type EmulatorBackend, EmulatorClient, type EmulatorClientOptions, EmulatorCommandError, type EmulatorImage, EmulatorImageMissingError, type EmulatorInstance, EmulatorLifecycle, type EmulatorLifecycleOptions, EmulatorNotFoundError, type EmulatorStartResult, type EmulatorStopResult, type Env, type Evidence, type EvidenceKind, type ExpectPresent, type ExpectationOutcome, type ExplorationAction, type ExplorationClock, type ExplorationDevice, type ExplorationDeviceOptions, type ExplorationHost, type ExplorationOptions, type ExplorationOutcome, type ExplorationResult, type ExplorationState, type ExplorationStep, type ExplorationStrategy, type ExplorationTargetDevice, FLAMEGRAPH_FILES, FPS_COMMAND, FTRACE_CATEGORIES, FaultTreeAnalyzer, type FaultTreeSignals, type Fidelity, type FileCategory, type FileRule, FlamegraphAnalyzer, type FlamegraphPageInput, type FoldedStack, type FpsBucket, type FpsWindow, type Frame, FrameAnalyzer, type FrameFlag, FrameLoadAnalyzer, FrameLoadIndex, type FrameLoadIndexInput, type FrameLoadThread, FrameQuery, type FrameStats, type FrameType, type FtraceOptions, GEOMETRY_TOLERANCE_PX, GcAnalyzer, type GcSignals, type Gesture, GestureDriver, type GestureResult, HILOG_COMMAND, HIPROFILER_PLUGIN_NAMES, HITCH_COMMAND, HITRACE_DEFAULT_CATEGORIES, type HapAnalysis, type HapPackage, type HarEdge, Hdc, HdcNotFoundError, type HdcOptions, type HdcResult, type HdcSlice, type HdcTarget, type HidumperCapture, HidumperCollector, type HidumperSnapshot, HilogAnalyzer, HilogCollector, type HilogLevel, type HilogLine, type HilogMatch, type HilogParseOptions, type HilogRule, type HiperfCapture, type HiperfCollectOptions, HiperfCollector, type HiprofilerCollectOptions, type HiprofilerCollectRequest, HiprofilerCollector, type HiprofilerConfigOptions, type HiprofilerPlugin, type HiprofilerPluginName, HitraceCollector, IGNORED_ATTRIBUTES, type ImageComparison, IngestError, InstantQuery, type InstructionClass, type InstructionCounts, type InventoryFile, type JsheapCapture, JsheapCollector, MAX_QUERY_LIMIT, METRIC_DIRECTIONS, MIN_BUFFER_PAGES, MIN_HASH_PIXELS, MemMeasureQuery, MemoryAnalyzer, MemoryMeasureAnalyzer, type MemoryPluginOptions, type MetadataPattern, type Metric, type MetricDelta, type MetricDirection, type MetricUnit, type ModuleDecl, type NamedQueryDefinition, type NamedQueryInfo, type NamedQueryResult, type NativeCategory, type NativeEventKind, type NativeHookEvent, type NativeHookFrame, NativeHookQuery, type NativeHookStatistic, NativeMemoryAnalyzer, type NativeMemoryResult, type NativeNames, type NativeTimelineBucket, type NativehookOptions, OhosPerfError, type OptimizationAnalysis, type OptimizationBasis, type OptimizationLevel, type OptimizationPotential, type OptimizationVerdict, type OversizedFile, PARITY_ROWS, PLANE_A_PLUGINS, type ParityRow, type ParityStatus, type PerfCallchain, type PerfFileAttribution, type PerfFunction, type PerfLeafAttribution, PerfQuery, type PerfSampleRow, type PerfThread, type PixelOnlyChange, type ProbeResult, type ProbeRunner, type ProbeSnapshot, type ProcessInfo, type ProcessMeasure, type ProcessMeasureFilter, ProcessQuery, ProcfsCollector, type ProcfsSample, type ProcfsStatus, type Provenance, type QueryArgument, type QueryContext, type QueryHandle, REPORT_SCHEMA_VERSION, type Rect, type RedundancyLevel, type RedundancyType, RedundantFileAnalyzer, type RedundantFileEntry, type RedundantFileReport, type RedundantThreadPattern, type RedundantThreadsSummary, type RegionPixelChange, RenderAnalyzer, type ReportGenerator, type ReportInput, type ReportModel, type ReportScenario, type ReportSection, type ReportSummary, type ReportTotals, type RgbaImage, RsSkipAnalyzer, type RsSkipFrame, type RsSkipResult, type RsSkipTraceMethod, type RuleMatch, type RuleMatchKind, type RunOptions, type RunResult, type RunStepResult, type RunnerCollectOptions, type RunnerDevice, SECTION_TITLES, type Scenario, type ScenarioAction, ScenarioRunner, type ScenarioStep, Scene, type SceneLayout, type SceneMetadata, type SceneStep, type SceneStepRef, type ScenesComparison, SchedQuery, type SchedSlice, type ScreenshotCapture, ScreenshotCollector, type Selector, type SelectorRect, type SmapsRollup, StartupAnalyzer, StartupQuery, type StartupRecord, type StepCapture, type StepComparison, type StepExpectation, type StepStatus, Streamer, StreamerNotFoundError, type StreamerOptions, type SymbolStat, SymbolsAnalyzer, TECH_RULES, type TechRule, type ThreadAnalysis, type ThreadAnalysisSummary, ThreadAnalyzer, type ThreadInfo, ThreadQuery, type ThreadState, ThreadStateQuery, type ThreadWakeupResult, type ThreadWakeupThread, type TimeRange, type TimingCycle, type TraceCollectOptions, type Trend, type TrendOrder, type TrendPoint, type TrendRun, type TrendSeries, UI_DIFF_FILES, UiAnalyzer, type UiCompareOptions, type UiDiff, type UiDiffSide, type UiNode, type UiTreeDiff, type UiTreeDifference, UitestCollector, type UnmeasuredRegion, type UnreleasedRow, type VsyncAnalysis, VsyncAnalyzer, type VsyncPeriod, type VsyncPeriodKind, type VsyncSeverity, type WakeupEvent, type WindowHitches, type ZipArchive, type ZipEntry, aggregateUnreleased, analyseAnimations, analyzeBinaries, analyzeHap, analyzeThreadWakeup, animationSeverity, buildDepGraph, buildHiprofilerConfig, buildInventory, buildMatrix, buildNativeTimeline, buildReport, buildTrend, categorize, classifyInstruction, classifyNativePath, classifyOptimization, compareImages, compareRegion, compareResults, compareSceneDirs, compareScenes, compileRules, computeBinderAnalysis, computeComponentReuse, computeFaultTree, computeFpsWindows, computeGc, computeRsSkip, computeThreadAnalysis, computeVsyncAnomalies, connect, countInstructions, createSceneLayout, cropRegion, decodePng, defaultAnalyzers, deviceExplorationHost, dhash, diffTrees, discoverCases, encodePng, escapeHtml, evidence, executeAction, explorationDevice, explore, extractBinaries, filterEmptyFrames, flattenUiTree, ftracePlugin, gpuPlugin, hapSection, hashTree, hiperfRecordCommand, ingestScene, inspectBinary, isUnresolvedSymbol, isZip, loadCases, lookupQuery, markRegions, matchHapRules, matchRules, matchSelector, memoryPlugin, metric, nativeEventKind, nativehookPlugin, nodeIdentity, openDb, openZip, optimizationSection, pairNativeMemory, paritySummary, parseBounds, parseCoverageReport, parseFpsCounts, parseHilogLine, parseHilogText, parseHiperfSummary, parseHitches, parseProcfsStatus, parseRedundantFile, parseScenario, parseSelector, parseSmapsRollup, planNextAction, queryDefinitions, readElf, readHidumperCapture, readHilogText, readJsheapSnapshot, readProcfsSamples, readSceneMetadata, readUiTree, renderBundle, renderEvidenceCsv, renderFlamegraphHtml, renderFlamegraphSvg, renderMetricsCsv, renderReportHtml, renderReportJson, renderReportXlsx, renderScenesComparison, renderSummaryJson, renderTrendHtml, renderTrendJson, renderUiDiffHtml, resolveAppIdentity, resolveAppIpids, resolveQueryLimit, resolveSelector, round2HalfEven, runAnalyzerSections, runAnalyzers, runDrillDown, runNamedQuery, runProbe, sortSteps, summarizeReport, tableRowCounts, trendRunFromReport, unknownQueryError, validateRules, writeProcfsSamples, writeRunFiles, writeSceneMetadata, xpowerPlugin };
|
|
7079
|
+
export { ANIMATION_BANDS, type ActionContext, type ActionDevice, type ActionOutcome, type ActiveAlloc, type AddressRef, type AgentConfig, type AgentDecision, type AgentDevice, type AgentFetch, type AgentHistoryEntry, type AgentModel, type AgentOptions, type AgentResult, type AgentStatus, type AgentStep, type AgentStepStatus, type AgentTranscript, type AgentTurn, type AnalyzeContext, type AnalyzeResult, type Analyzer, type AnalyzerRun, type AnalyzerSection, type AnimationAnalysis, type AnimationLabel, type AnimationSeverity, type AppIdentity, BUNDLE_RENDERED_FILES, type BaselineComparison, type BelowThresholdPattern, type BinaryFacts, type BinaryInput, type BinaryReport, type BinderAnalysis, BinderAnalyzer, type BinderEndpoint, type BinderEvent, type BinderInterfaceStat, type BinderProcessStat, BinderQuery, type BinderThreadStat, type BinderTransaction, type BundleRerenderInput, CATEGORY_EXTENSIONS, CATEGORY_MAX_BYTES, COLLECTOR_NAMES, type CallchainSample, type CallstackEvent, type CallstackEventWithArgs, CallstackQuery, type CapabilityId, type CapabilityInputs, CapabilityMatrix, type CapabilityState, type CaseLoad, type CategoryTotal, type CollectOptions, type CollectSession, type Collector, type CollectorName, type CompiledRule, type ComponentReuse, ComponentReuseAnalyzer, type ConnectOptions, type ContentPattern, CoverageAnalyzer, type CoverageCounts, type CoverageFile, type CoverageRatio, type CoverageReport, type CreateEmulatorRequest, DEFAULT_HILOG_RULES, DEFAULT_QUERY_LIMIT, DEVICE_PERF_PATH, DEVICE_SCREENSHOT_PATH, DEVICE_UI_PATH, type DeltaStatus, type DepGraph, type DepGraphEdge, type DepGraphFile, Device, type DeviceDeps, type DeviceIdentity, DeviceNotFoundError, type DiscoveredCase, type DrillDownHandle, type DuplicateGroup, EM_AARCH64, EXCLUDE_PATTERNS, type ElfFile, type ElfSection, type ElfSymbol, EmptyFrameAnalyzer, type EmptyFrameFilter, type EmulatorBackend, EmulatorClient, type EmulatorClientOptions, EmulatorCommandError, type EmulatorImage, EmulatorImageMissingError, type EmulatorInstance, EmulatorLifecycle, type EmulatorLifecycleOptions, EmulatorNotFoundError, type EmulatorStartResult, type EmulatorStopResult, type Env, type Evidence, type EvidenceKind, type ExpectPresent, type ExpectationOutcome, type ExplorationAction, type ExplorationClock, type ExplorationDevice, type ExplorationDeviceOptions, type ExplorationHost, type ExplorationOptions, type ExplorationOutcome, type ExplorationResult, type ExplorationState, type ExplorationStep, type ExplorationStrategy, type ExplorationTargetDevice, FLAMEGRAPH_FILES, FPS_COMMAND, FTRACE_CATEGORIES, FaultTreeAnalyzer, type FaultTreeSignals, type Fidelity, type FileCategory, type FileRule, FlamegraphAnalyzer, type FlamegraphPageInput, type FoldedStack, type FpsBucket, type FpsWindow, type Frame, FrameAnalyzer, type FrameFlag, FrameLoadAnalyzer, FrameLoadIndex, type FrameLoadIndexInput, type FrameLoadThread, FrameQuery, type FrameStats, type FrameType, type FtraceOptions, type FunctionRange, GEOMETRY_TOLERANCE_PX, GcAnalyzer, type GcSignals, type Gesture, GestureDriver, type GestureResult, HILOG_COMMAND, HIPROFILER_PLUGIN_NAMES, HITCH_COMMAND, HITRACE_DEFAULT_CATEGORIES, type HapAnalysis, type HapPackage, type HarEdge, Hdc, HdcNotFoundError, type HdcOptions, type HdcResult, type HdcSlice, type HdcTarget, type HidumperCapture, HidumperCollector, type HidumperSnapshot, HilogAnalyzer, HilogCollector, type HilogLevel, type HilogLine, type HilogMatch, type HilogParseOptions, type HilogRule, type HiperfCapture, type HiperfCollectOptions, HiperfCollector, type HiprofilerCollectOptions, type HiprofilerCollectRequest, HiprofilerCollector, type HiprofilerConfigOptions, type HiprofilerPlugin, type HiprofilerPluginName, HitraceCollector, type HttpAgentModelOptions, IGNORED_ATTRIBUTES, IRREVERSIBLE_PATTERNS, type ImageComparison, IngestError, InstantQuery, type InstructionClass, type InstructionCounts, type InventoryFile, type IrreversiblePattern, type JsheapCapture, JsheapCollector, MAX_QUERY_LIMIT, METRIC_DIRECTIONS, MIN_BUFFER_PAGES, MIN_HASH_PIXELS, MemMeasureQuery, MemoryAnalyzer, MemoryMeasureAnalyzer, type MemoryPluginOptions, type MetadataPattern, type Metric, type MetricDelta, type MetricDirection, type MetricUnit, type ModuleDecl, type NamedQueryDefinition, type NamedQueryInfo, type NamedQueryResult, type NamingAnswer, type NamingCase, type NamingQuestion, type NamingReport, type NativeCategory, type NativeEventKind, type NativeHookEvent, type NativeHookFrame, NativeHookQuery, type NativeHookStatistic, NativeMemoryAnalyzer, type NativeMemoryResult, type NativeNames, type NativeTimelineBucket, type NativehookOptions, OhosPerfError, type OptimizationAnalysis, type OptimizationBasis, type OptimizationLevel, type OptimizationPotential, type OptimizationVerdict, type OversizedFile, PARITY_ROWS, PLANE_A_PLUGINS, type ParityRow, type ParityStatus, type PerfCallchain, type PerfFileAttribution, type PerfFunction, type PerfLeafAttribution, PerfQuery, type PerfSampleRow, type PerfThread, type PixelOnlyChange, type ProbeResult, type ProbeRunner, type ProbeSnapshot, type ProcessInfo, type ProcessMeasure, type ProcessMeasureFilter, ProcessQuery, ProcfsCollector, type ProcfsSample, type ProcfsStatus, type Provenance, type QueryArgument, type QueryContext, type QueryHandle, REPORT_SCHEMA_VERSION, type RecoveredSymbol, type RecoveryResult, type Rect, type RedundancyLevel, type RedundancyType, RedundantFileAnalyzer, type RedundantFileEntry, type RedundantFileReport, type RedundantThreadPattern, type RedundantThreadsSummary, type RegionPixelChange, RenderAnalyzer, type ReplayResult, type ReportGenerator, type ReportInput, type ReportModel, type ReportScenario, type ReportSection, type ReportSummary, type ReportTotals, type RgbaImage, RsSkipAnalyzer, type RsSkipFrame, type RsSkipResult, type RsSkipTraceMethod, type RuleMatch, type RuleMatchKind, type RunOptions, type RunResult, type RunStepResult, type RunnerCollectOptions, type RunnerDevice, SECTION_TITLES, type Scenario, type ScenarioAction, ScenarioRunner, type ScenarioStep, Scene, type SceneLayout, type SceneMetadata, type SceneStep, type SceneStepRef, type ScenesComparison, SchedQuery, type SchedSlice, type ScreenshotCapture, ScreenshotCollector, type Selector, type SelectorRect, type SmapsRollup, StartupAnalyzer, StartupQuery, type StartupRecord, type StepCapture, type StepComparison, type StepExpectation, type StepStatus, Streamer, StreamerNotFoundError, type StreamerOptions, type SymbolStat, SymbolsAnalyzer, TECH_RULES, type TechRule, type ThreadAnalysis, type ThreadAnalysisSummary, ThreadAnalyzer, type ThreadInfo, ThreadQuery, type ThreadState, ThreadStateQuery, type ThreadWakeupResult, type ThreadWakeupThread, type TimeRange, type TimingCycle, type TraceCollectOptions, type Trend, type TrendOrder, type TrendPoint, type TrendRun, type TrendSeries, UI_DIFF_FILES, UiAnalyzer, type UiCompareOptions, type UiDiff, type UiDiffSide, type UiNode, type UiTreeDiff, type UiTreeDifference, UitestCollector, type UnmeasuredRegion, type UnreleasedRow, type UnresolvedAddress, type VsyncAnalysis, VsyncAnalyzer, type VsyncPeriod, type VsyncPeriodKind, type VsyncSeverity, type WakeupEvent, type WindowHitches, type ZipArchive, type ZipEntry, addressOfOffset, agentPrompt, aggregateUnreleased, analyseAnimations, analyzeBinaries, analyzeHap, analyzeThreadWakeup, animationSeverity, buildDepGraph, buildHiprofilerConfig, buildInventory, buildMatrix, buildNativeTimeline, buildReport, buildTrend, categorize, classifyInstruction, classifyNativePath, classifyOptimization, compareImages, compareRegion, compareResults, compareSceneDirs, compareScenes, compileRules, computeBinderAnalysis, computeComponentReuse, computeFaultTree, computeFpsWindows, computeGc, computeRsSkip, computeThreadAnalysis, computeVsyncAnomalies, connect, countInstructions, createSceneLayout, cropRegion, decodePng, defaultAnalyzers, describeDecision, deviceExplorationHost, dhash, diffTrees, discoverCases, encodePng, escapeHtml, evaluateExpectation, evidence, executeAction, explorationDevice, explore, extractBinaries, filterEmptyFrames, flattenUiTree, ftracePlugin, functionAt, gpuPlugin, hapSection, hashTree, hiperfRecordCommand, httpAgentModel, ingestScene, inspectBinary, irreversibleReason, isUnresolvedSymbol, isZip, loadCases, lookupQuery, markRegions, matchHapRules, matchRules, matchSelector, measureNaming, memoryPlugin, metric, nativeEventKind, nativehookPlugin, nodeIdentity, normaliseName, openDb, openZip, optimizationSection, pairNativeMemory, paritySummary, parseBounds, parseCoverageReport, parseDecision, parseFpsCounts, parseHilogLine, parseHilogText, parseHiperfSummary, parseHitches, parseProcfsStatus, parseRedundantFile, parseScenario, parseSelector, parseSmapsRollup, planNextAction, queryDefinitions, readAgentConfig, readElf, readHidumperCapture, readHilogText, readJsheapSnapshot, readProcfsSamples, readSceneMetadata, readUiTree, recoverSymbols, renderBundle, renderEvidenceCsv, renderFlamegraphHtml, renderFlamegraphSvg, renderMetricsCsv, renderReportHtml, renderReportJson, renderReportXlsx, renderScenesComparison, renderSummaryJson, renderTree, renderTrendHtml, renderTrendJson, renderUiDiffHtml, replayAgent, resolveAppIdentity, resolveAppIpids, resolveQueryLimit, resolveSelector, round2HalfEven, runAgent, runAnalyzerSections, runAnalyzers, runDrillDown, runNamedQuery, runProbe, sortSteps, summarizeReport, symbolIndex, tableRowCounts, trendRunFromReport, unknownQueryError, validateRules, writeProcfsSamples, writeRunFiles, writeSceneMetadata, xpowerPlugin };
|