export interface ActionTrainingMessage { role: "system" | "user" | "assistant"; content: string; } export interface PortableActionTrainingExample { messages: ActionTrainingMessage[]; metadata: { schema_version: "crowdlisten.action-workflow-example.v1"; record_type: "approved_workflow_plan"; source_action_ref: string; status: "done"; object_type: string; starter_key: string | null; skill: string; plan_version: number | null; evidence_count: number; contains_raw_evidence: false; contains_execution_trace: false; }; } export interface SkippedAction { source_action_ref: string; reason: "missing_action_id" | "not_done" | "not_approved_for_portability" | "missing_action_plan" | "incomplete_action_plan"; } export interface ActionTrainingExport { examples: PortableActionTrainingExample[]; skipped: SkippedAction[]; stats: { received: number; exported: number; skipped: number; }; } export interface ActionTrainingExportOptions { /** * Explicit human allowlist for portable use. A completed CrowdListen action * is not automatically approved for training or cross-workspace sharing. */ approvedActionIds: Iterable; } export type ExecutionTrainingScope = "internal_harness" | "external_harness" | "fine_tuning"; export interface PortableReviewedExecutionExample { messages: ActionTrainingMessage[]; metadata: { schema_version: "crowdlisten.reviewed-execution-example.v1"; record_type: "reviewed_execution_outcome"; source_execution_ref: string; status: "completed"; review_status: "approved"; training_scope: ExecutionTrainingScope; executor_platform: string | null; step_count: number; result_count: number; metric_names: string[]; contains_raw_evidence: false; contains_identity_fields: false; contains_secrets: false; contains_tool_trace: false; }; } export interface SkippedReviewedExecution { source_execution_ref: string; reason: "missing_execution_id" | "not_completed" | "not_owner_approved" | "scope_not_persisted" | "not_approved_for_portability" | "incomplete_execution"; } export interface ReviewedExecutionTrainingExport { examples: PortableReviewedExecutionExample[]; skipped: SkippedReviewedExecution[]; stats: { received: number; exported: number; skipped: number; }; } export interface ReviewedExecutionTrainingExportOptions { /** Caller-side approval is required in addition to the persisted scope. */ approvedExecutionIds: Iterable; trainingScope: ExecutionTrainingScope; } /** * Convert explicitly approved, completed CrowdListen action plans into a * data-minimized chat-training format. Raw evidence, URLs, entity/user IDs, * saved_by, and owner fields are intentionally excluded. * * These records teach plan construction. They are not execution traces and do * not demonstrate that the planned business outcome occurred. */ export declare function buildActionTrainingExport(input: unknown, options: ActionTrainingExportOptions): ActionTrainingExport; export declare function serializeActionTrainingExamples(examples: PortableActionTrainingExample[]): string; /** * Convert completed, owner-reviewed executions into a privacy-minimized * outcome-training format. Both the persisted scope and a caller allowlist are * mandatory. Only bounded summaries and numeric/boolean metrics are retained. */ export declare function buildReviewedExecutionTrainingExport(input: unknown, options: ReviewedExecutionTrainingExportOptions): ReviewedExecutionTrainingExport; export declare function serializeReviewedExecutionTrainingExamples(examples: PortableReviewedExecutionExample[]): string;