Commit Graph
32 Commits
Author SHA1 Message Date
Ole André Vadla Ravnås a1508524a0 Draw the author's own scene on a canvas
A scene the image holds by handle and changes; the host draws it.
Each drawable carries its own vertex and fragment stages, its own
attribute layout, named uniforms, buffers, a transform and a
visibility flag -- described as objects rather than staged globals.

A value says what it should do, ramp or oscillate, rather than what
it is each frame: nothing crosses per frame, since the image has no
business in the frame path any more than in the audio callback.
Both renderers work it out on the clock that draws it.
2026-08-13 12:46:09 +02:00
Ole André Vadla Ravnås ad7ffcdabc Add a synthesiser that sounds arriving events
Eight channels, each with its own patch and pattern on its own step
clock, mixed on the audio device's thread: storage allocated once,
reached through unsafe pointers, and a lock-free ring for control,
so nothing under the callback allocates, retains or locks.

The image performs a tune, names it, and sounds chords.
2026-08-13 12:46:09 +02:00
Ole André Vadla Ravnås 2ab95ef638 Author each effect once, in GLSL
Write each effect body-only against a preamble the host supplies,
and let the build systems generate what each renderer needs -- a
Swift catalog for OpenGL, a Metal fragment function through glslang
and spirv-cross. Effects react to arriving events.
2026-08-13 12:46:09 +02:00
Ole André Vadla Ravnås 6837bbc1fb events: Anchor stream to bottom 2026-05-16 22:18:58 +02:00
Ole André Vadla Ravnås 82c22cf427 core: Route LumaCore prints through engine events
Add an .engine RuntimeEvent source so host-tier issues
(devices, packages, attach, spawn-gating, instruments,
hookpacks, repl, itrace, editor) flow into the existing
event stream instead of stdout. HookPackLibrary takes a
callback for decode errors, and ITraceDecoder returns
collected panic strings so ProcessNode can yield them as
engine events.
2026-05-16 03:14:37 +02:00
Ole André Vadla Ravnås 15117ef080 ui: Don't auto-pause event stream when collapsed 2026-05-15 13:45:51 +02:00
Ole André Vadla Ravnås 5ae77ef099 ui: Fix title and payload on pinned events
Carry the runtime event's JSInspectValue into the notebook
entry so it renders as an inspectable value instead of a
stringified payload. Resolve the descriptor's display name
for the title — the source-level name is the def's UUID for
custom instruments.
2026-05-12 16:18:30 +02:00
Ole André Vadla Ravnås c5d2ff7050 core: Replace Workspace with per-document Engine
EngineRegistry caches one Engine per working-project URL.
MainWindowView.init does a pure lookup, so SwiftUI's
view-tree re-evaluations cannot open extra ProjectStores
that race the live one's BEGIN IMMEDIATE and crash via
try!.

UI-state persistence (collapse flag, sidebar selection,
session detail section, etc.) lives on Engine for GTK to
adopt. SQLite has a 5s busy timeout. Engine open failures
surface as an error view.

TargetPicker is host @State injected via environment.
Global instrument-UI defaults register at app startup;
per-engine instrument and local-notifier hookups live in
Engine extensions.
2026-05-11 21:15:47 +02:00
Ole André Vadla Ravnås 704f6e05bc core: Persist event log across runs
Length-prefixed JSON log at events.log next to db.sqlite,
configurable byte cap with rolling compaction. Replays on
Engine.start.

toLogJSON/fromLogJSON carry the .raw payload and sessionID
that wire JSON drops. EventLog flushes a pendingPersist
queue so the visible-window trim can't drop events.
2026-05-10 15:45:27 +02:00
Ole André Vadla Ravnås 45481e1d2a swiftui: Wire spawn gating UI
Target picker grows a Wait for Launch mode with a popover-anchored
suggestions list. Sidebar context menu adds Arm/Disarm with a regex
prompt; armed sessions get a scope badge.

Detail banner picks among armed, idle, and detached states. The
armed banner offers Resume when gating is paused or failed and
Disarm otherwise.

EventStreamView renders spawn-gating events; raw payloads unwrap to
the inner message string instead of String(describing:) on the case
wrapper. REPL inactive message reflects armed/paused/detached.
2026-05-08 16:15:25 +02:00
Ole André Vadla Ravnås 8c82612579 Switch instrument icon to rich model 2026-05-06 00:05:01 +02:00
Ole André Vadla Ravnås 6ab2e3d3b2 macos: Add custom instrument UI 2026-05-05 19:15:56 +02:00
Ole André Vadla Ravnås 0d382e6a8d gtk: Align backtrace popover with SwiftUI
Replace the GTK "⋯ bt" trigger with an icon button. Each
backtrace entry gets a circular "Open Disassembly" jump
button that routes through AddressActionMenu's navigator.
Symbolication failures surface an error caption with a
Symbolicate retry button.

