Building modules

Module example library

Runnable example modules for every module type.

For Muon Insight 0.26.0. This guide also ships inside the app under Help and Documentation.

The example library is installed under repository-examples\modules. Each example is a complete folder with a schema-valid module.json, a heavily commented entry point, and a technician-facing HELP.md.

Copy the whole folder. Do not combine files from different examples until the copied module runs.

Examples technicians can run through current module pages

diagnostic-powershell

A read-only Windows check that demonstrates context loading, parameters, progress, cancellation, individual tests, findings, remote-scope evidence, and caught failures.

Use this as the default starting point for Windows troubleshooting.

action-powershell

A confirmed action with preflight, cancellation before mutation, a bounded change, final-state verification, and explicit change reporting. Its example mutation writes only an instructional marker inside the approved task artifact directory.

Use this for repairs, resets, service changes, or other deliberate mutations.

log-collector-powershell

A bounded local/WinRM log collector using Invoke-MuonBoundedLogCollection. It demonstrates age and size parameters, file patterns, focused event-channel export, ZIP attachment creation, hashing, and remote scope reporting.

Use this for category-focused support bundles.

analyzer-python

A deterministic threshold analyzer with typed inputs, tests, findings, progress, and cancellation. It does not make changes or call external services.

Use this when the important work is interpreting values rather than collecting Windows evidence.

integration-python

A defensive HTTPS integration pattern. Network access is disabled by default. The code demonstrates URL validation, bounded timeout, limited response reading, safe error reporting, and avoiding secret output.

Use this for ServiceNow-like or inventory APIs after adapting it to approved configuration and credential storage.

Host-extension contract examples

These examples produce valid module results and attachments, but the current application does not automatically place them on their specialized pages. They are starting contracts for developers who are also adding the corresponding host registration.

report-generator-python

Creates a self-contained HTML report inside paths.artifacts, hashes it, and returns it as an approved attachment.

connection-test-python

Performs bounded controller-origin DNS and TCP checks for the selected target and returns one test per stage.

dashboard-provider-python

Returns compact, non-sensitive dashboard card objects with stable keys, display values, status, and refresh guidance. The current Dashboard does not auto-discover these cards.

Validate the library

The automated suite discovers every example against schemas/module.schema.json, checks that every declared help file exists, compiles Python, parses PowerShell, and verifies that all eight module types are represented. Treat a failing example-library test as a release blocker because developers will copy these files directly.

Something wrong or unclear? Open an issue on GitHub.