feat(native): add inspection primitives, dispatch traces and approved UI observation (#500)
* fix(hopper): normalize string-backed addresses and update verification * feat(native): add inspection primitives, dispatch traces and approved UI observation * test: prioritize real artifact E2E and captured golden regressions * fix(process): queue observed output before reactive rendering actions * test: prune redundant cases and strengthen boundary assertions * fix(cli): route native value tracing through shared workflows * test: replace synthetic success with real workflows and captured data * fix(catalog): separate portable metadata from native host availability
This commit is contained in:
@@ -5,6 +5,8 @@ import { artifactOutputSchemas } from "./toolOutputSchemas.js";
|
||||
import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
import { toolContractMetadata } from "./toolEffects.js";
|
||||
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
||||
import { appleAssetCatalogInputSchema } from "../domain/appleAssetCatalog.js";
|
||||
import { keyedArchiveInputSchema } from "../domain/keyedArchive.js";
|
||||
const integrityInput = {
|
||||
fail: {
|
||||
integrity_policy: z.literal("fail").default("fail"),
|
||||
@@ -39,6 +41,8 @@ const examples: Readonly<Record<string, Readonly<Record<string, unknown>>>> = {
|
||||
inspect_artifact: {},
|
||||
extract_artifact: {},
|
||||
decode_interface_builder: {},
|
||||
inspect_asset_catalog: { offset: 0, limit: 1000 },
|
||||
inspect_keyed_archive: { path: "Contents/Resources/Model.plist" },
|
||||
};
|
||||
|
||||
const artifact = <
|
||||
@@ -87,6 +91,16 @@ export const ARTIFACT_TOOL_CONTRACTS = [
|
||||
max_connections: z.number().int().min(1).max(40_000).default(40_000),
|
||||
}),
|
||||
),
|
||||
artifact(
|
||||
"inspect_keyed_archive",
|
||||
"Inspect one Foundation NSKeyedArchiver plist in the active app bundle as original object-table nodes, class descriptors, named roots, and UID edges. Preserves shared and cyclic references without instantiating classes. The path is relative to the bundle; root selection and object pagination preserve original identities.",
|
||||
keyedArchiveInputSchema,
|
||||
),
|
||||
artifact(
|
||||
"inspect_asset_catalog",
|
||||
"Inspect compiled Assets.car metadata in an active Apple app bundle. Returns stable paginated catalog and rendition records with raw assetutil metadata and catalog digests; rendition bytes are not extracted.",
|
||||
appleAssetCatalogInputSchema,
|
||||
),
|
||||
] as const satisfies readonly ToolContract[];
|
||||
|
||||
/** Provider operations; inventory remains an internal primitive of inspection. */
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
ENHANCED_TOOL_CONTRACTS,
|
||||
OFFICIAL_TOOL_CONTRACTS,
|
||||
SESSION_TOOL_CONTRACTS,
|
||||
TOOL_CONTRACTS,
|
||||
} from "./toolContracts.js";
|
||||
import { NATIVE_TOOL_CONTRACTS } from "./nativeToolContracts.js";
|
||||
import { ARTIFACT_TOOL_CONTRACTS } from "./artifactToolContracts.js";
|
||||
@@ -16,47 +15,10 @@ import { BROWSER_SCENARIO_TOOL_CONTRACTS } from "./browserScenarioToolContracts.
|
||||
import { ELECTRON_TOOL_CONTRACTS } from "./electronToolContracts.js";
|
||||
import { JAVASCRIPT_RUNTIME_OBSERVATION_TOOL_CONTRACTS } from "./javascriptRuntimeObservationToolContracts.js";
|
||||
import { APPLICATION_TOOL_CONTRACTS } from "./applicationToolContracts.js";
|
||||
import {
|
||||
enhancedOutputSchemas,
|
||||
managedOutputSchemas,
|
||||
managedWorkflowOutputSchemas,
|
||||
officialOutputSchemas,
|
||||
sessionOutputSchemas,
|
||||
} from "./toolOutputSchemas.js";
|
||||
import { annotationsFromEffects, TOOL_EFFECTS } from "./toolEffects.js";
|
||||
import { TOOL_EFFECTS } from "./toolEffects.js";
|
||||
|
||||
const convertContractJsonSchema = (schema: z.ZodType) =>
|
||||
z.toJSONSchema(schema, {
|
||||
target: "draft-07",
|
||||
unrepresentable: "any",
|
||||
});
|
||||
|
||||
const jsonSchemaCache = new WeakMap<
|
||||
z.ZodType,
|
||||
ReturnType<typeof convertContractJsonSchema>
|
||||
>();
|
||||
|
||||
const contractJsonSchema = (schema: z.ZodType) => {
|
||||
const cached = jsonSchemaCache.get(schema);
|
||||
if (cached !== undefined) return cached;
|
||||
const converted = convertContractJsonSchema(schema);
|
||||
jsonSchemaCache.set(schema, converted);
|
||||
return converted;
|
||||
};
|
||||
|
||||
const describesObject = (schema: ReturnType<typeof contractJsonSchema>) =>
|
||||
schema.type === "object" ||
|
||||
[schema.oneOf, schema.anyOf].some(
|
||||
(variants) =>
|
||||
Array.isArray(variants) &&
|
||||
variants.every(
|
||||
(variant) =>
|
||||
typeof variant === "object" &&
|
||||
variant !== null &&
|
||||
"type" in variant &&
|
||||
variant.type === "object",
|
||||
),
|
||||
);
|
||||
const contractJsonSchema = (schema: z.ZodType) =>
|
||||
z.toJSONSchema(schema, { target: "draft-07", unrepresentable: "any" });
|
||||
|
||||
describe("tool contract surface", () => {
|
||||
it("advertises capture comparison alternatives on an object root", () => {
|
||||
@@ -98,32 +60,6 @@ describe("tool contract surface", () => {
|
||||
expect(contract.inputSchema.safeParse(incomplete).success).toBe(false);
|
||||
});
|
||||
|
||||
it("advertises complete typed schemas and annotations for every public tool", () => {
|
||||
const contracts = TOOL_CONTRACTS;
|
||||
for (const contract of contracts) {
|
||||
const inputSchema = contractJsonSchema(contract.inputSchema);
|
||||
const outputSchema = contractJsonSchema(contract.outputSchema);
|
||||
expect(describesObject(inputSchema), contract.name).toBe(true);
|
||||
expect(describesObject(outputSchema)).toBe(true);
|
||||
expect(contract.title.length).toBeGreaterThan(2);
|
||||
expect(contract.annotations).toEqual(
|
||||
annotationsFromEffects(contract.effects),
|
||||
);
|
||||
expect(typeof contract.annotations.idempotentHint).toBe("boolean");
|
||||
expect(typeof contract.annotations.openWorldHint).toBe("boolean");
|
||||
expect(typeof contract.annotations.readOnlyHint).toBe("boolean");
|
||||
expect(typeof contract.annotations.destructiveHint).toBe("boolean");
|
||||
expect(contract.examples.length).toBeGreaterThan(0);
|
||||
for (const example of contract.examples) {
|
||||
expect(example.title.trim().length).toBeGreaterThan(0);
|
||||
expect(
|
||||
contract.inputSchema.safeParse(example.input).success,
|
||||
`${contract.name}: ${example.title}`,
|
||||
).toBe(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("audits every tool effect explicitly with no heuristic fallback", () => {
|
||||
const names = [
|
||||
...OFFICIAL_TOOL_CONTRACTS,
|
||||
@@ -166,34 +102,4 @@ describe("tool contract surface", () => {
|
||||
destructiveHint: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("publishes a dedicated output schema and agent guidance for every tool", () => {
|
||||
expect(Object.keys(officialOutputSchemas).sort()).toEqual(
|
||||
OFFICIAL_TOOL_CONTRACTS.map(({ name }) => name).sort(),
|
||||
);
|
||||
expect(Object.keys(enhancedOutputSchemas).sort()).toEqual(
|
||||
ENHANCED_TOOL_CONTRACTS.map(({ name }) => name).sort(),
|
||||
);
|
||||
expect(Object.keys(sessionOutputSchemas).sort()).toEqual(
|
||||
SESSION_TOOL_CONTRACTS.map(({ name }) => name).sort(),
|
||||
);
|
||||
expect(Object.keys(managedOutputSchemas).sort()).toEqual(
|
||||
MANAGED_TOOL_CONTRACTS.map(({ name }) => name).sort(),
|
||||
);
|
||||
expect(Object.keys(managedWorkflowOutputSchemas).sort()).toEqual(
|
||||
MANAGED_WORKFLOW_TOOL_CONTRACTS.map(({ name }) => name).sort(),
|
||||
);
|
||||
|
||||
for (const contract of [
|
||||
...OFFICIAL_TOOL_CONTRACTS,
|
||||
...ENHANCED_TOOL_CONTRACTS,
|
||||
...MANAGED_TOOL_CONTRACTS,
|
||||
...MANAGED_WORKFLOW_TOOL_CONTRACTS,
|
||||
...SESSION_TOOL_CONTRACTS,
|
||||
]) {
|
||||
const schema = contractJsonSchema(contract.outputSchema);
|
||||
expect(JSON.stringify(schema)).not.toContain('"result":{}');
|
||||
expect(contract.description.trim().length).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { nativeValueTraceInputSchema } from "../domain/nativeValueTrace.js";
|
||||
const traceLiteralInputSchema = z.strictObject({
|
||||
query: z.string().min(1),
|
||||
case_sensitive: z.boolean().default(false),
|
||||
@@ -6,6 +7,7 @@ const traceLiteralInputSchema = z.strictObject({
|
||||
|
||||
/** Input schemas shared by MCP registration and enhanced application dispatch. */
|
||||
export const enhancedInputSchemas = {
|
||||
trace_native_values: nativeValueTraceInputSchema,
|
||||
inspect_native_dispatch_metadata: z.strictObject({
|
||||
max_records: z.number().int().min(1).max(20_000).default(5_000),
|
||||
}),
|
||||
@@ -54,7 +56,9 @@ export const enhancedInputSchemas = {
|
||||
action: z
|
||||
.string()
|
||||
.min(1)
|
||||
.describe("A unique compiled UI action selector or interface object ID"),
|
||||
.describe(
|
||||
"A unique compiled UI action selector, interface object ID, native symbol or exact function address",
|
||||
),
|
||||
max_depth: z.number().int().min(0).max(32).default(8),
|
||||
max_nodes: z.number().int().min(1).max(2_000).default(250),
|
||||
max_edges: z.number().int().min(1).max(5_000).default(500),
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { z } from "zod";
|
||||
import {
|
||||
nativeUiObservationInputSchema,
|
||||
nativeUiScenarioInputSchema,
|
||||
} from "../domain/nativeUiObservation.js";
|
||||
|
||||
import type { ToolContract } from "./toolContracts.js";
|
||||
import { nativeOutputSchemas } from "./toolOutputSchemas.js";
|
||||
@@ -11,6 +15,15 @@ const examples: Readonly<Record<string, Readonly<Record<string, unknown>>>> = {
|
||||
inspect_signature: {},
|
||||
inspect_plist: { path: "/Applications/Example.app/Contents/Info.plist" },
|
||||
list_architectures: {},
|
||||
observe_native_ui: { pid: 123, window_id: 456, observation_approved: true },
|
||||
capture_native_ui_scenario: {
|
||||
pid: 123,
|
||||
window_id: 456,
|
||||
observation_approved: true,
|
||||
actions_approved: true,
|
||||
restore: "leave-as-is",
|
||||
steps: [{ kind: "wait", milliseconds: 100 }],
|
||||
},
|
||||
demangle_swift: { symbols: ["$s4Test3fooyyF"] },
|
||||
};
|
||||
|
||||
@@ -40,6 +53,16 @@ const native = <Name extends string, Schema extends z.ZodObject>(
|
||||
|
||||
/** Provider-neutral semantic operations backed initially by macOS utilities. */
|
||||
export const NATIVE_TOOL_CONTRACTS = [
|
||||
native(
|
||||
"observe_native_ui",
|
||||
"Passively observe one explicitly approved already-running native app PID and window ID bound to the active Mach-O target. Captures a bounded accessibility tree and selected-window screenshot; OS permission denial fails without broad capture or target launch.",
|
||||
nativeUiObservationInputSchema,
|
||||
),
|
||||
native(
|
||||
"capture_native_ui_scenario",
|
||||
"Run separately approved selected-element press, increment/decrement scroll, AXValue text entry and bounded wait steps in one exact native app window. Returns ordered before/after captures and action/capture failures. Actions can change app data, network activity and persistent state. The caller must choose leave-as-is; automatic restoration is unsupported.",
|
||||
nativeUiScenarioInputSchema,
|
||||
),
|
||||
native(
|
||||
"inspect_macho",
|
||||
"Inspect Mach-O slices, load commands, imports, exports, dependencies, build metadata, segments, sections, permissions, and exact command provenance without launching Hopper.",
|
||||
|
||||
@@ -53,7 +53,7 @@ describe("guided prompt contracts", () => {
|
||||
});
|
||||
// Assert the properties an analyst depends on rather than thirteen
|
||||
// incidental fragments, so a copy edit is a reviewable diff instead of a
|
||||
// wall of failures. The wording is still pinned by the last assertion.
|
||||
// wall of failures.
|
||||
// Untrusted caller input must be framed as data, never as instruction.
|
||||
expect(rendered).toMatch(/not instructions/i);
|
||||
expect(rendered).toContain(
|
||||
@@ -67,12 +67,6 @@ describe("guided prompt contracts", () => {
|
||||
expect(rendered).toContain(section);
|
||||
// Tools are never a grant of authority.
|
||||
expect(rendered).toMatch(/never as authorization/i);
|
||||
expect(rendered.indexOf("`list_documents`")).toBeLessThan(
|
||||
rendered.indexOf("`search_strings`"),
|
||||
);
|
||||
expect(rendered.indexOf("`search_strings`")).toBeLessThan(
|
||||
rendered.indexOf("`analyze_function`"),
|
||||
);
|
||||
});
|
||||
|
||||
it("orders mutation and execution after inspection and preparation", () => {
|
||||
@@ -82,6 +76,12 @@ describe("guided prompt contracts", () => {
|
||||
renderGuidedPrompt(prompt, {}),
|
||||
]),
|
||||
);
|
||||
expect(rendered.get("audit_residual_unknowns")).toContain(
|
||||
"`list_unknowns`",
|
||||
);
|
||||
expect(rendered.get("audit_residual_unknowns")).toContain(
|
||||
"`update_unknown`",
|
||||
);
|
||||
expect(
|
||||
rendered.get("audit_residual_unknowns")?.indexOf("`list_unknowns`"),
|
||||
).toBeLessThan(
|
||||
@@ -95,6 +95,12 @@ describe("guided prompt contracts", () => {
|
||||
.get("prepare_bounded_process_capture")
|
||||
?.indexOf("`capture_process_scenario`"),
|
||||
).toBeGreaterThanOrEqual(0);
|
||||
expect(rendered.get("compare_application_versions")).toContain(
|
||||
"`inspect_artifact`",
|
||||
);
|
||||
expect(rendered.get("compare_application_versions")).toContain(
|
||||
"`compare_artifacts`",
|
||||
);
|
||||
expect(
|
||||
rendered
|
||||
.get("compare_application_versions")
|
||||
|
||||
@@ -21,6 +21,10 @@ export const TOOL_EXAMPLE_OVERRIDES: Readonly<
|
||||
procedure_callees: { procedure: "main" },
|
||||
procedure_callers: { procedure: "main" },
|
||||
procedure_info: { procedure: "main" },
|
||||
trace_native_values: { procedure: "0x1000" },
|
||||
inspect_native_data_type: { type: "/MyStruct" },
|
||||
inspect_native_instruction: { address: "0x1000" },
|
||||
resolve_native_call_targets: { address: "0x1000" },
|
||||
read_function_instructions: { procedure: "main" },
|
||||
read_bytes: { address: "0x1000", length: 16 },
|
||||
address_to_file_offset: { address: "0x1000" },
|
||||
|
||||
@@ -91,6 +91,7 @@ const PUBLISHED_TOOL_NAME_FLOOR = [
|
||||
"inline_comment",
|
||||
"inspect_address_context",
|
||||
"inspect_artifact",
|
||||
"inspect_asset_catalog",
|
||||
"inspect_electron_page",
|
||||
"inspect_macho",
|
||||
"inspect_managed_artifact",
|
||||
|
||||
@@ -46,6 +46,8 @@ import {
|
||||
} from "./toolContractHelpers.js";
|
||||
import type { ToolContract } from "./toolContractTypes.js";
|
||||
import { toolContractMetadata } from "./toolEffects.js";
|
||||
import { nativeDataTypeInputSchema } from "../domain/nativeDataType.js";
|
||||
import { nativeInstructionInputSchema } from "../domain/nativeInstruction.js";
|
||||
import { functionInstructionInputSchema } from "./functionInstructionContract.js";
|
||||
import { HOPPER_MEMORY_TOOL_DEFINITIONS } from "./hopperMemoryContracts.js";
|
||||
import { analysisSearchInput } from "./analysisSearchContract.js";
|
||||
@@ -111,6 +113,21 @@ const session = <Name extends string, Schema extends z.ZodObject>(
|
||||
|
||||
/** Bridge operations exposed without additional application composition. */
|
||||
export const OFFICIAL_TOOL_CONTRACTS = [
|
||||
official(
|
||||
"inspect_native_data_type",
|
||||
"Inspect one recovered type by exact database category path or defined typed data address. Returns observed size, alignment, packing, fields, bitfields, enum values, and child type identities; source-level authority and flexible-tail semantics remain unknown unless substantiated.",
|
||||
nativeDataTypeInputSchema,
|
||||
),
|
||||
official(
|
||||
"inspect_native_instruction",
|
||||
"Inspect one exact instruction address: decoded bytes, mnemonic, ordered operand tokens, flow and typed references. Memory addressing decomposition is unavailable when the provider supplies only tokens. Data, interior instruction addresses and undecodable bytes are distinct outcomes.",
|
||||
nativeInstructionInputSchema,
|
||||
),
|
||||
official(
|
||||
"resolve_native_call_targets",
|
||||
"Resolve one explicit static call site using typed provider call references. Preserves ambiguous targets as candidates and unresolved computed calls as unknown; does not execute code or traverse a call graph.",
|
||||
nativeInstructionInputSchema,
|
||||
),
|
||||
official(
|
||||
"address_name",
|
||||
"Resolve the primary analyzed name at a code or data address. Headless providers require an explicit address; GUI providers may default to their current cursor. Null means the provider has no primary name at that address.",
|
||||
@@ -353,9 +370,14 @@ export const ENHANCED_TOOL_CONTRACTS = [
|
||||
),
|
||||
enhanced(
|
||||
"trace_native_ui_action",
|
||||
"Trace one unique compiled Interface Builder action selector or object ID through its authored UI connections to symbolized Objective-C handlers and bounded direct callees. REA decodes the active app bundle and reads the selected provider's symbol inventory itself. Authored connections, statically matched handlers, resolved direct calls, and unresolved dynamic dispatch remain distinct; runtime reachability and cross-function value flow are not claimed.",
|
||||
"Trace one unique compiled UI action, object ID, native symbol or exact function address through authored connections, encoded or symbolized Objective-C handlers, and bounded static call references. Typed direct and resolved indirect calls, ambiguous candidates, inferred untyped provider callees, and targetless sites remain distinct. Runtime reachability is unknown; use trace_native_values for recovered value dependencies.",
|
||||
enhancedInputSchemas.trace_native_ui_action,
|
||||
),
|
||||
enhanced(
|
||||
"trace_native_values",
|
||||
"Trace a bounded static dependency graph from one explicit native procedure. Includes high-p-code def-use, constants, operators, memory and branch operations, resolved call edges, and derived argument/parameter and return/output bindings. Missing bindings, alias semantics, persistent state and RNG roles remain unknown. Budgets bound depth, decompilations, graph size and payloads; nodes are paginated.",
|
||||
enhancedInputSchemas.trace_native_values,
|
||||
),
|
||||
] as const satisfies readonly ToolContract[];
|
||||
|
||||
/** Session-owned Evidence bundle export options. */
|
||||
|
||||
@@ -42,6 +42,7 @@ const sessionEvidence = effects({ mutatesSession: true });
|
||||
export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
|
||||
inspect_native_dispatch_metadata: evidence,
|
||||
trace_native_ui_action: evidence,
|
||||
trace_native_values: evidence,
|
||||
address_name: evidence,
|
||||
comment: evidence,
|
||||
current_address: evidence,
|
||||
@@ -63,6 +64,9 @@ export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
|
||||
procedure_callers: evidence,
|
||||
procedure_info: evidence,
|
||||
read_function_instructions: evidence,
|
||||
inspect_native_instruction: evidence,
|
||||
inspect_native_data_type: evidence,
|
||||
resolve_native_call_targets: evidence,
|
||||
read_bytes: evidence,
|
||||
address_to_file_offset: evidence,
|
||||
procedure_references: evidence,
|
||||
@@ -94,6 +98,21 @@ export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
|
||||
trace_feature: effects({ mutatesSession: true, idempotent: false }),
|
||||
find_code_for_string: effects({ mutatesSession: true, idempotent: false }),
|
||||
trace_call_path: effects({ mutatesSession: true, idempotent: false }),
|
||||
observe_native_ui: effects({
|
||||
mutatesSession: true,
|
||||
launchesProcess: true,
|
||||
writesFilesystem: true,
|
||||
}),
|
||||
capture_native_ui_scenario: effects({
|
||||
writesFilesystem: true,
|
||||
mutatesTarget: true,
|
||||
mutatesSession: true,
|
||||
launchesProcess: true,
|
||||
accessesNetwork: true,
|
||||
changesUiState: true,
|
||||
mayDiscardData: true,
|
||||
idempotent: false,
|
||||
}),
|
||||
inspect_macho: nativeEvidence,
|
||||
inspect_signature: nativeEvidence,
|
||||
inspect_plist: nativeEvidence,
|
||||
@@ -102,6 +121,8 @@ export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
|
||||
inspect_artifact: evidence,
|
||||
extract_artifact: effects({ mutatesSession: true, writesFilesystem: true }),
|
||||
decode_interface_builder: evidence,
|
||||
inspect_asset_catalog: nativeEvidence,
|
||||
inspect_keyed_archive: evidence,
|
||||
inspect_managed_artifact: evidence,
|
||||
inspect_managed_members: evidence,
|
||||
inspect_managed_native_boundaries: evidence,
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import { z } from "zod";
|
||||
import { nativeUiResultSchema } from "../domain/nativeUiObservation.js";
|
||||
import { nativeValueTraceSchema } from "../domain/nativeValueTrace.js";
|
||||
import { nativeDataTypeSchema } from "../domain/nativeDataType.js";
|
||||
import {
|
||||
nativeInstructionSchema,
|
||||
nativeCallTargetsSchema,
|
||||
} from "../domain/nativeInstruction.js";
|
||||
import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
import { residualUnknownSchema } from "../domain/residualUnknown.js";
|
||||
import { evidenceBundleSchema } from "../domain/evidenceBundle.js";
|
||||
@@ -22,6 +29,8 @@ import {
|
||||
import { artifactExtractionResultSchema } from "../domain/artifactGraph.js";
|
||||
import { artifactInspectionResultSchema } from "../domain/artifactInspection.js";
|
||||
import { interfaceBuilderAnalysisSchema } from "../domain/interfaceBuilderGraph.js";
|
||||
import { keyedArchiveResultSchema } from "../domain/keyedArchive.js";
|
||||
import { appleAssetCatalogResultSchema } from "../domain/appleAssetCatalog.js";
|
||||
import {
|
||||
managedArtifactInspectionSchema,
|
||||
managedMemberInspectionSchema,
|
||||
@@ -93,6 +102,9 @@ const addressedString = z.object({
|
||||
|
||||
/** Exact structured-content schemas shared by direct analysis providers. */
|
||||
export const officialOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
inspect_native_data_type: resultOf(nativeDataTypeSchema),
|
||||
inspect_native_instruction: resultOf(nativeInstructionSchema),
|
||||
resolve_native_call_targets: resultOf(nativeCallTargetsSchema),
|
||||
address_name: resultOf(nullableText),
|
||||
comment: resultOf(nullableText),
|
||||
current_address: resultOf(z.string()),
|
||||
@@ -133,6 +145,10 @@ export const officialOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
z.object({
|
||||
procedure: procedureIdentity,
|
||||
direction: z.enum(["incoming", "outgoing"]),
|
||||
reference_kinds_available: z.boolean().optional(),
|
||||
unresolved_calls: z
|
||||
.array(z.object({ address: z.string(), reason: z.string() }))
|
||||
.default([]),
|
||||
references: z.array(
|
||||
z.object({
|
||||
source_address: z.string(),
|
||||
@@ -225,6 +241,7 @@ export const enhancedOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
inspect_native_dispatch_metadata: resultOf(
|
||||
nativeDispatchMetadataResultSchema,
|
||||
),
|
||||
trace_native_values: resultOf(nativeValueTraceSchema),
|
||||
trace_native_ui_action: resultOf(nativeInvestigationTraceSchema),
|
||||
get_objc_classes: symbolDiscoveryOutput("classes"),
|
||||
get_objc_protocols: symbolDiscoveryOutput("protocols"),
|
||||
@@ -302,6 +319,8 @@ export const enhancedOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
|
||||
/** Exact Evidence schemas for provider-neutral native inspection. */
|
||||
export const nativeOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
observe_native_ui: resultOf(nativeUiResultSchema),
|
||||
capture_native_ui_scenario: resultOf(nativeUiResultSchema),
|
||||
inspect_macho: resultOf(inspectMachoSchema),
|
||||
inspect_signature: resultOf(inspectSignatureSchema),
|
||||
inspect_plist: resultOf(inspectPlistSchema),
|
||||
@@ -314,6 +333,8 @@ export const artifactOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
inspect_artifact: resultOf(artifactInspectionResultSchema),
|
||||
extract_artifact: resultOf(artifactExtractionResultSchema),
|
||||
decode_interface_builder: resultOf(interfaceBuilderAnalysisSchema),
|
||||
inspect_keyed_archive: resultOf(keyedArchiveResultSchema),
|
||||
inspect_asset_catalog: resultOf(appleAssetCatalogResultSchema),
|
||||
};
|
||||
|
||||
/** Exact Evidence schema for execution-free managed static analysis. */
|
||||
|
||||
Reference in New Issue
Block a user