Skip to content

ImperaZim/LibRuntimeInspector

Repository files navigation

LibRuntimeInspector 1.0.0-dev PocketMine-MP 5.0.0+ PHP 8.2+

LibRuntimeInspector

Runtime inspection and report helpers for PocketMine-MP plugins, commands, schedulers and EasyLibrary package environments.

Status

This repository is the development home for the EasyLibrary OP-80 runtime inspection library. The repository has development release assets, but it is not in the official EasyLibrary package catalog yet.

The current slice is intentionally diagnostic-only:

  • describe plugins without taking ownership of their lifecycle;
  • describe commands, aliases, owners and permission shape from normalized snapshots;
  • translate public PocketMine-MP PluginManager and CommandMap snapshots into those normalized descriptors;
  • report that scheduler task listings are not available through a stable public PocketMine-MP API instead of relying on hidden internals by default;
  • consume structured libruntimeguard.report.v1 payloads without requiring LibRuntimeGuard at runtime;
  • collect findings with severity;
  • export reports as arrays, JSON, Markdown or console text.

It does not auto-fix server problems and does not replace /easylibrary doctor.

Example

use imperazim\runtimeinspector\command\CommandDescriptor;
use imperazim\runtimeinspector\command\CommandInspector;
use imperazim\runtimeinspector\plugin\PluginDescriptor;
use imperazim\runtimeinspector\plugin\PluginInspector;
use imperazim\runtimeinspector\report\ReportGenerator;

$plugins = (new PluginInspector())->inspect([
    new PluginDescriptor('EasyLibrary', '3.0.0-dev', true, ['LibCommand'], []),
    new PluginDescriptor('MyPlugin', '1.0.0', true, ['EasyLibrary'], ['LibPlaceholder']),
]);

$commands = (new CommandInspector())->inspect([
    new CommandDescriptor('version', 'PocketMine-MP', ['ver'], 'pocketmine.command.version'),
    new CommandDescriptor('plugins', 'PocketMine-MP', ['pl'], 'pocketmine.command.plugins'),
]);

echo ReportGenerator::markdown('Runtime Snapshot', [$plugins, $commands]);

PocketMine-MP Adapter

use imperazim\runtimeinspector\pmmp\PmmpRuntimeSnapshotAdapter;
use imperazim\runtimeinspector\report\ReportGenerator;

$reports = (new PmmpRuntimeSnapshotAdapter())->inspect($server);

echo ReportGenerator::console('PocketMine Runtime', $reports);

The PMMP adapter reads public APIs only:

  • Server::getPluginManager() and PluginManager::getPlugins() for plugin descriptors;
  • Server::getCommandMap() and SimpleCommandMap::getCommands() for command descriptors;
  • Server::getScheduler() only to report that a stable task-list snapshot is not exposed publicly.

Runtime Guard Reports

use imperazim\runtimeinspector\guard\GuardReportInspector;

$inspection = (new GuardReportInspector())->inspect(
    $runtimeGuard->report()->toArray()
);

The adapter is schema-based. LibRuntimeInspector does not load or control LibRuntimeGuard; it only translates retained guard failures and retention overflow into regular inspection findings.

Planned Inspectors

  • PluginInspector: plugins, dependencies, soft dependencies and provider hints.
  • CommandInspector: commands, aliases, owner drift, permission gaps and alias conflicts.
  • SchedulerInspector: task owners, intervals and risk hints if a stable instrumentation point is added later.
  • PackageInspector: EasyLibrary package-backed, virtual and standalone provider shape when EasyLibrary is present.
  • ReportGenerator: console, Markdown and JSON output.

The later slices should only inspect deeper PocketMine internals when there is a safe fallback and a real support/debugging use case.

About

Runtime inspection and report helpers for PocketMine-MP plugins, commands and EasyLibrary package environments.

Topics

Resources

License

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages