adhdev 0.9.8 → 0.9.9

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/index.js CHANGED
@@ -5813,6 +5813,18 @@ function validateRole(role, source, index) {
5813
5813
  }
5814
5814
  return role;
5815
5815
  }
5816
+ function validateBubbleState(state, source, index) {
5817
+ if (typeof state !== "string" || !VALID_BUBBLE_STATES.includes(state)) {
5818
+ throw new Error(`${source}: messages[${index}].bubbleState must be one of ${VALID_BUBBLE_STATES.join(", ")}`);
5819
+ }
5820
+ return state;
5821
+ }
5822
+ function validateTurnStatus(turnStatus, source) {
5823
+ if (typeof turnStatus !== "string" || !VALID_TURN_STATUSES.includes(turnStatus)) {
5824
+ throw new Error(`${source}: turnStatus must be one of ${VALID_TURN_STATUSES.join(", ")}`);
5825
+ }
5826
+ return turnStatus;
5827
+ }
5816
5828
  function validateMessageContent(content, source, index) {
5817
5829
  if (typeof content === "string") return content;
5818
5830
  if (Array.isArray(content)) return normalizeMessageParts(content);
@@ -5828,6 +5840,9 @@ function validateMessage(message, source, index) {
5828
5840
  };
5829
5841
  if (typeof message.kind === "string") normalized.kind = message.kind;
5830
5842
  if (typeof message.id === "string") normalized.id = message.id;
5843
+ if (typeof message.bubbleId === "string") normalized.bubbleId = message.bubbleId;
5844
+ if (typeof message.providerUnitKey === "string") normalized.providerUnitKey = message.providerUnitKey;
5845
+ if (message.bubbleState !== void 0) normalized.bubbleState = validateBubbleState(message.bubbleState, source, index);
5831
5846
  if (isFiniteNumber(message.index)) normalized.index = message.index;
5832
5847
  if (isFiniteNumber(message.timestamp)) normalized.timestamp = message.timestamp;
5833
5848
  if (isFiniteNumber(message.receivedAt)) normalized.receivedAt = message.receivedAt;
@@ -5895,6 +5910,8 @@ function validateReadChatResultPayload(raw, source = "read_chat") {
5895
5910
  if (activeModal !== void 0) normalized.activeModal = activeModal;
5896
5911
  if (typeof raw.id === "string") normalized.id = raw.id;
5897
5912
  if (typeof raw.title === "string") normalized.title = raw.title;
5913
+ if (typeof raw.currentTurnId === "string") normalized.currentTurnId = raw.currentTurnId;
5914
+ if (raw.turnStatus !== void 0) normalized.turnStatus = validateTurnStatus(raw.turnStatus, source);
5898
5915
  if (typeof raw.agentType === "string") normalized.agentType = raw.agentType;
5899
5916
  if (typeof raw.agentName === "string") normalized.agentName = raw.agentName;
5900
5917
  if (typeof raw.extensionId === "string") normalized.extensionId = raw.extensionId;
@@ -5907,13 +5924,15 @@ function validateReadChatResultPayload(raw, source = "read_chat") {
5907
5924
  if (typeof raw.providerSessionId === "string") normalized.providerSessionId = raw.providerSessionId;
5908
5925
  return normalized;
5909
5926
  }
5910
- var VALID_STATUSES, VALID_ROLES;
5927
+ var VALID_STATUSES, VALID_ROLES, VALID_BUBBLE_STATES, VALID_TURN_STATUSES;
5911
5928
  var init_read_chat_contract = __esm({
5912
5929
  "../../oss/packages/daemon-core/src/providers/read-chat-contract.ts"() {
5913
5930
  "use strict";
5914
5931
  init_contracts();
5915
5932
  VALID_STATUSES = ["idle", "generating", "waiting_approval", "error", "panel_hidden", "streaming", "long_generating"];
5916
5933
  VALID_ROLES = ["user", "assistant", "system", "human"];
5934
+ VALID_BUBBLE_STATES = ["draft", "streaming", "final", "removed"];
5935
+ VALID_TURN_STATUSES = ["open", "waiting_approval", "complete", "error"];
5917
5936
  }
5918
5937
  });
5919
5938
 
@@ -87073,7 +87092,7 @@ var init_adhdev_daemon = __esm({
87073
87092
  init_version();
87074
87093
  init_src();
87075
87094
  init_runtime_defaults();
87076
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.8" });
87095
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.9" });
87077
87096
  AdhdevDaemon = class _AdhdevDaemon {
87078
87097
  localHttpServer = null;
87079
87098
  localWss = null;