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/index.js CHANGED
@@ -5293,6 +5293,18 @@ function validateRole(role, source, index) {
5293
5293
  }
5294
5294
  return role;
5295
5295
  }
5296
+ function validateBubbleState(state, source, index) {
5297
+ if (typeof state !== "string" || !VALID_BUBBLE_STATES.includes(state)) {
5298
+ throw new Error(`${source}: messages[${index}].bubbleState must be one of ${VALID_BUBBLE_STATES.join(", ")}`);
5299
+ }
5300
+ return state;
5301
+ }
5302
+ function validateTurnStatus(turnStatus, source) {
5303
+ if (typeof turnStatus !== "string" || !VALID_TURN_STATUSES.includes(turnStatus)) {
5304
+ throw new Error(`${source}: turnStatus must be one of ${VALID_TURN_STATUSES.join(", ")}`);
5305
+ }
5306
+ return turnStatus;
5307
+ }
5296
5308
  function validateMessageContent(content, source, index) {
5297
5309
  if (typeof content === "string") return content;
5298
5310
  if (Array.isArray(content)) return normalizeMessageParts(content);
@@ -5308,6 +5320,9 @@ function validateMessage(message, source, index) {
5308
5320
  };
5309
5321
  if (typeof message.kind === "string") normalized.kind = message.kind;
5310
5322
  if (typeof message.id === "string") normalized.id = message.id;
5323
+ if (typeof message.bubbleId === "string") normalized.bubbleId = message.bubbleId;
5324
+ if (typeof message.providerUnitKey === "string") normalized.providerUnitKey = message.providerUnitKey;
5325
+ if (message.bubbleState !== void 0) normalized.bubbleState = validateBubbleState(message.bubbleState, source, index);
5311
5326
  if (isFiniteNumber(message.index)) normalized.index = message.index;
5312
5327
  if (isFiniteNumber(message.timestamp)) normalized.timestamp = message.timestamp;
5313
5328
  if (isFiniteNumber(message.receivedAt)) normalized.receivedAt = message.receivedAt;
@@ -5375,6 +5390,8 @@ function validateReadChatResultPayload(raw, source = "read_chat") {
5375
5390
  if (activeModal !== void 0) normalized.activeModal = activeModal;
5376
5391
  if (typeof raw.id === "string") normalized.id = raw.id;
5377
5392
  if (typeof raw.title === "string") normalized.title = raw.title;
5393
+ if (typeof raw.currentTurnId === "string") normalized.currentTurnId = raw.currentTurnId;
5394
+ if (raw.turnStatus !== void 0) normalized.turnStatus = validateTurnStatus(raw.turnStatus, source);
5378
5395
  if (typeof raw.agentType === "string") normalized.agentType = raw.agentType;
5379
5396
  if (typeof raw.agentName === "string") normalized.agentName = raw.agentName;
5380
5397
  if (typeof raw.extensionId === "string") normalized.extensionId = raw.extensionId;
@@ -5387,13 +5404,15 @@ function validateReadChatResultPayload(raw, source = "read_chat") {
5387
5404
  if (typeof raw.providerSessionId === "string") normalized.providerSessionId = raw.providerSessionId;
5388
5405
  return normalized;
5389
5406
  }
5390
- var VALID_STATUSES, VALID_ROLES;
5407
+ var VALID_STATUSES, VALID_ROLES, VALID_BUBBLE_STATES, VALID_TURN_STATUSES;
5391
5408
  var init_read_chat_contract = __esm({
5392
5409
  "../../oss/packages/daemon-core/src/providers/read-chat-contract.ts"() {
5393
5410
  "use strict";
5394
5411
  init_contracts();
5395
5412
  VALID_STATUSES = ["idle", "generating", "waiting_approval", "error", "panel_hidden", "streaming", "long_generating"];
5396
5413
  VALID_ROLES = ["user", "assistant", "system", "human"];
5414
+ VALID_BUBBLE_STATES = ["draft", "streaming", "final", "removed"];
5415
+ VALID_TURN_STATUSES = ["open", "waiting_approval", "complete", "error"];
5397
5416
  }
5398
5417
  });
5399
5418
 
@@ -55353,7 +55372,7 @@ var init_adhdev_daemon = __esm({
55353
55372
  init_version();
55354
55373
  init_src();
55355
55374
  init_runtime_defaults();
55356
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.8" });
55375
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.9" });
55357
55376
  AdhdevDaemon = class _AdhdevDaemon {
55358
55377
  localHttpServer = null;
55359
55378
  localWss = null;