Files
rea/src/cli/debPackageCommands.ts
T
morluto 8ca74c46c7 fix(deb)!: deliver inspect_deb_package within the agent result budget (#15432)
* fix(deb)!: deliver inspect_deb_package within the agent result budget

inspect_deb_package registered a retained summary view but declared no
detail selector and no summary delivery, so a large .deb inventory was
always inlined whole (about 790 KB for 5000 files).

The tool now takes detail like inspect_nuget_nupkg: omitted detail returns
complete Evidence within delivery.agent_result_budget_bytes and the retained
summary otherwise, and the CLI gains --detail and --evidence_output.

BREAKING CHANGE: inspect_deb_package with detail omitted now returns its
retained summary when complete Evidence exceeds the agent result budget in
a session that can page it. Pass detail "complete" (CLI --detail complete)
for complete inline delivery.

Refs #15326

* test(deb): read the retained parent without reopening the package
2026-12-01 16:15:36 +00:00

37 lines
1.2 KiB
TypeScript

import type { Logger } from "pino";
import { createDebPackageService } from "../composition/debPackage.js";
import { DEB_PACKAGE_TOOL_CONTRACTS } from "../contracts/deb/debPackageToolContracts.js";
import { contractNamed } from "./contractCliDescription.js";
import { registerContractCommand } from "./contractCommand.js";
import { deliverWithService } from "./contractCommandRunners.js";
import type { CliInstance } from "./types.js";
/** Resolve an operator-selected Debian package through the shared inspection workflow. */
export const registerDebPackageCommands = (
cli: CliInstance,
logger: Logger,
): void => {
const service = createDebPackageService();
const contract = contractNamed(
DEB_PACKAGE_TOOL_CONTRACTS,
"inspect_deb_package",
);
registerContractCommand(
cli,
logger,
contract,
{
description:
"Inspect a local Debian .deb without installing it or running maintainer scripts",
positionals: ["path"],
callerPaths: ["path"],
evidenceDelivery: true,
fields: {
path: { description: "Local Debian .deb package" },
},
},
deliverWithService(() => service, "rea-deb-package"),
);
};