* feat(plugin,host,ui): add agent session takeover, protected-phase confirmation, and autoinstall host foundation * feat(macos,ui,cli): add offline REIMSPROV first-boot provisioning to skip Setup Assistant (#129) Builds a per-VM read-only REIMSPROV disk image containing a pure-Go XAR Distribution flat package (provision.pkg) and an offline Recovery fallback script (provision-offline.sh). Passwords are hashed in memory to Apple SALTED-SHA512-PBKDF2 bplist00 ShadowHashData (never persisted in plaintext, no auto-login or NOPASSWD sudo). Uses native OpenDirectory.framework (JXA NSData) + dseditgroup under SIP-enabled live bootinstalld and dslocal plist + PlistBuddy under offline Recovery, skips Setup Assistant and Keyboard Setup Assistant, pre-stages Guest Tools, integrates with CreateWizard / VMPage / vm provision CLI / StartAutoInstall, and zero-wipes on finish_install, normal cold start, or DeleteVM. * feat(autoinstall,host,ui): add input-locked session shield, recovery-only mode, and restart grace cap Adds the real-machine end-to-end verified baseline for automatic macOS installation: (1) takeover_policy 'lock' with transparent Win32 VM client-area input shield, low-level key/mouse lock preserving host escape shortcuts (Alt+Tab/Alt+Esc/Win), HUD & UI Pause/Resume controls, and write guards while paused; (2) decoupled recovery_only vs full (REIMSPROV) modes in StartAutoInstall, CreateWizard, and VMAutoInstallPanel; (3) graceful_timeout_sec cap (default 10s) on automated built-in macOS host/vm.restart so Setup Assistant/Login Window restarts do not stall 90s on ACPI; (4) additional modifier aliases in console manager and agent-session/telemetry cleanup on VM deletion. * feat(autoinstall,overlay,plugin): add built-in macOS auto-install plugin, dynamic island overlay, and review fixes * fix(app,host,macos,ui): address PR #134 automated review findings - Frontend & i18n: - Fix UTF-8/GBK mojibake in VMPage.tsx. - Emit reims:confirm-resolved on timeout/cancel/resolve so frontend modals auto-close and surface errors cleanly; stop submitCreate from continuing after PrepareVMProvision failure. - Gate AutoInstallPanel RapidOCR download button on preflight can_download_ocr when pinned default assets are unavailable. - App / Sessions / Confirm / Lifecycle: - Add 30s denial cooldown for protected-phase confirmation prompts and revoke (pluginID, vmKey) grants on non-completed session exits. - Fix sessionOverlay / activeAgentSessions data race, remove duplicate permission-denied invocation, guard against clobbering other sessions or completed overlays, and unify VM key normalization. - Grant protected-phase confirmation and attach lock-mode session + watcher when resuming auto-install without an active session. - Unify FinishInstall and host/vm.finishInstall result handling and persist .reims-go-provision-ready across restarts. - Preserve non-timeout stop errors in restartMacOSVMLocked instead of force-killing. - Host Takeover Hooks: - Require both keyboard and mouse WH_*_LL hooks (rolling back partial installs), initialize thread message queue before ready, reset started state on error/exit for retry, and report hook failures. - macOS Provisioning & Autoinstall Engine: - Track REIMSPROV staged/wipe-pending/ready lifecycle markers, exclude "restore" recovery marker from re-attaching REIMSPROV, fail explicitly on offline admin plist creation failure, and report wipe failures. - Serialize per-VM Start/Stop/Resume with stop generation tokens, guard ROI fast-path against maxDim overflow, switch hostclient early-event buffer to FIFO eviction, fix untyped nil Engine return, tighten negation & high-risk fuzzy matching, preserve ackedQemuErrors across RebootWindow resets, and re-orient/expire stale inherited running checkpoints. - Document verified Windows SDK IDL vtable slots for WinOCR (live-tested on Windows) and add regression tests across app, host, macosdriver, startprep, installer, and autoinstall packages. * fix(app,cli,host,macos,ui): address PR #134 second automated review findings - CLI & Desktop Control Channel: - Add __reims_host__ / autoinstall desktop control channel with data_root verification so CLI status, resume, and stop talk directly to the live desktop runner instead of splitting checkpoint state or launching doomed short-lived CLI runners. - Merge live runners with on-disk checkpoints when listing status without a VM argument. - App Sessions, Confirmations, Downloads & Telemetry: - Scope single-VM not_authorized errors to the target VM in handleSessionBegin and resolveComputerUseVM so active sessions on other VMs are not aborted. - Exclude stopped and suspended VMs from hasUnboundAgentSession fast-polling. - Revoke protected-phase grants when a VM disappears from poll results. - Require manifest Secret:true validation before storing auto-install passwords and remove the unsafe default account_password fallback. - Reject userinfo URLs in allow_custom_mirror, gate custom-mirror exemption strictly on plugin.ErrNetOriginNotDeclared, and keep redirect SSRF checks enabled on loopback custom mirrors. - Preserve VM telemetry milestones across suspend-resume and Win10 cold-reboot restarts while still resetting on fresh cold boots. - Log a warning when Guest Tools bridge is unavailable while preparing REIMSPROV. - Clarify CallHostAPI authorization/audit contract and add regression test proving built-in plugins enforce catalog permissions and audit logging. - Host Takeover & Guest Tools: - Track locked mouse button presses via a 5-button bitmask so ButtonUp events from drags started outside the VM window are never swallowed. - Align active-window-reporter.js permissions to 0o100755 across ToolsDiskFiles, ToolsProvisionFiles, and postinstall. - macOS Provisioning & Autoinstall Engine (OCR / Vision / Rules / Runner): - Never delete an unwiped REIMSPROV image on OpenFile/Write/Sync failure; persist wipe-pending marker and return error for retry. - Harden live postinstall preference writes with chmod 600, plutil -lint, chown, and cfprefsd flush. - Rewrite Windows RapidOCR C ABI structs and result extraction to match RapidAI/RapidOcrOnnx@675e73fe4c include/OcrLiteCApi.h:27-70 and src/OcrLiteCApi.cpp:12-160 (5-arg OcrInit verified). - Inspect PE32/PE32+ IMAGE_DIRECTORY_ENTRY_IMPORT directly to require onnxruntime.dll only for dynamically linked RapidOcrOnnx.dll builds. - Validate cfg.VM and use collision-free SHA-256-suffixed checkpoint paths with read fallback; redact PII/paths/UUIDs/MACs/IPs/tokens in diagnostic summaries; snapshot checkpoints before releasing r.mu for serialized disk I/O. - Add contrast/border/focus-ring ok return to DetectInputFieldNearLabel, enforce mask-dots verification in fillAccountForm and login screens, refuse blind password typing on clock-only lock screens, confirm shell readiness before typing install.sh, and prefer isolated button lines over modal prose in FindHit. - Frontend: - Require explicit Apple SLA confirmation in both recovery_only and full modes across AutoInstallPanel and CreateWizard, with unit tests in frontend/scripts/test-autoinstall.mjs. * fix(app,cli,host,macos,ui): address PR #134 third automated review findings Addresses all confirmed findings from Review #6204465334 (commit d516350) with targeted regression tests and hardens verified COM vtable bindings: - App & Session Lifecycle: - Track hostPaused separately in agentSession so plugin host/session.update (paused_for_user=false) cannot clear physical user takeover or explicit PauseAgentSession holds; only host ResumeAgentSession or timed takeover expiry clears them. - Give each auto-install session watcher a monotonic watchGen + cancelable child context so restarting/resuming auto-install on the same VM cancels any superseded watcher and prevents stale timeout or secret cleanup. - Bound fast 500ms unbound-PID discovery for running VMs to sessionDiscoverGraceWindow via unboundSince (refreshed on restart/rebind). - Keep non-blocking buffered confirm resolution send inside confirmMu for clear mutual exclusion with cancelPendingConfirmations. - Clear cold-reboot telemetry preserveNextBoot via defer on all early-return and StartVM-failure paths in watchColdReboot. - Rebuild REIMSPROV with current StartAutoInstall credentials (preserving install_guest_tools) whenever VM is stopped instead of reusing stale images. - CLI & macOS Provisioning / StartPrep: - Refuse `vm provision --clear` and overwriting existing REIMSPROV while the VM is running or paused. - Guard live "/" root in postinstall against macOS Recovery/Installer (/System/Installation/CDIS), forbid "/" in provision-offline.sh, and scope chmod 644 strictly to com.apple.keyboardtype.plist. - Reject unknown -* options in REIMSHELP/install.sh (including after --erase). - Defer clearing the one-shot REIMSPROV staged marker until after setExtraArgs (startprep) and StartWithCompat (macosdriver) succeed. - Preserve pending RestartFrom guards in AdvancePostInstallHandoff when checkpoint is already at StepDesktop. - Host Input & Session Overlay: - Filter injected keyboard events (LLKHF_INJECTED / LLKHF_LOWER_IL_INJECTED) in locked-input mode consistently with the mouse hook. - Clean up exited overlay entries in entry.run() and recreate dead entries on Manager.Upsert when CreateWindowExW fails or exits early. - Cache the static island base surface (shell + icons + DirectWrite text) and measured text metrics across breathing frames, raising timerBreathMs to 100ms. - Replace magic Direct2D/DirectWrite vtable indices with named d2d1.h / dwrite.h constants, check EndDraw HRESULT, and add a live Windows DirectWrite rendering smoke test. - Autoinstall OCR, Rules, Watchdog & Runner: - Persist and verify a per-file SHA-256 manifest.json in <dataDir>/ocr/ before loading RapidOcrOnnx.dll / onnxruntime.dll; reject duplicate whitelisted basenames in offline zip imports. - Signal WinOCREngine.Close() before acquiring e.mu and add bounded wait + channel wakeup in Recognize so Close() immediately cancels in-flight OCR. - Fall back to installed RapidOCR when WinOCR initialization fails in Open(), and distinguish needs_rapidocr_import from needs_rapidocr_download in Probe. - Pause instead of pressing Return when post-TypeSecret login screenshot fails. - Re-baseline ColdRebootCount in Watchdog.ResetRebootWindow / ResetAfterResume. - Tighten recovery.main specificity (drop bare "Disk Utility"), guard 4-5 char pure-ASCII needles from sliding-window fuzzy collisions, use Unicode word boundaries for short names (<4 runes) in RedactDiagnosticText, and honor rule verify.wait_change_ms with early exit on visual frame diff. * fix(autoinstall): handle CJK short-name redaction, sh-3.2 prompt bound, and OCR re-import pruning
837 lines
33 KiB
Go
837 lines
33 KiB
Go
// Package plugin implements the Reims-Go plugin kernel: unified extension
|
|
// registry, reversible scopes, dependency-driven reconciliation, hook dispatch,
|
|
// start-intent argument ownership ledger, package lifecycle, security broker,
|
|
// L1 declarative rules, and L3 Sidecar supervision.
|
|
package plugin
|
|
|
|
import (
|
|
"encoding/json"
|
|
"sort"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/Nwflower/reims-go/internal/i18n"
|
|
"github.com/Nwflower/reims-go/pkg/pluginproto"
|
|
)
|
|
|
|
const (
|
|
// PluginAPIVersion is the host plugin API contract version (SemVer).
|
|
PluginAPIVersion = "1.3.0"
|
|
// UIAPIVersion is the frontend UI contract version (SemVer); the contract
|
|
// itself lives in frontend/src/styles/ui-contract.ts (§5.1, §6.3).
|
|
UIAPIVersion = "2.2.0"
|
|
// BridgeAPIVersion is the plugin view/panel bridge protocol version (§5.6);
|
|
// methods are listed in BridgeMethodCatalog.
|
|
BridgeAPIVersion = "1.0.0"
|
|
// ManifestSchemaVersion is the current plugin.json schema version.
|
|
ManifestSchemaVersion = 1
|
|
)
|
|
|
|
// State represents the runtime lifecycle state of a plugin (§4.1).
|
|
type State string
|
|
|
|
const (
|
|
StateOff State = "off"
|
|
StatePending State = "pending"
|
|
StateActive State = "active"
|
|
StateDegraded State = "degraded"
|
|
StateFailed State = "failed"
|
|
)
|
|
|
|
// TrustLevel classifies the provenance and signature trust of a plugin (§7.2).
|
|
type TrustLevel string
|
|
|
|
const (
|
|
TrustOfficial TrustLevel = "official"
|
|
TrustVerified TrustLevel = "verified"
|
|
TrustCommunity TrustLevel = "community"
|
|
TrustDev TrustLevel = "dev"
|
|
)
|
|
|
|
// Tier identifies the execution isolation layer derived from package contents (§3.1).
|
|
type Tier string
|
|
|
|
const (
|
|
TierBuiltin Tier = "builtin"
|
|
TierL1 Tier = "L1"
|
|
TierRuntime Tier = "runtime"
|
|
TierL2 Tier = "L2"
|
|
TierL3 Tier = "L3"
|
|
TierL4 Tier = "L4"
|
|
)
|
|
|
|
// SourceKind distinguishes where a plugin came from.
|
|
type SourceKind string
|
|
|
|
const (
|
|
SourceBuiltin SourceKind = "builtin"
|
|
SourceBundled SourceKind = "bundled"
|
|
SourceLocal SourceKind = "local"
|
|
SourceMarket SourceKind = "market"
|
|
SourceDevLink SourceKind = "dev"
|
|
)
|
|
|
|
// LocalizedText holds localized strings readable without executing code (§6.2).
|
|
// ZhCN and EnUS remain first-class fields for backward compatibility; any other
|
|
// BCP-47 locale tags (e.g. "ja-JP", "zh-TW") are stored in Extra.
|
|
type LocalizedText struct {
|
|
ZhCN string `json:"zh-CN,omitempty"`
|
|
EnUS string `json:"en-US,omitempty"`
|
|
Extra map[string]string `json:"extra,omitempty"`
|
|
}
|
|
|
|
// HasAny reports whether at least one localized string is non-empty.
|
|
func (lt LocalizedText) HasAny() bool {
|
|
if lt.ZhCN != "" || lt.EnUS != "" {
|
|
return true
|
|
}
|
|
for _, v := range lt.Extra {
|
|
if strings.TrimSpace(v) != "" {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Get returns the best localized string for locale using Reims-Go's multi-hop
|
|
// fallback chain (e.g. zh-HK -> zh-TW -> zh-CN -> en-US) and en-XA pseudo-locale.
|
|
func (lt LocalizedText) Get(locale string) string {
|
|
chain := i18n.FallbackChain(i18n.ResolveLocale(locale))
|
|
for _, step := range chain {
|
|
switch step {
|
|
case i18n.EnXA:
|
|
base := lt.EnUS
|
|
if base == "" {
|
|
base = lt.ZhCN
|
|
}
|
|
if base != "" {
|
|
return i18n.PseudoLocalize(base)
|
|
}
|
|
case i18n.ZhCN:
|
|
if lt.ZhCN != "" {
|
|
return lt.ZhCN
|
|
}
|
|
case i18n.EnUS:
|
|
if lt.EnUS != "" {
|
|
return lt.EnUS
|
|
}
|
|
default:
|
|
if v := lt.Extra[string(step)]; v != "" {
|
|
return v
|
|
}
|
|
}
|
|
}
|
|
if len(lt.Extra) > 0 {
|
|
keys := make([]string, 0, len(lt.Extra))
|
|
for k := range lt.Extra {
|
|
keys = append(keys, k)
|
|
}
|
|
sort.Strings(keys)
|
|
for _, k := range keys {
|
|
if v := lt.Extra[k]; v != "" {
|
|
return v
|
|
}
|
|
}
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// SetIfEmpty assigns a localized value only when the target locale slot is empty.
|
|
func (lt *LocalizedText) SetIfEmpty(locale, val string) {
|
|
if lt == nil || strings.TrimSpace(val) == "" {
|
|
return
|
|
}
|
|
canon, ok := i18n.ParseLocale(locale)
|
|
if !ok {
|
|
return
|
|
}
|
|
switch canon {
|
|
case i18n.ZhCN:
|
|
if lt.ZhCN == "" {
|
|
lt.ZhCN = val
|
|
}
|
|
case i18n.EnUS:
|
|
if lt.EnUS == "" {
|
|
lt.EnUS = val
|
|
}
|
|
default:
|
|
if lt.Extra[string(canon)] == "" {
|
|
if lt.Extra == nil {
|
|
lt.Extra = make(map[string]string)
|
|
}
|
|
lt.Extra[string(canon)] = val
|
|
}
|
|
}
|
|
}
|
|
|
|
// Set assigns a localized value for a canonical BCP-47 locale tag.
|
|
func (lt *LocalizedText) Set(locale, val string) {
|
|
if lt == nil || strings.TrimSpace(val) == "" {
|
|
return
|
|
}
|
|
canon, ok := i18n.ParseLocale(locale)
|
|
if !ok {
|
|
return
|
|
}
|
|
switch canon {
|
|
case i18n.ZhCN:
|
|
lt.ZhCN = val
|
|
case i18n.EnUS:
|
|
lt.EnUS = val
|
|
default:
|
|
if lt.Extra == nil {
|
|
lt.Extra = make(map[string]string)
|
|
}
|
|
lt.Extra[string(canon)] = val
|
|
}
|
|
}
|
|
|
|
// UnmarshalJSON accepts a plain string or an object {"zh-CN": ..., "en-US": ..., "<bcp47>": ...}.
|
|
func (lt *LocalizedText) UnmarshalJSON(data []byte) error {
|
|
var plain string
|
|
if err := json.Unmarshal(data, &plain); err == nil {
|
|
lt.ZhCN = plain
|
|
lt.EnUS = plain
|
|
lt.Extra = nil
|
|
return nil
|
|
}
|
|
var raw map[string]json.RawMessage
|
|
if err := json.Unmarshal(data, &raw); err != nil {
|
|
return err
|
|
}
|
|
out := LocalizedText{}
|
|
for k, v := range raw {
|
|
if k == "extra" {
|
|
var extra map[string]string
|
|
if err := json.Unmarshal(v, &extra); err == nil {
|
|
for ek, ev := range extra {
|
|
out.Set(ek, ev)
|
|
}
|
|
}
|
|
continue
|
|
}
|
|
var s string
|
|
if err := json.Unmarshal(v, &s); err != nil || s == "" {
|
|
continue
|
|
}
|
|
out.Set(k, s)
|
|
}
|
|
*lt = out
|
|
return nil
|
|
}
|
|
|
|
// Engines specifies host compatibility ranges checked before install (§6.2).
|
|
type Engines struct {
|
|
ReimsGo string `json:"reims-go,omitempty"`
|
|
PluginAPI string `json:"pluginApi,omitempty"`
|
|
UIAPI string `json:"uiApi,omitempty"`
|
|
BridgeAPI string `json:"bridgeApi,omitempty"`
|
|
}
|
|
|
|
// Entry declares executable/script/panel entrypoints. Tier is inferred from this (§6.2).
|
|
type Entry struct {
|
|
Sidecar string `json:"sidecar,omitempty"`
|
|
Script string `json:"script,omitempty"`
|
|
PanelDir string `json:"panelDir,omitempty"`
|
|
UIScript string `json:"uiScript,omitempty"`
|
|
}
|
|
|
|
// ServiceRequirement declares a service dependency with an optional SemVer range.
|
|
type ServiceRequirement struct {
|
|
Service string `json:"service"`
|
|
Version string `json:"version,omitempty"`
|
|
Optional bool `json:"optional,omitempty"`
|
|
}
|
|
|
|
// ServiceProvision declares a service provided by a plugin.
|
|
type ServiceProvision struct {
|
|
Service string `json:"service"`
|
|
Version string `json:"version"`
|
|
}
|
|
|
|
// Provenance records upstream build and source archive metadata (mandatory for runtime packages).
|
|
type Provenance struct {
|
|
UpstreamRepo string `json:"upstreamRepo,omitempty"`
|
|
Commit string `json:"commit,omitempty"`
|
|
Patches []string `json:"patches,omitempty"`
|
|
PatchHashes []string `json:"patchHashes,omitempty"`
|
|
SourcePackage string `json:"sourcePackage,omitempty"`
|
|
}
|
|
|
|
// Manifest is the declarative plugin.json descriptor (§6.2).
|
|
type Manifest struct {
|
|
Schema int `json:"schema"`
|
|
ID string `json:"id"`
|
|
Version string `json:"version"`
|
|
Name LocalizedText `json:"name"`
|
|
Description LocalizedText `json:"description"`
|
|
Publisher string `json:"publisher,omitempty"`
|
|
License string `json:"license,omitempty"`
|
|
Homepage string `json:"homepage,omitempty"`
|
|
Icon *PluginIcon `json:"icon,omitempty"`
|
|
Engines Engines `json:"engines,omitempty"`
|
|
Platforms []string `json:"platforms,omitempty"`
|
|
L10n string `json:"l10n,omitempty"` // relative directory holding <locale>.json bundles for plugin:<id>:*
|
|
Entry Entry `json:"entry,omitempty"`
|
|
Contributes Contributes `json:"contributes,omitempty"`
|
|
Requires []ServiceRequirement `json:"requires,omitempty"`
|
|
Provides []ServiceProvision `json:"provides,omitempty"`
|
|
Permissions []string `json:"permissions,omitempty"`
|
|
Activation []string `json:"activation,omitempty"`
|
|
Settings *SettingsSchema `json:"settings,omitempty"`
|
|
DefaultEnabled bool `json:"defaultEnabled,omitempty"`
|
|
Provenance *Provenance `json:"provenance,omitempty"`
|
|
}
|
|
|
|
// InferTier derives the plugin's execution tier from manifest contents (never trusting self-claims).
|
|
func (m Manifest) InferTier(isBuiltin bool) Tier {
|
|
if isBuiltin {
|
|
return TierBuiltin
|
|
}
|
|
if strings.TrimSpace(m.Entry.Sidecar) != "" {
|
|
return TierL3
|
|
}
|
|
if strings.TrimSpace(m.Entry.Script) != "" {
|
|
return TierL2
|
|
}
|
|
if strings.TrimSpace(m.Entry.PanelDir) != "" || len(m.Contributes.Panels) > 0 || len(m.Contributes.ImageSources) > 0 {
|
|
return TierL4
|
|
}
|
|
if len(m.Contributes.Runtimes) > 0 {
|
|
return TierRuntime
|
|
}
|
|
return TierL1
|
|
}
|
|
|
|
// Contributes enumerates all extension-point declarations in plugin.json (§4.2).
|
|
type Contributes struct {
|
|
Themes []ThemeContribution `json:"themes,omitempty"`
|
|
Channels []ChannelContribution `json:"channels,omitempty"`
|
|
UIScripts []UIScriptContribution `json:"uiScripts,omitempty"`
|
|
Locales []LocaleContribution `json:"locales,omitempty"`
|
|
InputFilters []InputFilterContribution `json:"inputFilters,omitempty"`
|
|
VMTemplates []VMTemplateContribution `json:"vmTemplates,omitempty"`
|
|
RuntimeSources []RuntimeSourceContribution `json:"runtimeSources,omitempty"`
|
|
RuntimeKinds []RuntimeKindContribution `json:"runtimeKinds,omitempty"`
|
|
Runtimes []RuntimePackContribution `json:"runtimes,omitempty"`
|
|
GuestDrivers []GuestDriverContribution `json:"guestDrivers,omitempty"`
|
|
Downloaders []DownloaderContribution `json:"downloaders,omitempty"`
|
|
Hooks []HookContribution `json:"hooks,omitempty"`
|
|
RuleHooks []RuleHook `json:"ruleHooks,omitempty"`
|
|
Commands []CommandContribution `json:"commands,omitempty"`
|
|
Menus []MenuContribution `json:"menus,omitempty"`
|
|
VMCards []VMCardContribution `json:"vmCards,omitempty"`
|
|
SettingsPages []SettingsPageContribution `json:"settingsPages,omitempty"`
|
|
StatusItems []StatusItemContribution `json:"statusItems,omitempty"`
|
|
Panels []PanelContribution `json:"panels,omitempty"`
|
|
ImageSources []ImageSourceContribution `json:"imageSources,omitempty"`
|
|
AutoInstallers []AutoInstallerContribution `json:"autoInstallers,omitempty"`
|
|
Views []ViewContribution `json:"views,omitempty"`
|
|
Diagnostics []DiagnosticsContribution `json:"diagnostics,omitempty"`
|
|
}
|
|
|
|
// ChannelContribution declares a framed message channel exposed through
|
|
// `reims-go plugin connect`. The host validates the declaration before it
|
|
// forwards any client data to the Sidecar.
|
|
type ChannelContribution struct {
|
|
ID string `json:"id"`
|
|
Framing string `json:"framing"`
|
|
}
|
|
|
|
// DownloaderContribution registers a pluggable file/region downloader (Builtin or L3 Sidecar).
|
|
type DownloaderContribution struct {
|
|
ID string `json:"id"`
|
|
Name LocalizedText `json:"name"`
|
|
Priority int `json:"priority,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// ThemeContribution describes a L1 token/style theme or tier-3 interactive theme (§5.1).
|
|
type ThemeContribution struct {
|
|
ID string `json:"id"`
|
|
Name LocalizedText `json:"name"`
|
|
Description LocalizedText `json:"description,omitempty"`
|
|
Appearance string `json:"appearance,omitempty"` // "light" | "dark" | "both"
|
|
Seeds map[string]string `json:"seeds,omitempty"`
|
|
Schemes []ThemeScheme `json:"schemes,omitempty"`
|
|
DeriveRules []TokenDeriveRule `json:"deriveRules,omitempty"`
|
|
Tokens map[string]string `json:"tokens,omitempty"`
|
|
DarkTokens map[string]string `json:"darkTokens,omitempty"`
|
|
Fonts []ThemeFont `json:"fonts,omitempty"`
|
|
Icons map[string]string `json:"icons,omitempty"`
|
|
BrandMark string `json:"brandMark,omitempty"`
|
|
Background string `json:"background,omitempty"`
|
|
Stylesheet string `json:"stylesheet,omitempty"` // relative path inside package
|
|
Decorations []ThemeDecoration `json:"decorations,omitempty"`
|
|
UIScript string `json:"uiScript,omitempty"` // requires ui:script
|
|
Layout *ThemeLayout `json:"layout,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// ThemeScheme is a named seed-color preset inside a theme pack.
|
|
type ThemeScheme struct {
|
|
ID string `json:"id"`
|
|
Name LocalizedText `json:"name"`
|
|
Appearance string `json:"appearance,omitempty"` // "light" | "dark" | "both"
|
|
Seeds map[string]string `json:"seeds"`
|
|
}
|
|
|
|
// TokenDeriveRule derives a CSS custom property from a seed color using
|
|
// declarative lightness/chroma/alpha adjustments per light/dark appearance.
|
|
type TokenDeriveRule struct {
|
|
Token string `json:"token"`
|
|
FromSeed string `json:"fromSeed"`
|
|
Appearance string `json:"appearance,omitempty"` // "" (both) | "light" | "dark"
|
|
Lightness float64 `json:"lightness,omitempty"` // delta in [-1, 1]
|
|
Chroma float64 `json:"chroma,omitempty"` // scale multiplier (0 = unchanged)
|
|
Alpha float64 `json:"alpha,omitempty"` // 0 = opaque / unchanged, (0,1] sets alpha
|
|
}
|
|
|
|
// ThemeFont declares a bundled font face.
|
|
type ThemeFont struct {
|
|
Family string `json:"family"`
|
|
File string `json:"file"`
|
|
Weight string `json:"weight,omitempty"`
|
|
Style string `json:"style,omitempty"`
|
|
UnicodeRange string `json:"unicodeRange,omitempty"`
|
|
}
|
|
|
|
// ThemeDecoration defines a declarative state-driven sprite/frame decoration anchored to a slot.
|
|
type ThemeDecoration struct {
|
|
ID string `json:"id"`
|
|
Slot string `json:"slot"` // e.g. "sidebar.footer", "vm.preview.br"
|
|
Width int `json:"width,omitempty"`
|
|
Height int `json:"height,omitempty"`
|
|
Alt LocalizedText `json:"alt,omitempty"`
|
|
States []ThemeDecorationState `json:"states"`
|
|
}
|
|
|
|
// ThemeDecorationState maps a state expression (e.g. "vmState==running") to a static/animated asset.
|
|
type ThemeDecorationState struct {
|
|
When string `json:"when"` // "default", "vmState==running", "busy==true", etc.
|
|
Asset string `json:"asset,omitempty"`
|
|
Frames []string `json:"frames,omitempty"`
|
|
FPS int `json:"fps,omitempty"`
|
|
}
|
|
|
|
// UIScriptContribution registers a trusted interactive theme script.
|
|
type UIScriptContribution struct {
|
|
ID string `json:"id"`
|
|
ThemeID string `json:"themeId"`
|
|
Script string `json:"script"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// PluginManifestOverride translates manifest metadata of a target third-party plugin.
|
|
type PluginManifestOverride struct {
|
|
Name string `json:"name,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
Fields map[string]string `json:"fields,omitempty"` // "settingKey.title", "settingKey.description", "commandId.title", etc.
|
|
}
|
|
|
|
// PluginLocaleOverride allows an independent Language Pack plugin to localize
|
|
// another plugin's manifest metadata and private message namespace (VS Code style).
|
|
type PluginLocaleOverride struct {
|
|
Manifest *PluginManifestOverride `json:"manifest,omitempty"`
|
|
ManifestFile string `json:"manifestFile,omitempty"`
|
|
Messages map[string]string `json:"messages,omitempty"`
|
|
MessagesFile string `json:"messagesFile,omitempty"`
|
|
}
|
|
|
|
// ResolvedLocaleFont is a ready-to-load @font-face descriptor served via AssetServer.
|
|
type ResolvedLocaleFont struct {
|
|
Family string `json:"family"`
|
|
URL string `json:"url"`
|
|
Weight string `json:"weight,omitempty"`
|
|
Style string `json:"style,omitempty"`
|
|
UnicodeRange string `json:"unicodeRange,omitempty"`
|
|
}
|
|
|
|
// LocaleContribution registers additional UI and/or backend/CLI translations,
|
|
// optional bundled CJK/regional WebFonts, and cross-plugin translation overrides.
|
|
type LocaleContribution struct {
|
|
Locale string `json:"locale"`
|
|
Label string `json:"label,omitempty"`
|
|
Fallback string `json:"fallback,omitempty"`
|
|
Priority int `json:"priority,omitempty"`
|
|
File string `json:"file,omitempty"`
|
|
BackendFile string `json:"backendFile,omitempty"`
|
|
Files map[string]string `json:"files,omitempty"` // domain -> relative JSON path (core, vm, wizard, settings, plugins, native, macosGlossary)
|
|
Messages map[string]string `json:"messages,omitempty"`
|
|
Backend map[string]string `json:"backend,omitempty"`
|
|
Fonts []ThemeFont `json:"fonts,omitempty"`
|
|
PluginOverrides map[string]PluginLocaleOverride `json:"pluginOverrides,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
TrustRank int `json:"-"`
|
|
}
|
|
|
|
// ResolvedLocalePack is the merged, ready-to-use UI language pack contributed
|
|
// by one or more active plugins for a single canonical locale tag.
|
|
type ResolvedLocalePack struct {
|
|
Locale string `json:"locale"`
|
|
Label string `json:"label"`
|
|
Fallback string `json:"fallback,omitempty"`
|
|
HasUIMessages bool `json:"has_ui_messages,omitempty"`
|
|
Messages map[string]string `json:"messages,omitempty"`
|
|
PluginMessages map[string]map[string]string `json:"plugin_messages,omitempty"`
|
|
Fonts []ResolvedLocaleFont `json:"fonts,omitempty"`
|
|
PluginIDs []string `json:"pluginIds,omitempty"`
|
|
}
|
|
|
|
// InputFilterContribution declares a host-side input filter rule (§5.4).
|
|
type InputFilterContribution struct {
|
|
ID string `json:"id"`
|
|
Event string `json:"event"` // "mouse_wheel"
|
|
Axis string `json:"axis,omitempty"` // "vertical" | "horizontal" | "both"
|
|
Transform string `json:"transform"` // "invert"
|
|
Scope string `json:"scope"` // "vm_foreground"
|
|
SettingKey string `json:"settingKey,omitempty"` // VM-scoped boolean key
|
|
HorizKey string `json:"horizontalKey,omitempty"`
|
|
VertKey string `json:"verticalKey,omitempty"`
|
|
Name LocalizedText `json:"name,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// VMTemplateContribution contributes a VM creation preset.
|
|
type VMTemplateContribution struct {
|
|
ID string `json:"id"`
|
|
DriverID string `json:"driverId,omitempty"`
|
|
Name LocalizedText `json:"name"`
|
|
Description LocalizedText `json:"description,omitempty"`
|
|
Defaults map[string]any `json:"defaults,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// RuntimeSourceContribution contributes an additional runtime download mirror/source.
|
|
type RuntimeSourceContribution struct {
|
|
ID string `json:"id"`
|
|
Kind string `json:"kind"`
|
|
Name LocalizedText `json:"name"`
|
|
IndexURL string `json:"indexUrl"`
|
|
Channel string `json:"channel,omitempty"`
|
|
License string `json:"license,omitempty"`
|
|
Publisher string `json:"publisher,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// RuntimeKindContribution registers a new runtime kind (e.g. "qemu-ovmf").
|
|
type RuntimeKindContribution struct {
|
|
Kind string `json:"kind"`
|
|
Name LocalizedText `json:"name"`
|
|
Description LocalizedText `json:"description,omitempty"`
|
|
RequiredFiles []string `json:"requiredFiles,omitempty"`
|
|
DefaultAPIVer string `json:"defaultApiVersion,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// RuntimePackContribution declares an archive/binary runtime package inside a plugin.
|
|
type RuntimePackContribution struct {
|
|
Kind string `json:"kind"`
|
|
Version string `json:"version"`
|
|
RuntimeAPI string `json:"runtimeApi"`
|
|
Capabilities []string `json:"capabilities,omitempty"`
|
|
Dir string `json:"dir,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// GuestDriverContribution declares a guest VM driver provided by an L3 Sidecar or builtin.
|
|
type GuestDriverContribution struct {
|
|
ID string `json:"id"`
|
|
Name LocalizedText `json:"name"`
|
|
Description LocalizedText `json:"description,omitempty"`
|
|
RuntimeKind string `json:"runtimeKind"`
|
|
RuntimeAPIRange string `json:"runtimeApiRange,omitempty"`
|
|
Capabilities []string `json:"capabilities,omitempty"`
|
|
VMRoots []string `json:"vmRoots,omitempty"` // slash-separated paths relative to DataRoot
|
|
CreateSchema *SettingsSchema `json:"createSchema,omitempty"`
|
|
SettingsSchema *SettingsSchema `json:"settingsSchema,omitempty"`
|
|
// ConsoleEndpoint selects who serves screenshots and input: "qmp" (the
|
|
// host's QMP proxy, default) or "driver". Experimental until the console
|
|
// router lands.
|
|
ConsoleEndpoint string `json:"consoleEndpoint,omitempty"`
|
|
// PasteCombo is the key combination that pastes in the guest, such as
|
|
// "meta_l+v" or "ctrl+v".
|
|
PasteCombo string `json:"pasteCombo,omitempty"`
|
|
Keymap string `json:"keymap,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// VMRef identifies a VM by owning driver and name on the Sidecar wire.
|
|
type VMRef = pluginproto.VMRef
|
|
|
|
// VMEndpoint is one way to reach a guest, as a Sidecar reports it. The
|
|
// internal/driver package validates and acts on it.
|
|
type VMEndpoint = pluginproto.VMEndpoint
|
|
|
|
// GuestOSInfo describes the guest operating system on the Sidecar wire.
|
|
type GuestOSInfo = pluginproto.GuestOSInfo
|
|
|
|
// ReportedVMState is the payload of `host/vm.reportState`.
|
|
type ReportedVMState = pluginproto.ReportedVMState
|
|
|
|
// HookContribution subscribes a Sidecar or L2 script to a lifecycle event.
|
|
type HookContribution struct {
|
|
Event string `json:"event"`
|
|
Priority int `json:"priority,omitempty"`
|
|
Blocking bool `json:"blocking,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// CommandContribution exposes a command callable via CLI (`plugin run`) or GUI menu.
|
|
type CommandContribution struct {
|
|
ID string `json:"id"`
|
|
Title LocalizedText `json:"title"`
|
|
Description LocalizedText `json:"description,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// MenuContribution contributes a button/menu item to a declared UI slot (e.g. vm.toolbar).
|
|
type MenuContribution struct {
|
|
ID string `json:"id"`
|
|
Slot string `json:"slot"` // "vm.toolbar"
|
|
Command string `json:"command"`
|
|
Title LocalizedText `json:"title"`
|
|
When string `json:"when,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// VMCardContribution contributes key-value info to `vm.card`.
|
|
type VMCardContribution struct {
|
|
ID string `json:"id"`
|
|
Title LocalizedText `json:"title"`
|
|
Value LocalizedText `json:"value,omitempty"`
|
|
Badge string `json:"badge,omitempty"` // "ok" | "warn" | "idle" | "error"
|
|
When string `json:"when,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// SettingsPageContribution declares a plugin settings group.
|
|
type SettingsPageContribution struct {
|
|
ID string `json:"id"`
|
|
Title LocalizedText `json:"title"`
|
|
Group string `json:"group,omitempty"` // e.g. "keyboard", "collaboration", "general"
|
|
Scope string `json:"scope,omitempty"` // "app" | "vm"
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// StatusItemContribution contributes an item to `statusbar.right`.
|
|
type StatusItemContribution struct {
|
|
ID string `json:"id"`
|
|
Slot string `json:"slot"` // "statusbar.right"
|
|
Text LocalizedText `json:"text"`
|
|
Tooltip LocalizedText `json:"tooltip,omitempty"`
|
|
Command string `json:"command,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// PanelContribution declares an L4 sandboxed iframe panel in a declared slot.
|
|
type PanelContribution struct {
|
|
ID string `json:"id"`
|
|
Slot string `json:"slot"` // "settings.plugin" | "vm.card" | "sidebar.footer"
|
|
Title LocalizedText `json:"title"`
|
|
Entry string `json:"entry"` // relative HTML file under entry.panelDir
|
|
Height int `json:"height,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// ImageSourceContribution registers a tab entry in the top-level Images page
|
|
// segmented control. External plugins provide a sandboxed L4 iframe Entry under
|
|
// entry.panelDir; compiled-in builtins may set Native to mount a host view.
|
|
type ImageSourceContribution struct {
|
|
ID string `json:"id"`
|
|
Title LocalizedText `json:"title"`
|
|
Description LocalizedText `json:"description,omitempty"`
|
|
Order int `json:"order,omitempty"`
|
|
Entry string `json:"entry,omitempty"`
|
|
Height int `json:"height,omitempty"`
|
|
Native string `json:"native,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// AutoInstallerContribution declares a built-in or Sidecar-backed unattended
|
|
// guest installer (such as local-vision macOS setup). Host UI and CLI discover
|
|
// enabled contributions by guest family and leave zero residue when disabled.
|
|
type AutoInstallerContribution struct {
|
|
ID string `json:"id"`
|
|
Title LocalizedText `json:"title"`
|
|
Description LocalizedText `json:"description,omitempty"`
|
|
GuestFamilies []string `json:"guestFamilies"`
|
|
RequiresOfflineInstaller bool `json:"requiresOfflineInstaller,omitempty"`
|
|
SecretSetting string `json:"secretSetting,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// ViewContribution declares a sandboxed iframe view with its own page, tab or
|
|
// dialog (§5.6). Entry is relative to entry.panelDir; Location is one of
|
|
// ViewLocationCatalog.
|
|
type ViewContribution struct {
|
|
ID string `json:"id"`
|
|
Title LocalizedText `json:"title"`
|
|
Icon string `json:"icon,omitempty"` // packaged monochrome SVG, tinted by the host
|
|
Location string `json:"location"` // "sidebar" | "vm.tab" | "settings" | "dialog"
|
|
Entry string `json:"entry"`
|
|
Order int `json:"order,omitempty"`
|
|
When string `json:"when,omitempty"`
|
|
MinWidth int `json:"minWidth,omitempty"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// ThemeLayout declares layout options of a theme (§5.1). Values come from
|
|
// ThemeLayoutCatalog; they move and size regions but never hide operation entries.
|
|
type ThemeLayout struct {
|
|
SidebarPosition string `json:"sidebarPosition,omitempty"`
|
|
SidebarMode string `json:"sidebarMode,omitempty"`
|
|
Density string `json:"density,omitempty"`
|
|
Titlebar string `json:"titlebar,omitempty"`
|
|
}
|
|
|
|
// DiagnosticsContribution declares a diagnostics collector.
|
|
type DiagnosticsContribution struct {
|
|
ID string `json:"id"`
|
|
Title LocalizedText `json:"title"`
|
|
PluginID string `json:"pluginId,omitempty"`
|
|
}
|
|
|
|
// SettingsSchema is a JSON Schema subset with Reims-Go extensions (§6.2).
|
|
type SettingsSchema struct {
|
|
Title LocalizedText `json:"title,omitempty"`
|
|
Group string `json:"x-group,omitempty"` // e.g. "keyboard", "collaboration"
|
|
Scope string `json:"x-scope,omitempty"` // "app" | "vm" | "both"
|
|
Properties map[string]SettingProperty `json:"properties"`
|
|
Order []string `json:"x-order,omitempty"`
|
|
}
|
|
|
|
// SettingProperty describes one configurable field.
|
|
type SettingProperty struct {
|
|
Type string `json:"type"` // "boolean" | "string" | "number" | "integer"
|
|
FilePattern string `json:"x-filePattern,omitempty"` // native picker for built-in create forms only
|
|
Title LocalizedText `json:"title"`
|
|
Description LocalizedText `json:"description,omitempty"`
|
|
Default any `json:"default,omitempty"`
|
|
Enum []string `json:"enum,omitempty"`
|
|
EnumLabels []LocalizedText `json:"x-enumLabels,omitempty"`
|
|
Minimum *float64 `json:"minimum,omitempty"`
|
|
Maximum *float64 `json:"maximum,omitempty"`
|
|
Secret bool `json:"x-secret,omitempty"`
|
|
Effect string `json:"x-effect,omitempty"` // "immediate" | "next_start"
|
|
Scope string `json:"x-scope,omitempty"` // "app" | "vm" | "both"
|
|
Group string `json:"x-group,omitempty"` // VM settings section id
|
|
Required bool `json:"required,omitempty"`
|
|
}
|
|
|
|
// PermissionLevel categorizes permission risk (§7.1).
|
|
type PermissionLevel string
|
|
|
|
const (
|
|
PermLow PermissionLevel = "low"
|
|
PermMedium PermissionLevel = "medium"
|
|
PermHigh PermissionLevel = "high"
|
|
PermForbidden PermissionLevel = "forbidden"
|
|
)
|
|
|
|
// PermissionSpec classifies a declared permission string.
|
|
type PermissionSpec struct {
|
|
Name string `json:"name"`
|
|
Level PermissionLevel `json:"level"`
|
|
}
|
|
|
|
// ClassifyPermission returns the risk tier of a permission per §7.1.
|
|
func ClassifyPermission(perm string) PermissionLevel {
|
|
p := strings.TrimSpace(perm)
|
|
switch p {
|
|
case "vm:read", "ui:notify", "task:progress", "fs:plugin_data", "log:read":
|
|
return PermLow
|
|
case "vm:intent", "runtime:source", "ui:slot", "input:filter", "fs:pick":
|
|
return PermMedium
|
|
case "driver:vm", "runtime:provider", "process:spawn", "vm:control", "vm:screen",
|
|
"qmp:write", "fs:vm_dir", "fs:shared", "host:clipboard", "ui:script":
|
|
return PermHigh
|
|
}
|
|
if strings.HasPrefix(p, "net:") && len(p) > len("net:") {
|
|
return PermMedium
|
|
}
|
|
return PermForbidden
|
|
}
|
|
|
|
// HasHighRiskPermission returns all high-risk permissions in perms.
|
|
func HighRiskPermissions(perms []string) []string {
|
|
var out []string
|
|
for _, p := range perms {
|
|
if ClassifyPermission(p) == PermHigh {
|
|
out = append(out, p)
|
|
}
|
|
}
|
|
return out
|
|
}
|
|
|
|
// ForbiddenPermissions returns any unrecognized/forbidden permissions in perms.
|
|
func ForbiddenPermissions(perms []string) []string {
|
|
var out []string
|
|
for _, p := range perms {
|
|
if ClassifyPermission(p) == PermForbidden {
|
|
out = append(out, p)
|
|
}
|
|
}
|
|
return out
|
|
}
|
|
|
|
// DeclaredUISlots lists the host-declared UI slots and their max item caps
|
|
// (§4.2), derived from UISlotCatalog.
|
|
var DeclaredUISlots = func() map[string]int {
|
|
out := make(map[string]int, len(UISlotCatalog))
|
|
for id, spec := range UISlotCatalog {
|
|
out[id] = spec.Max
|
|
}
|
|
return out
|
|
}()
|
|
|
|
// IsDeclaredSlot checks whether slot is a host-recognized UI slot.
|
|
func IsDeclaredSlot(slot string) bool {
|
|
_, ok := UISlotCatalog[slot]
|
|
return ok
|
|
}
|
|
|
|
// PluginInfo is the read-only UI/CLI view of an installed or builtin plugin.
|
|
type PluginInfo struct {
|
|
ID string `json:"id"`
|
|
Version string `json:"version"`
|
|
Name LocalizedText `json:"name"`
|
|
Description LocalizedText `json:"description"`
|
|
Publisher string `json:"publisher,omitempty"`
|
|
License string `json:"license,omitempty"`
|
|
Homepage string `json:"homepage,omitempty"`
|
|
Icon *PluginIcon `json:"icon,omitempty"`
|
|
Source SourceKind `json:"source"`
|
|
Trust TrustLevel `json:"trust"`
|
|
Tier Tier `json:"tier"`
|
|
State State `json:"state"`
|
|
Enabled bool `json:"enabled"`
|
|
Removable bool `json:"removable"`
|
|
System bool `json:"system,omitempty"`
|
|
InUse bool `json:"in_use"`
|
|
Error string `json:"error,omitempty"`
|
|
DegradedReason string `json:"degraded_reason,omitempty"`
|
|
RuntimeWarning string `json:"runtime_warning,omitempty"`
|
|
Permissions []PermissionSpec `json:"permissions,omitempty"`
|
|
ApprovedPermissions []string `json:"approved_permissions,omitempty"`
|
|
NeedsApproval bool `json:"needs_approval"`
|
|
Risks []string `json:"risks,omitempty"`
|
|
Locales []string `json:"locales,omitempty"` // UI languages the plugin contributes
|
|
Requires []string `json:"requires,omitempty"`
|
|
Provides []string `json:"provides,omitempty"`
|
|
Settings *SettingsSchema `json:"settings,omitempty"`
|
|
InstallDir string `json:"install_dir,omitempty"`
|
|
EntryHash string `json:"entry_hash,omitempty"`
|
|
EntryPath string `json:"entry_path,omitempty"`
|
|
LogPath string `json:"log_path,omitempty"`
|
|
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
|
}
|
|
|
|
// DiagnosticsEntry is one redacted diagnostic section contributed by a plugin.
|
|
type DiagnosticsEntry struct {
|
|
PluginID string `json:"plugin_id"`
|
|
Title string `json:"title"`
|
|
Data map[string]any `json:"data,omitempty"`
|
|
Text string `json:"text,omitempty"`
|
|
}
|