package runtimedeploy

import webhookdomain "github.com/codex-k8s/kodex/libs/go/domain/webhook"

func defaultTemplateVars() map[string]string {
	return map[string]string{
		"KODEX_PRODUCTION_NAMESPACE":                                    "kodex-prod",
		"KODEX_PLATFORM_NAMESPACE":                                      "kodex-prod",
		"KODEX_INTERNAL_REGISTRY_SERVICE":                               "kodex-registry",
		"KODEX_INTERNAL_REGISTRY_PORT":                                  "5000",
		"KODEX_INTERNAL_REGISTRY_HOST":                                  "127.0.0.1:5000",
		"KODEX_INTERNAL_REGISTRY_STORAGE_SIZE":                          "20Gi",
		"KODEX_REGISTRY_IMAGE":                                          "registry:2",
		"KODEX_POSTGRES_IMAGE":                                          "127.0.0.1:5000/kodex/mirror/pgvector:pg16",
		"KODEX_BUSYBOX_IMAGE":                                           "127.0.0.1:5000/kodex/mirror/busybox:1.36",
		"KODEX_OAUTH2_PROXY_IMAGE":                                      "127.0.0.1:5000/kodex/mirror/oauth2-proxy:v7.6.0",
		"KODEX_CODEGEN_CHECK_IMAGE":                                     "127.0.0.1:5000/kodex/mirror/golang:1.24-bookworm",
		"KODEX_KUBECTL_IMAGE":                                           "127.0.0.1:5000/kodex/mirror/alpine-k8s:1.32.2",
		"KODEX_CODEGEN_CHECK_ENABLED":                                   "true",
		"KODEX_CODEGEN_CHECK_TIMEOUT":                                   "30m",
		"KODEX_KANIKO_CACHE_ENABLED":                                    "false",
		"KODEX_KANIKO_CACHE_TTL":                                        "168h",
		"KODEX_KANIKO_CACHE_COMPRESSED":                                 "false",
		"KODEX_KANIKO_CACHE_COPY_LAYERS":                                "true",
		"KODEX_KANIKO_SNAPSHOT_MODE":                                    "redo",
		"KODEX_KANIKO_SINGLE_SNAPSHOT":                                  "true",
		"KODEX_KANIKO_USE_NEW_RUN":                                      "true",
		"KODEX_KANIKO_VERBOSITY":                                        "info",
		"KODEX_KANIKO_CLEANUP":                                          "",
		"KODEX_KANIKO_CPU_REQUEST":                                      "4",
		"KODEX_KANIKO_MEMORY_REQUEST":                                   "8Gi",
		"KODEX_KANIKO_CPU_LIMIT":                                        "16",
		"KODEX_KANIKO_MEMORY_LIMIT":                                     "32Gi",
		"KODEX_KANIKO_MAX_PARALLEL":                                     "8",
		"KODEX_IMAGE_MIRROR_ENABLED":                                    "true",
		"KODEX_IMAGE_MIRROR_MAX_PARALLEL":                               "8",
		"KODEX_IMAGE_MIRROR_TOOL_IMAGE":                                 "gcr.io/go-containerregistry/crane:debug",
		"KODEX_IMAGE_MIRROR_PLATFORM":                                   "linux/amd64",
		"KODEX_RUNTIME_DEPLOY_WORKERS_PER_POD":                          "4",
		"KODEX_KANIKO_CLONE_IMAGE":                                      "127.0.0.1:5000/kodex/mirror/alpine-git:2.47.2",
		"KODEX_KANIKO_EXECUTOR_IMAGE":                                   "127.0.0.1:5000/kodex/mirror/kaniko-executor:v1.23.2-debug",
		"KODEX_REPO_SYNC_IMAGE":                                         "127.0.0.1:5000/kodex/mirror/alpine-git:2.47.2",
		"KODEX_REGISTRY_CLEANUP_KEEP_TAGS":                              "5",
		"KODEX_API_GATEWAY_IMAGE":                                       "127.0.0.1:5000/kodex/api-gateway:latest",
		"KODEX_CONTROL_PLANE_IMAGE":                                     "127.0.0.1:5000/kodex/control-plane:latest",
		"KODEX_WORKER_IMAGE":                                            "127.0.0.1:5000/kodex/worker:latest",
		"KODEX_AGENT_RUNNER_IMAGE":                                      "127.0.0.1:5000/kodex/agent-runner:latest",
		"KODEX_WEB_CONSOLE_IMAGE":                                       "127.0.0.1:5000/kodex/web-console:latest",
		"KODEX_WORKER_JOB_IMAGE":                                        "",
		"KODEX_WORKER_JOB_IMAGE_FALLBACK":                               "",
		"KODEX_WORKER_JOB_IMAGE_CHECK_TIMEOUT":                          "10s",
		"KODEX_PLATFORM_DEPLOYMENT_REPLICAS":                            "",
		"KODEX_WORKER_REPLICAS":                                         "",
		"KODEX_WORKER_POLL_INTERVAL":                                    "5s",
		"KODEX_WORKER_CLAIM_LIMIT":                                      "10",
		"KODEX_WORKER_RUNNING_CHECK_LIMIT":                              "200",
		"KODEX_WORKER_SLOTS_PER_PROJECT":                                "2",
		"KODEX_WORKER_SLOT_LEASE_TTL":                                   "10m",
		"KODEX_WORKER_K8S_NAMESPACE":                                    "kodex-prod",
		"KODEX_WORKER_JOB_COMMAND":                                      "/usr/local/bin/kodex-agent-runner",
		"KODEX_WORKER_JOB_TTL_SECONDS":                                  "600",
		"KODEX_WORKER_JOB_BACKOFF_LIMIT":                                "0",
		"KODEX_WORKER_JOB_ACTIVE_DEADLINE_SECONDS":                      "18000",
		"KODEX_WORKER_RUN_NAMESPACE_PREFIX":                             "codex-issue",
		"KODEX_WORKER_RUN_NAMESPACE_CLEANUP":                            "true",
		"KODEX_WORKER_NAMESPACE_LEASE_SWEEP_LIMIT":                      "200",
		"KODEX_WORKER_NAMESPACE_CLEANUP_CRON_SCHEDULE":                  "*/15 * * * *",
		"KODEX_WORKER_NAMESPACE_CLEANUP_CRON_SUSPEND":                   "false",
		"KODEX_WORKER_NAMESPACE_CLEANUP_CRON_STARTING_DEADLINE_SECONDS": "300",
		"KODEX_WORKER_NAMESPACE_CLEANUP_CRON_SUCCESS_HISTORY_LIMIT":     "1",
		"KODEX_WORKER_NAMESPACE_CLEANUP_CRON_FAILED_HISTORY_LIMIT":      "3",
		"KODEX_WORKER_NAMESPACE_CLEANUP_CRON_ACTIVE_DEADLINE_SECONDS":   "900",
		"KODEX_WORKER_RUN_SERVICE_ACCOUNT":                              "codex-runner",
		"KODEX_WORKER_RUN_ROLE_NAME":                                    "codex-runner",
		"KODEX_WORKER_RUN_ROLE_BINDING_NAME":                            "codex-runner",
		"KODEX_WORKER_RUN_RESOURCE_QUOTA_NAME":                          "codex-run-quota",
		"KODEX_WORKER_RUN_LIMIT_RANGE_NAME":                             "codex-run-limits",
		"KODEX_WORKER_RUN_CREDENTIALS_SECRET_NAME":                      "codex-run-credentials",
		"KODEX_WORKER_RUN_QUOTA_PODS":                                   "20",
		"KODEX_AGENT_DEFAULT_MODEL":                                     "gpt-5.4",
		"KODEX_AGENT_DEFAULT_REASONING_EFFORT":                          "high",
		"KODEX_AGENT_DEFAULT_LOCALE":                                    "ru",
		"KODEX_AGENT_BASE_BRANCH":                                       "main",
		"KODEX_K8S_API_PORT":                                            "6443",
		"KODEX_PRODUCTION_DOMAIN":                                       "platform.kodex.works",
		"KODEX_AI_DOMAIN":                                               "ai.platform.kodex.works",
		"KODEX_TLS_SYSTEM_NAMESPACE":                                    "kodex-system",
		"KODEX_CERT_MANAGER_ANNOTATE":                                   "false",
		"KODEX_CERT_ISSUER_ENABLED":                                     "false",
	}
}

