Commit Graph
112 Commits
Author SHA1 Message Date
Ole André Vadla Ravnås 69c706789f Follow the pattern compiler's module API
Compile, then decode through the module. Pass platform before arch,
and default both to the host rather than darwin/arm64.
2026-10-01 20:49:11 +02:00
Ole André Vadla Ravnås 0659f5f14e core: Expose virtual machines to LLMs 2026-10-01 20:49:11 +02:00
Ole André Vadla Ravnås a8816543d8 core: Pass tool images over MCP 2026-10-01 20:49:11 +02:00
Ole André Vadla Ravnås bbf63ec269 core: Expose patterns to LLMs
Let a model list, check and write patterns, decode memory with them,
and place them on insights.
2026-10-01 20:49:11 +02:00
Ole André Vadla Ravnås a3cdd5df5f core: Derive the approval-gated tool list 2026-10-01 20:49:11 +02:00
Ole André Vadla Ravnås 8d12aa4d7f core: Carry the app icon on a spawn target 2026-09-28 17:35:15 +02:00
Ole André Vadla Ravnås f89d31aa9d core: Order OS checks Windows, macOS, Linux
The house order was not kept where these were first written.
2026-09-17 13:15:53 +02:00
Ole André Vadla Ravnås fa1416e3bc Spawn children without a console
Foundation calls CreateProcessW with CREATE_UNICODE_ENVIRONMENT and
nothing else, and offers no way to add to that. The app has no
console of its own, so every console child it started -- an
emulator, qemu-img, the agent CLI -- was given a fresh command
prompt to look at.

Spawn through ChildProcess instead, which asks for CREATE_NO_WINDOW
on Windows and is Process everywhere else.
2026-09-15 13:45:03 +02:00
Ole André Vadla Ravnås b88a9be290 Replace SwiftyMonaco with native editors
Drop the Monaco webview. Edit in a GtkSourceView on GTK and in a
native text view on Apple, both speaking to Frida.Compiler's
in-process language server for completions, signature help,
hovers and diagnostics.

Color, complete and indent code natively, matching the GitHub
theme in light and dark.
2026-09-08 19:52:31 +02:00
Ole André Vadla Ravnås f8d25015ae Drop the comments that only restate the code
A comment is a last resort, and these were not one: section banners,
doc headers naming what the declaration below already names, and
notes saying in prose what the next line says in code.

What is left is what the code cannot show -- an ordering that matters,
a platform quirk, why the obvious way fails.
2026-08-13 13:09:18 +02:00
Ole André Vadla Ravnås 4f7f06e57d Follow frida-swift's regenerated API
Take the regenerated bindings on both frontends.
2026-08-13 12:46:09 +02:00
Ole André Vadla Ravnås b6ee7d7187 Put the whole surface on iOS too
The playground, the notebook cells, the source editor with its
marks, the inspector columns and the canvas are written once for
both Apple platforms, with a file naming what the two frameworks
call differently. The editor is where they really part company.

