UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

224 lines (223 loc) 12.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.env = void 0; const env_struct_1 = require("env-struct"); const v4_1 = require("zod/v4"); const DonobuDeploymentEnvironment_1 = require("./models/DonobuDeploymentEnvironment"); /** * This is the set of environment variable (for the process) names that Donobu may use. * This should not be confused with the user-defined API-based environment variables * that may be used in a flow. */ exports.env = env_struct_1.Env.fromZod(v4_1.z.object({ APPDATA: v4_1.z.string().optional() .describe(`Windows-specific roaming application data directory. This is typically set by the OS and used to derive platform default storage paths. This is ignored if BASE_WORKING_DIR is explicitly set.`), BASE_WORKING_DIR: v4_1.z .string() .optional() .describe(`Overrides the effective working/persistence directory.`), BASE64_GPT_CONFIG: v4_1.z.string().optional() .describe(`If specified, use this base-64 JSON GPT configuration for running flows. This takes priority over all other GPT configuration options.`), BROWSERBASE_API_KEY: v4_1.z .string() .optional() .describe(`The API key to use for the BrowserBase API.`), BROWSERBASE_PROJECT_ID: v4_1.z .string() .optional() .describe(`The project ID to use for the BrowserBase API.`), LOG_LEVEL: v4_1.z .enum(['error', 'warn', 'info', 'debug']) .default('info') .describe(`Sets the minimum log level for the application logger.`), DONOBU_DEPLOYMENT_ENVIRONMENT: DonobuDeploymentEnvironment_1.DonobuDeploymentEnvironmentSchema.optional().describe(`The deployment environment for this application.`), DONOBU_API_BASE_URL: v4_1.z .string() .default('https://donobu-prd-api-service-73193699649.us-central1.run.app') .describe('The base URL for the Donobu API'), ANTHROPIC_API_KEY: v4_1.z.string().optional() .describe(`Automatically create GPT configurations for Anthropic using this API key. For convenience, the created configuration names will reflect the underlying models they map to (ex: "claude-sonnet-4-5-latest", etc).`), ANTHROPIC_MODEL_NAME: v4_1.z.string().optional() .describe(`If specified, this will shade the default flow runner agent when running flows. If specified, ANTHROPIC_API_KEY must also be specified.`), DONOBU_MAX_STABILITY_WAIT_MS: v4_1.z .number() .int() .nonnegative() .default(5000) .describe(`Overrides the maximum wait time (in milliseconds) used by waitForPageStability.`), DONOBU_MIN_STABILITY_WAIT_MS: v4_1.z .number() .int() .nonnegative() .default(1000) .describe(`Overrides the minimum wait time (in milliseconds) used by waitForPageStability.`), DONOBU_AUTO_HEAL_ACTIVE: v4_1.z.enum(['0', '1', 'true', 'false']).optional() .describe(`Internal flag the CLI sets while running an auto-heal retry. Fixtures can use this to annotate healed tests or branch logic without relying on CLI arguments. Treat any non-false value ("1"/"true") as meaning the current Playwright invocation is part of an automated heal.`), DONOBU_AUTO_HEAL_ORCHESTRATED: v4_1.z .enum(['0', '1', 'true', 'false']) .optional() .describe(`Internal coordination flag set by the CLI when it intends to take responsibility for posting the final Slack payload itself. Tells the Slack reporter to defer its POST so users see exactly one message per run reflecting the merged outcome.`), DONOBU_REPORT_URL: v4_1.z.string().optional() .describe(`Optional URL to embed in the Slack message that links back to the full report (e.g. the GitHub Actions run URL, or a published HTML report). When unset, the message simply omits the link section.`), DONOBU_SLACK_WEBHOOK_URL: v4_1.z.string().optional() .describe(`Slack Incoming Webhook URL the Slack reporter POSTs to. Treated as a secret and read only from the environment. When unset, the reporter still writes the payload file but performs no network call.`), GITHUB_STEP_SUMMARY: v4_1.z.string().optional() .describe(`Set by the GitHub Actions runner to the path of a per-step Markdown file. Anything written here is concatenated into the workflow run's job summary. The Donobu Markdown reporter writes to this automatically when running inside a GHA step so no separate workflow step is needed.`), GITHUB_RUN_ID: v4_1.z .string() .optional() .describe(`Set by the GitHub Actions runner. Used by the auto-heal PR body footer to link back to the workflow run that produced the heal.`), GITHUB_RUN_NUMBER: v4_1.z .string() .optional() .describe(`Set by the GitHub Actions runner. Embedded in the auto-heal PR body footer as a human-friendly run number.`), GITHUB_SERVER_URL: v4_1.z .string() .optional() .describe(`Set by the GitHub Actions runner (e.g. https://github.com). Combined with GITHUB_REPOSITORY and GITHUB_RUN_ID to build the auto-heal PR body footer link.`), GITHUB_REPOSITORY: v4_1.z .string() .optional() .describe(`Set by the GitHub Actions runner (owner/repo). Used by the auto-heal PR body footer link.`), GITHUB_ACTOR: v4_1.z .string() .optional() .describe(`Set by the GitHub Actions runner. Embedded in the auto-heal PR body footer as the user who triggered the run.`), GITHUB_REF_NAME: v4_1.z .string() .optional() .describe(`Set by the GitHub Actions runner. Embedded in the auto-heal PR body footer as the source branch.`), CI_PIPELINE_URL: v4_1.z .string() .optional() .describe(`Set by the GitLab CI runner. Used by the auto-heal MR body footer to link back to the pipeline that produced the heal.`), CI_PIPELINE_IID: v4_1.z .string() .optional() .describe(`Set by the GitLab CI runner — the per-project pipeline number GitLab shows in its UI. Embedded in the auto-heal MR body footer.`), GITLAB_USER_LOGIN: v4_1.z .string() .optional() .describe(`Set by the GitLab CI runner. Embedded in the auto-heal MR body footer as the user who triggered the pipeline.`), CI_COMMIT_REF_NAME: v4_1.z .string() .optional() .describe(`Set by the GitLab CI runner. Embedded in the auto-heal MR body footer as the source branch.`), PLAYWRIGHT_JSON_OUTPUT_DIR: v4_1.z.string().optional() .describe(`Directory where the Playwright JSON reporter writes its output (and where the Donobu reporters merge their per-reporter state into a shared sidecar so the auto-heal orchestrator can re-render reports from merged data).`), DONOBU_PAGE_AI_CLEAR_CACHE: v4_1.z.enum(['0', '1', 'true', 'false']).optional() .describe(`When truthy (for example '1' or 'true'), instructs the Playwright fixtures to bypass and invalidate Page.AI cache entries for the current run. The Donobu CLI sets this automatically when invoked with \`--clear-ai-cache\` so a retry always regenerates selectors from scratch.`), GOOGLE_GENERATIVE_AI_API_KEY: v4_1.z.string().optional() .describe(`Automatically create GPT configurations for Google Gemini using this API key. For convenience, the created configuration names will reflect the underlying models they map to (ex: "gemini-2.0-flash", etc).`), GOOGLE_GENERATIVE_AI_MODEL_NAME: v4_1.z.string().optional() .describe(`If specified, this will shade the default flow runner agent when running flows. If specified, GOOGLE_GENERATIVE_AI_API_KEY must also be specified.`), OLLAMA_MODEL_NAME: v4_1.z.string().optional() .describe(`If specified, automatically create a GPT configuration for Ollama using this model name (e.g. "llama3.2", "qwen2.5"). Ollama must be running locally or at the URL specified by OLLAMA_API_URL.`), OLLAMA_API_URL: v4_1.z.string().optional() .describe(`The base URL for the Ollama API. Defaults to http://localhost:11434 if not specified. Only used when OLLAMA_MODEL_NAME is also set.`), OPENAI_API_KEY: v4_1.z.string().optional() .describe(`Automatically create GPT configurations for OpenAI using this API key. For convenience, the created configuration names will reflect the underlying models they map to (ex: "gpt-4o", etc).`), OPENAI_API_MODEL_NAME: v4_1.z.string().optional() .describe(`If specified, this will shade the default flow runner agent when running flows. If specified, OPENAI_API_KEY must also be specified.`), PERSISTENCE_PRIORITY: v4_1.z .array(v4_1.z.string()) .default(['DONOBU', 'S3', 'GCS', 'LOCAL', 'RAM']) .describe(`Controls which persistence backends are active and the order in which they are consulted. Backends not listed are excluded entirely. The first entry is the primary layer used for single-layer operations. Built-in values: DONOBU (Donobu API), LOCAL (SQLite), RAM (in-memory, non-durable). Additional backends (e.g. S3, GCS) are available via persistence plugins. Each backend still requires its own configuration to actually be available.`), AWS_S3_BUCKET: v4_1.z.string().optional() .describe(`Directs Donobu flows to be persisted using this AWS S3 bucket. Takes priority over GOOGLE_CLOUD_STORAGE_BUCKET being specified.`), AWS_S3_REGION: v4_1.z.string().optional() .describe(`The AWS S3 region the corresponding AWS_S3_BUCKET lives in. Fails over to the AWS_REGION environment variable if not specified.`), AWS_BEDROCK_MODEL_NAME: v4_1.z.string().optional() .describe(`If specified, this will shade the default flow runner agent when running flows. If specified, AWS credentials must also be present.`), AWS_REGION: v4_1.z .string() .optional() .describe(`The AWS region to use for operations using the AWS SDK.`), AWS_ACCESS_KEY_ID: v4_1.z .string() .optional() .describe(`The AWS access key ID to use for operations using the AWS SDK.`), AWS_SECRET_ACCESS_KEY: v4_1.z .string() .optional() .describe(`The AWS access key to use for operations using the AWS SDK.`), EXPERIMENTAL_FEATURES_ENABLED: v4_1.z .boolean() .default(false) .describe(`If set to true, then experimental Donobu features will be enabled. There is no guarantee for stability of these features.`), DONOBU_API_KEY: v4_1.z .string() .optional() .describe(`The API key for the Donobu API. Used to create GPT configurations backed by the Donobu API, and to persist flows via the Donobu API when set.`), DONOBU_PERSISTENCE_API_KEY: v4_1.z .string() .optional() .describe(`Persistence-only fallback for the Donobu API key. When set, the DONOBU persistence layer will instantiate using this key if DONOBU_API_KEY is absent — but unlike DONOBU_API_KEY, this value is NOT consulted by DonobuFlowsManager.createGptClient's env-var fallback chain. Intended for hosts (e.g. the Donobu Studio desktop app) that drive AI inference through an explicit gpt-config / flow-runner agent and want to enable Donobu Cloud persistence without their persistence credential silently overriding the user's flow-runner pick.`), GOOGLE_CLOUD_STORAGE_BUCKET: v4_1.z.string().optional() .describe(`Directs Donobu flows to be persisted using this Google Cloud Storage bucket.`), SCREENSHOT_TIMEOUT_MS: v4_1.z.number().default(3000), SELF_HEAL_TESTS_ENABLED: v4_1.z.string().optional() .describe(`If set to 'true', then Donobu will attempt to self-heal tests. This option is only used when using Donobu as a library to run Playwright-based tests.`), PROXY_SERVER: v4_1.z.string().optional() .describe(`Default URL for the browser proxy configuration. Only applies when running flows using the 'device' type and a proxy URL is not otherwise specified.`), PROXY_USERNAME: v4_1.z.string().optional() .describe(`Default user name for the browser proxy configuration. Only applies when running flows using the 'device' type and a proxy username is not otherwise specified.`), PROXY_PASSWORD: v4_1.z.string().optional() .describe(`Default password for the browser proxy configuration. Only applies when running flows using the 'device' type and a proxy password is not otherwise specified.`), XDG_CONFIG_HOME: v4_1.z.string().optional() .describe(`Linux-specific configuration directory root following the XDG Base Directory specification. Used to derive platform default storage paths. This is ignored if BASE_WORKING_DIR is explicitly set.`), })); //# sourceMappingURL=envVars.js.map