@superatomai/sdk-node 0.0.55-dsp → 0.0.56-dsp

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
@@ -395,6 +395,23 @@ interface ScriptMatch {
395
395
  * See backend/docs/SCRIPT-FLOW-IMPLEMENTATION.md § IPC Bridge.
396
396
  */
397
397
 
398
+ /**
399
+ * A name the user said, and what it resolved to.
400
+ *
401
+ * Handed to getAnalysis/getComponents so a narrative can NAME the thing the
402
+ * question was about without typing the name in. Before this, the runtime knew
403
+ * "Fusion5 Pty Ltd" and used that knowledge only to REJECT scripts that typed
404
+ * it — with no sanctioned way to obtain it, the only legal escape was to add a
405
+ * column to getData and re-run the query, spending an execute attempt to learn
406
+ * something the runtime already knew.
407
+ */
408
+ interface ResolvedEntityRef {
409
+ /** The text the user actually wrote. */
410
+ mention: string;
411
+ entityType: string;
412
+ instanceId: string;
413
+ displayName: string;
414
+ }
398
415
  /**
399
416
  * What getAnalysis returns. `analysis` is the narrative and `summary` the short
400
417
  * bullets the markdown block binds to — siblings over one dataset, never a
@@ -498,6 +515,19 @@ interface ExecutedToolInfo {
498
515
  /** Up to MAIN_AGENT_COMPLETE_ROWS rows — the complete result when small. */
499
516
  _mainAgentRows?: any[];
500
517
  };
518
+ /**
519
+ * THIS call's rows, at render size — deliberately a sibling of `result`, not a
520
+ * field inside it, because `result` is the object that gets picked apart for
521
+ * prompts (`_sampleData`, `_mainAgentRows`, `_summary`). Never put these in a
522
+ * prompt.
523
+ *
524
+ * Exists because a SourceAgentResult keeps only the LAST query's rows for a
525
+ * whole dispatch (see main-agent's "a follow-up query overwrites result.data"
526
+ * note). A component bound to an EARLIER query therefore rendered the later
527
+ * query's data — confirmed live: a revenue chart and a budget chart both drew
528
+ * budget, because both queries ran through one tool.
529
+ */
530
+ renderRows?: any[];
501
531
  outputSchema?: any;
502
532
  sourceSchema?: string;
503
533
  sourceType?: string;
@@ -2702,6 +2732,29 @@ interface ScriptStoreOptions {
2702
2732
  /** Project scope stamped on every row. */
2703
2733
  projectId?: string;
2704
2734
  }
2735
+ /**
2736
+ * Fingerprint of everything that decides what `getData` PRODUCES.
2737
+ *
2738
+ * A recipe holds three programs in one file — getData, getAnalysis,
2739
+ * getComponents — but only getData costs a source query, and only getData's
2740
+ * output can invalidate a verified run. Editing the narrative or a chart title
2741
+ * cannot change a single row, yet a whole-body comparison says it did, because
2742
+ * `write_script` resubmits the entire file. That is what made a cosmetic edit
2743
+ * indistinguishable from a SQL change and cost a scarce execute attempt.
2744
+ *
2745
+ * Parameters are part of the fingerprint, not an afterthought: `execute_script`
2746
+ * runs with `{}`, so the DEFAULTS are the values getData actually sees. Same
2747
+ * getData text with a changed default is a genuinely different result, and
2748
+ * hashing the body alone would have called it unchanged.
2749
+ *
2750
+ * Deliberately conservative — trimmed, not whitespace-collapsed. The two ways
2751
+ * to be wrong are NOT symmetric: a false "unchanged" reuses a stale result and
2752
+ * reports wrong numbers, while a false "changed" merely costs an attempt. So it
2753
+ * biases toward detecting change, and a reformat is allowed to look like an edit.
2754
+ */
2755
+ declare function dataFingerprint(scriptBody: string, parameters?: ScriptParameter[]): string;
2756
+ /** Inverse of `stripNamedExport` — pulls the named export block OUT instead of removing it. Null when absent. */
2757
+ declare function extractNamedExport(body: string, fnName: string): string | null;
2705
2758
  declare function normalizeScriptBody(scriptBody: string): string;
2706
2759
  declare class ScriptStore {
2707
2760
  private store;
@@ -5316,6 +5369,12 @@ interface RunScriptOptions {
5316
5369
  * caller is already unwinding, so the result is discarded).
5317
5370
  */
5318
5371
  signal?: AbortSignal;
5372
+ /**
5373
+ * Names resolved for this run, handed to getAnalysis/getComponents as their
5374
+ * 5th argument. Supplying these is what stops "the narrative needs the
5375
+ * subsidiary's name" from being a reason to rewrite getData and re-query.
5376
+ */
5377
+ entities?: ResolvedEntityRef[];
5319
5378
  }
