@toothfairyai/tfdesign 0.4.6 → 0.4.8

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.
Files changed (2) hide show
  1. package/dist/cli.js +16 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1076,6 +1076,7 @@ async function runDesignRun(rawArgs) {
1076
1076
  process.exit(130);
1077
1077
  });
1078
1078
  let outcome;
1079
+ let result;
1079
1080
  try {
1080
1081
  outcome = await driveRounds({
1081
1082
  base,
@@ -1095,6 +1096,13 @@ async function runDesignRun(rawArgs) {
1095
1096
  },
1096
1097
  isCanceled: () => canceled
1097
1098
  });
1099
+ if (outcome.status === "done") {
1100
+ result = await buildResult(base, project, conversationId, {
1101
+ rounds: outcome.rounds,
1102
+ finalText: outcome.finalText,
1103
+ mirrorRoot
1104
+ });
1105
+ }
1098
1106
  } finally {
1099
1107
  if (daemon.booted && daemon.server) {
1100
1108
  daemon.server.close?.();
@@ -1104,11 +1112,14 @@ async function runDesignRun(rawArgs) {
1104
1112
  if (outcome.status === "canceled") process.exit(130);
1105
1113
  if (outcome.status === "failed") process.exit(4);
1106
1114
  if (outcome.status === "unanswered") process.exit(5);
1107
- const result = await buildResult(base, project, conversationId, {
1108
- rounds: outcome.rounds,
1109
- finalText: outcome.finalText,
1110
- mirrorRoot
1111
- });
1115
+ if (!result) {
1116
+ emit({
1117
+ type: "error",
1118
+ code: "NO_RESULT",
1119
+ message: "run finished without a result payload"
1120
+ });
1121
+ process.exit(4);
1122
+ }
1112
1123
  emit({ type: "result", ...result });
1113
1124
  if (!json) printResultSummary(result);
1114
1125
  if (flags.open === true && result.previewUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toothfairyai/tfdesign",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "TF Design — the local design workspace CLI: headless design runs (decks, posters, sites) through the tfdesign daemon, delegable from tfcode.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",