@hachej/boring-agent 0.1.94 → 0.1.95

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.
@@ -4077,12 +4077,22 @@ var HarnessPiChatService = class {
4077
4077
  }
4078
4078
  async readStateBeforeDispose(ctx, sessionId) {
4079
4079
  const sessionKey2 = this.sessionKey(ctx, sessionId);
4080
- const channel = this.channels.get(sessionKey2);
4080
+ let channel = this.channels.get(sessionKey2);
4081
4081
  if (!channel && !this.harnessMayHaveLiveSession(ctx, sessionId)) {
4082
4082
  const persisted = await this.readPersistedState(ctx, sessionId);
4083
- if (persisted) return persisted;
4083
+ channel = this.channels.get(sessionKey2);
4084
+ if (persisted && !channel && !this.harnessMayHaveLiveSession(ctx, sessionId)) return persisted;
4084
4085
  }
4085
4086
  const adapter = await this.getAdapter(ctx, sessionId, "");
4087
+ if (this.canRefreshFromPersistedState(sessionKey2, adapter)) {
4088
+ const persisted = await this.readPersistedState(ctx, sessionId);
4089
+ if (persisted && this.canRefreshFromPersistedState(sessionKey2, adapter)) {
4090
+ return this.enrichSyntheticPromptFailures(
4091
+ sessionKey2,
4092
+ this.messageMetadata.enrichSnapshot(sessionKey2, persisted)
4093
+ );
4094
+ }
4095
+ }
4086
4096
  const snapshot = this.messageMetadata.enrichSnapshot(sessionKey2, buildPiChatSnapshot(adapter, {
4087
4097
  seq: channel?.buffer.latestSeq ?? 0,
4088
4098
  sessionId,
@@ -4091,6 +4101,11 @@ var HarnessPiChatService = class {
4091
4101
  }));
4092
4102
  return this.enrichSyntheticPromptFailures(sessionKey2, snapshot);
4093
4103
  }
4104
+ canRefreshFromPersistedState(sessionKey2, adapter) {
4105
+ if (this.activePromptRuns.has(sessionKey2)) return false;
4106
+ const snapshot = adapter.readSnapshot();
4107
+ return !snapshot.isStreaming && !snapshot.isRetrying && snapshot.pendingMessageCount === 0 && snapshot.steeringMessages.length === 0 && snapshot.followUpMessages.length === 0;
4108
+ }
4094
4109
  harnessMayHaveLiveSession(ctx, sessionId) {
4095
4110
  return typeof this.harness.hasPiSession === "function" ? this.harness.hasPiSession(sessionId, toSessionCtx(ctx)) : true;
4096
4111
  }
@@ -137,11 +137,13 @@ interface ChatEmptyStateProps {
137
137
  * resolves this to `sendMessage` with the suggestion's prompt.
138
138
  */
139
139
  onSelect?: (suggestion: ChatSuggestion) => void;
140
+ /** Uses the concise empty-chat hierarchy. */
141
+ hero?: boolean;
140
142
  /** Optional content rendered below the suggestion grid. */
141
143
  footer?: ReactNode;
142
144
  className?: string;
143
145
  }
144
- declare function ChatEmptyState({ eyebrow, title, description, suggestions, onSelect, footer, className, }: ChatEmptyStateProps): react.JSX.Element;
146
+ declare function ChatEmptyState({ eyebrow, title, description, suggestions, onSelect, hero, footer, className, }: ChatEmptyStateProps): react.JSX.Element;
145
147
 
146
148
  interface ParsedCommand {
147
149
  name: string;