mtmharness
v0.9.103
Published
Vite browser application with a minimal DSH profile adapter.
Readme
mtmharness
mtmharness is a Vite + React browser application with a minimal DSH profile adapter. The active source, npm release and Pages deployment are owned by codeh007/gomtm under packages/mtmharness; the standalone codeh007/mtmdsh repository is retired. The profile adapter publishes host runtime metadata.
Browser App
The browser bundle is published as dist/mtmharness.js and can be loaded from npm, unpkg, or jsDelivr. The bundle automatically mounts when its script has the required data attributes:
<script
type="module"
src="https://unpkg.com/mtmharness/dist/mtmharness.js"
data-api-origin="https://api.example.test"
data-oauth-issuer="https://api.example.test"
data-oauth-client-id="<pre-registered-client-id>"
data-oauth-redirect-uri="https://host.example.test/"
data-oauth-resource="https://api.example.test/api/dsh"
data-oauth-scopes="openid offline_access dsh:connect"
data-mode="floating"
data-target="#agent-panel"
></script>The optional P2P capability uses the published static worker at dist/p2p-worker.js. DSH profile installation is declared by cordis.patch.yml and uses dist/mtmharness-host.js as the Node-side adapter.
The app owns its mount root, presentation, navigation, OAuth client, and P2P client. Every mode can be unmounted without leaving DOM, styles, observers, router state, or runtime resources behind.
Standalone application
The Vite build emits dist/index.html, generated file routes and lazy ESM chunks. Serve the complete dist directory with SPA fallback for application paths, including /sub2api/*, /p2p and /vnc. Only / redirects to /sub2api; desktop deep links keep their peer/address query. The Pages host creates its P2P SharedWorker from the same origin.
Sub2API connects directly to https://sub2.yuepa8.com. That service must allow the host origin through CORS with allow_credentials: false; requests use Authorization: Bearer and credentials: "omit". The Nodes and desktops link opens P2P discovery and the desktop service. DSH sessions still require an explicitly configured authority and working DSH backend.
Shared desktop
The /vnc route uses the existing anonymous internal-test VNC service through libp2p HTTP/WebSocket over WS/WSS. It does not grant access to DSH or imply public/NAT relay support. Closing, reconnecting or switching a view only disconnects that view. Stop shared desktop explicitly stops the shared instance.
The pinned Kasm noVNC client loads only when a desktop is ready. Its upstream patches cover worker-safe loading and transport/query cancellation; the emitted vnc-client.LICENSE* and vnc-client.AUTHORS notices travel with npm and Pages artifacts. Clipboard, audio and multiple monitors remain unsupported.
Release ownership
Gomtm's annotated version tags publish mtmharness and mtmcanvas through .github/workflows/release.yml. Its manual .github/workflows/deploy.yml deploys this application's dist to mtmharness-dev Pages alongside gomtmui. npm/CDN consumers follow the gomtm-published package; deploy the entire matching dist because entry files import version-specific chunks. Do not publish from the retired mtmdsh Changesets pipeline.
Checks
pnpm install
pnpm --filter mtmharness typecheck
pnpm --filter mtmharness build
pnpm --filter mtmharness test
pnpm --filter mtmharness pack --dry-run
pnpm exec publint packages/mtmharness