import type { JobState, JobStateInput } from './jobs' export interface GeneratedJsonSchema { type?: string | string[] format?: string title?: string description?: string default?: unknown const?: unknown enum?: unknown[] minimum?: number maximum?: number exclusiveMinimum?: number exclusiveMaximum?: number multipleOf?: number minLength?: number maxLength?: number pattern?: string minItems?: number maxItems?: number writeOnly?: boolean properties?: Record additionalProperties?: boolean | GeneratedJsonSchema required?: string[] anyOf?: GeneratedJsonSchema[] allOf?: GeneratedJsonSchema[] oneOf?: GeneratedJsonSchema[] prefixItems?: GeneratedJsonSchema[] items?: GeneratedJsonSchema discriminator?: { propertyName: string mapping?: Record } $ref?: string $defs?: Record 'x-mint-component'?: 'path' } export interface PluginJobPathInput { kind: 'path' files: File[] relativePaths: string[] rootName?: string signal?: AbortSignal } /** * An existing file-backed analysis artifact chosen for a `Path` field. Only * the database ids reach the plugin; it resolves, re-authorizes, and copies * the file into job staging when the job is submitted. */ export interface PluginJobArtifactPathInput { kind: 'artifact-path' experimentId: number artifactId: number name: string signal?: AbortSignal } export type PluginJobPathSelection = PluginJobPathInput | PluginJobArtifactPathInput export interface PluginJobPathUpload { token: string kind: 'file' | 'directory' name: string size: number } export interface PluginJobStagedPartInput> { job: GeneratedAnalysisJob | string key: string file: Blob metadata: Metadata expectedSize?: number expectedSha256?: string signal?: AbortSignal } export interface PluginJobStagedPart { key: string size: number sha256: string metadata: Metadata } export interface PluginJobStagingSummary { job_id: string sealed: boolean part_count: number total_bytes: number } export interface PluginJobStagedPartUploadResult { part: PluginJobStagedPart staging: PluginJobStagingSummary } export interface PluginJobStagingPagination { offset?: number limit?: number } export interface PluginJobStaging extends PluginJobStagingSummary { parts: PluginJobStagedPart[] offset: number limit: number next_offset: number | null has_more: boolean } export type GeneratedJobLifecycle = 'process' | 'staged' | 'service' export type GeneratedJobProfile = | { kind: 'process' } | { kind: 'staged' partSchema: GeneratedJsonSchema minParts: number maxParts: number maxBytes: number } | { kind: 'service' timeoutSeconds: number maxConcurrency: number } export interface GeneratedJobDefinition { id: string title: string description: string cpu: number /** Whether integrated submission requires a platform or current-plugin administrator. */ requires_admin?: boolean /** Defaults to process for manifests generated before lifecycle profiles. */ lifecycle?: GeneratedJobLifecycle /** Defaults to `{ kind: 'process' }` for older manifests. */ profile?: GeneratedJobProfile input_schema: GeneratedJsonSchema output_schema: GeneratedJsonSchema result_schema?: GeneratedJsonSchema } export interface GeneratedAnalysisManifest { schema_version: '1' plugin: { name: string version: string description: string routes_prefix: string } ui: { title: string description: string } jobs: GeneratedJobDefinition[] } export interface GeneratedSession { id: string tab_id: string created_at: string last_seen_at: string active_job_ids: string[] } export type GeneratedAnalysisResult = | { kind: 'text'; text: string } | { kind: 'json'; value: unknown } | { kind: 'table'; columns: string[]; rows: Record[] } | { kind: 'image'; media_type: string; data: string; alt: string } | { kind: 'plotly' spec: Record fallback?: { media_type: 'image/png'; data: string } } | { kind: 'artifact' id: string name: string media_type: string size: number | null data?: string download_url?: string download_expires_at?: string sha256?: string managed?: boolean } export interface GeneratedAnalysisJobInput extends JobStateInput { definition_id?: string | null metadata: JobStateInput['metadata'] & { definition_id?: string client_request_id?: string has_result?: boolean } } /** Canonical job state exposed after transport payloads cross the SDK boundary. */ export interface GeneratedAnalysisJob extends JobState { metadata: JobState['metadata'] & { definition_id?: string client_request_id?: string has_result?: boolean } }