@ankhorage/apm

中文文档
0.8.15发布于 2026/10/17MITTypeScriptES Module构建来源已验证近 30 天下载 9.5万

Headless project update analysis, planning, execution, recovery, and verification for Ankhorage tooling.

原始使用文档
文档目录3 节
  1. Generated documentation
  2. Public API
  3. Utilities

@ankhorage/apm

license: MIT npm: v0.8.15 runtime: bun typescript: strict eslint: checked prettier: checked build: checked tests: checked docs: paradox

Headless project update analysis, planning, execution, recovery, and verification.

Generated documentation

Public API

Utilities

APM_PLAN_SUPPORT

Publish the deterministic planning guarantees and native resolver matrix implemented by APM.

plan is read-only with respect to the inspected project. Package-manager resolution runs in a disposable staging directory and uses the selected project's native npm, pnpm, Yarn, or Bun resolver. Lifecycle scripts are disabled. Only reviewed manifest and lockfile changes are returned as serializable plan evidence; staging/cache/network effects remain outside the project tree.

The default dependency policy is conservative: only direct registry packages with a newer version satisfying their existing declared range are selected automatically. Latest majors, prereleases, downgrades and exact versions require explicit selections and APM never invents a new caret range. Explicit transitive selections remain lock-only; they are not promoted into root dependencies.

Native solver output is re-inspected through the same package-manager evidence adapters used by status. Duplicate package instances, peer contexts and workspace links keep their native identity. Unknown artifact sources, peer conflicts, unsupported lock/linker modes and unresolved targets are blockers rather than partial executable plans.

Package-owned migration/projection planners can request additional dependency selections. APM resolves those through a bounded fixed-point loop (four iterations by default). Conflicting owner requirements or non-convergence block the plan, and intermediate diffs are never exposed as an executable result. Required host/extension upgrades are explicit restart-and-re-plan boundaries.

Saved plans contain exact targets, reviewed file content/digests, resolved graph/artifact identities, ordered step prerequisites, executor identity and a semantic input fingerprint. Registry freshness timestamps are recorded separately from fingerprint validity: refreshing identical registry evidence does not invalidate an otherwise identical plan. Apply must revalidate the project fingerprint and executor instead of re-resolving latest.

Shipment effects remain separate from source updates. In particular, dependency graph changes are never assumed OTA-safe; without package/platform evidence APM records OTA eligibility as unknown.

Module: src/features/plan/constants/support.ts Source: src/features/plan/constants/support.ts:34:14

APM_STATUS_SUPPORT

Publish the exact read-only status matrix proven by the evidence adapters.

Runtime: APM requires Node 24 or newer. Development uses Bun 1.4.2, but inspected customer projects may use any explicitly supported manager below.

Ordinary JavaScript and TypeScript projects require no ankh.config.json. APM derives package, workspace and package-manager evidence from Project Detector plus package-manager-native files. Detected non-JavaScript ecosystems remain inspection-only until an explicit APM adapter owns their dependency semantics; they never become a false complete/current result.

Install-root selection is evidence based. An explicit packageManager declaration wins over lockfile heuristics while stale lockfiles from other managers remain diagnostic evidence. If multiple manager lockfiles exist without an explicit selection, the root is conflicting and incomplete. Nested packages that carry their own manager/lock evidence become independent install roots rather than being folded into the parent workspace.

npm: package-lock v2 and v3 are parsed. The physical node_modules locations recorded by npm are checked without executing package code. package-lock v1 is detected but remains inspection-only. Duplicate versions remain separate physical package instances and dependency edges retain the instance identity they actually resolve to.

pnpm: lockfile v9 is parsed, including importer roots, package/snapshot instance identities, workspace links and peer-context suffixes. Installed state is confirmed from the pnpm virtual store lock when present; unknown/custom layouts stay explicit. Peer variants therefore remain distinct package instances rather than being collapsed by package name.

Yarn: Berry lock metadata v8 is parsed. nodeLinker: node-modules uses .yarn-state.yml; nodeLinker: pnp reads .pnp.data.json when present and never executes .pnp.cjs. An inlined PnP map therefore remains incomplete by design. Yarn Classic and Yarn's pnpm linker are detected but are not claimed as complete inventory modes in this release.

Bun: text bun.lock v1 and v2 are parsed. Bun's isolated .bun store and ordinary node_modules links are inspected as data. Hoisted lock-path keys retain nested and scoped package placements; installed identity/version mismatches remain explicit incomplete evidence. Binary bun.lockb and unknown lock versions are inspection-only.

Registry availability uses npm-compatible registries selected from project/user npmrc and environment overrides. Credentials are used only at the HTTP edge and are never returned in reports. Lookups deduplicate registry names, retain each instance's declared constraint, and run in batches of at most eight requests (configurable 1–64), with a default budget of 4096 names. Hosts can pass a configured registry availability port to statusProjectAsync; exceeding an explicit budget leaves uncached packages unknown rather than truncating them from the report. Offline cache misses and registry/auth/network failures make availability unknown.

status and plan are read-only project operations. Status reads manifests, lockfiles, installation metadata and registry data. Plan performs package-manager-native resolution only in disposable staging and returns reviewed diffs without writing the inspected project. Neither operation executes project lifecycle hooks or migrations. apply and verify remain separate roadmap operations.

Module: src/features/status/constants/support.ts Source: src/features/status/constants/support.ts:52:14

statusAsync
statusAsync(input: ApmStatusInput, ports: ApmStatusPorts) => Promise<ApmStatusResult>

Build evidence-based, serializable APM status without mutating the inspected project.

The use case separates Project Detector evidence, package-manager inventory, registry availability, and optional package-owned projection/migration evidence behind outbound ports. Missing or partial evidence makes currency unknown; it never becomes a green current result. Hosts can call this boundary without a terminal and can test it with deterministic fake ports.

Module: src/features/status/application/statusAsync.ts Source: src/features/status/application/statusAsync.ts:20:1 Related symbols: ApmStatusInput, ApmStatusPorts, ApmStatusResult

版本与发布记录

@ankhorage/apm 共发布 23 个版本,首次发布于 2026/09/14;过去 12 个月发布了 23 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.15latest2026/10/1720 天前
0.8.142026/10/041 个月前
0.8.132026/09/291 个月前
0.8.122026/09/291 个月前
0.8.112026/09/281 个月前
0.8.102026/09/191 个月前

关于 @ankhorage/apm 的常见问题

@ankhorage/apm 是什么?

Headless project update analysis, planning, execution, recovery, and verification for Ankhorage tooling.

如何安装 @ankhorage/apm?

在项目目录运行 npm install @ankhorage/apm,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 apm,可以用 npx apm 直接运行。

@ankhorage/apm 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ankhorage/apm 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ankhorage/apm 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ankhorage/apm 可以商用吗?

@ankhorage/apm 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ankhorage/apm 的下载量有多少?

根据 npm 官方下载统计,@ankhorage/apm 在 2026/10/06 – 2026/11/04 这 30 天内被下载 94,539 次,日均约 3,151 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ankhorage/apm 还在维护吗?

最新版本 0.8.15 发布于 2026/10/17(20 天前);至今共发布 23 个版本,其中过去 12 个月发布了 23 个;首次发布于 2026/09/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。