var labelCatalogDefaults = map[string]string{
	"KODEX_RUN_INTAKE_LABEL":                   webhookdomain.DefaultRunIntakeLabel,
	"KODEX_RUN_INTAKE_REVISE_LABEL":            webhookdomain.DefaultRunIntakeReviseLabel,
	"KODEX_RUN_VISION_LABEL":                   webhookdomain.DefaultRunVisionLabel,
	"KODEX_RUN_VISION_REVISE_LABEL":            webhookdomain.DefaultRunVisionReviseLabel,
	"KODEX_RUN_PRD_LABEL":                      webhookdomain.DefaultRunPRDLabel,
	"KODEX_RUN_PRD_REVISE_LABEL":               webhookdomain.DefaultRunPRDReviseLabel,
	"KODEX_RUN_ARCH_LABEL":                     webhookdomain.DefaultRunArchLabel,
	"KODEX_RUN_ARCH_REVISE_LABEL":              webhookdomain.DefaultRunArchReviseLabel,
	"KODEX_RUN_DESIGN_LABEL":                   webhookdomain.DefaultRunDesignLabel,
	"KODEX_RUN_DESIGN_REVISE_LABEL":            webhookdomain.DefaultRunDesignReviseLabel,
	"KODEX_RUN_PLAN_LABEL":                     webhookdomain.DefaultRunPlanLabel,
	"KODEX_RUN_PLAN_REVISE_LABEL":              webhookdomain.DefaultRunPlanReviseLabel,
	"KODEX_RUN_DEV_LABEL":                      webhookdomain.DefaultRunDevLabel,
	"KODEX_RUN_DEV_REVISE_LABEL":               webhookdomain.DefaultRunDevReviseLabel,
	"KODEX_RUN_DEBUG_LABEL":                    webhookdomain.DefaultRunDebugLabel,
	"KODEX_RUN_DOC_AUDIT_LABEL":                webhookdomain.DefaultRunDocAuditLabel,
	"KODEX_RUN_DOC_AUDIT_REVISE_LABEL":         webhookdomain.DefaultRunDocAuditReviseLabel,
	"KODEX_RUN_AI_REPAIR_LABEL":                webhookdomain.DefaultRunAIRepairLabel,
	"KODEX_RUN_QA_LABEL":                       webhookdomain.DefaultRunQALabel,
	"KODEX_RUN_QA_REVISE_LABEL":                webhookdomain.DefaultRunQAReviseLabel,
	"KODEX_RUN_RELEASE_LABEL":                  webhookdomain.DefaultRunReleaseLabel,
	"KODEX_RUN_RELEASE_REVISE_LABEL":           webhookdomain.DefaultRunReleaseReviseLabel,
	"KODEX_RUN_POSTDEPLOY_LABEL":               webhookdomain.DefaultRunPostDeployLabel,
	"KODEX_RUN_POSTDEPLOY_REVISE_LABEL":        webhookdomain.DefaultRunPostDeployReviseLabel,
	"KODEX_RUN_OPS_LABEL":                      webhookdomain.DefaultRunOpsLabel,
	"KODEX_RUN_OPS_REVISE_LABEL":               webhookdomain.DefaultRunOpsReviseLabel,
	"KODEX_RUN_SELF_IMPROVE_LABEL":             webhookdomain.DefaultRunSelfImproveLabel,
	"KODEX_RUN_SELF_IMPROVE_REVISE_LABEL":      webhookdomain.DefaultRunSelfImproveReviseLabel,
	"KODEX_RUN_RETHINK_LABEL":                  webhookdomain.DefaultRunRethinkLabel,
	"KODEX_MODE_DISCUSSION_LABEL":              webhookdomain.DefaultModeDiscussionLabel,
	"KODEX_STATE_BLOCKED_LABEL":                webhookdomain.DefaultStateBlockedLabel,
	"KODEX_STATE_IN_REVIEW_LABEL":              webhookdomain.DefaultStateInReviewLabel,
	"KODEX_STATE_APPROVED_LABEL":               webhookdomain.DefaultStateApprovedLabel,
	"KODEX_STATE_SUPERSEDED_LABEL":             webhookdomain.DefaultStateSupersededLabel,
	"KODEX_STATE_ABANDONED_LABEL":              webhookdomain.DefaultStateAbandonedLabel,
	"KODEX_NEED_INPUT_LABEL":                   webhookdomain.DefaultNeedInputLabel,
	"KODEX_NEED_PM_LABEL":                      webhookdomain.DefaultNeedPMLabel,
	"KODEX_NEED_SA_LABEL":                      webhookdomain.DefaultNeedSALabel,
	"KODEX_NEED_QA_LABEL":                      webhookdomain.DefaultNeedQALabel,
	"KODEX_NEED_SRE_LABEL":                     webhookdomain.DefaultNeedSRELabel,
	"KODEX_NEED_EM_LABEL":                      webhookdomain.DefaultNeedEMLabel,
	"KODEX_NEED_KM_LABEL":                      webhookdomain.DefaultNeedKMLabel,
	"KODEX_NEED_REVIEWER_LABEL":                webhookdomain.DefaultNeedReviewerLabel,
	"KODEX_AI_MODEL_GPT_5_4_LABEL":             "[ai-model-gpt-5.4]",
	"KODEX_AI_MODEL_GPT_5_3_CODEX_LABEL":       "[ai-model-gpt-5.3-codex]",
	"KODEX_AI_MODEL_GPT_5_3_CODEX_SPARK_LABEL": "[ai-model-gpt-5.3-codex-spark]",
	"KODEX_AI_MODEL_GPT_5_2_CODEX_LABEL":       "[ai-model-gpt-5.2-codex]",
	"KODEX_AI_MODEL_GPT_5_1_CODEX_MAX_LABEL":   "[ai-model-gpt-5.1-codex-max]",
	"KODEX_AI_MODEL_GPT_5_2_LABEL":             "[ai-model-gpt-5.2]",
	"KODEX_AI_MODEL_GPT_5_1_CODEX_MINI_LABEL":  "[ai-model-gpt-5.1-codex-mini]",
	"KODEX_AI_REASONING_LOW_LABEL":             "[ai-reasoning-low]",
	"KODEX_AI_REASONING_MEDIUM_LABEL":          "[ai-reasoning-medium]",
	"KODEX_AI_REASONING_HIGH_LABEL":            "[ai-reasoning-high]",
	"KODEX_AI_REASONING_EXTRA_HIGH_LABEL":      "[ai-reasoning-extra-high]",
}
