@superatomai/sdk-node 0.0.54-dsp → 0.0.55-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/README.md +942 -942
- package/dist/index.d.mts +146 -0
- package/dist/index.d.ts +146 -0
- package/dist/index.js +319 -111
- package/dist/index.mjs +319 -111
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -852,6 +852,59 @@ interface RunTrace {
|
|
|
852
852
|
kind: string;
|
|
853
853
|
body: string;
|
|
854
854
|
}>;
|
|
855
|
+
/** This dispatch's `SourceToolInput.aggregation` ('raw' | 'pre-aggregate' | 'summary') — decides which AGGREGATION_MODE text this SourceAgent's own prompt got. */
|
|
856
|
+
aggregation?: string;
|
|
857
|
+
/** The exact DATABASE_RULES text this SourceAgent's own prompt got (promptLoader.loadDatabaseRulesForType). */
|
|
858
|
+
databaseRulesText?: string;
|
|
859
|
+
/** The exact ROW_LIMIT_SYNTAX text this SourceAgent's own prompt got. */
|
|
860
|
+
rowLimitSyntaxText?: string;
|
|
861
|
+
/** The exact SCHEMA_SEARCH_INSTRUCTIONS text this SourceAgent's own prompt got — the guidance, not the runtime searchSchemaLookups results above. */
|
|
862
|
+
schemaSearchInstructionsText?: string;
|
|
863
|
+
/** The literal tool definitions (query tool + search_schema tool, when offered) handed to this SourceAgent's own LLM.streamWithTools call. */
|
|
864
|
+
toolsSent?: any[];
|
|
865
|
+
/** This SourceAgent's own LLM.streamWithTools call config. */
|
|
866
|
+
callConfig?: {
|
|
867
|
+
model?: string;
|
|
868
|
+
maxTokens?: number;
|
|
869
|
+
temperature?: number;
|
|
870
|
+
maxIterations?: number;
|
|
871
|
+
};
|
|
872
|
+
/** The exact USER_ACCESS_CONTEXT text this SourceAgent's own prompt got — its own copy of the same value captured once at the turn level in userAccessContext. */
|
|
873
|
+
userAccessContextText?: string;
|
|
874
|
+
}>;
|
|
875
|
+
};
|
|
876
|
+
/**
|
|
877
|
+
* Concept-catalog activity this turn (see main-agent.ts's loadConceptCatalog /
|
|
878
|
+
* loadConceptInvariants / RESOLVE_CONCEPTS_TOOL_DEF). Parallel to
|
|
879
|
+
* `entityResolution` above. Absent/empty for a project with no concepts
|
|
880
|
+
* collection registered.
|
|
881
|
+
*/
|
|
882
|
+
concepts: {
|
|
883
|
+
/** The exact {{CONCEPT_CATALOG}} text injected into MainAgent's system prompt (names + aliases only — bodies come back via resolve_concepts). */
|
|
884
|
+
catalogText?: string;
|
|
885
|
+
/** The exact {{CONCEPT_INVARIANTS}} text injected into MainAgent's system prompt — always-on, never requested by the LLM. Distinct from the resolved-concept bodies below, which mix invariants and explicitly-resolved concepts together. */
|
|
886
|
+
invariantsText?: string;
|
|
887
|
+
/** One entry per resolve_concepts-driven resolution this turn — explicit tool calls, resolve_entities-triggered concept lookups, and (for the dashboard flow) its own concept tool. */
|
|
888
|
+
calls: Array<{
|
|
889
|
+
via: 'resolve_concepts' | 'resolve_entities' | 'dashboard-agent';
|
|
890
|
+
asked?: string[];
|
|
891
|
+
implied?: string[];
|
|
892
|
+
returned?: Array<{
|
|
893
|
+
kind: string;
|
|
894
|
+
name: string;
|
|
895
|
+
returns?: any;
|
|
896
|
+
definition: string;
|
|
897
|
+
viaRequires?: boolean;
|
|
898
|
+
}>;
|
|
899
|
+
viaFloor?: string[];
|
|
900
|
+
corrected?: Array<{
|
|
901
|
+
asked: string;
|
|
902
|
+
matched: string;
|
|
903
|
+
}>;
|
|
904
|
+
unmatched?: string[];
|
|
905
|
+
suggestions?: string[];
|
|
906
|
+
error?: string;
|
|
907
|
+
note?: string;
|
|
855
908
|
}>;
|
|
856
909
|
};
|
|
857
910
|
/** The script that produced this answer, if any. Null for a general (no-tool) answer. */
|
|
@@ -897,6 +950,10 @@ interface RunTrace {
|
|
|
897
950
|
activeScript: string;
|
|
898
951
|
/** Active bindings offered as edit candidates this turn. */
|
|
899
952
|
activeBindingCount: number;
|
|
953
|
+
/** This call's LLM.stream config. */
|
|
954
|
+
model?: string;
|
|
955
|
+
maxTokens?: number;
|
|
956
|
+
temperature?: number;
|
|
900
957
|
};
|
|
901
958
|
/**
|
|
902
959
|
* Everything that came back OUT — the LLM's raw answer plus what the
|
|
@@ -990,6 +1047,95 @@ interface RunTrace {
|
|
|
990
1047
|
* only because traces saved before this field existed won't have it.
|
|
991
1048
|
*/
|
|
992
1049
|
userAccessContext?: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* The exact per-user knowledge-base text injected into MainAgent's system
|
|
1052
|
+
* prompt (getUserKnowledgeBase's output, folded into KNOWLEDGE_BASE_CONTEXT
|
|
1053
|
+
* alongside the query-matched half already captured in kbNodes.query).
|
|
1054
|
+
* Captured separately because it's a distinct fetch with no node-level
|
|
1055
|
+
* structure to list, unlike kbNodes.
|
|
1056
|
+
*/
|
|
1057
|
+
userKbContext?: string;
|
|
1058
|
+
/** The literal tool definitions (source, direct, workflow, resolve_entities, resolve_concepts, write_script, execute_script, write_analysis, write_components — whichever were actually offered this turn) handed to MainAgent's LLM.streamWithTools call. */
|
|
1059
|
+
toolsSent?: any[];
|
|
1060
|
+
/** The exact {{DIRECT_TOOLS}} text injected into MainAgent's system prompt. */
|
|
1061
|
+
directToolsText?: string;
|
|
1062
|
+
/** The exact {{WORKFLOW_COMPONENTS}} text injected into MainAgent's system prompt. */
|
|
1063
|
+
workflowsText?: string;
|
|
1064
|
+
/** The exact {{SCRIPT_BODY_CONTRACT}} text injected into MainAgent's system prompt (promptLoader.loadScriptBodyContract). */
|
|
1065
|
+
scriptBodyContractText?: string;
|
|
1066
|
+
/**
|
|
1067
|
+
* Full edit-mode context as sent to MainAgent this turn — every EditContext
|
|
1068
|
+
* field, not just the instruction already folded into `script.reasoning`.
|
|
1069
|
+
* Null for a non-edit turn.
|
|
1070
|
+
*/
|
|
1071
|
+
editContext?: {
|
|
1072
|
+
recipeId?: string;
|
|
1073
|
+
parentName?: string;
|
|
1074
|
+
parentBody?: string;
|
|
1075
|
+
instruction?: string;
|
|
1076
|
+
lastResultColumns?: string[];
|
|
1077
|
+
parentParams?: string;
|
|
1078
|
+
} | null;
|
|
1079
|
+
/**
|
|
1080
|
+
* The fork-mode preamble as actually assembled and prepended to the user
|
|
1081
|
+
* prompt (agent-user-response.ts) — parentBody/gaps/modificationHint as
|
|
1082
|
+
* sent, plus the lineage fields also written to the script store separately
|
|
1083
|
+
* (parentRecipeId/forkDepth/forkReason). Null for a non-fork turn.
|
|
1084
|
+
*/
|
|
1085
|
+
forkContext?: {
|
|
1086
|
+
parentBody?: string;
|
|
1087
|
+
gaps?: string;
|
|
1088
|
+
modificationHint?: string;
|
|
1089
|
+
parentRecipeId?: string;
|
|
1090
|
+
forkDepth?: number;
|
|
1091
|
+
forkReason?: string;
|
|
1092
|
+
} | null;
|
|
1093
|
+
/** The write_analysis tool call's analysisBody argument this turn, when called. */
|
|
1094
|
+
writeAnalysisBody?: string;
|
|
1095
|
+
/** The write_components tool call's componentsBody argument this turn, when called. */
|
|
1096
|
+
writeComponentsBody?: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* Component-generation/re-authoring activity this turn — one entry per call
|
|
1099
|
+
* to `authorComponentsProgram` (script-component-generator.ts — the
|
|
1100
|
+
* display-edit path, reauthoring getComponents as a program),
|
|
1101
|
+
* `generateScriptComponents` (the script-replay fallback, spec/analysis-based
|
|
1102
|
+
* generation), or `summarizeToMarkdown` (its own small analysis-summary LLM
|
|
1103
|
+
* call, reached via `assembleComponentsFromSpecs`). A turn can hit more than
|
|
1104
|
+
* one of these across its fallback chain, so this is an array, not a
|
|
1105
|
+
* singleton — same pattern as `concepts.calls`/`entityResolution.calls`.
|
|
1106
|
+
*/
|
|
1107
|
+
componentGen: Array<{
|
|
1108
|
+
via: 'authorComponentsProgram' | 'generateScriptComponents' | 'summarizeToMarkdown';
|
|
1109
|
+
/** authorComponentsProgram only: the edit instruction driving the re-author. */
|
|
1110
|
+
instruction?: string;
|
|
1111
|
+
/** authorComponentsProgram only: the component body being revised, before this attempt. */
|
|
1112
|
+
currentBody?: string;
|
|
1113
|
+
/** Dataset shapes/schemas the LLM was shown (both generation paths, different derivation). */
|
|
1114
|
+
datasetShapes?: string;
|
|
1115
|
+
/** The component catalog text/list handed to the LLM. */
|
|
1116
|
+
componentCatalog?: string;
|
|
1117
|
+
/** generateScriptComponents only: source name(s) shown (SOURCE_NAME). */
|
|
1118
|
+
sourceName?: string;
|
|
1119
|
+
/** generateScriptComponents only: row count(s) shown (ROW_COUNT). */
|
|
1120
|
+
rowCount?: string;
|
|
1121
|
+
/** generateScriptComponents only: column descriptions text shown. */
|
|
1122
|
+
columnDescriptions?: string;
|
|
1123
|
+
/** generateScriptComponents/summarizeToMarkdown: the analysis text handed to the LLM. */
|
|
1124
|
+
analysisText?: string;
|
|
1125
|
+
/** This call's LLM config. */
|
|
1126
|
+
callConfig?: {
|
|
1127
|
+
model?: string;
|
|
1128
|
+
maxTokens?: number;
|
|
1129
|
+
temperature?: number;
|
|
1130
|
+
};
|
|
1131
|
+
/** authorComponentsProgram only: one entry per retry attempt — the feedback fed back in and the raw response for that attempt, in order. */
|
|
1132
|
+
attempts?: Array<{
|
|
1133
|
+
feedback?: string;
|
|
1134
|
+
rawResponse?: string;
|
|
1135
|
+
}>;
|
|
1136
|
+
/** The final raw LLM response text for this call (last attempt, for authorComponentsProgram's retry loop; the single response otherwise). */
|
|
1137
|
+
rawResponse?: string;
|
|
1138
|
+
}>;
|
|
993
1139
|
}
|
|
994
1140
|
/**
|
|
995
1141
|
* Configuration for the multi-agent system.
|
package/dist/index.d.ts
CHANGED
|
@@ -852,6 +852,59 @@ interface RunTrace {
|
|
|
852
852
|
kind: string;
|
|
853
853
|
body: string;
|
|
854
854
|
}>;
|
|
855
|
+
/** This dispatch's `SourceToolInput.aggregation` ('raw' | 'pre-aggregate' | 'summary') — decides which AGGREGATION_MODE text this SourceAgent's own prompt got. */
|
|
856
|
+
aggregation?: string;
|
|
857
|
+
/** The exact DATABASE_RULES text this SourceAgent's own prompt got (promptLoader.loadDatabaseRulesForType). */
|
|
858
|
+
databaseRulesText?: string;
|
|
859
|
+
/** The exact ROW_LIMIT_SYNTAX text this SourceAgent's own prompt got. */
|
|
860
|
+
rowLimitSyntaxText?: string;
|
|
861
|
+
/** The exact SCHEMA_SEARCH_INSTRUCTIONS text this SourceAgent's own prompt got — the guidance, not the runtime searchSchemaLookups results above. */
|
|
862
|
+
schemaSearchInstructionsText?: string;
|
|
863
|
+
/** The literal tool definitions (query tool + search_schema tool, when offered) handed to this SourceAgent's own LLM.streamWithTools call. */
|
|
864
|
+
toolsSent?: any[];
|
|
865
|
+
/** This SourceAgent's own LLM.streamWithTools call config. */
|
|
866
|
+
callConfig?: {
|
|
867
|
+
model?: string;
|
|
868
|
+
maxTokens?: number;
|
|
869
|
+
temperature?: number;
|
|
870
|
+
maxIterations?: number;
|
|
871
|
+
};
|
|
872
|
+
/** The exact USER_ACCESS_CONTEXT text this SourceAgent's own prompt got — its own copy of the same value captured once at the turn level in userAccessContext. */
|
|
873
|
+
userAccessContextText?: string;
|
|
874
|
+
}>;
|
|
875
|
+
};
|
|
876
|
+
/**
|
|
877
|
+
* Concept-catalog activity this turn (see main-agent.ts's loadConceptCatalog /
|
|
878
|
+
* loadConceptInvariants / RESOLVE_CONCEPTS_TOOL_DEF). Parallel to
|
|
879
|
+
* `entityResolution` above. Absent/empty for a project with no concepts
|
|
880
|
+
* collection registered.
|
|
881
|
+
*/
|
|
882
|
+
concepts: {
|
|
883
|
+
/** The exact {{CONCEPT_CATALOG}} text injected into MainAgent's system prompt (names + aliases only — bodies come back via resolve_concepts). */
|
|
884
|
+
catalogText?: string;
|
|
885
|
+
/** The exact {{CONCEPT_INVARIANTS}} text injected into MainAgent's system prompt — always-on, never requested by the LLM. Distinct from the resolved-concept bodies below, which mix invariants and explicitly-resolved concepts together. */
|
|
886
|
+
invariantsText?: string;
|
|
887
|
+
/** One entry per resolve_concepts-driven resolution this turn — explicit tool calls, resolve_entities-triggered concept lookups, and (for the dashboard flow) its own concept tool. */
|
|
888
|
+
calls: Array<{
|
|
889
|
+
via: 'resolve_concepts' | 'resolve_entities' | 'dashboard-agent';
|
|
890
|
+
asked?: string[];
|
|
891
|
+
implied?: string[];
|
|
892
|
+
returned?: Array<{
|
|
893
|
+
kind: string;
|
|
894
|
+
name: string;
|
|
895
|
+
returns?: any;
|
|
896
|
+
definition: string;
|
|
897
|
+
viaRequires?: boolean;
|
|
898
|
+
}>;
|
|
899
|
+
viaFloor?: string[];
|
|
900
|
+
corrected?: Array<{
|
|
901
|
+
asked: string;
|
|
902
|
+
matched: string;
|
|
903
|
+
}>;
|
|
904
|
+
unmatched?: string[];
|
|
905
|
+
suggestions?: string[];
|
|
906
|
+
error?: string;
|
|
907
|
+
note?: string;
|
|
855
908
|
}>;
|
|
856
909
|
};
|
|
857
910
|
/** The script that produced this answer, if any. Null for a general (no-tool) answer. */
|
|
@@ -897,6 +950,10 @@ interface RunTrace {
|
|
|
897
950
|
activeScript: string;
|
|
898
951
|
/** Active bindings offered as edit candidates this turn. */
|
|
899
952
|
activeBindingCount: number;
|
|
953
|
+
/** This call's LLM.stream config. */
|
|
954
|
+
model?: string;
|
|
955
|
+
maxTokens?: number;
|
|
956
|
+
temperature?: number;
|
|
900
957
|
};
|
|
901
958
|
/**
|
|
902
959
|
* Everything that came back OUT — the LLM's raw answer plus what the
|
|
@@ -990,6 +1047,95 @@ interface RunTrace {
|
|
|
990
1047
|
* only because traces saved before this field existed won't have it.
|
|
991
1048
|
*/
|
|
992
1049
|
userAccessContext?: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* The exact per-user knowledge-base text injected into MainAgent's system
|
|
1052
|
+
* prompt (getUserKnowledgeBase's output, folded into KNOWLEDGE_BASE_CONTEXT
|
|
1053
|
+
* alongside the query-matched half already captured in kbNodes.query).
|
|
1054
|
+
* Captured separately because it's a distinct fetch with no node-level
|
|
1055
|
+
* structure to list, unlike kbNodes.
|
|
1056
|
+
*/
|
|
1057
|
+
userKbContext?: string;
|
|
1058
|
+
/** The literal tool definitions (source, direct, workflow, resolve_entities, resolve_concepts, write_script, execute_script, write_analysis, write_components — whichever were actually offered this turn) handed to MainAgent's LLM.streamWithTools call. */
|
|
1059
|
+
toolsSent?: any[];
|
|
1060
|
+
/** The exact {{DIRECT_TOOLS}} text injected into MainAgent's system prompt. */
|
|
1061
|
+
directToolsText?: string;
|
|
1062
|
+
/** The exact {{WORKFLOW_COMPONENTS}} text injected into MainAgent's system prompt. */
|
|
1063
|
+
workflowsText?: string;
|
|
1064
|
+
/** The exact {{SCRIPT_BODY_CONTRACT}} text injected into MainAgent's system prompt (promptLoader.loadScriptBodyContract). */
|
|
1065
|
+
scriptBodyContractText?: string;
|
|
1066
|
+
/**
|
|
1067
|
+
* Full edit-mode context as sent to MainAgent this turn — every EditContext
|
|
1068
|
+
* field, not just the instruction already folded into `script.reasoning`.
|
|
1069
|
+
* Null for a non-edit turn.
|
|
1070
|
+
*/
|
|
1071
|
+
editContext?: {
|
|
1072
|
+
recipeId?: string;
|
|
1073
|
+
parentName?: string;
|
|
1074
|
+
parentBody?: string;
|
|
1075
|
+
instruction?: string;
|
|
1076
|
+
lastResultColumns?: string[];
|
|
1077
|
+
parentParams?: string;
|
|
1078
|
+
} | null;
|
|
1079
|
+
/**
|
|
1080
|
+
* The fork-mode preamble as actually assembled and prepended to the user
|
|
1081
|
+
* prompt (agent-user-response.ts) — parentBody/gaps/modificationHint as
|
|
1082
|
+
* sent, plus the lineage fields also written to the script store separately
|
|
1083
|
+
* (parentRecipeId/forkDepth/forkReason). Null for a non-fork turn.
|
|
1084
|
+
*/
|
|
1085
|
+
forkContext?: {
|
|
1086
|
+
parentBody?: string;
|
|
1087
|
+
gaps?: string;
|
|
1088
|
+
modificationHint?: string;
|
|
1089
|
+
parentRecipeId?: string;
|
|
1090
|
+
forkDepth?: number;
|
|
1091
|
+
forkReason?: string;
|
|
1092
|
+
} | null;
|
|
1093
|
+
/** The write_analysis tool call's analysisBody argument this turn, when called. */
|
|
1094
|
+
writeAnalysisBody?: string;
|
|
1095
|
+
/** The write_components tool call's componentsBody argument this turn, when called. */
|
|
1096
|
+
writeComponentsBody?: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* Component-generation/re-authoring activity this turn — one entry per call
|
|
1099
|
+
* to `authorComponentsProgram` (script-component-generator.ts — the
|
|
1100
|
+
* display-edit path, reauthoring getComponents as a program),
|
|
1101
|
+
* `generateScriptComponents` (the script-replay fallback, spec/analysis-based
|
|
1102
|
+
* generation), or `summarizeToMarkdown` (its own small analysis-summary LLM
|
|
1103
|
+
* call, reached via `assembleComponentsFromSpecs`). A turn can hit more than
|
|
1104
|
+
* one of these across its fallback chain, so this is an array, not a
|
|
1105
|
+
* singleton — same pattern as `concepts.calls`/`entityResolution.calls`.
|
|
1106
|
+
*/
|
|
1107
|
+
componentGen: Array<{
|
|
1108
|
+
via: 'authorComponentsProgram' | 'generateScriptComponents' | 'summarizeToMarkdown';
|
|
1109
|
+
/** authorComponentsProgram only: the edit instruction driving the re-author. */
|
|
1110
|
+
instruction?: string;
|
|
1111
|
+
/** authorComponentsProgram only: the component body being revised, before this attempt. */
|
|
1112
|
+
currentBody?: string;
|
|
1113
|
+
/** Dataset shapes/schemas the LLM was shown (both generation paths, different derivation). */
|
|
1114
|
+
datasetShapes?: string;
|
|
1115
|
+
/** The component catalog text/list handed to the LLM. */
|
|
1116
|
+
componentCatalog?: string;
|
|
1117
|
+
/** generateScriptComponents only: source name(s) shown (SOURCE_NAME). */
|
|
1118
|
+
sourceName?: string;
|
|
1119
|
+
/** generateScriptComponents only: row count(s) shown (ROW_COUNT). */
|
|
1120
|
+
rowCount?: string;
|
|
1121
|
+
/** generateScriptComponents only: column descriptions text shown. */
|
|
1122
|
+
columnDescriptions?: string;
|
|
1123
|
+
/** generateScriptComponents/summarizeToMarkdown: the analysis text handed to the LLM. */
|
|
1124
|
+
analysisText?: string;
|
|
1125
|
+
/** This call's LLM config. */
|
|
1126
|
+
callConfig?: {
|
|
1127
|
+
model?: string;
|
|
1128
|
+
maxTokens?: number;
|
|
1129
|
+
temperature?: number;
|
|
1130
|
+
};
|
|
1131
|
+
/** authorComponentsProgram only: one entry per retry attempt — the feedback fed back in and the raw response for that attempt, in order. */
|
|
1132
|
+
attempts?: Array<{
|
|
1133
|
+
feedback?: string;
|
|
1134
|
+
rawResponse?: string;
|
|
1135
|
+
}>;
|
|
1136
|
+
/** The final raw LLM response text for this call (last attempt, for authorComponentsProgram's retry loop; the single response otherwise). */
|
|
1137
|
+
rawResponse?: string;
|
|
1138
|
+
}>;
|
|
993
1139
|
}
|
|
994
1140
|
/**
|
|
995
1141
|
* Configuration for the multi-agent system.
|