Plugin API 2.8.0. Needs Termix 26.11.2.
Added
ctx.desktop.local.fs.openInEditor(path)opens a local file in the external editor the person picked in the desktop app, or with its default app. The app starts the editor, so the plugin needs no process grantctx.schedule.keepAwake(reason, awake)tells Termix the plugin has work that needs its process running. A plugin that calls it lets Termix stop the process when there is none, and its jobs shorter than the idle time then run only while it runs. Optional in the types, so call it asctx.schedule.keepAwake?.(...)createMockCtxrecords those reasons inawakectx.desktop.grantView({ url, ignoreCert })lets the plugin's frames show one page:NativeViewfrom/uitakes thegrantand Termix draws a native view on the desktop or a credentialless sandboxed iframe in a browser. Needsdesktop:window.createMockCtxrecords them inviewGrantsapp.serial: Web Serial through Termix for a plugin withdevice:serial. The browser's picker opens from a click and the plugin gets only the port the person picked- Login methods can describe themselves for the sign in screen:
fieldsfor form methods,kind: "webauthn"withoptionsfor passkeys,placementand per instanceviews. Second factors take aprompt(code,fieldsorwebauthn) ctx.auth.registerWebAuthnCeremonyandapp.auth.webauthn(id, extra)run WebAuthn steps from a plugin's own screens, such as adding a passkey. Termix runs the browser prompt and the plugin's server checks the answer.createMockCtxrecords them inauth.webAuthnCeremoniesapp.session.signOut()andapp.session.reload()for login policy plugins (auth:policy)
Changed
- On the desktop app, plugin processes run on the app's pinned Node with the same flags as on a server, inside an OS sandbox. Desktop only code that used
fsorchild_processfreely must move toctx.desktop.local registerLoginMethodandregisterSecondFactorUIin a frame take onlyenrollment; the sign in steps are drawn from what the backend describes.componentis optional and only works for plugins in the pageNativeViewno longer takesignoreCert. Only a grant from the plugin's server can trust a bad certificatetermix-plugin validaterefuses theme CSS that loads anything from outside the plugin, throughurl(),image-set(),src(), root paths or CSS escapes- A plugin process now stops when idle unless it provides something on core's own request paths (logins, connects, sync, host status and locks, alerts, approvals, TLS, looks) or runs a job more often than the idle time. Operations, services, registry values, event listeners, settings hooks and jobs it registered stay with core and start the process again when called
Fixed
- The sandbox mock of
createMockCtxletsctx.auth.completeRedirectLoginkeep the live request, and hands login hooks a plain copy of the request, as a plugin process does