-
-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy patherrors.go
More file actions
1628 lines (1492 loc) · 114 KB
/
Copy patherrors.go
File metadata and controls
1628 lines (1492 loc) · 114 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package errors
import (
"errors"
"fmt"
schemaPkg "github.com/cloudposse/atmos/pkg/schema"
)
const (
// ErrWrapFormat is the standard format string for wrapping errors with context.
// Use with fmt.Errorf to wrap a sentinel error with an underlying error:
// fmt.Errorf(ErrWrapFormat, errUtils.ErrSentinel, underlyingErr)
ErrWrapFormat = "%w: %w"
// ErrWrapWithNameFormat is the format string for wrapping errors with a name context.
// Use with fmt.Errorf to wrap a sentinel error with a name:
// fmt.Errorf(ErrWrapWithNameFormat, errUtils.ErrSentinel, name)
ErrWrapWithNameFormat = "%w: %s"
// ErrWrapWithNameAndCauseFormat is the format string for wrapping errors with a name and cause.
// Use with fmt.Errorf to wrap a sentinel error with a name and underlying error:
// fmt.Errorf(ErrWrapWithNameAndCauseFormat, errUtils.ErrSentinel, name, underlyingErr)
ErrWrapWithNameAndCauseFormat = "%w '%s': %w"
)
var (
ErrDownloadPackage = errors.New("failed to download package")
ErrDownloadFile = errors.New("failed to download file")
ErrInvalidClientMode = errors.New("invalid client mode for operation")
ErrInvalidErrorMode = errors.New("invalid error mode")
ErrParseFile = errors.New("failed to parse file")
ErrParseURL = errors.New("failed to parse URL")
ErrInvalidURL = errors.New("invalid URL")
ErrCreateDownloadClient = errors.New("failed to create download client")
ErrProcessOCIImage = errors.New("failed to process OCI image")
ErrCopyPackage = errors.New("failed to copy package")
ErrCreateTempDir = errors.New("failed to create temp directory")
ErrUnknownPackageType = errors.New("unknown package type")
ErrLocalMixinURICannotBeEmpty = errors.New("local mixin URI cannot be empty")
ErrLocalMixinInstallationNotImplemented = errors.New("local mixin installation not implemented")
ErrNotImplemented = errors.New("not implemented")
ErrFailedToInitializeTUIModel = errors.New("failed to initialize TUI model: verify terminal capabilities and permissions")
ErrSetTempDirPermissions = errors.New("failed to set temp directory permissions")
ErrCopyPackageToTarget = errors.New("failed to copy package to target")
ErrNoValidInstallerPackage = errors.New("no valid installer package provided")
ErrFailedToInitializeTUIModelWithDetails = errors.New("failed to initialize TUI model: verify terminal capabilities and permissions")
ErrValidPackage = errors.New("no valid installer package provided for")
ErrTUIModel = errors.New("failed to initialize TUI model")
ErrTUIRun = errors.New("failed to run TUI")
ErrUIFormatterNotInitialized = errors.New("ui formatter not initialized")
ErrMarkdownRendererInit = errors.New("failed to initialize markdown renderer")
ErrMarkdownRender = errors.New("failed to render markdown content")
ErrCastOutputExists = errors.New("cast output already exists")
ErrEmptyCastFile = errors.New("empty cast file")
ErrUnsupportedCastOutputExtension = errors.New("unsupported cast output extension")
ErrRenderOutputExists = errors.New("render output already exists")
ErrMissingAgg = errors.New("missing required tool `agg`; install asciinema agg and retry")
ErrMissingFFmpeg = errors.New("missing required tool `ffmpeg`; install FFmpeg and retry")
ErrMissingRenderOutput = errors.New("specify an output path with --output")
ErrRenderToolExecFailed = errors.New("managed renderer execution failed")
ErrUnknownSessionAction = errors.New("unknown cast session action type")
ErrSimulateActionMissingCallback = errors.New("simulate session action has no callback")
ErrWaitTimeout = errors.New("timed out waiting for cast output")
ErrUnsupportedCastKey = errors.New("unsupported cast key")
ErrMissingExecCommand = errors.New("exec recording requires a command")
ErrIOContextNotInitialized = errors.New("global I/O context is nil after initialization")
ErrNoFilesFound = errors.New("no files found in directory")
ErrMultipleFilesFound = errors.New("multiple files found in directory")
ErrSourceDirNotExist = errors.New("source directory does not exist")
ErrEmptyFilePath = errors.New("file path is empty")
ErrEmptyWorkdir = errors.New("workdir cannot be empty")
ErrWorkdirNotExist = errors.New("workdir does not exist")
ErrPathResolution = errors.New("failed to resolve absolute path")
ErrInvalidTemplateFunc = errors.New("invalid template function")
ErrInvalidTemplateSettings = errors.New("invalid template settings")
ErrTemplateEvaluation = errors.New("template evaluation failed")
ErrCommandEnvDecodeFailed = schemaPkg.ErrCommandEnvDecodeFailed
ErrCastStepRequiresSteps = errors.New("cast step requires nested steps")
ErrCastSessionRequiresActions = errors.New("cast session step requires session actions")
ErrInvalidCastMode = errors.New("cast step has invalid mode")
ErrWriteActionRequiresText = errors.New("write action requires text")
ErrKeyActionRequiresKey = errors.New("key action requires key")
ErrPauseActionRequiresDuration = errors.New("pause action requires duration")
ErrWaitActionRequiresTextOrRegex = errors.New("wait action requires exactly one of text or regex")
ErrUnsupportedSessionAction = errors.New("unsupported session action type")
ErrInvalidSimulateMode = errors.New("simulate step has invalid mode")
ErrSimulateTypedRequiresText = errors.New("simulate typed step requires text")
ErrInvalidSimulateJitter = errors.New("simulate typed step jitter must be between 0 and 1")
ErrUnsupportedPromptStyle = errors.New("unsupported simulate prompt style")
ErrWorkdirPathRequired = errors.New("workdir path is required")
ErrWorkdirSourceRequired = errors.New("workdir source is required")
ErrWorkdirSourceKeyInvalid = errors.New("workdir source map keys must be strings")
ErrUnsafeVendorTarget = errors.New("unsafe vendor target directory")
ErrInvalidConfig = errors.New("invalid configuration")
ErrRefuseDeleteSymbolicLink = errors.New("refusing to delete symbolic link")
ErrRefuseWriteThroughSymlink = errors.New("refusing to write through symbolic link")
ErrNoDocsGenerateEntry = errors.New("no docs.generate entry found")
ErrMissingDocType = errors.New("doc-type argument missing")
ErrUnsupportedInputType = errors.New("unsupported input type")
ErrMissingStackNameTemplateAndPattern = errors.New("'stacks.name_template' (or the deprecated 'stacks.name_pattern') needs to be specified in 'atmos.yaml'")
ErrStackNamePatternPartMissing = errors.New("stack name pattern references a context part that is not defined in the stack file")
ErrFailedMarshalConfigToYaml = errors.New("failed to marshal config to YAML")
ErrStacksDirectoryDoesNotExist = errors.New("directory for Atmos stacks does not exist")
ErrMissingAtmosConfig = errors.New("atmos configuration not found or invalid")
ErrNotInGitRepository = errors.New("not inside a git repository")
ErrCommandNil = errors.New("command cannot be nil")
ErrProcessStartFailed = errors.New("process start failed")
ErrProcessWaitFailed = errors.New("process wait failed")
ErrGitHubRateLimitExceeded = errors.New("GitHub API rate limit exceeded")
ErrInvalidLimit = errors.New("limit must be between 1 and 100")
ErrInvalidOffset = errors.New("offset must be >= 0")
ErrDuplicateFlagRegistration = errors.New("duplicate flag registration")
ErrReservedFlagName = errors.New("reserved flag name")
ErrInvalidSinceDate = errors.New("invalid date format for --since")
ErrTerminalTooNarrow = errors.New("terminal too narrow")
ErrSpinnerReturnedNilModel = errors.New("spinner returned nil model")
ErrSpinnerUnexpectedModelType = errors.New("spinner returned unexpected model type")
ErrSpinnerOperationInterrupted = errors.New("operation was interrupted")
// Version Tracker errors.
ErrVersionTrackNotFound = errors.New("version track not found")
ErrVersionNotFound = errors.New("version not found")
ErrVersionNotLocked = errors.New("version not locked")
ErrVersionTrackNotVerified = errors.New("version track is not verified")
ErrDesiredVersionRequired = errors.New("desired version is required")
ErrVersionEntryExists = errors.New("version entry already exists")
ErrVersionEntryNotFound = errors.New("version entry not found")
ErrInvalidVersionCooldown = errors.New("invalid cooldown")
ErrVersionRenderFileRequired = errors.New("--file is required")
ErrVersionRenderDrift = errors.New("rendered output differs from committed file")
ErrUnsupportedVersionTrackFormat = errors.New("unsupported output format (supported: yaml, json)")
ErrUnsupportedVersionShow = errors.New("unsupported --show value (supported: desired, locked)")
ErrUnsupportedVersionField = errors.New("unsupported --show value (supported: name, ecosystem, datasource, provider, package, desired, group, update, include, exclude, prerelease, labels, locked)")
ErrVersionFilesDrift = errors.New("version-managed files are out of date; run `atmos version track apply`")
ErrUnknownVersionFileManager = errors.New("unknown file manager")
ErrDuplicateVersionFileManager = errors.New("duplicate file manager registration")
ErrVersionMarkerBadMatch = errors.New("marker match expression must compile and contain one capture group")
// Theme-related errors.
ErrThemeNotFound = errors.New("theme not found")
ErrInvalidTheme = errors.New("invalid theme")
// Experimental feature errors.
ErrExperimentalDisabled = errors.New("experimental command is disabled")
ErrExperimentalRequiresIn = errors.New("experimental command requires explicit opt-in")
// Authentication and TTY errors.
ErrAuthConsole = errors.New("auth console operation failed")
ErrProviderNotSupported = errors.New("provider does not support this operation")
// ErrWebflowRequiresAWSUser indicates --webflow was used without a direct aws/user identity.
ErrWebflowRequiresAWSUser = errors.New("--webflow requires an aws/user identity")
ErrUnknownServiceAlias = errors.New("unknown service alias")
ErrUnknownHelpTopic = errors.New("unknown help topic")
ErrTTYRequired = errors.New("requires a TTY")
ErrInvalidAuthManagerType = errors.New("invalid authManager type")
// Component and positional argument errors.
ErrComponentRequired = errors.New("component is required")
ErrInvalidPositionalArgs = errors.New("invalid positional arguments")
ErrWorkflowNameRequired = errors.New("workflow name is required")
ErrInvalidStackConfiguration = errors.New("invalid stack configuration")
ErrPathNotWithinComponentBase = errors.New("path is not within component base path")
ErrStackRequired = errors.New("--stack flag is required")
ErrStackHasNoLocals = errors.New("stack has no locals defined")
ErrNoStackManifestsFound = errors.New("no stack manifests found")
// ErrPlanHasDiff is returned when there are differences between two Terraform plan files.
ErrPlanHasDiff = errors.New("plan files have differences")
// ErrPlanVerificationFailed is returned when a stored planfile differs from the current state during --verify-plan.
ErrPlanVerificationFailed = errors.New("plan verification failed: stored plan differs from current state")
// ErrStoredPlanfileMissing is returned when a deploy expected a stored planfile to verify against but none was found.
ErrStoredPlanfileMissing = errors.New("plan verification failed: no stored planfile was found to verify against")
// ErrPlanfileStorageNotConfigured is returned when planfile verification is explicitly requested (`--verify-plan`) but no planfile storage is configured.
ErrPlanfileStorageNotConfigured = errors.New("planfile verification was requested but planfile storage is not configured")
ErrInvalidTerraformFlagsWithAffectedFlag = errors.New("the `--affected` flag can't be used with the other multi-component (bulk operations) flags `--all`, `--query` and `--components`")
ErrInvalidTerraformComponentWithMultiComponentFlags = errors.New("the component argument can't be used with the multi-component (bulk operations) flags `--affected`, `--all`, `--query`, `--components`, `--tags` and `--labels`")
ErrInvalidTerraformSingleComponentAndMultiComponentFlags = errors.New("the single-component flags (`--from-plan`, `--planfile`) can't be used with the multi-component (bulk operations) flags (`--affected`, `--all`, `--query`, `--components`)")
ErrClosureFlagsRequireMultiComponent = errors.New("the `--include-dependencies` and `--include-dependents` flags expand a multi-component selection and require one of `--all`, `--components`, `--query`, `-s`, `--tags`, `--labels`, or `--affected`")
ErrYamlFuncInvalidArguments = errors.New("invalid number of arguments in the Atmos YAML function")
ErrYamlFuncMaxResolutionDepth = errors.New("Atmos YAML function resolution exceeded the maximum dependency depth (likely an undetected circular dependency)")
ErrAwsGetCallerIdentity = errors.New("failed to get AWS caller identity")
ErrUnsupportedYamlTag = errors.New("unsupported YAML tag")
ErrAwsDescribeOrganization = errors.New("failed to describe AWS organization")
ErrDescribeComponent = errors.New("failed to describe component")
ErrReadTerraformState = errors.New("failed to read Terraform state")
ErrEvaluateTerraformBackendVariable = errors.New("failed to evaluate terraform backend variable")
ErrEvaluateOutput = errors.New("failed to evaluate output expression")
// Recoverable YAML function errors - use YQ default if available.
// These errors indicate the data is not available but do not represent API failures.
ErrTerraformStateNotProvisioned = errors.New("terraform state not provisioned")
ErrTerraformOutputNotFound = errors.New("terraform output not found")
ErrTerraformOutputFailed = errors.New("failed to retrieve terraform outputs")
// Terraform output component configuration errors.
ErrMissingExecutable = errors.New("component does not have 'command' (executable) defined")
ErrMissingWorkspace = errors.New("component does not have terraform workspace defined")
ErrMissingComponentInfo = errors.New("component does not have 'component_info' defined")
ErrInvalidComponentInfoS = errors.New("component has invalid 'component_info' section")
ErrMissingComponentPath = errors.New("component has invalid 'component_info.component_path'")
ErrBackendFileGeneration = errors.New("failed to generate backend file")
ErrProviderFileGeneration = errors.New("failed to generate provider override file")
ErrTerraformInit = errors.New("terraform init failed")
ErrTerraformWorkspaceOp = errors.New("terraform workspace operation failed")
// Terraform lint errors.
ErrTerraformLint = errors.New("terraform lint failed")
ErrTerraformLintAuth = errors.New("failed to initialize authentication for terraform lint")
ErrTerraformLintAffected = errors.New("failed to determine affected terraform lint targets")
ErrBuildTerraformLintTargets = errors.New("failed to build terraform lint targets")
// --use-mocks errors.
ErrTerraformComponentMocksNotDeclared = errors.New("terraform component does not declare `mocks` required by --use-mocks")
ErrTerraformMockOutputNotDeclared = errors.New("mocked terraform output is not declared for component")
// API/infrastructure errors - should cause non-zero exit.
// These errors indicate backend API failures that should not use YQ defaults.
ErrTerraformBackendAPIError = errors.New("terraform backend API error")
ErrUnsupportedBackendType = errors.New("unsupported backend type")
ErrProcessTerraformStateFile = errors.New("error processing terraform state file")
ErrGetObjectFromS3 = errors.New("failed to get object from S3")
ErrReadS3ObjectBody = errors.New("failed to read S3 object body")
ErrS3BucketAccessDenied = errors.New("access denied to S3 bucket")
ErrInvalidSSECustomerKey = errors.New("invalid SSE-C customer encryption key")
ErrCreateGCSClient = errors.New("failed to create GCS client")
ErrGetObjectFromGCS = errors.New("failed to get object from GCS")
ErrReadGCSObjectBody = errors.New("failed to read GCS object body")
ErrGCSBucketRequired = errors.New("bucket is required for gcs backend")
ErrInvalidBackendConfig = errors.New("invalid backend configuration")
// Azure Blob Storage specific errors.
ErrGetBlobFromAzure = errors.New("failed to get blob from Azure Blob Storage")
ErrReadAzureBlobBody = errors.New("failed to read Azure blob body")
ErrCreateAzureCredential = errors.New("failed to create Azure credential")
ErrCreateAzureClient = errors.New("failed to create Azure Blob Storage client")
ErrAzureContainerRequired = errors.New("container_name is required for azurerm backend")
ErrStorageAccountRequired = errors.New("storage_account_name is required for azurerm backend")
ErrAzurePermissionDenied = errors.New("permission denied accessing Azure blob")
// Azure authentication errors.
ErrAzureOIDClaimNotFound = errors.New("oid claim not found in token")
ErrAzureUsernameClaimNotFound = errors.New("no username claim found in token (tried upn, unique_name, email)")
ErrAzureInvalidJWTFormat = errors.New("invalid JWT format")
ErrAzureExpirationTimeEmpty = errors.New("expiration time is empty")
ErrAzureTimeParseFailure = errors.New("unable to parse time: tried RFC3339, local time formats, and Unix timestamp")
ErrAzureNoAccountsInCache = errors.New("no accounts found in cache")
ErrAzureNoAccountForTenant = errors.New("no account found for tenant")
ErrBackendConfigRequired = errors.New("backend configuration is required")
ErrBackendTypeRequired = errors.New("backend_type is required")
ErrBackendSectionMissing = errors.New("no 'backend' section configured")
ErrBackendTypeMissing = errors.New("no 'backend_type' configured")
ErrBackendTypeEmptyAfterRender = errors.New("'backend_type' is empty after template processing")
ErrBackendConfigEmpty = errors.New("'backend' section is empty but 'backend_type' requires configuration")
// Git-related errors.
ErrGitNotAvailable = errors.New("git must be available and on the PATH")
ErrGitRoot = errors.New("failed to get git repository root")
ErrGitSHA = errors.New("failed to get git SHA")
ErrGitBranch = errors.New("failed to get git branch")
ErrGitRef = errors.New("failed to get git ref")
ErrGitWorktree = errors.New("failed to get git worktree")
ErrDetachedHead = errors.New("git HEAD is detached")
ErrEmptyBranchName = errors.New("git branch name is empty")
ErrInvalidGitPort = errors.New("invalid port number")
ErrSSHKeyUsage = errors.New("error using SSH key")
ErrGitCommandExited = errors.New("git command exited with non-zero status")
ErrGitCommandFailed = errors.New("failed to execute git command")
ErrReadDestDir = errors.New("failed to read the destination directory during git update")
ErrRemoveGitDir = errors.New("failed to remove the .git directory in the destination directory during git update")
ErrUnexpectedGitOutput = errors.New("unexpected 'git version' output")
ErrUnexpectedGitRevParseOutput = errors.New("unexpected 'git rev-parse' output")
ErrGitVersionMismatch = errors.New("git version requirement not met")
ErrRemoteRepoNotGitRepo = errors.New("target remote repository is not a git repository")
ErrFailedToGetLocalRepo = errors.New("failed to get local repository")
ErrFailedToGetRepoInfo = errors.New("failed to get repository info")
ErrLocalRepoFetch = errors.New("local repo unavailable")
ErrGitRefNotFound = errors.New("git reference not found on local filesystem")
ErrGitFileNotFound = errors.New("file not found in git reference")
ErrGitWorktreeAdd = errors.New("failed to create git worktree")
ErrGitWorktreePruneIncomplete = errors.New("git worktree prune completed but worktree path still exists")
ErrFetchOrigin = errors.New("failed to fetch from origin")
ErrDeepenOrigin = errors.New("failed to deepen fetch from origin")
ErrGitRepositoryNotFound = errors.New("git repository not configured")
ErrGitAuthFailed = errors.New("git authentication failed")
ErrGitPushRejected = errors.New("git push rejected: non-fast-forward")
ErrGitDirtyUnmanagedFiles = errors.New("unmanaged dirty files detected outside commit paths")
ErrGitPathEscapesWorktree = errors.New("path resolves outside git worktree")
ErrGitHookNotConfigured = errors.New("git hook not configured")
ErrGitRepositoryRequired = errors.New("git repository name or URI is required")
ErrGitProviderNotFound = errors.New("git provider not registered")
ErrGitWorkdirExists = errors.New("git workdir already exists")
ErrGitNoTrackingBranch = errors.New("no branch to pull: the current branch has no upstream")
ErrGitWorkdirNotInitialized = errors.New("git repository not cloned or initialized")
ErrGitTargetPathInvalid = errors.New("git target path must not be empty or the repository root")
ErrGitArtifactWrite = errors.New("failed to write provision artifact")
ErrUnsafeForkCheckout = errors.New("refusing to clone untrusted fork content in an elevated CI event")
ErrGitArtifactRead = errors.New("failed to read provision artifact")
// I/O and output errors.
ErrBuildIOConfig = errors.New("failed to build I/O config")
ErrUnknownStream = errors.New("unknown I/O stream")
ErrWriteToStream = errors.New("failed to write to stream")
ErrMaskingContent = errors.New("failed to mask content")
ErrHeadLookup = errors.New("HEAD not found")
ErrInvalidFormat = errors.New("invalid format")
ErrOutputFormat = errors.New("output format error")
// File operation errors.
ErrRefusingToDeleteSymlink = ErrRefuseDeleteSymbolicLink
// Scheduler errors.
ErrNilGraph = errors.New("scheduler graph cannot be nil")
ErrNilDispatcher = errors.New("scheduler dispatcher cannot be nil")
ErrNodeFailed = errors.New("scheduler node failed")
ErrNodeSkipped = errors.New("scheduler node skipped")
ErrNodeNotFound = errors.New("scheduler node not found")
ErrInvalidGraph = errors.New("scheduler graph is invalid")
ErrInvalidWorker = errors.New("scheduler max concurrency must be greater than zero")
// Slice utility errors.
ErrNilInput = errors.New("input must not be nil")
ErrNonStringElement = errors.New("element is not a string")
// Merge-related errors.
ErrEmptyPath = errors.New("empty path")
ErrCannotNavigatePath = errors.New("cannot navigate path: field is not a map")
ErrUnknownListMergeStrategy = errors.New("unknown list merge strategy")
ErrReadFile = errors.New("error reading file")
ErrInvalidFlag = errors.New("invalid flag")
// ErrForbiddenSelectorFunction enforces the selector purity contract:
// metadata.tags/metadata.labels drive scoping decisions before evaluation,
// so by design they may not contain constructs that require authentication
// or process execution (e.g. !terraform.state, !store, !exec, atmos.Component).
ErrForbiddenSelectorFunction = errors.New("forbidden function in labels/tags selector")
// Dependency management errors.
ErrDependencyConstraint = errors.New("dependency constraint validation failed")
ErrDependencyResolution = errors.New("dependency resolution failed")
ErrToolInstall = errors.New("tool installation failed")
// Helm plugin errors.
ErrInvalidHelmPluginSpec = errors.New("invalid helm plugin specification")
ErrHelmPluginInstall = errors.New("helm plugin installation failed")
ErrHelmBinaryNotFound = errors.New("helm binary not found")
// Toolchain errors.
ErrToolNotFound = errors.New("tool not found")
ErrInvalidToolSpec = errors.New("invalid tool specification")
ErrToolAlreadyInstalled = errors.New("tool already installed")
ErrDownloadFailed = errors.New("download failed")
ErrDownloadRetryable = errors.New("retryable download error")
ErrSignatureRetryable = errors.New("retryable signature verification error")
ErrExtractionFailed = errors.New("extraction failed")
ErrChecksumMismatch = errors.New("checksum mismatch")
ErrNoVersionsInstalled = errors.New("no versions installed")
ErrLatestFileNotFound = errors.New("latest version file not found")
ErrRegistryNotReachable = errors.New("registry not reachable")
ErrToolNotInRegistry = errors.New("tool not in registry")
ErrToolPlatformNotSupported = errors.New("tool does not support this platform")
ErrAliasNotFound = errors.New("alias not found")
ErrBinaryNotExecutable = errors.New("binary not executable")
ErrBinaryNotFound = errors.New("binary not found")
ErrLockfileVersionMismatch = errors.New("lockfile version mismatch")
ErrNoAssetTemplate = errors.New("no asset template defined")
ErrAssetTemplateInvalid = errors.New("asset template invalid")
ErrToolVersionsFileOperation = errors.New("tool-versions file operation failed")
ErrNoToolsConfigured = errors.New("no tools configured")
ErrUnsupportedVersionConstraint = errors.New("unsupported version constraint format")
ErrToolchainPlainFormatWithAllFlag = errors.New("--format=plain can't be used with --all")
// Flag validation errors.
ErrCompatibilityFlagMissingTarget = errors.New("compatibility flag references non-existent flag")
ErrInvalidFlagValue = errors.New("invalid value for flag")
// File and URL handling errors.
ErrInvalidPagerCommand = errors.New("invalid pager command")
ErrEmptyURL = errors.New("empty URL provided")
ErrFailedToFindImport = errors.New("failed to find import")
ErrInvalidFilePath = errors.New("invalid file path")
ErrRelPath = errors.New("error determining relative path")
ErrHTTPRequestFailed = errors.New("HTTP request failed")
ErrRedirectLimitExceeded = errors.New("stopped after 10 redirects")
// Config loading errors.
ErrAtmosDirConfigNotFound = errors.New("atmos config directory not found")
ErrReadConfig = errors.New("failed to read config")
ErrMergeTempConfig = errors.New("failed to merge temp config")
ErrPreprocessYAMLFunctions = errors.New("failed to preprocess YAML functions")
ErrMergeEmbeddedConfig = errors.New("failed to merge embedded config")
ErrExpectedDirOrPattern = errors.New("expected directory or pattern")
ErrFileNotFound = errors.New("file not found")
ErrFileAccessDenied = errors.New("file access denied")
ErrExpectedFile = errors.New("expected file")
ErrAtmosArgConfigNotFound = errors.New("atmos configuration not found")
ErrEmptyConfigPath = errors.New("config path is empty")
ErrEmptyConfigFile = errors.New("config file path is empty")
ErrAtmosFilesDirConfigNotFound = errors.New("atmos configuration file not found in directory")
ErrAtmosConfigNotFound = errors.New("atmos configuration file not found")
// Profile errors.
ErrProfileNotFound = errors.New("profile not found")
ErrProfileSyntax = errors.New("profile syntax error")
ErrProfileDiscovery = errors.New("failed to discover profiles")
ErrProfileLoad = errors.New("failed to load profile")
ErrProfileMerge = errors.New("failed to merge profile configuration")
ErrProfileDirNotExist = errors.New("profile directory does not exist")
ErrProfileDirNotAccessible = errors.New("profile directory not accessible")
ErrProfileInvalidMetadata = errors.New("invalid profile metadata")
ErrMissingStack = errors.New("stack is required; specify it on the command line using the flag `--stack <stack>` (shorthand `-s`)")
ErrMissingComponent = errors.New("component is required")
ErrNoStacksToSelect = errors.New("no stacks are configured to choose from")
ErrNoComponentsToSelect = errors.New("no components are configured to choose from")
ErrLoadSelectionOptions = errors.New("failed to load options for interactive selection")
ErrMissingComponentType = errors.New("component type is required")
ErrRequiredFlagNotProvided = errors.New("required flag not provided")
ErrRequiredFlagEmpty = errors.New("required flag cannot be empty")
ErrInvalidArguments = errors.New("invalid arguments")
ErrUnknownSubcommand = errors.New("unknown subcommand")
ErrInvalidComponent = errors.New("invalid component")
ErrDuplicateComponentConfig = errors.New("duplicate component configuration")
// ErrInvalidStack indicates the user provided an identifier that doesn't match
// the stack's canonical name (e.g., using filename when explicit name is set).
// This differs from ErrStackNotFound which indicates the stack doesn't exist at all.
ErrInvalidStack = errors.New("invalid stack")
ErrInvalidComponentMapType = errors.New("invalid component map type")
ErrAbstractComponentCantBeProvisioned = errors.New("abstract component cannot be provisioned")
ErrLockedComponentCantBeProvisioned = errors.New("locked component cannot be provisioned")
ErrSpaceliftAdminStackWorkspaceNotEnabled = errors.New("spacelift admin stack does not have workspace enabled")
ErrSpaceliftAdminStackComponentNotProvisioned = errors.New("spacelift admin stack component cannot be provisioned")
// Terraform-specific errors.
ErrHTTPBackendWorkspaces = errors.New("workspaces are not supported for the HTTP backend")
ErrInvalidTerraformComponent = errors.New("invalid Terraform component")
ErrNoTty = errors.New("no TTY attached")
ErrNoSuitableShell = errors.New("no suitable shell found")
ErrFailedToLoadTerraformComponent = errors.New("failed to load terraform component")
ErrNoJSONOutput = errors.New("no JSON output found in terraform show output")
ErrOriginalPlanFileRequired = errors.New("original plan file is required")
ErrOriginalPlanFileNotExist = errors.New("original plan file does not exist")
ErrNewPlanFileNotExist = errors.New("new plan file does not exist")
ErrTerraformGenerateBackendArgument = errors.New("invalid arguments")
ErrFileTemplateRequired = errors.New("file-template is required")
ErrInteractiveNotAvailable = errors.New("interactive confirmation not available in non-TTY environment")
ErrDeprecatedCmdNotCallable = errors.New("deprecated command should not be called")
ErrMissingPackerTemplate = errors.New("packer template is required")
ErrMissingPackerManifest = errors.New("packer manifest is missing")
ErrAtmosConfigIsNil = errors.New("atmos config is nil")
ErrFailedToInitializeAtmosConfig = errors.New("failed to initialize atmos config")
ErrInvalidListMergeStrategy = errors.New("invalid list merge strategy")
ErrMerge = errors.New("merge error")
ErrMergeNilDst = errors.New("merge destination must not be nil")
ErrMergeTypeMismatch = errors.New("cannot override two slices with different type")
ErrMergeKeyCollision = errors.New("distinct map keys collide after normalization")
ErrEncode = errors.New("encoding error")
ErrDecode = errors.New("decoding error")
// Stack processing errors.
ErrStackManifestFileNotFound = errors.New("stack manifest file not found")
ErrInvalidStackManifest = errors.New("invalid stack manifest")
ErrStackManifestSchemaValidation = errors.New("stack manifest schema validation failed")
ErrStackImportSelf = errors.New("stack manifest imports itself")
ErrStackImportNotFound = errors.New("stack import not found")
ErrImportPathTemplate = errors.New("failed to render Go template in import path")
ErrStackCircularInheritance = errors.New("circular component inheritance detected")
ErrInvalidHooksSection = errors.New("invalid 'hooks' section in the file")
ErrInvalidTerraformHooksSection = errors.New("invalid 'terraform.hooks' section in the file")
ErrInvalidComponentVars = errors.New("invalid component vars section")
ErrInvalidComponentLocals = errors.New("invalid component locals section")
ErrInvalidComponentSettings = errors.New("invalid component settings section")
ErrInvalidComponentEnv = errors.New("invalid component env section")
ErrInvalidComponentProviders = errors.New("invalid component providers section")
ErrInvalidComponentRequiredProviders = errors.New("invalid component required_providers section")
ErrInvalidComponentRequiredVersion = errors.New("invalid component required_version attribute")
ErrInvalidComponentHooks = errors.New("invalid component hooks section")
ErrUnknownHookKind = errors.New("unknown hook kind")
ErrInvalidHookOnFailure = errors.New("invalid hook on_failure value")
ErrInvalidComponentSecrets = errors.New("invalid component secrets section")
ErrStoreIsSecret = errors.New("store is a secret store; use !secret instead of !store")
ErrInvalidComponentGenerate = errors.New("invalid component generate section")
ErrInvalidComponentAuth = errors.New("invalid component auth section")
ErrInvalidComponentProvision = errors.New("invalid component provision section")
ErrInvalidComponentMetadata = errors.New("invalid component metadata section")
ErrInvalidComponentDependencies = errors.New("invalid component dependencies section")
ErrInvalidComponentBackendType = errors.New("invalid component backend_type attribute")
ErrInvalidComponentBackend = errors.New("invalid component backend section")
ErrInvalidComponentRemoteStateBackendType = errors.New("invalid component remote_state_backend_type attribute")
ErrInvalidComponentRemoteStateBackend = errors.New("invalid component remote_state_backend section")
ErrInvalidComponentCommand = errors.New("invalid component command attribute")
ErrInvalidComponentSource = errors.New("invalid component source section")
ErrInvalidComponentOverrides = errors.New("invalid component overrides section")
ErrInvalidComponentOverridesVars = errors.New("invalid component overrides vars section")
ErrInvalidComponentOverridesSettings = errors.New("invalid component overrides settings section")
ErrInvalidComponentOverridesEnv = errors.New("invalid component overrides env section")
ErrInvalidComponentOverridesAuth = errors.New("invalid component overrides auth section")
ErrInvalidComponentOverridesCommand = errors.New("invalid component overrides command attribute")
ErrInvalidComponentOverridesProviders = errors.New("invalid component overrides providers section")
ErrInvalidComponentOverridesRequiredProviders = errors.New("invalid component overrides required_providers section")
ErrInvalidComponentOverridesRequiredVersion = errors.New("invalid component overrides required_version attribute")
ErrInvalidComponentOverridesHooks = errors.New("invalid component overrides hooks section")
ErrInvalidComponentOverridesGenerate = errors.New("invalid component overrides generate section")
ErrInvalidComponentAttribute = errors.New("invalid component attribute")
ErrInvalidComponentMetadataComponent = errors.New("invalid component metadata.component attribute")
ErrInvalidSpaceLiftSettings = errors.New("invalid spacelift settings section")
ErrInvalidComponentMetadataInherits = errors.New("invalid component metadata.inherits section")
ErrComponentNotDefined = errors.New("component not defined in any config files")
// Component registry errors.
ErrComponentProviderNotFound = errors.New("component provider not found")
ErrComponentProviderNil = errors.New("component provider cannot be nil")
ErrComponentTypeEmpty = errors.New("component type is empty")
ErrComponentEmpty = errors.New("component is empty")
ErrStackEmpty = errors.New("stack is empty")
ErrComponentConfigInvalid = errors.New("component configuration invalid")
ErrComponentListFailed = errors.New("failed to list components")
ErrComponentValidationFailed = errors.New("component validation failed")
ErrComponentExecutionFailed = errors.New("component execution failed")
ErrNoRunningContainer = errors.New("no running container found")
ErrComponentArtifactGeneration = errors.New("component artifact generation failed")
ErrComponentProviderRegistration = errors.New("failed to register component provider")
// Emulator errors.
ErrUnknownEmulatorDriver = errors.New("unknown emulator driver")
ErrEmulatorNotRunning = errors.New("emulator is not running")
ErrEmulatorNotConfigured = errors.New("emulator is not configured")
ErrEmulatorResolutionFailed = errors.New("failed to resolve emulator")
ErrEmulatorAmbiguous = errors.New("emulator identity is ambiguous")
ErrEmulatorTargetMismatch = errors.New("emulator target does not match")
ErrEmulatorConfigInvalid = errors.New("emulator configuration invalid")
ErrEmulatorResolverUnavailable = errors.New("emulator resolver is not available")
ErrEmulatorResetFailed = errors.New("emulator reset failed")
ErrInvalidTerraformBackend = errors.New("invalid terraform.backend section")
ErrInvalidTerraformRemoteStateBackend = errors.New("invalid terraform.remote_state_backend section")
ErrUnsupportedComponentType = errors.New("unsupported component type")
// Custom component errors.
ErrCustomComponentTypeRegistration = errors.New("failed to register custom component type")
ErrComponentArgumentNotFound = errors.New("no argument or flag with type 'component' found")
ErrStackArgumentNotFound = errors.New("no argument or flag with type 'stack' found")
// Generator errors.
ErrGeneratorNotFound = errors.New("generator not found")
ErrInvalidGeneratorCtx = errors.New("invalid generator context")
ErrGeneratorValidation = errors.New("generator validation failed")
ErrGenerationFailed = errors.New("generation failed")
ErrGeneratorWriteFailed = errors.New("failed to write generated file")
ErrMissingWorkingDir = errors.New("working directory is required")
ErrMissingProviderSource = errors.New("required_providers entry missing 'source' field")
// Archive package errors (pkg/archive).
ErrArchiveUnknownFormat = errors.New("unknown or unsupported archive format")
ErrArchiveActionNotImplemented = errors.New("archive action is not yet implemented")
ErrArchiveUpdateUnsupportedFormat = errors.New("archive update is not supported for this format")
ErrArchiveOptionsRequired = errors.New("archive options are required")
ErrArchiveSourceRequired = errors.New("archive source is required")
ErrArchiveSourceNotFound = errors.New("archive source does not exist")
ErrArchiveDestinationRequired = errors.New("archive destination is required")
ErrArchiveInvalidGlobPattern = errors.New("invalid archive include/exclude glob pattern")
ErrArchiveInvalidSubpath = errors.New("invalid archive subpath")
ErrArchiveFormatNotImplemented = errors.New("archive format is not yet implemented")
ErrArchiveWriteFailed = errors.New("failed to write archive")
ErrArchiveWalkFailed = errors.New("failed to walk archive source")
ErrArchiveInvalidMtimeMode = errors.New("invalid archive mtime mode")
// List command errors.
ErrInvalidStackPattern = errors.New("invalid stack pattern")
ErrEmptyTargetComponentName = errors.New("target component name cannot be empty")
ErrComponentsSectionNotFound = errors.New("components section not found in stack")
ErrComponentNotFoundInSections = errors.New("component not found in terraform or helmfile sections")
ErrUnknownComposition = errors.New("component references an undeclared composition")
ErrUnknownCompositionMembership = errors.New("component claims membership in a service not declared by the composition")
ErrQueryFailed = errors.New("query execution failed")
ErrScalarExtractionNotSupported = errors.New("scalar extraction queries are not supported")
ErrQueryUnexpectedResultType = errors.New("query returned unexpected result type")
ErrTableTooWide = errors.New("the table is too wide to display properly")
ErrGettingCommonFlags = errors.New("error getting common flags")
ErrGettingAbstractFlag = errors.New("error getting abstract flag")
ErrGettingVarsFlag = errors.New("error getting vars flag")
ErrInitializingCLIConfig = errors.New("error initializing CLI config")
ErrDescribingStacks = errors.New("error describing stacks")
ErrComponentNameRequired = errors.New("component name is required")
ErrCreateColumnSelector = errors.New("failed to create column selector")
// Version command errors.
ErrVersionDisplayFailed = errors.New("failed to display version information")
ErrVersionCheckFailed = errors.New("failed to check for version updates")
ErrVersionFormatInvalid = errors.New("invalid version output format")
ErrVersionCacheLoadFailed = errors.New("failed to load version check cache")
ErrVersionGitHubAPIFailed = errors.New("failed to query GitHub API for releases")
// Version constraint errors.
ErrVersionConstraint = errors.New("version constraint not satisfied")
ErrInvalidVersionConstraint = errors.New("invalid version constraint")
// Atlantis errors.
ErrAtlantisInvalidFlags = errors.New("incompatible atlantis flags")
ErrAtlantisProjectTemplateNotDef = errors.New("atlantis project template is not defined")
ErrAtlantisConfigTemplateNotDef = errors.New("atlantis config template is not defined")
ErrAtlantisConfigTemplateNotSpec = errors.New("atlantis config template is not specified")
// Validation errors.
ErrValidationFailed = errors.New("validation failed")
ErrUnsupportedValidationFormat = errors.New("unsupported validation format: expected text or rich")
ErrUnsupportedCIValidationFormat = errors.New("unsupported CI validation format: expected text, rich, or sarif")
ErrWorkflowArgsWithWorkflowPath = errors.New("workflow-file arguments cannot be used with --workflow-path")
ErrAffectedWithFileArgsOrPath = errors.New("--affected cannot be used with workflow-file arguments or --workflow-path")
ErrCIValidatorNotRegistered = errors.New("CI validator is not registered")
// EditorConfig validation errors.
ErrEditorConfigValidationFailed = errors.New("EditorConfig validation failed")
ErrEditorConfigVersionMismatch = errors.New("EditorConfig version mismatch")
ErrEditorConfigGetFiles = errors.New("failed to get files for EditorConfig validation")
ErrEditorConfigInvalidFormat = errors.New("invalid EditorConfig output format")
// Global/Stack-level section errors.
ErrInvalidVarsSection = errors.New("invalid vars section")
ErrInvalidSettingsSection = errors.New("invalid settings section")
ErrInvalidEnvSection = errors.New("invalid env section")
ErrInvalidGenerateSection = errors.New("invalid generate section")
ErrInvalidDependenciesSection = errors.New("invalid dependencies section")
ErrInvalidTerraformSection = errors.New("invalid terraform section")
ErrInvalidHelmfileSection = errors.New("invalid helmfile section")
ErrInvalidPackerSection = errors.New("invalid packer section")
ErrInvalidComponentsSection = errors.New("invalid components section")
ErrInvalidAuthSection = errors.New("invalid auth section")
ErrInvalidGlobalMetadataSection = errors.New("invalid metadata section")
ErrGlobalMetadataFieldNotAllowed = errors.New("metadata field is not allowed at global (stack-wide) scope")
ErrInvalidImportSection = errors.New("invalid import section")
ErrInvalidImport = errors.New("invalid import")
ErrInvalidRemoteImport = errors.New("invalid remote import")
ErrDownloadRemoteImport = errors.New("failed to download remote import")
ErrCacheDirectoryCreation = errors.New("failed to create cache directory")
ErrClearCache = errors.New("failed to clear cache")
ErrInvalidOverridesSection = errors.New("invalid overrides section")
ErrInvalidTerraformOverridesSection = errors.New("invalid terraform overrides section")
ErrInvalidHelmOverridesSection = errors.New("invalid helm overrides section")
ErrInvalidHelmfileOverridesSection = errors.New("invalid helmfile overrides section")
ErrInvalidBaseComponentConfig = errors.New("invalid base component config")
ErrCircularComponentInheritance = ErrStackCircularInheritance
// Terraform-specific subsection errors.
ErrInvalidTerraformCommand = errors.New("invalid terraform command")
ErrInvalidTerraformVars = errors.New("invalid terraform vars section")
ErrInvalidTerraformSettings = errors.New("invalid terraform settings section")
ErrInvalidTerraformEnv = errors.New("invalid terraform env section")
ErrInvalidTerraformProviders = errors.New("invalid terraform providers section")
ErrInvalidTerraformGenerateSection = errors.New("invalid terraform generate section")
ErrInvalidTerraformBackendType = errors.New("invalid terraform backend_type")
ErrMissingTerraformBackendType = errors.New("'backend_type' is missing for the component")
ErrMissingTerraformBackendConfig = errors.New("'backend' config is missing for the component")
ErrMissingTerraformWorkspaceKeyPrefix = errors.New("backend config is missing 'workspace_key_prefix'")
ErrInvalidTerraformRemoteStateType = errors.New("invalid terraform remote_state_backend_type")
ErrInvalidTerraformRemoteStateSection = errors.New("invalid terraform remote_state_backend section")
ErrInvalidTerraformAuth = errors.New("invalid terraform auth section")
ErrInvalidTerraformDependencies = errors.New("invalid terraform dependencies section")
ErrInvalidTerraformSource = errors.New("invalid terraform source section")
ErrInvalidTerraformProvision = errors.New("invalid terraform provision section")
ErrUnresolvedComputedTerraformVar = errors.New("terraform variable contains an unresolved computed value")
// Helmfile-specific subsection errors.
ErrInvalidHelmfileCommand = errors.New("invalid helmfile command")
ErrInvalidHelmfileVars = errors.New("invalid helmfile vars section")
ErrInvalidHelmfileSettings = errors.New("invalid helmfile settings section")
ErrInvalidHelmfileEnv = errors.New("invalid helmfile env section")
ErrInvalidHelmfileAuth = errors.New("invalid helmfile auth section")
ErrInvalidHelmfileDependencies = errors.New("invalid helmfile dependencies section")
// Helmfile configuration errors.
ErrMissingHelmfileBasePath = errors.New("helmfile base path is required")
ErrMissingHelmfileKubeconfigPath = errors.New("helmfile kubeconfig path is required")
ErrMissingHelmfileAwsProfilePattern = errors.New("helmfile AWS profile pattern is required")
ErrMissingHelmfileClusterNamePattern = errors.New("helmfile cluster name pattern is required")
ErrMissingHelmfileClusterName = errors.New("helmfile cluster name is required")
ErrMissingHelmfileAuth = errors.New("helmfile AWS authentication is required")
// Packer configuration errors.
ErrMissingPackerBasePath = errors.New("packer base path is required")
// Packer-specific subsection errors.
ErrInvalidPackerCommand = errors.New("invalid packer command")
ErrInvalidPackerVars = errors.New("invalid packer vars section")
ErrInvalidPackerSettings = errors.New("invalid packer settings section")
ErrInvalidPackerEnv = errors.New("invalid packer env section")
ErrInvalidPackerAuth = errors.New("invalid packer auth section")
ErrInvalidPackerDependencies = errors.New("invalid packer dependencies section")
// Ansible configuration errors.
ErrMissingAnsibleBasePath = errors.New("ansible base path is required")
// Ansible-specific subsection errors.
ErrInvalidAnsibleSection = errors.New("invalid ansible section")
ErrInvalidAnsibleCommand = errors.New("invalid ansible command")
ErrInvalidAnsibleVars = errors.New("invalid ansible vars section")
ErrInvalidAnsibleSettings = errors.New("invalid ansible settings section")
ErrInvalidAnsibleEnv = errors.New("invalid ansible env section")
ErrInvalidAnsibleAuth = errors.New("invalid ansible auth section")
ErrInvalidAnsibleDependencies = errors.New("invalid ansible dependencies section")
// Ansible execution errors.
ErrAnsiblePlaybookMissing = errors.New("ansible playbook is required")
// Component type-specific section errors.
ErrInvalidComponentsTerraform = errors.New("invalid components.terraform section")
ErrInvalidComponentsHelmfile = errors.New("invalid components.helmfile section")
ErrInvalidComponentsPacker = errors.New("invalid components.packer section")
ErrInvalidComponentsAnsible = errors.New("invalid components.ansible section")
// Specific component configuration errors.
ErrInvalidSpecificTerraformComponent = errors.New("invalid terraform component configuration")
ErrInvalidSpecificHelmfileComponent = errors.New("invalid helmfile component configuration")
ErrInvalidSpecificPackerComponent = errors.New("invalid packer component configuration")
ErrInvalidSpecificAnsibleComponent = errors.New("invalid ansible component configuration")
// Pro API client errors.
ErrFailedToCreateRequest = errors.New("failed to create request")
ErrFailedToMarshalPayload = errors.New("failed to marshal request body")
ErrFailedToCreateAuthRequest = errors.New("failed to create authenticated request")
ErrFailedToMakeRequest = errors.New("failed to make request")
ErrFailedToUploadStacks = errors.New("failed to upload stacks")
ErrFailedToReadResponseBody = errors.New("failed to read response body")
ErrFailedToLockStack = errors.New("failed to lock stack")
ErrFailedToUnlockStack = errors.New("failed to unlock stack")
ErrOIDCWorkspaceIDRequired = errors.New("workspace ID environment variable is required for OIDC authentication")
ErrOIDCTokenExchangeFailed = errors.New("failed to exchange OIDC token for Atmos token")
ErrOIDCAuthFailedNoToken = errors.New("OIDC authentication failed: no token")
ErrNotInGitHubActions = errors.New("not running in GitHub Actions or missing OIDC token environment variables")
ErrFailedToGetOIDCToken = errors.New("failed to get OIDC token")
ErrFailedToDecodeOIDCResponse = errors.New("failed to decode OIDC token response")
ErrFailedToExchangeOIDCToken = errors.New("failed to exchange OIDC token")
ErrFailedToDecodeTokenResponse = errors.New("failed to decode token response")
ErrFailedToGetGitHubOIDCToken = errors.New("failed to get GitHub OIDC token")
ErrFailedToUploadInstances = errors.New("failed to upload instances")
ErrFailedToUploadInstanceStatus = errors.New("failed to upload instance status")
ErrUploadRetryExhausted = errors.New("upload failed after all retries")
ErrTokenRefreshFailed = errors.New("failed to refresh API token")
ErrFailedToUnmarshalAPIResponse = errors.New("failed to unmarshal API response")
ErrNilRequestDTO = errors.New("nil request DTO")
// Pro commit errors.
ErrCommitMessageRequired = errors.New("commit message is required")
ErrCommitMessageTooLong = errors.New("commit message exceeds 500 characters")
ErrCommentTooLong = errors.New("comment exceeds 2000 characters")
ErrBranchRequired = errors.New("GITHUB_HEAD_REF is required (this command only runs in PR workflows)")
ErrBranchInvalid = errors.New("branch name contains invalid characters")
ErrTooManyChanges = errors.New("too many changed files (max 200)")
ErrCommitInvalidFilePath = errors.New("invalid file path for commit")
ErrFileTooLarge = errors.New("file exceeds 2 MiB size limit")
ErrFailedToStageChanges = errors.New("failed to stage changes")
ErrFailedToDetectChanges = errors.New("failed to detect git changes")
ErrFailedToCreateCommit = errors.New("failed to create commit via Atmos Pro")
ErrStagingFlagConflict = errors.New("--add and --all are mutually exclusive")
ErrAPIResponseError = errors.New("API response error")
// Exec package errors.
ErrComponentAndStackRequired = errors.New("component and stack are both required")
ErrFailedToCreateAPIClient = errors.New("failed to create API client")
ErrFailedToProcessArgs = errors.New("failed to process command-line arguments")
ErrFailedToInitConfig = errors.New("failed to initialize Atmos configuration")
ErrFailedToCreateLogger = errors.New("failed to create logger")
ErrFailedToGetComponentFlag = errors.New("failed to get '--component' flag")
ErrFailedToGetStackFlag = errors.New("failed to get '--stack' flag")
ErrOPAPolicyViolations = errors.New("OPA policy violations detected")
ErrOPATimeout = errors.New("timeout evaluating OPA policy")
ErrInvalidRegoPolicy = errors.New("invalid Rego policy")
ErrInvalidOPAPolicy = errors.New("invalid OPA policy")
ErrTerraformEnvCliVarJSON = errors.New("failed to parse JSON variable from TF_CLI_ARGS environment variable")
ErrWorkflowBasePathNotConfigured = errors.New("'workflows.base_path' must be configured in 'atmos.yaml'")
ErrWorkflowDirectoryDoesNotExist = errors.New("workflow directory does not exist")
ErrWorkflowNoSteps = errors.New("workflow has no steps defined")
ErrInvalidWorkflowStepType = errors.New("invalid workflow step type")
ErrInvalidFromStep = errors.New("invalid from-step flag")
ErrWorkflowStepFailed = errors.New("workflow step execution failed")
ErrWorkflowNoWorkflow = errors.New("no workflow found")
ErrWorkflowFileNotFound = errors.New("workflow file not found")
ErrInvalidWorkflowManifest = errors.New("invalid workflow manifest")
ErrUnknownStepType = errors.New("unknown step type")
ErrStepOptionsRequired = errors.New("options is required for step")
ErrStepContentOrOptionsRequired = errors.New("either content or options is required for step")
ErrStepDataOrContentRequired = errors.New("either data or content is required for step")
ErrStepEmptyCommand = errors.New("empty command for step")
ErrStepNoFilesFound = errors.New("no files found matching criteria")
ErrStepFieldRequired = errors.New("required field missing for step")
ErrStepExecutionFailed = errors.New("step execution failed")
ErrStepTTYRequired = errors.New("interactive terminal required for step")
ErrHTTPStepURLRequired = errors.New("url is required for http step")
ErrHTTPStepInvalidMethod = errors.New("invalid HTTP method for http step")
ErrHTTPStepBodyFormConflict = errors.New("http step cannot set both body and form")
ErrHTTPStepInvalidExpectPattern = errors.New("invalid expect.response regex pattern for http step")
ErrHTTPStepRequestFailed = errors.New("http request failed")
ErrHTTPStepUnexpectedStatus = errors.New("http response did not match expected status")
ErrHTTPStepUnexpectedResponse = errors.New("http response body did not match expected pattern")
ErrArchiveStepInvalidAction = errors.New("invalid action for archive step")
ErrArchiveStepInvalidSource = errors.New("archive step source must be a string path")
ErrStoreStepInvalidAction = errors.New("invalid action for store step")
ErrStoreStepWriteFailed = errors.New("store step failed to write value")
ErrRequireStepEmpty = errors.New("require step must specify at least one of tools, files, or dirs")
ErrRequirementsNotMet = errors.New("required tools or paths are missing")
ErrWorkingDirNotFound = errors.New("working directory does not exist")
ErrWorkingDirNotDirectory = errors.New("working directory path is not a directory")
ErrWorkingDirAccessFailed = errors.New("failed to access working directory")
ErrWorkflowExit = errors.New("workflow exit requested")
ErrAuthProviderNotAvailable = errors.New("auth provider is not available")
ErrInvalidComponentArgument = errors.New("invalid arguments. The command requires one argument 'componentName'")
ErrValidation = errors.New("validation failed")
ErrCUEValidationUnsupported = errors.New("validation using CUE is not supported yet")
// List package errors.
ErrExecuteDescribeStacks = errors.New("failed to execute describe stacks")
ErrProcessInstances = errors.New("failed to process instances")
ErrParseFlag = errors.New("failed to parse flag value")
ErrFailedToFinalizeCSVOutput = errors.New("failed to finalize CSV output")
ErrParseStacks = errors.New("could not parse stacks")
ErrParseComponents = errors.New("could not parse components")
ErrNoComponentsFound = errors.New("no components found")
ErrNoStacksFound = errors.New("no stacks found")
ErrStackNotFound = errors.New("stack not found")
ErrProcessStack = errors.New("error processing stack")
// Dependency errors.
ErrUnsupportedDependencyType = errors.New("unsupported dependency type")
ErrMissingDependencyField = errors.New("dependency missing required field")
ErrDependencyTargetNotFound = errors.New("dependency target not found")
// Terraform --all flag errors.
ErrComponentWithAllFlagConflict = errors.New("component argument can't be used with --all flag")
// ErrCacheCertUntrusted is returned when the OS trust store does not trust the
// registry cache proxy's certificate (macOS/Windows require a one-time trust step).
ErrCacheCertUntrusted = errors.New("registry cache certificate is not trusted")
// ErrTrustStore is returned when installing or removing the registry cache proxy's
// certificate in the OS trust store fails.
ErrTrustStore = errors.New("registry cache trust store operation failed")
// Terraform execution errors.
ErrTerraformExecFailed = errors.New("terraform execution failed")
ErrDescribeAffected = errors.New("describe affected failed")
ErrUploadRequiresSupportedEvent = errors.New("upload requires a supported CI event")
ErrDescribeStacks = errors.New("describe stacks failed")
ErrBuildDepGraph = errors.New("build dependency graph failed")
ErrTopologicalOrder = errors.New("topological sort failed")
ErrGraphExecutionCanceled = errors.New("graph execution canceled")
ErrGraphExecutionOptions = errors.New("graph execution options are invalid")
ErrFormatForLogging = errors.New("format affected for logging failed")
ErrQueryEvaluation = errors.New("query evaluation failed")
ErrNilResult = errors.New("nil result")
// Cache-related errors.
ErrCacheLocked = errors.New("cache file is locked")
ErrCacheRead = errors.New("cache read failed")
ErrCacheWrite = errors.New("cache write failed")
ErrCacheFetch = errors.New("failed to fetch content for cache")
ErrCacheUnmarshal = errors.New("cache unmarshal failed")
ErrCacheMarshal = errors.New("cache marshal failed")
ErrCacheDir = errors.New("cache directory creation failed")
// Logger errors.
ErrInvalidLogLevel = errors.New("invalid log level")
// File operation errors.
ErrCopyFile = errors.New("failed to copy file")
ErrCreateDirectory = errors.New("failed to create directory")
ErrCreateFile = errors.New("failed to create file")
ErrOpenFile = errors.New("failed to open file")
ErrWriteFile = errors.New("failed to write to file")
ErrCloseFile = errors.New("failed to close file")
ErrStatFile = errors.New("failed to stat file")
ErrRemoveDirectory = errors.New("failed to remove directory")
ErrSetPermissions = errors.New("failed to set permissions")
ErrReadDirectory = errors.New("failed to read directory")
ErrComputeRelativePath = errors.New("failed to compute relative path")
ErrFileOperation = errors.New("file operation failed")
// OCI/Container image errors.
ErrCreateTempDirectory = ErrCreateTempDir // Alias to avoid duplicate sentinels
ErrInvalidImageReference = errors.New("invalid image reference")
ErrPullImage = errors.New("failed to pull image")
ErrGetImageDescriptor = errors.New("cannot get a descriptor for the OCI image")
ErrGetImageLayers = errors.New("failed to get image layers")
ErrProcessLayer = errors.New("failed to process layer")
ErrLayerDecompression = errors.New("layer decompression error")
ErrLayerExtraction = errors.New("layer extraction error")
ErrArchiveTooLarge = errors.New("archive exceeds maximum size")
ErrArchiveEntryTooLarge = errors.New("archive entry exceeds maximum extracted size")
// Initialization and configuration errors.
ErrInitializeCLIConfig = errors.New("error initializing CLI config")
ErrGetHooks = errors.New("error getting hooks")
ErrPerComponentHookFailed = errors.New("per-component hook failed")
ErrSetFlag = errors.New("failed to set flag")
ErrVersionMismatch = errors.New("version mismatch")
// Download and client errors.
ErrMergeConfiguration = errors.New("failed to merge configuration")
// Template and documentation errors.
ErrGenerateTerraformDocs = errors.New("failed to generate terraform docs")
ErrMergeInputYAMLs = errors.New("failed to merge input YAMLs")
ErrRenderTemplate = errors.New("failed to render template with datasources")
ErrResolveOutputPath = errors.New("failed to resolve output path")
ErrWriteOutput = errors.New("failed to write output")
// Import-related errors.
ErrBasePath = errors.New("base path required to process imports")
ErrTempDir = errors.New("temporary directory required to process imports")
ErrResolveLocal = errors.New("failed to resolve local import path")
ErrSourceDestination = errors.New("source and destination cannot be nil")
ErrImportPathRequired = errors.New("import path required to process imports")
ErrNoFileMatchPattern = errors.New("no files matching patterns found")
ErrMaxImportDepth = errors.New("maximum import depth reached")
ErrNoValidAbsolutePaths = errors.New("no valid absolute paths found")
ErrDownloadRemoteConfig = errors.New("failed to download remote config")
ErrMockImportFailure = errors.New("mock error: simulated import failure")
ErrProcessNestedImports = errors.New("failed to process nested imports")
// Profiler-related errors.
ErrProfilerStart = errors.New("profiler start failed")
ErrProfilerUnsupportedType = errors.New("profiler: unsupported profile type")
ErrProfilerStartCPU = errors.New("profiler: failed to start CPU profile")
ErrProfilerStartTrace = errors.New("profiler: failed to start trace profile")
ErrProfilerCreateFile = errors.New("profiler: failed to create profile file")
// Auth package errors.
ErrAuthNotConfigured = errors.New("authentication not configured in atmos.yaml")
ErrInvalidAuthConfig = errors.New("invalid auth config")
ErrInvalidIdentityKind = errors.New("invalid identity kind")
ErrInvalidIdentityConfig = errors.New("invalid identity config")
ErrInvalidProviderKind = errors.New("invalid provider kind")
ErrInvalidProviderConfig = errors.New("invalid provider config")
ErrInvalidBrowserExecutable = errors.New("invalid browser executable")
ErrAuthenticationFailed = errors.New("authentication failed")
ErrPrepareShellEnvironment = errors.New("failed to prepare authenticated shell environment")
ErrInvalidADCContent = errors.New("invalid ADC content")
ErrWriteADCFile = errors.New("failed to write ADC file")
ErrWritePropertiesFile = errors.New("failed to write properties file")
ErrWriteAccessTokenFile = errors.New("failed to write access token file")
ErrPostAuthenticationHookFailed = errors.New("post authentication hook failed")
ErrAuthManager = errors.New("auth manager error")
ErrDefaultIdentity = errors.New("default identity error")
ErrAwsAuth = errors.New("aws auth error")
ErrAwsUserNotConfigured = errors.New("aws user not configured")
ErrAwsUserKeyringReadFailed = errors.New("failed to read AWS user credentials from keyring")
ErrAwsSAMLDecodeFailed = errors.New("aws saml decode failed")
ErrPlaywrightDriverSeed = errors.New("failed to pre-seed the Playwright driver")
ErrAwsMissingEnvVars = errors.New("missing required AWS environment variables")
ErrUnsupportedPlatform = errors.New("unsupported platform")
ErrChromeNotFound = errors.New("chrome/chromium not found for isolated browser sessions")
ErrSayNotFound = errors.New("text-to-speech command not found")
ErrVoiceListUnsupported = errors.New("voice enumeration not supported for backend")
ErrUserAborted = errors.New("user aborted")
// AWS SSO specific errors.
ErrSSOSessionExpired = errors.New("aws sso session expired")
ErrSSODeviceAuthFailed = errors.New("aws sso device authorization failed")
ErrSSOTokenCreationFailed = errors.New("aws sso token creation failed")
ErrSSOAccountListFailed = errors.New("failed to list aws sso accounts")
ErrSSORoleListFailed = errors.New("failed to list aws sso roles")
ErrSSOProvisioningFailed = errors.New("aws sso identity provisioning failed")
ErrSSOInvalidToken = errors.New("invalid aws sso token")
// AWS browser webflow errors.
ErrWebflowAuthFailed = errors.New("browser authentication failed")
ErrWebflowDisabled = errors.New("browser authentication is disabled")
ErrWebflowTokenExchange = errors.New("failed to exchange authorization code for credentials")
ErrWebflowCallbackServer = errors.New("failed to start local callback server")
ErrWebflowTimeout = errors.New("browser authentication timed out")
ErrWebflowRefreshFailed = errors.New("failed to refresh browser credentials")
// ErrWebflowRefreshTokenRevoked indicates the refresh token has been definitively
// rejected by the AWS signin service (e.g. HTTP 400 invalid_grant/invalid_token).
// This is the only condition under which the cached refresh token should be deleted;
// transient failures (HTTP 5xx, 429, network errors) must preserve the cache.
ErrWebflowRefreshTokenRevoked = errors.New("browser refresh token has been revoked")
ErrWebflowCodeRequired = errors.New("authorization code is required")
ErrWebflowReadAuthCodeFailed = errors.New("failed to read authorization code")
ErrWebflowAuthorizationError = errors.New("authorization error")
ErrWebflowMissingCallbackCode = errors.New("missing authorization code in callback")
ErrWebflowStateMismatch = errors.New("state mismatch: possible CSRF attack")
ErrWebflowEmptyCachedToken = errors.New("cached refresh token is empty")
// ErrWebflowDPoP indicates a failure generating or serializing the RFC 9449
// DPoP proof required on AWS signin token requests (issue #2542).
ErrWebflowDPoP = errors.New("failed to build DPoP proof")
// Credential errors.
ErrCredentialsInvalid = errors.New("credentials are invalid or have been revoked")
ErrInvalidDuration = errors.New("invalid duration format")
// Auth manager and identity/provider resolution errors (centralized sentinels).
ErrFailedToInitializeAuthManager = errors.New("failed to initialize auth manager")
ErrNoCredentialsFound = errors.New("no credentials found for identity")
ErrExpiredCredentials = errors.New("credentials for identity are expired or invalid")
ErrNilParam = errors.New("parameter cannot be nil")