import type { AgentAppearance } from "../agent-appearance.js"; import type { AgentEnvConfig } from "./secrets.js"; import type { RoutineVariable } from "./routine.js"; import type { IssueCommentAuthorType, PermissionKey } from "../constants.js"; import type { IssueCommentMetadata, IssueCommentPresentation } from "./issue.js"; export interface CompanyPortabilityInclude { company: boolean; agents: boolean; projects: boolean; issues: boolean; skills: boolean; } export interface CompanyPortabilityEnvInput { key: string; description: string | null; agentSlug: string | null; projectSlug: string | null; kind: "secret" | "plain"; requirement: "required" | "optional"; defaultValue: string | null; portability: "portable" | "system_dependent"; } export type CompanyPortabilityFileEntry = string | { encoding: "base64"; data: string; contentType?: string | null; }; export interface CompanyPortabilityCompanyManifestEntry { path: string; name: string; description: string | null; logoPath: string | null; requireBoardApprovalForNewAgents: boolean; feedbackDataSharingEnabled: boolean; feedbackDataSharingConsentAt: string | null; feedbackDataSharingConsentByUserId: string | null; feedbackDataSharingTermsVersion: string | null; } export interface CompanyPortabilitySidebarOrder { agents: string[]; projects: string[]; } export interface CompanyPortabilityLabelManifestEntry { name: string; color: string; } export interface CompanyPortabilityBlobManifestEntry { sha256: string; byteSize: number; contentType: string; } export interface CompanyPortabilityEmbeddedAssetManifestEntry { /** * The asset id on the SOURCE board. Source ids are only meaningful as the * rewrite key for the /api/assets//content references embedded in * the bundle's markdown; the importer mints fresh asset ids and rewrites * every reference to them. */ assetId: string; /** Content address of the image bytes in the bundle's blobs/ store. */ sha256: string; contentType: string; originalFilename: string | null; /** * Export categories whose files reference this asset ("agents", * "projects", "skills", "tasks", "routines"), or "always" when an * always-exported root file references it. Lets export selection follow * the toggles of the referencing files. Absent entries are treated as * always included. */ ownedBy?: string[]; } export interface CompanyPortabilityProjectManifestEntry { slug: string; name: string; path: string; description: string | null; ownerAgentSlug: string | null; leadAgentSlug: string | null; targetDate: string | null; color: string | null; icon: string | null; status: string | null; env: AgentEnvConfig | null; executionWorkspacePolicy: Record | null; workspaces: CompanyPortabilityProjectWorkspaceManifestEntry[]; metadata: Record | null; } export interface CompanyPortabilityProjectWorkspaceManifestEntry { key: string; name: string; sourceType: string | null; repoUrl: string | null; repoRef: string | null; defaultRef: string | null; visibility: string | null; setupCommand: string | null; cleanupCommand: string | null; metadata: Record | null; isPrimary: boolean; } export interface CompanyPortabilityIssueRoutineTriggerManifestEntry { kind: string; label: string | null; enabled: boolean; cronExpression: string | null; timezone: string | null; signingMode: string | null; replayWindowSec: number | null; } export interface CompanyPortabilityIssueRoutineManifestEntry { concurrencyPolicy: string | null; catchUpPolicy: string | null; variables?: RoutineVariable[] | null; triggers: CompanyPortabilityIssueRoutineTriggerManifestEntry[]; } export interface CompanyPortabilityIssueCommentManifestEntry { body: string; authorType: IssueCommentAuthorType; authorAgentSlug: string | null; authorUserId: string | null; presentation: IssueCommentPresentation | null; metadata: IssueCommentMetadata | null; createdAt: string | null; } export interface CompanyPortabilityIssueDocumentManifestEntry { key: string; title: string | null; format: string; path: string; } export interface CompanyPortabilityIssueWorkProductManifestEntry { type: string; provider: string; externalId: string | null; title: string; url: string | null; status: string; reviewState: string; isPrimary: boolean; healthStatus: string; summary: string | null; metadata: Record | null; } export interface CompanyPortabilityIssueMonitorManifestEntry { notes: string | null; scheduledBy: string | null; hadSchedule: boolean; } export interface CompanyPortabilityIssueAttachmentManifestEntry { sha256: string; contentType: string; originalFilename: string | null; byteSize: number; commentIndex: number | null; } export interface CompanyPortabilityIssueManifestEntry { slug: string; identifier: string | null; title: string; path: string; projectSlug: string | null; projectWorkspaceKey: string | null; assigneeAgentSlug: string | null; description: string | null; recurring: boolean; routine: CompanyPortabilityIssueRoutineManifestEntry | null; legacyRecurrence: Record | null; status: string | null; priority: string | null; labelIds: string[]; labelNames?: string[]; billingCode: string | null; executionWorkspaceSettings: Record | null; assigneeAdapterOverrides: Record | null; comments: CompanyPortabilityIssueCommentManifestEntry[]; blockedBy?: string[]; documents?: CompanyPortabilityIssueDocumentManifestEntry[]; workProducts?: CompanyPortabilityIssueWorkProductManifestEntry[]; monitor?: CompanyPortabilityIssueMonitorManifestEntry | null; attachments?: CompanyPortabilityIssueAttachmentManifestEntry[]; /** Slug of the parent task when it is part of the same bundle (schemaVersion >= 7). */ parentSlug?: string | null; /** Preserved source timestamps as ISO strings (schemaVersion >= 7); absent in older bundles. */ createdAt?: string | null; updatedAt?: string | null; startedAt?: string | null; completedAt?: string | null; cancelledAt?: string | null; metadata: Record | null; } export interface CompanyPortabilityAgentManifestEntry { slug: string; name: string; path: string; skills: string[]; role: string; title: string | null; icon: string | null; appearance?: AgentAppearance | null; capabilities: string | null; reportsToSlug: string | null; reportsToExistingAgentId: string | null; reportsToExistingAgentSlug: string | null; adapterType: string; adapterConfig: Record; runtimeConfig: Record; permissions: Record; permissionGrants: Array<{ permissionKey: PermissionKey; scope: Record | null; }>; budgetMonthlyCents: number; metadata: Record | null; } export interface CompanyPortabilitySkillManifestEntry { key: string; slug: string; name: string; path: string; description: string | null; sourceType: string; sourceLocator: string | null; sourceRef: string | null; trustLevel: string | null; compatibility: string | null; metadata: Record | null; fileInventory: Array<{ path: string; kind: string; }>; } export interface CompanyPortabilityManifest { schemaVersion: number; generatedAt: string; source: { companyId: string; companyName: string; } | null; includes: CompanyPortabilityInclude; company: CompanyPortabilityCompanyManifestEntry | null; sidebar: CompanyPortabilitySidebarOrder | null; labels?: CompanyPortabilityLabelManifestEntry[]; blobs?: CompanyPortabilityBlobManifestEntry[]; embeddedAssets?: CompanyPortabilityEmbeddedAssetManifestEntry[]; agents: CompanyPortabilityAgentManifestEntry[]; skills: CompanyPortabilitySkillManifestEntry[]; projects: CompanyPortabilityProjectManifestEntry[]; issues: CompanyPortabilityIssueManifestEntry[]; envInputs: CompanyPortabilityEnvInput[]; } export interface CompanyPortabilityExportResult { rootPath: string; manifest: CompanyPortabilityManifest; files: Record; warnings: string[]; paperclipExtensionPath: string; } export interface CompanyPortabilityExportPreviewFile { path: string; kind: "company" | "agent" | "skill" | "project" | "issue" | "extension" | "readme" | "other"; } export interface CompanyPortabilityExportPreviewResult { rootPath: string; manifest: CompanyPortabilityManifest; files: Record; fileInventory: CompanyPortabilityExportPreviewFile[]; counts: { files: number; agents: number; skills: number; projects: number; issues: number; }; warnings: string[]; paperclipExtensionPath: string; } export type CompanyPortabilitySource = { type: "inline"; rootPath?: string | null; files: Record; /** * Client-declared file count (`Object.keys(files).length`). The import * path fails closed when the received file set is smaller, so a * truncated inline body cannot import a fragment. Optional for callers * that predate the check. */ expectedFileCount?: number; } | { type: "github"; url: string; }; export type CompanyPortabilityImportTarget = { mode: "new_company"; newCompanyName?: string | null; } | { mode: "existing_company"; companyId: string; }; export type CompanyPortabilityAgentSelection = "all" | string[]; export type CompanyPortabilityCollisionStrategy = "rename" | "skip" | "replace"; export interface CompanyPortabilityPreviewRequest { source: CompanyPortabilitySource; include?: Partial; target: CompanyPortabilityImportTarget; agents?: CompanyPortabilityAgentSelection; collisionStrategy?: CompanyPortabilityCollisionStrategy; nameOverrides?: Record; selectedFiles?: string[]; } export interface CompanyPortabilityPreviewAgentPlan { slug: string; action: "create" | "update" | "skip"; plannedName: string; existingAgentId: string | null; reason: string | null; } export interface CompanyPortabilityPreviewProjectPlan { slug: string; action: "create" | "update" | "skip"; plannedName: string; existingProjectId: string | null; reason: string | null; } export interface CompanyPortabilityPreviewIssuePlan { slug: string; action: "create" | "skip"; plannedTitle: string; reason: string | null; } export interface CompanyPortabilityPreviewResult { include: CompanyPortabilityInclude; targetCompanyId: string | null; targetCompanyName: string | null; collisionStrategy: CompanyPortabilityCollisionStrategy; selectedAgentSlugs: string[]; plan: { companyAction: "none" | "create" | "update"; agentPlans: CompanyPortabilityPreviewAgentPlan[]; projectPlans: CompanyPortabilityPreviewProjectPlan[]; issuePlans: CompanyPortabilityPreviewIssuePlan[]; }; manifest: CompanyPortabilityManifest; files: Record; envInputs: CompanyPortabilityEnvInput[]; warnings: string[]; errors: string[]; } export interface CompanyPortabilityAdapterOverride { adapterType: string; adapterConfig?: Record; } export interface CompanyPortabilityImportRequest extends CompanyPortabilityPreviewRequest { adapterOverrides?: Record; secretValues?: Record; pauseAutomations?: boolean; } export interface CompanyPortabilityImportResult { company: { id: string; name: string; action: "created" | "updated" | "unchanged"; }; agents: { slug: string; id: string | null; action: "created" | "updated" | "skipped"; name: string; reason: string | null; }[]; skills: { originalKey: string; originalSlug: string; key: string; slug: string; id: string; action: "created" | "renamed" | "replaced" | "skipped"; reason: string | null; }[]; projects: { slug: string; id: string | null; action: "created" | "updated" | "skipped"; name: string; reason: string | null; }[]; routines: { slug: string; id: string | null; action: "created"; title: string; status: string; }[]; envInputs: CompanyPortabilityEnvInput[]; warnings: string[]; } export interface CompanyPortabilityExportRequest { include?: Partial; agents?: string[]; skills?: string[]; projects?: string[]; issues?: string[]; projectIssues?: string[]; selectedFiles?: string[]; expandReferencedSkills?: boolean; sidebarOrder?: Partial; } //# sourceMappingURL=company-portability.d.ts.map