Pause the event stream when the popover opens so live
updates don't shift the anchor; SwiftUI gets a matching
pauseEventStream environment value that EventStreamView
injects and TracerEventRowView reads.
2026-05-04 17:00:29 +02:00
Ole André Vadla Ravnås 51c693a665 swiftui: Add accessibility identifiers for UI tests 2026-05-03 22:29:31 +02:00
Ole André Vadla Ravnås 1ba5bc2661 events: Breathe empty state on compact
"No events yet" and its subtitle sat with only 6pt between them
on iPhone, which read as one chunk rather than title+explanation.
Bump the stack spacing to 12pt on compact widths; macOS keeps the
tighter 6pt since the wider layout doesn't need the extra gap.
2026-04-22 20:14:21 +02:00
Ole André Vadla Ravnås 57de6dd62d events: Anchor search left of the live indicator
The search field sat between the Spacer and the Live/Paused label,
so every time Pause toggled the field jumped by the width
difference between "Live" and "Paused". Move the field to a
fixed position right after the source/process filters, and push
the Spacer to the right of it — the field now stays put.
2026-04-22 19:51:23 +02:00
Ole André Vadla Ravnås a0bd716601 events: Match drawer chrome, flatten overflow menu
Two issues on the event stream header:

- On macOS/iPad the overflow menu rendered with the default
  bordered-ish chrome, so a gray button sat in a white toolbar.
  Apply `.buttonStyle(.borderless)` so it matches the pause
  button beside it.
- On compact iPhone the header used 8pt horizontal padding while
  the surrounding drawer header uses 16pt, so the overflow button
  sat almost on the screen edge and its outer edge didn't align
  with the drawer's expand/close icons. Bump compact header to
  16pt so the edges line up.
2026-04-22 19:41:59 +02:00
Ole André Vadla Ravnås 2e53bc7dbd events: Move Clear action to overflow menu
Trash sitting immediately next to Pause in the event stream header
was too easy to hit by accident. Replace the dedicated trash /
Clear button with an ellipsis / view-more menu that exposes Clear
Events as a destructive menu item on both SwiftUI and GTK.
2026-04-22 17:54:33 +02:00
Ole André Vadla Ravnås 3e773eac5e ios: Compact-width adaptations for shared views
Gate min-width frames behind isCompactWidth so the event stream,
target picker, codeshare browser, and collaboration panel collapse
cleanly on iPhone instead of forcing a scroll at their regular
widths. Give the event stream a dedicated compact header that
promotes the source / process filters to icon menus and keeps the
search, pause, and clear controls inline.

Drop the auto-select-first behavior in the target picker and
codeshare browser on compact, so tapping a sidebar row navigates
to the detail pane on NavigationSplitView's built-in stack instead
of stranding the user looking at a preselected item.

Push the instrument event-row monospaced font up into each
InstrumentUI factory and out of JSInspectValueView, so tracer,
hook-pack, and codeshare rows match without recomputing it for
every sub-value. Migrate the JS inspector disclosure label to
AttributedString to kill the deprecated Text + Text concatenation
warning. Tighten REPL result formatting and relabel the detach
banner hint.
2026-04-21 18:53:41 +02:00
Ole André Vadla Ravnås ccb1682d59 Fix stale .core/.instance references in views 2026-04-07 10:15:19 +02:00
Ole André Vadla Ravnås 0e669be3dc Move the rest of business logic into LumaCore
Workspace is now a thin host adapter. Engine owns sessions and
notebook entries (via store observation), GitHub auth + OAuth
device flow, hook-pack discovery, address annotations and address
actions, the disassembler cache, and all instrument lifecycle.
EventLog is @Observable so SwiftUI tracks it directly; the host
no longer mirrors event arrays or version counters.

R2 (live disassembly + trace inspection) lives entirely in
LumaCore as concrete Disassembler / TraceDisassembler classes
returning portable StyledText spans. ProcessNodeViewModel and
InstrumentRuntime are gone; views read engine.processNodes /
node.instruments / engine.descriptor(for:) directly.

Reorganize Luma/Models/ — instrument UI dispatch lives under
Luma/Instruments/, Monaco editor glue under Luma/Editor/, and the
remaining UI types sit at the top of Luma/.
2026-04-07 10:11:31 +02:00
Ole André Vadla Ravnås 875a19cfc2 Delete Workspace+Collaboration
CollaborationSession is now @Observable. Views read its
state directly via workspace.engine.collaboration. The
notebook entry methods live on Engine. The portal cert
is a LumaCore SwiftPM resource via Bundle.module.

