Add public artifact reader support

This commit is contained in:
2026-07-28 00:35:54 +00:00
parent ad115a2259
commit a74c03bd9b
7 changed files with 289 additions and 12 deletions

View File

@@ -29,8 +29,10 @@ func hasPublicError(err error) bool {
ErrInvalidRequest,
ErrPromptNotFound,
ErrProfileNotFound,
ErrProfileRequired,
ErrPromptLoad,
ErrProfileLoad,
ErrAPIKeyEnvMissing,
ErrArtifactLoad,
ErrPromptRender,
ErrLLMGenerate,
@@ -49,6 +51,8 @@ func publicErrorFor(err error) error {
return ErrPromptNotFound
case errors.Is(err, profile.ErrProfileNotFound):
return ErrProfileNotFound
case errors.Is(err, usecase.ErrProfileRequired):
return errors.Join(ErrInvalidRequest, ErrProfileRequired)
case errors.Is(err, usecase.ErrPromptLoad):
return ErrPromptLoad
case errors.Is(err, usecase.ErrProfileLoad):
@@ -57,6 +61,8 @@ func publicErrorFor(err error) error {
return ErrPromptLoad
case isProfileLoadCause(err):
return ErrProfileLoad
case errors.Is(err, usecase.ErrAPIKeyEnvMissing):
return errors.Join(ErrInvalidRequest, ErrAPIKeyEnvMissing)
case errors.Is(err, usecase.ErrArtifactLoad):
return ErrArtifactLoad
case errors.Is(err, usecase.ErrPromptRender):