@autohq/cli 0.1.288 → 0.1.289

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.
@@ -23384,7 +23384,7 @@ Object.assign(lookup, {
23384
23384
  // package.json
23385
23385
  var package_default = {
23386
23386
  name: "@autohq/cli",
23387
- version: "0.1.288",
23387
+ version: "0.1.289",
23388
23388
  license: "SEE LICENSE IN README.md",
23389
23389
  publishConfig: {
23390
23390
  access: "public"
@@ -36728,25 +36728,11 @@ var AgentBridgeOutputBuffer = class {
36728
36728
  );
36729
36729
  if (!completedMessage || !completedMessage.id.trim()) {
36730
36730
  if (isTerminalUiMessageChunk(projection.chunk)) {
36731
- const statusText = terminalStatusText(projection);
36732
- if (statusText) {
36733
- await this.enqueueProjectionAndDrain(context, {
36734
- type: "entry",
36735
- entry: {
36736
- role: "system",
36737
- kind: "status",
36738
- status: terminalEntryStatus(projection),
36739
- ...projection.turnStatus ? { turnStatus: projection.turnStatus } : {},
36740
- ...projection.usage ? { usage: projection.usage } : {},
36741
- content: {
36742
- parts: [{ type: "text", text: statusText }]
36743
- }
36744
- }
36745
- });
36746
- }
36731
+ await this.emitTerminalStatusEntry(context, projection);
36747
36732
  }
36748
36733
  return;
36749
36734
  }
36735
+ const turnFailed = projection.turnStatus === "failed";
36750
36736
  this.outputSeq += 1;
36751
36737
  const completedAt = now2();
36752
36738
  const completedOutput = buildUiMessageCompletedOutputEnvelope({
@@ -36754,13 +36740,35 @@ var AgentBridgeOutputBuffer = class {
36754
36740
  outputSeq: this.outputSeq,
36755
36741
  message: completedMessage,
36756
36742
  status: terminalEntryStatus(projection),
36757
- turnStatus: projection.turnStatus,
36758
- usage: projection.usage,
36743
+ turnStatus: turnFailed ? void 0 : projection.turnStatus,
36744
+ usage: turnFailed ? void 0 : projection.usage,
36759
36745
  createdAt: completedAt,
36760
36746
  completedAt
36761
36747
  });
36762
36748
  this.enqueueOutput(completedOutput);
36763
36749
  await this.drainPendingOutputs();
36750
+ if (turnFailed) {
36751
+ await this.emitTerminalStatusEntry(context, projection);
36752
+ }
36753
+ }
36754
+ async emitTerminalStatusEntry(context, projection) {
36755
+ const statusText = terminalStatusText(projection);
36756
+ if (!statusText) {
36757
+ return;
36758
+ }
36759
+ await this.enqueueProjectionAndDrain(context, {
36760
+ type: "entry",
36761
+ entry: {
36762
+ role: "system",
36763
+ kind: "status",
36764
+ status: terminalEntryStatus(projection),
36765
+ ...projection.turnStatus ? { turnStatus: projection.turnStatus } : {},
36766
+ ...projection.usage ? { usage: projection.usage } : {},
36767
+ content: {
36768
+ parts: [{ type: "text", text: statusText }]
36769
+ }
36770
+ }
36771
+ });
36764
36772
  }
36765
36773
  async emitLiveUiMessageChunk(context, chunk) {
36766
36774
  this.outputSeq += 1;
package/dist/index.js CHANGED
@@ -23173,7 +23173,7 @@ var init_package = __esm({
23173
23173
  "package.json"() {
23174
23174
  package_default = {
23175
23175
  name: "@autohq/cli",
23176
- version: "0.1.288",
23176
+ version: "0.1.289",
23177
23177
  license: "SEE LICENSE IN README.md",
23178
23178
  publishConfig: {
23179
23179
  access: "public"
@@ -33745,25 +33745,11 @@ var AgentBridgeOutputBuffer = class {
33745
33745
  );
33746
33746
  if (!completedMessage || !completedMessage.id.trim()) {
33747
33747
  if (isTerminalUiMessageChunk(projection.chunk)) {
33748
- const statusText = terminalStatusText(projection);
33749
- if (statusText) {
33750
- await this.enqueueProjectionAndDrain(context, {
33751
- type: "entry",
33752
- entry: {
33753
- role: "system",
33754
- kind: "status",
33755
- status: terminalEntryStatus(projection),
33756
- ...projection.turnStatus ? { turnStatus: projection.turnStatus } : {},
33757
- ...projection.usage ? { usage: projection.usage } : {},
33758
- content: {
33759
- parts: [{ type: "text", text: statusText }]
33760
- }
33761
- }
33762
- });
33763
- }
33748
+ await this.emitTerminalStatusEntry(context, projection);
33764
33749
  }
33765
33750
  return;
33766
33751
  }
33752
+ const turnFailed = projection.turnStatus === "failed";
33767
33753
  this.outputSeq += 1;
33768
33754
  const completedAt = now2();
33769
33755
  const completedOutput = buildUiMessageCompletedOutputEnvelope({
@@ -33771,13 +33757,35 @@ var AgentBridgeOutputBuffer = class {
33771
33757
  outputSeq: this.outputSeq,
33772
33758
  message: completedMessage,
33773
33759
  status: terminalEntryStatus(projection),
33774
- turnStatus: projection.turnStatus,
33775
- usage: projection.usage,
33760
+ turnStatus: turnFailed ? void 0 : projection.turnStatus,
33761
+ usage: turnFailed ? void 0 : projection.usage,
33776
33762
  createdAt: completedAt,
33777
33763
  completedAt
33778
33764
  });
33779
33765
  this.enqueueOutput(completedOutput);
33780
33766
  await this.drainPendingOutputs();
33767
+ if (turnFailed) {
33768
+ await this.emitTerminalStatusEntry(context, projection);
33769
+ }
33770
+ }
33771
+ async emitTerminalStatusEntry(context, projection) {
33772
+ const statusText = terminalStatusText(projection);
33773
+ if (!statusText) {
33774
+ return;
33775
+ }
33776
+ await this.enqueueProjectionAndDrain(context, {
33777
+ type: "entry",
33778
+ entry: {
33779
+ role: "system",
33780
+ kind: "status",
33781
+ status: terminalEntryStatus(projection),
33782
+ ...projection.turnStatus ? { turnStatus: projection.turnStatus } : {},
33783
+ ...projection.usage ? { usage: projection.usage } : {},
33784
+ content: {
33785
+ parts: [{ type: "text", text: statusText }]
33786
+ }
33787
+ }
33788
+ });
33781
33789
  }
33782
33790
  async emitLiveUiMessageChunk(context, chunk) {
33783
33791
  this.outputSeq += 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.288",
3
+ "version": "0.1.289",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"