The engine owns the image and its start-up, so a mission reaches
the whole of Pharo.
2026-08-13 12:46:09 +02:00
Ole André Vadla Ravnås 5d1ed175fe core: Prepare attaching sessions in the engine
Frontends built the session record, set its phase and surfaced it,
briefly showing the detached banner at the idle phase before attach
began. Move construction, phase and surfacing into prepareSpawnSession
and prepareAttachSession so the session appears already attaching.
2026-07-09 17:31:45 +02:00
Sunwoo Moon 03b5fb8791 Add a second OpenAI-compatible mission provider
Fold the local and URL providers into one configurable
OpenAICompatibleProvider and register both, so a remote
endpoint can be set alongside the local one. Accept optional
API keys for compatible providers in the mission sheet, and
collapse duplicate /v1 segments when building request URLs.
2026-07-06 17:31:43 +02:00
Sunwoo Moon a6d6ec439e Keep mission reply visible until it is persisted
Clear the live assistant text on an explicit liveTextCleared
event emitted once the turn is saved, not on messageStop or
finalMessage. Navigating away and back no longer drops the
latest streamed reply.
2026-07-06 17:31:43 +02:00
necpition205 7411c3c9a4 Optimize mission context reads 2026-06-28 02:02:14 +02:00
necpition205 79651b5407 Guard runtime parsing and rendering 2026-06-28 02:02:14 +02:00
necpition205 83769a5e8e Harden custom instrument handling 2026-06-28 02:02:14 +02:00
Ole André Vadla Ravnås e711f772e3 Render r2 hexdumps in the hex view widget
Detect the plain px and x commands and fetch their bytes via
pxj, rendering them in our interactive hex view rather than as
text. Resolve the target address so the offset column shows the
real addresses, carrying it on the binary result's metadata.
2026-06-26 19:13:57 +02:00
Ole André Vadla Ravnås ce32477080 Adopt unified SwiftyR2 cmd API
Move to the single cmd that returns an R2CommandResult with an
optional output, and handle the nil that r2 yields for commands
with no string result (e.g. an invalid command from completion).
Bump the SwiftyR2 pin to the revision with that fix.
2026-06-26 18:33:16 +02:00
Ole André Vadla Ravnås b84bfa0a2b Add r2 as a first-class REPL language
Make the REPL prompt a clickable mode toggle between JavaScript
and r2; ":", ":r2" and ":js" switch from the keyboard. Carry the
language on REPLCell and REPLResult, route r2 input through the
session disassembler, and render output as a JSInspectValue tree
for JSON commands or ANSI-parsed styled text otherwise.
2026-06-26 16:45:21 +02:00
Ole André Vadla Ravnås ffa1a21e8a core: Surface Claude subprocess retry status
Yield api_retry events as live notices so model overload is
visible instead of a silent spinner, and fall back to the
streamed error detail when claude exits with empty stderr.
2026-06-24 15:27:41 +02:00
Ole André Vadla Ravnås b74976687b gtk: Fix base URL entry and allow optional API key
The base URL only applied on Enter, and applyProviderSelection
reset it to the stored value, wiping typed text. Persist edits
after a debounce instead, and only load the stored URL when
switching provider.

Servers like open-webui need a Bearer token, so introduce an
optionalAPIKey capability, declare it on the local
OpenAI-compatible provider, and show the key field without
gating Start on it.

Refresh only the model list when the base URL or API key
changes, instead of rebuilding the whole provider section: the
full rebuild flickered, and hid the API key entry while typing
into it. Guard async model loads with a generation counter so
stale results cannot overwrite newer ones.
2026-06-04 23:31:20 +02:00
Ole André Vadla Ravnås 0079588667 mission-tools: Harden disassemble tool
Two distinct failure modes were producing misleading tool
output to agents:

1. The joined `text` payload was being inferred as
   `GRDB.SQL` instead of `String` via transitive overload
   visibility, producing an unbridgeable Swift value that
   NSJSONSerialization rejected with an uncaught
   NSException during makeResult. The exception unwound
   through a Swift async continuation, leaving the
   concurrency runtime in a state that subsequently
   tripped libswift_Concurrency during AppKit window
   key-state propagation, crashing the app.

2. When the session was detached, the cached Disassembler
   still returned lines decoded as "invalid" because r2's
   IO backend got read failures from a CachingMemoryReader
   whose live reader was nil. Agents saw what looked like
   real disassembly of garbage and could be misled into
   deep debugging of a non-issue.