Workspace keeps only the auth-flow glue (showing the
sign-in sheet, signOut clearing UI state) and the deep
link join handler.
2026-04-07 07:47:39 +02:00
Ole André Vadla Ravnås 54084fe703 Split InstrumentTemplate into descriptor and UI
InstrumentDescriptor (LumaCore) holds the data: kind,
identifier, display name, icon, initial config, and
event summary. Engine maintains a descriptor registry.

InstrumentUI protocol (Luma) defines the SwiftUI view
factories. TracerUI, HookPackUI, and CodeShareUI
implement it. InstrumentUIRegistry maps descriptor
IDs to UI instances.

Workspace no longer constructs templates. Views look
up descriptors via engine and UI via the registry.
2026-04-07 07:09:44 +02:00
Ole André Vadla Ravnås 944b0a0cb0 Fix instrument event rendering and name
Resolve InstrumentRuntime in the event sink so the
template's renderEvent closure is used. Show the
instrument's display name in the source badge.
2026-04-06 22:27:26 +02:00
Ole André Vadla Ravnås bddb2830fe Wire views and Workspace exts to ProjectStore
Update every view and Workspace extension to use LumaCore
types and ProjectStore instead of SwiftData:

- SidebarView: fetch instruments/insights/captures from store
- DetailView: resolve sessions via store
- REPLView: load cells from store by sessionID
- NotebookView: use LumaCore.NotebookEntry value types
- Workspace+Packages: delegate to CompilerWorkspace, use
  ESMBundleParser.parse(), persist via store
- Workspace+Collaboration: fetch/save collaboration state
  and notebook entries through store
- All remaining views qualified with LumaCore types

The Luma app should now compile without SwiftData.
2026-04-06 21:03:17 +02:00
Ole André Vadla Ravnås 19369c1f8a Remove SwiftData and wire Luma app to ProjectStore
Delete all 10 @Model classes (replaced by LumaCore structs).
Remove SwiftData imports from 27 files. Drop DocumentGroup,
schema versions, and migration plan from LumaApp.

ProcessNodeViewModel now persists REPL cells, ITrace
captures, and session updates through ProjectStore instead
of ModelContext. InstrumentRuntime uses the LumaCore
InstrumentInstance struct directly.

WIP: Workspace needs ProjectStore injection and views need
wiring to load data from the store. The Xcode build has
errors until the remaining view plumbing is done.
2026-04-06 20:33:20 +02:00
Ole André Vadla Ravnås 67ebd9ab2e Adapt Luma app to LumaCore ProcessNode
Rename ProcessNode → ProcessNodeViewModel across all views
and update RuntimeEvent to wrap the LumaCore event type.

Views access core business logic through .core (evalInREPL,
symbolicate, resolve, anchor, readRemoteMemory, modules).
The ViewModel exposes Frida types directly (device, session,
script) and handles SwiftData persistence by subscribing to
the core's async event streams.
2026-04-06 20:04:29 +02:00
Ole André Vadla Ravnås 54868d8b9d Extract portable model types into LumaCore
Move pure data types out of Luma/ into Sources/LumaCore/
so they can be shared with the GTK frontend:

- AddressAnchor, CFGGraph, ITraceDecoder (+ all related
  types: TraceEntry, ITraceMetadata, RegisterState, etc.)
- JSInspectValue, SpawnConfig, ProcessModule
- HookPackConfig, HookPackManifest, InstrumentConfigCodec
- InstrumentIcon, InstrumentKind, ConsoleLevel

CFGGraph uses its own Point2D instead of CoreGraphics
types, keeping the core free of Apple frameworks.

Remove premature stubs (Engine, ProcessNode,
InstrumentRuntime, EventStream) that will be properly
built in a later phase once the real implementations
are ready to move.
2026-04-06 19:19:20 +02:00
Ole André Vadla Ravnås ac85dfa289 event-stream: Align rows on .firstTextBaseline 2026-01-02 23:04:42 +01:00
Ole André Vadla Ravnås 1a305abec8 Pass session ID when creating notebook entries
It's required for entries that contain a JSInspectValue.
2025-12-23 13:18:36 +01:00
Ole André Vadla RavnåsandFrancesco Tamagni d9c1c5376a Start integrating r2
Kudos to @mrmacete for the Ansi parser.

Co-authored-by: Francesco Tamagni <[email protected]>
2025-12-13 18:56:33 +01:00
Ole André Vadla Ravnås 851b8e26bd Initial commit 2025-12-05 23:16:30 +01:00