@granular-software/sdk 0.4.25 → 0.4.26

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.
@@ -4590,6 +4590,22 @@ var Session = class {
4590
4590
  }
4591
4591
  };
4592
4592
  }
4593
+ stringifyConversationValue(value) {
4594
+ if (typeof value === "string") {
4595
+ return value;
4596
+ }
4597
+ if (typeof value === "boolean") {
4598
+ return value ? "Confirmed" : "Canceled";
4599
+ }
4600
+ if (value === void 0) {
4601
+ return "";
4602
+ }
4603
+ try {
4604
+ return JSON.stringify(value, null, 2);
4605
+ } catch {
4606
+ return String(value);
4607
+ }
4608
+ }
4593
4609
  // --- Public API ---
4594
4610
  get document() {
4595
4611
  return this.client.doc;
@@ -4740,6 +4756,20 @@ var Session = class {
4740
4756
  answer: resolvedAnswer,
4741
4757
  value: resolvedAnswer
4742
4758
  });
4759
+ try {
4760
+ const content = this.stringifyConversationValue(resolvedAnswer);
4761
+ if (content.trim()) {
4762
+ await this.appendConversationMessage({
4763
+ role: "user",
4764
+ content,
4765
+ promptId
4766
+ });
4767
+ }
4768
+ } catch {
4769
+ }
4770
+ }
4771
+ async appendConversationMessage(input) {
4772
+ return this.client.call("conversation.append", input);
4743
4773
  }
4744
4774
  /**
4745
4775
  * Get the current list of available effects.