@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.
@@ -1,4 +1,4 @@
1
- import { P as Prompt, d as Environment, c as SessionHeapSnapshot, a$ as ManifestContent, ax as RecordObjectOptions, T as ToolWithHandler, G as Granular, C as ConnectOptions, y as CreateEnvironmentData, i as GranularOptions } from './client-BeKRGMoT.mjs';
1
+ import { P as Prompt, e as Environment, c as SessionHeapSnapshot, b3 as ManifestContent, aB as RecordObjectOptions, T as ToolWithHandler, G as Granular, C as ConnectOptions, z as CreateEnvironmentData, j as GranularOptions } from './client-Zoo8YITZ.mjs';
2
2
  import { GeneratedJobCodeIssue, HarnessControllerBudgets } from './agent-harness.mjs';
3
3
  import '@automerge/automerge';
4
4
  import '@automerge/automerge/slim';
@@ -1,4 +1,4 @@
1
- import { P as Prompt, d as Environment, c as SessionHeapSnapshot, a$ as ManifestContent, ax as RecordObjectOptions, T as ToolWithHandler, G as Granular, C as ConnectOptions, y as CreateEnvironmentData, i as GranularOptions } from './client-BeKRGMoT.js';
1
+ import { P as Prompt, e as Environment, c as SessionHeapSnapshot, b3 as ManifestContent, aB as RecordObjectOptions, T as ToolWithHandler, G as Granular, C as ConnectOptions, z as CreateEnvironmentData, j as GranularOptions } from './client-Zoo8YITZ.js';
2
2
  import { GeneratedJobCodeIssue, HarnessControllerBudgets } from './agent-harness.js';
3
3
  import '@automerge/automerge';
4
4
  import '@automerge/automerge/slim';
@@ -4615,6 +4615,22 @@ var Session = class {
4615
4615
  }
4616
4616
  };
4617
4617
  }
4618
+ stringifyConversationValue(value) {
4619
+ if (typeof value === "string") {
4620
+ return value;
4621
+ }
4622
+ if (typeof value === "boolean") {
4623
+ return value ? "Confirmed" : "Canceled";
4624
+ }
4625
+ if (value === void 0) {
4626
+ return "";
4627
+ }
4628
+ try {
4629
+ return JSON.stringify(value, null, 2);
4630
+ } catch {
4631
+ return String(value);
4632
+ }
4633
+ }
4618
4634
  // --- Public API ---
4619
4635
  get document() {
4620
4636
  return this.client.doc;
@@ -4765,6 +4781,20 @@ var Session = class {
4765
4781
  answer: resolvedAnswer,
4766
4782
  value: resolvedAnswer
4767
4783
  });
4784
+ try {
4785
+ const content = this.stringifyConversationValue(resolvedAnswer);
4786
+ if (content.trim()) {
4787
+ await this.appendConversationMessage({
4788
+ role: "user",
4789
+ content,
4790
+ promptId
4791
+ });
4792
+ }
4793
+ } catch {
4794
+ }
4795
+ }
4796
+ async appendConversationMessage(input) {
4797
+ return this.client.call("conversation.append", input);
4768
4798
  }
4769
4799
  /**
4770
4800
  * Get the current list of available effects.