@superatomai/sdk-node 0.0.53 → 0.0.55

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.d.mts CHANGED
@@ -70,7 +70,7 @@ declare class Logger {
70
70
  /**
71
71
  * Log LLM method prompts with clear labeling
72
72
  */
73
- logLLMPrompt(methodName: string, promptType: 'system' | 'user', content: string): void;
73
+ logLLMPrompt(methodName: string, promptType: 'system' | 'user', content: string | object | any[]): void;
74
74
  }
75
75
  declare const logger: Logger;
76
76
 
package/dist/index.d.ts CHANGED
@@ -70,7 +70,7 @@ declare class Logger {
70
70
  /**
71
71
  * Log LLM method prompts with clear labeling
72
72
  */
73
- logLLMPrompt(methodName: string, promptType: 'system' | 'user', content: string): void;
73
+ logLLMPrompt(methodName: string, promptType: 'system' | 'user', content: string | object | any[]): void;
74
74
  }
75
75
  declare const logger: Logger;
76
76
 
package/dist/index.js CHANGED
@@ -153,7 +153,22 @@ ${"#".repeat(80)}
153
153
  ${"#".repeat(80)}
154
154
  `;
155
155
  LOGSTREAM.write(header);
156
- LOGSTREAM.write(content);
156
+ let contentStr;
157
+ if (typeof content === "string") {
158
+ contentStr = content;
159
+ } else if (Array.isArray(content)) {
160
+ contentStr = content.map((item) => {
161
+ if (typeof item === "string") return item;
162
+ if (item.text) return item.text;
163
+ if (item.content) return typeof item.content === "string" ? item.content : JSON.stringify(item.content, null, 2);
164
+ return JSON.stringify(item, null, 2);
165
+ }).join("\n\n");
166
+ } else if (typeof content === "object") {
167
+ contentStr = JSON.stringify(content, null, 2);
168
+ } else {
169
+ contentStr = String(content);
170
+ }
171
+ LOGSTREAM.write(contentStr);
157
172
  LOGSTREAM.write(`
158
173
  ${"#".repeat(80)}
159
174
 
@@ -5390,6 +5405,19 @@ var LLM = class {
5390
5405
  // src/userResponse/base-llm.ts
5391
5406
  init_logger();
5392
5407
 
5408
+ // src/utils/datetime.ts
5409
+ function getCurrentDateTimeForPrompt() {
5410
+ return (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
5411
+ weekday: "long",
5412
+ year: "numeric",
5413
+ month: "long",
5414
+ day: "numeric",
5415
+ hour: "2-digit",
5416
+ minute: "2-digit",
5417
+ timeZoneName: "short"
5418
+ });
5419
+ }
5420
+
5393
5421
  // src/userResponse/knowledge-base.ts
5394
5422
  init_logger();
5395
5423
  var getKnowledgeBase = async ({
@@ -5870,7 +5898,8 @@ ${fieldsText}`;
5870
5898
  SCHEMA_DOC: schemaDoc,
5871
5899
  DATABASE_RULES: databaseRules,
5872
5900
  DEFERRED_TOOLS: deferredToolsText,
5873
- EXECUTED_TOOLS: executedToolsText
5901
+ EXECUTED_TOOLS: executedToolsText,
5902
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
5874
5903
  });
5875
5904
  logger.debug(`[${this.getProviderName()}] Loaded match-text-components prompts`);
5876
5905
  const systemPromptStr = Array.isArray(prompts.system) ? prompts.system.join("\n") : prompts.system;
@@ -6145,7 +6174,8 @@ ${executedToolsText}`);
6145
6174
  USER_PROMPT: userPrompt,
6146
6175
  CONVERSATION_HISTORY: conversationHistory || "No previous conversation",
6147
6176
  AVAILABLE_TOOLS: availableToolsDoc,
6148
- SCHEMA_DOC: schemaDoc || "No database schema available"
6177
+ SCHEMA_DOC: schemaDoc || "No database schema available",
6178
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
6149
6179
  });
6150
6180
  const systemPrompt = Array.isArray(prompts.system) ? prompts.system.join("\n") : prompts.system;