Pin String at every binding in the disassemble payload to
prevent inference drift; add an isValidJSONObject guard in
makeResult so any future non-JSON value becomes a clean
MCP error with a key-path + Swift type diagnostic instead
of an uncaught ObjC exception; and require an attached
node before invoking the disassembler, using the canonical
"no attached session for id …" error so agents recover via
the established list_sessions → attach_to_process path.
2026-05-25 22:12:12 +02:00
Ole André Vadla Ravnås b8800dbd80 core: Clarify read*String(size) semantics 2026-05-24 10:36:26 +02:00
Ole André Vadla Ravnås 3382de8579 core: Note multi-file imports use .js suffix 2026-05-24 10:36:23 +02:00
Ole André Vadla Ravnås 197a101d6a core: Surface authoring guide via MCP instructions 2026-05-24 10:36:18 +02:00
Ole André Vadla Ravnås 96a8b04483 core: Unify instrument discovery and attach in MCP
Replace list_custom_instruments + attach_custom_instrument
with list_instruments + attach_instrument over the
InstrumentDescriptor registry. Hookpacks and the tracer
are now discoverable and attachable through the same path.
Re-attaching an instrument that's already on the session
returns the existing instance.
2026-05-24 08:41:44 +02:00
Ole André Vadla Ravnås 92fc4ee4f5 core: Surface compile/attach status in MCP
Edit tools (tracer hook + custom instrument) await
recompile and report apply outcome per session. Query
tools (list_session_instruments, list_tracer_hooks,
read_tracer_hook) expose attachment, status, and
per-hook compile errors. submit_console_input and
invoke_widget_action refuse to dispatch when the
session is detached or the instrument is in error.
2026-05-24 08:10:49 +02:00
Ole André Vadla Ravnås 5baf1d4f14 core: Decouple custom instrument writes from agent reload
A wedged custom instrument blocks dispose RPC, which made every
write_custom_instrument_file call hang waiting on the live reload.
The store write already succeeded; only the side-effect bounce was
stuck, and that's exactly when you most need to edit the source.

Detach the reload into a Task so writes return as soon as the
on-disk state is updated.
2026-05-22 18:02:06 +02:00
Ole André Vadla Ravnås 8f0e8e7a0f Skip action queue when MCP client is trusted
Add a 'Trust client approvals' toggle on the external MCP
server config. When on, write-mode tool calls from this server
bypass Luma's approval gate (still recorded in history) so
users aren't double-prompted when their MCP client — e.g.
Claude Code — already prompts per tool. Default off; persists
in LumaAppState and applies live to a running server.
2026-05-22 13:03:15 +02:00
Ole André Vadla Ravnås 788ee99554 core: Defer to typings tool for custom instr API 2026-05-22 12:38:36 +02:00
Ole André Vadla Ravnås 3afae9d084 core: Sharpen Frida guidance in system prompt
Add a GumJS gotchas section covering the polyfilled surface
(Buffer yes, btoa/atob no, ArrayBuffer.wrap is GumJS not Node),
language bridges needing install_package + global_alias, 64-bit
integer wrappers that JSON-stringify, NativeFunction bool as
0/1, and struct args as flat arrays. Pin the custom-instrument
entrypoint to the top of the file per newspaper order.
2026-05-22 12:35:12 +02:00
Ole André Vadla Ravnås 8d6f91fe1e Plumb image attachments through to the LLM
Console widgets get an appendImage / respond.image API on the
agent. read_widget_state surfaces image entries as attachments
scaled to at most max_dimension pixels (default 1568) on the
longest edge. Anthropic nests image blocks inside tool_result;
OpenAI gets a synthetic follow-up user message. The host scales
via CoreImage on macOS and GdkPixbuf on GTK.
2026-05-22 12:15:53 +02:00
Ole André Vadla Ravnås 5c2092364b core: Cap oversized strings in tool results
Walks the payload before serialization and replaces any string
over 2 KiB with a head-truncated marker. Guards against a single
5 MiB base64 blob blowing the LLM's context budget.
2026-05-22 10:52:22 +02:00
Ole André Vadla Ravnås dde1888650 core: Declare code-preview args on tool specs
Action Queue rendering had drifted: stale field name, two
non-existent tool names, and the edit_* tools missing entirely.
Move the metadata to ActionSpec so the view can't drift again.
2026-05-22 10:32:33 +02:00
Ole André Vadla Ravnås edbf8da951 core: Number lines in agentic file reads 2026-05-22 10:22:41 +02:00
Ole André Vadla Ravnås 7e6e6c8338 core: Add line-range edit tool for tracer hooks
read_tracer_hook now returns line_count so edit_tracer_hook
can target lines reliably.
2026-05-21 09:21:45 +02:00
Ole André Vadla Ravnås a2e26e8058 core: Add line-range edit tool for instruments
Custom instrument files can run to thousands of lines;
full-file rewrites waste tokens and risk clobbering
untouched code. read_custom_instrument_file now returns
line_count to make targeting reliable.
2026-05-21 09:15:45 +02:00
Ole André Vadla Ravnås 4b9669dab2 agent: Notify sidebar on AI-created sessions 2026-05-21 02:17:51 +02:00
Ole André Vadla Ravnås 1fbcdb881a core: Share code style across LLM prompts 2026-05-21 02:02:00 +02:00
Ole André Vadla Ravnås d0acb79a14 agent: Use friendly names for AI-installed hooks 2026-05-21 02:01:40 +02:00
Ole André Vadla Ravnås 6dd110761c agent: Auto-run rename_insight 2026-05-21 01:59:15 +02:00
Ole André Vadla Ravnås 7a43a42744 Replace isDarkMode with Appearance enum
New LumaCore.Appearance (light, dark). DisassemblyRequest,
Disassembler and TraceDisassembler key on it directly; the
r2 theme mapping lives in one place. ThemeWatcher returns
Appearance; remaining C-interop callers compare to .dark at
the boundary. CFG views use themeAppearance to avoid clashing
with NSView's inherited appearance property.
2026-05-20 21:03:29 +02:00
Ole André Vadla Ravnås 211c8d25e2 Carry symbolicate names offline
Engine.symbolDisplay returns a richer SymbolDisplay (overlay,
source, raw, primary) and persists every live symbolicate
result into module_symbol (sessionID, modulePath, function-entry
offset → name). Offline rendering falls through to that table
first, then to enclosingFunction from the persisted block
ranges, then to module+offset. ProcessNode delegates trace
block annotation back through this path via
onResolveBlockNames so the same names show up on detached
traces.
2026-05-20 19:18:13 +02:00
Ole André Vadla Ravnås dd71943d94 Allow naming address insights
Replace the auto-derived title with userTitle (nil = auto)
and a parentInsightID link. Display name is userTitle, else
<parent.title>+0x<delta>, else sub_<offset> if at a function
start, else module+offset. Sidebar context menu Rename… and
an LLM rename_insight tool both go through Engine.renameInsight,
which broadcasts via the existing updateInsight op and pushes
the new name into r2 as a flag (plus afn at function starts).