5320
5379
  /**
5321
5380
  * Execute a recipe by spawning a tsx child on the script's .ts file.
@@ -5526,4 +5585,4 @@ declare class SuperatomSDK {
5526
5585
  getConversationSimilarityThreshold(): number;
5527
5586
  }
5528
5587
 
5529
- export { type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type CollectionHandler, type CollectionOperation, type DBUIBlock, DEFAULT_AGENT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type Harness, type HybridSearchOptions, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, type ModelStrategy, type OutputContract, type OutputField, type OutputValidator, type RerankedResult, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, SuperatomSDK, type SuperatomSDKConfig, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type WorkflowDescriptor, type Workspace, anthropicLLM, assertReadOnlySql, createCodexSession, createCodingAgentSession, dashboardConversationHistory, describeTriggers, emitAgentEvent, geminiLLM, getCodingAgent, getCodingAgentsConfig, groqLLM, hybridRerank, listCodingAgents, llmUsageLogger, logger, normalizeScriptBody, onAgentRun, openaiLLM, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, rerankChromaResults, rerankConversationResults, resolveScriptRecipeStore, runCodingAgent, runScript, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, writeBridgeShims };
5588
+ export { type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type CollectionHandler, type CollectionOperation, type DBUIBlock, DEFAULT_AGENT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type Harness, type HybridSearchOptions, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, type ModelStrategy, type OutputContract, type OutputField, type OutputValidator, type RerankedResult, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, SuperatomSDK, type SuperatomSDKConfig, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type WorkflowDescriptor, type Workspace, anthropicLLM, assertReadOnlySql, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeTriggers, emitAgentEvent, extractNamedExport, geminiLLM, getCodingAgent, getCodingAgentsConfig, groqLLM, hybridRerank, listCodingAgents, llmUsageLogger, logger, normalizeScriptBody, onAgentRun, openaiLLM, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, rerankChromaResults, rerankConversationResults, resolveScriptRecipeStore, runCodingAgent, runScript, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, writeBridgeShims };
package/dist/index.d.ts CHANGED
@@ -395,6 +395,23 @@ interface ScriptMatch {
395
395
  * See backend/docs/SCRIPT-FLOW-IMPLEMENTATION.md § IPC Bridge.
396
396
  */
397
397
 
398
+ /**
399
+ * A name the user said, and what it resolved to.
400
+ *
401
+ * Handed to getAnalysis/getComponents so a narrative can NAME the thing the
402
+ * question was about without typing the name in. Before this, the runtime knew
403
+ * "Fusion5 Pty Ltd" and used that knowledge only to REJECT scripts that typed
404
+ * it — with no sanctioned way to obtain it, the only legal escape was to add a
405
+ * column to getData and re-run the query, spending an execute attempt to learn
406
+ * something the runtime already knew.
407
+ */
408
+ interface ResolvedEntityRef {
409
+ /** The text the user actually wrote. */
410
+ mention: string;
411
+ entityType: string;
412
+ instanceId: string;
413
+ displayName: string;
414
+ }
398
415
  /**
399
416
  * What getAnalysis returns. `analysis` is the narrative and `summary` the short
400
417
  * bullets the markdown block binds to — siblings over one dataset, never a
@@ -498,6 +515,19 @@ interface ExecutedToolInfo {
498
515
  /** Up to MAIN_AGENT_COMPLETE_ROWS rows — the complete result when small. */
499
516
  _mainAgentRows?: any[];
500
517
  };
518
+ /**
519
+ * THIS call's rows, at render size — deliberately a sibling of `result`, not a
520
+ * field inside it, because `result` is the object that gets picked apart for
521
+ * prompts (`_sampleData`, `_mainAgentRows`, `_summary`). Never put these in a
522
+ * prompt.
523
+ *
524
+ * Exists because a SourceAgentResult keeps only the LAST query's rows for a
525
+ * whole dispatch (see main-agent's "a follow-up query overwrites result.data"
526
+ * note). A component bound to an EARLIER query therefore rendered the later
527
+ * query's data — confirmed live: a revenue chart and a budget chart both drew
528
+ * budget, because both queries ran through one tool.
529
+ */
530
+ renderRows?: any[];
501
531
  outputSchema?: any;
502
532
  sourceSchema?: string;