6151
6181
  const userPromptText = Array.isArray(prompts.user) ? prompts.user.join("\n") : prompts.user;
@@ -6212,7 +6242,8 @@ ${executedToolsText}`);
6212
6242
  COMPONENT_PROPS: JSON.stringify(component.props, null, 2),
6213
6243
  CACHED_TEXT_RESPONSE: cachedTextResponse || "No cached text response available",
6214
6244
  SCHEMA_DOC: schemaDoc || "No schema available",
6215
- DATABASE_RULES: databaseRules
6245
+ DATABASE_RULES: databaseRules,
6246
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
6216
6247
  });
6217
6248
  const result = await LLM.stream(
6218
6249
  {
@@ -6344,7 +6375,8 @@ ${executedToolsText}`);
6344
6375
  SCHEMA_DOC: schemaDoc,
6345
6376
  DATABASE_RULES: databaseRules,
6346
6377
  KNOWLEDGE_BASE_CONTEXT: knowledgeBaseContext || "No additional knowledge base context available.",
6347
- AVAILABLE_EXTERNAL_TOOLS: availableToolsDoc
6378
+ AVAILABLE_EXTERNAL_TOOLS: availableToolsDoc,
6379
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
6348
6380
  });
6349
6381
  const sysPrompt = Array.isArray(prompts.system) ? prompts.system.join("\n") : prompts.system;
6350
6382
  const usrPrompt = Array.isArray(prompts.user) ? prompts.user.join("\n") : prompts.user;
@@ -7025,6 +7057,8 @@ ${errorMsg}
7025
7057
  executionReason: t.executionReason || "",
7026
7058
  requiredFields: t.requiredFields || [],
7027
7059
  userProvidedData: t.userProvidedData || null,
7060
+ // CRITICAL: Include outputSchema from real tool for component config generation
7061
+ outputSchema: realTool?.outputSchema,
7028
7062
  fn: (() => {
7029
7063
  if (realTool) {
7030
7064
  logger.info(`[${this.getProviderName()}] Using real tool implementation for ${t.type}`);
@@ -7113,7 +7147,8 @@ ${errorMsg}
7113
7147
  ORIGINAL_USER_PROMPT: originalUserPrompt,
7114
7148
  COMPONENT_INFO: component_info,
7115
7149
  COMPONENT_DATA: component_data,
7116
- CONVERSATION_HISTORY: conversationHistory || "No previous conversation"
7150
+ CONVERSATION_HISTORY: conversationHistory || "No previous conversation",
7151
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
7117
7152
  });
7118
7153
  const result = await LLM.stream(
7119
7154
  {
@@ -11016,7 +11051,8 @@ async function pickComponentWithLLM(prompt, components, anthropicApiKey, groqApi
11016
11051
  AVAILABLE_COMPONENTS: availableComponentsText,
11017
11052
  SCHEMA_DOC: schemaDoc || "No database schema available",
11018
11053
  DATABASE_RULES: databaseRules,
11019
- AVAILABLE_TOOLS: availableToolsText
11054
+ AVAILABLE_TOOLS: availableToolsText,
11055
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
11020
11056
  });
11021
11057
  logger.debug("[DASH_COMP_REQ] Loaded dash-comp-picker prompts with schema and tools");
11022
11058
  const { apiKey, model } = getApiKeyAndModel(
@@ -11165,7 +11201,8 @@ async function createFilterWithLLM(prompt, components, existingComponents, anthr
11165
11201
  EXISTING_COMPONENTS: formatExistingComponentsForPrompt(existingComponents),
11166
11202
  SCHEMA_DOC: schemaDoc || "No database schema available",
11167
11203
  DATABASE_RULES: databaseRules,
11168
- AVAILABLE_TOOLS: formatToolsForPrompt(tools)
11204
+ AVAILABLE_TOOLS: formatToolsForPrompt(tools),
11205
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
11169
11206
  });
11170
11207
  logger.debug("[DASH_COMP_REQ:FILTER] Loaded dash-filter-picker prompts");
11171
11208
  const { apiKey, model } = getApiKeyAndModel(