getOrCreateInsight kicks off a background pass that links a
new insight to its enclosing function-start insight, and
adopts siblings inside its region when the new insight is
itself the function start. The same adoption runs when a
fresh ModuleAnalysis newly reveals a function start under an
existing insight.
2026-05-19 16:01:25 +02:00
Ole André Vadla Ravnås 143df80073 Bound disasm at function end
Persist per-session module analysis (executable ranges + known
functions, keyed by module name + LC_UUID) so on-demand
analysis runs once per binary and rebases on reattach. The
agent gains enumerateModuleRanges and getModuleIdentity; the
store gains a module_analysis table.

Disassembler queries $FB/$FE for the request address; when it
hits a function start, fetch via pDJ bounded to the function's
byte range. Otherwise fall back to pdJ N. Filter pdJ
decoration entries (xrefs, fcn headers, var summaries) that
share the addr of an instruction.

DisassemblyPage carries a scope (.function/.span) so the
SwiftUI and GTK insight views can disable loadMore when the
page is function-bounded. The disassemble AI tool surfaces the
scope too, so the model knows whether it has the whole
function or just an N-instruction span.

Go-to-Function-Start now opens (or selects) the insight rooted
at the function start, which then renders via the bounded
path.
2026-05-19 09:53:41 +02:00
Ole André Vadla Ravnås 3bb90498ef core: Capture r2 logs per command
runCommand and decompile now return R2CommandResult so callers
can see r2's log entries. r2_cmd surfaces them to the agent;
findFunctionStart treats any error log as no result.
2026-05-18 00:29:07 +02:00
Ole André Vadla Ravnås ac6943deab core: Add LLM-backed RE suggestion tools
Four typed tools layered on radare2 + the mission's LLM:
suggest_function_name, suggest_function_signature,
suggest_local_names, find_vulnerabilities. Suggestions are
proposals only; the agent applies them via r2_cmd if it wants.
2026-05-18 00:25:58 +02:00
Ole André Vadla Ravnås a3987ca769 core: Add r2_cmd mission tool
Lets the agent run ad-hoc radare2 commands against the session's
r2 context. Output is truncated to max_output_chars.
2026-05-18 00:25:58 +02:00