/** * activate/selection — activation candidate selection core (#435). * * Extracted from activate.ts: the pure decision logic that turns installed * bundle candidates into a selected activation set — per-host budgets, * preferred asset order, intention matching, negative-score hard boundary * (#426), concern/task-mode buckets, and the ranking comparators. No I/O: * the state flows that call these live in activate.ts. */ import type { HostTarget, InstalledPackageManifest, RecommendationEntry, RecommendationReport, SessionIntent } from "../types.js"; /** * Hosts that activation can directly materialize runtime views for. */ export type ActivationHost = "opencode" | "copilot-vscode" | "shared"; /** * The ordered list of activation-capable hosts. */ export declare const ACTIVATION_HOSTS: readonly ["opencode", "copilot-vscode", "shared"]; /** * Canonical host target for the shared/default activation scope. */ export declare const SHARED_HOST_TARGET: "shared"; /** * Filters installed bundle ids down to those a host's recommendation report * suggests. When the report has no suggestion for the host (or none of the * suggestions survive the filter), every bundle id is kept — catalog * selection breadth remains the operator-curated contract. */ export declare function filterBundleIdsForHost(bundleIds: string[], host: HostTarget, recommendationReport: RecommendationReport | null): string[]; /** * Returns the default bundle ids activated for a host when no explicit host * bundle list is configured. */ export declare function getDefaultBundleIdsForHost(host: ActivationHost): string[]; /** * Builds a deterministic, slug-safe Copilot workspace profile id from * selected asset ids: the first segments joined with hyphens, non-slug * characters collapsed, and the result capped at a safe ID length. */ export declare function buildCopilotProfileId(assetIds: string[]): string; /** * Returns the per-host activation budget, falling back to the conservative * default for hosts without an explicit budget. */ export declare function getActivationBudget(host: ActivationHost): number; /** * Comparator ranking activation candidates: session-intent match first, then * recommendation order, source authority, portfolio fit, context cost, and * finally a deterministic asset-id tie-break. * * @returns A negative, zero, or positive number per Array.sort semantics. */ export declare function compareActivationCandidates(left: InstalledPackageManifest, right: InstalledPackageManifest, preferredAssetOrder: Map, recommendationEntryByAssetId: Map, sessionIntent: SessionIntent): number; /** * Selects activation candidates up to the budget: negatively scored assets * are never selected (hard boundary #426), and prompt-weight accounting * guarantees the first candidate always fits the remaining budget. */ export declare function selectActivationCandidates(candidates: Array<{ packageManifest: InstalledPackageManifest; destinationRoot: string; }>, preferredAssetOrder: Map, recommendationEntryByAssetId: Map, activationBudget: number, sessionIntent: SessionIntent): Array<{ packageManifest: InstalledPackageManifest; destinationRoot: string; }>; /** * Groups asset ids by their recommendation coverage tags (concerns), with * each bucket deduplicated and sorted. */ export declare function buildConcernBuckets(assetIds: string[], recommendationEntryByAssetId: Map): Record; /** * Groups asset ids by task mode and appends the intent-ranked "focused" * bucket (capped) plus the full "broad" bucket used to shape activation * ordering. */ export declare function buildTaskModeBuckets(assetIds: string[], recommendationEntryByAssetId: Map, sessionIntent: SessionIntent): Record; /** * Hard negative-score boundary shared by every activation selection path * (#426): an asset the recommendation engine scored below zero for a host * can never be activated for it. Centralizing the predicate keeps the * selection, fallback-pool, and explain paths on one definition of the * boundary. */ export declare function isNegativelyScored(recommendationEntry: { score: number | undefined; } | undefined | null): boolean;