@koda-sl/baker-cli 0.284.0-dev.c513a9a6c → 0.285.0-dev.e3dcdf3eb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -29925,12 +29925,24 @@ function failValidation2(message, fix) {
29925
29925
  writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message, ...fix ? { fix } : {} } });
29926
29926
  process.exit(1);
29927
29927
  }
29928
- function failAvatarApi(err, handle) {
29929
- if (err instanceof ApiError) {
29930
- const fix = err.code === "NOT_FOUND" ? {
29928
+ function avatarFailureFix(err, handle) {
29929
+ if (err.code === "NOT_FOUND") {
29930
+ return {
29931
29931
  action: "list_avatars",
29932
29932
  explanation: `Run \`baker avatars list\` to see which avatars this company has${handle ? ` \u2014 "${handle}" is not one of them` : ""}. Handles are lowercase letters, numbers and dashes ("maria-founder", not "Maria Founder"). If the roster is empty, create the avatar first with \`baker avatars create\`. Do not abandon the wider job over this \u2014 carry on without the avatar and say so.`
29933
- } : void 0;
29933
+ };
29934
+ }
29935
+ if (err.code === "CONFLICT" && handle) {
29936
+ return {
29937
+ action: "use_the_existing_avatar",
29938
+ explanation: `@${handle} already exists in THIS company \u2014 avatars belong to the company, not to a chat, so one made in an earlier conversation is still here and still castable. If it is the person you want, use it as it is: \`--avatar ${handle}\`. Read it first with \`baker avatars get ${handle} --full\` and say who they already are. Do NOT create the same person under a second name: the user would be told about one avatar and handed another, and the company ends up with duplicates nobody chose a face for. If you genuinely need a different person, ask the user what to call them.`
29939
+ };
29940
+ }
29941
+ return void 0;
29942
+ }
29943
+ function failAvatarApi(err, handle) {
29944
+ if (err instanceof ApiError) {
29945
+ const fix = avatarFailureFix(err, handle);
29934
29946
  writeJson({ ok: false, error: { code: err.code, message: err.message, ...fix ? { fix } : {} } });
29935
29947
  process.exit(1);
29936
29948
  }