OMC version 5.2 #26
abra-code
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
OMC 5.2
OMC 5 requires macOS 14.6 or later. For older macOS versions, use OMC 4.x.
OMC 5.2 is a testing and tooling release. Its centerpiece is omctest, a headless test harness that runs an applet's handlers against a mock OMC environment, wired into AppletBuilder as a Test button and an
appletbuilder testsubcommand. Around it, the command-lineplistertool got three rounds of crash and data-loss fixes plus content-based format sniffing,codesign_applet.shlearned to preserve entitlements on nested code, applets launch faster and ship smaller, and includes latest ActionUI with add-ons.Highlights
omctest: a headless test harness for applet handlers
Applet handlers can now be tested without a GUI and without a human clicking through dialogs.
omctestruns a suite of shell or Python tests against a mock OMC environment: recording stubs foromc_dialog_control,plisterandpasteboard, simulated alerts and command chains, input simulation, a check vocabulary, and virtual-window readback.Agents/omctest.shinside AppletBuilder.app, with a full test-author reference atDocumentation/omctest_guide.md(API tables, verb replay table, seam contract, fixtures, troubleshooting).omc_control_defaults <document>resets a window to the values its ActionUI document actually declares, rather than to a blank state. This matters because many applets ship non-default toggle states, and a blank reset silently tests the wrong thing.chains_resetresets chain state between tests,ui_declare_idsdeclares runtime-minted view ids, andomctest_isolation_lintwarns about$HOMEanddefaultspaths the harness cannot intercept.$HOMEis isolated per test file, so a test that saves settings no longer writes into your real~/Library/Application Support.CRASHandINCOMPLETEdistinctly instead of collapsing both into a generic failure.OMCTEST_API_VERSIONis currently 6. Assert a minimum in your suite if you rely on something recent: 2 addedomc_control_defaults, 3 isolates$HOME, 4 isolates named pasteboards, 5 exportsOMC_APP_PROCESS_ID, 6 makes named pasteboards files and dropsOMCTEST_PB_PREFIX.AppletBuilder runs the suite for you
appletbuilder build --testruns the suite after the runtime refresh and before signing, and halts the build if it fails. This is deliberately opt-in rather than folded into a plainbuild.appletbuilder validatenow emits an informational note when an applet has noTests/directory.validate cross-checks ActionUI action ids against the command list
command_verifiernow resolves every ActionUIactionIDand*ActionIDvalue against the applet's command list. It warns when a control's action id resolves to no command, and separately flags a case-only mismatch, which the engine treats as a dead control because dispatch is case-sensitive. This turns a manual by-eye step into an automated one. It was validated across 25 applets plus AppletBuilder itself, roughly 460 action ids, with no false positives.plister: crash and data-loss fixes, and format sniffing
plisteris the plist and JSON manipulation tool handlers lean on, and it went through three review rounds:plisternow determines it from the content, trying JSON first and falling back to the plist parser. Custom project extensions work without a format flag.append dictandappend arraynow work; previously only scalars could be appended.plisterreturned exit 0 after a write that did not happen; so diditerateafter a failed modifying subcommand.plister set dict <file> /previously overwrote an unparsable file with an empty container..or..component in a property path no longer hangs; it was allocating about 2 GB in 4 seconds.New features
OMC_APP_PROCESS_ID
A new always-exported variable,
$OMC_APP_PROCESS_ID(template form__APP_PROCESS_ID__), resolves to the process id of the OMC host process itself: the applet, OMCService, the Shortcuts observer, OMCEdit, or AppletBuilder. NoENVIRONMENT_VARIABLESdeclaration is needed.This is distinct from the existing
$OMC_FRONT_PROCESS_ID, which is the frontmost application and may be unrelated to the applet. Use$OMC_APP_PROCESS_IDwhen a handler needs to know whether the instance that owns some state is still alive, for example to avoid orphaning a spawned server process.New ActionUI navigation elements
NavigationSplitViewandNavigationStackare now available and documented for OMC dialogs, giving multi-pane sidebar and detail layouts and push-style navigation stacks. Each has two forms: static panes, or selection-driven destination switching viadestinationViewId.codesign_applet.sh: entitlements carried forward, plus two new flags
allow-jitwould crash the first time it ran after signing.--list-codeprints every path the script would sign, one per line, and exits without touching anything, so a caller can check the same set.--no-entitlements-searchuses only the entitlements file passed explicitly, never auto-discovering a stray neighboring.entitlementsfile./tmpto$TMPDIR.thin_applet_python.py
A new
planandapplytool shrinks an applet's embedded Python by tracing the bundle's own scripts directly, with no hand-written per-applet workload to maintain. Measured on the current applets: Zip 69.5 MB to 42.6 MB, ICEdit 56.5 MB to 38.0 MB, Watchdog 61.0 MB to 38.0 MB, Cadabra 108.2 MB to 89.9 MB, AIChat 47.5 MB to 29.1 MB.Faster applet launch
The launch-time
compileallof an applet'sResources/Scriptsis disabled. It could never help, because CPython does not consult a bytecode cache for__main__, and it cost every launch between 24 and 123 ms to save at most 3 ms once. Handlers behave identically; cold launch is measurably faster.Security
Bundled Chat component: redirects refused on the ACP handshake
The bundled Chat component moved from ChatView 0.2.1 to 0.5.6. As of 0.4.5 its remote ACP WebSocket client refuses redirects on the connection-upgrade handshake. Previously a followed redirect could hand the code-execution bridge credential to whatever host the redirect named, in cleartext over
ws://.The same version arc also fixed a recurring AppKit layout-loop crash that could kill a chat mid-answer, and added composer and conversation-summarizer support.
Compatibility notes
The
plisterfixes above correct real bugs, but a handler that worked around one of them may need a look:plisterused to rewrite as XML on every modification now keeps its original format. Tooling that assumed "plister always normalizes to XML" no longer holds.true,42, ornullat the root of a file with an unrecognized extension is read as a plist string, not sniffed as JSON.plister set dict <file> /, the documented create-if-missing idiom, now refuses to run against an existing file that fails to parse instead of overwriting it. A handler that relied on the old overwrite behavior will now see a failure.omctest suites written against API version 2 or lower still run, but tests that read or write real user preferences may behave differently now that
$HOMEis isolated per test file. That is the intended fix, and it is worth re-reading such tests rather than assuming they still assert what they used to.Documentation and skill
Documentation/omctest_guide.md, the test-author reference for omctest.OMC_APP_PROCESS_IDdocumented in the runtime-context reference, inbuilding_omc_applet.md, and in the Skill.appletbuilder_user_guide.mdand in the agent troubleshooting checklist.Chat,NavigationSplitView,NavigationStack,CommandMenu, andView, whosehiddensemantics are now stated explicitly: a hidden view is laid out but invisible, not collapsed.Also in this release
appletbuilder build <app> --identityor--thin, with the option as the final argument, spun at 100% CPU forever instead of reporting a usage error./usr/bin/python3when its embedded interpreter is missing; it fails loudly instead. Multi-line embedded Python inside its shell scripts was extracted into real.pyfiles.In this distribution
~/Library/Preferences/com.abracode.OnMyCommandCMPrefs.plist.codesign_applet.sh,install_contextual_menu_plugin.sh,thin_distribution.sh,OMCApplet.entitlements, and the examplecom.abracode.OnMyCommandCMPrefs.plist.See the main OMC README at https://github.com/abra-code/OMC/ for full documentation on commands, runtime context, dialogs, and services.
This discussion was created from the release OMC version 5.2.
All reactions