{"version":3,"file":"lib.mjs","names":[],"sources":["../../src/cli/lib.ts"],"sourcesContent":["// CLI API exports for programmatic usage\nimport { registerTsHook } from \"./shared/register-ts-hook\";\n\nawait registerTsHook(new URL(\"./ts-hook.mjs\", import.meta.url));\n\n// CLI foundation shared with plugins. Plugins resolve this package at runtime,\n// so logger state (--json / --verbose) set through these args reaches the SDK\n// code paths they call into. The @politty/zod surface is re-exported for the\n// same reason: arg metadata (aliases, env bindings, effects) lives in a\n// @politty/zod module-level registry, so registration and parsing must use\n// one @politty/zod copy.\nexport { arg, defineCommand, runCommand, runMain } from \"@politty/zod\";\nexport { logger, styles, type LogMode, type LogOptions, type OutOptions } from \"./shared/logger\";\nexport { defineAppCommand } from \"./shared/command\";\nexport { logBetaWarning } from \"./shared/beta\";\nexport { prompt } from \"./shared/prompt\";\nexport { workspaceNameSchema } from \"./shared/workspace-name\";\nexport {\n  createCommonArgs,\n  workspaceArgs,\n  configArg,\n  confirmationArgs,\n  deploymentArgs,\n  loadEnvFiles,\n  type CommonArgsType,\n} from \"./shared/args\";\nexport { deploy, deploy as apply } from \"./commands/deploy/deploy\";\nexport type { DeployOptions, DeployOptions as ApplyOptions } from \"./commands/deploy/deploy\";\nexport type { BundledScripts } from \"./commands/deploy/function-registry\";\nexport { ensureConfigId } from \"./commands/deploy/config-id-injector\";\nexport {\n  TAILOR_LOCK_FILENAME,\n  TAILOR_LOCK_VERSION,\n  findAppIdLock,\n  parseAppIds,\n  planAppIds,\n  removeAdoptedConfigIds,\n  type AppIdEntry,\n  type AppIdEntryInput,\n  type AppIdLock,\n  type AppIdPlan,\n  type AppIdPlanMode,\n  type AppIds,\n  type PlanAppIdsParams,\n  type RemoveAdoptedConfigIdsResult,\n} from \"./commands/deploy/app-id-lock\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { extractOwnedNamespaces } from \"./shared/config\";\nexport { errorToJson, serializeError, type ErrorToJsonOptions } from \"./shared/error-json\";\nexport { annotateTerminalError, withSourceLocation } from \"./shared/github-actions\";\nexport type { ErrorSourceLocation } from \"./shared/error-diagnostics\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport {\n  loadTailorDBNamespaces,\n  type TailorDBNamespaceSelector,\n  type LoadTailorDBNamespacesOptions,\n  type LoadedTailorDBNamespaces,\n} from \"./shared/tailordb-namespaces\";\nexport {\n  deployStaticWebsite,\n  type DeployResult as StaticWebsiteDeployResult,\n} from \"./commands/staticwebsite/deploy\";\nexport { assertWritable } from \"./shared/readonly-guard\";\nexport { isPluginGeneratedTable } from \"#/parser/service/tailordb/type-source\";\nexport type {\n  GeneratorResult,\n  Plugin,\n  PluginAttachment,\n  TailorDBNamespaceData,\n} from \"#/plugin/types\";\nexport type {\n  TailorDBType,\n  TypeSourceInfoEntry,\n  ParsedField,\n  OperatorFieldConfig,\n  PluginGeneratedTableSource,\n} from \"#/parser/service/tailordb/types\";\nexport type { Resolver } from \"#/types/resolver.generated\";\nexport type { Executor } from \"#/types/executor.generated\";\n\nexport {\n  show,\n  type ShowOptions,\n  type ApplicationInfo,\n  type ShowInfo,\n  type AIGatewayInfo,\n} from \"./commands/show\";\nexport { remove, type RemoveOptions } from \"./commands/remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./commands/workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./commands/workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./commands/workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./commands/workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./commands/workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./commands/workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./commands/workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./commands/workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./commands/workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./commands/workspace/user/remove\";\nexport type { UserInfo } from \"./commands/workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./commands/workspace/app/list\";\nexport {\n  getAppHealth,\n  type HealthOptions as GetAppHealthOptions,\n} from \"./commands/workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./commands/workspace/app/transform\";\nexport { getFunctionRegistry, type GetFunctionRegistryOptions } from \"./commands/function/get\";\nexport {\n  listFunctionRegistries,\n  type ListFunctionRegistriesOptions,\n} from \"./commands/function/list\";\nexport type { FunctionRegistryInfo } from \"./commands/function/transform\";\nexport {\n  listMachineUsers,\n  type ListMachineUsersOptions,\n  type MachineUserInfo,\n} from \"./commands/machineuser/list\";\nexport {\n  getMachineUserToken,\n  type GetMachineUserTokenOptions,\n  type MachineUserTokenInfo,\n} from \"./commands/machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./commands/oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./commands/oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./commands/oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./commands/workflow/list\";\nexport { getWorkflow, type GetWorkflowTypedOptions } from \"./commands/workflow/get\";\nexport type { MachineUserName } from \"@tailor-platform/sdk\";\nexport {\n  startWorkflow,\n  type StartWorkflowTypedOptions,\n  type StartWorkflowResultWithWait,\n  type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n  listWorkflowExecutions,\n  getWorkflowExecution,\n  type ListWorkflowExecutionsTypedOptions,\n  type GetWorkflowExecutionOptions,\n  type GetWorkflowExecutionResult,\n  type WorkflowExecutionWaitInfo,\n} from \"./commands/workflow/executions\";\nexport { waitWorkflowExecution, type WorkflowWaitOutput } from \"./commands/workflow/wait\";\nexport type { WaitWorkflowExecutionOptions, WorkflowWaitResult } from \"./commands/workflow/waiter\";\nexport {\n  resumeWorkflow,\n  type ResumeWorkflowOptions,\n  type ResumeWorkflowResultWithWait,\n} from \"./commands/workflow/resume\";\nexport type {\n  WorkflowListInfo,\n  WorkflowInfo,\n  WorkflowExecutionInfo,\n  WorkflowJobExecutionInfo,\n} from \"./commands/workflow/transform\";\nexport type { FunctionLogEntryInfo } from \"./shared/function-execution\";\nexport {\n  triggerExecutor,\n  type TriggerExecutorTypedOptions,\n  type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n  listExecutorJobs,\n  getExecutorJob,\n  getExecutorWaitFailureMessage,\n  watchExecutorJob,\n  type ListExecutorJobsTypedOptions,\n  type GetExecutorJobTypedOptions,\n  type WatchExecutorJobTypedOptions,\n  type ExecutorJobDetailInfo,\n  type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport { getExecutor, type GetExecutorTypedOptions } from \"./commands/executor/get\";\nexport {\n  listWebhookExecutors,\n  type ListWebhookExecutorsOptions,\n  type WebhookExecutorInfo,\n} from \"./commands/executor/webhook\";\nexport type {\n  ExecutorJobListInfo,\n  ExecutorJobInfo,\n  ExecutorJobAttemptInfo,\n  ExecutorListInfo,\n  ExecutorInfo,\n} from \"./commands/executor/transform\";\nexport { listOrganizations, type ListOrganizationsOptions } from \"./commands/organization/list\";\nexport { getOrganization, type GetOrganizationOptions } from \"./commands/organization/get\";\nexport { updateOrganization, type UpdateOrganizationOptions } from \"./commands/organization/update\";\nexport { organizationTree, type OrganizationTreeOptions } from \"./commands/organization/tree\";\nexport type {\n  UserOrganizationInfo,\n  OrganizationInfo,\n  FolderListInfo,\n  FolderInfo,\n} from \"./commands/organization/transform\";\nexport { listFolders, type ListFoldersOptions } from \"./commands/organization/folder/list\";\nexport { getFolder, type GetFolderOptions } from \"./commands/organization/folder/get\";\nexport { createFolder, type CreateFolderOptions } from \"./commands/organization/folder/create\";\nexport { updateFolder, type UpdateFolderOptions } from \"./commands/organization/folder/update\";\nexport { deleteFolder, type DeleteFolderOptions } from \"./commands/organization/folder/delete\";\nexport { loadAccessToken, loadWorkspaceId } from \"./shared/context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./commands/api\";\nexport { query } from \"./query\";\nexport { truncate, type TruncateOptions } from \"./commands/tailordb/truncate\";\n\n// Migration exports\nexport {\n  generate as migrateGenerate,\n  type GenerateOptions as MigrateGenerateOptions,\n} from \"./commands/tailordb/migrate/generate\";\nexport {\n  createSnapshotFromLocalTypes,\n  reconstructSnapshotFromMigrations,\n  compareSnapshots,\n  getNextMigrationNumber,\n  getLatestMigrationNumber,\n  getMigrationFiles,\n  compareLocalTypesWithSnapshot,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport {\n  getNamespacesWithMigrations,\n  type NamespaceWithMigrations,\n} from \"./commands/tailordb/migrate/config\";\nexport {\n  hasChanges,\n  formatMigrationDiff,\n  formatDiffSummary,\n  type MigrationDiff,\n  type BreakingChangeInfo,\n} from \"./commands/tailordb/migrate/diff-calculator\";\nexport {\n  SCHEMA_FILE_NAME,\n  DIFF_FILE_NAME,\n  MIGRATE_FILE_NAME,\n  MIGRATE_TEST_FILE_NAME,\n  MIGRATE_PGLITE_TEST_FILE_NAME,\n  DB_TYPES_FILE_NAME,\n  DB_PGLITE_SCHEMA_FILE_NAME,\n  INITIAL_SCHEMA_NUMBER,\n  getMigrationDirPath,\n  getMigrationFilePath,\n  type SchemaSnapshot,\n  type NormalizedSchemaSnapshot,\n  type TailorDBSnapshotType,\n  type SnapshotFieldConfig,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./commands/tailordb/migrate/types\";\n\n// Seed exports\nexport {\n  loadSeedContext,\n  type LoadSeedContextOptions,\n  type SeedContext,\n  type SeedIdpUserContext,\n  type SeedNamespaceConfig,\n} from \"./shared/seed-context\";\nexport {\n  chunkSeedData,\n  type SeedChunk,\n  type ChunkSeedDataOptions,\n  type SeedData,\n} from \"./shared/seed-chunker\";\nexport {\n  bundleSeedScript,\n  bundleSeedDumpScript,\n  type SeedBundleResult,\n  type SeedDumpBundleResult,\n} from \"./commands/generate/seed/bundler\";\nexport {\n  bundleMigrationScript,\n  type MigrationBundleResult,\n} from \"./commands/tailordb/migrate/bundler\";\nexport {\n  executeScript,\n  waitForExecution,\n  type ScriptExecutionOptions,\n  type ScriptExecutionResult,\n  type ScriptInvoker,\n  type ExecutionWaitResult,\n} from \"./shared/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./shared/client\";\nexport type { AuthInvoker } from \"@tailor-platform/tailor-proto/auth_resource_pb\";\n"],"mappings":"ipCAGA,MAAM,GAAe,IAAI,IAAI,gBAAiB,YAAY,GAAG,CAAC"}