/** * Shared StructuredOutput builder for the advise tools. `advise_install` * (the wizard for Reporter / Receiver) and `advise_retriever` both * produce an `AdvisePlan` (see ./types.ts) and render it the same way, * so the envelope shape is the same too. */ import type { AdvisePlan, AdviseAction, VerifyProbe } from './types.js'; import { type StructuredOutput } from '../output-types.js'; /** * Typed summary of an AdvisePlan. Exported so both `advise_install` and * `advise_retriever` mirror the same shape — any agent that handles one * advisor's plan output handles the other through the same code path. */ /** * What kind of license JWT the plan ships with. Surfaced as a typed * field so agents don't have to grep `notes[]` to know whether the * install will run with a demo or a real user-scoped license — the * difference is structurally meaningful (demo can't run airgapped, * - 'user-scoped' — minted from /api/v1/license with Auth0 tokens. * Production-grade. Can run airgapped. Log10x sets no expiry. * - 'demo' — anonymous /api/v1/license/demo. 14-day, no * airgapped, reduced limits. * - 'user-pasted' — the user supplied the JWT via license_jwt_paste; * it is not introspected. * failed and the plan was emitted with REPLACE_WITH_LICENSE_JWT). */ export type PlanLicenseKind = 'user-scoped' | 'demo' | 'user-pasted' | 'placeholder'; export interface AdvisePlanSummary { ok: boolean; app: 'reporter' | 'receiver' | 'retriever'; snapshot_id: string; release_name: string; namespace: string; forwarder?: string; action: AdviseAction; preflight: { name: string; status: 'ok' | 'warn' | 'fail' | 'unknown'; detail: string; }[]; preflight_summary: { ok: number; warn: number; fail: number; unknown: number; }; install_step_count: number; /** * Total number of files the install steps emit (sum of each step's * `file` count + `files[]` length). A single overlay can require * multiple files — the Fluentd Receiver path emits five (values.yaml * + tenx-kustomize/{kustomization, sidecar-patch, post-render.sh, * post-render.cmd}). Agents use this to know "the install plan is * not a one-file paste". */ install_file_count: number; /** * When the install plan emits ANY file the user must `chmod +x` (e.g. * the kustomize post-render shell shim), `true` so the agent surfaces * the chmod ritual to the user even if they only skim the markdown. */ install_requires_chmod: boolean; /** * License JWT kind baked into the plan. Optional only for * back-compat with summaries built before this field existed; new * emitters always populate it. Use this instead of grepping `notes` * for the substring "demo license". */ license_kind?: PlanLicenseKind; /** * How the helm command lands. See AdvisePlan.installMode for the * full description. Surfaced on the summary so agents can route on * it directly. * - 'upgrade-existing' — sidecar goes INTO the user's existing * forwarder release. The wizard does NOT deploy a second one. * - 'fresh-release' — new release name + namespace. * Optional for back-compat with summaries built before the field * existed. */ install_mode?: 'upgrade-existing' | 'fresh-release'; /** * When install_mode === 'upgrade-existing', the detected existing * release the plan upgrades in-place. Lets agents say "this * upgrades release X" without comparing fields. */ existing_helm_release?: { name: string; namespace: string; }; verify_probe_count: number; /** * Fix 93 — structured verify probe list. * * Each entry mirrors the `VerifyProbe` shape from types.ts. Exposed * as a typed array so agents can iterate probes and execute them * autonomously without parsing the markdown blob. `verify_probe_count` * is kept for back-compat (equals `verify_probes.length`). * * Only populated when at least one verify probe was built (i.e. the * plan action is `verify` or `all`). Empty array otherwise. */ verify_probes: Pick[]; teardown_step_count: number; blockers: string[]; notes: string[]; has_gitops_section: boolean; human_summary: string; } /** Build the typed plan summary. Exported for the install wizard's plan-mode. */ export declare function buildPlanSummary(plan: AdvisePlan, action: AdviseAction): AdvisePlanSummary; /** Plan-mode headline (sentence the agent can quote cold). Exported. */ export declare function buildPlanHeadline(plan: AdvisePlan, action: AdviseAction): string; export declare function buildAdvisePlanEnvelope(args: { tool: string; plan: AdvisePlan; action: AdviseAction; destinationNote?: string; }): StructuredOutput;