/** * Pack import — data-type parts (S1). * * Maps a pack's data-type contents (skills, prompts) to bundle-relative * DraftChanges. This module is the pure mapping layer: it produces the file * changes and reports which bundle assets were added, so the integration layer * can update policy.json (prompt order / managed sources) and stage a data * proposal against the current stable bundle. * * Skills and prompts are pure-additive bundle assets. Structured preference * memory is parsed, merged append-only with the parent bundle, and rewritten * with pack provenance. Code-type parts (components, workflows) are handled by * the ABI activation path, not here. */ import { type EvoCapabilityGrant } from "../components/capabilities/broker.ts"; import { type UnknownAbiBuilderRequest } from "../evolve/unknown-abi.ts"; import { type PreferenceMemory } from "../memory/preferences.ts"; import { type EvoPaths } from "../paths.ts"; import { type DraftChange } from "../proposal.ts"; import type { Proposal } from "../types.ts"; import { type EvoPackManifest } from "./pack.ts"; export interface PackDataChanges { /** Bundle-relative file changes to stage in a data proposal. */ changes: DraftChange[]; /** Bundle paths of prompt assets added (for policy promptOrder update). */ addedPromptPaths: string[]; /** Bundle paths of skill assets added. */ addedSkillPaths: string[]; /** Number of new durable preferences appended from memory parts. */ addedMemoryPreferences: number; } /** * Build the bundle DraftChanges for a pack's data-type contents. Reads each * referenced file from `packDir`. Pure w.r.t. the registry: no bundle is * mutated; the caller stages these as a proposal. */ export declare function buildPackDataChanges(packDir: string, manifest: EvoPackManifest, parentMemory?: PreferenceMemory): Promise; export interface PackImportResult { manifest: EvoPackManifest; /** The staged data proposal, or undefined when the pack has no data-type parts. */ proposal: Proposal | undefined; addedSkillPaths: string[]; addedPromptPaths: string[]; addedMemoryPreferences: number; /** Code-type parts (components + workflows) not handled by the data path. */ skippedCode: number; } /** * Import a pack's data-type parts against the current stable bundle: verify * integrity, map skills/prompts to bundle changes, and stage a reversible data * proposal (T0/T1) via the existing proposal pipeline. Skills load from the * bundle `skills/` directory and prompts from `prompts/` automatically, so no * policy edit is required. Code-type parts (components/workflows) are counted * and left to the ABI activation path. */ export declare function importPackData(options: { paths: EvoPaths; parentDigest: string; packDir: string; /** Reject if the pack changed after a caller's read-only preflight. */ expectedIntegrity?: string; }): Promise; export interface ImportedPackComponent { surface: string; abi: string; id: string; trigger?: string; artifactDigest: string; proposal: Proposal; } export interface EvoPackImportResult extends PackImportResult { importedComponents: ImportedPackComponent[]; /** ABIs that require a T2 host-wiring proposal before their parts can activate. */ unregisteredAbis: string[]; /** Workflow parts whose ABI is not registered and therefore cannot be staged yet. */ pendingWorkflows: number; /** Frozen, fully validated Builder inputs for code parts whose ABI is not registered. */ unknownAbiRequests: UnknownAbiBuilderRequest[]; } export interface EvoPackImportPreflight { manifest: EvoPackManifest; integrity: string; /** Private verified snapshot; valid only until the beforeStage callback returns. */ packDirectory: string; unregisteredAbis: string[]; pendingWorkflows: number; unknownAbiRequests: UnknownAbiBuilderRequest[]; } /** * Full pack staging entry point. Data assets use the existing reversible data * proposal. Registered, empty-ceiling components are verified into the local * content-addressed store and each receives its own focused selection proposal. * Unknown ABIs are reported for the later T2 Builder path; nothing activates * during import. */ export declare function importEvoPack(options: { paths: EvoPaths; parentDigest: string; packDir: string; /** Reject if the pack changed after a caller's read-only approval preview. */ expectedIntegrity?: string; /** Explicit artifact grants keyed by the pack's globally unique component id. */ grantsByComponent?: Readonly>; /** * Runs after the entire pack is validated but before this importer publishes * artifacts or stages proposals. A failure leaves no pack-owned durable state. * Side effects created inside the callback belong to that independent * transaction and are not deleted by this importer. */ beforeStage?: (preflight: EvoPackImportPreflight) => Promise; /** * Sandbox mode for the post-stage executable validation of imported * components (workflow dry run / deterministic fixture). Pass false only * after an explicit one-time direct-execution permission. */ sandbox?: boolean; }): Promise; //# sourceMappingURL=import.d.ts.map