Documentation
¶
Index ¶
- Constants
- func PlatformDisplayName(platform string) string
- type AITool
- type AgentSkill
- type AgentSkillScanInfo
- type BrewPackage
- type BrewScanResult
- type BrowserCoverage
- type BrowserExtensionFinding
- type BrowserExtensionScanInfo
- type BunAudit
- type BunConfigFile
- type BunSection
- type ConditionResult
- type CredentialError
- type CredentialFinding
- type CredentialScanInfo
- type Device
- type EvaluatedRule
- type Extension
- type FileAttrs
- type GroupResult
- type IDE
- type MCPConfig
- type MCPConfigEnterprise
- type MachineResources
- type NPMRCAudit
- type NPMRCEffective
- type NPMRCEntry
- type NPMRCEnvVar
- type NPMRCFile
- type NodePackage
- type NodeScanResult
- type PackageDetail
- type PipAudit
- type PipConfigFile
- type PipEffective
- type PipEnvVar
- type PipFinding
- type PipKeyValue
- type PipNetrcStatus
- type PipSection
- type PkgManager
- type PnpmAudit
- type PnpmEffective
- type ProjectInfo
- type PythonPackage
- type PythonScanResult
- type RemovedProjectRef
- type RuleFileMatch
- type RuleResult
- type RuleScan
- type ScanResult
- type Summary
- type SystemPackage
- type SystemPackageScanResult
- type UnchangedGlobalRef
- type UnchangedProjectRef
- type YarnAudit
- type YarnConfigFile
- type YarnEntry
Constants ¶
const ( // Membership complete, every attribute parsed. Zero extensions is a real // answer, not a missing one. BrowserCoverageScanned = "scanned" // Membership complete, one or more attributes degraded. Still authoritative. BrowserCoveragePartial = "partial" // Membership not known complete. Findings for this browser are dropped before // the payload is built, and a reader keeps whatever it already stored. BrowserCoverageFailed = "failed" // No data directory for this browser exists, or one exists holding no // installation. BrowserCoverageNotPresent = "not_present" )
Coverage statuses, one per browser attempted. They answer whether the set of extension identities reported for that browser is the whole set, not whether every attribute parsed.
const ( BrowserExtReasonRefusedTCC = "refused_tcc" BrowserExtReasonPermissionDenied = "permission_denied" BrowserExtReasonParseError = "parse_error" BrowserExtReasonUnsupportedEncoding = "unsupported_encoding" BrowserExtReasonSymlinkRejected = "symlink_rejected" BrowserExtReasonCapped = "capped" BrowserExtReasonTimedOut = "timed_out" )
Reason codes for a browser that could not be fully read. Typed rather than free text: a decoder's own message quotes the document it choked on, and these documents are the browser's private state.
const ( BrowserExtEnabled = "enabled" BrowserExtDisabled = "disabled" BrowserExtStateUnknown = "unknown" )
Enabled state. Enabled in any one profile counts as enabled: the extension can run on this machine.
const ( BrowserExtDisabledByUser = "user" BrowserExtDisabledByBrowser = "browser" BrowserExtDisabledByPolicy = "policy" BrowserExtDisabledByUnknown = "unknown" )
Who disabled it, set exactly when the state is disabled. The interesting case is not that an extension is off but that the browser turned it off.
const ( BrowserExtStoreListingListed = "listed" BrowserExtStoreListingDelisted = "delisted" BrowserExtStoreListingUnknown = "unknown" )
Whether the extension's store still lists it, from the browser's own cached belief refreshed on its update ping. Independent of enabled state, and delisted is a strong positive where listed is a weak negative.
const ( BrowserExtStoreViolationNone = "none" BrowserExtStoreViolationFlagged = "flagged" BrowserExtStoreViolationUnknown = "unknown" )
Whether the store recorded a policy violation against it.
const ( BrowserExtInstallUser = "user" BrowserExtInstallSideload = "sideload" BrowserExtInstallRegistry = "registry" BrowserExtInstallUnpacked = "unpacked" BrowserExtInstallPolicy = "policy" BrowserExtInstallUnknown = "unknown" )
How the extension got installed.
const ( BrowserExtStoreChromeWebStore = "chrome_web_store" BrowserExtStoreEdgeAddons = "edge_addons" BrowserExtStoreAMO = "amo" BrowserExtStoreSelfHosted = "self_hosted" BrowserExtStoreNone = "none" BrowserExtStoreUnknown = "unknown" )
Which store the extension is attributed to. An enum and never a URL: a self-hosted update server's hostname is internal infrastructure.
const ( BrowserExtSignedBroken = "broken" BrowserExtSignedUnknownChain = "unknown_chain" BrowserExtSignedMissing = "missing" BrowserExtSignedPreliminary = "preliminary" BrowserExtSignedSigned = "signed" BrowserExtSignedSystem = "system" BrowserExtSignedPrivileged = "privileged" )
Signing state, gecko only.
const ( BrowserExtTruncatedFindingCap = "finding_cap" BrowserExtTruncatedDeadline = "deadline" )
Why the result was cut short. Set exactly when Truncated is, and never for a file that failed its own byte cap: that fails one browser rather than shortening the payload.
const ( CredentialCategoryCloud = "cloud" CredentialCategorySourceControl = "source_control" CredentialCategoryPackageReg = "package_registry" CredentialCategoryContainers = "containers" CredentialCategoryInfrastructure = "infrastructure" )
Credential categories. The customer-facing grouping a finding rolls up to.
const ( // A usable secret in the clear. CredentialProtectionPlaintext = "plaintext" // Present but not usable as-is — passphrase-encrypted, hardware-backed, or // otherwise wrapped. CredentialProtectionProtected = "protected" )
Protection states, worst-case per source. Two values and no third: every finding is material that is either usable straight out of the file or not.
const ( CredentialPrincipalAgentEffective = "agent_effective" CredentialPrincipalUserEffective = "user_effective" )
Collection principals. AgentEffective is the agent process itself, which on macOS is a root daemon. UserEffective is reserved for a reader that drops privileges first.
const ( CredentialReasonRefusedTCC = "refused_tcc" CredentialReasonRefusedOutsideRoots = "refused_outside_user_roots" CredentialReasonPermissionDenied = "permission_denied" CredentialReasonLocationUnresolved = "location_unresolved" //#nosec G101 -- a reason code on the wire; no value read from a file reaches this vocabulary. CredentialReasonUnsupportedEncoding = "unsupported_encoding" //#nosec G101 -- see above: a reason code, not anything read. CredentialReasonSkippedNoUser = "skipped_no_user" CredentialReasonCapped = "capped" CredentialReasonTimedOut = "timed_out" // The file was there and was read within its cap, and its format could not // be interpreted well enough to state that it holds no material. Reported // instead of a finding, never alongside one for the same entry: a parse // failure is not evidence that a credential exists. CredentialReasonUnrecognizedFormat = "unrecognized_format" )
Reason codes for a source that could not be collected. Typed rather than free text because a parser's own error message can quote the line it choked on, which is a credential value.
const ( PlatformDarwin = "darwin" PlatformWindows = "windows" PlatformLinux = "linux" )
Platform constants used by detectors, device info, and output formatters. These match the values returned by runtime.GOOS / executor.GOOS().
const CurrentBrowserExtensionSchemaVersion = 1
CurrentBrowserExtensionSchemaVersion is this block's own shape version, so a reader can reject a shape it does not know instead of dropping the fields it has no home for.
const CurrentCredentialSchemaVersion = 1
CurrentCredentialSchemaVersion is the credential block's own shape version, declared so a reader can reject or down-convert a shape it does not know instead of silently dropping fields.
Variables ¶
This section is empty.
Functions ¶
func PlatformDisplayName ¶ added in v1.11.0
PlatformDisplayName returns the human-readable name for a platform identifier.
Types ¶
type AITool ¶
type AITool struct {
Name string `json:"name"`
Vendor string `json:"vendor"`
Type string `json:"type"`
Version string `json:"version"`
BinaryPath string `json:"binary_path,omitempty"`
InstallPath string `json:"install_path,omitempty"`
ConfigDir string `json:"config_dir,omitempty"`
IsRunning *bool `json:"is_running,omitempty"`
}
AITool represents a detected AI agent, CLI tool, framework, or general agent. Fields are conditionally present based on type (cli_tool, general_agent, framework).
type AgentSkill ¶ added in v1.14.0
type AgentSkill struct {
// Identity
SkillSlug string `json:"skill_slug"` // directory basename
SkillName string `json:"skill_name"` // frontmatter name, else slug
Description string `json:"description,omitempty"` // frontmatter description, ≤1024 runes (standard max)
Version string `json:"version,omitempty"` // frontmatter version (or metadata.version fallback)
License string `json:"license,omitempty"` // standard frontmatter license, ≤128 runes
AllowedTools []string `json:"allowed_tools,omitempty"` // normalized from space/comma string or YAML list
// Behavior/risk flags (frontmatter + body scan)
DisableModelInvocation bool `json:"disable_model_invocation,omitempty"`
UserInvocableDisabled bool `json:"user_invocable_disabled,omitempty"` // frontmatter user-invocable: false
ContextFork bool `json:"context_fork,omitempty"` // context: fork (runs in subagent)
ModelOverride string `json:"model_override,omitempty"` // frontmatter model
HasHooks bool `json:"has_hooks,omitempty"` // hooks key present in frontmatter
HasShellInjection bool `json:"has_shell_injection,omitempty"` // body has !`cmd` / “`! load-time exec
// Attribution
Agent string `json:"agent"` // "claude-code"|"codex"|"opencode"|"cursor"|"pi"|"factory"|"amp"|"copilot"|"gemini-cli"|"aider"|"shared"
Source string `json:"source"` // atomic attribution key. "claude_user"|"claude_project"|
// // "agents_user"|"agents_project"|"codex_user"|"codex_system"|"codex_admin"|
// // "opencode_user"|"opencode_project"|"cursor_user"|"cursor_project"|"pi_user"|
// // "pi_project"|"factory_user"|"factory_project"|"factory_agent_project"|
// // "factory_agent_user"|"amp_user"|"copilot_user"|"github_project"|
// // "gemini_user"|"gemini_project"|"aider_project"
Scope string `json:"scope"` // "global" | "project" | "system"
ProjectPath string `json:"project_path,omitempty"` // project root for project scope
PluginName string `json:"plugin_name,omitempty"` // owning plugin, from skills.sh lock pluginName
// Location
SkillDirPath string `json:"skill_dir_path,omitempty"` // absolute, symlink-resolved dir of the physical skill (the collapse group key)
RootRelPath string `json:"root_rel_path,omitempty"` // skill dir relative to its root, forward-slash ("frontend-design", "apps/web/frontend-design")
SkillMDPath string `json:"skill_md_path,omitempty"`
SymlinkSources []string `json:"symlink_sources,omitempty"` // sorted, deduped source labels that symlink to this physical skill dir; every entry is a symlink by definition
// Content identity
SkillMDHash string `json:"skill_md_hash,omitempty"` // hex(sha256(SKILL.md)) — identity/drift key
// File census (all stat-derived — no file bytes read)
FileCount int `json:"file_count,omitempty"`
CodeFileCount int `json:"code_file_count,omitempty"`
SymlinkCount int `json:"symlink_count,omitempty"`
TotalSizeBytes int64 `json:"total_size_bytes,omitempty"`
HasCode bool `json:"has_code,omitempty"`
HasPluginManifest bool `json:"has_plugin_manifest,omitempty"` // .claude-plugin/plugin.json in skill dir
LastModified int64 `json:"last_modified,omitempty"` // unix, max mtime in dir
// Frontmatter health
HasFrontmatter bool `json:"has_frontmatter"`
FrontmatterError string `json:"frontmatter_error,omitempty"` // "" | "invalid_yaml" | "missing_name" | "missing_description" | "file_too_large" | "unreadable"
// skills.sh lock provenance (empty when unmanaged)
ManagedBy string `json:"managed_by,omitempty"` // "skills.sh" | ""
SourceSlug string `json:"source_slug,omitempty"` // "vercel-labs/agent-skills" (alias only for sourceType=local)
SourceType string `json:"source_type,omitempty"` // "github"|"mintlify"|"huggingface"|"local"|"well-known"
SourceURL string `json:"source_url,omitempty"`
Ref string `json:"ref,omitempty"` // branch|tag|sha as recorded
SkillPath string `json:"skill_path,omitempty"` // subdir within upstream repo
UpstreamFolderHash string `json:"upstream_folder_hash,omitempty"` // GitHub tree SHA from lock (NOT sha256)
InstalledAt string `json:"installed_at,omitempty"` // ISO8601 from lock
UpdatedAt string `json:"updated_at,omitempty"` // ISO8601 from lock
LockFilePath string `json:"lock_file_path,omitempty"`
}
AgentSkill represents one discovered agent skill: a physical SKILL.md directory, optionally enriched with skills.sh lock provenance. Symlink shadows of the same physical dir are collapsed into one record (the linked roots listed in SymlinkSources). Never carries file content — identity, provenance, hashes, and census counts only.
type AgentSkillScanInfo ¶ added in v1.14.0
type AgentSkillScanInfo struct {
RootsScanned []string `json:"roots_scanned"` // absolute root paths probed AND existing
ProjectsScanned int `json:"projects_scanned"`
LockFilesParsed int `json:"lock_files_parsed"`
SkillsFound int `json:"skills_found"`
Truncated bool `json:"truncated,omitempty"` // any cap hit (roots/projects/skills/home-walk)
Errors []string `json:"errors,omitempty"` // bounded: ≤50 entries, each ≤256 chars
WalkDirsVisited int `json:"walk_dirs_visited,omitempty"` // home-walk ReadDir count
WalkRootsFound int `json:"walk_roots_found,omitempty"` // project-root candidates the home walk emitted (pre-union)
DurationMs int64 `json:"duration_ms"`
}
AgentSkillScanInfo summarizes the skills phase. Its presence in the payload is the "scan ran" sentinel: a nil section means the scan did not run (no information), while a non-nil section with zero skills means "scan ran, nothing installed".
type BrewPackage ¶ added in v1.10.0
type BrewPackage struct {
Name string `json:"name"`
Version string `json:"version"`
// Metadata (populated from brew info --json=v2)
Tap string `json:"tap,omitempty"` // Source tap: "homebrew/core", "homebrew/cask", or custom
Description string `json:"description,omitempty"` // Package description
License string `json:"license,omitempty"` // SPDX license (formulae only)
Homepage string `json:"homepage,omitempty"` // Upstream project URL
InstallPath string `json:"install_path,omitempty"` // On-disk install path: <prefix>/Cellar/<name>/<version> (formulae) or <prefix>/Caskroom/<token> (casks)
InstallTimeUnix int64 `json:"install_time_unix,omitempty"` // Unix epoch when installed
InstalledAsDependency bool `json:"installed_as_dependency,omitempty"` // true if pulled in by another package
Deprecated bool `json:"deprecated,omitempty"` // true if package is deprecated upstream
PouredFromBottle bool `json:"poured_from_bottle,omitempty"` // true if installed from pre-built binary
AutoUpdates bool `json:"auto_updates,omitempty"` // cask: app handles its own updates
}
BrewPackage represents a single installed Homebrew formula or cask.
type BrewScanResult ¶ added in v1.10.0
type BrewScanResult struct {
ScanType string `json:"scan_type"` // "formulae" or "casks"
RawStdoutBase64 string `json:"raw_stdout_base64"`
RawStderrBase64 string `json:"raw_stderr_base64"`
Error string `json:"error"`
ExitCode int `json:"exit_code"`
ScanDurationMs int64 `json:"scan_duration_ms"`
LineCount int `json:"line_count"`
}
BrewScanResult holds raw Homebrew scan output for enterprise telemetry.
type BrowserCoverage ¶ added in v1.16.0
type BrowserCoverage struct {
BrowserID string `json:"browser_id"`
Status string `json:"status"`
// The browser's headline reason for being degraded, required for partial and
// failed and empty otherwise. One reason per browser: a browser that degraded
// twice reports the first cause.
ReasonCode string `json:"reason_code"`
// Profiles enumerated across every data directory this browser has. The
// profiles themselves stay inside the detector: their names are user-chosen
// text.
ProfileCount int `json:"profile_count"`
// Extensions reported for this browser, after exclusions and deduplication.
// Zero for failed and not_present, and otherwise equal to the findings
// carrying this browser_id.
ExtensionCount int `json:"extension_count"`
}
BrowserCoverage is what one browser's attempt produced. Stored rows are reconciled per browser, so without it a payload could not say whether zero findings for a browser means nothing installed or could not look.
type BrowserExtensionFinding ¶ added in v1.16.0
type BrowserExtensionFinding struct {
BrowserID string `json:"browser_id"`
// 32 characters of [a-p] on the Chromium family, the addon id on gecko. Never
// truncated: a shortened identity is a different identity.
ExtensionID string `json:"extension_id"`
// May be empty. An extension whose metadata could not be recovered still has
// an identity.
Name string `json:"name"`
Version string `json:"version"`
// The manifest revision the browser recorded, zero where it recorded none.
// Version 2 can hold blocking request interception, which version 3 removed.
ManifestVersion int `json:"manifest_version,omitempty"`
EnabledState string `json:"enabled_state"`
// Present exactly when EnabledState is disabled.
DisabledBy string `json:"disabled_by,omitempty"`
// Present on Chromium-family findings only; gecko has no store-listing
// concept here.
StoreListing string `json:"store_listing,omitempty"`
StoreViolation string `json:"store_violation,omitempty"`
InstallSource string `json:"install_source"`
// Where an unpacked extension was loaded from, as the user pointed the browser
// at it. Empty for every other install source, and never opened or resolved.
InstallPath string `json:"install_path,omitempty"`
Store string `json:"store"`
// The browser shipped it as a default. Still a real extension with real
// permissions, so it is reported; the flag lets a console de-emphasize it.
Preinstalled bool `json:"preinstalled"`
// gecko only.
SignedState string `json:"signed_state,omitempty"`
// The API permissions and host patterns the browser is honouring now, rather
// than what the manifest asked for or what the extension has held at some
// point. Hosts the user has since withheld are left out. An entry too long for
// its cap is omitted rather than shortened: these strings are matched, so a
// shortened one is a different grant. Empty where the browser's record of
// present access could not be read, with the browser reported partial to say
// so.
Permissions []string `json:"permissions"`
HostPermissions []string `json:"host_permissions"`
// The hosts the extension declared content scripts for, which the browser
// injects into automatically at page load. Not the limit of what it can inject
// into: with host access and the scripting, userScripts or debugger permission
// it can inject programmatically anywhere it holds a host. Nil where the engine
// does not record the distinction, so an empty list means it declared no
// content scripts and an absent one means this cannot tell.
ScriptableHostPermissions *[]string `json:"scriptable_host_permissions,omitempty"`
// What the extension declared it collects, as far as the user's grant records
// it. Written by gecko, the only engine that records the concept, though the
// wire carries it on any engine. A list holding "none" is a positive
// declaration that it collects nothing, which is not the same answer as an
// empty list, where nothing was declared at all.
DataCollection []string `json:"data_collection,omitempty"`
}
BrowserExtensionFinding describes one extension in one browser.
type BrowserExtensionScanInfo ¶ added in v1.16.0
type BrowserExtensionScanInfo struct {
PayloadSchemaVersion int `json:"payload_schema_version"`
// The revision of the browser list probed. An identifier, not a quantity.
CatalogVersion string `json:"catalog_version"`
CollectedAt int64 `json:"collected_at"`
DurationMs int64 `json:"duration_ms"`
// False when any browser failed or a cap cut the result. A degraded attribute
// does not clear it: one extension whose metadata went missing must not mark
// the whole scan incomplete.
ScanComplete bool `json:"scan_complete"`
Truncated bool `json:"truncated,omitempty"`
TruncatedReason string `json:"truncated_reason,omitempty"`
// One entry per catalog browser attempted on this platform. A browser this
// platform's catalog does not carry appears nowhere.
Browsers []BrowserCoverage `json:"browsers"`
// One entry per (browser, extension). The same extension in three profiles is
// one finding.
Findings []BrowserExtensionFinding `json:"findings"`
}
BrowserExtensionScanInfo is the browser extension inventory for one run. Nil means no information at all; non-nil with zero findings and authoritative coverage means the machine really holds no extensions. A reader reconciles stored rows against a non-nil section, so an eagerly initialised struct where nil was meant erases a device's inventory.
type BunAudit ¶ added in v1.12.0
type BunAudit struct {
Available bool `json:"bun_available"`
BunVersion string `json:"bun_version,omitempty"`
BunPath string `json:"bun_path,omitempty"`
Files []BunConfigFile `json:"files"`
NPMRCFiles []NPMRCFile `json:"npmrc_files"`
Env []NPMRCEnvVar `json:"env"`
DiscoveryError string `json:"discovery_error,omitempty"`
}
BunAudit has no Effective field — bun has no `config list` equivalent. Consumers render the union of parsed files. NPMRCFiles carries any .npmrc bun would read for auth.
type BunConfigFile ¶ added in v1.12.0
type BunConfigFile struct {
Path string `json:"path"`
Scope string `json:"scope"`
Exists bool `json:"exists"`
Readable bool `json:"readable"`
SizeBytes int64 `json:"size_bytes,omitempty"`
ModTimeUnix int64 `json:"mtime_unix,omitempty"`
Mode string `json:"mode,omitempty"`
OwnerUID int `json:"owner_uid,omitempty"`
OwnerName string `json:"owner_name,omitempty"`
GroupGID int `json:"group_gid,omitempty"`
GroupName string `json:"group_name,omitempty"`
SHA256 string `json:"sha256,omitempty"`
SymlinkTo string `json:"symlink_target,omitempty"`
InGitRepo bool `json:"in_git_repo,omitempty"`
GitTracked bool `json:"git_tracked,omitempty"`
Sections []BunSection `json:"sections,omitempty"`
ParseError string `json:"parse_error,omitempty"`
}
BunConfigFile is a single bunfig.toml. Scope: user | user-xdg | project.
type BunSection ¶ added in v1.12.0
type BunSection struct {
Name string `json:"name"`
Entries []NPMRCEntry `json:"entries"`
}
BunSection groups NPMRCEntry by dotted section path (e.g. "install", "install.scopes.@step-security"). Entry LineNum is always 0 — go-toml/v2 doesn't cheaply expose per-key positions.
type ConditionResult ¶ added in v1.12.0
type ConditionResult struct {
ID string `json:"id"`
Kind string `json:"kind"` // "regex" | "sha256"
Matched bool `json:"matched"`
}
ConditionResult reports the boolean outcome of one condition. No matched text is ever captured — only whether the condition matched.
type CredentialError ¶ added in v1.16.0
type CredentialError struct {
// Empty for exactly one reason code, skipped_no_user, which reports that no
// account resolved and so no source was ever attempted. Every other reason
// names the source it belongs to, and a reader is entitled to reject an
// empty one. Naming the run here instead would put a value in this field
// that looks like a catalog source and matches none.
SourceID string `json:"source_id"`
ReasonCode string `json:"reason_code"`
}
CredentialError is one source attempted and not collected. Deliberately not a finding: before the first syscall the detector does not know whether anything is there, so a finding would claim a credential on the strength of a path.
type CredentialFinding ¶ added in v1.16.0
type CredentialFinding struct {
SourceID string `json:"source_id"`
Category string `json:"category"`
// The path as configured, in tokenised-root form ($HOME/..., $APPDATA/...,
// $XDG_CONFIG_HOME/..., $VOLUME/<id>/..., $ABS/<token>/...). Display path
// and identity path are one string: two representations become two rows.
Location string `json:"location"`
ResolvedLocation string `json:"resolved_location,omitempty"`
// How many credentials the location holds. Always at least one: a location
// with none produces no finding at all.
Count int `json:"count"`
Protection string `json:"protection"`
// Octal POSIX bits ("0600"). Omitted on Windows, where Go synthesizes Perm()
// from the read-only attribute regardless of the real ACL.
Mode string `json:"mode,omitempty"`
// Windows only: the file's own DACL carries an allow-read entry for a broad
// trustee. Named for what is observed, not a conclusion it cannot reach —
// effective access also depends on inherited entries, deny ordering, nested
// groups and conditional entries. Tri-state so "not evaluated" stays
// distinct from "absent".
BroadReadAllowACEPresent *bool `json:"broad_read_allow_ace_present,omitempty"`
// The highest-signal fields. Both use the resolved location, because a
// dotfiles symlink farm is the layout that puts a credential in a repository
// and the probed path looks innocent.
InGitRepo bool `json:"in_git_repo"`
GitTracked bool `json:"git_tracked"`
// Change detection without a whole-file hash, which for a low-entropy
// credential would be a guessing oracle.
Size int64 `json:"size"`
MTime int64 `json:"mtime"`
CollectionPrincipal string `json:"collection_principal"`
}
CredentialFinding describes one credential location.
type CredentialScanInfo ¶ added in v1.16.0
type CredentialScanInfo struct {
Findings []CredentialFinding `json:"findings"`
// One entry per source attempted and not read. A source absent from the
// machine produces neither — a path name is not evidence.
Errors []CredentialError `json:"errors"`
// Pessimistic: false if any source could not be read, a cap was hit, or no
// user resolved. A snapshot that replaces its predecessor wholesale has to
// carry its own incompleteness.
ScanComplete bool `json:"scan_complete"`
// A cap bounded the result. Setting it also clears ScanComplete.
Truncated bool `json:"truncated,omitempty"`
PayloadSchemaVersion int `json:"payload_schema_version"`
// The revision of the source list probed, so a narrower list is
// distinguishable from a source that did not run. An identifier, not a
// quantity.
CatalogVersion string `json:"catalog_version"`
CollectionPrincipal string `json:"collection_principal"`
CollectedAt int64 `json:"collected_at"`
DurationMs int64 `json:"duration_ms"`
}
CredentialScanInfo is the credential inventory for one run. Its presence is the "scan ran" sentinel and that is load-bearing: nil means no information, while non-nil with zero findings means the scan ran and found nothing. The stored snapshot is replaced on any non-nil section, so an eagerly initialised struct where nil was meant erases a device's inventory in one write.
type EvaluatedRule ¶ added in v1.12.0
type EvaluatedRule struct {
RuleID string `json:"rule_id"`
RuleRevision string `json:"rule_revision,omitempty"`
Complete bool `json:"complete"`
}
EvaluatedRule records one rule the engine ran this scan, including rules that matched nothing. Complete is false if the rule hit its per-rule match cap (matches_truncated) or wasn't fully walked. RuleRevision is the opaque revision echoed back for backend audit/drift detection.
type Extension ¶
type Extension struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Publisher string `json:"publisher"`
InstallPath string `json:"install_path,omitempty"`
InstallDate int64 `json:"install_date"`
IDEType string `json:"ide_type"`
Source string `json:"source,omitempty"` // "bundled" or "user_installed"
}
func FilterUserInstalledExtensions ¶ added in v1.10.2
FilterUserInstalledExtensions removes bundled/platform extensions, keeping only user-installed, marketplace, and dropins extensions.
type FileAttrs ¶ added in v1.12.0
type FileAttrs struct {
SizeBytes int64 `json:"size_bytes"`
ModifiedAt int64 `json:"modified_at"` // mtime
CreatedAt int64 `json:"created_at"` // birth time (best-effort)
ChangedAt int64 `json:"changed_at"` // ctime
}
FileAttrs is file metadata only, never content. Times are unix seconds UTC, 0 when unavailable on the platform.
type GroupResult ¶ added in v1.12.0
type GroupResult struct {
GroupID string `json:"group_id"`
FullMatch bool `json:"full_match"`
Conditions []ConditionResult `json:"conditions"`
}
GroupResult reports one condition group. FullMatch is true when every condition in the group matched (after applying negation).
type MCPConfig ¶
type MCPConfig struct {
ConfigSource string `json:"config_source"`
ConfigPath string `json:"config_path"`
Vendor string `json:"vendor"`
}
MCPConfig represents a detected MCP server configuration (community mode).
type MCPConfigEnterprise ¶
type MCPConfigEnterprise struct {
ConfigSource string `json:"config_source"`
ConfigPath string `json:"config_path"`
Vendor string `json:"vendor"`
ConfigContentBase64 string `json:"config_content_base64,omitempty"`
}
MCPConfigEnterprise includes base64-encoded content for enterprise mode.
type MachineResources ¶ added in v1.11.3
type MachineResources struct {
CPUModel string `json:"cpu_model"` // e.g. "Apple M3 Pro", "Intel(R) Core(TM) i9-13900K"
CPUArchitecture string `json:"cpu_architecture"` // "arm64", "amd64"
PhysicalCores int `json:"physical_cores"` // 0 if undeterminable
LogicalCores int `json:"logical_cores"` // includes SMT/hyperthreads
MemoryBytes uint64 `json:"memory_bytes"` // total installed RAM
DiskTotalBytes uint64 `json:"disk_total_bytes"` // capacity of the system/root volume
}
MachineResources captures the static hardware capacity of the machine — what's there, not what's currently in use. Answers "how much resource does this machine have?".
type NPMRCAudit ¶ added in v1.11.3
type NPMRCAudit struct {
Available bool `json:"npm_available"`
NPMVersion string `json:"npm_version,omitempty"`
NPMPath string `json:"npm_path,omitempty"`
Files []NPMRCFile `json:"files"`
Effective *NPMRCEffective `json:"effective,omitempty"`
Env []NPMRCEnvVar `json:"env"`
DiscoveryError string `json:"discovery_error,omitempty"`
}
NPMRCAudit is the top-level structure produced by the npmrc detector.
type NPMRCEffective ¶ added in v1.11.3
type NPMRCEffective struct {
SourceByKey map[string]string `json:"source_by_key,omitempty"`
Config map[string]any `json:"config,omitempty"`
Error string `json:"error,omitempty"`
}
NPMRCEffective mirrors the merged-config view emitted by `npm config ls -l --json`. Auth values are returned by npm as "(protected)" — that's what we surface.
type NPMRCEntry ¶ added in v1.11.3
type NPMRCEntry struct {
Key string `json:"key"`
DisplayValue string `json:"display_value"`
LineNum int `json:"line_num"`
IsArray bool `json:"is_array,omitempty"`
IsAuth bool `json:"is_auth,omitempty"`
IsEnvRef bool `json:"is_env_ref,omitempty"`
EnvRefVars []string `json:"env_ref_vars,omitempty"`
ValueSHA256 string `json:"value_sha256,omitempty"`
Quoted bool `json:"quoted,omitempty"`
}
NPMRCEntry is one parsed line of a .npmrc file. DisplayValue is always safe to print: auth values are redacted to ***last4 (or *** when the secret is short). The raw value is never stored — ValueSHA256 is the only fingerprint kept.
type NPMRCEnvVar ¶ added in v1.11.3
type NPMRCEnvVar struct {
Name string `json:"name"`
Set bool `json:"set"`
DisplayValue string `json:"display_value,omitempty"`
ValueSHA256 string `json:"value_sha256,omitempty"`
}
NPMRCEnvVar is a single npm-relevant process environment variable. Set=false records are kept so the audit shape stays stable across hosts.
type NPMRCFile ¶ added in v1.11.3
type NPMRCFile struct {
Path string `json:"path"`
Scope string `json:"scope"` // builtin | global | user | project
Exists bool `json:"exists"`
Readable bool `json:"readable"`
SizeBytes int64 `json:"size_bytes,omitempty"`
ModTimeUnix int64 `json:"mtime_unix,omitempty"`
Mode string `json:"mode,omitempty"`
OwnerUID int `json:"owner_uid,omitempty"`
OwnerName string `json:"owner_name,omitempty"`
GroupGID int `json:"group_gid,omitempty"`
GroupName string `json:"group_name,omitempty"`
SHA256 string `json:"sha256,omitempty"`
SymlinkTo string `json:"symlink_target,omitempty"`
InGitRepo bool `json:"in_git_repo,omitempty"`
GitTracked bool `json:"git_tracked,omitempty"`
Entries []NPMRCEntry `json:"entries,omitempty"`
ParseError string `json:"parse_error,omitempty"`
}
NPMRCFile is a single .npmrc file. Metadata is best-effort: fields that could not be determined (e.g. owner_name on Windows) are omitted.
type NodePackage ¶ added in v1.13.0
type NodePackage struct {
Name string `json:"name"`
Version string `json:"version"`
// IsDirect marks a top-level dependency (declared in the project's
// package.json) versus a transitive one pulled in by another package.
// Derived from lockfile structure, not from running the package manager.
IsDirect bool `json:"is_direct,omitempty"`
}
NodePackage is one installed Node package discovered by disk parsing.
Fields are intentionally limited to what the backend persists today (name, version, direct-vs-transitive) — see DeviceNPMPackageUsageInfo. The agent-api NodePackage additionally declares InstallPath and Dependencies, but both are parsed-then-discarded server-side and are omitted here on purpose. JSON tags match ddbmodels.NodePackage.
type NodeScanResult ¶
type NodeScanResult struct {
ProjectPath string `json:"project_path"`
PackageManager string `json:"package_manager"`
PMVersion string `json:"package_manager_version"`
WorkingDirectory string `json:"working_directory"`
RawStdoutBase64 string `json:"raw_stdout_base64,omitempty"`
RawStderrBase64 string `json:"raw_stderr_base64,omitempty"`
Packages []NodePackage `json:"packages,omitempty"`
PackagesCount int `json:"packages_count"`
Error string `json:"error"`
ExitCode int `json:"exit_code"`
ScanDurationMs int64 `json:"scan_duration_ms"`
}
NodeScanResult holds one project's (or one global root's) scan output for enterprise telemetry. Used for both global packages and per-project scans.
Two mutually-exclusive shapes flow through this struct depending on how the scan was produced:
- Legacy (command) path: RawStdoutBase64 carries the raw `npm ls`/`yarn`/ `pnpm`/`bun` output; the backend parses it into packages on ingest.
- Disk-parse path: Packages is populated directly and RawStdoutBase64 is left empty. The backend's ParseNodeProjects passes a project through untouched when RawStdoutBase64 == "", so pre-parsed packages reach storage with no backend change. Never set both: a non-empty RawStdoutBase64 makes the backend re-parse and overwrite Packages.
JSON tags match agent-api's ddbmodels.NodeProject so the payload deserializes server-side without a schema change.
type PackageDetail ¶ added in v1.10.0
PackageDetail represents a single package name and version.
type PipAudit ¶ added in v1.11.3
type PipAudit struct {
Available bool `json:"pip_available"`
Invocation string `json:"pip_invocation,omitempty"` // "pip" | "pip3" | "python3 -m pip"
Version string `json:"pip_version,omitempty"`
Path string `json:"pip_path,omitempty"`
Files []PipConfigFile `json:"files"`
EnvVars []PipEnvVar `json:"env_vars"`
Effective *PipEffective `json:"effective,omitempty"`
Netrc *PipNetrcStatus `json:"netrc,omitempty"`
Findings []PipFinding `json:"findings"`
DiscoveryError string `json:"discovery_error,omitempty"`
}
PipAudit is the top-level pip audit object.
type PipConfigFile ¶ added in v1.11.3
type PipConfigFile struct {
Path string `json:"path"`
Layer string `json:"layer"` // global | user | user-legacy | site | PIP_CONFIG_FILE
Exists bool `json:"exists"`
Readable bool `json:"readable"`
SizeBytes int64 `json:"size_bytes,omitempty"`
ModTimeUnix int64 `json:"mtime_unix,omitempty"`
Mode string `json:"mode,omitempty"`
OwnerName string `json:"owner_name,omitempty"`
GroupName string `json:"group_name,omitempty"`
SHA256 string `json:"sha256,omitempty"`
InGitRepo bool `json:"in_git_repo,omitempty"`
GitTracked bool `json:"git_tracked,omitempty"`
Sections []PipSection `json:"sections,omitempty"`
ParseError string `json:"parse_error,omitempty"`
}
PipConfigFile is one pip.conf / pip.ini discovered on disk. Layer is the precedence layer pip itself assigns.
type PipEffective ¶ added in v1.11.3
type PipEffective struct {
SourceByKey map[string]string `json:"source_by_key,omitempty"`
Config map[string]string `json:"config,omitempty"`
Error string `json:"error,omitempty"`
}
PipEffective is the merged-config view from `pip config list -v`. The SourceByKey map keys are "<section>.<key>" to disambiguate the same key appearing in multiple sections.
type PipEnvVar ¶ added in v1.11.3
type PipEnvVar struct {
Name string `json:"name"`
Set bool `json:"set"`
Value string `json:"-"` // raw; never serialized
Display string `json:"display,omitempty"`
SHA256 string `json:"sha256,omitempty"`
}
PipEnvVar captures one PIP_* environment variable. Display is the finding-grade safe-to-print form (creds redacted in URLs). Unset vars are kept (Set=false) so the audit shape stays stable across hosts and a future change-tracking layer can detect newly-set vars between runs.
type PipFinding ¶ added in v1.11.3
type PipFinding struct {
ID string `json:"id"` // "pip-001" etc.
Severity string `json:"severity"` // CRITICAL | HIGH | MEDIUM | LOW | INFO
Category string `json:"category"`
Source string `json:"source"` // file path or env var name
Section string `json:"section,omitempty"` // "global" / "install" / "" for env vars
Key string `json:"key,omitempty"`
ValueShown string `json:"value_shown,omitempty"`
Detail string `json:"detail"`
Remediation string `json:"remediation,omitempty"`
}
PipFinding is one detection from the rule catalog (pip-001 .. pip-024). ValueShown is always pre-redacted; the raw value never leaves the detector.
type PipKeyValue ¶ added in v1.11.3
type PipKeyValue struct {
Key string `json:"key"`
// Values holds the raw, un-redacted parsed values. Used internally by
// the findings engine (URL.User parsing, http-scheme detection, etc.)
// — NEVER serialized to JSON or pretty output, since for keys like
// `extra-index-url` it can hold a literal `user:pass@host` URL. Use
// Display for any user-visible rendering.
Values []string `json:"-"`
Display string `json:"display,omitempty"` // human-readable single-line rendering, with creds redacted
LineNum int `json:"line_num"`
}
PipKeyValue is a single key/value (or key/multi-value) entry inside a section. Repeatable options surface as multiple Values.
type PipNetrcStatus ¶ added in v1.11.3
type PipNetrcStatus struct {
Path string `json:"path"`
Exists bool `json:"exists"`
Mode string `json:"mode,omitempty"` // empty on Windows
}
PipNetrcStatus is informational: pip falls back to ~/.netrc for credentials, so its presence + permissions matter even though we don't parse the contents (.netrc is shared with curl/wget/twine/etc.; auditing its content is a separate concern).
type PipSection ¶ added in v1.11.3
type PipSection struct {
Name string `json:"name"` // "global", "install", "freeze", "wheel", "list", "hash", ...
LineNum int `json:"line_num"`
Entries []PipKeyValue `json:"entries"`
}
PipSection is one [section] block in a pip config file.
type PkgManager ¶
type PnpmAudit ¶ added in v1.12.0
type PnpmAudit struct {
Available bool `json:"pnpm_available"`
PnpmVersion string `json:"pnpm_version,omitempty"`
PnpmPath string `json:"pnpm_path,omitempty"`
Files []NPMRCFile `json:"files"`
Effective *PnpmEffective `json:"effective,omitempty"`
Env []NPMRCEnvVar `json:"env"`
DiscoveryError string `json:"discovery_error,omitempty"`
}
PnpmAudit reuses NPMRCFile/NPMRCEnvVar — pnpm reads the same .npmrc syntax as npm. Only the effective view and env list diverge.
type PnpmEffective ¶ added in v1.12.0
type PnpmEffective struct {
SourceByKey map[string]string `json:"source_by_key,omitempty"`
Config map[string]any `json:"config,omitempty"`
Error string `json:"error,omitempty"`
}
PnpmEffective mirrors `pnpm config list --json`. SourceByKey is kept on the struct for renderer parity with npm but is typically empty — pnpm doesn't emit per-key source attribution.
type ProjectInfo ¶ added in v1.10.0
type ProjectInfo struct {
Path string `json:"path"`
PackageManager string `json:"package_manager,omitempty"`
Packages []PackageDetail `json:"packages,omitempty"`
}
ProjectInfo represents a detected project directory with its packages.
type PythonPackage ¶ added in v1.10.0
PythonPackage represents a single installed Python package.
type PythonScanResult ¶ added in v1.10.0
type PythonScanResult struct {
PackageManager string `json:"package_manager"`
PMVersion string `json:"package_manager_version"`
BinaryPath string `json:"binary_path"` // Resolved path to the package manager binary
RawStdoutBase64 string `json:"raw_stdout_base64"`
RawStderrBase64 string `json:"raw_stderr_base64"`
Error string `json:"error"`
ExitCode int `json:"exit_code"`
ScanDurationMs int64 `json:"scan_duration_ms"`
}
PythonScanResult holds raw Python scan output for enterprise telemetry.
type RemovedProjectRef ¶ added in v1.13.0
type RemovedProjectRef struct {
Path string `json:"path"`
LastUploadedExecutionID string `json:"last_uploaded_execution_id,omitempty"`
}
RemovedProjectRef tells the backend a project has disappeared from disk. Backend drops Path from every matching row's ProjectPaths and bumps RecordUpdatedAt but not LastSeenAt.
type RuleFileMatch ¶ added in v1.12.0
type RuleFileMatch struct {
Path string `json:"path"`
MatchedGlob string `json:"matched_glob"`
FileSHA256 string `json:"file_sha256,omitempty"`
SizeExceeded bool `json:"size_exceeded,omitempty"`
Groups []GroupResult `json:"groups,omitempty"`
FileAttrs FileAttrs `json:"file_attrs"`
}
RuleFileMatch is one candidate file reported for a rule. SizeExceeded is set when the file was larger than the rule's size guard: it is reported but not read, so FileSHA256 and Groups are empty. FileAttrs (Stat-only metadata) is always present.
type RuleResult ¶ added in v1.12.0
type RuleResult struct {
RuleID string `json:"rule_id"`
RuleRevision string `json:"rule_revision,omitempty"`
MatchesTruncated bool `json:"matches_truncated,omitempty"`
Files []RuleFileMatch `json:"files"`
}
RuleResult is one rule that matched at least one file. MatchesTruncated is true when more than the per-rule cap (200) of files matched; the Files slice is capped and the corresponding EvaluatedRule.Complete is false.
type RuleScan ¶ added in v1.12.0
type RuleScan struct {
ScanComplete bool `json:"scan_complete"`
EvaluatedRules []EvaluatedRule `json:"evaluated_rules"`
Results []RuleResult `json:"results"`
}
RuleScan is the top-level result of one malicious-file scan. It carries the scan-level completeness flag, every rule the engine evaluated (even those with zero matches), and the per-rule match results. ScanComplete is false when a global file/time budget cut the walk short, which suppresses backend auto-resolution for the whole run.
type ScanResult ¶
type ScanResult struct {
AgentVersion string `json:"agent_version"`
AgentURL string `json:"agent_url"`
ScanTimestamp int64 `json:"scan_timestamp"`
ScanTimestampISO string `json:"scan_timestamp_iso"`
Device Device `json:"device"`
AIAgentsAndTools []AITool `json:"ai_agents_and_tools"`
IDEInstallations []IDE `json:"ide_installations"`
IDEExtensions []Extension `json:"ide_extensions"`
MCPConfigs []MCPConfig `json:"mcp_configs"`
NodePkgManagers []PkgManager `json:"node_package_managers"`
NodePackages []any `json:"node_packages"`
NodeProjects []ProjectInfo `json:"node_projects"`
BrewPkgManager *PkgManager `json:"brew_package_manager,omitempty"`
BrewFormulae []BrewPackage `json:"brew_formulae"`
BrewCasks []BrewPackage `json:"brew_casks"`
PythonPkgManagers []PkgManager `json:"python_package_managers"`
PythonPackages []PythonPackage `json:"python_packages"`
PythonProjects []ProjectInfo `json:"python_projects"`
SystemPkgManager *PkgManager `json:"system_package_manager,omitempty"`
SystemPackages []SystemPackage `json:"system_packages"`
SnapPkgManager *PkgManager `json:"snap_package_manager,omitempty"`
SnapPackages []SystemPackage `json:"snap_packages"`
FlatpakPkgManager *PkgManager `json:"flatpak_package_manager,omitempty"`
FlatpakPackages []SystemPackage `json:"flatpak_packages"`
NPMRCAudit *NPMRCAudit `json:"npmrc_audit,omitempty"`
PipAudit *PipAudit `json:"pip_audit,omitempty"`
PnpmAudit *PnpmAudit `json:"pnpm_audit,omitempty"`
BunAudit *BunAudit `json:"bun_audit,omitempty"`
YarnAudit *YarnAudit `json:"yarn_audit,omitempty"`
// AgentSkills is the flat list of discovered AI agent skills. AgentSkillScan
// is the phase summary; its non-nil presence is the "scan ran" sentinel (a
// nil section must never cause the backend to delete skill state).
AgentSkills []AgentSkill `json:"agent_skills,omitempty"`
AgentSkillScan *AgentSkillScanInfo `json:"agent_skill_scan,omitempty"`
// CredentialScan is the credential-location inventory. Nil means the phase
// did not run, which is the only "no information" signal a reader has — a
// non-nil section with zero findings means it ran and found nothing.
CredentialScan *CredentialScanInfo `json:"credential_scan,omitempty"`
// BrowserExtensionScan is the browser extension inventory. Nil means the
// phase did not run — the only "no information" signal a reader has, and the
// difference between it and a section carrying zero findings is what keeps a
// skipped scan from erasing a device's extensions.
BrowserExtensionScan *BrowserExtensionScanInfo `json:"browser_extension_scan,omitempty"`
Summary Summary `json:"summary"`
}
ScanResult is the community-mode JSON output structure.
type Summary ¶
type Summary struct {
AIAgentsAndToolsCount int `json:"ai_agents_and_tools_count"`
IDEInstallationsCount int `json:"ide_installations_count"`
IDEExtensionsCount int `json:"ide_extensions_count"`
MCPConfigsCount int `json:"mcp_configs_count"`
NodeProjectsCount int `json:"node_projects_count"`
BrewFormulaeCount int `json:"brew_formulae_count"`
BrewCasksCount int `json:"brew_casks_count"`
PythonProjectsCount int `json:"python_projects_count"`
SystemPackagesCount int `json:"system_packages_count"`
SnapPackagesCount int `json:"snap_packages_count"`
FlatpakPackagesCount int `json:"flatpak_packages_count"`
AgentSkillsCount int `json:"agent_skills_count"`
}
type SystemPackage ¶ added in v1.11.0
type SystemPackage struct {
Name string `json:"name"`
Version string `json:"version"`
Arch string `json:"arch,omitempty"` // CPU architecture: x86_64, amd64, noarch, arm64, etc.
Source string `json:"source,omitempty"` // Origin: source RPM, dpkg source, snap publisher, flatpak remote
InstallPath string `json:"install_path,omitempty"` // On-disk install root. Populated for snap (/snap/<name>/current) and flatpak (~/.local/share/flatpak/app/<id> or /var/lib/flatpak/app/<id>). Not applicable for rpm/dpkg/pacman/apk (file collections).
InstallTimeUnix int64 `json:"install_time_unix,omitempty"` // Unix epoch seconds when installed (rpm, dpkg, pacman)
// Provenance & trust signals
Vendor string `json:"vendor,omitempty"` // Distributor: rpm VENDOR, dpkg Origin
Maintainer string `json:"maintainer,omitempty"` // Packager identity: rpm PACKAGER, dpkg Maintainer, apk maintainer, pacman Packager
URL string `json:"url,omitempty"` // Upstream project URL
License string `json:"license,omitempty"` // SPDX license expression
Section string `json:"section,omitempty"` // dpkg Section category (e.g. "libs", "non-free/libs")
Signature string `json:"signature,omitempty"` // Signature info: rpm SIGPGP/RSAHEADER, pacman Validated By
BuildTimeUnix int64 `json:"build_time_unix,omitempty"` // Unix epoch when package was built (rpm, apk, pacman)
// Size
InstalledSize int64 `json:"installed_size,omitempty"` // Installed size in bytes (rpm SIZE, dpkg Installed-Size * 1024)
// Sandboxing / confinement (snap, flatpak)
Confinement string `json:"confinement,omitempty"` // snap: strict/classic/devmode
Channel string `json:"channel,omitempty"` // snap tracking channel, flatpak branch
Runtime string `json:"runtime,omitempty"` // flatpak runtime ref
// Source control
CommitHash string `json:"commit_hash,omitempty"` // apk commit, flatpak active commit
}
SystemPackage represents a package installed via the system package manager (rpm, dpkg, pacman, apk, snap, flatpak).
type SystemPackageScanResult ¶ added in v1.11.0
type SystemPackageScanResult struct {
ScanType string `json:"scan_type"` // "rpm", "dpkg", "pacman", "apk", "snap", "flatpak"
PackageManager *PkgManager `json:"package_manager,omitempty"`
Packages []SystemPackage `json:"packages"`
PackagesCount int `json:"packages_count"`
Error string `json:"error,omitempty"`
ScanDurationMs int64 `json:"scan_duration_ms"`
}
SystemPackageScanResult holds parsed system package data for enterprise telemetry. Unlike BrewScanResult (which sends raw base64), this sends pre-parsed packages since syspkg.go already handles the format-specific parsing edge cases.
type UnchangedGlobalRef ¶ added in v1.13.0
type UnchangedGlobalRef struct {
PackageManager string `json:"package_manager"`
ScanOutputHash string `json:"scan_output_hash"`
LastUploadedExecutionID string `json:"last_uploaded_execution_id,omitempty"`
}
UnchangedGlobalRef tells the backend a PM's global package set is unchanged. Keyed by PM name (globals are PM-scoped, not path-scoped).
type UnchangedProjectRef ¶ added in v1.13.0
type UnchangedProjectRef struct {
Path string `json:"path"`
ScanOutputHash string `json:"scan_output_hash"`
LastUploadedExecutionID string `json:"last_uploaded_execution_id,omitempty"`
}
UnchangedProjectRef tells the backend a project is unchanged since the last successful upload. Backend bumps LastSeenAt on every package row whose ProjectPaths contains Path.
type YarnAudit ¶ added in v1.12.0
type YarnAudit struct {
Available bool `json:"yarn_available"`
YarnVersion string `json:"yarn_version,omitempty"`
YarnPath string `json:"yarn_path,omitempty"`
Flavor string `json:"flavor,omitempty"` // "classic" | "berry" | "unknown"
Files []YarnConfigFile `json:"files"`
NPMRCFiles []NPMRCFile `json:"npmrc_files"` // auth side-channel
Env []NPMRCEnvVar `json:"env"`
DiscoveryError string `json:"discovery_error,omitempty"`
}
YarnAudit covers both classic (v1.x, .yarnrc) and berry (v2+, .yarnrc.yml). Top-level Flavor reflects the binary's major; per-file Flavor reflects the file's own syntax — the renderer flags mismatches.
type YarnConfigFile ¶ added in v1.12.0
type YarnConfigFile struct {
Path string `json:"path"`
Scope string `json:"scope"` // "user" | "project"
Flavor string `json:"flavor"` // "classic" | "berry"
Exists bool `json:"exists"`
Readable bool `json:"readable"`
SizeBytes int64 `json:"size_bytes,omitempty"`
ModTimeUnix int64 `json:"mtime_unix,omitempty"`
Mode string `json:"mode,omitempty"`
OwnerUID int `json:"owner_uid,omitempty"`
OwnerName string `json:"owner_name,omitempty"`
GroupGID int `json:"group_gid,omitempty"`
GroupName string `json:"group_name,omitempty"`
SHA256 string `json:"sha256,omitempty"`
SymlinkTo string `json:"symlink_target,omitempty"`
InGitRepo bool `json:"in_git_repo,omitempty"`
GitTracked bool `json:"git_tracked,omitempty"`
Entries []YarnEntry `json:"entries,omitempty"`
ParseError string `json:"parse_error,omitempty"`
}
YarnConfigFile is a discovered .yarnrc (classic) or .yarnrc.yml (berry).
type YarnEntry ¶ added in v1.12.0
type YarnEntry struct {
Key string `json:"key"`
DisplayValue string `json:"display_value"`
LineNum int `json:"line_num,omitempty"`
IsAuth bool `json:"is_auth,omitempty"`
IsEnvRef bool `json:"is_env_ref,omitempty"`
EnvRefVars []string `json:"env_ref_vars,omitempty"`
ValueSHA256 string `json:"value_sha256,omitempty"`
Quoted bool `json:"quoted,omitempty"`
}
YarnEntry is a parsed key/value from either flavor. Berry nested maps flatten to dotted keys (e.g. `npmScopes.@step-security.npmAuthToken`) so the same slice carries both flavors.