@creature-ai/sdk 0.1.11 → 0.1.12

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.
@@ -184,6 +184,12 @@ interface ToolResult {
184
184
  inlineHeight?: number;
185
185
  /** Whether this is an error result */
186
186
  isError?: boolean;
187
+ /**
188
+ * Skip widget creation for this tool call.
189
+ * When true, no PIP/panel is created even if the tool has a `ui` configured.
190
+ * Use for read-only operations (read, list, delete) that shouldn't open UI.
191
+ */
192
+ noWidget?: boolean;
187
193
  }
188
194
  /**
189
195
  * Tool handler function type.
@@ -14124,6 +14124,13 @@ var App = class {
14124
14124
  */
14125
14125
  formatServerlessResult(result, instanceId, websocketUrl) {
14126
14126
  const text = result.text || JSON.stringify(result.data || {});
14127
+ if (result.noWidget) {
14128
+ return {
14129
+ content: [{ type: "text", text }],
14130
+ structuredContent: result.data ? { ...result.data } : void 0,
14131
+ ...result.isError && { isError: true }
14132
+ };
14133
+ }
14127
14134
  return {
14128
14135
  content: [{ type: "text", text }],
14129
14136
  structuredContent: {
@@ -14760,15 +14767,16 @@ var App = class {
14760
14767
  */
14761
14768
  formatToolResult(result, instanceId, websocketUrl) {
14762
14769
  const text = result.text || JSON.stringify(result.data || {});
14770
+ const skipWidget = result.noWidget;
14763
14771
  const structuredContent = {
14764
14772
  ...result.data,
14765
14773
  ...result.title && { title: result.title },
14766
14774
  ...result.inlineHeight && { inlineHeight: result.inlineHeight },
14767
- ...instanceId && { instanceId },
14768
- ...websocketUrl && { websocketUrl }
14775
+ ...!skipWidget && instanceId && { instanceId },
14776
+ ...!skipWidget && websocketUrl && { websocketUrl }
14769
14777
  };
14770
14778
  const meta = {};
14771
- if (instanceId) {
14779
+ if (!skipWidget && instanceId) {
14772
14780
  meta["openai/widgetSessionId"] = instanceId;
14773
14781
  }
14774
14782
  return {