503
533
  sourceType?: string;
@@ -2702,6 +2732,29 @@ interface ScriptStoreOptions {
2702
2732
  /** Project scope stamped on every row. */
2703
2733
  projectId?: string;
2704
2734
  }
2735
+ /**
2736
+ * Fingerprint of everything that decides what `getData` PRODUCES.
2737
+ *
2738
+ * A recipe holds three programs in one file — getData, getAnalysis,
2739
+ * getComponents — but only getData costs a source query, and only getData's
2740
+ * output can invalidate a verified run. Editing the narrative or a chart title
2741
+ * cannot change a single row, yet a whole-body comparison says it did, because
2742
+ * `write_script` resubmits the entire file. That is what made a cosmetic edit
2743
+ * indistinguishable from a SQL change and cost a scarce execute attempt.
2744
+ *
2745
+ * Parameters are part of the fingerprint, not an afterthought: `execute_script`
2746
+ * runs with `{}`, so the DEFAULTS are the values getData actually sees. Same
2747
+ * getData text with a changed default is a genuinely different result, and
2748
+ * hashing the body alone would have called it unchanged.
2749
+ *
2750
+ * Deliberately conservative — trimmed, not whitespace-collapsed. The two ways
2751
+ * to be wrong are NOT symmetric: a false "unchanged" reuses a stale result and
2752
+ * reports wrong numbers, while a false "changed" merely costs an attempt. So it
2753
+ * biases toward detecting change, and a reformat is allowed to look like an edit.
2754
+ */
2755
+ declare function dataFingerprint(scriptBody: string, parameters?: ScriptParameter[]): string;
2756
+ /** Inverse of `stripNamedExport` — pulls the named export block OUT instead of removing it. Null when absent. */
2757
+ declare function extractNamedExport(body: string, fnName: string): string | null;
2705
2758
  declare function normalizeScriptBody(scriptBody: string): string;
2706
2759
  declare class ScriptStore {
2707
2760
  private store;
@@ -5316,6 +5369,12 @@ interface RunScriptOptions {
5316
5369
  * caller is already unwinding, so the result is discarded).
5317
5370
  */
5318
5371
  signal?: AbortSignal;
5372
+ /**
5373
+ * Names resolved for this run, handed to getAnalysis/getComponents as their
5374
+ * 5th argument. Supplying these is what stops "the narrative needs the
5375
+ * subsidiary's name" from being a reason to rewrite getData and re-query.
5376
+ */
5377
+ entities?: ResolvedEntityRef[];
5319
5378
  }
5320
5379
  /**
5321
5380
  * Execute a recipe by spawning a tsx child on the script's .ts file.
@@ -5526,4 +5585,4 @@ declare class SuperatomSDK {
5526
5585
  getConversationSimilarityThreshold(): number;
5527
5586
  }
5528
5587
 
5529
- export { type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type CollectionHandler, type CollectionOperation, type DBUIBlock, DEFAULT_AGENT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type Harness, type HybridSearchOptions, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, type ModelStrategy, type OutputContract, type OutputField, type OutputValidator, type RerankedResult, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, SuperatomSDK, type SuperatomSDKConfig, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type WorkflowDescriptor, type Workspace, anthropicLLM, assertReadOnlySql, createCodexSession, createCodingAgentSession, dashboardConversationHistory, describeTriggers, emitAgentEvent, geminiLLM, getCodingAgent, getCodingAgentsConfig, groqLLM, hybridRerank, listCodingAgents, llmUsageLogger, logger, normalizeScriptBody, onAgentRun, openaiLLM, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, rerankChromaResults, rerankConversationResults, resolveScriptRecipeStore, runCodingAgent, runScript, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, writeBridgeShims };
5588
+ export { type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type CollectionHandler, type CollectionOperation, type DBUIBlock, DEFAULT_AGENT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type Harness, type HybridSearchOptions, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, type ModelStrategy, type OutputContract, type OutputField, type OutputValidator, type RerankedResult, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, SuperatomSDK, type SuperatomSDKConfig, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type WorkflowDescriptor, type Workspace, anthropicLLM, assertReadOnlySql, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeTriggers, emitAgentEvent, extractNamedExport, geminiLLM, getCodingAgent, getCodingAgentsConfig, groqLLM, hybridRerank, listCodingAgents, llmUsageLogger, logger, normalizeScriptBody, onAgentRun, openaiLLM, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, rerankChromaResults, rerankConversationResults, resolveScriptRecipeStore, runCodingAgent, runScript, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, writeBridgeShims };